diff --git a/BootROMs/agb_boot.asm b/BootROMs/agb_boot.asm new file mode 100644 index 0000000..95a2c78 --- /dev/null +++ b/BootROMs/agb_boot.asm @@ -0,0 +1,2 @@ +AGB EQU 1 +include "cgb_boot.asm" \ No newline at end of file diff --git a/BootROMs/cgb_boot.asm b/BootROMs/cgb_boot.asm index 92f0671..6b0d601 100644 --- a/BootROMs/cgb_boot.asm +++ b/BootROMs/cgb_boot.asm @@ -732,7 +732,28 @@ Preboot: ld a, [InputPalette] and a jr nz, .emulateDMGForCGBGame - ld a, $11 +IF DEF(AGB) + ; Set registers to match the original AGB-CGB boot + ld bc, $1100 + push bc + pop af + ld h, c + ld b, 1 + ld c, c + ld e, $08 + ld l, $7c +ELSE + ; Set registers to match the original CGB boot + ld bc, $1180 + push bc + pop af + ld c, 0 + ld h, c + ld b, c + ld c, c + ld e, $08 + ld l, $7c +ENDC ret .emulateDMGForCGBGame diff --git a/Makefile b/Makefile index 2969a3e..f416358 100755 --- a/Makefile +++ b/Makefile @@ -90,9 +90,9 @@ endif cocoa: $(BIN)/SameBoy.app quicklook: $(BIN)/SameBoy.qlgenerator -sdl: $(SDL_TARGET) $(BIN)/SDL/dmg_boot.bin $(BIN)/SDL/cgb_boot.bin $(BIN)/SDL/LICENSE $(BIN)/SDL/registers.sym $(BIN)/SDL/background.bmp $(BIN)/SDL/Shaders -bootroms: $(BIN)/BootROMs/cgb_boot.bin $(BIN)/BootROMs/dmg_boot.bin -tester: $(TESTER_TARGET) $(BIN)/tester/dmg_boot.bin $(BIN)/tester/cgb_boot.bin +sdl: $(SDL_TARGET) $(BIN)/SDL/dmg_boot.bin $(BIN)/SDL/cgb_boot.bin $(BIN)/SDL/agb_boot.bin $(BIN)/SDL/LICENSE $(BIN)/SDL/registers.sym $(BIN)/SDL/background.bmp $(BIN)/SDL/Shaders +bootroms: $(BIN)/BootROMs/agb_boot.bin $(BIN)/BootROMs/cgb_boot.bin $(BIN)/BootROMs/dmg_boot.bin +tester: $(TESTER_TARGET) $(BIN)/tester/dmg_boot.bin $(BIN)/tester/cgb_boot.bin $(BIN)/tester/agb_boot.bin all: cocoa sdl tester libretro # Get a list of our source files and their respective object file targets @@ -161,6 +161,7 @@ $(BIN)/SameBoy.app: $(BIN)/SameBoy.app/Contents/MacOS/SameBoy \ Misc/registers.sym \ $(BIN)/SameBoy.app/Contents/Resources/dmg_boot.bin \ $(BIN)/SameBoy.app/Contents/Resources/cgb_boot.bin \ + $(BIN)/SameBoy.app/Contents/Resources/agb_boot.bin \ $(patsubst %.xib,%.nib,$(addprefix $(BIN)/SameBoy.app/Contents/Resources/Base.lproj/,$(shell cd Cocoa;ls *.xib))) \ $(BIN)/SameBoy.qlgenerator \ Shaders