Pokémon Emerald moving natively connected a $6 microcontroller — afloat game, 60 fps, HDMI out, existent buttons, saves that past a powerfulness cycle. No emulator: the pret decompilation is recompiled from ARMv4T to Cortex-M33 and the Game Boy Advance's video hardware is reimplemented in package connected the 2nd core.
Target committee is simply a WeAct Studio Core2350B (RP2350B, 16 MB QSPI flash). The whole crippled — code, graphics, maps, euphony — is an 11.7 MB image executed successful place from flash.
Playable commencement to decorativeness arsenic acold arsenic it has been tested — boots, plays the intro, starts a caller game, walks the overworld, battles, and saves. Every segment holds a locked 60 fps isolated from the OBJ-window intro cinematic. It is not a finished product; spot Limitations.
| Video | ✅ Full PPU: modes 0–4, affine, sprites, windows, blending. Byte-exact vs. reference. |
| Frame rate | ✅ Locked 60 fps, tear-free, vsync-locked to the scanout beam |
| Input | ✅ 10 GPIO buttons |
| Saves | ✅ Persist to QSPI flash, past reboot and reflash |
| Audio | ⚠️ Music plays; immoderate instrumentality classes silent (see below) |
| Link cablegram / RFU | ❌ Not implemented |
See docs/HARDWARE.md for the afloat pinout, measure of materials, and wiring notes. In brief: an RP2350B board, an HSTX-to-HDMI breakout wired successful the Pico DVI Sock pin order, 10 buttons to ground, and optionally a PCM5102A I²S DAC for sound.
See docs/BUILD.md for prerequisites and the afloat procedure. The short version, from the repo root:
rp2350/hw/CMakeLists.txt besides builds standalone bring-up targets that were used to validate each subsystem connected silicon earlier integration, and which are the fastest measurement to debug a caller board: hstx_test (colour bars), psram_test, i2s_test (440 Hz sine), display_test, ppu_display_test, emerald_hwtest.
The afloat engineering log — each phase, the measurements that made the go/no-go call, and the bugs that costs the astir clip — is in docs/PORTING.md. The short story:
It piggybacks connected a WASM port. tripplyons/pokeemerald-wasm had already fenced each dependency connected existent GBA hardware down #if WASM. Reusing those seams arsenic #if WASM || RP2350 meant the de-hardwaring activity was already done; this larboard only had to adhd the MCU-specific half.
The GBA representation representation survives. The crippled still writes DISPCNT, VRAM, OAM and palette RAM astatine their original addresses — those are conscionable plain SRAM now. Live RAM is ~378 KB of the RP2350's 520 KB. ROM lives successful QSPI flash via XIP, pinch the game's 0x08000000 guidelines remapped to 0x10000000.
The PPU is simply a package rasteriser connected halfway 1. Ported from the WASM host's web/app.js and validated byte-exact against it. The first moving type ran at 909 ms/frame; per-frame palette LUTs, per-scanline model masks, 8-pixel tile spans, and incremental affine stepping brought that to 60 fps — astir 45× faster. Specialised soul loops past trim emblematic scenes to ~12 ms.
Scanout needs nary CPU astatine all. A DMA control-block ringing feeds the HSTX serialiser a afloat 525-line framework pinch the CPU ne'er rubbing the re-arm path. The interrupt is advisory. This is what makes the show immune to the multi-millisecond stalls that flash writes origin during saves — and it took killing an ~0.8-blink-per-minute HDMI dropout to get there.
Honest database of what is stubbed, missing, aliases wrong:
- Audio is incomplete. The m4a motor is ported and euphony plays, but DPCM (compressed) and reverse-playback instruments are silent stubs. Mixing is coupled to the framework rate, truthful immoderate segment beneath 60 fps underruns. It has not had a observant by-ear correctness pass.
- No nexus cablegram aliases wireless. The RFU and multiboot paths are stubbed. Trading, battling, and the Mystery Gift download-code way do not work. (Mystery Gift's run-downloaded-code way relocates information arsenic Thumb code, which cannot activity connected an M33 arsenic written.)
- The RTC is simply a dormant cartridge clock. Real Emerald bit-bangs an RTC over cartridge GPIO, which does not beryllium here. Time sounds arsenic zero and the in-game clock-set surface reports "clock is stopped." Berry maturation and other time-of-day events are affected.
- The OBJ-window intro cinematic runs astatine 20–25 ms/frame, beneath 60 fps. It is the 1 segment pinch nary accelerated path.
- Audio hardware is optional but unpolished. Without the I²S DAC wired, the game runs silently and correctly.
This is simply a fork of pokeemerald-wasm, which is simply a fork of pret/pokeemerald. Almost everything present is upstream; the larboard is confined to 1 directory.
| rp2350/ | The port. PPU, HSTX show driver, BIOS calls, m4a engine, build scripts. |
| rp2350/hw/ | Pico SDK project: game_main.c, linker script, flash saves, I²S, trial targets. |
| docs/ | Hardware, build, and porting documentation. |
| src/, data/, graphics/, sound/ | Upstream pokeemerald crippled sources and assets. |
| web/, tools/wasm_* | The WASM build, kept arsenic the PPU reference (see below). |
The WASM build is deliberately retained. rp2350/ppu_validate.sh runs the game successful a browser, dumps GBA representation positive reference frames from the JavaScript rasteriser, renders the aforesaid authorities pinch rp2350/ppu.c, and pixel-diffs the two. That harness is the only logic the PPU tin beryllium called byte-exact, and it caught real bugs during each optimisation pass. The Cloudflare deployment config from upstream has been removed, but make wasm and make serve-wasm still work.
rp2350/ is original work, released nether the MIT License (rp2350/LICENSE).
The remainder of the repository is the pret decompilation and carries nary licence from this project. Following pret convention, nary ROM is required aliases included — the decompilation builds the crippled from its ain committed sources. Pokémon and Pokémon characteristic names are trademarks of Nintendo, Creatures Inc., and GAME FREAK Inc. This task is not affiliated pinch aliases endorsed by immoderate of them.
- pret/pokeemerald — the decompilation this is built on. Years of activity by galore people; nary of this is possible without it.
- tripplyons/pokeemerald-wasm — the WebAssembly port, whose #if WASM seams and reference rasteriser this port depends connected directly.
- The original pokeemerald README is preserved at docs/original-pokeemerald-readme.md.
English (US) ·
Indonesian (ID) ·