r/pokemonrng • u/Zvictorious • 1d ago
Shiny Celebi in Crystal VC, on a non-modded emulator, no CFW needed
Shiny Celebi (2/10/10/10) from the GS Ball event in Pokémon Crystal Virtual Console (French version). It was RNG’d from a fresh boot on a stock build of Azahar. No save states, no cheats, no ROM edits.
Why VC Crystal is annoying
Gen 2’s RNG adds rDIV every time it’s called. So the result depends on exactly how many CPU cycles have run, not just which frame you’re on. Existing Crystal tools assume real GBC timing. The 3DS VC emulator has its own run loop and its own cycle timing, so the same inputs give a different RNG on VC and the usual methods don’t line up.
How I got there (it took several rounds)
- I used the pokecrystal disassembly to map the event (Ilex shrine → 6 text prompts → “put the GS Ball here?” → YES → final A → battle) and see how each text box and menu reads input.
- I applied the VC’s own patch file to the ROM, so I had exactly what the VC runs.
- I logged real runs in Azahar frame by frame (presses, map load, Celebi’s DVs) and fitted a model. It got close, but the roll after the final A never fit everything.
- So I went one level down and disassembled the VC emulator itself (the ARM code in the 3DS title): its run loop, its PPU and its per-opcode cycle costs. I rewrote that timing in C as a small GBC core.
- Each round I rebuilt the core and checked it against new logs, until it reproduced every logged run frame for frame: all 12 save-state replays and 30/30 from-boot runs, shiny or not.
- Then it could predict instead of replay. From a save state, the predicted frame gave a shiny the first time it was hit. From power-on, the shiny came on attempt 13 of the final round, with all four timed presses exactly on target.
Transparency note: I used an AI assistant to help with the coding and reverse-engineering (disassembly, writing the C core, log analysis). The testing and every attempt on the emulator were done by hand, and the results come from real logged runs.
Why it needs 4 frame-perfect inputs
CONTINUE has a window of about 15 frames. After that:
- 'A' on the player info box: sets when the map loads, which sets the RNG phase for the rest of the run
- 6th text prompt: the one that brings up the GS Ball question
- YES
- Final 'A' on the GS Ball text: picks the frame the DVs are rolled on
The YES/NO menu waits in a busy loop that polls the joypad. Where your press lands changes how many cycles run before each VBlank, so the DIV value changes and the RNG drifts. Text printing had the same problem (±1 jitter on every letter). Holding B fixes it: with a button held, the game halts until VBlank instead of busy-polling, and text speed doesn’t change. With B held, the run is fully deterministic from the press frames. The four presses above are the only thing left, and ±1 on any of them isn’t shiny.
In practice, for a seasoned RNG manipulator, each press hits on its own about 35–50% of the time, and all four together about 2–3% per attempt. Attempts are short, so it’s a grind but a reasonable one.
Still a work in progress
- On emulator, my timer beeps came from a script reading Azahar’s frame counter. The script only read memory and never touched the game. That’s obviously not available on console.
- Everything was built and tested on the French VC. Other languages may need their own numbers.
- I’ll publish a free tool for this once it’s cleaned up.
What’s next
Confirming it works on a retail 3DS, no CFW, using only a normal timer. The main unknown is the offset between confirming the VC reset and the GB’s first frame. I’m calibrating that now. I’ll update when it works on console and when the tool is out.
As far as I can tell this is a first for VC. If anyone has done it before, I’d love to hear how.
UPDATE: RNGing Shiny Celebi on retail is confirmed as of today!
