What you're looking at
The emulator models the whole machine from part 5: the 65c02 CPU, 16kb of RAM, the 32kb ROM with the BIOS and Enhanced BASIC, the 65c22 VIA and its timer, the GPU, and a cartridge in the first I/O port.
When you pick a cartridge the machine resets, and the BIOS loads it exactly as it does on the real board: it copies the tiles and map into the GPU's video memory one byte at a time, then copies the program into RAM and jumps to it. That loading normally takes a while, so the emulator runs flat out until the program starts.
The screen is the GPU's 400x300 output. Everything on it is made of 16x16 tiles, including BASIC's text, where each character is a tile from the cartridge's font.
Things to know
- Click the screen (or tab to it) before typing. Keys only go to the emulator while the screen is focused.
- Letters are sent in capitals, since BASIC's keywords need them. On a phone, use the “Type a line” box.
- BASIC's screen is 25 characters wide and wraps back to the top when it reaches the bottom, just like on the real board. Long lines run off the right-hand edge.
- There's no way to break out of a running BASIC program, so if you write an endless loop, press Reset.
- Snake is a new cartridge, written in 2026 for this page. It's 6502 assembly using the same BIOS routines, font and cartridge format as the originals, and its source is in the repo with the others.
- The real board never had a keyboard or controller. Both only ever existed here, in the emulator.
- The timer and Pokémon cartridges were saved in an older format and wouldn't load as they were, so these copies were re-assembled from their original source with the current cartridge header. The timer also needed one extra instruction to switch interrupts back on, since the final BIOS leaves them off.
- A couple of small fixes were made to the emulator in 2026 so that resets and timer interrupts behave like the real chips. Otherwise it's the original code.
The emulator is written in TypeScript. Its source, along with the BIOS, the cartridges and the schematics, is on Bitbucket.