From 96fc617c69bca4fe717bd590e03bdd1fae1349e4 Mon Sep 17 00:00:00 2001 From: Engezerstorung <154867622+Engezerstorung@users.noreply.github.com> Date: Tue, 28 Jan 2025 18:08:12 +0100 Subject: Correct wTileMapBackup declared space (#487) --- constants/gfx_constants.asm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'constants') diff --git a/constants/gfx_constants.asm b/constants/gfx_constants.asm index 79d9647f..08cf8dc7 100644 --- a/constants/gfx_constants.asm +++ b/constants/gfx_constants.asm @@ -10,6 +10,13 @@ DEF SCREEN_HEIGHT_PX EQU SCREEN_HEIGHT * TILE_WIDTH ; pixels DEF BG_MAP_WIDTH EQU 32 ; tiles DEF BG_MAP_HEIGHT EQU 32 ; tiles +DEF BLOCK_WIDTH EQU 4 ; tiles +DEF BLOCK_HEIGHT EQU BLOCK_WIDTH ; tiles +DEF SCREEN_BLOCK_WIDTH EQU 6 ; blocks +DEF SCREEN_BLOCK_HEIGHT EQU 5 ; blocks +DEF SURROUNDING_WIDTH EQU SCREEN_BLOCK_WIDTH * BLOCK_WIDTH ; tiles +DEF SURROUNDING_HEIGHT EQU SCREEN_BLOCK_HEIGHT * BLOCK_HEIGHT ; tiles + DEF SPRITEBUFFERSIZE EQU 7 * 7 * LEN_1BPP_TILE ; HP bar -- cgit v1.3.1-sl0p From 79518a602e6241ff6bd6e905fabaf644680f7469 Mon Sep 17 00:00:00 2001 From: SatoMew Date: Thu, 30 Jan 2025 22:13:40 +0000 Subject: Consistently refer to CGB, not GBC (#491) --- constants/hardware_constants.asm | 6 ++++-- engine/gfx/palettes.asm | 16 ++++++++-------- home/start.asm | 8 ++++---- ram/wram.asm | 3 ++- 4 files changed, 18 insertions(+), 15 deletions(-) (limited to 'constants') diff --git a/constants/hardware_constants.asm b/constants/hardware_constants.asm index 005a6934..6c5d43c1 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 05202079..f69eeba9 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 764f9468..5e301da2 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 aa36c188..e7d35f96 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 -- cgit v1.3.1-sl0p