Skip to content

Commit

Permalink
Consistently refer to CGB, not GBC (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
SatoMew authored Jan 30, 2025
1 parent ec37f61 commit 79518a6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
6 changes: 4 additions & 2 deletions constants/hardware_constants.asm
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 8 additions & 8 deletions engine/gfx/palettes.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions home/start.asm
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion ram/wram.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 79518a6

Please sign in to comment.