ref: 38065a744de1065cc021a4cafe22476f8425448d
parent: 1ee9fb408c47c3a15a38b1bb407d86ed1a5d2fcc
author: dannye <corrnondacqb@yahoo.com>
date: Sun Aug 30 17:38:41 EDT 2015
No more W_
--- a/audio.asm
+++ b/audio.asm
@@ -371,13 +371,13 @@
call PlaySound ; stop music
call DelayFrame
ld c, BANK(Music_GymLeaderBattle)
- ld a, [W_GYMLEADERNO]
+ ld a, [wGymLeaderNo]
and a
jr z, .notGymLeaderBattle
ld a, MUSIC_GYM_LEADER_BATTLE
jr .playSong
.notGymLeaderBattle
- ld a, [W_CUROPPONENT]
+ ld a, [wCurOpponent]
cp 200
jr c, .wildBattle
cp OPP_SONY3
--- a/constants/hide_show_constants.asm
+++ b/constants/hide_show_constants.asm
@@ -2,7 +2,7 @@
; sprites marked with an X are constants that are never used
; because those sprites are not (de)activated in a map's script
; (they are either items or sprites that deactivate after battle
-; and are detected in W_MISSABLEOBJECTLIST)
+; and are detected in wMissableObjectList)
const_value = 0
--- a/constants/wram_constants.asm
+++ b/constants/wram_constants.asm
@@ -1,8 +1,8 @@
SPRITEBUFFERSIZE EQU 7*7 * 8 ; 7 * 7 (tiles) * 8 (bytes per tile)
-; Overload W_GRASSMONS
-wSerialEnemyDataBlock EQU $d893 ; W_GRASSMONS + 11
+; Overload wGrassMons
+wSerialEnemyDataBlock EQU $d893 ; wGrassMons + 11
; Overload enemy party data
W_WATERRATE EQU $d8a4 ; wEnemyMon1Species
--- a/data/hide_show_data.asm
+++ b/data/hide_show_data.asm
@@ -263,7 +263,7 @@
; a) Map_ID = $FF
; b) Map_ID ≠ currentMapID
;
-; This Data is loaded into RAM at wd5ce-$D5F?. (W_MISSABLEOBJECTLIST)
+; This Data is loaded into RAM at wd5ce-$D5F?. (wMissableObjectList)
; These constants come from the bytes for Predef functions:
Hide equ $11
--- a/data/trainer_moves.asm
+++ b/data/trainer_moves.asm
@@ -1,8 +1,8 @@
IF !DEF(YELLOW)
LoneMoves: ; 39d22 (e:5d22)
; these are used for gym leaders.
-; this is not automatic! you have to write the number you want to W_LONEATTACKNO
-; first. e.g., erika's script writes 4 to W_LONEATTACKNO to get mega drain,
+; this is not automatic! you have to write the number you want to wLoneAttackNo
+; first. e.g., erika's script writes 4 to wLoneAttackNo to get mega drain,
; the fourth entry in the list.
; first byte: pokemon in the trainer's party that gets the move
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -4,18 +4,18 @@
ld l,c
ld h,b
ld a,[hli]
- ld [W_NUMFBTILES],a
- ld a,[W_FBDESTADDR + 1]
+ ld [wNumFBTiles],a
+ ld a,[wFBDestAddr + 1]
ld e,a
- ld a,[W_FBDESTADDR]
+ ld a,[wFBDestAddr]
ld d,a
xor a
- ld [W_FBTILECOUNTER],a ; loop counter
+ ld [wFBTileCounter],a ; loop counter
.loop
- ld a,[W_FBTILECOUNTER]
+ ld a,[wFBTileCounter]
inc a
- ld [W_FBTILECOUNTER],a
- ld a,[W_SUBANIMTRANSFORM]
+ ld [wFBTileCounter],a
+ ld a,[wSubAnimTransform]
dec a
jr z,.flipHorizontalAndVertical ; 1
dec a
@@ -23,15 +23,15 @@
dec a
jr z,.flipBaseCoords ; 3
.noTransformation
- ld a,[W_BASECOORDY]
+ ld a,[wBaseCoordY]
add [hl]
ld [de],a ; store Y
inc hl
inc de
- ld a,[W_BASECOORDX]
+ ld a,[wBaseCoordX]
jr .finishCopying
.flipBaseCoords
- ld a,[W_BASECOORDY]
+ ld a,[wBaseCoordY]
ld b,a
ld a,136
sub b ; flip Y base coordinate
@@ -39,11 +39,11 @@
ld [de],a ; store Y
inc hl
inc de
- ld a,[W_BASECOORDX]
+ ld a,[wBaseCoordX]
ld b,a
ld a,168
sub b ; flip X base coordinate
-.finishCopying ; finish copying values to OAM (when [W_SUBANIMTRANSFORM] not 1 or 2)
+.finishCopying ; finish copying values to OAM (when [wSubAnimTransform] not 1 or 2)
add [hl] ; X offset
ld [de],a ; store X
inc hl
@@ -57,7 +57,7 @@
inc de
jp .nextTile
.flipHorizontalAndVertical
- ld a,[W_BASECOORDY]
+ ld a,[wBaseCoordY]
add [hl] ; Y offset
ld b,a
ld a,136
@@ -65,7 +65,7 @@
ld [de],a ; store Y
inc hl
inc de
- ld a,[W_BASECOORDX]
+ ld a,[wBaseCoordX]
add [hl] ; X offset
ld b,a
ld a,168
@@ -95,13 +95,13 @@
inc de
jp .nextTile
.flipHorizontalTranslateDown
- ld a,[W_BASECOORDY]
+ ld a,[wBaseCoordY]
add [hl]
add a,40 ; translate Y coordinate downwards
ld [de],a ; store Y
inc hl
inc de
- ld a,[W_BASECOORDX]
+ ld a,[wBaseCoordX]
add [hl]
ld b,a
ld a,168
@@ -125,24 +125,24 @@
ld [de],a
inc de
.nextTile
- ld a,[W_FBTILECOUNTER]
+ ld a,[wFBTileCounter]
ld c,a
- ld a,[W_NUMFBTILES]
+ ld a,[wNumFBTiles]
cp c
jp nz,.loop ; go back up if there are more tiles to draw
.afterDrawingTiles
- ld a,[W_FBMODE]
+ ld a,[wFBMode]
cp a,2
jr z,.advanceFrameBlockDestAddr; skip delay and don't clean OAM buffer
- ld a,[W_SUBANIMFRAMEDELAY]
+ ld a,[wSubAnimFrameDelay]
ld c,a
call DelayFrames
- ld a,[W_FBMODE]
+ ld a,[wFBMode]
cp a,3
jr z,.advanceFrameBlockDestAddr ; skip cleaning OAM buffer
cp a,4
jr z,.done ; skip cleaning OAM buffer and don't advance the frame block destination address
- ld a,[W_ANIMATIONID]
+ ld a,[wAnimationID]
cp a,GROWL
jr z,.resetFrameBlockDestAddr
call AnimationCleanOAM
@@ -149,15 +149,15 @@
.resetFrameBlockDestAddr
ld hl,wOAMBuffer ; OAM buffer
ld a,l
- ld [W_FBDESTADDR + 1],a
+ ld [wFBDestAddr + 1],a
ld a,h
- ld [W_FBDESTADDR],a ; set destination address to beginning of OAM buffer
+ ld [wFBDestAddr],a ; set destination address to beginning of OAM buffer
ret
.advanceFrameBlockDestAddr
ld a,e
- ld [W_FBDESTADDR + 1],a
+ ld [wFBDestAddr + 1],a
ld a,d
- ld [W_FBDESTADDR],a
+ ld [wFBDestAddr],a
.done
ret
@@ -164,8 +164,8 @@
PlayAnimation: ; 780f1 (1e:40f1)
xor a
ld [$FF8B],a ; it looks like nothing reads this
- ld [W_SUBANIMTRANSFORM],a
- ld a,[W_ANIMATIONID] ; get animation number
+ ld [wSubAnimTransform],a
+ ld a,[wAnimationID] ; get animation number
dec a
ld l,a
ld h,0
@@ -217,7 +217,7 @@
.playSubanimation
ld c,a
and a,%00111111
- ld [W_SUBANIMFRAMEDELAY],a
+ ld [wSubAnimFrameDelay],a
xor a
sla c
rla
@@ -235,9 +235,9 @@
ld de,SubanimationPointers
add hl,de
ld a,l
- ld [W_SUBANIMADDRPTR],a
+ ld [wSubAnimAddrPtr],a
ld a,h
- ld [W_SUBANIMADDRPTR + 1],a
+ ld [wSubAnimAddrPtr + 1],a
ld l,c
ld h,b
push hl
@@ -257,9 +257,9 @@
ret
LoadSubanimation: ; 7817c (1e:417c)
- ld a,[W_SUBANIMADDRPTR + 1]
+ ld a,[wSubAnimAddrPtr + 1]
ld h,a
- ld a,[W_SUBANIMADDRPTR]
+ ld a,[wSubAnimAddrPtr]
ld l,a
ld a,[hli]
ld e,a
@@ -268,7 +268,7 @@
ld a,[de]
ld b,a
and a,31
- ld [W_SUBANIMCOUNTER],a ; number of frame blocks
+ ld [wSubAnimCounter],a ; number of frame blocks
ld a,b
and a,%11100000
cp a,5 << 5 ; is subanimation type 5?
@@ -282,12 +282,12 @@
; place the upper 3 bits of a into bits 0-2 of a before storing
srl a
swap a
- ld [W_SUBANIMTRANSFORM],a
+ ld [wSubAnimTransform],a
cp a,4 ; is the animation reversed?
ld hl,0
jr nz,.storeSubentryAddr
; if the animation is reversed, then place the initial subentry address at the end of the list of subentries
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
dec a
ld bc,3
.loop
@@ -298,9 +298,9 @@
inc de
add hl,de
ld a,l
- ld [W_SUBANIMSUBENTRYADDR],a
+ ld [wSubAnimSubEntryAddr],a
ld a,h
- ld [W_SUBANIMSUBENTRYADDR + 1],a
+ ld [wSubAnimSubEntryAddr + 1],a
ret
; called if the subanimation type is not 5
@@ -384,7 +384,7 @@
push af
call WaitForSoundToFinish
call SetAnimationPalette
- ld a,[W_ANIMATIONID]
+ ld a,[wAnimationID]
and a
jr z,.AnimationFinished
@@ -397,7 +397,7 @@
.MoveAnimation
; check if battle animations are disabled in the options
- ld a,[W_OPTIONS]
+ ld a,[wOptions]
bit 7,a
jr nz,.AnimationsDisabled
call ShareMoveAnimations
@@ -411,9 +411,9 @@
.AnimationFinished
call WaitForSoundToFinish
xor a
- ld [W_SUBANIMSUBENTRYADDR],a
+ ld [wSubAnimSubEntryAddr],a
ld [wUnusedD09B],a
- ld [W_SUBANIMTRANSFORM],a
+ ld [wSubAnimTransform],a
dec a
ld [wAnimSoundID],a
pop af
@@ -430,7 +430,7 @@
; opponent’s turn
- ld a,[W_ANIMATIONID]
+ ld a,[wAnimationID]
cp a,AMNESIA
ld b,CONF_ANIM
@@ -442,7 +442,7 @@
.Replace
ld a,b
- ld [W_ANIMATIONID],a
+ ld [wAnimationID],a
ret
PlayApplyingAttackAnimation: ; 78dbd (1e:4dbd)
@@ -529,7 +529,7 @@
ld a, $f0
ld [wAnimPalette], a
ld b, $e4
- ld a, [W_ANIMATIONID]
+ ld a, [wAnimationID]
cp TRADE_BALL_DROP_ANIM
jr c, .next
cp TRADE_BALL_POOF_ANIM + 1
@@ -558,12 +558,12 @@
.skipPlayingSound
ld hl,wOAMBuffer ; base address of OAM buffer
ld a,l
- ld [W_FBDESTADDR + 1],a
+ ld [wFBDestAddr + 1],a
ld a,h
- ld [W_FBDESTADDR],a
- ld a,[W_SUBANIMSUBENTRYADDR + 1]
+ ld [wFBDestAddr],a
+ ld a,[wSubAnimSubEntryAddr + 1]
ld h,a
- ld a,[W_SUBANIMSUBENTRYADDR]
+ ld a,[wSubAnimSubEntryAddr]
ld l,a
.loop
push hl
@@ -585,24 +585,24 @@
add hl,de
add hl,de
ld a,[hli]
- ld [W_BASECOORDY],a
+ ld [wBaseCoordY],a
ld a,[hl]
- ld [W_BASECOORDX],a
+ ld [wBaseCoordX],a
pop hl
inc hl
ld a,[hl] ; frame block mode
- ld [W_FBMODE],a
+ ld [wFBMode],a
call DrawFrameBlock
call DoSpecialEffectByAnimationId ; run animation-specific function (if there is one)
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
dec a
- ld [W_SUBANIMCOUNTER],a
+ ld [wSubAnimCounter],a
ret z
- ld a,[W_SUBANIMSUBENTRYADDR + 1]
+ ld a,[wSubAnimSubEntryAddr + 1]
ld h,a
- ld a,[W_SUBANIMSUBENTRYADDR]
+ ld a,[wSubAnimSubEntryAddr]
ld l,a
- ld a,[W_SUBANIMTRANSFORM]
+ ld a,[wSubAnimTransform]
cp a,4 ; is the animation reversed?
ld bc,3
jr nz,.nextSubanimationSubentry
@@ -610,9 +610,9 @@
.nextSubanimationSubentry
add hl,bc
ld a,h
- ld [W_SUBANIMSUBENTRYADDR + 1],a
+ ld [wSubAnimSubEntryAddr + 1],a
ld a,l
- ld [W_SUBANIMSUBENTRYADDR],a
+ ld [wSubAnimSubEntryAddr],a
jp .loop
AnimationCleanOAM: ; 78ec8 (1e:4ec8)
@@ -634,7 +634,7 @@
push hl
push de
push bc
- ld a,[W_ANIMATIONID]
+ ld a,[wAnimationID]
ld hl,AnimationIdSpecialEffects
ld de,3
call IsInArray
@@ -737,7 +737,7 @@
xor a,%00111100 ; complement colors 1 and 2
ld [rOBP0],a
.skipFlashingEffect
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
cp a,11 ; is it the beginning of the subanimation?
jr nz,.skipPlayingSound
; if it is the beginning of the subanimation, play a sound
@@ -744,7 +744,7 @@
ld a,SFX_BALL_TOSS
call PlaySound
.skipPlayingSound
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
cp a,02 ; is it a trainer battle?
jr z,.isTrainerBattle
ld a,[wd11e]
@@ -751,7 +751,7 @@
cp a,$10 ; is the enemy pokemon the Ghost Marowak?
ret nz
; if the enemy pokemon is the Ghost Marowak, make it dodge during the last 3 frames
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
cp a,3
jr z,.moveGhostMarowakLeft
cp a,2
@@ -775,15 +775,15 @@
ld [rNR10],a ; Channel 1 sweep register
ret
.isTrainerBattle ; if it's a trainer battle, shorten the animation by one frame
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
cp a,3
ret nz
dec a
- ld [W_SUBANIMCOUNTER],a
+ ld [wSubAnimCounter],a
ret
DoBallShakeSpecialEffects: ; 78f96 (1e:4f96)
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
cp a,4 ; is it the beginning of a shake?
jr nz,.skipPlayingSound
; if it is the beginning of a shake, play a sound and wait 2/3 of a second
@@ -792,7 +792,7 @@
ld c,40
call DelayFrames
.skipPlayingSound
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
dec a
ret nz
; if it's the end of the ball shaking subanimation, check if more shakes are left and restart the subanimation
@@ -801,23 +801,23 @@
ld [wNumShakes],a
ret z
; if there are shakes left, restart the subanimation
- ld a,[W_SUBANIMSUBENTRYADDR]
+ ld a,[wSubAnimSubEntryAddr]
ld l,a
- ld a,[W_SUBANIMSUBENTRYADDR + 1]
+ ld a,[wSubAnimSubEntryAddr + 1]
ld h,a
ld de,-(4 * 3) ; 4 subentries and 3 bytes per subentry
add hl,de
ld a,l
- ld [W_SUBANIMSUBENTRYADDR],a
+ ld [wSubAnimSubEntryAddr],a
ld a,h
- ld [W_SUBANIMSUBENTRYADDR + 1],a
+ ld [wSubAnimSubEntryAddr + 1],a
ld a,5 ; number of subentries in the ball shaking subanimation plus one
- ld [W_SUBANIMCOUNTER],a
+ ld [wSubAnimCounter],a
ret
; plays a sound after the second frame of the poof animation
DoPoofSpecialEffects: ; 78fce (1e:4fce)
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
cp a,5
ret nz
ld a,SFX_BALL_POOF
@@ -824,7 +824,7 @@
jp PlaySound
DoRockSlideSpecialEffects: ; 78fd9 (1e:4fd9)
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
cp a,12
ret nc
cp a,8
@@ -840,7 +840,7 @@
predef_jump PredefShakeScreenVertically ; shake vertically
FlashScreenEveryEightFrameBlocks: ; 78ff7 (1e:4ff7)
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
and a,7 ; is the subanimation counter exactly 8?
call z,AnimationFlashScreen ; if so, flash the screen
ret
@@ -847,7 +847,7 @@
; flashes the screen if the subanimation counter is divisible by 4
FlashScreenEveryFourFrameBlocks: ; 79000 (1e:5000)
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
and a,3
call z,AnimationFlashScreen
ret
@@ -854,7 +854,7 @@
; used for Explosion and Selfdestruct
DoExplodeSpecialEffects: ; 79009 (1e:5009)
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
cp a,1 ; is it the end of the subanimation?
jr nz,FlashScreenEveryFourFrameBlocks
; if it's the end of the subanimation, make the attacking pokemon disappear
@@ -863,7 +863,7 @@
; flashes the screen when subanimation counter is 1 modulo 4
DoBlizzardSpecialEffects: ; 79016 (1e:5016)
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
cp a,13
jp z,AnimationFlashScreen
cp a,9
@@ -877,7 +877,7 @@
; flashes the screen at 3 points in the subanimation
; unused
FlashScreenUnused: ; 7902e (1e:502e)
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
cp a,14
jp z,AnimationFlashScreen
cp a,9
@@ -888,7 +888,7 @@
; function to make the pokemon disappear at the beginning of the animation
TradeHidePokemon: ; 79041 (1e:5041)
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
cp a,6
ret nz
ld a,2 * SCREEN_WIDTH + 7
@@ -896,7 +896,7 @@
; function to make a shaking pokeball jump up at the end of the animation
TradeShakePokeball: ; 7904c (1e:504c)
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
cp a,1
ret nz
; if it's the end of the animation, make the ball jump up
@@ -976,7 +976,7 @@
ld de,wOAMBuffer + $10
ld bc,$10
call CopyData ; copy the musical note graphic
- ld a,[W_SUBANIMCOUNTER]
+ ld a,[wSubAnimCounter]
dec a
call z,AnimationCleanOAM ; clean up at the end of the subanimation
ret
@@ -984,7 +984,7 @@
; this is associated with Tail Whip, but Tail Whip doesn't use any subanimations
TailWhipAnimationUnused: ; 790d0 (1e:50d0)
ld a,1
- ld [W_SUBANIMCOUNTER],a
+ ld [wSubAnimCounter],a
ld c,20
jp DelayFrames
@@ -1243,17 +1243,17 @@
call LoadAnimationTileset
ld d, 32
ld a, -16
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
ld a, $71
ld [wDropletTile], a
.loop
ld a, 16
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
ld a, 0
ld [wUnusedD08A], a
call _AnimationWaterDroplets
ld a, 24
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
ld a, 32
ld [wUnusedD08A], a
call _AnimationWaterDroplets
@@ -1264,24 +1264,24 @@
_AnimationWaterDroplets: ; 79246 (1e:5246)
ld hl, wOAMBuffer
.loop
- ld a, [W_BASECOORDY]
+ ld a, [wBaseCoordY]
ld [hli], a ; Y
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
add 27
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
ld [hli], a ; X
ld a, [wDropletTile]
ld [hli], a ; tile
xor a
ld [hli], a ; attribute
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
cp 144
jr c, .loop
sub 168
- ld [W_BASECOORDX], a
- ld a, [W_BASECOORDY]
+ ld [wBaseCoordX], a
+ ld a, [wBaseCoordY]
add 16
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
cp 112
jr c, .loop
call AnimationCleanOAM
@@ -1387,14 +1387,14 @@
; Writes the OAM entries for a copy of the player mon's pic in OAM.
; The top 5 rows are reproduced in OAM, although only 2 are actually needed.
ld a, $10
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
ld a, $30
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
ld hl, wOAMBuffer
ld d, 0
ld c, 7
.loop
- ld a, [W_BASECOORDY]
+ ld a, [wBaseCoordY]
ld e, a
ld b, 5
.innerLoop
@@ -1406,14 +1406,14 @@
ret z
inc d
inc d
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
add 8
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
jr .loop
BattleAnimWriteOAMEntry: ; 79329 (1e:5329)
; Y coordinate = e (increased by 8 each call, before the write to OAM)
-; X coordinate = [W_BASECOORDX]
+; X coordinate = [wBaseCoordX]
; tile = d
; attributes = 0
ld a, e
@@ -1420,7 +1420,7 @@
add 8
ld e, a
ld [hli], a
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
ld [hli], a
ld a, d
ld [hli], a
@@ -1749,9 +1749,9 @@
lb bc, 6 * 8, 5 * 8
.next
ld a, b
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
ld a, c
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
lb bc, 5, 1
call _AnimationShootBallsUpward
jp AnimationCleanOAM
@@ -1765,7 +1765,7 @@
ld d, $7a ; ball tile
ld hl, wOAMBuffer
push bc
- ld a, [W_BASECOORDY]
+ ld a, [wBaseCoordY]
ld e, a
.initOAMLoop
call BattleAnimWriteOAMEntry
@@ -1779,7 +1779,7 @@
push bc
ld hl, wOAMBuffer
.innerLoop
- ld a, [W_BASECOORDY]
+ ld a, [wBaseCoordY]
add 8
ld e, a
ld a, [hl]
@@ -1819,11 +1819,11 @@
ld [wSavedY], a
.loop
ld a, [wSavedY]
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
ld a, [hli]
cp $ff
jp z, AnimationCleanOAM
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
lb bc, 4, 1
push hl
call _AnimationShootBallsUpward
@@ -2096,10 +2096,10 @@
ld a, [H_WHOSETURN]
and a
ld hl, wPlayerMonMinimized
- ld a, [W_PLAYERBATTSTATUS2]
+ ld a, [wPlayerBattleStatus2]
jr z, .next1
ld hl, wEnemyMonMinimized
- ld a, [W_ENEMYBATTSTATUS2]
+ ld a, [wEnemyBattleStatus2]
.next1
push hl
; if the substitute broke, slide it down, else slide it offscreen horizontally
@@ -2150,7 +2150,7 @@
ld [wcf91], a
ld [wd0b5], a
xor a
- ld [W_SPRITEFLIPPED], a
+ ld [wSpriteFlipped], a
call GetMonHeader
coord hl, 12, 0
call LoadFrontSpriteByMonIndex
@@ -2196,7 +2196,7 @@
pop bc
xor a
ld e, a
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
ld hl, wOAMBuffer
.loop
call BattleAnimWriteOAMEntry
@@ -2354,7 +2354,7 @@
IsCryMove: ; 798ad (1e:58ad)
; set carry if the move animation involves playing a monster cry
- ld a,[W_ANIMATIONID]
+ ld a,[wAnimationID]
cp a,GROWL
jr z,.CryMove
cp a,ROAR
@@ -2953,7 +2953,7 @@
jp Delay3
TossBallAnimation: ; 79e16 (1e:5e16)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
cp a,2
jr z,.BlockBall ; if in trainer battle, play different animation
ld a,[wPokeBallAnimData]
@@ -2984,7 +2984,7 @@
.done
ld a,b
.PlayNextAnimation
- ld [W_ANIMATIONID],a
+ ld [wAnimationID],a
push bc
push hl
call PlayAnimation
@@ -3001,12 +3001,12 @@
.BlockBall ; 5E55
ld a,TOSS_ANIM
- ld [W_ANIMATIONID],a
+ ld [wAnimationID],a
call PlayAnimation
ld a,SFX_FAINT_THUD
call PlaySound
ld a,BLOCKBALL_ANIM
- ld [W_ANIMATIONID],a
+ ld [wAnimationID],a
jp PlayAnimation
PlayApplyingAttackSound: ; 79e6a (1e:5e6a)
--- a/engine/battle/battle_transitions.asm
+++ b/engine/battle/battle_transitions.asm
@@ -81,7 +81,7 @@
dw BattleTransition_Split ; %111
GetBattleTransitionID_WildOrTrainer: ; 709e2 (1c:49e2)
- ld a, [W_CUROPPONENT]
+ ld a, [wCurOpponent]
cp 200
jr nc, .trainer
res 0, c
@@ -105,7 +105,7 @@
ld a, [hl]
add $3
ld e, a
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
sub e
jr nc, .highLevelEnemy
res 1, c
@@ -122,7 +122,7 @@
; MANSION_1, SEAFOAM_ISLANDS_[2-5], POWER_PLANT, DIGLETTS_CAVE
; and SILPH_CO_[9-11]F as dungeon maps
GetBattleTransitionID_IsDungeonMap: ; 70a19 (1c:4a19)
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
ld e, a
ld hl, DungeonMaps1
.loop1
@@ -151,7 +151,7 @@
res 2, c
ret
-; GetBattleTransitionID_IsDungeonMap checks if W_CURMAP
+; GetBattleTransitionID_IsDungeonMap checks if wCurMap
; is equal to one of these maps
DungeonMaps1: ; 70a3f (1c:4a3f)
db VIRIDIAN_FOREST
@@ -160,7 +160,7 @@
db ROCK_TUNNEL_2
db $FF
-; GetBattleTransitionID_IsDungeonMap checks if W_CURMAP
+; GetBattleTransitionID_IsDungeonMap checks if wCurMap
; is in between or equal to each pair of maps
DungeonMaps2: ; 70a44 (1c:4a44)
; all MT_MOON maps
--- a/engine/battle/common_text.asm
+++ b/engine/battle/common_text.asm
@@ -1,8 +1,8 @@
PrintBeginningBattleText: ; 58d99 (16:4d99)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a
jr nz, .trainerBattle
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp POKEMONTOWER_3
jr c, .notPokemonTower
cp LAVENDER_HOUSE_1
@@ -11,7 +11,7 @@
ld a, [wEnemyMonSpecies2]
call PlayCry
ld hl, WildMonAppearedText
- ld a, [W_MOVEMISSED]
+ ld a, [wMoveMissed]
and a
jr z, .notFishing
ld hl, HookedMonAttackedText
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -239,7 +239,7 @@
.foundFirstAliveEnemyMon
ld a, d
ld [wSerialExchangeNybbleReceiveData], a
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a ; is it a trainer battle?
call nz, EnemySendOutFirstMon ; if it is a trainer battle, send out enemy mon
ld c, 40
@@ -251,7 +251,7 @@
and a
jp z, HandlePlayerBlackOut ; jump if no mon is alive
call LoadScreenTilesFromBuffer1
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
and a ; is it a normal battle?
jp z, .playerSendOutFirstMon ; if so, send out player mon
; safari zone battle
@@ -261,7 +261,7 @@
ld a, [wActionResultOrTookBattleTurn]
and a ; was the item used successfully?
jr z, .displaySafariZoneBattleMenu ; if not, display the menu again; XXX does this ever jump?
- ld a, [W_NUMSAFARIBALLS]
+ ld a, [wNumSafariBalls]
and a
jr nz, .notOutOfSafariBalls
call LoadScreenTilesFromBuffer1
@@ -380,13 +380,13 @@
call SaveScreenTilesToBuffer1
xor a
ld [wFirstMonsNotOutYet], a
- ld a, [W_PLAYERBATTSTATUS2]
+ ld a, [wPlayerBattleStatus2]
and (1 << NeedsToRecharge) | (1 << UsingRage) ; check if the player is using Rage or needs to recharge
jr nz, .selectEnemyMove
; the player is not using Rage and doesn't need to recharge
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
res Flinched, [hl] ; reset flinch bit
- ld hl, W_PLAYERBATTSTATUS1
+ ld hl, wPlayerBattleStatus1
res Flinched, [hl] ; reset flinch bit
ld a, [hl]
and (1 << ThrashingAbout) | (1 << ChargingUp) ; check if the player is thrashing about or charging for an attack
@@ -400,10 +400,10 @@
ld a, [wBattleMonStatus]
and (1 << FRZ) | SLP ; is mon frozen or asleep?
jr nz, .selectEnemyMove ; if so, jump
- ld a, [W_PLAYERBATTSTATUS1]
+ ld a, [wPlayerBattleStatus1]
and (1 << StoringEnergy) | (1 << UsingTrappingMove) ; check player is using Bide or using a multi-turn attack like wrap
jr nz, .selectEnemyMove ; if so, jump
- ld a, [W_ENEMYBATTSTATUS1]
+ ld a, [wEnemyBattleStatus1]
bit UsingTrappingMove, a ; check if enemy is using a multi-turn attack like wrap
jr z, .selectPlayerMove ; if not, jump
; enemy is using a mult-turn attack like wrap, so player is trapped and cannot execute a move
@@ -416,7 +416,7 @@
jr nz, .selectEnemyMove
ld [wMoveMenuType], a
inc a
- ld [W_ANIMATIONID], a
+ ld [wAnimationID], a
xor a
ld [wMenuItemToSwap], a
call MoveSelectionMenu
@@ -441,7 +441,7 @@
sub $4
jr c, .noLinkBattle
; the link battle enemy has switched mons
- ld a, [W_PLAYERBATTSTATUS1]
+ ld a, [wPlayerBattleStatus1]
bit UsingTrappingMove, a ; check if using multi-turn move like Wrap
jr z, .asm_3c2dd
ld a, [wPlayerMoveListIndex]
@@ -584,11 +584,11 @@
pop hl
call HandlePoisonBurnLeechSeed_DecreaseOwnHP
.notBurnedOrPoisoned
- ld de, W_PLAYERBATTSTATUS2
+ ld de, wPlayerBattleStatus2
ld a, [H_WHOSETURN]
and a
jr z, .playersTurn2
- ld de, W_ENEMYBATTSTATUS2
+ ld de, wEnemyBattleStatus2
.playersTurn2
ld a, [de]
add a
@@ -659,13 +659,13 @@
jr nz, .nonZeroDamage
inc c ; damage is at least 1
.nonZeroDamage
- ld hl, W_PLAYERBATTSTATUS3
- ld de, W_PLAYERTOXICCOUNTER
+ ld hl, wPlayerBattleStatus3
+ ld de, wPlayerToxicCounter
ld a, [H_WHOSETURN]
and a
jr z, .playersTurn
- ld hl, W_ENEMYBATTSTATUS3
- ld de, W_ENEMYTOXICCOUNTER
+ ld hl, wEnemyBattleStatus3
+ ld de, wEnemyToxcCounter
.playersTurn
bit BadlyPoisoned, [hl]
jr z, .noToxic
@@ -775,7 +775,7 @@
and a
jr nz, .checkEnemy
; player has 0 attacks left
- ld hl, W_PLAYERBATTSTATUS1
+ ld hl, wPlayerBattleStatus1
res UsingTrappingMove, [hl] ; player not using multi-turn attack like wrap any more
.checkEnemy
ld a, [wEnemyNumAttacksLeft]
@@ -782,7 +782,7 @@
and a
ret nz
; enemy has 0 attacks left
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
res UsingTrappingMove, [hl] ; enemy not using multi-turn attack like wrap any more
ret
@@ -798,7 +798,7 @@
ld a, [hli]
or [hl] ; is battle mon HP zero?
call nz, DrawPlayerHUDAndHPBar ; if battle mon HP is not zero, draw player HD and HP bar
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a
ret z ; return if it's a wild battle
call AnyEnemyPokemonAliveCheck
@@ -821,7 +821,7 @@
FaintEnemyPokemon: ; 0x3c567
call ReadPlayerMonCurHPAndStatus
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a
jr z, .wild
ld a, [wEnemyMonPartyPos]
@@ -832,7 +832,7 @@
ld [hli], a
ld [hl], a
.wild
- ld hl, W_PLAYERBATTSTATUS1
+ ld hl, wPlayerBattleStatus1
res AttackingMultipleTimes, [hl]
; Bug. This only zeroes the high byte of the player's accumulated damage,
; setting the accumulated damage to itself mod 256 instead of 0 as was probably
@@ -851,7 +851,7 @@
ld [hli], a
ld [hli], a
ld [hl], a
- ld [W_ENEMYDISABLEDMOVE], a
+ ld [wEnemyDisabledMove], a
ld [wEnemyDisabledMoveNumber], a
ld [wEnemyMonMinimized], a
ld hl, wPlayerUsedMove
@@ -863,7 +863,7 @@
coord hl, 0, 0
lb bc, 4, 11
call ClearScreenArea
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a
jr z, .wild_win
xor a
@@ -994,7 +994,7 @@
.notLinkBattle
call EnemySendOut
xor a
- ld [W_ENEMYMOVENUM], a
+ ld [wEnemyMoveNum], a
ld [wActionResultOrTookBattleTurn], a
ld [wAILayer2Encouragement], a
inc a ; reset Z flag
@@ -1003,16 +1003,16 @@
TrainerBattleVictory: ; 3c696 (f:4696)
call EndLowHealthAlarm
ld b, MUSIC_DEFEATED_GYM_LEADER
- ld a, [W_GYMLEADERNO]
+ ld a, [wGymLeaderNo]
and a
jr nz, .gymleader
ld b, MUSIC_DEFEATED_TRAINER
.gymleader
- ld a, [W_TRAINERCLASS]
+ ld a, [wTrainerClass]
cp SONY3 ; final battle against rival
jr nz, .notrival
ld b, MUSIC_DEFEATED_GYM_LEADER
- ld hl, W_FLAGS_D733
+ ld hl, wFlags_D733
set 1, [hl]
.notrival
ld a, [wLinkState]
@@ -1068,7 +1068,7 @@
jr nz, .doUseNextMonDialogue ; if not, jump
; the enemy mon has 0 HP
call FaintEnemyPokemon
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a
ret z ; if wild encounter, battle is over
call AnyEnemyPokemonAliveCheck
@@ -1094,7 +1094,7 @@
ld hl, wPartyGainExpFlags
ld b, FLAG_RESET
predef FlagActionPredef ; clear gain exp flag for fainted mon
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
res 2, [hl] ; reset "attacking multiple times" flag
ld a, [wLowHealthAlarm]
bit 7, a ; skip sound flag (red bar (?))
@@ -1140,7 +1140,7 @@
DoUseNextMonDialogue: ; 3c79b (f:479b)
call PrintEmptyString
call SaveScreenTilesToBuffer1
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
and a
dec a
ret nz ; return if it's a trainer battle
@@ -1221,7 +1221,7 @@
ld a, [wLinkState]
cp LINK_STATE_BATTLING
jr z, .notSony1Battle
- ld a, [W_CUROPPONENT]
+ ld a, [wCurOpponent]
cp OPP_SONY1
jr nz, .notSony1Battle
coord hl, 0, 0 ; sony 1 battle
@@ -1232,7 +1232,7 @@
call DelayFrames
ld hl, Sony1WinText
call PrintText
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp OAKS_LAB
ret z ; starter battle in oak's lab: don't black out
.notSony1Battle
@@ -1384,7 +1384,7 @@
ld [hli],a
ld [hli],a
ld [hl],a
- ld [W_ENEMYDISABLEDMOVE],a
+ ld [wEnemyDisabledMove],a
ld [wEnemyDisabledMoveNumber],a
ld [wEnemyMonMinimized],a
ld hl,wPlayerUsedMove
@@ -1392,7 +1392,7 @@
ld [hl],a
dec a
ld [wAICount],a
- ld hl,W_PLAYERBATTSTATUS1
+ ld hl,wPlayerBattleStatus1
res 5,[hl]
coord hl, 18, 0
ld a,8
@@ -1432,7 +1432,7 @@
ld bc,wEnemyMon2 - wEnemyMon1
call AddNTimes
ld a,[hl]
- ld [W_CURENEMYLVL],a
+ ld [wCurEnemyLVL],a
ld a,[wWhichPokemon]
inc a
ld hl,wEnemyPartyCount
@@ -1459,7 +1459,7 @@
ld a,[wLinkState]
cp LINK_STATE_BATTLING
jr z,.next4
- ld a,[W_OPTIONS]
+ ld a,[wOptions]
bit 6,a
jr nz,.next4
ld hl, TrainerAboutToUseText
@@ -1583,13 +1583,13 @@
TryRunningFromBattle: ; 3cab9 (f:4ab9)
call IsGhostBattle
jp z, .canEscape ; jump if it's a ghost battle
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
jp z, .canEscape ; jump if it's a safari battle
ld a, [wLinkState]
cp LINK_STATE_BATTLING
jp z, .canEscape
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a
jr nz, .trainerBattle ; jump if it's a trainer battle
ld a, [wNumRunAttempts]
@@ -1787,7 +1787,7 @@
ld bc, 1 + NUM_STATS * 2
call CopyData
call ApplyBurnAndParalysisPenaltiesToEnemy
- ld hl, W_MONHBASESTATS
+ ld hl, wMonHBaseStats
ld de, wEnemyMonBaseStats
ld b, NUM_STATS
.copyBaseStatsLoop
@@ -1824,7 +1824,7 @@
ld [hl], a
ld [wBoostExpByExpAll], a
ld [wDamageMultipliers], a
- ld [W_PLAYERMOVENUM], a
+ ld [wPlayerMoveNum], a
ld hl, wPlayerUsedMove
ld [hli], a
ld [hl], a
@@ -1834,12 +1834,12 @@
ld [hli], a
ld [hli], a
ld [hl], a
- ld [W_PLAYERDISABLEDMOVE], a
+ ld [wPlayerDisabledMove], a
ld [wPlayerDisabledMoveNumber], a
ld [wPlayerMonMinimized], a
ld b, SET_PAL_BATTLE
call RunPaletteCommand
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
res UsingTrappingMove, [hl]
ld a, $1
ld [H_WHOSETURN], a
@@ -2086,7 +2086,7 @@
DisplayBattleMenu: ; 3ceb3 (f:4eb3)
call LoadScreenTilesFromBuffer1 ; restore saved screen
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
and a
jr nz, .nonstandardbattle
call DrawHUDsAndHPBars
@@ -2093,7 +2093,7 @@
call PrintEmptyString
call SaveScreenTilesToBuffer1
.nonstandardbattle
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
ld a, BATTLE_MENU_TEMPLATE
jr nz, .menuselected
@@ -2101,12 +2101,12 @@
.menuselected
ld [wTextBoxID], a
call DisplayTextBoxID
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
dec a
jp nz, .handleBattleMenuInput ; handle menu input if it's not the old man tutorial
; the following happens for the old man tutorial
ld hl, wPlayerName
- ld de, W_GRASSRATE
+ ld de, wGrassRate
ld bc, NAME_LENGTH
call CopyData ; temporarily save the player name in unused space,
; which is supposed to get overwritten when entering a
@@ -2143,7 +2143,7 @@
ld [wLastMenuItem], a
jr .rightColumn
.leftColumn ; put cursor in left column of menu
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
ld a, " "
jr z, .safariLeftColumn
@@ -2156,7 +2156,7 @@
Coorda 13, 14
Coorda 13, 16
coord hl, 7, 14
- ld de, W_NUMSAFARIBALLS
+ ld de, wNumSafariBalls
lb bc, 1, 2
call PrintNumber
ld b, $1 ; top menu item X
@@ -2176,7 +2176,7 @@
jr nz, .rightColumn
jr .AButtonPressed ; the A button was pressed
.rightColumn ; put cursor in right column of menu
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
ld a, " "
jr z, .safariRightColumn
@@ -2189,7 +2189,7 @@
Coorda 1, 14 ; clear upper cursor position in left column
Coorda 1, 16 ; clear lower cursor position in left column
coord hl, 7, 14
- ld de, W_NUMSAFARIBALLS
+ ld de, wNumSafariBalls
lb bc, 1, 2
call PrintNumber
ld b, $d ; top menu item X
@@ -2213,7 +2213,7 @@
ld [wCurrentMenuItem], a
.AButtonPressed
call PlaceUnfilledArrowMenuCursor
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
ld a, [wCurrentMenuItem]
ld [wBattleAndStartSavedMenuItem], a
@@ -2235,7 +2235,7 @@
and a
jr nz, .upperLeftMenuItemWasNotSelected
; the upper left menu item was selected
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
jr z, .throwSafariBallWasSelected
; the "FIGHT" menu was selected
@@ -2263,7 +2263,7 @@
.notLinkBattle
call SaveScreenTilesToBuffer2
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
jr nz, BagWasSelected
@@ -2274,7 +2274,7 @@
BagWasSelected:
call LoadScreenTilesFromBuffer1
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
and a ; is it a normal battle?
jr nz, .next
@@ -2281,7 +2281,7 @@
; normal battle
call DrawHUDsAndHPBars
.next
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
dec a ; is it the old man tutorial?
jr nz, DisplayPlayerBag ; no, it is a normal battle
ld hl, OldManItemList
@@ -2332,7 +2332,7 @@
call ClearSprites
xor a
ld [wCurrentMenuItem], a
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
jr z, .checkIfMonCaptured
@@ -2340,13 +2340,13 @@
and a ; was the item used successfully?
jp z, BagWasSelected ; if not, go back to the bag menu
- ld a, [W_PLAYERBATTSTATUS1]
+ ld a, [wPlayerBattleStatus1]
bit UsingTrappingMove, a ; is the player using a multi-turn move like wrap?
jr z, .checkIfMonCaptured
ld hl, wPlayerNumAttacksLeft
dec [hl]
jr nz, .checkIfMonCaptured
- ld hl, W_PLAYERBATTSTATUS1
+ ld hl, wPlayerBattleStatus1
res UsingTrappingMove, [hl] ; not using multi-turn move any more
.checkIfMonCaptured
@@ -2354,7 +2354,7 @@
and a ; was the enemy mon captured with a ball?
jr nz, .returnAfterCapturingMon
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
jr z, .returnAfterUsingItem_NoCapture
; not a safari battle
@@ -2385,7 +2385,7 @@
jp nz, BattleMenu_RunWasSelected
; party menu or rock was selected
call SaveScreenTilesToBuffer2
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
cp BATTLE_TYPE_SAFARI
jr nz, .partyMenuWasSelected
; safari battle
@@ -2453,7 +2453,7 @@
predef StatusScreen
predef StatusScreen2
; now we need to reload the enemy mon pic
- ld a, [W_ENEMYBATTSTATUS2]
+ ld a, [wEnemyBattleStatus2]
bit HasSubstituteUp, a ; does the enemy mon have a substitute?
ld hl, AnimationSubstitute
jr nz, .doEnemyMonAnimation
@@ -2641,7 +2641,7 @@
ld a, [wLinkState]
cp LINK_STATE_BATTLING
jr z, .matchedkeyspicked
- ld a, [W_FLAGS_D733]
+ ld a, [wFlags_D733]
bit BIT_TEST_BATTLE, a
ld b, D_UP | D_DOWN | A_BUTTON | B_BUTTON | SELECT
jr z, .matchedkeyspicked
@@ -2669,7 +2669,7 @@
call PlaceString
jr .select
.battleselect
- ld a, [W_FLAGS_D733]
+ ld a, [wFlags_D733]
bit BIT_TEST_BATTLE, a
jr nz, .select
call PrintMenuItem
@@ -2724,13 +2724,13 @@
ld a, [hl]
and $3f
jr z, .nopp
- ld a, [W_PLAYERDISABLEDMOVE]
+ ld a, [wPlayerDisabledMove]
swap a
and $f
dec a
cp c
jr z, .disabled
- ld a, [W_PLAYERBATTSTATUS3]
+ ld a, [wPlayerBattleStatus3]
bit 3, a ; transformed
jr nz, .dummy ; game freak derp
.dummy
@@ -2791,7 +2791,7 @@
; return z and Struggle as the selected move if all moves have 0 PP and/or are disabled
ld a, STRUGGLE
ld [wPlayerSelectedMove], a
- ld a, [W_PLAYERDISABLEDMOVE]
+ ld a, [wPlayerDisabledMove]
and a
ld hl, wBattleMonPP
jr nz, .asm_3d40e
@@ -2843,7 +2843,7 @@
ld hl, wBattleMonPP
call .swapBytes ; swap move PP
; update the index of the disabled move if necessary
- ld hl, W_PLAYERDISABLEDMOVE
+ ld hl, wPlayerDisabledMove
ld a, [hl]
swap a
and $f
@@ -2917,7 +2917,7 @@
ld b, $3
ld c, $9
call TextBoxBorder
- ld a, [W_PLAYERDISABLEDMOVE]
+ ld a, [wPlayerDisabledMove]
and a
jr z, .notDisabled
swap a
@@ -3014,10 +3014,10 @@
ld a, [hl]
jr .done
.noLinkBattle
- ld a, [W_ENEMYBATTSTATUS2]
+ ld a, [wEnemyBattleStatus2]
and (1 << NeedsToRecharge) | (1 << UsingRage) ; need to recharge or using rage
ret nz
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
ld a, [hl]
and (1 << ChargingUp) | (1 << ThrashingAbout) ; using a charging move or thrash/petal dance
ret nz
@@ -3024,10 +3024,10 @@
ld a, [wEnemyMonStatus]
and SLP | 1 << FRZ ; sleeping or frozen
ret nz
- ld a, [W_ENEMYBATTSTATUS1]
+ ld a, [wEnemyBattleStatus1]
and (1 << UsingTrappingMove) | (1 << StoringEnergy) ; using a trapping move like wrap or bide
ret nz
- ld a, [W_PLAYERBATTSTATUS1]
+ ld a, [wPlayerBattleStatus1]
bit UsingTrappingMove, a ; caught in player's trapping move (e.g. wrap)
jr z, .canSelectMove
.unableToSelectMove
@@ -3038,12 +3038,12 @@
ld a, [hld]
and a
jr nz, .atLeastTwoMovesAvailable
- ld a, [W_ENEMYDISABLEDMOVE]
+ ld a, [wEnemyDisabledMove]
and a
ld a, STRUGGLE ; struggle if the only move is disabled
jr nz, .done
.atLeastTwoMovesAvailable
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a
jr z, .chooseRandomMove ; wild encounter
callab AIEnemyTrainerChooseMoves
@@ -3067,7 +3067,7 @@
ld a, b
dec a
ld [wEnemyMoveListIndex], a
- ld a, [W_ENEMYDISABLEDMOVE]
+ ld a, [wEnemyDisabledMove]
swap a
and $f
cp b
@@ -3139,7 +3139,7 @@
inc a
jp z, ExecutePlayerMoveDone ; for selected move = FF, skip most of player's turn
xor a
- ld [W_MOVEMISSED], a
+ ld [wMoveMissed], a
ld [wMonIsDisobedient], a
ld [wMoveDidntMiss], a
ld a, $a
@@ -3154,7 +3154,7 @@
jp [hl]
.playerHasNoSpecialCondition
call GetCurrentMove
- ld hl, W_PLAYERBATTSTATUS1
+ ld hl, wPlayerBattleStatus1
bit ChargingUp, [hl] ; charging up for attack
jr nz, PlayerCanExecuteChargingMove
call CheckForDisobedience
@@ -3161,7 +3161,7 @@
jp z, ExecutePlayerMoveDone
CheckIfPlayerNeedsToChargeUp: ; 3d69a (f:569a)
- ld a, [W_PLAYERMOVEEFFECT]
+ ld a, [wPlayerMoveEffect]
cp CHARGE_EFFECT
jp z, JumpMoveEffect
cp FLY_EFFECT
@@ -3170,7 +3170,7 @@
; in-battle stuff
PlayerCanExecuteChargingMove: ; 3d6a9 (f:56a9)
- ld hl,W_PLAYERBATTSTATUS1
+ ld hl,wPlayerBattleStatus1
res ChargingUp,[hl] ; reset charging up and invulnerability statuses if mon was charging up for an attack
; being fully paralyzed or hurting oneself in confusion removes charging up status
; resulting in the Pokemon being invulnerable for the whole battle
@@ -3181,19 +3181,19 @@
ld de,wPlayerSelectedMove ; pointer to the move just used
ld b,BANK(DecrementPP)
call Bankswitch
- ld a,[W_PLAYERMOVEEFFECT] ; effect of the move just used
+ ld a,[wPlayerMoveEffect] ; effect of the move just used
ld hl,ResidualEffects1
ld de,1
call IsInArray
jp c,JumpMoveEffect ; ResidualEffects1 moves skip damage calculation and accuracy tests
; unless executed as part of their exclusive effect functions
- ld a,[W_PLAYERMOVEEFFECT]
+ ld a,[wPlayerMoveEffect]
ld hl,SpecialEffectsCont
ld de,1
call IsInArray
call c,JumpMoveEffect ; execute the effects of SpecialEffectsCont moves (e.g. Wrap, Thrash) but don't skip anything
PlayerCalcMoveDamage: ; 3d6dc (f:56dc)
- ld a,[W_PLAYERMOVEEFFECT]
+ ld a,[wPlayerMoveEffect]
ld hl,SetDamageEffects
ld de,1
call IsInArray
@@ -3210,15 +3210,15 @@
.moveHitTest
call MoveHitTest
handleIfPlayerMoveMissed
- ld a,[W_MOVEMISSED]
+ ld a,[wMoveMissed]
and a
jr z,getPlayerAnimationType
- ld a,[W_PLAYERMOVEEFFECT]
+ ld a,[wPlayerMoveEffect]
sub a,EXPLODE_EFFECT
jr z,playPlayerMoveAnimation ; don't play any animation if the move missed, unless it was EXPLODE_EFFECT
jr playerCheckIfFlyOrChargeEffect
getPlayerAnimationType
- ld a,[W_PLAYERMOVEEFFECT]
+ ld a,[wPlayerMoveEffect]
and a
ld a,4 ; move has no effect other than dealing damage
jr z,playPlayerMoveAnimation
@@ -3225,7 +3225,7 @@
ld a,5 ; move has effect
playPlayerMoveAnimation
push af
- ld a,[W_PLAYERBATTSTATUS2]
+ ld a,[wPlayerBattleStatus2]
bit HasSubstituteUp,a
ld hl,HideSubstituteShowMonAnim
ld b,BANK(HideSubstituteShowMonAnim)
@@ -3232,11 +3232,11 @@
call nz,Bankswitch
pop af
ld [wAnimationType],a
- ld a,[W_PLAYERMOVENUM]
+ ld a,[wPlayerMoveNum]
call PlayMoveAnimation
call HandleExplodingAnimation
call DrawPlayerHUDAndHPBar
- ld a,[W_PLAYERBATTSTATUS2]
+ ld a,[wPlayerBattleStatus2]
bit HasSubstituteUp,a
ld hl,ReshowSubstituteAnim
ld b,BANK(ReshowSubstituteAnim)
@@ -3245,7 +3245,7 @@
playerCheckIfFlyOrChargeEffect
ld c,30
call DelayFrames
- ld a,[W_PLAYERMOVEEFFECT]
+ ld a,[wPlayerMoveEffect]
cp a,FLY_EFFECT
jr z,.playAnim
cp a,CHARGE_EFFECT
@@ -3257,7 +3257,7 @@
ld a,STATUS_AFFECTED_ANIM
call PlayMoveAnimation
MirrorMoveCheck
- ld a,[W_PLAYERMOVEEFFECT]
+ ld a,[wPlayerMoveEffect]
cp a,MIRROR_MOVE_EFFECT
jr nz,.metronomeCheck
call MirrorMoveCopyMove
@@ -3271,16 +3271,16 @@
call MetronomePickMove
jp CheckIfPlayerNeedsToChargeUp ; Go back to damage calculation for the move picked by Metronome
.next
- ld a,[W_PLAYERMOVEEFFECT]
+ ld a,[wPlayerMoveEffect]
ld hl,ResidualEffects2
ld de,1
call IsInArray
jp c,JumpMoveEffect ; done here after executing effects of ResidualEffects2
- ld a,[W_MOVEMISSED]
+ ld a,[wMoveMissed]
and a
jr z,.moveDidNotMiss
call PrintMoveFailureText
- ld a,[W_PLAYERMOVEEFFECT]
+ ld a,[wPlayerMoveEffect]
cp a,EXPLODE_EFFECT ; even if Explosion or Selfdestruct missed, its effect still needs to be activated
jr z,.notDone
jp ExecutePlayerMoveDone ; otherwise, we're done if the move missed
@@ -3291,7 +3291,7 @@
ld a,1
ld [wMoveDidntMiss],a
.notDone
- ld a,[W_PLAYERMOVEEFFECT]
+ ld a,[wPlayerMoveEffect]
ld hl,AlwaysHappenSideEffects
ld de,1
call IsInArray
@@ -3303,7 +3303,7 @@
ret z ; don't do anything else if the enemy fainted
call HandleBuildingRage
- ld hl,W_PLAYERBATTSTATUS1
+ ld hl,wPlayerBattleStatus1
bit AttackingMultipleTimes,[hl]
jr z,.executeOtherEffects
ld a,[wPlayerNumAttacksLeft]
@@ -3317,7 +3317,7 @@
xor a
ld [wPlayerNumHits],a
.executeOtherEffects
- ld a,[W_PLAYERMOVEEFFECT]
+ ld a,[wPlayerMoveEffect]
and a
jp z,ExecutePlayerMoveDone
ld hl,SpecialEffects
@@ -3368,10 +3368,10 @@
db "@"
IsGhostBattle: ; 3d83a (f:583a)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
dec a
ret nz
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
cp a,POKEMONTOWER_1
jr c,.next
cp a,LAVENDER_HOUSE_1
@@ -3424,7 +3424,7 @@
jp .returnToHL
.HeldInPlaceCheck
- ld a,[W_ENEMYBATTSTATUS1]
+ ld a,[wEnemyBattleStatus1]
bit UsingTrappingMove,a ; is enemy using a mult-turn move like wrap?
jp z,.FlinchedCheck
ld hl,CantMoveText
@@ -3433,7 +3433,7 @@
jp .returnToHL
.FlinchedCheck
- ld hl,W_PLAYERBATTSTATUS1
+ ld hl,wPlayerBattleStatus1
bit Flinched,[hl]
jp z,.HyperBeamCheck
res Flinched,[hl] ; reset player's flinch status
@@ -3443,7 +3443,7 @@
jp .returnToHL
.HyperBeamCheck
- ld hl,W_PLAYERBATTSTATUS2
+ ld hl,wPlayerBattleStatus2
bit NeedsToRecharge,[hl]
jr z,.AnyMoveDisabledCheck
res NeedsToRecharge,[hl] ; reset player's recharge status
@@ -3453,7 +3453,7 @@
jp .returnToHL
.AnyMoveDisabledCheck
- ld hl,W_PLAYERDISABLEDMOVE
+ ld hl,wPlayerDisabledMove
ld a,[hl]
and a
jr z,.ConfusedCheck
@@ -3467,13 +3467,13 @@
call PrintText
.ConfusedCheck
- ld a,[W_PLAYERBATTSTATUS1]
+ ld a,[wPlayerBattleStatus1]
add a ; is player confused?
jr nc,.TriedToUseDisabledMoveCheck
- ld hl,W_PLAYERCONFUSEDCOUNTER
+ ld hl,wPlayerConfusedCounter
dec [hl]
jr nz,.IsConfused
- ld hl,W_PLAYERBATTSTATUS1
+ ld hl,wPlayerBattleStatus1
res Confused,[hl] ; if confused counter hit 0, reset confusion status
ld hl,ConfusedNoMoreText
call PrintText
@@ -3488,9 +3488,9 @@
call BattleRandom
cp a,$80 ; 50% chance to hurt itself
jr c,.TriedToUseDisabledMoveCheck
- ld hl,W_PLAYERBATTSTATUS1
+ ld hl,wPlayerBattleStatus1
ld a,[hl]
- and a, 1 << Confused ; if mon hurts itself, clear every other status from W_PLAYERBATTSTATUS1
+ and a, 1 << Confused ; if mon hurts itself, clear every other status from wPlayerBattleStatus1
ld [hl],a
call HandleSelfConfusionDamage
jr .MonHurtItselfOrFullyParalysed
@@ -3518,12 +3518,12 @@
call PrintText
.MonHurtItselfOrFullyParalysed
- ld hl,W_PLAYERBATTSTATUS1
+ ld hl,wPlayerBattleStatus1
ld a,[hl]
; clear bide, thrashing, charging up, and trapping moves such as warp (already cleared for confusion damage)
and $ff ^ ((1 << StoringEnergy) | (1 << ThrashingAbout) | (1 << ChargingUp) | (1 << UsingTrappingMove))
ld [hl],a
- ld a,[W_PLAYERMOVEEFFECT]
+ ld a,[wPlayerMoveEffect]
cp a,FLY_EFFECT
jr z,.FlyOrChargeEffect
cp a,CHARGE_EFFECT
@@ -3540,12 +3540,12 @@
jp .returnToHL ; if using a two-turn move, we need to recharge the first turn
.BideCheck
- ld hl,W_PLAYERBATTSTATUS1
+ ld hl,wPlayerBattleStatus1
bit StoringEnergy,[hl] ; is mon using bide?
jr z,.ThrashingAboutCheck
xor a
- ld [W_PLAYERMOVENUM],a
- ld hl,W_DAMAGE
+ ld [wPlayerMoveNum],a
+ ld hl,wDamage
ld a,[hli]
ld b,a
ld c,[hl]
@@ -3562,30 +3562,30 @@
ld hl,ExecutePlayerMoveDone
jp .returnToHL ; unless mon unleashes energy, can't move this turn
.UnleashEnergy
- ld hl,W_PLAYERBATTSTATUS1
+ ld hl,wPlayerBattleStatus1
res StoringEnergy,[hl] ; not using bide any more
ld hl,UnleashedEnergyText
call PrintText
ld a,1
- ld [W_PLAYERMOVEPOWER],a
+ ld [wPlayerMovePower],a
ld hl,wPlayerBideAccumulatedDamage + 1
ld a,[hld]
add a
ld b,a
- ld [W_DAMAGE + 1],a
+ ld [wDamage + 1],a
ld a,[hl]
rl a ; double the damage
- ld [W_DAMAGE],a
+ ld [wDamage],a
or b
jr nz,.next
ld a,1
- ld [W_MOVEMISSED],a
+ ld [wMoveMissed],a
.next
xor a
ld [hli],a
ld [hl],a
ld a,BIDE
- ld [W_PLAYERMOVENUM],a
+ ld [wPlayerMoveNum],a
ld hl,handleIfPlayerMoveMissed ; skip damage calculation, DecrementPP and MoveHitTest
jp .returnToHL
@@ -3593,7 +3593,7 @@
bit ThrashingAbout,[hl] ; is mon using thrash or petal dance?
jr z,.MultiturnMoveCheck
ld a,THRASH
- ld [W_PLAYERMOVENUM],a
+ ld [wPlayerMoveNum],a
ld hl,ThrashingAboutText
call PrintText
ld hl,wPlayerNumAttacksLeft
@@ -3601,7 +3601,7 @@
ld hl,PlayerCalcMoveDamage ; skip DecrementPP
jp nz,.returnToHL
push hl
- ld hl,W_PLAYERBATTSTATUS1
+ ld hl,wPlayerBattleStatus1
res ThrashingAbout,[hl] ; no longer thrashing about
set Confused,[hl] ; confused
call BattleRandom
@@ -3608,7 +3608,7 @@
and a,3
inc a
inc a ; confused for 2-5 turns
- ld [W_PLAYERCONFUSEDCOUNTER],a
+ ld [wPlayerConfusedCounter],a
pop hl ; skip DecrementPP
jp .returnToHL
@@ -3626,7 +3626,7 @@
jp .returnToHL
.RageCheck
- ld a, [W_PLAYERBATTSTATUS2]
+ ld a, [wPlayerBattleStatus2]
bit UsingRage, a ; is mon using rage?
jp z, .checkPlayerStatusConditionsDone ; if we made it this far, mon can move normally this turn
ld a, RAGE
@@ -3634,7 +3634,7 @@
call GetMoveName
call CopyStringToCF4B
xor a
- ld [W_PLAYERMOVEEFFECT], a
+ ld [wPlayerMoveEffect], a
ld hl, PlayerCanExecuteMove
jp .returnToHL
@@ -3709,12 +3709,12 @@
PrintMoveIsDisabledText: ; 3da88 (f:5a88)
ld hl, wPlayerSelectedMove
- ld de, W_PLAYERBATTSTATUS1
+ ld de, wPlayerBattleStatus1
ld a, [H_WHOSETURN]
and a
jr z, .removeChargingUp
inc hl
- ld de, W_ENEMYBATTSTATUS1
+ ld de, wEnemyBattleStatus1
.removeChargingUp
ld a, [de]
res ChargingUp, a ; end the pokemon's
@@ -3741,7 +3741,7 @@
ld [hli], a
ld a, [wBattleMonDefense + 1]
ld [hl], a
- ld hl, W_PLAYERMOVEEFFECT
+ ld hl, wPlayerMoveEffect
push hl
ld a, [hl]
push af
@@ -3787,10 +3787,10 @@
TX_ASM
ld a, [H_WHOSETURN]
and a
- ld a, [W_PLAYERMOVENUM]
+ ld a, [wPlayerMoveNum]
ld hl, wPlayerUsedMove
jr z, .asm_3db11
- ld a, [W_ENEMYMOVENUM]
+ ld a, [wEnemyMoveNum]
ld hl, wEnemyUsedMove
.asm_3db11
ld [hl], a
@@ -3921,11 +3921,11 @@
db $FF ; terminator
PrintMoveFailureText: ; 3dbe2 (f:5be2)
- ld de, W_PLAYERMOVEEFFECT
+ ld de, wPlayerMoveEffect
ld a, [H_WHOSETURN]
and a
jr z, .playersTurn
- ld de, W_ENEMYMOVEEFFECT
+ ld de, wEnemyMoveEffect
.playersTurn
ld hl, DoesntAffectMonText
ld a, [wDamageMultipliers]
@@ -3947,7 +3947,7 @@
ret nz
; if you get here, the mon used jump kick or hi jump kick and missed
- ld hl, W_DAMAGE ; since the move missed, W_DAMAGE will always contain 0 at this point.
+ ld hl, wDamage ; since the move missed, wDamage will always contain 0 at this point.
; Thus, recoil damage will always be equal to 1
; even if it was intended to be potential damage/8.
ld a, [hli]
@@ -4057,7 +4057,7 @@
; it was traded
.monIsTraded
; what level might disobey?
- ld hl, W_OBTAINEDBADGES
+ ld hl, wObtainedBadges
bit 7, [hl]
ld a, 101
jr nz, .next
@@ -4234,15 +4234,15 @@
; sets b, c, d, and e for the CalculateDamage routine in the case of an attack by the player mon
GetDamageVarsForPlayerAttack: ; 3ddcf (f:5dcf)
xor a
- ld hl, W_DAMAGE ; damage to eventually inflict, initialise to zero
+ ld hl, wDamage ; damage to eventually inflict, initialise to zero
ldi [hl], a
ld [hl], a
- ld hl, W_PLAYERMOVEPOWER
+ ld hl, wPlayerMovePower
ld a, [hli]
and a
ld d, a ; d = move power
ret z ; return if move power is zero
- ld a, [hl] ; a = [W_PLAYERMOVETYPE]
+ ld a, [hl] ; a = [wPlayerMoveType]
cp FIRE ; types >= FIRE are all special
jr nc, .specialAttack
.physicalAttack
@@ -4250,7 +4250,7 @@
ld a, [hli]
ld b, a
ld c, [hl] ; bc = enemy defense
- ld a, [W_ENEMYBATTSTATUS3]
+ ld a, [wEnemyBattleStatus3]
bit HasReflectUp, a ; check for Reflect
jr z, .physicalAttackCritCheck
; if the enemy has used Reflect, double the enemy's defense
@@ -4280,7 +4280,7 @@
ld a, [hli]
ld b, a
ld c, [hl] ; bc = enemy special
- ld a, [W_ENEMYBATTSTATUS3]
+ ld a, [wEnemyBattleStatus3]
bit HasLightScreenUp, a ; check for Light Screen
jr z, .specialAttackCritCheck
; if the enemy has used Light Screen, double the enemy's special
@@ -4346,16 +4346,16 @@
; sets b, c, d, and e for the CalculateDamage routine in the case of an attack by the enemy mon
GetDamageVarsForEnemyAttack: ; 3de75 (f:5e75)
- ld hl, W_DAMAGE ; damage to eventually inflict, initialise to zero
+ ld hl, wDamage ; damage to eventually inflict, initialise to zero
xor a
ld [hli], a
ld [hl], a
- ld hl, W_ENEMYMOVEPOWER
+ ld hl, wEnemyMovePower
ld a, [hli]
ld d, a ; d = move power
and a
ret z ; return if move power is zero
- ld a, [hl] ; a = [W_ENEMYMOVETYPE]
+ ld a, [hl] ; a = [wEnemyMoveType]
cp FIRE ; types >= FIRE are all special
jr nc, .specialAttack
.physicalAttack
@@ -4363,7 +4363,7 @@
ld a, [hli]
ld b, a
ld c, [hl] ; bc = player defense
- ld a, [W_PLAYERBATTSTATUS3]
+ ld a, [wPlayerBattleStatus3]
bit HasReflectUp, a ; check for Reflect
jr z, .physicalAttackCritCheck
; if the player has used Reflect, double the player's defense
@@ -4393,7 +4393,7 @@
ld a, [hli]
ld b, a
ld c, [hl]
- ld a, [W_PLAYERBATTSTATUS3]
+ ld a, [wPlayerBattleStatus3]
bit HasLightScreenUp, a ; check for Light Screen
jr z, .specialAttackCritCheck
; if the player has used Light Screen, double the player's special
@@ -4483,7 +4483,7 @@
ret
.notLinkBattle
ld a, [wEnemyMonLevel]
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
ld a, [wEnemyMonSpecies]
ld [wd0b5], a
call GetMonHeader
@@ -4510,9 +4510,9 @@
ld a, [H_WHOSETURN] ; whose turn?
and a
- ld a, [W_PLAYERMOVEEFFECT]
+ ld a, [wPlayerMoveEffect]
jr z, .effect
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
.effect
; EXPLODE_EFFECT halves defense.
@@ -4589,7 +4589,7 @@
ld b, 4
call Divide
- ld hl, W_DAMAGE
+ ld hl, wDamage
ld b, [hl]
ld a, [H_QUOTIENT + 3]
add b
@@ -4665,7 +4665,7 @@
JumpToOHKOMoveEffect: ; 3e016 (f:6016)
call JumpMoveEffect
- ld a, [W_MOVEMISSED]
+ ld a, [wMoveMissed]
dec a
ret
@@ -4692,16 +4692,16 @@
.asm_3e032
ld [wd0b5], a
call GetMonHeader
- ld a, [W_MONHBASESPEED]
+ ld a, [wMonHBaseSpeed]
ld b, a
srl b ; (effective (base speed/2))
ld a, [H_WHOSETURN]
and a
- ld hl, W_PLAYERMOVEPOWER
- ld de, W_PLAYERBATTSTATUS2
+ ld hl, wPlayerMovePower
+ ld de, wPlayerBattleStatus2
jr z, .calcCriticalHitProbability
- ld hl, W_ENEMYMOVEPOWER
- ld de, W_ENEMYBATTSTATUS2
+ ld hl, wEnemyMovePower
+ ld de, wEnemyBattleStatus2
.calcCriticalHitProbability
ld a, [hld] ; read base power from RAM
and a
@@ -4768,18 +4768,18 @@
and a
; player's turn
ld hl,wEnemySelectedMove
- ld de,W_ENEMYMOVEPOWER
+ ld de,wEnemyMovePower
ld a,[wPlayerSelectedMove]
jr z,.next
; enemy's turn
ld hl,wPlayerSelectedMove
- ld de,W_PLAYERMOVEPOWER
+ ld de,wPlayerMovePower
ld a,[wEnemySelectedMove]
.next
cp a,COUNTER
ret nz ; return if not using Counter
ld a,$01
- ld [W_MOVEMISSED],a ; initialize the move missed variable to true (it is set to false below if the move hits)
+ ld [wMoveMissed],a ; initialize the move missed variable to true (it is set to false below if the move hits)
ld a,[hl]
cp a,COUNTER
ret z ; miss if the opponent's last selected move is Counter.
@@ -4797,11 +4797,11 @@
xor a
ret
.counterableType
- ld hl,W_DAMAGE
+ ld hl,wDamage
ld a,[hli]
or [hl]
ret z ; If we made it here, Counter still misses if the last move used in battle did no damage to its target.
- ; W_DAMAGE is shared by both players, so Counter may strike back damage dealt by the Counter user itself
+ ; wDamage is shared by both players, so Counter may strike back damage dealt by the Counter user itself
; if the conditions meet, even though 99% of the times damage will come from the target.
; if it did damage, double it
ld a,[hl]
@@ -4817,13 +4817,13 @@
ld [hl],a
.noCarry
xor a
- ld [W_MOVEMISSED],a
+ ld [wMoveMissed],a
call MoveHitTest ; do the normal move hit test in addition to Counter's special rules
xor a
ret
ApplyAttackToEnemyPokemon: ; 3e0df (f:60df)
- ld a,[W_PLAYERMOVEEFFECT]
+ ld a,[wPlayerMoveEffect]
cp a,OHKO_EFFECT
jr z,ApplyDamageToEnemyPokemon
cp a,SUPER_FANG_EFFECT
@@ -4830,7 +4830,7 @@
jr z,.superFangEffect
cp a,SPECIAL_DAMAGE_EFFECT
jr z,.specialDamage
- ld a,[W_PLAYERMOVEPOWER]
+ ld a,[wPlayerMovePower]
and a
jp z,ApplyAttackToEnemyPokemonDone ; no attack to apply if base power is 0
jr ApplyDamageToEnemyPokemon
@@ -4837,7 +4837,7 @@
.superFangEffect
; set the damage to half the target's HP
ld hl,wEnemyMonHP
- ld de,W_DAMAGE
+ ld de,wDamage
ld a,[hli]
srl a
ld [de],a
@@ -4856,7 +4856,7 @@
ld hl,wBattleMonLevel
ld a,[hl]
ld b,a ; Seismic Toss deals damage equal to the user's level
- ld a,[W_PLAYERMOVENUM]
+ ld a,[wPlayerMoveNum]
cp a,SEISMIC_TOSS
jr z,.storeDamage
cp a,NIGHT_SHADE
@@ -4882,7 +4882,7 @@
jr nc,.loop
ld b,a
.storeDamage ; store damage value at b
- ld hl,W_DAMAGE
+ ld hl,wDamage
xor a
ld [hli],a
ld a,b
@@ -4889,13 +4889,13 @@
ld [hl],a
ApplyDamageToEnemyPokemon: ; 3e142 (f:6142)
- ld hl,W_DAMAGE
+ ld hl,wDamage
ld a,[hli]
ld b,a
ld a,[hl]
or b
jr z,ApplyAttackToEnemyPokemonDone ; we're done if damage is 0
- ld a,[W_ENEMYBATTSTATUS2]
+ ld a,[wEnemyBattleStatus2]
bit HasSubstituteUp,a ; does the enemy have a substitute?
jp nz,AttackSubstitute
; subtract the damage from the pokemon's current HP
@@ -4913,7 +4913,7 @@
sbc b
ld [wEnemyMonHP],a
jr nc,.animateHpBar
-; if more damage was done than the current HP, zero the HP and set the damage (W_DAMAGE)
+; if more damage was done than the current HP, zero the HP and set the damage (wDamage)
; equal to how much HP the pokemon had before the attack
ld a,[wHPBarOldHP+1]
ld [hli],a
@@ -4942,7 +4942,7 @@
jp DrawHUDsAndHPBars
ApplyAttackToPlayerPokemon: ; 3e1a0 (f:61a0)
- ld a,[W_ENEMYMOVEEFFECT]
+ ld a,[wEnemyMoveEffect]
cp a,OHKO_EFFECT
jr z,ApplyDamageToPlayerPokemon
cp a,SUPER_FANG_EFFECT
@@ -4949,7 +4949,7 @@
jr z,.superFangEffect
cp a,SPECIAL_DAMAGE_EFFECT
jr z,.specialDamage
- ld a,[W_ENEMYMOVEPOWER]
+ ld a,[wEnemyMovePower]
and a
jp z,ApplyAttackToPlayerPokemonDone
jr ApplyDamageToPlayerPokemon
@@ -4956,7 +4956,7 @@
.superFangEffect
; set the damage to half the target's HP
ld hl,wBattleMonHP
- ld de,W_DAMAGE
+ ld de,wDamage
ld a,[hli]
srl a
ld [de],a
@@ -4975,7 +4975,7 @@
ld hl,wEnemyMonLevel
ld a,[hl]
ld b,a
- ld a,[W_ENEMYMOVENUM]
+ ld a,[wEnemyMoveNum]
cp a,SEISMIC_TOSS
jr z,.storeDamage
cp a,NIGHT_SHADE
@@ -5001,7 +5001,7 @@
jr nc,.loop
ld b,a
.storeDamage
- ld hl,W_DAMAGE
+ ld hl,wDamage
xor a
ld [hli],a
ld a,b
@@ -5008,13 +5008,13 @@
ld [hl],a
ApplyDamageToPlayerPokemon: ; 3e200 (f:6200)
- ld hl,W_DAMAGE
+ ld hl,wDamage
ld a,[hli]
ld b,a
ld a,[hl]
or b
jr z,ApplyAttackToPlayerPokemonDone ; we're done if damage is 0
- ld a,[W_PLAYERBATTSTATUS2]
+ ld a,[wPlayerBattleStatus2]
bit HasSubstituteUp,a ; does the player have a substitute?
jp nz,AttackSubstitute
; subtract the damage from the pokemon's current HP
@@ -5033,7 +5033,7 @@
ld [wBattleMonHP],a
ld [wHPBarNewHP+1],a
jr nc,.animateHpBar
-; if more damage was done than the current HP, zero the HP and set the damage (W_DAMAGE)
+; if more damage was done than the current HP, zero the HP and set the damage (wDamage)
; equal to how much HP the pokemon had before the attack
ld a,[wHPBarOldHP+1]
ld [hli],a
@@ -5071,15 +5071,15 @@
call PrintText
; values for player turn
ld de,wEnemySubstituteHP
- ld bc,W_ENEMYBATTSTATUS2
+ ld bc,wEnemyBattleStatus2
ld a,[H_WHOSETURN]
and a
jr z,.applyDamageToSubstitute
; values for enemy turn
ld de,wPlayerSubstituteHP
- ld bc,W_PLAYERBATTSTATUS2
+ ld bc,wPlayerBattleStatus2
.applyDamageToSubstitute
- ld hl,W_DAMAGE
+ ld hl,wDamage
ld a,[hli]
and a
jr nz,.substituteBroke ; damage > 0xFF always breaks substitutes
@@ -5089,7 +5089,7 @@
ld [de],a
ret nc
.substituteBroke
-; If the target's Substitute breaks, W_DAMAGE isn't updated with the amount of HP
+; If the target's Substitute breaks, wDamage isn't updated with the amount of HP
; the Substitute had before being attacked.
ld h,b
ld l,c
@@ -5105,10 +5105,10 @@
ld a,[H_WHOSETURN]
xor a,$01
ld [H_WHOSETURN],a
- ld hl,W_PLAYERMOVEEFFECT ; value for player's turn
+ ld hl,wPlayerMoveEffect ; value for player's turn
and a
jr z,.nullifyEffect
- ld hl,W_ENEMYMOVEEFFECT ; value for enemy's turn
+ ld hl,wEnemyMoveEffect ; value for enemy's turn
.nullifyEffect
xor a
ld [hl],a ; zero the effect of the attacker's move
@@ -5125,16 +5125,16 @@
; this function raises the attack modifier of a pokemon using Rage when that pokemon is attacked
HandleBuildingRage: ; 3e2b6 (f:62b6)
; values for the player turn
- ld hl,W_ENEMYBATTSTATUS2
+ ld hl,wEnemyBattleStatus2
ld de,wEnemyMonStatMods
- ld bc,W_ENEMYMOVENUM
+ ld bc,wEnemyMoveNum
ld a,[H_WHOSETURN]
and a
jr z,.next
; values for the enemy turn
- ld hl,W_PLAYERBATTSTATUS2
+ ld hl,wPlayerBattleStatus2
ld de,wPlayerMonStatMods
- ld bc,W_PLAYERMOVENUM
+ ld bc,wPlayerMoveNum
.next
bit UsingRage,[hl] ; is the pokemon being attacked under the effect of Rage?
ret z ; return if not
@@ -5183,11 +5183,11 @@
; values for player turn
ld a,[wEnemyUsedMove]
ld hl,wPlayerSelectedMove
- ld de,W_PLAYERMOVENUM
+ ld de,wPlayerMoveNum
jr z,.next
; values for enemy turn
ld a,[wPlayerUsedMove]
- ld de,W_ENEMYMOVENUM
+ ld de,wEnemyMoveNum
ld hl,wEnemySelectedMove
.next
ld [hl],a
@@ -5229,13 +5229,13 @@
ld a,METRONOME
call PlayMoveAnimation ; play Metronome's animation
; values for player turn
- ld de,W_PLAYERMOVENUM
+ ld de,wPlayerMoveNum
ld hl,wPlayerSelectedMove
ld a,[H_WHOSETURN]
and a
jr z,.pickMoveLoop
; values for enemy turn
- ld de,W_ENEMYMOVENUM
+ ld de,wEnemyMoveNum
ld hl,wEnemySelectedMove
; loop to pick a random number in the range [1, $a5) to be the move used by Metronome
.pickMoveLoop
@@ -5294,7 +5294,7 @@
ld a,[hli]
ld d,a ; d = type 1 of defender
ld e,[hl] ; e = type 2 of defender
- ld a,[W_PLAYERMOVETYPE]
+ ld a,[wPlayerMoveType]
ld [wMoveType],a
ld a,[H_WHOSETURN]
and a
@@ -5308,7 +5308,7 @@
ld a,[hli]
ld d,a ; d = type 1 of defender
ld e,[hl] ; e = type 2 of defender
- ld a,[W_ENEMYMOVETYPE]
+ ld a,[wEnemyMoveType]
ld [wMoveType],a
.next
ld a,[wMoveType]
@@ -5319,7 +5319,7 @@
jr .skipSameTypeAttackBonus
.sameTypeAttackBonus
; if the move type matches one of the attacker's types
- ld hl,W_DAMAGE + 1
+ ld hl,wDamage + 1
ld a,[hld]
ld h,[hl]
ld l,a ; hl = damage
@@ -5330,9 +5330,9 @@
add hl,bc ; hl = floor(1.5 * damage)
; store damage
ld a,h
- ld [W_DAMAGE],a
+ ld [wDamage],a
ld a,l
- ld [W_DAMAGE + 1],a
+ ld [wDamage + 1],a
ld hl,wDamageMultipliers
set 7,[hl]
.skipSameTypeAttackBonus
@@ -5365,7 +5365,7 @@
ld [wDamageMultipliers],a
xor a
ld [H_MULTIPLICAND],a
- ld hl,W_DAMAGE
+ ld hl,wDamage
ld a,[hli]
ld [H_MULTIPLICAND + 1],a
ld a,[hld]
@@ -5386,7 +5386,7 @@
; if damage is 0, make the move miss
; this only occurs if a move that would do 2 or 3 damage is 0.25x effective against the target
inc a
- ld [W_MOVEMISSED],a
+ ld [wMoveMissed],a
.skipTypeImmunity
pop bc
pop hl
@@ -5404,7 +5404,7 @@
; ($05 is not very effective, $10 is neutral, $14 is super effective)
; as far is can tell, this is only used once in some AI code to help decide which move to use
AIGetTypeEffectiveness: ; 3e449 (f:6449)
- ld a,[W_ENEMYMOVETYPE]
+ ld a,[wEnemyMoveType]
ld d,a ; d = type of enemy move
ld hl,wBattleMonType
ld b,[hl] ; b = type 1 of player's pokemon
@@ -5440,15 +5440,15 @@
; some tests that need to pass for a move to hit
MoveHitTest: ; 3e56b (f:656b)
; player's turn
- ld hl,W_ENEMYBATTSTATUS1
- ld de,W_PLAYERMOVEEFFECT
+ ld hl,wEnemyBattleStatus1
+ ld de,wPlayerMoveEffect
ld bc,wEnemyMonStatus
ld a,[H_WHOSETURN]
and a
jr z,.dreamEaterCheck
; enemy's turn
- ld hl,W_PLAYERBATTSTATUS1
- ld de,W_ENEMYMOVEEFFECT
+ ld hl,wPlayerBattleStatus1
+ ld de,wEnemyMoveEffect
ld bc,wBattleMonStatus
.dreamEaterCheck
ld a,[de]
@@ -5477,7 +5477,7 @@
jr nz,.enemyTurn
.playerTurn
; this checks if the move effect is disallowed by mist
- ld a,[W_PLAYERMOVEEFFECT]
+ ld a,[wPlayerMoveEffect]
cp a,ATTACK_DOWN1_EFFECT
jr c,.skipEnemyMistCheck
cp a,HAZE_EFFECT + 1
@@ -5494,16 +5494,16 @@
; FLASH, CONVERSION*, HAZE*, SCREECH, LIGHT SCREEN*, REFLECT*
; the moves that are marked with an asterisk are not affected since this
; function is not called when those moves are used
- ld a,[W_ENEMYBATTSTATUS2]
+ ld a,[wEnemyBattleStatus2]
bit ProtectedByMist,a ; is mon protected by mist?
jp nz,.moveMissed
.skipEnemyMistCheck
- ld a,[W_PLAYERBATTSTATUS2]
+ ld a,[wPlayerBattleStatus2]
bit UsingXAccuracy,a ; is the player using X Accuracy?
ret nz ; if so, always hit regardless of accuracy/evasion
jr .calcHitChance
.enemyTurn
- ld a,[W_ENEMYMOVEEFFECT]
+ ld a,[wEnemyMoveEffect]
cp a,ATTACK_DOWN1_EFFECT
jr c,.skipPlayerMistCheck
cp a,HAZE_EFFECT + 1
@@ -5515,21 +5515,21 @@
jr .skipPlayerMistCheck
.playerMistCheck
; similar to enemy mist check
- ld a,[W_PLAYERBATTSTATUS2]
+ ld a,[wPlayerBattleStatus2]
bit ProtectedByMist,a ; is mon protected by mist?
jp nz,.moveMissed
.skipPlayerMistCheck
- ld a,[W_ENEMYBATTSTATUS2]
+ ld a,[wEnemyBattleStatus2]
bit UsingXAccuracy,a ; is the enemy using X Accuracy?
ret nz ; if so, always hit regardless of accuracy/evasion
.calcHitChance
call CalcHitChance ; scale the move accuracy according to attacker's accuracy and target's evasion
- ld a,[W_PLAYERMOVEACCURACY]
+ ld a,[wPlayerMoveAccuracy]
ld b,a
ld a,[H_WHOSETURN]
and a
jr z,.doAccuracyCheck
- ld a,[W_ENEMYMOVEACCURACY]
+ ld a,[wEnemyMoveAccuracy]
ld b,a
.doAccuracyCheck
; if the random number generated is greater than or equal to the scaled accuracy, the move misses
@@ -5540,26 +5540,26 @@
ret
.moveMissed
xor a
- ld hl,W_DAMAGE ; zero the damage
+ ld hl,wDamage ; zero the damage
ld [hli],a
ld [hl],a
inc a
- ld [W_MOVEMISSED],a
+ ld [wMoveMissed],a
ld a,[H_WHOSETURN]
and a
jr z,.playerTurn2
.enemyTurn2
- ld hl,W_ENEMYBATTSTATUS1
+ ld hl,wEnemyBattleStatus1
res UsingTrappingMove,[hl] ; end multi-turn attack e.g. wrap
ret
.playerTurn2
- ld hl,W_PLAYERBATTSTATUS1
+ ld hl,wPlayerBattleStatus1
res UsingTrappingMove,[hl] ; end multi-turn attack e.g. wrap
ret
; values for player turn
CalcHitChance: ; 3e624 (f:6624)
- ld hl,W_PLAYERMOVEACCURACY
+ ld hl,wPlayerMoveAccuracy
ld a,[H_WHOSETURN]
and a
ld a,[wPlayerMonAccuracyMod]
@@ -5568,7 +5568,7 @@
ld c,a
jr z,.next
; values for enemy turn
- ld hl,W_ENEMYMOVEACCURACY
+ ld hl,wEnemyMoveAccuracy
ld a,[wEnemyMonAccuracyMod]
ld b,a
ld a,[wPlayerMonEvasionMod]
@@ -5631,7 +5631,7 @@
; multiplies damage by a random percentage from ~85% to 100%
RandomizeDamage: ; 3e687 (f:6687)
- ld hl, W_DAMAGE
+ ld hl, wDamage
ld a, [hli]
and a
jr nz, .DamageGreaterThanOne
@@ -5660,7 +5660,7 @@
call Divide ; divide the result by 255
; store the modified damage
ld a, [H_QUOTIENT + 2]
- ld hl, W_DAMAGE
+ ld hl, wDamage
ld [hli], a
ld a, [H_QUOTIENT + 3]
ld [hl], a
@@ -5686,7 +5686,7 @@
ld hl, wAILayer2Encouragement
inc [hl]
xor a
- ld [W_MOVEMISSED], a
+ ld [wMoveMissed], a
ld [wMoveDidntMiss], a
ld a, $a
ld [wDamageMultipliers], a
@@ -5694,13 +5694,13 @@
jr nz, .enemyHasNoSpecialConditions
jp [hl]
.enemyHasNoSpecialConditions
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
bit ChargingUp, [hl] ; is the enemy charging up for attack?
jr nz, EnemyCanExecuteChargingMove ; if so, jump
call GetCurrentMove
CheckIfEnemyNeedsToChargeUp: ; 3e6fc (f:66fc)
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
cp CHARGE_EFFECT
jp z, JumpMoveEffect
cp FLY_EFFECT
@@ -5707,10 +5707,10 @@
jp z, JumpMoveEffect
jr EnemyCanExecuteMove
EnemyCanExecuteChargingMove: ; 3e70b (f:670b)
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
res ChargingUp, [hl] ; no longer charging up for attack
res Invulnerable, [hl] ; no longer invulnerable to typical attacks
- ld a, [W_ENEMYMOVENUM]
+ ld a, [wEnemyMoveNum]
ld [wd0b5], a
ld a, BANK(MoveNames)
ld [wPredefBank], a
@@ -5723,12 +5723,12 @@
xor a
ld [wMonIsDisobedient], a
call PrintMonName1Text
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
ld hl, ResidualEffects1
ld de, $1
call IsInArray
jp c, JumpMoveEffect
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
ld hl, SpecialEffectsCont
ld de, $1
call IsInArray
@@ -5735,7 +5735,7 @@
call c, JumpMoveEffect
EnemyCalcMoveDamage: ; 3e750 (f:6750)
call SwapPlayerAndEnemyLevels
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
ld hl, SetDamageEffects
ld de, $1
call IsInArray
@@ -5754,10 +5754,10 @@
EnemyMoveHitTest: ; 3e77f (f:677f)
call MoveHitTest
handleIfEnemyMoveMissed: ; 3e782 (f:6782)
- ld a, [W_MOVEMISSED]
+ ld a, [wMoveMissed]
and a
jr z, .asm_3e791
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
cp EXPLODE_EFFECT
jr z, asm_3e7a0
jr EnemyCheckIfFlyOrChargeEffect
@@ -5765,7 +5765,7 @@
call SwapPlayerAndEnemyLevels
GetEnemyAnimationType: ; 3e794 (f:6794)
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
and a
ld a, $1
jr z, playEnemyMoveAnimation
@@ -5776,7 +5776,7 @@
xor a
playEnemyMoveAnimation: ; 3e7a4 (f:67a4)
push af
- ld a, [W_ENEMYBATTSTATUS2]
+ ld a, [wEnemyBattleStatus2]
bit HasSubstituteUp, a ; does mon have a substitute?
ld hl, HideSubstituteShowMonAnim
ld b, BANK(HideSubstituteShowMonAnim)
@@ -5783,11 +5783,11 @@
call nz, Bankswitch
pop af
ld [wAnimationType], a
- ld a, [W_ENEMYMOVENUM]
+ ld a, [wEnemyMoveNum]
call PlayMoveAnimation
call HandleExplodingAnimation
call DrawEnemyHUDAndHPBar
- ld a, [W_ENEMYBATTSTATUS2]
+ ld a, [wEnemyBattleStatus2]
bit HasSubstituteUp, a ; does mon have a substitute?
ld hl, ReshowSubstituteAnim
ld b, BANK(ReshowSubstituteAnim)
@@ -5798,7 +5798,7 @@
call SwapPlayerAndEnemyLevels
ld c, 30
call DelayFrames
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
cp FLY_EFFECT
jr z, .playAnim
cp CHARGE_EFFECT
@@ -5810,7 +5810,7 @@
ld a,STATUS_AFFECTED_ANIM
call PlayMoveAnimation
EnemyCheckIfMirrorMoveEffect: ; 3e7ef (f:67ef)
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
cp MIRROR_MOVE_EFFECT
jr nz, .notMirrorMoveEffect
call MirrorMoveCopyMove
@@ -5822,16 +5822,16 @@
call MetronomePickMove
jp CheckIfEnemyNeedsToChargeUp
.notMetronomeEffect
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
ld hl, ResidualEffects2
ld de, $1
call IsInArray
jp c, JumpMoveEffect
- ld a, [W_MOVEMISSED]
+ ld a, [wMoveMissed]
and a
jr z, .asm_3e82b
call PrintMoveFailureText
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
cp EXPLODE_EFFECT
jr z, .asm_3e83e
jp ExecuteEnemyMoveDone
@@ -5842,7 +5842,7 @@
ld a, 1
ld [wMoveDidntMiss], a
.asm_3e83e
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
ld hl, AlwaysHappenSideEffects
ld de, $1
call IsInArray
@@ -5853,7 +5853,7 @@
or b
ret z
call HandleBuildingRage
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
bit AttackingMultipleTimes, [hl] ; is mon hitting multiple times? (example: double kick)
jr z, .asm_3e873
push hl
@@ -5867,7 +5867,7 @@
xor a
ld [wEnemyNumHits], a
.asm_3e873
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
and a
jr z, ExecuteEnemyMoveDone
ld hl, SpecialEffects
@@ -5920,7 +5920,7 @@
ld hl, ExecuteEnemyMoveDone ; enemy can't move this turn
jp .enemyReturnToHL
.checkIfTrapped
- ld a, [W_PLAYERBATTSTATUS1]
+ ld a, [wPlayerBattleStatus1]
bit UsingTrappingMove, a ; is the player using a multi-turn attack like warp
jp z, .checkIfFlinched
ld hl, CantMoveText
@@ -5928,7 +5928,7 @@
ld hl, ExecuteEnemyMoveDone ; enemy can't move this turn
jp .enemyReturnToHL
.checkIfFlinched
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
bit Flinched, [hl] ; check if enemy mon flinched
jp z, .checkIfMustRecharge
res Flinched, [hl]
@@ -5937,7 +5937,7 @@
ld hl, ExecuteEnemyMoveDone ; enemy can't move this turn
jp .enemyReturnToHL
.checkIfMustRecharge
- ld hl, W_ENEMYBATTSTATUS2
+ ld hl, wEnemyBattleStatus2
bit NeedsToRecharge, [hl] ; check if enemy mon has to recharge after using a move
jr z, .checkIfAnyMoveDisabled
res NeedsToRecharge, [hl]
@@ -5946,7 +5946,7 @@
ld hl, ExecuteEnemyMoveDone ; enemy can't move this turn
jp .enemyReturnToHL
.checkIfAnyMoveDisabled
- ld hl, W_ENEMYDISABLEDMOVE
+ ld hl, wEnemyDisabledMove
ld a, [hl]
and a
jr z, .checkIfConfused
@@ -5959,13 +5959,13 @@
ld hl, DisabledNoMoreText
call PrintText
.checkIfConfused
- ld a, [W_ENEMYBATTSTATUS1]
+ ld a, [wEnemyBattleStatus1]
add a ; check if enemy mon is confused
jp nc, .checkIfTriedToUseDisabledMove
- ld hl, W_ENEMYCONFUSEDCOUNTER
+ ld hl, wEnemyConfusedCounter
dec [hl]
jr nz, .isConfused
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
res Confused, [hl] ; if confused counter hit 0, reset confusion status
ld hl, ConfusedNoMoreText
call PrintText
@@ -5980,9 +5980,9 @@
call BattleRandom
cp $80
jr c, .checkIfTriedToUseDisabledMove
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
ld a, [hl]
- and 1 << Confused ; if mon hurts itself, clear every other status from W_ENEMYBATTSTATUS1
+ and 1 << Confused ; if mon hurts itself, clear every other status from wEnemyBattleStatus1
ld [hl], a
ld hl, HurtItselfText
call PrintText
@@ -5995,7 +5995,7 @@
ld [hli], a
ld a, [wEnemyMonDefense + 1]
ld [hl], a
- ld hl, W_ENEMYMOVEEFFECT
+ ld hl, wEnemyMoveEffect
push hl
ld a, [hl]
push af
@@ -6046,12 +6046,12 @@
ld hl, FullyParalyzedText
call PrintText
.monHurtItselfOrFullyParalysed
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
ld a, [hl]
; clear bide, thrashing about, charging up, and multi-turn moves such as warp
and $ff ^ ((1 << StoringEnergy) | (1 << ThrashingAbout) | (1 << ChargingUp) | (1 << UsingTrappingMove))
ld [hl], a
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
cp FLY_EFFECT
jr z, .flyOrChargeEffect
cp CHARGE_EFFECT
@@ -6066,12 +6066,12 @@
ld hl, ExecuteEnemyMoveDone
jp .enemyReturnToHL ; if using a two-turn move, enemy needs to recharge the first turn
.checkIfUsingBide
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
bit StoringEnergy, [hl] ; is mon using bide?
jr z, .checkIfThrashingAbout
xor a
- ld [W_ENEMYMOVENUM], a
- ld hl, W_DAMAGE
+ ld [wEnemyMoveNum], a
+ ld hl, wDamage
ld a, [hli]
ld b, a
ld c, [hl]
@@ -6088,30 +6088,30 @@
ld hl, ExecuteEnemyMoveDone
jp .enemyReturnToHL ; unless mon unleashes energy, can't move this turn
.unleashEnergy
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
res StoringEnergy, [hl] ; not using bide any more
ld hl, UnleashedEnergyText
call PrintText
ld a, $1
- ld [W_ENEMYMOVEPOWER], a
+ ld [wEnemyMovePower], a
ld hl, wEnemyBideAccumulatedDamage + 1
ld a, [hld]
add a
ld b, a
- ld [W_DAMAGE + 1], a
+ ld [wDamage + 1], a
ld a, [hl]
rl a ; double the damage
- ld [W_DAMAGE], a
+ ld [wDamage], a
or b
jr nz, .next
ld a, $1
- ld [W_MOVEMISSED], a
+ ld [wMoveMissed], a
.next
xor a
ld [hli], a
ld [hl], a
ld a, BIDE
- ld [W_ENEMYMOVENUM], a
+ ld [wEnemyMoveNum], a
call SwapPlayerAndEnemyLevels
ld hl, handleIfEnemyMoveMissed ; skip damage calculation, DecrementPP and MoveHitTest
jp .enemyReturnToHL
@@ -6119,7 +6119,7 @@
bit ThrashingAbout, [hl] ; is mon using thrash or petal dance?
jr z, .checkIfUsingMultiturnMove
ld a, THRASH
- ld [W_ENEMYMOVENUM], a
+ ld [wEnemyMoveNum], a
ld hl, ThrashingAboutText
call PrintText
ld hl, wEnemyNumAttacksLeft
@@ -6127,7 +6127,7 @@
ld hl, EnemyCalcMoveDamage ; skip DecrementPP
jp nz, .enemyReturnToHL
push hl
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
res ThrashingAbout, [hl] ; mon is no longer using thrash or petal dance
set Confused, [hl] ; mon is now confused
call BattleRandom
@@ -6134,7 +6134,7 @@
and $3
inc a
inc a ; confused for 2-5 turns
- ld [W_ENEMYCONFUSEDCOUNTER], a
+ ld [wEnemyConfusedCounter], a
pop hl ; skip DecrementPP
jp .enemyReturnToHL
.checkIfUsingMultiturnMove
@@ -6149,7 +6149,7 @@
jp nz, .enemyReturnToHL
jp .enemyReturnToHL
.checkIfUsingRage
- ld a, [W_ENEMYBATTSTATUS2]
+ ld a, [wEnemyBattleStatus2]
bit UsingRage, a ; is mon using rage?
jp z, .checkEnemyStatusConditionsDone ; if we made it this far, mon can move normally this turn
ld a, RAGE
@@ -6157,7 +6157,7 @@
call GetMoveName
call CopyStringToCF4B
xor a
- ld [W_ENEMYMOVEEFFECT], a
+ ld [wEnemyMoveEffect], a
ld hl, EnemyCanExecuteMove
jp .enemyReturnToHL
.enemyReturnToHL
@@ -6172,12 +6172,12 @@
ld a, [H_WHOSETURN]
and a
jp z, .player
- ld de, W_ENEMYMOVENUM
+ ld de, wEnemyMoveNum
ld a, [wEnemySelectedMove]
jr .selected
.player
- ld de, W_PLAYERMOVENUM
- ld a, [W_FLAGS_D733]
+ ld de, wPlayerMoveNum
+ ld a, [wFlags_D733]
bit BIT_TEST_BATTLE, a
ld a, [wTestBattlePlayerSelectedMove]
jr nz, .selected
@@ -6207,13 +6207,13 @@
ld [wEnemyMonSpecies], a
ld [wd0b5], a
call GetMonHeader
- ld a, [W_ENEMYBATTSTATUS3]
+ ld a, [wEnemyBattleStatus3]
bit Transformed, a ; is enemy mon transformed?
ld hl, wTransformedEnemyMonOriginalDVs ; original DVs before transforming
ld a, [hli]
ld b, [hl]
jr nz, .storeDVs
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $2 ; is it a trainer battle?
; fixed DVs for trainer mon
ld a, $98
@@ -6228,7 +6228,7 @@
ld [hli], a
ld [hl], b
ld de, wEnemyMonLevel
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
ld [de], a
inc de
ld b, $0
@@ -6236,10 +6236,10 @@
push hl
call CalcStats
pop hl
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $2 ; is it a trainer battle?
jr z, .copyHPAndStatusFromPartyData
- ld a, [W_ENEMYBATTSTATUS3]
+ ld a, [wEnemyBattleStatus3]
bit Transformed, a ; is enemy mon transformed?
jr nz, .copyTypes ; if transformed, jump
; if it's a wild mon and not transformed, init the current HP to max HP and the status to 0
@@ -6268,7 +6268,7 @@
ld [wEnemyMonStatus], a
jr .copyTypes
.copyTypes
- ld hl, W_MONHTYPES
+ ld hl, wMonHTypes
ld de, wEnemyMonType
ld a, [hli] ; copy type 1
ld [de], a
@@ -6279,7 +6279,7 @@
ld a, [hli] ; copy catch rate
ld [de], a
inc de
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $2 ; is it a trainer battle?
jr nz, .copyStandardMoves
; if it's a trainer battle, copy moves from enemy party data
@@ -6292,7 +6292,7 @@
jr .loadMovePPs
.copyStandardMoves
; for a wild mon, first copy default moves from the mon header
- ld hl, W_MONHMOVES
+ ld hl, wMonHMoves
ld a, [hli]
ld [de], a
inc de
@@ -6314,7 +6314,7 @@
ld hl, wEnemyMonMoves
ld de, wEnemyMonPP - 1
predef LoadMovePPs
- ld hl, W_MONHBASESTATS
+ ld hl, wMonHBaseStats
ld de, wEnemyMonBaseStats
ld b, NUM_STATS
.copyBaseStatsLoop
@@ -6323,7 +6323,7 @@
inc de
dec b
jr nz, .copyBaseStatsLoop
- ld hl, W_MONHCATCHRATE
+ ld hl, wMonHCatchRate
ld a, [hli]
ld [de], a
inc de
@@ -6391,7 +6391,7 @@
ld [hli], a
ld [hli], a
ld [hl], a
- ld [W_PLAYERDISABLEDMOVE], a
+ ld [wPlayerDisabledMove], a
ret
; swaps the level values of the BattleMon and EnemyMon structs
@@ -6410,7 +6410,7 @@
; also writes OAM data and loads tile patterns for the Red or Old Man back sprite's head
; (for use when scrolling the player sprite and enemy's silhouettes on screen)
LoadPlayerBackPic: ; 3ec92 (f:6c92)
- ld a, [W_BATTLETYPE]
+ ld a, [wBattleType]
dec a ; is it the old man tutorial?
ld de, RedPicBack
jr nz, .next
@@ -6664,7 +6664,7 @@
ld a, [wLinkState]
cp LINK_STATE_BATTLING
ret z ; return if link battle
- ld a, [W_OBTAINEDBADGES]
+ ld a, [wObtainedBadges]
ld b, a
ld hl, wBattleMonAttack
ld c, $4
@@ -6804,12 +6804,12 @@
ld a, [H_WHOSETURN]
and a
ld hl, wEnemyMonType1
- ld de, W_ENEMYBATTSTATUS1
- ld a, [W_PLAYERMOVENUM]
+ ld de, wEnemyBattleStatus1
+ ld a, [wPlayerMoveNum]
jr z, .asm_3eeea
ld hl, wBattleMonType1
- ld de, W_ENEMYBATTSTATUS1
- ld a, [W_ENEMYMOVENUM]
+ ld de, wEnemyBattleStatus1
+ ld a, [wEnemyMoveNum]
.asm_3eeea
cp SELFDESTRUCT
jr z, .asm_3eef1
@@ -6825,7 +6825,7 @@
ld a, [hl]
cp GHOST
ret z
- ld a, [W_MOVEMISSED]
+ ld a, [wMoveMissed]
and a
ret nz
ld a, 5
@@ -6832,17 +6832,17 @@
ld [wAnimationType], a
PlayMoveAnimation: ; 3ef07 (f:6f07)
- ld [W_ANIMATIONID],a
+ ld [wAnimationID],a
call Delay3
predef_jump MoveAnimation
InitBattle: ; 3ef12 (f:6f12)
- ld a, [W_CUROPPONENT]
+ ld a, [wCurOpponent]
and a
jr z, DetermineWildOpponent
InitOpponent: ; 3ef18 (f:6f18)
- ld a, [W_CUROPPONENT]
+ ld a, [wCurOpponent]
ld [wcf91], a
ld [wEnemyMonSpecies2], a
jr InitBattleCommon
@@ -6871,7 +6871,7 @@
ld a, [wEnemyMonSpecies2]
sub 200
jp c, InitWildBattle
- ld [W_TRAINERCLASS], a
+ ld [wTrainerClass], a
call GetTrainerInformation
callab ReadTrainer
call DoBattleTransitionAndInitBattleVariables
@@ -6886,21 +6886,21 @@
ld a, $ff
ld [wEnemyMonPartyPos], a
ld a, $2
- ld [W_ISINBATTLE], a
+ ld [wIsInBattle], a
jp _InitBattleCommon
InitWildBattle: ; 3ef8b (f:6f8b)
ld a, $1
- ld [W_ISINBATTLE], a
+ ld [wIsInBattle], a
call LoadEnemyMonData
call DoBattleTransitionAndInitBattleVariables
- ld a, [W_CUROPPONENT]
+ ld a, [wCurOpponent]
cp MAROWAK
jr z, .isGhost
call IsGhostBattle
jr nz, .isNoGhost
.isGhost
- ld hl, W_MONHSPRITEDIM
+ ld hl, wMonHSpriteDim
ld a, $66
ld [hli], a ; write sprite dimensions
ld bc, GhostPic
@@ -6933,7 +6933,7 @@
call LoadMonFrontSprite ; load mon sprite
.spriteLoaded
xor a
- ld [W_TRAINERCLASS], a
+ ld [wTrainerClass], a
ld [hStartTileID], a
coord hl, 12, 0
predef CopyUncompressedPicToTilemap
@@ -6964,7 +6964,7 @@
lb bc, 4, 10
call ClearScreenArea
call ClearSprites
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a ; is it a wild battle?
call z, DrawEnemyHUDAndHPBar ; draw enemy HUD and HP bar if it's a wild battle
call StartBattle
@@ -7014,7 +7014,7 @@
ld a, [hStartTileID]
ld [hBaseTileID], a
ld b, $4c
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
and a
jr z, .notInBattle
add b
@@ -7056,7 +7056,7 @@
lb bc, 7, 7
ld de, SCREEN_WIDTH
push af
- ld a, [W_SPRITEFLIPPED]
+ ld a, [wSpriteFlipped]
and a
jr nz, .flipped
pop af
@@ -7108,7 +7108,7 @@
ld b, 7
ld c, 8
call ClearScreenArea
- ld hl, W_MONHBACKSPRITE - W_MONHEADER
+ ld hl, wMonHBackSprite - wMonHeader
call UncompressMonSprite
predef ScaleSpriteByTwo
ld de, vBackPic
@@ -7128,9 +7128,9 @@
_JumpMoveEffect: ; 3f138 (f:7138)
ld a, [H_WHOSETURN]
and a
- ld a, [W_PLAYERMOVEEFFECT]
+ ld a, [wPlayerMoveEffect]
jr z, .next1
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
.next1
dec a ; subtract 1, there is no special effect for 00
add a ; x2, 16bit pointers
@@ -7233,12 +7233,12 @@
SleepEffect: ; 3f1fc (f:71fc)
ld de, wEnemyMonStatus
- ld bc, W_ENEMYBATTSTATUS2
+ ld bc, wEnemyBattleStatus2
ld a, [H_WHOSETURN]
and a
jp z, .sleepEffect
ld de, wBattleMonStatus
- ld bc, W_PLAYERBATTSTATUS2
+ ld bc, wPlayerBattleStatus2
.sleepEffect
ld a, [bc]
@@ -7260,7 +7260,7 @@
push de
call MoveHitTest ; apply accuracy tests
pop de
- ld a, [W_MOVEMISSED]
+ ld a, [wMoveMissed]
and a
jr nz, .didntAffect
.setSleepCounter
@@ -7285,12 +7285,12 @@
PoisonEffect: ; 3f24f (f:724f)
ld hl, wEnemyMonStatus
- ld de, W_PLAYERMOVEEFFECT
+ ld de, wPlayerMoveEffect
ld a, [H_WHOSETURN]
and a
jr z, .poisonEffect
ld hl, wBattleMonStatus
- ld de, W_ENEMYMOVEEFFECT
+ ld de, wEnemyMoveEffect
.poisonEffect
call CheckTargetSubstitute
jr nz, .noEffect ; can't posion a substitute target
@@ -7316,7 +7316,7 @@
call MoveHitTest ; apply accuracy tests
pop de
pop hl
- ld a, [W_MOVEMISSED]
+ ld a, [wMoveMissed]
and a
jr nz, .didntAffect
jr .inflictPoison
@@ -7332,13 +7332,13 @@
ld a, [H_WHOSETURN]
and a
ld b, ANIM_C7
- ld hl, W_PLAYERBATTSTATUS3
+ ld hl, wPlayerBattleStatus3
ld a, [de]
- ld de, W_PLAYERTOXICCOUNTER
+ ld de, wPlayerToxicCounter
jr nz, .ok
ld b, ANIM_A9
- ld hl, W_ENEMYBATTSTATUS3
- ld de, W_ENEMYTOXICCOUNTER
+ ld hl, wEnemyBattleStatus3
+ ld de, wEnemyToxcCounter
.ok
cp TOXIC
jr nz, .normalPoison ; done if move is not Toxic
@@ -7382,12 +7382,12 @@
ExplodeEffect: ; 3f2f1 (f:72f1)
ld hl, wBattleMonHP
- ld de, W_PLAYERBATTSTATUS2
+ ld de, wPlayerBattleStatus2
ld a, [H_WHOSETURN]
and a
jr z, .faintUser
ld hl, wEnemyMonHP
- ld de, W_ENEMYBATTSTATUS2
+ ld de, wEnemyBattleStatus2
.faintUser
xor a
ld [hli], a ; set the mon's HP to 0
@@ -7410,7 +7410,7 @@
ld a, [wEnemyMonStatus]
and a
jp nz, CheckDefrost ; can't inflict status if opponent is already statused
- ld a, [W_PLAYERMOVETYPE]
+ ld a, [wPlayerMoveType]
ld b, a
ld a, [wEnemyMonType1]
cp b ; do target type 1 and move type match?
@@ -7418,7 +7418,7 @@
ld a, [wEnemyMonType2]
cp b ; do target type 2 and move type match?
ret z ; return if they match
- ld a, [W_PLAYERMOVEEFFECT]
+ ld a, [wPlayerMoveEffect]
cp a, PARALYZE_SIDE_EFFECT1 + 1 ; 10% status effects are 04, 05, 06 so 07 will set carry for those
ld b, $1a ; 0x1A/0x100 or 26/256 = 10.2%~ chance
jr c, .next1 ; branch ahead if this is a 10% chance effect..
@@ -7462,7 +7462,7 @@
ld a, [wBattleMonStatus] ; mostly same as above with addresses swapped for opponent
and a
jp nz, CheckDefrost
- ld a, [W_ENEMYMOVETYPE]
+ ld a, [wEnemyMoveType]
ld b, a
ld a, [wBattleMonType1]
cp b
@@ -7470,7 +7470,7 @@
ld a, [wBattleMonType2]
cp b
ret z
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
cp a, PARALYZE_SIDE_EFFECT1 + 1
ld b, $1a
jr c, .next1
@@ -7520,7 +7520,7 @@
and a
jr nz, .opponent
;player [attacker]
- ld a, [W_PLAYERMOVETYPE]
+ ld a, [wPlayerMoveType]
sub a, FIRE
ret nz ; return if type of move used isn't fire
ld [wEnemyMonStatus], a ; set opponent status to 00 ["defrost" a frozen monster]
@@ -7533,7 +7533,7 @@
ld hl, FireDefrostedText
jr .common
.opponent
- ld a, [W_ENEMYMOVETYPE] ; same as above with addresses swapped
+ ld a, [wEnemyMoveType] ; same as above with addresses swapped
sub a, FIRE
ret nz
ld [wBattleMonStatus], a
@@ -7553,12 +7553,12 @@
StatModifierUpEffect: ; 3f428 (f:7428)
ld hl, wPlayerMonStatMods
- ld de, W_PLAYERMOVEEFFECT
+ ld de, wPlayerMoveEffect
ld a, [H_WHOSETURN]
and a
jr z, .statModifierUpEffect
ld hl, wEnemyMonStatMods
- ld de, W_ENEMYMOVEEFFECT
+ ld de, wEnemyMoveEffect
.statModifierUpEffect
ld a, [de]
sub ATTACK_UP1_EFFECT
@@ -7660,14 +7660,14 @@
ld b, c
inc b
call PrintStatText
- ld hl, W_PLAYERBATTSTATUS2
- ld de, W_PLAYERMOVENUM
+ ld hl, wPlayerBattleStatus2
+ ld de, wPlayerMoveNum
ld bc, wPlayerMonMinimized
ld a, [H_WHOSETURN]
and a
jr z, .asm_3f4e6
- ld hl, W_ENEMYBATTSTATUS2
- ld de, W_ENEMYMOVENUM
+ ld hl, wEnemyBattleStatus2
+ ld de, wEnemyMoveNum
ld bc, wEnemyMonMinimized
.asm_3f4e6
ld a, [de]
@@ -7721,9 +7721,9 @@
ld hl, GreatlyRoseText
ld a, [H_WHOSETURN]
and a
- ld a, [W_PLAYERMOVEEFFECT]
+ ld a, [wPlayerMoveEffect]
jr z, .asm_3f53b
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
.asm_3f53b
cp ATTACK_DOWN1_EFFECT
ret nc
@@ -7740,14 +7740,14 @@
StatModifierDownEffect: ; 3f54c (f:754c)
ld hl, wEnemyMonStatMods
- ld de, W_PLAYERMOVEEFFECT
- ld bc, W_ENEMYBATTSTATUS1
+ ld de, wPlayerMoveEffect
+ ld bc, wEnemyBattleStatus1
ld a, [H_WHOSETURN]
and a
jr z, .statModifierDownEffect
ld hl, wPlayerMonStatMods
- ld de, W_ENEMYMOVEEFFECT
- ld bc, W_PLAYERBATTSTATUS1
+ ld de, wEnemyMoveEffect
+ ld bc, wPlayerBattleStatus1
ld a, [wLinkState]
cp LINK_STATE_BATTLING
jr z, .statModifierDownEffect
@@ -7774,7 +7774,7 @@
pop bc
pop de
pop hl
- ld a, [W_MOVEMISSED]
+ ld a, [wMoveMissed]
and a
jp nz, MoveMissed
ld a, [bc]
@@ -7923,9 +7923,9 @@
ld hl, FellText
ld a, [H_WHOSETURN]
and a
- ld a, [W_PLAYERMOVEEFFECT]
+ ld a, [wPlayerMoveEffect]
jr z, .asm_3f674
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
.asm_3f674
cp $1a
ret c
@@ -7983,13 +7983,13 @@
db 4, 1 ; 4.00
BideEffect: ; 3f6e5 (f:76e5)
- ld hl, W_PLAYERBATTSTATUS1
+ ld hl, wPlayerBattleStatus1
ld de, wPlayerBideAccumulatedDamage
ld bc, wPlayerNumAttacksLeft
ld a, [H_WHOSETURN]
and a
jr z, .bideEffect
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
ld de, wEnemyBideAccumulatedDamage
ld bc, wEnemyNumAttacksLeft
.bideEffect
@@ -7998,8 +7998,8 @@
ld [de], a
inc de
ld [de], a
- ld [W_PLAYERMOVEEFFECT], a
- ld [W_ENEMYMOVEEFFECT], a
+ ld [wPlayerMoveEffect], a
+ ld [wEnemyMoveEffect], a
call BattleRandom
and $1
inc a
@@ -8010,12 +8010,12 @@
jp PlayBattleAnimation2
ThrashPetalDanceEffect: ; 3f717 (f:7717)
- ld hl, W_PLAYERBATTSTATUS1
+ ld hl, wPlayerBattleStatus1
ld de, wPlayerNumAttacksLeft
ld a, [H_WHOSETURN]
and a
jr z, .thrashPetalDanceEffect
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
ld de, wEnemyNumAttacksLeft
.thrashPetalDanceEffect
set ThrashingAbout, [hl] ; mon is now using thrash/petal dance
@@ -8032,10 +8032,10 @@
ld a, [H_WHOSETURN]
and a
jr nz, .asm_3f791
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a
jr nz, .asm_3f77e
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
ld b, a
ld a, [wBattleMonLevel]
cp b
@@ -8053,7 +8053,7 @@
jr nc, .asm_3f76e
ld c, 50
call DelayFrames
- ld a, [W_PLAYERMOVENUM]
+ ld a, [wPlayerMoveNum]
cp TELEPORT
jp nz, PrintDidntAffectText
jp PrintButItFailedText_
@@ -8063,23 +8063,23 @@
ld [wAnimationType], a
inc a
ld [wEscapedFromBattle], a
- ld a, [W_PLAYERMOVENUM]
+ ld a, [wPlayerMoveNum]
jr .asm_3f7e4
.asm_3f77e
ld c, 50
call DelayFrames
ld hl, IsUnaffectedText
- ld a, [W_PLAYERMOVENUM]
+ ld a, [wPlayerMoveNum]
cp TELEPORT
jp nz, PrintText
jp PrintButItFailedText_
.asm_3f791
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a
jr nz, .asm_3f7d1
ld a, [wBattleMonLevel]
ld b, a
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
cp b
jr nc, .asm_3f7c1
add b
@@ -8095,7 +8095,7 @@
jr nc, .asm_3f7c1
ld c, 50
call DelayFrames
- ld a, [W_ENEMYMOVENUM]
+ ld a, [wEnemyMoveNum]
cp TELEPORT
jp nz, PrintDidntAffectText
jp PrintButItFailedText_
@@ -8105,13 +8105,13 @@
ld [wAnimationType], a
inc a
ld [wEscapedFromBattle], a
- ld a, [W_ENEMYMOVENUM]
+ ld a, [wEnemyMoveNum]
jr .asm_3f7e4
.asm_3f7d1
ld c, 50
call DelayFrames
ld hl, IsUnaffectedText
- ld a, [W_ENEMYMOVENUM]
+ ld a, [wEnemyMoveNum]
cp TELEPORT
jp nz, PrintText
jp ConditionalPrintButItFailed
@@ -8144,13 +8144,13 @@
db "@"
TwoToFiveAttacksEffect: ; 3f811 (f:7811)
- ld hl, W_PLAYERBATTSTATUS1
+ ld hl, wPlayerBattleStatus1
ld de, wPlayerNumAttacksLeft
ld bc, wPlayerNumHits
ld a, [H_WHOSETURN]
and a
jr z, .twoToFiveAttacksEffect
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
ld de, wEnemyNumAttacksLeft
ld bc, wEnemyNumHits
.twoToFiveAttacksEffect
@@ -8157,11 +8157,11 @@
bit AttackingMultipleTimes, [hl] ; is mon attacking multiple times?
ret nz
set AttackingMultipleTimes, [hl] ; mon is now attacking multiple times
- ld hl, W_PLAYERMOVEEFFECT
+ ld hl, wPlayerMoveEffect
ld a, [H_WHOSETURN]
and a
jr z, .setNumberOfHits
- ld hl, W_ENEMYMOVEEFFECT
+ ld hl, wEnemyMoveEffect
.setNumberOfHits
ld a, [hl]
cp TWINEEDLE_EFFECT
@@ -8191,13 +8191,13 @@
FlinchSideEffect: ; 3f85b (f:785b)
call CheckTargetSubstitute
ret nz
- ld hl, W_ENEMYBATTSTATUS1
- ld de, W_PLAYERMOVEEFFECT
+ ld hl, wEnemyBattleStatus1
+ ld de, wPlayerMoveEffect
ld a, [H_WHOSETURN]
and a
jr z, .flinchSideEffect
- ld hl, W_PLAYERBATTSTATUS1
- ld de, W_ENEMYMOVEEFFECT
+ ld hl, wPlayerBattleStatus1
+ ld de, wEnemyMoveEffect
.flinchSideEffect
ld a, [de]
cp FLINCH_SIDE_EFFECT1
@@ -8216,14 +8216,14 @@
jpab OneHitKOEffect_
ChargeEffect: ; 3f88c (f:788c)
- ld hl, W_PLAYERBATTSTATUS1
- ld de, W_PLAYERMOVEEFFECT
+ ld hl, wPlayerBattleStatus1
+ ld de, wPlayerMoveEffect
ld a, [H_WHOSETURN]
and a
ld b, XSTATITEM_ANIM
jr z, .chargeEffect
- ld hl, W_ENEMYBATTSTATUS1
- ld de, W_ENEMYMOVEEFFECT
+ ld hl, wEnemyBattleStatus1
+ ld de, wEnemyMoveEffect
ld b, ANIM_AF
.chargeEffect
set ChargingUp, [hl]
@@ -8298,12 +8298,12 @@
db "@"
TrappingEffect: ; 3f917 (f:7917)
- ld hl, W_PLAYERBATTSTATUS1
+ ld hl, wPlayerBattleStatus1
ld de, wPlayerNumAttacksLeft
ld a, [H_WHOSETURN]
and a
jr z, .trappingEffect
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
ld de, wEnemyNumAttacksLeft
.trappingEffect
bit UsingTrappingMove, [hl]
@@ -8341,7 +8341,7 @@
call CheckTargetSubstitute
jr nz, ConfusionEffectFailed
call MoveHitTest
- ld a, [W_MOVEMISSED]
+ ld a, [wMoveMissed]
and a
jr nz, ConfusionEffectFailed
@@ -8348,13 +8348,13 @@
ConfusionSideEffectSuccess: ; 3f96f (f:796f)
ld a, [H_WHOSETURN]
and a
- ld hl, W_ENEMYBATTSTATUS1
- ld bc, W_ENEMYCONFUSEDCOUNTER
- ld a, [W_PLAYERMOVEEFFECT]
+ ld hl, wEnemyBattleStatus1
+ ld bc, wEnemyConfusedCounter
+ ld a, [wPlayerMoveEffect]
jr z, .confuseTarget
- ld hl, W_PLAYERBATTSTATUS1
- ld bc, W_PLAYERCONFUSEDCOUNTER
- ld a, [W_ENEMYMOVEEFFECT]
+ ld hl, wPlayerBattleStatus1
+ ld bc, wPlayerConfusedCounter
+ ld a, [wEnemyMoveEffect]
.confuseTarget
bit Confused, [hl] ; is mon confused?
jr nz, ConfusionEffectFailed
@@ -8389,11 +8389,11 @@
jpab SubstituteEffect_
HyperBeamEffect: ; 3f9c1 (f:79c1)
- ld hl, W_PLAYERBATTSTATUS2
+ ld hl, wPlayerBattleStatus2
ld a, [H_WHOSETURN]
and a
jr z, .hyperBeamEffect
- ld hl, W_ENEMYBATTSTATUS2
+ ld hl, wEnemyBattleStatus2
.hyperBeamEffect
set NeedsToRecharge, [hl] ; mon now needs to recharge
ret
@@ -8400,11 +8400,11 @@
ClearHyperBeam: ; 3f9cf (f:79cf)
push hl
- ld hl, W_ENEMYBATTSTATUS2
+ ld hl, wEnemyBattleStatus2
ld a, [H_WHOSETURN]
and a
jr z, .asm_3f9db
- ld hl, W_PLAYERBATTSTATUS2
+ ld hl, wPlayerBattleStatus2
.asm_3f9db
res NeedsToRecharge, [hl] ; mon no longer needs to recharge
pop hl
@@ -8411,11 +8411,11 @@
ret
RageEffect: ; 3f9df (f:79df)
- ld hl, W_PLAYERBATTSTATUS2
+ ld hl, wPlayerBattleStatus2
ld a, [H_WHOSETURN]
and a
jr z, .player
- ld hl, W_ENEMYBATTSTATUS2
+ ld hl, wEnemyBattleStatus2
.player
set UsingRage, [hl] ; mon is now in "rage" mode
ret
@@ -8424,19 +8424,19 @@
ld c, 50
call DelayFrames
call MoveHitTest
- ld a, [W_MOVEMISSED]
+ ld a, [wMoveMissed]
and a
jr nz, .asm_3fa74
ld a, [H_WHOSETURN]
and a
ld hl, wBattleMonMoves
- ld a, [W_PLAYERBATTSTATUS1]
+ ld a, [wPlayerBattleStatus1]
jr nz, .asm_3fa13
ld a, [wLinkState]
cp LINK_STATE_BATTLING
jr nz, .asm_3fa3a
ld hl, wEnemyMonMoves
- ld a, [W_ENEMYBATTSTATUS1]
+ ld a, [wEnemyBattleStatus1]
.asm_3fa13
bit Invulnerable, a
jr nz, .asm_3fa74
@@ -8461,7 +8461,7 @@
ld a, [wEnemyMoveListIndex]
jr .asm_3fa5f
.asm_3fa3a
- ld a, [W_ENEMYBATTSTATUS1]
+ ld a, [wEnemyBattleStatus1]
bit Invulnerable, a
jr nz, .asm_3fa74
ld a, [wCurrentMenuItem]
@@ -8505,15 +8505,15 @@
DisableEffect: ; 3fa8a (f:7a8a)
call MoveHitTest
- ld a, [W_MOVEMISSED]
+ ld a, [wMoveMissed]
and a
jr nz, .moveMissed
- ld de, W_ENEMYDISABLEDMOVE
+ ld de, wEnemyDisabledMove
ld hl, wEnemyMonMoves
ld a, [H_WHOSETURN]
and a
jr z, .disableEffect
- ld de, W_PLAYERDISABLEDMOVE
+ ld de, wPlayerDisabledMove
ld hl, wBattleMonMoves
.disableEffect
; no effect if target already has a move disabled
@@ -8567,7 +8567,7 @@
inc a ; 1-8 turns disabled
inc c ; move 1-4 will be disabled
swap c
- add c ; map disabled move to high nibble of W_ENEMYDISABLEDMOVE / W_PLAYERDISABLEDMOVE
+ add c ; map disabled move to high nibble of wEnemyDisabledMove / wPlayerDisabledMove
ld [de], a
call PlayCurrentMoveAnimation2
ld hl, wPlayerDisabledMoveNumber
@@ -8655,11 +8655,11 @@
CheckTargetSubstitute: ; 3fb79 (f:7b79)
push hl
- ld hl, W_ENEMYBATTSTATUS2
+ ld hl, wEnemyBattleStatus2
ld a, [H_WHOSETURN]
and a
jr z, .next1
- ld hl, W_PLAYERBATTSTATUS2
+ ld hl, wPlayerBattleStatus2
.next1
bit HasSubstituteUp, [hl]
pop hl
@@ -8670,9 +8670,9 @@
; plays wAnimationType 3 or 6
ld a, [H_WHOSETURN]
and a
- ld a, [W_PLAYERMOVENUM]
+ ld a, [wPlayerMoveNum]
jr z, .notEnemyTurn
- ld a, [W_ENEMYMOVENUM]
+ ld a, [wEnemyMoveNum]
.notEnemyTurn
and a
ret z
@@ -8679,7 +8679,7 @@
PlayBattleAnimation2: ; 3fb96 (f:7b96)
; play animation ID at a and animation type 6 or 3
- ld [W_ANIMATIONID], a
+ ld [wAnimationID], a
ld a, [H_WHOSETURN]
and a
ld a, $6
@@ -8696,9 +8696,9 @@
ld [wAnimationType], a
ld a, [H_WHOSETURN]
and a
- ld a, [W_PLAYERMOVENUM]
+ ld a, [wPlayerMoveNum]
jr z, .notEnemyTurn
- ld a, [W_ENEMYMOVENUM]
+ ld a, [wEnemyMoveNum]
.notEnemyTurn
and a
ret z
@@ -8705,10 +8705,10 @@
PlayBattleAnimation: ; 3fbb9 (f:7bb9)
; play animation ID at a and predefined animation type
- ld [W_ANIMATIONID], a
+ ld [wAnimationID], a
PlayBattleAnimationGotID: ; 3fbbc (f:7bbc)
-; play animation at W_ANIMATIONID
+; play animation at wAnimationID
push hl
push de
push bc
--- a/engine/battle/decrement_pp.asm
+++ b/engine/battle/decrement_pp.asm
@@ -4,9 +4,9 @@
cp a, STRUGGLE
ret z ; if the pokemon is using "struggle", there's nothing to do
; we don't decrement PP for "struggle"
- ld hl, W_PLAYERBATTSTATUS1
- ld a, [hli] ; load the W_PLAYERBATTSTATUS1 pokemon status flags and increment hl to load the
- ; W_PLAYERBATTSTATUS2 status flags later
+ ld hl, wPlayerBattleStatus1
+ ld a, [hli] ; load the wPlayerBattleStatus1 pokemon status flags and increment hl to load the
+ ; wPlayerBattleStatus2 status flags later
and a, (1 << StoringEnergy) | (1 << ThrashingAbout) | (1 << AttackingMultipleTimes)
ret nz ; if any of these statuses are true, don't decrement PP
bit UsingRage, [hl]
@@ -17,7 +17,7 @@
call .DecrementPP
; decrement PP in the party struct
- ld a, [W_PLAYERBATTSTATUS3]
+ ld a, [wPlayerBattleStatus3]
bit Transformed, a
ret nz ; Return if transformed. Pokemon Red stores the "current pokemon's" PP
; separately from the "Pokemon in your party's" PP. This is
--- a/engine/battle/draw_hud_pokeball_gfx.asm
+++ b/engine/battle/draw_hud_pokeball_gfx.asm
@@ -1,7 +1,7 @@
DrawAllPokeballs: ; 3a849 (e:6849)
call LoadPartyPokeballGfx
call SetupOwnPartyPokeballs
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a
ret z ; return if wild pokémon
jp SetupEnemyPartyPokeballs
@@ -22,7 +22,7 @@
ld de, wPartyCount
call SetupPokeballs
ld a, $60
- ld hl, W_BASECOORDX
+ ld hl, wBaseCoordX
ld [hli], a
ld [hl], a
ld a, 8
@@ -35,7 +35,7 @@
ld hl, wEnemyMons
ld de, wEnemyPartyCount
call SetupPokeballs
- ld hl, W_BASECOORDX
+ ld hl, wBaseCoordX
ld a, $48
ld [hli], a
ld [hl], $20
@@ -98,19 +98,19 @@
ld de, wBuffer
ld c, PARTY_LENGTH
.loop
- ld a, [W_BASECOORDY]
+ ld a, [wBaseCoordY]
ld [hli], a
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
ld [hli], a
ld a, [de]
ld [hli], a
xor a
ld [hli], a
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
ld b, a
ld a, [wHUDPokeballGfxOffsetX]
add b
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
inc de
dec c
jr nz, .loop
@@ -168,7 +168,7 @@
ld hl, wPartyMons
ld de, wPartyCount
call SetupPokeballs
- ld hl, W_BASECOORDX
+ ld hl, wBaseCoordX
ld a, $50
ld [hli], a
ld [hl], $40
@@ -179,7 +179,7 @@
ld hl, wEnemyMons
ld de, wEnemyPartyCount
call SetupPokeballs
- ld hl, W_BASECOORDX
+ ld hl, wBaseCoordX
ld a, $50
ld [hli], a
ld [hl], $68
--- a/engine/battle/end_of_battle.asm
+++ b/engine/battle/end_of_battle.asm
@@ -47,10 +47,10 @@
xor a
ld [wLowHealthAlarm], a ;disable low health alarm
ld [wChannelSoundIDs + CH4], a
- ld [W_ISINBATTLE], a
- ld [W_BATTLETYPE], a
- ld [W_MOVEMISSED], a
- ld [W_CUROPPONENT], a
+ ld [wIsInBattle], a
+ ld [wBattleType], a
+ ld [wMoveMissed], a
+ ld [wCurOpponent], a
ld [wForcePlayerToChooseMon], a
ld [wNumRunAttempts], a
ld [wEscapedFromBattle], a
--- a/engine/battle/experience.asm
+++ b/engine/battle/experience.asm
@@ -83,7 +83,7 @@
ld a, 1
.next
ld [wGainBoostedExp], a
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a ; is it a trainer battle?
call nz, BoostExp ; if so, boost exp
inc hl
@@ -160,11 +160,11 @@
ld a, [hl] ; current level
cp d
jp z, .nextMon ; if level didn't change, go to next mon
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
push af
push hl
ld a, d
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
ld [hl], a
ld bc, wPartyMon1Species - wPartyMon1Level
add hl, bc
@@ -223,7 +223,7 @@
ld bc, 1 + NUM_STATS * 2 ; size of stats
call CopyData
pop hl
- ld a, [W_PLAYERBATTSTATUS3]
+ ld a, [wPlayerBattleStatus3]
bit 3, a ; is the mon transformed?
jr nz, .recalcStatChanges
; the mon is not transformed, so update the unmodified stats
@@ -261,7 +261,7 @@
predef FlagActionPredef
pop hl
pop af
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
.nextMon
ld a, [wPartyCount]
--- a/engine/battle/get_trainer_name.asm
+++ b/engine/battle/get_trainer_name.asm
@@ -1,10 +1,10 @@
GetTrainerName_: ; 13a58 (4:7a58)
- ld hl, W_GRASSRATE
+ ld hl, wGrassRate
ld a, [wLinkState]
and a
jr nz, .rival
- ld hl, W_RIVALNAME
- ld a, [W_TRAINERCLASS]
+ ld hl, wRivalName
+ ld a, [wTrainerClass]
cp SONY1
jr z, .rival
cp SONY2
@@ -19,6 +19,6 @@
call GetName
ld hl, wcd6d
.rival
- ld de, W_TRAINERNAME
+ ld de, wTrainerName
ld bc, $d
jp CopyData
--- a/engine/battle/ghost_marowak_anim.asm
+++ b/engine/battle/ghost_marowak_anim.asm
@@ -55,15 +55,15 @@
ld bc, 7 * 7
call CopyVideoData
ld a, $10
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
ld a, $70
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
ld hl, wOAMBuffer
lb bc, 6, 6
ld d, $8
.oamLoop
push bc
- ld a, [W_BASECOORDY]
+ ld a, [wBaseCoordY]
ld e, a
.oamInnerLoop
ld a, e
@@ -70,7 +70,7 @@
add $8
ld e, a
ld [hli], a
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
ld [hli], a
ld a, d
ld [hli], a
@@ -80,9 +80,9 @@
dec c
jr nz, .oamInnerLoop
inc d
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
add $8
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
pop bc
dec b
jr nz, .oamLoop
--- a/engine/battle/init_battle_variables.asm
+++ b/engine/battle/init_battle_variables.asm
@@ -27,12 +27,12 @@
jr nz, .loop
inc a ; POUND
ld [wTestBattlePlayerSelectedMove], a
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp SAFARI_ZONE_EAST
jr c, .notSafariBattle
cp SAFARI_ZONE_REST_HOUSE_1
jr nc, .notSafariBattle
ld a, BATTLE_TYPE_SAFARI
- ld [W_BATTLETYPE], a
+ ld [wBattleType], a
.notSafariBattle
jpab PlayBattleMusic
--- a/engine/battle/moveEffects/conversion_effect.asm
+++ b/engine/battle/moveEffects/conversion_effect.asm
@@ -3,13 +3,13 @@
ld de, wBattleMonType1
ld a, [H_WHOSETURN]
and a
- ld a, [W_ENEMYBATTSTATUS1]
+ ld a, [wEnemyBattleStatus1]
jr z, .conversionEffect
push hl
ld h, d
ld l, e
pop de
- ld a, [W_PLAYERBATTSTATUS1]
+ ld a, [wPlayerBattleStatus1]
.conversionEffect
bit Invulnerable, a ; is mon immune to typical attacks (dig/fly)
jr nz, PrintButItFailedText
--- a/engine/battle/moveEffects/drain_hp_effect.asm
+++ b/engine/battle/moveEffects/drain_hp_effect.asm
@@ -1,5 +1,5 @@
DrainHPEffect_: ; 783f (1:783f)
- ld hl, W_DAMAGE
+ ld hl, wDamage
ld a, [hl]
srl a ; divide damage by 2
ld [hli], a
@@ -36,12 +36,12 @@
dec bc
ld [bc], a
; add damage to attacker's HP and copy new HP to wHPBarNewHP
- ld a, [W_DAMAGE + 1]
+ ld a, [wDamage + 1]
ld b, [hl]
add b
ld [hld], a
ld [wHPBarNewHP], a
- ld a, [W_DAMAGE]
+ ld a, [wDamage]
ld b, [hl]
adc b
ld [hli], a
@@ -85,9 +85,9 @@
ld hl, SuckedHealthText
ld a, [H_WHOSETURN]
and a
- ld a, [W_PLAYERMOVEEFFECT]
+ ld a, [wPlayerMoveEffect]
jr z, .next3
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
.next3
cp DREAM_EATER_EFFECT
jr nz, .printText
--- a/engine/battle/moveEffects/focus_energy_effect.asm
+++ b/engine/battle/moveEffects/focus_energy_effect.asm
@@ -1,9 +1,9 @@
FocusEnergyEffect_: ; 27f86 (9:7f86)
- ld hl, W_PLAYERBATTSTATUS2
+ ld hl, wPlayerBattleStatus2
ld a, [H_WHOSETURN]
and a
jr z, .notEnemy
- ld hl, W_ENEMYBATTSTATUS2
+ ld hl, wEnemyBattleStatus2
.notEnemy
bit GettingPumped, [hl] ; is mon already using focus energy?
jr nz, .alreadyUsing
--- a/engine/battle/moveEffects/haze_effect.asm
+++ b/engine/battle/moveEffects/haze_effect.asm
@@ -31,14 +31,14 @@
.cureVolatileStatuses
xor a
- ld [W_PLAYERDISABLEDMOVE], a
- ld [W_ENEMYDISABLEDMOVE], a
+ ld [wPlayerDisabledMove], a
+ ld [wEnemyDisabledMove], a
ld hl, wPlayerDisabledMoveNumber
ld [hli], a
ld [hl], a
- ld hl, W_PLAYERBATTSTATUS1
+ ld hl, wPlayerBattleStatus1
call CureVolatileStatuses
- ld hl, W_ENEMYBATTSTATUS1
+ ld hl, wEnemyBattleStatus1
call CureVolatileStatuses
ld hl, PlayCurrentMoveAnimation
call CallBankF
--- a/engine/battle/moveEffects/heal_effect.asm
+++ b/engine/battle/moveEffects/heal_effect.asm
@@ -3,11 +3,11 @@
and a
ld de, wBattleMonHP
ld hl, wBattleMonMaxHP
- ld a, [W_PLAYERMOVENUM]
+ ld a, [wPlayerMoveNum]
jr z, .healEffect
ld de, wEnemyMonHP
ld hl, wEnemyMonMaxHP
- ld a, [W_ENEMYMOVENUM]
+ ld a, [wEnemyMoveNum]
.healEffect
ld b, a
ld a, [de]
--- a/engine/battle/moveEffects/leech_seed_effect.asm
+++ b/engine/battle/moveEffects/leech_seed_effect.asm
@@ -1,14 +1,14 @@
LeechSeedEffect_: ; 2bea9 (a:7ea9)
callab MoveHitTest
- ld a, [W_MOVEMISSED]
+ ld a, [wMoveMissed]
and a
jr nz, .moveMissed
- ld hl, W_ENEMYBATTSTATUS2
+ ld hl, wEnemyBattleStatus2
ld de, wEnemyMonType1
ld a, [H_WHOSETURN]
and a
jr z, .leechSeedEffect
- ld hl, W_PLAYERBATTSTATUS2
+ ld hl, wPlayerBattleStatus2
ld de, wBattleMonType1
.leechSeedEffect
; miss if the target is grass-type or already seeded
--- a/engine/battle/moveEffects/mist_effect.asm
+++ b/engine/battle/moveEffects/mist_effect.asm
@@ -1,9 +1,9 @@
MistEffect_: ; 33f2b (c:7f2b)
- ld hl, W_PLAYERBATTSTATUS2
+ ld hl, wPlayerBattleStatus2
ld a, [H_WHOSETURN]
and a
jr z, .mistEffect
- ld hl, W_ENEMYBATTSTATUS2
+ ld hl, wEnemyBattleStatus2
.mistEffect
bit ProtectedByMist, [hl] ; is mon protected by mist?
jr nz, .mistAlreadyInUse
--- a/engine/battle/moveEffects/one_hit_ko_effect.asm
+++ b/engine/battle/moveEffects/one_hit_ko_effect.asm
@@ -1,5 +1,5 @@
OneHitKOEffect_: ; 33f57 (c:7f57)
- ld hl, W_DAMAGE
+ ld hl, wDamage
xor a
ld [hli], a
ld [hl], a ; set the damage output to zero
@@ -24,7 +24,7 @@
ld a, [hl]
sbc b
jr c, .userIsSlower
- ld hl, W_DAMAGE
+ ld hl, wDamage
ld a, $ff
ld [hli], a
ld [hl], a
@@ -34,5 +34,5 @@
.userIsSlower
; keep damage at 0 and set move missed flag if target's current speed is higher instead
ld a, $1
- ld [W_MOVEMISSED], a
+ ld [wMoveMissed], a
ret
--- a/engine/battle/moveEffects/paralyze_effect.asm
+++ b/engine/battle/moveEffects/paralyze_effect.asm
@@ -1,11 +1,11 @@
ParalyzeEffect_: ; 52601 (14:6601)
ld hl, wEnemyMonStatus
- ld de, W_PLAYERMOVETYPE
+ ld de, wPlayerMoveType
ld a, [H_WHOSETURN]
and a
jp z, .next
ld hl, wBattleMonStatus
- ld de, W_ENEMYMOVETYPE
+ ld de, wEnemyMoveType
.next
ld a, [hl]
and a ; does the target already have a status ailment?
@@ -28,7 +28,7 @@
push hl
callab MoveHitTest
pop hl
- ld a, [W_MOVEMISSED]
+ ld a, [wMoveMissed]
and a
jr nz, .didntAffect
set PAR, [hl]
--- a/engine/battle/moveEffects/recoil_effect.asm
+++ b/engine/battle/moveEffects/recoil_effect.asm
@@ -1,16 +1,16 @@
RecoilEffect_: ; 1392c (4:792c)
ld a, [H_WHOSETURN]
and a
- ld a, [W_PLAYERMOVENUM]
+ ld a, [wPlayerMoveNum]
ld hl, wBattleMonMaxHP
jr z, .recoilEffect
- ld a, [W_ENEMYMOVENUM]
+ ld a, [wEnemyMoveNum]
ld hl, wEnemyMonMaxHP
.recoilEffect
ld d, a
- ld a, [W_DAMAGE]
+ ld a, [wDamage]
ld b, a
- ld a, [W_DAMAGE + 1]
+ ld a, [wDamage + 1]
ld c, a
srl b
rr c
--- a/engine/battle/moveEffects/reflect_light_screen_effect.asm
+++ b/engine/battle/moveEffects/reflect_light_screen_effect.asm
@@ -1,11 +1,11 @@
ReflectLightScreenEffect_: ; 3bb97 (e:7b97)
- ld hl, W_PLAYERBATTSTATUS3
- ld de, W_PLAYERMOVEEFFECT
+ ld hl, wPlayerBattleStatus3
+ ld de, wPlayerMoveEffect
ld a, [H_WHOSETURN]
and a
jr z, .reflectLightScreenEffect
- ld hl, W_ENEMYBATTSTATUS3
- ld de, W_ENEMYMOVEEFFECT
+ ld hl, wEnemyBattleStatus3
+ ld de, wEnemyMoveEffect
.reflectLightScreenEffect
ld a, [de]
cp LIGHT_SCREEN_EFFECT
--- a/engine/battle/moveEffects/substitute_effect.asm
+++ b/engine/battle/moveEffects/substitute_effect.asm
@@ -3,13 +3,13 @@
call DelayFrames
ld hl, wBattleMonMaxHP
ld de, wPlayerSubstituteHP
- ld bc, W_PLAYERBATTSTATUS2
+ ld bc, wPlayerBattleStatus2
ld a, [H_WHOSETURN]
and a
jr z, .notEnemy
ld hl, wEnemyMonMaxHP
ld de, wEnemySubstituteHP
- ld bc, W_ENEMYBATTSTATUS2
+ ld bc, wEnemyBattleStatus2
.notEnemy
ld a, [bc]
bit HasSubstituteUp, a ; user already has substitute?
@@ -44,7 +44,7 @@
ld h, b
ld l, c
set HasSubstituteUp, [hl]
- ld a, [W_OPTIONS]
+ ld a, [wOptions]
bit 7, a ; battle animation is enabled?
ld hl, PlayCurrentMoveAnimation
ld b, BANK(PlayCurrentMoveAnimation)
--- a/engine/battle/moveEffects/transform_effect.asm
+++ b/engine/battle/moveEffects/transform_effect.asm
@@ -1,16 +1,16 @@
TransformEffect_: ; 3bab1 (e:7ab1)
ld hl, wBattleMonSpecies
ld de, wEnemyMonSpecies
- ld bc, W_ENEMYBATTSTATUS3
- ld a, [W_ENEMYBATTSTATUS1]
+ ld bc, wEnemyBattleStatus3
+ ld a, [wEnemyBattleStatus1]
ld a, [H_WHOSETURN]
and a
jr nz, .hitTest
ld hl, wEnemyMonSpecies
ld de, wBattleMonSpecies
- ld bc, W_PLAYERBATTSTATUS3
+ ld bc, wPlayerBattleStatus3
ld [wPlayerMoveListIndex], a
- ld a, [W_PLAYERBATTSTATUS1]
+ ld a, [wPlayerBattleStatus1]
.hitTest
bit Invulnerable, a ; is mon invulnerable to typical attacks? (fly/dig)
jp nz, .failed
@@ -17,11 +17,11 @@
push hl
push de
push bc
- ld hl, W_PLAYERBATTSTATUS2
+ ld hl, wPlayerBattleStatus2
ld a, [H_WHOSETURN]
and a
jr z, .transformEffect
- ld hl, W_ENEMYBATTSTATUS2
+ ld hl, wEnemyBattleStatus2
.transformEffect
; animation(s) played are different if target has Substitute up
bit HasSubstituteUp, [hl]
@@ -29,7 +29,7 @@
ld hl, HideSubstituteShowMonAnim
ld b, BANK(HideSubstituteShowMonAnim)
call nz, Bankswitch
- ld a, [W_OPTIONS]
+ ld a, [wOptions]
add a
ld hl, PlayCurrentMoveAnimation
ld b, BANK(PlayCurrentMoveAnimation)
--- a/engine/battle/print_type.asm
+++ b/engine/battle/print_type.asm
@@ -6,11 +6,11 @@
call GetMonHeader
pop hl
push hl
- ld a, [W_MONHTYPE1]
+ ld a, [wMonHType1]
call PrintType
- ld a, [W_MONHTYPE1]
+ ld a, [wMonHType1]
ld b, a
- ld a, [W_MONHTYPE2]
+ ld a, [wMonHType2]
cp b
pop hl
jr z, EraseType2Text
@@ -34,7 +34,7 @@
PrintMoveType: ; 27d98 (9:7d98)
call GetPredefRegisters
push hl
- ld a, [W_PLAYERMOVETYPE]
+ ld a, [wPlayerMoveType]
; fall through
PrintType_: ; 27d9f (9:7d9f)
--- a/engine/battle/read_trainer_party.asm
+++ b/engine/battle/read_trainer_party.asm
@@ -15,7 +15,7 @@
ld [hl],a
; get the pointer to trainer data for this class
- ld a,[W_CUROPPONENT]
+ ld a,[wCurOpponent]
sub $C9 ; convert value from pokemon to trainer
add a,a
ld hl,TrainerDataPointers
@@ -25,7 +25,7 @@
ld a,[hli]
ld h,[hl]
ld l,a
- ld a,[W_TRAINERNO]
+ ld a,[wTrainerNo]
ld b,a
; At this point b contains the trainer number,
; and hl points to the trainer class.
@@ -43,13 +43,13 @@
; if the first byte of trainer data is FF,
; - each pokemon has a specific level
; (as opposed to the whole team being of the same level)
-; - if [W_LONEATTACKNO] != 0, one pokemon on the team has a special move
+; - if [wLoneAttackNo] != 0, one pokemon on the team has a special move
; else the first byte is the level of every pokemon on the team
.IterateTrainer
ld a,[hli]
cp $FF ; is the trainer special?
jr z,.SpecialTrainer ; if so, check for special moves
- ld [W_CURENEMYLVL],a
+ ld [wCurEnemyLVL],a
.LoopTrainerData
ld a,[hli]
and a ; have we reached the end of the trainer data?
@@ -65,11 +65,11 @@
; if this code is being run:
; - each pokemon has a specific level
; (as opposed to the whole team being of the same level)
-; - if [W_LONEATTACKNO] != 0, one pokemon on the team has a special move
+; - if [wLoneAttackNo] != 0, one pokemon on the team has a special move
ld a,[hli]
and a ; have we reached the end of the trainer data?
jr z,.AddLoneMove
- ld [W_CURENEMYLVL],a
+ ld [wCurEnemyLVL],a
ld a,[hli]
ld [wcf91],a
ld a,ENEMY_PARTY_DATA
@@ -80,7 +80,7 @@
jr .SpecialTrainer
.AddLoneMove
; does the trainer have a single monster with a different move
- ld a,[W_LONEATTACKNO] ; Brock is 01, Misty is 02, Erika is 04, etc
+ ld a,[wLoneAttackNo] ; Brock is 01, Misty is 02, Erika is 04, etc
and a
jr z,.AddTeamMove
dec a
@@ -100,7 +100,7 @@
; check if our trainer's team has special moves
; get trainer class number
- ld a,[W_CUROPPONENT]
+ ld a,[wCurOpponent]
sub 200
ld b,a
ld hl,TeamMoves
@@ -130,7 +130,7 @@
ld [wEnemyMon1Moves + 2],a
; starter
- ld a,[W_RIVALSTARTER]
+ ld a,[wRivalStarter]
cp STARTER3
ld b,MEGA_DRAIN
jr z,.GiveStarterMove
@@ -150,7 +150,7 @@
ld [de],a
inc de
ld [de],a
- ld a,[W_CURENEMYLVL]
+ ld a,[wCurEnemyLVL]
ld b,a
.LastLoop
; update wAmountMoneyWon addresses (money to win) based on enemy's level
@@ -162,5 +162,5 @@
inc de
inc de
dec b
- jr nz,.LastLoop ; repeat W_CURENEMYLVL times
+ jr nz,.LastLoop ; repeat wCurEnemyLVL times
ret
--- a/engine/battle/safari_zone.asm
+++ b/engine/battle/safari_zone.asm
@@ -18,7 +18,7 @@
ld a, [wEnemyMonSpecies]
ld [wd0b5], a
call GetMonHeader
- ld a, [W_MONHCATCHRATE]
+ ld a, [wMonHCatchRate]
ld [wEnemyMonCatchRate], a
pop hl
.asm_429f
--- a/engine/battle/save_trainer_name.asm
+++ b/engine/battle/save_trainer_name.asm
@@ -1,6 +1,6 @@
SaveTrainerName: ; 27e4a (9:7e4a)
ld hl,TrainerNamePointers
- ld a,[W_TRAINERCLASS]
+ ld a,[wTrainerClass]
dec a
ld c,a
ld b,0
@@ -23,50 +23,50 @@
dw YoungsterName
dw BugCatcherName
dw LassName
- dw W_TRAINERNAME
+ dw wTrainerName
dw JrTrainerMName
dw JrTrainerFName
dw PokemaniacName
dw SuperNerdName
- dw W_TRAINERNAME
- dw W_TRAINERNAME
+ dw wTrainerName
+ dw wTrainerName
dw BurglarName
dw EngineerName
dw JugglerXName
- dw W_TRAINERNAME
+ dw wTrainerName
dw SwimmerName
- dw W_TRAINERNAME
- dw W_TRAINERNAME
+ dw wTrainerName
+ dw wTrainerName
dw BeautyName
- dw W_TRAINERNAME
+ dw wTrainerName
dw RockerName
dw JugglerName
- dw W_TRAINERNAME
- dw W_TRAINERNAME
+ dw wTrainerName
+ dw wTrainerName
dw BlackbeltName
- dw W_TRAINERNAME
+ dw wTrainerName
dw ProfOakName
dw ChiefName
dw ScientistName
- dw W_TRAINERNAME
+ dw wTrainerName
dw RocketName
dw CooltrainerMName
dw CooltrainerFName
- dw W_TRAINERNAME
- dw W_TRAINERNAME
- dw W_TRAINERNAME
- dw W_TRAINERNAME
- dw W_TRAINERNAME
- dw W_TRAINERNAME
- dw W_TRAINERNAME
- dw W_TRAINERNAME
- dw W_TRAINERNAME
- dw W_TRAINERNAME
- dw W_TRAINERNAME
- dw W_TRAINERNAME
- dw W_TRAINERNAME
- dw W_TRAINERNAME
- dw W_TRAINERNAME
+ dw wTrainerName
+ dw wTrainerName
+ dw wTrainerName
+ dw wTrainerName
+ dw wTrainerName
+ dw wTrainerName
+ dw wTrainerName
+ dw wTrainerName
+ dw wTrainerName
+ dw wTrainerName
+ dw wTrainerName
+ dw wTrainerName
+ dw wTrainerName
+ dw wTrainerName
+ dw wTrainerName
YoungsterName: ; 27ec2 (9:7ec2)
db "YOUNGSTER@"
--- a/engine/battle/trainer_ai.asm
+++ b/engine/battle/trainer_ai.asm
@@ -7,7 +7,7 @@
ld [hli], a ; move 2
ld [hli], a ; move 3
ld [hl], a ; move 4
- ld a, [W_ENEMYDISABLEDMOVE] ; forbid disabled move (if any)
+ ld a, [wEnemyDisabledMove] ; forbid disabled move (if any)
swap a
and $f
jr z, .noMoveDisabled
@@ -19,7 +19,7 @@
ld [hl], $50 ; forbid (highly discourage) disabled move
.noMoveDisabled
ld hl, TrainerClassMoveChoiceModifications
- ld a, [W_TRAINERCLASS]
+ ld a, [wTrainerClass]
ld b, a
.loopTrainerClasses
dec b
@@ -126,10 +126,10 @@
ret z ; no more moves in move set
inc de
call ReadMove
- ld a, [W_ENEMYMOVEPOWER]
+ ld a, [wEnemyMovePower]
and a
jr nz, .nextMove
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
push hl
push de
push bc
@@ -171,7 +171,7 @@
ret z ; no more moves in move set
inc de
call ReadMove
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
cp ATTACK_UP1_EFFECT
jr c, .nextMove
cp BIDE_EFFECT
@@ -218,7 +218,7 @@
push hl
push de
push bc
- ld a, [W_ENEMYMOVETYPE]
+ ld a, [wEnemyMoveType]
ld d, a
ld hl, wEnemyMonMoves ; enemy moves
ld b, NUM_MOVES + 1
@@ -230,7 +230,7 @@
and a
jr z, .done
call ReadMove
- ld a, [W_ENEMYMOVEEFFECT]
+ ld a, [wEnemyMoveEffect]
cp SUPER_FANG_EFFECT
jr z, .betterMoveFound ; Super Fang is considered to be a better move
cp SPECIAL_DAMAGE_EFFECT
@@ -237,10 +237,10 @@
jr z, .betterMoveFound ; any special damage moves are considered to be better moves
cp FLY_EFFECT
jr z, .betterMoveFound ; Fly is considered to be a better move
- ld a, [W_ENEMYMOVETYPE]
+ ld a, [wEnemyMoveType]
cp d
jr z, .loopMoves
- ld a, [W_ENEMYMOVEPOWER]
+ ld a, [wEnemyMovePower]
and a
jr nz, .betterMoveFound ; damaging moves of a different type are considered to be better moves
jr .loopMoves
@@ -266,7 +266,7 @@
ld hl,Moves
ld bc,MoveEnd - Moves
call AddNTimes
- ld de,W_ENEMYMOVENUM
+ ld de,wEnemyMoveNum
call CopyData
pop bc
pop de
@@ -338,13 +338,13 @@
TrainerAI: ; 3a52e (e:652e)
and a
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
dec a
ret z ; if not a trainer, we're done here
ld a,[wLinkState]
cp LINK_STATE_BATTLING
ret z
- ld a,[W_TRAINERCLASS] ; what trainer class is this?
+ ld a,[wTrainerClass] ; what trainer class is this?
dec a
ld c,a
ld b,0
@@ -727,13 +727,13 @@
xor a
ld [hl],a ; clear status in enemy team roster
ld [wEnemyMonStatus],a ; clear status of active enemy
- ld hl,W_ENEMYBATTSTATUS3
+ ld hl,wEnemyBattleStatus3
res 0,[hl]
ret
AIUseXAccuracy: ; 0x3a7a8 unused
call AIPlayRestoringSFX
- ld hl,W_ENEMYBATTSTATUS2
+ ld hl,wEnemyBattleStatus2
set 0,[hl]
ld a,X_ACCURACY
jp AIPrintItemUse
@@ -740,7 +740,7 @@
AIUseGuardSpec: ; 3a7b5 (e:67b5)
call AIPlayRestoringSFX
- ld hl,W_ENEMYBATTSTATUS2
+ ld hl,wEnemyBattleStatus2
set 1,[hl]
ld a,GUARD_SPEC_
jp AIPrintItemUse
@@ -747,7 +747,7 @@
AIUseDireHit: ; 0x3a7c2 unused
call AIPlayRestoringSFX
- ld hl,W_ENEMYBATTSTATUS2
+ ld hl,wEnemyBattleStatus2
set 2,[hl]
ld a,DIRE_HIT
jp AIPrintItemUse
@@ -803,7 +803,7 @@
push bc
call AIPrintItemUse_
pop bc
- ld hl,W_ENEMYMOVEEFFECT
+ ld hl,wEnemyMoveEffect
ld a,[hld]
push af
ld a,[hl]
--- a/engine/battle/wild_encounters.asm
+++ b/engine/battle/wild_encounters.asm
@@ -27,9 +27,9 @@
; is the bottom right tile (9,9) of the half-block we're standing in a grass/water tile?
coord hl, 9, 9
ld c, [hl]
- ld a, [W_GRASSTILE]
+ ld a, [wGrassTile]
cp c
- ld a, [W_GRASSRATE]
+ ld a, [wGrassRate]
jr z, .CanEncounter
ld a, $14 ; in all tilesets with a water tile, this is its id
cp c
@@ -38,13 +38,13 @@
; even if not in grass/water, standing anywhere we can encounter pokemon
; so long as the map is "indoor" and has wild pokemon defined.
; ...as long as it's not Viridian Forest or Safari Zone.
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp REDS_HOUSE_1F ; is this an indoor map?
jr c, .CantEncounter2
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
cp FOREST ; Viridian Forest/Safari Zone
jr z, .CantEncounter2
- ld a, [W_GRASSRATE]
+ ld a, [wGrassRate]
.CanEncounter
; compare encounter chance with a random number to determine if there will be an encounter
ld b, a
@@ -63,7 +63,7 @@
.gotEncounterSlot
; determine which wild pokemon (grass or water) can appear in the half-block we're standing in
ld c, [hl]
- ld hl, W_GRASSMONS
+ ld hl, wGrassMons
aCoord 8, 9
cp $14 ; is the bottom left tile (8,9) of the half-block we're standing in a water tile?
jr nz, .gotWildEncounterType ; else, it's treated as a grass tile by default
@@ -74,7 +74,7 @@
ld b, 0
add hl, bc
ld a, [hli]
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
ld a, [hl]
ld [wcf91], a
ld [wEnemyMonSpecies2], a
@@ -83,7 +83,7 @@
jr z, .willEncounter
ld a, [wPartyMon1Level]
ld b, a
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
cp b
jr c, .CantEncounter2 ; repel prevents encounters if the leading party mon's level is higher than the wild mon
jr .willEncounter
--- a/engine/cable_club.asm
+++ b/engine/cable_club.asm
@@ -57,8 +57,8 @@
ld [hli], a
dec b
jr nz, .zeroPlayerDataPatchListLoop
- ld hl, W_GRASSRATE
- ld bc, W_TRAINERHEADERPTR - W_GRASSRATE
+ ld hl, wGrassRate
+ ld bc, wTrainerHeaderPtr - wGrassRate
.zeroEnemyPartyLoop
xor a
ld [hli], a
@@ -186,7 +186,7 @@
dec c
jr nz, .copyEnemyNameLoop
ld de, wEnemyPartyCount
- ld bc, W_TRAINERHEADERPTR - wEnemyPartyCount
+ ld bc, wTrainerHeaderPtr - wEnemyPartyCount
.copyEnemyPartyLoop
ld a, [hli]
cp SERIAL_NO_DATA_BYTE
@@ -275,10 +275,10 @@
ld a, LINK_STATE_BATTLING
ld [wLinkState], a
ld a, OPP_SONY1
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
call ClearScreen
call Delay3
- ld hl, W_OPTIONS
+ ld hl, wOptions
res 7, [hl]
predef InitOpponent
predef HealParty
@@ -900,18 +900,18 @@
call CableClub_DoBattleOrTrade
ld hl, Club_GFX
ld a, h
- ld [W_TILESETGFXPTR + 1], a
+ ld [wTileSetGFXPtr + 1], a
ld a, l
- ld [W_TILESETGFXPTR], a
+ ld [wTileSetGFXPtr], a
ld a, Bank(Club_GFX)
- ld [W_TILESETBANK], a
+ ld [wTileSetBank], a
ld hl, Club_Coll
ld a, h
- ld [W_TILESETCOLLISIONPTR + 1], a
+ ld [wTileSetCollisionPtr + 1], a
ld a, l
- ld [W_TILESETCOLLISIONPTR], a
+ ld [wTileSetCollisionPtr], a
xor a
- ld [W_GRASSRATE], a
+ ld [wGrassRate], a
inc a ; LINK_STATE_IN_CABLE_CLUB
ld [wLinkState], a
ld [$ffb5], a
--- a/engine/evos_moves.asm
+++ b/engine/evos_moves.asm
@@ -105,7 +105,7 @@
cp b ; is the mon's level greater than the evolution requirement?
jp c, .nextEvoEntry2 ; if so, go the next evolution entry
.doEvolution
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
ld a, 1
ld [wEvolutionOccurred], a
push hl
@@ -163,10 +163,10 @@
ld hl, BaseStats
ld bc, MonBaseStatsEnd - MonBaseStats
call AddNTimes
- ld de, W_MONHEADER
+ ld de, wMonHeader
call CopyData
ld a, [wd0b5]
- ld [W_MONHINDEX], a
+ ld [wMonHIndex], a
pop af
ld [wd11e], a
ld hl, wLoadedMonHPExp - 1
@@ -210,7 +210,7 @@
call LearnMoveFromLevelUp
pop hl
predef SetPartyMonTypes
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
and a
call z, Evolution_ReloadTilesetTilePatterns
predef IndexToPokedex
@@ -249,7 +249,7 @@
ld a, [wLinkState]
cp LINK_STATE_TRADING
ret z
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
and a
ret nz
ld a, [wEvolutionOccurred]
@@ -262,7 +262,7 @@
; nickname, in which case the nickname is kept.
ld a, [wd0b5]
push af
- ld a, [W_MONHINDEX]
+ ld a, [wMonHIndex]
ld [wd0b5], a
call GetName
pop af
@@ -340,7 +340,7 @@
and a ; have we reached the end of the learn set?
jr z, .done ; if we've reached the end of the learn set, jump
ld b, a ; level the move is learnt at
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
cp b ; is the move learnt at the mon's current level?
ld a, [hli] ; move ID
jr nz, .learnSetLoop
@@ -375,7 +375,7 @@
ld [wd11e], a
ret
-; writes the moves a mon has at level [W_CURENEMYLVL] to [de]
+; writes the moves a mon has at level [wCurEnemyLVL] to [de]
; move slots are being filled up sequentially and shifted if all slots are full
WriteMonMoves: ; 3afb8 (e:6fb8)
call GetPredefRegisters
@@ -407,7 +407,7 @@
and a
jp z, .done ; end of list
ld b, a
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
cp b
jp c, .done ; mon level < move level (assumption: learnset is sorted by level)
ld a, [wLearningMovesFromDayCare]
--- a/engine/experience.asm
+++ b/engine/experience.asm
@@ -29,7 +29,7 @@
; calculates the amount of experience needed for level d
CalcExperience: ; 58f6a (16:4f6a)
- ld a, [W_MONHGROWTHRATE]
+ ld a, [wMonHGrowthRate]
add a
add a
ld c, a
--- a/engine/give_pokemon.asm
+++ b/engine/give_pokemon.asm
@@ -7,12 +7,12 @@
ld a, [wPartyCount]
cp PARTY_LENGTH
jr c, .addToParty
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
cp MONS_PER_BOX
jr nc, .boxFull
; add to box
xor a
- ld [W_ENEMYBATTSTATUS3], a
+ ld [wEnemyBattleStatus3], a
ld a, [wcf91]
ld [wEnemyMonSpecies2], a
callab LoadEnemyMonData
--- a/engine/hall_of_fame.asm
+++ b/engine/hall_of_fame.asm
@@ -20,7 +20,7 @@
xor a
ld [wUpdateSpritesEnabled], a
ld [hTilesetType], a
- ld [W_SPRITEFLIPPED], a
+ ld [wSpriteFlipped], a
ld [wLetterPrintingDelayFlags], a ; no delay
ld [wHoFMonOrPlayer], a ; mon
inc a
@@ -224,12 +224,12 @@
ld de, HoFPlayTimeText
call PlaceString
coord hl, 5, 7
- ld de, W_PLAYTIMEHOURS + 1
+ ld de, wPlayTimeHours + 1
lb bc, 1, 3
call PrintNumber
ld [hl], $6d
inc hl
- ld de, W_PLAYTIMEMINUTES + 1
+ ld de, wPlayTimeMinutes + 1
lb bc, LEADING_ZEROES | 1, 2
call PrintNumber
coord hl, 1, 9
--- a/engine/hidden_object_functions18.asm
+++ b/engine/hidden_object_functions18.asm
@@ -7,7 +7,7 @@
cp SPRITE_FACING_UP
ret nz
ld hl, .BadgeFlags
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
ld b, a
.loop
ld a, [hli]
@@ -50,7 +50,7 @@
PrintBenchGuyText: ; 6245d (18:645d)
call EnableAutoTextBoxDrawing
ld hl, BenchGuyTextPointers
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
ld b, a
.loop
ld a, [hli]
--- a/engine/hidden_object_functions3.asm
+++ b/engine/hidden_object_functions3.asm
@@ -4,7 +4,7 @@
cp SPRITE_FACING_UP
jr nz, .noMatch
; facing up
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
ld b, a
aCoord 8, 7
ld c, a
@@ -78,7 +78,7 @@
TX_ASM
ld hl, IndigoPlateauStatuesText1
call PrintText
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
bit 0, a
ld hl, IndigoPlateauStatuesText2
jr nz, .asm_fbd3
@@ -102,7 +102,7 @@
BookOrSculptureText: ; fbe8 (3:7be8)
TX_ASM
ld hl, PokemonBooksText
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
cp MANSION ; Celadon Mansion tileset
jr nz, .asm_fbfd
aCoord 8, 6
--- a/engine/hidden_object_functions7.asm
+++ b/engine/hidden_object_functions7.asm
@@ -38,7 +38,7 @@
SafariZoneCheck: ; 1e988 (7:6988)
CheckEventHL EVENT_IN_SAFARI_ZONE ; if we are not in the Safari Zone,
jr z, SafariZoneGameStillGoing ; don't bother printing game over text
- ld a, [W_NUMSAFARIBALLS]
+ ld a, [wNumSafariBalls]
and a
jr z, SafariZoneGameOver
jr SafariZoneGameStillGoing
@@ -83,7 +83,7 @@
ld a, $3
ld [wDestinationWarpID], a
ld a, $5
- ld [W_SAFARIZONEENTRANCECURSCRIPT], a
+ ld [wSafariZoneEntranceCurScript], a
SetEvent EVENT_SAFARI_GAME_OVER
ld a, 1
ld [wSafariZoneGameOver], a
@@ -97,7 +97,7 @@
SafariGameOverText: ; 1e9f7 (7:69f7)
TX_ASM
- ld a, [W_NUMSAFARIBALLS]
+ ld a, [wNumSafariBalls]
and a
jr z, .asm_1ea04
ld hl, TimesUpText
--- a/engine/in_game_trades.asm
+++ b/engine/in_game_trades.asm
@@ -108,7 +108,7 @@
ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
ld a,[hl]
- ld [W_CURENEMYLVL],a
+ ld [wCurEnemyLVL],a
ld hl,wCompletedInGameTradeFlags
ld a,[wWhichTrade]
ld c,a
@@ -118,13 +118,13 @@
call PrintText
ld a,[wWhichPokemon]
push af
- ld a,[W_CURENEMYLVL]
+ ld a,[wCurEnemyLVL]
push af
call LoadHpBarAndStatusTilePatterns
call InGameTrade_PrepareTradeData
predef InternalClockTradeAnim
pop af
- ld [W_CURENEMYLVL],a
+ ld [wCurEnemyLVL],a
pop af
ld [wWhichPokemon],a
ld a,[wInGameTradeReceiveMonSpecies]
--- a/engine/intro.asm
+++ b/engine/intro.asm
@@ -29,9 +29,9 @@
ld b, $3 ; Gengar tiles
call IntroCopyTiles
ld a, 0
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
ld a, 80
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
lb bc, 6, 6
call InitIntroNidorinoOAM
lb de, 80 / 2, MOVE_NIDORINO_RIGHT
@@ -141,10 +141,10 @@
ld a, [de]
cp $50
ret z
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
inc de
ld a, [de]
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
push de
ld c, 6 * 6
call UpdateIntroNidorinoOAM
@@ -159,10 +159,10 @@
ld a, [wIntroNidorinoBaseTile]
ld d, a
.loop
- ld a, [W_BASECOORDY]
+ ld a, [wBaseCoordY]
add [hl]
ld [hli], a ; Y
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
add [hl]
ld [hli], a ; X
ld a, d
@@ -178,7 +178,7 @@
ld d, 0
.loop
push bc
- ld a, [W_BASECOORDY]
+ ld a, [wBaseCoordY]
ld e, a
.innerLoop
ld a, e
@@ -185,7 +185,7 @@
add 8
ld e, a
ld [hli], a ; Y
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
ld [hli], a ; X
ld a, d
ld [hli], a ; tile
@@ -194,9 +194,9 @@
inc d
dec c
jr nz, .innerLoop
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
add 8
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
pop bc
dec b
jr nz, .loop
@@ -245,9 +245,9 @@
.moveNidorinoRight
push de
ld a, 2
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
xor a
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
ld c, 6 * 6
call UpdateIntroNidorinoOAM
pop de
@@ -312,7 +312,7 @@
call ClearScreen
call DisableLCD
xor a
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
call IntroDrawBlackBars
call LoadIntroGraphics
call EnableLCD
--- a/engine/items/itemfinder.asm
+++ b/engine/items/itemfinder.asm
@@ -3,7 +3,7 @@
ld b, 0
.loop
ld de, 3
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
call IsInRestOfArray
ret nc ; return if current map has no hidden items
push bc
@@ -24,19 +24,19 @@
inc hl
jr nz, .loop ; if the item has already been obtained
; check if the item is within 4-5 tiles (depending on the direction of item)
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
call Sub5ClampTo0
cp d
jr nc, .loop
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
add 4
cp d
jr c, .loop
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
call Sub5ClampTo0
cp e
jr nc, .loop
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
add 5
cp e
jr c, .loop
--- a/engine/items/items.asm
+++ b/engine/items/items.asm
@@ -103,7 +103,7 @@
ItemUseBall: ; d687 (3:5687)
; Balls can't be used out of battle.
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp z,ItemUseNotTime
@@ -112,7 +112,7 @@
jp nz,ThrowBallAtTrainerMon
; If this is for the old man battle, skip checking if the party & box are full.
- ld a,[W_BATTLETYPE]
+ ld a,[wBattleType]
dec a
jr z,.canUseBall
@@ -119,7 +119,7 @@
ld a,[wPartyCount] ; is party full?
cp a,PARTY_LENGTH
jr nz,.canUseBall
- ld a,[W_NUMINBOX] ; is box full?
+ ld a,[wNumInBox] ; is box full?
cp a,MONS_PER_BOX
jp z,BoxFullCannotThrowBall
@@ -127,12 +127,12 @@
xor a
ld [wCapturedMonSpecies],a
- ld a,[W_BATTLETYPE]
+ ld a,[wBattleType]
cp a,BATTLE_TYPE_SAFARI
jr nz,.skipSafariZoneCode
.safariZone
- ld hl,W_NUMSAFARIBALLS
+ ld hl,wNumSafariBalls
dec [hl] ; remove a Safari Ball
.skipSafariZoneCode
@@ -151,12 +151,12 @@
ld b,$10 ; can't be caught value
jp z,.setAnimData
- ld a,[W_BATTLETYPE]
+ ld a,[wBattleType]
dec a
jr nz,.notOldManBattle
.oldManBattle
- ld hl,W_GRASSRATE
+ ld hl,wGrassRate
ld de,wPlayerName
ld bc,NAME_LENGTH
call CopyData ; save the player's name in the Wild Monster data (part of the Cinnabar Island Missingno. glitch)
@@ -165,7 +165,7 @@
.notOldManBattle
; If the player is fighting the ghost Marowak, set the value that indicates the
; Pokémon can't be caught and skip the capture calculations.
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
cp a,POKEMONTOWER_6
jr nz,.loop
ld a,[wEnemyMonSpecies2]
@@ -420,7 +420,7 @@
; Do the animation.
ld a,TOSS_ANIM
- ld [W_ANIMATIONID],a
+ ld [wAnimationID],a
xor a
ld [H_WHOSETURN],a
ld [wAnimationType],a
@@ -470,7 +470,7 @@
; 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,W_ENEMYBATTSTATUS3
+ ld hl,wEnemyBattleStatus3
bit Transformed,[hl]
jr z,.notTransformed
ld a,DITTO
@@ -494,7 +494,7 @@
ld a,[wEnemyMonSpecies2]
ld [wcf91],a
ld a,[wEnemyMonLevel]
- ld [W_CURENEMYLVL],a
+ ld [wCurEnemyLVL],a
callab LoadEnemyMonData
pop af
ld [wcf91],a
@@ -510,7 +510,7 @@
ld [wCapturedMonSpecies],a
ld [wcf91],a
ld [wd11e],a
- ld a,[W_BATTLETYPE]
+ ld a,[wBattleType]
dec a ; is this the old man battle?
jr z,.oldManCaughtMon ; if so, don't give the player the caught Pokémon
@@ -573,7 +573,7 @@
call ClearSprites
.done
- ld a,[W_BATTLETYPE]
+ ld a,[wBattleType]
and a ; is this the old man battle?
ret nz ; if so, don't remove a ball from the bag
@@ -627,13 +627,13 @@
db "@"
ItemUseTownMap: ; d968 (3:5968)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp nz,ItemUseNotTime
jpba DisplayTownMap
ItemUseBicycle: ; d977 (3:5977)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp nz,ItemUseNotTime
ld a,[wWalkBikeSurfState]
@@ -695,7 +695,7 @@
ld hl,TilePairCollisionsWater
call CheckForTilePairCollisions
jr c,.cannotStopSurfing
- ld hl,W_TILESETCOLLISIONPTR ; pointer to list of passable tiles
+ ld hl,wTileSetCollisionPtr ; pointer to list of passable tiles
ld a,[hli]
ld h,[hl]
ld l,a ; hl now points to passable tiles
@@ -754,7 +754,7 @@
predef_jump ShowPokedexMenu
ItemUseEvoStone: ; da5b (3:5a5b)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp nz,ItemUseNotTime
ld a,[wWhichPokemon]
@@ -795,7 +795,7 @@
ret
ItemUseVitamin: ; dab4 (3:5ab4)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp nz,ItemUseNotTime
@@ -898,7 +898,7 @@
xor a
ld [wBattleMonStatus],a ; remove the status ailment in the in-battle pokemon data
push hl
- ld hl,W_PLAYERBATTSTATUS3
+ ld hl,wPlayerBattleStatus3
res BadlyPoisoned,[hl] ; heal Toxic status
pop hl
ld bc,wPartyMon1Stats - wPartyMon1Status
@@ -926,7 +926,7 @@
jr z,.updateInBattleFaintedData
jp .healingItemNoEffect
.updateInBattleFaintedData
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jr z,.compareCurrentHPToMaxHP
push hl
@@ -1244,7 +1244,7 @@
ret nz ; if so, return
call GBPalWhiteOut
call z,RunDefaultPaletteCommand
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
ret nz
jp ReloadMapData
@@ -1256,7 +1256,7 @@
ld bc,wPartyMon1Level - wPartyMon1
add hl,bc ; hl now points to level
ld a,[hl] ; a = level
- ld [W_CURENEMYLVL],a ; store level
+ ld [wCurEnemyLVL],a ; store level
call GetMonHeader
push de
ld a,d
@@ -1335,7 +1335,7 @@
jr z,.vitaminNoEffect ; can't raise level above 100
inc a
ld [hl],a ; store incremented level
- ld [W_CURENEMYLVL],a
+ ld [wCurEnemyLVL],a
push hl
push de
ld d,a
@@ -1454,7 +1454,7 @@
ld de,wSafariBaitFactor ; bait factor
BaitRockCommon: ; df7f (3:5f7f)
- ld [W_ANIMATIONID],a
+ ld [wAnimationID],a
xor a
ld [wAnimationType],a
ld [H_WHOSETURN],a
@@ -1486,13 +1486,13 @@
; also used for Dig out-of-battle effect
ItemUseEscapeRope: ; dfaf (3:5faf)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jr nz,.notUsable
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
cp a,AGATHAS_ROOM
jr z,.notUsable
- ld a,[W_CURMAPTILESET]
+ ld a,[wCurMapTileset]
ld b,a
ld hl,EscapeRopeTilesets
.loop
@@ -1508,8 +1508,8 @@
res 4,[hl]
ResetEvent EVENT_IN_SAFARI_ZONE
xor a
- ld [W_NUMSAFARIBALLS],a
- ld [W_SAFARIZONEENTRANCECURSCRIPT],a
+ ld [wNumSafariBalls],a
+ ld [wSafariZoneEntranceCurScript],a
inc a
ld [wEscapedFromBattle],a
ld [wActionResultOrTookBattleTurn],a ; item used
@@ -1531,7 +1531,7 @@
ld b,100
ItemUseRepelCommon: ; e005 (3:6005)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp nz,ItemUseNotTime
ld a,b
@@ -1540,10 +1540,10 @@
; handles X Accuracy item
ItemUseXAccuracy: ; e013 (3:6013)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp z,ItemUseNotTime
- ld hl,W_PLAYERBATTSTATUS2
+ ld hl,wPlayerBattleStatus2
set UsingXAccuracy,[hl] ; X Accuracy bit
jp PrintItemUseTextAndRemoveItem
@@ -1568,7 +1568,7 @@
jp nz,ItemUseNotTime
ld hl,CardKeyTable3
.next1
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
ld b,a
.loop
ld a,[hli]
@@ -1641,7 +1641,7 @@
db $ff
ItemUsePokedoll: ; e0cd (3:60cd)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
dec a
jp nz,ItemUseNotTime
ld a,$01
@@ -1649,10 +1649,10 @@
jp PrintItemUseTextAndRemoveItem
ItemUseGuardSpec: ; e0dc (3:60dc)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp z,ItemUseNotTime
- ld hl,W_PLAYERBATTSTATUS2
+ ld hl,wPlayerBattleStatus2
set ProtectedByMist,[hl] ; Mist bit
jp PrintItemUseTextAndRemoveItem
@@ -1665,15 +1665,15 @@
jp ItemUseRepelCommon
ItemUseDireHit: ; e0f5 (3:60f5)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp z,ItemUseNotTime
- ld hl,W_PLAYERBATTSTATUS2
+ ld hl,wPlayerBattleStatus2
set GettingPumped,[hl] ; Focus Energy bit
jp PrintItemUseTextAndRemoveItem
ItemUseXStat: ; e104 (3:6104)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jr nz,.inBattle
call ItemUseNotTime
@@ -1681,11 +1681,11 @@
ld [wActionResultOrTookBattleTurn],a ; item not used
ret
.inBattle
- ld hl,W_PLAYERMOVENUM
+ ld hl,wPlayerMoveNum
ld a,[hli]
- push af ; save [W_PLAYERMOVENUM]
+ push af ; save [wPlayerMoveNum]
ld a,[hl]
- push af ; save [W_PLAYERMOVEEFFECT]
+ push af ; save [wPlayerMoveEffect]
push hl
ld a,[wcf91]
sub a,X_ATTACK - ATTACK_UP1_EFFECT
@@ -1692,7 +1692,7 @@
ld [hl],a ; store player move effect
call PrintItemUseTextAndRemoveItem
ld a,XSTATITEM_ANIM ; X stat item animation ID
- ld [W_PLAYERMOVENUM],a
+ ld [wPlayerMoveNum],a
call LoadScreenTilesFromBuffer1 ; restore saved screen
call Delay3
xor a
@@ -1700,18 +1700,18 @@
callba StatModifierUpEffect ; do stat increase move
pop hl
pop af
- ld [hld],a ; restore [W_PLAYERMOVEEFFECT]
+ ld [hld],a ; restore [wPlayerMoveEffect]
pop af
- ld [hl],a ; restore [W_PLAYERMOVENUM]
+ ld [hl],a ; restore [wPlayerMoveNum]
ret
ItemUsePokeflute: ; e140 (3:6140)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jr nz,.inBattle
; if not in battle
call ItemUseReloadOverworldData
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
cp a,ROUTE_12
jr nz,.notRoute12
CheckEvent EVENT_BEAT_ROUTE12_SNORLAX
@@ -1746,7 +1746,7 @@
ld b,~SLP & $ff
ld hl,wPartyMon1Status
call WakeUpEntireParty
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
dec a ; is it a trainer battle?
jr z,.skipWakingUpEnemyParty
; if it's a trainer battle
@@ -1838,7 +1838,7 @@
TX_FAR _PlayedFluteHadEffectText
db $06
TX_ASM
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jr nz,.done
; play out-of-battle pokeflute music
@@ -1856,7 +1856,7 @@
jp TextScriptEnd ; end text
ItemUseCoinCase: ; e23a (3:623a)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp nz,ItemUseNotTime
ld hl,CoinCaseNumCoinsText
@@ -1913,11 +1913,11 @@
jr nz, .next
; if yes, store level and species data
ld a, 1
- ld [W_MOVEMISSED], a
+ ld [wMoveMissed], a
ld a, b ; level
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
ld a, c ; species
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
.next
ld hl, wWalkBikeSurfState
@@ -1934,7 +1934,7 @@
; checks if fishing is possible and if so, runs initialization code common to all rods
; unsets carry if fishing is possible, sets carry if not
FishingInit: ; e2b4 (3:62b4)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jr z,.notInBattle
scf ; can't fish during battle
@@ -1962,7 +1962,7 @@
jp ItemUseNotYoursToUse
ItemUseItemfinder: ; e2e1 (3:62e1)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp nz,ItemUseNotTime
call ItemUseReloadOverworldData
@@ -1990,7 +1990,7 @@
db "@"
ItemUsePPUp: ; e317 (3:6317)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp nz,ItemUseNotTime
@@ -2195,7 +2195,7 @@
jp ItemUseNotTime
ItemUseTMHM: ; e479 (3:6479)
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp nz,ItemUseNotTime
ld a,[wcf91]
@@ -2337,7 +2337,7 @@
call LoadScreenTilesFromBuffer1 ; restore saved screen
call Delay3
ld a,TOSS_ANIM
- ld [W_ANIMATIONID],a
+ ld [wAnimationID],a
predef MoveAnimation ; do animation
ld hl,ThrowBallAtTrainerMonText1
call PrintText
@@ -2687,7 +2687,7 @@
INCLUDE "data/key_items.asm"
SendNewMonToBox: ; e7a4 (3:67a4)
- ld de, W_NUMINBOX
+ ld de, wNumInBox
ld a, [de]
inc a
ld [de], a
@@ -2706,7 +2706,7 @@
call GetMonHeader
ld hl, wBoxMonOT
ld bc, NAME_LENGTH
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
dec a
jr z, .asm_e7ee
dec a
@@ -2717,7 +2717,7 @@
ld d, h
ld e, l
pop hl
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
dec a
ld b, a
.asm_e7db
@@ -2738,7 +2738,7 @@
ld de, wBoxMonOT
ld bc, NAME_LENGTH
call CopyData
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
dec a
jr z, .asm_e82a
ld hl, wBoxMonNicks
@@ -2751,7 +2751,7 @@
ld d, h
ld e, l
pop hl
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
dec a
ld b, a
.asm_e817
@@ -2772,7 +2772,7 @@
ld a, NAME_MON_SCREEN
ld [wNamingScreenType], a
predef AskName
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
dec a
jr z, .asm_e867
ld hl, wBoxMons
@@ -2785,7 +2785,7 @@
ld d, h
ld e, l
pop hl
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
dec a
ld b, a
.asm_e854
@@ -2816,7 +2816,7 @@
ld [de], a
inc de
push de
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
ld d, a
callab CalcExperience
pop de
@@ -2856,12 +2856,12 @@
; used for surfing and fishing
; unsets carry if it is, sets carry if not
IsNextTileShoreOrWater: ; e8b8 (3:68b8)
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
ld hl, WaterTilesets
ld de,1
call IsInArray
jr nc, .notShoreOrWater
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
cp SHIP_PORT ; Vermilion Dock tileset
ld a, [wTileInFrontOfPlayer] ; tile in front of player
jr z, .skipShoreTiles ; if it's the Vermilion Dock tileset
@@ -2888,7 +2888,7 @@
; return e = 2 if no fish on this map
; return e = 1 if a bite, bc = level,species
; return e = 0 if no bite
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
ld de, 3 ; each fishing group is three bytes wide
ld hl, SuperRodData
call IsInArray
--- a/engine/items/tms.asm
+++ b/engine/items/tms.asm
@@ -3,7 +3,7 @@
ld a, [wcf91]
ld [wd0b5], a
call GetMonHeader
- ld hl, W_MONHLEARNSET
+ ld hl, wMonHLearnset
push hl
ld a, [wMoveNum]
ld b, a
--- a/engine/learn_move.asm
+++ b/engine/learn_move.asm
@@ -53,7 +53,7 @@
pop de
pop hl
ld [hl], a
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
and a
jp z, PrintLearnedMove
ld a, [wWhichPokemon]
--- a/engine/menu/bills_pc.asm
+++ b/engine/menu/bills_pc.asm
@@ -212,7 +212,7 @@
call PrintText
jp BillsPCMenu
.partyLargeEnough
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
cp MONS_PER_BOX
jr nz, .boxNotFull
ld hl, BoxFullText
@@ -254,7 +254,7 @@
jp BillsPCMenu
BillsPCWithdraw: ; 21618 (8:5618)
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
and a
jr nz, .boxNotEmpty
ld hl, NoMonText
@@ -268,7 +268,7 @@
call PrintText
jp BillsPCMenu
.partyNotFull
- ld hl, W_NUMINBOX
+ ld hl, wNumInBox
call DisplayMonListMenu
jp c, BillsPCMenu
call DisplayDepositWithdrawMenu
@@ -291,7 +291,7 @@
jp BillsPCMenu
BillsPCRelease: ; 21673 (8:5673)
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
and a
jr nz, .loop
ld hl, NoMonText
@@ -298,7 +298,7 @@
call PrintText
jp BillsPCMenu
.loop
- ld hl, W_NUMINBOX
+ ld hl, wNumInBox
call DisplayMonListMenu
jp c, BillsPCMenu
ld hl, OnceReleasedText
@@ -515,7 +515,7 @@
ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
cp SPRITE_FACING_RIGHT
ret nz
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp TRADE_CENTER
ld a, LINK_STATE_START_TRADE
jr z, .next
@@ -532,7 +532,7 @@
ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
cp SPRITE_FACING_LEFT
ret nz
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp TRADE_CENTER
ld a, LINK_STATE_START_TRADE
jr z, .next
--- a/engine/menu/league_pc.asm
+++ b/engine/menu/league_pc.asm
@@ -10,7 +10,7 @@
push af
xor a
ld [hTilesetType], a
- ld [W_SPRITEFLIPPED], a
+ ld [wSpriteFlipped], a
ld [wUpdateSpritesEnabled], a
ld [wHoFTeamIndex2], a
ld [wHoFTeamNo], a
--- a/engine/menu/main_menu.asm
+++ b/engine/menu/main_menu.asm
@@ -114,7 +114,7 @@
ld a,[wNumHoFTeams]
and a
jp z,SpecialEnterMap
- ld a,[W_CURMAP] ; map ID
+ ld a,[wCurMap] ; map ID
cp a,HALL_OF_FAME
jp nz,SpecialEnterMap
xor a
@@ -128,7 +128,7 @@
ld a,1 ; no delay
ld [wLetterPrintingDelayFlags],a
ld a,3 ; medium speed
- ld [W_OPTIONS],a
+ ld [wOptions],a
ret
LinkMenu: ; 5c0a (1:5c0a)
@@ -392,7 +392,7 @@
PrintNumBadges: ; 5e2f (1:5e2f)
push hl
- ld hl, W_OBTAINEDBADGES
+ ld hl, wObtainedBadges
ld b, $1
call CountSetBits
pop hl
@@ -411,12 +411,12 @@
jp PrintNumber
PrintPlayTime: ; 5e55 (1:5e55)
- ld de, W_PLAYTIMEHOURS + 1
+ ld de, wPlayTimeHours + 1
lb bc, 1, 3
call PrintNumber
ld [hl], $6d
inc hl
- ld de, W_PLAYTIMEMINUTES + 1
+ ld de, wPlayTimeMinutes + 1
lb bc, LEADING_ZEROES | 1, 2
jp PrintNumber
@@ -626,13 +626,13 @@
res 6,d
.storeOptions
ld a,d
- ld [W_OPTIONS],a
+ ld [wOptions],a
ret
; reads the options variable and places menu cursors in the correct positions within the options menu
SetCursorPositionsFromOptions: ; 604c (1:604c)
ld hl,TextSpeedOptionData + 1
- ld a,[W_OPTIONS]
+ ld a,[wOptions]
ld c,a
and a,$3f
push bc
--- a/engine/menu/naming_screen.asm
+++ b/engine/menu/naming_screen.asm
@@ -2,7 +2,7 @@
call SaveScreenTilesToBuffer1
call GetPredefRegisters
push hl
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a
coord hl, 0, 0
ld b, 4
@@ -30,7 +30,7 @@
ld a, NAME_MON_SCREEN
ld [wNamingScreenType], a
call DisplayNamingScreen
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
and a
jr nz, .inBattle
call ReloadMapSpriteTilePatterns
@@ -169,7 +169,7 @@
ld [wAnimCounter], a
ld hl, wd730
res 6, [hl]
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
and a
jp z, LoadTextBoxTilePatterns
jpab LoadHudTilePatterns
--- a/engine/menu/prize_menu.asm
+++ b/engine/menu/prize_menu.asm
@@ -78,7 +78,7 @@
ld e,a
inc hl
push hl
- ld hl,W_PRIZE1
+ ld hl,wPrize1
call CopyString
pop hl
ld a,[hli]
@@ -90,17 +90,17 @@
ld a,[wWhichPrizeWindow]
cp a,$02 ;is TM_menu?
jr nz,.putMonName
- ld a,[W_PRIZE1]
+ ld a,[wPrize1]
ld [wd11e],a
call GetItemName
coord hl, 2, 4
call PlaceString
- ld a,[W_PRIZE2]
+ ld a,[wPrize2]
ld [wd11e],a
call GetItemName
coord hl, 2, 6
call PlaceString
- ld a,[W_PRIZE3]
+ ld a,[wPrize3]
ld [wd11e],a
call GetItemName
coord hl, 2, 8
@@ -107,17 +107,17 @@
call PlaceString
jr .putNoThanksText
.putMonName
- ld a,[W_PRIZE1]
+ ld a,[wPrize1]
ld [wd11e],a
call GetMonName
coord hl, 2, 4
call PlaceString
- ld a,[W_PRIZE2]
+ ld a,[wPrize2]
ld [wd11e],a
call GetMonName
coord hl, 2, 6
call PlaceString
- ld a,[W_PRIZE3]
+ ld a,[wPrize3]
ld [wd11e],a
call GetMonName
coord hl, 2, 8
@@ -191,7 +191,7 @@
ld [wWhichPrize],a
ld d,0
ld e,a
- ld hl,W_PRIZE1
+ ld hl,wPrize1
add hl,de
ld a,[hl]
ld [wd11e],a
@@ -300,7 +300,7 @@
jr .loop
.matchFound
ld a,[hl]
- ld [W_CURENEMYLVL],a
+ ld [wCurEnemyLVL],a
ret
INCLUDE "data/prize_mon_levels.asm"
--- a/engine/menu/start_sub_menus.asm
+++ b/engine/menu/start_sub_menus.asm
@@ -117,7 +117,7 @@
ld a,[hli]
ld h,[hl]
ld l,a
- ld a,[W_OBTAINEDBADGES] ; badges obtained
+ ld a,[wObtainedBadges] ; badges obtained
jp [hl]
.outOfBattleMovePointers
dw .cut
@@ -601,12 +601,12 @@
ld c,$e3
call PrintBCDNumber
coord hl, 9, 6
- ld de,W_PLAYTIMEHOURS + 1 ; hours
+ ld de,wPlayTimeHours + 1 ; hours
lb bc, LEFT_ALIGN | 1, 3
call PrintNumber
ld [hl],$d6 ; colon tile ID
inc hl
- ld de,W_PLAYTIMEMINUTES + 1 ; minutes
+ ld de,wPlayTimeMinutes + 1 ; minutes
lb bc, LEADING_ZEROES | 1, 2
jp PrintNumber
--- a/engine/menu/status_screen.asm
+++ b/engine/menu/status_screen.asm
@@ -71,7 +71,7 @@
; mon is in a box or daycare
ld a, [wLoadedMonBoxLevel]
ld [wLoadedMonLevel], a
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
ld hl, wLoadedMonHPExp - 1
ld de, wLoadedMonStats
ld b, $1
@@ -138,7 +138,7 @@
call PlaceString ; "STATUS/"
coord hl, 14, 2
call PrintLevel ; Pokémon level
- ld a, [W_MONHINDEX]
+ ld a, [wMonHIndex]
ld [wd11e], a
ld [wd0b5], a
predef IndexToPokedex
@@ -196,13 +196,13 @@
dw wPartyMonOT
dw wEnemyMonOT
dw wBoxMonOT
- dw W_DAYCAREMONOT
+ dw wDayCareMonOT
NamePointers2: ; 12a9d (4:6a9d)
dw wPartyMonNicks
dw wEnemyMonNicks
dw wBoxMonNicks
- dw W_DAYCAREMONNAME
+ dw wDayCareMonName
Type1Text: ; 12aa5 (4:6aa5)
db "TYPE1/", $4e
@@ -417,7 +417,7 @@
call StatusScreen_ClearName
coord hl, 9, 1
call StatusScreen_ClearName
- ld a, [W_MONHINDEX]
+ ld a, [wMonHIndex]
ld [wd11e], a
call GetMonName
coord hl, 9, 1
--- a/engine/oak_speech.asm
+++ b/engine/oak_speech.asm
@@ -1,7 +1,7 @@
SetDefaultNames: ; 60ca (1:60ca)
ld a, [wLetterPrintingDelayFlags]
push af
- ld a, [W_OPTIONS]
+ ld a, [wOptions]
push af
ld a, [wd732]
push af
@@ -16,7 +16,7 @@
pop af
ld [wd732], a
pop af
- ld [W_OPTIONS], a
+ ld [wOptions], a
pop af
ld [wLetterPrintingDelayFlags], a
ld a, [wOptionsInitialized]
@@ -27,7 +27,7 @@
ld bc, NAME_LENGTH
call CopyData
ld hl, SonyText
- ld de, W_RIVALNAME
+ ld de, wRivalName
ld bc, NAME_LENGTH
jp CopyData
--- a/engine/oak_speech2.asm
+++ b/engine/oak_speech2.asm
@@ -40,11 +40,11 @@
jr z, .customName
ld hl, DefaultNamesRivalList
call GetDefaultName
- ld de, W_RIVALNAME
+ ld de, wRivalName
call OakSpeechSlidePicLeft
jr .done
.customName
- ld hl, W_RIVALNAME
+ ld hl, wRivalName
ld a, NAME_RIVAL_SCREEN
ld [wNamingScreenType], a
call DisplayNamingScreen
--- a/engine/overworld/card_key.asm
+++ b/engine/overworld/card_key.asm
@@ -1,6 +1,6 @@
PrintCardKeyText: ; 52673 (14:6673)
ld hl, SilphCoMapList
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
ld b, a
.silphCoMapListLoop
ld a, [hli]
@@ -15,7 +15,7 @@
cp $24
jr z, .cardKeyDoorInFrontOfPlayer
ld b, a
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp SILPH_CO_11F
ret nz
ld a, b
@@ -39,7 +39,7 @@
ld a, e
ld c, a
ld [wCardKeyDoorX], a
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp SILPH_CO_11F
jr nz, .notSilphCo11F
ld a, $3
@@ -84,9 +84,9 @@
; d = Y
; e = X
GetCoordsInFrontOfPlayer: ; 526fd (14:66fd)
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
ld d, a
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
ld e, a
ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
and a
--- a/engine/overworld/cinnabar_lab.asm
+++ b/engine/overworld/cinnabar_lab.asm
@@ -48,9 +48,9 @@
.choseDomeFossil
ld b, KABUTO
.fossilSelected
- ld [W_FOSSILITEM], a
+ ld [wFossilItem], a
ld a, b
- ld [W_FOSSILMON], a
+ ld [wFossilMon], a
call LoadFossilItemAndMonName
ld hl, LabFossil_610ae
call PrintText
@@ -60,7 +60,7 @@
jr nz, .cancelledGivingFossil
ld hl, LabFossil_610b3
call PrintText
- ld a, [W_FOSSILITEM]
+ ld a, [wFossilItem]
ld [hItemToRemoveID], a
callba RemoveItemByID
ld hl, LabFossil_610b8
@@ -113,11 +113,11 @@
; loads the names of the fossil item and the resulting mon
LoadFossilItemAndMonName: ; 610eb (18:50eb)
- ld a, [W_FOSSILMON]
+ ld a, [wFossilMon]
ld [wd11e], a
call GetMonName
call CopyStringToCF4B
- ld a, [W_FOSSILITEM]
+ ld a, [wFossilItem]
ld [wd11e], a
call GetItemName
ret
--- a/engine/overworld/cut.asm
+++ b/engine/overworld/cut.asm
@@ -1,7 +1,7 @@
UsedCut: ; ef54 (3:6f54)
xor a
ld [wActionResultOrTookBattleTurn], a ; initialise to failure value
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
and a ; OVERWORLD
jr z, .overworld
cp GYM
@@ -177,7 +177,7 @@
; player (i.e. where the tree is) and replace it with the corresponding tile
; block that doesn't have the tree.
push de
- ld a, [W_CURMAPWIDTH]
+ ld a, [wCurMapWidth]
add 6
ld c, a
ld b, 0
@@ -195,22 +195,22 @@
cp SPRITE_FACING_LEFT
jr z, .left
; right
- ld a, [W_XBLOCKCOORD]
+ ld a, [wXBlockCoord]
and a
jr z, .centerTileBlock
jr .rightOfCenter
.down
- ld a, [W_YBLOCKCOORD]
+ ld a, [wYBlockCoord]
and a
jr z, .centerTileBlock
jr .belowCenter
.up
- ld a, [W_YBLOCKCOORD]
+ ld a, [wYBlockCoord]
and a
jr z, .aboveCenter
jr .centerTileBlock
.left
- ld a, [W_XBLOCKCOORD]
+ ld a, [wXBlockCoord]
and a
jr z, .leftOfCenter
jr .centerTileBlock
--- a/engine/overworld/doors.asm
+++ b/engine/overworld/doors.asm
@@ -2,7 +2,7 @@
IsPlayerStandingOnDoorTile: ; 1a609 (6:6609)
push de
ld hl, DoorTileIDPointers
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
ld de, $3
call IsInArray
pop de
--- a/engine/overworld/hidden_items.asm
+++ b/engine/overworld/hidden_items.asm
@@ -135,7 +135,7 @@
ld d, a
ld a, [wHiddenObjectX]
ld e, a
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
ld b, a
ld c, -1
.loop
--- a/engine/overworld/hidden_objects.asm
+++ b/engine/overworld/hidden_objects.asm
@@ -29,7 +29,7 @@
ld b, a
cp $ff
jr z, .noMatch
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp b
jr z, .foundMatchingMap
inc de
@@ -95,30 +95,30 @@
cp SPRITE_FACING_RIGHT
jr z, .facingRight
; facing down
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
inc a
jr .upDownCommon
.facingUp
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
dec a
.upDownCommon
cp b
jr nz, .didNotMatch
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp c
jr nz, .didNotMatch
jr .matched
.facingLeft
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
dec a
jr .leftRightCommon
.facingRight
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
inc a
.leftRightCommon
cp c
jr nz, .didNotMatch
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp b
jr nz, .didNotMatch
.matched
--- a/engine/overworld/is_player_just_outside_map.asm
+++ b/engine/overworld/is_player_just_outside_map.asm
@@ -1,13 +1,13 @@
; returns whether the player is one tile outside the map in Z
IsPlayerJustOutsideMap: ; 128d8 (4:68d8)
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
ld b, a
- ld a, [W_CURMAPHEIGHT]
+ ld a, [wCurMapHeight]
call .compareCoordWithMapDimension
ret z
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
ld b, a
- ld a, [W_CURMAPWIDTH]
+ ld a, [wCurMapWidth]
.compareCoordWithMapDimension
add a
cp b
--- a/engine/overworld/item.asm
+++ b/engine/overworld/item.asm
@@ -3,7 +3,7 @@
ld a, [hSpriteIndexOrTextID]
ld b, a
- ld hl, W_MISSABLEOBJECTLIST
+ ld hl, wMissableObjectList
.missableObjectsListLoop
ld a, [hli]
cp $ff
@@ -17,7 +17,7 @@
ld a, [hl]
ld [$ffdb], a
- ld hl, W_MAPSPRITEEXTRADATA
+ ld hl, wMapSpriteExtraData
ld a, [hSpriteIndexOrTextID]
dec a
add a
--- a/engine/overworld/ledges.asm
+++ b/engine/overworld/ledges.asm
@@ -2,7 +2,7 @@
ld a, [wd736]
bit 6, a ; already jumping down ledge
ret nz
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
and a ; OVERWORLD
ret nz
predef GetTileAndCoordsInFrontOfPlayer
--- a/engine/overworld/map_sprites.asm
+++ b/engine/overworld/map_sprites.asm
@@ -30,12 +30,12 @@
; InitOutsideMapSprites.
; Loads tile pattern data for sprites into VRAM.
LoadMapSpriteTilePatterns: ; 17871 (5:7871)
- ld a,[W_NUMSPRITES]
+ ld a,[wNumSprites]
and a ; are there any sprites?
jr nz,.spritesExist
ret
.spritesExist
- ld c,a ; c = [W_NUMSPRITES]
+ ld c,a ; c = [wNumSprites]
ld b,$10 ; number of sprite slots
ld hl,wSpriteStateData2 + $0d
xor a
@@ -251,7 +251,7 @@
; Loads sprite set for outside maps (cities and routes) and sets VRAM slots.
; sets carry if the map is a city or route, unsets carry if not
InitOutsideMapSprites: ; 1797b (5:797b)
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
cp a,REDS_HOUSE_1F ; is the map a city or a route (map ID less than $25)?
ret nc ; if not, return
ld hl,MapSpriteSets
@@ -267,12 +267,12 @@
ld a,[wFontLoaded]
bit 0,a ; reloading upper half of tile patterns after displaying text?
jr nz,.loadSpriteSet ; if so, forcibly reload the sprite set
- ld a,[W_SPRITESETID]
+ ld a,[wSpriteSetID]
cp b ; has the sprite set ID changed?
jr z,.skipLoadingSpriteSet ; if not, don't load it again
.loadSpriteSet
ld a,b
- ld [W_SPRITESETID],a
+ ld [wSpriteSetID],a
dec a
ld b,a
sla a
@@ -291,7 +291,7 @@
ld hl,wSpriteStateData2 + $0d
ld a,SPRITE_RED
ld [hl],a
- ld bc,W_SPRITESET
+ ld bc,wSpriteSet
; Load the sprite set into RAM.
; This loop also fills $C2XD (sprite picture ID) where X is from $0 to $A
; with picture ID's. This is done so that LoadMapSpriteTilePatterns will
@@ -317,13 +317,13 @@
ld [hl],a ; $C2XD (sprite picture ID)
dec b
jr nz,.zeroRemainingSlotsLoop
- ld a,[W_NUMSPRITES]
+ ld a,[wNumSprites]
push af ; save number of sprites
ld a,11 ; 11 sprites in sprite set
- ld [W_NUMSPRITES],a
+ ld [wNumSprites],a
call LoadMapSpriteTilePatterns
pop af
- ld [W_NUMSPRITES],a ; restore number of sprites
+ ld [wNumSprites],a ; restore number of sprites
ld hl,wSpriteStateData2 + $1e
ld b,$0f
; The VRAM tile pattern slots that LoadMapSpriteTilePatterns set are in the
@@ -352,7 +352,7 @@
and a ; is the sprite slot used?
jr z,.skipGettingPictureIndex ; if the sprite slot is not used
ld b,a ; b = picture ID
- ld de,W_SPRITESET
+ ld de,wSpriteSet
; Loop to find the index of the sprite's picture ID within the sprite set.
.getPictureIndexLoop
inc c
@@ -399,10 +399,10 @@
ld b,a
jr z,.eastWestDivide
.northSouthDivide
- ld a,[W_YCOORD]
+ ld a,[wYCoord]
jr .compareCoord
.eastWestDivide
- ld a,[W_XCOORD]
+ ld a,[wXCoord]
.compareCoord
cp b
jr c,.loadSpriteSetID
@@ -415,7 +415,7 @@
; Route 20 is a special case because the two map sections have a more complex
; shape instead of the map simply being split horizontally or vertically.
.route20
- ld hl,W_XCOORD
+ ld hl,wXCoord
ld a,[hl]
cp a,$2b
ld a,$01
@@ -430,7 +430,7 @@
jr nc,.next
ld b,$0d
.next
- ld a,[W_YCOORD]
+ ld a,[wYCoord]
cp b
ld a,$0a
ret c
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -89,7 +89,7 @@
; bit set by later logic.
ld a, [hTilePlayerStandingOn]
ld c, a
- ld a, [W_GRASSTILE]
+ ld a, [wGrassTile]
cp c
ld a, $0
jr nz, .next2
@@ -114,7 +114,7 @@
swap a
dec a
add a
- ld hl, W_MAPSPRITEDATA
+ ld hl, wMapSpriteData
add l
ld l, a
ld a, [hl] ; read movement byte 2
@@ -453,7 +453,7 @@
ld a, [H_CURRENTSPRITEOFFSET]
add $4
ld l, a
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
ld b, a
ld a, [hl] ; c2x4 (Y position + 4)
sub b ; relative to player position
@@ -462,7 +462,7 @@
dec h
ld [hli], a ; c1x4 (screen Y position)
inc h
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
ld b, a
ld a, [hli] ; c2x6 (X position + 4)
sub b ; relative to player position
@@ -488,7 +488,7 @@
add $4
ld l, a
ld b, [hl] ; c2x4: Y pos (+4)
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp b
jr z, .skipYVisibilityTest
jr nc, .spriteInvisible ; above screen region
@@ -498,7 +498,7 @@
.skipYVisibilityTest
inc l
ld b, [hl] ; c2x5: X pos (+4)
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp b
jr z, .skipXVisibilityTest
jr nc, .spriteInvisible ; left of screen region
@@ -542,7 +542,7 @@
ld a, [H_CURRENTSPRITEOFFSET]
add $7
ld l, a
- ld a, [W_GRASSTILE]
+ ld a, [wGrassTile]
cp c
ld a, $0
jr nz, .notInGrass
@@ -590,9 +590,9 @@
and a
ret
.notScripted
- ld a, [W_TILESETCOLLISIONPTR]
+ ld a, [wTileSetCollisionPtr]
ld l, a
- ld a, [W_TILESETCOLLISIONPTR+1]
+ ld a, [wTileSetCollisionPtr+1]
ld h, a
.tilePassableLoop
ld a, [hli]
--- a/engine/overworld/npc_movement.asm
+++ b/engine/overworld/npc_movement.asm
@@ -52,7 +52,7 @@
dw PalletMovementScript_Done
PalletMovementScript_OakMoveLeft: ; 1a44c (6:644c)
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
sub $a
ld [wNumStepsToTake], a
jr z, .playerOnLeftTile
@@ -79,7 +79,7 @@
ld a, $3
ld [wNPCMovementScriptFunctionNum], a
.done
- ld hl, W_FLAGS_D733
+ ld hl, wFlags_D733
set 1, [hl]
ld a, $fc
ld [wJoyIgnore], a
@@ -267,7 +267,7 @@
db $FF
FreezeEnemyTrainerSprite: ; 1a5e7 (6:65e7)
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp POKEMONTOWER_7
ret z ; the Rockets on Pokemon Tower 7F leave after battling, so don't freeze them
ld hl, RivalIDs
--- a/engine/overworld/pewter_guys.asm
+++ b/engine/overworld/pewter_guys.asm
@@ -17,9 +17,9 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
ld b, a
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
ld c, a
.findMatchingCoordsLoop
ld a, [hli]
--- a/engine/overworld/player_animations.asm
+++ b/engine/overworld/player_animations.asm
@@ -5,7 +5,7 @@
call Delay3
push hl
call GBFadeInFromWhite
- ld hl, W_FLAGS_D733
+ ld hl, wFlags_D733
bit 7, [hl] ; used fly out of battle?
res 7, [hl]
jr nz, .flyAnimation
@@ -350,7 +350,7 @@
IsPlayerStandingOnWarpPadOrHole: ; 70787 (1c:4787)
ld b, 0
ld hl, .warpPadAndHoleData
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
ld c, a
.loop
ld a, [hli]
--- a/engine/overworld/trainers.asm
+++ b/engine/overworld/trainers.asm
@@ -291,7 +291,7 @@
; tests if the player is in front of the sprite (rather than behind it)
CheckPlayerIsInFrontOfSprite: ; 569e3 (15:69e3)
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp POWER_PLANT
jp z, .engage ; bypass this for power plant to get voltorb fake items to work
ld a, [wTrainerSpriteOffset]
--- a/engine/palettes.asm
+++ b/engine/palettes.asm
@@ -30,11 +30,11 @@
ld de, wPalPacket
ld bc, $10
call CopyData
- ld a, [W_PLAYERBATTSTATUS3]
+ ld a, [wPlayerBattleStatus3]
ld hl, wBattleMonSpecies
call DeterminePaletteID
ld b, a
- ld a, [W_ENEMYBATTSTATUS3]
+ ld a, [wEnemyBattleStatus3]
ld hl, wEnemyMonSpecies2
call DeterminePaletteID
ld c, a
@@ -139,12 +139,12 @@
ld de, wPalPacket
ld bc, $10
call CopyData
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
cp CEMETERY
jr z, .PokemonTowerOrAgatha
cp CAVERN
jr z, .caveOrBruno
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp REDS_HOUSE_1F
jr c, .townOrRoute
cp UNKNOWN_DUNGEON_2
@@ -207,7 +207,7 @@
call CopyData
ld de, BadgeBlkDataLengths
ld hl, wTrainerCardBlkPacket + 2
- ld a, [W_OBTAINEDBADGES]
+ ld a, [wObtainedBadges]
ld c, 8
.badgeLoop
srl a
--- a/engine/play_time.asm
+++ b/engine/play_time.asm
@@ -3,37 +3,37 @@
ld a, [wd732]
bit 0, a
ret z
- ld a, [W_PLAYTIMEMINUTES]
+ ld a, [wPlayTimeMinutes]
and a
ret nz
- ld a, [W_PLAYTIMEFRAMES]
+ ld a, [wPlayTimeFrames]
inc a
- ld [W_PLAYTIMEFRAMES], a
+ ld [wPlayTimeFrames], a
cp 60
ret nz
xor a
- ld [W_PLAYTIMEFRAMES], a
- ld a, [W_PLAYTIMESECONDS]
+ ld [wPlayTimeFrames], a
+ ld a, [wPlayTimeSeconds]
inc a
- ld [W_PLAYTIMESECONDS], a
+ ld [wPlayTimeSeconds], a
cp 60
ret nz
xor a
- ld [W_PLAYTIMESECONDS], a
- ld a, [W_PLAYTIMEMINUTES + 1]
+ ld [wPlayTimeSeconds], a
+ ld a, [wPlayTimeMinutes + 1]
inc a
- ld [W_PLAYTIMEMINUTES + 1], a
+ ld [wPlayTimeMinutes + 1], a
cp 60
ret nz
xor a
- ld [W_PLAYTIMEMINUTES + 1], a
- ld a, [W_PLAYTIMEHOURS + 1]
+ ld [wPlayTimeMinutes + 1], a
+ ld a, [wPlayTimeHours + 1]
inc a
- ld [W_PLAYTIMEHOURS + 1], a
+ ld [wPlayTimeHours + 1], a
cp $ff
ret nz
ld a, $ff
- ld [W_PLAYTIMEMINUTES], a
+ ld [wPlayTimeMinutes], a
ret
CountDownIgnoreInputBitReset: ; 18e36 (6:4e36)
--- a/engine/predefs17_2.asm
+++ b/engine/predefs17_2.asm
@@ -8,8 +8,8 @@
push hl
call GetMonHeader
pop hl
- ld a, [W_MONHTYPE1]
+ ld a, [wMonHType1]
ld [hli], a
- ld a, [W_MONHTYPE2]
+ ld a, [wMonHType2]
ld [hl], a
ret
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -63,7 +63,7 @@
ld de, wMainDataStart
ld bc, wMainDataEnd - wMainDataStart
call CopyData
- ld hl, W_CURMAPTILESET
+ ld hl, wCurMapTileset
set 7, [hl]
ld hl, sSpriteData
ld de, wSpriteDataStart
@@ -369,7 +369,7 @@
call GetBoxSRAMLocation
ld de, wBoxDataStart
call CopyBoxToOrFromSRAM ; copy new box from SRAM to WRAM
- ld hl, W_MAPTEXTPTR
+ ld hl, wMapTextPtr
ld de, wChangeBoxSavedMapTextPointer
ld a, [hli]
ld [de], a
@@ -580,7 +580,7 @@
ld c, a
ld b, 0
add hl, bc
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
ld [hl], a
ret
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -758,7 +758,7 @@
ld de, wSlotMachineWheel1Offset
ld hl, wOAMBuffer
ld a, $30
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
jr SlotMachine_AnimWheel
SlotMachine_AnimWheel2: ; 37823 (d:7823)
@@ -766,7 +766,7 @@
ld de, wSlotMachineWheel2Offset
ld hl, wOAMBuffer + $30
ld a, $50
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
jr SlotMachine_AnimWheel
SlotMachine_AnimWheel3: ; 37833 (d:7833)
@@ -774,11 +774,11 @@
ld de, wSlotMachineWheel3Offset
ld hl, wOAMBuffer + $60
ld a, $70
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
SlotMachine_AnimWheel: ; 37841 (d:7841)
ld a, $58
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
push de
ld a, [de]
ld d, b
@@ -787,17 +787,17 @@
jr nc, .loop
inc d
.loop
- ld a, [W_BASECOORDY]
+ ld a, [wBaseCoordY]
ld [hli], a
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
ld [hli], a
ld a, [de]
ld [hli], a
ld a, $80
ld [hli], a
- ld a, [W_BASECOORDY]
+ ld a, [wBaseCoordY]
ld [hli], a
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
add $8
ld [hli], a
ld a, [de]
@@ -806,9 +806,9 @@
ld a, $80
ld [hli], a
inc de
- ld a, [W_BASECOORDY]
+ ld a, [wBaseCoordY]
sub $8
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
cp $28
jr nz, .loop
pop de
--- a/engine/titlescreen.asm
+++ b/engine/titlescreen.asm
@@ -8,7 +8,7 @@
ld de, wPlayerName
call CopyFixedLengthText
ld hl, SonyText
- ld de, W_RIVALNAME
+ ld de, wRivalName
call CopyFixedLengthText
xor a
ld [hWY], a
--- a/engine/town_map.asm
+++ b/engine/town_map.asm
@@ -7,7 +7,7 @@
push hl
ld a, $1
ld [hJoy7], a
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
push af
ld b, $0
call DrawPlayerOrBirdSprite ; player sprite
@@ -156,7 +156,7 @@
coord hl, 0, 0
ld de, ToText
call PlaceString
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
ld b, $0
call DrawPlayerOrBirdSprite
ld hl, wFlyLocationsList
@@ -250,9 +250,9 @@
ld hl, wFlyLocationsList - 1
ld [hl], $ff
inc hl
- ld a, [W_TOWNVISITEDFLAG]
+ ld a, [wTownVisitedFlag]
ld e, a
- ld a, [W_TOWNVISITEDFLAG + 1]
+ ld a, [wTownVisitedFlag + 1]
ld d, a
ld bc, SAFFRON_CITY + 1
.loop
@@ -405,7 +405,7 @@
call PlaceString
jr .done
.drawPlayerSprite
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
ld b, $0
call DrawPlayerOrBirdSprite
.done
--- a/engine/trade.asm
+++ b/engine/trade.asm
@@ -18,7 +18,7 @@
ld de, ExternalClockTradeFuncSequence
TradeAnimCommon: ; 41102 (10:5102)
- ld a, [W_OPTIONS]
+ ld a, [wOptions]
push af
ld a, [hSCY]
push af
@@ -25,7 +25,7 @@
ld a, [hSCX]
push af
xor a
- ld [W_OPTIONS], a
+ ld [wOptions], a
ld [hSCY], a
ld [hSCX], a
push de
@@ -53,7 +53,7 @@
pop af
ld [hSCY], a
pop af
- ld [W_OPTIONS], a
+ ld [wOptions], a
ret
addtradefunc: MACRO
@@ -383,9 +383,9 @@
ld a, $e4
ld [rOBP0], a
ld a, $54
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
ld a, $1c
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
ld a, [wLeftGBMonSpecies]
ld [wMonPartySpriteSpecies], a
call Trade_WriteCircledMonOAM
@@ -415,9 +415,9 @@
xor a
ld [wTradedMonMovingRight], a
ld a, $64
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
ld a, $44
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
ld a, [wRightGBMonSpecies]
ld [wMonPartySpriteSpecies], a
call Trade_WriteCircledMonOAM
@@ -622,10 +622,10 @@
ld hl, wOAMBuffer
ld c, $14
.loop
- ld a, [W_BASECOORDY]
+ ld a, [wBaseCoordY]
add [hl]
ld [hli], a
- ld a, [W_BASECOORDX]
+ ld a, [wBaseCoordX]
add [hl]
ld [hli], a
inc hl
@@ -657,9 +657,9 @@
lb bc, -4, 0 ; move left
.doAnim
ld a, b
- ld [W_BASECOORDX], a
+ ld [wBaseCoordX], a
ld a, c
- ld [W_BASECOORDY], a
+ ld [wBaseCoordY], a
ld d, $4
.loop
call Trade_AddOffsetsToOAMCoords
@@ -847,7 +847,7 @@
db "@"
Trade_ShowAnimation: ; 41676 (10:5676)
- ld [W_ANIMATIONID], a
+ ld [wAnimationID], a
xor a
ld [wAnimationType], a
predef_jump MoveAnimation
--- a/home.asm
+++ b/home.asm
@@ -240,7 +240,7 @@
; loads pokemon data from one of multiple sources to wLoadedMon
-; loads base stats to W_MONHEADER
+; loads base stats to wMonHeader
; INPUT:
; [wWhichPokemon] = index of pokemon within party/box
; [wMonDataLocation] = source
@@ -251,7 +251,7 @@
; OUTPUT:
; [wcf91] = pokemon ID
; wLoadedMon = base address of pokemon data
-; W_MONHEADER = base address of base stats
+; wMonHeader = base address of base stats
LoadMonData:: ; 1372 (0:1372)
jpab LoadMonData_
@@ -268,7 +268,7 @@
LoadFlippedFrontSpriteByMonIndex:: ; 1384 (0:1384)
ld a, 1
- ld [W_SPRITEFLIPPED], a
+ ld [wSpriteFlipped], a
LoadFrontSpriteByMonIndex:: ; 1389 (0:1389)
push hl
@@ -304,7 +304,7 @@
ld [hStartTileID], a
call CopyUncompressedPicToHL
xor a
- ld [W_SPRITEFLIPPED], a
+ ld [wSpriteFlipped], a
pop af
ld [H_LOADEDROMBANK], a
ld [MBC1RomBank], a
@@ -551,7 +551,7 @@
ld a,[hl]
ret
-; copies the base stat data of a pokemon to W_MONHEADER
+; copies the base stat data of a pokemon to wMonHeader
; INPUT:
; [wd0b5] = pokemon ID
GetMonHeader:: ; 1537 (0:1537)
@@ -586,12 +586,12 @@
ld bc,MonBaseStatsEnd - MonBaseStats
ld hl,BaseStats
call AddNTimes
- ld de,W_MONHEADER
+ ld de,wMonHeader
ld bc,MonBaseStatsEnd - MonBaseStats
call CopyData
jr .done
.specialID
- ld hl,W_MONHSPRITEDIM
+ ld hl,wMonHSpriteDim
ld [hl],b ; write sprite dimensions
inc hl
ld [hl],e ; write front sprite pointer
@@ -600,13 +600,13 @@
jr .done
.mew
ld hl,MewBaseStats
- ld de,W_MONHEADER
+ ld de,wMonHeader
ld bc,MonBaseStatsEnd - MonBaseStats
ld a,BANK(MewBaseStats)
call FarCopyData
.done
ld a,[wd0b5]
- ld [W_MONHINDEX],a
+ ld [wMonHIndex],a
pop af
ld [wd11e],a
pop hl
@@ -718,12 +718,12 @@
; assumes the corresponding mon header is already loaded
; hl contains offset to sprite pointer ($b for front or $d for back)
UncompressMonSprite:: ; 1627 (0:1627)
- ld bc,W_MONHEADER
+ ld bc,wMonHeader
add hl,bc
ld a,[hli]
- ld [W_SPRITEINPUTPTR],a ; fetch sprite input pointer
+ ld [wSpriteInputPtr],a ; fetch sprite input pointer
ld a,[hl]
- ld [W_SPRITEINPUTPTR+1],a
+ ld [wSpriteInputPtr+1],a
; define (by index number) the bank that a pokemon's image is in
; index = Mew, bank 1
; index = Kabutops fossil, bank $B
@@ -764,9 +764,9 @@
; de: destination location
LoadMonFrontSprite:: ; 1665 (0:1665)
push de
- ld hl, W_MONHFRONTSPRITE - W_MONHEADER
+ ld hl, wMonHFrontSprite - wMonHeader
call UncompressMonSprite
- ld hl, W_MONHSPRITEDIM
+ ld hl, wMonHSpriteDim
ld a, [hli]
ld c, a
pop de
@@ -891,7 +891,7 @@
dec a
ld [H_SPRITEINTERLACECOUNTER], a
jr nz, .interlaceLoop
- ld a, [W_SPRITEFLIPPED]
+ ld a, [wSpriteFlipped]
and a
jr z, .notFlipped
ld bc, 2*SPRITEBUFFERSIZE
@@ -1057,12 +1057,12 @@
bit 0,[hl]
res 0,[hl]
jr nz,.skipSwitchToMapBank
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
call SwitchToMapRomBank
.skipSwitchToMapBank
ld a,30 ; half a second
ld [H_FRAMECOUNTER],a ; used as joypad poll timer
- ld hl,W_MAPTEXTPTR
+ ld hl,wMapTextPtr
ld a,[hli]
ld h,[hl]
ld l,a ; hl = map text pointer
@@ -1079,7 +1079,7 @@
jp z,DisplayPlayerBlackedOutText
cp a,TEXT_REPEL_WORE_OFF
jp z,DisplayRepelWoreOffText
- ld a,[W_NUMSPRITES]
+ ld a,[wNumSprites]
ld e,a
ld a,[hSpriteIndexOrTextID] ; sprite ID
cp e
@@ -1093,7 +1093,7 @@
callba UpdateSpriteFacingOffsetAndDelayMovement ; update the graphics of the sprite the player is talking to (to face the right direction)
pop bc
pop de
- ld hl,W_MAPSPRITEDATA ; NPC text entries
+ ld hl,wMapSpriteData ; NPC text entries
ld a,[hSpriteIndexOrTextID]
dec a
add a
@@ -1157,7 +1157,7 @@
jr nz,HoldTextDisplayOpen
CloseTextDisplay:: ; 29e8 (0:29e8)
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
call SwitchToMapRomBank
ld a,$90
ld [hWY],a ; move the window off the screen
@@ -1376,7 +1376,7 @@
ld [H_AUTOBGTRANSFERENABLED],a ; disable auto-transfer
ld a,1
ld [hJoy7],a ; joypad state update flag
- ld a,[W_BATTLETYPE]
+ ld a,[wBattleType]
and a ; is it the Old Man battle?
jr nz,.specialBattleType
ld a,$01 ; hardcoded bank
@@ -1432,7 +1432,7 @@
ld a,1
ld [H_AUTOBGTRANSFERENABLED],a ; enable transfer
call Delay3
- ld a,[W_BATTLETYPE]
+ ld a,[wBattleType]
and a ; is it the Old Man battle?
jr z,.notOldManBattle
.oldManBattle
@@ -2043,7 +2043,7 @@
ReloadMapData:: ; 3071 (0:3071)
ld a,[H_LOADEDROMBANK]
push af
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
call SwitchToMapRomBank
call DisableLCD
call LoadTextBoxTilePatterns
@@ -2059,7 +2059,7 @@
ReloadTilesetTilePatterns:: ; 3090 (0:3090)
ld a,[H_LOADEDROMBANK]
push af
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
call SwitchToMapRomBank
call DisableLCD
call LoadTilesetTilePatternData
@@ -2202,12 +2202,12 @@
EmptyFunc2:: ; 3156 (0:3156)
ret
-; stores hl in [W_TRAINERHEADERPTR]
+; stores hl in [wTrainerHeaderPtr]
StoreTrainerHeaderPointer:: ; 3157 (0:3157)
ld a, h
- ld [W_TRAINERHEADERPTR], a
+ ld [wTrainerHeaderPtr], a
ld a, l
- ld [W_TRAINERHEADERPTR+1], a
+ ld [wTrainerHeaderPtr+1], a
ret
; executes the current map script from the function pointer array provided in hl.
@@ -2219,16 +2219,16 @@
pop hl
pop af
push hl
- ld hl, W_FLAGS_D733
+ ld hl, wFlags_D733
bit 4, [hl]
res 4, [hl]
jr z, .useProvidedIndex ; test if map script index was overridden manually
- ld a, [W_CURMAPSCRIPT]
+ ld a, [wCurMapScript]
.useProvidedIndex
pop hl
- ld [W_CURMAPSCRIPT], a
+ ld [wCurMapScript], a
call CallFunctionInTable
- ld a, [W_CURMAPSCRIPT]
+ ld a, [wCurMapScript]
ret
LoadGymLeaderAndCityName:: ; 317f (0:317f)
@@ -2241,7 +2241,7 @@
ld bc, NAME_LENGTH
jp CopyData ; load gym leader name
-; reads specific information from trainer header (pointed to at W_TRAINERHEADERPTR)
+; reads specific information from trainer header (pointed to at wTrainerHeaderPtr)
; a: offset in header data
; 0 -> flag's bit (into wTrainerHeaderFlagBit)
; 2 -> flag's byte ptr (into hl)
@@ -2253,7 +2253,7 @@
push af
ld d, $0
ld e, a
- ld hl, W_TRAINERHEADERPTR
+ ld hl, wTrainerHeaderPtr
ld a, [hli]
ld l, [hl]
ld h, a
@@ -2317,7 +2317,7 @@
call ReadTrainerHeaderInfo ; read end battle text
pop de
call SaveEndBattleTextPointers
- ld hl, W_FLAGS_D733
+ ld hl, wFlags_D733
set 4, [hl] ; activate map script index override (index is set below)
ld hl, wFlags_0xcd60
bit 0, [hl] ; test if player is already engaging the trainer (because the trainer saw the player)
@@ -2324,7 +2324,7 @@
ret nz
; if the player talked to the trainer of his own volition
call EngageMapTrainer
- ld hl, W_CURMAPSCRIPT
+ ld hl, wCurMapScript
inc [hl] ; increment map script index before StartTrainerBattle increments it again (next script function is usually EndTrainerBattle)
jp StartTrainerBattle
@@ -2339,7 +2339,7 @@
ld [wTrainerHeaderFlagBit], a
ret
.trainerEngaging
- ld hl, W_FLAGS_D733
+ ld hl, wFlags_D733
set 3, [hl]
ld [wEmotionBubbleSpriteIndex], a
xor a ; EXCLAMATION_BUBBLE
@@ -2350,7 +2350,7 @@
xor a
ld [hJoyHeld], a
call TrainerWalkUpToPlayer_Bank0
- ld hl, W_CURMAPSCRIPT
+ ld hl, wCurMapScript
inc [hl] ; increment map script index (next script function is usually DisplayEnemyTrainerTextAndStartBattle)
ret
@@ -2374,7 +2374,7 @@
set 7, [hl]
ld hl, wd72e
set 1, [hl]
- ld hl, W_CURMAPSCRIPT
+ ld hl, wCurMapScript
inc [hl] ; increment map script index (next script function is usually EndTrainerBattle)
ret
@@ -2386,7 +2386,7 @@
res 7, [hl]
ld hl, wFlags_0xcd60
res 0, [hl] ; player is no longer engaged by any trainer
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, ResetButtonPressedAndMapScript
ld a, $2
@@ -2395,10 +2395,10 @@
ld c, a
ld b, FLAG_SET
call TrainerFlagAction ; flag trainer as fought
- ld a, [W_ENEMYMONORTRAINERCLASS]
+ ld a, [wEnemyMonOrTrainerClass]
cp 200
jr nc, .skipRemoveSprite ; test if trainer was fought (in that case skip removing the corresponding sprite)
- ld hl, W_MISSABLEOBJECTLIST
+ ld hl, wMissableObjectList
ld de, $2
ld a, [wSpriteIndex]
call IsInArray ; search for sprite ID
@@ -2418,7 +2418,7 @@
ld [hJoyHeld], a
ld [hJoyPressed], a
ld [hJoyReleased], a
- ld [W_CURMAPSCRIPT], a ; reset battle status
+ ld [wCurMapScript], a ; reset battle status
ret
; calls TrainerWalkUpToPlayer
@@ -2428,15 +2428,15 @@
; sets opponent type and mon set/lvl based on the engaging trainer data
InitBattleEnemyParameters:: ; 32d7 (0:32d7)
ld a, [wEngagedTrainerClass]
- ld [W_CUROPPONENT], a
- ld [W_ENEMYMONORTRAINERCLASS], a
+ ld [wCurOpponent], a
+ ld [wEnemyMonOrTrainerClass], a
cp 200
ld a, [wEngagedTrainerSet]
jr c, .noTrainer
- ld [W_TRAINERNO], a
+ ld [wTrainerNo], a
ret
.noTrainer
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
ret
GetSpritePosition1:: ; 32ef (0:32ef)
@@ -2521,7 +2521,7 @@
; loads data of some trainer on the current map and plays pre-battle music
; [wSpriteIndex]: sprite ID of trainer who is engaged
EngageMapTrainer:: ; 336a (0:336a)
- ld hl, W_MAPSPRITEEXTRADATA
+ ld hl, wMapSpriteExtraData
ld d, $0
ld a, [wSpriteIndex]
dec a
@@ -2600,7 +2600,7 @@
ret z
cp OPP_SONY3
ret z
- ld a, [W_GYMLEADERNO]
+ ld a, [wGymLeaderNo]
and a
ret nz
xor a
@@ -2741,9 +2741,9 @@
; [wCoordIndex] = if there is match, the matching array index
; sets carry if the coordinates are in the array, clears carry if not
ArePlayerCoordsInArray:: ; 34bf (0:34bf)
- ld a,[W_YCOORD]
+ ld a,[wYCoord]
ld b,a
- ld a,[W_XCOORD]
+ ld a,[wXCoord]
ld c,a
; fallthrough
@@ -2878,7 +2878,7 @@
; returns the sprite movement byte 2 pointer for sprite [H_SPRITEINDEX] in hl
GetSpriteMovementByte2Pointer:: ; 3558 (0:3558)
push de
- ld hl,W_MAPSPRITEDATA
+ ld hl,wMapSpriteData
ld a,[H_SPRITEINDEX]
dec a
add a
@@ -2895,7 +2895,7 @@
jr nz, .linkBattle
ld a, Bank(TrainerPicAndMoneyPointers)
call BankswitchHome
- ld a, [W_TRAINERCLASS]
+ ld a, [wTrainerClass]
dec a
ld hl, TrainerPicAndMoneyPointers
ld bc, $5
@@ -3151,7 +3151,7 @@
UncompressSpriteFromDE:: ; 36eb (0:36eb)
; Decompress pic at a:de.
- ld hl, W_SPRITEINPUTPTR
+ ld hl, wSpriteInputPtr
ld [hl], e
inc hl
ld [hl], d
@@ -3537,7 +3537,7 @@
ld a,[wLetterPrintingDelayFlags]
bit 0,a
jr z,.waitOneFrame
- ld a,[W_OPTIONS]
+ ld a,[wOptions]
and $f
ld [H_FRAMECOUNTER],a
jr .checkButtons
@@ -3627,7 +3627,7 @@
ld a, b
ld d, a
push hl
- ld hl, W_MONHEADER
+ ld hl, wMonHeader
ld b, $0
add hl, bc
ld a, [hl] ; read base value of stat
@@ -3741,7 +3741,7 @@
ld [H_MULTIPLICAND+1], a
xor a
ld [H_MULTIPLICAND], a
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
ld [H_MULTIPLIER], a
call Multiply ; ((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level
ld a, [H_MULTIPLICAND]
@@ -3759,7 +3759,7 @@
cp $1
ld a, 5 ; + 5 for non-HP stat
jr nz, .notHPStat
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
ld b, a
ld a, [H_MULTIPLICAND+2]
add b
@@ -4531,7 +4531,7 @@
res 0, [hl]
push hl
xor a
- ld [W_SPRITESETID], a
+ ld [wSpriteSetID], a
call DisableLCD
callba InitMapSprites
call EnableLCD
@@ -4565,7 +4565,7 @@
ld a, b
ld [wcf91], a
ld a, c
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
xor a ; PLAYER_PARTY_DATA
ld [wMonDataLocation], a
jpba _GivePokemon
@@ -4637,7 +4637,7 @@
call DisplayTextID
RestoreMapTextPointer:: ; 3f05 (0:3f05)
- ld hl, W_MAPTEXTPTR
+ ld hl, wMapTextPtr
ld a, [$ffec]
ld [hli], a
ld a, [$ffec + 1]
@@ -4645,14 +4645,14 @@
ret
SetMapTextPointer:: ; 3f0f (0:3f0f)
- ld a, [W_MAPTEXTPTR]
+ ld a, [wMapTextPtr]
ld [$ffec], a
- ld a, [W_MAPTEXTPTR + 1]
+ ld a, [wMapTextPtr + 1]
ld [$ffec + 1], a
ld a, l
- ld [W_MAPTEXTPTR], a
+ ld [wMapTextPtr], a
ld a, h
- ld [W_MAPTEXTPTR + 1], a
+ ld [wMapTextPtr + 1], a
ret
TextPredefs::
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -61,7 +61,7 @@
ld a,[wd732]
and a,1 << 4 | 1 << 3 ; fly warp or dungeon warp
jp nz,HandleFlyWarpOrDungeonWarp
- ld a,[W_CUROPPONENT]
+ ld a,[wCurOpponent]
and a
jp nz,.newBattle
ld a,[wd730]
@@ -115,17 +115,17 @@
jr z,.changeMap
; XXX can this code be reached?
predef LoadSAV
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
ld [wDestinationMap],a
call SpecialWarpIn
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
call SwitchToMapRomBank ; switch to the ROM bank of the current map
- ld hl,W_CURMAPTILESET
+ ld hl,wCurMapTileset
set 7,[hl]
.changeMap
jp EnterMap
.checkForOpponent
- ld a,[W_CUROPPONENT]
+ ld a,[wCurOpponent]
and a
jp nz,.newBattle
jp OverworldLoop
@@ -300,7 +300,7 @@
and a
jp nz,WarpFound2
.notSafariZone
- ld a,[W_ISINBATTLE]
+ ld a,[wIsInBattle]
and a
jp nz,CheckWarpsNoCollision
predef ApplyOutOfBattlePoisonDamage ; also increment daycare mon exp
@@ -315,7 +315,7 @@
.battleOccurred
ld hl,wd72d
res 6,[hl]
- ld hl,W_FLAGS_D733
+ ld hl,wFlags_D733
res 3,[hl]
ld hl,wd126
set 5,[hl]
@@ -322,7 +322,7 @@
set 6,[hl]
xor a
ld [hJoyHeld],a
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
cp a,CINNABAR_GYM
jr nz,.notCinnabarGym
SetEvent EVENT_2A7
@@ -329,7 +329,7 @@
.notCinnabarGym
ld hl,wd72e
set 5,[hl]
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
cp a,OAKS_LAB
jp z,.noFaintCheck ; no blacking out if the player lost to the rival in Oak's lab
callab AnyPartyAlive
@@ -342,7 +342,7 @@
jp EnterMap
.allPokemonFainted
ld a,$ff
- ld [W_ISINBATTLE],a
+ ld [wIsInBattle],a
call RunMapScript
jp HandleBlackOut
@@ -367,7 +367,7 @@
ld a,[wNPCMovementScriptPointerTableNum]
and a
ret nz
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
cp a,ROUTE_17 ; Cycling Road
jr nz,.goFaster
ld a,[hJoyHeld]
@@ -384,9 +384,9 @@
ld a,[wNumberOfWarps]
ld b,0
ld c,a
- ld a,[W_YCOORD]
+ ld a,[wYCoord]
ld d,a
- ld a,[W_XCOORD]
+ ld a,[wXCoord]
ld e,a
ld hl,wWarpEntries
CheckWarpsNoCollisionLoop:: ; 06cc (0:06cc)
@@ -412,7 +412,7 @@
pop hl
jr nc,CheckWarpsNoCollisionRetry2
; if the extra check passed
- ld a,[W_FLAGS_D733]
+ ld a,[wFlags_D733]
bit 2,a
jr nz,WarpFound1
push de
@@ -433,12 +433,12 @@
.loop
ld a,[hli] ; Y coordinate of warp
ld b,a
- ld a,[W_YCOORD]
+ ld a,[wYCoord]
cp b
jr nz,.retry1
ld a,[hli] ; X coordinate of warp
ld b,a
- ld a,[W_XCOORD]
+ ld a,[wXCoord]
cp b
jr nz,.retry2
ld a,[hli]
@@ -472,17 +472,17 @@
ld a,[wNumberOfWarps]
sub c
ld [wWarpedFromWhichWarp],a ; save ID of used warp
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
ld [wWarpedFromWhichMap],a
call CheckIfInOutsideMap
jr nz,.indoorMaps
; this is for handling "outside" maps that can't have the 0xFF destination map
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
ld [wLastMap],a
- ld a,[W_CURMAPWIDTH]
+ ld a,[wCurMapWidth]
ld [wUnusedD366],a ; not read
ld a,[hWarpDestinationMap]
- ld [W_CURMAP],a
+ ld [wCurMap],a
cp a,ROCK_TUNNEL_1
jr nz,.notRockTunnel
ld a,$06
@@ -497,7 +497,7 @@
cp a,$ff
jr z,.goBackOutside
; if not going back to the previous map
- ld [W_CURMAP],a
+ ld [wCurMap],a
callba IsPlayerStandingOnWarpPadOrHole
ld a,[wStandingOnWarpPadOrHole]
dec a ; is the player on a warp pad?
@@ -516,7 +516,7 @@
jr .done
.goBackOutside
ld a,[wLastMap]
- ld [W_CURMAP],a
+ ld [wCurMap],a
call PlayMapChangeSound
xor a
ld [wMapPalOffset],a
@@ -534,19 +534,19 @@
; if no matching warp was found
CheckMapConnections:: ; 07ba (0:07ba)
.checkWestMap
- ld a,[W_XCOORD]
+ ld a,[wXCoord]
cp a,$ff
jr nz,.checkEastMap
- ld a,[W_MAPCONN3PTR]
- ld [W_CURMAP],a
+ ld a,[wMapConn3Ptr]
+ ld [wCurMap],a
ld a,[wWestConnectedMapXAlignment] ; new X coordinate upon entering west map
- ld [W_XCOORD],a
- ld a,[W_YCOORD]
+ ld [wXCoord],a
+ ld a,[wYCoord]
ld c,a
ld a,[wWestConnectedMapYAlignment] ; Y adjustment upon entering west map
add c
ld c,a
- ld [W_YCOORD],a
+ ld [wYCoord],a
ld a,[wWestConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for Y position
ld l,a
ld a,[wWestConnectedMapViewPointer + 1]
@@ -573,16 +573,16 @@
ld a,[wCurrentMapWidth2] ; map width
cp b
jr nz,.checkNorthMap
- ld a,[W_MAPCONN4PTR]
- ld [W_CURMAP],a
+ ld a,[wMapConn4Ptr]
+ ld [wCurMap],a
ld a,[wEastConnectedMapXAlignment] ; new X coordinate upon entering east map
- ld [W_XCOORD],a
- ld a,[W_YCOORD]
+ ld [wXCoord],a
+ ld a,[wYCoord]
ld c,a
ld a,[wEastConnectedMapYAlignment] ; Y adjustment upon entering east map
add c
ld c,a
- ld [W_YCOORD],a
+ ld [wYCoord],a
ld a,[wEastConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for Y position
ld l,a
ld a,[wEastConnectedMapViewPointer + 1]
@@ -605,19 +605,19 @@
ld [wCurrentTileBlockMapViewPointer + 1],a
jp .loadNewMap
.checkNorthMap
- ld a,[W_YCOORD]
+ ld a,[wYCoord]
cp a,$ff
jr nz,.checkSouthMap
- ld a,[W_MAPCONN1PTR]
- ld [W_CURMAP],a
+ ld a,[wMapConn1Ptr]
+ ld [wCurMap],a
ld a,[wNorthConnectedMapYAlignment] ; new Y coordinate upon entering north map
- ld [W_YCOORD],a
- ld a,[W_XCOORD]
+ ld [wYCoord],a
+ ld a,[wXCoord]
ld c,a
ld a,[wNorthConnectedMapXAlignment] ; X adjustment upon entering north map
add c
ld c,a
- ld [W_XCOORD],a
+ ld [wXCoord],a
ld a,[wNorthConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for X position
ld l,a
ld a,[wNorthConnectedMapViewPointer + 1]
@@ -635,16 +635,16 @@
ld a,[wCurrentMapHeight2]
cp b
jr nz,.didNotEnterConnectedMap
- ld a,[W_MAPCONN2PTR]
- ld [W_CURMAP],a
+ ld a,[wMapConn2Ptr]
+ ld [wCurMap],a
ld a,[wSouthConnectedMapYAlignment] ; new Y coordinate upon entering south map
- ld [W_YCOORD],a
- ld a,[W_XCOORD]
+ ld [wYCoord],a
+ ld a,[wXCoord]
ld c,a
ld a,[wSouthConnectedMapXAlignment] ; X adjustment upon entering south map
add c
ld c,a
- ld [W_XCOORD],a
+ ld [wXCoord],a
ld a,[wSouthConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for X position
ld l,a
ld a,[wSouthConnectedMapViewPointer + 1]
@@ -687,7 +687,7 @@
CheckIfInOutsideMap:: ; 08e1 (0:08e1)
; If the player is in an outside map (a town or route), set the z flag
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
and a ; most towns/routes have tileset 0 (OVERWORLD)
ret z
cp PLATEAU ; Route 23 / Indigo Plateau
@@ -700,7 +700,7 @@
; "function 2" passes when the the tile in front of the player is among a certain set
; sets carry if the check passes, otherwise clears carry
ExtraWarpCheck:: ; 08e9 (0:08e9)
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp SS_ANNE_3
jr z, .useFunction1
cp ROCKET_HIDEOUT_1
@@ -711,7 +711,7 @@
jr z, .useFunction2
cp ROCK_TUNNEL_1
jr z, .useFunction2
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
and a ; outside tileset (OVERWORLD)
jr z, .useFunction2
cp SHIP ; S.S. Anne tileset
@@ -770,7 +770,7 @@
xor a
ld [wBattleResult], a
ld [wWalkBikeSurfState], a
- ld [W_ISINBATTLE], a
+ ld [wIsInBattle], a
ld [wMapPalOffset], a
ld hl, wd732
set 2, [hl] ; fly warp or dungeon warp
@@ -828,13 +828,13 @@
; or maps with tilesets in BikeRidingTilesets.
; Return carry if biking is allowed.
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp ROUTE_23
jr z, .allowed
cp INDIGO_PLATEAU
jr z, .allowed
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
ld b, a
ld hl, BikeRidingTilesets
.loop
@@ -854,13 +854,13 @@
; load the tile pattern data of the current tileset into VRAM
LoadTilesetTilePatternData:: ; 09e8 (0:09e8)
- ld a,[W_TILESETGFXPTR]
+ ld a,[wTileSetGFXPtr]
ld l,a
- ld a,[W_TILESETGFXPTR + 1]
+ ld a,[wTileSetGFXPtr + 1]
ld h,a
ld de,vTileset
ld bc,$600
- ld a,[W_TILESETBANK]
+ ld a,[wTileSetBank]
jp FarCopyData2
; this loads the current maps complete tile map (which references blocks, not individual tiles) to C6E8
@@ -881,7 +881,7 @@
; load tile map of current map (made of tile block IDs)
; a 3-byte border at the edges of the map is kept so that there is space for map connections
ld hl,wOverworldMap
- ld a,[W_CURMAPWIDTH]
+ ld a,[wCurMapWidth]
ld [hMapWidth],a
add a,MAP_BORDER * 2 ; east and west
ld [hMapStride],a ; map width + border
@@ -893,11 +893,11 @@
add hl,bc
ld c,MAP_BORDER
add hl,bc ; this puts us past the (west) border
- ld a,[W_MAPDATAPTR] ; tile map pointer
+ ld a,[wMapDataPtr] ; tile map pointer
ld e,a
- ld a,[W_MAPDATAPTR + 1]
+ ld a,[wMapDataPtr + 1]
ld d,a ; de = tile map pointer
- ld a,[W_CURMAPHEIGHT]
+ ld a,[wCurMapHeight]
ld b,a
.rowLoop ; copy one row each iteration
push hl
@@ -920,7 +920,7 @@
dec b
jr nz,.rowLoop
.northConnection
- ld a,[W_MAPCONN1PTR]
+ ld a,[wMapConn1Ptr]
cp a,$ff
jr z,.southConnection
call SwitchToMapRomBank
@@ -938,7 +938,7 @@
ld [hNorthSouthConnectedMapWidth],a
call LoadNorthSouthConnectionsTileMap
.southConnection
- ld a,[W_MAPCONN2PTR]
+ ld a,[wMapConn2Ptr]
cp a,$ff
jr z,.westConnection
call SwitchToMapRomBank
@@ -956,7 +956,7 @@
ld [hNorthSouthConnectedMapWidth],a
call LoadNorthSouthConnectionsTileMap
.westConnection
- ld a,[W_MAPCONN3PTR]
+ ld a,[wMapConn3Ptr]
cp a,$ff
jr z,.eastConnection
call SwitchToMapRomBank
@@ -974,7 +974,7 @@
ld [hEastWestConnectedMapWidth],a
call LoadEastWestConnectionsTileMap
.eastConnection
- ld a,[W_MAPCONN4PTR]
+ ld a,[wMapConn4Ptr]
cp a,$ff
jr z,.done
call SwitchToMapRomBank
@@ -1015,7 +1015,7 @@
jr nc,.noCarry1
inc h
.noCarry1
- ld a,[W_CURMAPWIDTH]
+ ld a,[wCurMapWidth]
add a,MAP_BORDER * 2
add e
ld e,a
@@ -1044,7 +1044,7 @@
jr nc,.noCarry1
inc h
.noCarry1
- ld a,[W_CURMAPWIDTH]
+ ld a,[wCurMapWidth]
add a,MAP_BORDER * 2
add e
ld e,a
@@ -1100,7 +1100,7 @@
; check if the player is front of a counter in a pokemon center, pokemart, etc. and if so, extend the range at which he can talk to the NPC
.extendRangeOverCounter
predef GetTileAndCoordsInFrontOfPlayer ; get the tile in front of the player in c
- ld hl,W_TILESETTALKINGOVERTILES ; list of tiles that extend talking range (counter tiles)
+ ld hl,wTileSetTalkingOverTiles ; list of tiles that extend talking range (counter tiles)
ld b,3
ld d,$20 ; talking range in pixels (long range)
.counterTilesLoop
@@ -1152,7 +1152,7 @@
ld a,PLAYER_DIR_LEFT
.doneCheckingDirection
ld [wPlayerDirection],a
- ld a,[W_NUMSPRITES] ; number of sprites
+ ld a,[wNumSprites] ; number of sprites
and a
ret z
; if there are sprites
@@ -1242,7 +1242,7 @@
predef GetTileAndCoordsInFrontOfPlayer ; get tile in front of player
ld a,[wTileInFrontOfPlayer] ; tile in front of player
ld c,a
- ld hl,W_TILESETCOLLISIONPTR ; pointer to list of passable tiles
+ ld hl,wTileSetCollisionPtr ; pointer to list of passable tiles
ld a,[hli]
ld h,[hl]
ld l,a ; hl now points to passable tiles
@@ -1284,7 +1284,7 @@
ld a,[wTileInFrontOfPlayer]
ld c,a
.tilePairCollisionLoop
- ld a,[W_CURMAPTILESET] ; tileset number
+ ld a,[wCurMapTileset] ; tileset number
ld b,a
ld a,[hli]
cp a,$ff
@@ -1354,7 +1354,7 @@
LoadCurrentMapView:: ; 0caa (0:0caa)
ld a,[H_LOADEDROMBANK]
push af
- ld a,[W_TILESETBANK] ; tile data ROM bank
+ ld a,[wTileSetBank] ; tile data ROM bank
ld [H_LOADEDROMBANK],a
ld [MBC1RomBank],a ; switch to ROM bank that contains tile data
ld a,[wCurrentTileBlockMapViewPointer] ; address of upper left corner of current map view
@@ -1386,7 +1386,7 @@
jr nz,.rowInnerLoop
; update tile block map pointer to next row's address
pop de
- ld a,[W_CURMAPWIDTH]
+ ld a,[wCurMapWidth]
add a,MAP_BORDER * 2
add e
ld e,a
@@ -1406,13 +1406,13 @@
ld hl,wTileMapBackup
ld bc,$0000
.adjustForYCoordWithinTileBlock
- ld a,[W_YBLOCKCOORD]
+ ld a,[wYBlockCoord]
and a
jr z,.adjustForXCoordWithinTileBlock
ld bc,$0030
add hl,bc
.adjustForXCoordWithinTileBlock
- ld a,[W_XBLOCKCOORD]
+ ld a,[wXBlockCoord]
and a
jr z,.copyToVisibleAreaBuffer
ld bc,$0002
@@ -1450,12 +1450,12 @@
dec [hl]
jr nz,.afterUpdateMapCoords
; if it's the end of the animation, update the player's map coordinates
- ld a,[W_YCOORD]
+ ld a,[wYCoord]
add b
- ld [W_YCOORD],a
- ld a,[W_XCOORD]
+ ld [wYCoord],a
+ ld a,[wXCoord]
add c
- ld [W_XCOORD],a
+ ld [wXCoord],a
.afterUpdateMapCoords
ld a,[wWalkCounter] ; walking animation counter
cp a,$07
@@ -1522,7 +1522,7 @@
and a
jr z,.pointlessJump ; mistake?
.pointlessJump
- ld hl,W_XBLOCKCOORD
+ ld hl,wXBlockCoord
ld a,[hl]
add c
ld [hl],a
@@ -1548,7 +1548,7 @@
call MoveTileBlockMapPointerWest
jr .updateMapView
.adjustYCoordWithinBlock
- ld hl,W_YBLOCKCOORD
+ ld hl,wYBlockCoord
ld a,[hl]
add b
ld [hl],a
@@ -1560,7 +1560,7 @@
ld hl,wYOffsetSinceLastSpecialWarp
inc [hl]
ld de,wCurrentTileBlockMapViewPointer
- ld a,[W_CURMAPWIDTH]
+ ld a,[wCurMapWidth]
call MoveTileBlockMapPointerSouth
jr .updateMapView
.checkForMoveToNorthBlock
@@ -1572,7 +1572,7 @@
ld hl,wYOffsetSinceLastSpecialWarp
dec [hl]
ld de,wCurrentTileBlockMapViewPointer
- ld a,[W_CURMAPWIDTH]
+ ld a,[wCurMapWidth]
call MoveTileBlockMapPointerNorth
.updateMapView
call LoadCurrentMapView
@@ -1616,7 +1616,7 @@
; shift all the sprites in the direction opposite of the player's motion
; so that the player appears to move relative to them
ld hl,wSpriteStateData1 + $14
- ld a,[W_NUMSPRITES] ; number of sprites
+ ld a,[wNumSprites] ; number of sprites
and a ; are there any sprites?
jr z,.done
ld e,a
@@ -1784,9 +1784,9 @@
; Input: c = tile block ID, hl = destination address
DrawTileBlock:: ; 0f1d (0:0f1d)
push hl
- ld a,[W_TILESETBLOCKSPTR] ; pointer to tiles
+ ld a,[wTileSetBlocksPtr] ; pointer to tiles
ld l,a
- ld a,[W_TILESETBLOCKSPTR + 1]
+ ld a,[wTileSetBlocksPtr + 1]
ld h,a
ld a,c
swap a
@@ -1829,10 +1829,10 @@
ld [wSpriteStateData1 + 5],a
call RunMapScript
call Joypad
- ld a,[W_FLAGS_D733]
+ ld a,[wFlags_D733]
bit 3,a ; check if a trainer wants a challenge
jr nz,.notForcedDownwards
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
cp a,ROUTE_17 ; Cycling Road
jr nz,.notForcedDownwards
ld a,[hJoyHeld]
@@ -1915,7 +1915,7 @@
jr z,.noCollision ; keep surfing
; check if the [land] tile in front of the player is passable
.checkIfNextTileIsPassable
- ld hl,W_TILESETCOLLISIONPTR ; pointer to list of passable tiles
+ ld hl,wTileSetCollisionPtr ; pointer to list of passable tiles
ld a,[hli]
ld h,[hl]
ld l,a
@@ -1946,7 +1946,7 @@
call PlayDefaultMusic
jr .noCollision
.checkIfVermilionDockTileset
- ld a, [W_CURMAPTILESET] ; tileset
+ ld a, [wCurMapTileset] ; tileset
cp SHIP_PORT ; Vermilion Dock tileset
jr nz, .noCollision ; keep surfing if it's not the boarding platform tile
jr .stopSurfing ; if it is the boarding platform tile, stop surfing
@@ -1966,9 +1966,9 @@
pop de
pop hl
call RunNPCMovementScript
- ld a,[W_CURMAP] ; current map number
+ ld a,[wCurMap] ; current map number
call SwitchToMapRomBank ; change to the ROM bank the map's data is in
- ld hl,W_MAPSCRIPTPTR
+ ld hl,wMapScriptPtr
ld a,[hli]
ld h,[hl]
ld l,a
@@ -2012,19 +2012,19 @@
; function to load data from the map header
LoadMapHeader:: ; 107c (0:107c)
callba MarkTownVisitedAndLoadMissableObjects
- ld a,[W_CURMAPTILESET]
+ ld a,[wCurMapTileset]
ld [wUnusedD119],a
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
call SwitchToMapRomBank
- ld a,[W_CURMAPTILESET]
+ ld a,[wCurMapTileset]
ld b,a
res 7,a
- ld [W_CURMAPTILESET],a
+ ld [wCurMapTileset],a
ld [hPreviousTileset],a
bit 7,b
ret nz
ld hl,MapHeaderPointers
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
sla a
jr nc,.noCarry1
inc h
@@ -2038,7 +2038,7 @@
ld h,[hl]
ld l,a ; hl = base of map header
; copy the first 10 bytes (the fixed area) of the map data to D367-D370
- ld de,W_CURMAPTILESET
+ ld de,wCurMapTileset
ld c,$0a
.copyFixedHeaderLoop
ld a,[hli]
@@ -2048,32 +2048,32 @@
jr nz,.copyFixedHeaderLoop
; initialize all the connected maps to disabled at first, before loading the actual values
ld a,$ff
- ld [W_MAPCONN1PTR],a
- ld [W_MAPCONN2PTR],a
- ld [W_MAPCONN3PTR],a
- ld [W_MAPCONN4PTR],a
+ ld [wMapConn1Ptr],a
+ ld [wMapConn2Ptr],a
+ ld [wMapConn3Ptr],a
+ ld [wMapConn4Ptr],a
; copy connection data (if any) to WRAM
- ld a,[W_MAPCONNECTIONS]
+ ld a,[wMapConnections]
ld b,a
.checkNorth
bit 3,b
jr z,.checkSouth
- ld de,W_MAPCONN1PTR
+ ld de,wMapConn1Ptr
call CopyMapConnectionHeader
.checkSouth
bit 2,b
jr z,.checkWest
- ld de,W_MAPCONN2PTR
+ ld de,wMapConn2Ptr
call CopyMapConnectionHeader
.checkWest
bit 1,b
jr z,.checkEast
- ld de,W_MAPCONN3PTR
+ ld de,wMapConn3Ptr
call CopyMapConnectionHeader
.checkEast
bit 0,b
jr z,.getObjectDataPointer
- ld de,W_MAPCONN4PTR
+ ld de,wMapConn4Ptr
call CopyMapConnectionHeader
.getObjectDataPointer
ld a,[hli]
@@ -2144,7 +2144,7 @@
bit 5,a ; did a battle happen immediately before this?
jp nz,.finishUp ; if so, skip this because battles don't destroy this data
ld a,[hli]
- ld [W_NUMSPRITES],a ; save the number of sprites
+ ld [wNumSprites],a ; save the number of sprites
push hl
; zero C110-C1FF and C210-C2FF
ld hl,wSpriteStateData1 + $10
@@ -2168,7 +2168,7 @@
jr nz,.disableSpriteEntriesLoop
pop hl
ld de,wSpriteStateData1 + $10
- ld a,[W_NUMSPRITES] ; number of sprites
+ ld a,[wNumSprites] ; number of sprites
and a ; are there any sprites?
jp z,.finishUp ; if there are no sprites, skip the rest
ld b,a
@@ -2195,7 +2195,7 @@
push bc
push hl
ld b,$00
- ld hl,W_MAPSPRITEDATA
+ ld hl,wMapSpriteData
add hl,bc
ld a,[hLoadSpriteTemp1]
ld [hli],a ; store movement byte 2 in byte 0 of sprite entry
@@ -2218,7 +2218,7 @@
ld a,[hli]
ld [hLoadSpriteTemp2],a ; save trainer number (within class)
push hl
- ld hl,W_MAPSPRITEEXTRADATA
+ ld hl,wMapSpriteExtraData
add hl,bc
ld a,[hLoadSpriteTemp1]
ld [hli],a ; store trainer class in byte 0 of the entry
@@ -2230,7 +2230,7 @@
ld a,[hli]
ld [hLoadSpriteTemp1],a ; save item number
push hl
- ld hl,W_MAPSPRITEEXTRADATA
+ ld hl,wMapSpriteExtraData
add hl,bc
ld a,[hLoadSpriteTemp1]
ld [hli],a ; store item number in byte 0 of the entry
@@ -2240,7 +2240,7 @@
jr .nextSprite
.regularSprite
push hl
- ld hl,W_MAPSPRITEEXTRADATA
+ ld hl,wMapSpriteExtraData
add hl,bc
; zero both bytes, since regular sprites don't use this extra space
xor a
@@ -2261,13 +2261,13 @@
predef LoadTilesetHeader
callab LoadWildData
pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose)
- ld a,[W_CURMAPHEIGHT] ; map height in 4x4 tile blocks
+ ld a,[wCurMapHeight] ; map height in 4x4 tile blocks
add a ; double it
ld [wCurrentMapHeight2],a ; store map height in 2x2 tile blocks
- ld a,[W_CURMAPWIDTH] ; map width in 4x4 tile blocks
+ ld a,[wCurMapWidth] ; map width in 4x4 tile blocks
add a ; double it
ld [wCurrentMapWidth2],a ; map width in 2x2 tile blocks
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
ld c,a
ld b,$00
ld a,[H_LOADEDROMBANK]
@@ -2313,7 +2313,7 @@
ld [wWalkCounter],a
ld [wUnusedD119],a
ld [wWalkBikeSurfStateCopy],a
- ld [W_SPRITESETID],a
+ ld [wSpriteSetID],a
call LoadTextBoxTilePatterns
call LoadMapHeader
callba InitMapSprites ; load tile pattern data for sprites
@@ -2349,7 +2349,7 @@
ld a,[wd732]
and a,1 << 4 | 1 << 3 ; fly warp or dungeon warp
jr nz,.restoreRomBank
- ld a,[W_FLAGS_D733]
+ ld a,[wFlags_D733]
bit 1,a
jr nz,.restoreRomBank
call UpdateMusic6Times
--- a/home/pic.asm
+++ b/home/pic.asm
@@ -1,5 +1,5 @@
; bankswitches and runs _UncompressSpriteData
-; bank is given in a, sprite input stream is pointed to in W_SPRITEINPUTPTR
+; bank is given in a, sprite input stream is pointed to in wSpriteInputPtr
UncompressSpriteData:: ; 24fd (0:24fd)
ld b, a
ld a, [H_LOADEDROMBANK]
@@ -25,13 +25,13 @@
xor a
call FillMemory ; clear sprite buffer 1 and 2
ld a, $1
- ld [W_SPRITEINPUTBITCOUNTER], a
+ ld [wSpriteInputBitCounter], a
ld a, $3
- ld [W_SPRITEOUTPUTBITOFFSET], a
+ ld [wSpriteOutputBitOffset], a
xor a
- ld [W_SPRITECURPOSX], a
- ld [W_SPRITECURPOSY], a
- ld [W_SPRITELOADFLAGS], a
+ ld [wSpriteCurPosX], a
+ ld [wSpriteCurPosY], a
+ ld [wSpriteLoadFlags], a
call ReadNextInputByte ; first byte of input determines sprite width (high nybble) and height (low nybble) in tiles (8x8 pixels)
ld b, a
and $f
@@ -38,7 +38,7 @@
add a
add a
add a
- ld [W_SPRITEHEIGHT], a
+ ld [wSpriteHeight], a
ld a, b
swap a
and $f
@@ -45,9 +45,9 @@
add a
add a
add a
- ld [W_SPRITEWITDH], a
+ ld [wSpriteWidth], a
call ReadNextInputBit
- ld [W_SPRITELOADFLAGS], a ; initialite bit1 to 0 and bit0 to the first input bit
+ ld [wSpriteLoadFlags], a ; initialite bit1 to 0 and bit0 to the first input bit
; this will load two chunks of data to S_SPRITEBUFFER1 and S_SPRITEBUFFER2
; bit 0 decides in which one the first chunk is placed
; fall through
@@ -57,13 +57,13 @@
; note that this is an endless loop which is terminated during a call to MoveToNextBufferPosition by manipulating the stack
UncompressSpriteDataLoop:: ; 2556 (0:2556)
ld hl, S_SPRITEBUFFER1
- ld a, [W_SPRITELOADFLAGS]
+ ld a, [wSpriteLoadFlags]
bit 0, a
jr z, .useSpriteBuffer1 ; check which buffer to use
ld hl, S_SPRITEBUFFER2
.useSpriteBuffer1
call StoreSpriteOutputPointer
- ld a, [W_SPRITELOADFLAGS]
+ ld a, [wSpriteLoadFlags]
bit 1, a
jr z, .startDecompression ; check if last iteration
call ReadNextInputBit ; if last chunk, read 1-2 bit unpacking mode
@@ -72,7 +72,7 @@
call ReadNextInputBit ; 1 0 -> mode 1
inc a ; 1 1 -> mode 2
.unpackingMode0
- ld [W_SPRITEUNPACKMODE], a
+ ld [wSpriteUnpackMode], a
.startDecompression
call ReadNextInputBit
and a
@@ -146,48 +146,48 @@
; also cancels the calling function if the all output is done (by removing the return pointer from stack)
; and calls postprocessing functions according to the unpack mode
MoveToNextBufferPosition:: ; 25d8 (0:25d8)
- ld a, [W_SPRITEHEIGHT]
+ ld a, [wSpriteHeight]
ld b, a
- ld a, [W_SPRITECURPOSY]
+ ld a, [wSpriteCurPosY]
inc a
cp b
jr z, .curColumnDone
- ld [W_SPRITECURPOSY], a
- ld a, [W_SPRITEOUTPUTPTR]
+ ld [wSpriteCurPosY], a
+ ld a, [wSpriteOutputPtr]
inc a
- ld [W_SPRITEOUTPUTPTR], a
+ ld [wSpriteOutputPtr], a
ret nz
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
inc a
- ld [W_SPRITEOUTPUTPTR+1], a
+ ld [wSpriteOutputPtr+1], a
ret
.curColumnDone
xor a
- ld [W_SPRITECURPOSY], a
- ld a, [W_SPRITEOUTPUTBITOFFSET]
+ ld [wSpriteCurPosY], a
+ ld a, [wSpriteOutputBitOffset]
and a
jr z, .bitOffsetsDone
dec a
- ld [W_SPRITEOUTPUTBITOFFSET], a
- ld hl, W_SPRITEOUTPUTPTRCACHED
+ ld [wSpriteOutputBitOffset], a
+ ld hl, wSpriteOutputPtrCached
ld a, [hli]
- ld [W_SPRITEOUTPUTPTR], a
+ ld [wSpriteOutputPtr], a
ld a, [hl]
- ld [W_SPRITEOUTPUTPTR+1], a
+ ld [wSpriteOutputPtr+1], a
ret
.bitOffsetsDone
ld a, $3
- ld [W_SPRITEOUTPUTBITOFFSET], a
- ld a, [W_SPRITECURPOSX]
+ ld [wSpriteOutputBitOffset], a
+ ld a, [wSpriteCurPosX]
add $8
- ld [W_SPRITECURPOSX], a
+ ld [wSpriteCurPosX], a
ld b, a
- ld a, [W_SPRITEWITDH]
+ ld a, [wSpriteWidth]
cp b
jr z, .allColumnsDone
- ld a, [W_SPRITEOUTPUTPTR]
+ ld a, [wSpriteOutputPtr]
ld l, a
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
ld h, a
inc hl
jp StoreSpriteOutputPointer
@@ -194,21 +194,21 @@
.allColumnsDone
pop hl
xor a
- ld [W_SPRITECURPOSX], a
- ld a, [W_SPRITELOADFLAGS]
+ ld [wSpriteCurPosX], a
+ ld a, [wSpriteLoadFlags]
bit 1, a
jr nz, .done ; test if there is one more sprite to go
xor $1
set 1, a
- ld [W_SPRITELOADFLAGS], a
+ ld [wSpriteLoadFlags], a
jp UncompressSpriteDataLoop
.done
jp UnpackSprite
-; writes 2 bits (from a) to the output buffer (pointed to from W_SPRITEOUTPUTPTR)
+; writes 2 bits (from a) to the output buffer (pointed to from wSpriteOutputPtr)
WriteSpriteBitsToBuffer:: ; 2649 (0:2649)
ld e, a
- ld a, [W_SPRITEOUTPUTBITOFFSET]
+ ld a, [wSpriteOutputBitOffset]
and a
jr z, .offset0
cp $2
@@ -224,9 +224,9 @@
.offset2
swap e
.offset0
- ld a, [W_SPRITEOUTPUTPTR]
+ ld a, [wSpriteOutputPtr]
ld l, a
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
ld h, a
ld a, [hl]
or e
@@ -235,32 +235,32 @@
; reads next bit from input stream and returns it in a
ReadNextInputBit:: ; 2670 (0:2670)
- ld a, [W_SPRITEINPUTBITCOUNTER]
+ ld a, [wSpriteInputBitCounter]
dec a
jr nz, .curByteHasMoreBitsToRead
call ReadNextInputByte
- ld [W_SPRITEINPUTCURBYTE], a
+ ld [wSpriteInputCurByte], a
ld a, $8
.curByteHasMoreBitsToRead
- ld [W_SPRITEINPUTBITCOUNTER], a
- ld a, [W_SPRITEINPUTCURBYTE]
+ ld [wSpriteInputBitCounter], a
+ ld a, [wSpriteInputCurByte]
rlca
- ld [W_SPRITEINPUTCURBYTE], a
+ ld [wSpriteInputCurByte], a
and $1
ret
; reads next byte from input stream and returns it in a
ReadNextInputByte:: ; 268b (0:268b)
- ld a, [W_SPRITEINPUTPTR]
+ ld a, [wSpriteInputPtr]
ld l, a
- ld a, [W_SPRITEINPUTPTR+1]
+ ld a, [wSpriteInputPtr+1]
ld h, a
ld a, [hli]
ld b, a
ld a, l
- ld [W_SPRITEINPUTPTR], a
+ ld [wSpriteInputPtr], a
ld a, h
- ld [W_SPRITEINPUTPTR+1], a
+ ld [wSpriteInputPtr+1], a
ld a, b
ret
@@ -285,7 +285,7 @@
; unpacks the sprite data depending on the unpack mode
UnpackSprite:: ; 26bf (0:26bf)
- ld a, [W_SPRITEUNPACKMODE]
+ ld a, [wSpriteUnpackMode]
cp $2
jp z, UnpackSpriteMode2
and a
@@ -299,10 +299,10 @@
; input bit value 0 preserves the current bit value and input bit value 1 toggles it (starting from initial value 0).
SpriteDifferentialDecode:: ; 26d4 (0:26d4)
xor a
- ld [W_SPRITECURPOSX], a
- ld [W_SPRITECURPOSY], a
+ ld [wSpriteCurPosX], a
+ ld [wSpriteCurPosY], a
call StoreSpriteOutputPointer
- ld a, [W_SPRITEFLIPPED]
+ ld a, [wSpriteFlipped]
and a
jr z, .notFlipped
ld hl, DecodeNybble0TableFlipped
@@ -313,18 +313,18 @@
ld de, DecodeNybble1Table
.storeDecodeTablesPointers
ld a, l
- ld [W_SPRITEDECODETABLE0PTR], a
+ ld [wSpriteDecodeTable0Ptr], a
ld a, h
- ld [W_SPRITEDECODETABLE0PTR+1], a
+ ld [wSpriteDecodeTable0Ptr+1], a
ld a, e
- ld [W_SPRITEDECODETABLE1PTR], a
+ ld [wSpriteDecodeTable1Ptr], a
ld a, d
- ld [W_SPRITEDECODETABLE1PTR+1], a
+ ld [wSpriteDecodeTable1Ptr+1], a
ld e, $0 ; last decoded nybble, initialized to 0
.decodeNextByteLoop
- ld a, [W_SPRITEOUTPUTPTR]
+ ld a, [wSpriteOutputPtr]
ld l, a
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
ld h, a
ld a, [hl]
ld b, a
@@ -338,40 +338,40 @@
call DifferentialDecodeNybble ; decode low nybble
or d
ld b, a
- ld a, [W_SPRITEOUTPUTPTR]
+ ld a, [wSpriteOutputPtr]
ld l, a
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
ld h, a
ld a, b
ld [hl], a ; write back decoded data
- ld a, [W_SPRITEHEIGHT]
+ ld a, [wSpriteHeight]
add l ; move on to next column
jr nc, .noCarry
inc h
.noCarry
- ld [W_SPRITEOUTPUTPTR], a
+ ld [wSpriteOutputPtr], a
ld a, h
- ld [W_SPRITEOUTPUTPTR+1], a
- ld a, [W_SPRITECURPOSX]
+ ld [wSpriteOutputPtr+1], a
+ ld a, [wSpriteCurPosX]
add $8
- ld [W_SPRITECURPOSX], a
+ ld [wSpriteCurPosX], a
ld b, a
- ld a, [W_SPRITEWITDH]
+ ld a, [wSpriteWidth]
cp b
jr nz, .decodeNextByteLoop ; test if current row is done
xor a
ld e, a
- ld [W_SPRITECURPOSX], a
- ld a, [W_SPRITECURPOSY] ; move on to next row
+ ld [wSpriteCurPosX], a
+ ld a, [wSpriteCurPosY] ; move on to next row
inc a
- ld [W_SPRITECURPOSY], a
+ ld [wSpriteCurPosY], a
ld b, a
- ld a, [W_SPRITEHEIGHT]
+ ld a, [wSpriteHeight]
cp b
jr z, .done ; test if all rows finished
- ld a, [W_SPRITEOUTPUTPTRCACHED]
+ ld a, [wSpriteOutputPtrCached]
ld l, a
- ld a, [W_SPRITEOUTPUTPTRCACHED+1]
+ ld a, [wSpriteOutputPtrCached+1]
ld h, a
inc hl
call StoreSpriteOutputPointer
@@ -378,7 +378,7 @@
jr .decodeNextByteLoop
.done
xor a
- ld [W_SPRITECURPOSY], a
+ ld [wSpriteCurPosY], a
ret
; decodes the nybble stored in a. Last decoded data is assumed to be in e (needed to determine if initial value is 0 or 1)
@@ -389,7 +389,7 @@
ld c, $1
.evenNumber
ld l, a
- ld a, [W_SPRITEFLIPPED]
+ ld a, [wSpriteFlipped]
and a
jr z, .notFlipped ; determine if initial value is 0 or one
bit 3, e ; if flipped, consider MSB of last data
@@ -399,14 +399,14 @@
.selectLookupTable
ld e, l
jr nz, .initialValue1 ; load the appropriate table
- ld a, [W_SPRITEDECODETABLE0PTR]
+ ld a, [wSpriteDecodeTable0Ptr]
ld l, a
- ld a, [W_SPRITEDECODETABLE0PTR+1]
+ ld a, [wSpriteDecodeTable0Ptr+1]
jr .tableLookup
.initialValue1
- ld a, [W_SPRITEDECODETABLE1PTR]
+ ld a, [wSpriteDecodeTable1Ptr]
ld l, a
- ld a, [W_SPRITEDECODETABLE1PTR+1]
+ ld a, [wSpriteDecodeTable1Ptr+1]
.tableLookup
ld h, a
ld a, e
@@ -464,25 +464,25 @@
; combines the two loaded chunks with xor (the chunk loaded second is the destination). The source chunk is differeintial decoded beforehand.
XorSpriteChunks:: ; 27c7 (0:27c7)
xor a
- ld [W_SPRITECURPOSX], a
- ld [W_SPRITECURPOSY], a
+ ld [wSpriteCurPosX], a
+ ld [wSpriteCurPosY], a
call ResetSpriteBufferPointers
- ld a, [W_SPRITEOUTPUTPTR] ; points to buffer 1 or 2, depending on flags
+ ld a, [wSpriteOutputPtr] ; points to buffer 1 or 2, depending on flags
ld l, a
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
ld h, a
call SpriteDifferentialDecode ; decode buffer 1 or 2, depending on flags
call ResetSpriteBufferPointers
- ld a, [W_SPRITEOUTPUTPTR] ; source buffer, points to buffer 1 or 2, depending on flags
+ ld a, [wSpriteOutputPtr] ; source buffer, points to buffer 1 or 2, depending on flags
ld l, a
- ld a, [W_SPRITEOUTPUTPTR+1]
+ ld a, [wSpriteOutputPtr+1]
ld h, a
- ld a, [W_SPRITEOUTPUTPTRCACHED] ; destination buffer, points to buffer 2 or 1, depending on flags
+ ld a, [wSpriteOutputPtrCached] ; destination buffer, points to buffer 2 or 1, depending on flags
ld e, a
- ld a, [W_SPRITEOUTPUTPTRCACHED+1]
+ ld a, [wSpriteOutputPtrCached+1]
ld d, a
.xorChunksLoop
- ld a, [W_SPRITEFLIPPED]
+ ld a, [wSpriteFlipped]
and a
jr z, .notFlipped
push de
@@ -506,24 +506,24 @@
xor b
ld [de], a
inc de
- ld a, [W_SPRITECURPOSY]
+ ld a, [wSpriteCurPosY]
inc a
- ld [W_SPRITECURPOSY], a ; go to next row
+ ld [wSpriteCurPosY], a ; go to next row
ld b, a
- ld a, [W_SPRITEHEIGHT]
+ ld a, [wSpriteHeight]
cp b
jr nz, .xorChunksLoop ; test if column finished
xor a
- ld [W_SPRITECURPOSY], a
- ld a, [W_SPRITECURPOSX]
+ ld [wSpriteCurPosY], a
+ ld a, [wSpriteCurPosX]
add $8
- ld [W_SPRITECURPOSX], a ; go to next column
+ ld [wSpriteCurPosX], a ; go to next column
ld b, a
- ld a, [W_SPRITEWITDH]
+ ld a, [wSpriteWidth]
cp b
jr nz, .xorChunksLoop ; test if all columns finished
xor a
- ld [W_SPRITECURPOSX], a
+ ld [wSpriteCurPosX], a
ret
; reverses the bits in the nybble given in register a
@@ -537,9 +537,9 @@
ld a, [de]
ret
-; resets sprite buffer pointers to buffer 1 and 2, depending on W_SPRITELOADFLAGS
+; resets sprite buffer pointers to buffer 1 and 2, depending on wSpriteLoadFlags
ResetSpriteBufferPointers:: ; 2841 (0:2841)
- ld a, [W_SPRITELOADFLAGS]
+ ld a, [wSpriteLoadFlags]
bit 0, a
jr nz, .buffer2Selected
ld de, S_SPRITEBUFFER1
@@ -550,13 +550,13 @@
ld hl, S_SPRITEBUFFER1
.storeBufferPointers
ld a, l
- ld [W_SPRITEOUTPUTPTR], a
+ ld [wSpriteOutputPtr], a
ld a, h
- ld [W_SPRITEOUTPUTPTR+1], a
+ ld [wSpriteOutputPtr+1], a
ld a, e
- ld [W_SPRITEOUTPUTPTRCACHED], a
+ ld [wSpriteOutputPtrCached], a
ld a, d
- ld [W_SPRITEOUTPUTPTRCACHED+1], a
+ ld [wSpriteOutputPtrCached+1], a
ret
; maps each nybble to its reverse
@@ -566,26 +566,26 @@
; combines the two loaded chunks with xor (the chunk loaded second is the destination). Both chunks are differeintial decoded beforehand.
UnpackSpriteMode2:: ; 2877 (0:2877)
call ResetSpriteBufferPointers
- ld a, [W_SPRITEFLIPPED]
+ ld a, [wSpriteFlipped]
push af
xor a
- ld [W_SPRITEFLIPPED], a ; temporarily clear flipped flag for decoding the destination chunk
- ld a, [W_SPRITEOUTPUTPTRCACHED]
+ ld [wSpriteFlipped], a ; temporarily clear flipped flag for decoding the destination chunk
+ ld a, [wSpriteOutputPtrCached]
ld l, a
- ld a, [W_SPRITEOUTPUTPTRCACHED+1]
+ ld a, [wSpriteOutputPtrCached+1]
ld h, a
call SpriteDifferentialDecode
call ResetSpriteBufferPointers
pop af
- ld [W_SPRITEFLIPPED], a
+ ld [wSpriteFlipped], a
jp XorSpriteChunks
; stores hl into the output pointers
StoreSpriteOutputPointer:: ; 2897 (0:2897)
ld a, l
- ld [W_SPRITEOUTPUTPTR], a
- ld [W_SPRITEOUTPUTPTRCACHED], a
+ ld [wSpriteOutputPtr], a
+ ld [wSpriteOutputPtrCached], a
ld a, h
- ld [W_SPRITEOUTPUTPTR+1], a
- ld [W_SPRITEOUTPUTPTRCACHED+1], a
+ ld [wSpriteOutputPtr+1], a
+ ld [wSpriteOutputPtrCached+1], a
ret
--- a/home/text.asm
+++ b/home/text.asm
@@ -146,7 +146,7 @@
Char53:: ; 19ff (0:19ff) ; rival’s name
push de
- ld de,W_RIVALNAME
+ ld de,wRivalName
jr FinishDTE
Char5D:: ; 1a05 (0:1a05) ; TRAINER
--- a/main.asm
+++ b/main.asm
@@ -24,7 +24,7 @@
xor a
ld [wBattleResult], a
ld [wWalkBikeSurfState], a
- ld [W_ISINBATTLE], a
+ ld [wIsInBattle], a
ld [wMapPalOffset], a
ld [wNPCMovementScriptFunctionNum], a
ld [hJoyHeld], a
@@ -86,7 +86,7 @@
; 2: boxmon
; 3: daycaremon
; Return monster id at wcf91 and its data at wLoadedMon.
-; Also load base stats at W_MONHEADER for convenience.
+; Also load base stats at wMonHeader for convenience.
ld a, [wDayCareMonSpecies]
ld [wcf91], a
@@ -161,7 +161,7 @@
coord hl, 3, 10
ld b, $1
ld c, $b
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
and a
jr z, .asm_4c17
call TextBoxBorder
@@ -545,9 +545,9 @@
; Don't mess around
; with obedience.
ld a, %10000000 ; EARTHBADGE
- ld [W_OBTAINEDBADGES], a
+ ld [wObtainedBadges], a
- ld hl, W_FLAGS_D733
+ ld hl, wFlags_D733
set BIT_TEST_BATTLE, [hl]
; Reset the party.
@@ -562,16 +562,16 @@
ld a, RHYDON
ld [wcf91], a
ld a, 20
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
xor a
ld [wMonDataLocation], a
- ld [W_CURMAP], a
+ ld [wCurMap], a
call AddPartyMon
; Fight against a
; level 20 Rhydon.
ld a, RHYDON
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
predef InitOpponent
@@ -655,7 +655,7 @@
jr nz, .notFirstMap
ld hl, FirstMapSpec
.copyWarpData
- ld de, W_CURMAP
+ ld de, wCurMap
ld c, $7
.copyWarpDataLoop
ld a, [hli]
@@ -664,7 +664,7 @@
dec c
jr nz, .copyWarpDataLoop
ld a, [hli]
- ld [W_CURMAPTILESET], a
+ ld [wCurMapTileset], a
xor a
jr .done
.notFirstMap
@@ -683,7 +683,7 @@
res 4, [hl]
ld a, [wDungeonWarpDestinationMap]
ld b, a
- ld [W_CURMAP], a
+ ld [wCurMap], a
ld a, [wWhichDungeonWarp]
ld c, a
ld hl, DungeonWarpList
@@ -713,7 +713,7 @@
ld a, [wDestinationMap]
.usedFlyWarp
ld b, a
- ld [W_CURMAP], a
+ ld [wCurMap], a
ld hl, FlyWarpDataPtr
.flyWarpDataPtrLoop
ld a, [hli]
@@ -737,7 +737,7 @@
dec c
jr nz, .copyWarpDataLoop2
xor a ; OVERWORLD
- ld [W_CURMAPTILESET], a
+ ld [wCurMapTileset], a
.done
ld [wYOffsetSinceLastSpecialWarp], a
ld [wXOffsetSinceLastSpecialWarp], a
@@ -765,7 +765,7 @@
ld [wcf91], a
inc de
ld a, [de]
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
inc de
call AddPartyMon
jr .loop
@@ -966,7 +966,7 @@
push hl
ld hl, SafariZoneRestHouses
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
ld b, a
.loop
ld a, [hli]
@@ -1931,7 +1931,7 @@
ld a, [wRemoveMonFromBox]
and a
jr z, .asm_7b74
- ld hl, W_NUMINBOX
+ ld hl, wNumInBox
.asm_7b74
ld a, [hl]
dec a
@@ -2058,7 +2058,7 @@
xor a
ld [H_AUTOBGTRANSFERENABLED], a
ld [wStepCounter], a
- ld [W_LONEATTACKNO], a
+ ld [wLoneAttackNo], a
ld [hJoyPressed], a
ld [hJoyReleased], a
ld [hJoyHeld], a
@@ -2080,11 +2080,11 @@
ld c, a
ld hl, wWarpEntries
.loop
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp [hl]
jr nz, .nextWarp1
inc hl
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp [hl]
jr nz, .nextWarp2
inc hl
@@ -2110,11 +2110,11 @@
bit 5, [hl]
ret nz
ld hl, ForcedBikeOrSurfMaps
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
ld b, a
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
ld c, a
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
ld d, a
.loop
ld a, [hli]
@@ -2128,15 +2128,15 @@
ld a, [hli]
cp c ;compare x-coord
jr nz, .loop ; incorrect x-coord, check next item
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp SEAFOAM_ISLANDS_4
ld a, $2
- ld [W_SEAFOAMISLANDS4CURSCRIPT], a
+ ld [wSeafoamIslands4CurScript], a
jr z, .forceSurfing
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp SEAFOAM_ISLANDS_5
ld a, $2
- ld [W_SEAFOAMISLANDS5CURSCRIPT], a
+ ld [wSeafoamIslands5CurScript], a
jr z, .forceSurfing
;force bike riding
ld hl, wd732
@@ -2171,9 +2171,9 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
ld b, a
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
ld c, a
ld de, .asm_c41e
push de
@@ -2191,7 +2191,7 @@
dw .facingRight
.facingDown
- ld a, [W_CURMAPHEIGHT]
+ ld a, [wCurMapHeight]
add a
dec a
cp b
@@ -2211,7 +2211,7 @@
jr .resetCarry
.facingRight
- ld a, [W_CURMAPWIDTH]
+ ld a, [wCurMapWidth]
add a
dec a
cp c
@@ -2229,7 +2229,7 @@
push de
push bc
call _GetTileAndCoordsInFrontOfPlayer
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp SS_ANNE_5
jr z, .ssAnne5
ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction
@@ -2284,7 +2284,7 @@
push bc
callba IsPlayerStandingOnDoorTile
jr c, .done
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
add a
ld c, a
ld b, $0
@@ -2308,7 +2308,7 @@
INCLUDE "data/warp_tile_ids.asm"
PrintSafariZoneSteps: ; c52f (3:452f)
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp SAFARI_ZONE_EAST
ret c
cp UNKNOWN_DUNGEON_2
@@ -2327,7 +2327,7 @@
coord hl, 1, 3
ld de, SafariBallText
call PlaceString
- ld a, [W_NUMSAFARIBALLS]
+ ld a, [wNumSafariBalls]
cp 10
jr nc, .asm_c56d
coord hl, 5, 3
@@ -2335,7 +2335,7 @@
ld [hl], a
.asm_c56d
coord hl, 6, 3
- ld de, W_NUMSAFARIBALLS
+ ld de, wNumSafariBalls
lb bc, 1, 2
jp PrintNumber
@@ -2349,9 +2349,9 @@
call GetPredefRegisters
_GetTileAndCoordsInFrontOfPlayer: ; c589 (3:4589)
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
ld d, a
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
ld e, a
ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
and a ; cp SPRITE_FACING_DOWN
@@ -2388,7 +2388,7 @@
GetTileTwoStepsInFrontOfPlayer: ; c5be (3:45be)
xor a
ld [$ffdb], a
- ld hl, W_YCOORD
+ ld hl, wYCoord
ld a, [hli]
ld d, a
ld e, [hl]
@@ -2435,7 +2435,7 @@
CheckForCollisionWhenPushingBoulder: ; c60b (3:460b)
call GetTileTwoStepsInFrontOfPlayer
- ld hl, W_TILESETCOLLISIONPTR
+ ld hl, wTileSetCollisionPtr
ld a, [hli]
ld h, [hl]
ld l, a
@@ -2471,7 +2471,7 @@
ld [$ffdc], a
ld a, [hl] ; map X position
ld [$ffdd], a
- ld a, [W_NUMSPRITES]
+ ld a, [wNumSprites]
ld c, a
ld de, $f
ld hl, wSpriteStateData2 + $14
@@ -2653,7 +2653,7 @@
call GetPredefRegisters
push hl
ld d, 0
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
add a
add a
ld b, a
@@ -2665,7 +2665,7 @@
ld e, a
ld hl, Tilesets
add hl, de
- ld de, W_TILESETBANK
+ ld de, wTileSetBank
ld c, $b
.copyTilesetHeaderLoop
ld a, [hli]
@@ -2678,7 +2678,7 @@
xor a
ld [$ffd8], a
pop hl
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
push hl
push de
ld hl, DungeonTilesets
@@ -2687,7 +2687,7 @@
pop de
pop hl
jr c, .asm_c797
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
ld b, a
ld a, [hPreviousTileset]
cp b
@@ -2697,12 +2697,12 @@
cp $ff
jr z, .done
call LoadDestinationWarpPosition
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
and $1
- ld [W_YBLOCKCOORD], a
- ld a, [W_XCOORD]
+ ld [wYBlockCoord], a
+ ld a, [wXCoord]
and $1
- ld [W_XBLOCKCOORD], a
+ ld [wXBlockCoord], a
.done
ret
@@ -2711,7 +2711,7 @@
INCLUDE "data/tileset_headers.asm"
IncrementDayCareMonExp: ; c8de (3:48de)
- ld a, [W_DAYCARE_IN_USE]
+ ld a, [wDayCareInUse]
and a
ret z
ld hl, wDayCareMonExp + 2
@@ -2760,7 +2760,7 @@
ld a, [wd732]
bit 5, a
jr nz, .forcedToRideBike
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp SEAFOAM_ISLANDS_5
ret nz
CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE
@@ -2944,7 +2944,7 @@
LoadWildData: ; ceb8 (3:4eb8)
ld hl,WildDataPointers
- ld a,[W_CURMAP]
+ ld a,[wCurMap]
; get wild data for current map
ld c,a
@@ -2955,11 +2955,11 @@
ld h,[hl]
ld l,a ; hl now points to wild data for current map
ld a,[hli]
- ld [W_GRASSRATE],a
+ ld [wGrassRate],a
and a
jr z,.NoGrassData ; if no grass data, skip to surfing data
push hl
- ld de,W_GRASSMONS ; otherwise, load grass data
+ ld de,wGrassMons ; otherwise, load grass data
ld bc,$0014
call CopyData
pop hl
@@ -3000,7 +3000,7 @@
; Alter these based on owned badges.
ld de, wTempObtainedBadgesBooleans
ld hl, wBadgeOrFaceTiles
- ld a, [W_OBTAINEDBADGES]
+ ld a, [wObtainedBadges]
ld b, a
ld c, 8
.CheckBadge
@@ -3106,7 +3106,7 @@
ReplaceTileBlock: ; ee9e (3:6e9e)
call GetPredefRegisters
ld hl, wOverworldMap
- ld a, [W_CURMAPWIDTH]
+ ld a, [wCurMapWidth]
add $6
ld e, a
ld d, $0
@@ -3148,7 +3148,7 @@
ret c ; return if the replaced tile block is above the map view in memory
RedrawMapView: ; eedc (3:6edc)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
inc a
ret z
ld a, [H_AUTOBGTRANSFERENABLED]
@@ -3229,16 +3229,16 @@
INCLUDE "engine/overworld/cut.asm"
MarkTownVisitedAndLoadMissableObjects: ; f113 (3:7113)
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
cp ROUTE_1
jr nc, .notInTown
ld c, a
ld b, FLAG_SET
- ld hl, W_TOWNVISITEDFLAG ; mark town as visited (for flying)
+ ld hl, wTownVisitedFlag ; mark town as visited (for flying)
predef FlagActionPredef
.notInTown
ld hl, MapHSPointers
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
ld b, $0
ld c, a
add hl, bc
@@ -3271,11 +3271,11 @@
ld [H_DIVISOR], a
ld b, $2
call Divide ; divide difference by 3, resulting in the global offset (number of missable items before ours)
- ld a, [W_CURMAP]
+ ld a, [wCurMap]
ld b, a
ld a, [H_DIVIDEND+3]
ld c, a ; store global offset in c
- ld de, W_MISSABLEOBJECTLIST
+ ld de, wMissableObjectList
pop hl
.writeMissableObjectsListLoop
ld a, [hli]
@@ -3298,8 +3298,8 @@
ret
InitializeMissableObjectsFlags: ; f175 (3:7175)
- ld hl, W_MISSABLEOBJECTFLAGS
- ld bc, wMissableObjectFlagsEnd - W_MISSABLEOBJECTFLAGS
+ ld hl, wMissableObjectFlags
+ ld bc, wMissableObjectFlagsEnd - wMissableObjectFlags
xor a
call FillMemory ; clear missable objects flags
ld hl, MapHS00
@@ -3314,7 +3314,7 @@
ld a, [hl]
cp Hide
jr nz, .skip
- ld hl, W_MISSABLEOBJECTFLAGS
+ ld hl, wMissableObjectFlags
ld a, [wMissableObjectCounter]
ld c, a
ld b, FLAG_SET
@@ -3332,7 +3332,7 @@
ld a, [H_CURRENTSPRITEOFFSET]
swap a
ld b, a
- ld hl, W_MISSABLEOBJECTLIST
+ ld hl, wMissableObjectList
.loop
ld a, [hli]
cp $ff
@@ -3342,7 +3342,7 @@
jr nz, .loop
ld c, a
ld b, FLAG_TEST
- ld hl, W_MISSABLEOBJECTFLAGS
+ ld hl, wMissableObjectFlags
call MissableObjectFlagAction
ld a, c
and a
@@ -3357,7 +3357,7 @@
; [wMissableObjectIndex]: index of the missable object to be added (global index)
ShowObject: ; f1c8 (3:71c8)
ShowObject2:
- ld hl, W_MISSABLEOBJECTFLAGS
+ ld hl, wMissableObjectFlags
ld a, [wMissableObjectIndex]
ld c, a
ld b, FLAG_RESET
@@ -3367,7 +3367,7 @@
; removes missable object (items, leg. pokemon, etc.) from the map
; [wMissableObjectIndex]: index of the missable object to be removed (global index)
HideObject: ; f1d7 (3:71d7)
- ld hl, W_MISSABLEOBJECTFLAGS
+ ld hl, wMissableObjectFlags
ld a, [wMissableObjectIndex]
ld c, a
ld b, FLAG_SET
@@ -3619,7 +3619,7 @@
ld a, [wcf91]
ld [wd0b5], a
call GetMonHeader
- ld hl, W_MONHEADER
+ ld hl, wMonHeader
ld a, [hli]
ld [de], a ; species
inc de
@@ -3658,7 +3658,7 @@
pop hl
push hl
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
and a ; is this a wild mon caught in battle?
jr nz, .copyEnemyMonData
@@ -3713,7 +3713,7 @@
ld [de], a
inc de
.copyMonTypesAndMoves
- ld hl, W_MONHTYPES
+ ld hl, wMonHTypes
ld a, [hli] ; type 1
ld [de], a
inc de
@@ -3722,7 +3722,7 @@
inc de
ld a, [hli] ; catch rate (held item in gen 2)
ld [de], a
- ld hl, W_MONHMOVES
+ ld hl, wMonHMoves
ld a, [hli]
inc de
push de
@@ -3751,7 +3751,7 @@
inc de
ld [de], a
push de
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
ld d, a
callab CalcExperience
pop de
@@ -3776,10 +3776,10 @@
pop hl
call AddPartyMon_WriteMovePP
inc de
- ld a, [W_CURENEMYLVL]
+ ld a, [wCurEnemyLVL]
ld [de], a
inc de
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
dec a
jr nz, .calcFreshStats
ld hl, wEnemyMonMaxHP
@@ -3899,7 +3899,7 @@
cp PARTY_TO_DAYCARE
ld hl, wDayCareMon
jr z, .asm_f575
- ld hl, W_NUMINBOX
+ ld hl, wNumInBox
ld a, [hl]
cp MONS_PER_BOX
jr nz, .partyOrBoxNotFull
@@ -3934,7 +3934,7 @@
jr nz, .skipToNewMonEntry
ld hl, wBoxMons
ld bc, wBoxMon2 - wBoxMon1 ; $21
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
.skipToNewMonEntry
dec a
call AddNTimes
@@ -3977,7 +3977,7 @@
.asm_f5b4
ld a, [wMoveMonType]
cp PARTY_TO_DAYCARE
- ld de, W_DAYCAREMONOT
+ ld de, wDayCareMonOT
jr z, .asm_f5d3
dec a
ld hl, wPartyMonOT
@@ -3984,7 +3984,7 @@
ld a, [wPartyCount]
jr nz, .asm_f5cd
ld hl, wBoxMonOT
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
.asm_f5cd
dec a
call SkipFixedLengthTextEntries
@@ -3995,7 +3995,7 @@
ld a, [wMoveMonType]
and a
jr z, .asm_f5e6
- ld hl, W_DAYCAREMONOT
+ ld hl, wDayCareMonOT
cp DAYCARE_TO_PARTY
jr z, .asm_f5ec
ld hl, wPartyMonOT
@@ -4007,7 +4007,7 @@
call CopyData
ld a, [wMoveMonType]
cp PARTY_TO_DAYCARE
- ld de, W_DAYCAREMONNAME
+ ld de, wDayCareMonName
jr z, .asm_f611
dec a
ld hl, wPartyMonNicks
@@ -4014,7 +4014,7 @@
ld a, [wPartyCount]
jr nz, .asm_f60b
ld hl, wBoxMonNicks
- ld a, [W_NUMINBOX]
+ ld a, [wNumInBox]
.asm_f60b
dec a
call SkipFixedLengthTextEntries
@@ -4025,7 +4025,7 @@
ld a, [wMoveMonType]
and a
jr z, .asm_f624
- ld hl, W_DAYCAREMONNAME
+ ld hl, wDayCareMonName
cp DAYCARE_TO_PARTY
jr z, .asm_f62a
ld hl, wPartyMonNicks
@@ -4048,7 +4048,7 @@
call LoadMonData
callba CalcLevelFromExperience
ld a, d
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
pop hl
ld bc, wBoxMon2 - wBoxMon1
add hl, bc
@@ -4470,7 +4470,7 @@
ld hl, wPartyCount
call InitializeEmptyList
- ld hl, W_NUMINBOX
+ ld hl, wNumInBox
call InitializeEmptyList
ld hl, wNumBagItems
call InitializeEmptyList
@@ -4488,7 +4488,7 @@
ld [wMonDataLocation], a
- ld hl, W_OBTAINEDBADGES
+ ld hl, wObtainedBadges
ld [hli], a
ld [hl], a
@@ -4497,8 +4497,8 @@
ld [hli], a
ld [hl], a
- ld hl, W_GAMEPROGRESSFLAGS
- ld bc, wGameProgressFlagsEnd - W_GAMEPROGRESSFLAGS
+ ld hl, wGameProgressFlags
+ ld bc, wGameProgressFlagsEnd - wGameProgressFlags
call FillMemory ; clear all game progress flags
jp InitializeMissableObjectsFlags
--- a/scripts/agatha.asm
+++ b/scripts/agatha.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, AgathaTrainerHeaders
ld de, AgathaScriptPointers
- ld a, [W_AGATHACURSCRIPT]
+ ld a, [wAgathaCurScript]
call ExecuteCurMapScriptInTable
- ld [W_AGATHACURSCRIPT], a
+ ld [wAgathaCurScript], a
ret
AgathaScript_76443: ; 76443 (1d:6443)
@@ -27,7 +27,7 @@
AgathaScript_76464: ; 76464 (1d:6464)
xor a
- ld [W_AGATHACURSCRIPT], a
+ ld [wAgathaCurScript], a
ret
AgathaScriptPointers: ; 76469 (1d:6469)
@@ -53,8 +53,8 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $3
- ld [W_AGATHACURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wAgathaCurScript], a
+ ld [wCurMapScript], a
ret
AgathaScript0: ; 76490 (1d:6490)
@@ -81,8 +81,8 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $3
- ld [W_AGATHACURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wAgathaCurScript], a
+ ld [wCurMapScript], a
ret
CoordsData_764d1: ; 764d1 (1d:64d1)
@@ -99,13 +99,13 @@
call Delay3
xor a
ld [wJoyIgnore], a
- ld [W_AGATHACURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wAgathaCurScript], a
+ ld [wCurMapScript], a
ret
AgathaScript2: ; 764ed (1d:64ed)
call EndTrainerBattle
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, AgathaScript_76464
ld a, $1
@@ -112,7 +112,7 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $1
- ld [W_GARYCURSCRIPT], a
+ ld [wGaryCurScript], a
ret
AgathaTextPointers: ; 76505 (1d:6505)
--- a/scripts/billshouse.asm
+++ b/scripts/billshouse.asm
@@ -1,6 +1,6 @@
BillsHouseScript: ; 1e76a (7:676a)
call EnableAutoTextBoxDrawing
- ld a, [W_BILLSHOUSECURSCRIPT]
+ ld a, [wBillsHouseCurScript]
ld hl, BillsHouseScriptPointers
jp CallFunctionInTable
@@ -26,7 +26,7 @@
ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $2
- ld [W_BILLSHOUSECURSCRIPT], a
+ ld [wBillsHouseCurScript], a
ret
MovementData_1e79c: ; 1e79c (7:679c)
@@ -55,7 +55,7 @@
xor a
ld [wJoyIgnore], a
ld a, $3
- ld [W_BILLSHOUSECURSCRIPT], a
+ ld [wBillsHouseCurScript], a
ret
BillsHouseScript3: ; 1e7c5 (7:67c5)
@@ -84,7 +84,7 @@
ld de, MovementData_1e807
call MoveSprite
ld a, $4
- ld [W_BILLSHOUSECURSCRIPT], a
+ ld [wBillsHouseCurScript], a
ret
MovementData_1e807: ; 1e807 (7:6807)
@@ -104,7 +104,7 @@
SetEvent EVENT_MET_BILL_2 ; this event seems redundant
SetEvent EVENT_MET_BILL
ld a, $0
- ld [W_BILLSHOUSECURSCRIPT], a
+ ld [wBillsHouseCurScript], a
ret
BillsHouseScript5: ; 1e827 (7:6827)
@@ -112,7 +112,7 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $0
- ld [W_BILLSHOUSECURSCRIPT], a
+ ld [wBillsHouseCurScript], a
ret
BillsHouseTextPointers: ; 1e834 (7:6834)
@@ -136,7 +136,7 @@
ld hl, BillsHouseText_1e86a
call PrintText
ld a, $1
- ld [W_BILLSHOUSECURSCRIPT], a
+ ld [wBillsHouseCurScript], a
jr .asm_1e862
.asm_1e85a
ld hl, BillsHouseText_1e86f
--- a/scripts/blueshouse.asm
+++ b/scripts/blueshouse.asm
@@ -1,7 +1,7 @@
BluesHouseScript: ; 19b3b (6:5b3b)
call EnableAutoTextBoxDrawing
ld hl,BluesHouseScriptPointers
- ld a,[W_BLUESHOUSECURSCRIPT]
+ ld a,[wBluesHouseCurScript]
jp CallFunctionInTable
BluesHouseScriptPointers: ; 19b47 (6:5b47)
@@ -13,7 +13,7 @@
; trigger the next script
ld a,1
- ld [W_BLUESHOUSECURSCRIPT],a
+ ld [wBluesHouseCurScript],a
ret
BluesHouseScript1: ; 19b56 (6:5b56)
--- a/scripts/bruno.asm
+++ b/scripts/bruno.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, BrunoTrainerHeaders
ld de, BrunoScriptPointers
- ld a, [W_BRUNOCURSCRIPT]
+ ld a, [wBrunoCurScript]
call ExecuteCurMapScriptInTable
- ld [W_BRUNOCURSCRIPT], a
+ ld [wBrunoCurScript], a
ret
BrunoScript_762ec: ; 762ec (1d:62ec)
@@ -27,7 +27,7 @@
BrunoScript_7630d: ; 7630d (1d:630d)
xor a
- ld [W_BRUNOCURSCRIPT], a
+ ld [wBrunoCurScript], a
ret
BrunoScriptPointers: ; 76312 (1d:6312)
@@ -53,8 +53,8 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $3
- ld [W_BRUNOCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wBrunoCurScript], a
+ ld [wCurMapScript], a
ret
BrunoScript0: ; 76339 (1d:6339)
@@ -81,8 +81,8 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $3
- ld [W_BRUNOCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wBrunoCurScript], a
+ ld [wCurMapScript], a
ret
CoordsData_7637a: ; 7637a (1d:637a)
@@ -99,13 +99,13 @@
call Delay3
xor a
ld [wJoyIgnore], a
- ld [W_BRUNOCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wBrunoCurScript], a
+ ld [wCurMapScript], a
ret
BrunoScript2: ; 76396 (1d:6396)
call EndTrainerBattle
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, BrunoScript_7630d
ld a, $1
--- a/scripts/celadongamecorner.asm
+++ b/scripts/celadongamecorner.asm
@@ -3,7 +3,7 @@
call CeladonGameCornerScript_48bec
call EnableAutoTextBoxDrawing
ld hl, CeladonGameCornerScriptPointers
- ld a, [W_CELADONGAMECORNERCURSCRIPT]
+ ld a, [wCeladonGameCornerCurScript]
jp CallFunctionInTable
CeladonGameCornerScript_48bcf: ; 48bcf (12:4bcf)
@@ -38,8 +38,8 @@
CeladonGameCornerScript_48c07: ; 48c07 (12:4c07)
xor a
ld [wJoyIgnore], a
- ld [W_CELADONGAMECORNERCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wCeladonGameCornerCurScript], a
+ ld [wCurMapScript], a
ret
CeladonGameCornerScriptPointers: ; 48c12 (12:4c12)
@@ -51,7 +51,7 @@
ret
CeladonGameCornerScript1: ; 48c19 (12:4c19)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, CeladonGameCornerScript_48c07
ld a, $f0
@@ -63,13 +63,13 @@
ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
ld de, MovementData_48c5a
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $6
jr nz, .asm_48c43
ld de, MovementData_48c63
jr .asm_48c4d
.asm_48c43
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $8
jr nz, .asm_48c4d
ld de, MovementData_48c63
@@ -78,7 +78,7 @@
ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $2
- ld [W_CELADONGAMECORNERCURSCRIPT], a
+ ld [wCeladonGameCornerCurScript], a
ret
MovementData_48c5a: ; 48c5a (12:4c5a)
@@ -113,7 +113,7 @@
set 5, [hl]
set 6, [hl]
ld a, $0
- ld [W_CELADONGAMECORNERCURSCRIPT], a
+ ld [wCeladonGameCornerCurScript], a
ret
CeladonGameCornerTextPointers: ; 48c8a (12:4c8a)
@@ -424,7 +424,7 @@
ld [hJoyPressed], a
ld [hJoyReleased], a
ld a, $1
- ld [W_CELADONGAMECORNERCURSCRIPT], a
+ ld [wCeladonGameCornerCurScript], a
jp TextScriptEnd
CeladonGameCornerText_48ece: ; 48ece (12:4ece)
--- a/scripts/celadongym.asm
+++ b/scripts/celadongym.asm
@@ -6,9 +6,9 @@
call EnableAutoTextBoxDrawing
ld hl, CeladonGymTrainerHeaders
ld de, CeladonGymScriptPointers
- ld a, [W_CELADONGYMCURSCRIPT]
+ ld a, [wCeladonGymCurScript]
call ExecuteCurMapScriptInTable
- ld [W_CELADONGYMCURSCRIPT], a
+ ld [wCeladonGymCurScript], a
ret
CeladonGymScript_48927: ; 48927 (12:4927)
@@ -25,8 +25,8 @@
CeladonGymText_48943: ; 48943 (12:4943)
xor a
ld [wJoyIgnore], a
- ld [W_CELADONGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wCeladonGymCurScript], a
+ ld [wCurMapScript], a
ret
CeladonGymScriptPointers: ; 4894e (12:494e)
@@ -36,7 +36,7 @@
dw CeladonGymScript3
CeladonGymScript3: ; 48956 (12:4956)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, CeladonGymText_48943
ld a, $f0
@@ -60,7 +60,7 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_4898c
- ld hl, W_OBTAINEDBADGES
+ ld hl, wObtainedBadges
set 3, [hl]
ld hl, wBeatGymFlags
set 3, [hl]
@@ -176,10 +176,10 @@
call EngageMapTrainer
call InitBattleEnemyParameters
ld a, $4
- ld [W_GYMLEADERNO], a
+ ld [wGymLeaderNo], a
ld a, $3
- ld [W_CELADONGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wCeladonGymCurScript], a
+ ld [wCurMapScript], a
.asm_48a5b
jp TextScriptEnd
--- a/scripts/ceruleancity.asm
+++ b/scripts/ceruleancity.asm
@@ -1,13 +1,13 @@
CeruleanCityScript: ; 19480 (6:5480)
call EnableAutoTextBoxDrawing
ld hl, CeruleanCityScriptPointers
- ld a, [W_CERULEANCITYCURSCRIPT]
+ ld a, [wCeruleanCityCurScript]
jp CallFunctionInTable
CeruleanCityScript_1948c: ; 1948c (6:548c)
xor a
ld [wJoyIgnore], a
- ld [W_CERULEANCITYCURSCRIPT], a
+ ld [wCeruleanCityCurScript], a
ld a, HS_CERULEAN_RIVAL
ld [wMissableObjectIndex], a
predef_jump HideObject
@@ -20,7 +20,7 @@
dw CeruleanCityScript4
CeruleanCityScript4: ; 194a7 (6:54a7)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, CeruleanCityScript_1948c
ld a, $f0
@@ -31,7 +31,7 @@
call DisplayTextID
xor a
ld [wJoyIgnore], a
- ld [W_CERULEANCITYCURSCRIPT], a
+ ld [wCeruleanCityCurScript], a
ret
CeruleanCityScript0: ; 194c8 (6:54c8)
@@ -75,7 +75,7 @@
ld [hJoyHeld], a
ld a, $f0
ld [wJoyIgnore], a
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $14
jr z, .asm_19535
ld a, $1
@@ -93,7 +93,7 @@
ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $1
- ld [W_CERULEANCITYCURSCRIPT], a
+ ld [wCeruleanCityCurScript], a
ret
CeruleanCityCoords1: ; 1954f (6:554f)
@@ -135,10 +135,10 @@
ld de, CeruleanCityText_19672
call SaveEndBattleTextPointers
ld a, OPP_SONY1
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
; select which team to use during the encounter
- ld a, [W_RIVALSTARTER]
+ ld a, [wRivalStarter]
cp STARTER2
jr nz, .NotSquirtle
ld a, $7
@@ -151,17 +151,17 @@
.Charmander
ld a, $9
.done
- ld [W_TRAINERNO], a
+ ld [wTrainerNo], a
xor a
ld [hJoyHeld], a
call CeruleanCityScript_1955d
ld a, $2
- ld [W_CERULEANCITYCURSCRIPT], a
+ ld [wCeruleanCityCurScript], a
ret
CeruleanCityScript2: ; 195b1 (6:55b1)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, CeruleanCityScript_1948c
call CeruleanCityScript_1955d
@@ -178,7 +178,7 @@
ld a, $1
ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $14
jr nz, .asm_195f0
ld de, CeruleanCityMovement4
@@ -190,7 +190,7 @@
ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $3
- ld [W_CERULEANCITYCURSCRIPT], a
+ ld [wCeruleanCityCurScript], a
ret
CeruleanCityMovement3: ; 19600 (6:5600)
@@ -224,7 +224,7 @@
ld [wJoyIgnore], a
call PlayDefaultMusic
ld a, $0
- ld [W_CERULEANCITYCURSCRIPT], a
+ ld [wCeruleanCityCurScript], a
ret
CeruleanCityTextPointers: ; 1962d (6:562d)
@@ -294,7 +294,7 @@
call EngageMapTrainer
call InitBattleEnemyParameters
ld a, $4
- ld [W_CERULEANCITYCURSCRIPT], a
+ ld [wCeruleanCityCurScript], a
jp TextScriptEnd
.asm_4ca20
ld hl, CeruleanCityText_196f3
--- a/scripts/ceruleangym.asm
+++ b/scripts/ceruleangym.asm
@@ -6,9 +6,9 @@
call EnableAutoTextBoxDrawing
ld hl, CeruleanGymTrainerHeaders
ld de, CeruleanGymScriptPointers
- ld a, [W_CERULEANGYMCURSCRIPT]
+ ld a, [wCeruleanGymCurScript]
call ExecuteCurMapScriptInTable
- ld [W_CERULEANGYMCURSCRIPT], a
+ ld [wCeruleanGymCurScript], a
ret
CeruleanGymScript_5c6d0: ; 5c6d0 (17:46d0)
@@ -25,8 +25,8 @@
CeruleanGymScript_5c6ed: ; 5c6ed (17:46ed)
xor a
ld [wJoyIgnore], a
- ld [W_CERULEANGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wCeruleanGymCurScript], a
+ ld [wCurMapScript], a
ret
CeruleanGymScriptPointers: ; 5c6f8 (17:46f8)
@@ -36,7 +36,7 @@
dw CeruleanGymScript3
CeruleanGymScript3: ; 5c700 (17:4700)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, CeruleanGymScript_5c6ed
ld a, $f0
@@ -60,7 +60,7 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_5c736
- ld hl, W_OBTAINEDBADGES
+ ld hl, wObtainedBadges
set 1, [hl]
ld hl, wBeatGymFlags
set 1, [hl]
@@ -127,11 +127,11 @@
call EngageMapTrainer
call InitBattleEnemyParameters
ld a, $2
- ld [W_GYMLEADERNO], a
+ ld [wGymLeaderNo], a
xor a
ld [hJoyHeld], a
ld a, $3
- ld [W_CERULEANGYMCURSCRIPT], a
+ ld [wCeruleanGymCurScript], a
.asm_5c7bb
jp TextScriptEnd
--- a/scripts/cinnabargym.asm
+++ b/scripts/cinnabargym.asm
@@ -2,7 +2,7 @@
call CinnabarGymScript_75759
call EnableAutoTextBoxDrawing
ld hl, CinnabarGymScriptPointers
- ld a, [W_CINNABARGYMCURSCRIPT]
+ ld a, [wCinnabarGymCurScript]
jp CallFunctionInTable
CinnabarGymScript_75759: ; 75759 (1d:5759)
@@ -30,8 +30,8 @@
CinnabarGymScript_75792: ; 75792 (1d:5792)
xor a
ld [wJoyIgnore], a
- ld [W_CINNABARGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wCinnabarGymCurScript], a
+ ld [wCurMapScript], a
ld [wOpponentAfterWrongAnswer], a
ret
@@ -64,8 +64,8 @@
.asm_757cb
call MoveSprite
ld a, $1
- ld [W_CINNABARGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wCinnabarGymCurScript], a
+ ld [wCurMapScript], a
ret
MovementData_757d7: ; 757d7 (1d:57d7)
@@ -92,7 +92,7 @@
predef_jump FlagActionPredef
CinnabarGymScript2: ; 757f6 (1d:57f6)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, CinnabarGymScript_75792
ld a, [wTrainerHeaderFlagBit]
@@ -129,12 +129,12 @@
ld [wJoyIgnore], a
ld [wOpponentAfterWrongAnswer], a
ld a, $0
- ld [W_CINNABARGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wCinnabarGymCurScript], a
+ ld [wCurMapScript], a
ret
CinnabarGymScript3: ; 7584a (1d:584a)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, CinnabarGymScript_75792
ld a, $f0
@@ -157,7 +157,7 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_75880
- ld hl, W_OBTAINEDBADGES
+ ld hl, wObtainedBadges
set 6, [hl]
ld hl, wBeatGymFlags
set 6, [hl]
@@ -200,8 +200,8 @@
.asm_758d4
ld a, $3
.asm_758d6
- ld [W_CINNABARGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wCinnabarGymCurScript], a
+ ld [wCurMapScript], a
jp TextScriptEnd
CinnabarGymText1: ; 758df (1d:58df)
@@ -224,7 +224,7 @@
ld de, BlaineEndBattleText
call SaveEndBattleTextPointers
ld a, $7
- ld [W_GYMLEADERNO], a
+ ld [wGymLeaderNo], a
jp CinnabarGymScript_758b7
BlaineBattleText: ; 75914 (1d:5914)
--- a/scripts/cinnabarisland.asm
+++ b/scripts/cinnabarisland.asm
@@ -5,7 +5,7 @@
ResetEvent EVENT_MANSION_SWITCH_ON
ResetEvent EVENT_LAB_STILL_REVIVING_FOSSIL
ld hl, CinnabarIslandScriptPointers
- ld a, [W_CINNABARISLANDCURSCRIPT]
+ ld a, [wCinnabarIslandCurScript]
jp CallFunctionInTable
CinnabarIslandScriptPointers: ; 1ca34 (7:4a34)
@@ -16,10 +16,10 @@
ld b, SECRET_KEY
call IsItemInBag
ret nz
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $4
ret nz
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $12
ret nz
ld a, PLAYER_DIR_UP
@@ -38,7 +38,7 @@
ld [wSpriteStateData1 + 9], a
ld [wJoyIgnore], a
ld a, $1
- ld [W_CINNABARISLANDCURSCRIPT], a
+ ld [wCinnabarIslandCurScript], a
ret
CinnabarIslandScript1: ; 1ca73 (7:4a73)
@@ -47,7 +47,7 @@
ret nz
call Delay3
ld a, $0
- ld [W_CINNABARISLANDCURSCRIPT], a
+ ld [wCinnabarIslandCurScript], a
ret
CinnabarIslandTextPointers: ; 1ca81 (7:4a81)
--- a/scripts/daycarem.asm
+++ b/scripts/daycarem.asm
@@ -7,7 +7,7 @@
DayCareMText1: ; 56254 (15:6254)
TX_ASM
call SaveScreenTilesToBuffer2
- ld a, [W_DAYCARE_IN_USE]
+ ld a, [wDayCareInUse]
and a
jp nz, .daycareInUse
ld hl, DayCareIntroText
@@ -46,7 +46,7 @@
ld hl, DayCareWillLookAfterMonText
call PrintText
ld a, 1
- ld [W_DAYCARE_IN_USE], a
+ ld [wDayCareInUse], a
ld a, PARTY_TO_DAYCARE
ld [wMoveMonType], a
call MoveMon
@@ -60,7 +60,7 @@
.daycareInUse
xor a
- ld hl, W_DAYCAREMONNAME
+ ld hl, wDayCareMonName
call GetPartyMonName
ld a, DAYCARE_DATA
ld [wMonDataLocation], a
@@ -150,7 +150,7 @@
.enoughMoney
xor a
- ld [W_DAYCARE_IN_USE], a
+ ld [wDayCareInUse], a
ld hl, wDayCareNumLevelsGrown
ld [hli], a
inc hl
--- a/scripts/fightingdojo.asm
+++ b/scripts/fightingdojo.asm
@@ -2,16 +2,16 @@
call EnableAutoTextBoxDrawing
ld hl, FightingDojoTrainerHeaders
ld de, FightingDojoScriptPointers
- ld a, [W_FIGHTINGDOJOCURSCRIPT]
+ ld a, [wFightingDojoCurScript]
call ExecuteCurMapScriptInTable
- ld [W_FIGHTINGDOJOCURSCRIPT], a
+ ld [wFightingDojoCurScript], a
ret
FightingDojoScript_5cd70: ; 5cd70 (17:4d70)
xor a
ld [wJoyIgnore], a
- ld [W_FIGHTINGDOJOCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wFightingDojoCurScript], a
+ ld [wCurMapScript], a
ret
FightingDojoScriptPointers: ; 5cd7b (17:4d7b)
@@ -32,10 +32,10 @@
xor a
ld [hJoyHeld], a
ld [wcf0d], a
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $3
ret nz
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $4
ret nz
ld a, $1
@@ -53,7 +53,7 @@
ret
FightingDojoScript3: ; 5cdc6 (17:4dc6)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, FightingDojoScript_5cd70
ld a, [wcf0d]
@@ -76,8 +76,8 @@
call DisplayTextID
xor a
ld [wJoyIgnore], a
- ld [W_FIGHTINGDOJOCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wFightingDojoCurScript], a
+ ld [wCurMapScript], a
ret
FightingDojoTextPointers: ; 5ce03 (17:4e03)
@@ -148,8 +148,8 @@
call EngageMapTrainer
call InitBattleEnemyParameters
ld a, $3
- ld [W_FIGHTINGDOJOCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wFightingDojoCurScript], a
+ ld [wCurMapScript], a
jr .asm_9dba4
.continue1
ld hl, FightingDojoText_5ce9d
--- a/scripts/fuchsiagym.asm
+++ b/scripts/fuchsiagym.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, FuchsiaGymTrainerHeaders
ld de, FuchsiaGymScriptPointers
- ld a, [W_FUCHSIAGYMCURSCRIPT]
+ ld a, [wFuchsiaGymCurScript]
call ExecuteCurMapScriptInTable
- ld [W_FUCHSIAGYMCURSCRIPT], a
+ ld [wFuchsiaGymCurScript], a
ret
FuchsiaGymScript_75453: ; 75453 (1d:5453)
@@ -26,8 +26,8 @@
FuchsiaGymScript_75477: ; 75477 (1d:5477)
xor a
ld [wJoyIgnore], a
- ld [W_FUCHSIAGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wFuchsiaGymCurScript], a
+ ld [wCurMapScript], a
ret
FuchsiaGymScriptPointers: ; 75482 (1d:5482)
@@ -37,7 +37,7 @@
dw FuchsiaGymScript3
FuchsiaGymScript3: ; 7548a (1d:548a)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, FuchsiaGymScript_75477
ld a, $f0
@@ -60,7 +60,7 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_754c0
- ld hl, W_OBTAINEDBADGES
+ ld hl, wObtainedBadges
set 4, [hl]
ld hl, wBeatGymFlags
set 4, [hl]
@@ -167,11 +167,11 @@
call EngageMapTrainer
call InitBattleEnemyParameters
ld a, $5
- ld [W_GYMLEADERNO], a
+ ld [wGymLeaderNo], a
xor a
ld [hJoyHeld], a
ld a, $3
- ld [W_FUCHSIAGYMCURSCRIPT], a
+ ld [wFuchsiaGymCurScript], a
.asm_e84c6
jp TextScriptEnd
--- a/scripts/gary.asm
+++ b/scripts/gary.asm
@@ -1,13 +1,13 @@
GaryScript: ; 75f1d (1d:5f1d)
call EnableAutoTextBoxDrawing
ld hl, GaryScriptPointers
- ld a, [W_GARYCURSCRIPT]
+ ld a, [wGaryCurScript]
jp CallFunctionInTable
GaryScript_75f29: ; 75f29 (1d:5f29)
xor a
ld [wJoyIgnore], a
- ld [W_GARYCURSCRIPT], a
+ ld [wGaryCurScript], a
ret
GaryScriptPointers: ; 75f31 (1d:5f31)
@@ -36,7 +36,7 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $2
- ld [W_GARYCURSCRIPT], a
+ ld [wGaryCurScript], a
ret
RLEMovement75f63: ; 75f63 (1d:5f63)
@@ -52,7 +52,7 @@
call Delay3
xor a
ld [wJoyIgnore], a
- ld hl, W_OPTIONS
+ ld hl, wOptions
res 7, [hl]
ld a, $1
ld [hSpriteIndexOrTextID], a
@@ -65,10 +65,10 @@
ld de, GaryText_760fe
call SaveEndBattleTextPointers
ld a, OPP_SONY3
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
; select which team to use during the encounter
- ld a, [W_RIVALSTARTER]
+ ld a, [wRivalStarter]
cp STARTER2
jr nz, .NotSquirtle
ld a, $1
@@ -81,16 +81,16 @@
.Charmander
ld a, $3
.done
- ld [W_TRAINERNO], a
+ ld [wTrainerNo], a
xor a
ld [hJoyHeld], a
ld a, $3
- ld [W_GARYCURSCRIPT], a
+ ld [wGaryCurScript], a
ret
GaryScript3: ; 75fbb (1d:5fbb)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, GaryScript_75f29
call UpdateSprites
@@ -104,7 +104,7 @@
ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
ld a, $4
- ld [W_GARYCURSCRIPT], a
+ ld [wGaryCurScript], a
ret
GaryScript4: ; 75fe4 (1d:5fe4)
@@ -123,7 +123,7 @@
ld [wMissableObjectIndex], a
predef ShowObject
ld a, $5
- ld [W_GARYCURSCRIPT], a
+ ld [wGaryCurScript], a
ret
MovementData_76014: ; 76014 (1d:6014)
@@ -154,7 +154,7 @@
ld [hSpriteIndexOrTextID], a
call GaryScript_760c8
ld a, $6
- ld [W_GARYCURSCRIPT], a
+ ld [wGaryCurScript], a
ret
GaryScript6: ; 76047 (1d:6047)
@@ -167,7 +167,7 @@
ld [hSpriteIndexOrTextID], a
call GaryScript_760c8
ld a, $7
- ld [W_GARYCURSCRIPT], a
+ ld [wGaryCurScript], a
ret
GaryScript7: ; 7605f (1d:605f)
@@ -184,7 +184,7 @@
ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $8
- ld [W_GARYCURSCRIPT], a
+ ld [wGaryCurScript], a
ret
MovementData_76080: ; 76080 (1d:6080)
@@ -200,7 +200,7 @@
ld [wMissableObjectIndex], a
predef HideObject
ld a, $9
- ld [W_GARYCURSCRIPT], a
+ ld [wGaryCurScript], a
ret
GaryScript9: ; 76099 (1d:6099)
@@ -213,7 +213,7 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $a
- ld [W_GARYCURSCRIPT], a
+ ld [wGaryCurScript], a
ret
RLEMovement760b4: ; 760b4 (1d:60b4)
@@ -228,7 +228,7 @@
xor a
ld [wJoyIgnore], a
ld a, $0
- ld [W_GARYCURSCRIPT], a
+ ld [wGaryCurScript], a
ret
GaryScript_760c8: ; 760c8 (1d:60c8)
@@ -278,7 +278,7 @@
GaryText3: ; 7610d (1d:610d)
TX_ASM
- ld a, [W_PLAYERSTARTER]
+ ld a, [wPlayerStarter]
ld [wd11e], a
call GetMonName
ld hl, GaryText_76120
--- a/scripts/halloffameroom.asm
+++ b/scripts/halloffameroom.asm
@@ -1,13 +1,13 @@
HallofFameRoomScript: ; 5a49e (16:649e)
call EnableAutoTextBoxDrawing
ld hl, HallofFameRoomScriptPointers
- ld a, [W_HALLOFFAMEROOMCURSCRIPT]
+ ld a, [wHallOfFameRoomCurScript]
jp CallFunctionInTable
HallofFameRoomScript_5a4aa: ; 5a4aa (16:64aa)
xor a
ld [wJoyIgnore], a
- ld [W_HALLOFFAMEROOMCURSCRIPT], a
+ ld [wHallOfFameRoomCurScript], a
ret
HallofFameRoomScriptPointers: ; 5a4b2 (16:64b2)
@@ -28,21 +28,21 @@
predef HallOfFamePC
pop af
ld [wLetterPrintingDelayFlags], a
- ld hl, W_FLAGS_D733
+ ld hl, wFlags_D733
res 1, [hl]
inc hl
set 0, [hl]
xor a
- ld hl, W_LORELEICURSCRIPT
+ ld hl, wLoreleiCurScript
ld [hli], a
ld [hli], a
ld [hl], a
- ld [W_LANCECURSCRIPT], a
- ld [W_HALLOFFAMEROOMCURSCRIPT], a
+ ld [wLanceCurScript], a
+ ld [wHallOfFameRoomCurScript], a
; Elite 4 events
ResetEventRange ELITE4_EVENTS_START, ELITE4_CHAMPION_EVENTS_END, 1
xor a
- ld [W_HALLOFFAMEROOMCURSCRIPT], a
+ ld [wHallOfFameRoomCurScript], a
ld a, PALLET_TOWN
ld [wLastBlackoutMap], a
callba SaveSAVtoSRAM
@@ -65,7 +65,7 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $1
- ld [W_HALLOFFAMEROOMCURSCRIPT], a
+ ld [wHallOfFameRoomCurScript], a
ret
RLEMovement5a528: ; 5a528 (16:6528)
@@ -98,7 +98,7 @@
ld [wMissableObjectIndex], a
predef HideObject
ld a, $2
- ld [W_HALLOFFAMEROOMCURSCRIPT], a
+ ld [wHallOfFameRoomCurScript], a
ret
HallofFameRoomTextPointers: ; 5a56a (16:656a)
--- a/scripts/lab4.asm
+++ b/scripts/lab4.asm
@@ -74,7 +74,7 @@
ld hl, Lab4Text_75dd5
call PrintText
SetEvent EVENT_LAB_HANDING_OVER_FOSSIL_MON
- ld a, [W_FOSSILMON]
+ ld a, [wFossilMon]
ld b, a
ld c, 30
call GivePokemon
--- a/scripts/lance.asm
+++ b/scripts/lance.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, LanceTrainerHeaders
ld de, LanceScriptPointers
- ld a, [W_LANCECURSCRIPT]
+ ld a, [wLanceCurScript]
call ExecuteCurMapScriptInTable
- ld [W_LANCECURSCRIPT], a
+ ld [wLanceCurScript], a
ret
LanceScript_5a2c4: ; 5a2c4 (16:62c4)
@@ -37,7 +37,7 @@
LanceScript_5a2f5: ; 5a2f5 (16:62f5)
xor a
- ld [W_LANCECURSCRIPT], a
+ ld [wLanceCurScript], a
ret
LanceScriptPointers: ; 5a2fa (16:62fa)
@@ -85,7 +85,7 @@
LanceScript2: ; 5a349 (16:6349)
call EndTrainerBattle
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, LanceScript_5a2f5
ld a, $1
@@ -102,8 +102,8 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $3
- ld [W_LANCECURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wLanceCurScript], a
+ ld [wCurMapScript], a
ret
RLEList_5a379: ; 5a379 (16:6379)
@@ -120,8 +120,8 @@
call Delay3
xor a
ld [wJoyIgnore], a
- ld [W_LANCECURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wLanceCurScript], a
+ ld [wCurMapScript], a
ret
LanceTextPointers: ; 5a395 (16:6395)
--- a/scripts/lorelei.asm
+++ b/scripts/lorelei.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, LoreleiTrainerHeaders
ld de, LoreleiScriptPointers
- ld a, [W_LORELEICURSCRIPT]
+ ld a, [wLoreleiCurScript]
call ExecuteCurMapScriptInTable
- ld [W_LORELEICURSCRIPT], a
+ ld [wLoreleiCurScript], a
ret
LoreleiScript_76191: ; 76191 (1d:6191)
@@ -28,7 +28,7 @@
LoreleiScript_761b6: ; 761b6 (1d:61b6)
xor a
- ld [W_LORELEICURSCRIPT], a
+ ld [wLoreleiCurScript], a
ret
LoreleiScriptPointers: ; 761bb (1d:61bb)
@@ -54,8 +54,8 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $3
- ld [W_LORELEICURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wLoreleiCurScript], a
+ ld [wCurMapScript], a
ret
LoreleiScript0: ; 761e2 (1d:61e2)
@@ -82,8 +82,8 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $3
- ld [W_LORELEICURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wLoreleiCurScript], a
+ ld [wCurMapScript], a
ret
CoordsData_76223: ; 76223 (1d:6223)
@@ -100,12 +100,12 @@
call Delay3
xor a
ld [wJoyIgnore], a
- ld [W_LORELEICURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wLoreleiCurScript], a
+ ld [wCurMapScript], a
ret
LoreleiScript2: ; 7623f (1d:623f)
call EndTrainerBattle
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, LoreleiScript_761b6
ld a, $1
--- a/scripts/mansion1.asm
+++ b/scripts/mansion1.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, Mansion1TrainerHeaders
ld de, Mansion1ScriptPointers
- ld a, [W_MANSION1CURSCRIPT]
+ ld a, [wMansion1CurScript]
call ExecuteCurMapScriptInTable
- ld [W_MANSION1CURSCRIPT], a
+ ld [wMansion1CurScript], a
ret
Mansion1Subscript1: ; 442c5 (11:42c5)
--- a/scripts/mansion2.asm
+++ b/scripts/mansion2.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, Mansion2TrainerHeaders
ld de, Mansion2ScriptPointers
- ld a, [W_MANSION2CURSCRIPT]
+ ld a, [wMansion2CurScript]
call ExecuteCurMapScriptInTable
- ld [W_MANSION2CURSCRIPT], a
+ ld [wMansion2CurScript], a
ret
Mansion2Script_51fee: ; 51fee (14:5fee)
--- a/scripts/mansion3.asm
+++ b/scripts/mansion3.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, Mansion3TrainerHeader0
ld de, Mansion3ScriptPointers
- ld a, [W_MANSION3CURSCRIPT]
+ ld a, [wMansion3CurScript]
call ExecuteCurMapScriptInTable
- ld [W_MANSION3CURSCRIPT], a
+ ld [wMansion3CurScript], a
ret
Mansion3Script_52204: ; 52204 (14:6204)
--- a/scripts/mansion4.asm
+++ b/scripts/mansion4.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, Mansion4TrainerHeader0
ld de, Mansion4ScriptPointers
- ld a, [W_MANSION4CURSCRIPT]
+ ld a, [wMansion4CurScript]
call ExecuteCurMapScriptInTable
- ld [W_MANSION4CURSCRIPT], a
+ ld [wMansion4CurScript], a
ret
Mansion4Script_523cf: ; 523cf (14:63cf)
--- a/scripts/mtmoon1.asm
+++ b/scripts/mtmoon1.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, MtMoon1TrainerHeader0
ld de, MtMoon1ScriptPointers
- ld a, [W_MTMOON1CURSCRIPT]
+ ld a, [wMtMoon1CurScript]
call ExecuteCurMapScriptInTable
- ld [W_MTMOON1CURSCRIPT], a
+ ld [wMtMoon1CurScript], a
ret
MtMoon1ScriptPointers: ; 499db (12:59db)
--- a/scripts/mtmoon3.asm
+++ b/scripts/mtmoon3.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, MtMoon3TrainerHeader0
ld de, MtMoon3ScriptPointers
- ld a, [W_MTMOON3CURSCRIPT]
+ ld a, [wMtMoon3CurScript]
call ExecuteCurMapScriptInTable
- ld [W_MTMOON3CURSCRIPT], a
+ ld [wMtMoon3CurScript], a
CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
ret z
ld hl, CoordsData_49d37
@@ -40,8 +40,8 @@
MtMoon3Script_49d58: ; 49d58 (12:5d58)
xor a
ld [wJoyIgnore], a
- ld [W_MTMOON3CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wMtMoon3CurScript], a
+ ld [wCurMapScript], a
ret
MtMoon3ScriptPointers: ; 49d63 (12:5d63)
@@ -55,10 +55,10 @@
MtMoon3Script0: ; 49d6f (12:5d6f)
CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
jp nz, MtMoon3Script_49d91
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $8
jp nz, MtMoon3Script_49d91
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $d
jp nz, MtMoon3Script_49d91
xor a
@@ -73,7 +73,7 @@
ret
MtMoon3Script3: ; 49d9a (12:5d9a)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, MtMoon3Script_49d58
call UpdateSprites
@@ -82,8 +82,8 @@
xor a
ld [wJoyIgnore], a
ld a, $0
- ld [W_MTMOON3CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wMtMoon3CurScript], a
+ ld [wCurMapScript], a
ret
MtMoon3Script4: ; 49dba (12:5dba)
@@ -105,8 +105,8 @@
ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $5
- ld [W_MTMOON3CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wMtMoon3CurScript], a
+ ld [wCurMapScript], a
ret
CoordsData_49dea: ; 49dea (12:5dea)
@@ -150,8 +150,8 @@
xor a
ld [wJoyIgnore], a
ld a, $0
- ld [W_MTMOON3CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wMtMoon3CurScript], a
+ ld [wCurMapScript], a
ret
MtMoon3TextPointers: ; 49e34 (12:5e34)
@@ -228,8 +228,8 @@
call EngageMapTrainer
call InitBattleEnemyParameters
ld a, $3
- ld [W_MTMOON3CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wMtMoon3CurScript], a
+ ld [wCurMapScript], a
jr .asm_49ebe
.asm_49eb8
ld hl, MtMoon3Text_49f94
@@ -280,8 +280,8 @@
predef HideObject
SetEvent EVENT_GOT_DOME_FOSSIL
ld a, $4
- ld [W_MTMOON3CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wMtMoon3CurScript], a
+ ld [wCurMapScript], a
.asm_49f21
jp TextScriptEnd
@@ -308,8 +308,8 @@
predef HideObject
SetEvent EVENT_GOT_HELIX_FOSSIL
ld a, $4
- ld [W_MTMOON3CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wMtMoon3CurScript], a
+ ld [wCurMapScript], a
.asm_49f61
jp TextScriptEnd
--- a/scripts/museum1f.asm
+++ b/scripts/museum1f.asm
@@ -4,7 +4,7 @@
xor a
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, Museum1FScriptPointers
- ld a, [W_MUSEUM1FCURSCRIPT]
+ ld a, [wMuseum1fCurScript]
jp CallFunctionInTable
Museum1FScriptPointers: ; 5c109 (17:4109)
@@ -12,13 +12,13 @@
dw Museum1FScript1
Museum1FScript0: ; 5c10d (17:410d)
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $4
ret nz
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $9
jr z, .asm_5c120
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $a
ret nz
.asm_5c120
@@ -40,10 +40,10 @@
Museum1FText1: ; 5c135 (17:4135)
TX_ASM
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $4
jr nz, .asm_8774b
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $d
jp z, Museum1FScript_5c1f9
jr .asm_b8709
@@ -50,7 +50,7 @@
.asm_8774b
cp $3
jr nz, .asm_d49e7
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $c
jp z, Museum1FScript_5c1f9
.asm_d49e7
@@ -120,7 +120,7 @@
jr Museum1FScriptEnd
.asm_0b094
ld a, $1
- ld [W_MUSEUM1FCURSCRIPT], a
+ ld [wMuseum1fCurScript], a
jr Museum1FScriptEnd
Museum1FScript_5c1f9: ; 5c1f9 (17:41f9)
--- a/scripts/oakslab.asm
+++ b/scripts/oakslab.asm
@@ -6,7 +6,7 @@
xor a
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, OaksLabScriptPointers
- ld a, [W_OAKSLABCURSCRIPT]
+ ld a, [wOaksLabCurScript]
jp CallFunctionInTable
OaksLabScriptPointers: ; 1cb28 (7:4b28)
@@ -43,7 +43,7 @@
res 4, [hl]
ld a, $1
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript1: ; 1cb6e (7:4b6e)
@@ -53,7 +53,7 @@
call MoveSprite
ld a, $2
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OakEntryMovement: ; 1cb7e (7:4b7e)
@@ -74,7 +74,7 @@
predef ShowObject
ld a, $3
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript3: ; 1cba2 (7:4ba2)
@@ -97,7 +97,7 @@
call SetSpriteFacingDirectionAndDelay
ld a, $4
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
PlayerEntryMovementRLE: ; 1cbcf (7:4bcf)
@@ -116,12 +116,12 @@
ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
call UpdateSprites
- ld hl, W_FLAGS_D733
+ ld hl, wFlags_D733
res 1, [hl]
call PlayDefaultMusic
ld a, $5
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript5: ; 1cbfd (7:4bfd)
@@ -147,11 +147,11 @@
ld [wJoyIgnore], a
ld a, $6
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript6: ; 1cc36 (7:4c36)
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $6
ret nz
ld a, $5
@@ -177,7 +177,7 @@
ld [wPlayerMovingDirection], a
ld a, $7
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript7: ; 1cc72 (7:4c72)
@@ -187,11 +187,11 @@
call Delay3
ld a, $6
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript8: ; 1cc80 (7:4c80)
- ld a, [W_PLAYERSTARTER]
+ ld a, [wPlayerStarter]
cp STARTER1
jr z, .Charmander
cp STARTER2
@@ -199,7 +199,7 @@
jr .Bulbasaur
.Charmander
ld de, .MiddleBallMovement1
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $4 ; is the player standing below the table?
jr z, .asm_1ccf3
ld de, .MiddleBallMovement2
@@ -223,7 +223,7 @@
.Squirtle
ld de, .RightBallMovement1
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $4 ; is the player standing below the table?
jr z, .asm_1ccf3
ld de, .RightBallMovement2
@@ -249,7 +249,7 @@
.Bulbasaur
ld de, .LeftBallMovement1
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $9 ; is the player standing to the right of the table?
jr nz, .asm_1ccf3
push hl
@@ -285,7 +285,7 @@
call MoveSprite
ld a, $9
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript9: ; 1cd00 (7:4d00)
@@ -319,7 +319,7 @@
predef HideObject
call Delay3
ld a, [wRivalStarterTemp]
- ld [W_RIVALSTARTER], a
+ ld [wRivalStarter], a
ld [wcf91], a
ld [wd11e], a
call GetMonName
@@ -336,11 +336,11 @@
ld [wJoyIgnore], a
ld a, $a
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript10: ; 1cd6d (7:4d6d)
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $6
ret nz
ld a, $1
@@ -372,7 +372,7 @@
call MoveSprite
ld a, $b
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript11: ; 1cdb9 (7:4db9)
@@ -382,8 +382,8 @@
; define which team rival uses, and fight it
ld a, OPP_SONY1
- ld [W_CUROPPONENT], a
- ld a, [W_RIVALSTARTER]
+ ld [wCurOpponent], a
+ ld a, [wRivalStarter]
cp STARTER2
jr nz, .NotSquirtle
ld a, $1
@@ -396,7 +396,7 @@
.Charmander
ld a, $3
.done
- ld [W_TRAINERNO], a
+ ld [wTrainerNo], a
ld a, $1
ld [wSpriteIndex], a
call GetSpritePosition1
@@ -411,7 +411,7 @@
ld a, PLAYER_DIR_UP
ld [wPlayerMovingDirection], a
ld a, $c
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript12: ; 1ce03 (7:4e03)
@@ -432,7 +432,7 @@
SetEvent EVENT_BATTLED_RIVAL_IN_OAKS_LAB
ld a, $d
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript13: ; 1ce32 (7:4e32)
@@ -446,7 +446,7 @@
ld [H_SPRITEINDEX], a
ld de, .RivalExitMovement
call MoveSprite
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $4
; move left or right depending on where the player is standing
jr nz, .moveLeft
@@ -458,7 +458,7 @@
ld [wNPCMovementDirections], a
ld a, $e
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
.RivalExitMovement
@@ -481,7 +481,7 @@
ld [wJoyIgnore], a
call PlayDefaultMusic ; reset to map music
ld a, $12
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
jr .done
; make the player keep facing the rival as he walks away
.asm_1ce8c
@@ -488,7 +488,7 @@
ld a, [wNPCNumScriptedSteps]
cp $5
jr nz, .asm_1cea8
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $4
jr nz, .asm_1cea1
ld a, SPRITE_FACING_RIGHT
@@ -535,7 +535,7 @@
call MoveSprite
ld a, $10
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript_1cefd: ; 1cefd (7:4efd)
@@ -621,7 +621,7 @@
call MoveSprite
ld a, $11
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript17: ; 1cfd4 (7:4fd4)
@@ -639,12 +639,12 @@
ld [wMissableObjectIndex], a
predef ShowObject
ld a, $5
- ld [W_PALLETTOWNCURSCRIPT], a
+ ld [wPalletTownCurScript], a
xor a
ld [wJoyIgnore], a
ld a, $12
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
ret
OaksLabScript18: ; 1d009 (7:5009)
@@ -675,7 +675,7 @@
ld [$ffeb], a
ld a, $8
ld [$ffee], a
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $3
jr nz, .asm_1d045
ld a, $4
@@ -695,7 +695,7 @@
ld a, $3
ld [wNPCMovementDirections2Index], a
ld b, $a
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $4
jr nz, .asm_1d066
ld a, $40
@@ -714,9 +714,9 @@
OaksLabScript_1d076: ; 1d076 (7:5076)
ld hl, OaksLabTextPointers + $36 ; starts at OaksLabText28
ld a, l
- ld [W_MAPTEXTPTR], a
+ ld [wMapTextPtr], a
ld a, h
- ld [W_MAPTEXTPTR+1], a
+ ld [wMapTextPtr+1], a
ret
OaksLabTextPointers: ; 1d082 (7:5082)
@@ -898,7 +898,7 @@
and a
jr nz, OaksLabMonChoiceEnd
ld a, [wcf91]
- ld [W_PLAYERSTARTER], a
+ ld [wPlayerStarter], a
ld [wd11e], a
call GetMonName
ld a, [wSpriteIndex]
@@ -925,7 +925,7 @@
xor a ; PLAYER_PARTY_DATA
ld [wMonDataLocation], a
ld a, 5
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
ld a, [wcf91]
ld [wd11e], a
call AddPartyMon
@@ -934,7 +934,7 @@
ld a, $fc
ld [wJoyIgnore], a
ld a, $8
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
OaksLabMonChoiceEnd: ; 1d21f (7:521f)
jp TextScriptEnd
@@ -1013,7 +1013,7 @@
call PrintText
call OaksLabScript_RemoveParcel
ld a, $f
- ld [W_OAKSLABCURSCRIPT], a
+ ld [wOaksLabCurScript], a
jr .asm_1d2ed
.asm_1d2c8
ld hl, OaksLabAroundWorldText
--- a/scripts/pallettown.asm
+++ b/scripts/pallettown.asm
@@ -5,7 +5,7 @@
.next
call EnableAutoTextBoxDrawing
ld hl,PalletTownScriptPointers
- ld a,[W_PALLETTOWNCURSCRIPT]
+ ld a,[wPalletTownCurScript]
jp CallFunctionInTable
PalletTownScriptPointers: ; 18e73 (6:4e73)
@@ -20,7 +20,7 @@
PalletTownScript0: ; 18e81 (6:4e81)
CheckEvent EVENT_FOLLOWED_OAK_INTO_LAB
ret nz
- ld a,[W_YCOORD]
+ ld a,[wYCoord]
cp 1 ; is player near north exit?
ret nz
xor a
@@ -39,7 +39,7 @@
; trigger the next script
ld a,1
- ld [W_PALLETTOWNCURSCRIPT],a
+ ld [wPalletTownCurScript],a
ret
PalletTownScript1: ; 18eb2 (6:4eb2)
@@ -56,7 +56,7 @@
; trigger the next script
ld a,2
- ld [W_PALLETTOWNCURSCRIPT],a
+ ld [wPalletTownCurScript],a
ret
PalletTownScript2: ; 18ed2 (6:4ed2)
@@ -67,7 +67,7 @@
call SetSpriteFacingDirectionAndDelay
call Delay3
ld a,1
- ld [W_YCOORD],a
+ ld [wYCoord],a
ld a,1
ld [hNPCPlayerRelativePosPerspective],a
ld a,1
@@ -86,7 +86,7 @@
; trigger the next script
ld a,3
- ld [W_PALLETTOWNCURSCRIPT],a
+ ld [wPalletTownCurScript],a
ret
PalletTownScript3: ; 18f12 (6:4f12)
@@ -116,7 +116,7 @@
; trigger the next script
ld a,4
- ld [W_PALLETTOWNCURSCRIPT],a
+ ld [wPalletTownCurScript],a
ret
PalletTownScript4: ; 18f4b (6:4f4b)
@@ -126,7 +126,7 @@
; trigger the next script
ld a,5
- ld [W_PALLETTOWNCURSCRIPT],a
+ ld [wPalletTownCurScript],a
ret
PalletTownScript5: ; 18f56 (6:4f56)
--- a/scripts/pewtercity.asm
+++ b/scripts/pewtercity.asm
@@ -1,7 +1,7 @@
PewterCityScript: ; 19237 (6:5237)
call EnableAutoTextBoxDrawing
ld hl, PewterCityScriptPointers
- ld a, [W_PEWTERCITYCURSCRIPT]
+ ld a, [wPewterCityCurScript]
jp CallFunctionInTable
PewterCityScriptPointers: ; 19243 (6:5243)
@@ -15,7 +15,7 @@
PewterCityScript0: ; 19251 (6:5251)
xor a
- ld [W_MUSEUM1FCURSCRIPT], a
+ ld [wMuseum1fCurScript], a
ResetEvent EVENT_BOUGHT_MUSEUM_TICKET
call PewterCityScript_1925e
ret
@@ -73,7 +73,7 @@
ld de, MovementData_PewterMuseumGuyExit
call MoveSprite
ld a, $2
- ld [W_PEWTERCITYCURSCRIPT], a
+ ld [wPewterCityCurScript], a
ret
MovementData_PewterMuseumGuyExit: ; 192ce (6:52ce)
@@ -91,7 +91,7 @@
ld [wMissableObjectIndex], a
predef HideObject
ld a, $3
- ld [W_PEWTERCITYCURSCRIPT], a
+ ld [wPewterCityCurScript], a
ret
PewterCityScript3: ; 192e9 (6:52e9)
@@ -104,7 +104,7 @@
xor a
ld [wJoyIgnore], a
ld a, $0
- ld [W_PEWTERCITYCURSCRIPT], a
+ ld [wPewterCityCurScript], a
ret
PewterCityScript4: ; 19305 (6:5305)
@@ -141,7 +141,7 @@
ld de, MovementData_PewterGymGuyExit
call MoveSprite
ld a, $5
- ld [W_PEWTERCITYCURSCRIPT], a
+ ld [wPewterCityCurScript], a
ret
MovementData_PewterGymGuyExit: ; 19353 (6:5353)
@@ -160,7 +160,7 @@
ld [wMissableObjectIndex], a
predef HideObject
ld a, $6
- ld [W_PEWTERCITYCURSCRIPT], a
+ ld [wPewterCityCurScript], a
ret
PewterCityScript6: ; 1936f (6:536f)
@@ -173,7 +173,7 @@
xor a
ld [wJoyIgnore], a
ld a, $0
- ld [W_PEWTERCITYCURSCRIPT], a
+ ld [wPewterCityCurScript], a
ret
PewterCityTextPointers: ; 1938b (6:538b)
@@ -226,7 +226,7 @@
ld [wSpriteIndex], a
call GetSpritePosition2
ld a, $1
- ld [W_PEWTERCITYCURSCRIPT], a
+ ld [wPewterCityCurScript], a
.asm_193ee
jp TextScriptEnd
@@ -290,7 +290,7 @@
ld [wSpriteIndex], a
call GetSpritePosition2
ld a, $4
- ld [W_PEWTERCITYCURSCRIPT], a
+ ld [wPewterCityCurScript], a
jp TextScriptEnd
PewterCityText_1945d: ; 1945d (6:545d)
--- a/scripts/pewtergym.asm
+++ b/scripts/pewtergym.asm
@@ -6,9 +6,9 @@
call EnableAutoTextBoxDrawing
ld hl, PewterGymTrainerHeaders
ld de, PewterGymScriptPointers
- ld a, [W_PEWTERGYMCURSCRIPT]
+ ld a, [wPewterGymCurScript]
call ExecuteCurMapScriptInTable
- ld [W_PEWTERGYMCURSCRIPT], a
+ ld [wPewterGymCurScript], a
ret
PewterGymScript_5c3a4: ; 5c3a4 (17:43a4)
@@ -25,8 +25,8 @@
PewterGymScript_5c3bf: ; 5c3bf (17:43bf)
xor a
ld [wJoyIgnore], a
- ld [W_PEWTERGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPewterGymCurScript], a
+ ld [wCurMapScript], a
ret
PewterGymScriptPointers: ; 5c3ca (17:43ca)
@@ -36,7 +36,7 @@
dw PewterGymScript3
PewterGymScript3: ; 5c3d2 (17:43d2)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, PewterGymScript_5c3bf
ld a, $f0
@@ -60,7 +60,7 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_5c408
- ld hl, W_OBTAINEDBADGES
+ ld hl, wObtainedBadges
set 0, [hl]
ld hl, wBeatGymFlags
set 0, [hl]
@@ -126,12 +126,12 @@
call EngageMapTrainer
call InitBattleEnemyParameters
ld a, $1
- ld [W_GYMLEADERNO], a
+ ld [wGymLeaderNo], a
xor a
ld [hJoyHeld], a
ld a, $3
- ld [W_PEWTERGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPewterGymCurScript], a
+ ld [wCurMapScript], a
.asm_5c49b
jp TextScriptEnd
--- a/scripts/pokemontower2.asm
+++ b/scripts/pokemontower2.asm
@@ -1,14 +1,14 @@
PokemonTower2Script: ; 604f2 (18:44f2)
call EnableAutoTextBoxDrawing
ld hl, PokemonTower2ScriptPointers
- ld a, [W_POKEMONTOWER2CURSCRIPT]
+ ld a, [wPokemonTower2CurScript]
jp CallFunctionInTable
PokemonTower2Script_604fe: ; 604fe (18:44fe)
xor a
ld [wJoyIgnore], a
- ld [W_POKEMONTOWER2CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower2CurScript], a
+ ld [wCurMapScript], a
ret
PokemonTower2ScriptPointers: ; 60509 (18:4509)
@@ -59,7 +59,7 @@
db $0F ; isn't this supposed to end in $ff?
PokemonTower2Script1: ; 60563 (18:4563)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, PokemonTower2Script_604fe
ld a, $f0
@@ -81,8 +81,8 @@
call PlaySound
callba Music_RivalAlternateStart
ld a, $2
- ld [W_POKEMONTOWER2CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower2CurScript], a
+ ld [wCurMapScript], a
ret
MovementData_605a9: ; 605a9 (18:45a9)
@@ -118,8 +118,8 @@
ld [wJoyIgnore], a
call PlayDefaultMusic
ld a, $0
- ld [W_POKEMONTOWER2CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower2CurScript], a
+ ld [wCurMapScript], a
ret
PokemonTower2TextPointers: ; 605db (18:45db)
@@ -143,10 +143,10 @@
ld de, PokemonTower2Text_60637
call SaveEndBattleTextPointers
ld a, OPP_SONY2
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
; select which team to use during the encounter
- ld a, [W_RIVALSTARTER]
+ ld a, [wRivalStarter]
cp STARTER2
jr nz, .NotSquirtle
ld a, $4
@@ -159,11 +159,11 @@
.Charmander
ld a, $6
.done
- ld [W_TRAINERNO], a
+ ld [wTrainerNo], a
ld a, $1
- ld [W_POKEMONTOWER2CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower2CurScript], a
+ ld [wCurMapScript], a
.asm_41852
jp TextScriptEnd
--- a/scripts/pokemontower3.asm
+++ b/scripts/pokemontower3.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, PokemonTower3TrainerHeaders
ld de, PokemonTower3ScriptPointers
- ld a, [W_POKEMONTOWER3CURSCRIPT]
+ ld a, [wPokemonTower3CurScript]
call ExecuteCurMapScriptInTable
- ld [W_POKEMONTOWER3CURSCRIPT], a
+ ld [wPokemonTower3CurScript], a
ret
PokemonTower3ScriptPointers: ; 606df (18:46df)
--- a/scripts/pokemontower4.asm
+++ b/scripts/pokemontower4.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, PokemonTower4TrainerHeaders
ld de, PokemonTower4ScriptPointers
- ld a, [W_POKEMONTOWER4CURSCRIPT]
+ ld a, [wPokemonTower4CurScript]
call ExecuteCurMapScriptInTable
- ld [W_POKEMONTOWER4CURSCRIPT], a
+ ld [wPokemonTower4CurScript], a
ret
PokemonTower4ScriptPointers: ; 60809 (18:4809)
--- a/scripts/pokemontower5.asm
+++ b/scripts/pokemontower5.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, PokemonTower5TrainerHeaders
ld de, PokemonTower5ScriptPointers
- ld a, [W_POKEMONTOWER5CURSCRIPT]
+ ld a, [wPokemonTower5CurScript]
call ExecuteCurMapScriptInTable
- ld [W_POKEMONTOWER5CURSCRIPT], a
+ ld [wPokemonTower5CurScript], a
ret
PokemonTower5ScriptPointers: ; 60945 (18:4945)
--- a/scripts/pokemontower6.asm
+++ b/scripts/pokemontower6.asm
@@ -2,16 +2,16 @@
call EnableAutoTextBoxDrawing
ld hl, PokemonTower6TrainerHeaders
ld de, PokemonTower6ScriptPointers
- ld a, [W_POKEMONTOWER6CURSCRIPT]
+ ld a, [wPokemonTower6CurScript]
call ExecuteCurMapScriptInTable
- ld [W_POKEMONTOWER6CURSCRIPT], a
+ ld [wPokemonTower6CurScript], a
ret
PokemonTower6Script_60b02: ; 60b02 (18:4b02)
xor a
ld [wJoyIgnore], a
- ld [W_POKEMONTOWER6CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower6CurScript], a
+ ld [wCurMapScript], a
ret
PokemonTower6ScriptPointers: ; 60b0d (18:4b0d)
@@ -33,12 +33,12 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, MAROWAK
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
ld a, 30
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
ld a, $4
- ld [W_POKEMONTOWER6CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower6CurScript], a
+ ld [wCurMapScript], a
ret
CoordsData_60b45: ; 60b45 (18:4b45)
@@ -45,7 +45,7 @@
db $10,$0A,$FF
PokemonTower6Script4: ; 60b48 (18:4b48)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, PokemonTower6Script_60b02
ld a, $ff
@@ -66,8 +66,8 @@
xor a
ld [wJoyIgnore], a
ld a, $0
- ld [W_POKEMONTOWER6CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower6CurScript], a
+ ld [wCurMapScript], a
ret
.asm_60b82
ld a, $1
@@ -80,8 +80,8 @@
ld hl, wd730
set 7, [hl]
ld a, $3
- ld [W_POKEMONTOWER6CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower6CurScript], a
+ ld [wCurMapScript], a
ret
PokemonTower6Script3: ; 60ba1 (18:4ba1)
@@ -90,8 +90,8 @@
ret nz
call Delay3
xor a
- ld [W_POKEMONTOWER6CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower6CurScript], a
+ ld [wCurMapScript], a
ret
PokemonTower6TextPointers: ; 60bb1 (18:4bb1)
--- a/scripts/pokemontower7.asm
+++ b/scripts/pokemontower7.asm
@@ -2,16 +2,16 @@
call EnableAutoTextBoxDrawing
ld hl, PokemonTower7TrainerHeaders
ld de, PokemonTower7ScriptPointers
- ld a, [W_POKEMONTOWER7CURSCRIPT]
+ ld a, [wPokemonTower7CurScript]
call ExecuteCurMapScriptInTable
- ld [W_POKEMONTOWER7CURSCRIPT], a
+ ld [wPokemonTower7CurScript], a
ret
PokemonTower7Script_60d18: ; 60d18 (18:4d18)
xor a
ld [wJoyIgnore], a
- ld [W_POKEMONTOWER7CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower7CurScript], a
+ ld [wCurMapScript], a
ret
PokemonTower7ScriptPointers:
@@ -24,7 +24,7 @@
PokemonTower7Script2: ; 60d23 (18:4d23)
ld hl, wFlags_0xcd60
res 0, [hl]
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, PokemonTower7Script_60d18
call EndTrainerBattle
@@ -35,8 +35,8 @@
call DisplayTextID
call PokemonTower7Script_60db6
ld a, $3
- ld [W_POKEMONTOWER7CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower7CurScript], a
+ ld [wCurMapScript], a
ret
PokemonTower7Script3: ; 60d56 (18:4d56)
@@ -43,7 +43,7 @@
ld a, [wd730]
bit 0, a
ret nz
- ld hl, W_MISSABLEOBJECTLIST
+ ld hl, wMissableObjectList
ld a, [wSpriteIndex]
ld b, a
.missableObjectsListLoop
@@ -59,8 +59,8 @@
ld [wTrainerHeaderFlagBit], a
ld [wUnusedDA38], a
ld a, $0
- ld [W_POKEMONTOWER7CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower7CurScript], a
+ ld [wCurMapScript], a
ret
PokemonTower7Script4: ; 60d86 (18:4d86)
@@ -80,8 +80,8 @@
ld hl, wd72d
set 3, [hl]
ld a, $0
- ld [W_POKEMONTOWER7CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower7CurScript], a
+ ld [wCurMapScript], a
ret
PokemonTower7Script_60db6: ; 60db6 (18:4db6)
@@ -92,9 +92,9 @@
ld d, $0
ld e, a
add hl, de
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
ld b, a
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
ld c, a
.asm_60dcb
ld a, [hli]
@@ -268,8 +268,8 @@
ld [wMissableObjectIndex], a
predef ShowObject
ld a, $4
- ld [W_POKEMONTOWER7CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wPokemonTower7CurScript], a
+ ld [wCurMapScript], a
jp TextScriptEnd
TowerRescueFujiText:
--- a/scripts/powerplant.asm
+++ b/scripts/powerplant.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, PowerPlantTrainerHeaders
ld de, PowerPlantScriptPointers
- ld a, [W_POWERPLANTCURSCRIPT]
+ ld a, [wPowerPlantCurScript]
call ExecuteCurMapScriptInTable
- ld [W_POWERPLANTCURSCRIPT], a
+ ld [wPowerPlantCurScript], a
ret
PowerPlantScriptPointers: ; 1e2d9 (7:62d9)
@@ -114,8 +114,8 @@
InitVoltorbBattle: ; 1e368 (7:6368)
call TalkToTrainer
- ld a, [W_CURMAPSCRIPT]
- ld [W_POWERPLANTCURSCRIPT], a
+ ld a, [wCurMapScript]
+ ld [wPowerPlantCurScript], a
jp TextScriptEnd
PowerPlantText1: ; 1e374 (7:6374)
--- a/scripts/redshouse2f.asm
+++ b/scripts/redshouse2f.asm
@@ -1,7 +1,7 @@
RedsHouse2FScript: ; 5c0b0 (17:40b0)
call EnableAutoTextBoxDrawing
ld hl,RedsHouse2FScriptPointers
- ld a,[W_REDSHOUSE2CURSCRIPT]
+ ld a,[wRedsHouse2CurScript]
jp CallFunctionInTable
RedsHouse2FScriptPointers: ; 5c0bc (17:40bc)
@@ -14,7 +14,7 @@
ld a,PLAYER_DIR_UP
ld [wPlayerMovingDirection],a
ld a,1
- ld [W_REDSHOUSE2CURSCRIPT],a
+ ld [wRedsHouse2CurScript],a
ret
RedsHouse2FScript1: ; 5c0ce (17:40ce)
--- a/scripts/rockethideout1.asm
+++ b/scripts/rockethideout1.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, RocketHideout1TrainerHeaders
ld de, RocketHideout1ScriptPointers
- ld a, [W_ROCKETHIDEOUT1CURSCRIPT]
+ ld a, [wRocketHideout1CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROCKETHIDEOUT1CURSCRIPT], a
+ ld [wRocketHideout1CurScript], a
ret
RocketHideout1Script_44be0: ; 44be0 (11:4be0)
--- a/scripts/rockethideout2.asm
+++ b/scripts/rockethideout2.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, RocketHideout2TrainerHeaders
ld de, RocketHideout2ScriptPointers
- ld a, [W_ROCKETHIDEOUT2CURSCRIPT]
+ ld a, [wRocketHideout2CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROCKETHIDEOUT2CURSCRIPT], a
+ ld [wRocketHideout2CurScript], a
ret
RocketHideout2ScriptPointers: ; 44e3a (11:4e3a)
@@ -14,9 +14,9 @@
dw RocketHideout2Script3
RocketHideout2Script0: ; 44e42 (11:4e42)
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
ld b, a
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
ld c, a
ld hl, RocketHideout2ArrowTilePlayerMovement
call DecodeArrowMovementRLE
@@ -30,7 +30,7 @@
ld a, $ff
ld [wJoyIgnore], a
ld a, $3
- ld [W_CURMAPSCRIPT], a
+ ld [wCurMapScript], a
ret
;format:
@@ -310,7 +310,7 @@
ld hl, wd736
res 7, [hl]
ld a, $0
- ld [W_CURMAPSCRIPT], a
+ ld [wCurMapScript], a
ret
LoadSpinnerArrowTiles: ; 44fd7 (11:4fd7)
@@ -323,7 +323,7 @@
add hl, bc
ld a, [hl]
ld [wSpriteStateData1 + 2], a
- ld a, [W_CURMAPTILESET]
+ ld a, [wCurMapTileset]
cp FACILITY
ld hl, FacilitySpinnerArrows
jr z, .asm_44ff6
--- a/scripts/rockethideout3.asm
+++ b/scripts/rockethideout3.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, RocketHideout3TrainerHeaders
ld de, RocketHideout3ScriptPointers
- ld a, [W_ROCKETHIDEOUT3CURSCRIPT]
+ ld a, [wRocketHideout3CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROCKETHIDEOUT3CURSCRIPT], a
+ ld [wRocketHideout3CurScript], a
ret
RocketHideout3ScriptPointers: ; 45238 (11:5238)
@@ -14,9 +14,9 @@
dw RocketHideout3Script3
RocketHideout3Script0: ; 45240 (11:5240)
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
ld b, a
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
ld c, a
ld hl, RocketHideout3ArrowTilePlayerMovement
call DecodeArrowMovementRLE
@@ -30,7 +30,7 @@
ld a, $ff
ld [wJoyIgnore], a
ld a, $3
- ld [W_CURMAPSCRIPT], a
+ ld [wCurMapScript], a
ret
;format:
@@ -140,7 +140,7 @@
ld hl, wd736
res 7, [hl]
ld a, $0
- ld [W_CURMAPSCRIPT], a
+ ld [wCurMapScript], a
ret
RocketHideout3TextPointers: ; 452fa (11:52fa)
--- a/scripts/rockethideout4.asm
+++ b/scripts/rockethideout4.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, RocketHideout4TrainerHeader0
ld de, RocketHideout4ScriptPointers
- ld a, [W_ROCKETHIDEOUT4CURSCRIPT]
+ ld a, [wRocketHideout4CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROCKETHIDEOUT4CURSCRIPT], a
+ ld [wRocketHideout4CurScript], a
ret
RocketHideout4Script_45473: ; 45473 (11:5473)
@@ -33,8 +33,8 @@
RocketHideout4Script_454a3: ; 454a3 (11:54a3)
xor a
ld [wJoyIgnore], a
- ld [W_ROCKETHIDEOUT4CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRocketHideout4CurScript], a
+ ld [wCurMapScript], a
ret
RocketHideout4ScriptPointers: ; 454ae (11:54ae)c
@@ -44,7 +44,7 @@
dw RocketHideout4Script3
RocketHideout4Script3: ; 454b6 (11:54b6)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, RocketHideout4Script_454a3
call UpdateSprites
@@ -68,8 +68,8 @@
ld hl, wd126
set 5, [hl]
ld a, $0
- ld [W_ROCKETHIDEOUT4CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRocketHideout4CurScript], a
+ ld [wCurMapScript], a
ret
RocketHideout4TextPointers: ; 45501 (11:5501)
@@ -133,8 +133,8 @@
xor a
ld [hJoyHeld], a
ld a, $3
- ld [W_ROCKETHIDEOUT4CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRocketHideout4CurScript], a
+ ld [wCurMapScript], a
jr .asm_209f0
.asm_545571
ld hl, RocketHideout4Text10
--- a/scripts/rocktunnel1.asm
+++ b/scripts/rocktunnel1.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, RockTunnel1TrainerHeaders
ld de, RockTunnel1ScriptPointers
- ld a, [W_ROCKTUNNEL1CURSCRIPT]
+ ld a, [wRockTunnel1CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROCKTUNNEL1CURSCRIPT], a
+ ld [wRockTunnel1CurScript], a
ret
RockTunnel1ScriptPointers: ; 444ef (11:44ef)
--- a/scripts/rocktunnel2.asm
+++ b/scripts/rocktunnel2.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, RockTunnel2TrainerHeaders
ld de, RockTunnel2ScriptPointers
- ld a, [W_ROCKTUNNEL2CURSCRIPT]
+ ld a, [wRockTunnel2CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROCKTUNNEL2CURSCRIPT], a
+ ld [wRockTunnel2CurScript], a
ret
RockTunnel2ScriptPointers: ; 45ffe (11:5ffe)
--- a/scripts/route10.asm
+++ b/scripts/route10.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route10TrainerHeaders
ld de, Route10ScriptPointers
- ld a, [W_ROUTE10CURSCRIPT]
+ ld a, [wRoute10CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE10CURSCRIPT], a
+ ld [wRoute10CurScript], a
ret
Route10ScriptPointers: ; 59349 (16:5349)
--- a/scripts/route11.asm
+++ b/scripts/route11.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route11TrainerHeaders
ld de, Route11ScriptPointers
- ld a, [W_ROUTE11CURSCRIPT]
+ ld a, [wRoute11CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE11CURSCRIPT], a
+ ld [wRoute11CurScript], a
ret
Route11ScriptPointers: ; 5945f (16:545f)
--- a/scripts/route12.asm
+++ b/scripts/route12.asm
@@ -2,16 +2,16 @@
call EnableAutoTextBoxDrawing
ld hl, Route12TrainerHeaders
ld de, Route12ScriptPointers
- ld a, [W_ROUTE12CURSCRIPT]
+ ld a, [wRoute12CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE12CURSCRIPT], a
+ ld [wRoute12CurScript], a
ret
Route12Script_59606: ; 59606 (16:5606)
xor a
ld [wJoyIgnore], a
- ld [W_ROUTE12CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRoute12CurScript], a
+ ld [wCurMapScript], a
ret
Route12ScriptPointers: ; 59611 (16:5611)
@@ -30,19 +30,19 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, SNORLAX
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
ld a, 30
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
ld a, HS_ROUTE_12_SNORLAX
ld [wMissableObjectIndex], a
predef HideObject
ld a, $3
- ld [W_ROUTE12CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRoute12CurScript], a
+ ld [wCurMapScript], a
ret
Route12Script3: ; 5964c (16:564c)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jr z, Route12Script_59606
call UpdateSprites
@@ -56,8 +56,8 @@
SetEvent EVENT_BEAT_ROUTE12_SNORLAX
call Delay3
ld a, $0
- ld [W_ROUTE12CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRoute12CurScript], a
+ ld [wCurMapScript], a
ret
Route12TextPointers: ; 59675 (16:5675)
--- a/scripts/route13.asm
+++ b/scripts/route13.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route13TrainerHeaders
ld de, Route13ScriptPointers
- ld a, [W_ROUTE13CURSCRIPT]
+ ld a, [wRoute13CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE13CURSCRIPT], a
+ ld [wRoute13CurScript], a
ret
Route13ScriptPointers: ; 55831 (15:5831)
--- a/scripts/route14.asm
+++ b/scripts/route14.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route14TrainerHeaders
ld de, Route14ScriptPointers
- ld a, [W_ROUTE14CURSCRIPT]
+ ld a, [wRoute14CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE14CURSCRIPT], a
+ ld [wRoute14CurScript], a
ret
Route14ScriptPointers: ; 559e6 (15:59e6)
--- a/scripts/route15.asm
+++ b/scripts/route15.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route15TrainerHeaders
ld de, Route15ScriptPointers
- ld a, [W_ROUTE15CURSCRIPT]
+ ld a, [wRoute15CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE15CURSCRIPT], a
+ ld [wRoute15CurScript], a
ret
Route15ScriptPointers: ; 597c1 (16:57c1)
--- a/scripts/route16.asm
+++ b/scripts/route16.asm
@@ -2,16 +2,16 @@
call EnableAutoTextBoxDrawing
ld hl, Route16TrainerHeaders
ld de, Route16ScriptPointers
- ld a, [W_ROUTE16CURSCRIPT]
+ ld a, [wRoute16CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE16CURSCRIPT], a
+ ld [wRoute16CurScript], a
ret
Route16Script_59946: ; 59946 (16:5946)
xor a
ld [wJoyIgnore], a
- ld [W_ROUTE16CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRoute16CurScript], a
+ ld [wCurMapScript], a
ret
Route16ScriptPointers: ; 59951 (16:5951)
@@ -30,20 +30,20 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, SNORLAX
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
ld a, 30
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
ld a, HS_ROUTE_16_SNORLAX
ld [wMissableObjectIndex], a
predef HideObject
call UpdateSprites
ld a, $3
- ld [W_ROUTE16CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRoute16CurScript], a
+ ld [wCurMapScript], a
ret
Route16Script3: ; 5998f (16:598f)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, Route16Script_59946
call UpdateSprites
@@ -57,8 +57,8 @@
SetEvent EVENT_BEAT_ROUTE16_SNORLAX
call Delay3
ld a, $0
- ld [W_ROUTE16CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRoute16CurScript], a
+ ld [wCurMapScript], a
ret
Route16TextPointers: ; 599b9 (16:59b9)
--- a/scripts/route16gate.asm
+++ b/scripts/route16gate.asm
@@ -2,7 +2,7 @@
ld hl, wd732
res 5, [hl]
call EnableAutoTextBoxDrawing
- ld a, [W_ROUTE16GATECURSCRIPT]
+ ld a, [wRoute16GateCurScript]
ld hl, Route16GateScriptPointers
jp CallFunctionInTable
@@ -36,11 +36,11 @@
call FillMemory
call StartSimulatingJoypadStates
ld a, $1
- ld [W_ROUTE16GATECURSCRIPT], a
+ ld [wRoute16GateCurScript], a
ret
.asm_4970e
ld a, $2
- ld [W_ROUTE16GATECURSCRIPT], a
+ ld [wRoute16GateCurScript], a
ret
CoordsData_49714: ; 49714 (12:5714)
@@ -67,7 +67,7 @@
ld [wSimulatedJoypadStatesEnd], a
call StartSimulatingJoypadStates
ld a, $3
- ld [W_ROUTE16GATECURSCRIPT], a
+ ld [wRoute16GateCurScript], a
ret
Route16GateScript3: ; 49741 (12:5741)
@@ -79,7 +79,7 @@
ld hl, wd730
res 7, [hl]
ld a, $0
- ld [W_ROUTE16GATECURSCRIPT], a
+ ld [wRoute16GateCurScript], a
ret
Route16GateScript_49755: ; 49755 (12:5755)
--- a/scripts/route17.asm
+++ b/scripts/route17.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route17TrainerHeaders
ld de, Route17ScriptPointers
- ld a, [W_ROUTE17CURSCRIPT]
+ ld a, [wRoute17CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE17CURSCRIPT], a
+ ld [wRoute17CurScript], a
ret
Route17ScriptPointers: ; 55b8d (15:5b8d)
--- a/scripts/route18.asm
+++ b/scripts/route18.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route18TrainerHeaders
ld de, Route18ScriptPointers
- ld a, [W_ROUTE18CURSCRIPT]
+ ld a, [wRoute18CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE18CURSCRIPT], a
+ ld [wRoute18CurScript], a
ret
Route18ScriptPointers: ; 59ada (16:5ada)
--- a/scripts/route18gate.asm
+++ b/scripts/route18gate.asm
@@ -2,7 +2,7 @@
ld hl, wd732
res 5, [hl]
call EnableAutoTextBoxDrawing
- ld a, [W_ROUTE18GATECURSCRIPT]
+ ld a, [wRoute18GateCurScript]
ld hl, Route18GateScriptPointers
jp CallFunctionInTable
@@ -36,11 +36,11 @@
call FillMemory
call StartSimulatingJoypadStates
ld a, $1
- ld [W_ROUTE18GATECURSCRIPT], a
+ ld [wRoute18GateCurScript], a
ret
.asm_498c6
ld a, $2
- ld [W_ROUTE18GATECURSCRIPT], a
+ ld [wRoute18GateCurScript], a
ret
CoordsData_498cc: ; 498cc (12:58cc)
@@ -67,7 +67,7 @@
ld [wSimulatedJoypadStatesEnd], a
call StartSimulatingJoypadStates
ld a, $3
- ld [W_ROUTE18GATECURSCRIPT], a
+ ld [wRoute18GateCurScript], a
ret
Route18GateScript3: ; 498f9 (12:58f9)
@@ -79,7 +79,7 @@
ld hl, wd730
res 7, [hl]
ld a, $0
- ld [W_ROUTE18GATECURSCRIPT], a
+ ld [wRoute18GateCurScript], a
ret
Route18GateTextPointers: ; 4990d (12:590d)
--- a/scripts/route19.asm
+++ b/scripts/route19.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route19TrainerHeaders
ld de, Route19ScriptPointers
- ld a, [W_ROUTE19CURSCRIPT]
+ ld a, [wRoute19CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE19CURSCRIPT], a
+ ld [wRoute19CurScript], a
ret
Route19ScriptPointers: ; 55d57 (15:5d57)
--- a/scripts/route20.asm
+++ b/scripts/route20.asm
@@ -4,9 +4,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route20TrainerHeader0
ld de, Route20ScriptPointers
- ld a, [W_ROUTE20CURSCRIPT]
+ ld a, [wRoute20CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE20CURSCRIPT], a
+ ld [wRoute20CurScript], a
ret
Route20Script_50cc6: ; 50cc6 (14:4cc6)
--- a/scripts/route21.asm
+++ b/scripts/route21.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route21TrainerHeaders
ld de, Route21ScriptPointers
- ld a, [W_ROUTE21CURSCRIPT]
+ ld a, [wRoute21CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE21CURSCRIPT], a
+ ld [wRoute21CurScript], a
ret
Route21ScriptPointers: ; 55efe (15:5efe)
--- a/scripts/route22.asm
+++ b/scripts/route22.asm
@@ -1,7 +1,7 @@
Route22Script: ; 50eb2 (14:4eb2)
call EnableAutoTextBoxDrawing
ld hl, Route22ScriptPointers
- ld a, [W_ROUTE22CURSCRIPT]
+ ld a, [wRoute22CurScript]
jp CallFunctionInTable
Route22ScriptPointers: ; 50ebe (14:4ebe)
@@ -17,12 +17,12 @@
Route22Script_50ece: ; 50ece (14:4ece)
xor a
ld [wJoyIgnore], a
- ld [W_ROUTE22CURSCRIPT], a
+ ld [wRoute22CurScript], a
Route22Script7: ; 50ed5 (14:4ed5)
ret
Route22Script_50ed6: ; 50ed6 (14:4ed6)
- ld a, [W_RIVALSTARTER]
+ ld a, [wRivalStarter]
ld b, a
.asm_50eda
ld a, [hli]
@@ -32,7 +32,7 @@
jr .asm_50eda
.asm_50ee1
ld a, [hl]
- ld [W_TRAINERNO], a
+ ld [wTrainerNo], a
ret
Route22MoveRivalSprite: ; 50ee6 (14:4ee6)
@@ -99,7 +99,7 @@
ld [H_SPRITEINDEX], a
call Route22MoveRivalSprite
ld a, $1
- ld [W_ROUTE22CURSCRIPT], a
+ ld [wRoute22CurScript], a
ret
Route22Script1: ; 50f62 (14:4f62)
@@ -132,11 +132,11 @@
ld de, Route22Text_511bc
call SaveEndBattleTextPointers
ld a, OPP_SONY1
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
ld hl, StarterMons_50faf
call Route22Script_50ed6
ld a, $2
- ld [W_ROUTE22CURSCRIPT], a
+ ld [wRoute22CurScript], a
ret
StarterMons_50faf: ; 50faf (14:4faf)
@@ -146,7 +146,7 @@
db STARTER1,$06
Route22Script2: ; 50fb5 (14:4fb5)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, Route22Script_50ece
ld a, [wSpriteStateData1 + 9]
@@ -180,7 +180,7 @@
call Route22Script_5100d
.asm_51002
ld a, $3
- ld [W_ROUTE22CURSCRIPT], a
+ ld [wRoute22CurScript], a
ret
Route22Script_51008: ; 51008 (14:5008)
@@ -229,7 +229,7 @@
call PlayDefaultMusic
ResetEvents EVENT_1ST_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_BATTLE
ld a, $0
- ld [W_ROUTE22CURSCRIPT], a
+ ld [wRoute22CurScript], a
ret
Route22Script_5104e: ; 5104e (14:504e)
@@ -253,7 +253,7 @@
ld [H_SPRITEINDEX], a
call Route22MoveRivalSprite
ld a, $4
- ld [W_ROUTE22CURSCRIPT], a
+ ld [wRoute22CurScript], a
ret
Route22Script4: ; 51087 (14:5087)
@@ -288,11 +288,11 @@
ld de, Route22Text_511d0
call SaveEndBattleTextPointers
ld a, OPP_SONY2
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
ld hl, StarterMons_510d9
call Route22Script_50ed6
ld a, $5
- ld [W_ROUTE22CURSCRIPT], a
+ ld [wRoute22CurScript], a
ret
StarterMons_510d9: ; 510d9 (14:50d9)
@@ -301,7 +301,7 @@
db STARTER1,$0c
Route22Script5: ; 510df (14:50df)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, Route22Script_50ece
ld a, $2
@@ -339,7 +339,7 @@
call Route22Script_51142
.asm_51137
ld a, $6
- ld [W_ROUTE22CURSCRIPT], a
+ ld [wRoute22CurScript], a
ret
Route22Script_5113d: ; 5113d (14:513d)
@@ -374,7 +374,7 @@
call PlayDefaultMusic
ResetEvents EVENT_2ND_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_BATTLE
ld a, $7
- ld [W_ROUTE22CURSCRIPT], a
+ ld [wRoute22CurScript], a
ret
Route22TextPointers: ; 51175 (14:5175)
--- a/scripts/route22gate.asm
+++ b/scripts/route22gate.asm
@@ -1,9 +1,9 @@
Route22GateScript: ; 1e683 (7:6683)
call EnableAutoTextBoxDrawing
ld hl, Route22GateScriptPointers
- ld a, [W_ROUTE22GATECURSCRIPT]
+ ld a, [wRoute22GateCurScript]
call CallFunctionInTable
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $4
ld a, ROUTE_23
jr c, .asm_1e69a
@@ -49,7 +49,7 @@
ld [wJoyIgnore], a
call Delay3
ld a, $0
- ld [W_ROUTE22GATECURSCRIPT], a
+ ld [wRoute22GateCurScript], a
Route22GateScript2: ; 1e6de (7:66de)
ret
@@ -58,7 +58,7 @@
Route22GateText1: ; 1e6e1 (7:66e1)
TX_ASM
- ld a, [W_OBTAINEDBADGES]
+ ld a, [wObtainedBadges]
bit 0, a
jr nz, .asm_1e6f6
ld hl, Route22GateText_1e704
@@ -71,7 +71,7 @@
call PrintText
ld a, $2
.asm_1e6fe
- ld [W_ROUTE22GATECURSCRIPT], a
+ ld [wRoute22GateCurScript], a
jp TextScriptEnd
Route22GateText_1e704: ; 1e704 (7:6704)
--- a/scripts/route23.asm
+++ b/scripts/route23.asm
@@ -2,7 +2,7 @@
call Route23Script_511e9
call EnableAutoTextBoxDrawing
ld hl, Route23ScriptPointers
- ld a, [W_ROUTE23CURSCRIPT]
+ ld a, [wRoute23CurScript]
jp CallFunctionInTable
Route23Script_511e9: ; 511e9 (14:51e9)
@@ -26,7 +26,7 @@
Route23Script0: ; 51219 (14:5219)
ld hl, YCoordsData_51255
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
ld b, a
ld e, $0
EventFlagBit c, EVENT_PASSED_EARTHBADGE_CHECK + 1, EVENT_PASSED_CASCADEBADGE_CHECK
@@ -40,7 +40,7 @@
jr nz, .asm_51224
cp $23
jr nz, .asm_51237
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $e
ret nc
.asm_51237
@@ -128,7 +128,7 @@
ret nz
Route23Script2: ; 512f1 (14:52f1)
ld a, $0
- ld [W_ROUTE23CURSCRIPT], a
+ ld [wRoute23CurScript], a
ret
Route23TextPointers: ; 512f7 (14:52f7)
@@ -190,7 +190,7 @@
inc a
ld c, a
ld b, FLAG_TEST
- ld hl, W_OBTAINEDBADGES
+ ld hl, wObtainedBadges
predef FlagActionPredef
ld a, c
and a
@@ -199,7 +199,7 @@
call PrintText
call Route23Script_512d8
ld a, $1
- ld [W_ROUTE23CURSCRIPT], a
+ ld [wRoute23CurScript], a
ret
.asm_5136e
ld hl, VictoryRoadGuardText2
@@ -210,7 +210,7 @@
EventFlagAddress hl, EVENT_PASSED_CASCADEBADGE_CHECK
predef FlagActionPredef
ld a, $2
- ld [W_ROUTE23CURSCRIPT], a
+ ld [wRoute23CurScript], a
ret
Route23Script_51388: ; 51388 (14:5388)
--- a/scripts/route24.asm
+++ b/scripts/route24.asm
@@ -2,16 +2,16 @@
call EnableAutoTextBoxDrawing
ld hl, Route24TrainerHeaders
ld de, Route24ScriptPointers
- ld a, [W_ROUTE24CURSCRIPT]
+ ld a, [wRoute24CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE24CURSCRIPT], a
+ ld [wRoute24CurScript], a
ret
Route24Script_513c0: ; 513c0 (14:53c0)
xor a
ld [wJoyIgnore], a
- ld [W_ROUTE24CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRoute24CurScript], a
+ ld [wCurMapScript], a
ret
Route24ScriptPointers: ; 513cb (14:53cb)
@@ -40,8 +40,8 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $4
- ld [W_ROUTE24CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRoute24CurScript], a
+ ld [wCurMapScript], a
ret
CoordsData_5140e: ; 5140e (14:540e)
@@ -53,12 +53,12 @@
ret nz
call Delay3
ld a, $0
- ld [W_ROUTE24CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRoute24CurScript], a
+ ld [wCurMapScript], a
ret
Route24Script3: ; 51422 (14:5422)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, Route24Script_513c0
call UpdateSprites
@@ -71,8 +71,8 @@
xor a
ld [wJoyIgnore], a
ld a, $0
- ld [W_ROUTE24CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRoute24CurScript], a
+ ld [wCurMapScript], a
ret
Route24TextPointers: ; 5144b (14:544b)
@@ -170,8 +170,8 @@
xor a
ld [hJoyHeld], a
ld a, $3
- ld [W_ROUTE24CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRoute24CurScript], a
+ ld [wCurMapScript], a
jp TextScriptEnd
.asm_514f9
ld hl, Route24Text_51530
--- a/scripts/route25.asm
+++ b/scripts/route25.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route25TrainerHeaders
ld de, Route25ScriptPointers
- ld a, [W_ROUTE25CURSCRIPT]
+ ld a, [wRoute25CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE25CURSCRIPT], a
+ ld [wRoute25CurScript], a
ret
Route25Script_515e1: ; 515e1 (14:55e1)
--- a/scripts/route3.asm
+++ b/scripts/route3.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route3TrainerHeader0
ld de, Route3ScriptPointers
- ld a, [W_ROUTE3CURSCRIPT]
+ ld a, [wRoute3CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE3CURSCRIPT], a
+ ld [wRoute3CurScript], a
ret
Route3ScriptPointers: ; 5550b (15:550b)
--- a/scripts/route4.asm
+++ b/scripts/route4.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route4TrainerHeaders
ld de, Route4ScriptPointers
- ld a, [W_ROUTE4CURSCRIPT]
+ ld a, [wRoute4CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE4CURSCRIPT], a
+ ld [wRoute4CurScript], a
ret
Route4ScriptPointers: ; 5566b (15:566b)
--- a/scripts/route5gate.asm
+++ b/scripts/route5gate.asm
@@ -1,6 +1,6 @@
Route5GateScript: ; 1df33 (7:5f33)
call EnableAutoTextBoxDrawing
- ld a, [W_ROUTE5GATECURSCRIPT]
+ ld a, [wRoute5GateCurScript]
ld hl, Route5GateScriptPointers
jp CallFunctionInTable
@@ -35,7 +35,7 @@
call DisplayTextID
call Route5GateScript_1df43
ld a, $1
- ld [W_ROUTE5GATECURSCRIPT], a
+ ld [wRoute5GateCurScript], a
ret
.asm_1df82
ld a, $3
@@ -57,7 +57,7 @@
call Delay3
xor a
ld [wJoyIgnore], a
- ld [W_ROUTE5GATECURSCRIPT], a
+ ld [wRoute5GateCurScript], a
ret
Route5GateTextPointers: ; 1dfa4 (7:5fa4)
@@ -81,7 +81,7 @@
call PrintText
call Route5GateScript_1df43
ld a, $1
- ld [W_ROUTE5GATECURSCRIPT], a
+ ld [wRoute5GateCurScript], a
jp TextScriptEnd
.asm_768a2
ld hl, Route5GateText3
--- a/scripts/route6.asm
+++ b/scripts/route6.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route6TrainerHeaders
ld de, Route6ScriptPointers
- ld a, [W_ROUTE6CURSCRIPT]
+ ld a, [wRoute6CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE6CURSCRIPT], a
+ ld [wRoute6CurScript], a
ret
Route6ScriptPointers: ; 590c3 (16:50c3)
--- a/scripts/route6gate.asm
+++ b/scripts/route6gate.asm
@@ -1,7 +1,7 @@
Route6GateScript: ; 1e03d (7:603d)
call EnableAutoTextBoxDrawing
ld hl, Route6GateScriptPointers
- ld a, [W_ROUTE6GATECURSCRIPT]
+ ld a, [wRoute6GateCurScript]
call CallFunctionInTable
ret
@@ -29,7 +29,7 @@
call DisplayTextID
call Route6GateScript_1e0a1
ld a, $1
- ld [W_ROUTE6GATECURSCRIPT], a
+ ld [wRoute6GateCurScript], a
ret
.asm_1e080
ld hl, wd728
@@ -49,7 +49,7 @@
call Delay3
xor a
ld [wJoyIgnore], a
- ld [W_ROUTE6GATECURSCRIPT], a
+ ld [wRoute6GateCurScript], a
ret
Route6GateScript_1e0a1: ; 1e0a1 (7:60a1)
--- a/scripts/route7gate.asm
+++ b/scripts/route7gate.asm
@@ -1,6 +1,6 @@
Route7GateScript: ; 1e100 (7:6100)
call EnableAutoTextBoxDrawing
- ld a, [W_ROUTE7GATECURSCRIPT]
+ ld a, [wRoute7GateCurScript]
ld hl, Route7GateScriptPointers
call CallFunctionInTable
ret
@@ -41,7 +41,7 @@
call DisplayTextID
call Route7GateScript_1e111
ld a, $1
- ld [W_ROUTE7GATECURSCRIPT], a
+ ld [wRoute7GateCurScript], a
ret
.asm_1e15a
ld a, $3
@@ -63,8 +63,8 @@
call Delay3
xor a
ld [wJoyIgnore], a
- ld [W_ROUTE7GATECURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wRoute7GateCurScript], a
+ ld [wCurMapScript], a
ret
Route7GateTextPointers: ; 1e17f (7:617f)
--- a/scripts/route8.asm
+++ b/scripts/route8.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route8TrainerHeaders
ld de, Route8ScriptPointers
- ld a, [W_ROUTE8CURSCRIPT]
+ ld a, [wRoute8CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE8CURSCRIPT], a
+ ld [wRoute8CurScript], a
ret
Route8ScriptPointers: ; 591c9 (16:51c9)
--- a/scripts/route8gate.asm
+++ b/scripts/route8gate.asm
@@ -1,7 +1,7 @@
Route8GateScript: ; 1e1c7 (7:61c7)
call EnableAutoTextBoxDrawing
ld hl, Route8GateScriptPointers
- ld a, [W_ROUTE8GATECURSCRIPT]
+ ld a, [wRoute8GateCurScript]
jp CallFunctionInTable
Route8GateScriptPointers: ; 1e1d3 (7:61d3)
@@ -40,7 +40,7 @@
call DisplayTextID
call Route8GateScript_1e1d7
ld a, $1
- ld [W_ROUTE8GATECURSCRIPT], a
+ ld [wRoute8GateCurScript], a
ret
.asm_1e220
ld hl, wd728
@@ -61,7 +61,7 @@
call Delay3
xor a
ld [wJoyIgnore], a
- ld [W_ROUTE8GATECURSCRIPT], a
+ ld [wRoute8GateCurScript], a
ret
Route8GateTextPointers: ; 1e241 (7:6241)
--- a/scripts/route9.asm
+++ b/scripts/route9.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, Route9TrainerHeaders
ld de, Route9ScriptPointers
- ld a, [W_ROUTE9CURSCRIPT]
+ ld a, [wRoute9CurScript]
call ExecuteCurMapScriptInTable
- ld [W_ROUTE9CURSCRIPT], a
+ ld [wRoute9CurScript], a
ret
Route9ScriptPointers: ; 556cf (15:56cf)
--- a/scripts/safarizoneentrance-yellow.asm
+++ b/scripts/safarizoneentrance-yellow.asm
@@ -56,7 +56,7 @@
ld a,30
lb hl, (502 / $100), (502 % $100)
.xf1ff2
- ld [W_NUMSAFARIBALLS],a
+ ld [wNumSafariBalls],a
ld a,h
ld [wSafariSteps],a
ld a,l
@@ -67,7 +67,7 @@
SetEvent EVENT_IN_SAFARI_ZONE
ResetEventReuseHL EVENT_SAFARI_GAME_OVER
ld a,3
- ld [W_SAFARIZONEENTRANCECURSCRIPT],a
+ ld [wSafariZoneEntranceCurScript],a
jr .done
.PleaseComeAgain
@@ -78,7 +78,7 @@
ld c,1
call SafariZoneEntranceAutoWalk
ld a,4
- ld [W_SAFARIZONEENTRANCECURSCRIPT],a
+ ld [wSafariZoneEntranceCurScript],a
.done
ret
--- a/scripts/safarizoneentrance.asm
+++ b/scripts/safarizoneentrance.asm
@@ -1,7 +1,7 @@
SafariZoneEntranceScript: ; 751cd (1d:51cd)
call EnableAutoTextBoxDrawing
ld hl, SafariZoneEntranceScriptPointers
- ld a, [W_SAFARIZONEENTRANCECURSCRIPT]
+ ld a, [wSafariZoneEntranceCurScript]
jp CallFunctionInTable
SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9)
@@ -30,7 +30,7 @@
cp $1
jr z, .asm_7520f
ld a, $2
- ld [W_SAFARIZONEENTRANCECURSCRIPT], a
+ ld [wSafariZoneEntranceCurScript], a
ret
.asm_7520f
ld a, D_RIGHT
@@ -39,7 +39,7 @@
ld a, $f0
ld [wJoyIgnore], a
ld a, $1
- ld [W_SAFARIZONEENTRANCECURSCRIPT], a
+ ld [wSafariZoneEntranceCurScript], a
ret
.CoordsData_75221: ; 75221 (1d:5221)
@@ -68,7 +68,7 @@
xor a
ld [wJoyIgnore], a
ld a, $5
- ld [W_SAFARIZONEENTRANCECURSCRIPT], a
+ ld [wSafariZoneEntranceCurScript], a
ret
.SafariZoneEntranceScript5
@@ -84,12 +84,12 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
- ld [W_NUMSAFARIBALLS], a
+ ld [wNumSafariBalls], a
ld a, D_DOWN
ld c, $3
call SafariZoneEntranceAutoWalk
ld a, $4
- ld [W_SAFARIZONEENTRANCECURSCRIPT], a
+ ld [wSafariZoneEntranceCurScript], a
jr .asm_75286
.asm_7527f
ld a, $5
@@ -104,7 +104,7 @@
xor a
ld [wJoyIgnore], a
ld a, $0
- ld [W_SAFARIZONEENTRANCECURSCRIPT], a
+ ld [wSafariZoneEntranceCurScript], a
ret
.SafariZoneEntranceScript6
@@ -112,7 +112,7 @@
ret nz
call Delay3
ld a, [wcf0d]
- ld [W_SAFARIZONEENTRANCECURSCRIPT], a
+ ld [wSafariZoneEntranceCurScript], a
ret
SafariZoneEntranceAutoWalk:
@@ -181,7 +181,7 @@
ld hl,.MakePaymentText
call PrintText
ld a,30
- ld [W_NUMSAFARIBALLS],a
+ ld [wNumSafariBalls],a
ld a,502 / $100
ld [wSafariSteps],a
ld a, 502 % $100
@@ -192,7 +192,7 @@
SetEvent EVENT_IN_SAFARI_ZONE
ResetEventReuseHL EVENT_SAFARI_GAME_OVER
ld a,3
- ld [W_SAFARIZONEENTRANCECURSCRIPT],a
+ ld [wSafariZoneEntranceCurScript],a
jr .done
.PleaseComeAgain
@@ -203,7 +203,7 @@
ld c,1
call SafariZoneEntranceAutoWalk
ld a,4
- ld [W_SAFARIZONEENTRANCECURSCRIPT],a
+ ld [wSafariZoneEntranceCurScript],a
.done
jp TextScriptEnd
@@ -251,7 +251,7 @@
ld [wcf0d], a
.asm_753b3
ld a, $6
- ld [W_SAFARIZONEENTRANCECURSCRIPT], a
+ ld [wSafariZoneEntranceCurScript], a
jp TextScriptEnd
.SafariZoneEntranceText_753bb
--- a/scripts/saffrongym.asm
+++ b/scripts/saffrongym.asm
@@ -6,9 +6,9 @@
call EnableAutoTextBoxDrawing
ld hl, SaffronGymTrainerHeader0
ld de, SaffronGymScriptPointers
- ld a, [W_SAFFRONGYMCURSCRIPT]
+ ld a, [wSaffronGymCurScript]
call ExecuteCurMapScriptInTable
- ld [W_SAFFRONGYMCURSCRIPT], a
+ ld [wSaffronGymCurScript], a
ret
.extra
@@ -25,8 +25,8 @@
SaffronGymText_5d048: ; 5d048 (17:5048)
xor a
ld [wJoyIgnore], a
- ld [W_SAFFRONGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wSaffronGymCurScript], a
+ ld [wCurMapScript], a
ret
SaffronGymScriptPointers: ; 5d053 (17:5053)
@@ -36,7 +36,7 @@
dw SaffronGymScript3
SaffronGymScript3: ; 5d05b (17:505b)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, SaffronGymText_5d048
ld a, $f0
@@ -60,7 +60,7 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_5d091
- ld hl, W_OBTAINEDBADGES
+ ld hl, wObtainedBadges
set 5, [hl]
ld hl, wBeatGymFlags
set 5, [hl]
@@ -177,9 +177,9 @@
call EngageMapTrainer
call InitBattleEnemyParameters
ld a, $6
- ld [W_GYMLEADERNO], a
+ ld [wGymLeaderNo], a
ld a, $3
- ld [W_SAFFRONGYMCURSCRIPT], a
+ ld [wSaffronGymCurScript], a
.asm_5d15f
jp TextScriptEnd
--- a/scripts/seafoamislands4.asm
+++ b/scripts/seafoamislands4.asm
@@ -41,7 +41,7 @@
ret nz
.asm_465ed
ld hl, SeafoamIslands4ScriptPointers
- ld a, [W_SEAFOAMISLANDS4CURSCRIPT]
+ ld a, [wSeafoamIslands4CurScript]
jp CallFunctionInTable
Seafoam4HolesCoords: ; 465f6 (11:65f6)
@@ -58,10 +58,10 @@
SeafoamIslands4Script0: ; 46603 (11:6603)
CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE
ret z
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $8
ret nz
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $f
ret nz
ld hl, wSimulatedJoypadStatesEnd
@@ -70,10 +70,10 @@
dec a
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
- ld hl, W_FLAGS_D733
+ ld hl, wFlags_D733
set 2, [hl]
ld a, $1
- ld [W_SEAFOAMISLANDS4CURSCRIPT], a
+ ld [wSeafoamIslands4CurScript], a
ret
RLEMovement46632: ; 46632 (11:6632)
@@ -87,13 +87,13 @@
and a
ret nz
ld a, $0
- ld [W_SEAFOAMISLANDS4CURSCRIPT], a
+ ld [wSeafoamIslands4CurScript], a
ret
SeafoamIslands4Script2: ; 46644 (11:6644)
CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE
ret z
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $12
jr z, .asm_4665e
cp $13
@@ -112,11 +112,11 @@
ld [wSpriteStateData2 + $06], a
ld hl, wd730
set 7, [hl]
- ld hl, W_FLAGS_D733
+ ld hl, wFlags_D733
set 2, [hl]
ld a, $3
.asm_4667b
- ld [W_SEAFOAMISLANDS4CURSCRIPT], a
+ ld [wSeafoamIslands4CurScript], a
ret
RLEData_4667f: ; 4667f (11:667f)
@@ -137,7 +137,7 @@
and a
ret nz
ld a, $0
- ld [W_SEAFOAMISLANDS4CURSCRIPT], a
+ ld [wSeafoamIslands4CurScript], a
ret
SeafoamIslands4TextPointers: ; 4669a (11:669a)
--- a/scripts/seafoamislands5.asm
+++ b/scripts/seafoamislands5.asm
@@ -1,12 +1,12 @@
SeafoamIslands5Script: ; 46799 (11:6799)
call EnableAutoTextBoxDrawing
- ld a, [W_SEAFOAMISLANDS5CURSCRIPT]
+ ld a, [wSeafoamIslands5CurScript]
ld hl, SeafoamIslands5ScriptPointers
jp CallFunctionInTable
SeafoamIslands5Script_467a5: ; 467a5 (11:67a5)
xor a
- ld [W_SEAFOAMISLANDS5CURSCRIPT], a
+ ld [wSeafoamIslands5CurScript], a
ld [wJoyIgnore], a
ret
@@ -18,12 +18,12 @@
dw SeafoamIslands5Script4
SeafoamIslands5Script4: ; 467b7 (11:67b7)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jr z, SeafoamIslands5Script_467a5
call EndTrainerBattle
ld a, $0
- ld [W_SEAFOAMISLANDS5CURSCRIPT], a
+ ld [wSeafoamIslands5CurScript], a
ret
SeafoamIslands5Script0: ; 467c7 (11:67c7)
@@ -46,10 +46,10 @@
ld a, D_UP
ld [wSimulatedJoypadStatesEnd], a
call StartSimulatingJoypadStates
- ld hl, W_FLAGS_D733
+ ld hl, wFlags_D733
res 2, [hl]
ld a, $1
- ld [W_SEAFOAMISLANDS5CURSCRIPT], a
+ ld [wSeafoamIslands5CurScript], a
ret
CoordsData_467fe: ; 467fe (11:67fe)
@@ -66,7 +66,7 @@
xor a
ld [wJoyIgnore], a
ld a, $0
- ld [W_SEAFOAMISLANDS5CURSCRIPT], a
+ ld [wSeafoamIslands5CurScript], a
ret
SeafoamIslands5Script2: ; 46816 (11:6816)
@@ -92,7 +92,7 @@
call StartSimulatingJoypadStates
ld a, $3
.asm_46849
- ld [W_SEAFOAMISLANDS5CURSCRIPT], a
+ ld [wSeafoamIslands5CurScript], a
ret
CoordsData_4684d: ; 4684d (11:684d)
@@ -121,7 +121,7 @@
and a
ret nz
ld a, $0
- ld [W_SEAFOAMISLANDS5CURSCRIPT], a
+ ld [wSeafoamIslands5CurScript], a
ret
SeaFoamIslands5Script_46872: ; 46872 (11:6872)
@@ -154,7 +154,7 @@
ld hl, SeafoamIslands5TrainerHeader0
call TalkToTrainer
ld a, $4
- ld [W_SEAFOAMISLANDS5CURSCRIPT], a
+ ld [wSeafoamIslands5CurScript], a
jp TextScriptEnd
SeafoamIslands5BattleText2: ; 468a2 (11:68a2)
--- a/scripts/silphco10.asm
+++ b/scripts/silphco10.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, SilphCo10TrainerHeaders
ld de, SilphCo10ScriptPointers
- ld a, [W_SILPHCO10CURSCRIPT]
+ ld a, [wSilphCo10CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SILPHCO10CURSCRIPT], a
+ ld [wSilphCo10CurScript], a
ret
SilphCo10Script_5a14f: ; 5a14f (16:614f)
--- a/scripts/silphco11.asm
+++ b/scripts/silphco11.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, SilphCo11TrainerHeaders
ld de, SilphCo11ScriptPointers
- ld a, [W_SILPHCO11CURSCRIPT]
+ ld a, [wSilphCo11CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SILPHCO11CURSCRIPT], a
+ ld [wSilphCo11CurScript], a
ret
SilphCo11Script_62110: ; 62110 (18:6110)
@@ -150,8 +150,8 @@
ld [wJoyIgnore], a
SilphCo11Script_621c8: ; 621c8 (18:61c8)
- ld [W_SILPHCO11CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wSilphCo11CurScript], a
+ ld [wCurMapScript], a
ret
SilphCo11ScriptPointers: ; 621cf (18:61cf)
@@ -205,7 +205,7 @@
jp SetSpriteFacingDirectionAndDelay
SilphCo11Script5: ; 62227 (18:6227)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, SilphCo11Script_621c4
ld a, [wcf0d]
--- a/scripts/silphco2.asm
+++ b/scripts/silphco2.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, SilphCo2TrainerHeaders
ld de, SilphCo2ScriptPointers
- ld a, [W_SILPHCO2CURSCRIPT]
+ ld a, [wSilphCo2CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SILPHCO2CURSCRIPT], a
+ ld [wSilphCo2CurScript], a
ret
SilphCo2Script_59d07: ; 59d07 (16:5d07)
--- a/scripts/silphco3.asm
+++ b/scripts/silphco3.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, SilphCo3TrainerHeaders
ld de, SilphCo3ScriptPointers
- ld a, [W_SILPHCO3CURSCRIPT]
+ ld a, [wSilphCo3CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SILPHCO3CURSCRIPT], a
+ ld [wSilphCo3CurScript], a
ret
SilphCo3Script_59f71: ; 59f71 (16:5f71)
--- a/scripts/silphco4.asm
+++ b/scripts/silphco4.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, SilphCo4TrainerHeaders
ld de, SilphCo4ScriptPointers
- ld a, [W_SILPHCO4CURSCRIPT]
+ ld a, [wSilphCo4CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SILPHCO4CURSCRIPT], a
+ ld [wSilphCo4CurScript], a
ret
SilphCo4Script_19d21: ; 19d21 (6:5d21)
--- a/scripts/silphco5.asm
+++ b/scripts/silphco5.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, SilphCo5TrainerHeaders
ld de, SilphCo5ScriptPointers
- ld a, [W_SILPHCO5CURSCRIPT]
+ ld a, [wSilphCo5CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SILPHCO5CURSCRIPT], a
+ ld [wSilphCo5CurScript], a
ret
SilphCo5Script_19f4d: ; 19f4d (6:5f4d)
--- a/scripts/silphco6.asm
+++ b/scripts/silphco6.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, SilphCo6TrainerHeaders
ld de, SilphCo6ScriptPointers
- ld a, [W_SILPHCO6CURSCRIPT]
+ ld a, [wSilphCo6CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SILPHCO6CURSCRIPT], a
+ ld [wSilphCo6CurScript], a
ret
SilphCo6Script_1a1bf: ; 1a1bf (6:61bf)
--- a/scripts/silphco7.asm
+++ b/scripts/silphco7.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, SilphCo7TrainerHeaders
ld de, SilphCo7ScriptPointers
- ld a, [W_SILPHCO7CURSCRIPT]
+ ld a, [wSilphCo7CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SILPHCO7CURSCRIPT], a
+ ld [wSilphCo7CurScript], a
ret
SilphCo7Script_51b77: ; 51b77 (14:5b77)
@@ -106,8 +106,8 @@
ld [wJoyIgnore], a
SilphCo7Text_51c10: ; 51c10 (14:5c10)
- ld [W_SILPHCO7CURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wSilphCo7CurScript], a
+ ld [wCurMapScript], a
ret
SilphCo7ScriptPointers: ; 51c17 (14:5c17)
@@ -184,8 +184,8 @@
ld de, SilphCo7Text_51ecd
call SaveEndBattleTextPointers
ld a, OPP_SONY2
- ld [W_CUROPPONENT], a
- ld a, [W_RIVALSTARTER]
+ ld [wCurOpponent], a
+ ld a, [wRivalStarter]
cp STARTER2
jr nz, .asm_51cb6
ld a, $7
@@ -198,12 +198,12 @@
.asm_51cbe
ld a, $9
.asm_51cc0
- ld [W_TRAINERNO], a
+ ld [wTrainerNo], a
ld a, $4
jp SilphCo7Text_51c10
SilphCo7Script4: ; 51cc8 (14:5cc8)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, SilphCo7Text_51c0c
ld a, $f0
--- a/scripts/silphco8.asm
+++ b/scripts/silphco8.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, SilphCo8TrainerHeader0
ld de, SilphCo8ScriptPointers
- ld a, [W_SILPHCO8CURSCRIPT]
+ ld a, [wSilphCo8CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SILPHCO8CURSCRIPT], a
+ ld [wSilphCo8CurScript], a
ret
SilphCo8Script_5651a: ; 5651a (15:651a)
--- a/scripts/silphco9.asm
+++ b/scripts/silphco9.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, SilphCo9TrainerHeaders
ld de, SilphCo9ScriptPointers
- ld a, [W_SILPHCO9CURSCRIPT]
+ ld a, [wSilphCo9CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SILPHCO9CURSCRIPT], a
+ ld [wSilphCo9CurScript], a
ret
SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1)
--- a/scripts/ssanne10.asm
+++ b/scripts/ssanne10.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, SSAnne10TrainerHeaders
ld de, SSAnne10ScriptPointers
- ld a, [W_SSANNE10CURSCRIPT]
+ ld a, [wSSAnne10CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SSANNE10CURSCRIPT], a
+ ld [wSSAnne10CurScript], a
ret
SSAnne10ScriptPointers: ; 61d68 (18:5d68)
--- a/scripts/ssanne2.asm
+++ b/scripts/ssanne2.asm
@@ -1,13 +1,13 @@
SSAnne2Script: ; 6139f (18:539f)
call EnableAutoTextBoxDrawing
ld hl, SSAnne2ScriptPointers
- ld a, [W_SSANNE2CURSCRIPT]
+ ld a, [wSSAnne2CurScript]
jp CallFunctionInTable
SSAnne2Script_613ab: ; 613ab (18:53ab)
xor a
ld [wJoyIgnore], a
- ld [W_SSANNE2CURSCRIPT], a
+ ld [wSSAnne2CurScript], a
ret
SSAnne2ScriptPointers: ; 613b3 (18:53b3)
@@ -53,7 +53,7 @@
.asm_61403
call MoveSprite
ld a, $1
- ld [W_SSANNE2CURSCRIPT], a
+ ld [wSSAnne2CurScript], a
ret
MovementData_6140c: ; 6140c (18:540c)
@@ -71,7 +71,7 @@
db $FF
SSAnne2Script_61416: ; 61416 (18:5416)
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $25
jr nz, .asm_61426
ld a, PLAYER_DIR_LEFT
@@ -98,10 +98,10 @@
call DisplayTextID
call Delay3
ld a, OPP_SONY2
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
; select which team to use during the encounter
- ld a, [W_RIVALSTARTER]
+ ld a, [wRivalStarter]
cp STARTER2
jr nz, .NotSquirtle
ld a, $1
@@ -114,15 +114,15 @@
.Charmander
ld a, $3
.done
- ld [W_TRAINERNO], a
+ ld [wTrainerNo], a
call SSAnne2Script_61416
ld a, $2
- ld [W_SSANNE2CURSCRIPT], a
+ ld [wSSAnne2CurScript], a
ret
SSAnne2Script2: ; 6146d (18:546d)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, SSAnne2Script_613ab
call SSAnne2Script_61416
@@ -134,7 +134,7 @@
ld a, $2
ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $25
jr nz, .asm_61497
ld de, MovementData_614b9
@@ -150,7 +150,7 @@
call PlaySound
callba Music_RivalAlternateStart
ld a, $3
- ld [W_SSANNE2CURSCRIPT], a
+ ld [wSSAnne2CurScript], a
ret
MovementData_614b7: ; 614b7 (18:54b7)
@@ -175,7 +175,7 @@
predef HideObject
call PlayDefaultMusic
ld a, $4
- ld [W_SSANNE2CURSCRIPT], a
+ ld [wSSAnne2CurScript], a
ret
SSAnne2TextPointers: ; 614db (18:54db)
--- a/scripts/ssanne5.asm
+++ b/scripts/ssanne5.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, SSAnne5TrainerHeader0
ld de, SSAnne5ScriptPointers
- ld a, [W_SSANNE5CURSCRIPT]
+ ld a, [wSSAnne5CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SSANNE5CURSCRIPT], a
+ ld [wSSAnne5CurScript], a
ret
SSAnne5ScriptPointers: ; 616c1 (18:56c1)
--- a/scripts/ssanne8.asm
+++ b/scripts/ssanne8.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, SSAnne8TrainerHeaders
ld de, SSAnne8ScriptPointers
- ld a, [W_SSANNE8CURSCRIPT]
+ ld a, [wSSAnne8CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SSANNE8CURSCRIPT], a
+ ld [wSSAnne8CurScript], a
ret
SSAnne8ScriptPointers: ; 61989 (18:5989)
--- a/scripts/ssanne9.asm
+++ b/scripts/ssanne9.asm
@@ -5,9 +5,9 @@
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, SSAnne9TrainerHeaders
ld de, SSAnne9ScriptPointers
- ld a, [W_SSANNE9CURSCRIPT]
+ ld a, [wSSAnne9CurScript]
call ExecuteCurMapScriptInTable
- ld [W_SSANNE9CURSCRIPT], a
+ ld [wSSAnne9CurScript], a
ret
SSAnne9ScriptPointers: ; 61b64 (18:5b64)
--- a/scripts/unknowndungeon3.asm
+++ b/scripts/unknowndungeon3.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, UnknownDungeon3TrainerHeaders
ld de, UnknownDungeon3ScriptPointers
- ld a, [W_UNKNOWNDUNGEON3CURSCRIPT]
+ ld a, [wUnknownDungeon3CurScript]
call ExecuteCurMapScriptInTable
- ld [W_UNKNOWNDUNGEON3CURSCRIPT], a
+ ld [wUnknownDungeon3CurScript], a
ret
UnknownDungeon3ScriptPointers: ; 45f03 (11:5f03)
--- a/scripts/vermilioncity.asm
+++ b/scripts/vermilioncity.asm
@@ -10,7 +10,7 @@
res 5, [hl]
call nz, VermilionCityScript_197c0
ld hl, VermilionCityScriptPointers
- ld a, [W_VERMILIONCITYCURSCRIPT]
+ ld a, [wVermilionCityCurScript]
jp CallFunctionInTable
VermilionCityScript_197c0: ; 197c0 (6:57c0)
@@ -27,7 +27,7 @@
SetEventReuseHL EVENT_WALKED_PAST_GUARD_AFTER_SS_ANNE_LEFT
ret nz
ld a, $2
- ld [W_VERMILIONCITYCURSCRIPT], a
+ ld [wVermilionCityCurScript], a
ret
VermilionCityScriptPointers: ; 197dc (6:57dc)
@@ -64,7 +64,7 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $1
- ld [W_VERMILIONCITYCURSCRIPT], a
+ ld [wVermilionCityCurScript], a
ret
CoordsData_19823: ; 19823 (6:5823)
@@ -76,7 +76,7 @@
call ArePlayerCoordsInArray
ret c
ld a, $0
- ld [W_VERMILIONCITYCURSCRIPT], a
+ ld [wVermilionCityCurScript], a
ret
VermilionCityScript2: ; 19833 (6:5833)
@@ -89,7 +89,7 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $3
- ld [W_VERMILIONCITYCURSCRIPT], a
+ ld [wVermilionCityCurScript], a
ret
VermilionCityScript3: ; 1984e (6:584e)
@@ -100,7 +100,7 @@
ld [wJoyIgnore], a
ld [hJoyHeld], a
ld a, $0
- ld [W_VERMILIONCITYCURSCRIPT], a
+ ld [wVermilionCityCurScript], a
ret
VermilionCityScript1: ; 1985f (6:585f)
@@ -110,7 +110,7 @@
ld c, 10
call DelayFrames
ld a, $0
- ld [W_VERMILIONCITYCURSCRIPT], a
+ ld [wVermilionCityCurScript], a
ret
VermilionCityTextPointers: ; 1986f (6:586f)
@@ -182,7 +182,7 @@
ld hl, SSAnneFlashedTicketText
call PrintText
ld a, $4
- ld [W_VERMILIONCITYCURSCRIPT], a
+ ld [wVermilionCityCurScript], a
jr .asm_198fc
.asm_198f6
ld hl, SSAnneNotHereText
--- a/scripts/vermiliongym.asm
+++ b/scripts/vermiliongym.asm
@@ -11,9 +11,9 @@
call EnableAutoTextBoxDrawing
ld hl, VermilionGymTrainerHeader0
ld de, VermilionGymScriptPointers
- ld a, [W_VERMILIONGYMCURSCRIPT]
+ ld a, [wVermilionGymCurScript]
call ExecuteCurMapScriptInTable
- ld [W_VERMILIONGYMCURSCRIPT], a
+ ld [wVermilionGymCurScript], a
ret
VermilionGymScript_5ca4c: ; 5ca4c (17:4a4c)
@@ -44,8 +44,8 @@
VermilionGymScript_5ca8a: ; 5ca8a (17:4a8a)
xor a
ld [wJoyIgnore], a
- ld [W_VERMILIONGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wVermilionGymCurScript], a
+ ld [wCurMapScript], a
ret
VermilionGymScriptPointers: ; 5ca95 (17:4a95)
@@ -55,7 +55,7 @@
dw VermilionGymScript3
VermilionGymScript3: ; 5ca9d (17:4a9d)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, VermilionGymScript_5ca8a
ld a, $f0
@@ -79,7 +79,7 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_5cad3
- ld hl, W_OBTAINEDBADGES
+ ld hl, wObtainedBadges
set 2, [hl]
ld hl, wBeatGymFlags
set 2, [hl]
@@ -156,12 +156,12 @@
call EngageMapTrainer
call InitBattleEnemyParameters
ld a, $3
- ld [W_GYMLEADERNO], a
+ ld [wGymLeaderNo], a
xor a
ld [hJoyHeld], a
ld a, $3
- ld [W_VERMILIONGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wVermilionGymCurScript], a
+ ld [wCurMapScript], a
.asm_5cb6a
jp TextScriptEnd
--- a/scripts/victoryroad1.asm
+++ b/scripts/victoryroad1.asm
@@ -6,9 +6,9 @@
call EnableAutoTextBoxDrawing
ld hl, VictoryRoad1TrainerHeaders
ld de, VictoryRoad1ScriptPointers
- ld a, [W_VICTORYROAD1CURSCRIPT]
+ ld a, [wVictoryRoad1CurScript]
call ExecuteCurMapScriptInTable
- ld [W_VICTORYROAD1CURSCRIPT], a
+ ld [wVictoryRoad1CurScript], a
ret
.next
CheckEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH
--- a/scripts/victoryroad2.asm
+++ b/scripts/victoryroad2.asm
@@ -10,9 +10,9 @@
call EnableAutoTextBoxDrawing
ld hl, VictoryRoad2TrainerHeaders
ld de, VictoryRoad2ScriptPointers
- ld a, [W_VICTORYROAD2CURSCRIPT]
+ ld a, [wVictoryRoad2CurScript]
call ExecuteCurMapScriptInTable
- ld [W_VICTORYROAD2CURSCRIPT], a
+ ld [wVictoryRoad2CurScript], a
ret
VictoryRoad2Script_517c4: ; 517c4 (14:57c4)
--- a/scripts/victoryroad3.asm
+++ b/scripts/victoryroad3.asm
@@ -3,9 +3,9 @@
call EnableAutoTextBoxDrawing
ld hl, VictoryRoad3TrainerHeaders
ld de, VictoryRoad3ScriptPointers
- ld a, [W_VICTORYROAD3CURSCRIPT]
+ ld a, [wVictoryRoad3CurScript]
call ExecuteCurMapScriptInTable
- ld [W_VICTORYROAD3CURSCRIPT], a
+ ld [wVictoryRoad3CurScript], a
ret
VictoryRoad3Script_44996: ; 44996 (11:4996)
--- a/scripts/viridiancity.asm
+++ b/scripts/viridiancity.asm
@@ -1,7 +1,7 @@
ViridianCityScript: ; 18ff1 (6:4ff1)
call EnableAutoTextBoxDrawing
ld hl, ViridianCityScriptPointers
- ld a, [W_VIRIDIANCITYCURSCRIPT]
+ ld a, [wViridianCityCurScript]
jp CallFunctionInTable
ViridianCityScriptPointers: ; 18ffd (6:4ffd)
@@ -17,16 +17,16 @@
ViridianCityScript_1900b: ; 1900b (6:500b)
CheckEvent EVENT_VIRIDIAN_GYM_OPEN
ret nz
- ld a, [W_OBTAINEDBADGES]
+ ld a, [wObtainedBadges]
cp %01111111
jr nz, .asm_1901e
SetEvent EVENT_VIRIDIAN_GYM_OPEN
ret
.asm_1901e
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $8
ret nz
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $20
ret nz
ld a, $e
@@ -36,16 +36,16 @@
ld [hJoyHeld], a
call ViridianCityScript_190cf
ld a, $3
- ld [W_VIRIDIANCITYCURSCRIPT], a
+ ld [wViridianCityCurScript], a
ret
ViridianCityScript_1903d: ; 1903d (6:503d)
CheckEvent EVENT_GOT_POKEDEX
ret nz
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
cp $9
ret nz
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
cp $13
ret nz
ld a, $5
@@ -55,7 +55,7 @@
ld [hJoyHeld], a
call ViridianCityScript_190cf
ld a, $3
- ld [W_VIRIDIANCITYCURSCRIPT], a
+ ld [wViridianCityCurScript], a
ret
ViridianCityScript1: ; 19062 (6:5062)
@@ -72,13 +72,13 @@
; set up battle for Old Man
ld a, BATTLE_TYPE_OLD_MAN
- ld [W_BATTLETYPE], a
+ ld [wBattleType], a
ld a, 5
- ld [W_CURENEMYLVL], a
+ ld [wCurEnemyLVL], a
ld a, WEEDLE
- ld [W_CUROPPONENT], a
+ ld [wCurOpponent], a
ld a, $2
- ld [W_VIRIDIANCITYCURSCRIPT], a
+ ld [wViridianCityCurScript], a
ret
ViridianCityScript2: ; 1908f (6:508f)
@@ -98,10 +98,10 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
- ld [W_BATTLETYPE], a
+ ld [wBattleType], a
ld [wJoyIgnore], a
ld a, $0
- ld [W_VIRIDIANCITYCURSCRIPT], a
+ ld [wViridianCityCurScript], a
ret
ViridianCityScript3: ; 190c1 (6:50c1)
@@ -110,7 +110,7 @@
ret nz
call Delay3
ld a, 0
- ld [W_VIRIDIANCITYCURSCRIPT], a
+ ld [wViridianCityCurScript], a
ret
ViridianCityScript_190cf: ; 190cf (6:50cf)
@@ -147,7 +147,7 @@
ViridianCityText2: ; 19107 (6:5107)
TX_ASM
- ld a, [W_OBTAINEDBADGES]
+ ld a, [wObtainedBadges]
cp %01111111
ld hl, ViridianCityText_19127
jr z, .asm_ae9fe
@@ -222,7 +222,7 @@
call PrintText
call ViridianCityScript_190cf
ld a, $3
- ld [W_VIRIDIANCITYCURSCRIPT], a
+ ld [wViridianCityCurScript], a
jp TextScriptEnd
ViridianCityText_19191: ; 19191 (6:5191)
@@ -281,7 +281,7 @@
ld hl, ViridianCityText_1920f
call PrintText
ld a, $1
- ld [W_VIRIDIANCITYCURSCRIPT], a
+ ld [wViridianCityCurScript], a
jr .asm_2413a
.asm_42f68
ld hl, ViridianCityText_19214
--- a/scripts/viridianforest.asm
+++ b/scripts/viridianforest.asm
@@ -2,9 +2,9 @@
call EnableAutoTextBoxDrawing
ld hl, ViridianForestTrainerHeaders
ld de, ViridianForestScriptPointers
- ld a, [W_VIRIDIANFORESTCURSCRIPT]
+ ld a, [wViridianForestCurScript]
call ExecuteCurMapScriptInTable
- ld [W_VIRIDIANFORESTCURSCRIPT], a
+ ld [wViridianForestCurScript], a
ret
ViridianForestScriptPointers: ; 61120 (18:5120)
--- a/scripts/viridiangym.asm
+++ b/scripts/viridiangym.asm
@@ -5,9 +5,9 @@
call EnableAutoTextBoxDrawing
ld hl, ViridianGymTrainerHeaders
ld de, ViridianGymScriptPointers
- ld a, [W_VIRIDIANGYMCURSCRIPT]
+ ld a, [wViridianGymCurScript]
call ExecuteCurMapScriptInTable
- ld [W_VIRIDIANGYMCURSCRIPT], a
+ ld [wViridianGymCurScript], a
ret
Gym8CityName: ; 748bf (1d:48bf)
@@ -18,8 +18,8 @@
ViridianGymScript_748d6: ; 748d6 (1d:48d6)
xor a
ld [wJoyIgnore], a
- ld [W_VIRIDIANGYMCURSCRIPT], a
- ld [W_CURMAPSCRIPT], a
+ ld [wViridianGymCurScript], a
+ ld [wCurMapScript], a
ret
ViridianGymScriptPointers: ; 748e1 (1d:48e1)
@@ -30,9 +30,9 @@
dw ViridianGymScript4
ViridianGymScript0: ; 748eb (1d:48eb)
- ld a, [W_YCOORD]
+ ld a, [wYCoord]
ld b, a
- ld a, [W_XCOORD]
+ ld a, [wXCoord]
ld c, a
ld hl, ViridianGymArrowTilePlayerMovement
call DecodeArrowMovementRLE
@@ -46,7 +46,7 @@
ld a, $ff
ld [wJoyIgnore], a
ld a, $4
- ld [W_CURMAPSCRIPT], a
+ ld [wCurMapScript], a
ret
;format:
@@ -125,13 +125,13 @@
ld hl, wd736
res 7, [hl]
ld a, $0
- ld [W_CURMAPSCRIPT], a
+ ld [wCurMapScript], a
ret
.asm_74980
jpba LoadSpinnerArrowTiles
ViridianGymScript3: ; 74988 (1d:4988)
- ld a, [W_ISINBATTLE]
+ ld a, [wIsInBattle]
cp $ff
jp z, ViridianGymScript_748d6
ld a, $f0
@@ -154,7 +154,7 @@
ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_749be
- ld hl, W_OBTAINEDBADGES
+ ld hl, wObtainedBadges
set 7, [hl]
ld hl, wBeatGymFlags
set 7, [hl]
@@ -295,9 +295,9 @@
call EngageMapTrainer
call InitBattleEnemyParameters
ld a, $8
- ld [W_GYMLEADERNO], a
+ ld [wGymLeaderNo], a
ld a, $3
- ld [W_VIRIDIANGYMCURSCRIPT], a
+ ld [wViridianGymCurScript], a
.asm_6dff7
jp TextScriptEnd
--- a/scripts/viridianmart.asm
+++ b/scripts/viridianmart.asm
@@ -2,7 +2,7 @@
call ViridianMartScript_1d47d
call EnableAutoTextBoxDrawing
ld hl, ViridianMartScriptPointers
- ld a, [W_VIRIDIANMARKETCURSCRIPT]
+ ld a, [wViridianMarketCurScript]
jp CallFunctionInTable
ViridianMartScript_1d47d: ; 1d47d (7:547d)
@@ -14,9 +14,9 @@
ld hl, ViridianMartTextPointers + $a ; starts at ViridianMartText6
.asm_1d48c
ld a, l
- ld [W_MAPTEXTPTR], a
+ ld [wMapTextPtr], a
ld a, h
- ld [W_MAPTEXTPTR+1], a
+ ld [wMapTextPtr+1], a
ret
ViridianMartScriptPointers: ; 1d495 (7:5495)
@@ -36,7 +36,7 @@
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $1
- ld [W_VIRIDIANMARKETCURSCRIPT], a
+ ld [wViridianMarketCurScript], a
ret
RLEMovement1d4bb: ; 1d4bb (7:54bb)
@@ -56,7 +56,7 @@
call GiveItem
SetEvent EVENT_GOT_OAKS_PARCEL
ld a, $2
- ld [W_VIRIDIANMARKETCURSCRIPT], a
+ ld [wViridianMarketCurScript], a
; fallthrough
ViridianMartScript2: ; 1d4df (7:54df)
ret
--- a/text.asm
+++ b/text.asm
@@ -243,7 +243,7 @@
INCLUDE "text/maps/seafoam_islands_b4f.asm"
_AIBattleWithdrawText:: ; 880be (22:40be)
- TX_RAM W_TRAINERNAME
+ TX_RAM wTrainerName
text " with-"
line "drew @"
TX_RAM wEnemyMonNick
@@ -251,7 +251,7 @@
prompt
_AIBattleUseItemText:: ; 880d5 (22:40d5)
- TX_RAM W_TRAINERNAME
+ TX_RAM wTrainerName
db $0
line "used @"
TX_RAM wcd6d
@@ -265,7 +265,7 @@
TX_RAM wcf4b
text " went"
line "to @"
- TX_RAM W_GRASSRATE
+ TX_RAM wGrassRate
text "."
done
@@ -277,7 +277,7 @@
done
_TradeSendsText:: ; 88112 (22:4112)
- TX_RAM W_GRASSRATE
+ TX_RAM wGrassRate
text " sends"
line "@"
TX_RAM wcd6d
@@ -285,7 +285,7 @@
done
_TradeWavesFarewellText:: ; 88124 (22:4124)
- TX_RAM W_GRASSRATE
+ TX_RAM wGrassRate
text " waves"
line "farewell as"
done
@@ -304,7 +304,7 @@
done
_TradeWillTradeText:: ; 8816a (22:416a)
- TX_RAM W_GRASSRATE
+ TX_RAM wGrassRate
text " will"
line "trade @"
TX_RAM wcd6d
@@ -1122,7 +1122,7 @@
_TrainerDefeatedText:: ; 896f9 (22:56f9)
text $52, " defeated"
line "@"
- TX_RAM W_TRAINERNAME
+ TX_RAM wTrainerName
text "!"
prompt
@@ -1152,12 +1152,12 @@
_LinkBattleLostText:: ; 89772 (22:5772)
text $52, " lost to"
line "@"
- TX_RAM W_TRAINERNAME
+ TX_RAM wTrainerName
text "!"
prompt
_TrainerAboutToUseText:: ; 89784 (22:5784)
- TX_RAM W_TRAINERNAME
+ TX_RAM wTrainerName
text " is"
line "about to use"
cont"@"
@@ -1169,7 +1169,7 @@
done
_TrainerSentOutText:: ; 897b4 (22:57b4)
- TX_RAM W_TRAINERNAME
+ TX_RAM wTrainerName
text " sent"
line "out @"
TX_RAM wEnemyMonNick
@@ -1475,7 +1475,7 @@
TX_RAM wcd6d
text " grew"
line "to level @"
- TX_NUM W_CURENEMYLVL, 1, 3
+ TX_NUM wCurEnemyLVL, 1, 3
text "!@@"
_WildMonAppearedText:: ; 89c1d (22:5c1d)
@@ -1500,7 +1500,7 @@
prompt
_TrainerWantsToFightText:: ; 89c5e (22:5c5e)
- TX_RAM W_TRAINERNAME
+ TX_RAM wTrainerName
text " wants"
line "to fight!"
prompt
@@ -1683,7 +1683,7 @@
TX_RAM wcd6d
text " grew"
line "to level @"
- TX_NUM W_CURENEMYLVL, $1,$3
+ TX_NUM wCurEnemyLVL, $1,$3
text "!@@"
_TurnedOnPC1Text:: ; 89efe (22:5efe)
--- a/text/maps/daycare_1.asm
+++ b/text/maps/daycare_1.asm
@@ -48,7 +48,7 @@
_DayCareGotMonBackText:: ; 8acae (22:6cae)
text $52, " got"
line "@"
- TX_RAM W_DAYCAREMONNAME
+ TX_RAM wDayCareMonName
text " back!"
done
--- a/wram.asm
+++ b/wram.asm
@@ -1484,29 +1484,29 @@
; other values aren't used
ds 1
-W_ENEMYMOVENUM:: ; cfcc
+wEnemyMoveNum:: ; cfcc
ds 1
-W_ENEMYMOVEEFFECT:: ; cfcd
+wEnemyMoveEffect:: ; cfcd
ds 1
-W_ENEMYMOVEPOWER:: ; cfce
+wEnemyMovePower:: ; cfce
ds 1
-W_ENEMYMOVETYPE:: ; cfcf
+wEnemyMoveType:: ; cfcf
ds 1
-W_ENEMYMOVEACCURACY:: ; cfd0
+wEnemyMoveAccuracy:: ; cfd0
ds 1
-W_ENEMYMOVEMAXPP:: ; cfd1
+wEnemyMoveMaxPP:: ; cfd1
ds 1
-W_PLAYERMOVENUM:: ; cfd2
+wPlayerMoveNum:: ; cfd2
ds 1
-W_PLAYERMOVEEFFECT:: ; cfd3
+wPlayerMoveEffect:: ; cfd3
ds 1
-W_PLAYERMOVEPOWER:: ; cfd4
+wPlayerMovePower:: ; cfd4
ds 1
-W_PLAYERMOVETYPE:: ; cfd5
+wPlayerMoveType:: ; cfd5
ds 1
-W_PLAYERMOVEACCURACY:: ; cfd6
+wPlayerMoveAccuracy:: ; cfd6
ds 1
-W_PLAYERMOVEMAXPP:: ; cfd7
+wPlayerMoveMaxPP:: ; cfd7
ds 1
@@ -1557,7 +1557,7 @@
wBattleMon:: battle_struct wBattleMon ; d014
-W_TRAINERCLASS:: ; d031
+wTrainerClass:: ; d031
ds 1
ds 1
@@ -1582,13 +1582,13 @@
ds 1
-W_TRAINERNAME:: ; d04a
+wTrainerName:: ; d04a
; 13 bytes for the letters of the opposing trainer
; the name is terminated with $50 with possible
; unused trailing letters
ds 13
-W_ISINBATTLE:: ; d057
+wIsInBattle:: ; d057
; lost battle, this is -1
; no battle, this is 0
; wild battle, this is 1
@@ -1599,12 +1599,12 @@
; flags that indicate which party members should be be given exp when GainExperience is called
flag_array 6
-W_CUROPPONENT:: ; d059
+wCurOpponent:: ; d059
; in a wild battle, this is the species of pokemon
; in a trainer battle, this is the trainer class + 200
ds 1
-W_BATTLETYPE:: ; d05a
+wBattleType:: ; d05a
; in normal battle, this is 0
; in old man battle, this is 1
; in safari battle, this is 2
@@ -1619,12 +1619,12 @@
; bit 7: STAB
ds 1
-W_LONEATTACKNO:: ; d05c
+wLoneAttackNo:: ; d05c
; which entry in LoneAttacks to use
-W_GYMLEADERNO:: ; d05c
+wGymLeaderNo:: ; d05c
; it's actually the same thing as ^
ds 1
-W_TRAINERNO:: ; d05d
+wTrainerNo:: ; d05d
; which instance of [youngster, lass, etc] is this?
ds 1
@@ -1635,7 +1635,7 @@
; $ff = failed OHKO
ds 1
-W_MOVEMISSED:: ; d05f
+wMoveMissed:: ; d05f
ds 1
wPlayerStatsToDouble:: ; d060
@@ -1646,7 +1646,7 @@
; always 0
ds 1
-W_PLAYERBATTSTATUS1:: ; d062
+wPlayerBattleStatus1:: ; d062
; bit 0 - bide
; bit 1 - thrash / petal dance
; bit 2 - attacking multiple times (e.g. double kick)
@@ -1657,7 +1657,7 @@
; bit 7 - confusion
ds 1
-W_PLAYERBATTSTATUS2:: ; d063
+wPlayerBattleStatus2:: ; d063
; bit 0 - X Accuracy effect
; bit 1 - protected by "mist"
; bit 2 - focus energy effect
@@ -1667,7 +1667,7 @@
; bit 7 - leech seeded
ds 1
-W_PLAYERBATTSTATUS3:: ; d064
+wPlayerBattleStatus3:: ; d064
; bit 0 - toxic
; bit 1 - light screen
; bit 2 - reflect
@@ -1682,11 +1682,11 @@
; always 0
ds 1
-W_ENEMYBATTSTATUS1:: ; d067
+wEnemyBattleStatus1:: ; d067
ds 1
-W_ENEMYBATTSTATUS2:: ; d068
+wEnemyBattleStatus2:: ; d068
ds 1
-W_ENEMYBATTSTATUS3:: ; d069
+wEnemyBattleStatus3:: ; d069
ds 1
wPlayerNumAttacksLeft::
@@ -1693,12 +1693,13 @@
; when the player is attacking multiple times, the number of attacks left
ds 1
-W_PLAYERCONFUSEDCOUNTER:: ; d06b
+wPlayerConfusedCounter:: ; d06b
ds 1
-W_PLAYERTOXICCOUNTER:: ; d06c
+wPlayerToxicCounter:: ; d06c
ds 1
-W_PLAYERDISABLEDMOVE:: ; d06d
+
+wPlayerDisabledMove:: ; d06d
; high nibble: which move is disabled (1-4)
; low nibble: disable turns left
ds 1
@@ -1709,12 +1710,13 @@
; when the enemy is attacking multiple times, the number of attacks left
ds 1
-W_ENEMYCONFUSEDCOUNTER:: ; d070
+wEnemyConfusedCounter:: ; d070
ds 1
-W_ENEMYTOXICCOUNTER:: ; d071
+wEnemyToxcCounter:: ; d071
ds 1
-W_ENEMYDISABLEDMOVE:: ; d072
+
+wEnemyDisabledMove:: ; d072
; high nibble: which move is disabled (1-4)
; low nibble: disable turns left
ds 1
@@ -1752,7 +1754,7 @@
wMenuItemOffset:: ; d07c
-W_ANIMATIONID:: ; d07c
+wAnimationID:: ; d07c
; ID number of the current battle animation
ds 1
@@ -1772,9 +1774,9 @@
ds 2
; base coordinates of frame block
-W_BASECOORDX:: ; d081
+wBaseCoordX:: ; d081
ds 1
-W_BASECOORDY:: ; d082
+wBaseCoordY:: ; d082
ds 1
; low health alarm counter/enable
@@ -1781,7 +1783,7 @@
; high bit = enable, others = timer to cycle frequencies
wLowHealthAlarm:: ds 1 ; d083
-W_FBTILECOUNTER:: ; d084
+wFBTileCounter:: ; d084
; counts how many tiles of the current frame block have been drawn
ds 1
@@ -1788,10 +1790,10 @@
wMovingBGTilesCounter2:: ; d085
ds 1
-W_SUBANIMFRAMEDELAY:: ; d086
+wSubAnimFrameDelay:: ; d086
; duration of each frame of the current subanimation in terms of screen refreshes
ds 1
-W_SUBANIMCOUNTER:: ; d087
+wSubAnimCounter:: ; d087
; counts the number of subentries left in the current subanimation
ds 1
@@ -1800,7 +1802,7 @@
; 2 = save file exists and no corruption has been detected
ds 1
-W_NUMFBTILES:: ; d089
+wNumFBTiles:: ; d089
; number of tiles in current battle animation frame block
ds 1
@@ -1836,7 +1838,7 @@
wAnimCounter:: ; d08b
; generic counter variable for various animations
-W_SUBANIMTRANSFORM:: ; d08b
+wSubAnimTransform:: ; d08b
; controls what transformations are applied to the subanimation
; 01: flip horizontally and vertically
; 02: flip horizontally and translate downwards 40 pixels
@@ -1857,7 +1859,7 @@
ds 1
-W_SUBANIMADDRPTR:: ; d094
+wSubAnimAddrPtr:: ; d094
; the address _of the address_ of the current subanimation entry
ds 2
@@ -1867,7 +1869,7 @@
; the only way it can increase. Winning certain payout amounts will decrement it
; or zero it.
-W_SUBANIMSUBENTRYADDR:: ; d096
+wSubAnimSubEntryAddr:: ; d096
; the address of the current subentry of the current subanimation
ds 2
@@ -1885,17 +1887,17 @@
wUnusedD09B:: ; d09b
ds 1
-W_FBDESTADDR:: ; d09c
+wFBDestAddr:: ; d09c
; current destination address in OAM for frame blocks (big endian)
ds 2
-W_FBMODE:: ; d09e
+wFBMode:: ; d09e
; controls how the frame blocks are put together to form frames
; specifically, after finishing drawing the frame block, the frame block's mode determines what happens
; 00: clean OAM buffer and delay
; 02: move onto the next frame block with no delay and no cleaning OAM buffer
; 03: delay, but don't clean OAM buffer
-; 04: delay, without cleaning OAM buffer, and do not advance [W_FBDESTADDR], so that the next frame block will overwrite this one
+; 04: delay, without cleaning OAM buffer, and do not advance [wFBDestAddr], so that the next frame block will overwrite this one
ds 1
wLinkCableAnimBulgeToggle:: ; d09f
@@ -1922,22 +1924,22 @@
wDisableVBlankWYUpdate:: ds 1 ; if non-zero, don't update WY during V-blank
-W_SPRITECURPOSX:: ; d0a1
+wSpriteCurPosX:: ; d0a1
ds 1
-W_SPRITECURPOSY:: ; d0a2
+wSpriteCurPosY:: ; d0a2
ds 1
-W_SPRITEWITDH:: ; d0a3
+wSpriteWidth:: ; d0a3
ds 1
-W_SPRITEHEIGHT:: ; d0a4
+wSpriteHeight:: ; d0a4
ds 1
-W_SPRITEINPUTCURBYTE:: ; d0a5
+wSpriteInputCurByte:: ; d0a5
; current input byte
ds 1
-W_SPRITEINPUTBITCOUNTER:: ; d0a6
+wSpriteInputBitCounter:: ; d0a6
; bit offset of last read input bit
ds 1
-W_SPRITEOUTPUTBITOFFSET:: ; d0a7; determines where in the output byte the two bits are placed. Each byte contains four columns (2bpp data)
+wSpriteOutputBitOffset:: ; d0a7; determines where in the output byte the two bits are placed. Each byte contains four columns (2bpp data)
; 3 -> XX000000 1st column
; 2 -> 00XX0000 2nd column
; 1 -> 0000XX00 3rd column
@@ -1944,28 +1946,28 @@
; 0 -> 000000XX 4th column
ds 1
-W_SPRITELOADFLAGS:: ; d0a8
+wSpriteLoadFlags:: ; d0a8
; bit 0 determines used buffer (0 -> $a188, 1 -> $a310)
; bit 1 loading last sprite chunk? (there are at most 2 chunks per load operation)
ds 1
-W_SPRITEUNPACKMODE:: ; d0a9
+wSpriteUnpackMode:: ; d0a9
ds 1
-W_SPRITEFLIPPED:: ; d0aa
+wSpriteFlipped:: ; d0aa
ds 1
-W_SPRITEINPUTPTR:: ; d0ab
+wSpriteInputPtr:: ; d0ab
; pointer to next input byte
ds 2
-W_SPRITEOUTPUTPTR:: ; d0ad
+wSpriteOutputPtr:: ; d0ad
; pointer to current output byte
ds 2
-W_SPRITEOUTPUTPTRCACHED:: ; d0af
+wSpriteOutputPtrCached:: ; d0af
; used to revert pointer for different bit offsets
ds 2
-W_SPRITEDECODETABLE0PTR:: ; d0b1
+wSpriteDecodeTable0Ptr:: ; d0b1
; pointer to differential decoding table (assuming initial value 0)
ds 2
-W_SPRITEDECODETABLE1PTR:: ; d0b3
+wSpriteDecodeTable1Ptr:: ; d0b3
; pointer to differential decoding table (assuming initial value 1)
ds 2
@@ -1977,49 +1979,49 @@
wPredefBank:: ; d0b7
ds 1
-W_MONHEADER:: ; d0b8
+wMonHeader:: ; d0b8
-W_MONHINDEX:: ; d0b8
+wMonHIndex:: ; d0b8
; In the ROM base stats data stucture, this is the dex number, but it is
; overwritten with the internal index number after the header is copied to WRAM.
ds 1
-W_MONHBASESTATS:: ; d0b9
-W_MONHBASEHP:: ; d0b9
+wMonHBaseStats:: ; d0b9
+wMonHBaseHP:: ; d0b9
ds 1
-W_MONHBASEATTACK:: ; d0ba
+wMonHBaseAttack:: ; d0ba
ds 1
-W_MONHBASEDEFENSE:: ; d0bb
+wMonHBaseDefense:: ; d0bb
ds 1
-W_MONHBASESPEED:: ; d0bc
+wMonHBaseSpeed:: ; d0bc
ds 1
-W_MONHBASESPECIAL:: ; d0bd
+wMonHBaseSpecial:: ; d0bd
ds 1
-W_MONHTYPES:: ; d0be
-W_MONHTYPE1:: ; d0be
+wMonHTypes:: ; d0be
+wMonHType1:: ; d0be
ds 1
-W_MONHTYPE2:: ; d0bf
+wMonHType2:: ; d0bf
ds 1
-W_MONHCATCHRATE:: ; d0c0
+wMonHCatchRate:: ; d0c0
ds 1
-W_MONHBASEXP:: ; d0c1
+wMonHBaseEXP:: ; d0c1
ds 1
-W_MONHSPRITEDIM:: ; d0c2
+wMonHSpriteDim:: ; d0c2
ds 1
-W_MONHFRONTSPRITE:: ; d0c3
+wMonHFrontSprite:: ; d0c3
ds 2
-W_MONHBACKSPRITE:: ; d0c5
+wMonHBackSprite:: ; d0c5
ds 2
-W_MONHMOVES:: ; d0c7
- ds 4
+wMonHMoves:: ; d0c7
+ ds NUM_MOVES
-W_MONHGROWTHRATE:: ; d0cb
+wMonHGrowthRate:: ; d0cb
ds 1
-W_MONHLEARNSET:: ; d0cc
+wMonHLearnset:: ; d0cc
; bit field
flag_array 50 + 5
ds 1
@@ -2030,10 +2032,8 @@
ds 2
-W_MONHPADDING:: ; d0d7
-
-W_DAMAGE:: ; d0d7
+wDamage:: ; d0d7
ds 2
ds 2
@@ -2120,7 +2120,7 @@
wd126:: ds 1 ; not exactly sure what this is used for, but it seems to be used as a multipurpose temp flag value
-W_CURENEMYLVL:: ; d127
+wCurEnemyLVL:: ; d127
ds 1
wItemListPointer:: ; d128
@@ -2198,11 +2198,11 @@
; after a battle, you have at least 3 steps before a random battle can occur
ds 1
-W_PRIZE1:: ; d13d
+wPrize1:: ; d13d
ds 1
-W_PRIZE2:: ; d13e
+wPrize2:: ; d13e
ds 1
-W_PRIZE3:: ; d13f
+wPrize3:: ; d13f
ds 1
ds 1
@@ -2291,10 +2291,10 @@
wPlayerMoney:: ; d347
ds 3 ; BCD
-W_RIVALNAME:: ; d34a
+wRivalName:: ; d34a
ds NAME_LENGTH
-W_OPTIONS:: ; d355
+wOptions:: ; d355
; bit 7 = battle animation
; 0: On
; 1: Off
@@ -2307,7 +2307,7 @@
; 5: Slow
ds 1
-W_OBTAINEDBADGES:: ; d356
+wObtainedBadges:: ; d356
ds 1
ds 1
@@ -2333,7 +2333,7 @@
; normally, it is 0. it is 6 when Flash is needed, causing FadePal2 to be used instead of FadePal4
ds 1
-W_CURMAP:: ; d35e
+wCurMap:: ; d35e
ds 1
wCurrentTileBlockMapViewPointer:: ; d35f
@@ -2340,18 +2340,18 @@
; pointer to the upper left corner of the current view in the tile block map
ds 2
-W_YCOORD:: ; d361
+wYCoord:: ; d361
; player’s position on the current map
ds 1
-W_XCOORD:: ; d362
+wXCoord:: ; d362
ds 1
-W_YBLOCKCOORD:: ; d363
+wYBlockCoord:: ; d363
; player's y position (by block)
ds 1
-W_XBLOCKCOORD:: ; d364
+wXBlockCoord:: ; d364
ds 1
wLastMap:: ; d365
@@ -2360,31 +2360,31 @@
wUnusedD366:: ; d366
ds 1
-W_CURMAPTILESET:: ; d367
+wCurMapTileset:: ; d367
ds 1
-W_CURMAPHEIGHT:: ; d368
+wCurMapHeight:: ; d368
; blocks
ds 1
-W_CURMAPWIDTH:: ; d369
+wCurMapWidth:: ; d369
; blocks
ds 1
-W_MAPDATAPTR:: ; d36a
+wMapDataPtr:: ; d36a
ds 2
-W_MAPTEXTPTR:: ; d36c
+wMapTextPtr:: ; d36c
ds 2
-W_MAPSCRIPTPTR:: ; d36e
+wMapScriptPtr:: ; d36e
ds 2
-W_MAPCONNECTIONS:: ; d370
+wMapConnections:: ; d370
; connection byte
ds 1
-W_MAPCONN1PTR:: ; d371
+wMapConn1Ptr:: ; d371
ds 1
wNorthConnectionStripSrc:: ; d372
@@ -2408,7 +2408,7 @@
wNorthConnectedMapViewPointer:: ; d37a
ds 2
-W_MAPCONN2PTR:: ; d37c
+wMapConn2Ptr:: ; d37c
ds 1
wSouthConnectionStripSrc:: ; d37d
@@ -2432,7 +2432,7 @@
wSouthConnectedMapViewPointer:: ; d385
ds 2
-W_MAPCONN3PTR:: ; d387
+wMapConn3Ptr:: ; d387
ds 1
wWestConnectionStripSrc:: ; d388
@@ -2456,7 +2456,7 @@
wWestConnectedMapViewPointer:: ; d390
ds 2
-W_MAPCONN4PTR:: ; d392
+wMapConn4Ptr:: ; d392
ds 1
wEastConnectionStripSrc:: ; d393
@@ -2480,11 +2480,11 @@
wEastConnectedMapViewPointer:: ; d39b
ds 2
-W_SPRITESET:: ; d39d
+wSpriteSet:: ; d39d
; sprite set for the current map (11 sprite picture ID's)
ds 11
-W_SPRITESETID:: ; d3a8
+wSpriteSetID:: ; d3a8
; sprite set ID for the current map
ds 1
@@ -2523,7 +2523,7 @@
wSignTextIDs:: ; d4d1
ds 16
-W_NUMSPRITES:: ; d4e1
+wNumSprites:: ; d4e1
; number of sprites on the current map
ds 1
@@ -2534,11 +2534,11 @@
wXOffsetSinceLastSpecialWarp:: ; d4e3
ds 1
-W_MAPSPRITEDATA:: ; d4e4
+wMapSpriteData:: ; d4e4
; two bytes per sprite (movement byte 2, text ID)
ds 32
-W_MAPSPRITEEXTRADATA:: ; d504
+wMapSpriteExtraData:: ; d504
; two bytes per sprite (trainer class/item ID, trainer set ID)
ds 32
@@ -2572,24 +2572,24 @@
; if the player is not moving, the last the direction in which the player moved
ds 1
-W_TILESETBANK:: ; d52b
+wTileSetBank:: ; d52b
ds 1
-W_TILESETBLOCKSPTR:: ; d52c
+wTileSetBlocksPtr:: ; d52c
; maps blocks (4x4 tiles) to tiles
ds 2
-W_TILESETGFXPTR:: ; d52e
+wTileSetGFXPtr:: ; d52e
ds 2
-W_TILESETCOLLISIONPTR:: ; d530
+wTileSetCollisionPtr:: ; d530
; list of all walkable tiles
ds 2
-W_TILESETTALKINGOVERTILES:: ; d532
+wTileSetTalkingOverTiles:: ; d532
ds 3
-W_GRASSTILE:: ; d535
+wGrassTile:: ; d535
ds 1
ds 4
@@ -2616,7 +2616,7 @@
wPlayerCoins:: ; d5a4
ds 2 ; BCD
-W_MISSABLEOBJECTFLAGS:: ; d5a6
+wMissableObjectFlags:: ; d5a6
; bit array of missable objects. set = removed
ds 32
wMissableObjectFlagsEnd::
@@ -2625,225 +2625,225 @@
wd5cd:: ds 1 ; temp copy of c1x2 (sprite facing/anim)
-W_MISSABLEOBJECTLIST:: ; d5ce
+wMissableObjectList:: ; d5ce
; each entry consists of 2 bytes
; * the sprite ID (depending on the current map)
-; * the missable object index (global, used for W_MISSABLEOBJECTFLAGS)
+; * the missable object index (global, used for wMissableObjectFlags)
; terminated with $FF
ds 17 * 2
-W_GAMEPROGRESSFLAGS:: ; d5f0
+wGameProgressFlags:: ; d5f0
; $c8 bytes
ds 0
-W_OAKSLABCURSCRIPT:: ; d5f0
+wOaksLabCurScript:: ; d5f0
ds 1
-W_PALLETTOWNCURSCRIPT:: ; d5f1
+wPalletTownCurScript:: ; d5f1
ds 1
ds 1
-W_BLUESHOUSECURSCRIPT:: ; d5f3
+wBluesHouseCurScript:: ; d5f3
ds 1
-W_VIRIDIANCITYCURSCRIPT:: ; d5f4
+wViridianCityCurScript:: ; d5f4
ds 1
ds 2
-W_PEWTERCITYCURSCRIPT:: ; d5f7
+wPewterCityCurScript:: ; d5f7
ds 1
-W_ROUTE3CURSCRIPT:: ; d5f8
+wRoute3CurScript:: ; d5f8
ds 1
-W_ROUTE4CURSCRIPT:: ; d5f9
+wRoute4CurScript:: ; d5f9
ds 1
ds 1
-W_VIRIDIANGYMCURSCRIPT:: ; d5fb
+wViridianGymCurScript:: ; d5fb
ds 1
-W_PEWTERGYMCURSCRIPT:: ; d5fc
+wPewterGymCurScript:: ; d5fc
ds 1
-W_CERULEANGYMCURSCRIPT:: ; d5fd
+wCeruleanGymCurScript:: ; d5fd
ds 1
-W_VERMILIONGYMCURSCRIPT:: ; d5fe
+wVermilionGymCurScript:: ; d5fe
ds 1
-W_CELADONGYMCURSCRIPT:: ; d5ff
+wCeladonGymCurScript:: ; d5ff
ds 1
-W_ROUTE6CURSCRIPT:: ; d600
+wRoute6CurScript:: ; d600
ds 1
-W_ROUTE8CURSCRIPT:: ; d601
+wRoute8CurScript:: ; d601
ds 1
-W_ROUTE24CURSCRIPT:: ; d602
+wRoute24CurScript:: ; d602
ds 1
-W_ROUTE25CURSCRIPT:: ; d603
+wRoute25CurScript:: ; d603
ds 1
-W_ROUTE9CURSCRIPT:: ; d604
+wRoute9CurScript:: ; d604
ds 1
-W_ROUTE10CURSCRIPT:: ; d605
+wRoute10CurScript:: ; d605
ds 1
-W_MTMOON1CURSCRIPT:: ; d606
+wMtMoon1CurScript:: ; d606
ds 1
-W_MTMOON3CURSCRIPT:: ; d607
+wMtMoon3CurScript:: ; d607
ds 1
-W_SSANNE8CURSCRIPT:: ; d608
+wSSAnne8CurScript:: ; d608
ds 1
-W_SSANNE9CURSCRIPT:: ; d609
+wSSAnne9CurScript:: ; d609
ds 1
-W_ROUTE22CURSCRIPT:: ; d60a
+wRoute22CurScript:: ; d60a
ds 1
ds 1
-W_REDSHOUSE2CURSCRIPT:: ; d60c
+wRedsHouse2CurScript:: ; d60c
ds 1
-W_VIRIDIANMARKETCURSCRIPT:: ; d60d
+wViridianMarketCurScript:: ; d60d
ds 1
-W_ROUTE22GATECURSCRIPT:: ; d60e
+wRoute22GateCurScript:: ; d60e
ds 1
-W_CERULEANCITYCURSCRIPT:: ; d60f
+wCeruleanCityCurScript:: ; d60f
ds 1
ds 7
-W_SSANNE5CURSCRIPT:: ; d617
+wSSAnne5CurScript:: ; d617
ds 1
-W_VIRIDIANFORESTCURSCRIPT:: ; d618
+wViridianForestCurScript:: ; d618
ds 1
-W_MUSEUM1FCURSCRIPT:: ; d619
+wMuseum1fCurScript:: ; d619
ds 1
-W_ROUTE13CURSCRIPT:: ; d61a
+wRoute13CurScript:: ; d61a
ds 1
-W_ROUTE14CURSCRIPT:: ; d61b
+wRoute14CurScript:: ; d61b
ds 1
-W_ROUTE17CURSCRIPT:: ; d61c
+wRoute17CurScript:: ; d61c
ds 1
-W_ROUTE19CURSCRIPT:: ; d61d
+wRoute19CurScript:: ; d61d
ds 1
-W_ROUTE21CURSCRIPT:: ; d61e
+wRoute21CurScript:: ; d61e
ds 1
-W_SAFARIZONEENTRANCECURSCRIPT:: ; d61f
+wSafariZoneEntranceCurScript:: ; d61f
ds 1
-W_ROCKTUNNEL2CURSCRIPT:: ; d620
+wRockTunnel2CurScript:: ; d620
ds 1
-W_ROCKTUNNEL1CURSCRIPT:: ; d621
+wRockTunnel1CurScript:: ; d621
ds 1
ds 1
-W_ROUTE11CURSCRIPT:: ; d623
+wRoute11CurScript:: ; d623
ds 1
-W_ROUTE12CURSCRIPT:: ; d624
+wRoute12CurScript:: ; d624
ds 1
-W_ROUTE15CURSCRIPT:: ; d625
+wRoute15CurScript:: ; d625
ds 1
-W_ROUTE16CURSCRIPT:: ; d626
+wRoute16CurScript:: ; d626
ds 1
-W_ROUTE18CURSCRIPT:: ; d627
+wRoute18CurScript:: ; d627
ds 1
-W_ROUTE20CURSCRIPT:: ; d628
+wRoute20CurScript:: ; d628
ds 1
-W_SSANNE10CURSCRIPT:: ; d629
+wSSAnne10CurScript:: ; d629
ds 1
-W_VERMILIONCITYCURSCRIPT:: ; d62a
+wVermilionCityCurScript:: ; d62a
ds 1
-W_POKEMONTOWER2CURSCRIPT:: ; d62b
+wPokemonTower2CurScript:: ; d62b
ds 1
-W_POKEMONTOWER3CURSCRIPT:: ; d62c
+wPokemonTower3CurScript:: ; d62c
ds 1
-W_POKEMONTOWER4CURSCRIPT:: ; d62d
+wPokemonTower4CurScript:: ; d62d
ds 1
-W_POKEMONTOWER5CURSCRIPT:: ; d62e
+wPokemonTower5CurScript:: ; d62e
ds 1
-W_POKEMONTOWER6CURSCRIPT:: ; d62f
+wPokemonTower6CurScript:: ; d62f
ds 1
-W_POKEMONTOWER7CURSCRIPT:: ; d630
+wPokemonTower7CurScript:: ; d630
ds 1
-W_ROCKETHIDEOUT1CURSCRIPT:: ; d631
+wRocketHideout1CurScript:: ; d631
ds 1
-W_ROCKETHIDEOUT2CURSCRIPT:: ; d632
+wRocketHideout2CurScript:: ; d632
ds 1
-W_ROCKETHIDEOUT3CURSCRIPT:: ; d633
+wRocketHideout3CurScript:: ; d633
ds 1
-W_ROCKETHIDEOUT4CURSCRIPT:: ; d634
+wRocketHideout4CurScript:: ; d634
ds 2
-W_ROUTE6GATECURSCRIPT:: ; d636
+wRoute6GateCurScript:: ; d636
ds 1
-W_ROUTE8GATECURSCRIPT:: ; d637
+wRoute8GateCurScript:: ; d637
ds 2
-W_CINNABARISLANDCURSCRIPT:: ; d639
+wCinnabarIslandCurScript:: ; d639
ds 1
-W_MANSION1CURSCRIPT:: ; d63a
+wMansion1CurScript:: ; d63a
ds 2
-W_MANSION2CURSCRIPT:: ; d63c
+wMansion2CurScript:: ; d63c
ds 1
-W_MANSION3CURSCRIPT:: ; d63d
+wMansion3CurScript:: ; d63d
ds 1
-W_MANSION4CURSCRIPT:: ; d63e
+wMansion4CurScript:: ; d63e
ds 1
-W_VICTORYROAD2CURSCRIPT:: ; d63f
+wVictoryRoad2CurScript:: ; d63f
ds 1
-W_VICTORYROAD3CURSCRIPT:: ; d640
+wVictoryRoad3CurScript:: ; d640
ds 2
-W_FIGHTINGDOJOCURSCRIPT:: ; d642
+wFightingDojoCurScript:: ; d642
ds 1
-W_SILPHCO2CURSCRIPT:: ; d643
+wSilphCo2CurScript:: ; d643
ds 1
-W_SILPHCO3CURSCRIPT:: ; d644
+wSilphCo3CurScript:: ; d644
ds 1
-W_SILPHCO4CURSCRIPT:: ; d645
+wSilphCo4CurScript:: ; d645
ds 1
-W_SILPHCO5CURSCRIPT:: ; d646
+wSilphCo5CurScript:: ; d646
ds 1
-W_SILPHCO6CURSCRIPT:: ; d647
+wSilphCo6CurScript:: ; d647
ds 1
-W_SILPHCO7CURSCRIPT:: ; d648
+wSilphCo7CurScript:: ; d648
ds 1
-W_SILPHCO8CURSCRIPT:: ; d649
+wSilphCo8CurScript:: ; d649
ds 1
-W_SILPHCO9CURSCRIPT:: ; d64a
+wSilphCo9CurScript:: ; d64a
ds 1
-W_HALLOFFAMEROOMCURSCRIPT:: ; d64b
+wHallOfFameRoomCurScript:: ; d64b
ds 1
-W_GARYCURSCRIPT:: ; d64c
+wGaryCurScript:: ; d64c
ds 1
-W_LORELEICURSCRIPT:: ; d64d
+wLoreleiCurScript:: ; d64d
ds 1
-W_BRUNOCURSCRIPT:: ; d64e
+wBrunoCurScript:: ; d64e
ds 1
-W_AGATHACURSCRIPT:: ; d64f
+wAgathaCurScript:: ; d64f
ds 1
-W_UNKNOWNDUNGEON3CURSCRIPT:: ; d650
+wUnknownDungeon3CurScript:: ; d650
ds 1
-W_VICTORYROAD1CURSCRIPT:: ; d651
+wVictoryRoad1CurScript:: ; d651
ds 1
ds 1
-W_LANCECURSCRIPT:: ; d653
+wLanceCurScript:: ; d653
ds 1
ds 4
-W_SILPHCO10CURSCRIPT:: ; d658
+wSilphCo10CurScript:: ; d658
ds 1
-W_SILPHCO11CURSCRIPT:: ; d659
+wSilphCo11CurScript:: ; d659
ds 1
ds 1
-W_FUCHSIAGYMCURSCRIPT:: ; d65b
+wFuchsiaGymCurScript:: ; d65b
ds 1
-W_SAFFRONGYMCURSCRIPT:: ; d65c
+wSaffronGymCurScript:: ; d65c
ds 1
ds 1
-W_CINNABARGYMCURSCRIPT:: ; d65e
+wCinnabarGymCurScript:: ; d65e
ds 1
-W_CELADONGAMECORNERCURSCRIPT:: ; d65f
+wCeladonGameCornerCurScript:: ; d65f
ds 1
-W_ROUTE16GATECURSCRIPT:: ; d660
+wRoute16GateCurScript:: ; d660
ds 1
-W_BILLSHOUSECURSCRIPT:: ; d661
+wBillsHouseCurScript:: ; d661
ds 1
-W_ROUTE5GATECURSCRIPT:: ; d662
+wRoute5GateCurScript:: ; d662
ds 1
-W_POWERPLANTCURSCRIPT:: ; d663
+wPowerPlantCurScript:: ; d663
; overload
ds 0
-W_ROUTE7GATECURSCRIPT:: ; d663
+wRoute7GateCurScript:: ; d663
; overload
ds 1
ds 1
-W_SSANNE2CURSCRIPT:: ; d665
+wSSAnne2CurScript:: ; d665
ds 1
-W_SEAFOAMISLANDS4CURSCRIPT:: ; d666
+wSeafoamIslands4CurScript:: ; d666
ds 1
-W_ROUTE23CURSCRIPT:: ; d667
+wRoute23CurScript:: ; d667
ds 1
-W_SEAFOAMISLANDS5CURSCRIPT:: ; d668
+wSeafoamIslands5CurScript:: ; d668
ds 1
-W_ROUTE18GATECURSCRIPT:: ; d669
+wRoute18GateCurScript:: ; d669
ds 1
ds 78
@@ -2865,7 +2865,7 @@
ds 10
-W_TOWNVISITEDFLAG:: ; d70b
+wTownVisitedFlag:: ; d70b
flag_array 13
wSafariSteps:: ; d70d
@@ -2872,17 +2872,17 @@
; starts at 502
ds 2
-W_FOSSILITEM:: ; d70f
+wFossilItem:: ; d70f
; item given to cinnabar lab
ds 1
-W_FOSSILMON:: ; d710
+wFossilMon:: ; d710
; mon that will result from the item
ds 1
ds 2
-W_ENEMYMONORTRAINERCLASS:: ; d713
+wEnemyMonOrTrainerClass:: ; d713
; trainer classes start at 200
ds 1
@@ -2889,12 +2889,12 @@
wPlayerJumpingYScreenCoordsIndex:: ; d714
ds 1
-W_RIVALSTARTER:: ; d715
+wRivalStarter:: ; d715
ds 1
ds 1
-W_PLAYERSTARTER:: ; d717
+wPlayerStarter:: ; d717
ds 1
wBoulderSpriteIndex:: ; d718
@@ -2942,7 +2942,7 @@
ds 1
wBeatGymFlags:: ; d72a
-; redundant because it matches W_OBTAINEDBADGES
+; redundant because it matches wObtainedBadges
; used to determine whether to show name on statue and in two NPC text scripts
ds 1
@@ -3002,12 +3002,12 @@
; bit 6: map destination is [wLastBlackoutMap] (usually the last used pokemon center, but could be the player's house)
ds 1
-W_FLAGS_D733:: ; d733
+wFlags_D733:: ; d733
; bit 0: running a test battle
; bit 1: prevent music from changing when entering new map
; bit 2: skip the joypad check in CheckWarpsNoCollision (used for the forced warp down the waterfall in the Seafoam Islands)
; bit 3: trainer wants to battle
-; 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)
+; bit 4: use variable [wCurMapScript] instead of the provided index for next frame's map script (used to start battle when talking to trainers)
; bit 7: used fly out of battle
ds 1
@@ -3058,10 +3058,10 @@
wLinkEnemyTrainerName:: ; d887
; linked game's trainer name
-W_GRASSRATE:: ; d887
+wGrassRate:: ; d887
ds 1
-W_GRASSMONS:: ; d888
+wGrassMons:: ; d888
ds 20
wEnemyPartyCount:: ds 1 ; d89c
@@ -3079,7 +3079,7 @@
wEnemyMonNicks:: ds NAME_LENGTH * PARTY_LENGTH ; d9ee
-W_TRAINERHEADERPTR:: ; da30
+wTrainerHeaderPtr:: ; da30
ds 2
ds 6
@@ -3091,7 +3091,7 @@
wUnusedDA38:: ; da38
ds 1
-W_CURMAPSCRIPT:: ; da39
+wCurMapScript:: ; 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
ds 1
@@ -3098,29 +3098,29 @@
ds 6
-W_PLAYTIMEHOURS:: ; da40
+wPlayTimeHours:: ; da40
ds 2
-W_PLAYTIMEMINUTES:: ; da42
+wPlayTimeMinutes:: ; da42
ds 2
-W_PLAYTIMESECONDS:: ; da44
+wPlayTimeSeconds:: ; da44
ds 1
-W_PLAYTIMEFRAMES:: ; da45
+wPlayTimeFrames:: ; da45
ds 1
wSafariZoneGameOver:: ; da46
ds 1
-W_NUMSAFARIBALLS:: ; da47
+wNumSafariBalls:: ; da47
ds 1
-W_DAYCARE_IN_USE:: ; da48
+wDayCareInUse:: ; da48
; 0 if no pokemon is in the daycare
; 1 if pokemon is in the daycare
ds 1
-W_DAYCAREMONNAME:: ds NAME_LENGTH ; da49
-W_DAYCAREMONOT:: ds NAME_LENGTH ; da54
+wDayCareMonName:: ds NAME_LENGTH ; da49
+wDayCareMonOT:: ds NAME_LENGTH ; da54
wDayCareMon:: box_struct wDayCareMon ; da5f
@@ -3129,7 +3129,7 @@
wBoxDataStart::
-W_NUMINBOX:: ds 1 ; da80
+wNumInBox:: ds 1 ; da80
wBoxSpecies:: ds MONS_PER_BOX + 1
wBoxMons::