shithub: pokecrystal

Download patch

ref: f0346a9982ed2cda3f8d0aa5f14cfb1b8b84602e
parent: d7757676513e9e02fc67d99a7c60c02f74344292
author: yenatch <[email protected]>
date: Fri Mar 22 00:08:47 EDT 2013

various minor additions

-battle variable constants
-step counters
-turn update fns

--- a/constants.asm
+++ b/constants.asm
@@ -3249,6 +3249,8 @@
 MUSIC_BATTLE_TOWER_LOBBY EQU 101
 MUSIC_MOBILE_CENTER EQU 102
 
+MUSIC_MAHOGANY_MART EQU 100 ; grandfathered from gold
+
 ; sound
 _4CH1 EQU $c0
 _3CH1 EQU $80
@@ -3414,6 +3416,30 @@
 BATTLETYPE_TREE EQU $08
 BATTLETYPE_FORCEITEM EQU $0a
 BATTLETYPE_SUICUNE EQU $0c
+
+
+; battle variables
+BATTLE_VARS_SUBSTATUS1 EQU 0
+BATTLE_VARS_SUBSTATUS2 EQU 1
+BATTLE_VARS_SUBSTATUS3 EQU 2
+BATTLE_VARS_SUBSTATUS4 EQU 3
+BATTLE_VARS_SUBSTATUS5 EQU 4
+BATTLE_VARS_SUBSTATUS1_OPP EQU 5
+BATTLE_VARS_SUBSTATUS2_OPP EQU 6
+BATTLE_VARS_SUBSTATUS3_OPP EQU 7
+BATTLE_VARS_SUBSTATUS4_OPP EQU 8
+BATTLE_VARS_SUBSTATUS5_OPP EQU 9
+BATTLE_VARS_STATUS EQU 10
+BATTLE_VARS_STATUS_OPP EQU 11
+BATTLE_VARS_MOVE_ANIM EQU 12
+BATTLE_VARS_MOVE_EFFECT EQU 13
+BATTLE_VARS_MOVE_POWER EQU 14
+BATTLE_VARS_MOVE_TYPE EQU 15
+BATTLE_VARS_MOVE EQU 16
+BATTLE_VARS_LAST_COUNTER_MOVE EQU 17
+BATTLE_VARS_LAST_COUNTER_MOVE_OPP EQU 18
+BATTLE_VARS_LAST_MOVE EQU 19
+BATTLE_VARS_LAST_MOVE_OPP EQU 20
 
 
 ; joypad
--- a/main.asm
+++ b/main.asm
@@ -3415,7 +3415,21 @@
 	jp AddNTimes
 ; 392d
 
-INCBIN "baserom.gbc",$392d,$3b86 - $392d
+INCBIN "baserom.gbc", $392d, $3985 - $392d
+
+SetPlayerTurn: ; 3985
+	xor a
+	ld [hBattleTurn], a
+	ret
+; 3989
+
+SetEnemyTurn: ; 3989
+	ld a, 1
+	ld [hBattleTurn], a
+	ret
+; 398e
+
+INCBIN "baserom.gbc", $398e, $3b86 - $398e
 
 LoadMusicByte: ; 3b86
 ; load music data into CurMusicByte
--- a/wram.asm
+++ b/wram.asm
@@ -565,10 +565,8 @@
 BattleScriptBuffer: ; c68a
 	ds 40
 
-BattleScriptBufferLocLo: ; c6b2
-	ds 1
-BattleScriptBufferLocHi: ; c6b3
-	ds 1
+BattleScriptBufferLoc: ; c6b2
+	ds 2
 
 	ds 25
 
@@ -1286,6 +1284,11 @@
 Box14Name: ; dbea
 	ds 9
 
+SECTION "steps", BSS[$dc73]
+StepCount: ; dc73
+	ds 1
+PoisonStepCount: ; dc74
+	ds 1
 
 SECTION "FlypointPermissions", BSS[$dca5]
 FlypointPerms: ; dca5