All Projects → furrtek → Dmg Cpu Inside

furrtek / Dmg Cpu Inside

Licence: cc-by-sa-4.0
Reverse-engineered schematics for DMG-CPU-B

Projects that are alternatives of or similar to Dmg Cpu Inside

Vba M Nx
WIP full featured port of VBA-M for Nintendo Switch
Stars: ✭ 11 (-95.22%)
Mutual labels:  nintendo, gameboy
Retro Go
Retro emulation for the ODROID-GO
Stars: ✭ 73 (-68.26%)
Mutual labels:  nintendo, gameboy
Altium Library
Open source Altium Database Library with over 147,000 high quality components and full 3d models.
Stars: ✭ 875 (+280.43%)
Mutual labels:  schematics, electronics
Provenance
iOS & tvOS multi-emulator frontend, supporting various Atari, Bandai, NEC, Nintendo, Sega, SNK and Sony console systems… Get Started: https://wiki.provenance-emu.com |
Stars: ✭ 4,732 (+1957.39%)
Mutual labels:  nintendo, gameboy
Poketcg
Disassembly of Pokémon TCG
Stars: ✭ 125 (-45.65%)
Mutual labels:  gameboy, reverse-engineering
Skidl
SKiDL is a module that extends Python with the ability to design electronic circuits.
Stars: ✭ 614 (+166.96%)
Mutual labels:  schematics, electronics
Projectdmg
C# GameBoy Emulator
Stars: ✭ 57 (-75.22%)
Mutual labels:  nintendo, gameboy
VGChips
Video Game custom chips reverse-engineered from silicon
Stars: ✭ 86 (-62.61%)
Mutual labels:  asic, chip
Retrograde Android
Play retro video games on your Android TV!
Stars: ✭ 114 (-50.43%)
Mutual labels:  nintendo, gameboy
Pcbdl
PCB Design Language: A programming way to design schematics.
Stars: ✭ 84 (-63.48%)
Mutual labels:  schematics, electronics
Coreboy
A GameBoy Emulator, in C#
Stars: ✭ 397 (+72.61%)
Mutual labels:  nintendo, gameboy
Ghidra Switch Loader
Nintendo Switch loader for Ghidra
Stars: ✭ 146 (-36.52%)
Mutual labels:  nintendo, reverse-engineering
Pokeyellow
Disassembly of Pokemon Yellow
Stars: ✭ 383 (+66.52%)
Mutual labels:  gameboy, reverse-engineering
Mkw Structures
Documentation of various parts of Mario Kart Wii
Stars: ✭ 25 (-89.13%)
Mutual labels:  nintendo, reverse-engineering
khedgb
Experiments in Game Boy emulation
Stars: ✭ 15 (-93.48%)
Mutual labels:  nintendo, gameboy
Ntrghidra
Fully Featured Nintendo DS Loader for Ghidra
Stars: ✭ 56 (-75.65%)
Mutual labels:  nintendo, reverse-engineering
Gameboy-Color-Cartridge
Board layout for an eeprom powered GB cartridge
Stars: ✭ 58 (-74.78%)
Mutual labels:  gameboy, electronics
awesome-emu-resources
A curated list of emulator development resources
Stars: ✭ 26 (-88.7%)
Mutual labels:  nintendo, gameboy
Pokepinball
Disassembly of Pokémon Pinball
Stars: ✭ 77 (-66.52%)
Mutual labels:  gameboy, reverse-engineering
Mgbdis
Game Boy ROM disassembler with RGBDS compatible output
Stars: ✭ 131 (-43.04%)
Mutual labels:  gameboy, reverse-engineering

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:

  • All APU logic.
  • All PPU logic.
  • All I/O and timer logic.
  • All DMA logic.
  • All interrupt logic.
  • Various stuff used for testing/debugging.

What isn't done:

  • CPU. Why: it's a standalone core which doesn't use the standard cell topology. Visibility isn't good enough and it's too complex for me, sorry.
  • Clock complements. Why: They don't affect functionality. Only required because the DFF cells need a clock and its complement to work.
  • Some analog parts. Why: Poor visibility, lazyness.
  • Some cell groups related to embedded ROM and RAM blocks. Why: They don't affect functionality.

How to use

Just read the schematics :)

If you want to use the overlay:

  • Get Inkscape
  • Download the die picture from Digshadow
  • Resize it to 8000px wide if you're using Inkscape 0.92.2, otherwise it may freeze
  • Download the SVG overlay
  • Open the overlay in Inkscape, import the die picture (chose link, not embed), stick it under the overlay layers, align it and lock it in place
  • Have "fun"

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

  • Bit 4 and 5 of FF26 (NR52) can be written to.
    • Bit 4 sets NET03 (APU test mode ?).
    • Bit 5 allows software clocking of the CH1 sweep timer when NET03 is high.
  • Bit 0 of FF23 (NR44) can be read. It relates to the CH4 prescaler.
  • The current wave RAM address can be read in bits 4~0 of FF1C (NR32) when NET03 is high.
  • The whole chip can be made a slave for an external CPU by using the test pins. This was already discovered by @Gekkio and maybe others.
  • Probably other things I missed...

PAQ (Potentially Asked Questions)

  • Why ?

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.

  • Why are the schematics not in an editable format ?

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.

  • What's up with the cell labels ?

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

  • Many small lines aren't traced, why ?

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.

  • Why are there copies of logic blocks providing identical functions ?

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

  • I found a mistake, how can I report it ?

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, ...).

  • How did you know which cells did what ?

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.

  • How long did it take ?

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].