diff --git a/constants/hardware_constants.asm b/constants/hardware_constants.asm index 005a693457..6c5d43c169 100644 --- a/constants/hardware_constants.asm +++ b/constants/hardware_constants.asm @@ -1,6 +1,8 @@ -; From http://nocash.emubase.de/pandocs.htm. +; Reference documents: +; https://gbdev.io/pandocs/ +; https://github.com/gbdev/hardware.inc -DEF GBC EQU $11 +DEF CGB EQU $11 ; MBC1 DEF MBC1SRamEnable EQU $0000 diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm index 0520207935..f69eeba92f 100644 --- a/engine/gfx/palettes.asm +++ b/engine/gfx/palettes.asm @@ -396,11 +396,11 @@ LoadSGB: ret nc ld a, 1 ld [wOnSGB], a - ld a, [wGBC] + ld a, [wOnCGB] and a - jr z, .notGBC + jr z, .notCGB ret -.notGBC +.notCGB di call PrepareSuperNintendoVRAMTransfer ei @@ -563,21 +563,21 @@ Wait7000: ret SendSGBPackets: - ld a, [wGBC] + ld a, [wOnCGB] and a - jr z, .notGBC + jr z, .notCGB push de - call InitGBCPalettes + call InitCGBPalettes pop hl call EmptyFunc3 ret -.notGBC +.notCGB push de call SendSGBPacket pop hl jp SendSGBPacket -InitGBCPalettes: +InitCGBPalettes: ld a, $80 ; index 0 with auto-increment ldh [rBGPI], a inc hl diff --git a/home/start.asm b/home/start.asm index 764f946827..5e301da242 100644 --- a/home/start.asm +++ b/home/start.asm @@ -1,10 +1,10 @@ _Start:: - cp GBC - jr z, .gbc + cp CGB + jr z, .cgb xor a jr .ok -.gbc +.cgb ld a, FALSE .ok - ld [wGBC], a + ld [wOnCGB], a jp Init diff --git a/ram/wram.asm b/ram/wram.asm index aa36c188d3..e7d35f960d 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -1029,7 +1029,8 @@ wScriptedNPCWalkCounter:: db ds 1 -wGBC:: db +; always 0 since full CGB support was not implemented +wOnCGB:: db ; if running on SGB, it's 1, else it's 0 wOnSGB:: db