Home

Awesome

DMG-CPU-Inside

This repo contains an annotated overlay for the Nintendo Game Boy DMG-CPU-B chip die and the extracted schematics.

DMG-CPU-B die vector overlay

This was done manually with only a few automated checks so THERE'S A HIGH RISK OF ERROR. I'm in no way responsible if you made someone's life depend on this and it fucked up.

What is done:

What isn't done:

How to use

Just read the schematics :)

If you want to use the overlay:

Notes

Nets named FROM_CPU* and TO_CPU are connected to the CPU core but are not clearly identified. Many of them are trigger and acknowledge signals for interrupts. Others might be state indicators like the Z80 /M1 or HALT.

Some DFF clock polarities have to be verified.

The parallel-in-serial-out shift registers used for the serial link and video rendering are made of chains of set-reset-capable DFFs. Their loading logic require a lot of cells and seem complex, but in the end it forms something quite simple.

Rather than using multiplexers, many internal busses are instead tri-state capable. The "TRIBUFFER" cells are extensively used for this.

Mysteries

PAQ (Potentially Asked Questions)

It is well known by emulator authors that the Game Boy is full of quirks. Knowing exactly how and when signals change can help reaching perfect accuracy.

Because I used proprietary CAD software for speed and I didn't finish making the converter for the KiCAD format. I hope to be able to do that soon.

They're random, unique names. The first letter corresponds to the column they're in on the silicon die.

I didn't bother tracing branching lines when their end point was near enough to see it on my 15" screen at the zoom level I used. They're reported on the schematic, of course.

It's a way to trade off die space for speed, it seems weird but it's useful. Look up "logic duplication".

Until I get the files exported in KiCAD format, please open an issue and describe what's wrong (cell name, net name, position on die, ...).

I had to take guesses. Inputs and outputs are easily identified and the cell size gives some clues. When connections are made on the schematic, it becomes quickly obvious when a guess is wrong. Check out the cell zoo.

Identifying the cells, isolating them, tracing the connections and the schematics took 191 hours.

If you find it worth it, I accept donations through Paypal: paypal.me/furrtek

Thanks to Gekkio, Tanjent and Kevin Murphy for the help.