Skip to content

PC SETTINGS in the game's Options screen: video, cheats and save states with the pad - #111

Merged
boubou666 merged 1 commit into
mainfrom
claude/pc-settings-menu
Nov 26, 2026
Merged

boubou666 merged 1 commit into
mainfrom
claude/pc-settings-menu

Conversation

@boubou666

Copy link
Copy Markdown
Collaborator

The F2 settings, except the controls, are now reachable inside the game itself. A PC SETTINGS line is added under the game's Options screen. It opens pages drawn with the game's own font and sounds, steered with the pad:

  • Video:
    • Settings: display mode, resolution, render scale, frame rate, anti-aliasing, texture smoothing, texture upscaling and its filter, texture pack, pause in background, fast forward.
    • APPLY AND SAVE applies them and writes video.ini.
  • Cheats: unlock everything; infinite health, ammo and energy (off, player 1 or all players); no AI; weak enemies. Changes apply at once, as in F2's tab.
  • Save states: pick the slot, then LOAD or SAVE, the same as F5 / F7. The slot's picture is taken as with F5.

Up and Down choose a line, Left and Right change a value, Cross opens a page or acts, and Triangle or Circle goes back. The controls stay in F2.

How it hooks the game. The Options screen is uiOptions (0x1911F0); the details are in the header of runtime/tmb_menu.cpp.

  • uiGetInput's override, only for the Options page's own call, lets the cursor reach line 8.
    • Line 8 is safe: every other use of the cursor compares it with a line number, so 8 selects none of the game's lines.
    • Cross on line 8 opens the pages instead of triggering the game's accept-and-leave.
  • uiOptions' override draws the line after the game's page. While the pages are open, it draws them in the page's place.
    • The game's 3D shell stays behind them.
    • Its sliders are hidden with blankSliders, as the game's own Controls page does.
  • The game's font, input and sound functions are called on a copy of the context (BozoEngine kernel.md §3b), so guest code never leaves the override midway.
    • A first version called them on the thread's own context. fontSpritePrint could then leave at a checkpoint and later return into uiMain on the pages' stack, which crashed hidden runs after about 100 frames on a page.
  • The new code runs only where the graphics are native, which is every free run. The reference checker runs the game's own code.

Engine: BozoEngine moves to master 5d34d41. It brings #151's captureStatePicture, used for the Save states picture, plus the other ports' merges since f93b5af.

Checked:

  • All 11 native suites pass.
  • The 1P (9,500 frames) and 4P (8,500 frames) replays match main 89d5306 on every recorded field, the RAM image and the sound, both before and after the engine move.
  • The pinned boot check matches, and the pinned match1p check matches on all 16,000 frames.
  • Hidden window runs:
    • the line, Up from DIFFICULTY onto it, and Down off it;
    • every page;
    • render scale applied and saved to video.ini;
    • slot 0 saved (state and picture) and loaded;
    • 8,100 frames on the Video page with no fault.

Not checked: real controller input in a shown window.

🤖 Generated with Claude Code

…es with the pad

A ninth line under the game's Options (after SAVE SETTINGS TO MEMORY CARD)
opens pages drawn with the game's own font and steered with the pad:
- Video: display mode, resolution, render scale, frame rate, anti-aliasing,
  texture smoothing, upscaling and its filter, texture pack, pause in
  background, fast forward; APPLY AND SAVE posts them to the window and
  writes video.ini (bozo::app::video::post).
- Cheats: unlock everything, infinite health / ammo / energy (off, player 1,
  all players), no AI, weak enemies; at once (tmb::cheats::values /
  setValues, the F2 tab's switches).
- Save states: the slot, LOAD, SAVE (the host's requests, the slot's
  picture through BozoEngine's captureStatePicture, as F5 / F7).
Triangle or Circle goes back; the controls stay in F2.

runtime/tmb_menu.cpp, from the game's code (uiOptions 0x1911F0):
- uiGetInput's override (for the Options page's call, 0x19128C) lets the
  cursor (options_main_line) reach 8: every other use of the cursor is a
  compare, so 8 selects none of the game's lines. Cross there opens the
  pages instead of the game's accept-and-leave.
- uiOptions' override draws the line after the game's page and, while the
  pages are open, draws them instead (the 3D shell stays the game's, its
  sliders hidden by blankSliders as the controls page does).
- The game's font, sound and input functions run on a copy of the context
  (BozoEngine kernel.md section 3b): guest code there never leaves the
  override. Calling them on the thread's context let fontSpritePrint leave
  at a checkpoint and return later into uiMain on the pages' stack.
- Only where the graphics are native (every free run); a save state's load
  closes the pages.

BozoEngine at master 5d34d41 (#151's captureStatePicture, with the other
ports' merges since f93b5af).

Checked: the 11 native suites pass; the 1P (9,500) and 4P (8,500) replays
match main 89d5306 on every recorded field, RAM image and sound, before and
after the engine move; the pinned boot and match1p checks match (match1p
16000/16000 frames). Hidden window runs: the line, Up from DIFFICULTY onto
it and Down off it, each page, render scale applied and saved, slot 0
saved (state and picture) and loaded, and 8,100 frames on the Video page
without a fault.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boubou666
boubou666 merged commit 2a7eff7 into main Nov 26, 2026
8 checks passed
@boubou666
boubou666 deleted the claude/pc-settings-menu branch November 26, 2026 20:24
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