Made CGB boot more accurate, added AGB boot

This commit is contained in:
Lior Halphon 2018-01-13 13:02:31 +02:00
parent 59d4cb4bc2
commit 2cd5c49935
3 changed files with 28 additions and 4 deletions

2
BootROMs/agb_boot.asm Normal file
View File

@ -0,0 +1,2 @@
AGB EQU 1
include "cgb_boot.asm"

View File

@ -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

View File

@ -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