shithub: pokecrystal

Download patch

ref: 46d96bc7fdd3f8f190f7ae9af7d1abc725a29648
parent: 708df7907f7dd52daea1087e01d5a446293ac7ea
author: yenatch <[email protected]>
date: Mon Dec 9 11:20:19 EST 2013

more battle anim labels

--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -10635,7 +10635,7 @@
 	push hl
 	push de
 	push bc
-	callba Function4ea44
+	callba CheckBattleScene
 	pop bc
 	pop de
 	pop hl
--- a/constants/wram_constants.asm
+++ b/constants/wram_constants.asm
@@ -5,6 +5,10 @@
 BOXMON     EQU 2
 WILDMON    EQU 4
 
+; Options: ; cfcc
+BATTLE_SHIFT EQU 6
+BATTLE_SCENE EQU 7
+
 ; WalkingDirection: ; d043
 STANDING EQU -1
 DOWN     EQU 0
--- a/main.asm
+++ b/main.asm
@@ -42334,7 +42334,7 @@
 	ld bc, TempMonSpecies
 	callba Function4e53f
 	jr c, .asm_3d82c
-	callba Function4ea44
+	callba CheckBattleScene
 	jr c, .asm_3d821
 	ld hl, $c4ac
 	ld d, $0
@@ -48075,7 +48075,7 @@
 	callba CheckSleepingTreeMon
 	jr c, .asm_3fceb
 
-	callba Function4ea44
+	callba CheckBattleScene
 	jr c, .asm_3fce0
 
 	hlcoord 12, 0
@@ -60076,30 +60076,37 @@
 
 
 
-Function4ea44: ; 4ea44
-	ld a, $0
+CheckBattleScene: ; 4ea44
+; Return carry if battle scene is turned off.
+
+	ld a, 0
 	ld hl, InLinkBattle
 	call GetFarWRAMByte
-	cp $4
-	jr z, .asm_4ea59
+	cp 4
+	jr z, .mobile
+
 	ld a, [Options]
-	bit 7, a
-	jr nz, .asm_4ea80
+	bit BATTLE_SCENE, a
+	jr nz, .off
+
 	and a
 	ret
 
-.asm_4ea59
+.mobile
 	ld a, [$cd2f]
 	and a
 	jr nz, .asm_4ea72
+
 	ld a, $4
 	call GetSRAMBank
 	ld a, [$a60c]
 	ld c, a
 	call CloseSRAM
+
 	ld a, c
 	bit 0, c
-	jr z, .asm_4ea80
+	jr z, .off
+
 	and a
 	ret
 
@@ -60108,11 +60115,12 @@
 	ld hl, $dc00
 	call GetFarWRAMByte
 	bit 0, a
-	jr z, .asm_4ea80
+	jr z, .off
+
 	and a
 	ret
 
-.asm_4ea80
+.off
 	scf
 	ret
 ; 4ea82
@@ -87190,13 +87198,13 @@
 
 	ld c, 6
 .wait
-	call Functioncc1fb
+	call BattleAnimDelayFrame
 	dec c
 	jr nz, .wait
 
-	call Functioncc8a4
-	call Functioncc1e2
-	call Functioncc1fb
+	call BattleAnimAssignPals
+	call BattleAnimRequestPals
+	call BattleAnimDelayFrame
 
 	ld c, 1
 	ld a, [rKEY1]
@@ -87218,9 +87226,9 @@
 	ld a, $1
 	ld [hBGMapMode], a
 
-	call Functioncc1fb
-	call Functioncc1fb
-	call Functioncc1fb
+	call BattleAnimDelayFrame
+	call BattleAnimDelayFrame
+	call BattleAnimDelayFrame
 	call WaitSFX
 	ret
 ; cc11c
@@ -87231,20 +87239,20 @@
 	and a
 	jr nz, .asm_cc156
 
-	callba Function4ea44
+	callba CheckBattleScene
 	jr c, .asm_cc141
 
-	call Functioncc1a1
+	call BattleAnimClearHud
 	call Functioncc163
 
-	call Functioncc8a4
-	call Functioncc1e2
+	call BattleAnimAssignPals
+	call BattleAnimRequestPals
 
 	xor a
 	ld [hSCX], a
 	ld [hSCY], a
-	call Functioncc1fb
-	call Functioncc1bb
+	call BattleAnimDelayFrame
+	call BattleAnimRestoreHuds
 
 .asm_cc141
 	ld a, [$cfca]
@@ -87253,7 +87261,7 @@
 
 	ld l, a
 	ld h, 0
-	ld de, $010e
+	ld de, $10e
 	add hl, de
 	ld a, l
 	ld [FXAnimIDLo], a
@@ -87274,12 +87282,12 @@
 
 	call Functioncc8d3
 
-.asm_cc166
+.playframe
 	call Functioncc25f
 	call Functionccb48
 	call Functioncc96e
 	call Function3b0c
-	call Functioncc1e2
+	call BattleAnimRequestPals
 
 ; Speed up Rollout's animation on consecutive turns.
 	ld a, [FXAnimIDHi]
@@ -87293,7 +87301,7 @@
 	ld a, $2e
 	ld b, 5
 	ld de, 4
-	ld hl, $d3fa
+	ld hl, ActiveBGEffects
 .asm_cc18c
 	cp [hl]
 	jr z, .asm_cc196
@@ -87302,33 +87310,34 @@
 	jr nz, .asm_cc18c
 
 .asm_cc193
-	call Functioncc1fb
+	call BattleAnimDelayFrame
 
 .asm_cc196
 	ld a, [$d40f]
 	bit 0, a
-	jr z, .asm_cc166
+	jr z, .playframe
 
 	call Functioncc23d
 	ret
 ; cc1a1
 
-Functioncc1a1: ; cc1a1
-	call Functioncc1fb
+BattleAnimClearHud: ; cc1a1
+
+	call BattleAnimDelayFrame
 	call WaitTop
 	call ClearActorHud
 	ld a, $1
 	ld [hBGMapMode], a
-	call Functioncc1fb
-	call Functioncc1fb
-	call Functioncc1fb
+	call BattleAnimDelayFrame
+	call BattleAnimDelayFrame
+	call BattleAnimDelayFrame
 	call WaitTop
 	ret
 ; cc1bb
 
-Functioncc1bb: ; cc1bb
+BattleAnimRestoreHuds: ; cc1bb
 
-	call Functioncc1fb
+	call BattleAnimDelayFrame
 	call WaitTop
 
 	ld a, [rSVBK]
@@ -87345,14 +87354,14 @@
 
 	ld a, $1
 	ld [hBGMapMode], a
-	call Functioncc1fb
-	call Functioncc1fb
-	call Functioncc1fb
+	call BattleAnimDelayFrame
+	call BattleAnimDelayFrame
+	call BattleAnimDelayFrame
 	call WaitTop
 	ret
 ; cc1e2
 
-Functioncc1e2: ; cc1e2
+BattleAnimRequestPals: ; cc1e2
 
 	ld a, [hCGB]
 	and a
@@ -87372,7 +87381,7 @@
 	ret
 ; cc1fb
 
-Functioncc1fb: ; cc1fb
+BattleAnimDelayFrame: ; cc1fb
 ; Like DelayFrame but wastes battery life.
 
 	ld a, 1
@@ -88512,7 +88521,7 @@
 	ret
 ; cc8a4
 
-Functioncc8a4: ; cc8a4
+BattleAnimAssignPals: ; cc8a4
 	ld a, [hCGB]
 	and a
 	jr nz, .asm_cc8be
@@ -88558,8 +88567,8 @@
 	add hl, de
 	add hl, de
 	call Function3ae1
-	call Functioncc8a4
-	call Functioncc1fb
+	call BattleAnimAssignPals
+	call BattleAnimDelayFrame
 	ret
 ; cc8f6
 
@@ -88575,7 +88584,7 @@
 	xor a
 	ld [hSCX], a
 	ld [hSCY], a
-	call Functioncc1fb
+	call BattleAnimDelayFrame
 	ld a, $1
 	ld [hBGMapMode], a
 	ret
--- a/wram.asm
+++ b/wram.asm
@@ -2144,7 +2144,12 @@
 LYOverridesBackupEnd:
 
 
-SECTION "Battle Animations", WRAMX[$d410], BANK[5]
+SECTION "Battle Animations", WRAMX[$d3fa], BANK[5]
+
+ActiveBGEffects: ; d3fa
+	ds 4 * 5
+
+	ds 2
 
 BattleAnimAddress: ; d410
 	ds 2