MAX DUO Pokémon Toolkit GitHub

Home / Evidence

Virtual DUO rehearsals

The Virtual DUO is the toolkit's dress rehearsal. Two GBAs run in one process (mGBA 0.10.5 with a 63-line cartridge-bus hook), joined by a link cable. One has the real game; the other has the DUO in its cartridge slot – a behavioural model of the board's three chips (SST flash, Actel switch, Cypress USB controller) in shared C, running the same Reckless firmware image that goes on the real device. The DUO's USB end is a TCP port, so the unchanged duo_events.py talks to it exactly as it talks to the hardware.

Nothing here replaces a hardware test, but it catches most mistakes before they cost an evening at the console: every feature on this page was rehearsed here first, and the ones marked Proven on hardware elsewhere then worked on a real DUO. The design is written up in full in the library: Virtual DUO (design), and the save generator that makes the test saves from a ROM alone in Save generator.

The recordings

Each video is cut straight from a rehearsal run: the left half is the game, the right half the emulated DUO's own screen and log. Saves are synthetic (made by the save generator; the trainer is TESTER). Game audio has been removed.

Highlights: one DUO, every link feature. (Virtual DUO recording, emulated; game audio removed)

Trading

Ruby trades with the DUO, which plays the other player and offers a Swellow. (Virtual DUO recording, emulated; game audio removed)

Record Mixing and Secret Bases

Record Mixing in Ruby: a Secret Base from the Record Workshop arrives in the game. (Virtual DUO recording, emulated; game audio removed)

Mystery Event

Ruby receives the Eon Ticket from the DUO by Mystery Event. (Virtual DUO recording, emulated; game audio removed)
A single battle in Ruby's Colosseum, the DUO as the opponent. (Virtual DUO recording, emulated; game audio removed)
A double battle: two of the DUO's Pokémon at once. (Virtual DUO recording, emulated; game audio removed)

Battle Tower

Emerald's Battle Tower multi battle with the DUO as the partner. (Virtual DUO recording, emulated; game audio removed)

Contests and the Berry Blender

An Emerald link contest with the DUO's entrants. (Virtual DUO recording, emulated; game audio removed)
The Berry Blender in Ruby, with the DUO spinning for the other players. (Virtual DUO recording, emulated; game audio removed)

The cross-language matrix

The rehearsals were then run against every cartridge language the save generator knows (English Ruby's seven; Emerald's ten; LeafGreen's three). Result of the last full run (toolkit at 86260ce):

Game Passed Failed Notes
Ruby (English) 7 0
Emerald (Japanese) 10 0
Emerald (Spanish) 9 1 Battle Tower, DUO as player 0
Emerald (English, USA/Europe) 8 2 Battle Tower, both seats
Emerald (German) 9 1 Battle Tower, DUO as player 1
Emerald (French) 9 1 Battle Tower, DUO as player 1
Emerald (Italian) 8 2 Battle Tower, both seats
LeafGreen (Japanese, German, Spanish, European English, French, Italian) 3 each 0

Everything except the Battle Tower passes in every language. The Tower's failures are why it is marked simulator on the features matrix: the Japanese build passes both seats, the other languages fail one or both, and the cause is still being worked on (see Battle Tower).

How a rehearsal works

  1. A save from nothing. virtual/savegen boots the ROM in the emulator and lets the game's own code write a new save, then walks it to the Cable Club (no copyrighted save is used or published).
  2. The DUO boots for real. The emulated DUO starts Datel's firmware with the Reckless patches, exactly as the hardware does – including the borrowed Nintendo logo and the USB SERVER MODE start.
  3. The toolkit drives it. The rehearsal script runs the same duo_events.py command a user would run, over the TCP stand-in for USB, with the same strict one-packet-each-way turn-taking.
  4. The game is checked, not just watched. Each rehearsal checks the outcome in the game itself (for example, that the traded Pokémon or the ticket really arrived) and fails if it didn't.

One correction to mGBA came out of this work: a master's START while the others aren't ready still transfers on real hardware, and the emulator now does the same. See the design notes.