Skip to content

Pokémon Scarlet 4.0.0 (v786432): memory cuts, Bluetooth LE stub, union shader tables; Mac controller fixes - #470

Open
Serendipper wants to merge 2 commits into
seedds:mainfrom
Serendipper:scarlet-4.0.0
Open

Serendipper wants to merge 2 commits into
seedds:mainfrom
Serendipper:scarlet-4.0.0

Conversation

@Serendipper

@Serendipper Serendipper commented Oct 27, 2026 •

Copy link
Copy Markdown

What and why

Pokémon Scarlet's profile registered only 1.0.0, because the 4.0.0 update used for it had erased payload bytes (note, Files and builds). An intact v786432 dump extracts without --allow-damaged, so this registers 4.0.0:

  • Memory cuts at 4.0.0's addresses. main 421c5411… gets the 12 GB → 4 GB StandardAllocator cut at main+0x167d54c (patches.py). SDK 13.3.13 bb560bdf… gets 1.0.0's node-area and 32 MB alignment cuts, 0x620 bytes later (sdk_patches.py). All three are checked by disassembly.
  • Bluetooth LE answered without a service. At boot, 4.0.0 sets up the Pokémon GO Plus + link and aborts in InitializeBluetoothUserInterface. The new dm/host/hle_bluetooth.c reports that no accessory is present. The services.md entry describes it.
  • Shader tables. The tables are now the union of v0 and v786432 (39,216 shaders). The 30,142 shaders from 1.0.0 are unchanged, and the update adds 9,074.

Second commit: Mac controllers. Playing 4.0.0 with a Pro-compatible pad on Bluetooth turned up two problems in the Mac front end:

  • Face buttons: A/B and X/Y were swapped, because GameController names a Nintendo pad's buttons by Nintendo's letters. This commit takes Pokémon Violet: profile, Bluetooth stubs, Nintendo controller mapping #415's mapping by name (credited as co-author), confirmed with a GameController probe.
  • Sticks: the pad's thumbsticks never left 0 in GameController, even with no game running, so the left stick could not pass character creation. The raw 0x30 reports that motion_pro_mac.h already reads carry them. The front end now takes that player's sticks from the raw reports, but only after it sees raw movement while GameController reports all four axes at 0. Details are in Pro Controller sticks missing from GameController.

These are separate from the game profile, so I can split them into their own PR if you prefer; they overlap #415 and #382.

Overlap: the open Violet PRs #269 and #415 also stub nn::bluetooth, and #269 adds the same bb560bdf… SDK cuts, because Violet ships the same SDK. Whichever lands first, the other can drop its copy. #207 reports the same three startup failures on Violet 4.0.0.

Checked

  • Tests: these all pass:
    • all dm/tools/tests (unittest, as CI runs them)
    • make -C dm/host/tests GAME=0100A3D008C5C000 run
    • make -C dm/gfx/tests GAME=0100A3D008C5C000 run
  • Game run, 4.0.0 (v786432):
    • Fresh save under MTL_DEBUG_LAYER=1, using the note's route through the academy cutscene and the Bink movie to the standing player in the bedroom.
    • 600 s, frame 15,800. The only red diagnostic is conservative raster dilation, and there was no GPU fault.
    • Bedroom p50 is 33.4 ms; resident memory is about 5.0 GB.
  • 1.0.0 (v0): builds from the same folder with -p v0 and runs to frame 2,400 with no red diagnostic.
  • Controllers: a Pro-compatible pad over Bluetooth. A/B/X/Y act as printed, and both sticks work through the raw-report fallback.
  • Devices: Apple M4, macOS 27.0.1, Xcode 27.1.
  • Not checked:
    • iOS / an IPA.
    • Outdoor gameplay or battles.
    • Other games. The first commit changes no shared code except a new hle_*.c file that only hooks nn::bluetooth symbols. The controller commit changes the Mac front end for every game, but only for Nintendo pads, and the stick fallback only switches on when GameController's sticks are dead.
    • A genuine Pro Controller with the controller commit.

Docs

  • The finding is in its game note and in docs/reference/services.md, and python3 dm/tools/docs_symptoms.py was run.
  • A chain tool changed: not applicable.
  • No game files, keys or data extracted from a game in the change or the attachments. The shader tables hold content hashes and RomFS paths, as for every profile.

🤖 Generated with Claude Code

The profile registered only 1.0.0: the maintainer's 4.0.0 update had erased
payload bytes, so its shader split aborted and no cuts were registered. An
intact v786432 dump extracts without --allow-damaged and now builds and runs.

4.0.0 aborts at startup for the same two reasons as 1.0.0, at new addresses.
main 421c5411… asks StandardAllocator for 12 GB from main+0x167d554; the cut
at main+0x167d54c reserves 4 GB. SDK 13.3.13 (bb560bdf…) has 1.0.0's
AddressRegionManager code 0x620 bytes later; the 62 MB node area and 32 MB
alignment cuts go to sdk+0x37c760, +0x37c7fc and +0x37c95c. With only the
main cut, startup still aborts in CentralHeap's setup; with all three it
reaches nnMain.

4.0.0 then sets up Bluetooth LE for the Pokémon GO Plus + at boot
(main+0xa0b02c) and aborts in InitializeBluetoothUserInterface, because the
host has no bt / btm service. hle_bluetooth.c answers the nn::bluetooth entry
points that reach those services as if no accessory were present: events
bound and never fired, scans that find nothing, connections and GATT
operations that fail. A services.md entry describes it.

The shader tables are now the union of v0 and v786432: 39,216 shaders, the
30,142 of 1.0.0 unchanged plus 9,074 from the update; all compile for the Mac
with chain 157e1b96c8da.

Checked on an Apple M4, macOS 27.0.1: a fresh 4.0.0 save under
MTL_DEBUG_LAYER=1 follows the note's route through the academy cutscene and
the Bink movie to the standing player in the bedroom, 600 s / frame 15,800,
conservative raster dilation the only red diagnostic, bedroom p50 33.4 ms.
1.0.0 still builds from the same folder with -p v0 and runs to frame 2,400
with no red diagnostic. The Python tool tests, host tests and Metal graphics
tests pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ID when GameController has none

Found while playing Pokémon Scarlet 4.0.0 on the Mac with a Pro-compatible
pad over Bluetooth (vendor "Pro Controller", category "Switch Pro
Controller").

Face buttons: GameController names a Nintendo pad's face buttons by
Nintendo's letters, so the position mapping swapped A/B and X/Y. A probe
confirms the printed A, B, X and Y arrive as buttonA, buttonB, buttonX and
buttonY. A pad whose vendor name or product category names Nintendo, Switch
or Joy-Con now passes them through; DM_PAD_NINTENDO=1|0 forces the choice.
This is the mapping from seedds#415.

Sticks: the same pad's buttons, D-pad and motion come through
GameController, but its thumbsticks stay at 0, even in a standalone probe
with no game running. Its raw 0x30 reports carry them (12-bit, exactly 2048
at rest, 0 / 4095 at full tilt), so macOS likely rejects its calibration.
motion_pro_mac.h already reads those reports for motion and now decodes the
sticks too. Once the raw sticks pass half tilt while all four GameController
axes are 0, that player's sticks come from the raw reports (logged once). A
pad whose GameController sticks work never switches.

Checked: in Scarlet the left stick passes character creation and both sticks
and A/B/X/Y act as printed; host tests and the docs, env-switch and lint tool
tests pass. Reference entries in services.md, symptom index regenerated.

Co-authored-by: peachtaozhutou <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Serendipper Serendipper changed the title Pokémon Scarlet 4.0.0 (v786432): memory cuts, Bluetooth LE stub, union shader tables Pokémon Scarlet 4.0.0 (v786432): memory cuts, Bluetooth LE stub, union shader tables; Mac controller fixes Oct 27, 2026
@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) rewriter The NSO rewriter and per-build patches mac The Mac front end and app (dm/mac, front_mac.m) tools Tools and scripts (dm/tools, scripts) docs Documentation game: 0100A3D008C5C000 Pokémon Scarlet labels Nov 3, 2026
@seedds

seedds commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Design verdict: Partly superseded; keeping the unregistered Scarlet 4.0.0 support open.

Should it exist? Partly: shared controller mapping/Bluetooth work is covered, but Scarlet 4.0.0 support is not established by main’s 1.0.0 profile.

Main’s dm/games/0100A3D008C5C000/game.tsv still registers only v0; the note’s supplied 4.0.0 dump is damaged. This PR instead reports an intact v786432 dump, main 421c5411…, additional shaders and a 600-second run. Those version-specific facts remain distinct. Nintendo label mapping is already shared via 90eca2f9; the old copied frontend/Bluetooth implementations should not be reintroduced. The useful remaining scope is verifying and registering intact 4.0.0 against current shared mechanisms.

Review base: 82c354b0.

  • Confidence: High confidence in the source/history comparison; this triage adds no fresh gameplay validation.
  • Binding now / loosest correct: Partly: profile/build data remains game/build-bound; shared SDK/allocator and controller behavior should bind to sdk/engine/host. Fixed offsets must stay build-gated and cost another review at each update.
  • Root cause or workaround? Partly: a root-cause fix with older build-specific cuts; the current general allocator/SDK mechanisms must be checked before retaining those cuts.
  • Design from scratch? No as bundled: extend the existing profile and reuse current shared code. That costs a focused 4.0.0 rewrite/build/gameplay check.
  • Performance impact: None expected from this triage; only a reply/tracker-state update, with no code or shader change.
  • Regression level / games run: Low risk for this action. No games or regression suite run; source, diff, history and discussion review only.
  • Should we just leave it? Unknown for 4.0.0 support: main’s supported v0 should stay intact, and the distinct update proposal should remain visible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 0100A3D008C5C000 Pokémon Scarlet host The Horizon host: SVCs, services, threads, memory (dm/host) mac The Mac front end and app (dm/mac, front_mac.m) rewriter The NSO rewriter and per-build patches tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants