shithub: pokecrystal

Download patch

ref: 930d285fab94fde5e061efa80dc41d478f19fcff
parent: 0ae5e9b3986dbbe64870dc1ad29a63b65b96200e
author: mid-kid <esteve.varela@gmail.com>
date: Tue Dec 25 13:49:54 EST 2018

Fix comments around BANK() statements

Found a couple BANK()s that reference multiple labels.

--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -4154,7 +4154,7 @@
 	ld a, [wLastPlayerMon]
 	ld [wCurBattleMon], a
 .do_turn
-	ld a, BANK(DoPlayerTurn)
+	ld a, BANK(DoPlayerTurn) ; and BANK(DoEnemyTurn)
 	rst FarCall
 
 	ld a, BATTLE_VARS_MOVE
@@ -4404,7 +4404,7 @@
 
 .got_pointer
 	call SwitchTurnCore
-	ld a, BANK(CalcEnemyStats)
+	ld a, BANK(CalcPlayerStats) ; and BANK(CalcEnemyStats)
 	rst FarCall
 	call SwitchTurnCore
 	call ItemRecoveryAnim
--- a/engine/battle/move_effects/present.asm
+++ b/engine/battle/move_effects/present.asm
@@ -59,7 +59,7 @@
 	jr z, .got_hp_fn_pointer
 	ld hl, AICheckEnemyMaxHP
 .got_hp_fn_pointer
-	ld a, BANK(AICheckPlayerMaxHP)
+	ld a, BANK(AICheckPlayerMaxHP) ; and BANK(AICheckEnemyMaxHP)
 	rst FarCall
 	jr c, .already_fully_healed
 
--- a/engine/battle_anims/anim_commands.asm
+++ b/engine/battle_anims/anim_commands.asm
@@ -1340,7 +1340,7 @@
 	call DmgToCgbObjPals
 	ret
 
-ClearBattleAnims:
+ClearBattleAnims::
 ; Clear animation block
 	ld hl, wLYOverrides
 	ld bc, wBattleAnimEnd - wLYOverrides
--- a/engine/events/print_unown.asm
+++ b/engine/events/print_unown.asm
@@ -19,7 +19,7 @@
 
 	ld de, UnownDexATile
 	ld hl, vTiles0 tile UNOWNSTAMP_BOLD_A
-	lb bc, BANK(UnownDexBTile), 1
+	lb bc, BANK(UnownDexATile), 1
 	call Request1bpp
 
 	ld de, UnownDexBTile
--- a/home/battle.asm
+++ b/home/battle.asm
@@ -190,7 +190,8 @@
 	ld a, [hl]
 	ld [wBattleAnimAddress + 1], a
 
-	ld a, BANK(BattleAnimCommands)
+	; ClearBattleAnims is the only function that calls this...
+	ld a, BANK(ClearBattleAnims)
 	rst Bankswitch
 
 	ret
--- a/home/init.asm
+++ b/home/init.asm
@@ -97,7 +97,7 @@
 	call ClearSprites
 	call ClearsScratch
 
-	ld a, BANK(WriteOAMDMACodeToHRAM)
+	ld a, BANK(GameInit) ; and BANK(WriteOAMDMACodeToHRAM)
 	rst Bankswitch
 
 	call WriteOAMDMACodeToHRAM
--- a/home/scrolling_menu.asm
+++ b/home/scrolling_menu.asm
@@ -3,7 +3,7 @@
 	ldh a, [hROMBank]
 	push af
 
-	ld a, BANK(_ScrollingMenu)
+	ld a, BANK(_ScrollingMenu) ; and BANK(_InitScrollingMenu)
 	rst Bankswitch
 
 	call _InitScrollingMenu