MAX DUO Pokémon Toolkit GitHub

Home / Reference

Findings, addresses and methods

This is the project's research in one place: what was measured on the real Action Replay MAX DUO, what was read out of the games and Datel's firmware, and how. Each section links to the full note in the technical library and the lab session where it was found. Addresses are as the GBA sees them unless stated. Nothing here contains Nintendo or Datel code; where a fact came from reading code offline, the note says so.

How we worked

  • Read-only first. Every early hardware experiment was a read-only lab script (maxduo_saves.py --lab) run on one real DUO, with its whole output kept in lab/. New behaviour was only ever tried after the simulator agreed.
  • An allow-list, not a blocklist. The PC tool only sends commands whose effect is known. Datel's DeleteFile (0x1C), its receive-file commands (0x0A, 0x0B, 0x25) and DS-card save commands (0x27) are refused outright. See Datel's commands.
  • Simulators built from the decompilations. The games' link code (pret's pokeruby, pokeemerald, pokefirered) was ported into Python models – the cable link layer, librfu and link_rfu_2 for wireless, the Mystery Gift client and server, the e-Reader protocol – so a program could be proven against the game before it met the game. See How testing works.
  • A hardware simulator. tests/hwsim.py and later the C core in virtual/core model the DUO's chips at bus level, cross-checked against each other with random bus programs.
  • The Virtual DUO. Real games in mGBA wired to the emulated DUO running the real Reckless firmware image. Every feature is rehearsed there and recorded – see Virtual DUO rehearsals.
  • Offline disassembly of Datel's 2005 PC program and firmware (for the USB protocol) and of the GameCube discs' embedded GBA programs (for the JOY Bus side), always on the user's own copies and never published.

The board (REF1662)

Part What it is What it does on the DUO
SST 39VF400A-70-4C-EK 512 KB NOR flash, x16, 4 KB sectors, ID BF/2780 Datel's program, the code database and stored saves
Actel eX256-F TQ100 "NDS_eX_01" Antifuse FPGA, 12k gates Swaps the DUO's program and the game cartridge in and out of the GBA's address space; overlays the header
Cypress CY7C63743-QXC enCoRe low-speed USB, 8 KB OTP, 256 B RAM, 8-byte endpoints The USB end; powered from USB, so it holds a packet with the console off

Teardown photos are on Hardware; the full note is MAX DUO hardware.

The GBA's memory map of the DUO

Address What's there
0x08000000–0x0807FFFF DUO flash (512 KB), mirrored once more up to 1 MB; open bus above
0x08030000–0x0803BFFF Datel's storage ("DATEL NDS1 V1.0") and directory records
0x08040000–0x0807FFFF Action Replay code database (256 KB)
0x08000020–0x0800009F Overlaid by the Actel in every mode and width: reads as zeros, except the mapping register
0x0800009C Mapping register (reads F0 0F at rest): 0x0120 = DUO program; 0x0101, 0x0007, 0x0001 = game
0x09FE0000–0x09FFFFFF DUO control area, including the byte-wide link to the USB chip
0x0E000000 The game's save chip, when the game is mapped (8-bit bus)

Inside Datel's firmware 1.06: boot routine 0x080073F4; screen table 0x0802AD80 (12-byte entries: enter, update, leave); go-to-screen 0x08000E30; USB server entry 0x08007648. Holding L at switch-on selects screen 7 (USB SERVER MODE). All Reckless code lives in empty padding inside Datel's image.

Inside the control area

First read offline from how Datel's firmware uses it, then measured on the real DUO in sessions 32–37 (28 November 2026; full note):

  • Only 0x09FE0000–0x09FE01FF is decoded. At rest it all reads 0 except 0x09FE0080 = 0x0FF0, LINK_IN and LINK_OUT; nothing there changes on its own. From 0x09FE0200 up every read is open bus (the address bits), with no mirrors.
  • 0x09FFE140 is not a readable register: the "0xF0A0" we recorded in October is simply open bus. Datel still writes 0x0FF0 to it.
  • LINK_IN (0x09FE01C0, also readable at 0x01C2): bits 0–7 a byte from the USB chip, bit 8 its strobe, bit 10 the AR button (System Test's "AR Button : DOWN"), bit 12 serial data in, bits 13–14 the AR switch, bit 15 high. It reads 0xF5xx at rest and never flickers (4,000 samples at full speed).
  • LINK_OUT (0x09FE01E0): bits 0–7 a byte to the USB chip, bit 8 the GBA's strobe, bits 10–12 a bit-banged SPI port (select, clock, data out) – almost certainly the DS card's save chip. It reads back as 0x0002, not the GBA's last write.
  • Four write-only slots (an address and a 16-bit value each, at 0x09FE0060–0x02E0) – our interpretation: the hardware behind Action Replay ROM patch codes. They read as open bus; what they do needs a write test.
  • Mapping 0x0067 opens a code window at 0x09FE0400 that Datel's in-game routines jump into before settling on 0x0007. With the DUO mapped the window reads as open bus.
  • With the game mapped (0x0101, 0x0007 or 0x0001) the whole control area reads as open bus: a running game cannot see the Action Replay's registers.

Datel's USB command table (0x080074A8) answers only 14 of the 38 command numbers at the top level; the checksum and acknowledgement codes (0x16, 0x18, 0x19, 0x1F) are read inside transfers, never dispatched. The analysers are described in Probes and analysers.

Save chip, flash and bus (sessions 32–37)

  • Sanyo save chip: it ignores the AA-55-F0 exit from ID mode (seven waits up to 0x40000) and obeys a lone F0. In ID mode it reads 62 13 00 00 repeating. ID mode and the selected bank survive remapping and a DUO restart; only power-cycling the cartridge resets them. (A stuck ID mode once made a cartridge report call a genuine Ruby a reproduction – both tools are fixed.)
  • Save bus: 8 bits wide (16-bit reads give each byte twice, 32-bit four times); the chip repeats every 64 KB up to 0x0FFFFFFF; it wakes on the first ROM read and stays awake while mapped (8 s idle), sleeping only on a remap.
  • DUO flash: 117 of 128 4 KB pages used, 8 blank (in Datel's storage), 3 zero; the mirror at 0x08080000 is a full copy except the mapping register (F0 0F vs 00 00). It reads correctly at all 16 ROM wait states.
  • Game ROM timing: 2-cycle first access flips a single bit (bit 1) in a few bytes of some pages, mostly repeatably; the games' own 0x4317 is clean.
  • Open bus: 8- and 16-bit reads return the address bits by halfword; a 32-bit read repeats the low halfword. Nothing else is mapped anywhere in the 32 MB cartridge space.
  • Ruby's ROM has data to ~6.75 MB and a second stretch at 13–14.7 MB, FF elsewhere to 16 MB.

Rules the hardware taught us

  1. USB strictly takes turns. One PC packet, then one GBA packet, then one PC packet. A second PC packet in a row is never delivered; a second GBA packet in a row hangs the GBA. Firmware v3 broke this and stalled; v3.1 fixed it (History).
  2. The save chip sleeps after every swap-in and answers only after any game-ROM read – one read anywhere wakes it (the wake read).
  3. The save bus is 8 bits wide. 16- and 32-bit reads return the byte repeated, so checksums must read byte by byte.
  4. The DUO has no Nintendo logo. It borrows the game's at power-on; a BIOS hard reset with no logo freezes, so restarts use the soft reset.
  5. Datel's start-up checks once for a waiting hello and goes straight to USB server mode. Reckless v4.1 waits for the PC's hello before restarting: 13 of 13 restarts landed in server mode.
  6. Game-ROM timing matters. Two-cycle first access corrupted reads on Ruby but not LeafGreen, so the tool uses each game's own wait states.

Speed: about 2.6 s fixed plus about 18 ms per 8-byte packet pair (≈9 ms each way). Run-length compression makes a near-empty bank take about 10 s and a 9-hour Pokémon save about 24 s per 64 KB bank. 21 consecutive backups of one cartridge were byte-identical.

The USB protocol

  • The chip: "Datel" / "GBA Link", USB 1.1, bus-powered (100 mA); interrupt IN every 10 ms, OUT every 1 ms. Asking for string descriptors it doesn't have can knock it off the bus (it re-enumerates by itself).
  • Timing (sessions 32, 36, 37): about 8 ms per packet each way, so a round trip with Reckless is ~16 ms; Datel's HELLO takes ~48 ms because Datel's main loop checks for packets only every few frames. 1,300 timed round trips and repeated long streams: no errors. A DUO restart answers again in 0.50 s.

  • USB ID 05FD:DAAE (InterAct), low-speed; interrupt OUT 0x02, IN 0x81.

  • Every message is 8 bytes: PC→DUO "CBW" + command + 32-bit LE argument; DUO→PC "SBW" + code + 32-bit value.
  • Datel's stored saves export as a 0xA8-byte header then chunks of [BE size, BE compressed size, escape byte, data], where escape, n, v means v repeated n+1 times.

Commands added by this project (in slots Datel answers "unknown"):

Cmd Since What it does
0x03 v1 Read the GBA save directly (with the wake read)
0x1E v3 Upload n bytes to staging; each packet answered 0x1F, the last with the CRC-32
0x07 v3 Run the staged program and stream its output
0x09 v3 Version: RK31, RK40 or RK42
0x21 v4 Restart (reply, wait for hello, soft reset)
0x23 v4.2 Run a program from RAM

Full detail, including the stream and staging formats: The MAX DUO's USB protocol.

Cartridge baselines

Game Code Rev Save-library tag at
Ruby AXVE 2 0x086B07AC
Sapphire AXPE 1 0x086B080C
FireRed BPRE 1 0x086FBF74
LeafGreen BPGE 1 0x086FB860

All four use 16 MB ROM chips, FF-padded, with open bus from 16 MB (Ruby: data to ~6.75 MB and again at 13–14.7 MB). Searching for the tag runs at about 1 s per MB; known games skip it.

Being a Wireless Adapter

Rather than needing a real adapter, the toolkit can make the DUO's GBA pretend to be the adapter to the game on the other end of a link cable. What it took (full note):

  • The ID exchange (librfu's SIO32 ID) runs at 256 kHz and worked on real hardware from the start (session 11).
  • Commands run at 2 MHz, and at that speed the game reads the first bit of each DUO answer from SO's resting level; the other 31 arrive intact (found with the probe command, lab session 12). The fix: load every answer with SO already at the word's top bit, and ignore the first bit of the game's own acknowledgement.
  • The ready flick. After a handshake the DUO must show "ready" (SO low) yet deliver a top bit of 1 when the clock starts. A ~0.25 µs flick was too narrow to cross the cable reliably, so the adapter program tunes the flick width itself and remembers the last width that worked (sessions 13–14).
  • Distributor serials. Japanese Emerald insists on 0x7F7F (found with --sweep-serial, session 19); English LeafGreen and the English decomps use 0x7F7D (RFU_SERIAL_WONDER_DISTRIBUTOR, session 23). librfu drops broadcast entries whose checksum (the complement of the sum) doesn't match.
  • After joining: the child's name over librfu's NI channel in 14-byte sub-frames, RFU_STATUS_JOIN_GROUP_OK (5), then link_rfu_2's UNI command table every frame with block commands 0x8800/0x8900.
  • Real adapters (late November): air_host drives a real adapter as the host (10,316 bytes, using 0x26 then 0x24 each frame); air_join joins a game as a child. Still open: the friend gift over the air – the game sends READY_CLOSE and the DUO never answers it.

Mystery Event (Ruby and Sapphire)

The e-Reader route (full note):

  • The game must be the cable master; the e-Reader (the DUO) is the slave. If the DUO comes up as player 0, the tool asks you to swap the cable ends.
  • Every link player must carry link type 0x5501, and the two languages must match.
  • Only a block over 256 bytes lands in the shared buffer (gSharedMem, 0x7D4 bytes); smaller ones go to gBlockRecvBuffer, so a short script is silently never run. Found on hardware in session 29 (a 212-byte trainer card left Mossdeep's door locked). The DUO now always sends the whole 2,004-byte buffer.
  • Proven on hardware: the Eon Ticket (session 26) and an Enigma Berry, the PUMKIN BERRY (session 27).

The real-time clock

Ruby, Sapphire and Emerald carry an RTC reached through the cartridge's GPIO pins at 0x080000C4 / C6 / C8 (data, direction, enable). A chip that has lost power answers with nonsense – one cartridge read back 2065-65-65 45:65:65. The clock setter now checks every field is valid BCD and in range, says "not answering (battery flat?)" instead of showing garbage, and reads the time back after setting it.

The GameCube's GBA programs (JOY Bus)

Colosseum and XD send small GBA programs over the GameCube–GBA cable. Read from their unpacked code and then driven in an emulator with a Python-scripted GameCube (full note, Colosseum bonus disc). Each command is a session keyed "TEST".

Pokémon Box's save protocol (reproduced end to end; Box reloads the new save):

Step Command What happens
status 0xAA, then reads 0xAA while loading, then the save counter (top half, e.g. 0x0A32 = save #2610) and the load result (0 fine, 1 half damaged, 2–4 other)
read keep reading The loaded save as big-endian words: SaveBlock2 (0x890) | SaveBlock1 (0x3AC0) | PC boxes (0x83D0), 0xC720 bytes
write 0xCC, (start << 16 | end), words Stored straight into the loaded save
save 0xEE, then reads Writes 14 sectors into the other flash half, all but one byte: 0x22 busy, 0x11 written, 0xFF failed
commit 0x99 Writes the last signature byte; only now does the new save count (0x44 abandons it)

That two-phase commit is the game's link save; leaving it out gives a save both the game and Box treat as damaged.

XD's battle program maxbtl: JOY handler 0x0200F928, state block J = 0x0202BB90, S2 = 0x0202B2D0; trainer snapshot 632 bytes from 0x0202A8C0 (0x99); rules word (0x77) at S2+0x888 (1 single, 2 double) and S2+0x889 (how many to choose); 1920-byte team block (0x88) into 0x0202AB40; the player's chosen order at 0x0202BB80.

Colosseum's battle program colbtl (the older build of maxbtl): JOY handler 0x0200D2B8, state block 0x02025090, S2 = 0x02024800. 0x77 rules at S2+0x858/0x859; 0x88 1920 bytes into 0x02024070, which opens "Please select 3 POKéMON"; chosen order left at 0x02025080 as nibbles; 0x55 the opponent's team as 100-byte GBA party records into 0x02022D94; 0x33/0x22 the GBA's 50-byte records from a header at 0x02025068. Its watchdog returns to the cartridge after 256 quiet frames.

XD trades were reproduced outside a GameCube too: a Jirachi traded into a save, counter 2610 → 2611, all 14 sections valid. A save without the National Pokédex is refused (status 0xFFFFFFFF; the check calls 0x02008C34 and tests flag 0x801).

How faithful the simulator is

Every recorded lab result – 136 runs from October to session 37 – has been replayed through the simulated DUO (Simulator accuracy). After the model was corrected with this month's measurements, 1,808 of 1,813 behaviour comparisons agree; the five that don't are 32-bit reads of open bus, which the test harness renders as memory. 31 of 46 tracked behaviours are now checked against hardware.

Open questions

  • Why the friend Mystery Gift over the air never closes (READY_CLOSE unanswered).
  • The Battle Tower's failures in the European Emerald builds (matrix).
  • What the four write-only slots, the 0x0067 window and the 0x0FF0 register do (needs a write test), and how the AR switch, AR button and DS card show on LINK_IN (needs someone at the console).
  • What maxbtl's 0x88/0x77 parameter-block reads are for, and which Box modes handle the Hall of Fame.

The working lists are in Hardware queue and Roadmap.