aboutsummaryrefslogtreecommitdiffstats
path: root/engine/gfx
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2025-01-30 21:40:19 -0600
committerdannye <33dannye@gmail.com>2025-01-30 21:40:19 -0600
commit6cb885a9f68b9f445d7fa45279731336fe0247d4 (patch)
tree39736ab1dd8ebcc57f8e981db6103285743d5530 /engine/gfx
parentIdentify unnamed functions in map_sprites.asm (#126) (diff)
parentFix some label typos, and add some constants instead of raw numbers (#492) (diff)
downloadpokeyellow-6cb885a9f68b9f445d7fa45279731336fe0247d4.tar.gz
pokeyellow-6cb885a9f68b9f445d7fa45279731336fe0247d4.tar.xz
pokeyellow-6cb885a9f68b9f445d7fa45279731336fe0247d4.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'engine/gfx')
-rw-r--r--engine/gfx/palettes.asm98
-rw-r--r--engine/gfx/screen_effects.asm4
-rw-r--r--engine/gfx/sprite_oam.asm2
3 files changed, 52 insertions, 52 deletions
diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm
index 428a6998..a618fe91 100644
--- a/engine/gfx/palettes.asm
+++ b/engine/gfx/palettes.asm
@@ -317,27 +317,27 @@ YellowIntroPaletteAction::
and a
jr nz, .asm_720bd
ld hl, PalPacket_Generic
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
jp z, SendSGBPacket
- jp InitGBCPalettes
+ jp InitCGBPalettes
.asm_720bd
ld hl, PalPacket_PikachusBeach
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
jp z, SendSGBPacket
- call InitGBCPalettes
+ call InitCGBPalettes
ld hl, PalPacket_Generic
inc hl
ld a, [hli]
- call GetGBCBasePalAddress
+ call GetCGBBasePalAddress
ld a, e
- ld [wGBCBasePalPointers + 2], a
+ ld [wCGBBasePalPointers + 2], a
ld a, d
- ld [wGBCBasePalPointers + 2 + 1], a
+ ld [wCGBBasePalPointers + 2 + 1], a
xor a ; CONVERT_BGP
- call DMGPalToGBCPal
+ call DMGPalToCGBPal
ld a, 1
call TransferCurBGPData
ret
@@ -354,14 +354,14 @@ LoadOverworldPikachuFrontpicPalettes::
ld a, PAL_PIKACHU_PORTRAIT
ld [hl], a
ld hl, wPalPacket
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
jr nz, .cgb_1
call SendSGBPacket
jr .okay_1
.cgb_1
- call InitGBCPalettes
+ call InitCGBPalettes
.okay_1
ld hl, BlkPacket_WholeScreen
ld de, wPalPacket
@@ -379,14 +379,14 @@ LoadOverworldPikachuFrontpicPalettes::
ld a, $a
ld [hl], a
ld hl, wPalPacket
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
jr nz, .cgb_2
call SendSGBPacket
jr .okay_2
.cgb_2
- call InitGBCPalettes
+ call InitCGBPalettes
.okay_2
ret
@@ -545,7 +545,7 @@ LoadSGB:
ld [wOnSGB], a
call CheckSGB
jr c, .onSGB
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
jr z, .onDMG
ld a, $1
@@ -666,7 +666,7 @@ CopyGfxToSuperNintendoVRAM:
call DisableLCD
ld a, $e4
ldh [rBGP], a
- call _UpdateGBCPal_BGP_CheckDMG
+ call _UpdateCGBPal_BGP_CheckDMG
ld de, vChars1
ld a, [wCopyingSGBTileData]
and a
@@ -697,7 +697,7 @@ CopyGfxToSuperNintendoVRAM:
call SendSGBPacket
xor a
ldh [rBGP], a
- call _UpdateGBCPal_BGP_CheckDMG
+ call _UpdateCGBPal_BGP_CheckDMG
ei
ret
@@ -715,25 +715,25 @@ Wait7000:
ret
SendSGBPackets:
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
- jr z, .notGBC
+ jr z, .notCGB
push de
- call InitGBCPalettes
+ call InitCGBPalettes
pop hl
- call InitGBCPalettes
+ call InitCGBPalettes
ldh a, [rLCDC]
and 1 << rLCDC_ENABLE
ret z
call Delay3
ret
-.notGBC
+.notCGB
push de
call SendSGBPacket
pop hl
jp SendSGBPacket
-InitGBCPalettes:
+InitCGBPalettes:
ld a, [hl]
and $f8
cp $20
@@ -753,31 +753,31 @@ InitGBCPalettes:
push hl
ENDC
- call GetGBCBasePalAddress
+ call GetCGBBasePalAddress
ld a, e
- ld [wGBCBasePalPointers + index * 2], a
+ ld [wCGBBasePalPointers + index * 2], a
ld a, d
- ld [wGBCBasePalPointers + index * 2 + 1], a
+ ld [wCGBBasePalPointers + index * 2 + 1], a
xor a ; CONVERT_BGP
- call DMGPalToGBCPal
+ call DMGPalToCGBPal
ld a, index
call TransferCurBGPData
ld a, CONVERT_OBP0
- call DMGPalToGBCPal
+ call DMGPalToCGBPal
ld a, index
call TransferCurOBPData
ld a, CONVERT_OBP1
- call DMGPalToGBCPal
+ call DMGPalToCGBPal
ld a, index + 4
call TransferCurOBPData
ENDR
ret
-GetGBCBasePalAddress::
+GetCGBBasePalAddress::
; Input: a = palette ID
; Output: de = palette address
push hl
@@ -787,7 +787,7 @@ GetGBCBasePalAddress::
add hl, hl
add hl, hl
add hl, hl
- ld de, GBCBasePalettes
+ ld de, CGBBasePalettes
add hl, de
ld a, l
ld e, a
@@ -796,12 +796,12 @@ GetGBCBasePalAddress::
pop hl
ret
-DMGPalToGBCPal::
-; Populate wGBCPal with colors from a base palette, selected using one of the
+DMGPalToCGBPal::
+; Populate wCGBPal with colors from a base palette, selected using one of the
; DMG palette registers.
; Input:
; a = which DMG palette register
-; de = address of GBC base palette
+; de = address of CGB base palette
and a
jr nz, .notBGP
ldh a, [rBGP]
@@ -822,9 +822,9 @@ DMGPalToGBCPal::
and %11
call .GetColorAddress
ld a, [hli]
- ld [wGBCPal + color_index * 2], a
+ ld [wCGBPal + color_index * 2], a
ld a, [hl]
- ld [wGBCPal + color_index * 2 + 1], a
+ ld [wCGBPal + color_index * 2 + 1], a
IF color_index < NUM_PAL_COLORS - 1
ld a, b
@@ -850,7 +850,7 @@ TransferCurBGPData::
or $80 ; auto-increment
ldh [rBGPI], a
ld de, rBGPD
- ld hl, wGBCPal
+ ld hl, wCGBPal
ld b, %10 ; mask for non-V-blank/non-H-blank STAT mode
ldh a, [rLCDC]
and 1 << rLCDC_ENABLE
@@ -868,7 +868,7 @@ TransferCurBGPData::
ret
BufferBGPPal::
-; Copy wGBCPal to palette a in wBGPPalsBuffer.
+; Copy wCGBPal to palette a in wBGPPalsBuffer.
push de
add a
add a
@@ -878,7 +878,7 @@ BufferBGPPal::
ld h, a
ld de, wBGPPalsBuffer
add hl, de
- ld de, wGBCPal
+ ld de, wCGBPal
ld c, PALETTE_SIZE
.loop
ld a, [de]
@@ -926,7 +926,7 @@ TransferCurOBPData:
or $80 ; auto-increment
ldh [rOBPI], a
ld de, rOBPD
- ld hl, wGBCPal
+ ld hl, wCGBPal
ld b, %10 ; mask for non-V-blank/non-H-blank STAT mode
ldh a, [rLCDC]
and 1 << rLCDC_ENABLE
@@ -967,20 +967,20 @@ TransferPalColorLCDDisabled:
ld [de], a
ret
-_UpdateGBCPal_BGP_CheckDMG::
- ldh a, [hGBC]
+_UpdateCGBPal_BGP_CheckDMG::
+ ldh a, [hOnCGB]
and a
ret z
; fall through
-_UpdateGBCPal_BGP::
+_UpdateCGBPal_BGP::
FOR index, NUM_ACTIVE_PALS
- ld a, [wGBCBasePalPointers + index * 2]
+ ld a, [wCGBBasePalPointers + index * 2]
ld e, a
- ld a, [wGBCBasePalPointers + index * 2 + 1]
+ ld a, [wCGBBasePalPointers + index * 2 + 1]
ld d, a
xor a ; CONVERT_BGP
- call DMGPalToGBCPal
+ call DMGPalToCGBPal
ld a, index
call BufferBGPPal
ENDR
@@ -988,14 +988,14 @@ _UpdateGBCPal_BGP::
call TransferBGPPals
ret
-_UpdateGBCPal_OBP::
+_UpdateCGBPal_OBP::
FOR index, NUM_ACTIVE_PALS
- ld a, [wGBCBasePalPointers + index * 2]
+ ld a, [wCGBBasePalPointers + index * 2]
ld e, a
- ld a, [wGBCBasePalPointers + index * 2 + 1]
+ ld a, [wCGBBasePalPointers + index * 2 + 1]
ld d, a
ld a, c
- call DMGPalToGBCPal
+ call DMGPalToCGBPal
ld a, c
dec a
rlca
@@ -1015,7 +1015,7 @@ _UpdateGBCPal_OBP::
ret
TranslatePalPacketToBGMapAttributes::
-; translate the SGB pal packets into something usable for the GBC
+; translate the SGB pal packets into something usable for the CGB
push hl
pop de
ld hl, PalPacketPointers
diff --git a/engine/gfx/screen_effects.asm b/engine/gfx/screen_effects.asm
index 0b4da01b..ece0a950 100644
--- a/engine/gfx/screen_effects.asm
+++ b/engine/gfx/screen_effects.asm
@@ -4,13 +4,13 @@ ChangeBGPalColor0_4Frames:
ldh a, [rBGP]
xor $ff
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld c, 4
call DelayFrames
ldh a, [rBGP]
xor $ff
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ret
PredefShakeScreenVertically:
diff --git a/engine/gfx/sprite_oam.asm b/engine/gfx/sprite_oam.asm
index c0cc0b4f..506b50a7 100644
--- a/engine/gfx/sprite_oam.asm
+++ b/engine/gfx/sprite_oam.asm
@@ -2,7 +2,7 @@ PrepareOAMData::
; Determine OAM data for currently visible
; sprites and write it to wShadowOAM.
; Yellow code has been changed to use registers more efficiently
-; as well as tweaking the code to show gbc palettes
+; as well as tweaking the code to show cgb palettes
ld a, [wUpdateSpritesEnabled]
dec a