Skip to content

Pokémon Violet: profile, Bluetooth stubs, Nintendo controller mapping - #415

Open
peachtaozhutou wants to merge 1 commit into
seedds:mainfrom
peachtaozhutou:pokemon-violet
Open

peachtaozhutou wants to merge 1 commit into
seedds:mainfrom
peachtaozhutou:pokemon-violet

Conversation

@peachtaozhutou

Copy link
Copy Markdown

Adds a game profile for Pokémon Violet (update 3.0.1, v720896) and the two host changes it needs.

Profile (dm/games/01008F6008C5E000/, note + table row): SDK 13.3.13, Game Freak's Trinity engine, 35,937 shaders
(35,897 BNSH in arc/data.trpfs decoded with the game's own Oodle, 40 in main) and 28,299 variation pairs. On an M4 Pro
it boots to the frame loop at 30 fps, 28 draws a frame, 0.2 ms of GPU a present.

Bluetooth (dm/host/hle_offline.c): Violet initializes the Bluetooth stack at boot for its Pokémon GO Plus+ link.
The SDK's btm::user::InitializeBtmUserInterface aborts when btm:u cannot hand out an IBtmUserCore object, which a
host session cannot supply. The two init entry points and the six nn::bluetooth::AcquireBle*Event functions become
no-ops, with the events bound to kernel events that never fire (the game only acquires them at boot).

Nintendo controller mapping (dm/host/front_mac.m): macOS reports a Switch pad's buttons by Nintendo's names, so the
position mapping swapped A/B and X/Y on a Switch Pro Controller. A pad whose vendor name or product category says
Nintendo now passes through; Xbox-style pads keep the position mapping. DM_PAD_NINTENDO=1|0 overrides the choice.

Testing

Tested on a Mac (M4 Pro, macOS 26.6): boots to the frame loop, 30 fps, audio and controller input work, A/B and X/Y are
correct on a Switch Pro Controller, no crash. The language screen, the opening and save creation have not been walked
yet, so the profile stays out of the README gallery until there is a gameplay screenshot.

Mac only for now

StandardAllocator::Initialize(nullptr, 0x300000000) (12 GB, the same call as in Z-A) does not fit the 5 GB layout:
CentralHeap::Init fails and the SDK aborts. The profile widens the guest block to 20 GB (14 GB alias) instead of cutting
the request, because finding the SDK 13 node area for Z-A's cuts would have taken longer than the bring-up. An iPhone
cannot reserve 20 GB, so this needs Z-A's allocator and node-area cuts before it can run there; the note says so.

One red line remains (image atomics on a block-linear texture, texture 302) and goes to the existing scratch-buffer
path; it has not been traced to a visible artifact.

Update 3.0.1 (v720896) over the base game, SDK 13.3.13, Game Freak's Trinity
engine. Boots to the frame loop at 30 fps on the Mac with 35,937 shaders and
28,299 variation pairs. The 12 GB StandardAllocator request needs a 20 GB guest
block, so this profile is Mac only for now: an iPhone cannot reserve it, and the
Z-A cuts have not been made.

The Bluetooth stubs and the Nintendo controller mapping it needs are in the
branch's other two commits.
@peachtaozhutou

Copy link
Copy Markdown
Author

Testing notes from the 3.0.1 build (2K shadow crash in the map screen, the community 60 fps patch's physics, and where cheat loading lives in MacNativeGames) are in #436.

@Serendipper

Serendipper commented Oct 27, 2026 •

Copy link
Copy Markdown

Tested the Nintendo face-button mapping from this PR (front_mac.m only) on a Mac with Pokémon Scarlet 4.0.0 (#470 on current main).

  • Controller: a Pro-compatible pad over Bluetooth. GameController reports it as vendor Pro Controller, product category Switch Pro Controller, and pad_nintendo() matches it through the product category.
  • Probe result: a GameController probe logged each press. The buttons printed A, B, X and Y arrive as buttonA, buttonB, buttonX and buttonY (localizedName "A Button" and so on). The position mapping on main swaps them, and this PR passes them through correctly.
  • In game: A confirms, B goes back, and X/Y match.
  • Device: Apple M4, macOS 27.0.1.

This pad also has a separate problem: GameController reports its thumbsticks as stuck at 0. It isn't related to this mapping; the details are in a comment on #382. #470 now carries this PR's face-button mapping with you credited as co-author, together with a raw-HID fallback for the sticks, because Scarlet needs both for this pad.

🤖 Generated with Claude Code

Serendipper added a commit to Serendipper/nxnative that referenced this pull request Oct 27, 2026
…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]>
@jthrilly

jthrilly commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Hi @peachtaozhutou, a heads-up that #269 also adds Pokémon Violet (01008F6008C5E000). A quick comparison:

#269 doesn't have your Nintendo controller passthrough in front_mac.m, and it looks useful on its own. It would probably fit best as a separate PR on top of the per-player controller change (#504). Would you be OK closing this one in favour of #269? If there's anything here #269 is missing for 3.0.1, I'm happy to fold it in.

@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) mac The Mac front end and app (dm/mac, front_mac.m) docs Documentation game: 01008F6008C5E000 Pokémon Violet labels Nov 3, 2026
@seedds

seedds commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Design verdict: Partly superseded; keeping Violet 3.0.1’s distinct version scope open.

Should it exist? Partly: the game and shared Nintendo mapping are supported, but main does not register the 3.0.1 build proposed here.

Main’s dm/games/01008F6008C5E000/game.tsv registers base 1.0.0, while this PR supplies v720896 / main 709bfd66…. The original ABXY diagnosis and cross-PR confirmation are valuable; 90eca2f9 now implements mapping in the shared Apple controller path. The 20 GB guest-block expansion remains an explicitly Mac-only workaround, so this bundle is not ready unchanged. Review any required 3.0.1 data against current allocator/SDK rules; keep #436’s shadow/physics findings separate.

Review base: 82c354b0.

  • Confidence: High confidence in the source/history comparison; this triage adds no fresh gameplay validation.
  • Binding now / loosest correct: Partly: version/profile data is game/build-bound, mapping belongs to host, and SDK allocation layout belongs to sdk/engine. The fixed-build approach is not the loosest correct implementation.
  • Root cause or workaround? Workaround: widening the block to 20 GB avoids the allocator-size problem and excludes iOS; current shared allocator/SDK handling should be evaluated first.
  • Design from scratch? No as bundled: reuse the shared memory/controller paths and add only the required 3.0.1 profile data. Cost: current-build rewrite and gameplay verification.
  • 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 3.0.1 support: it is not justified to close that distinct build merely because v0 is playable.

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

Labels

docs Documentation game: 01008F6008C5E000 Pokémon Violet host The Horizon host: SVCs, services, threads, memory (dm/host) mac The Mac front end and app (dm/mac, front_mac.m)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants