aboutsummaryrefslogtreecommitdiffstats
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/battle/animations.asm49
-rw-r--r--engine/battle/battle_transitions.asm8
-rw-r--r--engine/battle/core.asm16
-rw-r--r--engine/battle/effects.asm4
-rw-r--r--engine/battle/ghost_marowak_anim.asm6
-rw-r--r--engine/battle/trainer_ai.asm4
-rw-r--r--engine/debug/debug_menu.asm6
-rw-r--r--engine/debug/debug_party.asm9
-rw-r--r--engine/events/poison.asm2
-rw-r--r--engine/gfx/palettes.asm98
-rw-r--r--engine/gfx/screen_effects.asm4
-rw-r--r--engine/gfx/sprite_oam.asm2
-rw-r--r--engine/items/item_effects.asm14
-rw-r--r--engine/items/town_map.asm26
-rw-r--r--engine/link/cable_club.asm6
-rw-r--r--engine/menus/link_menu.asm16
-rw-r--r--engine/menus/main_menu.asm2
-rw-r--r--engine/minigame/surfing_pikachu.asm30
-rw-r--r--engine/movie/credits.asm8
-rw-r--r--engine/movie/hall_of_fame.asm2
-rw-r--r--engine/movie/intro.asm9
-rw-r--r--engine/movie/intro_yellow.asm50
-rw-r--r--engine/movie/oak_speech/init_player_data.asm2
-rw-r--r--engine/movie/oak_speech/oak_speech.asm4
-rw-r--r--engine/movie/splash.asm8
-rw-r--r--engine/movie/title.asm6
-rw-r--r--engine/movie/trade.asm10
-rw-r--r--engine/overworld/cut.asm2
-rw-r--r--engine/overworld/cut2.asm4
-rw-r--r--engine/overworld/dust_smoke.asm4
-rw-r--r--engine/overworld/healing_machine.asm6
-rw-r--r--engine/overworld/player_state.asm2
-rw-r--r--engine/overworld/trainer_sight.asm10
-rw-r--r--engine/pikachu/pikachu_pic_animation.asm2
-rw-r--r--engine/pokemon/evos_moves.asm4
-rw-r--r--engine/slots/slot_machine.asm14
36 files changed, 227 insertions, 222 deletions
diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm
index 33036d05..08399ad4 100644
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -274,7 +274,7 @@ PlayAnimation:
push af
ld a, [wAnimPalette]
ldh [rOBP0], a
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
call LoadMoveAnimationTiles
call LoadSubanimation
call PlaySubanimation
@@ -282,7 +282,7 @@ PlayAnimation:
vc_hook Stop_reducing_move_anim_flashing_Thunderbolt
ldh [rOBP0], a
vc_hook Stop_reducing_move_anim_flashing_Explosion
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
.nextAnimationCommand
vc_hook Stop_reducing_move_anim_flashing_Guillotine
pop hl
@@ -583,8 +583,8 @@ SetAnimationPalette:
ld a, $6c
vc_hook Reduce_move_anim_flashing_Haze
ldh [rOBP1], a
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
.notSGB
ld a, $e4
@@ -592,8 +592,8 @@ SetAnimationPalette:
ldh [rOBP0], a
ld a, $6c
ldh [rOBP1], a
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
Func_78e98:
@@ -729,7 +729,7 @@ DoBallTossSpecialEffects:
ldh a, [rOBP0]
xor %00111100 ; complement colors 1 and 2
ldh [rOBP0], a
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
.skipFlashingEffect
ld a, [wSubAnimCounter]
cp 11 ; is it the beginning of the subanimation?
@@ -1019,7 +1019,7 @@ AnimationFlashScreenLong:
cp 1
jr z, .endOfPalettes
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
call FlashScreenLongDelay
jr .innerLoop
.endOfPalettes
@@ -1082,17 +1082,17 @@ AnimationFlashScreen:
push af ; save initial palette
ld a, %00011011 ; 0, 1, 2, 3 (inverted colors)
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld c, 2
call DelayFrames
xor a ; white out background
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld c, 2
call DelayFrames
pop af
ldh [rBGP], a ; restore initial palette
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ret
AnimationDarkScreenPalette:
@@ -1138,7 +1138,7 @@ SetAnimationBGPalette:
ld a, c
.next
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ret
ld b, $5
@@ -2019,7 +2019,7 @@ AnimationSubstitute:
; Changes the pokemon's sprite to the mini sprite
ld hl, wTempPic
xor a
- ld bc, $310
+ ld bc, 7 * 7 tiles
call FillMemory
ldh a, [hWhoseTurn]
and a
@@ -2282,7 +2282,7 @@ GetMonSpriteTileMapPointerFromRowCount:
ldh a, [hWhoseTurn]
and a
jr nz, .enemyTurn
- ld a, 20 * 5 + 1
+ ld a, 5 * SCREEN_WIDTH + 1
jr .next
.enemyTurn
ld a, 12
@@ -2295,7 +2295,7 @@ GetMonSpriteTileMapPointerFromRowCount:
sub b
and a
jr z, .done
- ld de, 20
+ ld de, SCREEN_WIDTH
.loop
add hl, de
dec a
@@ -2349,8 +2349,7 @@ AnimCopyRowRight:
jr nz, AnimCopyRowRight
ret
-; get the sound of the move id in b
-GetMoveSoundB:
+GetIntroMoveSound: ; unreferenced
ld a, b
call GetMoveSound
ld b, a
@@ -2456,7 +2455,7 @@ CopyTileIDs:
dec c
jr nz, .columnLoop
pop hl
- ld bc, 20
+ ld bc, SCREEN_WIDTH
add hl, bc
pop bc
dec b
@@ -2473,7 +2472,7 @@ AnimationLeavesFalling:
; in Razor Leaf's animation.
ld a, [wAnimPalette]
ldh [rOBP0], a
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
ld d, $37 ; leaf tile
ld a, 3 ; number of leaves
ld [wNumFallingObjects], a
@@ -2678,12 +2677,12 @@ AnimationShakeEnemyHUD:
call BattleAnimCopyTileMapToVRAM
; update BGMap attributes
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
- jr z, .notGBC
+ jr z, .notCGB
ld c, 13
farcall LoadBGMapAttributes
-.notGBC
+.notCGB
; Move the window so that the row below the enemy HUD (in BG map 0) lines up
; with the top row of the window on the screen. This makes it so that the window
@@ -2719,12 +2718,12 @@ AnimationShakeEnemyHUD:
ld hl, vBGMap1
call BattleAnimCopyTileMapToVRAM
; update BGMap attributes
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
- jr z, .notGBC2
+ jr z, .notCGB2
ld c, 11
farcall LoadBGMapAttributes
-.notGBC2
+.notCGB2
xor a
ldh [hWY], a
call SaveScreenTilesToBuffer1
diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm
index b16bcdc1..8a340bf7 100644
--- a/engine/battle/battle_transitions.asm
+++ b/engine/battle/battle_transitions.asm
@@ -171,9 +171,9 @@ BattleTransition_BlackScreen:
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
; for non-dungeon trainer battles
@@ -337,7 +337,7 @@ BattleTransition_FlashScreen_:
cp 1
jr z, .done
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld c, 2
call DelayFrames
jr .loop
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index d6ce6557..39e80e74 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -67,9 +67,9 @@ SlidePlayerAndEnemySilhouettesOnScreen:
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
.slideSilhouettesLoop ; slide silhouettes of the player's pic and the enemy's pic onto the screen
ld h, b
ld l, $40
@@ -905,8 +905,8 @@ ReplaceFaintedEnemyMon:
ldpal a, SHADE_BLACK, SHADE_DARK, SHADE_LIGHT, SHADE_WHITE
ldh [rOBP0], a
ldh [rOBP1], a
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
callfar DrawEnemyPokeballs
ld a, [wLinkState]
cp LINK_STATE_BATTLING
@@ -4619,7 +4619,7 @@ CalculateDamage:
; Multi-hit attacks may or may not have 0 bp.
cp TWO_TO_FIVE_ATTACKS_EFFECT
jr z, .skipbp
- cp $1e
+ cp EFFECT_1E
jr z, .skipbp
; Calculate OHKO damage based on remaining HP.
@@ -5328,7 +5328,7 @@ MetronomePickMove:
and a
jr z, .pickMoveLoop
cp STRUGGLE
- assert NUM_ATTACKS == STRUGGLE ; random numbers greater than STRUGGLE are not moves
+ ASSERT NUM_ATTACKS == STRUGGLE ; random numbers greater than STRUGGLE are not moves
jr nc, .pickMoveLoop
cp METRONOME
jr z, .pickMoveLoop
@@ -6940,7 +6940,7 @@ HandleExplodingAnimation:
ret nz
ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT
ld [wAnimationType], a
- assert ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT == MEGA_PUNCH
+ ASSERT ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT == MEGA_PUNCH
; ld a, MEGA_PUNCH
; fallthrough
PlayMoveAnimation:
diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm
index a78de9ca..28e78c3d 100644
--- a/engine/battle/effects.asm
+++ b/engine/battle/effects.asm
@@ -236,8 +236,8 @@ FreezeBurnParalyzeEffect:
jr c, .regular_effectiveness
; extra effectiveness
ld b, 30 percent + 1
- assert PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1
- assert PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == FREEZE_SIDE_EFFECT2 - FREEZE_SIDE_EFFECT1
+ ASSERT PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1
+ ASSERT PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == FREEZE_SIDE_EFFECT2 - FREEZE_SIDE_EFFECT1
sub PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 ; treat extra effective as regular from now on
.regular_effectiveness
push af
diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm
index 5b14f6df..1230b936 100644
--- a/engine/battle/ghost_marowak_anim.asm
+++ b/engine/battle/ghost_marowak_anim.asm
@@ -2,7 +2,7 @@ MarowakAnim:
; animate the ghost being unveiled as a Marowak
ld a, $e4
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
call CopyMonPicFromBGToSpriteVRAM ; cover the BG ghost pic with a sprite ghost pic that looks the same
; now that the ghost pic is being displayed using sprites, clear the ghost pic from the BG tilemap
hlcoord 12, 0
@@ -28,7 +28,7 @@ MarowakAnim:
sla a
sla a
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
jr nz, .fadeOutGhostLoop
call ClearSprites
call CopyMonPicFromBGToSpriteVRAM ; copy Marowak pic from BG to sprite VRAM
@@ -42,7 +42,7 @@ MarowakAnim:
srl b
rra
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
ld a, b
and a
jr nz, .fadeInMarowakLoop
diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm
index d714109d..7843b1e2 100644
--- a/engine/battle/trainer_ai.asm
+++ b/engine/battle/trainer_ai.asm
@@ -644,7 +644,7 @@ AICureStatus:
res BADLY_POISONED, [hl]
ret
-AIUseXAccuracy: ; unused
+AIUseXAccuracy: ; unreferenced
call AIPlayRestoringSFX
ld hl, wEnemyBattleStatus2
set USING_X_ACCURACY, [hl]
@@ -658,7 +658,7 @@ AIUseGuardSpec:
ld a, GUARD_SPEC
jp AIPrintItemUse
-AIUseDireHit: ; unused
+AIUseDireHit: ; unreferenced
call AIPlayRestoringSFX
ld hl, wEnemyBattleStatus2
set GETTING_PUMPED, [hl]
diff --git a/engine/debug/debug_menu.asm b/engine/debug/debug_menu.asm
index b2efb940..92a6853f 100644
--- a/engine/debug/debug_menu.asm
+++ b/engine/debug/debug_menu.asm
@@ -782,9 +782,9 @@ Func_fec10:
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
hlcoord 0, 0
lb bc, 1, 18
call TextBoxBorder
diff --git a/engine/debug/debug_party.asm b/engine/debug/debug_party.asm
index 3c617938..407875e7 100644
--- a/engine/debug/debug_party.asm
+++ b/engine/debug/debug_party.asm
@@ -53,7 +53,7 @@ IF DEF(_DEBUG)
; Get some debug items.
ld hl, wNumBagItems
- ld de, DebugItemsList
+ ld de, DebugNewGameItemsList
.items_loop
ld a, [de]
cp -1
@@ -76,12 +76,13 @@ IF DEF(_DEBUG)
; Rival chose Jolteon.
ld hl, wRivalStarter
+ ASSERT wRivalStarter + 2 == wPlayerStarter
ld a, RIVAL_STARTER_JOLTEON
ld [hli], a
ld a, NUM_POKEMON
ld [hli], a ; hl = wUnknownDebugByte
ld a, STARTER_PIKACHU
- ld [hl], a ; hl = wPlayerStarter
+ ld [hl], a
; Give max money.
ld hl, wPlayerMoney
@@ -102,7 +103,7 @@ DebugSetPokedexEntries:
ld [hl], %01111111
ret
-DebugItemsList:
+DebugNewGameItemsList:
db MASTER_BALL, 99
db TOWN_MAP, 1
db BICYCLE, 1
@@ -119,7 +120,7 @@ DebugItemsList:
db PP_UP, 99
db -1 ; end
-DebugUnusedList:
+DebugUnusedList: ; unreferenced
db OLD_AMBER, 1
db DOME_FOSSIL, 1
db HELIX_FOSSIL, 1
diff --git a/engine/events/poison.asm b/engine/events/poison.asm
index 18546254..c57af3c4 100644
--- a/engine/events/poison.asm
+++ b/engine/events/poison.asm
@@ -1,6 +1,6 @@
ApplyOutOfBattlePoisonDamage:
ld a, [wStatusFlags5]
- assert BIT_SCRIPTED_MOVEMENT_STATE == 7
+ ASSERT BIT_SCRIPTED_MOVEMENT_STATE == 7
add a ; overflows scripted movement state bit into carry flag
jp c, .noBlackOut ; no black out if joypad states are being simulated
ld a, [wd492]
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
diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm
index 89a20113..de95b0c7 100644
--- a/engine/items/item_effects.asm
+++ b/engine/items/item_effects.asm
@@ -482,7 +482,7 @@ ItemUseBall:
push hl
-; If the Pokémon is transformed, the Pokémon is assumed to be a Ditto.
+; Bug: If the Pokémon is transformed, the Pokémon is assumed to be a Ditto.
; This is a bug because a wild Pokémon could have used Transform via
; Mirror Move even though the only wild Pokémon that knows Transform is Ditto.
ld hl, wEnemyBattleStatus3
@@ -828,7 +828,7 @@ ItemUseEvoStone:
ld a, SFX_HEAL_AILMENT
call PlaySoundWaitForCurrent
call WaitForSoundToFinish
- ld a, $01
+ ld a, TRUE
ld [wForceEvolution], a
callfar TryEvolvingMon ; try to evolve pokemon
pop af
@@ -2321,10 +2321,10 @@ ItemUsePPRestore:
.fullyRestorePP
ld a, [hl] ; move PP
-; Note that this code has a bug. It doesn't mask out the upper two bits, which
-; are used to count how many PP Ups have been used on the move. So, Max Ethers
-; and Max Elixirs will not be detected as having no effect on a move with full
-; PP if the move has had any PP Ups used on it.
+; Bug: This code doesn't mask out the upper two bits, which are used to count
+; how many PP Ups have been used on the move.
+; So, Max Ethers and Max Elixirs will not be detected as having no effect on
+; a move with full PP if the move has had any PP Ups used on it.
cp b ; does current PP equal max PP?
ret z
jr .storeNewAmount
@@ -2794,7 +2794,7 @@ GetMaxPP:
and %11000000 ; get PP Up count
pop bc
or b ; place normal max PP in 6 lower bits of a
- assert wMoveData + MOVE_PP + 1 == wPPUpCountAndMaxPP
+ ASSERT wMoveData + MOVE_PP + 1 == wPPUpCountAndMaxPP
ld h, d
ld l, e
inc hl ; hl = wPPUpCountAndMaxPP
diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm
index abd3b13f..d5960afd 100644
--- a/engine/items/town_map.asm
+++ b/engine/items/town_map.asm
@@ -18,9 +18,9 @@ DisplayTownMap:
hlcoord 1, 0
ld de, wNameBuffer
call PlaceString
- ld hl, wShadowOAM
- ld de, wTileMapBackup
- ld bc, $10
+ ld hl, wShadowOAMSprite00
+ ld de, wShadowOAMBackupSprite00
+ ld bc, 4 * 4
call CopyData
ld hl, vSprites tile BIRD_BASE_TILE
ld de, TownMapCursor
@@ -63,8 +63,8 @@ DisplayTownMap:
ld de, wNameBuffer
call PlaceString
ld hl, wShadowOAMSprite04
- ld de, wTileMapBackup + 16
- ld bc, $10
+ ld de, wShadowOAMBackupSprite04
+ ld bc, 4 * 4
call CopyData
.inputLoop
call TownMapSpriteBlinkingAnimation
@@ -222,7 +222,7 @@ LoadTownMap_Fly::
ld [wDestinationMap], a
ld hl, wStatusFlags6
set BIT_FLY_WARP, [hl]
- assert wStatusFlags6 + 1 == wStatusFlags7
+ ASSERT wStatusFlags6 + 1 == wStatusFlags7
inc hl
set BIT_USED_FLY, [hl]
.pressedB
@@ -376,8 +376,8 @@ DrawPlayerOrBirdSprite:
cp "@"
jr nz, .loop
ld hl, wShadowOAM
- ld de, wTileMapBackup
- ld bc, $a0
+ ld de, wShadowOAMBackup
+ ld bc, NUM_SPRITE_OAM_STRUCTS * 4
jp CopyData
DisplayWildLocations:
@@ -423,8 +423,8 @@ DisplayWildLocations:
call DrawPlayerOrBirdSprite
.done
ld hl, wShadowOAM
- ld de, wTileMapBackup
- ld bc, $a0
+ ld de, wShadowOAMBackup
+ ld bc, NUM_SPRITE_OAM_STRUCTS * 4
jp CopyData
AreaUnknownText:
@@ -611,15 +611,15 @@ TownMapSpriteBlinkingAnimation::
cp 50
jr nz, .done
; show sprites when the counter reaches 50
- ld hl, wTileMapBackup
+ ld hl, wShadowOAMBackup
ld de, wShadowOAM
- ld bc, $90
+ ld bc, (NUM_SPRITE_OAM_STRUCTS - 4) * 4
call CopyData
xor a
jr .done
.hideSprites
ld hl, wShadowOAM
- ld b, $24
+ ld b, NUM_SPRITE_OAM_STRUCTS - 4
ld de, $4
.hideSpritesLoop
ld [hl], $a0
diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm
index 26845d2e..691793e7 100644
--- a/engine/link/cable_club.asm
+++ b/engine/link/cable_club.asm
@@ -56,8 +56,8 @@ CableClub_DoBattleOrTradeAgain:
ld [hli], a
dec b
jr nz, .zeroPlayerDataPatchListLoop
- ld hl, wGrassRate
- ld bc, wTrainerHeaderPtr - wGrassRate
+ ld hl, wLinkEnemyTrainerName
+ ld bc, wTrainerHeaderPtr - wLinkEnemyTrainerName
.zeroEnemyPartyLoop
xor a
ld [hli], a
@@ -822,7 +822,7 @@ TradeCenter_Trade:
ld a, [wPartyCount]
dec a
ld [wWhichPokemon], a
- ld a, $1
+ ld a, TRUE
ld [wForceEvolution], a
ld a, [wTradingWhichEnemyMon]
ld hl, wEnemyPartySpecies
diff --git a/engine/menus/link_menu.asm b/engine/menus/link_menu.asm
index e0f39eda..9b151388 100644
--- a/engine/menus/link_menu.asm
+++ b/engine/menus/link_menu.asm
@@ -656,20 +656,20 @@ LinkMenu:
ld hl, wTopMenuItemY
ld a, 5
ld [hli], a
- assert wTopMenuItemY + 1 == wTopMenuItemX
+ ASSERT wTopMenuItemY + 1 == wTopMenuItemX
ld a, 6
ld [hli], a
- assert wTopMenuItemX + 1 == wCurrentMenuItem
+ ASSERT wTopMenuItemX + 1 == wCurrentMenuItem
xor a
ld [hli], a
inc hl
- assert wCurrentMenuItem + 2 == wMaxMenuItem
+ ASSERT wCurrentMenuItem + 2 == wMaxMenuItem
ld a, 3
ld [hli], a
- assert wMaxMenuItem + 1 == wMenuWatchedKeys
- assert 2 == B_BUTTON
+ ASSERT wMaxMenuItem + 1 == wMenuWatchedKeys
+ ASSERT 2 == B_BUTTON
ld [hli], a
- assert wMenuWatchedKeys + 1 == wLastMenuItem
+ ASSERT wMenuWatchedKeys + 1 == wLastMenuItem
xor a
ld [hl], a
.waitForInputLoop
@@ -741,7 +741,7 @@ LinkMenu:
ld d, " "
ld e, "▷"
ld a, [wLinkMenuSelectionSendBuffer]
- and (B_BUTTON << 2) ; was B button pressed?
+ and B_BUTTON << 2 ; was B button pressed?
jr nz, .updateCursorPosition
; A button was pressed
ld a, [wCurrentMenuItem]
@@ -762,7 +762,7 @@ LinkMenu:
call Func_f59ec
call LoadScreenTilesFromBuffer1
ld a, [wLinkMenuSelectionSendBuffer]
- and (B_BUTTON << 2) ; was B button pressed?
+ and B_BUTTON << 2 ; was B button pressed?
jr nz, .choseCancel ; cancel if B pressed
ld a, [wCurrentMenuItem]
cp $2
diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm
index 817205a9..a8e37ff2 100644
--- a/engine/menus/main_menu.asm
+++ b/engine/menus/main_menu.asm
@@ -278,7 +278,7 @@ CheckForPlayerNameInSRAM:
ld [MBC1SRamEnable], a
ld a, SRAM_BANKING_MODE
ld [MBC1SRamBankingMode], a
- assert SRAM_BANKING_MODE == BANK("Save Data")
+ ASSERT SRAM_BANKING_MODE == BANK("Save Data")
ld [MBC1SRamBank], a
ld b, NAME_LENGTH
ld hl, sPlayerName
diff --git a/engine/minigame/surfing_pikachu.asm b/engine/minigame/surfing_pikachu.asm
index 6d31c7b7..f30d567c 100644
--- a/engine/minigame/surfing_pikachu.asm
+++ b/engine/minigame/surfing_pikachu.asm
@@ -29,9 +29,9 @@ SurfingPikachuMinigame::
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
call ClearObjectAnimationBuffers
call ClearSprites
xor a
@@ -257,8 +257,8 @@ SurfingPikachuMinigame_LoadGFXAndLayout:
ldh [rOBP0], a
ld a, $e0
ldh [rOBP1], a
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
SurfingPikachuMinigame_SetBGPals:
@@ -267,13 +267,13 @@ SurfingPikachuMinigame_SetBGPals:
jr nz, .sgb
ld a, $d0
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ret
.sgb
ld a, $e4
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ret
Func_f81ff:
@@ -2376,8 +2376,8 @@ SurfingPikachuMinigameIntro:
ldh [rOBP0], a
ld a, $e0
ldh [rOBP1], a
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
call DelayFrame
ld a, MUSIC_SURFING_PIKACHU
ld c, BANK(Music_SurfingPikachu)
@@ -2518,9 +2518,9 @@ SurfingPikachuMinigame_BlankPals:
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
SurfingPikachuMinigame_NormalPals:
@@ -2529,9 +2529,9 @@ SurfingPikachuMinigame_NormalPals:
ldh [rOBP0], a
ld a, $e0
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
SurfingPikachu_ClearTileMap:
diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm
index 7a24b0b8..22006e6a 100644
--- a/engine/movie/credits.asm
+++ b/engine/movie/credits.asm
@@ -21,7 +21,7 @@ HallOfFamePC:
call FillFourRowsWithBlack
ld a, %11000000
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
call EnableLCD
call StopAllMusic
ld hl, vBGMap1
@@ -46,7 +46,7 @@ FadeInCreditsText:
.loop
ld a, [hli]
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld c, 5
call DelayFrames
dec b
@@ -78,7 +78,7 @@ DisplayCreditsMon:
call CreditsCopyTileMapToVRAM
ld a, %11111100 ; make the mon a black silhouette
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld hl, rLCDC
res rLCDC_BG_TILEMAP, [hl]
ld a, 1
@@ -94,7 +94,7 @@ DisplayCreditsMon:
call ScrollCreditsMonLeft
ld a, %11000000
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
xor a
ldh [hSCX], a
ret
diff --git a/engine/movie/hall_of_fame.asm b/engine/movie/hall_of_fame.asm
index 5be7d8c5..670c8261 100644
--- a/engine/movie/hall_of_fame.asm
+++ b/engine/movie/hall_of_fame.asm
@@ -121,7 +121,7 @@ HoFShowMonOrPlayer:
call RunPaletteCommand
ld a, %11100100
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld c, $31 ; back pic
call HoFLoadMonPlayerPicTileIDs
ld d, $a0
diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm
index ef2374da..33a3a134 100644
--- a/engine/movie/intro.asm
+++ b/engine/movie/intro.asm
@@ -85,7 +85,7 @@ PlayShootingStar:
farcall LoadCopyrightAndTextBoxTiles
ldpal a, SHADE_BLACK, SHADE_DARK, SHADE_LIGHT, SHADE_WHITE
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld c, 180
call DelayFrames
call ClearScreen
@@ -122,6 +122,7 @@ PlayShootingStar:
call DelayFrames
farcall AnimateShootingStar
push af
+ ; A `call LoadPresentsGraphic` here was removed in localization
pop af
jr c, .next ; skip the delay if the user interrupted the animation
ld c, 40
@@ -147,7 +148,11 @@ IntroDrawBlackBars:
ld c, BG_MAP_WIDTH * 4
jp IntroPlaceBlackTiles
-EmptyFunc2:
+LoadPresentsGraphic: ; unreferenced
+ ; This routine loaded the "PRESENTS" text graphic (tiles
+ ; $67, $68, $69, $6A, $6B, and $6C from gamefreak_presents.2bpp)
+ ; at coordinates (11, 7) in the Japanese versions.
+ ; It was dummied out in the English localization.
ret
GameFreakIntro:
diff --git a/engine/movie/intro_yellow.asm b/engine/movie/intro_yellow.asm
index 043ff068..4e8282bc 100644
--- a/engine/movie/intro_yellow.asm
+++ b/engine/movie/intro_yellow.asm
@@ -143,9 +143,9 @@ YellowIntroScene0:
ldh [rOBP0], a
ld a, $c4
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ld a, 130
ld [wYellowIntroSceneTimer], a
call YellowIntro_NextScene
@@ -198,7 +198,7 @@ YellowIntroScene2_PlaceGraphic:
add $10
dec b
jr nz, .row
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
jr z, .dmg_sgb
; We can actually set palettes!
@@ -278,7 +278,7 @@ YellowIntroScene4:
call YellowIntro_BlankPalsDelay2AndDisableLCD
ld c, $5
call UpdateMusicCTimes
- ldh a, [hGBC]
+ ldh a, [hOnCGB]
and a
jr z, .dmg_sgb
; We can actually set palettes!
@@ -566,9 +566,9 @@ YellowIntroScene14:
ldh [rOBP0], a
and $f0
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
.expired
@@ -596,8 +596,8 @@ YellowIntroScene14:
ld a, $e4
ldh [rOBP0], a
ldh [rBGP], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
lb de, $58, $58
ld a, $7
call YellowIntro_SpawnAnimatedObjectAndSavePointer
@@ -619,8 +619,8 @@ YellowIntroScene15:
ldh a, [rBGP]
xor $3
ldh [rBGP], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
ret
.expired
@@ -629,8 +629,8 @@ YellowIntroScene15:
ld a, $e4
ldh [rBGP], a
ldh [rOBP0], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
call YellowIntro_NextScene
YellowIntroScene16:
ld de, YellowIntroPalSequence_f9e0a
@@ -638,8 +638,8 @@ YellowIntroScene16:
jr c, .expired
ldh [rOBP0], a
ldh [rBGP], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
ret
.expired
@@ -750,9 +750,9 @@ YellowIntro_BlankPalsDelay2AndDisableLCD:
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
call DelayFrame
call DelayFrame
call DisableLCD
@@ -773,9 +773,9 @@ Func_f9e9a:
ldh [rOBP0], a
ld a, $e0
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
YellowIntro_Copy8BitSineWave:
@@ -922,9 +922,9 @@ YellowIntro_BlankPalettes:
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
- call UpdateGBCPal_BGP
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_BGP
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ret
YellowIntro_AnimatedObjectSpawnStateData:
diff --git a/engine/movie/oak_speech/init_player_data.asm b/engine/movie/oak_speech/init_player_data.asm
index d393b333..9994be51 100644
--- a/engine/movie/oak_speech/init_player_data.asm
+++ b/engine/movie/oak_speech/init_player_data.asm
@@ -39,7 +39,7 @@ DEF START_MONEY EQU $3000
ld hl, wObtainedBadges
ld [hli], a
- assert wObtainedBadges + 1 == wUnusedObtainedBadges
+ ASSERT wObtainedBadges + 1 == wUnusedObtainedBadges
ld [hl], a
ld hl, wPlayerCoins
diff --git a/engine/movie/oak_speech/oak_speech.asm b/engine/movie/oak_speech/oak_speech.asm
index 6cdf3e56..1591fefc 100644
--- a/engine/movie/oak_speech/oak_speech.asm
+++ b/engine/movie/oak_speech/oak_speech.asm
@@ -190,7 +190,7 @@ FadeInIntroPic:
.next
ld a, [hli]
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld c, 10
call DelayFrames
dec b
@@ -212,7 +212,7 @@ MovePicLeft:
ld a, %11100100
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
.next
call DelayFrame
ldh a, [rWX]
diff --git a/engine/movie/splash.asm b/engine/movie/splash.asm
index b393d319..6d9b9be9 100644
--- a/engine/movie/splash.asm
+++ b/engine/movie/splash.asm
@@ -3,8 +3,8 @@ LoadShootingStarGraphics:
ldh [rOBP0], a
ld a, $a4
ldh [rOBP1], a
- call UpdateGBCPal_OBP0
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP0
+ call UpdateCGBPal_OBP1
ld de, MoveAnimationTiles1 tile 3 ; star tile (top left quadrant)
ld hl, vChars1 tile $20
lb bc, BANK(MoveAnimationTiles1), 1
@@ -77,7 +77,7 @@ AnimateShootingStar:
ld hl, rOBP0
rrc [hl]
rrc [hl]
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
ld c, 10
call CheckForUserInterruption
ret c
@@ -220,7 +220,7 @@ MoveDownSmallStars:
ldh a, [rOBP1]
xor %10100000
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
ld c, 3
call CheckForUserInterruption
ret c
diff --git a/engine/movie/title.asm b/engine/movie/title.asm
index 2c4b61fb..96ce948c 100644
--- a/engine/movie/title.asm
+++ b/engine/movie/title.asm
@@ -13,9 +13,9 @@ PrepareTitleScreen::
ld [wLetterPrintingDelayFlags], a
ld hl, wStatusFlags6
ld [hli], a
- assert wStatusFlags6 + 1 == wStatusFlags7
+ ASSERT wStatusFlags6 + 1 == wStatusFlags7
ld [hli], a
- assert wStatusFlags7 + 1 == wElite4Flags
+ ASSERT wStatusFlags7 + 1 == wElite4Flags
ld [hl], a
ld a, BANK(Music_TitleScreen)
ld [wAudioROMBank], a
@@ -76,7 +76,7 @@ DisplayTitleScreen:
call GBPalNormal
ld a, %11100000
ldh [rOBP0], a
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
; make pokemon logo bounce up and down
ld bc, hSCY ; background scroll Y
diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm
index be826996..dfbe643f 100644
--- a/engine/movie/trade.asm
+++ b/engine/movie/trade.asm
@@ -183,7 +183,7 @@ LoadTradingGFXAndMonNames:
ld a, $f0 ; SGB OBP0
.next
ldh [rOBP0], a
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
call EnableLCD
xor a
ldh [hAutoBGTransferEnabled], a
@@ -201,7 +201,7 @@ LoadTradingGFXAndMonNames:
Trade_LoadMonPartySpriteGfx:
ld a, %11010000
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
farjp LoadMonPartySpriteGfx
Trade_SwapNames:
@@ -305,7 +305,7 @@ Trade_AnimateBallEnteringLinkCable:
call DelayFrames
ld a, %11100100
ldh [rOBP0], a
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
xor a
ld [wLinkCableAnimBulgeToggle], a
lb bc, $20, $60
@@ -386,7 +386,7 @@ Trade_AnimLeftToRight:
ld [wTradedMonMovingRight], a
ld a, %11100100
ldh [rOBP0], a
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
ld a, $54
ld [wBaseCoordX], a
ld a, $1c
@@ -604,7 +604,7 @@ Trade_AnimCircledMon:
ldh a, [rBGP]
xor $3c ; make link cable flash
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld hl, wShadowOAMSprite00TileID
ld de, $4
ld c, $14
diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm
index d26832ec..76821045 100644
--- a/engine/overworld/cut.asm
+++ b/engine/overworld/cut.asm
@@ -76,7 +76,7 @@ InitCutAnimOAM:
ld [wWhichAnimationOffsets], a
ld a, %11100100
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
ld a, [wCutTile]
cp $52
jr z, .grass
diff --git a/engine/overworld/cut2.asm b/engine/overworld/cut2.asm
index 3cbd05b4..a6effff5 100644
--- a/engine/overworld/cut2.asm
+++ b/engine/overworld/cut2.asm
@@ -18,7 +18,7 @@ AnimCut:
ldh a, [rOBP1]
xor $64
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
call DelayFrame
pop bc
dec c
@@ -69,7 +69,7 @@ AnimCutGrass_UpdateOAMEntries:
ldh a, [rOBP1]
xor $64
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
call DelayFrame
pop bc
dec c
diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm
index 220d5794..669e1166 100644
--- a/engine/overworld/dust_smoke.asm
+++ b/engine/overworld/dust_smoke.asm
@@ -7,7 +7,7 @@ AnimateBoulderDust:
ld [wUpdateSpritesEnabled], a
ld a, %11100100
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
call LoadSmokeTileFourTimes
farcall WriteCutOrBoulderDustAnimationOAMBlock
ld c, 8 ; number of steps in animation
@@ -22,7 +22,7 @@ AnimateBoulderDust:
ldh a, [rOBP1]
xor %01100100
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
call Delay3
pop bc
dec c
diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm
index 3bd739b7..dfc6b97b 100644
--- a/engine/overworld/healing_machine.asm
+++ b/engine/overworld/healing_machine.asm
@@ -12,7 +12,7 @@ AnimateHealingMachine:
push af
ld a, $e0
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
ld hl, wShadowOAMSprite33
ld de, PokeCenterOAMData
call CopyHealingMachineOAM
@@ -54,7 +54,7 @@ AnimateHealingMachine:
call DelayFrames
pop af
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
pop hl
pop af
ld [hl], a
@@ -81,7 +81,7 @@ FlashSprite8Times:
ldh a, [rOBP1]
xor d
ldh [rOBP1], a
- call UpdateGBCPal_OBP1
+ call UpdateCGBPal_OBP1
ld c, 10
call DelayFrames
dec b
diff --git a/engine/overworld/player_state.asm b/engine/overworld/player_state.asm
index 1da1b36d..d29a5425 100644
--- a/engine/overworld/player_state.asm
+++ b/engine/overworld/player_state.asm
@@ -396,7 +396,7 @@ CheckForBoulderCollisionWithSprites:
ld a, [hli]
ld b, a
ldh a, [hPlayerFacing]
- assert BIT_FACING_DOWN == 0
+ ASSERT BIT_FACING_DOWN == 0
rrca
jr c, .pushingDown
; pushing up
diff --git a/engine/overworld/trainer_sight.asm b/engine/overworld/trainer_sight.asm
index f32b558a..da845fda 100644
--- a/engine/overworld/trainer_sight.asm
+++ b/engine/overworld/trainer_sight.asm
@@ -97,8 +97,8 @@ TrainerWalkUpToPlayer::
swap a
dec a
ld c, a ; bc = steps yet to go to reach player
- xor a
- ld b, a ; a = direction to go to
+ xor a ; NPC_MOVEMENT_DOWN
+ ld b, a
jr .writeWalkScript
.facingUp
ld a, [wTrainerScreenY]
@@ -111,7 +111,7 @@ TrainerWalkUpToPlayer::
dec a
ld c, a ; bc = steps yet to go to reach player
ld b, $0
- ld a, $40 ; a = direction to go to
+ ld a, NPC_MOVEMENT_UP
jr .writeWalkScript
.facingRight
ld a, [wTrainerScreenX]
@@ -124,7 +124,7 @@ TrainerWalkUpToPlayer::
dec a
ld c, a ; bc = steps yet to go to reach player
ld b, $0
- ld a, $c0 ; a = direction to go to
+ ld a, NPC_MOVEMENT_RIGHT
jr .writeWalkScript
.facingLeft
ld a, [wTrainerScreenX]
@@ -137,7 +137,7 @@ TrainerWalkUpToPlayer::
dec a
ld c, a ; bc = steps yet to go to reach player
ld b, $0
- ld a, $80 ; a = direction to go to
+ ld a, NPC_MOVEMENT_LEFT
.writeWalkScript
ld hl, wNPCMovementDirections2
ld de, wNPCMovementDirections2
diff --git a/engine/pikachu/pikachu_pic_animation.asm b/engine/pikachu/pikachu_pic_animation.asm
index 8abbb1f9..56ad6436 100644
--- a/engine/pikachu/pikachu_pic_animation.asm
+++ b/engine/pikachu/pikachu_pic_animation.asm
@@ -845,7 +845,7 @@ PikaPicAnimCommand_thunderbolt:
.UpdatePal:
ld a, b
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
call DelayFrames
ret
diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm
index 981dd10e..25a4d0a1 100644
--- a/engine/pokemon/evos_moves.asm
+++ b/engine/pokemon/evos_moves.asm
@@ -99,7 +99,7 @@ Evolution_PartyMonLoop: ; loop over party mons
jp nz, .nextEvoEntry1 ; don't evolve if we're in a battle as wCurPartySpecies could be holding the last mon sent out
ld b, a ; evolution item
- ld a, [wCurItem]
+ ld a, [wCurItem] ; same as [wCurPartySpecies]
cp b ; was the evolution item in this entry used?
jp nz, .nextEvoEntry1 ; if not, go to the next evolution entry
.checkLevel
@@ -264,7 +264,7 @@ Evolution_PartyMonLoop: ; loop over party mons
RenameEvolvedMon:
; Renames the mon to its new, evolved form's standard name unless it had a
; nickname, in which case the nickname is kept.
- assert wCurSpecies == wNameListIndex ; save+restore wCurSpecies while using wNameListIndex
+ ASSERT wCurSpecies == wNameListIndex ; save+restore wCurSpecies while using wNameListIndex
ld a, [wCurSpecies]
push af
ld a, [wMonHIndex]
diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm
index fd7a7466..9ad5aa6d 100644
--- a/engine/slots/slot_machine.asm
+++ b/engine/slots/slot_machine.asm
@@ -1,7 +1,7 @@
PromptUserToPlaySlots:
call SaveScreenTilesToBuffer2
ld a, BANK(DisplayTextIDInit)
- assert BANK(DisplayTextIDInit) == 1 << BIT_NO_AUTO_TEXT_BOX
+ ASSERT BANK(DisplayTextIDInit) == 1 << BIT_NO_AUTO_TEXT_BOX
ld [wAutoTextBoxDrawingControl], a ; 1 << BIT_NO_AUTO_TEXT_BOX
ld b, a ; BANK(DisplayTextIDInit)
ld hl, DisplayTextIDInit
@@ -28,7 +28,7 @@ PromptUserToPlaySlots:
call GBPalNormal
ld a, $e4
ldh [rOBP0], a
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
ld hl, wStatusFlags5
set BIT_NO_TEXT_DELAY, [hl]
xor a
@@ -299,8 +299,8 @@ SlotMachine_StopWheel1Early:
cp HIGH(SLOTSCHERRY)
jr nz, .stopWheel
ret
-; It looks like this was intended to make the wheel stop when a 7 symbol was
-; visible, but it has a bug and so the wheel stops randomly.
+; Bug: This looks intended to make the wheel stop when a
+; 7 symbol was visible, but instead the wheel stops randomly.
.sevenAndBarMode
ld c, $3
.loop
@@ -459,7 +459,7 @@ SlotMachine_CheckForMatches:
ldh a, [rBGP]
xor $40
ldh [rBGP], a
- call UpdateGBCPal_BGP
+ call UpdateCGBPal_BGP
ld c, 5
call DelayFrames
dec b
@@ -476,7 +476,7 @@ SlotMachine_CheckForMatches:
call SlotMachine_PrintPayoutCoins
ld a, $e4
ldh [rOBP0], a
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
jp .done
SymbolLinedUpSlotMachineText:
@@ -702,7 +702,7 @@ SlotMachine_PayCoinsToPlayer:
ldh a, [rOBP0]
xor $40 ; make the slot wheel symbols flash
ldh [rOBP0], a
- call UpdateGBCPal_OBP0
+ call UpdateCGBPal_OBP0
ld a, 5
.skip1
ld [wAnimCounter], a