MAX DUO Pokémon Toolkit GitHub

Home / How it works

How the wireless link works

Cable route (proven) GBA + DUOplays adapter + distributor GBA: the gamelibrfu, its own Mystery Gift MGB-010 cable, 2 MHz words Over the air (simulator; hardware tests 21-23) GBA + DUOplays the game side adapter adapter GBA: the gameits own Mystery Gift radio

The adapter, as librfu sees it

  1. ID exchange (Sio32ID): the game clocks 32-bit words at 256 kHz until both sides have spelled NINTENDO and the adapter has given its ID, 0x8001.
  2. Commands at 2 MHz: 0x9966LLCC and LL words from the game, then the adapter's answer 0x9966LL(CC+0x80) and its words. After every word both sides signal ready on their SO lines.
  3. The clock swap: after "send then wait" (0x25) or "wait" (0x27) the game becomes clock slave, and the adapter clocks a command back - 0x28 data ready, 0x27 nothing happened, 0x29 disconnected.
  4. Data: a parent's packets carry 3-byte-headed sub-frames, a child's 2-byte ones; NI for reliable transfers (names, cards), UNI for the per-frame command tables.

What real hardware taught (lab sessions 10-23)

Session Finding
10 a real Japanese Emerald accepts the DUO as adapter 0x8001
11-12 only the first bit of each 2 MHz answer arrives late; holding SO at the word's top bit fixes it (359/359)
13-17 the "ready" flick must briefly disarm; arming from resting high keeps SO high
18-19 Japanese Emerald's distributor serial is 0x7F7F, not the decomps' 0x7F7D; then every Mystery Gift step ran
20 the Old Sea Map arrives
23 English LeafGreen, serial 0x7F7D, the Aurora Ticket first time

Over the air

With real adapters the DUO's GBA plays the game side (librfu's master code), and the simulator gained an air model: each game with its own adapter, relaying broadcasts, joins and data one packet a frame each way. The swap timeout follows the game's 0x17 config (32 frames for Emerald). Wireless Adapter.

Full detail: docs/WIRELESS.md, docs/DISTRIBUTOR.md, docs/WIRELESS_HOST.md.