diff --git a/gameboy/makefile b/gameboy/makefile index 18b19d3..7bf172a 100644 --- a/gameboy/makefile +++ b/gameboy/makefile @@ -114,7 +114,8 @@ objlisto := $(foreach o,$(objlist),obj/gb/$(o).o) $(title).gb: $(objlisto) $(RGBLINK) -w -p 0xFF -m$(title).map -n$(title).sym -o$@ $^ - $(RGBFIX) -p0 -v $@ + cp $(title).gb $(title).beforefix + $(RGBFIX) -p 0xFF -m 'ROM' -vjcst '144P TEST' -kP8 -l0x33 $@ #obj/gb/%.o: obj/gb/%-dedent.z80 src/gb.inc src/hardware.inc src/global.inc # $(RGBASM) -o $@ $< diff --git a/gameboy/src/header.z80 b/gameboy/src/header.z80 index 04bfaa9..02aa7f7 100644 --- a/gameboy/src/header.z80 +++ b/gameboy/src/header.z80 @@ -33,57 +33,11 @@ SECTION "rst00", ROM0[$0000] ; $18-$38 and $50-$60 not used and omitted to save space ; Caution: If you set a bit in IE, you MUST have a handler for that -; interrupt. VisualBoyAdvance is known to call interrupt handlers -; on DI HALT. +; interrupt. VisualBoyAdvance calls interrupt handlers on DI HALT. SECTION "header", ROM0[$0100] ; All licensed games begin with NOP JP. It may have had to do with ; the debugger used in the era. nop jp reset_handler - - ; IPL uses this header to ensure D7-D0, A15, A5-A0, and /RD are - ; connected before calling something in the game that might - ; corrupt battery-backed save RAM. The data inserted by RGBFIX - ; spells "Nintendo" when deinterleaved to tiles. - ds 48,$00 - - ; TODO: Figure out how much of this RGBFIX can fill in for me - - ; 11-character title - DB "144P TEST" - DS 2,$00 - - ; Serial code (is ADME Doom or Animal Crossing?) - DS 4,$00 - - ; Execution mode (GBC runs in GBC mode if bit 7 is true) - DB CART_COMPATIBLE_DMG_GBC - - ; $0144: Developer ID - DB "OK" - - ; SGB mode - DB CART_INDICATOR_SGB - - ; Mapper - DB CART_ROM - - ; $0148: ceil(log2(ROM size / 32768)) - DB $00 - - ; log2(RAM size / 512)/2 - DB $00 - - ; Region code - DB CART_DEST_NON_JAPANESE - - ; Old hex developer ID: $33 means "see $0144" - ; Must be $33 for SGB support - DB $33 - - ; ROM version number - DB $00 - - ; Leave space for header checksum to be filled in by rgbfix - DS 3 + ds 76, $00