Andrew O’Neil

MissingnoMorepork

Experimenting with colour

Without a gate-level simulation to guide me, getting the Game Boy Color right meant adapting my approach.

As the last of Missingno’s Game Boy tests started to pass, I’d taken its accuracy further than I’d ever planned, and I’d really enjoyed the push to get there. It still didn’t play Game Boy Color games, though, and I felt like a lot of people would expect a Game Boy emulator to, and might be confused or disappointed when Missingno didn’t. The Game Boy Color was also a new type of challenge, and I was interested to see if I could adapt my approach to it.

I wasn’t quite sure how it would turn out, to be honest. Much of the Game Boy Color’s hardware is identical to the original’s, but for the parts that were new or had changed, there was nothing like dmg-sim, the gate-level simulation that had guided the Game Boy work. I didn’t want the guesswork that meant to make the Game Boy core less readable or more hacky, so wherever possible, I kept the Game Boy Color’s code isolated from it.

I also saw the Game Boy Color as a chance to start getting Missingno ready for more than one system. I started by refactoring the codebase. With all of the Game Boy’s pieces in place, I could cut, combine, rename and remodel freely, knowing the test suite would catch anything I broke, and clearer names meant both the agents and I could understand the code. I also set up the Game Boy Color’s test suites, and added support for it to gbtrace,1 so I could compare Missingno against other emulators from the start.

Getting something working wasn’t a big engineering challenge. The Game Boy Color’s enhancements are a fairly constrained superset of the Game Boy’s: palettes for colour, extra banks of memory, a faster way to copy data into video memory, and double speed, which runs the processor twice as fast. Because they sat on an accurate Game Boy core, real games were running within days. Six days after I started on them, Game Boy Color support went out in Missingno 26.6, on the first weekend of the month as usual. It wasn’t perfect, but it was capable enough for people to play real games.

Missingno’s debugger running Pokémon Crystal. The title screen is shown in colour beside panels for the CPU and graphics registers, the colour palettes, the tile map, the tiles in video memory, the four sound channels and a view of memory.

Pokémon Crystal in Missingno’s debugger, captured with a recent build.

After the release, I turned to accuracy, starting with the smaller differences. Most were register writes that take effect at slightly different times on the Game Boy Color, and the investigation process I’d built for the Game Boy handled them well. For each failing test, an agent would form a hypothesis, design a fix, implement it and review the result, and what it learnt fed the next hypothesis. Double speed touched so much else that errors underneath it would compound, so I held it back until I had a solid base.

What kept that process grounded was the test ROMs, small programs that check an emulator’s behaviour against real hardware, and the Game Boy Color is exceptionally well covered. Mooneye’s, Mealybug Tearoom’s and SameSuite test a broad range of its behaviour, and Gambatte’s home in on timing, the trickiest part, with over a thousand tests for double speed and switching in and out of it. I may not have had a blueprint, but I did have a map.

Once the single-speed differences were in good shape, I turned to double speed, which had many more moving parts. The processor runs twice as fast but the graphics chip doesn’t, so every register read and write lands at a different point in the graphics chip’s timing. Switching speed isn’t instant either: the processor stops for a short while, a period known as the blackout, and has to come out of it in step with the graphics chip. When a test failed, the cause could be in any of those, and because they were tangled up, working out which was difficult.

This was also where the agents started to struggle. Claude Opus 4.8 tended to stop early and give up.2 Quite often it just needed some encouragement, and a reminder that we had a documented process and would get to the answer if it followed it.

Part of the problem was how sticky giving up could be. Agents were now keeping notes in a memory that carried across sessions, and once one had recorded double speed as postponed, or a problem as a wall, later agents treated it as settled and wouldn’t pick it up on their own. Getting past it meant correcting the memory and reminding them, often more than once, that difficult didn’t mean blocked.


Working through double speed one test at a time was slow going, even when the agents kept at it. I needed to understand the system as a whole, and without evidence like dmg-sim’s, experimenting was the best way to collect it. Failed experiments teach as much as successful ones, so I’d have agents try several models of the same behaviour, like different ways the clocks could change over during a speed switch, and see which tests each fixed and which it broke. Agents made that cheap: several could work side by side, each in its own copy of the code. Together, the results ruled some possibilities out and left a few promising leads.

To decide which leads to follow, I asked whether each one was plausible hardware. The subtle part of double speed was switching back and forth: tests that switch several times showed the processor and graphics chip falling out of step a little differently each time. Missingno handled that with a “slip”, a piece of clock accounting that nudged them back into step. That was fine as a temporary measure while I understood the behaviour, but it felt like an accounting hack.

On the Game Boy, everything runs at about 4 MHz. The Game Boy Color’s processor can run at 4 or 8 MHz while its graphics chip stays at 4 MHz, but one crystal still sets the pace for both, and its speed never changes. Once I realised that, it followed that the shifting alignment should fall out of how the clock was divided for each chip and how long the blackout lasted. Gambatte’s tests switch speed in so many situations that they gave me plenty to fit those timings against, and once they fitted, the slip could go. I couldn’t prove the model right the way dmg-sim had let me, but as more of the pieces fell into place, I grew more confident in it.

Once I was confident in double speed and the speed switch, the rest came down to the investigation process again, with some trial and error along the way. On 4 July, Missingno passed every Game Boy Color test it ran, and I released 26.7 the same day. I was very pleased: I hadn’t been sure I could reach the same accuracy on the Game Boy Color as on the Game Boy, but once the core model was right, the final stretch was slow but steady progress.

60%70%80%90%100%1 Jun15 Jun1 Jul60%70%80%90%100%1 Jun1 Jul
The data behind the chart
DatePassingFailingShareEvent
31 May2,2621,18465.6%
1 June2,2641,18265.7%
2 June2,2681,17865.8%
3 June2,2721,17465.9%
4 June2,61083975.7%
7 June2,69375978.0%
10 June3,06738189.0%
11 June3,14030891.1%
12 June3,22122793.4%
13 June3,24620294.1%
14 June3,27117794.9%
15 June3,29215295.6%
16 June3,30014495.8%
19 June3,30813696.1%
20 June3,30813696.1%
21 June3,32712696.4%
22 June3,34311096.8%
23 June3,35010397.0%
24 June3,3559697.2%
25 June3,3569497.3%
26 June3,3648197.6%
27 June3,3648197.6%
29 June3,3776998.0%
30 June3,3826498.1%
1 July3,3935398.5%
2 July3,4291799.51%
3 July3,438799.80%
4 July3,4450100%
The share of Game Boy Color tests passing in each day’s best run, 31 May to 4 July 2026.

The work isn’t really done once it’s out the door, though. It just moves from building features to ongoing improvement and maintenance. The Steam Deck is my baseline for performance, and the heavier Game Boy Color games were a poor experience on it, but I didn’t want to make disruptive changes right before a release, so 26.7 only had a few performance fixes.

I spent the next release on speed. Emulation moved onto its own thread, so the interface no longer froze, and I looked for improvements that didn’t mean rethinking the model, including retraining Missingno’s profile-guided optimisation, where the compiler uses recordings of the emulator running to decide what to speed up, on a demanding demo. By the time that release shipped, I’d hit my performance target.

With Game Boy Color support squirreled away, I’d planned to go back to Mammet, a rules engine for reimplementing games that I’d prototyped in late May. Emulation still had a hold on me, though, and I wasn’t ready to put it down, so I started looking at which system Missingno could take on next.