A Reference on the layout and structure of GameBoy Color Roms? [closed]
Asked Answered
T

1

24

Does anyone have a reference or source about how GameBoy Color roms are laid out - where the data and code, what machine code instructions are used, how the clock works etc? I'm interested in perhaps building an emulator myself but I can't find any information about the roms' setup other than looking at them in a hex editor. I'm interested in roms in the .gbc file format.

I can of course look at the source of a working emulator, but I'm interested in something a bit more high level than that while I'm starting off.


Edit: Here are a load of really good resources I found:

Also, see the source for my currently developing project and this finished one in C# for the Gameboy Classic (more docs)

Typeface answered 11/9, 2010 at 12:8 Comment(2)
I thought visual boy advance was gba only. The gameboy is a modified z80, the gameboy advance is an arm7, huge difference. Anyway, This used to be a hot site for this kind of thing devrs.com/gb Might have some links related to your problem.Overby
Thanks, that looks like a really great site: I found this linked from it devrs.com/gb/files/gbspec.txt, which looks like a really good in depth spec.Typeface
P
12

ROM header from 0x100 to 0x14F. Everything else is "the ROM" meaning instructions interlaced with data or whatnot.

https://web.archive.org/web/20141105020940/http://problemkaputt.de/pandocs.htm

The opcodes are custom designed to be like the Zilog Z80, but are not exactly like it, since the CPU die itself is different from that of a Z80 as well as the clock cycles and register F flags being entirely different.

Snoop around in my code to find out the operations. https://github.com/grantgalitz/GameBoy-Online/blob/master/js/GameBoyCore.js look at line 525 and below. The GameBoy Color emulator is in javascript FTW.

And Imran's emulator is a bad source for looking up how the opcodes work, because his emulator still has many problems with getting the opcodes right. Look at gambatte's source code for the most accurate (accurate and "some more") depiction of how the console works.

Paradis answered 20/3, 2011 at 4:7 Comment(2)
Thanks for the answer, even so long after the question was asked. You are correct, Imran did mess up many of the opcodes so I did them myself from various references :DTypeface
Second link broken.Clynes

© 2022 - 2024 — McMap. All rights reserved.