Andrew O’Neil

MissingnoMorepork

First steps with agents

An agent helped me close the final gaps to release. Pushing Missingno towards accuracy took a much more rigorous approach.

Early 2026 changed how I approached development. I’d been dismissive of coding agents, because their output was inaccurate enough that cleaning it up didn’t seem worth the time. They’d been getting better, though, and we’d recently started using them in my day job, where I was finding ways to make them work for me. I decided to point them at Missingno, to see what they were capable of and what I could learn.

I’m a product developer at heart, and I like writing software that can be used. I wanted to bring some of that product experience to my personal projects, but before I could release Missingno there were still a few things to do: compatibility fixes, polish, and two bigger pieces I’d been struggling to find the attention for. One was the screen, which Missingno drew with a canvas widget that was very slow, when I wanted to make better use of the graphics hardware. The other was sound: I’d done a lot of work implementing the Game Boy’s sound chip, but I hadn’t figured out how to hook it up to actual output. The chip generates sound waves from electronic signals, and bridging those two worlds was getting quite involved. Without any output, it was also really hard to iterate on.

I started with the screen. It felt like a good test for an agent: it was fairly isolated, it was important for a release, and it didn’t need any real architectural changes. I was already using Zed as my everyday editor, so I used its agent panel with Claude Opus 4.6, which had come out only a few days earlier. Over a weekend, the agent moved Missingno’s rendering to wgpu, drawing the screen with shaders on the graphics card. It did a pretty good job up front, but it needed a bit of iteration to make sure all the pixel output in the debugger, like the tile and tile map views, got the same benefits.

Sound came next, on the Sunday afternoon. I’d implemented the registers games use to control the sound chip, but turning them into waves you could actually hear was the gap I’d been stuck on, and the agent filled in both the sound generation for each of the four channels and the output to my speakers. The first game I heard was Tetris, the same game that had been running silently since the year before, and it finally felt complete.

Next was compatibility. I’d kept making improvements through 2025, but it was spotty at best, and Pokémon froze during its intro. Bugs like that were often something subtly wrong in a single CPU instruction, which sends the program down the wrong path, and the hard part was finding out when it had gone wrong. The agent would try something, I’d play and report what I saw, and it added its own debugging logs as it went. By that evening it had fixed the freeze, which turned out to be several bugs across CPU instructions, interrupts, cartridge handling and video. Then I pointed it at the remaining blockers for release: different cartridge types, save files and controller support.

Flatpak packaging went in that night, and on 10 February I released Missingno 26.2 on Flathub. Linux is my preferred operating system and what I use every day, so it was a natural place to start, somewhere people could find it but with a fairly small audience.

Missingno running Pokémon Red in Super Game Boy colour, showing the title screen with the Pokémon logo, “Red Version”, Charmander and the player character.

Pokémon Red’s title screen in Super Game Boy colour, one of the screenshots from Missingno 26.2’s Flathub listing.

The release was a real milestone, but it felt like the beginning rather than the end. The agent had made crossing that final mile easy, and it had changed how my working hours and my hobby fitted together. With an agent carrying more of the context, the two could coexist without competing for my attention, and I started to wonder where the ceiling was now. If agents could do the easy stuff, how far could I push them?

I had my eye on Game Boy Color support, which I felt many people would expect from a Game Boy emulator, and some might not even know they were different platforms. But I didn’t want to build it on shaky foundations.

I was also still picturing Pokémon Red with Ken Sugimori’s watercolour art, and building an emulator had shown me how limiting it would be to swap the art inside one. It would either give a fairly average result or need a lot of per-game customisation, and neither appealed to me. Instead, I’d started thinking about what would become Mammet: reimplementing the game on a custom framework, and using Missingno to prove it was 100% identical. Either way, Missingno had to be accurate, and I wanted to see how accurate I could make it.

Chasing accuracy soon had me pushing the limits of what an agent could achieve out of the box. Context windows were still fairly short then, 200,000 tokens for Opus 4.6. Each time I asked the agent to solve an issue, it would research, try a few things and run out of room, compacting its context,1 then go in circles without landing on an answer. It was mostly trial and error: its best guess, then its next best guess. What I discovered was that an agent has to clearly understand why something didn’t work, or it will just try it again, so the first thing I did was have it write everything down. Each investigation got its own folder of receipts, with a summary of what had been tried and how it turned out, and compaction could no longer wipe out what it had learnt.

Writing things down helped, but I was still hitting the limits of what trial and error could achieve, so I started building a more rigorous process into a set of skills, instructions the agent follows for a particular kind of task. It was really me formalising how I’d go about solving something myself. When I’m debugging, I chase the hunch the problem seems to be pointing me at, and every time I learn something new, that’s a chance to change direction. Figuring out what something isn’t is on the path to figuring out what it is. Within a few days, investigations were split into steps for research, analysis, hypotheses, design and implementation, with rules like this one:

Never attempt fix N+1 without new diagnostic evidence that fix N didn’t have. If you’re changing code based on the same information that produced the failed fix, you’re guessing.

A core part of each investigation was a root cause analysis tree in its summary, recording every hypothesis, what had been tried and which ones had been struck out. Here’s one from March:

  • Interrupt dispatch +1 M-cycle late ← ACTIVE
    • H12/H13: +4 dot misalignment — 3 remaining candidates ← ACTIVE
      • ISR dispatch pipeline confirmed correct (5 M-cycles)
      • NOP sled alignment measured
      • (b) VBlank IF fires at dot=4 instead of dot=0 — dot=4 correct
      • (c) CPU polls 4 dots late — latch pipeline matches hardware 1-M-cycle latency
      • (a) NOP sled starts 4 dots late — CONFIRMED: first scanline is 454 dots, hardware is 448
    • H5: PPU/timer IF fires 4 dots late — refuted
    • H1: Fresh→Ready pipeline adds phantom M-cycle — refuted
    • H8: Trailing fetch + ISR step 0 double-count — refuted, architecture eliminated
    • EI delay too early — refuted

I also had to think carefully about what deserved a place in the agent’s main context. Long logs and measurements could fill it up quickly, so that kind of high-volume work went to subagents, separate agents that dug through the output and reported back only their results.

The process brought real improvements. Test ROMs are small programs that check an emulator’s behaviour against what real hardware does, and when I first added them as automated tests in February, using Blargg’s and Mooneye’s suites and dmg-acid2, Missingno passed 20 of 86. Along the way I kept adding harder suites, like Mealybug Tearoom’s tests of graphics registers changing mid-line, and Austin Appleby’s gbmicrotest, where each test checks one register at one specific cycle. By mid-April Missingno was passing 713 of 779.

Even so, the agent would still sometimes settle for a hack. Agents are trying to solve the problem in front of them, and if they can’t find a good solution, they’ll find a hacky one. Developers are much the same. That wasn’t what I wanted for Missingno, though. I wanted it to be an accurate model of the hardware, not a sloppy one full of hacks, and with a long way still to go on compatibility, everything I built next would sit on top of it. There were good emulators out there to learn from, but I had my own architecture and programming model, and I wanted to understand how the hardware worked and model that, not adopt someone else’s.


To push things further, I first needed better data. An agent reasoning from written descriptions is working with ideas rather than data, and that leaves a lot of room for errors of judgement to creep in. At work, I’d had success with agents reading log files to pull out the relevant information, and it reminded me of how I’d tracked down bugs earlier in Missingno’s development, comparing its logs against NO$GMB’s debugger at particular steps to see where they started to diverge. I started thinking about how to scale that up. Instead of reading another emulator’s code and copying it, an agent could compare how several emulators actually behaved, which made it much less likely to pick up any one emulator’s errors or design.

That became gbtrace, which I started in March. It records a detailed trace of what an emulator does as it runs a test ROM, through adapters for emulators like Gambatte and SameBoy, GateBoy the next day, and before long Missingno itself, so I could see exactly where Missingno diverged from the others. It also showed me how often even very accurate emulators behaved differently from each other, even if most of those differences never affected program flow or final accuracy. Analysing and comparing the traces needed quite a lot of tooling of its own, too.

This was also the first project where I left the code writing to the agent. I was still very much part of the process, and I iterated heavily on both the architecture and the interface, but I didn’t write the code myself. I love writing clean code that reads like poetry and explains itself, but not all code has the same stakes, and this was developer tooling for myself. I needed it to work, not to be architecturally watertight. The interface included a web viewer for browsing and comparing traces, which was a chance to see what the agent could do with a UI, and to give the wider emulation community something potentially useful.2

The gbtrace web viewer. Missingno’s trace of the dmg-acid2 test is loaded alongside Gambatte’s, with panels showing the PPU’s tile fetch and pixel queues, the sprite table, the finished frame with dmg-acid2’s smiling face, and the tiles in video memory, above a list of the CPU’s instructions.

The gbtrace viewer, rebuilt from the code as it was on 31 March 2026.

GateBoy was one of the emulators I traced. It simulates most of the Game Boy’s chip at the level of individual logic gates, traced from photos of the die, though its CPU takes a higher-level, behavioural approach. Complex behaviour is often emergent from the underlying model, so there’s a lot to gain from matching it. Going lower level can actually make things simpler, because coding close to the domain produces the same emergent behaviour with fewer hacks. That didn’t mean going as low as GateBoy, though, just to whatever level each part of the hardware needed to behave accurately.

The agent turned out to be pretty good at tracing signals through GateBoy’s code, but the emulator treats every signal as arriving instantly, and there are edge cases on the Game Boy where the time a signal takes to pass through the chip’s gates changes how it behaves. I wanted a map of where GateBoy was inaccurate and why, so I started a propagation-delay analysis of the chip, looking for the paths where those delays would matter. GateBoy was good, but it was still a model, and even with traces it was hard to see what was going on inside it. The first version of the analysis was built on its code, but I switched it to read the chip’s netlist directly, a description of every gate on the chip and how they’re wired together.

Not long after, I discovered dmg-sim, a simulation of the chip’s netlist that records every signal as it runs. It was an absolute gold mine of data about the Game Boy, with everything I’d need to build a higher-level model that behaves the same, and I realised this was it: what I needed to take Missingno into its next phase.