Skip to content

fix: wrong label on game switcher entries w/o save state#751

Merged
frysee merged 1 commit into
mainfrom
fix-game-switcher-hint
May 27, 2026
Merged

fix: wrong label on game switcher entries w/o save state#751
frysee merged 1 commit into
mainfrom
fix-game-switcher-hint

Conversation

@frysee

@frysee frysee commented May 27, 2026

Copy link
Copy Markdown
Member

@frysee frysee enabled auto-merge (squash) May 27, 2026 21:39
@frysee frysee disabled auto-merge May 27, 2026 21:52
@frysee frysee merged commit 28b7a30 into main May 27, 2026
62 checks passed
@frysee frysee deleted the fix-game-switcher-hint branch May 27, 2026 21:52
carroarmato0 added a commit to carroarmato0/NextUI that referenced this pull request Jul 2, 2026
Brings the migration branch current with upstream (LoveRetro/NextUI). New
upstream work pulled in: white-point colour correction + displaycal for
tg5040 (LoveRetro#760), configurable font style and custom system fonts (LoveRetro#748/LoveRetro#729),
usb-c card detection before boot (LoveRetro#750), the game-switcher label fix for
entries without a save state (LoveRetro#751), readyResume on Quick Menu directory
nav (LoveRetro#739). Two upstream commits (LoveRetro#733 cpu governor, LoveRetro#728 Rewind_init) are
the same PRs our fork already carried under different SHAs; git merged them
cleanly with no duplicated logic.

Conflict resolution:

- nextui.cpp: upstream still edits the old nextui.c, which we renamed to
  .cpp. Git followed the rename. The one real conflict was the recent-game
  preview button hints -- upstream's LoveRetro#751 changed the logic (group 0 always
  BACK; group 1 shows "A OPEN" when there's no save state instead of
  RESUME/REMOVE). Took upstream's logic, kept our C++-friendly cast style.
- nextui.cpp: LoveRetro#739 added a readyResume call site into nextui.c using the old
  Array API (->count / ->items[]); rewrote it against std::vector to match
  the migrated container (top->entries[top->selected]).

Also fixes a latent const-correctness bug the full clean build surfaced:
the tg5040 device descriptor stores sysfs paths as const char*, but
getInt/putInt/putFile took char* -- so libbatmondb (which compiles
platform.c with -Werror=discarded-qualifiers) failed once its cached header
forced a platform.c recompile. Those helpers only read the path string, so
const-ifying the parameter is the correct fix.

Verified: full clean build green for both desktop and tg5040 (nextui,
minarch, settings).
carroarmato0 added a commit to carroarmato0/NextUI that referenced this pull request Jul 2, 2026
Every button-hint group was passed as GFX_blitButtonGroup((char**)(const
char*[]){ ... }, ...). That GNU compound-literal argument is miscompiled by
the toolchain's g++ 8.3 -- the callee reads garbage, the pill computes as
zero-width, and nothing draws. Result: no on-screen hints (RESUME/OPEN/BACK
/SLEEP...) anywhere in the launcher.

Confirmed on device by probing one call two ways in the same frame:

    named local array   -> ow = 259  (correct)
    compound literal     -> ow = 0    (miscompiled)

The pattern came in with the C->C++ port: the original C used (char*[]){...}
(fine as C); it was cast to satisfy g++, which exposed the codegen bug. Route
the hints through a named local array instead, via a small BTN_HINTS() macro
(statement expression), and apply it to all 11 call sites. Same behaviour,
correct codegen -- hints are back, and the game-switcher RESUME/OPEN split by
save-state (from the upstream LoveRetro#751 merge) now shows correctly too.
ArjunKdaf added a commit to ArjunKdaf/kUI that referenced this pull request Jul 2, 2026
- Platform pill moves from a fixed spot (55% of width) to right-anchored
  just left of the hardware tray, with a small gap. Tray growth (wifi/bt/
  clock/OSD) slides the pill left automatically. New api helpers:
  GFX_hardwareGroupWidth() (tray width as last drawn), GFX_makePlatformPill()
  and GFX_blitPlatformPill() (shared pill chrome, returns width used).
- Pill now also renders on the Game Switcher (selected recent's platform)
  and in minarch's in-game menu (TrimUI button) — same chrome, same anchor.
  Title pills in both shrink by the pill's width so long names can't run
  underneath.
- Game Switcher: "Y REMOVE" hint now always visible — the BTN_Y handler
  removes entries regardless of save state, but the hint vanished on
  entries without one (regression from absorbing upstream LoveRetro#751). A label
  still flips RESUME/OPEN on can_resume.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant