Datel Orbit mapper support#755
Open
ericlewis wants to merge 1 commit intoLIJI32:masterfrom
Open
Conversation
Author
|
happy to leave as a draft, since this may not really fit the normal shape of changes. excessive commenting is for the sake of those using / reviewing this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a new mapper,
GB_DATEL_ORBIT, covering Datel’s Game Boy Color cheat cartridges sold as GameShark Pro (US) and Action Replay Online / V4 (EU), addressing #461.These carts diverge from standard Nintendo behavior:
"Action Replay V4"title string)$7FE0–$7FE7$7000–$7FFFValidated against:
gsonline.gb, ~80 KB)Action Replay Online, ~128 KB)with
pokered.gbas the inserted cartMapper Model
Register Map
$7FE0$4000–$7FFF$7FE1$4000–$5FFF$7FE5bit 4$0000–$014Freads to inserted cart (logo/title/cart-type probe)$7FE6 = 7$7FEEbit 4Memory Overlay
$7000–$7FFF→ 4 KB internal SRAM$7FE0–$7FE7→ mapper registers (overrides SRAM region)$7FEE→ computed status (not backed by SRAM)Execution Model
This mapper behaves like a staged bootstrap:
$7FE5) to probe inserted cart$7FEE$7FE6 = 7) → swaps ROM + jumpsThis is not a traditional MBC. It’s a runtime ROM switch with partial bus forwarding.
Public API
Minimal surface, aligned to hardware behavior:
GB_load_passthrough_rom(gb, path)Loads the inserted cart. No-op on non-passthrough mappers.
GB_set_cart_menu_button(gb, pressed)Drives the physical switch:
GB_cart_start_game(gb)Deterministic handoff. Same endpoint as menu flow, but aligned to a frame boundary.
Test Harness
Flags:
--passthrough <rom>→ load inserted cart--cart-menu→ hold menu switch at boot--start-game→ scripted menu → handoff (frame-aligned)Results
--passthrough pokered.gb <cart>→ boots to title (US + EU)
--cart-menu --passthrough pokered.gb <cart>→ menu renders correctly
"Pokemon R&B 1FR""No Game Active"(firmware limitation)--start-game --passthrough pokered.gb <cart>→ stable menu → handoff → game boots
EU firmware prints:
"POKEMON game found / Please ensure that the switch is in the off position"→ confirms correct modeling of
$7FEEsemanticsKnown Residual Issues
Mid-frame Handoff Hazard
Organic flow (menu navigation → release switch) triggers handoff mid-frame.
Result:
$20B4Workaround:
--start-gameforces handoff on frame boundary → stableRoot cause is architectural: mapper does not synchronize with PPU state before ROM swap.
Unimplemented Features
Out of scope for mapper layer:
These require: