shithub: pokered

Download patch

ref: dee494304392bdb9504560438dc5374f0db5b906
parent: f671ebc14350eb3fb9c2c9ea23b837ec7aa5c790
author: yenatch <yenatch@gmail.com>
date: Sun Dec 8 09:58:05 EST 2013

finish off wram labels and fix up mistaken label overloads

--- a/main.asm
+++ b/main.asm
@@ -11282,7 +11282,7 @@
 	ld a,[$cc49]
 	cp a,$01
 	jr c,.getMonEntry
-	ld hl,$d8a4 ; enemy pokemon 1 data
+	ld hl,wEnemyMons ; enemy pokemon 1 data
 	jr z,.getMonEntry
 	cp a,$02
 	ld hl,W_BOXMON1DATA ; box pokemon 1 data
@@ -13088,7 +13088,7 @@
 	inc de
 	dec c
 	jr nz, .asm_5446
-	ld de, W_ENEMYMONCOUNT ; $d89c
+	ld de, wEnemyPartyCount ; $d89c
 	ld bc, $194
 .asm_5456
 	ld a, [hli]
@@ -13266,7 +13266,7 @@
 	ld hl, Func_39bd5
 	ld b, $e
 	call Bankswitch
-	ld hl, $d8a4
+	ld hl, wEnemyMons
 	call Func_57d6
 	jp .asm_565b
 .asm_55b0
@@ -13677,7 +13677,7 @@
 	ld de, $cd4e
 	ld bc, $000b
 	call CopyData
-	ld hl, $d8a4
+	ld hl, wEnemyMons
 	ld a, [$cd3e]
 	ld bc, $002c
 	call AddNTimes
@@ -13707,7 +13707,7 @@
 	add hl, de
 	ld a, [hl]
 	ld [$cf91], a
-	ld hl, $d8a4
+	ld hl, wEnemyMons
 	ld a, c
 	ld bc, $002c
 	call AddNTimes
@@ -30109,7 +30109,7 @@
 	ld a, [$cc49]
 	and $f
 	jr z, .asm_f2f2
-	ld de, W_ENEMYMONCOUNT ; $d89c
+	ld de, wEnemyPartyCount ; $d89c
 .asm_f2f2
 	ld a, [de]
 	inc a
@@ -30158,7 +30158,7 @@
 	ld a, [$cc49]
 	and $f
 	jr z, .asm_f34c
-	ld hl, W_WATERRATE ; $d8a4
+	ld hl, wEnemyMons ; $d8a4
 .asm_f34c
 	ld a, [$FF00+$e4]
 	dec a
@@ -54969,7 +54969,7 @@
 	ld a, [$d11b]
 	cp $1
 	jr nz, .asm_39be6
-	ld hl, W_ENEMYMONCOUNT ; $d89c
+	ld hl, wEnemyPartyCount ; $d89c
 	ld de, $d9ac
 	ld a, $6
 	jr .asm_39c18
@@ -55040,10 +55040,10 @@
 	and a
 	ret nz
 
-; set [W_ENEMYMONCOUNT] to 0, [$D89D] to FF
+; set [wEnemyPartyCount] to 0, [$D89D] to FF
 ; XXX first is total enemy pokemon?
 ; XXX second is species of first pokemon?
-	ld hl,W_ENEMYMONCOUNT
+	ld hl,wEnemyPartyCount
 	xor a
 	ld [hli],a
 	dec a
@@ -56303,7 +56303,7 @@
 	jp DecrementAICount
 
 Function672A: ; 3a72a (e:672a)
-	ld a,[W_ENEMYMONCOUNT]
+	ld a,[wEnemyPartyCount]
 	ld c,a
 	ld hl,W_ENEMYMON1HP
 
@@ -56527,8 +56527,8 @@
 
 SetupEnemyPartyPokeballs: ; 3a887 (e:6887)
 	call Func_3a919
-	ld hl, $d8a4
-	ld de, W_ENEMYMONCOUNT ; $d89c
+	ld hl, wEnemyMons
+	ld de, wEnemyPartyCount ; $d89c
 	call SetupPokeballs
 	ld hl, W_BASECOORDX ; $d081
 	ld a, $48
@@ -56666,8 +56666,8 @@
 	ld [$cd3e], a
 	ld hl, wOAMBuffer
 	call Func_3a8e1
-	ld hl, W_WATERRATE ; $d8a4
-	ld de, W_ENEMYMONCOUNT ; $d89c
+	ld hl, wEnemyMons ; $d8a4
+	ld de, wEnemyPartyCount ; $d89c
 	call SetupPokeballs
 	ld hl, W_BASECOORDX ; $d081
 	ld a, $50
@@ -59813,7 +59813,7 @@
 	ld [$cd6a], a
 	inc a
 	ld [$d11d], a
-	ld hl, W_WATERMONS ; $d8a5 (aliases: W_ENEMYMON1HP)
+	ld hl, W_ENEMYMON1HP ; $d8a5
 	ld bc, $2b
 	ld d, $3
 .asm_3c134
@@ -60527,10 +60527,10 @@
 	ret
 
 Func_3c64f: ; 3c64f (f:464f)
-	ld a, [W_ENEMYMONCOUNT] ; $d89c
+	ld a, [wEnemyPartyCount] ; $d89c
 	ld b, a
 	xor a
-	ld hl, W_WATERMONS ; $d8a5 (aliases: W_ENEMYMON1HP)
+	ld hl, W_ENEMYMON1HP ; $d8a5
 	ld de, $2c
 .asm_3c65a
 	or [hl]
@@ -61303,7 +61303,7 @@
 Func_3cc13: ; 3cc13 (f:4c13)
 	ld a, [wWhichPokemon] ; $cf92
 	ld bc, $2c
-	ld hl, W_WATERRATE ; $d8a4
+	ld hl, wEnemyMons ; $d8a4
 	call AddNTimes
 	ld de, $cfe5
 	ld bc, $c
--- a/wram.asm
+++ b/wram.asm
@@ -1319,59 +1319,112 @@
 
 	ds 27
 
+
+W_FLAGS_D733: ; d733
 ; bit 4: use variable [W_CURMAPSCRIPT] instead of the provided index for next frame's map script (used to start battle when talking to trainers)
-W_FLAGS_D733 EQU $D733
+	ds 340
 
+W_GRASSRATE: ; d887
+	ds 1
 
-W_GRASSRATE EQU $D887
-W_GRASSMONS EQU $D888
-W_WATERRATE EQU $D8A4 ; OVERLOADED
-W_WATERMONS EQU $D8A5 ; OVERLOADED
+W_GRASSMONS: ; d888
+	ds 20
 
-W_ENEMYMONCOUNT  EQU $D89C
+wEnemyPartyCount: ; d89c
+	ds 1
+wEnemyPartyMons: ; d89d
+	ds 6
+	ds 1 ; end
 
-W_ENEMYMON1HP EQU $D8A5 ; 16 bits
+; Overload enemy party data
+W_WATERRATE EQU $d8a4
+W_WATERMONS EQU $d8a5
 
-W_ENEMYMON1MOVE3 EQU $D8AE
+wEnemyMons:
 
-W_ENEMYMON2MOVE3 EQU $D8DA
+wEnemyMon1: ; d8a4
+wEnemyMon1Species: ; d8a4
+	ds 1
+W_ENEMYMON1HP: ; d8a5
+	ds 2
 
-W_ENEMYMON3MOVE3 EQU $D906
+	ds 7
 
-W_ENEMYMON4MOVE3 EQU $D932
+W_ENEMYMON1MOVE3: ; d8ae
+	ds 44
+W_ENEMYMON2MOVE3: ; d8da
+	ds 44
+W_ENEMYMON3MOVE3: ; d906
+	ds 44
+W_ENEMYMON4MOVE3: ; d932
+	ds 44
+W_ENEMYMON5MOVE3: ; d95e
+	ds 44
+W_ENEMYMON6MOVE3: ; d98a
+	ds 34
 
-W_ENEMYMON5MOVE3 EQU $D95E
+W_ENEMYMON1OT: ; d9ac
+	ds 11
+W_ENEMYMON2OT: ; d9b7
+	ds 11
+W_ENEMYMON3OT: ; d9c2
+	ds 11
+W_ENEMYMON4OT: ; d9cd
+	ds 11
+W_ENEMYMON5OT: ; d9d8
+	ds 11
+W_ENEMYMON6OT: ; d9e3
+	ds 11
 
-W_ENEMYMON6MOVE3 EQU $D98A
+W_ENEMYMON1NAME: ; d9ee
+	ds 11
+W_ENEMYMON2NAME: ; d9f9
+	ds 11
+W_ENEMYMON3NAME: ; da04
+	ds 11
+W_ENEMYMON4NAME: ; da0f
+	ds 11
+W_ENEMYMON5NAME: ; da1a
+	ds 11
+W_ENEMYMON6NAME: ; da25
+	ds 11
 
-W_ENEMYMON1OT    EQU $D9AC
-W_ENEMYMON2OT    EQU $D9B7
-W_ENEMYMON3OT    EQU $D9C2
-W_ENEMYMON4OT    EQU $D9CD
-W_ENEMYMON5OT    EQU $D9D8
-W_ENEMYMON6OT    EQU $D9E3
+W_TRAINERHEADERPTR: ; da30
+	ds 2
 
-W_ENEMYMON1NAME     EQU $D9EE
-W_ENEMYMON2NAME     EQU $D9F9
-W_ENEMYMON3NAME     EQU $DA04
-W_ENEMYMON4NAME     EQU $DA0F
-W_ENEMYMON5NAME     EQU $DA1A
-W_ENEMYMON6NAME     EQU $DA25 ; to $da2f
-W_TRAINERHEADERPTR  EQU $DA30
+	ds 7
 
+W_CURMAPSCRIPT: ; da39
 ; index of current map script, mostly used as index for function pointer array
 ; mostly copied from map-specific map script pointer and wirtten back later
-W_CURMAPSCRIPT      EQU $DA39
+	ds 1
 
-W_PLAYTIMEHOURS     EQU $DA40 ; two bytes
-W_PLAYTIMEMINUTES   EQU $DA42 ; two bytes
-W_PLAYTIMESECONDS   EQU $DA44 ; one byte
-W_PLAYTIMEFRAMES    EQU $DA45 ; one byte
+	ds 6
 
-W_NUMSAFARIBALLS EQU $DA47
+W_PLAYTIMEHOURS: ; da40
+	ds 2
+W_PLAYTIMEMINUTES: ; da42
+	ds 2
+W_PLAYTIMESECONDS: ; da44
+	ds 1
+W_PLAYTIMEFRAMES: ; da45
+	ds 1
 
+	ds 1
+
+W_NUMSAFARIBALLS: ; da47
+	ds 1
+
+	ds 56
+
+W_NUMINBOX: ; da80
 ; number of mons in current box
-W_NUMINBOX    EQU $DA80
-W_BOXMON1DATA EQU $DA96
-W_BOXMON2DATA EQU $DAB7
+	ds 22
+
+W_BOXMON1DATA: ; da96
+	ds 33
+W_BOXMON2DATA: ; dab7
+	ds 33 * 19
+
+; dd2a