Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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:

  • A Emulator being built in javascript with more up to date source.
  • "The PAN documents" a detailed spec of the gameboy
  • A more up to date and better version of the previous item, with loads of stuff. Best resource.
  • Standard Z80 opcodes
  • All the opcodes in the Gameboy Z80
  • A list of opcodes changed/removed in the Gameboy
  • Z80 user manual (useful for flags)
  • Discussion of differences between Gameboy Color Z80 and 8080/Z80
  • Massive site dedicated to gameboy architecture (+GBA)
  • Another document on GBSpec, with timings

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

like image 733
Callum Rogers Avatar asked Sep 11 '10 12:09

Callum Rogers


People also ask

What was the last game made for Gameboy Color?

Harry Potter and the Chamber of Secrets (15 November 2002) Harry Potter and the Chamber of Secrets (Griptonite Games, 2002) was the last game released for the Nintendo Game Boy Color in North America.

How many Game Boy Color games are there?

There are currently 917 games on this list. It is organized alphabetically by the games' localized English titles, or by rōmaji transliterations when exclusive to Japan.

What Gameboy Color games are Gameboy?

Original Game Boy Games will work on Game Boy, Game Boy Pocket, Game Boy Color, Game Boy Advance and Game Boy Advance SP systems. They will not work on the DS, DS Lite, or DSi. Game Boy Color Games will work on Game Boy Color, Game Boy Advance and Game Boy Advance SP systems.


1 Answers

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.

like image 165
Grant Galitz Avatar answered Sep 21 '22 12:09

Grant Galitz