Jump to content



2

Gameboy programming?


6 replies to this topic

#1 Opry99er OFFLINE  

Opry99er

    River Patroller

  • 3,019 posts
  • Location:Elizabethtown, KY

Posted Wed Feb 16, 2011 5:39 PM

Has anyone done any Gameboy programming? I believe it's a variant on Z80 assembly but I am having alot of difficulty finding and good solid datasheets or info. Anyone?

#2 bmcnett OFFLINE  

bmcnett

    Chopper Commander

  • 122 posts

Posted Wed Feb 16, 2011 5:55 PM

View PostOpry99er, on Wed Feb 16, 2011 5:39 PM, said:

Has anyone done any Gameboy programming? I believe it's a variant on Z80 assembly but I am having alot of difficulty finding and good solid datasheets or info. Anyone?

I programmed a few games for it. We used RGBASM for assembly and NO$GMB for debugging. Anywhere you find those tools, you'll find good docs on the GB's custom Z80. That was ten years ago though, so there is probably a new generation of tools. Martine Korth, the author of NO$GMB, was helpful to us when we had problems.

IIRC the GB's Z80 was missing the extended registers like AF' but it had new instructions like LD A,[HL+] which auto-incremented HL after loading from it.

#3 Wickeycolumbus OFFLINE  

Wickeycolumbus

    River Patroller

  • 4,064 posts
  • Location:Michigan

Posted Wed Feb 16, 2011 6:06 PM

Here are some useful links:

http://www.dmgice.co...ware/Gbspec.txt
http://www.devrs.com/gb/

#4 Opry99er OFFLINE  

Opry99er

    River Patroller

  • 3,019 posts
  • Location:Elizabethtown, KY

Posted Wed Feb 16, 2011 6:33 PM

Thanks guys--- I'm toying with the idea of doing a game for the GB... I don't know Z80 assembly, but I hear there is a C subset that compiles into the proper object code--- it's an interesting idea. :)

#5 malducci OFFLINE  

malducci

    Moonsweeper

  • 266 posts

Posted Thu Mar 10, 2011 9:51 AM

View PostOpry99er, on Wed Feb 16, 2011 6:33 PM, said:

Thanks guys--- I'm toying with the idea of doing a game for the GB... I don't know Z80 assembly, but I hear there is a C subset that compiles into the proper object code--- it's an interesting idea. :)

The GB-Z80 isn't exactly a z80 ( T cycles are always 4 master cycles or bus cycles, which is why you'll see GBC/GB rated as both 8mhz/4mhz and 2mhz/1mhz). It's missing a few instructions, but gained a few DMA functions. The memory layout (cpu logical address range) is custom to the GB design as well. And there's bank switching hardware (for ram and rom). I'd say you'd need a specific GB C compiler or modify the source code if someone else. I don't particularly remember a C compiler for it BITD, but I could be wrong.

Here's the best thing that helped me out back in 1999/2000 when I did some GB/C coding: http://www.pcedev.ne...Sheet000129.pdf . This is the last one he released. Every system should have a cribsheet like that :)

Edited by malducci, Thu Mar 10, 2011 9:53 AM.


#6 PkK OFFLINE  

PkK

    Chopper Commander

  • 208 posts

Posted Mon May 23, 2011 2:57 AM

View Postmalducci, on Thu Mar 10, 2011 9:51 AM, said:

I'd say you'd need a specific GB C compiler

E.g. sdcc when invoced with the -mgbz80 option.

Philipp

#7 djmips OFFLINE  

djmips

    Dragonstomper

  • 591 posts
  • scrolling
  • Location:Seattle

Posted Mon May 23, 2011 3:24 AM

I've developed a few games for GB. It's been awhile. The CPU is an 8080 not a Z80. I used sdcc as well as assembly. The no cash emulator/debugger wasn't to bad. He made some custom opcodes so you may print to a window. That allows for some decent 'print' or trace debugging. I have some good library code somewhere. I wrote a sprite 'system's etc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users