ref: b35eb72290b964b98844afbe741bb7ede34b9ef3
parent: 7547ad839cf1c8141b931d08ef16a894e7db68c9
parent: 32ade4ac9bf113d630d904aab51f2c49c91bf8c2
author: yenatch <yenatch@gmail.com>
date: Sat Feb 3 12:15:20 EST 2018
Merge pull request #480 from luckytyphlosion/master [Ready to merge] Prefix wram labels with w.
--- a/audio/engine.asm
+++ b/audio/engine.asm
@@ -38,8 +38,8 @@
dec e
jr nz, .clearsound
- ld hl, Channels ; start of channel data
- ld de, ChannelsEnd - Channels ; length of area to clear (entire sound wram area)
+ ld hl, wChannels ; start of channel data
+ ld de, wChannelsEnd - wChannels ; length of area to clear (entire sound wram area)
.clearchannels
xor a
ld [hli], a
@@ -48,7 +48,7 @@
or d
jr nz, .clearchannels
ld a, MAX_VOLUME
- ld [Volume], a
+ ld [wVolume], a
call MusicOn
pop af
pop bc
@@ -60,15 +60,15 @@
MusicFadeRestart: ; e803d
; restart but keep the music id to fade in to
- ld a, [MusicFadeID + 1]
+ ld a, [wMusicFadeID + 1]
push af
- ld a, [MusicFadeID]
+ ld a, [wMusicFadeID]
push af
call _MapSetup_Sound_Off
pop af
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
pop af
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ret
; e8051
@@ -75,7 +75,7 @@
MusicOn: ; e8051
ld a, 1
- ld [MusicPlaying], a
+ ld [wMusicPlaying], a
ret
; e8057
@@ -82,7 +82,7 @@
MusicOff: ; e8057
xor a
- ld [MusicPlaying], a
+ ld [wMusicPlaying], a
ret
; e805c
@@ -90,22 +90,22 @@
_UpdateSound:: ; e805c
; called once per frame
; no use updating audio if it's not playing
- ld a, [MusicPlaying]
+ ld a, [wMusicPlaying]
and a
ret z
; start at ch1
xor a
- ld [CurChannel], a ; just
- ld [SoundOutput], a ; off
- ld bc, Channel1
+ ld [wCurChannel], a ; just
+ ld [wSoundOutput], a ; off
+ ld bc, wChannel1
.loop
; is the channel active?
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
bit SOUND_CHANNEL_ON, [hl]
jp z, .nextchannel
; check time left in the current note
- ld hl, Channel1NoteDuration - Channel1
+ ld hl, wChannel1NoteDuration - wChannel1
add hl, bc
ld a, [hl]
cp $2 ; 1 or 0?
@@ -115,14 +115,14 @@
.noteover
; reset vibrato delay
- ld hl, Channel1VibratoDelay - Channel1
+ ld hl, wChannel1VibratoDelay - wChannel1
add hl, bc
ld a, [hl]
- ld hl, Channel1VibratoDelayCount - Channel1
+ ld hl, wChannel1VibratoDelayCount - wChannel1
add hl, bc
ld [hl], a
; turn vibrato off for now
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
res SOUND_PITCH_WHEEL, [hl]
; get next note
@@ -130,7 +130,7 @@
.continue_sound_update
call ApplyPitchWheel
; duty cycle
- ld hl, Channel1DutyCycle - Channel1
+ ld hl, wChannel1DutyCycle - wChannel1
add hl, bc
ld a, [hli]
ld [wCurTrackDuty], a
@@ -146,62 +146,62 @@
call HandleTrackVibrato ; handle vibrato and other things
call HandleNoise
; turn off music when playing sfx?
- ld a, [SFXPriority]
+ ld a, [wSFXPriority]
and a
jr z, .next
; are we in a sfx channel right now?
- ld a, [CurChannel]
+ ld a, [wCurChannel]
cp CHAN5
jr nc, .next
; are any sfx channels active?
; if so, mute
- ld hl, Channel5Flags
+ ld hl, wChannel5Flags
bit SOUND_CHANNEL_ON, [hl]
jr nz, .restnote
- ld hl, Channel6Flags
+ ld hl, wChannel6Flags
bit SOUND_CHANNEL_ON, [hl]
jr nz, .restnote
- ld hl, Channel7Flags
+ ld hl, wChannel7Flags
bit SOUND_CHANNEL_ON, [hl]
jr nz, .restnote
- ld hl, Channel8Flags
+ ld hl, wChannel8Flags
bit SOUND_CHANNEL_ON, [hl]
jr z, .next
.restnote
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
set NOTE_REST, [hl] ; Rest
.next
; are we in a sfx channel right now?
- ld a, [CurChannel]
+ ld a, [wCurChannel]
cp CHAN5
jr nc, .sfx_channel
- ld hl, Channel5Flags - Channel1
+ ld hl, wChannel5Flags - wChannel1
add hl, bc
bit SOUND_CHANNEL_ON, [hl]
jr nz, .sound_channel_on
.sfx_channel
call UpdateChannels
- ld hl, Channel1Tracks - Channel1
+ ld hl, wChannel1Tracks - wChannel1
add hl, bc
- ld a, [SoundOutput]
+ ld a, [wSoundOutput]
or [hl]
- ld [SoundOutput], a
+ ld [wSoundOutput], a
.sound_channel_on
; clear note flags
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
xor a
ld [hl], a
.nextchannel
; next channel
- ld hl, Channel2 - Channel1
+ ld hl, wChannel2 - wChannel1
add hl, bc
ld c, l
ld b, h
- ld a, [CurChannel]
+ ld a, [wCurChannel]
inc a
- ld [CurChannel], a
+ ld [wCurChannel], a
cp $8 ; are we done?
jp nz, .loop ; do it all again
@@ -209,10 +209,10 @@
; fade music in/out
call FadeMusic
; write volume to hardware register
- ld a, [Volume]
+ ld a, [wVolume]
ld [rNR50], a
; write SO on/off to hardware register
- ld a, [SoundOutput]
+ ld a, [wSoundOutput]
ld [rNR51], a
ret
@@ -220,7 +220,7 @@
UpdateChannels: ; e8125
ld hl, .ChannelFnPtrs
- ld a, [CurChannel]
+ ld a, [wCurChannel]
and $7
add a
ld e, a
@@ -244,16 +244,16 @@
dw .Channel8
.Channel1:
- ld a, [Danger]
+ ld a, [wLowHealthAlarm]
bit DANGER_ON_F, a
ret nz
.Channel5:
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
bit NOTE_UNKN_3, [hl]
jr z, .asm_e8159
;
- ld a, [SoundInput]
+ ld a, [wSoundInput]
ld [rNR10], a
.asm_e8159
bit NOTE_REST, [hl] ; rest
@@ -317,7 +317,7 @@
.Channel2:
.Channel6:
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
bit NOTE_REST, [hl] ; rest
jr nz, .ch2rest
@@ -377,7 +377,7 @@
.Channel3:
.Channel7:
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
bit NOTE_REST, [hl] ; rest
jr nz, .ch3rest
@@ -478,7 +478,7 @@
.Channel4:
.Channel8:
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
bit NOTE_REST, [hl] ; rest
jr nz, .ch4rest
@@ -514,16 +514,16 @@
_CheckSFX: ; e82e7
; return carry if any sfx channels are active
- ld hl, Channel5Flags
+ ld hl, wChannel5Flags
bit SOUND_CHANNEL_ON, [hl]
jr nz, .sfxon
- ld hl, Channel6Flags
+ ld hl, wChannel6Flags
bit SOUND_CHANNEL_ON, [hl]
jr nz, .sfxon
- ld hl, Channel7Flags
+ ld hl, wChannel7Flags
bit SOUND_CHANNEL_ON, [hl]
jr nz, .sfxon
- ld hl, Channel8Flags
+ ld hl, wChannel8Flags
bit SOUND_CHANNEL_ON, [hl]
jr nz, .sfxon
and a
@@ -536,7 +536,7 @@
; e8307
PlayDanger: ; e8307
- ld a, [Danger]
+ ld a, [wLowHealthAlarm]
bit DANGER_ON_F, a
ret z
and $ff ^ (1 << DANGER_ON_F)
@@ -574,15 +574,15 @@
xor a
.asm_e833c
or 1 << DANGER_ON_F
- ld [Danger], a
+ ld [wLowHealthAlarm], a
; is hw ch1 on?
- ld a, [SoundOutput]
+ ld a, [wSoundOutput]
and $11
ret nz
; if not, turn it on
- ld a, [SoundOutput]
+ ld a, [wSoundOutput]
or $11
- ld [SoundOutput], a
+ ld [wSoundOutput], a
ret
; e8350
@@ -604,34 +604,34 @@
FadeMusic: ; e8358
; fade music if applicable
; usage:
-; write to MusicFade
+; write to wMusicFade
; song fades out at the given rate
-; load song id in MusicFadeID
+; load song id in wMusicFadeID
; fade new song in
; notes:
; max # frames per volume level is $3f
; fading?
- ld a, [MusicFade]
+ ld a, [wMusicFade]
and a
ret z
; has the count ended?
- ld a, [MusicFadeCount]
+ ld a, [wMusicFadeCount]
and a
jr z, .update
; count down
dec a
- ld [MusicFadeCount], a
+ ld [wMusicFadeCount], a
ret
.update
- ld a, [MusicFade]
+ ld a, [wMusicFade]
ld d, a
; get new count
and $3f
- ld [MusicFadeCount], a
+ ld [wMusicFadeCount], a
; get SO1 volume
- ld a, [Volume]
+ ld a, [wVolume]
and VOLUME_SO1_LEVEL
; which way are we fading?
bit MUSIC_FADE_IN_F, d
@@ -645,9 +645,9 @@
.novolume
; make sure volume is off
xor a
- ld [Volume], a
+ ld [wVolume], a
; did we just get on a bike?
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_BIKE
jr z, .bicycle
push bc
@@ -654,11 +654,11 @@
; restart sound
call MusicFadeRestart
; get new song id
- ld a, [MusicFadeID]
+ ld a, [wMusicFadeID]
and a
jr z, .quit ; this assumes there are fewer than 256 songs!
ld e, a
- ld a, [MusicFadeID + 1]
+ ld a, [wMusicFadeID + 1]
ld d, a
; load new song
call _PlayMusic
@@ -667,7 +667,7 @@
pop bc
; stop fading
xor a
- ld [MusicFade], a
+ ld [wMusicFade], a
ret
.bicycle
@@ -677,17 +677,17 @@
; this turns the volume up
; turn it back down
xor a
- ld [Volume], a
+ ld [wVolume], a
; get new song id
- ld a, [MusicFadeID]
+ ld a, [wMusicFadeID]
ld e, a
- ld a, [MusicFadeID + 1]
+ ld a, [wMusicFadeID + 1]
ld d, a
; load new song
call _PlayMusic
pop bc
; fade in
- ld hl, MusicFade
+ ld hl, wMusicFade
set MUSIC_FADE_IN_F, [hl]
ret
@@ -702,7 +702,7 @@
.maxvolume
; we're done
xor a
- ld [MusicFade], a
+ ld [wMusicFade], a
ret
.updatevolume
@@ -710,7 +710,7 @@
ld d, a
swap a
or d
- ld [Volume], a
+ ld [wVolume], a
ret
; e83d1
@@ -717,12 +717,12 @@
LoadNote: ; e83d1
; wait for pitch wheel to finish
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
bit SOUND_PITCH_WHEEL, [hl]
ret z
; get note duration
- ld hl, Channel1NoteDuration - Channel1
+ ld hl, wChannel1NoteDuration - wChannel1
add hl, bc
ld a, [hl]
ld hl, wCurNoteDuration
@@ -732,13 +732,13 @@
.ok
ld [hl], a
; get frequency
- ld hl, Channel1Frequency - Channel1
+ ld hl, wChannel1Frequency - wChannel1
add hl, bc
ld e, [hl]
inc hl
ld d, [hl]
; get direction of pitch wheel
- ld hl, Channel1PitchWheelTarget - Channel1
+ ld hl, wChannel1PitchWheelTarget - wChannel1
add hl, bc
ld a, e
sub [hl]
@@ -746,21 +746,21 @@
ld a, d
sbc 0
ld d, a
- ld hl, Channel1PitchWheelTarget + 1 - Channel1
+ ld hl, wChannel1PitchWheelTarget + 1 - wChannel1
add hl, bc
sub [hl]
jr nc, .greater_than
- ld hl, Channel1Flags3 - Channel1
+ ld hl, wChannel1Flags3 - wChannel1
add hl, bc
set SOUND_PITCH_WHEEL_DIR, [hl]
; get frequency
- ld hl, Channel1Frequency - Channel1
+ ld hl, wChannel1Frequency - wChannel1
add hl, bc
ld e, [hl]
inc hl
ld d, [hl]
; ????
- ld hl, Channel1PitchWheelTarget - Channel1
+ ld hl, wChannel1PitchWheelTarget - wChannel1
add hl, bc
ld a, [hl]
sub e
@@ -769,7 +769,7 @@
sbc 0
ld d, a
; ????
- ld hl, Channel1PitchWheelTarget + 1 - Channel1
+ ld hl, wChannel1PitchWheelTarget + 1 - wChannel1
add hl, bc
ld a, [hl]
sub d
@@ -777,17 +777,17 @@
jr .resume
.greater_than
- ld hl, Channel1Flags3 - Channel1
+ ld hl, wChannel1Flags3 - wChannel1
add hl, bc
res SOUND_PITCH_WHEEL_DIR, [hl]
; get frequency
- ld hl, Channel1Frequency - Channel1
+ ld hl, wChannel1Frequency - wChannel1
add hl, bc
ld e, [hl]
inc hl
ld d, [hl]
; get distance from pitch wheel target
- ld hl, Channel1PitchWheelTarget - Channel1
+ ld hl, wChannel1PitchWheelTarget - wChannel1
add hl, bc
ld a, e
sub [hl]
@@ -795,7 +795,7 @@
ld a, d
sbc 0
ld d, a
- ld hl, Channel1PitchWheelTarget + 1 - Channel1
+ ld hl, wChannel1PitchWheelTarget + 1 - wChannel1
add hl, bc
sub [hl]
ld d, a
@@ -823,13 +823,13 @@
add [hl]
ld d, b ; quotient
pop bc
- ld hl, Channel1PitchWheelAmount - Channel1
+ ld hl, wChannel1PitchWheelAmount - wChannel1
add hl, bc
ld [hl], d ; quotient
- ld hl, Channel1PitchWheelAmountFraction - Channel1
+ ld hl, wChannel1PitchWheelAmountFraction - wChannel1
add hl, bc
ld [hl], a ; remainder
- ld hl, Channel1Field25 - Channel1
+ ld hl, wChannel1Field25 - wChannel1
add hl, bc
xor a
ld [hl], a
@@ -839,11 +839,11 @@
HandleTrackVibrato: ; e8466
; handle duty, cry pitch, and vibrato
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
bit SOUND_DUTY, [hl] ; duty
jr z, .next
- ld hl, Channel1SFXDutyLoop - Channel1
+ ld hl, wChannel1SFXDutyLoop - wChannel1
add hl, bc
ld a, [hl]
rlca
@@ -851,15 +851,15 @@
ld [hl], a
and $c0
ld [wCurTrackDuty], a
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
set NOTE_DUTY_OVERRIDE, [hl]
.next
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
bit SOUND_CRY_PITCH, [hl]
jr z, .vibrato
- ld hl, Channel1CryPitch - Channel1
+ ld hl, wChannel1CryPitch - wChannel1
add hl, bc
ld e, [hl]
inc hl
@@ -877,19 +877,19 @@
ld [hl], d
.vibrato
; is vibrato on?
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
bit SOUND_VIBRATO, [hl] ; vibrato
jr z, .quit
; is vibrato active for this note yet?
; is the delay over?
- ld hl, Channel1VibratoDelayCount - Channel1
+ ld hl, wChannel1VibratoDelayCount - wChannel1
add hl, bc
ld a, [hl]
and a
jr nz, .subexit
; is the extent nonzero?
- ld hl, Channel1VibratoExtent - Channel1
+ ld hl, wChannel1VibratoExtent - wChannel1
add hl, bc
ld a, [hl]
and a
@@ -897,7 +897,7 @@
; save it for later
ld d, a
; is it time to toggle vibrato up/down?
- ld hl, Channel1VibratoRate - Channel1
+ ld hl, wChannel1VibratoRate - wChannel1
add hl, bc
ld a, [hl]
and $f ; count
@@ -916,7 +916,7 @@
ld a, [wCurTrackFrequency]
ld e, a
; toggle vibrato up/down
- ld hl, Channel1Flags3 - Channel1
+ ld hl, wChannel1Flags3 - wChannel1
add hl, bc
bit SOUND_VIBRATO_DIR, [hl] ; vibrato up/down
jr z, .down
@@ -948,7 +948,7 @@
.no_carry
ld [wCurTrackFrequency], a
;
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
set NOTE_VIBRATO_OVERRIDE, [hl]
.quit
@@ -958,23 +958,23 @@
ApplyPitchWheel: ; e84f9
; quit if pitch wheel inactive
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
bit SOUND_PITCH_WHEEL, [hl]
ret z
; de = Frequency
- ld hl, Channel1Frequency - Channel1
+ ld hl, wChannel1Frequency - wChannel1
add hl, bc
ld e, [hl]
inc hl
ld d, [hl]
; check whether pitch wheel is going up or down
- ld hl, Channel1Flags3 - Channel1
+ ld hl, wChannel1Flags3 - wChannel1
add hl, bc
bit SOUND_PITCH_WHEEL_DIR, [hl]
jr z, .decreasing
; frequency += [Channel*PitchWheelAmount]
- ld hl, Channel1PitchWheelAmount - Channel1
+ ld hl, wChannel1PitchWheelAmount - wChannel1
add hl, bc
ld l, [hl]
ld h, 0
@@ -983,10 +983,10 @@
ld e, l
; [Channel*Field25] += [Channel*PitchWheelAmountFraction]
; if rollover: Frequency += 1
- ld hl, Channel1PitchWheelAmountFraction - Channel1
+ ld hl, wChannel1PitchWheelAmountFraction - wChannel1
add hl, bc
ld a, [hl]
- ld hl, Channel1Field25 - Channel1
+ ld hl, wChannel1Field25 - wChannel1
add hl, bc
add [hl]
ld [hl], a
@@ -999,13 +999,13 @@
; Compare the dw at [Channel*PitchWheelTarget] to de.
; If frequency is greater, we're finished.
; Otherwise, load the frequency and set two flags.
- ld hl, Channel1PitchWheelTarget + 1 - Channel1
+ ld hl, wChannel1PitchWheelTarget + 1 - wChannel1
add hl, bc
ld a, [hl]
cp d
jp c, .finished_pitch_wheel
jr nz, .continue_pitch_wheel
- ld hl, Channel1PitchWheelTarget - Channel1
+ ld hl, wChannel1PitchWheelTarget - wChannel1
add hl, bc
ld a, [hl]
cp e
@@ -1015,7 +1015,7 @@
.decreasing
; frequency -= [Channel*PitchWheelAmount]
ld a, e
- ld hl, Channel1PitchWheelAmount - Channel1
+ ld hl, wChannel1PitchWheelAmount - wChannel1
add hl, bc
ld e, [hl]
sub e
@@ -1025,7 +1025,7 @@
ld d, a
; [Channel*Field25] *= 2
; if rollover: Frequency -= 1
- ld hl, Channel1PitchWheelAmountFraction - Channel1
+ ld hl, wChannel1PitchWheelAmountFraction - wChannel1
add hl, bc
ld a, [hl]
add a
@@ -1039,33 +1039,33 @@
; Compare the dw at [Channel*PitchWheelTarget] to de.
; If frequency is lower, we're finished.
; Otherwise, load the frequency and set two flags.
- ld hl, Channel1PitchWheelTarget + 1 - Channel1
+ ld hl, wChannel1PitchWheelTarget + 1 - wChannel1
add hl, bc
ld a, d
cp [hl]
jr c, .finished_pitch_wheel
jr nz, .continue_pitch_wheel
- ld hl, Channel1PitchWheelTarget - Channel1
+ ld hl, wChannel1PitchWheelTarget - wChannel1
add hl, bc
ld a, e
cp [hl]
jr nc, .continue_pitch_wheel
.finished_pitch_wheel
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
res SOUND_PITCH_WHEEL, [hl]
- ld hl, Channel1Flags3 - Channel1
+ ld hl, wChannel1Flags3 - wChannel1
add hl, bc
res SOUND_PITCH_WHEEL_DIR, [hl]
ret
.continue_pitch_wheel
- ld hl, Channel1Frequency - Channel1
+ ld hl, wChannel1Frequency - wChannel1
add hl, bc
ld [hl], e
inc hl
ld [hl], d
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
set NOTE_FREQ_OVERRIDE, [hl]
set NOTE_DUTY_OVERRIDE, [hl]
@@ -1075,16 +1075,16 @@
HandleNoise: ; e858c
; is noise sampling on?
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
bit SOUND_NOISE, [hl] ; noise sampling
ret z
; are we in a sfx channel?
- ld a, [CurChannel]
+ ld a, [wCurChannel]
bit 2, a ; sfx
jr nz, .next
; is ch8 on? (noise)
- ld hl, Channel8Flags
+ ld hl, wChannel8Flags
bit SOUND_CHANNEL_ON, [hl] ; on?
jr z, .next
; is ch8 playing noise?
@@ -1109,8 +1109,8 @@
; zz: intensity
; yy: frequency
- ; de = [NoiseSampleAddress]
- ld hl, NoiseSampleAddress
+ ; de = [wNoiseSampleAddress]
+ ld hl, wNoiseSampleAddress
ld e, [hl]
inc hl
ld d, [hl]
@@ -1138,12 +1138,12 @@
xor a
ld [wCurTrackFrequency + 1], a
- ld hl, NoiseSampleAddress
+ ld hl, wNoiseSampleAddress
ld [hl], e
inc hl
ld [hl], d
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
set NOTE_NOISE_SAMPLING, [hl]
ret
@@ -1166,9 +1166,9 @@
jr ParseMusic ; start over
.readnote
-; CurMusicByte contains current note
+; wCurMusicByte contains current note
; special notes
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
bit SOUND_SFX, [hl]
jp nz, ParseSFXOrRest
@@ -1178,33 +1178,33 @@
jp nz, GetNoiseSample
; normal note
; set note duration (bottom nybble)
- ld a, [CurMusicByte]
+ ld a, [wCurMusicByte]
and $f
call SetNoteDuration
; get note pitch (top nybble)
- ld a, [CurMusicByte]
+ ld a, [wCurMusicByte]
swap a
and $f
jr z, .rest ; pitch 0-> rest
; update pitch
- ld hl, Channel1Pitch - Channel1
+ ld hl, wChannel1Pitch - wChannel1
add hl, bc
ld [hl], a
; store pitch in e
ld e, a
; store octave in d
- ld hl, Channel1Octave - Channel1
+ ld hl, wChannel1Octave - wChannel1
add hl, bc
ld d, [hl]
; update frequency
call GetFrequency
- ld hl, Channel1Frequency - Channel1
+ ld hl, wChannel1Frequency - wChannel1
add hl, bc
ld [hl], e
inc hl
ld [hl], d
; ????
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
set NOTE_NOISE_SAMPLING, [hl]
jp LoadNote
@@ -1211,7 +1211,7 @@
.rest
; note = rest
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
set NOTE_REST, [hl] ; Rest
ret
@@ -1218,25 +1218,25 @@
.endchannel
; $ff is reached in music data
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
bit SOUND_SUBROUTINE, [hl] ; in a subroutine?
jr nz, .readcommand ; execute
- ld a, [CurChannel]
+ ld a, [wCurChannel]
cp CHAN5
jr nc, .chan_5to8
; ????
- ld hl, Channel5Flags - Channel1
+ ld hl, wChannel5Flags - wChannel1
add hl, bc
bit SOUND_CHANNEL_ON, [hl]
jr nz, .ok
.chan_5to8
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
bit SOUND_REST, [hl]
call nz, RestoreVolume
; end music
- ld a, [CurChannel]
+ ld a, [wCurChannel]
cp CHAN5
jr nz, .ok
; ????
@@ -1245,15 +1245,15 @@
.ok
; stop playing
; turn channel off
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
res SOUND_CHANNEL_ON, [hl]
; note = rest
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
set NOTE_REST, [hl]
; clear music id & bank
- ld hl, Channel1MusicID - Channel1
+ ld hl, wChannel1MusicID - wChannel1
add hl, bc
xor a
ld [hli], a ; id hi
@@ -1265,21 +1265,21 @@
RestoreVolume: ; e8679
; ch5 only
- ld a, [CurChannel]
+ ld a, [wCurChannel]
cp CHAN5
ret nz
xor a
- ld hl, Channel6CryPitch
+ ld hl, wChannel6CryPitch
ld [hli], a
ld [hl], a
- ld hl, Channel8CryPitch
+ ld hl, wChannel8CryPitch
ld [hli], a
ld [hl], a
- ld a, [LastVolume]
- ld [Volume], a
+ ld a, [wLastVolume]
+ ld [wVolume], a
xor a
- ld [LastVolume], a
- ld [SFXPriority], a
+ ld [wLastVolume], a
+ ld [wSFXPriority], a
ret
; e8698
@@ -1286,30 +1286,30 @@
ParseSFXOrRest: ; e8698
; turn noise sampling on
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
set NOTE_NOISE_SAMPLING, [hl] ; noise sample
; update note duration
- ld a, [CurMusicByte]
+ ld a, [wCurMusicByte]
call SetNoteDuration ; top nybble doesnt matter?
; update intensity from next param
call GetMusicByte
- ld hl, Channel1Intensity - Channel1
+ ld hl, wChannel1Intensity - wChannel1
add hl, bc
ld [hl], a
; update lo frequency from next param
call GetMusicByte
- ld hl, Channel1FrequencyLo - Channel1
+ ld hl, wChannel1FrequencyLo - wChannel1
add hl, bc
ld [hl], a
; are we on the last channel? (noise sampling)
- ld a, [CurChannel]
+ ld a, [wCurChannel]
maskbits NUM_MUSIC_CHANS
cp CHAN4
ret z
; update hi frequency from next param
call GetMusicByte
- ld hl, Channel1FrequencyHi - Channel1
+ ld hl, wChannel1FrequencyHi - wChannel1
add hl, bc
ld [hl], a
ret
@@ -1317,29 +1317,29 @@
; e86c5
GetNoiseSample: ; e86c5
-; load ptr to sample header in NoiseSampleAddress
+; load ptr to sample header in wNoiseSampleAddress
; are we on the last channel?
- ld a, [CurChannel]
+ ld a, [wCurChannel]
and NUM_MUSIC_CHANS +- 1
cp CHAN4
; ret if not
ret nz
; update note duration
- ld a, [CurMusicByte]
+ ld a, [wCurMusicByte]
and $f
call SetNoteDuration
; check current channel
- ld a, [CurChannel]
+ ld a, [wCurChannel]
bit 2, a ; are we in a sfx channel?
jr nz, .sfx
- ld hl, Channel8Flags
+ ld hl, wChannel8Flags
bit SOUND_CHANNEL_ON, [hl] ; is ch8 on? (noise)
ret nz
- ld a, [MusicNoiseSampleSet]
+ ld a, [wMusicNoiseSampleSet]
jr .next
.sfx
- ld a, [SFXNoiseSampleSet]
+ ld a, [wSFXNoiseSampleSet]
.next
; load noise sample set id into de
ld e, a
@@ -1352,7 +1352,7 @@
ld h, [hl]
ld l, a
; get pitch
- ld a, [CurMusicByte]
+ ld a, [wCurMusicByte]
swap a
; non-rest note?
and $f
@@ -1362,11 +1362,11 @@
ld d, 0
add hl, de
add hl, de
- ; load sample pointer into NoiseSampleAddress
+ ; load sample pointer into wNoiseSampleAddress
ld a, [hli]
- ld [NoiseSampleAddress], a
+ ld [wNoiseSampleAddress], a
ld a, [hl]
- ld [NoiseSampleAddress + 1], a
+ ld [wNoiseSampleAddress + 1], a
; clear ????
xor a
ld [wNoiseSampleDelay], a
@@ -1376,7 +1376,7 @@
ParseMusicCommand: ; e870f
; reload command
- ld a, [CurMusicByte]
+ ld a, [wCurMusicByte]
; get command #
sub $d0 ; first command
ld e, a
@@ -1462,16 +1462,16 @@
; end music stream
; return to caller of the subroutine
; reset subroutine flag
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
res SOUND_SUBROUTINE, [hl]
; copy LastMusicAddress to MusicAddress
- ld hl, Channel1LastMusicAddress - Channel1
+ ld hl, wChannel1LastMusicAddress - wChannel1
add hl, bc
ld e, [hl]
inc hl
ld d, [hl]
- ld hl, Channel1MusicAddress - Channel1
+ ld hl, wChannel1MusicAddress - wChannel1
add hl, bc
ld [hl], e
inc hl
@@ -1490,12 +1490,12 @@
ld d, a
push de
; copy MusicAddress to LastMusicAddress
- ld hl, Channel1MusicAddress - Channel1
+ ld hl, wChannel1MusicAddress - wChannel1
add hl, bc
ld e, [hl]
inc hl
ld d, [hl]
- ld hl, Channel1LastMusicAddress - Channel1
+ ld hl, wChannel1LastMusicAddress - wChannel1
add hl, bc
ld [hl], e
inc hl
@@ -1502,13 +1502,13 @@
ld [hl], d
; load pointer into MusicAddress
pop de
- ld hl, Channel1MusicAddress - Channel1
+ ld hl, wChannel1MusicAddress - wChannel1
add hl, bc
ld [hl], e
inc hl
ld [hl], d
; set subroutine flag
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
set SOUND_SUBROUTINE, [hl]
ret
@@ -1523,7 +1523,7 @@
ld e, a
call GetMusicByte
ld d, a
- ld hl, Channel1MusicAddress - Channel1
+ ld hl, wChannel1MusicAddress - wChannel1
add hl, bc
ld [hl], e
inc hl
@@ -1542,7 +1542,7 @@
; get loop count
call GetMusicByte
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
bit SOUND_LOOPING, [hl] ; has the loop been initiated?
jr nz, .checkloop
@@ -1551,11 +1551,11 @@
; initiate loop
dec a
set SOUND_LOOPING, [hl] ; set loop flag
- ld hl, Channel1LoopCount - Channel1
+ ld hl, wChannel1LoopCount - wChannel1
add hl, bc
ld [hl], a ; store loop counter
.checkloop
- ld hl, Channel1LoopCount - Channel1
+ ld hl, wChannel1LoopCount - wChannel1
add hl, bc
ld a, [hl]
and a ; are we done?
@@ -1568,7 +1568,7 @@
call GetMusicByte
ld d, a
; load new pointer into MusicAddress
- ld hl, Channel1MusicAddress - Channel1
+ ld hl, wChannel1MusicAddress - wChannel1
add hl, bc
ld [hl], e
inc hl
@@ -1577,11 +1577,11 @@
.endloop
; reset loop flag
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
res SOUND_LOOPING, [hl]
; skip to next command
- ld hl, Channel1MusicAddress - Channel1
+ ld hl, wChannel1MusicAddress - wChannel1
add hl, bc
ld e, [hl]
inc hl
@@ -1603,7 +1603,7 @@
; set condition
call GetMusicByte
- ld hl, Channel1Condition - Channel1
+ ld hl, wChannel1Condition - wChannel1
add hl, bc
ld [hl], a
ret
@@ -1621,13 +1621,13 @@
; a = condition
call GetMusicByte
; if existing condition matches, jump to new address
- ld hl, Channel1Condition - Channel1
+ ld hl, wChannel1Condition - wChannel1
add hl, bc
cp [hl]
jr z, .jump
; skip to next command
; get address
- ld hl, Channel1MusicAddress - Channel1
+ ld hl, wChannel1MusicAddress - wChannel1
add hl, bc
ld e, [hl]
inc hl
@@ -1649,7 +1649,7 @@
call GetMusicByte
ld d, a
; update pointer in MusicAddress
- ld hl, Channel1MusicAddress - Channel1
+ ld hl, wChannel1MusicAddress - wChannel1
add hl, bc
ld [hl], e
inc hl
@@ -1667,12 +1667,12 @@
; if ????, jump
; get channel
- ld a, [CurChannel]
+ ld a, [wCurChannel]
maskbits NUM_MUSIC_CHANS
ld e, a
ld d, 0
- ; hl = Channel1JumpCondition + channel id
- ld hl, Channel1JumpCondition
+ ; hl = wChannel1JumpCondition + channel id
+ ld hl, wChannel1JumpCondition
add hl, de
; if set, jump
ld a, [hl]
@@ -1680,7 +1680,7 @@
jr nz, .jump
; skip to next command
; get address
- ld hl, Channel1MusicAddress - Channel1
+ ld hl, wChannel1MusicAddress - wChannel1
add hl, bc
ld e, [hl]
inc hl
@@ -1703,7 +1703,7 @@
call GetMusicByte
ld d, a
; update address
- ld hl, Channel1MusicAddress - Channel1
+ ld hl, wChannel1MusicAddress - wChannel1
add hl, bc
ld [hl], e
inc hl
@@ -1726,10 +1726,10 @@
; seems to have been dummied out
; params: 1
call GetMusicByte
- ld hl, Channel1Field2c - Channel1
+ ld hl, wChannel1Field2c - wChannel1
add hl, bc
ld [hl], a
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
set SOUND_UNKN_0B, [hl]
ret
@@ -1746,21 +1746,21 @@
; z: rate (# frames per cycle)
; set vibrato flag?
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
set SOUND_VIBRATO, [hl]
; start at lower frequency (extent is positive)
- ld hl, Channel1Flags3 - Channel1
+ ld hl, wChannel1Flags3 - wChannel1
add hl, bc
res SOUND_VIBRATO_DIR, [hl]
; get delay
call GetMusicByte
; update delay
- ld hl, Channel1VibratoDelay - Channel1
+ ld hl, wChannel1VibratoDelay - wChannel1
add hl, bc
ld [hl], a
; update delay count
- ld hl, Channel1VibratoDelayCount - Channel1
+ ld hl, wChannel1VibratoDelayCount - wChannel1
add hl, bc
ld [hl], a
; update extent
@@ -1767,7 +1767,7 @@
; this is split into halves only to get added back together at the last second
; get extent/rate
call GetMusicByte
- ld hl, Channel1VibratoExtent - Channel1
+ ld hl, wChannel1VibratoExtent - wChannel1
add hl, bc
ld d, a
; get top nybble
@@ -1780,7 +1780,7 @@
or e
ld [hl], a
; update rate
- ld hl, Channel1VibratoRate - Channel1
+ ld hl, wChannel1VibratoRate - wChannel1
add hl, bc
; get bottom nybble
ld a, d
@@ -1813,13 +1813,13 @@
and $f
ld d, a
call GetFrequency
- ld hl, Channel1PitchWheelTarget - Channel1
+ ld hl, wChannel1PitchWheelTarget - wChannel1
add hl, bc
ld [hl], e
- ld hl, Channel1PitchWheelTarget + 1 - Channel1
+ ld hl, wChannel1PitchWheelTarget + 1 - wChannel1
add hl, bc
ld [hl], d
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
set SOUND_PITCH_WHEEL, [hl]
ret
@@ -1829,10 +1829,10 @@
Music_Tone: ; e88e4
; tone
; params: 1 (dw)
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
set SOUND_CRY_PITCH, [hl]
- ld hl, Channel1CryPitch + 1 - Channel1
+ ld hl, wChannel1CryPitch + 1 - wChannel1
add hl, bc
call GetMusicByte
ld [hld], a
@@ -1845,11 +1845,11 @@
MusicE7: ; e88f7
; unused
; params: 1
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
set SOUND_UNKN_0E, [hl]
call GetMusicByte
- ld hl, Channel1Field29 - Channel1
+ ld hl, wChannel1Field29 - wChannel1
add hl, bc
ld [hl], a
ret
@@ -1859,7 +1859,7 @@
Music_SoundDuty: ; e8906
; sequence of 4 duty cycles to be looped
; params: 1 (4 2-bit duty cycle arguments)
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
set SOUND_DUTY, [hl] ; duty cycle
; sound duty sequence
@@ -1866,12 +1866,12 @@
call GetMusicByte
rrca
rrca
- ld hl, Channel1SFXDutyLoop - Channel1
+ ld hl, wChannel1SFXDutyLoop - wChannel1
add hl, bc
ld [hl], a
; update duty cycle
and $c0 ; only uses top 2 bits
- ld hl, Channel1DutyCycle - Channel1
+ ld hl, wChannel1DutyCycle - wChannel1
add hl, bc
ld [hl], a
ret
@@ -1881,11 +1881,11 @@
MusicE8: ; e891e
; unused
; params: 1
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
set SOUND_UNKN_0D, [hl]
call GetMusicByte
- ld hl, Channel1Field2a - Channel1
+ ld hl, wChannel1Field2a - wChannel1
add hl, bc
ld [hl], a
ret
@@ -1895,7 +1895,7 @@
Music_ToggleSFX: ; e892d
; toggle something
; params: none
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
bit SOUND_SFX, [hl]
jr z, .on
@@ -1915,7 +1915,7 @@
; noise on: 1
; noise off: 0
; check if noise sampling is on
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
bit SOUND_NOISE, [hl]
jr z, .on
@@ -1927,7 +1927,7 @@
; turn noise sampling on
set SOUND_NOISE, [hl]
call GetMusicByte
- ld [MusicNoiseSampleSet], a
+ ld [wMusicNoiseSampleSet], a
ret
; e894f
@@ -1938,7 +1938,7 @@
; on: 1
; off: 0
; check if noise sampling is on
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
bit SOUND_NOISE, [hl]
jr z, .on
@@ -1950,7 +1950,7 @@
; turn noise sampling on
set SOUND_NOISE, [hl]
call GetMusicByte
- ld [SFXNoiseSampleSet], a
+ ld [wSFXNoiseSampleSet], a
ret
; e8963
@@ -1962,10 +1962,10 @@
; params: 2
; note length
call GetMusicByte
- ld hl, Channel1NoteLength - Channel1
+ ld hl, wChannel1NoteLength - wChannel1
add hl, bc
ld [hl], a
- ld a, [CurChannel]
+ ld a, [wCurChannel]
maskbits NUM_MUSIC_CHANS
cp CHAN4
ret z
@@ -1979,8 +1979,8 @@
; update sound status
; params: 1
call GetMusicByte
- ld [SoundInput], a
- ld hl, Channel1NoteFlags - Channel1
+ ld [wSoundInput], a
+ ld hl, wChannel1NoteFlags - wChannel1
add hl, bc
set NOTE_UNKN_3, [hl]
ret
@@ -1994,7 +1994,7 @@
rrca
rrca
and $c0
- ld hl, Channel1DutyCycle - Channel1
+ ld hl, wChannel1DutyCycle - wChannel1
add hl, bc
ld [hl], a
ret
@@ -2007,7 +2007,7 @@
; hi: pressure
; lo: velocity
call GetMusicByte
- ld hl, Channel1Intensity - Channel1
+ ld hl, wChannel1Intensity - wChannel1
add hl, bc
ld [hl], a
ret
@@ -2036,9 +2036,9 @@
Music_Octave2: ; e89a6
Music_Octave1: ; e89a6
; set octave based on lo nybble of the command
- ld hl, Channel1Octave - Channel1
+ ld hl, wChannel1Octave - wChannel1
add hl, bc
- ld a, [CurMusicByte]
+ ld a, [wCurMusicByte]
and 7
ld [hl], a
ret
@@ -2050,7 +2050,7 @@
; this forces all notes up by the starting octave
; params: 1
call GetMusicByte
- ld hl, Channel1PitchOffset - Channel1
+ ld hl, wChannel1PitchOffset - wChannel1
add hl, bc
ld [hl], a
ret
@@ -2061,7 +2061,7 @@
; stereo panning
; params: 1
; stereo on?
- ld a, [Options]
+ ld a, [wOptions]
bit STEREO, a
jr nz, Music_Panning
; skip param
@@ -2075,7 +2075,7 @@
; params: 1
call SetLRTracks
call GetMusicByte
- ld hl, Channel1Tracks - Channel1
+ ld hl, wChannel1Tracks - wChannel1
add hl, bc
and [hl]
ld [hl], a
@@ -2090,13 +2090,13 @@
; read param even if it's not used
call GetMusicByte
; is the song fading?
- ld a, [MusicFade]
+ ld a, [wMusicFade]
and a
ret nz
; reload param
- ld a, [CurMusicByte]
+ ld a, [wCurMusicByte]
; set volume
- ld [Volume], a
+ ld [wVolume], a
ret
; e89e1
@@ -2116,7 +2116,7 @@
.negative
ld d, -1
.ok
- ld hl, Channel1Tempo - Channel1
+ ld hl, wChannel1Tempo - wChannel1
add hl, bc
ld a, [hli]
ld h, [hl]
@@ -2133,7 +2133,7 @@
; turn sfx priority on
; params: none
ld a, 1
- ld [SFXPriority], a
+ ld [wSFXPriority], a
ret
; e8a03
@@ -2142,7 +2142,7 @@
; turn sfx priority off
; params: none
xor a
- ld [SFXPriority], a
+ ld [wSFXPriority], a
ret
; e8a08
@@ -2156,17 +2156,17 @@
; zzyy: pointer to new music data
; update music id
- ld hl, Channel1MusicID - Channel1
+ ld hl, wChannel1MusicID - wChannel1
add hl, bc
ld a, [hli]
- ld [MusicID], a
+ ld [wMusicID], a
ld a, [hl]
- ld [MusicID + 1], a
+ ld [wMusicID + 1], a
; update music bank
- ld hl, Channel1MusicBank - Channel1
+ ld hl, wChannel1MusicBank - wChannel1
add hl, bc
ld a, [hl]
- ld [MusicBank], a
+ ld [wMusicBank], a
; get pointer to new channel header
call GetMusicByte
ld l, a
@@ -2205,20 +2205,20 @@
push hl
push de
; load address into de
- ld hl, Channel1MusicAddress - Channel1
+ ld hl, wChannel1MusicAddress - wChannel1
add hl, bc
ld a, [hli]
ld e, a
ld d, [hl]
; load bank into a
- ld hl, Channel1MusicBank - Channel1
+ ld hl, wChannel1MusicBank - wChannel1
add hl, bc
ld a, [hl]
; get byte
- call _LoadMusicByte ; load data into CurMusicByte
+ call _LoadMusicByte ; load data into wCurMusicByte
inc de ; advance to next byte for next time this is called
; update channeldata address
- ld hl, Channel1MusicAddress - Channel1
+ ld hl, wChannel1MusicAddress - wChannel1
add hl, bc
ld a, e
ld [hli], a
@@ -2227,7 +2227,7 @@
pop de
pop hl
; store channeldata in a
- ld a, [CurMusicByte]
+ ld a, [wCurMusicByte]
ret
; e8a5d
@@ -2242,7 +2242,7 @@
; get octave
; get starting octave
- ld hl, Channel1PitchOffset - Channel1
+ ld hl, wChannel1PitchOffset - wChannel1
add hl, bc
ld a, [hl]
swap a ; hi nybble
@@ -2251,7 +2251,7 @@
add d
push af ; we'll use this later
; get starting octave
- ld hl, Channel1PitchOffset - Channel1
+ ld hl, wChannel1PitchOffset - wChannel1
add hl, bc
ld a, [hl]
and $f ; lo nybble
@@ -2293,7 +2293,7 @@
ld e, a
ld d, 0
; store NoteLength in a
- ld hl, Channel1NoteLength - Channel1
+ ld hl, wChannel1NoteLength - wChannel1
add hl, bc
ld a, [hl]
; multiply NoteLength by delay units
@@ -2301,13 +2301,13 @@
call .Multiply
ld a, l ; low
; store Tempo in de
- ld hl, Channel1Tempo - Channel1
+ ld hl, wChannel1Tempo - wChannel1
add hl, bc
ld e, [hl]
inc hl
ld d, [hl]
; add ???? to the next result
- ld hl, Channel1Field16 - Channel1
+ ld hl, wChannel1Field16 - wChannel1
add hl, bc
ld l, [hl]
; multiply Tempo by last result (NoteLength * LOW(delay))
@@ -2316,11 +2316,11 @@
ld e, l
ld d, h
; store result in ????
- ld hl, Channel1Field16 - Channel1
+ ld hl, wChannel1Field16 - wChannel1
add hl, bc
ld [hl], e
; store result in NoteDuration
- ld hl, Channel1NoteDuration - Channel1
+ ld hl, wChannel1NoteDuration - wChannel1
add hl, bc
ld [hl], d
ret
@@ -2353,27 +2353,27 @@
SetGlobalTempo: ; e8ac7
push bc ; save current channel
; are we dealing with music or sfx?
- ld a, [CurChannel]
+ ld a, [wCurChannel]
cp CHAN5
jr nc, .sfxchannels
- ld bc, Channel1
+ ld bc, wChannel1
call Tempo
- ld bc, Channel2
+ ld bc, wChannel2
call Tempo
- ld bc, Channel3
+ ld bc, wChannel3
call Tempo
- ld bc, Channel4
+ ld bc, wChannel4
call Tempo
jr .end
.sfxchannels
- ld bc, Channel5
+ ld bc, wChannel5
call Tempo
- ld bc, Channel6
+ ld bc, wChannel6
call Tempo
- ld bc, Channel7
+ ld bc, wChannel7
call Tempo
- ld bc, Channel8
+ ld bc, wChannel8
call Tempo
.end
pop bc ; restore current channel
@@ -2385,7 +2385,7 @@
; input:
; de: note length
; update Tempo
- ld hl, Channel1Tempo - Channel1
+ ld hl, wChannel1Tempo - wChannel1
add hl, bc
ld [hl], e
inc hl
@@ -2392,7 +2392,7 @@
ld [hl], d
; clear ????
xor a
- ld hl, Channel1Field16 - Channel1
+ ld hl, wChannel1Field16 - wChannel1
add hl, bc
ld [hl], a
ret
@@ -2401,7 +2401,7 @@
StartChannel: ; e8b11
call SetLRTracks
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
set SOUND_CHANNEL_ON, [hl] ; turn channel on
ret
@@ -2413,7 +2413,7 @@
; seems to be redundant since this is overwritten by stereo data later
push de
; store current channel in de
- ld a, [CurChannel]
+ ld a, [wCurChannel]
maskbits NUM_MUSIC_CHANS
ld e, a
ld d, 0
@@ -2422,7 +2422,7 @@
add hl, de ; de = channel 0-3
ld a, [hl]
; load lr tracks into Tracks
- ld hl, Channel1Tracks - Channel1
+ ld hl, wChannel1Tracks - wChannel1
add hl, bc
ld [hl], a
pop de
@@ -2433,7 +2433,7 @@
_PlayMusic:: ; e8b30
; load music
call MusicOff
- ld hl, MusicID
+ ld hl, wMusicID
ld [hl], e ; song number
inc hl
ld [hl], d ; (always 0)
@@ -2442,7 +2442,7 @@
add hl, de ; byte
add hl, de ; pointer
ld a, [hli]
- ld [MusicBank], a
+ ld [wMusicBank], a
ld e, [hl]
inc hl
ld d, [hl] ; music header address
@@ -2461,14 +2461,14 @@
jr nz, .loop
xor a
ld [wc2b5], a
- ld [Channel1JumpCondition], a
- ld [Channel2JumpCondition], a
- ld [Channel3JumpCondition], a
- ld [Channel4JumpCondition], a
- ld [NoiseSampleAddress], a
- ld [NoiseSampleAddress + 1], a
+ ld [wChannel1JumpCondition], a
+ ld [wChannel2JumpCondition], a
+ ld [wChannel3JumpCondition], a
+ ld [wChannel4JumpCondition], a
+ ld [wNoiseSampleAddress], a
+ ld [wNoiseSampleAddress + 1], a
ld [wNoiseSampleDelay], a
- ld [MusicNoiseSampleSet], a
+ ld [wMusicNoiseSampleSet], a
call MusicOn
ret
@@ -2476,13 +2476,13 @@
_PlayCry:: ; e8b79
; Play cry de using parameters:
-; CryPitch
-; CryLength
+; wCryPitch
+; wCryLength
call MusicOff
; Overload the music id with the cry id
- ld hl, MusicID
+ ld hl, wMusicID
ld [hl], e
inc hl
ld [hl], d
@@ -2494,7 +2494,7 @@
add hl, de
ld a, [hli]
- ld [MusicBank], a
+ ld [wMusicBank], a
ld e, [hl]
inc hl
@@ -2513,33 +2513,33 @@
push af
call LoadChannel
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
set SOUND_REST, [hl]
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
set SOUND_CRY_PITCH, [hl]
- ld hl, Channel1CryPitch - Channel1
+ ld hl, wChannel1CryPitch - wChannel1
add hl, bc
- ld a, [CryPitch]
+ ld a, [wCryPitch]
ld [hli], a
- ld a, [CryPitch + 1]
+ ld a, [wCryPitch + 1]
ld [hl], a
; No tempo for channel 4
- ld a, [CurChannel]
+ ld a, [wCurChannel]
maskbits NUM_MUSIC_CHANS
cp CHAN4
jr nc, .start
; Tempo is effectively length
- ld hl, Channel1Tempo - Channel1
+ ld hl, wChannel1Tempo - wChannel1
add hl, bc
- ld a, [CryLength]
+ ld a, [wCryLength]
ld [hli], a
- ld a, [CryLength+1]
+ ld a, [wCryLength+1]
ld [hl], a
.start
call StartChannel
@@ -2550,17 +2550,17 @@
; Stereo only: Play cry from the monster's side.
; This only applies in-battle.
- ld a, [Options]
+ ld a, [wOptions]
bit STEREO, a
jr z, .next
-; [Tracks] &= [CryTracks]
- ld hl, Channel1Tracks - Channel1
+; [Tracks] &= [wCryTracks]
+ ld hl, wChannel1Tracks - wChannel1
add hl, bc
ld a, [hl]
- ld hl, CryTracks
+ ld hl, wCryTracks
and [hl]
- ld hl, Channel1Tracks - Channel1
+ ld hl, wChannel1Tracks - wChannel1
add hl, bc
ld [hl], a
@@ -2570,18 +2570,18 @@
jr nz, .loop
; Cries play at max volume, so we save the current volume for later.
- ld a, [LastVolume]
+ ld a, [wLastVolume]
and a
jr nz, .end
- ld a, [Volume]
- ld [LastVolume], a
+ ld a, [wVolume]
+ ld [wLastVolume], a
ld a, MAX_VOLUME
- ld [Volume], a
+ ld [wVolume], a
.end
ld a, 1 ; stop playing music
- ld [SFXPriority], a
+ ld [wSFXPriority], a
call MusicOn
ret
@@ -2590,7 +2590,7 @@
_PlaySFX:: ; e8c04
; clear channels if they aren't already
call MusicOff
- ld hl, Channel5Flags
+ ld hl, wChannel5Flags
bit SOUND_CHANNEL_ON, [hl] ; ch5 on?
jr z, .ch6
res SOUND_CHANNEL_ON, [hl] ; turn it off
@@ -2603,10 +2603,10 @@
ld a, $80
ld [rNR14], a ; restart sound (freq hi = 0)
xor a
- ld [SoundInput], a ; global sound off
+ ld [wSoundInput], a ; global sound off
ld [rNR10], a ; sweep = 0
.ch6
- ld hl, Channel6Flags
+ ld hl, wChannel6Flags
bit SOUND_CHANNEL_ON, [hl]
jr z, .ch7
res SOUND_CHANNEL_ON, [hl] ; turn it off
@@ -2619,7 +2619,7 @@
ld a, $80
ld [rNR24], a ; restart sound (freq hi = 0)
.ch7
- ld hl, Channel7Flags
+ ld hl, wChannel7Flags
bit SOUND_CHANNEL_ON, [hl]
jr z, .ch8
res SOUND_CHANNEL_ON, [hl] ; turn it off
@@ -2633,7 +2633,7 @@
ld a, $80
ld [rNR34], a ; restart sound (freq hi = 0)
.ch8
- ld hl, Channel8Flags
+ ld hl, wChannel8Flags
bit SOUND_CHANNEL_ON, [hl]
jr z, .chscleared
res SOUND_CHANNEL_ON, [hl] ; turn it off
@@ -2646,11 +2646,11 @@
ld a, $80
ld [rNR44], a ; restart sound (freq hi = 0)
xor a
- ld [NoiseSampleAddress], a
- ld [NoiseSampleAddress + 1], a
+ ld [wNoiseSampleAddress], a
+ ld [wNoiseSampleAddress + 1], a
.chscleared
; start reading sfx header for # chs
- ld hl, MusicID
+ ld hl, wMusicID
ld [hl], e
inc hl
ld [hl], d
@@ -2660,7 +2660,7 @@
add hl, de ; pointers
; get bank
ld a, [hli]
- ld [MusicBank], a
+ ld [wMusicBank], a
; get address
ld e, [hl]
inc hl
@@ -2674,7 +2674,7 @@
.startchannels
push af
call LoadChannel ; bc = current channel
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
set SOUND_SFX, [hl]
call StartChannel
@@ -2683,7 +2683,7 @@
jr nz, .startchannels
call MusicOn
xor a
- ld [SFXPriority], a
+ ld [wSFXPriority], a
ret
; e8ca6
@@ -2694,12 +2694,12 @@
call MusicOff
; standard procedure if stereo's off
- ld a, [Options]
+ ld a, [wOptions]
bit STEREO, a
jp z, _PlaySFX
; else, let's go ahead with this
- ld hl, MusicID
+ ld hl, wMusicID
ld [hl], e
inc hl
ld [hl], d
@@ -2712,7 +2712,7 @@
; bank
ld a, [hli]
- ld [MusicBank], a
+ ld [wMusicBank], a
; address
ld e, [hl]
inc hl
@@ -2729,13 +2729,13 @@
push af
call LoadChannel
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
set SOUND_SFX, [hl]
push de
; get tracks for this channel
- ld a, [CurChannel]
+ ld a, [wCurChannel]
maskbits NUM_MUSIC_CHANS
ld e, a
ld d, 0
@@ -2745,15 +2745,15 @@
ld hl, wStereoPanningMask
and [hl]
- ld hl, Channel1Tracks - Channel1
+ ld hl, wChannel1Tracks - wChannel1
add hl, bc
ld [hl], a
- ld hl, Channel1Field30 - Channel1
+ ld hl, wChannel1Field30 - wChannel1
add hl, bc
ld [hl], a
- ld a, [CryTracks]
+ ld a, [wCryTracks]
cp 2 ; ch 1-2
jr c, .skip
@@ -2760,15 +2760,15 @@
; ch3-4
ld a, [wSFXDuration]
- ld hl, Channel1Field2e - Channel1
+ ld hl, wChannel1Field2e - wChannel1
add hl, bc
ld [hl], a
- ld hl, Channel1Field2f - Channel1
+ ld hl, wChannel1Field2f - wChannel1
add hl, bc
ld [hl], a
- ld hl, Channel1Flags2 - Channel1
+ ld hl, wChannel1Flags2 - wChannel1
add hl, bc
set SOUND_UNKN_0F, [hl]
@@ -2776,7 +2776,7 @@
pop de
; turn channel on
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
set SOUND_CHANNEL_ON, [hl] ; on
@@ -2799,7 +2799,7 @@
call LoadMusicByte
inc de
and $7 ; bit 0-2 (current channel)
- ld [CurChannel], a
+ ld [wCurChannel], a
ld c, a
ld b, 0
ld hl, ChannelPointers
@@ -2808,12 +2808,12 @@
ld c, [hl]
inc hl
ld b, [hl] ; bc = channel pointer
- ld hl, Channel1Flags - Channel1
+ ld hl, wChannel1Flags - wChannel1
add hl, bc
res SOUND_CHANNEL_ON, [hl] ; channel off
call ChannelInit
; load music pointer
- ld hl, Channel1MusicAddress - Channel1
+ ld hl, wChannel1MusicAddress - wChannel1
add hl, bc
call LoadMusicByte
ld [hli], a
@@ -2822,16 +2822,16 @@
ld [hl], a
inc de
; load music id
- ld hl, Channel1MusicID - Channel1
+ ld hl, wChannel1MusicID - wChannel1
add hl, bc
- ld a, [MusicID]
+ ld a, [wMusicID]
ld [hli], a
- ld a, [MusicID + 1]
+ ld a, [wMusicID + 1]
ld [hl], a
; load music bank
- ld hl, Channel1MusicBank - Channel1
+ ld hl, wChannel1MusicBank - wChannel1
add hl, bc
- ld a, [MusicBank]
+ ld a, [wMusicBank]
ld [hl], a
ret
@@ -2845,9 +2845,9 @@
push de
xor a
; get channel struct location and length
- ld hl, Channel1MusicID - Channel1 ; start
+ ld hl, wChannel1MusicID - wChannel1 ; start
add hl, bc
- ld e, Channel2 - Channel1 ; channel struct length
+ ld e, wChannel2 - wChannel1 ; channel struct length
; clear channel
.loop
ld [hli], a
@@ -2854,7 +2854,7 @@
dec e
jr nz, .loop
; set tempo to default ($100)
- ld hl, Channel1Tempo - Channel1
+ ld hl, wChannel1Tempo - wChannel1
add hl, bc
xor a
ld [hli], a
@@ -2861,7 +2861,7 @@
inc a
ld [hl], a
; set note length to default ($1) (fast)
- ld hl, Channel1NoteLength - Channel1
+ ld hl, wChannel1NoteLength - wChannel1
add hl, bc
ld [hl], a
pop de
@@ -2873,10 +2873,10 @@
; input:
; de = current music address
; output:
-; a = CurMusicByte
- ld a, [MusicBank]
+; a = wCurMusicByte
+ ld a, [wMusicBank]
call _LoadMusicByte
- ld a, [CurMusicByte]
+ ld a, [wCurMusicByte]
ret
; e8d80
@@ -2892,7 +2892,7 @@
GetLRTracks: ; e8fc2
; gets the default sound l/r channels
; stores mono/stereo table in hl
- ld a, [Options]
+ ld a, [wOptions]
bit STEREO, a
; made redundant, could have had a purpose in gold
jr nz, .stereo
@@ -2920,15 +2920,15 @@
ChannelPointers: ; e8fd9
; music channels
- dw Channel1
- dw Channel2
- dw Channel3
- dw Channel4
+ dw wChannel1
+ dw wChannel2
+ dw wChannel3
+ dw wChannel4
; sfx channels
- dw Channel5
- dw Channel6
- dw Channel7
- dw Channel8
+ dw wChannel5
+ dw wChannel6
+ dw wChannel7
+ dw wChannel8
; e8fe9
ClearChannels:: ; e8fe9
@@ -2973,7 +2973,7 @@
; input: e = trainer type
; turn fade off
xor a
- ld [MusicFade], a
+ ld [wMusicFade], a
; play nothing for one frame
push de
ld de, MUSIC_NONE
--- a/charmap.asm
+++ b/charmap.asm
@@ -7,10 +7,10 @@
charmap "<LNBRK>", $22
charmap "<POKE>", $24 ; "<PO><KE>"
charmap "%", $25 ; soft linebreak in landmark names
- charmap "<RED>", $38 ; RedsName
- charmap "<GREEN>", $39 ; GreensName
+ charmap "<RED>", $38 ; wRedsName
+ charmap "<GREEN>", $39 ; wGreensName
charmap "<ENEMY>", $3f
- charmap "<MOM>", $49 ; MomsName
+ charmap "<MOM>", $49 ; wMomsName
charmap "<PKMN>", $4a ; "<PK><MN>"
charmap "<_CONT>", $4b ; implements "<CONT>"
charmap "<SCROLL>", $4c
@@ -18,8 +18,8 @@
charmap "<LINE>", $4f
charmap "@", $50 ; string terminator
charmap "<PARA>", $51
- charmap "<PLAYER>", $52 ; PlayerName
- charmap "<RIVAL>", $53 ; RivalName
+ charmap "<PLAYER>", $52 ; wPlayerName
+ charmap "<RIVAL>", $53 ; wRivalName
charmap "#", $54 ; "POKé"
charmap "<CONT>", $55
charmap "<……>", $56 ; "……"
--- a/constants/audio_constants.asm
+++ b/constants/audio_constants.asm
@@ -66,7 +66,7 @@
const NOTE_REST ; 5
const NOTE_VIBRATO_OVERRIDE ; 6
-; Volume:
+; wVolume
VOLUME_SO1_F EQU 3
VOLUME_SO2_F EQU 7
VOLUME_SO1_LEVEL EQU %00000111
@@ -73,7 +73,7 @@
VOLUME_SO2_LEVEL EQU %01110000
MAX_VOLUME EQU $77
-; SoundInput:
+; wSoundInput
SOUND_INPUT_CH1_F EQU 0
SOUND_INPUT_CH2_F EQU 1
SOUND_INPUT_CH3_F EQU 2
@@ -80,9 +80,9 @@
SOUND_INPUT_CH4_F EQU 3
SOUND_INPUT_GLOBAL_F EQU 7
-; Danger:
+; wLowHealthAlarm
DANGER_PITCH_F EQU 4
DANGER_ON_F EQU 7
-; MusicFade:
+; wMusicFade
MUSIC_FADE_IN_F EQU 7
--- a/constants/battle_constants.asm
+++ b/constants/battle_constants.asm
@@ -27,7 +27,7 @@
NOT_VERY_EFFECTIVE EQU 05
NO_EFFECT EQU 00
-; PlayerStatLevels and EnemyStatLevels indexes (see wram.asm)
+; wPlayerStatLevels and wEnemyStatLevels indexes (see wram.asm)
; GetStatName arguments (see data/battle/stat_names.asm)
const_def
const ATTACK
@@ -53,7 +53,7 @@
; stat constants
; indexes for:
-; - PlayerStats and EnemyStats (see wram.asm)
+; - wPlayerStats and wEnemyStats (see wram.asm)
; - party_struct and battle_struct members (see macros/wram.asm)
const_value set 1
const STAT_HP
@@ -80,7 +80,7 @@
const WILD_BATTLE
const TRAINER_BATTLE
-; battle types (BattleType values)
+; battle types (wBattleType values)
const_def
const BATTLETYPE_NORMAL
const BATTLETYPE_CANLOSE
@@ -159,7 +159,7 @@
ALL_STATUS EQU (1 << PSN) + (1 << BRN) + (1 << FRZ) + (1 << PAR) + SLP
-; PlayerSubStatus1 or EnemySubStatus1 bit flags
+; wPlayerSubStatus1 or wEnemySubStatus1 bit flags
enum_start 7, -1
enum SUBSTATUS_IN_LOVE
enum SUBSTATUS_ROLLOUT
@@ -170,10 +170,10 @@
enum SUBSTATUS_CURSE
enum SUBSTATUS_NIGHTMARE
-; PlayerSubStatus2 or EnemySubStatus2 bit flags
+; wPlayerSubStatus2 or wEnemySubStatus2 bit flags
SUBSTATUS_CURLED EQU 0
-; PlayerSubStatus3 or EnemySubStatus3 bit flags
+; wPlayerSubStatus3 or wEnemySubStatus3 bit flags
enum_start 7, -1
enum SUBSTATUS_CONFUSED
enum SUBSTATUS_FLYING
@@ -184,7 +184,7 @@
enum SUBSTATUS_RAMPAGE
enum SUBSTATUS_BIDE
-; PlayerSubStatus4 or EnemySubStatus4 bit flags
+; wPlayerSubStatus4 or wEnemySubStatus4 bit flags
enum_start 7, -1
enum SUBSTATUS_LEECH_SEED
enum SUBSTATUS_RAGE
@@ -195,7 +195,7 @@
enum SUBSTATUS_MIST
enum SUBSTATUS_X_ACCURACY
-; PlayerSubStatus5 or EnemySubStatus5 bit flags
+; wPlayerSubStatus5 or wEnemySubStatus5 bit flags
enum_start 7, -1
enum SUBSTATUS_CANT_RUN
enum SUBSTATUS_DESTINY_BOND
@@ -206,7 +206,7 @@
enum SUBSTATUS_UNKNOWN_3
enum SUBSTATUS_TOXIC
-; PlayerScreens or EnemyScreens bit flags
+; wPlayerScreens or wEnemyScreens bit flags
enum_start 4, -1
enum SCREENS_REFLECT
enum SCREENS_LIGHT_SCREEN
@@ -214,7 +214,7 @@
enum SCREENS_UNUSED
enum SCREENS_SPIKES
-; Weather values
+; values in wBattleWeather
const_def
const WEATHER_NONE
const WEATHER_RAIN
--- a/constants/event_flags.asm
+++ b/constants/event_flags.asm
@@ -1,4 +1,4 @@
-; EventFlags bit flags
+; wEventFlags bit flags
const_def
; The first eight flags are reset upon reloading the map
const EVENT_GAVE_KURT_APRICORNS ; 000
--- a/constants/gfx_constants.asm
+++ b/constants/gfx_constants.asm
@@ -28,4 +28,4 @@
const SPRITEOAMSTRUCT_TILE_ID ; 2
const SPRITEOAMSTRUCT_ATTRIBUTES ; 3
SPRITEOAMSTRUCT_LENGTH EQU const_value
-NUM_SPRITE_OAM_STRUCTS EQU 40 ; see Sprites
+NUM_SPRITE_OAM_STRUCTS EQU 40 ; see wVirtualOAM
--- a/constants/map_data_constants.asm
+++ b/constants/map_data_constants.asm
@@ -60,7 +60,7 @@
const SOUTH_F
const NORTH_F
-; MapConnections
+; wMapConnections
const_def
shift_const EAST
shift_const WEST
@@ -170,7 +170,7 @@
const OBJECT_RANGE ; 20
; 21-27 are not used
OBJECT_STRUCT_LENGTH EQU 40
-NUM_OBJECT_STRUCTS EQU 13 ; see ObjectStructs
+NUM_OBJECT_STRUCTS EQU 13 ; see wObjectStructs
; object_struct OBJECT_FACING values
OW_DOWN EQU DOWN << 2
--- a/constants/pokemon_data_constants.asm
+++ b/constants/pokemon_data_constants.asm
@@ -1,29 +1,29 @@
; base data struct members (see data/pokemon/base_stats/*.asm)
-BASE_DEX_NO EQUS "(BaseDexNo - CurBaseData)"
-BASE_STATS EQUS "(BaseStats - CurBaseData)"
-BASE_HP EQUS "(BaseHP - CurBaseData)"
-BASE_ATK EQUS "(BaseAttack - CurBaseData)"
-BASE_SPD EQUS "(BaseSpeed - CurBaseData)"
-BASE_SAT EQUS "(BaseSpecialAttack - CurBaseData)"
-BASE_SDF EQUS "(BaseSpecialDefense - CurBaseData)"
-BASE_TYPES EQUS "(BaseType - CurBaseData)"
-BASE_TYPE_1 EQUS "(BaseType1 - CurBaseData)"
-BASE_TYPE_2 EQUS "(BaseType2 - CurBaseData)"
-BASE_CATCH_RATE EQUS "(BaseCatchRate - CurBaseData)"
-BASE_EXP EQUS "(BaseExp - CurBaseData)"
-BASE_ITEMS EQUS "(BaseItems - CurBaseData)"
-BASE_ITEM_1 EQUS "(BaseItem1 - CurBaseData)"
-BASE_ITEM_2 EQUS "(BaseItem2 - CurBaseData)"
-BASE_GENDER EQUS "(BaseGender - CurBaseData)"
-BASE_UNKNOWN_1 EQUS "(BaseUnknown1 - CurBaseData)"
-BASE_EGG_STEPS EQUS "(BaseEggSteps - CurBaseData)"
-BASE_UNKNOWN_2 EQUS "(BaseUnknown2 - CurBaseData)"
-BASE_PIC_SIZE EQUS "(BasePicSize - CurBaseData)"
-BASE_PADDING EQUS "(BasePadding - CurBaseData)"
-BASE_GROWTH_RATE EQUS "(BaseGrowthRate - CurBaseData)"
-BASE_EGG_GROUPS EQUS "(BaseEggGroups - CurBaseData)"
-BASE_TMHM EQUS "(BaseTMHM - CurBaseData)"
-BASE_DATA_SIZE EQUS "(CurBaseDataEnd - CurBaseData)"
+BASE_DEX_NO EQUS "(wBaseDexNo - wCurBaseData)"
+BASE_STATS EQUS "(wBaseStats - wCurBaseData)"
+BASE_HP EQUS "(wBaseHP - wCurBaseData)"
+BASE_ATK EQUS "(wBaseAttack - wCurBaseData)"
+BASE_SPD EQUS "(wBaseSpeed - wCurBaseData)"
+BASE_SAT EQUS "(wBaseSpecialAttack - wCurBaseData)"
+BASE_SDF EQUS "(wBaseSpecialDefense - wCurBaseData)"
+BASE_TYPES EQUS "(wBaseType - wCurBaseData)"
+BASE_TYPE_1 EQUS "(wBaseType1 - wCurBaseData)"
+BASE_TYPE_2 EQUS "(wBaseType2 - wCurBaseData)"
+BASE_CATCH_RATE EQUS "(wBaseCatchRate - wCurBaseData)"
+BASE_EXP EQUS "(wBaseExp - wCurBaseData)"
+BASE_ITEMS EQUS "(wBaseItems - wCurBaseData)"
+BASE_ITEM_1 EQUS "(wBaseItem1 - wCurBaseData)"
+BASE_ITEM_2 EQUS "(wBaseItem2 - wCurBaseData)"
+BASE_GENDER EQUS "(wBaseGender - wCurBaseData)"
+BASE_UNKNOWN_1 EQUS "(wBaseUnknown1 - wCurBaseData)"
+BASE_EGG_STEPS EQUS "(wBaseEggSteps - wCurBaseData)"
+BASE_UNKNOWN_2 EQUS "(wBaseUnknown2 - wCurBaseData)"
+BASE_PIC_SIZE EQUS "(wBasePicSize - wCurBaseData)"
+BASE_PADDING EQUS "(wBasePadding - wCurBaseData)"
+BASE_GROWTH_RATE EQUS "(wBaseGrowthRate - wCurBaseData)"
+BASE_EGG_GROUPS EQUS "(wBaseEggGroups - wCurBaseData)"
+BASE_TMHM EQUS "(wBaseTMHM - wCurBaseData)"
+BASE_DATA_SIZE EQUS "(wCurBaseDataEnd - wCurBaseData)"
; gender ratio constants
GENDER_F0 EQU 0 percent
@@ -34,7 +34,7 @@
GENDER_F100 EQU 254 ; 100 percent
GENDERLESS EQU 255
-; BaseGrowthRate values
+; wBaseGrowthRate values
; GrowthRates indexes (see data/growth_rates.asm)
const_def
const MEDIUM_FAST
@@ -44,7 +44,7 @@
const FAST
const SLOW
-; BaseEggGroups values
+; wBaseEggGroups values
const_value set 1
const MONSTER ; 1
const AMPHIBIAN ; 2
@@ -68,37 +68,37 @@
; party_struct members (see macros/wram.asm)
-MON_SPECIES EQUS "(PartyMon1Species - PartyMon1)"
-MON_ITEM EQUS "(PartyMon1Item - PartyMon1)"
-MON_MOVES EQUS "(PartyMon1Moves - PartyMon1)"
-MON_ID EQUS "(PartyMon1ID - PartyMon1)"
-MON_EXP EQUS "(PartyMon1Exp - PartyMon1)"
-MON_STAT_EXP EQUS "(PartyMon1StatExp - PartyMon1)"
-MON_HP_EXP EQUS "(PartyMon1HPExp - PartyMon1)"
-MON_ATK_EXP EQUS "(PartyMon1AtkExp - PartyMon1)"
-MON_DEF_EXP EQUS "(PartyMon1DefExp - PartyMon1)"
-MON_SPD_EXP EQUS "(PartyMon1SpdExp - PartyMon1)"
-MON_SPC_EXP EQUS "(PartyMon1SpcExp - PartyMon1)"
-MON_DVS EQUS "(PartyMon1DVs - PartyMon1)"
-MON_PP EQUS "(PartyMon1PP - PartyMon1)"
-MON_HAPPINESS EQUS "(PartyMon1Happiness - PartyMon1)"
-MON_PKRUS EQUS "(PartyMon1PokerusStatus - PartyMon1)"
-MON_CAUGHTDATA EQUS "(PartyMon1CaughtData - PartyMon1)"
-MON_CAUGHTLEVEL EQUS "(PartyMon1CaughtLevel - PartyMon1)"
-MON_CAUGHTTIME EQUS "(PartyMon1CaughtTime - PartyMon1)"
-MON_CAUGHTGENDER EQUS "(PartyMon1CaughtGender - PartyMon1)"
-MON_CAUGHTLOCATION EQUS "(PartyMon1CaughtLocation - PartyMon1)"
-MON_LEVEL EQUS "(PartyMon1Level - PartyMon1)"
-MON_STATUS EQUS "(PartyMon1Status - PartyMon1)"
-MON_HP EQUS "(PartyMon1HP - PartyMon1)"
-MON_MAXHP EQUS "(PartyMon1MaxHP - PartyMon1)"
-MON_ATK EQUS "(PartyMon1Attack - PartyMon1)"
-MON_DEF EQUS "(PartyMon1Defense - PartyMon1)"
-MON_SPD EQUS "(PartyMon1Speed - PartyMon1)"
-MON_SAT EQUS "(PartyMon1SpclAtk - PartyMon1)"
-MON_SDF EQUS "(PartyMon1SpclDef - PartyMon1)"
-BOXMON_STRUCT_LENGTH EQUS "(PartyMon1End - PartyMon1)"
-PARTYMON_STRUCT_LENGTH EQUS "(PartyMon1StatsEnd - PartyMon1)"
+MON_SPECIES EQUS "(wPartyMon1Species - wPartyMon1)"
+MON_ITEM EQUS "(wPartyMon1Item - wPartyMon1)"
+MON_MOVES EQUS "(wPartyMon1Moves - wPartyMon1)"
+MON_ID EQUS "(wPartyMon1ID - wPartyMon1)"
+MON_EXP EQUS "(wPartyMon1Exp - wPartyMon1)"
+MON_STAT_EXP EQUS "(wPartyMon1StatExp - wPartyMon1)"
+MON_HP_EXP EQUS "(wPartyMon1HPExp - wPartyMon1)"
+MON_ATK_EXP EQUS "(wPartyMon1AtkExp - wPartyMon1)"
+MON_DEF_EXP EQUS "(wPartyMon1DefExp - wPartyMon1)"
+MON_SPD_EXP EQUS "(wPartyMon1SpdExp - wPartyMon1)"
+MON_SPC_EXP EQUS "(wPartyMon1SpcExp - wPartyMon1)"
+MON_DVS EQUS "(wPartyMon1DVs - wPartyMon1)"
+MON_PP EQUS "(wPartyMon1PP - wPartyMon1)"
+MON_HAPPINESS EQUS "(wPartyMon1Happiness - wPartyMon1)"
+MON_PKRUS EQUS "(wPartyMon1PokerusStatus - wPartyMon1)"
+MON_CAUGHTDATA EQUS "(wPartyMon1CaughtData - wPartyMon1)"
+MON_CAUGHTLEVEL EQUS "(wPartyMon1CaughtLevel - wPartyMon1)"
+MON_CAUGHTTIME EQUS "(wPartyMon1CaughtTime - wPartyMon1)"
+MON_CAUGHTGENDER EQUS "(wPartyMon1CaughtGender - wPartyMon1)"
+MON_CAUGHTLOCATION EQUS "(wPartyMon1CaughtLocation - wPartyMon1)"
+MON_LEVEL EQUS "(wPartyMon1Level - wPartyMon1)"
+MON_STATUS EQUS "(wPartyMon1Status - wPartyMon1)"
+MON_HP EQUS "(wPartyMon1HP - wPartyMon1)"
+MON_MAXHP EQUS "(wPartyMon1MaxHP - wPartyMon1)"
+MON_ATK EQUS "(wPartyMon1Attack - wPartyMon1)"
+MON_DEF EQUS "(wPartyMon1Defense - wPartyMon1)"
+MON_SPD EQUS "(wPartyMon1Speed - wPartyMon1)"
+MON_SAT EQUS "(wPartyMon1SpclAtk - wPartyMon1)"
+MON_SDF EQUS "(wPartyMon1SpclDef - wPartyMon1)"
+BOXMON_STRUCT_LENGTH EQUS "(wPartyMon1End - wPartyMon1)"
+PARTYMON_STRUCT_LENGTH EQUS "(wPartyMon1StatsEnd - wPartyMon1)"
REDMON_STRUCT_LENGTH EQU 44
--- a/constants/script_constants.asm
+++ b/constants/script_constants.asm
@@ -5,9 +5,9 @@
; memory constants
const_def
- const MEM_BUFFER_0 ; use StringBuffer3
- const MEM_BUFFER_1 ; use StringBuffer4
- const MEM_BUFFER_2 ; use StringBuffer5
+ const MEM_BUFFER_0 ; use wStringBuffer3
+ const MEM_BUFFER_1 ; use wStringBuffer4
+ const MEM_BUFFER_2 ; use wStringBuffer5
NUM_MEM_BUFFERS EQU const_value
--- a/constants/sprite_constants.asm
+++ b/constants/sprite_constants.asm
@@ -149,7 +149,7 @@
const SPRITE_DAY_CARE_MON_1 ; e0
const SPRITE_DAY_CARE_MON_2 ; e1
-; VariableSprites indexes (see wram.asm)
+; wVariableSprites indexes (see wram.asm)
const_value set $f0
SPRITE_VARS EQU const_value
const SPRITE_CONSOLE ; f0
--- a/constants/wram_constants.asm
+++ b/constants/wram_constants.asm
@@ -1,4 +1,4 @@
-; MonType: ; cf5f
+; wMonType: ; cf5f
const_def
const PARTYMON ; 0
const OTPARTYMON ; 1
@@ -6,7 +6,7 @@
const TEMPMON ; 3
const WILDMON ; 4
-; Options: (bits) ; cfcc
+; wOptions: (bits) ; cfcc
const_value set 4
const NO_TEXT_SCROLL ; 4
const STEREO ; 5
@@ -13,12 +13,12 @@
const BATTLE_SHIFT ; 6
const BATTLE_SCENE ; 7
-; Options: (bits 0-2)
+; wOptions: (bits 0-2)
TEXT_DELAY_FAST EQU 1
TEXT_DELAY_MED EQU 3
TEXT_DELAY_SLOW EQU 5
-; TextBoxFrame: ; cfce
+; wTextBoxFrame: ; cfce
const_def
const FRAME_1 ; 0
const FRAME_2 ; 1
@@ -30,16 +30,16 @@
const FRAME_8 ; 7
NUM_FRAMES EQU const_value
-; TextBoxFlags:
+; wTextBoxFlags:
const_def
const FAST_TEXT_DELAY_F ; 0
const NO_TEXT_DELAY_F ; 1
-; Options2:
+; wOptions2:
const_def
const MENU_ACCOUNT ; 0
-; GBPrinter:
+; wGBPrinter:
GBPRINTER_LIGHTEST EQU $00
GBPRINTER_LIGHTER EQU $20
GBPRINTER_NORMAL EQU $40
@@ -46,7 +46,7 @@
GBPRINTER_DARKER EQU $60
GBPRINTER_DARKEST EQU $7f
-; WalkingDirection: ; d043
+; wWalkingDirection: ; d043
const_value set -1
const STANDING ; -1
const DOWN ; 0
@@ -60,7 +60,7 @@
LEFT_MASK EQU 1 << LEFT
RIGHT_MASK EQU 1 << RIGHT
-; FacingDirection: ; d044
+; wFacingDirection: ; d044
FACE_CURRENT EQU 0
FACE_DOWN EQU 8
FACE_UP EQU 4
@@ -67,7 +67,7 @@
FACE_LEFT EQU 2
FACE_RIGHT EQU 1
-; TimeOfDay: ; d269
+; wTimeOfDay: ; d269
const_def
const MORN_F ; 0
const DAY_F ; 1
@@ -82,16 +82,16 @@
ANYTIME EQU MORN | DAY | NITE
-; ScriptFlags: ; d434
+; wScriptFlags: ; d434
SCRIPT_RUNNING EQU 2
-; ScriptMode: ; d437
+; wScriptMode: ; d437
SCRIPT_OFF EQU 0
SCRIPT_READ EQU 1
SCRIPT_WAIT_MOVEMENT EQU 2
SCRIPT_WAIT EQU 3
-; CurDay: ; d4cb
+; wCurDay: ; d4cb
const_def
const SUNDAY ; 0
const MONDAY ; 1
@@ -101,20 +101,20 @@
const FRIDAY ; 5
const SATURDAY ; 6
-; MapObjects: ; d71e
+; wMapObjects: ; d71e
PLAYER_OBJECT EQU 0
NUM_OBJECTS EQU $10
-; InputType: ; c2c7
+; wInputType: ; c2c7
AUTO_INPUT EQU $ff
-; WhichRegisteredItem: ; d95b
+; wWhichRegisteredItem: ; d95b
REGISTERED_POCKET EQU %11000000
REGISTERED_NUMBER EQU %00111111
-; PlayerState: ; d95d
+; wPlayerState: ; d95d
PLAYER_NORMAL EQU 0
PLAYER_BIKE EQU 1
PLAYER_SKATE EQU 2
--- a/data/battle/battle_text.asm
+++ b/data/battle/battle_text.asm
@@ -10,7 +10,7 @@
WildPokemonAppearedText: ; 0x80746
text "Wild @"
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text_start
line "appeared!"
prompt
@@ -19,7 +19,7 @@
HookedPokemonAttackedText: ; 0x8075c
text "The hooked"
line "@"
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text_start
cont "attacked!"
prompt
@@ -26,7 +26,7 @@
; 0x80778
PokemonFellFromTreeText: ; 0x80778
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text " fell"
line "out of the tree!"
prompt
@@ -34,7 +34,7 @@
WildCelebiAppearedText: ; 0x80793
text "Wild @"
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text_start
line "appeared!"
prompt
@@ -48,7 +48,7 @@
BattleText_WildFled: ; 0x807bd
text "Wild @"
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text_start
line "fled!"
prompt
@@ -56,7 +56,7 @@
BattleText_EnemyFled: ; 0x807cf
text "Enemy @"
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text_start
line "fled!"
prompt
@@ -110,7 +110,7 @@
text "<TARGET>"
line "recovered with"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
prompt
; 0x80899
@@ -119,7 +119,7 @@
text "<USER>"
line "recovered PP using"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
prompt
; 0x808b6
@@ -138,7 +138,7 @@
; 0x808e7
BattleText_PkmnLightScreenFell: ; 0x808e7
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " #MON's"
line "LIGHT SCREEN fell!"
prompt
@@ -145,7 +145,7 @@
; 0x80905
BattleText_PkmnReflectFaded: ; 0x80905
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " #MON's"
line "REFLECT faded!"
prompt
@@ -188,7 +188,7 @@
BattleText_EnemyPkmnFainted: ; 0x809a8
text "Enemy @"
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text_start
line "fainted!"
prompt
@@ -237,7 +237,7 @@
; 0x80a75
BattleText_PkmnFainted: ; 0x80a75
- text_from_ram BattleMonNick
+ text_from_ram wBattleMonNick
text_start
line "fainted!"
prompt
@@ -265,7 +265,7 @@
text "<ENEMY>"
line "is about to use"
cont "@"
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text "."
para "Will <PLAYER>"
@@ -277,7 +277,7 @@
text "<ENEMY>"
line "sent out"
cont "@"
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text "!"
done
; 0x80b0b
@@ -313,7 +313,7 @@
text "<USER>"
line "fled using a"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
prompt
; 0x80ba0
@@ -333,7 +333,7 @@
text "<TARGET>"
line "recovered using a"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
prompt
; 0x80bde
@@ -341,7 +341,7 @@
BattleText_UsersStringBuffer1Activated: ; 0x80bde
text "<USER>'s"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
cont "activated!"
prompt
@@ -354,7 +354,7 @@
; 0x80c0d
BattleText_PkmnIsAlreadyOut: ; 0x80c0d
- text_from_ram BattleMonNick
+ text_from_ram wBattleMonNick
text_start
line "is already out."
prompt
@@ -361,7 +361,7 @@
; 0x80c22
BattleText_PkmnCantBeRecalled: ; 0x80c22
- text_from_ram BattleMonNick
+ text_from_ram wBattleMonNick
text_start
line "can't be recalled!"
prompt
@@ -380,7 +380,7 @@
; 0x80c72
BattleText_PkmnHasNoMovesLeft: ; 0x80c72
- text_from_ram BattleMonNick
+ text_from_ram wBattleMonNick
text_start
line "has no moves left!"
done
@@ -393,10 +393,10 @@
; 0x80c9c
BattleText_StringBuffer1GrewToLevel: ; 0x80c9c
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " grew to"
line "level @"
- deciram CurPartyLevel, 1, 3
+ deciram wCurPartyLevel, 1, 3
text "!@"
sound_dex_fanfare_50_79
db "@@"
@@ -404,7 +404,7 @@
BattleText_WildPkmnIsEating: ; 0x80cba
text "Wild @"
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text_start
line "is eating!"
prompt
@@ -412,7 +412,7 @@
BattleText_WildPkmnIsAngry: ; 0x80cd1
text "Wild @"
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text_start
line "is angry!"
prompt
@@ -480,7 +480,7 @@
BattleText_ItemHealedConfusion: ; ItemHealedConfusion
text "A @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " rid"
line "<TARGET>"
cont "of its confusion."
@@ -497,7 +497,7 @@
text "<USER>'s"
line "hurt by"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
prompt
; 0x80df5
@@ -506,7 +506,7 @@
text "<USER>"
line "was released from"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
prompt
; 0x80e11
@@ -560,7 +560,7 @@
text "<TARGET>"
line "hung on with"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
prompt
; 0x80eb0
@@ -588,7 +588,7 @@
DisabledMoveText: ; 0x80f02
text "<USER>'s"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " is"
cont "DISABLED!"
prompt
@@ -595,7 +595,7 @@
; 0x80f19
LoafingAroundText: ; 0x80f19
- text_from_ram BattleMonNick
+ text_from_ram wBattleMonNick
text " is"
line "loafing around."
prompt
@@ -602,7 +602,7 @@
; 0x80f31
BeganToNapText: ; 0x80f31
- text_from_ram BattleMonNick
+ text_from_ram wBattleMonNick
text " began"
line "to nap!"
prompt
@@ -609,7 +609,7 @@
; 0x80f44
WontObeyText: ; 0x80f44
- text_from_ram BattleMonNick
+ text_from_ram wBattleMonNick
text " won't"
line "obey!"
prompt
@@ -616,7 +616,7 @@
; 0x80f54
TurnedAwayText: ; 0x80f54
- text_from_ram BattleMonNick
+ text_from_ram wBattleMonNick
text " turned"
line "away!"
prompt
@@ -623,7 +623,7 @@
; 0x80f66
IgnoredOrdersText: ; 0x80f66
- text_from_ram BattleMonNick
+ text_from_ram wBattleMonNick
text " ignored"
line "orders!"
prompt
@@ -630,7 +630,7 @@
; 0x80f7b
IgnoredSleepingText: ; 0x80f7b
- text_from_ram BattleMonNick
+ text_from_ram wBattleMonNick
text " ignored"
line "orders…sleeping!"
prompt
@@ -646,7 +646,7 @@
text "<USER>"
line "has no PP left for"
cont "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "!"
prompt
; 0x80fd7
@@ -758,7 +758,7 @@
text "<USER>"
line "SKETCHED"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
prompt
; 0x81156
@@ -773,7 +773,7 @@
SpiteEffectText: ; 0x8117f
text "<TARGET>'s"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " was"
cont "reduced by @"
deciram wd265, 1, 1
@@ -850,7 +850,7 @@
WontRiseAnymoreText: ; 0x81272
text "<USER>'s"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " won't"
cont "rise anymore!"
prompt
@@ -859,7 +859,7 @@
WontDropAnymoreText: ; 0x8128f
text "<TARGET>'s"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " won't"
cont "drop anymore!"
prompt
@@ -885,7 +885,7 @@
PlayerHitTimesText: ; 0x812e5
text "Hit @"
- deciram PlayerDamageTaken, 1, 1
+ deciram wPlayerDamageTaken, 1, 1
text " times!"
prompt
; 0x812f8
@@ -892,7 +892,7 @@
EnemyHitTimesText: ; 0x812f8
text "Hit @"
- deciram EnemyDamageTaken, 1, 1
+ deciram wEnemyDamageTaken, 1, 1
text " times!"
prompt
; 0x8130b
@@ -957,7 +957,7 @@
text "<USER>"
line "learned"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
prompt
; 0x813f8
@@ -977,7 +977,7 @@
WasDisabledText: ; 0x8141d
text "<TARGET>'s"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " was"
cont "DISABLED!"
prompt
@@ -993,7 +993,7 @@
text "<USER>"
line "transformed into"
cont "the @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "-type!"
prompt
; 0x81476
@@ -1008,7 +1008,7 @@
text "<USER>"
line "TRANSFORMED into"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
prompt
; 0x814b4
@@ -1088,7 +1088,7 @@
text "<TARGET>'s"
line "protected by"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
prompt
; 0x815c1
@@ -1102,7 +1102,7 @@
StoleText: ; 0x815da
text "<USER>"
line "stole @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
cont "from its foe!"
prompt
@@ -1260,7 +1260,7 @@
; 0x8182d
BeatUpAttackText: ; 0x8182d
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "'s"
line "attack!"
done
--- a/data/common_text/common_text_1.asm
+++ b/data/common_text/common_text_1.asm
@@ -6,7 +6,7 @@
_HeyItsFruitText::
text "Hey! It's"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -13,7 +13,7 @@
_ObtainedFruitText::
text "Obtained"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -38,7 +38,7 @@
done
UnknownText_0x1bc0a2::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
line "recovered @"
deciram wd1f3, 2, 3
@@ -46,52 +46,52 @@
done
UnknownText_0x1bc0bb::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "'s"
line "cured of poison."
done
UnknownText_0x1bc0d2::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "'s"
line "rid of paralysis."
done
UnknownText_0x1bc0ea::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "'s"
line "burn was healed."
done
UnknownText_0x1bc101::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
line "was defrosted."
done
UnknownText_0x1bc115::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
line "woke up."
done
UnknownText_0x1bc123::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "'s"
line "health returned."
done
UnknownText_0x1bc13a::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
line "is revitalized."
done
UnknownText_0x1bc14f::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " grew to"
line "level @"
- deciram CurPartyLevel, 1, 3
+ deciram wCurPartyLevel, 1, 3
text "!@"
sound_dex_fanfare_50_79
text_waitbutton
@@ -98,7 +98,7 @@
db "@@"
UnknownText_0x1bc16e::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " came"
line "to its senses."
done
@@ -276,7 +276,7 @@
UnknownText_0x1bc4d7::
text "Put away the"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
prompt
@@ -288,7 +288,7 @@
UnknownText_0x1bc509::
text "Set up the"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
prompt
@@ -295,12 +295,12 @@
UnknownText_0x1bc51c::
text "Put away the"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
para "and set up the"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
prompt
@@ -331,7 +331,7 @@
UnknownText_0x1bc5d7::
text "It's an adorable"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
@@ -517,7 +517,7 @@
_OPT_OakText3::
text_start
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
done
@@ -524,7 +524,7 @@
_OPT_MaryText1::
text_start
line "MARY: @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "'s"
done
@@ -695,7 +695,7 @@
_PokedexShowText::
text_start
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
db "@@"
; Pokémon Music Channel / Pokémusic
@@ -793,7 +793,7 @@
text_start
line "Number is @"
interpret_data
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
done
@@ -842,9 +842,9 @@
_PnP_Text4::
text_start
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
db "@@"
_PnP_cute::
@@ -930,7 +930,7 @@
_PnP_Text5::
text_start
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
db "@@"
_RocketRadioText1::
@@ -1009,7 +1009,7 @@
_BuenaRadioText4::
text_start
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
done
@@ -1085,7 +1085,7 @@
text "<ENEMY>"
line "withdrew"
cont "@"
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text "!"
prompt
@@ -1095,7 +1095,7 @@
text_from_ram wMonOrItemNameBuffer
text_start
cont "on @"
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text "!"
prompt
@@ -1111,7 +1111,7 @@
Text_TheItemWasPutInThePack::
text "The @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
line "was put in the"
cont "PACK."
@@ -1138,7 +1138,7 @@
UnknownText_0x1bd07f::
text "Will you play with"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "?"
done
@@ -1173,7 +1173,7 @@
UnknownText_0x1bd131::
text "Test event"
line "@"
- deciram StringBuffer2, 1, 2
+ deciram wStringBuffer2, 1, 2
text "?"
done
@@ -1205,7 +1205,7 @@
UnknownText_0x1bd19a::
text "A new CARD arrived"
line "from @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
done
@@ -1215,10 +1215,10 @@
done
UnknownText_0x1bd1dd::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "'s CARD was"
line "listed as no.@"
- deciram StringBuffer1, 1, 2
+ deciram wStringBuffer1, 1, 2
text "."
prompt
@@ -1251,10 +1251,10 @@
UnknownText_0x1bd286::
text "Trading @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text_start
line "for @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "…"
done
@@ -1286,7 +1286,7 @@
UnknownText_0x1bd321::
text "<PLAYER> found"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -1298,10 +1298,10 @@
UnknownText_0x1bd34b::
text "I just saw some"
line "rare @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " in"
cont "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
para "I'll call you if I"
@@ -1315,10 +1315,10 @@
done
UnknownText_0x1bd3be::
- text_from_ram PlayerName
+ text_from_ram wPlayerName
text " received"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!@"
sound_item
text_waitbutton
@@ -1344,7 +1344,7 @@
text_from_ram wMonOrItemNameBuffer
text " for"
cont "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text ".@@"
UnknownText_0x1bd445::
@@ -1356,12 +1356,12 @@
text "I collect #MON."
line "Do you have"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "?"
para "Want to trade it"
line "for my @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "?"
done
@@ -1373,7 +1373,7 @@
UnknownText_0x1bd4aa::
text "Huh? That's not"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text ". "
cont "What a letdown…"
done
@@ -1381,7 +1381,7 @@
UnknownText_0x1bd4d2::
text "Yay! I got myself"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
cont "Thanks!"
done
@@ -1389,7 +1389,7 @@
UnknownText_0x1bd4f4::
text "Hi, how's my old"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " doing?"
done
@@ -1399,12 +1399,12 @@
para "If you have"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text ", would"
para "you trade it for"
line "my @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "?"
done
@@ -1419,7 +1419,7 @@
UnknownText_0x1bd5a1::
text "You don't have"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "? That's"
cont "too bad, then."
done
@@ -1429,7 +1429,7 @@
para "I finally got"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
done
@@ -1448,12 +1448,12 @@
para "it. Do you have"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "?"
para "Want to trade it"
line "for my @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "?"
done
@@ -1465,7 +1465,7 @@
UnknownText_0x1bd696::
text "That's not"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
para "Please trade with"
@@ -1483,7 +1483,7 @@
UnknownText_0x1bd6f5::
text "How is that"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " I"
cont "traded you doing?"
@@ -1709,7 +1709,7 @@
UnknownText_0x1bdd30::
text "OK. I'll raise"
line "your @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
prompt
@@ -1722,25 +1722,25 @@
text "Are we geniuses or"
line "what? Want to see"
cont "your @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "?"
done
UnknownText_0x1bdd96::
text "Your @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
line "has grown a lot."
para "By level, it's"
line "grown by @"
- deciram StringBuffer2 + 1, 1, 3
+ deciram wStringBuffer2 + 1, 1, 3
text "."
para "If you want your"
line "#MON back, it"
cont "will cost ¥@"
- deciram StringBuffer2 + 2, 3, 4
+ deciram wStringBuffer2 + 2, 3, 4
text "."
done
@@ -1752,7 +1752,7 @@
UnknownText_0x1bde1f::
text "<PLAYER> got back"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
prompt
@@ -1759,7 +1759,7 @@
UnknownText_0x1bde32::
text "Huh? Back already?"
line "Your @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
para "needs a little"
line "more time with us."
--- a/data/common_text/common_text_2.asm
+++ b/data/common_text/common_text_2.asm
@@ -27,7 +27,7 @@
UnknownText_0x1c00cd::
text "Hm… @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "…"
line "That's a fairly"
cont "decent name."
@@ -60,13 +60,13 @@
UnknownText_0x1c01be::
text "Hm… @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "?"
line "What a great name!"
cont "It's perfect."
para "Treat @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
line "with loving care."
done
@@ -90,12 +90,12 @@
text "All right. This"
line "#MON is now"
cont "named @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
prompt
Text_Gained::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " gained@@"
Text_ABoostedStringBuffer2ExpPoints::
@@ -102,7 +102,7 @@
text_start
line "a boosted"
cont "@"
- deciram StringBuffer2, 2, 4
+ deciram wStringBuffer2, 2, 4
text " EXP. Points!"
prompt
@@ -109,7 +109,7 @@
Text_StringBuffer2ExpPoints::
text_start
line "@"
- deciram StringBuffer2, 2, 4
+ deciram wStringBuffer2, 2, 4
text " EXP. Points!"
prompt
@@ -128,12 +128,12 @@
line "Get'm, @@"
Text_BattleMonNick01::
- text_from_ram BattleMonNick
+ text_from_ram wBattleMonNick
text "!"
done
Text_BattleMonNickComma::
- text_from_ram BattleMonNick
+ text_from_ram wBattleMonNick
text ",@@"
Text_ThatsEnoughComeBack::
@@ -164,26 +164,26 @@
UnknownText_0x1c0396::
text "It contained"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
para "Teach @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text_start
line "to a #MON?"
done
UnknownText_0x1c03c2::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " is"
line "not compatible"
cont "with @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
para "It can't learn"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
prompt
@@ -191,7 +191,7 @@
text "You have no room"
line "for any more"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "S."
prompt
@@ -198,7 +198,7 @@
UnknownText_0x1c0421::
text "You received"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
prompt
@@ -236,7 +236,7 @@
text_from_ram wMysteryGiftPartnerName
text " sent"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
prompt
@@ -244,7 +244,7 @@
text_from_ram wMysteryGiftPartnerName
text " sent"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
cont "to @"
text_from_ram wMysteryGiftPlayerName
@@ -292,7 +292,7 @@
prompt
UnknownText_0x1c05dd::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " used"
line "CUT!"
prompt
@@ -309,7 +309,7 @@
db "@@"
_UsedSurfText::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " used"
line "SURF!"
done
@@ -330,7 +330,7 @@
done
UnknownText_0x1c068e::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " used"
line "WATERFALL!"
done
@@ -346,7 +346,7 @@
done
UnknownText_0x1c06de::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " used"
line "DIG!"
done
@@ -379,13 +379,13 @@
prompt
UnknownText_0x1c0774::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " used"
line "STRENGTH!"
done
UnknownText_0x1c0788::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " can"
line "move boulders."
prompt
@@ -409,7 +409,7 @@
done
UnknownText_0x1c0816::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " used"
line "WHIRLPOOL!"
prompt
@@ -431,7 +431,7 @@
done
UnknownText_0x1c0897::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " did a"
line "HEADBUTT!"
prompt
@@ -449,7 +449,7 @@
done
UnknownText_0x1c08f0::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " used"
line "ROCK SMASH!"
prompt
@@ -489,7 +489,7 @@
UnknownText_0x1c09b2::
text "<PLAYER> got on the"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
done
@@ -496,7 +496,7 @@
UnknownText_0x1c09c7::
text "<PLAYER> got off"
line "the @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
done
@@ -515,7 +515,7 @@
UnknownText_0x1c0a1c::
text "<PLAYER> found"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -545,7 +545,7 @@
prompt
UnknownText_0x1c0acc::
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "fainted!"
prompt
@@ -559,7 +559,7 @@
prompt
UnknownText_0x1c0b03::
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " used"
line "SWEET SCENT!"
done
@@ -601,7 +601,7 @@
deciram wItemQuantityChangeBuffer, 1, 2
text_start
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "(S)?"
done
@@ -608,7 +608,7 @@
UnknownText_0x1c0bd8::
text "Threw away"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "(S)."
prompt
@@ -626,7 +626,7 @@
UnknownText_0x1c0c2e::
text "Registered the"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
prompt
@@ -657,7 +657,7 @@
UnknownText_0x1c0cc6::
text "<USER>'s"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
db "@@"
UnknownText_0x1c0cd0::
@@ -672,7 +672,7 @@
UnknownText_0x1c0ceb::
text "<TARGET>'s"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
db "@@"
UnknownText_0x1c0cf5::
@@ -733,7 +733,7 @@
cont "@@"
_MoveNameText::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
db "@@"
_EndUsedMove1Text::
@@ -766,7 +766,7 @@
done
UnknownText_0x1c0dba::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " came"
line "out of its EGG!@"
sound_caught_mon
@@ -776,7 +776,7 @@
UnknownText_0x1c0dd8::
text "Give a nickname to"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "?"
done
@@ -804,7 +804,7 @@
UnknownText_0x1c0e6f::
text "It has no interest"
line "in @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
prompt
@@ -811,7 +811,7 @@
UnknownText_0x1c0e8d::
text "It appears to care"
line "for @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
prompt
@@ -818,7 +818,7 @@
UnknownText_0x1c0eac::
text "It's friendly with"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
prompt
@@ -825,7 +825,7 @@
UnknownText_0x1c0ec6::
text "It shows interest"
line "in @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
prompt
@@ -874,10 +874,10 @@
UnknownText_0x1c0fbc::
deciram wcf64, 1, 3
text " @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
line "Animation type @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
db "@@"
UnknownText_0x1c0fdd::
@@ -885,7 +885,7 @@
done
Text_WasSentToBillsPC::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " was"
line "sent to BILL's PC."
prompt
@@ -924,7 +924,7 @@
UnknownText_0x1c10c0::
text "Caught @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
prompt
@@ -935,7 +935,7 @@
UnknownText_0x1c10dd::
text "You already caught"
line "a @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
prompt
@@ -950,7 +950,7 @@
text ","
line "who caught a"
cont "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!@@"
ContestJudging_FirstPlaceScoreText::
@@ -970,7 +970,7 @@
para "who caught a"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!@@"
ContestJudging_SecondPlaceScoreText::
@@ -990,7 +990,7 @@
para "who caught a"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!@@"
ContestJudging_ThirdPlaceScoreText::
@@ -1008,7 +1008,7 @@
para "…Hm, it measures"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
prompt
@@ -1016,7 +1016,7 @@
text "CURRENT RECORD"
para "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " caught by"
line "@"
text_from_ram wMagikarpRecordHoldersName
@@ -1030,7 +1030,7 @@
line "with the ID number"
para "of @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " in"
line "your party."
prompt
@@ -1042,7 +1042,7 @@
line "with the ID number"
para "of @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " in"
line "your PC BOX."
prompt
@@ -1050,7 +1050,7 @@
UnknownText_0x1c12fc::
text "Give a nickname to"
line "the @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " you"
cont "received?"
done
@@ -1081,7 +1081,7 @@
deciram wItemQuantityChangeBuffer, 1, 2
text_start
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "(S)."
prompt
@@ -1104,7 +1104,7 @@
deciram wItemQuantityChangeBuffer, 1, 2
text_start
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "(S)."
prompt
@@ -1161,10 +1161,10 @@
prompt
_OakPCText3::
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " #MON seen"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " #MON owned"
para "PROF.OAK's"
@@ -1352,7 +1352,7 @@
UnknownText_0x1c1a90::
text "Toss out how many"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "(S)?"
done
@@ -1361,7 +1361,7 @@
deciram wItemQuantityChangeBuffer, 1, 2
text_start
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "(S)?"
done
@@ -1368,7 +1368,7 @@
UnknownText_0x1c1aca::
text "Discarded"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "(S)."
prompt
@@ -1388,12 +1388,12 @@
text_from_ram wMonOrItemNameBuffer
text "'s"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " and"
para "made it hold"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
prompt
@@ -1402,7 +1402,7 @@
text_from_ram wMonOrItemNameBuffer
text_start
line "hold @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
prompt
@@ -1424,7 +1424,7 @@
UnknownText_0x1c1bc4::
text "Took @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
line "from @"
text_from_ram wMonOrItemNameBuffer
@@ -1437,7 +1437,7 @@
line "already holding"
para "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
line "Switch items?"
done
@@ -1455,7 +1455,7 @@
UnknownText_0x1c1c47::
text "MAIL detached from"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
prompt
--- a/data/common_text/common_text_3.asm
+++ b/data/common_text/common_text_3.asm
@@ -65,7 +65,7 @@
UnknownText_0x1c41e6::
text "Your friend's"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " appears"
cont "to be abnormal!"
prompt
@@ -75,7 +75,7 @@
text_from_ram wd004
text_start
line "for @"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "?"
done
@@ -124,7 +124,7 @@
UnknownText_0x1c439c::
text "Today's remaining"
line "time is @"
- deciram StringBuffer2, 1, 2
+ deciram wStringBuffer2, 1, 2
text " min."
para "Would you like to"
@@ -133,7 +133,7 @@
UnknownText_0x1c43dc::
text "There are only @"
- deciram StringBuffer2, 1, 2
+ deciram wStringBuffer2, 1, 2
text_start
line "min. left today."
@@ -180,7 +180,7 @@
UnknownText_0x1c4525::
text "Today's remaining"
line "time is @"
- deciram StringBuffer2, 1, 2
+ deciram wStringBuffer2, 1, 2
text " min."
done
@@ -257,7 +257,7 @@
UnknownText_0x1c4719::
text "<PLAYER> received"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
done
@@ -264,16 +264,16 @@
UnknownText_0x1c472c::
text "<PLAYER> put the"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " in"
cont "the @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
prompt
UnknownText_0x1c474b::
text "The @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "is full…"
prompt
@@ -447,7 +447,7 @@
UnknownText_0x1c4b92::
text "Congratulations!"
line "Your @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
db "@@"
UnknownText_0x1c4baf::
@@ -455,13 +455,13 @@
para "evolved into"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "!"
done
UnknownText_0x1c4bc5::
text "Huh? @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text_start
line "stopped evolving!"
prompt
@@ -468,7 +468,7 @@
UnknownText_0x1c4be3::
text "What? @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text_start
line "is evolving!"
done
@@ -480,7 +480,7 @@
UnknownText_0x1c4c08::
deciram wItemQuantityChangeBuffer, 1, 2
text " @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "(S)"
line "will be ¥@"
deciram hMoneyTemp, 3, 6
@@ -509,7 +509,7 @@
UnknownText_0x1c4cae::
deciram wItemQuantityChangeBuffer, 1, 2
text " @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "(S)"
line "will be ¥@"
deciram hMoneyTemp, 3, 6
@@ -548,7 +548,7 @@
done
UnknownText_0x1c4db0::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " costs"
line "¥@"
deciram hMoneyTemp, 3, 6
@@ -592,7 +592,7 @@
UnknownText_0x1c4e89::
deciram wItemQuantityChangeBuffer, 1, 2
text " @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "(S)"
line "will cost ¥@"
deciram hMoneyTemp, 3, 6
@@ -675,7 +675,7 @@
deciram hMoneyTemp, 3, 6
text " for"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "(S)."
done
@@ -705,7 +705,7 @@
UnknownText_0x1c509f::
text "lined up!"
line "Won @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " coins!"
done
@@ -935,7 +935,7 @@
text_from_ram wMonOrItemNameBuffer
text " learned"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "!@"
sound_dex_fanfare_50_79
text_waitbutton
@@ -949,7 +949,7 @@
UnknownText_0x1c5699::
text "Stop learning"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "?"
done
@@ -958,7 +958,7 @@
text_start
line "did not learn"
cont "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
prompt
@@ -967,7 +967,7 @@
text " is"
line "trying to learn"
cont "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
para "But @"
@@ -979,7 +979,7 @@
para "Delete an older"
line "move to make room"
cont "for @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "?"
done
@@ -997,7 +997,7 @@
text_from_ram wMonOrItemNameBuffer
text " forgot"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "."
para "And…"
@@ -1077,7 +1077,7 @@
done
UnknownText_0x1c58bc::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "?"
line "Is that right?"
done
@@ -1148,7 +1148,7 @@
Text_ThePkmnMustAllBeDifferentKinds::
text "The @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " #MON"
line "must all be"
cont "different kinds."
@@ -1158,7 +1158,7 @@
Text_ThePkmnMustNotHoldTheSameItems::
text "The @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " #MON"
line "must not hold the"
cont "same items."
@@ -1208,7 +1208,7 @@
UnknownText_0x1c5b17::
text "Gotcha! @"
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text_start
line "was caught!@"
sound_caught_mon
@@ -1225,7 +1225,7 @@
prompt
UnknownText_0x1c5b53::
- text_from_ram EnemyMonNick
+ text_from_ram wEnemyMonNick
text "'s data"
line "was newly added to"
cont "the #DEX.@"
@@ -1236,15 +1236,15 @@
UnknownText_0x1c5b7f::
text "Give a nickname to"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "?"
done
UnknownText_0x1c5b9a::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "'s"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text " rose."
prompt
@@ -1288,7 +1288,7 @@
UnknownText_0x1c5c7b::
text "Coins:"
line "@"
- deciram Coins, 2, 4
+ deciram wCoins, 2, 4
db "@@"
Text_RaiseThePPOfWhichMove::
@@ -1302,13 +1302,13 @@
done
Text_PPIsMaxedOut::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "'s PP"
line "is maxed out."
prompt
Text_PPsIncreased::
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "'s PP"
line "increased."
prompt
@@ -1324,7 +1324,7 @@
text_start
para "@"
- text_from_ram PlayerName
+ text_from_ram wPlayerName
text " sent the"
line "trophy home."
prompt
@@ -1371,7 +1371,7 @@
UnknownText_0x1c5e1d::
text "Can't get on your"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " now."
prompt
@@ -1384,7 +1384,7 @@
UnknownText_0x1c5e68::
text "<PLAYER> used the@"
text_low
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
done
@@ -1391,7 +1391,7 @@
UnknownText_0x1c5e7b::
text "<PLAYER> got on the@"
text_low
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
prompt
@@ -1399,15 +1399,15 @@
text "<PLAYER> got off@"
text_low
text "the @"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
prompt
UnknownText_0x1c5ea8::
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " knows"
line "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
prompt
@@ -1419,7 +1419,7 @@
UnknownText_0x1c5eda::
text "Oh, make it forget"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text "?"
done
--- a/data/default_options.asm
+++ b/data/default_options.asm
@@ -1,15 +1,15 @@
DefaultOptions: ; 14f7c
-; Options: med text speed
+; wOptions: med text speed
db TEXT_DELAY_MED
; wSaveFileExists: no
db $00
-; TextBoxFrame: frame 1
+; wTextBoxFrame: frame 1
db FRAME_1
-; TextBoxFlags: use text speed
+; wTextBoxFlags: use text speed
db 1 << FAST_TEXT_DELAY_F
-; GBPrinter: normal brightness
+; wGBPrinter: normal brightness
db GBPRINTER_NORMAL
-; Options2: menu account on
+; wOptions2: menu account on
db 1 << MENU_ACCOUNT
db $00
--- a/data/maps/data.asm
+++ b/data/maps/data.asm
@@ -24,12 +24,12 @@
;\7: this map id
map \2
dw \3_Blocks + \2_WIDTH * (\2_HEIGHT - 3) + \5
- dw OverworldMap + \4 + 3
+ dw wOverworldMap + \4 + 3
db \6
db \2_WIDTH
db \2_HEIGHT * 2 - 1
db (\4 - \5) * -2
- dw OverworldMap + \2_HEIGHT * (\2_WIDTH + 6) + 1
+ dw wOverworldMap + \2_HEIGHT * (\2_WIDTH + 6) + 1
endc
if "\1" == "south"
@@ -41,12 +41,12 @@
;\7: this map id
map \2
dw \3_Blocks + \5
- dw OverworldMap + (\7_HEIGHT + 3) * (\7_WIDTH + 6) + \4 + 3
+ dw wOverworldMap + (\7_HEIGHT + 3) * (\7_WIDTH + 6) + \4 + 3
db \6
db \2_WIDTH
db 0
db (\4 - \5) * -2
- dw OverworldMap + \2_WIDTH + 7
+ dw wOverworldMap + \2_WIDTH + 7
endc
if "\1" == "west"
@@ -58,12 +58,12 @@
;\7: this map id
map \2
dw \3_Blocks + (\2_WIDTH * \5) + \2_WIDTH - 3
- dw OverworldMap + (\7_WIDTH + 6) * (\4 + 3)
+ dw wOverworldMap + (\7_WIDTH + 6) * (\4 + 3)
db \6
db \2_WIDTH
db (\4 - \5) * -2
db \2_WIDTH * 2 - 1
- dw OverworldMap + \2_WIDTH * 2 + 6
+ dw wOverworldMap + \2_WIDTH * 2 + 6
endc
if "\1" == "east"
@@ -75,12 +75,12 @@
;\7: this map id
map \2
dw \3_Blocks + (\2_WIDTH * \5)
- dw OverworldMap + (\7_WIDTH + 6) * (\4 + 3 + 1) - 3
+ dw wOverworldMap + (\7_WIDTH + 6) * (\4 + 3 + 1) - 3
db \6
db \2_WIDTH
db (\4 - \5) * -2
db 0
- dw OverworldMap + \2_WIDTH + 7
+ dw wOverworldMap + \2_WIDTH + 7
endc
ENDM
--- a/data/phone/text/bill.asm
+++ b/data/phone/text/bill.asm
@@ -44,7 +44,7 @@
para "<PLAY_G>, your BOX"
line "has room for @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
cont "more #MON."
@@ -59,7 +59,7 @@
para "<PLAY_G>, your BOX"
line "has room for only"
cont "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " more #MON."
para "Maybe you should"
--- a/data/phone/text/extra.asm
+++ b/data/phone/text/extra.asm
@@ -310,7 +310,7 @@
ArnieLovesTheCuteText: ; 0x649dc
text "I'm always with my"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "!"
para "It's so cute!"
@@ -323,7 +323,7 @@
line "here, I saw this"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " for the"
line "first time."
@@ -336,7 +336,7 @@
text "I was wondering,"
line "do you happen to"
cont "have @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "?"
para "I can't seem to"
@@ -359,7 +359,7 @@
para "I'll be here on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x64b48
@@ -376,12 +376,12 @@
para "A whole bunch of"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " have"
para "appeared around"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
para "You have to see"
@@ -406,7 +406,7 @@
para "Let's battle. I'll"
line "be waiting for you"
cont "on @"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x64c5a
@@ -425,7 +425,7 @@
AlanGettingStrongerText: ; 0x64cbd
text "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "'s"
line "getting stronger,"
@@ -439,7 +439,7 @@
line "knocked out a wild"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " just"
line "the other day."
@@ -451,7 +451,7 @@
UnknownText_0x64d4f: ; 0x64d4f
text "By the way, a wild"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " escaped"
cont "on me yesterday."
@@ -469,7 +469,7 @@
para "I'm hanging out on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
para "Can you come down"
@@ -490,7 +490,7 @@
line "Why don't you come"
para "to @"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text_start
line "and pick it up?"
done
@@ -512,7 +512,7 @@
para "I'm waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x64f1a
@@ -526,7 +526,7 @@
para "I'm waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x64f74
@@ -533,7 +533,7 @@
UnknownText_0x64f74: ; 0x64f74
text "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " is"
line "getting prettier!"
@@ -546,7 +546,7 @@
text "It took only an"
line "instant to KO a"
cont "wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "It must be because"
@@ -560,7 +560,7 @@
UnknownText_0x6501c: ; 0x6501c
text "You know what?"
line "A wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
para "got away from me"
line "again."
@@ -576,7 +576,7 @@
UnknownText_0x65091: ; 0x65091
text "Right now, I'm on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
para "If you're close"
@@ -604,7 +604,7 @@
para "it! I'm waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x65161
@@ -630,7 +630,7 @@
para "I'm waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x6520f
@@ -646,7 +646,7 @@
para "I'm waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x65271
@@ -655,7 +655,7 @@
text "I recently began"
line "observing wild"
cont "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "I've been learning"
@@ -677,7 +677,7 @@
line "to knock out a"
para "wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " a"
line "while back."
@@ -694,7 +694,7 @@
line "close to catching"
para "a wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text ","
line "but it got away."
@@ -703,7 +703,7 @@
para "wanting to observe"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text ". Rats…"
done
; 0x65419
@@ -717,7 +717,7 @@
para "I'll be on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x65471
@@ -906,7 +906,7 @@
para "The place is"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
para "Hurry over--I'm"
@@ -917,7 +917,7 @@
DerekCheekPincherText: ; 0x65ab2
text "Listen to this."
line "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
para "grins happily when"
line "I pinch its cheek."
@@ -933,11 +933,11 @@
text "Oh, and recently,"
line "my PIKACHU beat a"
cont "wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "!"
para "A wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text ","
line "I tell you!"
@@ -955,7 +955,7 @@
UnknownText_0x65bc8: ; 0x65bc8
text "Oh, and I saw a"
line "wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " a"
cont "little while ago."
@@ -1020,7 +1020,7 @@
para "I'm waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
para "Come pick this up"
@@ -1030,7 +1030,7 @@
TullyGrownText: ; 0x65de4
text "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " has"
line "grown again."
@@ -1045,7 +1045,7 @@
UnknownText_0x65e42: ; 0x65e42
text "Oh yeah, I KO'd a"
line "wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "It was huge, like"
@@ -1060,7 +1060,7 @@
UnknownText_0x65eac: ; 0x65eac
text "Oh yeah, I lost a"
line "wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "It was huge, like"
@@ -1078,7 +1078,7 @@
para "I'll be fishing on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
para "Swing by if you"
@@ -1102,7 +1102,7 @@
para "I'll be waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
done
; 0x65ff2
@@ -1126,7 +1126,7 @@
para "Our battle will be"
line "on @"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
done
; 0x66087
@@ -1137,7 +1137,7 @@
para "Hustle over to"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
done
; 0x660be
@@ -1162,7 +1162,7 @@
line "down this wild"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
line "It wasn't rare"
@@ -1202,7 +1202,7 @@
para "You know where--"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
done
; 0x662a9
@@ -1318,7 +1318,7 @@
para "Hurry over to"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
done
; 0x665ad
@@ -1325,7 +1325,7 @@
UnknownText_0x665ad: ; 0x665ad
text "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "'s"
line "adorable, don't"
@@ -1342,7 +1342,7 @@
line "battle a wild"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " a while"
line "ago…"
@@ -1353,7 +1353,7 @@
para "I hate those nasty"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "!"
done
; 0x66688
@@ -1363,7 +1363,7 @@
line "battle a wild"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " a while"
line "ago…"
@@ -1389,13 +1389,13 @@
para "I'll be waiting"
line "with CLEFAIRY on"
cont "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
done
; 0x66796
TiffanyItsAwfulText: ; 0x66796
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "!"
para "It's awful."
@@ -1428,7 +1428,7 @@
para "Come collect it on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
done
; 0x66882
@@ -1451,7 +1451,7 @@
para "Please hurry to"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x6691d
@@ -1466,7 +1466,7 @@
para "Please hurry to"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x66980
@@ -1473,7 +1473,7 @@
VanceLiftoffText: ; 0x66980
text "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "'s"
line "become tougher."
@@ -1485,7 +1485,7 @@
UnknownText_0x669b2: ; 0x669b2
text "We can easily beat"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "!"
para "…Huh? You too?"
@@ -1496,7 +1496,7 @@
UnknownText_0x669ed: ; 0x669ed
text "But get this, a"
line "wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
para "just barely eluded"
line "us."
@@ -1509,7 +1509,7 @@
UnknownText_0x66a3a: ; 0x66a3a
text "Right now, I'm on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
para "You know, where I"
@@ -1537,7 +1537,7 @@
line "Hurry, hurry!"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
line "FLY over now!"
done
@@ -1545,7 +1545,7 @@
WiltonGrownText: ; 0x66afc
text "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "'s"
line "grown impressive!"
@@ -1557,7 +1557,7 @@
UnknownText_0x66b3e: ; 0x66b3e
text "We beat a wild"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "…"
para "You know, I have"
@@ -1574,7 +1574,7 @@
para "to landing a wild"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "I tell you, it was"
@@ -1585,7 +1585,7 @@
UnknownText_0x66bf3: ; 0x66bf3
text "I'm fishing on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text ","
para "but nothing's"
@@ -1608,7 +1608,7 @@
para "Come pick it up on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
done
; 0x66ca7
@@ -1631,7 +1631,7 @@
para "like before on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "…"
para "You have to come"
@@ -1647,7 +1647,7 @@
line "know where?"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "…"
line "Just head from"
@@ -1730,7 +1730,7 @@
ParryNoMatchText: ; 0x66f9f
text "Nothing can match"
line "my @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " now."
done
; 0x66fc0
@@ -1738,7 +1738,7 @@
UnknownText_0x66fc0: ; 0x66fc0
text "Yeah, we KO'd a"
line "wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "!"
para "That was OK, but I"
@@ -1751,7 +1751,7 @@
line "spotted a wild"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
line "We were debating"
@@ -1775,7 +1775,7 @@
para "Yep! We'll meet on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x670eb
@@ -1795,7 +1795,7 @@
ParryHaventYouGottenToText: ; 0x6712a
text "Haven't you gotten"
line "to @"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "?"
para "Waiting here isn't"
@@ -1805,9 +1805,9 @@
; 0x6717a
UnknownText_0x6717a: ; 0x6717a
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "'s @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
line "is much stronger"
cont "than before!"
@@ -1818,7 +1818,7 @@
text "And, and…"
line "I just battled and"
cont "beat @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "!"
para "I've raised my"
@@ -1830,7 +1830,7 @@
text "But, but…"
para "A wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
line "got away from me"
@@ -1848,7 +1848,7 @@
para "I'll be waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x67281
@@ -1874,7 +1874,7 @@
para "I'll be waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x67308
--- a/data/phone/text/extra2.asm
+++ b/data/phone/text/extra2.asm
@@ -21,7 +21,7 @@
JackIntelligenceText: ; 0x1740c0
text "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "'s"
line "intelligence keeps"
@@ -35,7 +35,7 @@
text "The other day, I"
line "easily defeated a"
cont "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "I think swapping"
@@ -49,7 +49,7 @@
line "I missed catching"
para "a @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " by"
line "just a tiny bit."
@@ -70,7 +70,7 @@
para "I'll be in"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
para "Give me a shout if"
@@ -226,7 +226,7 @@
para "I'll be at"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
done
; 0x174688
@@ -234,7 +234,7 @@
UnknownText_0x174688: ; 0x174688
text "I fancied up my"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " and"
para "made it even cuter"
@@ -266,7 +266,7 @@
line "showed it was"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text ". I was"
line "quite miffed."
done
@@ -290,7 +290,7 @@
para "I'll be at"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
para "Please come see me"
@@ -315,7 +315,7 @@
line "hurry. Come see me"
para "in @"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text_start
line "when you can."
done
@@ -329,7 +329,7 @@
line "last time!"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "'s"
line "where I'm waiting"
@@ -361,7 +361,7 @@
cont "about our battle!"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
para "Hustle over quick!"
@@ -371,7 +371,7 @@
GavenGreaterText: ; 0x174a24
text "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
line "might be greater"
cont "than I imagined."
@@ -378,7 +378,7 @@
para "I doubt I'll see a"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " that's"
cont "better than mine."
done
@@ -389,13 +389,13 @@
line "to barely defeat"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " the"
line "other day."
para "I've never seen a"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " get"
cont "that strong…"
@@ -412,7 +412,7 @@
text "And a while back,"
line "I tried to catch a"
cont "wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "But it managed to"
@@ -431,7 +431,7 @@
para "I'll be waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
para "Give me a shout"
@@ -457,7 +457,7 @@
para "I'll take you down"
line "with @"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x174c7f
@@ -465,11 +465,11 @@
UnknownText_0x174c7f: ; 0x174c7f
text "Do you remember my"
line "sweet @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "?"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " runs"
line "very fast."
@@ -484,7 +484,7 @@
UnknownText_0x174cf6: ; 0x174cf6
text "Oh, have you ever"
line "seen a @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
cont "before?"
@@ -505,7 +505,7 @@
UnknownText_0x174d86: ; 0x174d86
text "Oh, I just saw a"
line "wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "I was trying to"
@@ -535,7 +535,7 @@
line "for you around"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
line "Look for me, OK?"
done
@@ -560,7 +560,7 @@
line "deal?"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
para "That's where I'm"
@@ -571,7 +571,7 @@
JoseAromaText: ; 0x174f2f
text "Hey listen, my"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "'s stick"
para "has this really"
@@ -586,7 +586,7 @@
text "A while ago, my"
line "FARFETCH'D KO'd"
cont "this @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "You should have"
@@ -600,7 +600,7 @@
UnknownText_0x174ffd: ; 0x174ffd
text "I ran into a wild"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "…"
para "I was trying to"
@@ -625,7 +625,7 @@
line "raring to go."
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "'s"
line "where I'm at."
@@ -649,7 +649,7 @@
para "Catch up to me on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text ","
para "and I'll let you"
@@ -684,7 +684,7 @@
line "stick!"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
para "Please come as"
@@ -700,7 +700,7 @@
para "Catch up to me on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text ","
para "and I'll let you"
@@ -713,12 +713,12 @@
para "Do you recall my"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "?"
para "Yes, exactly. That"
line "lovely @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "Wouldn't you agree"
@@ -730,13 +730,13 @@
UnknownText_0x17536b: ; 0x17536b
text "Have I ever faced"
line "a wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "?"
para "You need to ask?"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " I've"
line "beaten on numerous"
cont "occasions!"
@@ -754,7 +754,7 @@
line "to catch a wild"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "…"
line "Oh! Never mind!"
done
@@ -766,7 +766,7 @@
para "The place shall be"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
para "Don't make me"
@@ -798,7 +798,7 @@
line "the place was"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
line "Don't try to run!"
done
@@ -806,7 +806,7 @@
JoeySharperText: ; 0x175530
text "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "'s"
line "looking sharper"
cont "than before!"
@@ -822,7 +822,7 @@
UnknownText_0x175591: ; 0x175591
text "Oh yeah, I took"
line "down a @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
para "in the wild the"
line "other day."
@@ -838,7 +838,7 @@
UnknownText_0x175611: ; 0x175611
text "Oh yeah, I saw a"
line "wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "!"
para "I thought about"
@@ -860,7 +860,7 @@
line "will be different!"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "'s"
line "where I'll be."
@@ -877,7 +877,7 @@
UnknownText_0x17571d: ; 0x17571d
text "I'm checking out"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "'s moves"
para "and devising some"
@@ -898,7 +898,7 @@
para "I'm waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x1757d4
@@ -914,7 +914,7 @@
line "It's overwhelming!"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "'s grow-"
line "ing especially"
@@ -926,7 +926,7 @@
UnknownText_0x175869: ; 0x175869
text "Oh yeah, we KO'd a"
line "wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
para "with one hit a"
line "while back."
@@ -942,7 +942,7 @@
UnknownText_0x1758e4: ; 0x1758e4
text "Oh yeah, a wild"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " got"
para "away from me at"
@@ -967,7 +967,7 @@
line "last time!"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "'s"
line "where I'll be."
@@ -1005,7 +1005,7 @@
para "I'll be waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
done
; 0x175abe
@@ -1027,7 +1027,7 @@
line "already!"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text " is"
line "where I am."
@@ -1041,7 +1041,7 @@
line "not here yet?"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text " is"
line "where I am."
@@ -1055,7 +1055,7 @@
line "more time with my"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " than I"
line "have with my kids."
@@ -1067,7 +1067,7 @@
UnknownText_0x175c24: ; 0x175c24
text "I just beat a wild"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "I told my kid, but"
@@ -1084,7 +1084,7 @@
UnknownText_0x175c9f: ; 0x175c9f
text "Yesterday a wild"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " slipped"
para "away from me, in"
@@ -1112,7 +1112,7 @@
line "quite agreeable."
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text " is"
line "the spot!"
done
@@ -1129,7 +1129,7 @@
para "Uh, sorry! See,"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " are"
para "biting like there"
@@ -1137,7 +1137,7 @@
para "over here on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
para "Aiyee! Ouch!"
@@ -1172,7 +1172,7 @@
para "you to show up on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
para "You shouldn't make"
@@ -1198,7 +1198,7 @@
line "hear this."
para "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " is"
line "so adorable!"
@@ -1212,7 +1212,7 @@
para "We beat a wild"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " with"
para "just one hit a"
@@ -1229,7 +1229,7 @@
para "We just saw a"
line "really gorgeous"
cont "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "But I was on the"
@@ -1252,7 +1252,7 @@
para "I'll be waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
para "Let me know when"
@@ -1450,13 +1450,13 @@
para "I saw a beautiful"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "!"
para "I wish I could"
line "become a beautiful"
cont "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " too."
done
; 0x17686d
@@ -1475,7 +1475,7 @@
text "Listen, listen!"
para "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "…"
line "it… so pretty…"
@@ -1515,7 +1515,7 @@
para "I'll be waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x176a2f
@@ -1525,7 +1525,7 @@
line "was watching my"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " eat"
line "some BERRIES."
@@ -1548,7 +1548,7 @@
line "running across"
para "wild @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
line "quite often."
@@ -1562,7 +1562,7 @@
line "battling this"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " the"
line "other day…"
@@ -1583,7 +1583,7 @@
line "battle right now!"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text " is"
line "where I am."
@@ -1604,13 +1604,13 @@
para "I took a hike in"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text_start
cont "yesterday, see?"
para "Well, there were"
line "tons of @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
para "around! You have"
line "to see it!"
@@ -1617,7 +1617,7 @@
para "I get this feeling"
line "that @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
para "may be timid."
line "I didn't see any"
@@ -1646,7 +1646,7 @@
line "you?"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
line "I'm waiting!"
done
@@ -1671,7 +1671,7 @@
ToddLooksCuteLikeMeText: ; 0x176e5d
text "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " is"
line "looking more and"
@@ -1685,7 +1685,7 @@
para "Now we can KO"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " easily."
para "I should challenge"
@@ -1698,7 +1698,7 @@
line "We just failed to"
para "beat @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " by"
line "a tiny margin."
@@ -1722,7 +1722,7 @@
para "I'll be waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
done
; 0x176fdb
@@ -1776,7 +1776,7 @@
para "I'll be waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
done
; 0x17717c
@@ -1798,7 +1798,7 @@
UnknownText_0x1771fd: ; 0x1771fd
text "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " and"
line "I are getting more"
@@ -1810,7 +1810,7 @@
UnknownText_0x177237: ; 0x177237
text "We battled a wild"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " and"
para "managed to drop it"
@@ -1826,7 +1826,7 @@
para "I still haven't"
line "caught @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "It's getting past"
@@ -1841,7 +1841,7 @@
para "I'll be waiting on"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "."
para "…Could you take it"
@@ -1880,7 +1880,7 @@
line "it, won't you?"
para "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text " is"
line "where I am."
done
@@ -1907,7 +1907,7 @@
para "Don't forget,"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x17750e
@@ -1921,7 +1921,7 @@
para "Hurry over to"
line "@"
- text_from_ram StringBuffer5
+ text_from_ram wStringBuffer5
text "!"
done
; 0x177561
--- a/data/phone/text/gaven_overworld.asm
+++ b/data/phone/text/gaven_overworld.asm
@@ -12,7 +12,7 @@
line "again when I heal"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " and the"
line "rest of my team."
done
@@ -25,7 +25,7 @@
line "again when I heal"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " and the"
line "rest of my team."
done
--- a/data/phone/text/jose_overworld.asm
+++ b/data/phone/text/jose_overworld.asm
@@ -1,6 +1,6 @@
JoseAskNumber1Text:
text "If my @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
line "sees anything"
--- a/data/phone/text/mom.asm
+++ b/data/phone/text/mom.asm
@@ -8,12 +8,12 @@
MomPhoneLandmarkText: ; 0x1b4021
text "Oh, so you're in"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Isn't that where"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
para "is? Did you go"
line "take a look?"
@@ -22,7 +22,7 @@
MomPhoneGenericAreaText: ; 0x1b406b
text "Really, you're in"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "?"
para "I've never gone"
@@ -33,7 +33,7 @@
MomPhoneNewBarkText: ; 0x1b40b1
text "What? You're in"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "?"
para "Come see your MOM"
@@ -43,7 +43,7 @@
MomPhoneCherrygroveText: ; 0x1b40e4
text "You're visiting"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "?"
para "How about coming"
@@ -53,7 +53,7 @@
MomOtherAreaText: ; 0x1b411c
text "Wow, you're in"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "?"
para "Good luck on your"
@@ -74,7 +74,7 @@
MomCheckBalanceText: ; 0x1b41a7
text "By the way, you've"
line "saved up ¥@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Do you want to"
@@ -97,7 +97,7 @@
MomYouveSavedText: ; 0x1b4249
text "By the way, you've"
line "saved up ¥@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Want to start"
--- a/data/phone/text/trainers1.asm
+++ b/data/phone/text/trainers1.asm
@@ -1,7 +1,7 @@
UnknownText_0x1b4dc5: ; 0x1b4dc5
text "Hello. This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Good morning,"
@@ -11,7 +11,7 @@
UnknownText_0x1b4ded: ; 0x1b4ded
text "Hello. This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "How's it going,"
@@ -21,7 +21,7 @@
UnknownText_0x1b4e16: ; 0x1b4e16
text "Hello. This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Good evening,"
@@ -33,7 +33,7 @@
line "morning!"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "How are you doing?"
done
@@ -42,7 +42,7 @@
text "<PLAY_G>, howdy!"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "Isn't it nice out?"
done
@@ -52,7 +52,7 @@
line "evening!"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "Got a minute?"
done
@@ -62,7 +62,7 @@
line "#MON doing?"
para "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " is"
line "so curious, it's a"
@@ -73,7 +73,7 @@
UnknownText_0x1b4f21: ; 0x1b4f21
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Oh! Good morning,"
@@ -83,7 +83,7 @@
UnknownText_0x1b4f4d: ; 0x1b4f4d
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Oh! Good day,"
@@ -93,7 +93,7 @@
UnknownText_0x1b4f75: ; 0x1b4f75
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Oh! Good evening,"
@@ -105,7 +105,7 @@
line "Good morning."
para "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "Were you asleep?"
done
@@ -113,7 +113,7 @@
UnknownText_0x1b4fda: ; 0x1b4fda
text "Hi, <PLAYER>."
line "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "How are you doing?"
@@ -122,7 +122,7 @@
UnknownText_0x1b5004: ; 0x1b5004
text "Hi, <PLAYER>."
line "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Were you awake?"
@@ -133,7 +133,7 @@
line "#MON happy?"
para "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " is"
line "healthy. It eats a"
cont "lot every day."
@@ -142,7 +142,7 @@
UnknownText_0x1b5073: ; 0x1b5073
text "Yeah, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Huh? What's up,"
@@ -152,7 +152,7 @@
UnknownText_0x1b509b: ; 0x1b509b
text "Yeah, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Huh? What's up"
@@ -162,7 +162,7 @@
UnknownText_0x1b50c2: ; 0x1b50c2
text "Yeah, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Huh? What's up"
@@ -174,7 +174,7 @@
line "You awake?"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
line "How's it going?"
done
@@ -184,7 +184,7 @@
line "free right now?"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
line "How's it going?"
done
@@ -194,7 +194,7 @@
line "Were you asleep?"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
line "How's it going?"
done
@@ -207,7 +207,7 @@
line "bit too energetic."
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text ","
line "especially."
@@ -221,7 +221,7 @@
UnknownText_0x1b522b: ; 0x1b522b
text "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "'s"
line "looking tougher"
cont "than ever."
@@ -233,7 +233,7 @@
UnknownText_0x1b5270: ; 0x1b5270
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " speaking…"
para "Hi, <PLAY_G>!"
@@ -243,7 +243,7 @@
UnknownText_0x1b52a5: ; 0x1b52a5
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " speaking…"
para "Hi, <PLAY_G>!"
@@ -252,7 +252,7 @@
UnknownText_0x1b52cc: ; 0x1b52cc
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " speaking…"
para "Hi, <PLAY_G>!"
@@ -264,7 +264,7 @@
line "morning!"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "How are you doing?"
done
@@ -273,7 +273,7 @@
text "Hi, <PLAY_G>!"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "How are you doing?"
done
@@ -283,7 +283,7 @@
line "evening!"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "How are you doing?"
done
@@ -293,7 +293,7 @@
line "#MON doing?"
para "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "'s"
line "doing as great as"
cont "ever."
@@ -306,7 +306,7 @@
UnknownText_0x1b53f7: ; 0x1b53f7
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Oh, <PLAY_G>."
@@ -318,7 +318,7 @@
UnknownText_0x1b5424: ; 0x1b5424
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Oh. Hi, <PLAY_G>."
@@ -327,7 +327,7 @@
UnknownText_0x1b5446: ; 0x1b5446
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Oh, <PLAY_G>."
@@ -339,7 +339,7 @@
line "<PLAY_G>!"
para "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "Were you sleeping?"
done
@@ -347,7 +347,7 @@
UnknownText_0x1b54a6: ; 0x1b54a6
text "<PLAY_G>, hi!"
line "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Do you have some"
@@ -359,7 +359,7 @@
line "Good evening."
para "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "I hope you were"
@@ -386,7 +386,7 @@
UnknownText_0x1b55ae: ; 0x1b55ae
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Oh, <PLAY_G>?"
@@ -396,7 +396,7 @@
UnknownText_0x1b55da: ; 0x1b55da
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Oh, <PLAY_G>? Hi!"
@@ -405,7 +405,7 @@
UnknownText_0x1b55fc: ; 0x1b55fc
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Oh, <PLAY_G>?"
@@ -417,7 +417,7 @@
para "Tweet! Yeah, it's"
line "me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
@@ -426,7 +426,7 @@
para "Tweet! Yeah, it's"
line "me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
@@ -435,7 +435,7 @@
para "Tweet! Yeah, it's"
line "me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
@@ -444,7 +444,7 @@
line "still cooking?"
para "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " has"
line "too much energy."
@@ -456,7 +456,7 @@
UnknownText_0x1b5702: ; 0x1b5702
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Oh. Hi, <PLAYER>."
@@ -466,7 +466,7 @@
UnknownText_0x1b572e: ; 0x1b572e
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Oh, hi, <PLAYER>,"
@@ -476,7 +476,7 @@
UnknownText_0x1b575a: ; 0x1b575a
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Oh, hi, <PLAYER>,"
@@ -488,7 +488,7 @@
line "up and answer!"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -497,7 +497,7 @@
line "up and answer!"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -506,7 +506,7 @@
line "up and answer!"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -528,7 +528,7 @@
UnknownText_0x1b589a: ; 0x1b589a
text "Hi, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here!"
para "Oh, <PLAYER>? You"
@@ -537,7 +537,7 @@
UnknownText_0x1b58c2: ; 0x1b58c2
text "Hi, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here!"
para "Oh, <PLAYER>? You"
@@ -546,7 +546,7 @@
UnknownText_0x1b58ea: ; 0x1b58ea
text "Hi, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here!"
para "Oh, <PLAYER>? You"
@@ -558,7 +558,7 @@
line "How're you doing?"
para "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text ","
line "got a minute?"
done
@@ -568,7 +568,7 @@
line "it going?"
para "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "Got a minute?"
done
@@ -578,7 +578,7 @@
line "How're you doing?"
para "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text ","
line "got a minute?"
done
@@ -588,7 +588,7 @@
line "#MON doing?"
para "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "'s"
line "raring to go, just"
cont "like always."
@@ -603,7 +603,7 @@
UnknownText_0x1b5a3b: ; 0x1b5a3b
text "Hello? This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " speaking."
para "Oh. Hi, <PLAY_G>!"
@@ -613,7 +613,7 @@
UnknownText_0x1b5a74: ; 0x1b5a74
text "Hello? This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " speaking."
para "Oh, hi, <PLAY_G>!"
@@ -622,7 +622,7 @@
UnknownText_0x1b5a9f: ; 0x1b5a9f
text "Hello? This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " speaking."
para "Oh, hi, <PLAY_G>!"
@@ -634,7 +634,7 @@
line "morning!"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "Isn't it nice out?"
done
@@ -643,7 +643,7 @@
text "<PLAY_G>, howdy!"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "Isn't it nice out?"
done
@@ -653,7 +653,7 @@
line "<PLAY_G>!"
para "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "Were you awake?"
done
@@ -670,7 +670,7 @@
para "Of all my #MON,"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " is the"
cont "hardest to handle."
@@ -711,7 +711,7 @@
UnknownText_0x1b5d09: ; 0x1b5d09
text "Hiya, it's Uncle"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
@@ -718,7 +718,7 @@
UnknownText_0x1b5d21: ; 0x1b5d21
text "Hiya, it's Uncle"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
@@ -725,7 +725,7 @@
UnknownText_0x1b5d39: ; 0x1b5d39
text "Hiya, it's Uncle"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
@@ -740,7 +740,7 @@
UnknownText_0x1b5d9f: ; 0x1b5d9f
text "Hello, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "speaking."
@@ -750,7 +750,7 @@
UnknownText_0x1b5dcc: ; 0x1b5dcc
text "Hello, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "speaking."
@@ -760,7 +760,7 @@
UnknownText_0x1b5df8: ; 0x1b5df8
text "Hello, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "speaking."
@@ -773,7 +773,7 @@
line "<PLAY_G>."
para "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "Were you sleeping?"
done
@@ -781,7 +781,7 @@
UnknownText_0x1b5e59: ; 0x1b5e59
text "Hi, <PLAY_G>."
line "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "How are things"
@@ -793,7 +793,7 @@
line "<PLAY_G>."
para "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "Are you awake?"
done
@@ -807,7 +807,7 @@
para "Me, I take my"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " to the"
para "#MON CENTER in"
@@ -822,7 +822,7 @@
UnknownText_0x1b5f7a: ; 0x1b5f7a
text "Yeah, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " the"
line "HIKER here."
@@ -831,7 +831,7 @@
UnknownText_0x1b5f9e: ; 0x1b5f9e
text "Yeah, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " the"
line "HIKER here."
@@ -841,7 +841,7 @@
UnknownText_0x1b5fc9: ; 0x1b5fc9
text "Yeah, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " the"
line "HIKER here."
@@ -853,7 +853,7 @@
text "Yo, <PLAYER>?"
para "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "the HIKER!"
done
@@ -863,7 +863,7 @@
line "<PLAYER>?"
para "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "the HIKER!"
done
@@ -873,7 +873,7 @@
line "awake?"
para "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "the HIKER!"
done
@@ -883,7 +883,7 @@
line "as feisty as ever?"
para "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " and"
line "me--we have energy"
@@ -897,7 +897,7 @@
UnknownText_0x1b60f5: ; 0x1b60f5
text "Yes? This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " speaking."
para "Hey, <PLAY_G>!"
@@ -906,7 +906,7 @@
UnknownText_0x1b611b: ; 0x1b611b
text "Yes? This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " speaking."
para "This must be"
@@ -916,7 +916,7 @@
UnknownText_0x1b6149: ; 0x1b6149
text "Yes? This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " speaking."
para "Ah, <PLAY_G>!"
@@ -925,7 +925,7 @@
UnknownText_0x1b616e: ; 0x1b616e
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "<PLAY_G>, right?"
@@ -934,7 +934,7 @@
UnknownText_0x1b618f: ; 0x1b618f
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "<PLAY_G>, what are"
@@ -944,7 +944,7 @@
UnknownText_0x1b61bd: ; 0x1b61bd
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "<PLAY_G>, sorry to"
@@ -968,7 +968,7 @@
UnknownText_0x1b626a: ; 0x1b626a
text "Hello? This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Oh, <PLAY_G>!"
@@ -978,7 +978,7 @@
UnknownText_0x1b6296: ; 0x1b6296
text "Hello? This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Oh, <PLAY_G>!"
@@ -988,7 +988,7 @@
UnknownText_0x1b62c5: ; 0x1b62c5
text "Hello? This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Oh, <PLAY_G>!"
@@ -999,7 +999,7 @@
text "<PLAY_G>?"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "Good morning!"
done
@@ -1008,7 +1008,7 @@
text "<PLAY_G>?"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text ". Is"
line "this a bad time?"
done
@@ -1017,7 +1017,7 @@
text "<PLAY_G>?"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "Got time to chat?"
done
@@ -1028,13 +1028,13 @@
para "I train every day"
line "with @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
done
UnknownText_0x1b638c: ; 0x1b638c
text "Hello? @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "here…"
@@ -1043,7 +1043,7 @@
UnknownText_0x1b63a8: ; 0x1b63a8
text "Hello? @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "here…"
@@ -1052,7 +1052,7 @@
UnknownText_0x1b63c4: ; 0x1b63c4
text "Hello? @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "here…"
@@ -1065,7 +1065,7 @@
para "It's your pal,"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -1075,7 +1075,7 @@
para "It's your buddy"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -1085,7 +1085,7 @@
para "It's your sidekick"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -1092,7 +1092,7 @@
UnknownText_0x1b6454: ; 0x1b6454
text "Yeah, hello."
line "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "…Huh, <PLAY_G>? Yo!"
@@ -1101,7 +1101,7 @@
UnknownText_0x1b647e: ; 0x1b647e
text "Yeah, hello, you"
line "got @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "…Huh, <PLAY_G>? Yo!"
@@ -1110,7 +1110,7 @@
UnknownText_0x1b64a8: ; 0x1b64a8
text "Yeah, hello, you"
line "got @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "…Huh, <PLAY_G>? Yo!"
@@ -1119,7 +1119,7 @@
UnknownText_0x1b64d2: ; 0x1b64d2
text "Yeah, hello?"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " calling."
para "What are you up"
@@ -1129,7 +1129,7 @@
UnknownText_0x1b6506: ; 0x1b6506
text "Yeah, hello?"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " calling."
para "Where are you now,"
@@ -1139,7 +1139,7 @@
UnknownText_0x1b6539: ; 0x1b6539
text "Yeah, hello?"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " calling."
para "Are you awake now,"
@@ -1154,7 +1154,7 @@
UnknownText_0x1b659d: ; 0x1b659d
text "Yup, it's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
para "Is this <PLAY_G>?"
@@ -1163,7 +1163,7 @@
UnknownText_0x1b65c7: ; 0x1b65c7
text "Yup, it's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
para "Is that <PLAY_G>?"
@@ -1171,7 +1171,7 @@
UnknownText_0x1b65e3: ; 0x1b65e3
text "Yup, it's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
para "Is that <PLAY_G>?"
@@ -1181,7 +1181,7 @@
UnknownText_0x1b660d: ; 0x1b660d
text "Hello! It's me,"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -1188,7 +1188,7 @@
UnknownText_0x1b6624: ; 0x1b6624
text "Hello! It's me,"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -1195,7 +1195,7 @@
UnknownText_0x1b663b: ; 0x1b663b
text "Hello! It's me,"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -1214,7 +1214,7 @@
UnknownText_0x1b66c8: ; 0x1b66c8
text "Hi, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " on the"
line "line."
@@ -1223,7 +1223,7 @@
UnknownText_0x1b66ec: ; 0x1b66ec
text "Hi, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " on the"
line "line."
@@ -1233,7 +1233,7 @@
UnknownText_0x1b6713: ; 0x1b6713
text "Hi, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " on the"
line "line."
@@ -1246,7 +1246,7 @@
para "It's me!"
line "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -1255,7 +1255,7 @@
para "It's me!"
line "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -1264,13 +1264,13 @@
para "It's me!"
line "It's me, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
UnknownText_0x1b6795: ; 0x1b6795
text "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " is"
line "so full of energy,"
@@ -1284,7 +1284,7 @@
UnknownText_0x1b67e2: ; 0x1b67e2
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Hi, <PLAY_G>!"
@@ -1294,7 +1294,7 @@
UnknownText_0x1b680e: ; 0x1b680e
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Hi, <PLAY_G>, good"
@@ -1304,7 +1304,7 @@
UnknownText_0x1b6836: ; 0x1b6836
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Hi, <PLAY_G>, good"
@@ -1316,7 +1316,7 @@
line "morning!"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "How are you?"
done
@@ -1326,7 +1326,7 @@
line "day!"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "How are you?"
done
@@ -1336,7 +1336,7 @@
line "evening!"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "How are you?"
done
@@ -1386,7 +1386,7 @@
line "morning!"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text ", how"
line "pika are you?"
done
@@ -1396,7 +1396,7 @@
line "pika day!"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text ", how"
line "pika are you?"
done
@@ -1406,7 +1406,7 @@
line "evening!"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text ". Were"
line "you pika awake?"
done
@@ -1416,7 +1416,7 @@
line "this! My lovable"
para "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " looked"
line "at me and grinned!"
@@ -1428,7 +1428,7 @@
UnknownText_0x1b6b39: ; 0x1b6b39
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Oh, Good morning,"
@@ -1438,7 +1438,7 @@
UnknownText_0x1b6b65: ; 0x1b6b65
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "That voice…"
@@ -1448,7 +1448,7 @@
UnknownText_0x1b6b92: ; 0x1b6b92
text "Hello, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "This must be"
@@ -1458,7 +1458,7 @@
UnknownText_0x1b6bb9: ; 0x1b6bb9
text "Hello!"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here…"
para "Good morning! The"
@@ -1468,7 +1468,7 @@
UnknownText_0x1b6bef: ; 0x1b6bef
text "Hello!"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here…"
para "What a perfect day"
@@ -1478,7 +1478,7 @@
UnknownText_0x1b6c23: ; 0x1b6c23
text "Hello!"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here…"
para "It's a great night"
@@ -1495,7 +1495,7 @@
UnknownText_0x1b6c96: ; 0x1b6c96
text "Yes? @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here…"
para "Ah, <PLAYER>. What"
@@ -1504,7 +1504,7 @@
UnknownText_0x1b6cc6: ; 0x1b6cc6
text "Yes? @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here…"
para "Ah, <PLAYER>. What"
@@ -1513,7 +1513,7 @@
UnknownText_0x1b6cf6: ; 0x1b6cf6
text "Yes? @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here…"
para "Ah, <PLAYER>. What"
@@ -1526,7 +1526,7 @@
para "Hey! It's me,"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
@@ -1536,7 +1536,7 @@
para "Hey, it's me,"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
@@ -1546,7 +1546,7 @@
para "Hey, it's me,"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
@@ -1564,7 +1564,7 @@
line "I'm impressed."
para "Heh, my @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
line "is so tough, it"
@@ -1576,7 +1576,7 @@
UnknownText_0x1b6e7c: ; 0x1b6e7c
text "Yes? This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Oh, <PLAY_G>."
@@ -1586,7 +1586,7 @@
UnknownText_0x1b6ea6: ; 0x1b6ea6
text "Yes? This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Oh, <PLAY_G>."
@@ -1596,7 +1596,7 @@
UnknownText_0x1b6ec9: ; 0x1b6ec9
text "Yes? This is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
para "Oh, <PLAY_G>, good"
@@ -1608,7 +1608,7 @@
para "Good morning. This"
line "is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
@@ -1616,7 +1616,7 @@
text "Is this <PLAY_G>?"
para "Hi, it's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
@@ -1625,7 +1625,7 @@
para "Good evening. This"
line "is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
@@ -1641,7 +1641,7 @@
line "too hard."
para "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " is"
line "cute and lively"
@@ -1655,7 +1655,7 @@
UnknownText_0x1b7019: ; 0x1b7019
text "Yes, hello?"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here!"
para "Morning, <PLAY_G>!"
@@ -1667,7 +1667,7 @@
UnknownText_0x1b7057: ; 0x1b7057
text "Yes, hello?"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here!"
para "Hi, <PLAY_G>!"
@@ -1679,7 +1679,7 @@
UnknownText_0x1b7092: ; 0x1b7092
text "Yes, hello?"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here!"
para "Evening, <PLAY_G>!"
@@ -1694,7 +1694,7 @@
line "<PLAY_G>!"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
line "Good morning!"
done
@@ -1703,7 +1703,7 @@
text "Hi, <PLAY_G>!"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
line "Remember me?"
done
@@ -1713,7 +1713,7 @@
line "<PLAY_G>!"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
line "Are you free now?"
done
@@ -1723,7 +1723,7 @@
line "#MON fine?"
para "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
line "looks like it will"
@@ -1737,7 +1737,7 @@
UnknownText_0x1b71d5: ; 0x1b71d5
text "Hello, you have"
line "reached @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Ah, <PLAY_G>."
@@ -1746,7 +1746,7 @@
UnknownText_0x1b71fc: ; 0x1b71fc
text "Hello, you have"
line "reached @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Ah, <PLAY_G>, is"
@@ -1756,7 +1756,7 @@
UnknownText_0x1b722a: ; 0x1b722a
text "Hello, you have"
line "reached @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Ah, if it isn't"
@@ -1765,7 +1765,7 @@
UnknownText_0x1b725c: ; 0x1b725c
text "Ah, it's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Have you got a"
@@ -1774,7 +1774,7 @@
UnknownText_0x1b7283: ; 0x1b7283
text "Ah, it's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Can you talk now?"
@@ -1782,7 +1782,7 @@
UnknownText_0x1b72a5: ; 0x1b72a5
text "Ah, it's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Sorry for calling"
@@ -1794,13 +1794,13 @@
line "grown any?"
para "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " has"
line "grown quite a bit."
done
UnknownText_0x1b730b: ; 0x1b730b
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here…"
para "<PLAYER>! Beautiful"
@@ -1808,7 +1808,7 @@
done
UnknownText_0x1b7331: ; 0x1b7331
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here…"
para "<PLAYER>! Beautiful"
@@ -1816,7 +1816,7 @@
done
UnknownText_0x1b7357: ; 0x1b7357
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " here…"
para "<PLAYER>! Beautiful"
@@ -1826,7 +1826,7 @@
UnknownText_0x1b737f: ; 0x1b737f
text "Hey, <PLAYER>!"
line "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -1833,7 +1833,7 @@
UnknownText_0x1b7397: ; 0x1b7397
text "Hey, <PLAYER>!"
line "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -1840,7 +1840,7 @@
UnknownText_0x1b73af: ; 0x1b73af
text "Hey, <PLAYER>!"
line "This is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
@@ -1847,7 +1847,7 @@
UnknownText_0x1b73c7: ; 0x1b73c7
text "Yup, yup!"
line "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
para "Hah, and here's"
@@ -1857,7 +1857,7 @@
UnknownText_0x1b73ef: ; 0x1b73ef
text "Yup, yup!"
line "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
para "Hah, and here's"
@@ -1867,7 +1867,7 @@
UnknownText_0x1b7417: ; 0x1b7417
text "Yup, yup!"
line "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
para "Hah, and here's"
@@ -1877,7 +1877,7 @@
UnknownText_0x1b743f: ; 0x1b743f
text "<PLAY_G>, it's"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
para "Have you had a"
@@ -1887,7 +1887,7 @@
UnknownText_0x1b746f: ; 0x1b746f
text "<PLAY_G>, it's"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
para "Have you had a"
@@ -1897,7 +1897,7 @@
UnknownText_0x1b749b: ; 0x1b749b
text "<PLAY_G>, it's"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
para "Have you had a"
@@ -1909,7 +1909,7 @@
line "looking good?"
para "My @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " and"
line "me--we're looking"
@@ -1920,7 +1920,7 @@
UnknownText_0x1b751a: ; 0x1b751a
text "Yes, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Oh. Hi, <PLAY_G>!"
@@ -1930,7 +1930,7 @@
UnknownText_0x1b7548: ; 0x1b7548
text "Yes, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Oh, hi, <PLAY_G>!"
@@ -1940,7 +1940,7 @@
UnknownText_0x1b756f: ; 0x1b756f
text "Yes, this is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
para "Oh, hi, <PLAY_G>!"
@@ -1950,7 +1950,7 @@
text "<PLAY_G>!"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
line "Good morning!"
done
@@ -1959,7 +1959,7 @@
text "<PLAY_G>!"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
line "Working hard?"
done
@@ -1968,7 +1968,7 @@
text "<PLAY_G>!"
para "It's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
line "Were you up?"
done
@@ -1978,10 +1978,10 @@
line "your #MON?"
para "Hey, @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "'s"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text " is"
cont "looking good!"
done
--- a/data/special_pointers.asm
+++ b/data/special_pointers.asm
@@ -1,5 +1,5 @@
; Special routines can be used with the "special" map script command.
-; They often use ScriptVar for arguments and return values.
+; They often use wScriptVar for arguments and return values.
add_special: MACRO
\1Special::
--- a/data/std_text.asm
+++ b/data/std_text.asm
@@ -231,11 +231,11 @@
ContestResults_PlayerWonAPrizeText:
text "<PLAYER>, the No.@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "finisher, wins"
cont "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "!"
done
@@ -242,7 +242,7 @@
ReceivedItemText:
text "<PLAYER> received"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
done
@@ -279,7 +279,7 @@
done
GymStatue_CityGymText:
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "#MON GYM"
done
@@ -286,7 +286,7 @@
GymStatue_WinningTrainersText:
text "LEADER: @"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text_start
para "WINNING TRAINERS:"
line "<PLAYER>"
@@ -376,7 +376,7 @@
RegisteredNumber1Text:
text "<PLAYER> registered"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "'s number."
done
@@ -383,6 +383,6 @@
RegisteredNumber2Text:
text "<PLAYER> registered"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "'s number."
done
--- a/data/text_buffers.asm
+++ b/data/text_buffers.asm
@@ -1,9 +1,9 @@
StringBufferPointers:: ; 24000
; entries correspond to arguments for text_buffer (TX_STRINGBUFFER)
- dw StringBuffer3 ; 0
- dw StringBuffer4 ; 1
- dw StringBuffer5 ; 2
- dw StringBuffer2 ; 3
- dw StringBuffer1 ; 4
- dw EnemyMonNick ; 5
- dw BattleMonNick ; 6
+ dw wStringBuffer3 ; 0
+ dw wStringBuffer4 ; 1
+ dw wStringBuffer5 ; 2
+ dw wStringBuffer2 ; 3
+ dw wStringBuffer1 ; 4
+ dw wEnemyMonNick ; 5
+ dw wBattleMonNick ; 6
--- a/data/trainers/palettes.asm
+++ b/data/trainers/palettes.asm
@@ -1,7 +1,7 @@
TrainerPalettes: ; b0ce
; entries correspond to trainer classes
-PlayerPalette: ; Chris uses the same colors as Cal
+wPlayerPalette: ; Chris uses the same colors as Cal
INCLUDE "gfx/trainers/cal.pal"
KrisPalette: ; Kris shares Falkner's palette
INCLUDE "gfx/trainers/falkner.pal"
--- a/data/unused/gen_1_trainer_names.asm
+++ b/data/unused/gen_1_trainer_names.asm
@@ -3,50 +3,50 @@
dw .Youngster
dw .BugCatcher
dw .Lass
- dw OTClassName ; sailor
+ dw wOTClassName ; sailor
dw .JrTrainerM
dw .JrTrainerF
dw .Pokemaniac
dw .SuperNerd
- dw OTClassName ; hiker
- dw OTClassName ; biker
+ dw wOTClassName ; hiker
+ dw wOTClassName ; biker
dw .Burglar
dw .Engineer
dw .Jack
- dw OTClassName ; fisher
+ dw wOTClassName ; fisher
dw .Swimmer
- dw OTClassName ; cue ball
- dw OTClassName ; gambler
+ dw wOTClassName ; cue ball
+ dw wOTClassName ; gambler
dw .Beauty
- dw OTClassName ; psychic
+ dw wOTClassName ; psychic
dw .Rocker
dw .Juggler
- dw OTClassName ; tamer
- dw OTClassName ; bird keeper
+ dw wOTClassName ; tamer
+ dw wOTClassName ; bird keeper
dw .Blackbelt
- dw OTClassName ; rival1
+ dw wOTClassName ; rival1
dw .ProfOak
dw .Chief
dw .Scientist
- dw OTClassName ; giovanni
+ dw wOTClassName ; giovanni
dw .Rocket
dw .CooltrainerM
dw .CooltrainerF
- dw OTClassName ; bruno
- dw OTClassName ; brock
- dw OTClassName ; misty
- dw OTClassName ; lt.surge
- dw OTClassName ; erika
- dw OTClassName ; koga
- dw OTClassName ; blaine
- dw OTClassName ; sabrina
- dw OTClassName ; gentleman
- dw OTClassName ; rival2
- dw OTClassName ; rival3
- dw OTClassName ; lorelei
- dw OTClassName ; channeler
- dw OTClassName ; agatha
- dw OTClassName ; lance
+ dw wOTClassName ; bruno
+ dw wOTClassName ; brock
+ dw wOTClassName ; misty
+ dw wOTClassName ; lt.surge
+ dw wOTClassName ; erika
+ dw wOTClassName ; koga
+ dw wOTClassName ; blaine
+ dw wOTClassName ; sabrina
+ dw wOTClassName ; gentleman
+ dw wOTClassName ; rival2
+ dw wOTClassName ; rival3
+ dw wOTClassName ; lorelei
+ dw wOTClassName ; channeler
+ dw wOTClassName ; agatha
+ dw wOTClassName ; lance
.Youngster: db "たんパン@"
.BugCatcher: db "むしとり@"
--- a/engine/battle/ai/items.asm
+++ b/engine/battle/ai/items.asm
@@ -12,7 +12,7 @@
farcall CheckEnemyLockedIn
ret nz
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_CANT_RUN, a
jr nz, DontSwitch
@@ -21,11 +21,11 @@
jr nz, DontSwitch
ld hl, TrainerClassAttributes + TRNATTR_AI_ITEM_SWITCH
- ld a, [InBattleTowerBattle] ; Load always the first TrainerClass for BattleTower-Trainers
+ ld a, [wInBattleTowerBattle] ; always load the first trainer class in wTrainerClass for BattleTower-Trainers
and a
jr nz, .ok
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
dec a
ld bc, NUM_TRAINER_ATTRIBUTES
call AddNTimes
@@ -151,7 +151,7 @@
CheckSubstatusCantRun: ; 380ff
- ld a, [EnemySubStatus5]
+ ld a, [wEnemySubStatus5]
bit SUBSTATUS_CANT_RUN, a
ret
; 38105
@@ -159,7 +159,7 @@
AI_TryItem: ; 38105
; items are not allowed in the BattleTower
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
and a
ret nz
@@ -172,7 +172,7 @@
call .IsHighestLevel
ret nc
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
dec a
ld hl, TrainerClassAttributes + TRNATTR_AI_ITEM_SWITCH
ld bc, NUM_TRAINER_ATTRIBUTES
@@ -226,19 +226,19 @@
inc a
ld [wEnemyGoesFirst], a
- ld hl, EnemySubStatus3
+ ld hl, wEnemySubStatus3
res SUBSTATUS_BIDE, [hl]
xor a
- ld [EnemyFuryCutterCount], a
- ld [EnemyProtectCount], a
+ ld [wEnemyFuryCutterCount], a
+ ld [wEnemyProtectCount], a
ld [wEnemyRageCounter], a
- ld hl, EnemySubStatus4
+ ld hl, wEnemySubStatus4
res SUBSTATUS_RAGE, [hl]
xor a
- ld [LastEnemyCounterMove], a
+ ld [wLastEnemyCounterMove], a
scf
ret
@@ -245,10 +245,10 @@
.IsHighestLevel: ; 38170
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
ld d, a
ld e, 0
- ld hl, OTPartyMon1Level
+ ld hl, wOTPartyMon1Level
ld bc, PARTYMON_STRUCT_LENGTH
.next
ld a, [hl]
@@ -260,8 +260,8 @@
dec d
jr nz, .next
- ld a, [CurOTMon]
- ld hl, OTPartyMon1Level
+ ld a, [wCurOTMon]
+ ld hl, wOTPartyMon1Level
call AddNTimes
ld a, [hl]
cp e
@@ -302,7 +302,7 @@
; 381ca
.Status: ; 381ca (e:41ca)
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
and a
jp z, .DontUse
@@ -318,10 +318,10 @@
jp .DontUse
.StatusCheckContext:
- ld a, [EnemySubStatus5]
+ ld a, [wEnemySubStatus5]
bit SUBSTATUS_TOXIC, a
jr z, .FailToxicCheck
- ld a, [EnemyToxicCount]
+ ld a, [wEnemyToxicCount]
cp 4
jr c, .FailToxicCheck
call Random
@@ -328,7 +328,7 @@
cp 1 + 50 percent
jp c, .Use
.FailToxicCheck:
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
and 1 << FRZ | SLP
jp z, .DontUse
jp .Use
@@ -419,8 +419,8 @@
callfar AICheckEnemyMaxHP
jr c, .dont_use
push bc
- ld de, EnemyMonMaxHP + 1
- ld hl, EnemyMonHP + 1
+ ld de, wEnemyMonMaxHP + 1
+ ld hl, wEnemyMonHP + 1
ld a, [de]
sub [hl]
jr z, .check_40_percent
@@ -509,7 +509,7 @@
; 3834d
.XItem: ; 3834d (e:434d)
- ld a, [EnemyTurnsTaken]
+ ld a, [wEnemyTurnsTaken]
and a
jr nz, .notfirstturnout
ld a, [bc]
@@ -571,21 +571,21 @@
EnemyUsedMaxPotion: ; 383ae (e:43ae)
ld a, MAX_POTION
- ld [CurEnemyItem], a
+ ld [wCurEnemyItem], a
jr FullRestoreContinue
EnemyUsedFullRestore: ; 383b5 (e:43b5)
call AI_HealStatus
ld a, FULL_RESTORE
- ld [CurEnemyItem], a
- ld hl, EnemySubStatus3
+ ld [wCurEnemyItem], a
+ ld hl, wEnemySubStatus3
res SUBSTATUS_CONFUSED, [hl]
xor a
- ld [EnemyConfuseCount], a
+ ld [wEnemyConfuseCount], a
FullRestoreContinue: ; 383c6
ld de, wCurHPAnimOldHP
- ld hl, EnemyMonHP + 1
+ ld hl, wEnemyMonHP + 1
ld a, [hld]
ld [de], a
inc de
@@ -592,16 +592,16 @@
ld a, [hl]
ld [de], a
inc de
- ld hl, EnemyMonMaxHP + 1
+ ld hl, wEnemyMonMaxHP + 1
ld a, [hld]
ld [de], a
inc de
ld [wCurHPAnimMaxHP], a
- ld [EnemyMonHP + 1], a
+ ld [wEnemyMonHP + 1], a
ld a, [hl]
ld [de], a
ld [wCurHPAnimMaxHP + 1], a
- ld [EnemyMonHP], a
+ ld [wEnemyMonHP], a
jr EnemyPotionFinish
; 383e8 (e:43e8)
@@ -620,8 +620,8 @@
ld b, 200
EnemyPotionContinue: ; 383f8
- ld [CurEnemyItem], a
- ld hl, EnemyMonHP + 1
+ ld [wCurEnemyItem], a
+ ld hl, wEnemyMonHP + 1
ld a, [hl]
ld [wCurHPAnimOldHP], a
add b
@@ -638,7 +638,7 @@
inc hl
ld a, [hld]
ld b, a
- ld de, EnemyMonMaxHP + 1
+ ld de, wEnemyMonMaxHP + 1
ld a, [de]
dec de
ld [wCurHPAnimMaxHP], a
@@ -671,9 +671,9 @@
AI_TrySwitch: ; 3844b
; Determine whether the AI can switch based on how many Pokemon are still alive.
; If it can switch, it will.
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
ld c, a
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
ld d, 0
.SwitchLoop:
ld a, [hli]
@@ -701,7 +701,7 @@
ld a, $1
ld [wEnemyIsSwitching], a
ld [wEnemyGoesFirst], a
- ld hl, EnemySubStatus4
+ ld hl, wEnemySubStatus4
res SUBSTATUS_RAGE, [hl]
xor a
ld [hBattleTurn], a
@@ -708,13 +708,13 @@
callfar PursuitSwitch
push af
- ld a, [CurOTMon]
- ld hl, OTPartyMon1Status
+ ld a, [wCurOTMon]
+ ld hl, wOTPartyMon1Status
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
ld e, l
- ld hl, EnemyMonStatus
+ ld hl, wEnemyMonStatus
ld bc, MON_MAXHP - MON_STATUS
call CopyBytes
pop af
@@ -728,7 +728,7 @@
ld [wBattleHasJustStarted], a
callfar NewEnemyMonStatus
callfar ResetEnemyStatLevels
- ld hl, PlayerSubStatus1
+ ld hl, wPlayerSubStatus1
res SUBSTATUS_IN_LOVE, [hl]
farcall EnemySwitch
farcall ResetBattleParticipants
@@ -754,18 +754,18 @@
; 384e0
AI_HealStatus: ; 384e0
- ld a, [CurOTMon]
- ld hl, OTPartyMon1Status
+ ld a, [wCurOTMon]
+ ld hl, wOTPartyMon1Status
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
xor a
ld [hl], a
- ld [EnemyMonStatus], a
+ ld [wEnemyMonStatus], a
; Bug: this should reset SUBSTATUS_NIGHTMARE too
; Uncomment the lines below to fix
- ; ld hl, EnemySubStatus1
+ ; ld hl, wEnemySubStatus1
; res SUBSTATUS_NIGHTMARE, [hl]
- ld hl, EnemySubStatus5
+ ld hl, wEnemySubStatus5
res SUBSTATUS_TOXIC, [hl]
ret
; 384f7
@@ -772,7 +772,7 @@
EnemyUsedXAccuracy: ; 384f7
call AIUsedItemSound
- ld hl, EnemySubStatus4
+ ld hl, wEnemySubStatus4
set SUBSTATUS_X_ACCURACY, [hl]
ld a, X_ACCURACY
jp PrintText_UsedItemOn_AND_AIUpdateHUD
@@ -780,7 +780,7 @@
EnemyUsedGuardSpec: ; 38504
call AIUsedItemSound
- ld hl, EnemySubStatus4
+ ld hl, wEnemySubStatus4
set SUBSTATUS_MIST, [hl]
ld a, GUARD_SPEC
jp PrintText_UsedItemOn_AND_AIUpdateHUD
@@ -788,7 +788,7 @@
EnemyUsedDireHit: ; 38511
call AIUsedItemSound
- ld hl, EnemySubStatus4
+ ld hl, wEnemySubStatus4
set SUBSTATUS_FOCUS_ENERGY, [hl]
ld a, DIRE_HIT
jp PrintText_UsedItemOn_AND_AIUpdateHUD
@@ -796,7 +796,7 @@
Function3851e: ; This appears to be unused
ld [hDivisor], a
- ld hl, EnemyMonMaxHP
+ ld hl, wEnemyMonMaxHP
ld a, [hli]
ld [hDividend], a
ld a, [hl]
@@ -807,7 +807,7 @@
ld c, a
ld a, [hQuotient + 1]
ld b, a
- ld hl, EnemyMonHP + 1
+ ld hl, wEnemyMonHP + 1
ld a, [hld]
ld e, a
ld a, [hl]
@@ -847,7 +847,7 @@
; a = ITEM_CONSTANT
; b = BATTLE_CONSTANT (ATTACK, DEFENSE, SPEED, SP_ATTACK, SP_DEFENSE, ACCURACY, EVASION)
EnemyUsedXItem:
- ld [CurEnemyItem], a
+ ld [wCurEnemyItem], a
push bc
call PrintText_UsedItemOn
pop bc
@@ -859,16 +859,16 @@
; Parameter
; a = ITEM_CONSTANT
PrintText_UsedItemOn_AND_AIUpdateHUD: ; 38568
- ld [CurEnemyItem], a
+ ld [wCurEnemyItem], a
call PrintText_UsedItemOn
jp AIUpdateHUD
; 38571
PrintText_UsedItemOn: ; 38571
- ld a, [CurEnemyItem]
+ ld a, [wCurEnemyItem]
ld [wd265], a
call GetItemName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wMonOrItemNameBuffer
ld bc, ITEM_NAME_LENGTH
call CopyBytes
--- a/engine/battle/ai/move.asm
+++ b/engine/battle/ai/move.asm
@@ -1,5 +1,5 @@
AIChooseMove: ; 440ce
-; Score each move in EnemyMonMoves starting from Buffer1. Lower is better.
+; Score each move in wEnemyMonMoves starting from wBuffer1. Lower is better.
; Pick the move with the lowest score.
; Wildmons attack at random.
@@ -18,7 +18,7 @@
; The default score is 20. Unusable moves are given a score of 80.
ld a, 20
- ld hl, Buffer1
+ ld hl, wBuffer1
ld [hli], a
ld [hli], a
ld [hli], a
@@ -25,11 +25,11 @@
ld [hl], a
; Don't pick disabled moves.
- ld a, [EnemyDisabledMove]
+ ld a, [wEnemyDisabledMove]
and a
jr z, .CheckPP
- ld hl, EnemyMonMoves
+ ld hl, wEnemyMonMoves
ld c, 0
.CheckDisabledMove:
cp [hl]
@@ -38,7 +38,7 @@
inc hl
jr .CheckDisabledMove
.ScoreDisabledMove:
- ld hl, Buffer1
+ ld hl, wBuffer1
ld b, 0
add hl, bc
ld [hl], 80
@@ -45,13 +45,13 @@
; Don't pick moves with 0 PP.
.CheckPP:
- ld hl, Buffer1 - 1
- ld de, EnemyMonPP
+ ld hl, wBuffer1 - 1
+ ld de, wEnemyMonPP
ld b, 0
.CheckMovePP:
inc b
ld a, b
- cp EnemyMonMovesEnd - EnemyMonMoves + 1
+ cp wEnemyMonMovesEnd - wEnemyMonMoves + 1
jr z, .ApplyLayers
inc hl
ld a, [de]
@@ -66,13 +66,13 @@
.ApplyLayers:
ld hl, TrainerClassAttributes + TRNATTR_AI_MOVE_WEIGHTS
- ; If we have a battle in BattleTower just load the Attributes of the first TrainerClass (Falkner)
+ ; If we have a battle in BattleTower just load the Attributes of the first trainer class in wTrainerClass (Falkner)
; so we have always the same AI, regardless of the loaded class of trainer
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
bit 0, a
jr nz, .battle_tower_skip
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
dec a
ld bc, 7 ; Trainer2AI - Trainer1AI
call AddNTimes
@@ -119,9 +119,9 @@
; Decrement the scores of all moves one by one until one reaches 0.
.DecrementScores:
- ld hl, Buffer1
- ld de, EnemyMonMoves
- ld c, EnemyMonMovesEnd - EnemyMonMoves
+ ld hl, wBuffer1
+ ld de, wEnemyMonMoves
+ ld c, wEnemyMonMovesEnd - wEnemyMonMoves
.DecrementNextScore:
; If the enemy has no moves, this will infinite.
@@ -154,8 +154,8 @@
cp NUM_MOVES + 1
jr nz, .move_loop
- ld hl, Buffer1
- ld de, EnemyMonMoves
+ ld hl, wBuffer1
+ ld de, wEnemyMonMoves
ld c, NUM_MOVES
; Give a score of 0 to a blank move
@@ -184,7 +184,7 @@
; Randomly choose one of the moves with a score of 1
.ChooseMove:
- ld hl, Buffer1
+ ld hl, wBuffer1
call Random
maskbits NUM_MOVES
ld c, a
@@ -194,9 +194,9 @@
and a
jr z, .ChooseMove
- ld [CurEnemyMove], a
+ ld [wCurEnemyMove], a
ld a, c
- ld [CurEnemyMoveNum], a
+ ld [wCurEnemyMoveNum], a
ret
; 441af
--- a/engine/battle/ai/redundant.asm
+++ b/engine/battle/ai/redundant.asm
@@ -47,95 +47,95 @@
db -1
.LightScreen: ; 2c487
- ld a, [EnemyScreens]
+ ld a, [wEnemyScreens]
bit SCREENS_LIGHT_SCREEN, a
ret
.Mist: ; 2c48d
- ld a, [EnemySubStatus4]
+ ld a, [wEnemySubStatus4]
bit SUBSTATUS_MIST, a
ret
.FocusEnergy: ; 2c493
- ld a, [EnemySubStatus4]
+ ld a, [wEnemySubStatus4]
bit SUBSTATUS_FOCUS_ENERGY, a
ret
.Confuse: ; 2c499
- ld a, [PlayerSubStatus3]
+ ld a, [wPlayerSubStatus3]
bit SUBSTATUS_CONFUSED, a
ret nz
- ld a, [PlayerScreens]
+ ld a, [wPlayerScreens]
bit SCREENS_SAFEGUARD, a
ret
.Transform: ; 2c4a5
- ld a, [EnemySubStatus5]
+ ld a, [wEnemySubStatus5]
bit SUBSTATUS_TRANSFORMED, a
ret
.Reflect: ; 2c4ab
- ld a, [EnemyScreens]
+ ld a, [wEnemyScreens]
bit SCREENS_REFLECT, a
ret
.Substitute: ; 2c4b1
- ld a, [EnemySubStatus4]
+ ld a, [wEnemySubStatus4]
bit SUBSTATUS_SUBSTITUTE, a
ret
.LeechSeed: ; 2c4b7
- ld a, [PlayerSubStatus4]
+ ld a, [wPlayerSubStatus4]
bit SUBSTATUS_LEECH_SEED, a
ret
.Disable: ; 2c4bd
- ld a, [PlayerDisableCount]
+ ld a, [wPlayerDisableCount]
and a
ret
.Encore: ; 2c4c2
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_ENCORED, a
ret
.Snore:
.SleepTalk: ; 2c4c8
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
and SLP
jr z, .Redundant
jr .NotRedundant
.MeanLook: ; 2c4d1
- ld a, [EnemySubStatus5]
+ ld a, [wEnemySubStatus5]
bit SUBSTATUS_CANT_RUN, a
ret
.Nightmare: ; 2c4d7
- ld a, [BattleMonStatus]
+ ld a, [wBattleMonStatus]
and a
jr z, .Redundant
- ld a, [PlayerSubStatus1]
+ ld a, [wPlayerSubStatus1]
bit SUBSTATUS_NIGHTMARE, a
ret
.Spikes: ; 2c4e3
- ld a, [PlayerScreens]
+ ld a, [wPlayerScreens]
bit SCREENS_SPIKES, a
ret
.Foresight: ; 2c4e9
- ld a, [PlayerSubStatus1]
+ ld a, [wPlayerSubStatus1]
bit SUBSTATUS_IDENTIFIED, a
ret
.PerishSong: ; 2c4ef
- ld a, [PlayerSubStatus1]
+ ld a, [wPlayerSubStatus1]
bit SUBSTATUS_PERISH, a
ret
.Sandstorm: ; 2c4f5
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_SANDSTORM
jr z, .Redundant
jr .NotRedundant
@@ -143,40 +143,40 @@
.Attract: ; 2c4fe
farcall CheckOppositeGender
jr c, .Redundant
- ld a, [PlayerSubStatus1]
+ ld a, [wPlayerSubStatus1]
bit SUBSTATUS_IN_LOVE, a
ret
.Safeguard: ; 2c50c
- ld a, [EnemyScreens]
+ ld a, [wEnemyScreens]
bit SCREENS_SAFEGUARD, a
ret
.RainDance: ; 2c512
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_RAIN
jr z, .Redundant
jr .NotRedundant
.SunnyDay: ; 2c51b
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_SUN
jr z, .Redundant
jr .NotRedundant
.DreamEater: ; 2c524
- ld a, [BattleMonStatus]
+ ld a, [wBattleMonStatus]
and SLP
jr z, .Redundant
jr .NotRedundant
.Swagger: ; 2c52d
- ld a, [PlayerSubStatus3]
+ ld a, [wPlayerSubStatus3]
bit SUBSTATUS_CONFUSED, a
ret
.FutureSight: ; 2c533
- ld a, [EnemyScreens]
+ ld a, [wEnemyScreens]
bit 5, a
ret
--- a/engine/battle/ai/scoring.asm
+++ b/engine/battle/ai/scoring.asm
@@ -5,9 +5,9 @@
; -Using status-only moves if the player can't be statused
; -Using moves that fail if they've already been used
- ld hl, Buffer1 - 1
- ld de, EnemyMonMoves
- ld b, EnemyMonMovesEnd - EnemyMonMoves + 1
+ ld hl, wBuffer1 - 1
+ ld de, wEnemyMonMoves
+ ld b, wEnemyMonMovesEnd - wEnemyMonMoves + 1
.checkmove
dec b
ret z
@@ -49,12 +49,12 @@
pop hl
jr nc, .checkmove
- ld a, [BattleMonStatus]
+ ld a, [wBattleMonStatus]
and a
jr nz, .discourage
; Dismiss Safeguard if it's already active.
- ld a, [PlayerScreens]
+ ld a, [wPlayerScreens]
bit SCREENS_SAFEGUARD, a
jr z, .checkmove
@@ -80,9 +80,9 @@
; 50% chance to greatly encourage stat-down moves during the first turn of player's Pokemon.
; Almost 90% chance to greatly discourage stat-modifying moves otherwise.
- ld hl, Buffer1 - 1
- ld de, EnemyMonMoves
- ld b, EnemyMonMovesEnd - EnemyMonMoves + 1
+ ld hl, wBuffer1 - 1
+ ld de, wEnemyMonMoves
+ ld b, wEnemyMonMovesEnd - wEnemyMonMoves + 1
.checkmove
dec b
ret z
@@ -120,7 +120,7 @@
jr .checkmove
.statup
- ld a, [EnemyTurnsTaken]
+ ld a, [wEnemyTurnsTaken]
and a
jr nz, .discourage
@@ -127,7 +127,7 @@
jr .encourage
.statdown
- ld a, [PlayerTurnsTaken]
+ ld a, [wPlayerTurnsTaken]
and a
jr nz, .discourage
@@ -156,9 +156,9 @@
; Discourage not very effective moves unless
; all damaging moves are of the same type.
- ld hl, Buffer1 - 1
- ld de, EnemyMonMoves
- ld b, EnemyMonMovesEnd - EnemyMonMoves + 1
+ ld hl, wBuffer1 - 1
+ ld de, wEnemyMonMoves
+ ld b, wEnemyMonMovesEnd - wEnemyMonMoves + 1
.checkmove
dec b
ret z
@@ -203,8 +203,8 @@
push bc
ld a, [wEnemyMoveStruct + MOVE_TYPE]
ld d, a
- ld hl, EnemyMonMoves
- ld b, EnemyMonMovesEnd - EnemyMonMoves + 1
+ ld hl, wEnemyMonMoves
+ ld b, wEnemyMonMovesEnd - wEnemyMonMoves + 1
ld c, 0
.checkmove2
dec b
@@ -245,9 +245,9 @@
AI_Offensive: ; 386a2
; Greatly discourage non-damaging moves.
- ld hl, Buffer1 - 1
- ld de, EnemyMonMoves
- ld b, EnemyMonMovesEnd - EnemyMonMoves + 1
+ ld hl, wBuffer1 - 1
+ ld de, wEnemyMonMoves
+ ld b, wEnemyMonMovesEnd - wEnemyMonMoves + 1
.checkmove
dec b
ret z
@@ -274,9 +274,9 @@
AI_Smart: ; 386be
; Context-specific scoring.
- ld hl, Buffer1
- ld de, EnemyMonMoves
- ld b, EnemyMonMovesEnd - EnemyMonMoves + 1
+ ld hl, wBuffer1
+ ld de, wEnemyMonMoves
+ ld b, wEnemyMonMovesEnd - wEnemyMonMoves + 1
.checkmove
dec b
ret z
@@ -462,7 +462,7 @@
AI_Smart_LockOn: ; 3881d
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_LOCK_ON, a
jr nz, .asm_38882
@@ -477,20 +477,20 @@
jr nc, .asm_38877
.asm_38834
- ld a, [PlayerEvaLevel]
+ ld a, [wPlayerEvaLevel]
cp $a
jr nc, .asm_3887a
cp $8
jr nc, .asm_38875
- ld a, [EnemyAccLevel]
+ ld a, [wEnemyAccLevel]
cp $5
jr c, .asm_3887a
cp $7
jr c, .asm_38875
- ld hl, EnemyMonMoves
- ld c, EnemyMonMovesEnd - EnemyMonMoves + 1
+ ld hl, wEnemyMonMoves
+ ld c, wEnemyMonMovesEnd - wEnemyMonMoves + 1
.asm_3884f
dec c
jr z, .asm_38877
@@ -537,9 +537,9 @@
.asm_38882
push hl
- ld hl, Buffer1 - 1
- ld de, EnemyMonMoves
- ld c, EnemyMonMovesEnd - EnemyMonMoves + 1
+ ld hl, wBuffer1 - 1
+ ld de, wEnemyMonMoves
+ ld c, wEnemyMonMovesEnd - wEnemyMonMoves + 1
.asm_3888b
inc hl
@@ -622,7 +622,7 @@
AI_Smart_EvasionUp: ; 388d4
; Dismiss this move if enemy's evasion can't raise anymore.
- ld a, [EnemyEvaLevel]
+ ld a, [wEnemyEvaLevel]
cp $d
jp nc, AIDiscourageMove
@@ -631,7 +631,7 @@
jr nc, .asm_388f2
; ...greatly encourage this move if player is badly poisoned.
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_TOXIC, a
jr nz, .asm_388ef
@@ -680,27 +680,27 @@
; 100% chance to end up here if enemy's HP is below 25%.
; In other words, we only end up here if the move has not been encouraged or dismissed.
.asm_38911
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_TOXIC, a
jr nz, .asm_38938
- ld a, [PlayerSubStatus4]
+ ld a, [wPlayerSubStatus4]
bit SUBSTATUS_LEECH_SEED, a
jr nz, .asm_38941
; Discourage this move if enemy's evasion level is higher than player's accuracy level.
- ld a, [EnemyEvaLevel]
+ ld a, [wEnemyEvaLevel]
ld b, a
- ld a, [PlayerAccLevel]
+ ld a, [wPlayerAccLevel]
cp b
jr c, .asm_38936
; Greatly encourage this move if the player is in the middle of Fury Cutter or Rollout.
- ld a, [PlayerFuryCutterCount]
+ ld a, [wPlayerFuryCutterCount]
and a
jr nz, .asm_388ef
- ld a, [PlayerSubStatus1]
+ ld a, [wPlayerSubStatus1]
bit SUBSTATUS_ROLLOUT, a
jr nz, .asm_388ef
@@ -736,12 +736,12 @@
; 80% chance to greatly encourage this move if either...
; ...enemy's accuracy level has been lowered three or more stages
- ld a, [EnemyAccLevel]
+ ld a, [wEnemyAccLevel]
cp $5
jr c, .asm_38954
; ...or player's evasion level has been raised three or more stages.
- ld a, [PlayerEvaLevel]
+ ld a, [wPlayerEvaLevel]
cp $a
ret c
@@ -758,7 +758,7 @@
AI_Smart_MirrorMove: ; 3895b
; If the player did not use any move last turn...
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
and a
jr nz, .asm_38968
@@ -810,7 +810,7 @@
jr nc, .asm_389a0
; ...greatly encourage this move if player is badly poisoned.
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_TOXIC, a
jr nz, .asm_3899d
@@ -855,27 +855,27 @@
; We only end up here if the move has not been already encouraged.
.asm_389bf
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_TOXIC, a
jr nz, .asm_389e6
- ld a, [PlayerSubStatus4]
+ ld a, [wPlayerSubStatus4]
bit SUBSTATUS_LEECH_SEED, a
jr nz, .asm_389ef
; Discourage this move if enemy's evasion level is higher than player's accuracy level.
- ld a, [EnemyEvaLevel]
+ ld a, [wEnemyEvaLevel]
ld b, a
- ld a, [PlayerAccLevel]
+ ld a, [wPlayerAccLevel]
cp b
jr c, .asm_389e4
; Greatly encourage this move if the player is in the middle of Fury Cutter or Rollout.
- ld a, [PlayerFuryCutterCount]
+ ld a, [wPlayerFuryCutterCount]
and a
jr nz, .asm_3899d
- ld a, [PlayerSubStatus1]
+ ld a, [wPlayerSubStatus1]
bit SUBSTATUS_ROLLOUT, a
jr nz, .asm_3899d
@@ -910,7 +910,7 @@
; 85% chance to encourage this move if any of enemy's stat levels is lower than -2.
push hl
- ld hl, EnemyAtkLevel
+ ld hl, wEnemyAtkLevel
ld c, $8
.asm_389fb
dec c
@@ -922,7 +922,7 @@
; 85% chance to encourage this move if any of player's stat levels is higher than +2.
.asm_38a05
- ld hl, PlayerAtkLevel
+ ld hl, wPlayerAtkLevel
ld c, $8
.asm_38a0a
dec c
@@ -1034,9 +1034,9 @@
; Dismiss this move if player's level is higher than enemy's level.
; Else, discourage this move is player's HP is below 50%.
- ld a, [BattleMonLevel]
+ ld a, [wBattleMonLevel]
ld b, a
- ld a, [EnemyMonLevel]
+ ld a, [wEnemyMonLevel]
cp b
jp c, AIDiscourageMove
call AICheckPlayerHalfHP
@@ -1056,16 +1056,16 @@
; 50% chance to greatly encourage this move if player is either
; badly poisoned, in love, identified, stuck in Rollout, or has a Nightmare.
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_TOXIC, a
jr nz, .asm_38a91
- ld a, [PlayerSubStatus1]
+ ld a, [wPlayerSubStatus1]
and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ROLLOUT | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
jr nz, .asm_38a91
; Else, 50% chance to greatly encourage this move if it's the player's Pokemon first turn.
- ld a, [PlayerTurnsTaken]
+ ld a, [wPlayerTurnsTaken]
and a
jr z, .asm_38a91
@@ -1089,17 +1089,17 @@
AI_Smart_RazorWind:
AI_Smart_Unused2B: ; 38a9c
- ld a, [EnemySubStatus1]
+ ld a, [wEnemySubStatus1]
bit SUBSTATUS_PERISH, a
jr z, .asm_38aaa
- ld a, [EnemyPerishCount]
+ ld a, [wEnemyPerishCount]
cp 3
jr c, .asm_38ad3
.asm_38aaa
push hl
- ld hl, PlayerUsedMoves
+ ld hl, wPlayerUsedMoves
ld c, 4
.asm_38ab0
@@ -1117,7 +1117,7 @@
.asm_38ac1
pop hl
- ld a, [EnemySubStatus3]
+ ld a, [wEnemySubStatus3]
bit SUBSTATUS_CONFUSED, a
jr nz, .asm_38acd
@@ -1168,7 +1168,7 @@
jr nc, .asm_38b10
; Discourage this move if enemy's special defense level is higher than +3.
- ld a, [EnemySDefLevel]
+ ld a, [wEnemySDefLevel]
cp $b
jr nc, .asm_38b10
@@ -1177,10 +1177,10 @@
cp $9
ret nc
- ld a, [BattleMonType1]
+ ld a, [wBattleMonType1]
cp SPECIAL
jr nc, .asm_38b09
- ld a, [BattleMonType2]
+ ld a, [wBattleMonType2]
cp SPECIAL
ret c
@@ -1203,7 +1203,7 @@
; Greatly encourage this move if the player is
; flying or underground, and slower than the enemy.
- ld a, [PlayerSubStatus3]
+ ld a, [wPlayerSubStatus3]
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret z
@@ -1266,7 +1266,7 @@
ret nz
call AICheckEnemyQuarterHP
ret nc
- ld a, [PlayerTurnsTaken]
+ ld a, [wPlayerTurnsTaken]
and a
ret nz
call AICompareSpeed
@@ -1315,7 +1315,7 @@
AI_Smart_Rage: ; 38b7f
- ld a, [EnemySubStatus4]
+ ld a, [wEnemySubStatus4]
bit SUBSTATUS_RAGE, a
jr z, .asm_38b9b
@@ -1355,7 +1355,7 @@
AI_Smart_Mimic: ; 38ba8
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
and a
jr z, .asm_38be9
@@ -1363,7 +1363,7 @@
jr nc, .asm_38bef
push hl
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
call AIGetEnemyMove
ld a, $1
@@ -1382,7 +1382,7 @@
dec [hl]
.asm_38bd4
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
push hl
ld hl, UsefulMoves
ld de, 1
@@ -1407,7 +1407,7 @@
AI_Smart_Counter: ; 38bf1
push hl
- ld hl, PlayerUsedMoves
+ ld hl, wPlayerUsedMoves
ld c, 4
ld b, 0
@@ -1440,7 +1440,7 @@
cp $3
jr nc, .asm_38c30
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
and a
jr z, .asm_38c38
@@ -1475,7 +1475,7 @@
call AICompareSpeed
jr nc, .asm_38c81
- ld a, [LastPlayerMove]
+ ld a, [wLastPlayerMove]
and a
jp z, AIDiscourageMove
@@ -1487,7 +1487,7 @@
push hl
ld a, [wEnemyMoveStruct + MOVE_TYPE]
- ld hl, EnemyMonType1
+ ld hl, wEnemyMonType1
predef CheckTypeMatchup
pop hl
@@ -1501,7 +1501,7 @@
.asm_38c68
push hl
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
ld hl, .EncoreMoves
ld de, 1
call IsInArray
@@ -1561,13 +1561,13 @@
; Discourage this move if [enemy's current HP * 2 > player's current HP].
push hl
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld b, [hl]
inc hl
ld c, [hl]
sla c
rl b
- ld hl, BattleMonHP + 1
+ ld hl, wBattleMonHP + 1
ld a, [hld]
cp c
ld a, [hl]
@@ -1584,7 +1584,7 @@
; Greatly encourage this move if enemy is fast asleep.
; Greatly discourage this move otherwise.
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
and $7
cp $1
jr z, .asm_38cc7
@@ -1606,7 +1606,7 @@
; Greatly encourage this move if enemy is frozen.
; No move has EFFECT_DEFROST_OPPONENT, so this layer is unused.
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
and $20
ret z
dec [hl]
@@ -1617,7 +1617,7 @@
AI_Smart_Spite: ; 38cd5
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
and a
jr nz, .asm_38ce7
@@ -1633,8 +1633,8 @@
push hl
ld b, a
ld c, 4
- ld hl, BattleMonMoves
- ld de, BattleMonPP
+ ld hl, wBattleMonMoves
+ ld de, wBattleMonPP
.asm_38cf1
ld a, [hli]
@@ -1697,10 +1697,10 @@
; 50% chance to greatly encourage this move if the enemy is fast asleep or frozen.
push hl
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
ld b, a
ld c, 0
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
ld de, PARTYMON_STRUCT_LENGTH
.loop
@@ -1728,7 +1728,7 @@
and a
jr z, .no_status
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
and a
jr z, .ok
dec [hl]
@@ -1742,7 +1742,7 @@
ret
.no_status
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
and a
ret nz
jp AIDiscourageMove
@@ -1755,7 +1755,7 @@
ret c
; Dismiss this move if the player is flying or underground.
- ld a, [PlayerSubStatus3]
+ ld a, [wPlayerSubStatus3]
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
jp nz, AIDiscourageMove
@@ -1767,13 +1767,13 @@
callfar BattleCommand_DamageCalc
callfar BattleCommand_Stab
pop hl
- ld a, [CurDamage + 1]
+ ld a, [wCurDamage + 1]
ld c, a
- ld a, [CurDamage]
+ ld a, [wCurDamage]
ld b, a
- ld a, [BattleMonHP + 1]
+ ld a, [wBattleMonHP + 1]
cp c
- ld a, [BattleMonHP]
+ ld a, [wBattleMonHP]
sbc b
ret nc
dec [hl]
@@ -1794,7 +1794,7 @@
AI_Smart_Conversion2: ; 38d98
- ld a, [LastPlayerMove]
+ ld a, [wLastPlayerMove]
and a
jr nz, .asm_38dc9
@@ -1839,7 +1839,7 @@
jr nc, .asm_38df3
push hl
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
ld hl, UsefulMoves
ld de, 1
call IsInArray
@@ -1877,14 +1877,14 @@
jp z, AIDiscourageMove
; 80% chance to greatly encourage this move if the enemy is badly poisoned (buggy).
-; Should check PlayerSubStatus5 instead.
- ld a, [EnemySubStatus5]
+; Should check wPlayerSubStatus5 instead.
+ ld a, [wEnemySubStatus5]
bit SUBSTATUS_TOXIC, a
jr nz, .asm_38e26
; 80% chance to greatly encourage this move if the player is either
; in love, identified, stuck in Rollout, or has a Nightmare.
- ld a, [PlayerSubStatus1]
+ ld a, [wPlayerSubStatus1]
and 1<<SUBSTATUS_IN_LOVE | 1<<SUBSTATUS_ROLLOUT | 1<<SUBSTATUS_IDENTIFIED | 1<<SUBSTATUS_NIGHTMARE
jr nz, .asm_38e26
@@ -1911,14 +1911,14 @@
AICheckLastPlayerMon: ; 38e2e
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld b, a
ld c, 0
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
ld de, PARTYMON_STRUCT_LENGTH
.loop
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
cp c
jr z, .asm_38e44
@@ -1952,7 +1952,7 @@
AI_Smart_FlameWheel: ; 38e50
; Use this move if the enemy is frozen.
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
bit FRZ, a
ret z
rept 5
@@ -1963,10 +1963,10 @@
AI_Smart_Curse: ; 38e5c
- ld a, [EnemyMonType1]
+ ld a, [wEnemyMonType1]
cp GHOST
jr z, .ghostcurse
- ld a, [EnemyMonType2]
+ ld a, [wEnemyMonType2]
cp GHOST
jr z, .ghostcurse
@@ -1973,18 +1973,18 @@
call AICheckEnemyHalfHP
jr nc, .asm_38e93
- ld a, [EnemyAtkLevel]
+ ld a, [wEnemyAtkLevel]
cp $b
jr nc, .asm_38e93
cp $9
ret nc
- ld a, [BattleMonType1]
+ ld a, [wBattleMonType1]
cp GHOST
jr z, .asm_38e92
cp SPECIAL
ret nc
- ld a, [BattleMonType2]
+ ld a, [wBattleMonType2]
cp SPECIAL
ret nc
call AI_80_20
@@ -2003,7 +2003,7 @@
ret
.ghostcurse
- ld a, [PlayerSubStatus1]
+ ld a, [wPlayerSubStatus1]
bit SUBSTATUS_CURSE, a
jp nz, AIDiscourageMove
@@ -2037,7 +2037,7 @@
call AICheckEnemyMaxHP
ret nc
- ld a, [PlayerTurnsTaken]
+ ld a, [wPlayerTurnsTaken]
and a
ret nz
@@ -2052,29 +2052,29 @@
AI_Smart_Protect: ; 38ed2
- ld a, [EnemyProtectCount]
+ ld a, [wEnemyProtectCount]
and a
jr nz, .asm_38f13
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_LOCK_ON, a
jr nz, .asm_38f14
- ld a, [PlayerFuryCutterCount]
+ ld a, [wPlayerFuryCutterCount]
cp 3
jr nc, .asm_38f0d
- ld a, [PlayerSubStatus3]
+ ld a, [wPlayerSubStatus3]
bit SUBSTATUS_CHARGED, a
jr nz, .asm_38f0d
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_TOXIC, a
jr nz, .asm_38f0d
- ld a, [PlayerSubStatus4]
+ ld a, [wPlayerSubStatus4]
bit SUBSTATUS_LEECH_SEED, a
jr nz, .asm_38f0d
- ld a, [PlayerSubStatus1]
+ ld a, [wPlayerSubStatus1]
bit SUBSTATUS_CURSE, a
jr nz, .asm_38f0d
@@ -2081,7 +2081,7 @@
bit SUBSTATUS_ROLLOUT, a
jr z, .asm_38f14
- ld a, [PlayerRolloutCount]
+ ld a, [wPlayerRolloutCount]
cp 3
jr c, .asm_38f14
@@ -2105,17 +2105,17 @@
AI_Smart_Foresight: ; 38f1d
- ld a, [EnemyAccLevel]
+ ld a, [wEnemyAccLevel]
cp $5
jr c, .asm_38f41
- ld a, [PlayerEvaLevel]
+ ld a, [wPlayerEvaLevel]
cp $a
jr nc, .asm_38f41
- ld a, [BattleMonType1]
+ ld a, [wBattleMonType1]
cp GHOST
jr z, .asm_38f41
- ld a, [BattleMonType2]
+ ld a, [wBattleMonType2]
cp GHOST
jr z, .asm_38f41
@@ -2141,7 +2141,7 @@
pop hl
jr c, .no
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_CANT_RUN, a
jr nz, .yes
@@ -2176,7 +2176,7 @@
AI_Smart_Sandstorm: ; 38f7a
; Greatly discourage this move if the player is immune to Sandstorm damage.
- ld a, [BattleMonType1]
+ ld a, [wBattleMonType1]
push hl
ld hl, .SandstormImmuneTypes
ld de, 1
@@ -2184,7 +2184,7 @@
pop hl
jr c, .asm_38fa5
- ld a, [BattleMonType2]
+ ld a, [wBattleMonType2]
push hl
ld hl, .SandstormImmuneTypes
ld de, 1
@@ -2219,7 +2219,7 @@
AI_Smart_Endure: ; 38fac
- ld a, [EnemyProtectCount]
+ ld a, [wEnemyProtectCount]
and a
jr nz, .asm_38fd8
@@ -2242,7 +2242,7 @@
ret
.asm_38fcb
- ld a, [EnemySubStatus5]
+ ld a, [wEnemySubStatus5]
bit SUBSTATUS_LOCK_ON, a
ret z
@@ -2265,7 +2265,7 @@
AI_Smart_FuryCutter: ; 38fdb
; Encourage this move based on Fury Cutter's count.
- ld a, [EnemyFuryCutterCount]
+ ld a, [wEnemyFuryCutterCount]
and a
jr z, .end
dec [hl]
@@ -2291,15 +2291,15 @@
; Rollout, Fury Cutter
; 80% chance to discourage this move if the enemy is in love, confused, or paralyzed.
- ld a, [EnemySubStatus1]
+ ld a, [wEnemySubStatus1]
bit SUBSTATUS_IN_LOVE, a
jr nz, .asm_39020
- ld a, [EnemySubStatus3]
+ ld a, [wEnemySubStatus3]
bit SUBSTATUS_CONFUSED, a
jr nz, .asm_39020
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
bit PAR, a
jr nz, .asm_39020
@@ -2308,10 +2308,10 @@
call AICheckEnemyQuarterHP
jr nc, .asm_39020
- ld a, [EnemyAccLevel]
+ ld a, [wEnemyAccLevel]
cp 7
jr c, .asm_39020
- ld a, [PlayerEvaLevel]
+ ld a, [wPlayerEvaLevel]
cp 8
jr nc, .asm_39020
@@ -2336,7 +2336,7 @@
; 80% chance to encourage this move during the first turn of player's Pokemon.
; 80% chance to discourage this move otherwise.
- ld a, [PlayerTurnsTaken]
+ ld a, [wPlayerTurnsTaken]
and a
jr z, .first_turn
@@ -2370,11 +2370,11 @@
AI_Smart_Earthquake: ; 39044
; Greatly encourage this move if the player is underground and the enemy is faster.
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
cp DIG
ret nz
- ld a, [PlayerSubStatus3]
+ ld a, [wPlayerSubStatus3]
bit SUBSTATUS_UNDERGROUND, a
jr z, .could_dig
@@ -2442,11 +2442,11 @@
and a
jr nz, .asm_39097
- ld a, [EnemySubStatus4]
+ ld a, [wEnemySubStatus4]
bit SUBSTATUS_LEECH_SEED, a
jr nz, .asm_39097
- ld a, [EnemyScreens]
+ ld a, [wEnemyScreens]
bit SCREENS_SPIKES, a
ret z
@@ -2504,13 +2504,13 @@
; Greatly discourage this move if it would favour the player type-wise.
; Particularly, if the player is a Water-type.
- ld a, [BattleMonType1]
+ ld a, [wBattleMonType1]
cp WATER
jr z, AIBadWeatherType
cp FIRE
jr z, AIGoodWeatherType
- ld a, [BattleMonType2]
+ ld a, [wBattleMonType2]
cp WATER
jr z, AIBadWeatherType
cp FIRE
@@ -2541,13 +2541,13 @@
; Greatly discourage this move if it would favour the player type-wise.
; Particularly, if the player is a Fire-type.
- ld a, [BattleMonType1]
+ ld a, [wBattleMonType1]
cp FIRE
jr z, AIBadWeatherType
cp WATER
jr z, AIGoodWeatherType
- ld a, [BattleMonType2]
+ ld a, [wBattleMonType2]
cp FIRE
jr z, AIBadWeatherType
cp WATER
@@ -2597,12 +2597,12 @@
; ...as long as one of the following conditions meet:
; It's the first turn of the player's Pokemon.
- ld a, [PlayerTurnsTaken]
+ ld a, [wPlayerTurnsTaken]
and a
jr z, .good
; Or it's the first turn of the enemy's Pokemon.
- ld a, [EnemyTurnsTaken]
+ ld a, [wEnemyTurnsTaken]
and a
ret nz
@@ -2630,7 +2630,7 @@
; Dismiss this move if enemy's attack is higher than +2 or if enemy's HP is below 50%.
; Else, discourage this move if enemy's HP is not full.
- ld a, [EnemyAtkLevel]
+ ld a, [wEnemyAtkLevel]
cp $a
jr nc, .asm_3914d
@@ -2652,7 +2652,7 @@
AI_Smart_PsychUp: ; 39152
push hl
- ld hl, EnemyAtkLevel
+ ld hl, wEnemyAtkLevel
ld b, $8
ld c, 100
@@ -2668,7 +2668,7 @@
; Calculate the sum of all player's stat level modifiers. Add 100 first to prevent underflow.
; Put the result in d. d will range between 58 and 142.
- ld hl, PlayerAtkLevel
+ ld hl, wPlayerAtkLevel
ld b, $8
ld d, 100
@@ -2687,12 +2687,12 @@
jr nc, .asm_39188
; Else, 80% chance to encourage this move unless player's accuracy level is lower than -1...
- ld a, [PlayerAccLevel]
+ ld a, [wPlayerAccLevel]
cp $6
ret c
; ...or enemy's evasion level is higher than +0.
- ld a, [EnemyEvaLevel]
+ ld a, [wEnemyEvaLevel]
cp $8
ret nc
@@ -2711,7 +2711,7 @@
AI_Smart_MirrorCoat: ; 3918b
push hl
- ld hl, PlayerUsedMoves
+ ld hl, wPlayerUsedMoves
ld c, $4
ld b, $0
@@ -2744,7 +2744,7 @@
cp $3
jr nc, .asm_391ca
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
and a
jr z, .asm_391d2
@@ -2778,11 +2778,11 @@
AI_Smart_Gust: ; 391d5
; Greatly encourage this move if the player is flying and the enemy is faster.
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
cp FLY
ret nz
- ld a, [PlayerSubStatus3]
+ ld a, [wPlayerSubStatus3]
bit SUBSTATUS_FLYING, a
jr z, .couldFly
@@ -2813,7 +2813,7 @@
call AICompareSpeed
ret nc
- ld a, [PlayerSubStatus3]
+ ld a, [wPlayerSubStatus3]
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret z
@@ -2842,7 +2842,7 @@
; 80% chance to encourage this move when it's sunny.
; 90% chance to discourage this move when it's raining.
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_SUN
jr z, .asm_3921e
@@ -2870,7 +2870,7 @@
AI_Smart_Thunder: ; 39225
; 90% chance to discourage this move when it's sunny.
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_SUN
ret nz
@@ -2887,13 +2887,13 @@
; Return carry if enemy is faster than player.
push bc
- ld a, [EnemyMonSpeed + 1]
+ ld a, [wEnemyMonSpeed + 1]
ld b, a
- ld a, [BattleMonSpeed + 1]
+ ld a, [wBattleMonSpeed + 1]
cp b
- ld a, [EnemyMonSpeed]
+ ld a, [wEnemyMonSpeed]
ld b, a
- ld a, [BattleMonSpeed]
+ ld a, [wBattleMonSpeed]
sbc b
pop bc
ret
@@ -2904,8 +2904,8 @@
push hl
push de
push bc
- ld de, BattleMonHP
- ld hl, BattleMonMaxHP
+ ld de, wBattleMonHP
+ ld hl, wBattleMonMaxHP
jr AICheckMaxHP
; 39251
@@ -2914,8 +2914,8 @@
push hl
push de
push bc
- ld de, EnemyMonHP
- ld hl, EnemyMonMaxHP
+ ld de, wEnemyMonHP
+ ld hl, wEnemyMonMaxHP
; fallthrough
; 3925a
@@ -2950,7 +2950,7 @@
AICheckPlayerHalfHP: ; 3926e
push hl
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld b, [hl]
inc hl
ld c, [hl]
@@ -2971,7 +2971,7 @@
push hl
push de
push bc
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld b, [hl]
inc hl
ld c, [hl]
@@ -2994,7 +2994,7 @@
push hl
push de
push bc
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld b, [hl]
inc hl
ld c, [hl]
@@ -3017,7 +3017,7 @@
AICheckPlayerQuarterHP: ; 392b3
push hl
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld b, [hl]
inc hl
ld c, [hl]
@@ -3040,8 +3040,8 @@
; Return carry if the enemy has move b.
push hl
- ld hl, EnemyMonMoves
- ld c, EnemyMonMovesEnd - EnemyMonMoves
+ ld hl, wEnemyMonMoves
+ ld c, wEnemyMonMovesEnd - wEnemyMonMoves
.checkmove
ld a, [hli]
@@ -3082,8 +3082,8 @@
jr z, .done
ld b, a
- ld c, EnemyMonMovesEnd - EnemyMonMoves + 1
- ld de, EnemyMonMoves
+ ld c, wEnemyMonMovesEnd - wEnemyMonMoves + 1
+ ld de, wEnemyMonMoves
.check
dec c
@@ -3145,9 +3145,9 @@
ret c
.asm_39322
- ld hl, Buffer1 - 1
- ld de, EnemyMonMoves
- ld c, EnemyMonMovesEnd - EnemyMonMoves + 1
+ ld hl, wBuffer1 - 1
+ ld de, wEnemyMonMoves
+ ld c, wEnemyMonMovesEnd - wEnemyMonMoves + 1
.checkmove
inc hl
dec c
@@ -3222,13 +3222,13 @@
; no move will be discouraged
; Figure out which attack does the most damage and put it in c.
- ld hl, EnemyMonMoves
+ ld hl, wEnemyMonMoves
ld bc, 0
ld de, 0
.checkmove
inc b
ld a, b
- cp EnemyMonMovesEnd - EnemyMonMoves + 1
+ cp wEnemyMonMovesEnd - wEnemyMonMoves + 1
jr z, .gotstrongestmove
ld a, [hli]
@@ -3248,15 +3248,15 @@
pop hl
; Update current move if damage is highest so far
- ld a, [CurDamage + 1]
+ ld a, [wCurDamage + 1]
cp e
- ld a, [CurDamage]
+ ld a, [wCurDamage]
sbc d
jr c, .checkmove
- ld a, [CurDamage + 1]
+ ld a, [wCurDamage + 1]
ld e, a
- ld a, [CurDamage]
+ ld a, [wCurDamage]
ld d, a
ld c, b
jr .checkmove
@@ -3274,13 +3274,13 @@
jr z, .done
; Discourage moves that do less damage unless they're reckless too.
- ld hl, Buffer1 - 1
- ld de, EnemyMonMoves
+ ld hl, wBuffer1 - 1
+ ld de, wEnemyMonMoves
ld b, 0
.checkmove2
inc b
ld a, b
- cp EnemyMonMovesEnd - EnemyMonMoves + 1
+ cp wEnemyMonMovesEnd - wEnemyMonMoves + 1
jr z, .done
; Ignore this move if it is the highest damaging one.
@@ -3357,13 +3357,13 @@
AI_Cautious: ; 39418
; 90% chance to discourage moves with residual effects after the first turn.
- ld a, [EnemyTurnsTaken]
+ ld a, [wEnemyTurnsTaken]
and a
ret z
- ld hl, Buffer1 - 1
- ld de, EnemyMonMoves
- ld c, EnemyMonMovesEnd - EnemyMonMoves + 1
+ ld hl, wBuffer1 - 1
+ ld de, wEnemyMonMoves
+ ld c, wEnemyMonMovesEnd - wEnemyMonMoves + 1
.asm_39425
inc hl
dec c
@@ -3414,9 +3414,9 @@
AI_Status: ; 39453
; Dismiss status moves that don't affect the player.
- ld hl, Buffer1 - 1
- ld de, EnemyMonMoves
- ld b, EnemyMonMovesEnd - EnemyMonMoves + 1
+ ld hl, wBuffer1 - 1
+ ld de, wEnemyMonMoves
+ ld b, wEnemyMonMovesEnd - wEnemyMonMoves + 1
.checkmove
dec b
ret z
@@ -3446,10 +3446,10 @@
jr .typeimmunity
.poisonimmunity
- ld a, [BattleMonType1]
+ ld a, [wBattleMonType1]
cp POISON
jr z, .immune
- ld a, [BattleMonType2]
+ ld a, [wBattleMonType2]
cp POISON
jr z, .immune
@@ -3479,9 +3479,9 @@
; Use any move that will KO the target.
; Risky moves will often be an exception (see below).
- ld hl, Buffer1 - 1
- ld de, EnemyMonMoves
- ld c, EnemyMonMovesEnd - EnemyMonMoves + 1
+ ld hl, wBuffer1 - 1
+ ld de, wEnemyMonMoves
+ ld c, wEnemyMonMovesEnd - wEnemyMonMoves + 1
.checkmove
inc hl
dec c
@@ -3519,13 +3519,13 @@
.checkko
call AIDamageCalc
- ld a, [CurDamage + 1]
+ ld a, [wCurDamage + 1]
ld e, a
- ld a, [CurDamage]
+ ld a, [wCurDamage]
ld d, a
- ld a, [BattleMonHP + 1]
+ ld a, [wBattleMonHP + 1]
cp e
- ld a, [BattleMonHP]
+ ld a, [wBattleMonHP]
sbc d
jr nc, .nextmove
--- a/engine/battle/ai/switch.asm
+++ b/engine/battle/ai/switch.asm
@@ -7,7 +7,7 @@
push bc
ld a, 10
ld [wEnemyAISwitchScore], a
- ld hl, PlayerUsedMoves
+ ld hl, wPlayerUsedMoves
ld a, [hl]
and a
jr z, .unknown_moves
@@ -27,7 +27,7 @@
inc hl
call GetMoveByte
- ld hl, EnemyMonType
+ ld hl, wEnemyMonType
call CheckTypeMatchup
ld a, [wTypeMatchup]
cp 10 + 1 ; 1.0 + 0.1
@@ -70,9 +70,9 @@
jr .done
.unknown_moves
- ld a, [BattleMonType1]
+ ld a, [wBattleMonType1]
ld b, a
- ld hl, EnemyMonType1
+ ld hl, wEnemyMonType1
call CheckTypeMatchup
ld a, [wTypeMatchup]
cp 10 + 1 ; 1.0 + 0.1
@@ -79,7 +79,7 @@
jr c, .ok
call .DecreaseScore
.ok
- ld a, [BattleMonType2]
+ ld a, [wBattleMonType2]
cp b
jr z, .ok2
call CheckTypeMatchup
@@ -99,7 +99,7 @@
.CheckEnemyMoveMatchups: ; 348de
- ld de, EnemyMonMoves
+ ld de, wEnemyMonMoves
ld b, NUM_MOVES + 1
ld c, 0
@@ -122,7 +122,7 @@
inc hl
call GetMoveByte
- ld hl, BattleMonType1
+ ld hl, wBattleMonType1
call CheckTypeMatchup
ld a, [wTypeMatchup]
@@ -183,11 +183,11 @@
call FindAliveEnemyMons
ret c
- ld a, [EnemySubStatus1]
+ ld a, [wEnemySubStatus1]
bit SUBSTATUS_PERISH, a
jr z, .no_perish
- ld a, [EnemyPerishCount]
+ ld a, [wEnemyPerishCount]
cp 1
jr nz, .no_perish
@@ -229,7 +229,7 @@
cp 11
ret nc
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
and a
jr z, .no_last_counter_move
@@ -296,7 +296,7 @@
FindAliveEnemyMons: ; 349f4
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
cp 2
jr c, .only_one
@@ -304,10 +304,10 @@
ld e, 0
ld b, 1 << (PARTY_LENGTH - 1)
ld c, 0
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
.loop
- ld a, [CurOTMon]
+ ld a, [wCurOTMon]
cp e
jr z, .next
@@ -348,8 +348,8 @@
FindEnemyMonsImmuneToLastCounterMove: ; 34a2a
- ld hl, OTPartyMon1
- ld a, [OTPartyCount]
+ ld hl, wOTPartyMon1
+ ld a, [wOTPartyCount]
ld b, a
ld c, 1 << (PARTY_LENGTH - 1)
ld d, 0
@@ -357,7 +357,7 @@
ld [wEnemyAISwitchScore], a
.loop
- ld a, [CurOTMon]
+ ld a, [wCurOTMon]
cp d
push hl
jr z, .next
@@ -375,11 +375,11 @@
jr z, .next
ld a, [hl]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
; the player's last move is damaging...
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
dec a
ld hl, Moves + MOVE_POWER
call GetMoveAttr
@@ -389,7 +389,7 @@
; and the Pokemon is immune to it...
inc hl
call GetMoveByte
- ld hl, BaseType
+ ld hl, wBaseType
call CheckTypeMatchup
ld a, [wTypeMatchup]
and a
@@ -417,9 +417,9 @@
FindAliveEnemyMonsWithASuperEffectiveMove: ; 34a85
push bc
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
ld e, a
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
ld b, 1 << (PARTY_LENGTH - 1)
ld c, 0
.loop
@@ -434,7 +434,7 @@
.next
srl b
push bc
- ld bc, PartyMon2HP - (PartyMon1HP + 1)
+ ld bc, wPartyMon2HP - (wPartyMon1HP + 1)
add hl, bc
pop bc
dec e
@@ -449,7 +449,7 @@
ld a, -1
ld [wEnemyAISwitchScore], a
- ld hl, OTPartyMon1Moves
+ ld hl, wOTPartyMon1Moves
ld b, 1 << (PARTY_LENGTH - 1)
ld d, 0
ld e, 0
@@ -480,7 +480,7 @@
; check type matchups
inc hl
call GetMoveByte
- ld hl, BattleMonType1
+ ld hl, wBattleMonType1
call CheckTypeMatchup
; if immune or not very effective: continue
@@ -556,7 +556,7 @@
FindEnemyMonsThatResistPlayer: ; 34b20
push bc
- ld hl, OTPartySpecies
+ ld hl, wOTPartySpecies
ld b, 1 << (PARTY_LENGTH - 1)
ld c, 0
@@ -566,9 +566,9 @@
jr z, .done
push hl
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [LastPlayerCounterMove]
+ ld a, [wLastPlayerCounterMove]
and a
jr z, .skip_move
@@ -583,16 +583,16 @@
jr .check_type
.skip_move
- ld a, [BattleMonType1]
- ld hl, BaseType
+ ld a, [wBattleMonType1]
+ ld hl, wBaseType
call CheckTypeMatchup
ld a, [wTypeMatchup]
cp 10 + 1
jr nc, .dont_choose_mon
- ld a, [BattleMonType2]
+ ld a, [wBattleMonType2]
.check_type
- ld hl, BaseType
+ ld hl, wBaseType
call CheckTypeMatchup
ld a, [wTypeMatchup]
cp 10 + 1
@@ -618,10 +618,10 @@
FindEnemyMonsWithAtLeastQuarterMaxHP: ; 34b77
push bc
- ld de, OTPartySpecies
+ ld de, wOTPartySpecies
ld b, 1 << (PARTY_LENGTH - 1)
ld c, 0
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
.loop
ld a, [de]
--- a/engine/battle/anim_hp_bar.asm
+++ b/engine/battle/anim_hp_bar.asm
@@ -275,10 +275,10 @@
ld [hld], a
dec hl
ld a, [wCurHPAnimOldHP]
- ld [StringBuffer2 + 1], a
+ ld [wStringBuffer2 + 1], a
ld a, [wCurHPAnimOldHP + 1]
- ld [StringBuffer2], a
- ld de, StringBuffer2
+ ld [wStringBuffer2], a
+ ld de, wStringBuffer2
lb bc, 2, 3
call PrintNum
pop hl
@@ -311,7 +311,7 @@
jr z, .load_0
cp $1
jr z, .load_1
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
cp $3
jr nc, .bottom_half_of_screen
ld c, $0
--- a/engine/battle/battle_transition.asm
+++ b/engine/battle/battle_transition.asm
@@ -198,12 +198,12 @@
StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)
; The screen flashes a different number of times depending on the level of
; your lead Pokemon relative to the opponent's.
-; BUG: BattleMonLevel and EnemyMonLevel are not set at this point, so whatever
+; BUG: wBattleMonLevel and wEnemyMonLevel are not set at this point, so whatever
; values happen to be there will determine the animation.
ld de, 0
- ld a, [BattleMonLevel]
+ ld a, [wBattleMonLevel]
add 3
- ld hl, EnemyMonLevel
+ ld hl, wEnemyMonLevel
cp [hl]
jr nc, .okay
set 0, e
@@ -298,7 +298,7 @@
StartTrainerBattle_SetUpForWavyOutro: ; 8c3e8 (23:43e8)
farcall Function5602
- ld a, BANK(LYOverrides)
+ ld a, BANK(wLYOverrides)
ld [rSVBK], a
call StartTrainerBattle_NextScene
@@ -334,8 +334,8 @@
ld d, [hl]
add [hl]
ld [hl], a
- ld a, LYOverridesEnd - LYOverrides
- ld bc, LYOverrides
+ ld a, wLYOverridesEnd - wLYOverrides
+ ld bc, wLYOverrides
ld e, $0
.loop
@@ -356,7 +356,7 @@
StartTrainerBattle_SetUpForSpinOutro: ; 8c43d (23:443d)
farcall Function5602
- ld a, BANK(LYOverrides)
+ ld a, BANK(wLYOverrides)
ld [rSVBK], a
call StartTrainerBattle_NextScene
xor a
@@ -498,7 +498,7 @@
StartTrainerBattle_SetUpForRandomScatterOutro: ; 8c578 (23:4578)
farcall Function5602
- ld a, BANK(LYOverrides)
+ ld a, BANK(wLYOverrides)
ld [rSVBK], a
call StartTrainerBattle_NextScene
ld a, $10
@@ -566,13 +566,13 @@
ret
StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
- ld a, [OtherTrainerClass]
+ ld a, [wOtherTrainerClass]
and a
jp z, .nextscene ; don't need to be here if wild
xor a
ld [hBGMapMode], a
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
inc b
inc c
@@ -639,7 +639,7 @@
.cgb
ld hl, .daypals
- ld a, [TimeOfDayPal]
+ ld a, [wTimeOfDayPal]
maskbits NUM_DAYTIMES
cp DARKNESS_F
jr nz, .daytime
@@ -699,7 +699,7 @@
; 8c6b1
.loadpokeballgfx
- ld a, [OtherTrainerClass]
+ ld a, [wOtherTrainerClass]
ld de, PokeBallTransition
ret
@@ -724,12 +724,12 @@
WipeLYOverrides: ; 8c6d8
ld a, [rSVBK]
push af
- ld a, BANK(LYOverrides)
+ ld a, BANK(wLYOverrides)
ld [rSVBK], a
- ld hl, LYOverrides
+ ld hl, wLYOverrides
call .wipe
- ld hl, LYOverridesBackup
+ ld hl, wLYOverridesBackup
call .wipe
pop af
--- a/engine/battle/checkbattlescene.asm
+++ b/engine/battle/checkbattlescene.asm
@@ -7,7 +7,7 @@
cp LINK_MOBILE
jr z, .mobile
- ld a, [Options]
+ ld a, [wOptions]
bit BATTLE_SCENE, a
jr nz, .off
--- a/engine/battle/consumehelditem.asm
+++ b/engine/battle/consumehelditem.asm
@@ -4,13 +4,13 @@
push bc
ld a, [hBattleTurn]
and a
- ld hl, OTPartyMon1Item
- ld de, EnemyMonItem
- ld a, [CurOTMon]
+ ld hl, wOTPartyMon1Item
+ ld de, wEnemyMonItem
+ ld a, [wCurOTMon]
jr z, .theirturn
- ld hl, PartyMon1Item
- ld de, BattleMonItem
- ld a, [CurBattleMon]
+ ld hl, wPartyMon1Item
+ ld de, wBattleMonItem
+ ld a, [wCurBattleMon]
.theirturn
push hl
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -4,11 +4,11 @@
xor a
ld [wBattleParticipantsNotFainted], a
ld [wBattleParticipantsIncludingFainted], a
- ld [wPlayerAction], a
- ld [BattleEnded], a
+ ld [wBattlePlayerAction], a
+ ld [wBattleEnded], a
inc a
ld [wBattleHasJustStarted], a
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
ld bc, PARTYMON_STRUCT_LENGTH - 1
ld d, BATTLEACTION_SWITCH1 - 1
.loop
@@ -52,33 +52,33 @@
and a
jp z, LostBattle
call Call_LoadTempTileMapToTileMap
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_DEBUG
jp z, .tutorial_debug
cp BATTLETYPE_TUTORIAL
jp z, .tutorial_debug
xor a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
.loop2
call CheckIfCurPartyMonIsFitToFight
jr nz, .alive2
- ld hl, CurPartyMon
+ ld hl, wCurPartyMon
inc [hl]
jr .loop2
.alive2
- ld a, [CurBattleMon]
- ld [LastPlayerMon], a
- ld a, [CurPartyMon]
- ld [CurBattleMon], a
+ ld a, [wCurBattleMon]
+ ld [wLastPlayerMon], a
+ ld a, [wCurPartyMon]
+ ld [wCurBattleMon], a
inc a
- ld hl, PartySpecies - 1
+ ld hl, wPartySpecies - 1
ld c, a
ld b, 0
add hl, bc
ld a, [hl]
- ld [CurPartySpecies], a
- ld [TempBattleMonSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wTempBattleMonSpecies], a
hlcoord 1, 5
ld a, 9
call SlideBattlePicOut
@@ -154,7 +154,7 @@
.skip_sfx
call SetPlayerTurn
ld a, 1
- ld [BattleEnded], a
+ ld [wBattleEnded], a
ret
; 3c12f
@@ -170,8 +170,8 @@
ld [wBattleHasJustStarted], a
ld [wPlayerJustGotFrozen], a
ld [wEnemyJustGotFrozen], a
- ld [CurDamage], a
- ld [CurDamage + 1], a
+ ld [wCurDamage], a
+ ld [wCurDamage + 1], a
call HandleBerserkGene
call UpdateBattleMonInParty
@@ -190,7 +190,7 @@
.loop1
call BattleMenu
jr c, .quit
- ld a, [BattleEnded]
+ ld a, [wBattleEnded]
and a
jr nz, .quit
ld a, [wForcedSwitch] ; roared/whirlwinded/teleported
@@ -217,12 +217,12 @@
and a
jr nz, .quit
- ld a, [BattleEnded]
+ ld a, [wBattleEnded]
and a
jr nz, .quit
call HandleBetweenTurnEffects
- ld a, [BattleEnded]
+ ld a, [wBattleEnded]
and a
jr nz, .quit
jp .loop
@@ -303,7 +303,7 @@
call HasPlayerFainted
jr nz, .PlayerNotFainted
call HandlePlayerMonFaint
- ld a, [BattleEnded]
+ ld a, [wBattleEnded]
and a
jr nz, .BattleIsOver
@@ -311,7 +311,7 @@
call HasEnemyFainted
jr nz, .BattleContinues
call HandleEnemyMonFaint
- ld a, [BattleEnded]
+ ld a, [wBattleEnded]
and a
jr nz, .BattleIsOver
@@ -328,7 +328,7 @@
call HasEnemyFainted
jr nz, .EnemyNotFainted
call HandleEnemyMonFaint
- ld a, [BattleEnded]
+ ld a, [wBattleEnded]
and a
jr nz, .BattleIsOver
@@ -336,7 +336,7 @@
call HasPlayerFainted
jr nz, .BattleContinues
call HandlePlayerMonFaint
- ld a, [BattleEnded]
+ ld a, [wBattleEnded]
and a
jr nz, .BattleIsOver
@@ -363,15 +363,15 @@
.player
call SetPlayerTurn
- ld de, PartyMon1Item
- ld a, [CurBattleMon]
+ ld de, wPartyMon1Item
+ ld a, [wCurBattleMon]
ld b, a
jr .go
.enemy
call SetEnemyTurn
- ld de, OTPartyMon1Item
- ld a, [CurOTMon]
+ ld de, wOTPartyMon1Item
+ ld a, [wCurOTMon]
ld b, a
; jr .go
@@ -404,8 +404,8 @@
push af
xor a
ld [hl], a
- ld [AttackMissed], a
- ld [EffectFailed], a
+ ld [wAttackMissed], a
+ ld [wEffectFailed], a
farcall BattleCommand_AttackUp2
pop af
pop hl
@@ -455,7 +455,7 @@
jr z, .use_move
sub BATTLEACTION_SWITCH1
jr c, .use_move
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
cp $2
jr nz, .switch
ld a, [hSerialConnectionStatus]
@@ -480,7 +480,7 @@
jp .enemy_first
.use_move
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
and a
jp nz, .player_first
call CompareMovePriority
@@ -536,8 +536,8 @@
jr .speed_check
.speed_check
- ld de, BattleMonSpeed
- ld hl, EnemyMonSpeed
+ ld de, wBattleMonSpeed
+ ld hl, wEnemyMonSpeed
ld c, 2
call StringCmp
jr z, .speed_tie
@@ -568,7 +568,7 @@
; 3c3f5
CheckContestBattleOver: ; 3c3f5
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_CONTEST
jr nz, .contest_not_over
ld a, [wParkBallsRemaining]
@@ -587,13 +587,13 @@
; 3c410
CheckPlayerLockedIn: ; 3c410
- ld a, [PlayerSubStatus4]
+ ld a, [wPlayerSubStatus4]
and 1 << SUBSTATUS_RECHARGE
jp nz, .quit
- ld hl, EnemySubStatus3
+ ld hl, wEnemySubStatus3
res SUBSTATUS_FLINCHED, [hl]
- ld hl, PlayerSubStatus3
+ ld hl, wPlayerSubStatus3
res SUBSTATUS_FLINCHED, [hl]
ld a, [hl]
@@ -600,7 +600,7 @@
and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_RAMPAGE
jp nz, .quit
- ld hl, PlayerSubStatus1
+ ld hl, wPlayerSubStatus1
bit SUBSTATUS_ROLLOUT, [hl]
jp nz, .quit
@@ -615,31 +615,31 @@
ParsePlayerAction: ; 3c434
call CheckPlayerLockedIn
jp c, .locked_in
- ld hl, PlayerSubStatus5
+ ld hl, wPlayerSubStatus5
bit SUBSTATUS_ENCORED, [hl]
jr z, .not_encored
- ld a, [LastPlayerMove]
- ld [CurPlayerMove], a
+ ld a, [wLastPlayerMove]
+ ld [wCurPlayerMove], a
jr .encored
.not_encored
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
cp $2
jr z, .reset_rage
and a
jr nz, .reset_bide
- ld a, [PlayerSubStatus3]
+ ld a, [wPlayerSubStatus3]
and 1 << SUBSTATUS_BIDE
jr nz, .locked_in
xor a
ld [wMoveSelectionMenuType], a
inc a ; POUND
- ld [FXAnimID], a
+ ld [wFXAnimID], a
call MoveSelectionScreen
push af
call Call_LoadTempTileMapToTileMap
call UpdateBattleHuds
- ld a, [CurPlayerMove]
+ ld a, [wCurPlayerMove]
cp STRUGGLE
jr z, .struggle
call PlayClickSFX
@@ -659,13 +659,13 @@
cp EFFECT_FURY_CUTTER
jr z, .continue_fury_cutter
xor a
- ld [PlayerFuryCutterCount], a
+ ld [wPlayerFuryCutterCount], a
.continue_fury_cutter
ld a, [wPlayerMoveStruct + MOVE_EFFECT]
cp EFFECT_RAGE
jr z, .continue_rage
- ld hl, PlayerSubStatus4
+ ld hl, wPlayerSubStatus4
res SUBSTATUS_RAGE, [hl]
xor a
ld [wPlayerRageCounter], a
@@ -677,19 +677,19 @@
cp EFFECT_ENDURE
jr z, .continue_protect
xor a
- ld [PlayerProtectCount], a
+ ld [wPlayerProtectCount], a
jr .continue_protect
.reset_bide
- ld hl, PlayerSubStatus3
+ ld hl, wPlayerSubStatus3
res SUBSTATUS_BIDE, [hl]
.locked_in
xor a
- ld [PlayerFuryCutterCount], a
- ld [PlayerProtectCount], a
+ ld [wPlayerFuryCutterCount], a
+ ld [wPlayerProtectCount], a
ld [wPlayerRageCounter], a
- ld hl, PlayerSubStatus4
+ ld hl, wPlayerSubStatus4
res SUBSTATUS_RAGE, [hl]
.continue_protect
@@ -699,10 +699,10 @@
.reset_rage
xor a
- ld [PlayerFuryCutterCount], a
- ld [PlayerProtectCount], a
+ ld [wPlayerFuryCutterCount], a
+ ld [wPlayerProtectCount], a
ld [wPlayerRageCounter], a
- ld hl, PlayerSubStatus4
+ ld hl, wPlayerSubStatus4
res SUBSTATUS_RAGE, [hl]
xor a
ret
@@ -718,15 +718,15 @@
.player_1
call .do_enemy
.do_player
- ld hl, PlayerSubStatus5
+ ld hl, wPlayerSubStatus5
bit SUBSTATUS_ENCORED, [hl]
ret z
- ld a, [PlayerEncoreCount]
+ ld a, [wPlayerEncoreCount]
dec a
- ld [PlayerEncoreCount], a
+ ld [wPlayerEncoreCount], a
jr z, .end_player_encore
- ld hl, BattleMonPP
- ld a, [CurMoveNum]
+ ld hl, wBattleMonPP
+ ld a, [wCurMoveNum]
ld c, a
ld b, 0
add hl, bc
@@ -735,7 +735,7 @@
ret nz
.end_player_encore
- ld hl, PlayerSubStatus5
+ ld hl, wPlayerSubStatus5
res SUBSTATUS_ENCORED, [hl]
call SetEnemyTurn
ld hl, BattleText_TargetsEncoreEnded
@@ -742,15 +742,15 @@
jp StdBattleTextBox
.do_enemy
- ld hl, EnemySubStatus5
+ ld hl, wEnemySubStatus5
bit SUBSTATUS_ENCORED, [hl]
ret z
- ld a, [EnemyEncoreCount]
+ ld a, [wEnemyEncoreCount]
dec a
- ld [EnemyEncoreCount], a
+ ld [wEnemyEncoreCount], a
jr z, .end_enemy_encore
- ld hl, EnemyMonPP
- ld a, [CurEnemyMoveNum]
+ ld hl, wEnemyMonPP
+ ld a, [wCurEnemyMoveNum]
ld c, a
ld b, 0
add hl, bc
@@ -759,7 +759,7 @@
ret nz
.end_enemy_encore
- ld hl, EnemySubStatus5
+ ld hl, wEnemySubStatus5
res SUBSTATUS_ENCORED, [hl]
call SetPlayerTurn
ld hl, BattleText_TargetsEncoreEnded
@@ -771,7 +771,7 @@
dec a
jr nz, .Stay
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_CANT_RUN, a
jr nz, .Stay
@@ -779,11 +779,11 @@
and a
jr nz, .Stay
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
and 1 << FRZ | SLP
jr nz, .Stay
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
ld de, 1
ld hl, AlwaysFleeMons
call IsInArray
@@ -795,7 +795,7 @@
jr nc, .Stay
push bc
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
ld de, 1
ld hl, OftenFleeMons
call IsInArray
@@ -806,7 +806,7 @@
cp 1 + (10 percent)
jr nc, .Stay
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
ld de, 1
ld hl, SometimesFleeMons
call IsInArray
@@ -827,11 +827,11 @@
; Compare the priority of the player and enemy's moves.
; Return carry if the player goes first, or z if they match.
- ld a, [CurPlayerMove]
+ ld a, [wCurPlayerMove]
call GetMovePriority
ld b, a
push bc
- ld a, [CurEnemyMove]
+ ld a, [wCurEnemyMove]
call GetMovePriority
pop bc
cp b
@@ -920,7 +920,7 @@
jp z, HandlePlayerMonFaint
call RefreshBattleHuds
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ret
; 3c664
@@ -970,7 +970,7 @@
jp z, HandleEnemyMonFaint
call RefreshBattleHuds
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ret
; 3c6cf
@@ -1011,11 +1011,11 @@
and a
jr z, HasPlayerFainted
HasEnemyFainted: ; 3c70b
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
jr CheckIfHPIsZero
HasPlayerFainted: ; 3c710
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
CheckIfHPIsZero: ; 3c713
ld a, [hli]
@@ -1052,11 +1052,11 @@
ld [wNumHits], a
call Call_PlayBattleAnim_OnlyIfVisible
call GetEighthMaxHP
- ld de, PlayerToxicCount
+ ld de, wPlayerToxicCount
ld a, [hBattleTurn]
and a
jr z, .check_toxic
- ld de, EnemyToxicCount
+ ld de, wEnemyToxicCount
.check_toxic
ld a, BATTLE_VARS_SUBSTATUS5
@@ -1141,11 +1141,11 @@
call StdBattleTextBox
.not_cursed
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld a, [hBattleTurn]
and a
jr z, .check_fainted
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
.check_fainted
ld a, [hli]
@@ -1175,11 +1175,11 @@
call SetPlayerTurn
.do_it
- ld hl, PlayerPerishCount
+ ld hl, wPlayerPerishCount
ld a, [hBattleTurn]
and a
jr z, .got_count
- ld hl, EnemyPerishCount
+ ld hl, wEnemyPerishCount
.got_count
ld a, BATTLE_VARS_SUBSTATUS1
@@ -1200,12 +1200,12 @@
ld a, [hBattleTurn]
and a
jr nz, .kill_enemy
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
xor a
ld [hli], a
ld [hl], a
- ld hl, PartyMon1HP
- ld a, [CurBattleMon]
+ ld hl, wPartyMon1HP
+ ld a, [wCurBattleMon]
call GetPartyLocation
xor a
ld [hli], a
@@ -1213,7 +1213,7 @@
ret
.kill_enemy
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
xor a
ld [hli], a
ld [hl], a
@@ -1220,8 +1220,8 @@
ld a, [wBattleMode]
dec a
ret z
- ld hl, OTPartyMon1HP
- ld a, [CurOTMon]
+ ld hl, wOTPartyMon1HP
+ ld a, [wCurOTMon]
call GetPartyLocation
xor a
ld [hli], a
@@ -1264,7 +1264,7 @@
ld a, [de]
ld [wd265], a
- ld [FXAnimID], a
+ ld [wFXAnimID], a
call GetMoveName
dec [hl]
jr z, .release_from_bounds
@@ -1277,7 +1277,7 @@
call SwitchTurnCore
xor a
ld [wNumHits], a
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
predef PlayBattleAnim
call SwitchTurnCore
@@ -1324,11 +1324,11 @@
cp HELD_LEFTOVERS
ret nz
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld a, [hBattleTurn]
and a
jr z, .got_hp
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
.got_hp
; Don't restore if we're already at max HP
@@ -1370,13 +1370,13 @@
ld a, b
cp HELD_RESTORE_PP
jr nz, .quit
- ld hl, PartyMon1PP
- ld a, [CurBattleMon]
+ ld hl, wPartyMon1PP
+ ld a, [wCurBattleMon]
call GetPartyLocation
ld d, h
ld e, l
- ld hl, PartyMon1Moves
- ld a, [CurBattleMon]
+ ld hl, wPartyMon1Moves
+ ld a, [wCurBattleMon]
call GetPartyLocation
ld a, [hBattleTurn]
and a
@@ -1386,13 +1386,13 @@
ld a, [wBattleMode]
dec a
jr z, .wild
- ld hl, OTPartyMon1PP
- ld a, [CurOTMon]
+ ld hl, wOTPartyMon1PP
+ ld a, [wCurOTMon]
call GetPartyLocation
ld d, h
ld e, l
- ld hl, OTPartyMon1Moves
- ld a, [CurOTMon]
+ ld hl, wOTPartyMon1Moves
+ ld a, [wCurOTMon]
call GetPartyLocation
.wild
@@ -1429,13 +1429,13 @@
push bc
ld a, [hl]
ld [wd265], a
- ld de, BattleMonMoves - 1
- ld hl, BattleMonPP
+ ld de, wBattleMonMoves - 1
+ ld hl, wBattleMonPP
ld a, [hBattleTurn]
and a
jr z, .player_pp
- ld de, EnemyMonMoves - 1
- ld hl, EnemyMonPP
+ ld de, wEnemyMonMoves - 1
+ ld hl, wEnemyMonPP
.player_pp
inc de
pop bc
@@ -1453,9 +1453,9 @@
jr nz, .skip_checks
ld a, [hBattleTurn]
and a
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
jr z, .check_transform
- ld a, [EnemySubStatus5]
+ ld a, [wEnemySubStatus5]
.check_transform
bit SUBSTATUS_TRANSFORMED, a
jr nz, .skip_checks
@@ -1531,14 +1531,14 @@
callfar UpdateMoveData
xor a
- ld [AttackMissed], a
- ld [AlreadyDisobeyed], a
+ ld [wAttackMissed], a
+ ld [wAlreadyDisobeyed], a
ld a, 10
- ld [TypeModifier], a
+ ld [wTypeModifier], a
callfar DoMove
xor a
- ld [CurDamage], a
- ld [CurDamage + 1], a
+ ld [wCurDamage], a
+ ld [wCurDamage + 1], a
ld a, BATTLE_VARS_MOVE
call GetBattleVarAddr
@@ -1559,7 +1559,7 @@
.enemy_first
call .do_enemy_turn
.do_player_turn
- ld a, [BattleMonStatus]
+ ld a, [wBattleMonStatus]
bit FRZ, a
ret z
@@ -1571,9 +1571,9 @@
cp 10 percent
ret nc
xor a
- ld [BattleMonStatus], a
- ld a, [CurBattleMon]
- ld hl, PartyMon1Status
+ ld [wBattleMonStatus], a
+ ld a, [wCurBattleMon]
+ ld hl, wPartyMon1Status
call GetPartyLocation
ld [hl], 0
call UpdateBattleHuds
@@ -1582,7 +1582,7 @@
jp StdBattleTextBox
.do_enemy_turn
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
bit FRZ, a
ret z
ld a, [wEnemyJustGotFrozen]
@@ -1592,13 +1592,13 @@
cp 10 percent
ret nc
xor a
- ld [EnemyMonStatus], a
+ ld [wEnemyMonStatus], a
ld a, [wBattleMode]
dec a
jr z, .wild
- ld a, [CurOTMon]
- ld hl, OTPartyMon1Status
+ ld a, [wCurOTMon]
+ ld hl, wOTPartyMon1Status
call GetPartyLocation
ld [hl], 0
.wild
@@ -1619,26 +1619,26 @@
.player1
call .CheckEnemy
.CheckPlayer:
- ld a, [PlayerScreens]
+ ld a, [wPlayerScreens]
bit SCREENS_SAFEGUARD, a
ret z
- ld hl, PlayerSafeguardCount
+ ld hl, wPlayerSafeguardCount
dec [hl]
ret nz
res SCREENS_SAFEGUARD, a
- ld [PlayerScreens], a
+ ld [wPlayerScreens], a
xor a
jr .print
.CheckEnemy:
- ld a, [EnemyScreens]
+ ld a, [wEnemyScreens]
bit SCREENS_SAFEGUARD, a
ret z
- ld hl, EnemySafeguardCount
+ ld hl, wEnemySafeguardCount
dec [hl]
ret nz
res SCREENS_SAFEGUARD, a
- ld [EnemyScreens], a
+ ld [wEnemyScreens], a
ld a, $1
@@ -1660,8 +1660,8 @@
call SetPlayerTurn
ld de, .Your
call .Copy
- ld hl, PlayerScreens
- ld de, PlayerLightScreenCount
+ ld hl, wPlayerScreens
+ ld de, wPlayerLightScreenCount
jr .TickScreens
.CheckEnemy:
@@ -1668,8 +1668,8 @@
call SetEnemyTurn
ld de, .Enemy
call .Copy
- ld hl, EnemyScreens
- ld de, EnemyLightScreenCount
+ ld hl, wEnemyScreens
+ ld de, wEnemyLightScreenCount
.TickScreens:
bit SCREENS_LIGHT_SCREEN, [hl]
@@ -1679,7 +1679,7 @@
ret
.Copy:
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
jp CopyName2
; 3cb75
@@ -1716,11 +1716,11 @@
; 3cb9e
HandleWeather: ; 3cb9e
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_NONE
ret z
- ld hl, WeatherCount
+ ld hl, wWeatherCount
dec [hl]
jr z, .ended
@@ -1727,7 +1727,7 @@
ld hl, .WeatherMessages
call .PrintWeatherMessage
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_SANDSTORM
ret nz
@@ -1752,11 +1752,11 @@
bit SUBSTATUS_UNDERGROUND, a
ret nz
- ld hl, BattleMonType1
+ ld hl, wBattleMonType1
ld a, [hBattleTurn]
and a
jr z, .ok
- ld hl, EnemyMonType1
+ ld hl, wEnemyMonType1
.ok
ld a, [hli]
cp ROCK
@@ -1790,11 +1790,11 @@
ld hl, .WeatherEndedMessages
call .PrintWeatherMessage
xor a
- ld [Weather], a
+ ld [wBattleWeather], a
ret
.PrintWeatherMessage:
- ld a, [Weather]
+ ld a, [wBattleWeather]
dec a
ld c, a
ld b, 0
@@ -1828,34 +1828,34 @@
; 3cc45
SubtractHP: ; 3cc45
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld a, [hBattleTurn]
and a
jr z, .ok
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
.ok
inc hl
ld a, [hl]
- ld [Buffer3], a
+ ld [wBuffer3], a
sub c
ld [hld], a
- ld [Buffer5], a
+ ld [wBuffer5], a
ld a, [hl]
- ld [Buffer4], a
+ ld [wBuffer4], a
sbc b
ld [hl], a
- ld [Buffer6], a
+ ld [wBuffer6], a
ret nc
- ld a, [Buffer3]
+ ld a, [wBuffer3]
ld c, a
- ld a, [Buffer4]
+ ld a, [wBuffer4]
ld b, a
xor a
ld [hli], a
ld [hl], a
- ld [Buffer5], a
- ld [Buffer6], a
+ ld [wBuffer5], a
+ ld [wBuffer6], a
ret
; 3cc76
@@ -1926,30 +1926,30 @@
; 3ccac
GetMaxHP: ; 3ccac
-; output: bc, Buffer1-2
+; output: bc, wBuffer1-2
- ld hl, BattleMonMaxHP
+ ld hl, wBattleMonMaxHP
ld a, [hBattleTurn]
and a
jr z, .ok
- ld hl, EnemyMonMaxHP
+ ld hl, wEnemyMonMaxHP
.ok
ld a, [hli]
- ld [Buffer2], a
+ ld [wBuffer2], a
ld b, a
ld a, [hl]
- ld [Buffer1], a
+ ld [wBuffer1], a
ld c, a
ret
; 3ccc2
Unreferenced_GetHalfHP: ; 3ccc2
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld a, [hBattleTurn]
and a
jr z, .ok
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
.ok
ld a, [hli]
ld b, a
@@ -1958,18 +1958,18 @@
srl b
rr c
ld a, [hli]
- ld [Buffer2], a
+ ld [wBuffer2], a
ld a, [hl]
- ld [Buffer1], a
+ ld [wBuffer1], a
ret
; 3ccde
CheckUserHasEnoughHP: ; 3ccde
- ld hl, BattleMonHP + 1
+ ld hl, wBattleMonHP + 1
ld a, [hBattleTurn]
and a
jr z, .ok
- ld hl, EnemyMonHP + 1
+ ld hl, wEnemyMonHP + 1
.ok
ld a, c
sub [hl]
@@ -1980,33 +1980,33 @@
; 3ccef
RestoreHP ; 3ccef
- ld hl, EnemyMonMaxHP
+ ld hl, wEnemyMonMaxHP
ld a, [hBattleTurn]
and a
jr z, .ok
- ld hl, BattleMonMaxHP
+ ld hl, wBattleMonMaxHP
.ok
ld a, [hli]
- ld [Buffer2], a
+ ld [wBuffer2], a
ld a, [hld]
- ld [Buffer1], a
+ ld [wBuffer1], a
dec hl
ld a, [hl]
- ld [Buffer3], a
+ ld [wBuffer3], a
add c
ld [hld], a
- ld [Buffer5], a
+ ld [wBuffer5], a
ld a, [hl]
- ld [Buffer4], a
+ ld [wBuffer4], a
adc b
ld [hli], a
- ld [Buffer6], a
+ ld [wBuffer6], a
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld c, a
ld a, [hld]
sub c
- ld a, [Buffer2]
+ ld a, [wBuffer2]
ld b, a
ld a, [hl]
sbc b
@@ -2013,10 +2013,10 @@
jr c, .asm_3cd2d
ld a, b
ld [hli], a
- ld [Buffer6], a
+ ld [wBuffer6], a
ld a, c
ld [hl], a
- ld [Buffer5], a
+ ld [wBuffer5], a
.asm_3cd2d
call SwitchTurnCore
@@ -2047,7 +2047,7 @@
HandleEnemyMonFaint: ; 3cd55
call FaintEnemyPokemon
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld a, [hli]
or [hl]
call z, FaintYourPokemon
@@ -2059,7 +2059,7 @@
and a
jp z, LostBattle
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld a, [hli]
or [hl]
call nz, UpdatePlayerHUD
@@ -2074,7 +2074,7 @@
jr nz, .trainer
ld a, 1
- ld [BattleEnded], a
+ ld [wBattleEnded], a
ret
.trainer
@@ -2081,7 +2081,7 @@
call CheckEnemyTrainerDefeated
jp z, WinTrainerBattle
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld a, [hli]
or [hl]
jr nz, .player_mon_not_fainted
@@ -2090,7 +2090,7 @@
jr nc, .dont_flee
ld a, 1
- ld [BattleEnded], a
+ ld [wBattleEnded], a
ret
.dont_flee
@@ -2099,7 +2099,7 @@
jp c, WildFled_EnemyFled_LinkBattleCanceled
ld a, $1
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
call HandleEnemySwitch
jp z, WildFled_EnemyFled_LinkBattleCanceled
jr DoubleSwitch
@@ -2106,11 +2106,11 @@
.player_mon_not_fainted
ld a, $1
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
call HandleEnemySwitch
jp z, WildFled_EnemyFled_LinkBattleCanceled
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ret
; 3cdca
@@ -2128,7 +2128,7 @@
jr .done
.player_1
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
push af
ld a, $1
call EnemyPartyMonEntrance
@@ -2135,12 +2135,12 @@
call ClearSprites
call LoadTileMapToTempTileMap
pop af
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
call PlayerPartyMonEntrance
.done
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ret
; 3ce01
@@ -2149,8 +2149,8 @@
ld a, [wBattleMode]
dec a
jr z, .wild
- ld a, [CurOTMon]
- ld hl, OTPartyMon1HP
+ ld a, [wCurOTMon]
+ ld hl, wOTPartyMon1HP
call GetPartyLocation
xor a
ld [hli], a
@@ -2157,10 +2157,10 @@
ld [hl], a
.wild
- ld hl, PlayerSubStatus3
+ ld hl, wPlayerSubStatus3
res SUBSTATUS_IN_LOOP, [hl]
xor a
- ld hl, EnemyDamageTaken
+ ld hl, wEnemyDamageTaken
ld [hli], a
ld [hl], a
call NewEnemyMonStatus
@@ -2173,10 +2173,10 @@
.wild2
call StopDangerSound
ld a, $1
- ld [wDanger], a
+ ld [wBattleLowHealthAlarm], a
.trainer
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld a, [hli]
or [hl]
jr nz, .player_mon_did_not_faint
@@ -2200,8 +2200,8 @@
ld [wBattleResult], a
call IsAnyMonHoldingExpShare
jr z, .skip_exp
- ld hl, EnemyMonBaseStats
- ld b, EnemyMonEnd - EnemyMonBaseStats
+ ld hl, wEnemyMonBaseStats
+ ld b, wEnemyMonEnd - wEnemyMonBaseStats
.loop
srl [hl]
inc hl
@@ -2209,9 +2209,9 @@
jr nz, .loop
.skip_exp
- ld hl, EnemyMonBaseStats
+ ld hl, wEnemyMonBaseStats
ld de, wBackupEnemyMonBaseStats
- ld bc, EnemyMonEnd - EnemyMonBaseStats
+ ld bc, wEnemyMonEnd - wEnemyMonBaseStats
call CopyBytes
xor a
ld [wGivingExperienceToExpShareHolders], a
@@ -2224,8 +2224,8 @@
ld a, d
ld [wBattleParticipantsNotFainted], a
ld hl, wBackupEnemyMonBaseStats
- ld de, EnemyMonBaseStats
- ld bc, EnemyMonEnd - EnemyMonBaseStats
+ ld de, wEnemyMonBaseStats
+ ld bc, wEnemyMonEnd - wEnemyMonBaseStats
call CopyBytes
ld a, $1
ld [wGivingExperienceToExpShareHolders], a
@@ -2236,9 +2236,9 @@
; 3ceaa
IsAnyMonHoldingExpShare: ; 3ceaa
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld b, a
- ld hl, PartyMon1
+ ld hl, wPartyMon1
ld c, 1
ld d, 0
.loop
@@ -2293,7 +2293,7 @@
StopDangerSound: ; 3ceec
xor a
- ld [Danger], a
+ ld [wLowHealthAlarm], a
ret
; 3cef1
@@ -2301,8 +2301,8 @@
call StopDangerSound
call WaitSFX
ld a, $f0
- ld [CryTracks], a
- ld a, [BattleMonSpecies]
+ ld [wCryTracks], a
+ ld a, [wBattleMonSpecies]
call PlayStereoCry
call PlayerMonFaintedAnimation
hlcoord 9, 7
@@ -2327,10 +2327,10 @@
; 3cf35
CheckEnemyTrainerDefeated: ; 3cf35
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
ld b, a
xor a
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
ld de, PARTYMON_STRUCT_LENGTH
.loop
@@ -2347,7 +2347,7 @@
; 3cf4a
HandleEnemySwitch: ; 3cf4a
- ld hl, EnemyHPPal
+ ld hl, wEnemyHPPal
ld e, HP_BAR_LENGTH_PX
call UpdateHPPal
call WaitBGMap
@@ -2364,7 +2364,7 @@
call Call_LoadTempTileMapToTileMap
.not_linked
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld a, [hli]
or [hl]
ld a, $0
@@ -2394,7 +2394,7 @@
call SpikesDamage
xor a
ld [wEnemyMoveStruct + MOVE_ANIM], a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
inc a
ret
; 3cfa4
@@ -2403,8 +2403,8 @@
; Player won the battle
call StopDangerSound
ld a, $1
- ld [wDanger], a
- ld [BattleEnded], a
+ ld [wBattleLowHealthAlarm], a
+ ld [wBattleEnded], a
ld a, [wLinkMode]
and a
ld a, b
@@ -2419,7 +2419,7 @@
and a
ret nz
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
bit 0, a
jr nz, .battle_tower
@@ -2426,7 +2426,7 @@
call BattleWinSlideInEnemyTrainerFrontpic
ld c, 40
call DelayFrames
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_CANLOSE
jr nz, .skip_heal
predef HealParty
@@ -2535,7 +2535,7 @@
.AddMoneyToWallet: ; 3d08d
push bc
ld hl, wBattleReward + 2
- ld de, Money + 2
+ ld de, wMoney + 2
call AddBattleMoneyToAccount
pop bc
ret
@@ -2652,7 +2652,7 @@
ld hl, GymLeaders
IsGymLeaderCommon:
push de
- ld a, [OtherTrainerClass]
+ ld a, [wOtherTrainerClass]
ld de, $1
call IsInArray
pop de
@@ -2663,7 +2663,7 @@
HandlePlayerMonFaint: ; 3d14e
call FaintYourPokemon
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld a, [hli]
or [hl]
call z, FaintEnemyPokemon
@@ -2674,7 +2674,7 @@
ld a, d
and a
jp z, LostBattle
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld a, [hli]
or [hl]
jr nz, .notfainted
@@ -2683,7 +2683,7 @@
dec a
jr nz, .trainer
ld a, $1
- ld [BattleEnded], a
+ ld [wBattleEnded], a
ret
.trainer
@@ -2694,7 +2694,7 @@
call AskUseNextPokemon
jr nc, .switch
ld a, $1
- ld [BattleEnded], a
+ ld [wBattleEnded], a
ret
.switch
@@ -2705,7 +2705,7 @@
and a
ret nz
ld a, $1
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
call HandleEnemySwitch
jp z, WildFled_EnemyFled_LinkBattleCanceled
jp DoubleSwitch
@@ -2712,33 +2712,33 @@
; 3d1aa
PlayerMonFaintHappinessMod: ; 3d1aa
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
ld c, a
ld hl, wBattleParticipantsNotFainted
ld b, RESET_FLAG
predef SmallFarFlagAction
- ld hl, EnemySubStatus3
+ ld hl, wEnemySubStatus3
res SUBSTATUS_IN_LOOP, [hl]
xor a
- ld [Danger], a
- ld hl, PlayerDamageTaken
+ ld [wLowHealthAlarm], a
+ ld hl, wPlayerDamageTaken
ld [hli], a
ld [hl], a
- ld [BattleMonStatus], a
+ ld [wBattleMonStatus], a
call UpdateBattleMonInParty
ld c, HAPPINESS_FAINTED
; If TheirLevel > (YourLevel + 30), use a different parameter
- ld a, [BattleMonLevel]
+ ld a, [wBattleMonLevel]
add 30
ld b, a
- ld a, [EnemyMonLevel]
+ ld a, [wEnemyMonLevel]
cp b
jr c, .got_param
ld c, HAPPINESS_BEATENBYSTRONGFOE
.got_param
- ld a, [CurBattleMon]
- ld [CurPartyMon], a
+ ld a, [wCurBattleMon]
+ ld [wCurPartyMon], a
callfar ChangeHappiness
ld a, [wBattleResult]
and %11000000
@@ -2774,8 +2774,8 @@
ld a, [wMenuCursorY]
cp $1 ; YES
jr z, .loop
- ld hl, PartyMon1Speed
- ld de, EnemyMonSpeed
+ ld hl, wPartyMon1Speed
+ ld de, wEnemyMonSpeed
jp TryToRunAwayFromBattle
; 3d227
@@ -2788,15 +2788,15 @@
and a
jr z, .skip_link
ld a, $1
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
call LinkBattleSendReceiveAction
.skip_link
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
call CheckMobileBattleError
jr c, .enemy_fainted_mobile_error
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld a, [hli]
or [hl]
jr nz, .send_out_pokemon
@@ -2816,10 +2816,10 @@
.send_out_pokemon
call ClearSprites
- ld a, [CurBattleMon]
- ld [LastPlayerMon], a
- ld a, [CurPartyMon]
- ld [CurBattleMon], a
+ ld a, [wCurBattleMon]
+ ld [wLastPlayerMon], a
+ ld a, [wCurPartyMon]
+ ld [wCurBattleMon], a
call AddBattleParticipant
call InitBattleMon
call ResetPlayerStatLevels
@@ -2844,10 +2844,10 @@
; 3d2b3
PlayerPartyMonEntrance: ; 3d2b3
- ld a, [CurBattleMon]
- ld [LastPlayerMon], a
- ld a, [CurPartyMon]
- ld [CurBattleMon], a
+ ld a, [wCurBattleMon]
+ ld [wLastPlayerMon], a
+ ld a, [wCurPartyMon]
+ ld [wCurBattleMon], a
call AddBattleParticipant
call InitBattleMon
call ResetPlayerStatLevels
@@ -2918,7 +2918,7 @@
PickPartyMonInBattle: ; 3d33c
.loop
ld a, PARTYMENUACTION_SWITCH ; Which PKMN?
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
call JumpToPartyMenuAndPrintText
call SelectBattleMon
ret c
@@ -2929,8 +2929,8 @@
; 3d34f
SwitchMonAlreadyOut: ; 3d34f
- ld hl, CurBattleMon
- ld a, [CurPartyMon]
+ ld hl, wCurBattleMon
+ ld a, [wCurPartyMon]
cp [hl]
jr nz, .notout
@@ -2985,13 +2985,13 @@
LostBattle: ; 3d38e
ld a, 1
- ld [BattleEnded], a
+ ld [wBattleEnded], a
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
bit 0, a
jr nz, .battle_tower
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_CANLOSE
jr nz, .not_canlose
@@ -3229,7 +3229,7 @@
xor a
ld [wBattleParticipantsNotFainted], a
ld [wBattleParticipantsIncludingFainted], a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
inc a
ld [wEnemyIsSwitching], a
call LoadTileMapToTempTileMap
@@ -3288,10 +3288,10 @@
ResetEnemyBattleVars: ; 3d557
; and draw empty TextBox
xor a
- ld [LastPlayerCounterMove], a
- ld [LastEnemyCounterMove], a
- ld [LastEnemyMove], a
- ld [CurEnemyMove], a
+ ld [wLastPlayerCounterMove], a
+ ld [wLastEnemyCounterMove], a
+ ld [wLastEnemyMove], a
+ ld [wCurEnemyMove], a
dec a
ld [wEnemyItemState], a
xor a
@@ -3308,7 +3308,7 @@
ld [wBattleParticipantsNotFainted], a
ld [wBattleParticipantsIncludingFainted], a
AddBattleParticipant: ; 3d581
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
ld c, a
ld hl, wBattleParticipantsNotFainted
ld b, SET_FLAG
@@ -3322,21 +3322,21 @@
FindPkmnInOTPartyToSwitchIntoBattle: ; 3d599
ld b, $ff
ld a, $1
- ld [Buffer1], a
- ld [Buffer2], a
+ ld [wBuffer1], a
+ ld [wBuffer2], a
.loop
- ld hl, Buffer1
+ ld hl, wBuffer1
sla [hl]
inc hl
sla [hl]
inc b
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
cp b
jp z, ScoreMonTypeMatchups
- ld a, [CurOTMon]
+ ld a, [wCurOTMon]
cp b
jr z, .discourage
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
push bc
ld a, b
call GetPartyLocation
@@ -3351,7 +3351,7 @@
jr .loop
.discourage
- ld hl, Buffer2
+ ld hl, wBuffer2
set 0, [hl]
jr .loop
; 3d5d7
@@ -3358,7 +3358,7 @@
LookUpTheEffectivenessOfEveryMove: ; 3d5d7
push bc
- ld hl, OTPartyMon1Moves
+ ld hl, wOTPartyMon1Moves
ld a, b
call GetPartyLocation
pop bc
@@ -3387,7 +3387,7 @@
ld a, [wd265] ; Get The Effectiveness Modifier
cp 10 + 1 ; 1.0 + 0.1
jr c, .loop
- ld hl, Buffer1
+ ld hl, wBuffer1
set 0, [hl]
ret
.done
@@ -3398,7 +3398,7 @@
; Calculates the effectiveness of the types of the PlayerPkmn
; against the OTPkmn
push bc
- ld hl, OTPartyCount
+ ld hl, wOTPartyCount
ld a, b
inc a
ld c, a
@@ -3409,11 +3409,11 @@
ld hl, BaseData + BASE_TYPES
ld bc, BASE_DATA_SIZE
call AddNTimes
- ld de, EnemyMonType
+ ld de, wEnemyMonType
ld bc, BASE_CATCH_RATE - BASE_TYPES
ld a, BANK(BaseData)
call FarCopyBytes
- ld a, [BattleMonType1]
+ ld a, [wBattleMonType1]
ld [wPlayerMoveStruct + MOVE_TYPE], a
call SetPlayerTurn
callfar BattleCheckTypeMatchup
@@ -3420,7 +3420,7 @@
ld a, [wd265]
cp 10 + 1 ; 1.0 + 0.1
jr nc, .super_effective
- ld a, [BattleMonType2]
+ ld a, [wBattleMonType2]
ld [wPlayerMoveStruct + MOVE_TYPE], a
callfar BattleCheckTypeMatchup
ld a, [wd265]
@@ -3431,7 +3431,7 @@
.super_effective
pop bc
- ld hl, Buffer1
+ ld hl, wBuffer1
bit 0, [hl]
jr nz, .reset
inc hl
@@ -3445,12 +3445,12 @@
ScoreMonTypeMatchups: ; 3d672
.loop1
- ld hl, Buffer1
+ ld hl, wBuffer1
sla [hl]
inc hl
sla [hl]
jr nc, .loop1
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
ld b, a
ld c, [hl]
.loop2
@@ -3461,7 +3461,7 @@
jr .loop2
.okay
- ld a, [Buffer1]
+ ld a, [wBuffer1]
and a
jr z, .okay2
ld b, $ff
@@ -3474,7 +3474,7 @@
.okay2
ld b, $ff
- ld a, [Buffer2]
+ ld a, [wBuffer2]
ld c, a
.loop4
inc b
@@ -3483,7 +3483,7 @@
jr .quit
.loop5
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
ld b, a
call BattleRandom
and $7
@@ -3490,10 +3490,10 @@
cp b
jr nc, .loop5
ld b, a
- ld a, [CurOTMon]
+ ld a, [wCurOTMon]
cp b
jr z, .loop5
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
push bc
ld a, b
call GetPartyLocation
@@ -3511,35 +3511,35 @@
LoadEnemyPkmnToSwitchTo: ; 3d6ca
; 'b' contains the PartyNr of the Pkmn the AI will switch to
ld a, b
- ld [CurPartyMon], a
- ld hl, OTPartyMon1Level
+ ld [wCurPartyMon], a
+ ld hl, wOTPartyMon1Level
call GetPartyLocation
ld a, [hl]
- ld [CurPartyLevel], a
- ld a, [CurPartyMon]
+ ld [wCurPartyLevel], a
+ ld a, [wCurPartyMon]
inc a
- ld hl, OTPartyCount
+ ld hl, wOTPartyCount
ld c, a
ld b, 0
add hl, bc
ld a, [hl]
- ld [TempEnemyMonSpecies], a
- ld [CurPartySpecies], a
+ ld [wTempEnemyMonSpecies], a
+ ld [wCurPartySpecies], a
call LoadEnemyMon
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp UNOWN
jr nz, .skip_unown
ld a, [wFirstUnownSeen]
and a
jr nz, .skip_unown
- ld hl, EnemyMonDVs
+ ld hl, wEnemyMonDVs
predef GetUnownLetter
- ld a, [UnownLetter]
+ ld a, [wUnownLetter]
ld [wFirstUnownSeen], a
.skip_unown
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld a, [hli]
ld [wEnemyHPAtTimeOfPlayerSwitch], a
ld a, [hl]
@@ -3551,23 +3551,23 @@
ld a, [wBattleHasJustStarted]
dec a
jp z, .return_nc
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
jp z, .return_nc
ld a, [wLinkMode]
and a
jp nz, .return_nc
- ld a, [Options]
+ ld a, [wOptions]
bit BATTLE_SHIFT, a
jr nz, .return_nc
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
push af
- ld a, [CurBattleMon]
- ld [CurPartyMon], a
+ ld a, [wCurBattleMon]
+ ld [wCurPartyMon], a
farcall CheckCurPartyMonFainted
pop bc
ld a, b
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
jr c, .return_nc
scf
ret
@@ -3578,7 +3578,7 @@
; 3d74b
OfferSwitch: ; 3d74b
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
push af
callfar Battle_GetTrainerName
ld hl, BattleText_EnemyIsAboutToUseWillPlayerChangePkmn
@@ -3591,18 +3591,18 @@
call SetUpBattlePartyMenu_NoLoop
call PickSwitchMonInBattle
jr c, .canceled_switch
- ld a, [CurBattleMon]
- ld [LastPlayerMon], a
- ld a, [CurPartyMon]
- ld [CurBattleMon], a
+ ld a, [wCurBattleMon]
+ ld [wLastPlayerMon], a
+ ld a, [wCurPartyMon]
+ ld [wCurBattleMon], a
call ClearPalettes
call DelayFrame
call _LoadHPBar
pop af
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
xor a
- ld [CurEnemyMove], a
- ld [CurPlayerMove], a
+ ld [wCurEnemyMove], a
+ ld [wCurPlayerMove], a
and a
ret
@@ -3613,7 +3613,7 @@
.said_no
pop af
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
scf
ret
; 3d7a0
@@ -3638,12 +3638,12 @@
; 3d7c7
Function_SetEnemyPkmnAndSendOutAnimation: ; 3d7c7
- ld a, [TempEnemyMonSpecies]
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld a, [wTempEnemyMonSpecies]
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
call GetBaseData
ld a, OTPARTYMON
- ld [MonType], a
+ ld [wMonType], a
predef CopyPkmnToTempMon
call GetEnemyMonFrontpic
@@ -3662,7 +3662,7 @@
call Call_PlayBattleAnim
.not_shiny
- ld bc, TempMonSpecies
+ ld bc, wTempMonSpecies
farcall CheckFaintedFrzSlp
jr c, .skip_cry
farcall CheckBattleScene
@@ -3675,8 +3675,8 @@
.cry_no_anim
ld a, $f
- ld [CryTracks], a
- ld a, [TempEnemyMonSpecies]
+ ld [wCryTracks], a
+ ld a, [wTempEnemyMonSpecies]
call PlayStereoCry
.skip_cry
@@ -3688,24 +3688,24 @@
NewEnemyMonStatus: ; 3d834
xor a
- ld [LastPlayerCounterMove], a
- ld [LastEnemyCounterMove], a
- ld [LastEnemyMove], a
- ld hl, EnemySubStatus1
+ ld [wLastPlayerCounterMove], a
+ ld [wLastEnemyCounterMove], a
+ ld [wLastEnemyMove], a
+ ld hl, wEnemySubStatus1
rept 4
ld [hli], a
endr
ld [hl], a
- ld [EnemyDisableCount], a
- ld [EnemyFuryCutterCount], a
- ld [EnemyProtectCount], a
+ ld [wEnemyDisableCount], a
+ ld [wEnemyFuryCutterCount], a
+ ld [wEnemyProtectCount], a
ld [wEnemyRageCounter], a
- ld [EnemyDisabledMove], a
+ ld [wEnemyDisabledMove], a
ld [wEnemyMinimized], a
ld [wPlayerWrapCount], a
ld [wEnemyWrapCount], a
- ld [EnemyTurnsTaken], a
- ld hl, PlayerSubStatus5
+ ld [wEnemyTurnsTaken], a
+ ld hl, wPlayerSubStatus5
res SUBSTATUS_CANT_RUN, [hl]
ret
; 3d867
@@ -3713,7 +3713,7 @@
ResetEnemyStatLevels: ; 3d867
ld a, BASE_STAT_LEVEL
ld b, NUM_LEVEL_STATS
- ld hl, EnemyStatLevels
+ ld hl, wEnemyStatLevels
.loop
ld [hli], a
dec b
@@ -3723,11 +3723,11 @@
CheckPlayerPartyForFitPkmn: ; 3d873
; Has the player any Pkmn in his Party that can fight?
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld e, a
xor a
- ld hl, PartyMon1HP
- ld bc, PartyMon2 - (PartyMon1 + 1)
+ ld hl, wPartyMon1HP
+ ld bc, wPartyMon2 - (wPartyMon1 + 1)
.loop
or [hl]
inc hl
@@ -3740,8 +3740,8 @@
; 3d887
CheckIfCurPartyMonIsFitToFight: ; 3d887
- ld a, [CurPartyMon]
- ld hl, PartyMon1HP
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1HP
call GetPartyLocation
ld a, [hli]
or [hl]
@@ -3750,8 +3750,8 @@
ld a, [wBattleHasJustStarted]
and a
jr nz, .finish_fail
- ld hl, PartySpecies
- ld a, [CurPartyMon]
+ ld hl, wPartySpecies
+ ld a, [wCurPartyMon]
ld c, a
ld b, 0
add hl, bc
@@ -3772,7 +3772,7 @@
TryToRunAwayFromBattle: ; 3d8b3
; Run away from battle, with or without item
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_DEBUG
jp z, .can_escape
cp BATTLETYPE_CONTEST
@@ -3794,7 +3794,7 @@
dec a
jp nz, .cant_run_from_trainer
- ld a, [EnemySubStatus5]
+ ld a, [wEnemySubStatus5]
bit SUBSTATUS_CANT_RUN, a
jp nz, .cant_escape
@@ -3804,7 +3804,7 @@
push hl
push de
- ld a, [BattleMonItem]
+ ld a, [wBattleMonItem]
ld [wd265], a
ld b, a
callfar GetItemHeldEffect
@@ -3883,7 +3883,7 @@
cp b
jr nc, .can_escape
ld a, $1
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ld hl, BattleText_CantEscape2
jr .print_inescapable_text
@@ -3909,11 +3909,11 @@
jr z, .fled
call LoadTileMapToTempTileMap
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ld a, $f
- ld [CurMoveNum], a
+ ld [wCurMoveNum], a
xor a
- ld [CurPlayerMove], a
+ ld [wCurPlayerMove], a
call LinkBattleSendReceiveAction
call Call_LoadTempTileMapToTileMap
call CheckMobileBattleError
@@ -3962,37 +3962,37 @@
InitBattleMon: ; 3da0d
ld a, MON_SPECIES
call GetPartyParamLocation
- ld de, BattleMonSpecies
+ ld de, wBattleMonSpecies
ld bc, MON_ID
call CopyBytes
ld bc, MON_DVS - MON_ID
add hl, bc
- ld de, BattleMonDVs
+ ld de, wBattleMonDVs
ld bc, MON_PKRUS - MON_DVS
call CopyBytes
inc hl
inc hl
inc hl
- ld de, BattleMonLevel
+ ld de, wBattleMonLevel
ld bc, PARTYMON_STRUCT_LENGTH - MON_LEVEL
call CopyBytes
- ld a, [BattleMonSpecies]
- ld [TempBattleMonSpecies], a
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld a, [wBattleMonSpecies]
+ ld [wTempBattleMonSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [BaseType1]
- ld [BattleMonType1], a
- ld a, [BaseType2]
- ld [BattleMonType2], a
- ld hl, PartyMonNicknames
- ld a, [CurBattleMon]
+ ld a, [wBaseType1]
+ ld [wBattleMonType1], a
+ ld a, [wBaseType2]
+ ld [wBattleMonType2], a
+ ld hl, wPartyMonNicknames
+ ld a, [wCurBattleMon]
call SkipNames
- ld de, BattleMonNick
+ ld de, wBattleMonNick
ld bc, MON_NAME_LENGTH
call CopyBytes
- ld hl, BattleMonAttack
- ld de, PlayerStats
+ ld hl, wBattleMonAttack
+ ld de, wPlayerStats
ld bc, PARTYMON_STRUCT_LENGTH - MON_ATK
call CopyBytes
call ApplyStatusEffectOnPlayerStats
@@ -4015,18 +4015,18 @@
; 3da85
GetPartyMonDVs: ; 3da85
- ld hl, BattleMonDVs
- ld a, [PlayerSubStatus5]
+ ld hl, wBattleMonDVs
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_TRANSFORMED, a
ret z
- ld hl, PartyMon1DVs
- ld a, [CurBattleMon]
+ ld hl, wPartyMon1DVs
+ ld a, [wCurBattleMon]
jp GetPartyLocation
; 3da97
GetEnemyMonDVs: ; 3da97
- ld hl, EnemyMonDVs
- ld a, [EnemySubStatus5]
+ ld hl, wEnemyMonDVs
+ ld a, [wEnemySubStatus5]
bit SUBSTATUS_TRANSFORMED, a
ret z
ld hl, wEnemyBackupDVs
@@ -4033,8 +4033,8 @@
ld a, [wBattleMode]
dec a
ret z
- ld hl, OTPartyMon1DVs
- ld a, [CurOTMon]
+ ld hl, wOTPartyMon1DVs
+ ld a, [wCurOTMon]
jp GetPartyLocation
; 3dab1
@@ -4041,7 +4041,7 @@
ResetPlayerStatLevels: ; 3dab1
ld a, BASE_STAT_LEVEL
ld b, NUM_LEVEL_STATS
- ld hl, PlayerStatLevels
+ ld hl, wPlayerStatLevels
.loop
ld [hli], a
dec b
@@ -4050,46 +4050,46 @@
; 3dabd
InitEnemyMon: ; 3dabd
- ld a, [CurPartyMon]
- ld hl, OTPartyMon1Species
+ ld a, [wCurPartyMon]
+ ld hl, wOTPartyMon1Species
call GetPartyLocation
- ld de, EnemyMonSpecies
+ ld de, wEnemyMonSpecies
ld bc, MON_ID
call CopyBytes
ld bc, MON_DVS - MON_ID
add hl, bc
- ld de, EnemyMonDVs
+ ld de, wEnemyMonDVs
ld bc, MON_PKRUS - MON_DVS
call CopyBytes
inc hl
inc hl
inc hl
- ld de, EnemyMonLevel
+ ld de, wEnemyMonLevel
ld bc, PARTYMON_STRUCT_LENGTH - MON_LEVEL
call CopyBytes
- ld a, [EnemyMonSpecies]
- ld [CurSpecies], a
+ ld a, [wEnemyMonSpecies]
+ ld [wCurSpecies], a
call GetBaseData
- ld hl, OTPartyMonNicknames
- ld a, [CurPartyMon]
+ ld hl, wOTPartyMonNicknames
+ ld a, [wCurPartyMon]
call SkipNames
- ld de, EnemyMonNick
+ ld de, wEnemyMonNick
ld bc, MON_NAME_LENGTH
call CopyBytes
- ld hl, EnemyMonAttack
- ld de, EnemyStats
+ ld hl, wEnemyMonAttack
+ ld de, wEnemyStats
ld bc, PARTYMON_STRUCT_LENGTH - MON_ATK
call CopyBytes
call ApplyStatusEffectOnEnemyStats
- ld hl, BaseType1
- ld de, EnemyMonType1
+ ld hl, wBaseType1
+ ld de, wEnemyMonType1
ld a, [hli]
ld [de], a
inc de
ld a, [hl]
ld [de], a
- ld hl, BaseStats
- ld de, EnemyMonBaseStats
+ ld hl, wBaseStats
+ ld de, wEnemyMonBaseStats
ld b, 5
.loop
ld a, [hli]
@@ -4097,17 +4097,17 @@
inc de
dec b
jr nz, .loop
- ld a, [CurPartyMon]
- ld [CurOTMon], a
+ ld a, [wCurPartyMon]
+ ld [wCurOTMon], a
ret
; 3db32
SwitchPlayerMon: ; 3db32
call ClearSprites
- ld a, [CurBattleMon]
- ld [LastPlayerMon], a
- ld a, [CurPartyMon]
- ld [CurBattleMon], a
+ ld a, [wCurBattleMon]
+ ld [wLastPlayerMon], a
+ ld a, [wCurPartyMon]
+ ld [wCurBattleMon], a
call AddBattleParticipant
call InitBattleMon
call ResetPlayerStatLevels
@@ -4116,7 +4116,7 @@
call SendOutPlayerMon
call EmptyBattleTextBox
call LoadTileMapToTempTileMap
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld a, [hli]
or [hl]
ret
@@ -4123,7 +4123,7 @@
; 3db5f
SendOutPlayerMon: ; 3db5f
- ld hl, BattleMonDVs
+ ld hl, wBattleMonDVs
predef GetUnownLetter
hlcoord 1, 5
ld b, 7
@@ -4136,12 +4136,12 @@
xor a
ld [hGraphicStartTile], a
ld [wBattleMenuCursorBuffer], a
- ld [CurMoveNum], a
- ld [TypeModifier], a
+ ld [wCurMoveNum], a
+ ld [wTypeModifier], a
ld [wPlayerMoveStruct + MOVE_ANIM], a
- ld [LastPlayerCounterMove], a
- ld [LastEnemyCounterMove], a
- ld [LastPlayerMove], a
+ ld [wLastPlayerCounterMove], a
+ ld [wLastEnemyCounterMove], a
+ ld [wLastPlayerMove], a
call CheckAmuletCoin
call FinishBattleAnim
xor a
@@ -4167,8 +4167,8 @@
farcall CheckFaintedFrzSlp
jr c, .statused
ld a, $f0
- ld [CryTracks], a
- ld a, [CurPartySpecies]
+ ld [wCryTracks], a
+ ld a, [wCurPartySpecies]
call PlayStereoCry
.statused
@@ -4180,50 +4180,50 @@
NewBattleMonStatus: ; 3dbde
xor a
- ld [LastPlayerCounterMove], a
- ld [LastEnemyCounterMove], a
- ld [LastPlayerMove], a
- ld hl, PlayerSubStatus1
+ ld [wLastPlayerCounterMove], a
+ ld [wLastEnemyCounterMove], a
+ ld [wLastPlayerMove], a
+ ld hl, wPlayerSubStatus1
rept 4
ld [hli], a
endr
ld [hl], a
- ld hl, PlayerUsedMoves
+ ld hl, wPlayerUsedMoves
ld [hli], a
ld [hli], a
ld [hli], a
ld [hl], a
- ld [PlayerDisableCount], a
- ld [PlayerFuryCutterCount], a
- ld [PlayerProtectCount], a
+ ld [wPlayerDisableCount], a
+ ld [wPlayerFuryCutterCount], a
+ ld [wPlayerProtectCount], a
ld [wPlayerRageCounter], a
- ld [DisabledMove], a
+ ld [wDisabledMove], a
ld [wPlayerMinimized], a
ld [wEnemyWrapCount], a
ld [wPlayerWrapCount], a
- ld [PlayerTurnsTaken], a
- ld hl, EnemySubStatus5
+ ld [wPlayerTurnsTaken], a
+ ld hl, wEnemySubStatus5
res SUBSTATUS_CANT_RUN, [hl]
ret
; 3dc18
BreakAttraction: ; 3dc18
- ld hl, PlayerSubStatus1
+ ld hl, wPlayerSubStatus1
res SUBSTATUS_IN_LOVE, [hl]
- ld hl, EnemySubStatus1
+ ld hl, wEnemySubStatus1
res SUBSTATUS_IN_LOVE, [hl]
ret
; 3dc23
SpikesDamage: ; 3dc23
- ld hl, PlayerScreens
- ld de, BattleMonType
+ ld hl, wPlayerScreens
+ ld de, wBattleMonType
ld bc, UpdatePlayerHUD
ld a, [hBattleTurn]
and a
jr z, .ok
- ld hl, EnemyScreens
- ld de, EnemyMonType
+ ld hl, wEnemyScreens
+ ld de, wEnemyMonType
ld bc, UpdateEnemyHUD
.ok
@@ -4265,7 +4265,7 @@
cp EFFECT_PURSUIT
jr nz, .done
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
push af
ld hl, DoPlayerTurn
@@ -4273,8 +4273,8 @@
and a
jr z, .do_turn
ld hl, DoEnemyTurn
- ld a, [LastPlayerMon]
- ld [CurBattleMon], a
+ ld a, [wLastPlayerMon]
+ ld [wCurBattleMon], a
.do_turn
ld a, BANK(DoPlayerTurn)
rst FarCall
@@ -4285,24 +4285,24 @@
ld [hl], a
pop af
- ld [CurBattleMon], a
+ ld [wCurBattleMon], a
ld a, [hBattleTurn]
and a
jr z, .check_enemy_fainted
- ld a, [LastPlayerMon]
+ ld a, [wLastPlayerMon]
call UpdateBattleMon
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld a, [hli]
or [hl]
jr nz, .done
ld a, $f0
- ld [CryTracks], a
- ld a, [BattleMonSpecies]
+ ld [wCryTracks], a
+ ld a, [wBattleMonSpecies]
call PlayStereoCry
- ld a, [LastPlayerMon]
+ ld a, [wLastPlayerMon]
ld c, a
ld hl, wBattleParticipantsNotFainted
ld b, RESET_FLAG
@@ -4312,7 +4312,7 @@
jr .done_fainted
.check_enemy_fainted
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld a, [hli]
or [hl]
jr nz, .done
@@ -4378,13 +4378,13 @@
ld a, b
cp HELD_BERRY
ret nz
- ld de, EnemyMonHP + 1
- ld hl, EnemyMonMaxHP
+ ld de, wEnemyMonHP + 1
+ ld hl, wEnemyMonMaxHP
ld a, [hBattleTurn]
and a
jr z, .go
- ld de, BattleMonHP + 1
- ld hl, BattleMonMaxHP
+ ld de, wBattleMonHP + 1
+ ld hl, wBattleMonMaxHP
.go
; If, and only if, Pokemon's HP is less than half max, use the item.
@@ -4391,13 +4391,13 @@
; Store current HP in Buffer 3/4
push bc
ld a, [de]
- ld [Buffer3], a
+ ld [wBuffer3], a
add a
ld c, a
dec de
ld a, [de]
inc de
- ld [Buffer4], a
+ ld [wBuffer4], a
adc a
ld b, a
ld a, b
@@ -4416,19 +4416,19 @@
.less
call ItemRecoveryAnim
- ; store max HP in Buffer1/2
+ ; store max HP in wBuffer1/2
ld a, [hli]
- ld [Buffer2], a
+ ld [wBuffer2], a
ld a, [hl]
- ld [Buffer1], a
+ ld [wBuffer1], a
ld a, [de]
add c
- ld [Buffer5], a
+ ld [wBuffer5], a
ld c, a
dec de
ld a, [de]
adc $0
- ld [Buffer6], a
+ ld [wBuffer6], a
ld b, a
ld a, [hld]
cp c
@@ -4436,15 +4436,15 @@
sbc b
jr nc, .okay
ld a, [hli]
- ld [Buffer6], a
+ ld [wBuffer6], a
ld a, [hl]
- ld [Buffer5], a
+ ld [wBuffer5], a
.okay
- ld a, [Buffer6]
+ ld a, [wBuffer6]
ld [de], a
inc de
- ld a, [Buffer5]
+ ld a, [wBuffer5]
ld [de], a
ld a, [hBattleTurn]
ld [wWhichHPBar], a
@@ -4473,11 +4473,11 @@
push bc
call EmptyBattleTextBox
ld a, RECOVER
- ld [FXAnimID], a
+ ld [wFXAnimID], a
call SwitchTurnCore
xor a
ld [wNumHits], a
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
predef PlayBattleAnim
call SwitchTurnCore
pop bc
@@ -4646,7 +4646,7 @@
rst FarCall
pop bc
pop de
- ld a, [FailedMessage]
+ ld a, [wFailedMessage]
and a
ret nz
xor a
@@ -4676,18 +4676,18 @@
; 3df12
GetPartymonItem: ; 3df12
- ld hl, PartyMon1Item
- ld a, [CurBattleMon]
+ ld hl, wPartyMon1Item
+ ld a, [wCurBattleMon]
call GetPartyLocation
- ld bc, BattleMonItem
+ ld bc, wBattleMonItem
ret
; 3df1f
GetOTPartymonItem: ; 3df1f
- ld hl, OTPartyMon1Item
- ld a, [CurOTMon]
+ ld hl, wOTPartyMon1Item
+ ld a, [wCurOTMon]
call GetPartyLocation
- ld bc, EnemyMonItem
+ ld bc, wEnemyMonItem
ret
; 3df2c
@@ -4696,11 +4696,11 @@
push de
push bc
call DrawPlayerHUD
- ld hl, PlayerHPPal
+ ld hl, wPlayerHPPal
call SetHPPal
call CheckDanger
call DrawEnemyHUD
- ld hl, EnemyHPPal
+ ld hl, wEnemyHPPal
call SetHPPal
pop bc
pop de
@@ -4740,19 +4740,19 @@
hlcoord 10, 9
ld b, 1
xor a ; PARTYMON
- ld [MonType], a
+ ld [wMonType], a
predef DrawPlayerHP
; Exp bar
push de
- ld a, [CurBattleMon]
- ld hl, PartyMon1Exp + 2
+ ld a, [wCurBattleMon]
+ ld hl, wPartyMon1Exp + 2
call GetPartyLocation
ld d, h
ld e, l
hlcoord 10, 11
- ld a, [TempMonLevel]
+ ld a, [wTempMonLevel]
ld b, a
call FillInExpBar
pop de
@@ -4760,29 +4760,29 @@
; 3df98
UpdatePlayerHPPal: ; 3df98
- ld hl, PlayerHPPal
+ ld hl, wPlayerHPPal
jp UpdateHPPal
; 3df9e
CheckDanger: ; 3df9e
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld a, [hli]
or [hl]
jr z, .no_danger
- ld a, [wDanger]
+ ld a, [wBattleLowHealthAlarm]
and a
jr nz, .done
- ld a, [PlayerHPPal]
+ ld a, [wPlayerHPPal]
cp HP_RED
jr z, .danger
.no_danger
- ld hl, Danger
+ ld hl, wLowHealthAlarm
res DANGER_ON_F, [hl]
jr .done
.danger
- ld hl, Danger
+ ld hl, wLowHealthAlarm
set DANGER_ON_F, [hl]
.done
@@ -4790,7 +4790,7 @@
; 3dfbf
PrintPlayerHUD: ; 3dfbf
- ld de, BattleMonNick
+ ld de, wBattleMonNick
hlcoord 10, 7
call ret_3e138
call PlaceString
@@ -4797,25 +4797,25 @@
push bc
- ld a, [CurBattleMon]
- ld hl, PartyMon1DVs
+ ld a, [wCurBattleMon]
+ ld hl, wPartyMon1DVs
call GetPartyLocation
- ld de, TempMonDVs
+ ld de, wTempMonDVs
ld a, [hli]
ld [de], a
inc de
ld a, [hl]
ld [de], a
- ld hl, BattleMonLevel
- ld de, TempMonLevel
+ ld hl, wBattleMonLevel
+ ld de, wTempMonLevel
ld bc, $11
call CopyBytes
- ld a, [CurBattleMon]
- ld hl, PartyMon1Species
+ ld a, [wCurBattleMon]
+ ld hl, wPartyMon1Species
call GetPartyLocation
ld a, [hl]
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
call GetBaseData
pop hl
@@ -4822,7 +4822,7 @@
dec hl
ld a, TEMPMON
- ld [MonType], a
+ ld [wMonType], a
callfar GetGender
ld a, " "
jr c, .got_gender_char
@@ -4836,7 +4836,7 @@
hlcoord 14, 8
push af ; back up gender
push hl
- ld de, BattleMonStatus
+ ld de, wBattleMonStatus
predef PlaceNonFaintStatus
pop hl
pop bc
@@ -4847,8 +4847,8 @@
dec hl ; genderless
.copy_level
- ld a, [BattleMonLevel]
- ld [TempMonLevel], a
+ ld a, [wBattleMonLevel]
+ ld [wTempMonLevel], a
jp PrintLevel
; 3e036
@@ -4874,11 +4874,11 @@
farcall DrawEnemyHUDBorder
- ld a, [TempEnemyMonSpecies]
- ld [CurSpecies], a
- ld [CurPartySpecies], a
+ ld a, [wTempEnemyMonSpecies]
+ ld [wCurSpecies], a
+ ld [wCurPartySpecies], a
call GetBaseData
- ld de, EnemyMonNick
+ ld de, wEnemyMonNick
hlcoord 1, 0
call ret_3e138
call PlaceString
@@ -4886,9 +4886,9 @@
ld l, c
dec hl
- ld hl, EnemyMonDVs
- ld de, TempMonDVs
- ld a, [EnemySubStatus5]
+ ld hl, wEnemyMonDVs
+ ld de, wTempMonDVs
+ ld a, [wEnemySubStatus5]
bit SUBSTATUS_TRANSFORMED, a
jr z, .ok
ld hl, wEnemyBackupDVs
@@ -4900,7 +4900,7 @@
ld [de], a
ld a, TEMPMON
- ld [MonType], a
+ ld [wMonType], a
callfar GetGender
ld a, " "
jr c, .got_gender
@@ -4915,7 +4915,7 @@
hlcoord 6, 1
push af
push hl
- ld de, EnemyMonStatus
+ ld de, wEnemyMonStatus
predef PlaceNonFaintStatus
pop hl
pop bc
@@ -4925,12 +4925,12 @@
jr nz, .print_level
dec hl
.print_level
- ld a, [EnemyMonLevel]
- ld [TempMonLevel], a
+ ld a, [wEnemyMonLevel]
+ ld [wTempMonLevel], a
call PrintLevel
.skip_level
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld a, [hli]
ld [hMultiplicand + 1], a
ld a, [hld]
@@ -4949,7 +4949,7 @@
ld a, HP_BAR_LENGTH_PX
ld [hMultiplier], a
call Multiply
- ld hl, EnemyMonMaxHP
+ ld hl, wEnemyMonMaxHP
ld a, [hli]
ld b, a
ld a, [hl]
@@ -4998,7 +4998,7 @@
; 3e127
UpdateEnemyHPPal: ; 3e127
- ld hl, EnemyHPPal
+ ld hl, wEnemyHPPal
call UpdateHPPal
ret
; 3e12e
@@ -5021,7 +5021,7 @@
ld [hBGMapMode], a
call LoadTempTileMapToTileMap
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_DEBUG
jr z, .ok
cp BATTLETYPE_TUTORIAL
@@ -5033,7 +5033,7 @@
.ok
.loop
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_CONTEST
jr nz, .not_contest
farcall ContestBattleMenu
@@ -5041,7 +5041,7 @@
.not_contest
; Auto input: choose "ITEM"
- ld a, [InputType]
+ ld a, [wInputType]
or a
jr z, .skip_dude_pack_select
farcall _DudeAutoInput_DownA
@@ -5103,13 +5103,13 @@
and a
jp nz, .ItemsCantBeUsed
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
and a
jp nz, .ItemsCantBeUsed
call LoadStandardMenuDataHeader
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
jr z, .tutorial
cp BATTLETYPE_CONTEST
@@ -5116,7 +5116,7 @@
jr z, .contest
farcall BattlePack
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
and a
jr z, .didnt_use_item
jr .got_item
@@ -5124,13 +5124,13 @@
.tutorial
farcall TutorialPack
ld a, POKE_BALL
- ld [CurItem], a
+ ld [wCurItem], a
call DoItemEffect
jr .got_item
.contest
ld a, PARK_BALL
- ld [CurItem], a
+ ld [wCurItem], a
call DoItemEffect
.got_item
@@ -5171,7 +5171,7 @@
ld [hBGMapMode], a
call _LoadBattleFontsHPBar
call ClearSprites
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
jr z, .tutorial2
call GetBattleMonBackpic
@@ -5210,7 +5210,7 @@
BattleMenuPKMN_Loop:
call SetUpBattlePartyMenu
xor a
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
call JumpToPartyMenuAndPrintText
call SelectBattleMon
jr c, .Cancel
@@ -5280,7 +5280,7 @@
call ClearSprites
call LowVolume
xor a ; PARTYMON
- ld [MonType], a
+ ld [wMonType], a
farcall BattleStatsScreenInit
call MaxVolume
@@ -5301,9 +5301,9 @@
; 3e358
TryPlayerSwitch: ; 3e358
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
ld d, a
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
cp d
jr nz, .check_trapped
ld hl, BattleText_PkmnIsAlreadyOut
@@ -5314,7 +5314,7 @@
ld a, [wPlayerWrapCount]
and a
jr nz, .trapped
- ld a, [EnemySubStatus5]
+ ld a, [wEnemySubStatus5]
bit SUBSTATUS_CANT_RUN, a
jr z, .try_switch
@@ -5326,10 +5326,10 @@
.try_switch
call CheckIfCurPartyMonIsFitToFight
jp z, BattleMenuPKMN_Loop
- ld a, [CurBattleMon]
- ld [LastPlayerMon], a
+ ld a, [wCurBattleMon]
+ ld [wLastPlayerMon], a
ld a, $2
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
call ClearPalettes
call DelayFrame
call ClearSprites
@@ -5337,8 +5337,8 @@
call CloseWindow
call GetMemSGBLayout
call SetPalettes
- ld a, [CurPartyMon]
- ld [CurBattleMon], a
+ ld a, [wCurPartyMon]
+ ld [wCurBattleMon], a
PlayerSwitch: ; 3e3ad
ld a, 1
ld [wPlayerIsSwitching], a
@@ -5401,7 +5401,7 @@
ld c, 50
call DelayFrames
- ld hl, PlayerSubStatus4
+ ld hl, wPlayerSubStatus4
res SUBSTATUS_RAGE, [hl]
call SetEnemyTurn
@@ -5414,8 +5414,8 @@
lb bc, 5, 11
call ClearBox
- ld a, [CurBattleMon]
- ld [CurPartyMon], a
+ ld a, [wCurBattleMon]
+ ld [wCurPartyMon], a
call AddBattleParticipant
call InitBattleMon
call ResetPlayerStatLevels
@@ -5440,8 +5440,8 @@
lb bc, 5, 11
call ClearBox
- ld a, [CurPartyMon]
- ld [CurBattleMon], a
+ ld a, [wCurPartyMon]
+ ld [wCurBattleMon], a
call AddBattleParticipant
call InitBattleMon
xor a
@@ -5458,13 +5458,13 @@
call Call_LoadTempTileMapToTileMap
ld a, $3
ld [wMenuCursorY], a
- ld hl, BattleMonSpeed
- ld de, EnemyMonSpeed
+ ld hl, wBattleMonSpeed
+ ld de, wEnemyMonSpeed
call TryToRunAwayFromBattle
ld a, $0
ld [wFailedToFlee], a
ret c
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
and a
ret nz
jp BattleMenu
@@ -5471,7 +5471,7 @@
; 3e4a8
CheckAmuletCoin: ; 3e4a8
- ld a, [BattleMonItem]
+ ld a, [wBattleMonItem]
ld b, a
callfar GetItemHeldEffect
ld a, b
@@ -5489,7 +5489,7 @@
ret
.not_mobile
- ld hl, EnemyMonMoves
+ ld hl, wEnemyMonMoves
ld a, [wMoveSelectionMenuType]
dec a
jr z, .got_menu_type
@@ -5497,7 +5497,7 @@
jr z, .ether_elixer_menu
call CheckPlayerHasUsableMoves
ret z ; use Struggle
- ld hl, BattleMonMoves
+ ld hl, wBattleMonMoves
jr .got_menu_type
.ether_elixer_menu
@@ -5530,7 +5530,7 @@
hlcoord 6, 17 - NUM_MOVES - 4
.got_start_coord
ld a, SCREEN_WIDTH
- ld [Buffer1], a
+ ld [wBuffer1], a
predef ListMoves
ld b, 5
@@ -5548,7 +5548,7 @@
ld a, [wMoveSelectionMenuType]
cp $1
jr z, .skip_inc
- ld a, [CurMoveNum]
+ ld a, [wCurMoveNum]
inc a
.skip_inc
@@ -5634,7 +5634,7 @@
.not_enemy_moves_process_b
dec a
ld a, b
- ld [CurMoveNum], a
+ ld [wCurMoveNum], a
jr nz, .use_move
pop af
@@ -5644,7 +5644,7 @@
pop af
ret nz
- ld hl, BattleMonPP
+ ld hl, wBattleMonPP
ld a, [wMenuCursorY]
ld c, a
ld b, 0
@@ -5652,7 +5652,7 @@
ld a, [hl]
and PP_MASK
jr z, .no_pp_left
- ld a, [PlayerDisableCount]
+ ld a, [wPlayerDisableCount]
swap a
and $f
dec a
@@ -5662,7 +5662,7 @@
and a
jr nz, .skip2
ld a, [wMenuCursorY]
- ld hl, BattleMonMoves
+ ld hl, wBattleMonMoves
ld c, a
ld b, 0
add hl, bc
@@ -5669,7 +5669,7 @@
ld a, [hl]
.skip2
- ld [CurPlayerMove], a
+ ld [wCurPlayerMove], a
xor a
ret
@@ -5717,11 +5717,11 @@
ld a, [wMoveSwapBuffer]
and a
jr z, .start_swap
- ld hl, BattleMonMoves
+ ld hl, wBattleMonMoves
call .swap_bytes
- ld hl, BattleMonPP
+ ld hl, wBattleMonPP
call .swap_bytes
- ld hl, PlayerDisableCount
+ ld hl, wPlayerDisableCount
ld a, [hl]
swap a
and $f
@@ -5752,11 +5752,11 @@
.swap_moves_in_party_struct
; Fixes the COOLTRAINER glitch
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_TRANSFORMED, a
jr nz, .transformed
- ld hl, PartyMon1Moves
- ld a, [CurBattleMon]
+ ld hl, wPartyMon1Moves
+ ld a, [wCurBattleMon]
call GetPartyLocation
push hl
call .swap_bytes
@@ -5808,7 +5808,7 @@
call TextBox
call MobileTextBorder
- ld a, [PlayerDisableCount]
+ ld a, [wPlayerDisableCount]
and a
jr z, .not_disabled
@@ -5828,18 +5828,18 @@
ld hl, wMenuCursorY
dec [hl]
call SetPlayerTurn
- ld hl, BattleMonMoves
+ ld hl, wBattleMonMoves
ld a, [wMenuCursorY]
ld c, a
ld b, 0
add hl, bc
ld a, [hl]
- ld [CurPlayerMove], a
+ ld [wCurPlayerMove], a
- ld a, [CurBattleMon]
- ld [CurPartyMon], a
+ ld a, [wCurBattleMon]
+ ld [wCurPartyMon], a
ld a, WILDMON
- ld [MonType], a
+ ld [wMonType], a
callfar GetMaxPPOfMove
ld hl, wMenuCursorY
@@ -5846,11 +5846,11 @@
ld c, [hl]
inc [hl]
ld b, 0
- ld hl, BattleMonPP
+ ld hl, wBattleMonPP
add hl, bc
ld a, [hl]
and PP_MASK
- ld [StringBuffer1], a
+ ld [wStringBuffer1], a
call .PrintPP
hlcoord 1, 9
@@ -5884,7 +5884,7 @@
hlcoord 5, 11
.ok
push hl
- ld de, StringBuffer1
+ ld de, wStringBuffer1
lb bc, 1, 2
call PrintNum
pop hl
@@ -5900,10 +5900,10 @@
CheckPlayerHasUsableMoves: ; 3e786
ld a, STRUGGLE
- ld [CurPlayerMove], a
- ld a, [PlayerDisableCount]
+ ld [wCurPlayerMove], a
+ ld a, [wPlayerDisableCount]
and a
- ld hl, BattleMonPP
+ ld hl, wBattleMonPP
jr nz, .disabled
ld a, [hli]
@@ -5955,7 +5955,7 @@
jr z, .not_linked
call EmptyBattleTextBox
call LoadTileMapToTempTileMap
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
and a
call z, LinkBattleSendReceiveAction
call Call_LoadTempTileMapToTileMap
@@ -5966,20 +5966,20 @@
jp z, .battle_action_d
cp BATTLEACTION_SWITCH1
jp nc, ResetVarsForSubstatusRage
- ld [CurEnemyMoveNum], a
+ ld [wCurEnemyMoveNum], a
ld c, a
- ld a, [EnemySubStatus1]
+ ld a, [wEnemySubStatus1]
bit SUBSTATUS_ROLLOUT, a
jp nz, .skip_load
- ld a, [EnemySubStatus3]
+ ld a, [wEnemySubStatus3]
and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_RAMPAGE | 1 << SUBSTATUS_BIDE
jp nz, .skip_load
- ld hl, EnemySubStatus5
+ ld hl, wEnemySubStatus5
bit SUBSTATUS_ENCORED, [hl]
- ld a, [LastEnemyMove]
+ ld a, [wLastEnemyMove]
jp nz, .finish
- ld hl, EnemyMonMoves
+ ld hl, wEnemyMonMoves
ld b, 0
add hl, bc
ld a, [hl]
@@ -5986,10 +5986,10 @@
jp .finish
.not_linked
- ld hl, EnemySubStatus5
+ ld hl, wEnemySubStatus5
bit SUBSTATUS_ENCORED, [hl]
jr z, .skip_encore
- ld a, [LastEnemyMove]
+ ld a, [wLastEnemyMove]
jp .finish
.skip_encore
@@ -6002,14 +6002,14 @@
jr .finish
.continue
- ld hl, EnemyMonMoves
- ld de, EnemyMonPP
+ ld hl, wEnemyMonMoves
+ ld de, wEnemyMonPP
ld b, NUM_MOVES
.loop
ld a, [hl]
and a
jp z, .struggle
- ld a, [EnemyDisabledMove]
+ ld a, [wEnemyDisabledMove]
cp [hl]
jr z, .disabled
ld a, [de]
@@ -6029,13 +6029,13 @@
jr nz, .skip_load
; wild
.loop2
- ld hl, EnemyMonMoves
+ ld hl, wEnemyMonMoves
call BattleRandom
maskbits NUM_MOVES
ld c, a
ld b, 0
add hl, bc
- ld a, [EnemyDisableCount]
+ ld a, [wEnemyDisableCount]
swap a
and $f
dec a
@@ -6044,7 +6044,7 @@
ld a, [hl]
and a
jr z, .loop2
- ld hl, EnemyMonPP
+ ld hl, wEnemyMonPP
add hl, bc
ld b, a
ld a, [hl]
@@ -6051,11 +6051,11 @@
and PP_MASK
jr z, .loop2
ld a, c
- ld [CurEnemyMoveNum], a
+ ld [wCurEnemyMoveNum], a
ld a, b
.finish
- ld [CurEnemyMove], a
+ ld [wCurEnemyMove], a
.skip_load
call SetEnemyTurn
@@ -6070,13 +6070,13 @@
cp EFFECT_FURY_CUTTER
jr z, .fury_cutter
xor a
- ld [EnemyFuryCutterCount], a
+ ld [wEnemyFuryCutterCount], a
.fury_cutter
ld a, [wEnemyMoveStruct + MOVE_EFFECT]
cp EFFECT_RAGE
jr z, .no_rage
- ld hl, EnemySubStatus4
+ ld hl, wEnemySubStatus4
res SUBSTATUS_RAGE, [hl]
xor a
ld [wEnemyRageCounter], a
@@ -6088,7 +6088,7 @@
cp EFFECT_ENDURE
ret z
xor a
- ld [EnemyProtectCount], a
+ ld [wEnemyProtectCount], a
ret
.struggle
@@ -6098,25 +6098,25 @@
ResetVarsForSubstatusRage: ; 3e8c1
xor a
- ld [EnemyFuryCutterCount], a
- ld [EnemyProtectCount], a
+ ld [wEnemyFuryCutterCount], a
+ ld [wEnemyProtectCount], a
ld [wEnemyRageCounter], a
- ld hl, EnemySubStatus4
+ ld hl, wEnemySubStatus4
res SUBSTATUS_RAGE, [hl]
ret
; 3e8d1
CheckEnemyLockedIn: ; 3e8d1
- ld a, [EnemySubStatus4]
+ ld a, [wEnemySubStatus4]
and 1 << SUBSTATUS_RECHARGE
ret nz
- ld hl, EnemySubStatus3
+ ld hl, wEnemySubStatus3
ld a, [hl]
and 1 << SUBSTATUS_CHARGED | 1 << SUBSTATUS_RAMPAGE | 1 << SUBSTATUS_BIDE
ret nz
- ld hl, EnemySubStatus1
+ ld hl, wEnemySubStatus1
bit SUBSTATUS_ROLLOUT, [hl]
ret
; 3e8e4
@@ -6128,15 +6128,15 @@
LoadEnemyMon: ; 3e8eb
; Initialize enemy monster parameters
-; To do this we pull the species from TempEnemyMonSpecies
+; To do this we pull the species from wTempEnemyMonSpecies
; Notes:
; BattleRandom is used to ensure sync between Game Boys
-; Clear the whole EnemyMon struct
+; Clear the whole enemy mon struct (wEnemyMon)
xor a
- ld hl, EnemyMonSpecies
- ld bc, EnemyMonEnd - EnemyMon
+ ld hl, wEnemyMonSpecies
+ ld bc, wEnemyMonEnd - wEnemyMon
call ByteFill
; We don't need to be here if we're in a link battle
@@ -6145,15 +6145,15 @@
jp nz, InitEnemyMon
; and also not in a BattleTower-Battle
- ld a, [InBattleTowerBattle] ; ????
+ ld a, [wInBattleTowerBattle] ; ????
bit 0, a
jp nz, InitEnemyMon
; Make sure everything knows what species we're working with
- ld a, [TempEnemyMonSpecies]
- ld [EnemyMonSpecies], a
- ld [CurSpecies], a
- ld [CurPartySpecies], a
+ ld a, [wTempEnemyMonSpecies]
+ ld [wEnemyMonSpecies], a
+ ld [wCurSpecies], a
+ ld [wCurPartySpecies], a
; Grab the BaseData for this species
call GetBaseData
@@ -6166,9 +6166,9 @@
jr z, .WildItem
; If we're in a trainer battle, the item is in the party struct
- ld a, [CurPartyMon]
- ld hl, OTPartyMon1Item
- call GetPartyLocation ; bc = PartyMon[CurPartyMon] - PartyMons
+ ld a, [wCurPartyMon]
+ ld hl, wOTPartyMon1Item
+ call GetPartyLocation ; bc = PartyMon[wCurPartyMon] - wPartyMons
ld a, [hl]
jr .UpdateItem
@@ -6177,9 +6177,9 @@
; Force Item1
; Used for Ho-Oh, Lugia and Snorlax encounters
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_FORCEITEM
- ld a, [BaseItems]
+ ld a, [wBaseItems]
jr z, .UpdateItem
; Failing that, it's all up to chance
@@ -6197,12 +6197,12 @@
; From there, an 8% chance for Item2
call BattleRandom
cp 8 percent ; 8% of 25% = 2% Item2
- ld a, [BaseItems]
+ ld a, [wBaseItems]
jr nc, .UpdateItem
- ld a, [BaseItems+1]
+ ld a, [wBaseItems+1]
.UpdateItem:
- ld [EnemyMonItem], a
+ ld [wEnemyMonItem], a
; Initialize DVs
@@ -6211,13 +6211,13 @@
and a
jr z, .InitDVs
- ld a, [EnemySubStatus5]
+ ld a, [wEnemySubStatus5]
bit SUBSTATUS_TRANSFORMED, a
jr z, .InitDVs
; Unknown
ld hl, wEnemyBackupDVs
- ld de, EnemyMonDVs
+ ld de, wEnemyMonDVs
ld a, [hli]
ld [de], a
inc de
@@ -6242,7 +6242,7 @@
; Roaming monsters (Entei, Raikou) work differently
; They have their own structs, which are shorter than normal
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_ROAMING
jr nz, .NotRoaming
@@ -6280,7 +6280,7 @@
jr .UpdateDVs
.NotRoaming:
-; Register a contains BattleType
+; Register a contains wBattleType
; Forced shiny battle type
; Used by Red Gyarados at Lake of Rage
@@ -6300,7 +6300,7 @@
.UpdateDVs:
; Input DVs in register bc
- ld hl, EnemyMonDVs
+ ld hl, wEnemyMonDVs
ld a, b
ld [hli], a
ld [hl], c
@@ -6313,12 +6313,12 @@
; Species-specfic:
; Unown
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
cp UNOWN
jr nz, .Magikarp
; Get letter based on DVs
- ld hl, EnemyMonDVs
+ ld hl, wEnemyMonDVs
predef GetUnownLetter
; Can't use any letters that haven't been unlocked
; If combined with forced shiny battletype, causes an infinite loop
@@ -6334,13 +6334,13 @@
; by targeting those 1600 mm (= 5'3") or larger.
; After the conversion to feet, it is unable to target any,
; since the largest possible Magikarp is 5'3", and $0503 = 1283 mm.
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
cp MAGIKARP
jr nz, .Happiness
; Get Magikarp's length
- ld de, EnemyMonDVs
- ld bc, PlayerID
+ ld de, wEnemyMonDVs
+ ld bc, wPlayerID
callfar CalcMagikarpLength
; No reason to keep going if length > 1536 mm (i.e. if HIGH(length) > 6 feet)
@@ -6380,10 +6380,10 @@
; Moreover, due to the check not being translated to feet+inches, all Magikarp
; smaller than 4'0" may be caught by the filter, a lot more than intended.
- ld a, [MapGroup]
+ ld a, [wMapGroup]
cp GROUP_LAKE_OF_RAGE
jr z, .Happiness
- ld a, [MapNumber]
+ ld a, [wMapNumber]
cp MAP_LAKE_OF_RAGE
jr z, .Happiness
; 40% chance of not flooring
@@ -6400,14 +6400,14 @@
.Happiness:
; Set happiness
ld a, BASE_HAPPINESS
- ld [EnemyMonHappiness], a
+ ld [wEnemyMonHappiness], a
; Set level
- ld a, [CurPartyLevel]
- ld [EnemyMonLevel], a
+ ld a, [wCurPartyLevel]
+ ld [wEnemyMonLevel], a
; Fill stats
- ld de, EnemyMonMaxHP
+ ld de, wEnemyMonMaxHP
ld b, FALSE
- ld hl, EnemyMonDVs - (MON_DVS - MON_STAT_EXP + 1) ; LinkBattleRNs + 7 ; ?
+ ld hl, wEnemyMonDVs - (MON_DVS - MON_STAT_EXP + 1) ; wLinkBattleRNs + 7 ; ?
predef CalcPkmnStats
; If we're in a trainer battle,
@@ -6420,7 +6420,7 @@
and a
jr z, .TreeMon
- ld a, [EnemySubStatus5]
+ ld a, [wEnemySubStatus5]
bit SUBSTATUS_TRANSFORMED, a
jp nz, .Moves
@@ -6433,7 +6433,7 @@
xor a
.UpdateStatus:
- ld hl, EnemyMonStatus
+ ld hl, wEnemyMonStatus
ld [hli], a
; Unused byte
@@ -6441,13 +6441,13 @@
ld [hli], a
; Full HP..
- ld a, [EnemyMonMaxHP]
+ ld a, [wEnemyMonMaxHP]
ld [hli], a
- ld a, [EnemyMonMaxHP + 1]
+ ld a, [wEnemyMonMaxHP + 1]
ld [hl], a
; ..unless it's a RoamMon
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_ROAMING
jr nz, .Moves
@@ -6459,38 +6459,38 @@
jr z, .InitRoamHP
; Update from the struct if it has
ld a, [hl]
- ld [EnemyMonHP + 1], a
+ ld [wEnemyMonHP + 1], a
jr .Moves
.InitRoamHP:
; HP only uses the lo byte in the RoamMon struct since
; Raikou/Entei/Suicune will have < 256 hp at level 40
- ld a, [EnemyMonHP + 1]
+ ld a, [wEnemyMonHP + 1]
ld [hl], a
jr .Moves
.OpponentParty:
; Get HP from the party struct
- ld hl, (OTPartyMon1HP + 1)
- ld a, [CurPartyMon]
+ ld hl, (wOTPartyMon1HP + 1)
+ ld a, [wCurPartyMon]
call GetPartyLocation
ld a, [hld]
- ld [EnemyMonHP + 1], a
+ ld [wEnemyMonHP + 1], a
ld a, [hld]
- ld [EnemyMonHP], a
+ ld [wEnemyMonHP], a
; Make sure everything knows which monster the opponent is using
- ld a, [CurPartyMon]
- ld [CurOTMon], a
+ ld a, [wCurPartyMon]
+ ld [wCurOTMon], a
; Get status from the party struct
dec hl
ld a, [hl] ; OTPartyMonStatus
- ld [EnemyMonStatus], a
+ ld [wEnemyMonStatus], a
.Moves:
- ld hl, BaseType1
- ld de, EnemyMonType1
+ ld hl, wBaseType1
+ ld de, wEnemyMonType1
ld a, [hli]
ld [de], a
inc de
@@ -6498,14 +6498,14 @@
ld [de], a
; Get moves
- ld de, EnemyMonMoves
+ ld de, wEnemyMonMoves
; Are we in a trainer battle?
ld a, [wBattleMode]
cp TRAINER_BATTLE
jr nz, .WildMoves
; Then copy moves from the party struct
- ld hl, OTPartyMon1Moves
- ld a, [CurPartyMon]
+ ld hl, wOTPartyMon1Moves
+ ld a, [wCurPartyMon]
call GetPartyLocation
ld bc, NUM_MOVES
call CopyBytes
@@ -6512,7 +6512,7 @@
jr .PP
.WildMoves:
-; Clear EnemyMonMoves
+; Clear wEnemyMonMoves
xor a
ld h, d
ld l, e
@@ -6532,25 +6532,25 @@
jr z, .TrainerPP
; Fill wild PP
- ld hl, EnemyMonMoves
- ld de, EnemyMonPP
+ ld hl, wEnemyMonMoves
+ ld de, wEnemyMonPP
predef FillPP
jr .Finish
.TrainerPP:
; Copy PP from the party struct
- ld hl, OTPartyMon1PP
- ld a, [CurPartyMon]
+ ld hl, wOTPartyMon1PP
+ ld a, [wCurPartyMon]
call GetPartyLocation
- ld de, EnemyMonPP
+ ld de, wEnemyMonPP
ld bc, NUM_MOVES
call CopyBytes
.Finish:
; Only the first five base stats are copied..
- ld hl, BaseStats
- ld de, EnemyMonBaseStats
- ld b, BaseSpecialDefense - BaseStats
+ ld hl, wBaseStats
+ ld de, wEnemyMonBaseStats
+ ld b, wBaseSpecialDefense - wBaseStats
.loop
ld a, [hli]
ld [de], a
@@ -6558,14 +6558,14 @@
dec b
jr nz, .loop
- ld a, [BaseCatchRate]
+ ld a, [wBaseCatchRate]
ld [de], a
inc de
- ld a, [BaseExp]
+ ld a, [wBaseExp]
ld [de], a
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
ld [wd265], a
call GetPokemonName
@@ -6576,22 +6576,22 @@
ret z
; Update enemy nick
- ld hl, StringBuffer1
- ld de, EnemyMonNick
+ ld hl, wStringBuffer1
+ ld de, wEnemyMonNick
ld bc, MON_NAME_LENGTH
call CopyBytes
; Saw this mon
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
dec a
ld c, a
ld b, SET_FLAG
- ld hl, PokedexSeen
+ ld hl, wPokedexSeen
predef SmallFarFlagAction
- ld hl, EnemyMonStats
- ld de, EnemyStats
- ld bc, EnemyMonStatsEnd - EnemyMonStats
+ ld hl, wEnemyMonStats
+ ld de, wEnemyStats
+ ld bc, wEnemyMonStatsEnd - wEnemyMonStats
call CopyBytes
ret
@@ -6602,13 +6602,13 @@
; for the current time of day
; Don't do anything if this isn't a tree encounter
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_TREE
jr nz, .NotSleeping
; Get list for the time of day
ld hl, AsleepTreeMonsMorn
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
cp DAY_F
jr c, .Check
ld hl, AsleepTreeMonsDay
@@ -6616,7 +6616,7 @@
ld hl, AsleepTreeMonsNite
.Check:
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
ld de, 1 ; length of species id
call IsInArray
; If it's a match, the opponent is asleep
@@ -6649,7 +6649,7 @@
ld l, a
push de
- ld a, [UnownLetter]
+ ld a, [wUnownLetter]
ld de, 1
push bc
call IsInArray
@@ -6698,12 +6698,12 @@
Unreferenced_SwapBattlerLevels: ; 3ebc7
push bc
- ld a, [BattleMonLevel]
+ ld a, [wBattleMonLevel]
ld b, a
- ld a, [EnemyMonLevel]
- ld [BattleMonLevel], a
+ ld a, [wEnemyMonLevel]
+ ld [wBattleMonLevel], a
ld a, b
- ld [EnemyMonLevel], a
+ ld [wEnemyMonLevel], a
pop bc
ret
; 3ebd8
@@ -6710,10 +6710,10 @@
BattleWinSlideInEnemyTrainerFrontpic: ; 3ebd8
xor a
- ld [TempEnemyMonSpecies], a
+ ld [wTempEnemyMonSpecies], a
call FinishBattleAnim
- ld a, [OtherTrainerClass]
- ld [TrainerClass], a
+ ld a, [wOtherTrainerClass]
+ ld [wTrainerClass], a
ld de, vTiles2
callfar GetTrainerPic
hlcoord 19, 0
@@ -6789,10 +6789,10 @@
ld a, [hBattleTurn]
and a
jr z, .enemy
- ld a, [BattleMonStatus]
+ ld a, [wBattleMonStatus]
and 1 << PAR
ret z
- ld hl, BattleMonSpeed + 1
+ ld hl, wBattleMonSpeed + 1
ld a, [hld]
ld b, a
ld a, [hl]
@@ -6810,10 +6810,10 @@
ret
.enemy
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
and 1 << PAR
ret z
- ld hl, EnemyMonSpeed + 1
+ ld hl, wEnemyMonSpeed + 1
ld a, [hld]
ld b, a
ld a, [hl]
@@ -6835,10 +6835,10 @@
ld a, [hBattleTurn]
and a
jr z, .enemy
- ld a, [BattleMonStatus]
+ ld a, [wBattleMonStatus]
and 1 << BRN
ret z
- ld hl, BattleMonAttack + 1
+ ld hl, wBattleMonAttack + 1
ld a, [hld]
ld b, a
ld a, [hl]
@@ -6854,10 +6854,10 @@
ret
.enemy
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
and 1 << BRN
ret z
- ld hl, EnemyMonAttack + 1
+ ld hl, wEnemyMonAttack + 1
ld a, [hld]
ld b, a
ld a, [hl]
@@ -6891,13 +6891,13 @@
ld a, [wd265]
and a
ld a, c
- ld hl, BattleMonAttack
- ld de, PlayerStats
- ld bc, PlayerAtkLevel
+ ld hl, wBattleMonAttack
+ ld de, wPlayerStats
+ ld bc, wPlayerAtkLevel
jr z, .got_pointers
- ld hl, EnemyMonAttack
- ld de, EnemyStats
- ld bc, EnemyAtkLevel
+ ld hl, wEnemyMonAttack
+ ld de, wEnemyStats
+ ld bc, wEnemyAtkLevel
.got_pointers
add c
@@ -6989,7 +6989,8 @@
; 3ed45
BadgeStatBoosts: ; 3ed45
-; Raise BattleMon stats depending on which badges have been obtained.
+; Raise the stats of the battle mon in wBattleMon
+; depending on which badges have been obtained.
; Every other badge boosts a stat, starting from the first.
@@ -7005,7 +7006,7 @@
and a
ret nz
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
and a
ret nz
@@ -7028,7 +7029,7 @@
or c
ld b, a
- ld hl, BattleMonAttack
+ ld hl, wBattleMonAttack
ld c, 4
.CheckBadge:
ld a, b
@@ -7124,13 +7125,13 @@
; Which value are we trying to pull?
push hl
push bc
- ld a, [LinkBattleRNCount]
+ ld a, [wLinkBattleRNCount]
ld c, a
ld b, 0
- ld hl, LinkBattleRNs
+ ld hl, wLinkBattleRNs
add hl, bc
inc a
- ld [LinkBattleRNCount], a
+ ld [wLinkBattleRNCount], a
; If we haven't hit the end yet, we're good
cp 10 - 1 ; Exclude last value. See the closing comment
@@ -7147,8 +7148,8 @@
; Reset count to 0
xor a
- ld [LinkBattleRNCount], a
- ld hl, LinkBattleRNs
+ ld [wLinkBattleRNCount], a
+ ld hl, wLinkBattleRNs
ld b, 10 ; number of seeds
; Generate next number in the sequence for each seed
@@ -7188,9 +7189,9 @@
Call_PlayBattleAnim: ; 3ee17
ld a, e
- ld [FXAnimID], a
+ ld [wFXAnimID], a
ld a, d
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
call WaitBGMap
predef_jump PlayBattleAnim
; 3ee27
@@ -7218,14 +7219,14 @@
and a
ret nz
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
bit 0, a
ret nz
call .EvenlyDivideExpAmongParticipants
xor a
- ld [CurPartyMon], a
- ld bc, PartyMon1Species
+ ld [wCurPartyMon], a
+ ld bc, wPartyMon1Species
.loop
ld hl, MON_HP
@@ -7236,7 +7237,7 @@
push bc
ld hl, wBattleParticipantsNotFainted
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld c, a
ld b, CHECK_FLAG
ld d, $0
@@ -7251,7 +7252,7 @@
add hl, bc
ld d, h
ld e, l
- ld hl, EnemyMonBaseStats - 1
+ ld hl, wEnemyMonBaseStats - 1
push bc
ld c, $5
.loop1
@@ -7303,9 +7304,9 @@
xor a
ld [hMultiplicand + 0], a
ld [hMultiplicand + 1], a
- ld a, [EnemyMonBaseExp]
+ ld a, [wEnemyMonBaseExp]
ld [hMultiplicand + 2], a
- ld a, [EnemyMonLevel]
+ ld a, [wEnemyMonLevel]
ld [hMultiplier], a
call Multiply
ld a, 7
@@ -7316,11 +7317,11 @@
pop bc
ld hl, MON_ID
add hl, bc
- ld a, [PlayerID]
+ ld a, [wPlayerID]
cp [hl]
jr nz, .boosted
inc hl
- ld a, [PlayerID + 1]
+ ld a, [wPlayerID + 1]
cp [hl]
ld a, $0
jr z, .no_boost
@@ -7331,7 +7332,7 @@
.no_boost
; Boost experience for a Trainer Battle
- ld [StringBuffer2 + 2], a
+ ld [wStringBuffer2 + 2], a
ld a, [wBattleMode]
dec a
call nz, BoostExp
@@ -7343,17 +7344,17 @@
cp LUCKY_EGG
call z, BoostExp
ld a, [hQuotient + 2]
- ld [StringBuffer2 + 1], a
+ ld [wStringBuffer2 + 1], a
ld a, [hQuotient + 1]
- ld [StringBuffer2], a
- ld a, [CurPartyMon]
- ld hl, PartyMonNicknames
+ ld [wStringBuffer2], a
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonNicknames
call GetNick
ld hl, Text_PkmnGainedExpPoint
call BattleTextBox
- ld a, [StringBuffer2 + 1]
+ ld a, [wStringBuffer2 + 1]
ld [hQuotient + 2], a
- ld a, [StringBuffer2]
+ ld a, [wStringBuffer2]
ld [hQuotient + 1], a
pop bc
call AnimateExpBar
@@ -7380,13 +7381,13 @@
ld [hl], a
.skip2
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld e, a
ld d, $0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, de
ld a, [hl]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
push bc
ld d, MAX_LEVEL
@@ -7417,7 +7418,7 @@
.not_max_exp
xor a ; PARTYMON
- ld [MonType], a
+ ld [wMonType], a
predef CopyPkmnToTempMon
callfar CalcLevel
pop bc
@@ -7430,15 +7431,15 @@
jp z, .skip_stats
; <NICKNAME> grew to level ##!
ld [wTempLevel], a
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
push af
ld a, d
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld [hl], a
ld hl, MON_SPECIES
add hl, bc
ld a, [hl]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
ld [wd265], a
call GetBaseData
ld hl, MON_MAXHP + 1
@@ -7473,18 +7474,18 @@
ld a, [hl]
adc d
ld [hl], a
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
ld d, a
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
cp d
jr nz, .skip_animation
- ld de, BattleMonHP
+ ld de, wBattleMonHP
ld a, [hli]
ld [de], a
inc de
ld a, [hli]
ld [de], a
- ld de, BattleMonMaxHP
+ ld de, wBattleMonMaxHP
push bc
ld bc, PARTYMON_STRUCT_LENGTH - MON_MAXHP
call CopyBytes
@@ -7492,13 +7493,13 @@
ld hl, MON_LEVEL
add hl, bc
ld a, [hl]
- ld [BattleMonLevel], a
- ld a, [PlayerSubStatus5]
+ ld [wBattleMonLevel], a
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_TRANSFORMED, a
jr nz, .transformed
ld hl, MON_ATK
add hl, bc
- ld de, PlayerStats
+ ld de, wPlayerStats
ld bc, PARTYMON_STRUCT_LENGTH - MON_ATK
call CopyBytes
@@ -7516,9 +7517,9 @@
.skip_animation
farcall LevelUpHappinessMod
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
ld b, a
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
cp b
jr z, .skip_animation2
ld de, SFX_HIT_END_OF_EXP_BAR
@@ -7530,7 +7531,7 @@
.skip_animation2
xor a ; PARTYMON
- ld [MonType], a
+ ld [wMonType], a
predef CopyPkmnToTempMon
hlcoord 9, 0
ld b, $a
@@ -7544,10 +7545,10 @@
call WaitPressAorB_BlinkCursor
call Call_LoadTempTileMapToTileMap
xor a ; PARTYMON
- ld [MonType], a
- ld a, [CurSpecies]
+ ld [wMonType], a
+ ld a, [wCurSpecies]
ld [wd265], a
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
push af
ld c, a
ld a, [wTempLevel]
@@ -7556,7 +7557,7 @@
.level_loop
inc b
ld a, b
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
push bc
predef LearnLevelMoves
pop bc
@@ -7564,23 +7565,23 @@
cp c
jr nz, .level_loop
pop af
- ld [CurPartyLevel], a
- ld hl, EvolvableFlags
- ld a, [CurPartyMon]
+ ld [wCurPartyLevel], a
+ ld hl, wEvolvableFlags
+ ld a, [wCurPartyMon]
ld c, a
ld b, SET_FLAG
predef SmallFarFlagAction
pop af
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
.skip_stats
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld b, a
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
inc a
cp b
jr z, .done
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld a, MON_SPECIES
call GetPartyParamLocation
ld b, h
@@ -7608,8 +7609,8 @@
ret c
ld [wd265], a
- ld hl, EnemyMonBaseStats
- ld c, EnemyMonEnd - EnemyMonBaseStats
+ ld hl, wEnemyMonBaseStats
+ ld c, wEnemyMonEnd - wEnemyMonBaseStats
.count_loop2
xor a
ld [hDividend + 0], a
@@ -7651,7 +7652,7 @@
text_jump Text_Gained
start_asm
ld hl, TextJump_StringBuffer2ExpPoints
- ld a, [StringBuffer2 + 2] ; IsTradedMon
+ ld a, [wStringBuffer2 + 2] ; IsTradedMon
and a
ret z
@@ -7672,12 +7673,12 @@
AnimateExpBar: ; 3f136
push bc
- ld hl, CurPartyMon
- ld a, [CurBattleMon]
+ ld hl, wCurPartyMon
+ ld a, [wCurBattleMon]
cp [hl]
jp nz, .finish
- ld a, [BattleMonLevel]
+ ld a, [wBattleMonLevel]
cp MAX_LEVEL
jp nc, .finish
@@ -7690,16 +7691,16 @@
xor a
ld [wd002], a
xor a ; PARTYMON
- ld [MonType], a
+ ld [wMonType], a
predef CopyPkmnToTempMon
- ld a, [TempMonLevel]
+ ld a, [wTempMonLevel]
ld b, a
ld e, a
push de
- ld de, TempMonExp + 2
+ ld de, wTempMonExp + 2
call CalcExpBar
push bc
- ld hl, TempMonExp + 2
+ ld hl, wTempMonExp + 2
ld a, [wd004]
add [hl]
ld [hld], a
@@ -7723,7 +7724,7 @@
ld c, a
ld a, [hProduct + 3]
ld d, a
- ld hl, TempMonExp + 2
+ ld hl, wTempMonExp + 2
ld a, [hld]
sub d
ld a, [hld]
@@ -7756,16 +7757,16 @@
cp d
jr z, .FinishExpBar
inc a
- ld [TempMonLevel], a
- ld [CurPartyLevel], a
- ld [BattleMonLevel], a
+ ld [wTempMonLevel], a
+ ld [wCurPartyLevel], a
+ ld [wBattleMonLevel], a
push de
call .PlayExpBarSound
ld c, $40
call .LoopBarAnimation
call PrintPlayerHUD
- ld hl, BattleMonNick
- ld de, StringBuffer1
+ ld hl, wBattleMonNick
+ ld de, wStringBuffer1
ld bc, MON_NAME_LENGTH
call CopyBytes
call TerminateExpBarSound
@@ -7783,7 +7784,7 @@
.FinishExpBar:
push bc
ld b, d
- ld de, TempMonExp + 2
+ ld de, wTempMonExp + 2
call CalcExpBar
ld a, b
pop bc
@@ -7868,7 +7869,7 @@
.not_linked
; Depending on the HP of the enemy Pkmn, the game prints a different text
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld a, [hli]
or [hl]
ld hl, JumpText_GoPkmn
@@ -7877,7 +7878,7 @@
; compute enemy helth remaining as a percentage
xor a
ld [hMultiplicand + 0], a
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld a, [hli]
ld [wEnemyHPAtTimeOfPlayerSwitch], a
ld [hMultiplicand + 1], a
@@ -7887,7 +7888,7 @@
ld a, 25
ld [hMultiplier], a
call Multiply
- ld hl, EnemyMonMaxHP
+ ld hl, wEnemyMonMaxHP
ld a, [hli]
ld b, [hl]
srl a
@@ -7959,7 +7960,7 @@
; depending on HP the message is different
push de
push bc
- ld hl, EnemyMonHP + 1
+ ld hl, wEnemyMonHP + 1
ld de, wEnemyHPAtTimeOfPlayerSwitch + 1
ld b, [hl]
dec hl
@@ -7974,7 +7975,7 @@
ld a, 25
ld [hMultiplier], a
call Multiply
- ld hl, EnemyMonMaxHP
+ ld hl, wEnemyMonMaxHP
ld a, [hli]
ld b, [hl]
srl a
@@ -8048,11 +8049,11 @@
ld hl, BattleText_WildPkmnIsAngry
jr nz, .finish
push hl
- ld a, [EnemyMonSpecies]
- ld [CurSpecies], a
+ ld a, [wEnemyMonSpecies]
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [BaseCatchRate]
- ld [EnemyMonCatchRate], a
+ ld a, [wBaseCatchRate]
+ ld [wEnemyMonCatchRate], a
pop hl
.finish
@@ -8205,7 +8206,7 @@
; 3f43d
GetBattleMonBackpic: ; 3f43d
- ld a, [PlayerSubStatus4]
+ ld a, [wPlayerSubStatus4]
bit SUBSTATUS_SUBSTITUTE, a
ld hl, BattleAnimCmd_RaiseSub
jr nz, GetBattleMonBackpic_DoAnim ; substitute
@@ -8215,16 +8216,16 @@
and a
ld hl, BattleAnimCmd_MinimizeOpp
jr nz, GetBattleMonBackpic_DoAnim
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
push af
- ld a, [BattleMonSpecies]
- ld [CurPartySpecies], a
- ld hl, BattleMonDVs
+ ld a, [wBattleMonSpecies]
+ ld [wCurPartySpecies], a
+ ld hl, wBattleMonDVs
predef GetUnownLetter
ld de, vTiles2 tile $31
predef GetMonBackpic
pop af
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ret
; 3f46f
@@ -8241,7 +8242,7 @@
; 3f47c
GetEnemyMonFrontpic: ; 3f47c
- ld a, [EnemySubStatus4]
+ ld a, [wEnemySubStatus4]
bit SUBSTATUS_SUBSTITUTE, a
ld hl, BattleAnimCmd_RaiseSub
jr nz, GetEnemyMonFrontpic_DoAnim
@@ -8252,18 +8253,18 @@
ld hl, BattleAnimCmd_MinimizeOpp
jr nz, GetEnemyMonFrontpic_DoAnim
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
push af
- ld a, [EnemyMonSpecies]
- ld [CurSpecies], a
- ld [CurPartySpecies], a
+ ld a, [wEnemyMonSpecies]
+ ld [wCurSpecies], a
+ ld [wCurPartySpecies], a
call GetBaseData
- ld hl, EnemyMonDVs
+ ld hl, wEnemyMonDVs
predef GetUnownLetter
ld de, vTiles2
predef GetAnimatedFrontpic
pop af
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ret
; 3f4b4
@@ -8282,17 +8283,17 @@
; This check prevents you from entering a battle without any Pokemon.
; Those using walk-through-walls to bypass getting a Pokemon experience
; the effects of this check.
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret z
- ld a, [TimeOfDayPal]
+ ld a, [wTimeOfDayPal]
push af
call BattleIntro
call DoBattle
call ExitBattle
pop af
- ld [TimeOfDayPal], a
+ ld [wTimeOfDayPal], a
scf
ret
; 3f4d9
@@ -8306,7 +8307,7 @@
farcall StubbedTrainerRankings_Battles ; mobile
call LoadTrainerOrWildMonPic
xor a
- ld [TempBattleMonSpecies], a
+ ld [wTempBattleMonSpecies], a
ld [wBattleMenuCursorBuffer], a
xor a
ld [hMapAnims], a
@@ -8344,19 +8345,19 @@
; 3f54e
LoadTrainerOrWildMonPic: ; 3f54e
- ld a, [OtherTrainerClass]
+ ld a, [wOtherTrainerClass]
and a
jr nz, .Trainer
- ld a, [TempWildMonSpecies]
- ld [CurPartySpecies], a
+ ld a, [wTempWildMonSpecies]
+ ld [wCurPartySpecies], a
.Trainer:
- ld [TempEnemyMonSpecies], a
+ ld [wTempEnemyMonSpecies], a
ret
; 3f55e
InitEnemy: ; 3f55e
- ld a, [OtherTrainerClass]
+ ld a, [wOtherTrainerClass]
and a
jp nz, InitEnemyTrainer ; trainer
jp InitEnemyWildmon ; wild
@@ -8387,19 +8388,19 @@
; 3f594
InitEnemyTrainer: ; 3f594
- ld [TrainerClass], a
+ ld [wTrainerClass], a
farcall StubbedTrainerRankings_TrainerBattles
xor a
- ld [TempEnemyMonSpecies], a
+ ld [wTempEnemyMonSpecies], a
callfar GetTrainerAttributes
callfar ReadTrainerParty
; RIVAL1's first mon has no held item
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
cp RIVAL1
jr nz, .ok
xor a
- ld [OTPartyMon1Item], a
+ ld [wOTPartyMon1Item], a
.ok
ld de, vTiles2
@@ -8412,7 +8413,7 @@
lb bc, 7, 7
predef PlaceGraphic
ld a, -1
- ld [CurOTMon], a
+ ld [wCurOTMon], a
ld a, TRAINER_BATTLE
ld [wBattleMode], a
@@ -8419,8 +8420,8 @@
call IsGymLeader
jr nc, .done
xor a
- ld [CurPartyMon], a
- ld a, [PartyCount]
+ ld [wCurPartyMon], a
+ ld a, [wPartyCount]
ld b, a
.partyloop
push bc
@@ -8435,7 +8436,7 @@
pop bc
dec b
jr z, .done
- ld hl, CurPartyMon
+ ld hl, wCurPartyMon
inc [hl]
jr .partyloop
.done
@@ -8447,29 +8448,29 @@
ld [wBattleMode], a
farcall StubbedTrainerRankings_WildBattles
call LoadEnemyMon
- ld hl, EnemyMonMoves
+ ld hl, wEnemyMonMoves
ld de, wWildMonMoves
ld bc, NUM_MOVES
call CopyBytes
- ld hl, EnemyMonPP
+ ld hl, wEnemyMonPP
ld de, wWildMonPP
ld bc, NUM_MOVES
call CopyBytes
- ld hl, EnemyMonDVs
+ ld hl, wEnemyMonDVs
predef GetUnownLetter
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp UNOWN
jr nz, .skip_unown
ld a, [wFirstUnownSeen]
and a
jr nz, .skip_unown
- ld a, [UnownLetter]
+ ld a, [wUnownLetter]
ld [wFirstUnownSeen], a
.skip_unown
ld de, vTiles2
predef GetAnimatedFrontpic
xor a
- ld [TrainerClass], a
+ ld [wTrainerClass], a
ld [hGraphicStartTile], a
hlcoord 12, 0
lb bc, 7, 7
@@ -8478,7 +8479,7 @@
; 3f662
Unreferenced_Function3f662: ; 3f662
- ld hl, EnemyMonMoves
+ ld hl, wEnemyMonMoves
ld de, wListMoves_MoveIndicesBuffer
ld b, NUM_MOVES
.loop
@@ -8500,7 +8501,7 @@
call GetFarByte
pop hl
- ld bc, EnemyMonPP - (EnemyMonMoves + 1)
+ ld bc, wEnemyMonPP - (wEnemyMonMoves + 1)
add hl, bc
ld [hl], a
@@ -8518,7 +8519,7 @@
.clearpp
push bc
push hl
- ld bc, EnemyMonPP - (EnemyMonMoves + 1)
+ ld bc, wEnemyMonPP - (wEnemyMonMoves + 1)
add hl, bc
xor a
ld [hl], a
@@ -8560,12 +8561,12 @@
CleanUpBattleRAM: ; 3f6d0
call BattleEnd_HandleRoamMons
xor a
- ld [Danger], a
+ ld [wLowHealthAlarm], a
ld [wBattleMode], a
- ld [BattleType], a
- ld [AttackMissed], a
- ld [TempWildMonSpecies], a
- ld [OtherTrainerClass], a
+ ld [wBattleType], a
+ ld [wAttackMissed], a
+ ld [wTempWildMonSpecies], a
+ ld [wOtherTrainerClass], a
ld [wFailedToFlee], a
ld [wNumFleeAttempts], a
ld [wForcedSwitch], a
@@ -8573,7 +8574,7 @@
ld [wKeyItemsPocketCursor], a
ld [wItemsPocketCursor], a
ld [wBattleMenuCursorBuffer], a
- ld [CurMoveNum], a
+ ld [wCurMoveNum], a
ld [wBallsPocketCursor], a
ld [wLastPocket], a
ld [wMenuScrollPosition], a
@@ -8580,8 +8581,8 @@
ld [wKeyItemsPocketScrollPosition], a
ld [wItemsPocketScrollPosition], a
ld [wBallsPocketScrollPosition], a
- ld hl, PlayerSubStatus1
- ld b, EnemyFuryCutterCount - PlayerSubStatus1
+ ld hl, wPlayerSubStatus1
+ ld b, wEnemyFuryCutterCount - wPlayerSubStatus1
.loop
ld [hli], a
dec b
@@ -8614,11 +8615,11 @@
.okay
ld hl, wPayDayMoney + 2
- ld de, Money + 2
+ ld de, wMoney + 2
call AddBattleMoneyToAccount
ld hl, BattleText_PlayerPickedUpPayDayMoney
call StdBattleTextBox
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
bit 0, a
ret z
call ClearTileMap
@@ -8629,10 +8630,10 @@
ShowLinkBattleParticipantsAfterEnd: ; 3f759
farcall StubbedTrainerRankings_LinkBattles
farcall BackupMobileEventIndex
- ld a, [CurOTMon]
- ld hl, OTPartyMon1Status
+ ld a, [wCurOTMon]
+ ld hl, wOTPartyMon1Status
call GetPartyLocation
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
ld [hl], a
call ClearTileMap
farcall _ShowLinkBattleParticipants
@@ -8734,7 +8735,7 @@
call ReadAndPrintLinkBattleRecord
call CloseSRAM
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
xor a
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
@@ -8883,7 +8884,7 @@
; 3f998
BattleEnd_HandleRoamMons: ; 3f998
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_ROAMING
jr nz, .not_roaming
ld a, [wBattleResult]
@@ -8890,7 +8891,7 @@
and $f
jr z, .caught_or_defeated_roam_mon
call GetRoamMonHP
- ld a, [EnemyMonHP + 1]
+ ld a, [wEnemyMonHP + 1]
ld [hl], a
jr .update_roam_mons
@@ -8916,7 +8917,7 @@
; 3f9d1
GetRoamMonMapGroup: ; 3f9d1
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
ld b, a
ld a, [wRoamMon1Species]
cp b
@@ -8931,7 +8932,7 @@
; 3f9e9
GetRoamMonMapNumber: ; 3f9e9
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
ld b, a
ld a, [wRoamMon1Species]
cp b
@@ -8947,7 +8948,7 @@
GetRoamMonHP: ; 3fa01
; output: hl = wRoamMonHP
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
ld b, a
ld a, [wRoamMon1Species]
cp b
@@ -8963,7 +8964,7 @@
GetRoamMonDVs: ; 3fa19
; output: hl = wRoamMonDVs
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
ld b, a
ld a, [wRoamMon1Species]
cp b
@@ -8978,7 +8979,7 @@
; 3fa31
GetRoamMonSpecies: ; 3fa31
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
ld hl, wRoamMon1Species
cp [hl]
ret z
@@ -8990,11 +8991,11 @@
; 3fa42
AddLastMobileBattleToLinkRecord: ; 3fa42
- ld hl, OTPlayerID
- ld de, StringBuffer1
+ ld hl, wOTPlayerID
+ ld de, wStringBuffer1
ld bc, 2
call CopyBytes
- ld hl, OTPlayerName
+ ld hl, wOTPlayerName
ld bc, NAME_LENGTH - 1
call CopyBytes
ld hl, sLinkBattleResults
@@ -9012,7 +9013,7 @@
jr z, .copy
push de
ld bc, 12
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call CompareLong
pop de
pop hl
@@ -9028,7 +9029,7 @@
.copy
ld d, h
ld e, l
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld bc, 12
call CopyBytes
ld b, 6
@@ -9275,7 +9276,7 @@
; Special exception for Dude.
ld b, BANK(DudeBackpic)
ld hl, DudeBackpic
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
jr z, .Decompress
@@ -9326,7 +9327,7 @@
; 3fc5b
.LoadTrainerBackpicAsOAM: ; 3fc5b
- ld hl, Sprite01
+ ld hl, wVirtualOAMSprite00
xor a
ld [hMapObjectIndexBuffer], a
ld b, 6
@@ -9406,12 +9407,12 @@
.cry_no_anim
ld a, $0f
- ld [CryTracks], a
- ld a, [TempEnemyMonSpecies]
+ ld [wCryTracks], a
+ ld a, [wTempEnemyMonSpecies]
call PlayStereoCry
.skip_cry
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_FISH
jr nz, .NotFishing
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -1,7 +1,7 @@
DoPlayerTurn: ; 34000
call SetPlayerTurn
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
and a
ret nz
@@ -56,7 +56,7 @@
ld a, BANK(MoveEffectsPointers)
call GetFarHalfword
- ld de, BattleScriptBuffer
+ ld de, wBattleScriptBuffer
.GetMoveEffect:
ld a, BANK(MoveEffects)
@@ -68,18 +68,18 @@
jr nz, .GetMoveEffect
; Start at the first command.
- ld hl, BattleScriptBuffer
+ ld hl, wBattleScriptBuffer
ld a, l
- ld [BattleScriptBufferAddress], a
+ ld [wBattleScriptBufferAddress], a
ld a, h
- ld [BattleScriptBufferAddress + 1], a
+ ld [wBattleScriptBufferAddress + 1], a
.ReadMoveEffectCommand:
-; ld a, [BattleScriptBufferAddress++]
- ld a, [BattleScriptBufferAddress]
+; ld a, [wBattleScriptBufferAddress++]
+ ld a, [wBattleScriptBufferAddress]
ld l, a
- ld a, [BattleScriptBufferAddress + 1]
+ ld a, [wBattleScriptBufferAddress + 1]
ld h, a
ld a, [hli]
@@ -86,9 +86,9 @@
push af
ld a, l
- ld [BattleScriptBufferAddress], a
+ ld [wBattleScriptBufferAddress], a
ld a, h
- ld [BattleScriptBufferAddress + 1], a
+ ld [wBattleScriptBufferAddress + 1], a
pop af
; endturn_command (-2) is used to terminate branches without ending the read cycle.
@@ -131,15 +131,15 @@
jp z, EndTurn
xor a
- ld [AttackMissed], a
- ld [EffectFailed], a
+ ld [wAttackMissed], a
+ ld [wEffectFailed], a
ld [wKickCounter], a
- ld [AlreadyDisobeyed], a
- ld [AlreadyFailed], a
+ ld [wAlreadyDisobeyed], a
+ ld [wAlreadyFailed], a
ld [wSomeoneIsRampaging], a
ld a, EFFECTIVE
- ld [TypeModifier], a
+ ld [wTypeModifier], a
ld a, [hBattleTurn]
and a
@@ -148,7 +148,7 @@
CheckPlayerTurn:
- ld hl, PlayerSubStatus4
+ ld hl, wPlayerSubStatus4
bit SUBSTATUS_RECHARGE, [hl]
jr z, .no_recharge
@@ -161,13 +161,13 @@
.no_recharge
- ld hl, BattleMonStatus
+ ld hl, wBattleMonStatus
ld a, [hl]
and SLP
jr z, .not_asleep
dec a
- ld [BattleMonStatus], a
+ ld [wBattleMonStatus], a
and SLP
jr z, .woke_up
@@ -186,7 +186,7 @@
call CallBattleCore
ld a, $1
ld [hBGMapMode], a
- ld hl, PlayerSubStatus1
+ ld hl, wPlayerSubStatus1
res SUBSTATUS_NIGHTMARE, [hl]
jr .not_asleep
@@ -195,7 +195,7 @@
call StdBattleTextBox
; Snore and Sleep Talk bypass sleep.
- ld a, [CurPlayerMove]
+ ld a, [wCurPlayerMove]
cp SNORE
jr z, .not_asleep
cp SLEEP_TALK
@@ -207,12 +207,12 @@
.not_asleep
- ld hl, BattleMonStatus
+ ld hl, wBattleMonStatus
bit FRZ, [hl]
jr z, .not_frozen
; Flame Wheel and Sacred Fire thaw the user.
- ld a, [CurPlayerMove]
+ ld a, [wCurPlayerMove]
cp FLAME_WHEEL
jr z, .not_frozen
cp SACRED_FIRE
@@ -227,7 +227,7 @@
.not_frozen
- ld hl, PlayerSubStatus3
+ ld hl, wPlayerSubStatus3
bit SUBSTATUS_FLINCHED, [hl]
jr z, .not_flinched
@@ -241,7 +241,7 @@
.not_flinched
- ld hl, PlayerDisableCount
+ ld hl, wPlayerDisableCount
ld a, [hl]
and a
jr z, .not_disabled
@@ -252,7 +252,7 @@
jr nz, .not_disabled
ld [hl], a
- ld [DisabledMove], a
+ ld [wDisabledMove], a
ld hl, DisabledNoMoreText
call StdBattleTextBox
@@ -259,14 +259,14 @@
.not_disabled
- ld a, [PlayerSubStatus3]
+ ld a, [wPlayerSubStatus3]
add a
jr nc, .not_confused
- ld hl, PlayerConfuseCount
+ ld hl, wPlayerConfuseCount
dec [hl]
jr nz, .confused
- ld hl, PlayerSubStatus3
+ ld hl, wPlayerSubStatus3
res SUBSTATUS_CONFUSED, [hl]
ld hl, ConfusedNoMoreText
call StdBattleTextBox
@@ -286,7 +286,7 @@
jr nc, .not_confused
; clear confusion-dependent substatus
- ld hl, PlayerSubStatus3
+ ld hl, wPlayerSubStatus3
ld a, [hl]
and 1 << SUBSTATUS_CONFUSED
ld [hl], a
@@ -298,7 +298,7 @@
.not_confused
- ld a, [PlayerSubStatus1]
+ ld a, [wPlayerSubStatus1]
add a ; bit SUBSTATUS_ATTRACT
jr nc, .not_infatuated
@@ -323,12 +323,12 @@
; We can't disable a move that doesn't exist.
- ld a, [DisabledMove]
+ ld a, [wDisabledMove]
and a
jr z, .no_disabled_move
; Are we using the disabled move?
- ld hl, CurPlayerMove
+ ld hl, wCurPlayerMove
cp [hl]
jr nz, .no_disabled_move
@@ -339,7 +339,7 @@
.no_disabled_move
- ld hl, BattleMonStatus
+ ld hl, wBattleMonStatus
bit PAR, [hl]
ret z
@@ -397,7 +397,7 @@
CheckEnemyTurn: ; 3421f
- ld hl, EnemySubStatus4
+ ld hl, wEnemySubStatus4
bit SUBSTATUS_RECHARGE, [hl]
jr z, .no_recharge
@@ -410,13 +410,13 @@
.no_recharge
- ld hl, EnemyMonStatus
+ ld hl, wEnemyMonStatus
ld a, [hl]
and SLP
jr z, .not_asleep
dec a
- ld [EnemyMonStatus], a
+ ld [wEnemyMonStatus], a
and a
jr z, .woke_up
@@ -437,13 +437,13 @@
call CallBattleCore
ld a, $1
ld [hBGMapMode], a
- ld hl, EnemySubStatus1
+ ld hl, wEnemySubStatus1
res SUBSTATUS_NIGHTMARE, [hl]
jr .not_asleep
.fast_asleep
; Snore and Sleep Talk bypass sleep.
- ld a, [CurEnemyMove]
+ ld a, [wCurEnemyMove]
cp SNORE
jr z, .not_asleep
cp SLEEP_TALK
@@ -454,12 +454,12 @@
.not_asleep
- ld hl, EnemyMonStatus
+ ld hl, wEnemyMonStatus
bit FRZ, [hl]
jr z, .not_frozen
; Flame Wheel and Sacred Fire thaw the user.
- ld a, [CurEnemyMove]
+ ld a, [wCurEnemyMove]
cp FLAME_WHEEL
jr z, .not_frozen
cp SACRED_FIRE
@@ -473,7 +473,7 @@
.not_frozen
- ld hl, EnemySubStatus3
+ ld hl, wEnemySubStatus3
bit SUBSTATUS_FLINCHED, [hl]
jr z, .not_flinched
@@ -487,7 +487,7 @@
.not_flinched
- ld hl, EnemyDisableCount
+ ld hl, wEnemyDisableCount
ld a, [hl]
and a
jr z, .not_disabled
@@ -498,7 +498,7 @@
jr nz, .not_disabled
ld [hl], a
- ld [EnemyDisabledMove], a
+ ld [wEnemyDisabledMove], a
ld hl, DisabledNoMoreText
call StdBattleTextBox
@@ -506,15 +506,15 @@
.not_disabled
- ld a, [EnemySubStatus3]
+ ld a, [wEnemySubStatus3]
add a ; bit SUBSTATUS_CONFUSED
jr nc, .not_confused
- ld hl, EnemyConfuseCount
+ ld hl, wEnemyConfuseCount
dec [hl]
jr nz, .confused
- ld hl, EnemySubStatus3
+ ld hl, wEnemySubStatus3
res SUBSTATUS_CONFUSED, [hl]
ld hl, ConfusedNoMoreText
call StdBattleTextBox
@@ -536,7 +536,7 @@
jr nc, .not_confused
; clear confusion-dependent substatus
- ld hl, EnemySubStatus3
+ ld hl, wEnemySubStatus3
ld a, [hl]
and 1 << SUBSTATUS_CONFUSED
ld [hl], a
@@ -565,7 +565,7 @@
.not_confused
- ld a, [EnemySubStatus1]
+ ld a, [wEnemySubStatus1]
add a ; bit SUBSTATUS_ATTRACT
jr nc, .not_infatuated
@@ -590,12 +590,12 @@
; We can't disable a move that doesn't exist.
- ld a, [EnemyDisabledMove]
+ ld a, [wEnemyDisabledMove]
and a
jr z, .no_disabled_move
; Are we using the disabled move?
- ld hl, CurEnemyMove
+ ld hl, wCurEnemyMove
cp [hl]
jr nz, .no_disabled_move
@@ -607,7 +607,7 @@
.no_disabled_move
- ld hl, EnemyMonStatus
+ ld hl, wEnemyMonStatus
bit PAR, [hl]
ret z
@@ -656,7 +656,7 @@
call StdBattleTextBox
xor a
- ld [CriticalHit], a
+ ld [wCriticalHit], a
call HitSelfInConfusion
call BattleCommand_DamageCalc
@@ -695,12 +695,12 @@
ret nz
; If we've already checked this turn
- ld a, [AlreadyDisobeyed]
+ ld a, [wAlreadyDisobeyed]
and a
ret nz
xor a
- ld [AlreadyDisobeyed], a
+ ld [wAlreadyDisobeyed], a
; No obedience in link battles
; (since no handling exists for enemy)
@@ -708,7 +708,7 @@
and a
ret nz
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
and a
ret nz
@@ -717,11 +717,11 @@
ld a, MON_ID
call BattlePartyAttr
- ld a, [PlayerID]
+ ld a, [wPlayerID]
cp [hl]
jr nz, .obeylevel
inc hl
- ld a, [PlayerID + 1]
+ ld a, [wPlayerID + 1]
cp [hl]
ret z
@@ -762,7 +762,7 @@
ld b, a
ld c, a
- ld a, [BattleMonLevel]
+ ld a, [wBattleMonLevel]
ld d, a
add b
@@ -839,7 +839,7 @@
and SLP
jr z, .Nap
- ld [BattleMonStatus], a
+ ld [wBattleMonStatus], a
ld hl, BeganToNapText
jr .Print
@@ -872,18 +872,18 @@
.UseInstead:
; Can't use another move if the monster only has one!
- ld a, [BattleMonMoves + 1]
+ ld a, [wBattleMonMoves + 1]
and a
jr z, .DoNothing
; Don't bother trying to handle Disable.
- ld a, [DisabledMove]
+ ld a, [wDisabledMove]
and a
jr nz, .DoNothing
- ld hl, BattleMonPP
- ld de, BattleMonMoves
+ ld hl, wBattleMonPP
+ ld de, wBattleMonMoves
ld b, 0
ld c, NUM_MOVES
@@ -904,8 +904,8 @@
.CheckMovePP:
- ld hl, BattleMonPP
- ld a, [CurMoveNum]
+ ld hl, wBattleMonPP
+ ld a, [wCurMoveNum]
ld e, a
ld d, 0
add hl, de
@@ -919,13 +919,13 @@
; Make sure we can actually use the move once we get there.
ld a, 1
- ld [AlreadyDisobeyed], a
+ ld [wAlreadyDisobeyed], a
ld a, [w2DMenuNumRows]
ld b, a
; Save the move we originally picked for afterward.
- ld a, [CurMoveNum]
+ ld a, [wCurMoveNum]
ld c, a
push af
@@ -942,8 +942,8 @@
jr z, .RandomMove
; Make sure it has PP.
- ld [CurMoveNum], a
- ld hl, BattleMonPP
+ ld [wCurMoveNum], a
+ ld hl, wBattleMonPP
ld e, a
ld d, 0
add hl, de
@@ -953,13 +953,13 @@
; Use it.
- ld a, [CurMoveNum]
+ ld a, [wCurMoveNum]
ld c, a
ld b, 0
- ld hl, BattleMonMoves
+ ld hl, wBattleMonMoves
add hl, bc
ld a, [hl]
- ld [CurPlayerMove], a
+ ld [wCurPlayerMove], a
call SetPlayerTurn
call UpdateMoveData
@@ -968,19 +968,19 @@
; Restore original move choice.
pop af
- ld [CurMoveNum], a
+ ld [wCurMoveNum], a
.EndDisobedience:
xor a
- ld [LastPlayerMove], a
- ld [LastPlayerCounterMove], a
+ ld [wLastPlayerMove], a
+ ld [wLastPlayerCounterMove], a
; Break Encore too.
- ld hl, PlayerSubStatus5
+ ld hl, wPlayerSubStatus5
res SUBSTATUS_ENCORED, [hl]
xor a
- ld [PlayerEncoreCount], a
+ ld [wPlayerEncoreCount], a
jp EndMoveEffect
@@ -1044,17 +1044,17 @@
call CheckUserIsCharging
ret nz
- ld hl, BattleMonPP
- ld de, PlayerSubStatus3
- ld bc, PlayerTurnsTaken
+ ld hl, wBattleMonPP
+ ld de, wPlayerSubStatus3
+ ld bc, wPlayerTurnsTaken
ld a, [hBattleTurn]
and a
jr z, .proceed
- ld hl, EnemyMonPP
- ld de, EnemySubStatus3
- ld bc, EnemyTurnsTaken
+ ld hl, wEnemyMonPP
+ ld de, wEnemySubStatus3
+ ld bc, wEnemyTurnsTaken
.proceed
@@ -1088,8 +1088,8 @@
ld a, [hBattleTurn]
and a
- ld hl, PartyMon1PP
- ld a, [CurBattleMon]
+ ld hl, wPartyMon1PP
+ ld a, [wCurBattleMon]
jr z, .player
; mimic this part entirely if wildbattle
@@ -1097,8 +1097,8 @@
dec a
jr z, .wild
- ld hl, OTPartyMon1PP
- ld a, [CurOTMon]
+ ld hl, wOTPartyMon1PP
+ ld a, [wCurOTMon]
.player
call GetPartyLocation
@@ -1110,9 +1110,9 @@
.consume_pp
ld a, [hBattleTurn]
and a
- ld a, [CurMoveNum]
+ ld a, [wCurMoveNum]
jr z, .okay
- ld a, [CurEnemyMoveNum]
+ ld a, [wCurEnemyMoveNum]
.okay
ld c, a
@@ -1126,8 +1126,8 @@
ret
.wild
- ld hl, EnemyMonMoves
- ld a, [CurEnemyMoveNum]
+ ld hl, wEnemyMonMoves
+ ld a, [wCurEnemyMoveNum]
ld c, a
ld b, 0
add hl, bc
@@ -1182,9 +1182,9 @@
CheckMimicUsed: ; 3460b
ld a, [hBattleTurn]
and a
- ld a, [CurMoveNum]
+ ld a, [wCurMoveNum]
jr z, .player
- ld a, [CurEnemyMoveNum]
+ ld a, [wCurEnemyMoveNum]
.player
ld c, a
@@ -1218,7 +1218,7 @@
; Determine whether this attack's hit will be critical.
xor a
- ld [CriticalHit], a
+ ld [wCriticalHit], a
ld a, BATTLE_VARS_MOVE_POWER
call GetBattleVar
@@ -1227,11 +1227,11 @@
ld a, [hBattleTurn]
and a
- ld hl, EnemyMonItem
- ld a, [EnemyMonSpecies]
+ ld hl, wEnemyMonItem
+ ld a, [wEnemyMonSpecies]
jr nz, .Item
- ld hl, BattleMonItem
- ld a, [BattleMonSpecies]
+ ld hl, wBattleMonItem
+ ld a, [wBattleMonSpecies]
.Item:
ld c, 0
@@ -1299,7 +1299,7 @@
cp [hl]
ret nc
ld a, 1
- ld [CriticalHit], a
+ ld [wCriticalHit], a
ret
INCLUDE "data/battle/critical_hits.asm"
@@ -1312,7 +1312,7 @@
ld a, [wKickCounter]
ld b, a
inc b
- ld hl, CurDamage + 1
+ ld hl, wCurDamage + 1
ld a, [hld]
ld e, a
ld a, [hli]
@@ -1354,11 +1354,11 @@
cp STRUGGLE
ret z
- ld hl, BattleMonType1
+ ld hl, wBattleMonType1
ld a, [hli]
ld b, a
ld c, [hl]
- ld hl, EnemyMonType1
+ ld hl, wEnemyMonType1
ld a, [hli]
ld d, a
ld e, [hl]
@@ -1367,11 +1367,11 @@
and a
jr z, .go ; Who Attacks and who Defends
- ld hl, EnemyMonType1
+ ld hl, wEnemyMonType1
ld a, [hli]
ld b, a
ld c, [hl]
- ld hl, BattleMonType1
+ ld hl, wBattleMonType1
ld a, [hli]
ld d, a
ld e, [hl]
@@ -1404,7 +1404,7 @@
jr .SkipStab
.stab
- ld hl, CurDamage + 1
+ ld hl, wCurDamage + 1
ld a, [hld]
ld h, [hl]
ld l, a
@@ -1416,11 +1416,11 @@
add hl, bc
ld a, h
- ld [CurDamage], a
+ ld [wCurDamage], a
ld a, l
- ld [CurDamage + 1], a
+ ld [wCurDamage + 1], a
- ld hl, TypeModifier
+ ld hl, wTypeModifier
set 7, [hl]
.SkipStab:
@@ -1459,7 +1459,7 @@
push hl
push bc
inc hl
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and %10000000
ld b, a
; If the target is immune to the move, treat it as a miss and calculate the damage as 0
@@ -1467,17 +1467,17 @@
and a
jr nz, .NotImmune
inc a
- ld [AttackMissed], a
+ ld [wAttackMissed], a
xor a
.NotImmune:
ld [hMultiplier], a
add b
- ld [TypeModifier], a
+ ld [wTypeModifier], a
xor a
ld [hMultiplicand + 0], a
- ld hl, CurDamage
+ ld hl, wCurDamage
ld a, [hli]
ld [hMultiplicand + 1], a
ld a, [hld]
@@ -1525,10 +1525,10 @@
call BattleCheckTypeMatchup
ld a, [wTypeMatchup]
ld b, a
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and %10000000
or b
- ld [TypeModifier], a
+ ld [wTypeModifier], a
ret
; 347c8
@@ -1535,11 +1535,11 @@
BattleCheckTypeMatchup: ; 347c8
- ld hl, EnemyMonType1
+ ld hl, wEnemyMonType1
ld a, [hBattleTurn]
and a
jr z, CheckTypeMatchup
- ld hl, BattleMonType1
+ ld hl, wBattleMonType1
CheckTypeMatchup: ; 347d3
; There is an incorrect assumption about this function made in the AI related code: when
; the AI calls CheckTypeMatchup (not BattleCheckTypeMatchup), it assumes that placing
@@ -1626,9 +1626,9 @@
jr nz, .reset
call ResetDamage
xor a
- ld [TypeModifier], a
+ ld [wTypeModifier], a
inc a
- ld [AttackMissed], a
+ ld [wAttackMissed], a
ret
.reset
@@ -1652,7 +1652,7 @@
; No point in reducing 1 or 0 damage.
- ld hl, CurDamage
+ ld hl, wCurDamage
ld a, [hli]
and a
jr nz, .go
@@ -1688,7 +1688,7 @@
; ...to get .85-1.00x damage.
ld a, [hQuotient + 1]
- ld hl, CurDamage
+ ld hl, wCurDamage
ld [hli], a
ld a, [hQuotient + 2]
ld [hl], a
@@ -1776,7 +1776,7 @@
.Missed:
ld a, 1
- ld [AttackMissed], a
+ ld [wAttackMissed], a
ret
@@ -1908,7 +1908,7 @@
cp EFFECT_THUNDER
ret nz
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_RAIN
ret
@@ -1927,17 +1927,17 @@
; load the user's accuracy into b and the opponent's evasion into c.
ld hl, wPlayerMoveStruct + MOVE_ACC
- ld a, [PlayerAccLevel]
+ ld a, [wPlayerAccLevel]
ld b, a
- ld a, [EnemyEvaLevel]
+ ld a, [wEnemyEvaLevel]
ld c, a
jr z, .got_acc_eva
ld hl, wEnemyMoveStruct + MOVE_ACC
- ld a, [EnemyAccLevel]
+ ld a, [wEnemyAccLevel]
ld b, a
- ld a, [PlayerEvaLevel]
+ ld a, [wPlayerEvaLevel]
ld c, a
.got_acc_eva
@@ -2020,7 +2020,7 @@
; effectchance
xor a
- ld [EffectFailed], a
+ ld [wEffectFailed], a
call CheckSubstituteOpp
jr nz, .failed
@@ -2039,7 +2039,7 @@
.failed
ld a, 1
- ld [EffectFailed], a
+ ld [wEffectFailed], a
and a
ret
@@ -2085,7 +2085,7 @@
xor a
ld [wNumHits], a
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
inc a
ld [wKickCounter], a
ld a, SUBSTITUTE
@@ -2127,16 +2127,16 @@
BattleCommand_HitTargetNoSub: ; 34f60
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jp nz, BattleCommand_MoveDelay
ld a, [hBattleTurn]
and a
- ld de, PlayerRolloutCount
+ ld de, wPlayerRolloutCount
ld a, BATTLEANIM_ENEMY_DAMAGE
jr z, .got_rollout_count
- ld de, EnemyRolloutCount
+ ld de, wEnemyRolloutCount
ld a, BATTLEANIM_PLAYER_DAMAGE
.got_rollout_count
@@ -2200,7 +2200,7 @@
BattleCommand_StatUpAnim: ; 34fd1
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jp nz, BattleCommand_MoveDelay
@@ -2211,7 +2211,7 @@
BattleCommand_StatDownAnim: ; 34fdb
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jp nz, BattleCommand_MoveDelay
@@ -2262,7 +2262,7 @@
xor a
ld [wNumHits], a
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
ld a, $2
ld [wKickCounter], a
ld a, SUBSTITUTE
@@ -2276,7 +2276,7 @@
; If the move missed or failed, load the appropriate
; text, and end the effects of multi-turn or multi-
; hit moves.
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
ret z
@@ -2380,20 +2380,20 @@
bit SUBSTATUS_SUBSTITUTE, a
ret nz
- ld de, PlayerDamageTaken + 1
+ ld de, wPlayerDamageTaken + 1
ld a, [hBattleTurn]
and a
jr nz, .damage_taken
- ld de, EnemyDamageTaken + 1
+ ld de, wEnemyDamageTaken + 1
.damage_taken
- ld a, [CurDamage + 1]
+ ld a, [wCurDamage + 1]
ld b, a
ld a, [de]
add b
ld [de], a
dec de
- ld a, [CurDamage]
+ ld a, [wCurDamage]
ld b, a
ld a, [de]
adc b
@@ -2411,7 +2411,7 @@
GetFailureResultText: ; 350e4
ld hl, DoesntAffectText
ld de, DoesntAffectText
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and $7f
jr z, .got_text
ld a, BATTLE_VARS_MOVE_EFFECT
@@ -2422,7 +2422,7 @@
jr z, .got_text
ld hl, AttackMissedText
ld de, AttackMissed2Text
- ld a, [CriticalHit]
+ ld a, [wCriticalHit]
cp -1
jr nz, .got_text
ld hl, UnaffectedText
@@ -2429,7 +2429,7 @@
.got_text
call FailText_CheckOpponentProtect
xor a
- ld [CriticalHit], a
+ ld [wCriticalHit], a
ld a, BATTLE_VARS_MOVE_EFFECT
call GetBattleVar
@@ -2436,11 +2436,11 @@
cp EFFECT_JUMP_KICK
ret nz
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and $7f
ret z
- ld hl, CurDamage
+ ld hl, wCurDamage
ld a, [hli]
ld b, [hl]
rept 3
@@ -2480,11 +2480,11 @@
BattleCommanda5: ; 35165
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
ret z
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and $7f
jp z, PrintDoesntAffect
jp PrintButItFailed
@@ -2497,7 +2497,7 @@
; Prints the message for critical hits or one-hit KOs.
; If there is no message to be printed, wait 20 frames.
- ld a, [CriticalHit]
+ ld a, [wCriticalHit]
and a
jr z, .wait
@@ -2513,7 +2513,7 @@
call StdBattleTextBox
xor a
- ld [CriticalHit], a
+ ld [wCriticalHit], a
.wait
ld c, 20
@@ -2528,11 +2528,11 @@
BattleCommand_StartLoop: ; 35197
; startloop
- ld hl, PlayerRolloutCount
+ ld hl, wPlayerRolloutCount
ld a, [hBattleTurn]
and a
jr z, .ok
- ld hl, EnemyRolloutCount
+ ld hl, wEnemyRolloutCount
.ok
xor a
ld [hl], a
@@ -2556,7 +2556,7 @@
BattleCommand_SuperEffectiveText: ; 351ad
; supereffectivetext
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and $7f
cp 10 ; 1.0
ret z
@@ -2574,11 +2574,11 @@
; Faint the user if it fainted an opponent using Destiny Bond.
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld a, [hBattleTurn]
and a
jr z, .got_hp
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
.got_hp
ld a, [hli]
@@ -2595,11 +2595,11 @@
ld a, [hBattleTurn]
and a
- ld hl, EnemyMonMaxHP + 1
+ ld hl, wEnemyMonMaxHP + 1
bccoord 2, 2 ; hp bar
ld a, 0
jr nz, .got_max_hp
- ld hl, BattleMonMaxHP + 1
+ ld hl, wBattleMonMaxHP + 1
bccoord 10, 9 ; hp bar
ld a, 1
@@ -2606,19 +2606,19 @@
.got_max_hp
ld [wWhichHPBar], a
ld a, [hld]
- ld [Buffer1], a
+ ld [wBuffer1], a
ld a, [hld]
- ld [Buffer2], a
+ ld [wBuffer2], a
ld a, [hl]
- ld [Buffer3], a
+ ld [wBuffer3], a
xor a
ld [hld], a
ld a, [hl]
- ld [Buffer4], a
+ ld [wBuffer4], a
xor a
ld [hl], a
- ld [Buffer5], a
- ld [Buffer6], a
+ ld [wBuffer5], a
+ ld [wBuffer6], a
ld h, b
ld l, c
predef AnimateHPBar
@@ -2627,7 +2627,7 @@
call BattleCommand_SwitchTurn
xor a
ld [wNumHits], a
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
inc a
ld [wKickCounter], a
ld a, DESTINY_BOND
@@ -2665,7 +2665,7 @@
jp .start
.start
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
ret nz
@@ -2696,10 +2696,10 @@
BattleCommand_RageDamage: ; 3527b
; ragedamage
- ld a, [CurDamage]
+ ld a, [wCurDamage]
ld h, a
ld b, a
- ld a, [CurDamage + 1]
+ ld a, [wCurDamage + 1]
ld l, a
ld c, a
ld a, [hBattleTurn]
@@ -2716,9 +2716,9 @@
ld hl, -1
.done
ld a, h
- ld [CurDamage], a
+ ld [wCurDamage], a
ld a, l
- ld [CurDamage + 1], a
+ ld [wCurDamage + 1], a
ret
; 352a3
@@ -2725,9 +2725,9 @@
EndMoveEffect: ; 352a3
- ld a, [BattleScriptBufferAddress]
+ ld a, [wBattleScriptBufferAddress]
ld l, a
- ld a, [BattleScriptBufferAddress + 1]
+ ld a, [wBattleScriptBufferAddress + 1]
ld h, a
ld a, $ff
ld [hli], a
@@ -2745,7 +2745,7 @@
and a
ld a, [hl]
jr nz, .Ditto
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
.Ditto:
cp DITTO
@@ -2804,12 +2804,12 @@
jr nc, .special
.physical
- ld hl, EnemyMonDefense
+ ld hl, wEnemyMonDefense
ld a, [hli]
ld b, a
ld c, [hl]
- ld a, [EnemyScreens]
+ ld a, [wEnemyScreens]
bit SCREENS_REFLECT, a
jr z, .physicalcrit
sla c
@@ -2816,24 +2816,24 @@
rl b
.physicalcrit
- ld hl, BattleMonAttack
+ ld hl, wBattleMonAttack
call GetDamageStatsCritical
jr c, .thickclub
- ld hl, EnemyDefense
+ ld hl, wEnemyDefense
ld a, [hli]
ld b, a
ld c, [hl]
- ld hl, PlayerAttack
+ ld hl, wPlayerAttack
jr .thickclub
.special
- ld hl, EnemyMonSpclDef
+ ld hl, wEnemyMonSpclDef
ld a, [hli]
ld b, a
ld c, [hl]
- ld a, [EnemyScreens]
+ ld a, [wEnemyScreens]
bit SCREENS_LIGHT_SCREEN, a
jr z, .specialcrit
sla c
@@ -2840,15 +2840,15 @@
rl b
.specialcrit
- ld hl, BattleMonSpclAtk
+ ld hl, wBattleMonSpclAtk
call GetDamageStatsCritical
jr c, .lightball
- ld hl, EnemySpDef
+ ld hl, wEnemySpDef
ld a, [hli]
ld b, a
ld c, [hl]
- ld hl, PlayerSpAtk
+ ld hl, wPlayerSpAtk
.lightball
; Note: Returns player special attack at hl in hl.
@@ -2862,7 +2862,7 @@
.done
call TruncateHL_BC
- ld a, [BattleMonLevel]
+ ld a, [wBattleMonLevel]
ld e, a
call DittoMetalPowder
@@ -2924,7 +2924,7 @@
GetDamageStatsCritical: ; 35378
; Return carry if non-critical.
- ld a, [CriticalHit]
+ ld a, [wCriticalHit]
and a
scf
ret z
@@ -2945,14 +2945,14 @@
ld a, [wPlayerMoveStructType]
cp SPECIAL
; special
- ld a, [PlayerSAtkLevel]
+ ld a, [wPlayerSAtkLevel]
ld b, a
- ld a, [EnemySDefLevel]
+ ld a, [wEnemySDefLevel]
jr nc, .end
; physical
- ld a, [PlayerAtkLevel]
+ ld a, [wPlayerAtkLevel]
ld b, a
- ld a, [EnemyDefLevel]
+ ld a, [wEnemyDefLevel]
jr .end
.enemy
@@ -2959,14 +2959,14 @@
ld a, [wEnemyMoveStructType]
cp SPECIAL
; special
- ld a, [EnemySAtkLevel]
+ ld a, [wEnemySAtkLevel]
ld b, a
- ld a, [PlayerSDefLevel]
+ ld a, [wPlayerSDefLevel]
jr nc, .end
; physical
- ld a, [EnemyAtkLevel]
+ ld a, [wEnemyAtkLevel]
ld b, a
- ld a, [PlayerDefLevel]
+ ld a, [wPlayerDefLevel]
.end
cp b
pop bc
@@ -3030,7 +3030,7 @@
and a
ld a, [hl]
jr z, .CompareSpecies
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
.CompareSpecies:
pop hl
@@ -3070,12 +3070,12 @@
jr nc, .Special
.physical
- ld hl, BattleMonDefense
+ ld hl, wBattleMonDefense
ld a, [hli]
ld b, a
ld c, [hl]
- ld a, [PlayerScreens]
+ ld a, [wPlayerScreens]
bit SCREENS_REFLECT, a
jr z, .physicalcrit
sla c
@@ -3082,24 +3082,24 @@
rl b
.physicalcrit
- ld hl, EnemyMonAttack
+ ld hl, wEnemyMonAttack
call GetDamageStatsCritical
jr c, .thickclub
- ld hl, PlayerDefense
+ ld hl, wPlayerDefense
ld a, [hli]
ld b, a
ld c, [hl]
- ld hl, EnemyAttack
+ ld hl, wEnemyAttack
jr .thickclub
.Special:
- ld hl, BattleMonSpclDef
+ ld hl, wBattleMonSpclDef
ld a, [hli]
ld b, a
ld c, [hl]
- ld a, [PlayerScreens]
+ ld a, [wPlayerScreens]
bit SCREENS_LIGHT_SCREEN, a
jr z, .specialcrit
sla c
@@ -3106,14 +3106,14 @@
rl b
.specialcrit
- ld hl, EnemyMonSpclAtk
+ ld hl, wEnemyMonSpclAtk
call GetDamageStatsCritical
jr c, .lightball
- ld hl, PlayerSpDef
+ ld hl, wPlayerSpDef
ld a, [hli]
ld b, a
ld c, [hl]
- ld hl, EnemySpAtk
+ ld hl, wEnemySpAtk
.lightball
call LightBallBoost
@@ -3125,7 +3125,7 @@
.done
call TruncateHL_BC
- ld a, [EnemyMonLevel]
+ ld a, [wEnemyMonLevel]
ld e, a
call DittoMetalPowder
@@ -3143,27 +3143,27 @@
ld a, [hBattleTurn]
and a
jp nz, .enemy_beats_up
- ld a, [PlayerSubStatus3]
+ ld a, [wPlayerSubStatus3]
bit SUBSTATUS_IN_LOOP, a
jr nz, .next_mon
ld c, 20
call DelayFrames
xor a
- ld [PlayerRolloutCount], a
+ ld [wPlayerRolloutCount], a
ld [wd002], a
ld [wBeatUpHitAtLeastOnce], a
jr .got_mon
.next_mon
- ld a, [PlayerRolloutCount]
+ ld a, [wPlayerRolloutCount]
ld b, a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
sub b
ld [wd002], a
.got_mon
ld a, [wd002]
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
call GetNick
ld a, MON_HP
call GetBeatupMonLocation
@@ -3172,11 +3172,11 @@
jp z, .beatup_fail ; fainted
ld a, [wd002]
ld c, a
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
; BUG: this can desynchronize link battles
; Change "cp [hl]" to "cp c" to fix
cp [hl]
- ld hl, BattleMonStatus
+ ld hl, wBattleMonStatus
jr z, .active_mon
ld a, MON_STATUS
call GetBeatupMonLocation
@@ -3189,18 +3189,18 @@
ld [wBeatUpHitAtLeastOnce], a
ld hl, BeatUpAttackText
call StdBattleTextBox
- ld a, [EnemyMonSpecies]
- ld [CurSpecies], a
+ ld a, [wEnemyMonSpecies]
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [BaseDefense]
+ ld a, [wBaseDefense]
ld c, a
push bc
ld a, MON_SPECIES
call GetBeatupMonLocation
ld a, [hl]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [BaseAttack]
+ ld a, [wBaseAttack]
pop bc
ld b, a
push bc
@@ -3214,20 +3214,20 @@
ret
.enemy_beats_up
- ld a, [EnemySubStatus3]
+ ld a, [wEnemySubStatus3]
bit SUBSTATUS_IN_LOOP, a
jr nz, .not_first_enemy_beatup
xor a
- ld [EnemyRolloutCount], a
+ ld [wEnemyRolloutCount], a
ld [wd002], a
ld [wBeatUpHitAtLeastOnce], a
jr .enemy_continue
.not_first_enemy_beatup
- ld a, [EnemyRolloutCount]
+ ld a, [wEnemyRolloutCount]
ld b, a
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
sub b
ld [wd002], a
.enemy_continue
@@ -3239,7 +3239,7 @@
and a
jr nz, .link_or_tower
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
and a
jr nz, .link_or_tower
@@ -3246,7 +3246,7 @@
ld a, [wd002]
ld c, a
ld b, 0
- ld hl, OTPartySpecies
+ ld hl, wOTPartySpecies
add hl, bc
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
@@ -3255,10 +3255,10 @@
.link_or_tower
ld a, [wd002]
- ld hl, OTPartyMonNicknames
+ ld hl, wOTPartyMonNicknames
ld bc, NAME_LENGTH
call AddNTimes
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call CopyBytes
.got_enemy_nick
ld a, MON_HP
@@ -3268,9 +3268,9 @@
jp z, .beatup_fail
ld a, [wd002]
ld b, a
- ld a, [CurOTMon]
+ ld a, [wCurOTMon]
cp b
- ld hl, EnemyMonStatus
+ ld hl, wEnemyMonStatus
jr z, .active_enemy
ld a, MON_STATUS
@@ -3285,7 +3285,7 @@
jr .finish_beatup
.wild
- ld a, [EnemyMonSpecies]
+ ld a, [wEnemyMonSpecies]
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, BeatUpAttackText
@@ -3295,18 +3295,18 @@
.finish_beatup
ld hl, BeatUpAttackText
call StdBattleTextBox
- ld a, [BattleMonSpecies]
- ld [CurSpecies], a
+ ld a, [wBattleMonSpecies]
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [BaseDefense]
+ ld a, [wBaseDefense]
ld c, a
push bc
ld a, MON_SPECIES
call GetBeatupMonLocation
ld a, [hl]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [BaseAttack]
+ ld a, [wBaseAttack]
pop bc
ld b, a
push bc
@@ -3345,9 +3345,9 @@
ld b, 0
ld a, [hBattleTurn]
and a
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
jr z, .got_species
- ld hl, OTPartyMon1Species
+ ld hl, wOTPartyMon1Species
.got_species
ld a, [wd002]
@@ -3359,7 +3359,7 @@
BattleCommand_ClearMissDamage: ; 355d5
; clearmissdamage
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
ret z
@@ -3372,14 +3372,14 @@
call ResetDamage
ld a, [hBattleTurn]
and a
- ld hl, BattleMonDefense
- ld de, PlayerScreens
- ld a, [BattleMonLevel]
+ ld hl, wBattleMonDefense
+ ld de, wPlayerScreens
+ ld a, [wBattleMonLevel]
jr z, .got_it
- ld hl, EnemyMonDefense
- ld de, EnemyScreens
- ld a, [EnemyMonLevel]
+ ld hl, wEnemyMonDefense
+ ld de, wEnemyScreens
+ ld a, [wEnemyMonLevel]
.got_it
push af
ld a, [hli]
@@ -3536,8 +3536,8 @@
call .CriticalMultiplier
-; Update CurDamage (capped at 997).
- ld hl, CurDamage
+; Update wCurDamage (capped at 997).
+ ld hl, wCurDamage
ld b, [hl]
ld a, [hProduct + 3]
add b
@@ -3617,7 +3617,7 @@
.CriticalMultiplier:
- ld a, [CriticalHit]
+ ld a, [wCriticalHit]
and a
ret z
@@ -3648,11 +3648,11 @@
BattleCommand_ConstantDamage: ; 35726
; constantdamage
- ld hl, BattleMonLevel
+ ld hl, wBattleMonLevel
ld a, [hBattleTurn]
and a
jr z, .got_turn
- ld hl, EnemyMonLevel
+ ld hl, wEnemyMonLevel
.got_turn
ld a, BATTLE_VARS_MOVE_EFFECT
@@ -3695,11 +3695,11 @@
jr .got_power
.super_fang
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld a, [hBattleTurn]
and a
jr z, .got_hp
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
.got_hp
ld a, [hli]
srl a
@@ -3718,17 +3718,17 @@
jr .got_power
.got_power
- ld hl, CurDamage
+ ld hl, wCurDamage
ld [hli], a
ld [hl], b
ret
.reversal
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld a, [hBattleTurn]
and a
jr z, .reversal_got_hp
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
.reversal_got_hp
xor a
ld [hDividend], a
@@ -3818,7 +3818,7 @@
; counter
ld a, 1
- ld [AttackMissed], a
+ ld [wAttackMissed], a
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
and a
@@ -3841,18 +3841,18 @@
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
dec a
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call GetMoveData
- ld a, [StringBuffer1 + MOVE_POWER]
+ ld a, [wStringBuffer1 + MOVE_POWER]
and a
ret z
- ld a, [StringBuffer1 + MOVE_TYPE]
+ ld a, [wStringBuffer1 + MOVE_TYPE]
cp SPECIAL
ret nc
- ld hl, CurDamage
+ ld hl, wCurDamage
ld a, [hli]
or [hl]
ret z
@@ -3870,7 +3870,7 @@
.capped
xor a
- ld [AttackMissed], a
+ ld [wAttackMissed], a
ret
; 35864
@@ -3879,13 +3879,13 @@
BattleCommand_Encore: ; 35864
; encore
- ld hl, EnemyMonMoves
- ld de, EnemyEncoreCount
+ ld hl, wEnemyMonMoves
+ ld de, wEnemyEncoreCount
ld a, [hBattleTurn]
and a
jr z, .ok
- ld hl, BattleMonMoves
- ld de, PlayerEncoreCount
+ ld hl, wBattleMonMoves
+ ld de, wPlayerEncoreCount
.ok
ld a, BATTLE_VARS_LAST_MOVE_OPP
call GetBattleVar
@@ -3904,12 +3904,12 @@
cp b
jr nz, .got_move
- ld bc, BattleMonPP - BattleMonMoves - 1
+ ld bc, wBattleMonPP - wBattleMonMoves - 1
add hl, bc
ld a, [hl]
and PP_MASK
jp z, .failed
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jp nz, .failed
ld a, BATTLE_VARS_SUBSTATUS5_OPP
@@ -3930,10 +3930,10 @@
jr z, .force_last_enemy_move
push hl
- ld a, [LastPlayerMove]
+ ld a, [wLastPlayerMove]
ld b, a
ld c, 0
- ld hl, BattleMonMoves
+ ld hl, wBattleMonMoves
.find_player_move
ld a, [hli]
cp b
@@ -3951,9 +3951,9 @@
.got_player_move
pop hl
ld a, c
- ld [CurMoveNum], a
+ ld [wCurMoveNum], a
ld a, b
- ld [CurPlayerMove], a
+ ld [wCurPlayerMove], a
dec a
ld de, wPlayerMoveStruct
call GetMoveData
@@ -3961,10 +3961,10 @@
.force_last_enemy_move
push hl
- ld a, [LastEnemyMove]
+ ld a, [wLastEnemyMove]
ld b, a
ld c, 0
- ld hl, EnemyMonMoves
+ ld hl, wEnemyMonMoves
.find_enemy_move
ld a, [hli]
cp b
@@ -3982,9 +3982,9 @@
.got_enemy_move
pop hl
ld a, c
- ld [CurEnemyMoveNum], a
+ ld [wCurEnemyMoveNum], a
ld a, b
- ld [CurEnemyMove], a
+ ld [wCurEnemyMove], a
dec a
ld de, wEnemyMoveStruct
call GetMoveData
@@ -4003,28 +4003,28 @@
BattleCommand_PainSplit: ; 35926
; painsplit
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jp nz, .ButItFailed
call CheckSubstituteOpp
jp nz, .ButItFailed
call AnimateCurrentMove
- ld hl, BattleMonMaxHP + 1
- ld de, EnemyMonMaxHP + 1
+ ld hl, wBattleMonMaxHP + 1
+ ld de, wEnemyMonMaxHP + 1
call .PlayerShareHP
ld a, $1
ld [wWhichHPBar], a
hlcoord 10, 9
predef AnimateHPBar
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld a, [hli]
- ld [Buffer4], a
+ ld [wBuffer4], a
ld a, [hli]
- ld [Buffer3], a
+ ld [wBuffer3], a
ld a, [hli]
- ld [Buffer2], a
+ ld [wBuffer2], a
ld a, [hl]
- ld [Buffer1], a
+ ld [wBuffer1], a
call .EnemyShareHP
xor a
ld [wWhichHPBar], a
@@ -4038,28 +4038,28 @@
.PlayerShareHP:
ld a, [hld]
- ld [Buffer1], a
+ ld [wBuffer1], a
ld a, [hld]
- ld [Buffer2], a
+ ld [wBuffer2], a
ld a, [hld]
ld b, a
- ld [Buffer3], a
+ ld [wBuffer3], a
ld a, [hl]
- ld [Buffer4], a
+ ld [wBuffer4], a
dec de
dec de
ld a, [de]
dec de
add b
- ld [CurDamage + 1], a
+ ld [wCurDamage + 1], a
ld b, [hl]
ld a, [de]
adc b
srl a
- ld [CurDamage], a
- ld a, [CurDamage + 1]
+ ld [wCurDamage], a
+ ld a, [wCurDamage + 1]
rr a
- ld [CurDamage + 1], a
+ ld [wCurDamage + 1], a
inc hl
inc hl
inc hl
@@ -4070,25 +4070,25 @@
.EnemyShareHP: ; 359ac
ld c, [hl]
dec hl
- ld a, [CurDamage + 1]
+ ld a, [wCurDamage + 1]
sub c
ld b, [hl]
dec hl
- ld a, [CurDamage]
+ ld a, [wCurDamage]
sbc b
jr nc, .skip
- ld a, [CurDamage]
+ ld a, [wCurDamage]
ld b, a
- ld a, [CurDamage + 1]
+ ld a, [wCurDamage + 1]
ld c, a
.skip
ld a, c
ld [hld], a
- ld [Buffer5], a
+ ld [wBuffer5], a
ld a, b
ld [hli], a
- ld [Buffer6], a
+ ld [wBuffer6], a
ret
; 359cd
@@ -4107,7 +4107,7 @@
ret nz
call ResetDamage
ld a, $1
- ld [AttackMissed], a
+ ld [wAttackMissed], a
call FailSnore
jp EndMoveEffect
@@ -4117,14 +4117,14 @@
BattleCommand_Conversion2: ; 359e6
; conversion2
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .failed
- ld hl, BattleMonType1
+ ld hl, wBattleMonType1
ld a, [hBattleTurn]
and a
jr z, .got_type
- ld hl, EnemyMonType1
+ ld hl, wEnemyMonType1
.got_type
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
@@ -4188,7 +4188,7 @@
call CheckSubstituteOpp
jr nz, .fail
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .fail
@@ -4235,11 +4235,11 @@
ld d, h
ld e, l
; Get the battle move structs.
- ld hl, BattleMonMoves
+ ld hl, wBattleMonMoves
ld a, [hBattleTurn]
and a
jr z, .get_last_move
- ld hl, EnemyMonMoves
+ ld hl, wEnemyMonMoves
.get_last_move
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
@@ -4278,7 +4278,7 @@
ld hl, Moves + MOVE_PP
call GetMoveAttr
pop hl
- ld bc, BattleMonPP - BattleMonMoves
+ ld bc, wBattleMonPP - wBattleMonMoves
add hl, bc
ld [hl], a
pop bc
@@ -4361,17 +4361,17 @@
; sleeptalk
call ClearLastMove
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .fail
ld a, [hBattleTurn]
and a
- ld hl, BattleMonMoves + 1
- ld a, [DisabledMove]
+ ld hl, wBattleMonMoves + 1
+ ld a, [wDisabledMove]
ld d, a
jr z, .got_moves
- ld hl, EnemyMonMoves + 1
- ld a, [EnemyDisabledMove]
+ ld hl, wEnemyMonMoves + 1
+ ld a, [wEnemyDisabledMove]
ld d, a
.got_moves
ld a, BATTLE_VARS_STATUS
@@ -4438,10 +4438,10 @@
.check_has_usable_move
ld a, [hBattleTurn]
and a
- ld a, [DisabledMove]
+ ld a, [wDisabledMove]
jr z, .got_move_2
- ld a, [EnemyDisabledMove]
+ ld a, [wEnemyDisabledMove]
.got_move_2
ld b, a
ld a, BATTLE_VARS_MOVE
@@ -4520,15 +4520,15 @@
BattleCommand_Spite: ; 35c0f
; spite
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jp nz, .failed
ld bc, PARTYMON_STRUCT_LENGTH ; ????
- ld hl, EnemyMonMoves
+ ld hl, wEnemyMonMoves
ld a, [hBattleTurn]
and a
jr z, .got_moves
- ld hl, BattleMonMoves
+ ld hl, wBattleMonMoves
.got_moves
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
@@ -4547,7 +4547,7 @@
dec hl
ld b, 0
push bc
- ld c, BattleMonPP - BattleMonMoves
+ ld c, wBattleMonPP - wBattleMonMoves
add hl, bc
pop bc
ld a, [hl]
@@ -4610,13 +4610,13 @@
BattleCommand_FalseSwipe: ; 35c94
; falseswipe
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld a, [hBattleTurn]
and a
jr z, .got_hp
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
.got_hp
- ld de, CurDamage
+ ld de, wCurDamage
ld c, 2
push hl
push de
@@ -4637,11 +4637,11 @@
dec a
ld [de], a
.okay
- ld a, [CriticalHit]
+ ld a, [wCriticalHit]
cp 2
jr nz, .carry
xor a
- ld [CriticalHit], a
+ ld [wCriticalHit], a
.carry
scf
ret
@@ -4659,11 +4659,11 @@
ld a, BATTLE_VARS_SUBSTATUS1
call GetBattleVarAddr
res SUBSTATUS_NIGHTMARE, [hl]
- ld de, PartyMon1Status
+ ld de, wPartyMon1Status
ld a, [hBattleTurn]
and a
jr z, .got_status
- ld de, OTPartyMon1Status
+ ld de, wOTPartyMon1Status
.got_status
ld a, BATTLE_VARS_STATUS
call GetBattleVarAddr
@@ -4704,9 +4704,9 @@
PlayFXAnimID: ; 35d08
ld a, e
- ld [FXAnimID], a
+ ld [wFXAnimID], a
ld a, d
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
ld c, 3
call DelayFrames
@@ -4719,7 +4719,7 @@
EnemyHurtItself: ; 35d1c
- ld hl, CurDamage
+ ld hl, wCurDamage
ld a, [hli]
ld b, a
ld a, [hl]
@@ -4730,7 +4730,7 @@
and a
jr nz, .mimic_sub_check
- ld a, [EnemySubStatus4]
+ ld a, [wEnemySubStatus4]
bit SUBSTATUS_SUBSTITUTE, a
jp nz, SelfInflictDamageToSubstitute
@@ -4737,39 +4737,39 @@
.mimic_sub_check
ld a, [hld]
ld b, a
- ld a, [EnemyMonHP + 1]
- ld [Buffer3], a
+ ld a, [wEnemyMonHP + 1]
+ ld [wBuffer3], a
sub b
- ld [EnemyMonHP + 1], a
+ ld [wEnemyMonHP + 1], a
ld a, [hl]
ld b, a
- ld a, [EnemyMonHP]
- ld [Buffer4], a
+ ld a, [wEnemyMonHP]
+ ld [wBuffer4], a
sbc b
- ld [EnemyMonHP], a
+ ld [wEnemyMonHP], a
jr nc, .mimic_faint
- ld a, [Buffer4]
+ ld a, [wBuffer4]
ld [hli], a
- ld a, [Buffer3]
+ ld a, [wBuffer3]
ld [hl], a
xor a
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld [hli], a
ld [hl], a
.mimic_faint
- ld hl, EnemyMonMaxHP
+ ld hl, wEnemyMonMaxHP
ld a, [hli]
- ld [Buffer2], a
+ ld [wBuffer2], a
ld a, [hl]
- ld [Buffer1], a
- ld hl, EnemyMonHP
+ ld [wBuffer1], a
+ ld hl, wEnemyMonHP
ld a, [hli]
- ld [Buffer6], a
+ ld [wBuffer6], a
ld a, [hl]
- ld [Buffer5], a
+ ld [wBuffer5], a
hlcoord 2, 2
xor a
ld [wWhichHPBar], a
@@ -4781,7 +4781,7 @@
PlayerHurtItself: ; 35d7e
- ld hl, CurDamage
+ ld hl, wCurDamage
ld a, [hli]
ld b, a
ld a, [hl]
@@ -4792,44 +4792,44 @@
and a
jr nz, .mimic_sub_check
- ld a, [PlayerSubStatus4]
+ ld a, [wPlayerSubStatus4]
bit SUBSTATUS_SUBSTITUTE, a
jp nz, SelfInflictDamageToSubstitute
.mimic_sub_check
ld a, [hld]
ld b, a
- ld a, [BattleMonHP + 1]
- ld [Buffer3], a
+ ld a, [wBattleMonHP + 1]
+ ld [wBuffer3], a
sub b
- ld [BattleMonHP + 1], a
- ld [Buffer5], a
+ ld [wBattleMonHP + 1], a
+ ld [wBuffer5], a
ld b, [hl]
- ld a, [BattleMonHP]
- ld [Buffer4], a
+ ld a, [wBattleMonHP]
+ ld [wBuffer4], a
sbc b
- ld [BattleMonHP], a
- ld [Buffer6], a
+ ld [wBattleMonHP], a
+ ld [wBuffer6], a
jr nc, .mimic_faint
- ld a, [Buffer4]
+ ld a, [wBuffer4]
ld [hli], a
- ld a, [Buffer3]
+ ld a, [wBuffer3]
ld [hl], a
xor a
- ld hl, BattleMonHP
+ ld hl, wBattleMonHP
ld [hli], a
ld [hl], a
- ld hl, Buffer5
+ ld hl, wBuffer5
ld [hli], a
ld [hl], a
.mimic_faint
- ld hl, BattleMonMaxHP
+ ld hl, wBattleMonMaxHP
ld a, [hli]
- ld [Buffer2], a
+ ld [wBuffer2], a
ld a, [hl]
- ld [Buffer1], a
+ ld [wBuffer1], a
hlcoord 10, 9
ld a, $1
ld [wWhichHPBar], a
@@ -4845,14 +4845,14 @@
ld hl, SubTookDamageText
call StdBattleTextBox
- ld de, EnemySubstituteHP
+ ld de, wEnemySubstituteHP
ld a, [hBattleTurn]
and a
jr z, .got_hp
- ld de, PlayerSubstituteHP
+ ld de, wPlayerSubstituteHP
.got_hp
- ld hl, CurDamage
+ ld hl, wCurDamage
ld a, [hli]
and a
jr nz, .broke
@@ -4910,7 +4910,7 @@
ld a, BATTLE_VARS_MOVE
call GetBattleVar
- ld [CurMove], a
+ ld [wCurMove], a
ld [wNamedObjectIndexBuffer], a
dec a
@@ -4945,7 +4945,7 @@
ld hl, AlreadyAsleepText
jr nz, .fail
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jp nz, PrintDidntAffect2
@@ -4962,7 +4962,7 @@
call AnimateCurrentMove
ld b, $7
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
and a
jr z, .random_loop
ld b, $3
@@ -5006,12 +5006,12 @@
and a
jr nz, .dont_fail
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
and a
jr nz, .dont_fail
; Not locked-on by the enemy
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_LOCK_ON, a
jr nz, .dont_fail
@@ -5035,7 +5035,7 @@
call GetBattleVarAddr
and a
ret nz
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and $7f
ret z
call CheckIfTargetIsPoisonType
@@ -5044,7 +5044,7 @@
ld a, b
cp HELD_PREVENT_POISON
ret z
- ld a, [EffectFailed]
+ ld a, [wEffectFailed]
and a
ret nz
call SafeCheckSafeguard
@@ -5068,7 +5068,7 @@
; poison
ld hl, DoesntAffectText
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and $7f
jp z, .failed
@@ -5107,11 +5107,11 @@
and a
jr nz, .mimic_random
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
and a
jr nz, .mimic_random
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_LOCK_ON, a
jr nz, .mimic_random
@@ -5122,7 +5122,7 @@
.mimic_random
call CheckSubstituteOpp
jr nz, .failed
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .failed
call .check_toxic
@@ -5168,9 +5168,9 @@
call GetBattleVarAddr
ld a, [hBattleTurn]
and a
- ld de, EnemyToxicCount
+ ld de, wEnemyToxicCount
jr z, .ok
- ld de, PlayerToxicCount
+ ld de, wPlayerToxicCount
.ok
ld a, BATTLE_VARS_MOVE_EFFECT
call GetBattleVar
@@ -5181,11 +5181,11 @@
CheckIfTargetIsPoisonType: ; 35fe1
- ld de, EnemyMonType1
+ ld de, wEnemyMonType1
ld a, [hBattleTurn]
and a
jr z, .ok
- ld de, BattleMonType1
+ ld de, wBattleMonType1
.ok
ld a, [de]
inc de
@@ -5226,7 +5226,7 @@
SapHealth: ; 36011
- ld hl, CurDamage
+ ld hl, wCurDamage
ld a, [hli]
srl a
ld [hDividend], a
@@ -5239,15 +5239,15 @@
ld a, $1
ld [hDividend + 1], a
.ok1
- ld hl, BattleMonHP
- ld de, BattleMonMaxHP
+ ld hl, wBattleMonHP
+ ld de, wBattleMonMaxHP
ld a, [hBattleTurn]
and a
jr z, .battlemonhp
- ld hl, EnemyMonHP
- ld de, EnemyMonMaxHP
+ ld hl, wEnemyMonHP
+ ld de, wEnemyMonMaxHP
.battlemonhp
- ld bc, Buffer4
+ ld bc, wBuffer4
ld a, [hli]
ld [bc], a
ld a, [hl]
@@ -5264,12 +5264,12 @@
ld b, [hl]
add b
ld [hld], a
- ld [Buffer5], a
+ ld [wBuffer5], a
ld a, [hDividend]
ld b, [hl]
adc b
ld [hli], a
- ld [Buffer6], a
+ ld [wBuffer6], a
jr c, .okay2
ld a, [hld]
ld b, a
@@ -5285,11 +5285,11 @@
.okay2
ld a, [de]
ld [hld], a
- ld [Buffer5], a
+ ld [wBuffer5], a
dec de
ld a, [de]
ld [hli], a
- ld [Buffer6], a
+ ld [wBuffer6], a
inc de
.okay3
ld a, [hBattleTurn]
@@ -5319,7 +5319,7 @@
call GetBattleVarAddr
and a
jp nz, Defrost
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and $7f
ret z
call CheckMoveTypeMatchesTarget ; Don't burn a Fire-type
@@ -5328,7 +5328,7 @@
ld a, b
cp HELD_PREVENT_BURN
ret z
- ld a, [EffectFailed]
+ ld a, [wEffectFailed]
and a
ret nz
call SafeCheckSafeguard
@@ -5362,11 +5362,11 @@
ld a, [hBattleTurn]
and a
- ld a, [CurOTMon]
- ld hl, OTPartyMon1Status
+ ld a, [wCurOTMon]
+ ld hl, wOTPartyMon1Status
jr z, .ok
- ld hl, PartyMon1Status
- ld a, [CurBattleMon]
+ ld hl, wPartyMon1Status
+ ld a, [wCurBattleMon]
.ok
call GetPartyLocation
@@ -5391,10 +5391,10 @@
call GetBattleVarAddr
and a
ret nz
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and $7f
ret z
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_SUN
ret z
call CheckMoveTypeMatchesTarget ; Don't freeze an Ice-type
@@ -5403,7 +5403,7 @@
ld a, b
cp HELD_PREVENT_FREEZE
ret z
- ld a, [EffectFailed]
+ ld a, [wEffectFailed]
and a
ret nz
call SafeCheckSafeguard
@@ -5447,7 +5447,7 @@
call GetBattleVarAddr
and a
ret nz
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and $7f
ret z
call GetOpponentItem
@@ -5454,7 +5454,7 @@
ld a, b
cp HELD_PREVENT_PARALYZE
ret z
- ld a, [EffectFailed]
+ ld a, [wEffectFailed]
and a
ret nz
call SafeCheckSafeguard
@@ -5548,7 +5548,7 @@
BattleCommand_StatUp: ; 361e4
; statup
call CheckIfStatCanBeRaised
- ld a, [FailedMessage]
+ ld a, [wFailedMessage]
and a
ret nz
jp StatUpAnimation
@@ -5558,20 +5558,20 @@
CheckIfStatCanBeRaised: ; 361ef
ld a, b
- ld [LoweredStat], a
- ld hl, PlayerStatLevels
+ ld [wLoweredStat], a
+ ld hl, wPlayerStatLevels
ld a, [hBattleTurn]
and a
jr z, .got_stat_levels
- ld hl, EnemyStatLevels
+ ld hl, wEnemyStatLevels
.got_stat_levels
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jp nz, .stat_raise_failed
- ld a, [EffectFailed]
+ ld a, [wEffectFailed]
and a
jp nz, .stat_raise_failed
- ld a, [LoweredStat]
+ ld a, [wLoweredStat]
and $f
ld c, a
ld b, 0
@@ -5581,7 +5581,7 @@
ld a, $d
cp b
jp c, .cant_raise_stat
- ld a, [LoweredStat]
+ ld a, [wLoweredStat]
and $f0
jr z, .got_num_stages
inc b
@@ -5595,13 +5595,13 @@
ld a, c
cp $5
jr nc, .done_calcing_stats
- ld hl, BattleMonStats + 1
- ld de, PlayerStats
+ ld hl, wBattleMonStats + 1
+ ld de, wPlayerStats
ld a, [hBattleTurn]
and a
jr z, .got_stats_pointer
- ld hl, EnemyMonStats + 1
- ld de, EnemyStats
+ ld hl, wEnemyMonStats + 1
+ ld de, wEnemyStats
.got_stats_pointer
push bc
sla c
@@ -5632,7 +5632,7 @@
.done_calcing_stats
pop hl
xor a
- ld [FailedMessage], a
+ ld [wFailedMessage], a
ret
; 3626e
@@ -5647,9 +5647,9 @@
.cant_raise_stat ; 36270
ld a, $2
- ld [FailedMessage], a
+ ld [wFailedMessage], a
ld a, $1
- ld [AttackMissed], a
+ ld [wAttackMissed], a
ret
; 3627b
@@ -5657,7 +5657,7 @@
.stat_raise_failed ; 3627b
ld a, $1
- ld [FailedMessage], a
+ ld [wFailedMessage], a
ret
; 36281
@@ -5763,20 +5763,20 @@
BattleCommand_StatDown: ; 362e3
; statdown
- ld [LoweredStat], a
+ ld [wLoweredStat], a
call CheckMist
jp nz, .Mist
- ld hl, EnemyStatLevels
+ ld hl, wEnemyStatLevels
ld a, [hBattleTurn]
and a
jr z, .GetStatLevel
- ld hl, PlayerStatLevels
+ ld hl, wPlayerStatLevels
.GetStatLevel:
; Attempt to lower the stat.
- ld a, [LoweredStat]
+ ld a, [wLoweredStat]
and $f
ld c, a
ld b, 0
@@ -5786,7 +5786,7 @@
jp z, .CantLower
; Sharply lower the stat if applicable.
- ld a, [LoweredStat]
+ ld a, [wLoweredStat]
and $f0
jr z, .ComputerMiss
dec b
@@ -5803,12 +5803,12 @@
and a
jr nz, .DidntMiss
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
and a
jr nz, .DidntMiss
; Lock-On still always works.
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_LOCK_ON, a
jr nz, .DidntMiss
@@ -5826,11 +5826,11 @@
call CheckSubstituteOpp
jr nz, .Failed
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .Failed
- ld a, [EffectFailed]
+ ld a, [wEffectFailed]
and a
jr nz, .Failed
@@ -5844,13 +5844,13 @@
jr nc, .Hit
push hl
- ld hl, EnemyMonAttack + 1
- ld de, EnemyStats
+ ld hl, wEnemyMonAttack + 1
+ ld de, wEnemyStats
ld a, [hBattleTurn]
and a
jr z, .do_enemy
- ld hl, BattleMonAttack + 1
- ld de, PlayerStats
+ ld hl, wBattleMonAttack + 1
+ ld de, wPlayerStats
.do_enemy
call TryLowerStat
pop hl
@@ -5858,7 +5858,7 @@
.Hit:
xor a
- ld [FailedMessage], a
+ ld [wFailedMessage], a
ret
.CouldntLower:
@@ -5865,22 +5865,22 @@
inc [hl]
.CantLower:
ld a, 3
- ld [FailedMessage], a
+ ld [wFailedMessage], a
ld a, 1
- ld [AttackMissed], a
+ ld [wAttackMissed], a
ret
.Failed:
ld a, 1
- ld [FailedMessage], a
- ld [AttackMissed], a
+ ld [wFailedMessage], a
+ ld [wAttackMissed], a
ret
.Mist:
ld a, 2
- ld [FailedMessage], a
+ ld [wFailedMessage], a
ld a, 1
- ld [AttackMissed], a
+ ld [wAttackMissed], a
ret
; 36391
@@ -5915,10 +5915,10 @@
BattleCommand_StatUpMessage: ; 363b8
- ld a, [FailedMessage]
+ ld a, [wFailedMessage]
and a
ret nz
- ld a, [LoweredStat]
+ ld a, [wLoweredStat]
and $f
ld b, a
inc b
@@ -5930,7 +5930,7 @@
text_jump UnknownText_0x1c0cc6
start_asm
ld hl, .up
- ld a, [LoweredStat]
+ ld a, [wLoweredStat]
and $f0
ret z
ld hl, .wayup
@@ -5948,10 +5948,10 @@
BattleCommand_StatDownMessage: ; 363e9
- ld a, [FailedMessage]
+ ld a, [wFailedMessage]
and a
ret nz
- ld a, [LoweredStat]
+ ld a, [wLoweredStat]
and $f
ld b, a
inc b
@@ -5963,7 +5963,7 @@
text_jump UnknownText_0x1c0ceb
start_asm
ld hl, .fell
- ld a, [LoweredStat]
+ ld a, [wLoweredStat]
and $f0
ret z
ld hl, .sharplyfell
@@ -6027,7 +6027,7 @@
BattleCommand_StatUpFailText: ; 3644c
; statupfailtext
- ld a, [FailedMessage]
+ ld a, [wFailedMessage]
and a
ret z
push af
@@ -6035,7 +6035,7 @@
pop af
dec a
jp z, TryPrintButItFailed
- ld a, [LoweredStat]
+ ld a, [wLoweredStat]
and $f
ld b, a
inc b
@@ -6048,7 +6048,7 @@
BattleCommand_StatDownFailText: ; 3646a
; statdownfailtext
- ld a, [FailedMessage]
+ ld a, [wFailedMessage]
and a
ret z
push af
@@ -6059,7 +6059,7 @@
dec a
ld hl, ProtectedByMistText
jp z, StdBattleTextBox
- ld a, [LoweredStat]
+ ld a, [wLoweredStat]
and $f
ld b, a
inc b
@@ -6083,8 +6083,8 @@
jr .GetName
.Copy:
- ld de, StringBuffer2
- ld bc, StringBuffer3 - StringBuffer2
+ ld de, wStringBuffer2
+ ld bc, wStringBuffer3 - wStringBuffer2
jp CopyBytes
INCLUDE "data/battle/stat_names.asm"
@@ -6125,7 +6125,7 @@
ResetMiss: ; 3652d
xor a
- ld [AttackMissed], a
+ ld [wAttackMissed], a
ret
; 36532
@@ -6132,16 +6132,16 @@
LowerStat: ; 36532
- ld [LoweredStat], a
+ ld [wLoweredStat], a
- ld hl, PlayerStatLevels
+ ld hl, wPlayerStatLevels
ld a, [hBattleTurn]
and a
jr z, .got_target
- ld hl, EnemyStatLevels
+ ld hl, wEnemyStatLevels
.got_target
- ld a, [LoweredStat]
+ ld a, [wLoweredStat]
and $f
ld c, a
ld b, 0
@@ -6150,7 +6150,7 @@
dec b
jr z, .cant_lower_anymore
- ld a, [LoweredStat]
+ ld a, [wLoweredStat]
and $f0
jr z, .got_num_stages
dec b
@@ -6164,13 +6164,13 @@
jr nc, .accuracy_evasion
push hl
- ld hl, BattleMonStats + 1
- ld de, PlayerStats
+ ld hl, wBattleMonStats + 1
+ ld de, wPlayerStats
ld a, [hBattleTurn]
and a
jr z, .got_target_2
- ld hl, EnemyMonStats + 1
- ld de, EnemyStats
+ ld hl, wEnemyMonStats + 1
+ ld de, wEnemyStats
.got_target_2
call TryLowerStat
@@ -6191,7 +6191,7 @@
.finish
xor a
- ld [FailedMessage], a
+ ld [wFailedMessage], a
ret
.failed
@@ -6199,7 +6199,7 @@
.cant_lower_anymore
ld a, 2
- ld [FailedMessage], a
+ ld [wFailedMessage], a
ret
; 3658f
@@ -6269,9 +6269,9 @@
CalcPlayerStats: ; 365d7
- ld hl, PlayerAtkLevel
- ld de, PlayerStats
- ld bc, BattleMonAttack
+ ld hl, wPlayerAtkLevel
+ ld de, wPlayerStats
+ ld bc, wBattleMonAttack
ld a, 5
call CalcStats
@@ -6293,9 +6293,9 @@
CalcEnemyStats: ; 365fd
- ld hl, EnemyAtkLevel
- ld de, EnemyStats
- ld bc, EnemyMonAttack
+ ld hl, wEnemyAtkLevel
+ ld de, wEnemyStats
+ ld bc, wEnemyMonAttack
ld a, 5
call CalcStats
@@ -6393,11 +6393,11 @@
bit SUBSTATUS_BIDE, a
ret z
- ld hl, PlayerRolloutCount
+ ld hl, wPlayerRolloutCount
ld a, [hBattleTurn]
and a
jr z, .check_still_storing_energy
- ld hl, EnemyRolloutCount
+ ld hl, wEnemyRolloutCount
.check_still_storing_energy
dec [hl]
jr nz, .still_storing
@@ -6413,30 +6413,30 @@
call GetBattleVarAddr
ld a, 1
ld [hl], a
- ld hl, PlayerDamageTaken + 1
+ ld hl, wPlayerDamageTaken + 1
ld de, wPlayerCharging ; player
ld a, [hBattleTurn]
and a
jr z, .player
- ld hl, EnemyDamageTaken + 1
+ ld hl, wEnemyDamageTaken + 1
ld de, wEnemyCharging ; enemy
.player
ld a, [hld]
add a
ld b, a
- ld [CurDamage + 1], a
+ ld [wCurDamage + 1], a
ld a, [hl]
rl a
- ld [CurDamage], a
+ ld [wCurDamage], a
jr nc, .not_maxed
ld a, $ff
- ld [CurDamage], a
- ld [CurDamage + 1], a
+ ld [wCurDamage], a
+ ld [wCurDamage + 1], a
.not_maxed
or b
jr nz, .built_up_something
ld a, 1
- ld [AttackMissed], a
+ ld [wAttackMissed], a
.built_up_something
xor a
ld [hli], a
@@ -6462,13 +6462,13 @@
BattleCommand_UnleashEnergy: ; 366e5
; unleashenergy
- ld de, PlayerDamageTaken
- ld bc, PlayerRolloutCount
+ ld de, wPlayerDamageTaken
+ ld bc, wPlayerRolloutCount
ld a, [hBattleTurn]
and a
jr z, .got_damage
- ld de, EnemyDamageTaken
- ld bc, EnemyRolloutCount
+ ld de, wEnemyDamageTaken
+ ld bc, wEnemyRolloutCount
.got_damage
ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVarAddr
@@ -6495,11 +6495,11 @@
BattleCommand_CheckRampage: ; 3671a
; checkrampage
- ld de, PlayerRolloutCount
+ ld de, wPlayerRolloutCount
ld a, [hBattleTurn]
and a
jr z, .player
- ld de, EnemyRolloutCount
+ ld de, wEnemyRolloutCount
.player
ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVarAddr
@@ -6541,11 +6541,11 @@
and SLP
ret nz
- ld de, PlayerRolloutCount
+ ld de, wPlayerRolloutCount
ld a, [hBattleTurn]
and a
jr z, .ok
- ld de, EnemyRolloutCount
+ ld de, wEnemyRolloutCount
.ok
ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVarAddr
@@ -6565,7 +6565,7 @@
BattleCommand_Teleport: ; 36778
; teleport
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_SHINY
jr z, .failed
cp BATTLETYPE_TRAP
@@ -6588,9 +6588,9 @@
dec a
jr nz, .failed
; If your level is greater than the opponent's, you run without fail.
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld b, a
- ld a, [BattleMonLevel]
+ ld a, [wBattleMonLevel]
cp b
jr nc, .run_away
; Generate a number between 0 and (YourLevel + TheirLevel).
@@ -6615,9 +6615,9 @@
ld a, [wBattleMode]
dec a
jr nz, .failed
- ld a, [BattleMonLevel]
+ ld a, [wBattleMonLevel]
ld b, a
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
cp b
jr nc, .run_away
add b
@@ -6668,7 +6668,7 @@
BattleCommand_ForceSwitch: ; 3680f
; forceswitch
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_SHINY
jp z, .fail
cp BATTLETYPE_TRAP
@@ -6680,15 +6680,15 @@
ld a, [hBattleTurn]
and a
jp nz, .force_player_switch
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .missed
ld a, [wBattleMode]
dec a
jr nz, .trainer
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld b, a
- ld a, [BattleMonLevel]
+ ld a, [wBattleMonLevel]
cp b
jr nc, .wild_force_flee
add b
@@ -6732,9 +6732,9 @@
call ClearBox
ld c, 20
call DelayFrames
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
ld b, a
- ld a, [CurOTMon]
+ ld a, [wCurOTMon]
ld c, a
; select a random enemy mon to switch to
.random_loop_trainer
@@ -6746,7 +6746,7 @@
jr z, .random_loop_trainer
push af
push bc
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
call GetPartyLocation
ld a, [hli]
or [hl]
@@ -6768,7 +6768,7 @@
jp .fail
.force_player_switch
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .player_miss
@@ -6776,9 +6776,9 @@
dec a
jr nz, .vs_trainer
- ld a, [BattleMonLevel]
+ ld a, [wBattleMonLevel]
ld b, a
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
cp b
jr nc, .wild_succeed_playeristarget
@@ -6827,9 +6827,9 @@
call ClearBox
ld c, 20
call DelayFrames
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld b, a
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
ld c, a
.random_loop_trainer_playeristarget
call BattleRandom
@@ -6842,7 +6842,7 @@
push af
push bc
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
call GetPartyLocation
ld a, [hli]
or [hl]
@@ -6851,7 +6851,7 @@
jr z, .random_loop_trainer_playeristarget
ld a, d
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld hl, SwitchPlayerMon
call CallBattleCore
@@ -6888,17 +6888,17 @@
CheckPlayerHasMonToSwitchTo: ; 36994
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld d, a
ld e, 0
ld bc, PARTYMON_STRUCT_LENGTH
.loop
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
cp e
jr z, .next
ld a, e
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
call AddNTimes
ld a, [hli]
or [hl]
@@ -6924,13 +6924,13 @@
; Loop back to the command before 'critical'.
- ld de, PlayerRolloutCount
- ld bc, PlayerDamageTaken
+ ld de, wPlayerRolloutCount
+ ld bc, wPlayerDamageTaken
ld a, [hBattleTurn]
and a
jr z, .got_addrs
- ld de, EnemyRolloutCount
- ld bc, EnemyDamageTaken
+ ld de, wEnemyRolloutCount
+ ld bc, wEnemyDamageTaken
.got_addrs
ld a, BATTLE_VARS_SUBSTATUS3
@@ -6965,7 +6965,7 @@
ld a, [hBattleTurn]
and a
jr nz, .check_ot_beat_up
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp 1
jp z, .only_one_beatup
dec a
@@ -6975,7 +6975,7 @@
ld a, [wBattleMode]
cp WILD_BATTLE
jp z, .only_one_beatup
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
cp 1
jp z, .only_one_beatup
dec a
@@ -7039,9 +7039,9 @@
; Loop back to the command before 'critical'.
.loop_back_to_critical
- ld a, [BattleScriptBufferAddress + 1]
+ ld a, [wBattleScriptBufferAddress + 1]
ld h, a
- ld a, [BattleScriptBufferAddress]
+ ld a, [wBattleScriptBufferAddress]
ld l, a
.not_critical
ld a, [hld]
@@ -7049,9 +7049,9 @@
jr nz, .not_critical
inc hl
ld a, h
- ld [BattleScriptBufferAddress + 1], a
+ ld [wBattleScriptBufferAddress + 1], a
ld a, l
- ld [BattleScriptBufferAddress], a
+ ld [wBattleScriptBufferAddress], a
ret
; 36a82
@@ -7058,7 +7058,7 @@
BattleCommand_FakeOut: ; 36a82
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
ret nz
@@ -7075,7 +7075,7 @@
.fail
ld a, 1
- ld [AttackMissed], a
+ ld [wAttackMissed], a
ret
; 36aa0
@@ -7093,7 +7093,7 @@
call CheckOpponentWentFirst
ret nz
- ld a, [EffectFailed]
+ ld a, [wEffectFailed]
and a
ret nz
@@ -7127,7 +7127,7 @@
BattleCommand_HeldFlinch: ; 36ac9
; kingsrock
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
ret nz
@@ -7159,11 +7159,11 @@
; ohko
call ResetDamage
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and $7f
jr z, .no_effect
- ld hl, EnemyMonLevel
- ld de, BattleMonLevel
+ ld hl, wEnemyMonLevel
+ ld de, wBattleMonLevel
ld bc, wPlayerMoveStruct + MOVE_ACC
ld a, [hBattleTurn]
and a
@@ -7186,19 +7186,19 @@
.finish_ohko
ld [bc], a
call BattleCommand_CheckHit
- ld hl, CurDamage
+ ld hl, wCurDamage
ld a, $ff
ld [hli], a
ld [hl], a
ld a, $2
- ld [CriticalHit], a
+ ld [wCriticalHit], a
ret
.no_effect
ld a, $ff
- ld [CriticalHit], a
+ ld [wCriticalHit], a
ld a, $1
- ld [AttackMissed], a
+ ld [wAttackMissed], a
ret
; 36b3a
@@ -7240,7 +7240,7 @@
set SUBSTATUS_CHARGED, [hl]
ld hl, IgnoredOrders2Text
- ld a, [AlreadyDisobeyed]
+ ld a, [wAlreadyDisobeyed]
and a
call nz, StdBattleTextBox
@@ -7373,7 +7373,7 @@
BattleCommand_TrapTarget: ; 36c2d
; traptarget
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
ret nz
ld hl, wEnemyWrapCount
@@ -7469,19 +7469,19 @@
BattleCommand_Recoil: ; 36cb2
; recoil
- ld hl, BattleMonMaxHP
+ ld hl, wBattleMonMaxHP
ld a, [hBattleTurn]
and a
jr z, .got_hp
- ld hl, EnemyMonMaxHP
+ ld hl, wEnemyMonMaxHP
.got_hp
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
ld d, a
; get 1/4 damage or 1 HP, whichever is higher
- ld a, [CurDamage]
+ ld a, [wCurDamage]
ld b, a
- ld a, [CurDamage + 1]
+ ld a, [wCurDamage + 1]
ld c, a
srl b
rr c
@@ -7493,26 +7493,26 @@
inc c
.min_damage
ld a, [hli]
- ld [Buffer2], a
+ ld [wBuffer2], a
ld a, [hl]
- ld [Buffer1], a
+ ld [wBuffer1], a
dec hl
dec hl
ld a, [hl]
- ld [Buffer3], a
+ ld [wBuffer3], a
sub c
ld [hld], a
- ld [Buffer5], a
+ ld [wBuffer5], a
ld a, [hl]
- ld [Buffer4], a
+ ld [wBuffer4], a
sbc b
ld [hl], a
- ld [Buffer6], a
+ ld [wBuffer6], a
jr nc, .dont_ko
xor a
ld [hli], a
ld [hl], a
- ld hl, Buffer5
+ ld hl, wBuffer5
ld [hli], a
ld [hl], a
.dont_ko
@@ -7540,7 +7540,7 @@
ld a, b
cp HELD_PREVENT_CONFUSE
ret z
- ld a, [EffectFailed]
+ ld a, [wEffectFailed]
and a
ret nz
call SafeCheckSafeguard
@@ -7580,15 +7580,15 @@
.not_already_confused
call CheckSubstituteOpp
jr nz, BattleCommand_Confuse_CheckSnore_Swagger_ConfuseHit
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, BattleCommand_Confuse_CheckSnore_Swagger_ConfuseHit
BattleCommand_FinishConfusingTarget: ; 36d70
- ld bc, EnemyConfuseCount
+ ld bc, wEnemyConfuseCount
ld a, [hBattleTurn]
and a
jr z, .got_confuse_count
- ld bc, PlayerConfuseCount
+ ld bc, wPlayerConfuseCount
.got_confuse_count
set SUBSTATUS_CONFUSED, [hl]
@@ -7649,7 +7649,7 @@
call GetBattleVar
bit PAR, a
jr nz, .paralyzed
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and $7f
jr z, .didnt_affect
call GetOpponentItem
@@ -7672,11 +7672,11 @@
and a
jr nz, .dont_sample_failure
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
and a
jr nz, .dont_sample_failure
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_LOCK_ON, a
jr nz, .dont_sample_failure
@@ -7689,7 +7689,7 @@
call GetBattleVarAddr
and a
jr nz, .failed
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .failed
call CheckSubstituteOpp
@@ -7732,11 +7732,11 @@
push hl
- ld hl, EnemyMonType1
+ ld hl, wEnemyMonType1
ld a, [hBattleTurn]
and a
jr z, .ok
- ld hl, BattleMonType1
+ ld hl, wBattleMonType1
.ok
ld a, BATTLE_VARS_MOVE_TYPE
@@ -7767,13 +7767,13 @@
; substitute
call BattleCommand_MoveDelay
- ld hl, BattleMonMaxHP
- ld de, PlayerSubstituteHP
+ ld hl, wBattleMonMaxHP
+ ld de, wPlayerSubstituteHP
ld a, [hBattleTurn]
and a
jr z, .got_hp
- ld hl, EnemyMonMaxHP
- ld de, EnemySubstituteHP
+ ld hl, wEnemyMonMaxHP
+ ld de, wEnemySubstituteHP
.got_hp
ld a, BATTLE_VARS_SUBSTATUS4
@@ -7826,7 +7826,7 @@
xor a
ld [wNumHits], a
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
ld [wKickCounter], a
ld a, SUBSTITUTE
call LoadAnim
@@ -7908,7 +7908,7 @@
DoubleDamage: ; 36f37
- ld hl, CurDamage + 1
+ ld hl, wCurDamage + 1
sla [hl]
dec hl
rl [hl]
@@ -7928,14 +7928,14 @@
call ClearLastMove
call BattleCommand_MoveDelay
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .fail
- ld hl, BattleMonMoves
+ ld hl, wBattleMonMoves
ld a, [hBattleTurn]
and a
jr z, .player_turn
- ld hl, EnemyMonMoves
+ ld hl, wEnemyMonMoves
.player_turn
call CheckHiddenOpponent
jr nz, .fail
@@ -7963,7 +7963,7 @@
call GetBattleVar
ld [hl], a
ld [wNamedObjectIndexBuffer], a
- ld bc, BattleMonPP - BattleMonMoves
+ ld bc, wBattleMonPP - wBattleMonMoves
add hl, bc
ld [hl], 5
call GetMoveName
@@ -7979,17 +7979,17 @@
BattleCommand_LeechSeed: ; 36f9d
; leechseed
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .evaded
call CheckSubstituteOpp
jr nz, .evaded
- ld de, EnemyMonType1
+ ld de, wEnemyMonType1
ld a, [hBattleTurn]
and a
jr z, .ok
- ld de, BattleMonType1
+ ld de, wBattleMonType1
.ok
ld a, [de]
@@ -8032,17 +8032,17 @@
BattleCommand_Disable: ; 36fed
; disable
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .failed
- ld de, EnemyDisableCount
- ld hl, EnemyMonMoves
+ ld de, wEnemyDisableCount
+ ld hl, wEnemyMonMoves
ld a, [hBattleTurn]
and a
jr z, .got_moves
- ld de, PlayerDisableCount
- ld hl, BattleMonMoves
+ ld de, wPlayerDisableCount
+ ld hl, wBattleMonMoves
.got_moves
ld a, [de]
@@ -8066,9 +8066,9 @@
ld a, [hBattleTurn]
and a
- ld hl, EnemyMonPP
+ ld hl, wEnemyMonPP
jr z, .got_pp
- ld hl, BattleMonPP
+ ld hl, wBattleMonPP
.got_pp
ld b, 0
add hl, bc
@@ -8085,7 +8085,7 @@
add c
ld [de], a
call AnimateCurrentMove
- ld hl, DisabledMove
+ ld hl, wDisabledMove
ld a, [hBattleTurn]
and a
jr nz, .got_disabled_move_pointer
@@ -8109,14 +8109,14 @@
; payday
xor a
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld [hli], a
ld a, [hBattleTurn]
and a
- ld a, [BattleMonLevel]
+ ld a, [wBattleMonLevel]
jr z, .ok
- ld a, [EnemyMonLevel]
+ ld a, [wEnemyMonLevel]
.ok
add a
@@ -8138,17 +8138,17 @@
BattleCommand_Conversion: ; 3707f
; conversion
- ld hl, BattleMonMoves
- ld de, BattleMonType1
+ ld hl, wBattleMonMoves
+ ld de, wBattleMonType1
ld a, [hBattleTurn]
and a
jr z, .got_moves
- ld hl, EnemyMonMoves
- ld de, EnemyMonType1
+ ld hl, wEnemyMonMoves
+ ld de, wEnemyMonType1
.got_moves
push de
ld c, 0
- ld de, StringBuffer1
+ ld de, wStringBuffer1
.loop
push hl
ld b, 0
@@ -8178,7 +8178,7 @@
inc de
ld [de], a
pop de
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
.loop2
ld a, [hl]
cp -1
@@ -8207,7 +8207,7 @@
maskbits NUM_MOVES
ld c, a
ld b, 0
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
add hl, bc
ld a, [hl]
cp -1
@@ -8239,9 +8239,9 @@
; resetstats
ld a, 7 ; neutral
- ld hl, PlayerStatLevels
+ ld hl, wPlayerStatLevels
call .Fill
- ld hl, EnemyStatLevels
+ ld hl, wEnemyStatLevels
call .Fill
ld a, [hBattleTurn]
@@ -8261,7 +8261,7 @@
jp StdBattleTextBox
.Fill:
- ld b, PlayerStatLevelsEnd - PlayerStatLevels
+ ld b, wPlayerStatLevelsEnd - wPlayerStatLevels
.next
ld [hli], a
dec b
@@ -8274,13 +8274,13 @@
BattleCommand_Heal: ; 3713e
; heal
- ld de, BattleMonHP
- ld hl, BattleMonMaxHP
+ ld de, wBattleMonHP
+ ld hl, wBattleMonMaxHP
ld a, [hBattleTurn]
and a
jr z, .got_hp
- ld de, EnemyMonHP
- ld hl, EnemyMonMaxHP
+ ld de, wEnemyMonHP
+ ld hl, wEnemyMonMaxHP
.got_hp
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
@@ -8403,14 +8403,14 @@
jr z, .player
xor a
- ld [EnemyDisableCount], a
- ld [EnemyDisabledMove], a
+ ld [wEnemyDisableCount], a
+ ld [wEnemyDisabledMove], a
ret
.player
xor a
- ld [PlayerDisableCount], a
- ld [DisabledMove], a
+ ld [wPlayerDisableCount], a
+ ld [wDisabledMove], a
ret
; 372fc
@@ -8419,13 +8419,13 @@
BattleCommand_Screen: ; 372fc
; screen
- ld hl, PlayerScreens
- ld bc, PlayerLightScreenCount
+ ld hl, wPlayerScreens
+ ld bc, wPlayerLightScreenCount
ld a, [hBattleTurn]
and a
jr z, .got_screens_pointer
- ld hl, EnemyScreens
- ld bc, EnemyLightScreenCount
+ ld hl, wEnemyScreens
+ ld bc, wEnemyLightScreenCount
.got_screens_pointer
ld a, BATTLE_VARS_MOVE_EFFECT
@@ -8481,7 +8481,7 @@
TryPrintButItFailed: ; 37349
- ld a, [AlreadyFailed]
+ ld a, [wAlreadyFailed]
and a
ret nz
@@ -8590,11 +8590,11 @@
CheckUserMove: ; 37462
; Return z if the user has move a.
ld b, a
- ld de, BattleMonMoves
+ ld de, wBattleMonMoves
ld a, [hBattleTurn]
and a
jr z, .ok
- ld de, EnemyMonMoves
+ ld de, wEnemyMonMoves
.ok
ld c, NUM_MOVES
@@ -8624,7 +8624,7 @@
.player
ld [hl], 1
xor a
- ld [AlreadyDisobeyed], a
+ ld [wAlreadyDisobeyed], a
call DoMove
jp EndMoveEffect
@@ -8727,14 +8727,14 @@
BattleCommand_FuryCutter: ; 37792
; furycutter
- ld hl, PlayerFuryCutterCount
+ ld hl, wPlayerFuryCutterCount
ld a, [hBattleTurn]
and a
jr z, .go
- ld hl, EnemyFuryCutterCount
+ ld hl, wEnemyFuryCutterCount
.go
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jp nz, ResetFuryCutterCount
@@ -8752,7 +8752,7 @@
ret z
; Double the damage
- ld hl, CurDamage + 1
+ ld hl, wCurDamage + 1
sla [hl]
dec hl
rl [hl]
@@ -8771,11 +8771,11 @@
push hl
- ld hl, PlayerFuryCutterCount
+ ld hl, wPlayerFuryCutterCount
ld a, [hBattleTurn]
and a
jr z, .reset
- ld hl, EnemyFuryCutterCount
+ ld hl, wEnemyFuryCutterCount
.reset
xor a
@@ -8792,11 +8792,11 @@
BattleCommand_HappinessPower: ; 3784b
; happinesspower
push bc
- ld hl, BattleMonHappiness
+ ld hl, wBattleMonHappiness
ld a, [hBattleTurn]
and a
jr z, .ok
- ld hl, EnemyMonHappiness
+ ld hl, wEnemyMonHappiness
.ok
xor a
ld [hMultiplicand + 0], a
@@ -8824,11 +8824,11 @@
; frustrationpower
push bc
- ld hl, BattleMonHappiness
+ ld hl, wBattleMonHappiness
ld a, [hBattleTurn]
and a
jr z, .got_happiness
- ld hl, EnemyMonHappiness
+ ld hl, wEnemyMonHappiness
.got_happiness
ld a, $ff
sub [hl]
@@ -8854,13 +8854,13 @@
BattleCommand_Safeguard: ; 37939
; safeguard
- ld hl, PlayerScreens
- ld de, PlayerSafeguardCount
+ ld hl, wPlayerScreens
+ ld de, wPlayerSafeguardCount
ld a, [hBattleTurn]
and a
jr z, .ok
- ld hl, EnemyScreens
- ld de, EnemySafeguardCount
+ ld hl, wEnemyScreens
+ ld de, wEnemySafeguardCount
.ok
bit SCREENS_SAFEGUARD, [hl]
jr nz, .failed
@@ -8880,11 +8880,11 @@
SafeCheckSafeguard: ; 37962
push hl
- ld hl, EnemyScreens
+ ld hl, wEnemyScreens
ld a, [hBattleTurn]
and a
jr z, .got_turn
- ld hl, PlayerScreens
+ ld hl, wPlayerScreens
.got_turn
bit SCREENS_SAFEGUARD, [hl]
@@ -8896,16 +8896,16 @@
BattleCommand_CheckSafeguard: ; 37972
; checksafeguard
- ld hl, EnemyScreens
+ ld hl, wEnemyScreens
ld a, [hBattleTurn]
and a
jr z, .got_turn
- ld hl, PlayerScreens
+ ld hl, wPlayerScreens
.got_turn
bit SCREENS_SAFEGUARD, [hl]
ret z
ld a, 1
- ld [AttackMissed], a
+ ld [wAttackMissed], a
call BattleCommand_MoveDelay
ld hl, SafeguardProtectText
call StdBattleTextBox
@@ -9046,7 +9046,7 @@
ret z
ld a, 1
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
call LoadStandardMenuDataHeader
ld hl, LinkBattleSendReceiveAction
@@ -9054,7 +9054,7 @@
call CloseWindow
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ret
; 37a82
@@ -9069,7 +9069,7 @@
ld hl, LinkBattleSendReceiveAction
call CallBattleCore
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
add BATTLEACTION_SWITCH1
ld b, a
ld a, [wBattleAction]
@@ -9079,7 +9079,7 @@
jr c, .switch
.baton_pass
- ld a, [CurOTMon]
+ ld a, [wCurOTMon]
add BATTLEACTION_SWITCH1
ld [wBattleAction], a
.switch
@@ -9113,11 +9113,11 @@
call ResetActorDisable
; Attraction isn't passed.
- ld hl, PlayerSubStatus1
+ ld hl, wPlayerSubStatus1
res SUBSTATUS_IN_LOVE, [hl]
- ld hl, EnemySubStatus1
+ ld hl, wEnemySubStatus1
res SUBSTATUS_IN_LOVE, [hl]
- ld hl, PlayerSubStatus5
+ ld hl, wPlayerSubStatus5
ld a, BATTLE_VARS_SUBSTATUS5
call GetBattleVarAddr
@@ -9138,10 +9138,10 @@
CheckAnyOtherAlivePartyMons: ; 37ae9
- ld hl, PartyMon1HP
- ld a, [PartyCount]
+ ld hl, wPartyMon1HP
+ ld a, [wPartyCount]
ld d, a
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
ld e, a
jr CheckAnyOtherAliveMons
@@ -9149,10 +9149,10 @@
CheckAnyOtherAliveEnemyMons: ; 37af6
- ld hl, OTPartyMon1HP
- ld a, [OTPartyCount]
+ ld hl, wOTPartyMon1HP
+ ld a, [wOTPartyCount]
ld d, a
- ld a, [CurOTMon]
+ ld a, [wCurOTMon]
ld e, a
; fallthrough
@@ -9211,7 +9211,7 @@
and a
ret z
- ld hl, CurDamage + 1
+ ld hl, wCurDamage + 1
sla [hl]
dec hl
rl [hl]
@@ -9237,12 +9237,12 @@
call StdBattleTextBox
.not_leeched
- ld hl, PlayerScreens
+ ld hl, wPlayerScreens
ld de, wPlayerWrapCount
ld a, [hBattleTurn]
and a
jr z, .got_screens_wrap
- ld hl, EnemyScreens
+ ld hl, wEnemyScreens
ld de, wEnemyWrapCount
.got_screens_wrap
bit SCREENS_SPIKES, [hl]
@@ -9288,13 +9288,13 @@
BattleCommand_TimeBasedHealContinue: ; 37b7e
; Time- and weather-sensitive heal.
- ld hl, BattleMonMaxHP
- ld de, BattleMonHP
+ ld hl, wBattleMonMaxHP
+ ld de, wBattleMonHP
ld a, [hBattleTurn]
and a
jr z, .start
- ld hl, EnemyMonMaxHP
- ld de, EnemyMonHP
+ ld hl, wEnemyMonMaxHP
+ ld de, wEnemyMonHP
.start
; Index for .Multipliers
@@ -9310,15 +9310,15 @@
; Don't factor in time of day in link battles.
ld a, [wLinkMode]
and a
- jr nz, .Weather
+ jr nz, .checkWeather
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
cp b
- jr z, .Weather
+ jr z, .checkWeather
dec c ; double
-.Weather:
- ld a, [Weather]
+.checkWeather:
+ ld a, [wBattleWeather]
and a
jr z, .Heal
@@ -9372,7 +9372,7 @@
BattleCommand_HiddenPower: ; 37be8
; hiddenpower
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
ret nz
farcall HiddenPowerDamage
@@ -9384,9 +9384,9 @@
BattleCommand_StartRain: ; 37bf4
; startrain
ld a, WEATHER_RAIN
- ld [Weather], a
+ ld [wBattleWeather], a
ld a, 5
- ld [WeatherCount], a
+ ld [wWeatherCount], a
call AnimateCurrentMove
ld hl, DownpourText
jp StdBattleTextBox
@@ -9397,9 +9397,9 @@
BattleCommand_StartSun: ; 37c07
; startsun
ld a, WEATHER_SUN
- ld [Weather], a
+ ld [wBattleWeather], a
ld a, 5
- ld [WeatherCount], a
+ ld [wWeatherCount], a
call AnimateCurrentMove
ld hl, SunGotBrightText
jp StdBattleTextBox
@@ -9413,7 +9413,7 @@
; before checking that it has enough HP to use the move.
; Swap the order of these two blocks to fix.
call BattleCommand_AttackUp2
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .failed
@@ -9448,8 +9448,8 @@
BattleCommand_PsychUp: ; 37c55
; psychup
- ld hl, EnemyStatLevels
- ld de, PlayerStatLevels
+ ld hl, wEnemyStatLevels
+ ld de, wPlayerStatLevels
ld a, [hBattleTurn]
and a
jr z, .pointers_correct
@@ -9502,7 +9502,7 @@
; mirrorcoat
ld a, 1
- ld [AttackMissed], a
+ ld [wAttackMissed], a
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
@@ -9526,18 +9526,18 @@
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
call GetBattleVar
dec a
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call GetMoveData
- ld a, [StringBuffer1 + 2]
+ ld a, [wStringBuffer1 + 2]
and a
ret z
- ld a, [StringBuffer1 + 3]
+ ld a, [wStringBuffer1 + 3]
cp SPECIAL
ret c
- ld hl, CurDamage
+ ld hl, wCurDamage
ld a, [hli]
or [hl]
ret z
@@ -9555,7 +9555,7 @@
.capped
xor a
- ld [AttackMissed], a
+ ld [wAttackMissed], a
ret
; 37ce6
@@ -9573,7 +9573,7 @@
ld a, [hl]
and a
ret z
- ld hl, CurDamage + 1
+ ld hl, wCurDamage + 1
sla [hl]
dec hl
rl [hl]
@@ -9588,7 +9588,7 @@
BattleCommand_SkipSunCharge: ; 37d02
; mimicsuncharge
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_SUN
ret nz
ld b, charge_command
@@ -9618,9 +9618,9 @@
ld [hl], 0
ld a, [de]
inc de
- ld [CurDamage], a
+ ld [wCurDamage], a
ld a, [de]
- ld [CurDamage + 1], a
+ ld [wCurDamage + 1], a
ld b, futuresight_command
jp SkipToBattleCommand
@@ -9663,7 +9663,7 @@
jr z, .StoreDamage
ld de, wEnemyFutureSightDamage
.StoreDamage:
- ld hl, CurDamage
+ ld hl, wCurDamage
ld a, [hl]
ld [de], a
ld [hl], 0
@@ -9690,7 +9690,7 @@
ld a, BATTLE_VARS_MOVE_TYPE
call GetBattleVarAddr
inc hl
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_RAIN
jr z, .rain
cp WEATHER_SUN
@@ -9718,11 +9718,11 @@
GetUserItem: ; 37db2
; Return the effect of the user's item in bc, and its id at hl.
- ld hl, BattleMonItem
+ ld hl, wBattleMonItem
ld a, [hBattleTurn]
and a
jr z, .go
- ld hl, EnemyMonItem
+ ld hl, wEnemyMonItem
.go
ld b, [hl]
jp GetItemHeldEffect
@@ -9732,11 +9732,11 @@
GetOpponentItem: ; 37dc1
; Return the effect of the opponent's item in bc, and its id at hl.
- ld hl, EnemyMonItem
+ ld hl, wEnemyMonItem
ld a, [hBattleTurn]
and a
jr z, .go
- ld hl, BattleMonItem
+ ld hl, wBattleMonItem
.go
ld b, [hl]
jp GetItemHeldEffect
@@ -9807,7 +9807,7 @@
PlayDamageAnim: ; 37e19
xor a
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
@@ -9814,7 +9814,7 @@
and a
ret z
- ld [FXAnimID], a
+ ld [wFXAnimID], a
ld a, [hBattleTurn]
and a
@@ -9833,7 +9833,7 @@
LoadMoveAnim: ; 37e36
xor a
ld [wNumHits], a
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
@@ -9846,7 +9846,7 @@
LoadAnim: ; 37e44
- ld [FXAnimID], a
+ ld [wFXAnimID], a
; fallthrough
; 37e47
@@ -9867,9 +9867,9 @@
PlayOpponentBattleAnim: ; 37e54
ld a, e
- ld [FXAnimID], a
+ ld [wFXAnimID], a
ld a, d
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
xor a
ld [wNumHits], a
@@ -9928,9 +9928,9 @@
SkipToBattleCommand: ; 37e8c
; Skip over commands until reaching command b.
- ld a, [BattleScriptBufferAddress + 1]
+ ld a, [wBattleScriptBufferAddress + 1]
ld h, a
- ld a, [BattleScriptBufferAddress]
+ ld a, [wBattleScriptBufferAddress]
ld l, a
.loop
ld a, [hli]
@@ -9938,9 +9938,9 @@
jr nz, .loop
ld a, h
- ld [BattleScriptBufferAddress + 1], a
+ ld [wBattleScriptBufferAddress + 1], a
ld a, l
- ld [BattleScriptBufferAddress], a
+ ld [wBattleScriptBufferAddress], a
ret
; 37ea1
--- a/engine/battle/effect_commands/attract.asm
+++ b/engine/battle/effect_commands/attract.asm
@@ -1,6 +1,6 @@
BattleCommand_Attract: ; 377ce
; attract
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .failed
call CheckOppositeGender
@@ -28,12 +28,12 @@
ld a, MON_SPECIES
call BattlePartyAttr
ld a, [hl]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
- ld a, [CurBattleMon]
- ld [CurPartyMon], a
+ ld a, [wCurBattleMon]
+ ld [wCurPartyMon], a
xor a
- ld [MonType], a
+ ld [wMonType], a
farcall GetGender
jr c, .genderless_samegender
@@ -44,20 +44,20 @@
.got_gender
push bc
- ld a, [TempEnemyMonSpecies]
- ld [CurPartySpecies], a
- ld hl, EnemyMonDVs
- ld a, [EnemySubStatus5]
+ ld a, [wTempEnemyMonSpecies]
+ ld [wCurPartySpecies], a
+ ld hl, wEnemyMonDVs
+ ld a, [wEnemySubStatus5]
bit SUBSTATUS_TRANSFORMED, a
jr z, .not_transformed
ld hl, wEnemyBackupDVs
.not_transformed
ld a, [hli]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [hl]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld a, 3
- ld [MonType], a
+ ld [wMonType], a
farcall GetGender
pop bc
jr c, .genderless_samegender
--- a/engine/battle/effect_commands/curse.asm
+++ b/engine/battle/effect_commands/curse.asm
@@ -1,13 +1,13 @@
BattleCommand_Curse: ; 37588
; curse
- ld de, BattleMonType1
- ld bc, PlayerStatLevels
+ ld de, wBattleMonType1
+ ld bc, wPlayerStatLevels
ld a, [hBattleTurn]
and a
jr z, .go
- ld de, EnemyMonType1
- ld bc, EnemyStatLevels
+ ld de, wEnemyMonType1
+ ld bc, wEnemyStatLevels
.go
--- a/engine/battle/effect_commands/foresight.asm
+++ b/engine/battle/effect_commands/foresight.asm
@@ -1,7 +1,7 @@
BattleCommand_Foresight: ; 376a0
; foresight
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr nz, .failed
--- a/engine/battle/effect_commands/perish_song.asm
+++ b/engine/battle/effect_commands/perish_song.asm
@@ -2,8 +2,8 @@
; perishsong
- ld hl, PlayerSubStatus1
- ld de, EnemySubStatus1
+ ld hl, wPlayerSubStatus1
+ ld de, wEnemySubStatus1
bit SUBSTATUS_PERISH, [hl]
jr z, .ok
@@ -17,7 +17,7 @@
set SUBSTATUS_PERISH, [hl]
ld a, 4
- ld [PlayerPerishCount], a
+ ld [wPlayerPerishCount], a
.enemy
ld a, [de]
@@ -27,7 +27,7 @@
set SUBSTATUS_PERISH, a
ld [de], a
ld a, 4
- ld [EnemyPerishCount], a
+ ld [wEnemyPerishCount], a
.done
call AnimateCurrentMove
--- a/engine/battle/effect_commands/present.asm
+++ b/engine/battle/effect_commands/present.asm
@@ -20,7 +20,7 @@
ld a, [wTypeMatchup]
and a
jp z, AnimateFailedMove
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jp nz, AnimateFailedMove
--- a/engine/battle/effect_commands/protect.asm
+++ b/engine/battle/effect_commands/protect.asm
@@ -16,11 +16,11 @@
ProtectChance: ; 3762c
- ld de, PlayerProtectCount
+ ld de, wPlayerProtectCount
ld a, [hBattleTurn]
and a
jr z, .asm_37637
- ld de, EnemyProtectCount
+ ld de, wEnemyProtectCount
.asm_37637
call CheckOpponentWentFirst
--- a/engine/battle/effect_commands/rollout.asm
+++ b/engine/battle/effect_commands/rollout.asm
@@ -4,11 +4,11 @@
BattleCommand_CheckCurl: ; 37718
; checkcurl
- ld de, PlayerRolloutCount
+ ld de, wPlayerRolloutCount
ld a, [hBattleTurn]
and a
jr z, .ok
- ld de, EnemyRolloutCount
+ ld de, wEnemyRolloutCount
.ok
ld a, BATTLE_VARS_SUBSTATUS1
call GetBattleVar
@@ -33,11 +33,11 @@
and SLP
ret nz
- ld hl, PlayerRolloutCount
+ ld hl, wPlayerRolloutCount
ld a, [hBattleTurn]
and a
jr z, .got_rollout_count
- ld hl, EnemyRolloutCount
+ ld hl, wEnemyRolloutCount
.got_rollout_count
ld a, [hl]
@@ -47,7 +47,7 @@
ld [wSomeoneIsRampaging], a
.skip_set_rampage
- ld a, [AttackMissed]
+ ld a, [wAttackMissed]
and a
jr z, .hit
@@ -84,7 +84,7 @@
dec b
jr z, .done_damage
- ld hl, CurDamage + 1
+ ld hl, wCurDamage + 1
sla [hl]
dec hl
rl [hl]
--- a/engine/battle/effect_commands/sandstorm.asm
+++ b/engine/battle/effect_commands/sandstorm.asm
@@ -1,14 +1,14 @@
BattleCommand_StartSandstorm: ; 376f8
; startsandstorm
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_SANDSTORM
jr z, .failed
ld a, WEATHER_SANDSTORM
- ld [Weather], a
+ ld [wBattleWeather], a
ld a, 5
- ld [WeatherCount], a
+ ld [wWeatherCount], a
call AnimateCurrentMove
ld hl, SandstormBrewedText
jp StdBattleTextBox
--- a/engine/battle/effect_commands/spikes.asm
+++ b/engine/battle/effect_commands/spikes.asm
@@ -1,11 +1,11 @@
BattleCommand_Spikes: ; 37683
; spikes
- ld hl, EnemyScreens
+ ld hl, wEnemyScreens
ld a, [hBattleTurn]
and a
jr z, .asm_3768e
- ld hl, PlayerScreens
+ ld hl, wPlayerScreens
.asm_3768e
; Fails if spikes are already down!
--- a/engine/battle/effect_commands/thief.asm
+++ b/engine/battle/effect_commands/thief.asm
@@ -26,7 +26,7 @@
farcall ItemIsMail
ret c
- ld a, [EffectFailed]
+ ld a, [wEffectFailed]
and a
ret nz
@@ -74,7 +74,7 @@
farcall ItemIsMail
ret c
- ld a, [EffectFailed]
+ ld a, [wEffectFailed]
and a
ret nz
@@ -103,7 +103,7 @@
call BattlePartyAttr
ld d, h
ld e, l
- ld hl, BattleMonItem
+ ld hl, wBattleMonItem
ret
.enemyitem
@@ -111,6 +111,6 @@
call OTPartyAttr
ld d, h
ld e, l
- ld hl, EnemyMonItem
+ ld hl, wEnemyMonItem
ret
; 37517
--- a/engine/battle/effect_commands/transform.asm
+++ b/engine/battle/effect_commands/transform.asm
@@ -11,7 +11,7 @@
jp nz, BattleEffect_ButItFailed
xor a
ld [wNumHits], a
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
ld a, $1
ld [wKickCounter], a
ld a, BATTLE_VARS_SUBSTATUS4
@@ -28,15 +28,15 @@
call GetBattleVarAddr
set SUBSTATUS_TRANSFORMED, [hl]
call ResetActorDisable
- ld hl, BattleMonSpecies
- ld de, EnemyMonSpecies
+ ld hl, wBattleMonSpecies
+ ld de, wEnemyMonSpecies
ld a, [hBattleTurn]
and a
jr nz, .got_mon_species
- ld hl, EnemyMonSpecies
- ld de, BattleMonSpecies
+ ld hl, wEnemyMonSpecies
+ ld de, wBattleMonSpecies
xor a
- ld [CurMoveNum], a
+ ld [wCurMoveNum], a
.got_mon_species
push hl
ld a, [hli]
@@ -64,7 +64,7 @@
ld [de], a
inc de
; move pointer to stats
- ld bc, BattleMonStats - BattleMonPP
+ ld bc, wBattleMonStats - wBattleMonPP
add hl, bc
push hl
ld h, d
@@ -73,16 +73,16 @@
ld d, h
ld e, l
pop hl
- ld bc, BattleMonStructEnd - BattleMonStats
+ ld bc, wBattleMonStructEnd - wBattleMonStats
call CopyBytes
; init the power points
- ld bc, BattleMonMoves - BattleMonStructEnd
+ ld bc, wBattleMonMoves - wBattleMonStructEnd
add hl, bc
push de
ld d, h
ld e, l
pop hl
- ld bc, BattleMonPP - BattleMonStructEnd
+ ld bc, wBattleMonPP - wBattleMonStructEnd
add hl, bc
ld b, NUM_MOVES
.pp_loop
@@ -102,12 +102,12 @@
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
- ld hl, EnemyStats
- ld de, PlayerStats
+ ld hl, wEnemyStats
+ ld de, wPlayerStats
ld bc, 2 * 5
call BattleSideCopy
- ld hl, EnemyStatLevels
- ld de, PlayerStatLevels
+ ld hl, wEnemyStatLevels
+ ld de, wPlayerStatLevels
ld bc, 8
call BattleSideCopy
call _CheckBattleScene
@@ -129,7 +129,7 @@
.after_anim
xor a
ld [wNumHits], a
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
ld a, $2
ld [wKickCounter], a
pop af
--- a/engine/battle/hidden_power.asm
+++ b/engine/battle/hidden_power.asm
@@ -1,11 +1,11 @@
HiddenPowerDamage: ; fbced
; Override Hidden Power's type and power based on the user's DVs.
- ld hl, BattleMonDVs
+ ld hl, wBattleMonDVs
ld a, [hBattleTurn]
and a
jr z, .got_dvs
- ld hl, EnemyMonDVs
+ ld hl, wEnemyMonDVs
.got_dvs
--- a/engine/battle/link_result.asm
+++ b/engine/battle/link_result.asm
@@ -1,9 +1,9 @@
DetermineLinkBattleResult: ; 2b930
farcall UpdateEnemyMonInParty
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
call .CountMonsRemaining
push bc
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
call .CountMonsRemaining
ld a, c
pop bc
@@ -20,10 +20,10 @@
jr z, .victory
cp $2
jr z, .defeat
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
call .CalcPercentHPRemaining
push de
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
call .CalcPercentHPRemaining
pop hl
ld a, d
@@ -118,16 +118,16 @@
ret
.BothSides_CheckNumberMonsAtFullHealth: ; 2b9e1
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
call .CheckFaintedOrFullHealth
jr nz, .finish ; we have a pokemon that's neither fainted nor at full health
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
call .CheckFaintedOrFullHealth
ld e, $1
ret
.finish
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
call .CheckFaintedOrFullHealth
ld e, $0
ret nz ; we both have pokemon that are neither fainted nor at full health
--- a/engine/battle/misc.asm
+++ b/engine/battle/misc.asm
@@ -53,7 +53,7 @@
DoWeatherModifiers: ; fbda4
ld de, .WeatherTypeModifiers
- ld a, [Weather]
+ ld a, [wBattleWeather]
ld b, a
ld a, [wd265] ; move type
ld c, a
@@ -105,7 +105,7 @@
.ApplyModifier:
xor a
ld [hMultiplicand + 0], a
- ld hl, CurDamage
+ ld hl, wCurDamage
ld a, [hli]
ld [hMultiplicand + 1], a
ld a, [hl]
@@ -138,9 +138,9 @@
.Update:
ld a, b
- ld [CurDamage], a
+ ld [wCurDamage], a
ld a, c
- ld [CurDamage + 1], a
+ ld [wCurDamage + 1], a
.done
ret
@@ -163,7 +163,7 @@
and a
ret nz
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
and a
ret nz
@@ -199,10 +199,10 @@
jr .CheckBadge
.ApplyBoost:
- ld a, [CurDamage]
+ ld a, [wCurDamage]
ld h, a
ld d, a
- ld a, [CurDamage + 1]
+ ld a, [wCurDamage + 1]
ld l, a
ld e, a
@@ -226,9 +226,9 @@
.Update:
ld a, h
- ld [CurDamage], a
+ ld [wCurDamage], a
ld a, l
- ld [CurDamage + 1], a
+ ld [wCurDamage + 1], a
.done
pop bc
--- a/engine/battle/read_trainer_attributes.asm
+++ b/engine/battle/read_trainer_attributes.asm
@@ -1,18 +1,18 @@
GetTrainerClassName: ; 3952d
- ld hl, RivalName
+ ld hl, wRivalName
ld a, c
cp RIVAL1
jr z, .rival
- ld [CurSpecies], a
+ ld [wCurSpecies], a
ld a, TRAINER_NAME
ld [wNamedObjectTypeBuffer], a
call GetName
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ret
.rival
- ld de, StringBuffer1
+ ld de, wStringBuffer1
push de
ld bc, NAME_LENGTH
call CopyBytes
@@ -20,25 +20,25 @@
ret
GetOTName: ; 39550
- ld hl, OTPlayerName
+ ld hl, wOTPlayerName
ld a, [wLinkMode]
and a
jr nz, .ok
- ld hl, RivalName
+ ld hl, wRivalName
ld a, c
cp RIVAL1
jr z, .ok
- ld [CurSpecies], a
+ ld [wCurSpecies], a
ld a, TRAINER_NAME
ld [wNamedObjectTypeBuffer], a
call GetName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
.ok
ld bc, TRAINER_CLASS_NAME_LENGTH
- ld de, OTClassName
+ ld de, wOTClassName
push de
call CopyBytes
pop de
@@ -45,10 +45,10 @@
ret
GetTrainerAttributes: ; 3957b
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
ld c, a
call GetOTName
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
dec a
ld hl, TrainerClassAttributes + TRNATTR_ITEM1
ld bc, NUM_TRAINER_ATTRIBUTES
--- a/engine/battle/read_trainer_dvs.asm
+++ b/engine/battle/read_trainer_dvs.asm
@@ -1,8 +1,8 @@
GetTrainerDVs: ; 270c4
-; Return the DVs of OtherTrainerClass in bc
+; Return the DVs of wOtherTrainerClass in bc
push hl
- ld a, [OtherTrainerClass]
+ ld a, [wOtherTrainerClass]
dec a
ld c, a
ld b, 0
--- a/engine/battle/read_trainer_party.asm
+++ b/engine/battle/read_trainer_party.asm
@@ -1,5 +1,5 @@
ReadTrainerParty: ; 39771
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
bit 0, a
ret nz
@@ -7,24 +7,24 @@
and a
ret nz
- ld hl, OTPartyCount
+ ld hl, wOTPartyCount
xor a
ld [hli], a
dec a
ld [hl], a
- ld hl, OTPartyMons
- ld bc, OTPartyMonsEnd - OTPartyMons
+ ld hl, wOTPartyMons
+ ld bc, wOTPartyMonsEnd - wOTPartyMons
xor a
call ByteFill
- ld a, [OtherTrainerClass]
+ ld a, [wOtherTrainerClass]
cp CAL
jr nz, .not_cal2
- ld a, [OtherTrainerID]
+ ld a, [wOtherTrainerID]
cp CAL2
jr z, .cal2
- ld a, [OtherTrainerClass]
+ ld a, [wOtherTrainerClass]
.not_cal2
dec a
@@ -37,7 +37,7 @@
ld h, [hl]
ld l, a
- ld a, [OtherTrainerID]
+ ld a, [wOtherTrainerID]
ld b, a
.skip_trainer
dec b
@@ -97,11 +97,11 @@
cp $ff
ret z
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld a, [hli]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, OTPARTYMON
- ld [MonType], a
+ ld [wMonType], a
push hl
predef TryAddMonToParty
pop hl
@@ -117,17 +117,17 @@
cp $ff
ret z
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld a, [hli]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, OTPARTYMON
- ld [MonType], a
+ ld [wMonType], a
push hl
predef TryAddMonToParty
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
dec a
- ld hl, OTPartyMon1Moves
+ ld hl, wOTPartyMon1Moves
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
@@ -144,9 +144,9 @@
push hl
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
dec a
- ld hl, OTPartyMon1Species
+ ld hl, wOTPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
@@ -194,16 +194,16 @@
cp $ff
ret z
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld a, [hli]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, OTPARTYMON
- ld [MonType], a
+ ld [wMonType], a
push hl
predef TryAddMonToParty
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
dec a
- ld hl, OTPartyMon1Item
+ ld hl, wOTPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
@@ -223,18 +223,18 @@
cp $ff
ret z
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld a, [hli]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, OTPARTYMON
- ld [MonType], a
+ ld [wMonType], a
push hl
predef TryAddMonToParty
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
dec a
- ld hl, OTPartyMon1Item
+ ld hl, wOTPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
@@ -245,9 +245,9 @@
ld [de], a
push hl
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
dec a
- ld hl, OTPartyMon1Moves
+ ld hl, wOTPartyMon1Moves
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
@@ -264,9 +264,9 @@
push hl
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
dec a
- ld hl, OTPartyMon1
+ ld hl, wOTPartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
@@ -314,7 +314,7 @@
ld [hli], a
ld a, [wEnemyTrainerBaseReward]
ld [hli], a
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld [hl], a
call Multiply
ld hl, wBattleReward
@@ -328,14 +328,14 @@
Battle_GetTrainerName:: ; 39939
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
bit 0, a
- ld hl, OTPlayerName
+ ld hl, wOTPlayerName
jp nz, CopyTrainerName
- ld a, [OtherTrainerID]
+ ld a, [wOtherTrainerID]
ld b, a
- ld a, [OtherTrainerClass]
+ ld a, [wOtherTrainerClass]
ld c, a
GetTrainerName:: ; 3994c
@@ -379,7 +379,7 @@
jr .loop
CopyTrainerName: ; 39984
- ld de, StringBuffer1
+ ld de, wStringBuffer1
push de
ld bc, NAME_LENGTH
call CopyBytes
@@ -389,7 +389,7 @@
Function39990: ; 39990
; This function is useless.
- ld de, StringBuffer1
+ ld de, wStringBuffer1
push de
ld bc, NAME_LENGTH
pop de
--- a/engine/battle/returntobattle_useball.asm
+++ b/engine/battle/returntobattle_useball.asm
@@ -1,7 +1,7 @@
_ReturnToBattle_UseBall: ; 2715c
call ClearBGPalettes
call ClearTileMap
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
jr z, .gettutorialbackpic
farcall GetBattleMonBackpic
--- a/engine/battle/sliding_intro.asm
+++ b/engine/battle/sliding_intro.asm
@@ -1,7 +1,7 @@
BattleIntroSlidingPics: ; 4e980
ld a, [rSVBK]
push af
- ld a, BANK(LYOverrides)
+ ld a, BANK(wLYOverrides)
ld [rSVBK], a
call .subfunction1
ld a, rSCX - $ff00
@@ -60,7 +60,7 @@
; 4e9d6
.subfunction3 ; 4e9d6
- ld hl, Sprite01XCoord
+ ld hl, wVirtualOAMSprite00XCoord
ld c, $12 ; 18
ld de, SPRITEOAMSTRUCT_LENGTH
.loop3
@@ -73,7 +73,7 @@
; 4e9e5
.subfunction4 ; 4e9e5
- ld hl, LYOverrides
+ ld hl, wLYOverrides
ld a, $90
ld bc, SCREEN_HEIGHT_PX
call ByteFill
@@ -81,7 +81,7 @@
; 4e9f1
.subfunction5 ; 4e9f1
- ld hl, LYOverrides
+ ld hl, wLYOverrides
ld a, d
ld c, $3e ; 62
.loop4
--- a/engine/battle/start_battle.asm
+++ b/engine/battle/start_battle.asm
@@ -17,7 +17,7 @@
ld [hMapAnims], a
call DelayFrame
ld b, 6
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
ld de, PARTYMON_STRUCT_LENGTH - 1
.loop
@@ -32,7 +32,7 @@
ld de, MON_LEVEL - MON_HP
add hl, de
ld a, [hl]
- ld [BattleMonLevel], a
+ ld [wBattleMonLevel], a
predef DoBattleTransition
farcall _LoadBattleFontsHPBar
ld a, 1
@@ -52,13 +52,13 @@
push bc
xor a
- ld [MusicFade], a
+ ld [wMusicFade], a
ld de, MUSIC_NONE
call PlayMusic
call DelayFrame
call MaxVolume
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_SUICUNE
ld de, MUSIC_SUICUNE_BATTLE
jp z, .done
@@ -66,7 +66,7 @@
jp z, .done
; Are we fighting a trainer?
- ld a, [OtherTrainerClass]
+ ld a, [wOtherTrainerClass]
and a
jr nz, .trainermusic
@@ -76,7 +76,7 @@
jr nz, .kantowild
ld de, MUSIC_JOHTO_WILD_BATTLE
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
cp NITE_F
jr nz, .done
ld de, MUSIC_JOHTO_WILD_BATTLE_NIGHT
@@ -111,13 +111,13 @@
jr c, .done
ld de, MUSIC_RIVAL_BATTLE
- ld a, [OtherTrainerClass]
+ ld a, [wOtherTrainerClass]
cp RIVAL1
jr z, .done
cp RIVAL2
jr nz, .othertrainer
- ld a, [OtherTrainerID]
+ ld a, [wOtherTrainerID]
cp RIVAL2_2_CHIKORITA ; Rival in Indigo Plateau
jr c, .done
ld de, MUSIC_CHAMPION_BATTLE
@@ -150,7 +150,7 @@
ClearBattleRAM: ; 2ef18
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ld [wBattleResult], a
ld hl, wPartyMenuCursor
@@ -160,25 +160,25 @@
ld [hl], a
ld [wMenuScrollPosition], a
- ld [CriticalHit], a
- ld [BattleMonSpecies], a
+ ld [wCriticalHit], a
+ ld [wBattleMonSpecies], a
ld [wBattleParticipantsNotFainted], a
- ld [CurBattleMon], a
+ ld [wCurBattleMon], a
ld [wForcedSwitch], a
- ld [TimeOfDayPal], a
- ld [PlayerTurnsTaken], a
- ld [EnemyTurnsTaken], a
- ld [EvolvableFlags], a
+ ld [wTimeOfDayPal], a
+ ld [wPlayerTurnsTaken], a
+ ld [wEnemyTurnsTaken], a
+ ld [wEvolvableFlags], a
- ld hl, PlayerHPPal
+ ld hl, wPlayerHPPal
ld [hli], a
ld [hl], a
- ld hl, BattleMonDVs
+ ld hl, wBattleMonDVs
ld [hli], a
ld [hl], a
- ld hl, EnemyMonDVs
+ ld hl, wEnemyMonDVs
ld [hli], a
ld [hl], a
--- a/engine/battle/trainer_huds.asm
+++ b/engine/battle/trainer_huds.asm
@@ -18,8 +18,8 @@
ShowPlayerMonsRemaining: ; 2c01c
call DrawPlayerPartyIconHUDBorder
- ld hl, PartyMon1HP
- ld de, PartyCount
+ ld hl, wPartyMon1HP
+ ld de, wPartyCount
call StageBallTilesData
; ldpixel wPlaceBallsX, 12, 12
ld a, 12 * 8
@@ -28,14 +28,14 @@
ld [hl], a
ld a, 8
ld [wPlaceBallsDirection], a
- ld hl, Sprite01
+ ld hl, wVirtualOAMSprite00
jp LoadTrainerHudOAM
; 2c03a
ShowOTTrainerMonsRemaining: ; 2c03a
call DrawEnemyHUDBorder
- ld hl, OTPartyMon1HP
- ld de, OTPartyCount
+ ld hl, wOTPartyMon1HP
+ ld de, wOTPartyCount
call StageBallTilesData
; ldpixel wPlaceBallsX, 9, 4
ld hl, wPlaceBallsX
@@ -44,7 +44,7 @@
ld [hl], 4 * 8
ld a, -8
ld [wPlaceBallsDirection], a
- ld hl, Sprite01 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
+ ld hl, wVirtualOAMSprite00 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
jp LoadTrainerHudOAM
; 2c059
@@ -51,7 +51,7 @@
StageBallTilesData: ; 2c059
ld a, [de]
push af
- ld de, Buffer1
+ ld de, wBuffer1
ld c, PARTY_LENGTH
ld a, $34 ; empty slot
.loop1
@@ -60,7 +60,7 @@
dec c
jr nz, .loop1
pop af
- ld de, Buffer1
+ ld de, wBuffer1
.loop2
push af
call .GetHUDTile
@@ -147,7 +147,7 @@
ld a, [wBattleMode]
dec a
ret nz
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
dec a
call CheckCaughtMon
ret z
@@ -167,17 +167,17 @@
ld [hl], a
ld bc, SCREEN_WIDTH
add hl, bc
- ld a, [StartFlypoint]
+ ld a, [wStartFlypoint]
ld [hl], a
ld b, $8
.loop
add hl, de
- ld a, [MovementBuffer]
+ ld a, [wMovementBuffer]
ld [hl], a
dec b
jr nz, .loop
add hl, de
- ld a, [EndFlypoint]
+ ld a, [wEndFlypoint]
ld [hl], a
ret
; 2c10d
@@ -184,8 +184,8 @@
LinkBattle_TrainerHuds: ; 2c10d
call LoadBallIconGFX
- ld hl, PartyMon1HP
- ld de, PartyCount
+ ld hl, wPartyMon1HP
+ ld de, wPartyCount
call StageBallTilesData
ld hl, wPlaceBallsX
ld a, 10 * 8
@@ -193,22 +193,22 @@
ld [hl], 8 * 8
ld a, $8
ld [wPlaceBallsDirection], a
- ld hl, Sprite01
+ ld hl, wVirtualOAMSprite00
call LoadTrainerHudOAM
- ld hl, OTPartyMon1HP
- ld de, OTPartyCount
+ ld hl, wOTPartyMon1HP
+ ld de, wOTPartyCount
call StageBallTilesData
ld hl, wPlaceBallsX
ld a, 10 * 8
ld [hli], a
ld [hl], 13 * 8
- ld hl, Sprite01 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
+ ld hl, wVirtualOAMSprite00 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
jp LoadTrainerHudOAM
; 2c143
LoadTrainerHudOAM: ; 2c143
- ld de, Buffer1
+ ld de, wBuffer1
ld c, PARTY_LENGTH
.loop
ld a, [wPlaceBallsY]
@@ -250,10 +250,10 @@
ld c, 14
call TextBox
hlcoord 4, 5
- ld de, PlayerName
+ ld de, wPlayerName
call PlaceString
hlcoord 4, 10
- ld de, OTPlayerName
+ ld de, wOTPlayerName
call PlaceString
hlcoord 9, 8
ld a, "<BOLD_V>"
--- a/engine/battle/updatebattlehuds.asm
+++ b/engine/battle/updatebattlehuds.asm
@@ -1,9 +1,9 @@
_UpdateBattleHUDs:
farcall DrawPlayerHUD
- ld hl, PlayerHPPal
+ ld hl, wPlayerHPPal
call SetHPPal
farcall DrawEnemyHUD
- ld hl, EnemyHPPal
+ ld hl, wEnemyHPPal
call SetHPPal
farcall FinishBattleAnim
ret
--- a/engine/battle/used_move_text.asm
+++ b/engine/battle/used_move_text.asm
@@ -46,7 +46,7 @@
; everything except 'instead' made redundant in localization
; check obedience
- ld a, [AlreadyDisobeyed]
+ ld a, [wAlreadyDisobeyed]
and a
ld hl, UsedMove2Text
ret nz
@@ -71,7 +71,7 @@
start_asm
UsedMoveText_CheckObedience: ; 105e10
; check obedience
- ld a, [AlreadyDisobeyed]
+ ld a, [wAlreadyDisobeyed]
and a
jr z, .GetMoveNameText
; print "instead,"
@@ -183,11 +183,11 @@
UpdateUsedMoves: ; 105ed0
-; append move a to PlayerUsedMoves unless it has already been used
+; append move a to wPlayerUsedMoves unless it has already been used
push bc
; start of list
- ld hl, PlayerUsedMoves
+ ld hl, wPlayerUsedMoves
; get move id
ld b, a
; next count
@@ -209,7 +209,7 @@
; if the list is full and the move hasn't already been used
; shift the list back one byte, deleting the first move used
; this can occur with struggle or a new learned move
- ld hl, PlayerUsedMoves + 1
+ ld hl, wPlayerUsedMoves + 1
; 1 = 2
ld a, [hld]
ld [hli], a
@@ -223,7 +223,7 @@
ld [hl], a
; 4 = new move
ld a, b
- ld [PlayerUsedMoves + 3], a
+ ld [wPlayerUsedMoves + 3], a
jr .quit
.add
--- a/engine/battle_anims/anim_commands.asm
+++ b/engine/battle_anims/anim_commands.asm
@@ -5,7 +5,7 @@
ld a, [rSVBK]
push af
- ld a, BANK(ActiveAnimObjects)
+ ld a, BANK(wActiveAnimObjects)
ld [rSVBK], a
call _PlayBattleAnim
@@ -56,7 +56,7 @@
BattleAnimRunScript: ; cc11c
- ld a, [FXAnimID + 1]
+ ld a, [wFXAnimID + 1]
and a
jr nz, .hi_byte
@@ -85,9 +85,9 @@
ld de, ANIM_MISS
add hl, de
ld a, l
- ld [FXAnimID], a
+ ld [wFXAnimID], a
ld a, h
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
.hi_byte
call WaitSFX
@@ -111,11 +111,11 @@
call BattleAnimRequestPals
; Speed up Rollout's animation.
- ld a, [FXAnimID + 1]
+ ld a, [wFXAnimID + 1]
or a
jr nz, .not_rollout
- ld a, [FXAnimID]
+ ld a, [wFXAnimID]
cp ROLLOUT
jr nz, .not_rollout
@@ -122,7 +122,7 @@
ld a, $2e
ld b, 5
ld de, 4
- ld hl, ActiveBGEffects
+ ld hl, wActiveBGEffects
.find
cp [hl]
jr z, .done
@@ -134,7 +134,7 @@
call BattleAnimDelayFrame
.done
- ld a, [BattleAnimFlags]
+ ld a, [wBattleAnimFlags]
bit 0, a
jr z, .playframe
@@ -163,7 +163,7 @@
ld a, [rSVBK]
push af
- ld a, BANK(CurBattleMon) ; alternatively: BANK(TempMon), BANK(PartyMon1), several others
+ ld a, BANK(wCurBattleMon) ; alternatively: BANK(wTempMon), BANK(wPartyMon1), several others
ld [rSVBK], a
ld hl, UpdateBattleHuds
@@ -206,9 +206,9 @@
; Like DelayFrame but wastes battery life.
ld a, 1
- ld [VBlankOccurred], a
+ ld [wVBlankOccurred], a
.wait
- ld a, [VBlankOccurred]
+ ld a, [wVBlankOccurred]
and a
jr nz, .wait
ret
@@ -253,11 +253,11 @@
BattleAnim_ClearCGB_OAMFlags: ; cc23d
- ld a, [BattleAnimFlags]
+ ld a, [wBattleAnimFlags]
bit 3, a
jr z, .delete
- ld hl, Sprite01Attributes
+ ld hl, wVirtualOAMSprite00Attributes
ld c, NUM_SPRITE_OAM_STRUCTS
.loop
ld a, [hl]
@@ -271,8 +271,8 @@
ret
.delete
- ld hl, Sprites
- ld c, SpritesEnd - Sprites
+ ld hl, wVirtualOAM
+ ld c, wVirtualOAMEnd - wVirtualOAM
xor a
.loop2
ld [hli], a
@@ -289,12 +289,12 @@
; cc267
.CheckTimer: ; cc267
- ld a, [BattleAnimDuration]
+ ld a, [wBattleAnimDuration]
and a
jr z, .done
dec a
- ld [BattleAnimDuration], a
+ ld [wBattleAnimDuration], a
and a
ret
@@ -311,7 +311,7 @@
jr nz, .not_done_with_anim
; Return from a subroutine.
- ld hl, BattleAnimFlags
+ ld hl, wBattleAnimFlags
bit 1, [hl]
jr nz, .do_anim
@@ -322,7 +322,7 @@
cp $d0
jr nc, .do_anim
- ld [BattleAnimDuration], a
+ ld [wBattleAnimDuration], a
ret
.do_anim
@@ -332,8 +332,8 @@
; cc293
.DoCommand: ; cc293
-; Execute battle animation command in [BattleAnimByte].
- ld a, [BattleAnimByte]
+; Execute battle animation command in [wBattleAnimByte].
+ ld a, [wBattleAnimByte]
sub $d0
ld e, a
@@ -408,13 +408,13 @@
ret
BattleAnimCmd_Ret: ; cc305 (33:4305)
- ld hl, BattleAnimFlags
+ ld hl, wBattleAnimFlags
res 1, [hl]
- ld hl, BattleAnimParent
+ ld hl, wBattleAnimParent
ld e, [hl]
inc hl
ld d, [hl]
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
@@ -426,20 +426,20 @@
call GetBattleAnimByte
ld d, a
push de
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
- ld hl, BattleAnimParent
+ ld hl, wBattleAnimParent
ld [hl], e
inc hl
ld [hl], d
pop de
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
- ld hl, BattleAnimFlags
+ ld hl, wBattleAnimFlags
set 1, [hl]
ret
@@ -448,7 +448,7 @@
ld e, a
call GetBattleAnimByte
ld d, a
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
@@ -456,7 +456,7 @@
BattleAnimCmd_Loop: ; cc348 (33:4348)
call GetBattleAnimByte
- ld hl, BattleAnimFlags
+ ld hl, wBattleAnimFlags
bit 2, [hl]
jr nz, .continue_loop
and a
@@ -463,9 +463,9 @@
jr z, .perpetual
dec a
set 2, [hl]
- ld [BattleAnimLoops], a
+ ld [wBattleAnimLoops], a
.continue_loop
- ld hl, BattleAnimLoops
+ ld hl, wBattleAnimLoops
ld a, [hl]
and a
jr z, .return_from_loop
@@ -475,7 +475,7 @@
ld e, a
call GetBattleAnimByte
ld d, a
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
@@ -482,9 +482,9 @@
ret
.return_from_loop
- ld hl, BattleAnimFlags
+ ld hl, wBattleAnimFlags
res 2, [hl]
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
@@ -506,7 +506,7 @@
ld e, a
call GetBattleAnimByte
ld d, a
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
@@ -513,7 +513,7 @@
ret
.dont_jump
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
@@ -526,21 +526,21 @@
BattleAnimCmd_SetVar: ; cc3a6 (33:43a6)
call GetBattleAnimByte
- ld [BattleAnimVar], a
+ ld [wBattleAnimVar], a
ret
BattleAnimCmd_IncVar: ; cc3ad (33:43ad)
- ld hl, BattleAnimVar
+ ld hl, wBattleAnimVar
inc [hl]
ret
BattleAnimCmd_IfVarEqual: ; cc3b2 (33:43b2)
call GetBattleAnimByte
- ld hl, BattleAnimVar
+ ld hl, wBattleAnimVar
cp [hl]
jr z, .jump
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
@@ -556,7 +556,7 @@
ld e, a
call GetBattleAnimByte
ld d, a
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
@@ -568,7 +568,7 @@
cp [hl]
jr z, .jump
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
@@ -584,7 +584,7 @@
ld e, a
call GetBattleAnimByte
ld d, a
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
@@ -597,7 +597,7 @@
and e
jr nz, .jump
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
@@ -613,7 +613,7 @@
ld e, a
call GetBattleAnimByte
ld d, a
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld [hl], e
inc hl
ld [hl], d
@@ -670,7 +670,7 @@
ret
BattleAnimCmd_ClearObjs: ; cc479 (33:4479)
- ld hl, ActiveAnimObjects
+ ld hl, wActiveAnimObjects
ld a, $a0
.loop
ld [hl], $0
@@ -684,7 +684,7 @@
BattleAnimCmd_3GFX:
BattleAnimCmd_4GFX:
BattleAnimCmd_5GFX: ; cc485 (33:4485)
- ld a, [BattleAnimByte]
+ ld a, [wBattleAnimByte]
and $f
ld c, a
ld hl, wBattleAnimTileDict
@@ -707,7 +707,7 @@
endr
ld de, vTiles0 tile $31
add hl, de
- ld a, [BattleAnimByte]
+ ld a, [wBattleAnimByte]
call LoadBattleAnimObj
ld a, [wBattleAnimTemp0]
add c
@@ -721,12 +721,12 @@
BattleAnimCmd_IncObj: ; cc4c0 (33:44c0)
call GetBattleAnimByte
ld e, 10
- ld bc, ActiveAnimObjects
+ ld bc, wActiveAnimObjects
.loop
ld hl, BATTLEANIMSTRUCT_INDEX
add hl, bc
ld d, [hl]
- ld a, [BattleAnimByte]
+ ld a, [wBattleAnimByte]
cp d
jr z, .found
ld hl, BATTLEANIMSTRUCT_LENGTH
@@ -746,12 +746,12 @@
BattleAnimCmd_IncBGEffect: ; cc4e3 (33:44e3)
call GetBattleAnimByte
ld e, 5
- ld bc, ActiveBGEffects
+ ld bc, wActiveBGEffects
.loop
ld hl, $0
add hl, bc
ld d, [hl]
- ld a, [BattleAnimByte]
+ ld a, [wBattleAnimByte]
cp d
jr z, .found
ld hl, 4
@@ -771,12 +771,12 @@
BattleAnimCmd_SetObj: ; cc506 (33:4506)
call GetBattleAnimByte
ld e, 10
- ld bc, ActiveAnimObjects
+ ld bc, wActiveAnimObjects
.loop
ld hl, BATTLEANIMSTRUCT_INDEX
add hl, bc
ld d, [hl]
- ld a, [BattleAnimByte]
+ ld a, [wBattleAnimByte]
cp d
jr z, .found
ld hl, BATTLEANIMSTRUCT_LENGTH
@@ -907,7 +907,7 @@
BattleAnimCmd_CheckPokeball: ; cc5d0 (33:45d0)
callfar GetPokeBallWobble
ld a, c
- ld [BattleAnimVar], a
+ ld [wBattleAnimVar], a
ret
BattleAnimCmd_E7: ; cc5db (33:45db)
@@ -916,9 +916,9 @@
BattleAnimCmd_Transform: ; cc5dc (33:45dc)
ld a, [rSVBK]
push af
- ld a, BANK(CurPartySpecies)
+ ld a, BANK(wCurPartySpecies)
ld [rSVBK], a
- ld a, [CurPartySpecies] ; CurPartySpecies
+ ld a, [wCurPartySpecies] ; CurPartySpecies
push af
ld a, [hBattleTurn]
@@ -925,9 +925,9 @@
and a
jr z, .player
- ld a, [TempBattleMonSpecies] ; TempBattleMonSpecies
- ld [CurPartySpecies], a ; CurPartySpecies
- ld hl, BattleMonDVs ; BattleMonDVs
+ ld a, [wTempBattleMonSpecies] ; TempBattleMonSpecies
+ ld [wCurPartySpecies], a ; CurPartySpecies
+ ld hl, wBattleMonDVs ; BattleMonDVs
predef GetUnownLetter
ld de, vTiles0 tile $00
predef GetMonFrontpic
@@ -934,9 +934,9 @@
jr .done
.player
- ld a, [TempEnemyMonSpecies] ; TempEnemyMonSpecies
- ld [CurPartySpecies], a ; CurPartySpecies
- ld hl, EnemyMonDVs ; EnemyMonDVs
+ ld a, [wTempEnemyMonSpecies] ; TempEnemyMonSpecies
+ ld [wCurPartySpecies], a ; CurPartySpecies
+ ld hl, wEnemyMonDVs ; EnemyMonDVs
predef GetUnownLetter
ld de, vTiles0 tile $00
predef GetMonBackpic
@@ -943,7 +943,7 @@
.done
pop af
- ld [CurPartySpecies], a ; CurPartySpecies
+ ld [wCurPartySpecies], a ; CurPartySpecies
pop af
ld [rSVBK], a
ret
@@ -1117,10 +1117,10 @@
BattleAnimCmd_DropSub: ; cc750 (33:4750)
ld a, [rSVBK]
push af
- ld a, BANK(CurPartySpecies)
+ ld a, BANK(wCurPartySpecies)
ld [rSVBK], a
- ld a, [CurPartySpecies] ; CurPartySpecies
+ ld a, [wCurPartySpecies] ; CurPartySpecies
push af
ld a, [hBattleTurn]
and a
@@ -1134,7 +1134,7 @@
.done
pop af
- ld [CurPartySpecies], a ; CurPartySpecies
+ ld [wCurPartySpecies], a ; CurPartySpecies
pop af
ld [rSVBK], a
ret
@@ -1142,19 +1142,19 @@
BattleAnimCmd_BeatUp: ; cc776 (33:4776)
ld a, [rSVBK]
push af
- ld a, BANK(CurPartySpecies)
+ ld a, BANK(wCurPartySpecies)
ld [rSVBK], a
- ld a, [CurPartySpecies] ; CurPartySpecies
+ ld a, [wCurPartySpecies] ; CurPartySpecies
push af
ld a, [wBattleAnimParam]
- ld [CurPartySpecies], a ; CurPartySpecies
+ ld [wCurPartySpecies], a ; CurPartySpecies
ld a, [hBattleTurn]
and a
jr z, .player
- ld hl, BattleMonDVs
+ ld hl, wBattleMonDVs
predef GetUnownLetter
ld de, vTiles2 tile $00
predef GetMonFrontpic
@@ -1161,7 +1161,7 @@
jr .done
.player
- ld hl, EnemyMonDVs
+ ld hl, wEnemyMonDVs
predef GetUnownLetter
ld de, vTiles2 tile $31
predef GetMonBackpic
@@ -1168,7 +1168,7 @@
.done
pop af
- ld [CurPartySpecies], a ; CurPartySpecies
+ ld [wCurPartySpecies], a ; CurPartySpecies
ld b, SCGB_BATTLE_COLORS
call GetSGBLayout
pop af
@@ -1186,7 +1186,7 @@
ret
BattleAnimCmd_ClearSprites: ; cc7c4 (33:47c4)
- ld hl, BattleAnimFlags
+ ld hl, wBattleAnimFlags
set 3, [hl]
ret
@@ -1207,7 +1207,7 @@
ld [wSFXDuration], a
call .GetCryTrack
maskbits NUM_NOISE_CHANS
- ld [CryTracks], a ; CryTracks
+ ld [wCryTracks], a ; CryTracks
ld e, a
ld d, 0
@@ -1253,7 +1253,7 @@
ld a, [rSVBK]
push af
- ld a, BANK(EnemyMon) ; BattleMon is in WRAM0, but EnemyMon is in WRAMX
+ ld a, BANK(wEnemyMon) ; wBattleMon is in WRAM0, but EnemyMon is in WRAMX
ld [rSVBK], a
ld a, [hBattleTurn]
@@ -1261,14 +1261,14 @@
jr nz, .enemy
ld a, $f0
- ld [CryTracks], a
- ld a, [BattleMonSpecies]
+ ld [wCryTracks], a
+ ld a, [wBattleMonSpecies]
jr .done_cry_tracks
.enemy
ld a, $0f
- ld [CryTracks], a
- ld a, [EnemyMonSpecies]
+ ld [wCryTracks], a
+ ld a, [wEnemyMonSpecies]
.done_cry_tracks
push hl
@@ -1282,21 +1282,21 @@
ld b, a
push hl
- ld hl, CryPitch
+ ld hl, wCryPitch
ld a, [hli]
ld h, [hl]
ld l, a
add hl, bc
ld a, l
- ld [CryPitch], a
+ ld [wCryPitch], a
ld a, h
- ld [CryPitch + 1], a
+ ld [wCryPitch + 1], a
pop hl
ld a, [hli]
ld c, a
ld b, [hl]
- ld hl, CryLength ; CryLength
+ ld hl, wCryLength ; CryLength
ld a, [hli]
ld h, [hl]
ld l, a
@@ -1303,9 +1303,9 @@
add hl, bc
ld a, l
- ld [CryLength], a ; CryLength
+ ld [wCryLength], a ; CryLength
ld a, h
- ld [CryLength + 1], a
+ ld [wCryLength + 1], a
ld a, 1
ld [wStereoPanningMask], a
@@ -1334,7 +1334,7 @@
ret nz
.okay
- ld a, [TypeModifier]
+ ld a, [wTypeModifier]
and $7f
ret z
@@ -1382,8 +1382,8 @@
ClearBattleAnims: ; cc8d3
; Clear animation block
- ld hl, LYOverrides
- ld bc, wBattleAnimEnd - LYOverrides
+ ld hl, wLYOverrides
+ ld bc, wBattleAnimEnd - wLYOverrides
.loop
ld [hl], $0
inc hl
@@ -1392,7 +1392,7 @@
or b
jr nz, .loop
- ld hl, FXAnimID
+ ld hl, wFXAnimID
ld e, [hl]
inc hl
ld d, [hl]
@@ -1476,7 +1476,7 @@
BattleAnim_UpdateOAM_All: ; cc96e
ld a, $0
ld [wBattleAnimOAMPointerLo], a
- ld hl, ActiveAnimObjects
+ ld hl, wActiveAnimObjects
ld e, 10
.loop
ld a, [hl]
@@ -1499,10 +1499,10 @@
jr nz, .loop
ld a, [wBattleAnimOAMPointerLo]
ld l, a
- ld h, HIGH(Sprites)
+ ld h, HIGH(wVirtualOAM)
.loop2
ld a, l
- cp LOW(SpritesEnd)
+ cp LOW(wVirtualOAMEnd)
jr nc, .done
xor a
ld [hli], a
--- a/engine/battle_anims/bg_effects.asm
+++ b/engine/battle_anims/bg_effects.asm
@@ -9,7 +9,7 @@
; BG effects for use in battle animations.
ExecuteBGEffects: ; c8000 (32:4000)
- ld hl, ActiveBGEffects
+ ld hl, wActiveBGEffects
ld e, 5
.loop
ld a, [hl]
@@ -30,7 +30,7 @@
ret
QueueBGEffect: ; c801a (32:401a)
- ld hl, ActiveBGEffects
+ ld hl, wActiveBGEffects
ld e, 5
.loop
ld a, [hl]
@@ -960,7 +960,7 @@
jr nz, .loop
pop af
ld [hl], a
- ld de, LYOverridesBackup
+ ld de, wLYOverridesBackup
ld hl, wSurfWaveBGEffect
ld bc, $0
.loop2
@@ -1224,7 +1224,7 @@
xor $ff
inc a
ld d, a
- ld h, HIGH(LYOverridesBackup)
+ ld h, HIGH(wLYOverridesBackup)
ld a, [hLYOverrideStart]
ld l, a
ld a, [hLYOverrideEnd]
@@ -1265,7 +1265,7 @@
ld e, [hl]
ld d, 2
call Functionc8f2e
- ld h, HIGH(LYOverridesBackup)
+ ld h, HIGH(wLYOverridesBackup)
ld a, [hLYOverrideEnd]
ld l, a
ld [hl], $0
@@ -1276,7 +1276,7 @@
.one
ld a, [hLYOverrideEnd]
ld l, a
- ld h, HIGH(LYOverridesBackup)
+ ld h, HIGH(wLYOverridesBackup)
ld e, l
ld d, h
dec de
@@ -1539,10 +1539,10 @@
Functionc88a5: ; c88a5 (32:48a5)
push af
- ld a, [FXAnimID + 1] ; FXAnimID + 1
+ ld a, [wFXAnimID + 1] ; FXAnimID + 1
or a
jr nz, .not_rollout
- ld a, [FXAnimID] ; FXAnimID
+ ld a, [wFXAnimID] ; FXAnimID
cp ROLLOUT
jr z, .rollout
.not_rollout
@@ -1555,7 +1555,7 @@
ld a, [hLYOverrideEnd]
sub d
ld d, a
- ld h, HIGH(LYOverridesBackup)
+ ld h, HIGH(wLYOverridesBackup)
ld a, [hSCY]
or a
jr nz, .skip1
@@ -1847,7 +1847,7 @@
ld [hLYOverrideEnd], a
ld a, [hLYOverrideStart]
ld l, a
- ld h, HIGH(LYOverridesBackup)
+ ld h, HIGH(wLYOverridesBackup)
.loop
ld a, [hLYOverrideEnd]
cp l
@@ -1901,7 +1901,7 @@
ld a, [hLYOverrideEnd]
sub l
srl a
- ld h, HIGH(LYOverridesBackup)
+ ld h, HIGH(wLYOverridesBackup)
.loop2
ld [hl], e
inc hl
@@ -2044,7 +2044,7 @@
ret
.DMG_LYOverrideLoads:
- ld hl, LYOverridesBackup
+ ld hl, wLYOverridesBackup
.loop1
ld [hl], d
inc hl
@@ -2314,7 +2314,7 @@
ld [hSCY], a
xor $ff
inc a
- ld [AnimObject01YOffset], a
+ ld [wAnimObject01YOffset], a
ret
BattleBGEffect_1f: ; c8cf9 (32:4cf9)
@@ -2657,13 +2657,13 @@
BattleBGEffects_ClearLYOverrides: ; c8eca (32:4eca)
xor a
BattleBGEffects_SetLYOverrides: ; c8ecb (32:4ecb)
- ld hl, LYOverrides ; wListPointer
+ ld hl, wLYOverrides ; wListPointer
ld e, $99
.loop1
ld [hli], a
dec e
jr nz, .loop1
- ld hl, LYOverridesBackup
+ ld hl, wLYOverridesBackup
ld e, $91
.loop2
ld [hli], a
@@ -2735,7 +2735,7 @@
ld [wBattleAnimTemp2], a
ld a, $80
ld [wBattleAnimTemp3], a
- ld bc, LYOverridesBackup
+ ld bc, wLYOverridesBackup
.loop
ld a, [hLYOverrideStart]
cp c
@@ -2796,7 +2796,7 @@
ld a, d
ld [wBattleAnimTemp2], a
call .GetLYOverrideBackupAddrOffset
- ld hl, LYOverridesBackup
+ ld hl, wLYOverridesBackup
add hl, de
ld c, l
ld b, h
@@ -2853,7 +2853,7 @@
ld l, a
inc a
ld e, a
- ld h, HIGH(LYOverridesBackup)
+ ld h, HIGH(wLYOverridesBackup)
ld d, h
ld a, [hLYOverrideEnd]
sub l
@@ -2876,7 +2876,7 @@
BGEffect_FillLYOverridesBackup: ; c900b (32:500b)
push af
- ld h, HIGH(LYOverridesBackup)
+ ld h, HIGH(wLYOverridesBackup)
ld a, [hLYOverrideStart]
ld l, a
ld a, [hLYOverrideEnd]
@@ -2899,7 +2899,7 @@
sub l
sub e
ld d, a
- ld h, HIGH(LYOverridesBackup)
+ ld h, HIGH(wLYOverridesBackup)
ld a, [hLYOverrideStart]
ld l, a
ld a, $90
@@ -2930,12 +2930,12 @@
and $1
xor [hl]
jr nz, .player
- ld a, [EnemySubStatus3] ; EnemySubStatus3
+ ld a, [wEnemySubStatus3] ; EnemySubStatus3
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret
.player
- ld a, [PlayerSubStatus3] ; PlayerSubStatus3
+ ld a, [wPlayerSubStatus3] ; PlayerSubStatus3
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret
--- a/engine/battle_anims/core.asm
+++ b/engine/battle_anims/core.asm
@@ -1,5 +1,5 @@
QueueBattleAnimation: ; cc9a1 (33:49a1)
- ld hl, ActiveAnimObjects
+ ld hl, wActiveAnimObjects
ld e, 10
.loop
ld a, [hl]
@@ -106,7 +106,7 @@
ld l, a
ld a, [wBattleAnimOAMPointerLo]
ld e, a
- ld d, HIGH(Sprites)
+ ld d, HIGH(wVirtualOAM)
.loop
ld a, [wBattleAnimTempYCoord]
ld b, a
@@ -249,10 +249,10 @@
.check_kinesis_softboiled_milkdrink
sub d
push af
- ld a, [FXAnimID + 1]
+ ld a, [wFXAnimID + 1]
or a
jr nz, .no_sub
- ld a, [FXAnimID]
+ ld a, [wFXAnimID]
cp KINESIS
jr z, .kinesis
cp SOFTBOILED
--- a/engine/battle_anims/functions.asm
+++ b/engine/battle_anims/functions.asm
@@ -428,9 +428,9 @@
ld hl, BallColors
ld a, [rSVBK]
push af
- ld a, BANK(CurItem)
+ ld a, BANK(wCurItem)
ld [rSVBK], a
- ld a, [CurItem]
+ ld a, [wCurItem]
ld e, a
pop af
ld [rSVBK], a
@@ -1611,7 +1611,7 @@
ld hl, BATTLEANIMSTRUCT_10
add hl, bc
ld e, [hl]
- ld hl, hPushOAM ; $ff80
+ ld hl, hTransferVirtualOAM ; $ff80
add hl, de
ld e, l
ld d, h
@@ -2104,7 +2104,7 @@
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld e, [hl]
- ld hl, hPushOAM ; $ff80
+ ld hl, hTransferVirtualOAM ; $ff80
add hl, de
ld e, l
ld d, h
@@ -3332,7 +3332,7 @@
ld hl, BATTLEANIMSTRUCT_0F
add hl, bc
ld e, [hl]
- ld hl, hPushOAM ; $ff80
+ ld hl, hTransferVirtualOAM ; $ff80
add hl, de
ld e, l
ld d, h
--- a/engine/battle_anims/getpokeballwobble.asm
+++ b/engine/battle_anims/getpokeballwobble.asm
@@ -8,12 +8,12 @@
ld d, a
push de
- ld a, BANK(Buffer2)
+ ld a, BANK(wBuffer2)
ld [rSVBK], a
- ld a, [Buffer2]
+ ld a, [wBuffer2]
inc a
- ld [Buffer2], a
+ ld [wBuffer2], a
; Wobble up to 3 times.
cp 3 + 1
@@ -25,7 +25,7 @@
jr nz, .done
ld hl, .WobbleProbabilities
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld b, a
.loop
ld a, [hli]
--- a/engine/billspc.asm
+++ b/engine/billspc.asm
@@ -1,12 +1,12 @@
_DepositPKMN: ; e2391 (38:6391)
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set 4, [hl]
- ld a, [VramState]
+ ld a, [wVramState]
push af
xor a
- ld [VramState], a
+ ld [wVramState], a
ld a, [hInMenu]
push af
ld a, $1
@@ -30,9 +30,9 @@
pop af
ld [hInMenu], a
pop af
- ld [VramState], a
+ ld [wVramState], a
pop af
- ld [Options], a
+ ld [wOptions], a
ret
.RunJumptable: ; e23d5 (38:63d5)
@@ -61,7 +61,7 @@
call BillsPC_RefreshTextboxes
call PCMonInfo
ld a, $ff
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
call WaitBGMap
@@ -117,7 +117,7 @@
ld [hBGMapMode], a
call ClearSprites
call BillsPC_GetSelectedPokemonSpecies
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
ld de, PCString_WhatsUp
@@ -177,7 +177,7 @@
call ExitMenu
call PCMonInfo
call BillsPC_GetSelectedPokemonSpecies
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
ret
@@ -202,7 +202,7 @@
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
xor a
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
@@ -261,14 +261,14 @@
; e2583
_WithdrawPKMN: ; e2583 (38:6583)
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set 4, [hl]
- ld a, [VramState]
+ ld a, [wVramState]
push af
xor a
- ld [VramState], a
+ ld [wVramState], a
ld a, [hInMenu]
push af
ld a, $1
@@ -292,9 +292,9 @@
pop af
ld [hInMenu], a
pop af
- ld [VramState], a
+ ld [wVramState], a
pop af
- ld [Options], a
+ ld [wOptions], a
ret
.RunJumptable: ; e25c8 (38:65c8)
@@ -325,7 +325,7 @@
call BillsPC_RefreshTextboxes
call PCMonInfo
ld a, $ff
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
call WaitBGMap
@@ -380,7 +380,7 @@
ld [hBGMapMode], a
call ClearSprites
call BillsPC_GetSelectedPokemonSpecies
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
ld de, PCString_WhatsUp
@@ -439,7 +439,7 @@
call ExitMenu
call PCMonInfo
call BillsPC_GetSelectedPokemonSpecies
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
ret
@@ -462,7 +462,7 @@
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld a, PC_DEPOSIT
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
@@ -504,14 +504,14 @@
; 0xe2759
_MovePKMNWithoutMail: ; e2759
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set 4, [hl]
- ld a, [VramState]
+ ld a, [wVramState]
push af
xor a
- ld [VramState], a
+ ld [wVramState], a
ld a, [hInMenu]
push af
ld a, $1
@@ -538,9 +538,9 @@
pop af
ld [hInMenu], a
pop af
- ld [VramState], a
+ ld [wVramState], a
pop af
- ld [Options], a
+ ld [wOptions], a
ret
; e27a2
@@ -574,7 +574,7 @@
call BillsPC_MoveMonWOMail_BoxNameAndArrows
call PCMonInfo
ld a, $ff
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
call WaitBGMap
@@ -640,7 +640,7 @@
ld [hBGMapMode], a
call ClearSprites
call BillsPC_GetSelectedPokemonSpecies
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
ld de, PCString_WhatsUp
@@ -698,7 +698,7 @@
call ExitMenu
call PCMonInfo
call BillsPC_GetSelectedPokemonSpecies
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
call BillsPC_ApplyPalettes
ret
@@ -1092,9 +1092,9 @@
call BillsPC_LoadMonStats
ld a, [wd265]
- ld [CurPartySpecies], a
- ld [CurSpecies], a
- ld hl, TempMonDVs
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
+ ld hl, wTempMonDVs
predef GetUnownLetter
call GetBaseData
ld de, vTiles2 tile $00
@@ -1101,7 +1101,7 @@
predef GetMonFrontpic
xor a
ld [wBillsPC_MonHasMail], a
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
cp EGG
ret z
@@ -1114,7 +1114,7 @@
call PrintLevel
ld a, $3
- ld [MonType], a
+ ld [wMonType], a
farcall GetGender
jr c, .skip_gender
ld a, "♂"
@@ -1125,7 +1125,7 @@
ld [hl], a
.skip_gender
- ld a, [TempMonItem]
+ ld a, [wTempMonItem]
and a
ret z
@@ -1169,7 +1169,7 @@
ld a, e
call AddNTimes
ld a, [hl]
- ld [TempMonLevel], a
+ ld [wTempMonLevel], a
pop hl
push hl
ld bc, sBoxMon1Item - sBox
@@ -1178,7 +1178,7 @@
ld a, e
call AddNTimes
ld a, [hl]
- ld [TempMonItem], a
+ ld [wTempMonItem], a
pop hl
ld bc, sBoxMon1DVs - sBox
add hl, bc
@@ -1185,7 +1185,7 @@
ld bc, BOXMON_STRUCT_LENGTH
ld a, e
call AddNTimes
- ld de, TempMonDVs
+ ld de, wTempMonDVs
ld a, [hli]
ld [de], a
inc de
@@ -1195,23 +1195,23 @@
ret
.party
- ld hl, PartyMon1Level
+ ld hl, wPartyMon1Level
ld bc, PARTYMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld a, [hl]
- ld [TempMonLevel], a
- ld hl, PartyMon1Item
+ ld [wTempMonLevel], a
+ ld hl, wPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
ld a, e
call AddNTimes
ld a, [hl]
- ld [TempMonItem], a
- ld hl, PartyMon1DVs
+ ld [wTempMonItem], a
+ ld hl, wPartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
ld a, e
call AddNTimes
- ld de, TempMonDVs
+ ld de, wTempMonDVs
ld a, [hli]
ld [de], a
inc de
@@ -1227,7 +1227,7 @@
ld a, e
call AddNTimes
ld a, [hl]
- ld [TempMonLevel], a
+ ld [wTempMonLevel], a
ld hl, sBoxMon1Item
ld bc, BOXMON_STRUCT_LENGTH
@@ -1234,13 +1234,13 @@
ld a, e
call AddNTimes
ld a, [hl]
- ld [TempMonItem], a
+ ld [wTempMonItem], a
ld hl, sBoxMon1DVs
ld bc, BOXMON_STRUCT_LENGTH
ld a, e
call AddNTimes
- ld de, TempMonDVs
+ ld de, wTempMonDVs
ld a, [hli]
ld [de], a
inc de
@@ -1334,12 +1334,12 @@
ld bc, MON_NAME_LENGTH
ld a, e
call AddNTimes
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld bc, MON_NAME_LENGTH
call CopyBytes
call CloseSRAM
pop hl
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call PlaceString
ret
@@ -1350,21 +1350,21 @@
.party
push hl
- ld hl, PartySpecies
+ ld hl, wPartySpecies
ld d, $0
add hl, de
ld a, [hl]
and a
jr z, .partyfail
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
ld a, e
call AddNTimes
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld bc, MON_NAME_LENGTH
call CopyBytes
pop hl
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call PlaceString
ret
@@ -1386,12 +1386,12 @@
ld bc, MON_NAME_LENGTH
ld a, e
call AddNTimes
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld bc, MON_NAME_LENGTH
call CopyBytes
call CloseSRAM
pop hl
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call PlaceString
ret
@@ -1465,7 +1465,7 @@
ret
.party
- ld hl, PartySpecies
+ ld hl, wPartySpecies
copy_box_data 0
ret
@@ -1498,7 +1498,7 @@
.place_cursor
ld hl, .OAM
- ld de, Sprite01
+ ld de, wVirtualOAMSprite00
.loop
ld a, [hl]
cp -1
@@ -1548,7 +1548,7 @@
BillsPC_UpdateInsertCursor: ; e2e8c
ld hl, .OAM
- ld de, Sprite01
+ ld de, wVirtualOAMSprite00
.loop
ld a, [hl]
cp -1
@@ -1645,7 +1645,7 @@
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
farcall CheckCurPartyMonFainted
jr c, .AllOthersFainted
ld a, [wBillsPC_MonHasMail]
@@ -1676,7 +1676,7 @@
ret
BillsPC_IsMonAnEgg: ; e2f5f (38:6f5f)
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
and a
@@ -1697,7 +1697,7 @@
call LowVolume
call BillsPC_CopyMon
ld a, $3
- ld [MonType], a
+ ld [wMonType], a
predef StatsScreenInit
call BillsPC_InitGFX
call MaxVolume
@@ -1723,9 +1723,9 @@
ld [wd265], a
call BillsPC_LoadMonStats
ld a, [wd265]
- ld [CurPartySpecies], a
- ld [CurSpecies], a
- ld hl, TempMonDVs
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
+ ld hl, wTempMonDVs
predef GetUnownLetter
call GetBaseData
call BillsPC_CopyMon
@@ -1741,7 +1741,7 @@
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld a, [wBillsPC_LoadedBox]
and a
jr z, .party
@@ -1757,7 +1757,7 @@
call CopyOTNameToTemp
ld hl, sBoxMons
ld bc, BOXMON_STRUCT_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld de, wBufferMon
ld bc, PARTYMON_STRUCT_LENGTH
@@ -1767,15 +1767,15 @@
ret
.party
- ld hl, PartySpecies
+ ld hl, wPartySpecies
call CopySpeciesToTemp
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
call CopyNicknameToTemp
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
call CopyOTNameToTemp
- ld hl, PartyMon1
+ ld hl, wPartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld de, wBufferMon
ld bc, PARTYMON_STRUCT_LENGTH
@@ -1813,9 +1813,9 @@
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
- ld [CurPartyMon], a
- ld hl, PartyMonNicknames
- ld a, [CurPartyMon]
+ ld [wCurPartyMon], a
+ ld hl, wPartyMonNicknames
+ ld a, [wCurPartyMon]
call GetNick
ld a, PC_DEPOSIT
ld [wPokemonWithdrawDepositParameter], a
@@ -1824,7 +1824,7 @@
xor a
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call PlayMonCry
hlcoord 0, 0
lb bc, 15, 8
@@ -1841,7 +1841,7 @@
call PlaceString
ld l, c
ld h, b
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call PlaceString
ld a, "!"
ld [bc], a
@@ -1865,10 +1865,10 @@
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld a, BANK(sBoxMonNicknames)
call GetSRAMBank
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld hl, sBoxMonNicknames
call GetNick
call CloseSRAM
@@ -1879,7 +1879,7 @@
ld a, PC_DEPOSIT
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call PlayMonCry
hlcoord 0, 0
lb bc, 15, 8
@@ -1896,7 +1896,7 @@
call PlaceString
ld l, c
ld h, b
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call PlaceString
ld a, $e7
ld [bc], a
@@ -1929,7 +1929,7 @@
call TextBox
call WaitBGMap
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call GetCryIndex
jr c, .skip_cry
ld e, c
@@ -1937,7 +1937,7 @@
call PlayCry
.skip_cry
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
call GetPokemonName
hlcoord 1, 16
@@ -1954,7 +1954,7 @@
ld l, c
ld h, b
inc hl
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call PlaceString
ld l, c
ld h, b
@@ -2099,7 +2099,7 @@
ld a, [wBillsPC_BackupCursorPosition]
ld hl, wBillsPC_BackupScrollPosition
add [hl]
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld a, BANK(sBox)
call GetSRAMBank
ld hl, sBoxSpecies
@@ -2127,7 +2127,7 @@
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
farcall InsertPokemonIntoBox
ret
; e3316
@@ -2136,14 +2136,14 @@
ld a, [wBillsPC_BackupCursorPosition]
ld hl, wBillsPC_BackupScrollPosition
add [hl]
- ld [CurPartyMon], a
- ld hl, PartySpecies
+ ld [wCurPartyMon], a
+ ld hl, wPartySpecies
call CopySpeciesToTemp
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
call CopyNicknameToTemp
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
call CopyOTNameToTemp
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call CopyMonToTemp
xor a
@@ -2156,23 +2156,23 @@
ld a, [wBillsPC_CursorPosition]
ld hl, wBillsPC_ScrollPosition
add [hl]
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
farcall InsertPokemonIntoParty
ret
; e3357
CopySpeciesToTemp: ; e3357 (38:7357)
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld c, a
ld b, $0
add hl, bc
ld a, [hl]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ret
CopyNicknameToTemp: ; e3363 (38:7363)
ld bc, MON_NAME_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld de, wBufferMonNick
ld bc, MON_NAME_LENGTH
@@ -2181,7 +2181,7 @@
CopyOTNameToTemp: ; e3376 (38:7376)
ld bc, NAME_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld de, wBufferMonOT
ld bc, NAME_LENGTH
@@ -2189,7 +2189,7 @@
ret
CopyMonToTemp: ; e3389 (38:7389)
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld de, wBufferMon
call CopyBytes
@@ -2357,7 +2357,7 @@
.boxnames ; e3619
push de
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
dec a
call GetBoxName
pop hl
@@ -2378,7 +2378,7 @@
hlcoord 11, 7
lb bc, 5, 7
call TextBox
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp -1
ret z
hlcoord 12, 9
@@ -2410,7 +2410,7 @@
GetBoxCount: ; e366c (38:766c)
ld a, [wCurBox]
ld c, a
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
dec a
cp c
jr z, .activebox
@@ -2508,7 +2508,7 @@
jr z, .EmptyBox
ld e, l
ld d, h
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
dec a
ld c, a
farcall PrintPCBox
@@ -2522,7 +2522,7 @@
ret
.Switch:
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
dec a
ld e, a
ld a, [wCurBox]
@@ -2538,7 +2538,7 @@
call ClearTileMap
call LoadStandardFont
call LoadFontsBattleExtra
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
dec a
call GetBoxName
ld e, l
@@ -2546,7 +2546,7 @@
ld hl, wd002
ld c, BOX_NAME_LENGTH - 1
call InitString
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
dec a
call GetBoxName
ld de, wd002
--- a/engine/billspctop.asm
+++ b/engine/billspctop.asm
@@ -6,7 +6,7 @@
jp .LogOut
.CheckCanUsePC: ; e40a (3:640a)
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret nz
ld hl, .Text_GottaHavePokemon
@@ -24,7 +24,7 @@
ld [hBGMapMode], a
call LoadStandardMenuDataHeader
call ClearPCItemScreen
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -31,7 +31,7 @@
ld hl, .Text_What
call PrintText
pop af
- ld [Options], a
+ ld [wOptions], a
call LoadFontsBattleExtra
ret
@@ -58,7 +58,7 @@
jr c, .cancel
ld a, [wMenuCursorBuffer]
push af
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld hl, .Jumptable
rst JumpTable
pop bc
@@ -143,7 +143,7 @@
ret
Unreferenced_Functione512:
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
jr z, .no_pkmn
cp 2
@@ -174,11 +174,11 @@
db "@"
CheckCurPartyMonFainted: ; e538
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
ld de, PARTYMON_STRUCT_LENGTH
ld b, $0
.loop
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
cp b
jr z, .skip
ld a, [hli]
@@ -188,7 +188,7 @@
.skip
inc b
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp b
jr z, .done
add hl, de
@@ -212,7 +212,7 @@
ret
Unreferenced_Functione56d:
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp PARTY_LENGTH
jr nc, .asm_e576
and a
@@ -255,11 +255,11 @@
ret
CopyBoxmonToTempMon: ; e5bb
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld hl, sBoxMon1Species
ld bc, BOXMON_STRUCT_LENGTH
call AddNTimes
- ld de, TempMonSpecies
+ ld de, wTempMonSpecies
ld bc, BOXMON_STRUCT_LENGTH
ld a, BANK(sBoxMon1Species)
call GetSRAMBank
@@ -309,7 +309,7 @@
ld a, [hl]
ld [de], a
inc de
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
pop bc
pop hl
@@ -352,7 +352,7 @@
swap a
or b
ld b, a
- ld a, [BaseGender]
+ ld a, [wBaseGender]
cp b
ld a, $1
jr c, .okay2
--- a/engine/breeding.asm
+++ b/engine/breeding.asm
@@ -3,13 +3,13 @@
ld c, $0
jp nc, .done
ld a, [wBreedMon1Species]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [wBreedMon1DVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wBreedMon1DVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld a, TEMPMON
- ld [MonType], a
+ ld [wMonType], a
predef GetGender
jr c, .genderless
ld b, $1
@@ -19,13 +19,13 @@
.breedmon2
push bc
ld a, [wBreedMon2Species]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [wBreedMon2DVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wBreedMon2DVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld a, $3
- ld [MonType], a
+ ld [wMonType], a
predef GetGender
pop bc
jr c, .genderless
@@ -109,16 +109,16 @@
; If either mon is in the No Eggs group,
; they are not compatible.
ld a, [wBreedMon2Species]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [BaseEggGroups]
+ ld a, [wBaseEggGroups]
cp NO_EGGS * $11
jr z, .Incompatible
ld a, [wBreedMon1Species]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [BaseEggGroups]
+ ld a, [wBaseEggGroups]
cp NO_EGGS * $11
jr z, .Incompatible
@@ -127,9 +127,9 @@
ld a, [wBreedMon2Species]
cp DITTO
jr z, .Compatible
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [BaseEggGroups]
+ ld a, [wBaseEggGroups]
push af
and $f
ld b, a
@@ -141,11 +141,11 @@
ld a, [wBreedMon1Species]
cp DITTO
jr z, .Compatible
- ld [CurSpecies], a
+ ld [wCurSpecies], a
push bc
call GetBaseData
pop bc
- ld a, [BaseEggGroups]
+ ld a, [wBaseEggGroups]
push af
and $f
ld d, a
@@ -176,8 +176,8 @@
; 16f3e
DoEggStep:: ; 16f3e
- ld de, PartySpecies
- ld hl, PartyMon1Happiness
+ ld de, wPartySpecies
+ ld hl, wPartyMon1Happiness
ld c, 0
.loop
ld a, [de]
@@ -210,10 +210,10 @@
; 16f70
HatchEggs: ; 16f70 (5:6f70)
- ld de, PartySpecies
- ld hl, PartyMon1Happiness
+ ld de, wPartySpecies
+ ld hl, wPartyMon1Happiness
xor a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
.loop ; 16f7a (5:6f7a)
ld a, [de]
@@ -233,16 +233,16 @@
farcall SetEggMonCaughtData
farcall StubbedTrainerRankings_EggsHatched
- ld a, [CurPartyMon]
- ld hl, PartyMon1Species
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld a, [hl]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
dec a
call SetSeenAndCaughtMon
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp TOGEPI
jr nz, .nottogepi
; set the event flag for hatching togepi
@@ -253,17 +253,17 @@
pop de
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
dec de
ld [de], a
ld [wd265], a
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetPokemonName
xor a
ld [wd26b], a
call GetBaseData
- ld a, [CurPartyMon]
- ld hl, PartyMon1
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
push hl
@@ -276,7 +276,7 @@
ld bc, MON_LEVEL
add hl, bc
ld a, [hl]
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
pop hl
push hl
ld bc, MON_STATUS
@@ -304,22 +304,22 @@
ld [hl], a
ld hl, MON_ID
add hl, bc
- ld a, [PlayerID]
+ ld a, [wPlayerID]
ld [hli], a
- ld a, [PlayerID + 1]
+ ld a, [wPlayerID + 1]
ld [hl], a
- ld a, [CurPartyMon]
- ld hl, PartyMonOT
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonOT
ld bc, NAME_LENGTH
call AddNTimes
ld d, h
ld e, l
- ld hl, PlayerName
+ ld hl, wPlayerName
call CopyBytes
ld hl, .Text_HatchEgg
call PrintText
- ld a, [CurPartyMon]
- ld hl, PartyMonNicknames
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
call AddNTimes
ld d, h
@@ -334,22 +334,22 @@
ld a, $1
ld [wd26b], a
xor a
- ld [MonType], a
+ ld [wMonType], a
push de
ld b, $0
farcall NamingScreen
pop hl
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call InitName
jr .next
.nonickname
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld bc, MON_NAME_LENGTH
call CopyBytes
.next ; 1707d (5:707d)
- ld hl, CurPartyMon
+ ld hl, wCurPartyMon
inc [hl]
pop hl
ld de, PARTYMON_STRUCT_LENGTH
@@ -365,18 +365,18 @@
; Huh? @ @
text_jump UnknownText_0x1c0db0
start_asm
- ld hl, VramState
+ ld hl, wVramState
res 0, [hl]
push hl
push de
push bc
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
push af
call EggHatch_AnimationSequence
ld hl, .ClearTextbox
call PrintText
pop af
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
pop bc
pop de
pop hl
@@ -580,16 +580,16 @@
ret
.ditto1
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
push af
ld a, [wBreedMon2Species]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [wBreedMon2DVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wBreedMon2DVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld a, TEMPMON
- ld [MonType], a
+ ld [wMonType], a
predef GetGender
jr c, .inherit_mon2_moves
jr nz, .inherit_mon2_moves
@@ -596,16 +596,16 @@
jr .inherit_mon1_moves
.ditto2
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
push af
ld a, [wBreedMon1Species]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [wBreedMon1DVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wBreedMon1DVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld a, TEMPMON
- ld [MonType], a
+ ld [wMonType], a
predef GetGender
jr c, .inherit_mon1_moves
jr nz, .inherit_mon1_moves
@@ -613,13 +613,13 @@
.inherit_mon2_moves
ld hl, wBreedMon2Moves
pop af
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ret
.inherit_mon1_moves
ld hl, wBreedMon1Moves
pop af
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ret
; 1720b
@@ -643,10 +643,10 @@
GetEggFrontpic: ; 17224 (5:7224)
push de
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
call GetBaseData
- ld hl, BattleMonDVs
+ ld hl, wBattleMonDVs
predef GetUnownLetter
pop de
predef_jump GetMonFrontpic
@@ -653,10 +653,10 @@
GetHatchlingFrontpic: ; 1723c (5:723c)
push de
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
call GetBaseData
- ld hl, BattleMonDVs
+ ld hl, wBattleMonDVs
predef GetUnownLetter
pop de
predef_jump GetAnimatedFrontpic
@@ -697,7 +697,7 @@
EggHatch_AnimationSequence: ; 1728f (5:728f)
ld a, [wd265]
ld [wJumptableIndex], a
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
push af
ld de, MUSIC_NONE
call PlayMusic
@@ -775,17 +775,17 @@
call Hatch_ShellFragmentLoop
call WaitSFX
ld a, [wJumptableIndex]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
hlcoord 6, 3
ld d, $0
ld e, ANIM_MON_HATCH
predef AnimateFrontpic
pop af
- ld [CurSpecies], a
+ ld [wCurSpecies], a
ret
Hatch_LoadFrontpicPal: ; 17363 (5:7363)
- ld [PlayerHPPal], a
+ ld [wPlayerHPPal], a
ld b, SCGB_EVOLUTION
ld c, $0
jp GetSGBLayout
@@ -931,7 +931,7 @@
DayCareMonCompatibilityText: ; 1746c
push bc
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld bc, NAME_LENGTH
call CopyBytes
call CheckBreedmonCompatibility
--- a/engine/buy_sell_toss.asm
+++ b/engine/buy_sell_toss.asm
@@ -9,9 +9,9 @@
farcall GetItemPrice
RooftopSale_SelectQuantityToBuy: ; 24fcf
ld a, d
- ld [Buffer1], a
+ ld [wBuffer1], a
ld a, e
- ld [Buffer2], a
+ ld [wBuffer2], a
ld hl, BuyItem_MenuDataHeader
call LoadMenuDataHeader
call Toss_Sell_Loop
@@ -21,9 +21,9 @@
SelectQuantityToSell: ; 24fe1
farcall GetItemPrice
ld a, d
- ld [Buffer1], a
+ ld [wBuffer1], a
ld a, e
- ld [Buffer2], a
+ ld [wBuffer2], a
ld hl, SellItem_MenuDataHeader
call LoadMenuDataHeader
call Toss_Sell_Loop
@@ -167,9 +167,9 @@
BuySell_MultiplyPrice: ; 250a9
xor a
ld [hMultiplicand + 0], a
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld [hMultiplicand + 1], a
- ld a, [Buffer2]
+ ld a, [wBuffer2]
ld [hMultiplicand + 2], a
ld a, [wItemQuantityChangeBuffer]
ld [hMultiplier], a
--- a/engine/card_flip.asm
+++ b/engine/card_flip.asm
@@ -11,7 +11,7 @@
ret
_CardFlip: ; e00ee (38:40ee)
- ld hl, Options
+ ld hl, wOptions
set 4, [hl]
call ClearBGPalettes
call ClearTileMap
@@ -70,7 +70,7 @@
call PlaySFX
call WaitSFX
call ClearBGPalettes
- ld hl, Options
+ ld hl, wOptions
res 4, [hl]
ret
@@ -126,9 +126,9 @@
; 0xe01d2
.DeductCoins: ; e01d2
- ld a, [Coins]
+ ld a, [wCoins]
ld h, a
- ld a, [Coins + 1]
+ ld a, [wCoins + 1]
ld l, a
ld a, h
and a
@@ -146,9 +146,9 @@
ld de, -3
add hl, de
ld a, h
- ld [Coins], a
+ ld [wCoins], a
ld a, l
- ld [Coins + 1], a
+ ld [wCoins + 1], a
ld de, SFX_TRANSACTION
call PlaySFX
xor a
@@ -485,7 +485,7 @@
ret z
; Set the attributes
- ld de, AttrMap - TileMap
+ ld de, wAttrMap - wTileMap
add hl, de
ld a, [wCardFlipFaceUpCard]
and 3
@@ -535,7 +535,7 @@
ld de, .CoinStr
call PlaceString
hlcoord 15, 16
- ld de, Coins
+ ld de, wCoins
lb bc, PRINTNUM_LEADINGZEROS | 2, 4
call PrintNum
ret
@@ -601,7 +601,7 @@
; e0509 (38:4509)
CardFlip_CopyOAM: ; e0509
- ld de, Sprite01
+ ld de, wVirtualOAMSprite00
ld a, [hli]
.loop
push af
@@ -1174,15 +1174,15 @@
; 0xe081b
.AddCoinPlaySFX: ; e081b
- ld a, [Coins]
+ ld a, [wCoins]
ld h, a
- ld a, [Coins + 1]
+ ld a, [wCoins + 1]
ld l, a
inc hl
ld a, h
- ld [Coins], a
+ ld [wCoins], a
ld a, l
- ld [Coins + 1], a
+ ld [wCoins + 1], a
ld de, SFX_PAY_DAY
call PlaySFX
ret
@@ -1189,7 +1189,7 @@
; e0833
.IsCoinCaseFull: ; e0833
- ld a, [Coins]
+ ld a, [wCoins]
cp HIGH(MAX_COINS)
jr c, .less
jr z, .check_low
@@ -1196,7 +1196,7 @@
jr .more
.check_low
- ld a, [Coins + 1]
+ ld a, [wCoins + 1]
cp LOW(MAX_COINS)
jr c, .less
@@ -1625,32 +1625,32 @@
and a
ret z
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
xor a
call ByteFill
- hlcoord 12, 1, AttrMap
+ hlcoord 12, 1, wAttrMap
lb bc, 2, 2
ld a, $1
call CardFlip_FillBox
- hlcoord 14, 1, AttrMap
+ hlcoord 14, 1, wAttrMap
lb bc, 2, 2
ld a, $2
call CardFlip_FillBox
- hlcoord 16, 1, AttrMap
+ hlcoord 16, 1, wAttrMap
lb bc, 2, 2
ld a, $3
call CardFlip_FillBox
- hlcoord 18, 1, AttrMap
+ hlcoord 18, 1, wAttrMap
lb bc, 2, 2
ld a, $4
call CardFlip_FillBox
- hlcoord 9, 0, AttrMap
+ hlcoord 9, 0, wAttrMap
lb bc, 12, 1
ld a, $1
call CardFlip_FillBox
--- a/engine/caught_data.asm
+++ b/engine/caught_data.asm
@@ -2,10 +2,10 @@
ld a, [wContestMon]
and a
jp z, .DidntCatchAnything
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
call GetBaseData
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [hl]
cp PARTY_LENGTH
jp nc, .TryAddToBox
@@ -16,11 +16,11 @@
add hl, bc
ld a, [wContestMon]
ld [hli], a
- ld [CurSpecies], a
+ ld [wCurSpecies], a
ld a, -1
ld [hl], a
- ld hl, PartyMon1Species
- ld a, [PartyCount]
+ ld hl, wPartyMon1Species
+ ld a, [wPartyCount]
dec a
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
@@ -29,50 +29,50 @@
ld hl, wContestMon
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
call SkipNames
ld d, h
ld e, l
- ld hl, PlayerName
+ ld hl, wPlayerName
call CopyBytes
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
call GetPokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wMonOrItemNameBuffer
ld bc, MON_NAME_LENGTH
call CopyBytes
call GiveANickname_YesNo
jr c, .Party_SkipNickname
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
xor a
- ld [MonType], a
+ ld [wMonType], a
ld de, wMonOrItemNameBuffer
callfar InitNickname
.Party_SkipNickname:
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
call SkipNames
ld d, h
ld e, l
ld hl, wMonOrItemNameBuffer
call CopyBytes
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1Level
+ ld hl, wPartyMon1Level
call GetPartyLocation
ld a, [hl]
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
call SetCaughtData
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1CaughtLocation
+ ld hl, wPartyMon1CaughtLocation
call GetPartyLocation
ld a, [hl]
and CAUGHT_GENDER_MASK
@@ -82,7 +82,7 @@
xor a
ld [wContestMon], a
and a ; BUGCONTEST_CAUGHT_MON
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.TryAddToBox: ; 4daa3
@@ -94,24 +94,24 @@
call CloseSRAM
jr nc, .BoxFull
xor a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld hl, wContestMon
ld de, wBufferMon
ld bc, BOXMON_STRUCT_LENGTH
call CopyBytes
- ld hl, PlayerName
+ ld hl, wPlayerName
ld de, wBufferMonOT
ld bc, NAME_LENGTH
call CopyBytes
callfar InsertPokemonIntoBox
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
call GetPokemonName
call GiveANickname_YesNo
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
jr c, .Box_SkipNickname
ld a, BOXMON
- ld [MonType], a
+ ld [wMonType], a
ld de, wMonOrItemNameBuffer
callfar InitNickname
ld hl, wMonOrItemNameBuffer
@@ -128,7 +128,7 @@
ld a, BANK(sBoxMon1Level)
call GetSRAMBank
ld a, [sBoxMon1Level]
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
call CloseSRAM
call SetBoxMonCaughtData
ld a, BANK(sBoxMon1CaughtLocation)
@@ -143,12 +143,12 @@
xor a
ld [wContestMon], a
ld a, BUGCONTEST_BOXED_MON
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.DidntCatchAnything: ; 4db35
ld a, BUGCONTEST_NO_CATCH
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
GiveANickname_YesNo: ; 4db3b
@@ -162,22 +162,22 @@
db "@"
SetCaughtData: ; 4db49
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1CaughtLevel
+ ld hl, wPartyMon1CaughtLevel
call GetPartyLocation
SetBoxmonOrEggmonCaughtData: ; 4db53
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
inc a
rrca
rrca
ld b, a
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
or b
ld [hli], a
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
cp MAP_POKECENTER_2F
jr nz, .NotPokecenter2F
@@ -185,9 +185,9 @@
cp GROUP_POKECENTER_2F
jr nz, .NotPokecenter2F
- ld a, [BackupMapGroup]
+ ld a, [wBackupMapGroup]
ld b, a
- ld a, [BackupMapNumber]
+ ld a, [wBackupMapNumber]
ld c, a
.NotPokecenter2F:
@@ -218,9 +218,9 @@
ret
SetGiftPartyMonCaughtData: ; 4dba3
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1CaughtLevel
+ ld hl, wPartyMon1CaughtLevel
push bc
call GetPartyLocation
pop bc
@@ -234,14 +234,14 @@
ret
SetEggMonCaughtData: ; 4dbb8 (13:5bb8)
- ld a, [CurPartyMon]
- ld hl, PartyMon1CaughtLevel
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1CaughtLevel
call GetPartyLocation
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
push af
ld a, CAUGHT_EGG_LEVEL
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
call SetBoxmonOrEggmonCaughtData
pop af
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ret
--- a/engine/cgb_layouts.asm
+++ b/engine/cgb_layouts.asm
@@ -10,7 +10,7 @@
ld a, b
cp SCGB_RAM
jr nz, .not_ram
- ld a, [SGBPredef]
+ ld a, [wSGBPredef]
.not_ram
cp SCGB_PARTY_MENU_HP_PALS
jp z, CGB_ApplyPartyMenuHPPals
@@ -89,7 +89,7 @@
call GetEnemyFrontpicPalettePointer
push hl
call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_BG_ENEMY
- ld a, [EnemyHPPal]
+ ld a, [wEnemyHPPal]
ld l, a
ld h, $0
add hl, hl
@@ -97,7 +97,7 @@
ld bc, HPBarPals
add hl, bc
call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_BG_ENEMY_HP
- ld a, [PlayerHPPal]
+ ld a, [wPlayerHPPal]
ld l, a
ld h, $0
add hl, hl
@@ -113,35 +113,35 @@
pop hl
call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_OB_PLAYER
ld a, SCGB_BATTLE_COLORS
- ld [SGBPredef], a
+ ld [wSGBPredef], a
call ApplyPals
_CGB_FinishBattleScreenLayout: ; 8e23
call InitPartyMenuBGPal7
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, PAL_BATTLE_BG_ENEMY_HP
call ByteFill
- hlcoord 0, 4, AttrMap
+ hlcoord 0, 4, wAttrMap
lb bc, 8, 10
ld a, PAL_BATTLE_BG_PLAYER
call FillBoxCGB
- hlcoord 10, 0, AttrMap
+ hlcoord 10, 0, wAttrMap
lb bc, 7, 10
ld a, PAL_BATTLE_BG_ENEMY
call FillBoxCGB
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
lb bc, 4, 10
ld a, PAL_BATTLE_BG_ENEMY_HP
call FillBoxCGB
- hlcoord 10, 7, AttrMap
+ hlcoord 10, 7, wAttrMap
lb bc, 5, 10
ld a, PAL_BATTLE_BG_PLAYER_HP
call FillBoxCGB
- hlcoord 10, 11, AttrMap
+ hlcoord 10, 11, wAttrMap
lb bc, 1, 9
ld a, PAL_BATTLE_BG_EXP
call FillBoxCGB
- hlcoord 0, 12, AttrMap
+ hlcoord 0, 12, wAttrMap
ld bc, 6 * SCREEN_WIDTH
ld a, PAL_BATTLE_BG_TEXT
call ByteFill
@@ -212,8 +212,8 @@
ld bc, HPBarPals
add hl, bc
call LoadPalette_White_Col1_Col2_Black ; hp palette
- ld a, [CurPartySpecies]
- ld bc, TempMonDVs
+ ld a, [wCurPartySpecies]
+ ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
call LoadPalette_White_Col1_Col2_Black ; mon palette
ld hl, ExpBarPalette
@@ -225,27 +225,27 @@
call FarCopyWRAM
call WipeAttrMap
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
lb bc, 8, SCREEN_WIDTH
ld a, $1 ; mon palette
call FillBoxCGB
- hlcoord 10, 16, AttrMap
+ hlcoord 10, 16, wAttrMap
ld bc, 10
ld a, $2 ; exp palette
call ByteFill
- hlcoord 13, 5, AttrMap
+ hlcoord 13, 5, wAttrMap
lb bc, 2, 2
ld a, $3 ; pink page palette
call FillBoxCGB
- hlcoord 15, 5, AttrMap
+ hlcoord 15, 5, wAttrMap
lb bc, 2, 2
ld a, $4 ; green page palette
call FillBoxCGB
- hlcoord 17, 5, AttrMap
+ hlcoord 17, 5, wAttrMap
lb bc, 2, 2
ld a, $5 ; blue page palette
call FillBoxCGB
@@ -270,7 +270,7 @@
ld a, PREDEFPAL_POKEDEX
call GetPredefPal
call LoadHLPaletteIntoDE ; dex interface palette
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp $ff
jr nz, .is_pokemon
ld hl, .PokedexQuestionMarkPalette
@@ -282,7 +282,7 @@
call LoadPalette_White_Col1_Col2_Black ; mon palette
.got_palette
call WipeAttrMap
- hlcoord 1, 1, AttrMap
+ hlcoord 1, 1, wAttrMap
lb bc, 7, 7
ld a, $1 ; green question mark palette
call FillBoxCGB
@@ -312,7 +312,7 @@
ld a, PREDEFPAL_POKEDEX
call GetPredefPal
call LoadHLPaletteIntoDE
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp $ff
jr nz, .GetMonPalette
ld hl, .BillsPCOrangePalette
@@ -320,12 +320,12 @@
jr .Resume
.GetMonPalette:
- ld bc, TempMonDVs
+ ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
call LoadPalette_White_Col1_Col2_Black
.Resume:
call WipeAttrMap
- hlcoord 1, 4, AttrMap
+ hlcoord 1, 4, wAttrMap
lb bc, 7, 7
ld a, $1
call FillBoxCGB
@@ -343,12 +343,12 @@
jr .asm_901a
.unused
- ld bc, TempMonDVs
+ ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
call LoadPalette_White_Col1_Col2_Black
.asm_901a
call WipeAttrMap
- hlcoord 1, 1, AttrMap
+ hlcoord 1, 1, wAttrMap
lb bc, 7, 7
ld a, $1
call FillBoxCGB
@@ -369,11 +369,11 @@
ld a, PREDEFPAL_POKEDEX
call GetPredefPal
call LoadHLPaletteIntoDE
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call GetMonPalettePointer_
call LoadPalette_White_Col1_Col2_Black
call WipeAttrMap
- hlcoord 7, 5, AttrMap
+ hlcoord 7, 5, wAttrMap
lb bc, 7, 7
ld a, $1
call FillBoxCGB
@@ -392,43 +392,43 @@
ld a, BANK(wBGPals1)
call FarCopyWRAM
call WipeAttrMap
- hlcoord 0, 2, AttrMap
+ hlcoord 0, 2, wAttrMap
lb bc, 10, 3
ld a, $2
call FillBoxCGB
- hlcoord 17, 2, AttrMap
+ hlcoord 17, 2, wAttrMap
lb bc, 10, 3
ld a, $2
call FillBoxCGB
- hlcoord 0, 4, AttrMap
+ hlcoord 0, 4, wAttrMap
lb bc, 6, 3
ld a, $3
call FillBoxCGB
- hlcoord 17, 4, AttrMap
+ hlcoord 17, 4, wAttrMap
lb bc, 6, 3
ld a, $3
call FillBoxCGB
- hlcoord 0, 6, AttrMap
+ hlcoord 0, 6, wAttrMap
lb bc, 2, 3
ld a, $4
call FillBoxCGB
- hlcoord 17, 6, AttrMap
+ hlcoord 17, 6, wAttrMap
lb bc, 2, 3
ld a, $4
call FillBoxCGB
- hlcoord 4, 2, AttrMap
+ hlcoord 4, 2, wAttrMap
lb bc, 2, 12
ld a, $1
call FillBoxCGB
- hlcoord 3, 2, AttrMap
+ hlcoord 3, 2, wAttrMap
lb bc, 10, 1
ld a, $1
call FillBoxCGB
- hlcoord 16, 2, AttrMap
+ hlcoord 16, 2, wAttrMap
lb bc, 10, 1
ld a, $1
call FillBoxCGB
- hlcoord 0, 12, AttrMap
+ hlcoord 0, 12, wAttrMap
ld bc, $78
ld a, $7
call ByteFill
@@ -447,7 +447,7 @@
ld a, PREDEFPAL_PACK
call GetPredefPal
call LoadHLPaletteIntoDE
- hlcoord 0, 6, AttrMap
+ hlcoord 0, 6, wAttrMap
lb bc, 12, SCREEN_WIDTH
ld a, $1
call FillBoxCGB
@@ -560,7 +560,7 @@
_CGB_MapPals: ; 91c8
call LoadMapPals
ld a, SCGB_MAPPALS
- ld [SGBPredef], a
+ ld [wSGBPredef], a
ret
; 91d1
@@ -585,13 +585,13 @@
jr .got_palette
.pokemon
- ld hl, PartyMon1DVs
+ ld hl, wPartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld c, l
ld b, h
- ld a, [PlayerHPPal]
+ ld a, [wPlayerHPPal]
call GetPlayerOrMonPalettePointer
call LoadPalette_White_Col1_Col2_Black
ld hl, BattleObjectPals
@@ -621,7 +621,7 @@
ld a, BANK(wOBPals1)
call FarCopyWRAM
ld a, SCGB_DIPLOMA
- ld [SGBPredef], a
+ ld [wSGBPredef], a
call ApplyPals
ld a, $1
ld [hCGBPalUpdate], a
@@ -690,7 +690,7 @@
call LoadHLPaletteIntoDE
; fill screen with opposite-gender palette for the card border
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, [wPlayerGender]
and a
@@ -700,7 +700,7 @@
.got_gender
call ByteFill
; fill trainer sprite area with same-gender palette
- hlcoord 14, 1, AttrMap
+ hlcoord 14, 1, wAttrMap
lb bc, 7, 5
ld a, [wPlayerGender]
and a
@@ -710,33 +710,33 @@
.got_gender2
call FillBoxCGB
; top-right corner still uses the border's palette
- hlcoord 18, 1, AttrMap
+ hlcoord 18, 1, wAttrMap
ld [hl], $1
- hlcoord 2, 11, AttrMap
+ hlcoord 2, 11, wAttrMap
lb bc, 2, 4
ld a, $1 ; falkner
call FillBoxCGB
- hlcoord 6, 11, AttrMap
+ hlcoord 6, 11, wAttrMap
lb bc, 2, 4
ld a, $2 ; bugsy
call FillBoxCGB
- hlcoord 10, 11, AttrMap
+ hlcoord 10, 11, wAttrMap
lb bc, 2, 4
ld a, $3 ; whitney
call FillBoxCGB
- hlcoord 14, 11, AttrMap
+ hlcoord 14, 11, wAttrMap
lb bc, 2, 4
ld a, $4 ; morty
call FillBoxCGB
- hlcoord 2, 14, AttrMap
+ hlcoord 2, 14, wAttrMap
lb bc, 2, 4
ld a, $5 ; chuck
call FillBoxCGB
- hlcoord 6, 14, AttrMap
+ hlcoord 6, 14, wAttrMap
lb bc, 2, 4
ld a, $6 ; jasmine
call FillBoxCGB
- hlcoord 10, 14, AttrMap
+ hlcoord 10, 14, wAttrMap
lb bc, 2, 4
ld a, $7 ; pryce
call FillBoxCGB
@@ -745,7 +745,7 @@
and a
push af
jr z, .got_gender3
- hlcoord 14, 14, AttrMap
+ hlcoord 14, 14, wAttrMap
lb bc, 2, 4
ld a, $1
call FillBoxCGB
@@ -756,7 +756,7 @@
inc c
.got_gender4
ld a, c
- hlcoord 18, 1, AttrMap
+ hlcoord 18, 1, wAttrMap
ld [hl], a
call ApplyAttrMap
call ApplyPals
@@ -770,7 +770,7 @@
ld a, PREDEFPAL_GOLDENROD
call GetPredefPal
call LoadHLPaletteIntoDE
- ld a, [PlayerHPPal]
+ ld a, [wPlayerHPPal]
ld l, a
ld h, 0
add hl, hl
@@ -779,7 +779,7 @@
add hl, bc
call LoadPalette_White_Col1_Col2_Black
call WipeAttrMap
- hlcoord 11, 1, AttrMap
+ hlcoord 11, 1, wAttrMap
lb bc, 2, 9
ld a, $1
call FillBoxCGB
@@ -816,7 +816,7 @@
_CGB_PackPals: ; 93d3
; pack pals
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
jr z, .tutorial_male
@@ -836,23 +836,23 @@
ld a, BANK(wBGPals1)
call FarCopyWRAM
call WipeAttrMap
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
lb bc, 1, 10
ld a, $1
call FillBoxCGB
- hlcoord 10, 0, AttrMap
+ hlcoord 10, 0, wAttrMap
lb bc, 1, 10
ld a, $2
call FillBoxCGB
- hlcoord 7, 2, AttrMap
+ hlcoord 7, 2, wAttrMap
lb bc, 9, 1
ld a, $3
call FillBoxCGB
- hlcoord 0, 7, AttrMap
+ hlcoord 0, 7, wAttrMap
lb bc, 3, 5
ld a, $4
call FillBoxCGB
- hlcoord 0, 3, AttrMap
+ hlcoord 0, 3, wAttrMap
lb bc, 3, 5
ld a, $5
call FillBoxCGB
@@ -874,7 +874,7 @@
_CGB_Pokepic: ; 9499
call _CGB_MapPals
ld de, SCREEN_WIDTH
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld a, [wMenuBorderTopCoord]
.loop
and a
@@ -910,11 +910,11 @@
ld hl, PalPacket_SCGB_13 + 1
call CopyFourPalettes
call WipeAttrMap
- hlcoord 0, 4, AttrMap
+ hlcoord 0, 4, wAttrMap
lb bc, 10, SCREEN_WIDTH
ld a, $2
call FillBoxCGB
- hlcoord 0, 6, AttrMap
+ hlcoord 0, 6, wAttrMap
lb bc, 6, SCREEN_WIDTH
ld a, $1
call FillBoxCGB
@@ -948,8 +948,8 @@
_CGB_PlayerOrMonFrontpicPals: ; 9529
ld de, wBGPals1
- ld a, [CurPartySpecies]
- ld bc, TempMonDVs
+ ld a, [wCurPartySpecies]
+ ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
call LoadPalette_White_Col1_Col2_Black
call WipeAttrMap
@@ -960,7 +960,7 @@
_CGB1e: ; 9542
ld de, wBGPals1
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call GetMonPalettePointer_
call LoadPalette_White_Col1_Col2_Black
call WipeAttrMap
@@ -986,8 +986,8 @@
_CGB_TrainerOrMonFrontpicPals: ; 9578
ld de, wBGPals1
- ld a, [CurPartySpecies]
- ld bc, TempMonDVs
+ ld a, [wCurPartySpecies]
+ ld bc, wTempMonDVs
call GetFrontpicPalettePointer
call LoadPalette_White_Col1_Col2_Black
call WipeAttrMap
@@ -1004,23 +1004,23 @@
call FarCopyWRAM
call ApplyPals
call WipeAttrMap
- hlcoord 3, 7, AttrMap
+ hlcoord 3, 7, wAttrMap
lb bc, 8, 14
ld a, $1
call FillBoxCGB
- hlcoord 1, 5, AttrMap
+ hlcoord 1, 5, wAttrMap
lb bc, 1, 18
ld a, $1
call FillBoxCGB
- hlcoord 1, 16, AttrMap
+ hlcoord 1, 16, wAttrMap
lb bc, 1, 18
ld a, $1
call FillBoxCGB
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
lb bc, 17, 2
ld a, $1
call FillBoxCGB
- hlcoord 18, 5, AttrMap
+ hlcoord 18, 5, wAttrMap
lb bc, 12, 1
ld a, $1
call FillBoxCGB
--- a/engine/clock_reset.asm
+++ b/engine/clock_reset.asm
@@ -20,13 +20,13 @@
; 20015 (8:4015)
.WrapAroundTimes: ; 20015
- dw Buffer4
+ dw wBuffer4
db 7, 4
- dw Buffer5
+ dw wBuffer5
db 24, 12
- dw Buffer6
+ dw wBuffer6
db 60, 15
; 20021
@@ -34,7 +34,7 @@
; If we're here, we had an RTC overflow.
ld hl, .Text_ClockTimeMayBeWrong
call PrintText
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -45,7 +45,7 @@
call .SetClock
call ExitMenu
pop bc
- ld hl, Options
+ ld hl, wOptions
ld [hl], b
ld c, a
ret
@@ -65,17 +65,17 @@
.SetClock: ; 20051 (8:4051)
ld a, 1
- ld [Buffer1], a ; which digit
- ld [Buffer2], a
+ ld [wBuffer1], a ; which digit
+ ld [wBuffer2], a
ld a, 8
- ld [Buffer3], a
+ ld [wBuffer3], a
call UpdateTime
call GetWeekday
- ld [Buffer4], a
+ ld [wBuffer4], a
ld a, [hHours]
- ld [Buffer5], a
+ ld [wBuffer5], a
ld a, [hMinutes]
- ld [Buffer6], a
+ ld [wBuffer6], a
.loop
call .joy_loop
@@ -87,14 +87,14 @@
call PrintText
call YesNoBox
jr c, .cancel
- ld a, [Buffer4]
- ld [StringBuffer2], a
- ld a, [Buffer5]
- ld [StringBuffer2 + 1], a
- ld a, [Buffer6]
- ld [StringBuffer2 + 2], a
+ ld a, [wBuffer4]
+ ld [wStringBuffer2], a
+ ld a, [wBuffer5]
+ ld [wStringBuffer2 + 1], a
+ ld a, [wBuffer6]
+ ld [wStringBuffer2 + 2], a
xor a
- ld [StringBuffer2 + 3], a
+ ld [wStringBuffer2 + 3], a
call InitTime
call .PrintTime
ld hl, .Text_ClockReset
@@ -151,7 +151,7 @@
ret
.pressed_up
- ld a, [Buffer1]
+ ld a, [wBuffer1]
call ResetClock_GetWraparoundTime
ld a, [de]
inc a
@@ -163,7 +163,7 @@
jr .done_scroll
.pressed_down
- ld a, [Buffer1]
+ ld a, [wBuffer1]
call ResetClock_GetWraparoundTime
ld a, [de]
dec a
@@ -176,7 +176,7 @@
jr .done_scroll
.pressed_left
- ld hl, Buffer1
+ ld hl, wBuffer1
dec [hl]
jr nz, .done_scroll
ld [hl], $3
@@ -183,7 +183,7 @@
jr .done_scroll
.pressed_right
- ld hl, Buffer1
+ ld hl, wBuffer1
inc [hl]
ld a, [hl]
cp $4
@@ -200,29 +200,29 @@
ld c, 18
call TextBox
decoord 1, 8
- ld a, [Buffer4]
+ ld a, [wBuffer4]
ld b, a
farcall PrintDayOfWeek
- ld a, [Buffer5]
+ ld a, [wBuffer5]
ld b, a
- ld a, [Buffer6]
+ ld a, [wBuffer6]
ld c, a
decoord 11, 8
farcall PrintHoursMins
- ld a, [Buffer2]
+ ld a, [wBuffer2]
lb de, " ", " "
call .PlaceChars
- ld a, [Buffer1]
+ ld a, [wBuffer1]
lb de, "▲", "▼"
call .PlaceChars
- ld a, [Buffer1]
- ld [Buffer2], a
+ ld a, [wBuffer1]
+ ld [wBuffer2], a
ret
; 20160 (8:4160)
; unused
.unreferenced ; 20160
- ld a, [Buffer3]
+ ld a, [wBuffer3]
ld b, a
call Coord2Tile
ret
@@ -231,7 +231,7 @@
.PlaceChars: ; 20168 (8:4168)
push de
call ResetClock_GetWraparoundTime
- ld a, [Buffer3]
+ ld a, [wBuffer3]
dec a
ld b, a
call Coord2Tile
--- a/engine/color.asm
+++ b/engine/color.asm
@@ -239,13 +239,13 @@
ret
LoadTrainerClassPaletteAsNthBGPal:
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
call GetTrainerPalettePointer
ld a, e
jr got_palette_pointer_8bd7
LoadMonPaletteAsNthBGPal:
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call GetMonPalettePointer
ld a, e
bit 7, a
@@ -278,14 +278,14 @@
ld a, [hCGB]
and a
jr nz, .cgb
- ld hl, PlayerLightScreenCount
+ ld hl, wPlayerLightScreenCount
jp PushSGBPals_
.cgb
- ld a, [EnemyLightScreenCount] ; col
+ ld a, [wEnemyLightScreenCount] ; col
ld c, a
- ld a, [EnemyReflectCount] ; row
- hlcoord 0, 0, AttrMap
+ ld a, [wEnemyReflectCount] ; row
+ hlcoord 0, 0, wAttrMap
ld de, SCREEN_WIDTH
.loop
and a
@@ -298,7 +298,7 @@
ld b, $0
add hl, bc
lb bc, 6, 4
- ld a, [EnemySafeguardCount] ; value
+ ld a, [wEnemySafeguardCount] ; value
and $3
call FillBoxCGB
call CopyTilemapAtOnce
@@ -310,12 +310,12 @@
ld a, e
and a
jr z, .get_trainer
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call GetMonPalettePointer_
jr .load_palettes
.get_trainer
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
call GetTrainerPalettePointer
.load_palettes
@@ -360,9 +360,9 @@
.PartyMenu:
ld e, c
inc e
- hlcoord 11, 1, AttrMap
+ hlcoord 11, 1, wAttrMap
ld bc, 2 * SCREEN_WIDTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
.loop
and a
jr z, .done
@@ -592,7 +592,7 @@
ret
WipeAttrMap:
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a
call ByteFill
@@ -602,7 +602,7 @@
ld hl, wBGPals1
ld de, wBGPals2
ld bc, 16 palettes
- ld a, BANK(wPals)
+ ld a, BANK(wGBCPalettes)
call FarCopyWRAM
ret
@@ -623,7 +623,7 @@
ret
.UpdateVBank1:
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
debgcoord 0, 0
ld b, SCREEN_HEIGHT
ld a, $1
@@ -660,7 +660,7 @@
ld a, [de]
inc a
ld e, a
- hlcoord 11, 2, AttrMap
+ hlcoord 11, 2, wAttrMap
ld bc, 2 * SCREEN_WIDTH
ld a, [wSGBPals]
.loop
@@ -688,7 +688,7 @@
farcall GetPartyMonDVs
ld c, l
ld b, h
- ld a, [TempBattleMonSpecies]
+ ld a, [wTempBattleMonSpecies]
call GetPlayerOrMonPalettePointer
pop de
ret
@@ -698,7 +698,7 @@
farcall GetEnemyMonDVs
ld c, l
ld b, h
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
call GetFrontpicPalettePointer
pop de
ret
@@ -716,13 +716,13 @@
ret
.male
- ld hl, PlayerPalette
+ ld hl, wPlayerPalette
ret
GetFrontpicPalettePointer:
and a
jp nz, GetMonNormalOrShinyPalettePointer
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
GetTrainerPalettePointer:
ld l, a
@@ -1230,7 +1230,7 @@
ld h, [hl]
ld l, a
; Futher refine by time of day
- ld a, [TimeOfDayPal]
+ ld a, [wTimeOfDayPal]
maskbits NUM_DAYTIMES
add a
add a
@@ -1276,7 +1276,7 @@
ld [rSVBK], a
.got_pals
- ld a, [TimeOfDayPal]
+ ld a, [wTimeOfDayPal]
maskbits NUM_DAYTIMES
ld bc, 8 palettes
ld hl, MapObjectPals
@@ -1292,7 +1292,7 @@
cp ROUTE
ret nz
.outside
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld l, a
ld h, 0
add hl, hl
@@ -1300,7 +1300,7 @@
add hl, hl
ld de, RoofPals
add hl, de
- ld a, [TimeOfDayPal]
+ ld a, [wTimeOfDayPal]
maskbits NUM_DAYTIMES
cp NITE_F
jr c, .morn_day
--- a/engine/credits.asm
+++ b/engine/credits.asm
@@ -13,7 +13,7 @@
ld a, [rSVBK]
push af
- ld a, BANK(wPals)
+ ld a, BANK(wGBCPalettes)
ld [rSVBK], a
call ClearBGPalettes
@@ -63,7 +63,7 @@
xor a
ld [wCreditsLYOverride], a
- ld hl, LYOverrides
+ ld hl, wLYOverrides
ld bc, $100
xor a
call ByteFill
@@ -81,9 +81,9 @@
ld [hInMenu], a
xor a
ld [hBGMapMode], a
- ld [CreditsPos], a
- ld [CreditsUnusedCD21], a
- ld [CreditsTimer], a
+ ld [wCreditsPos], a
+ ld [wCreditsUnusedCD21], a
+ ld [wCreditsTimer], a
.execution_loop
call Credits_HandleBButton
@@ -122,7 +122,7 @@
ld a, [wJumptableIndex]
bit 6, a
ret z
- ld hl, CreditsPos
+ ld hl, wCreditsPos
ld a, [hli]
cp $d
jr nc, .okay
@@ -130,7 +130,7 @@
and a
ret z
.okay
- ld hl, CreditsTimer
+ ld hl, wCreditsTimer
ld a, [hl]
and a
ret z
@@ -187,13 +187,13 @@
Credits_UpdateGFXRequestPath: ; 109964 (42:5964)
call Credits_LoadBorderGFX
ld a, l
- ld [Requested2bppSource], a
+ ld [wRequested2bppSource], a
ld a, h
- ld [Requested2bppSource + 1], a
+ ld [wRequested2bppSource + 1], a
ld a, LOW(vTiles2)
- ld [Requested2bppDest], a
+ ld [wRequested2bppDest], a
ld a, HIGH(vTiles2)
- ld [Requested2bppDest + 1], a
+ ld [wRequested2bppDest + 1], a
jr Credits_RequestGFX
Credits_RequestGFX: ; 10997b (42:597b)
@@ -200,7 +200,7 @@
xor a
ld [hBGMapMode], a
ld a, $8
- ld [Requested2bpp], a
+ ld [wRequested2bpp], a
jp Credits_Next
Credits_LYOverride: ; 109986 (42:5986)
@@ -211,9 +211,9 @@
dec a
dec a
ld [wCreditsLYOverride], a
- ld hl, LYOverrides + $1f
+ ld hl, wLYOverrides + $1f
call .Fill
- ld hl, LYOverrides + $87
+ ld hl, wLYOverrides + $87
call .Fill
jp Credits_Next
@@ -233,7 +233,7 @@
jp nz, .done
; Wait until the timer has run out to parse the next command.
- ld hl, CreditsTimer
+ ld hl, wCreditsTimer
ld a, [hl]
and a
jr z, .parse
@@ -349,13 +349,13 @@
.wait2
; Wait for some amount of ticks.
call .get
- ld [CreditsTimer], a
+ ld [wCreditsTimer], a
jr .done
.wait
; Wait for some amount of ticks, and do something else.
call .get
- ld [CreditsTimer], a
+ ld [wCreditsTimer], a
xor a
ld [hBGMapThird], a
@@ -370,20 +370,20 @@
ld hl, wJumptableIndex
set 7, [hl]
ld a, 32
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, LOW(MUSIC_POST_CREDITS)
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, HIGH(MUSIC_POST_CREDITS)
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ret
.get
-; Get byte CreditsPos from CreditsScript
+; Get byte wCreditsPos from CreditsScript
push hl
push de
- ld a, [CreditsPos]
+ ld a, [wCreditsPos]
ld e, a
- ld a, [CreditsPos+1]
+ ld a, [wCreditsPos+1]
ld d, a
ld hl, CreditsScript
add hl, de
@@ -390,9 +390,9 @@
inc de
ld a, e
- ld [CreditsPos], a
+ ld [wCreditsPos], a
ld a, d
- ld [CreditsPos+1], a
+ ld [wCreditsPos+1], a
ld a, [hl]
pop de
pop hl
@@ -424,22 +424,22 @@
ld a, $20
call DrawCreditsBorder
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, 4 * SCREEN_WIDTH
xor a
call ByteFill
- hlcoord 0, 4, AttrMap
+ hlcoord 0, 4, wAttrMap
ld bc, SCREEN_WIDTH
ld a, $1
call ByteFill
- hlcoord 0, 5, AttrMap
+ hlcoord 0, 5, wAttrMap
ld bc, 12 * SCREEN_WIDTH
ld a, $2
call ByteFill
- hlcoord 0, 17, AttrMap
+ hlcoord 0, 17, wAttrMap
ld bc, SCREEN_WIDTH
ld a, $1
call ByteFill
--- a/engine/crystal_intro.asm
+++ b/engine/crystal_intro.asm
@@ -352,7 +352,7 @@
CrystalIntro: ; e48ac
ld a, [rSVBK]
push af
- ld a, BANK(wPals)
+ ld a, BANK(wGBCPalettes)
ld [rSVBK], a
ld a, [hInMenu]
push af
@@ -796,7 +796,7 @@
xor a
ld [hLCDCPointer], a
call ClearSprites
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
; first 12 rows have palette 1
ld bc, 12 * SCREEN_WIDTH
ld a, $1
@@ -1919,15 +1919,15 @@
ld hl, .RustlingGrassPointers
add hl, de
ld a, [hli]
- ld [Requested2bppSource], a
+ ld [wRequested2bppSource], a
ld a, [hli]
- ld [Requested2bppSource + 1], a
+ ld [wRequested2bppSource + 1], a
ld a, LOW(vTiles2 tile $09)
- ld [Requested2bppDest], a
+ ld [wRequested2bppDest], a
ld a, HIGH(vTiles2 tile $09)
- ld [Requested2bppDest + 1], a
+ ld [wRequested2bppDest + 1], a
ld a, 4
- ld [Requested2bppSize], a
+ ld [wRequested2bppSize], a
ret
; e5496 (39:5496)
@@ -2022,11 +2022,11 @@
Intro_ResetLYOverrides: ; e5516 (39:5516)
ld a, [rSVBK]
push af
- ld a, BANK(LYOverrides)
+ ld a, BANK(wLYOverrides)
ld [rSVBK], a
- ld hl, LYOverrides
- ld bc, LYOverridesEnd - LYOverrides
+ ld hl, wLYOverrides
+ ld bc, wLYOverridesEnd - wLYOverrides
xor a
call ByteFill
@@ -2039,7 +2039,7 @@
Intro_PerspectiveScrollBG: ; e552f (39:552f)
ld a, [rSVBK]
push af
- ld a, BANK(LYOverrides)
+ ld a, BANK(wLYOverrides)
ld [rSVBK], a
; Scroll the grass every frame.
; Scroll the trees every other frame and at half speed.
@@ -2048,7 +2048,7 @@
and $1
jr z, .skip
; trees in the back
- ld hl, LYOverrides
+ ld hl, wLYOverrides
ld a, [hl]
inc a
ld bc, $5f
@@ -2055,13 +2055,13 @@
call ByteFill
.skip
; grass in the front
- ld hl, LYOverrides + $5f
+ ld hl, wLYOverrides + $5f
ld a, [hl]
inc a
inc a
ld bc, $31
call ByteFill
- ld a, [LYOverrides + 0]
+ ld a, [wLYOverrides + 0]
ld [hSCX], a
pop af
ld [rSVBK], a
--- a/engine/crystal_layouts.asm
+++ b/engine/crystal_layouts.asm
@@ -2,7 +2,7 @@
ld a, b
cp SCGB_RAM
jr nz, .not_ram
- ld a, [SGBPredef]
+ ld a, [wSGBPredef]
.not_ram
push af
farcall ResetBGPals
@@ -46,7 +46,7 @@
; 49346
MG_Mobile_Layout_WipeAttrMap: ; 49346 (12:5346)
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
xor a
call ByteFill
@@ -74,7 +74,7 @@
ret
MG_Mobile_Layout_CreatePalBoxes: ; 49384 (12:5384)
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
lb bc, 4, 1
ld a, $1
call MG_Mobile_Layout_FillBox
@@ -84,7 +84,7 @@
lb bc, 6, 1
ld a, $3
call MG_Mobile_Layout_FillBox
- hlcoord 1, 0, AttrMap
+ hlcoord 1, 0, wAttrMap
ld a, $1
lb bc, 3, 18
call MG_Mobile_Layout_FillBox
@@ -94,7 +94,7 @@
lb bc, 12, 18
ld a, $3
call MG_Mobile_Layout_FillBox
- hlcoord 19, 0, AttrMap
+ hlcoord 19, 0, wAttrMap
lb bc, 4, 1
ld a, $1
call MG_Mobile_Layout_FillBox
@@ -104,7 +104,7 @@
lb bc, 6, 1
ld a, $3
call MG_Mobile_Layout_FillBox
- hlcoord 0, 12, AttrMap
+ hlcoord 0, 12, wAttrMap
ld bc, 6 * SCREEN_WIDTH
ld a, $7
call ByteFill
@@ -145,11 +145,11 @@
ld a, BANK(wBGPals1)
call FarCopyWRAM
call MG_Mobile_Layout_WipeAttrMap
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a
call ByteFill
- hlcoord 0, 14, AttrMap
+ hlcoord 0, 14, wAttrMap
ld bc, 4 * SCREEN_WIDTH
ld a, $7
call ByteFill
@@ -178,27 +178,27 @@
; 49480
Function49480: ; 49480
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
lb bc, 4, SCREEN_WIDTH
ld a, $7
call MG_Mobile_Layout_FillBox
- hlcoord 0, 2, AttrMap
+ hlcoord 0, 2, wAttrMap
ld a, $4
ld [hl], a
- hlcoord 19, 2, AttrMap
+ hlcoord 19, 2, wAttrMap
ld [hl], a
ret
; 49496
Function49496: ; 49496
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
lb bc, 2, SCREEN_WIDTH
ld a, $7
call MG_Mobile_Layout_FillBox
- hlcoord 0, 1, AttrMap
+ hlcoord 0, 1, wAttrMap
ld a, $4
ld [hl], a
- hlcoord 19, 1, AttrMap
+ hlcoord 19, 1, wAttrMap
ld [hl], a
ret
; 494ac
@@ -251,43 +251,43 @@
; 49797
_InitMG_Mobile_LinkTradePalMap: ; 49797
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
lb bc, 16, 2
ld a, $4
call MG_Mobile_Layout_FillBox
ld a, $3
- ldcoord_a 0, 1, AttrMap
- ldcoord_a 0, 14, AttrMap
- hlcoord 2, 0, AttrMap
+ ldcoord_a 0, 1, wAttrMap
+ ldcoord_a 0, 14, wAttrMap
+ hlcoord 2, 0, wAttrMap
lb bc, 8, 18
ld a, $5
call MG_Mobile_Layout_FillBox
- hlcoord 2, 8, AttrMap
+ hlcoord 2, 8, wAttrMap
lb bc, 8, 18
ld a, $6
call MG_Mobile_Layout_FillBox
- hlcoord 0, 16, AttrMap
+ hlcoord 0, 16, wAttrMap
lb bc, 2, SCREEN_WIDTH
ld a, $4
call MG_Mobile_Layout_FillBox
ld a, $3
lb bc, 6, 1
- hlcoord 6, 1, AttrMap
+ hlcoord 6, 1, wAttrMap
call MG_Mobile_Layout_FillBox
ld a, $3
lb bc, 6, 1
- hlcoord 17, 1, AttrMap
+ hlcoord 17, 1, wAttrMap
call MG_Mobile_Layout_FillBox
ld a, $3
lb bc, 6, 1
- hlcoord 6, 9, AttrMap
+ hlcoord 6, 9, wAttrMap
call MG_Mobile_Layout_FillBox
ld a, $3
lb bc, 6, 1
- hlcoord 17, 9, AttrMap
+ hlcoord 17, 9, wAttrMap
call MG_Mobile_Layout_FillBox
ld a, $2
- hlcoord 2, 16, AttrMap
+ hlcoord 2, 16, wAttrMap
ld [hli], a
ld a, $7
ld [hli], a
@@ -295,7 +295,7 @@
ld [hli], a
ld a, $2
ld [hl], a
- hlcoord 2, 17, AttrMap
+ hlcoord 2, 17, wAttrMap
ld a, $3
ld bc, 6
call ByteFill
--- a/engine/debug.asm
+++ b/engine/debug.asm
@@ -71,7 +71,7 @@
ld hl, PokemonPalettes
Function818fd: ; 818fd
- ld de, OverworldMap
+ ld de, wOverworldMap
ld c, NUM_POKEMON + 1
.asm_81902
push bc
@@ -87,7 +87,7 @@
Function81911: ; 81911
ld hl, TrainerPalettes
- ld de, OverworldMap
+ ld de, wOverworldMap
ld c, NUM_TRAINER_CLASSES
.asm_81919
push bc
@@ -138,7 +138,7 @@
ld bc, sScratch - vTiles0
xor a
call ByteFill
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a
call ByteFill
@@ -320,7 +320,7 @@
call Function81bf4
ld a, [wcf66]
inc a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld [wd265], a
hlcoord 0, 1
ld de, wd265
@@ -330,7 +330,7 @@
and a
jr nz, .asm_81b7a
ld a, $1
- ld [UnownLetter], a
+ ld [wUnownLetter], a
call GetPokemonName
hlcoord 4, 1
call PlaceString
@@ -364,15 +364,15 @@
.asm_81b7a
ld a, [wd265]
- ld [TrainerClass], a
+ ld [wTrainerClass], a
callfar GetTrainerAttributes
- ld de, StringBuffer1
+ ld de, wStringBuffer1
hlcoord 4, 1
call PlaceString
ld de, vTiles2
callfar GetTrainerPic
xor a
- ld [TempEnemyMonSpecies], a
+ ld [wTempEnemyMonSpecies], a
ld [hGraphicStartTile], a
hlcoord 2, 3
lb bc, 7, 7
@@ -390,15 +390,15 @@
; 81bc0
Function81bc0: ; 81bc0
- decoord 0, 11, AttrMap
+ decoord 0, 11, wAttrMap
hlcoord 2, 11
ld a, $1
call Function81bde
- decoord 0, 13, AttrMap
+ decoord 0, 13, wAttrMap
hlcoord 2, 13
ld a, $2
call Function81bde
- decoord 0, 15, AttrMap
+ decoord 0, 15, wAttrMap
hlcoord 2, 15
ld a, $3
@@ -424,7 +424,7 @@
ld h, $0
add hl, hl
add hl, hl
- ld de, OverworldMap
+ ld de, wOverworldMap
add hl, de
ld de, wc608
ld bc, 4
@@ -771,7 +771,7 @@
call PlaceString
ld a, [wd004]
call Function81e55
- ld [CurItem], a
+ ld [wCurItem], a
predef CanLearnTMHMMove
ld a, c
and a
@@ -876,7 +876,7 @@
ld h, $0
add hl, hl
add hl, hl
- ld de, OverworldMap
+ ld de, wOverworldMap
add hl, de
ld e, l
ld d, h
@@ -1029,7 +1029,7 @@
ld [hl], $ed
ld b, $70
ld c, $5
- ld hl, Sprites
+ ld hl, wVirtualOAM
ld de, wc608 + 10
call .asm_81fb7
ld de, wc608 + 11
@@ -1099,7 +1099,7 @@
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, DEBUGTEST_BLACK
call ByteFill
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, $7
call ByteFill
@@ -1130,7 +1130,7 @@
Function821d8: ; 821d8
ld a, [wcf64]
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
Function821de: ; 821de
add hl, de
--- a/engine/decorations.asm
+++ b/engine/decorations.asm
@@ -1,8 +1,8 @@
InitDecorations: ; 26751 (9:6751)
ld a, DECO_FEATHERY_BED
- ld [Bed], a
+ ld [wDecoBed], a
ld a, DECO_TOWN_MAP
- ld [Poster], a
+ ld [wDecoPoster], a
ret
_KrisDecorationMenu: ; 0x2675c
@@ -11,18 +11,18 @@
ld hl, .MenuDataHeader
call LoadMenuDataHeader
xor a
- ld [Buffer5], a
+ ld [wBuffer5], a
ld a, $1
- ld [Buffer6], a
+ ld [wBuffer6], a
.top_loop
- ld a, [Buffer6]
+ ld a, [wBuffer6]
ld [wMenuCursorBuffer], a
call .FindCategoriesWithOwnedDecos
call DoNthMenu
ld a, [wMenuCursorY]
- ld [Buffer6], a
+ ld [wBuffer6], a
jr c, .exit_menu
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld hl, .pointers
call MenuJumptable
jr nc, .top_loop
@@ -31,7 +31,7 @@
call ExitMenu
pop af
ld [wWhichIndexSet], a
- ld a, [Buffer5]
+ ld a, [wBuffer5]
ld c, a
ret
; 0x2679a
@@ -78,7 +78,7 @@
call .FindOwndDecos
ld a, 7
call .AppendToStringBuffer2
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
ld de, wd002
ld bc, ITEM_NAME_LENGTH
call CopyBytes
@@ -85,7 +85,7 @@
ret
.ClearStringBuffer2: ; 26822 (9:6822)
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
xor a
ld [hli], a
ld bc, ITEM_NAME_LENGTH - 1
@@ -94,7 +94,7 @@
ret
.AppendToStringBuffer2: ; 26830 (9:6830)
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
inc [hl]
ld e, [hl]
ld d, 0
@@ -471,7 +471,7 @@
; 269f3
DecorationMenuFunction: ; 269f3
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
push de
call GetDecorationData
call GetDecoName
@@ -481,7 +481,7 @@
; 26a02
DoDecorationAction2: ; 26a02
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
call GetDecorationData
ld de, 2 ; function 2
add hl, de
@@ -545,7 +545,7 @@
GetDecoName: ; 26c72
ld a, [hli]
ld e, [hl]
- ld bc, StringBuffer2
+ ld bc, wStringBuffer2
push bc
ld hl, .NameFunctions
rst JumpTable
@@ -645,75 +645,75 @@
; 26ce5
DecoAction_setupbed: ; 26ce5
- ld hl, Bed
+ ld hl, wDecoBed
jp DecoAction_TrySetItUp
; 26ceb
DecoAction_putawaybed: ; 26ceb
- ld hl, Bed
+ ld hl, wDecoBed
jp DecoAction_TryPutItAway
; 26cf1
DecoAction_setupcarpet: ; 26cf1
- ld hl, Carpet
+ ld hl, wDecoCarpet
jp DecoAction_TrySetItUp
; 26cf7
DecoAction_putawaycarpet: ; 26cf7
- ld hl, Carpet
+ ld hl, wDecoCarpet
jp DecoAction_TryPutItAway
; 26cfd
DecoAction_setupplant: ; 26cfd
- ld hl, Plant
+ ld hl, wDecoPlant
jp DecoAction_TrySetItUp
; 26d03
DecoAction_putawayplant: ; 26d03
- ld hl, Plant
+ ld hl, wDecoPlant
jp DecoAction_TryPutItAway
; 26d09
DecoAction_setupposter: ; 26d09
- ld hl, Poster
+ ld hl, wDecoPoster
jp DecoAction_TrySetItUp
; 26d0f
DecoAction_putawayposter: ; 26d0f
- ld hl, Poster
+ ld hl, wDecoPoster
jp DecoAction_TryPutItAway
; 26d15
DecoAction_setupconsole: ; 26d15
- ld hl, Console
+ ld hl, wDecoConsole
jp DecoAction_TrySetItUp
; 26d1b
DecoAction_putawayconsole: ; 26d1b
- ld hl, Console
+ ld hl, wDecoConsole
jp DecoAction_TryPutItAway
; 26d21
DecoAction_setupbigdoll: ; 26d21
- ld hl, BigDoll
+ ld hl, wDecoBigDoll
jp DecoAction_TrySetItUp
; 26d27
DecoAction_putawaybigdoll: ; 26d27
- ld hl, BigDoll
+ ld hl, wDecoBigDoll
jp DecoAction_TryPutItAway
; 26d2d
DecoAction_TrySetItUp: ; 26d2d
ld a, [hl]
- ld [Buffer1], a
+ ld [wBuffer1], a
push hl
call DecoAction_SetItUp
jr c, .failed
ld a, 1
- ld [Buffer5], a
+ ld [wBuffer5], a
pop hl
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld [hl], a
xor a
ret
@@ -726,20 +726,20 @@
DecoAction_SetItUp: ; 26d46
; See if there's anything of the same type already out
- ld a, [Buffer1]
+ ld a, [wBuffer1]
and a
jr z, .nothingthere
; See if that item is already out
ld b, a
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp b
jr z, .alreadythere
; Put away the item that's already out, and set up the new one
- ld a, [MenuSelection]
- ld hl, StringBuffer4
+ ld a, [wMenuSelection]
+ ld hl, wStringBuffer4
call GetDecorationName
- ld a, [Buffer1]
- ld hl, StringBuffer3
+ ld a, [wBuffer1]
+ ld hl, wStringBuffer3
call GetDecorationName
ld hl, DecoText_PutAwayAndSetUp
call MenuTextBoxBackup
@@ -747,8 +747,8 @@
ret
.nothingthere
- ld a, [MenuSelection]
- ld hl, StringBuffer3
+ ld a, [wMenuSelection]
+ ld hl, wStringBuffer3
call GetDecorationName
ld hl, DecoText_SetUpTheDeco
call MenuTextBoxBackup
@@ -765,18 +765,18 @@
DecoAction_TryPutItAway: ; 26d86
; If there is no item of that type already set, there is nothing to put away.
ld a, [hl]
- ld [Buffer1], a
+ ld [wBuffer1], a
xor a
ld [hl], a
- ld a, [Buffer1]
+ ld a, [wBuffer1]
and a
jr z, .nothingthere
; Put it away.
ld a, $1
- ld [Buffer5], a
- ld a, [Buffer1]
- ld [MenuSelection], a
- ld hl, StringBuffer3
+ ld [wBuffer5], a
+ ld a, [wBuffer1]
+ ld [wMenuSelection], a
+ ld hl, wStringBuffer3
call GetDecorationName
ld hl, DecoText_PutAwayTheDeco
call MenuTextBoxBackup
@@ -797,7 +797,7 @@
call DecoAction_SetItUp_Ornament
jr c, .cancel
ld a, $1
- ld [Buffer5], a
+ ld [wBuffer5], a
jr DecoAction_FinishUp_Ornament
.cancel
@@ -829,16 +829,16 @@
and a
jr z, .nothingthere
ld b, a
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp b
jr z, .failed
ld a, b
- ld hl, StringBuffer3
+ ld hl, wStringBuffer3
call GetDecorationName
- ld a, [MenuSelection]
- ld hl, StringBuffer4
+ ld a, [wMenuSelection]
+ ld hl, wStringBuffer4
call GetDecorationName
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld [wSelectedDecoration], a
call .getwhichside
ld hl, DecoText_PutAwayAndSetUp
@@ -847,11 +847,11 @@
ret
.nothingthere
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld [wSelectedDecoration], a
call .getwhichside
- ld a, [MenuSelection]
- ld hl, StringBuffer3
+ ld a, [wMenuSelection]
+ ld hl, wStringBuffer3
call GetDecorationName
ld hl, DecoText_SetUpTheDeco
call MenuTextBoxBackup
@@ -866,7 +866,7 @@
; 26e33
.getwhichside ; 26e33
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld b, a
ld a, [wOtherDecoration]
cp b
@@ -886,10 +886,10 @@
ld a, [wSelectedDecoration]
and a
jr z, .nothingthere
- ld hl, StringBuffer3
+ ld hl, wStringBuffer3
call GetDecorationName
ld a, $1
- ld [Buffer5], a
+ ld [wBuffer5], a
xor a
ld [wSelectedDecoration], a
ld hl, DecoText_PutAwayTheDeco
@@ -920,7 +920,7 @@
ld a, [wMenuCursorY]
cp 3
jr z, .nope
- ld [Buffer2], a
+ ld [wBuffer2], a
call QueryWhichSide
ld a, [hl]
ld [wSelectedDecoration], a
@@ -935,9 +935,9 @@
; 26e9a
QueryWhichSide: ; 26e9a
- ld hl, RightOrnament
- ld de, LeftOrnament
- ld a, [Buffer2]
+ ld hl, wDecoRightOrnament
+ ld de, wDecoLeftOrnament
+ ld a, [wBuffer2]
cp 1
ret z
push hl
@@ -1009,7 +1009,7 @@
GetDecorationName_c: ; 26ef5 (9:6ef5)
ld a, c
call GetDecorationID
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
push hl
call GetDecorationName
pop de
@@ -1072,7 +1072,7 @@
; 26f69
DecorationDesc_Poster: ; 26f69
- ld a, [Poster]
+ ld a, [wDecoPoster]
ld hl, DecorationDesc_PosterPointers
ld de, 3
call IsInArray
@@ -1148,20 +1148,20 @@
; 26fb9
DecorationDesc_LeftOrnament: ; 26fb9
- ld a, [LeftOrnament]
+ ld a, [wDecoLeftOrnament]
jr DecorationDesc_OrnamentOrConsole
DecorationDesc_RightOrnament: ; 26fbe
- ld a, [RightOrnament]
+ ld a, [wDecoRightOrnament]
jr DecorationDesc_OrnamentOrConsole
DecorationDesc_Console: ; 26fc3
- ld a, [Console]
+ ld a, [wDecoConsole]
jr DecorationDesc_OrnamentOrConsole
DecorationDesc_OrnamentOrConsole: ; 26fc8
ld c, a
- ld de, StringBuffer3
+ ld de, wStringBuffer3
call GetDecorationName_c_de
ld b, BANK(.OrnamentConsoleScript)
ld de, .OrnamentConsoleScript
@@ -1196,18 +1196,18 @@
Special_ToggleMaptileDecorations: ; 26feb
lb de, 0, 4
- ld a, [Bed]
+ ld a, [wDecoBed]
call SetDecorationTile
lb de, 7, 4
- ld a, [Plant]
+ ld a, [wDecoPlant]
call SetDecorationTile
lb de, 6, 0
- ld a, [Poster]
+ ld a, [wDecoPoster]
call SetDecorationTile
call SetPosterVisibility
lb de, 0, 0
call PadCoords_de
- ld a, [Carpet]
+ ld a, [wDecoCarpet]
and a
ret z
call _GetDecorationSprite
@@ -1227,7 +1227,7 @@
SetPosterVisibility: ; 27027
ld b, SET_FLAG
- ld a, [Poster]
+ ld a, [wDecoPoster]
and a
jr nz, .ok
ld b, RESET_FLAG
@@ -1250,20 +1250,20 @@
Special_ToggleDecorationsVisibility: ; 27043
ld de, EVENT_KRISS_HOUSE_2F_CONSOLE
- ld hl, VariableSprites + SPRITE_CONSOLE - SPRITE_VARS
- ld a, [Console]
+ ld hl, wVariableSprites + SPRITE_CONSOLE - SPRITE_VARS
+ ld a, [wDecoConsole]
call ToggleDecorationVisibility
ld de, EVENT_KRISS_HOUSE_2F_DOLL_1
- ld hl, VariableSprites + SPRITE_DOLL_1 - SPRITE_VARS
- ld a, [LeftOrnament]
+ ld hl, wVariableSprites + SPRITE_DOLL_1 - SPRITE_VARS
+ ld a, [wDecoLeftOrnament]
call ToggleDecorationVisibility
ld de, EVENT_KRISS_HOUSE_2F_DOLL_2
- ld hl, VariableSprites + SPRITE_DOLL_2 - SPRITE_VARS
- ld a, [RightOrnament]
+ ld hl, wVariableSprites + SPRITE_DOLL_2 - SPRITE_VARS
+ ld a, [wDecoRightOrnament]
call ToggleDecorationVisibility
ld de, EVENT_KRISS_HOUSE_2F_BIG_DOLL
- ld hl, VariableSprites + SPRITE_BIG_DOLL - SPRITE_VARS
- ld a, [BigDoll]
+ ld hl, wVariableSprites + SPRITE_BIG_DOLL - SPRITE_VARS
+ ld a, [wDecoBigDoll]
call ToggleDecorationVisibility
ret
; 27074
--- a/engine/delete_save_change_clock.asm
+++ b/engine/delete_save_change_clock.asm
@@ -61,12 +61,12 @@
ClockResetPassword: ; 4d41e
call .CalculatePassword
push de
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
ld bc, 5
xor a
call ByteFill
ld a, $4
- ld [StringBuffer2 + 5], a
+ ld [wStringBuffer2 + 5], a
ld hl, .pleaseenterpasswordtext
call PrintText
.loop
@@ -108,7 +108,7 @@
.updateIDdisplay ; 4d468
hlcoord 14, 15
- ld de, StringBuffer2
+ ld de, wStringBuffer2
ld c, 5
.loop3
ld a, [de]
@@ -122,7 +122,7 @@
ld a, " "
call ByteFill
hlcoord 14, 16
- ld a, [StringBuffer2 + 5]
+ ld a, [wStringBuffer2 + 5]
ld e, a
ld d, $0
add hl, de
@@ -145,19 +145,19 @@
ret
.left
- ld a, [StringBuffer2 + 5]
+ ld a, [wStringBuffer2 + 5]
and a
ret z
dec a
- ld [StringBuffer2 + 5], a
+ ld [wStringBuffer2 + 5], a
ret
.right
- ld a, [StringBuffer2 + 5]
+ ld a, [wStringBuffer2 + 5]
cp $4
ret z
inc a
- ld [StringBuffer2 + 5], a
+ ld [wStringBuffer2 + 5], a
ret
.up
@@ -187,16 +187,16 @@
ret
.getcurrentdigit ; 4d4d5
- ld a, [StringBuffer2 + 5]
+ ld a, [wStringBuffer2 + 5]
ld e, a
ld d, $0
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
add hl, de
ret
.ConvertDecIDToBytes: ; 4d4e0
ld hl, 0
- ld de, StringBuffer2 + 4
+ ld de, wStringBuffer2 + 4
ld bc, 1
call .ConvertToBytes
ld bc, 10
@@ -222,13 +222,13 @@
ld a, BANK(sPlayerData)
call GetSRAMBank
ld de, 0
- ld hl, sPlayerData + (PlayerID - wPlayerData)
+ ld hl, sPlayerData + (wPlayerID - wPlayerData)
ld c, $2
call .ComponentFromNumber
- ld hl, sPlayerData + (PlayerName - wPlayerData)
+ ld hl, sPlayerData + (wPlayerName - wPlayerData)
ld c, NAME_LENGTH_JAPANESE - 1
call .ComponentFromString
- ld hl, sPlayerData + (Money - wPlayerData)
+ ld hl, sPlayerData + (wMoney - wPlayerData)
ld c, $3
call .ComponentFromNumber
call CloseSRAM
--- a/engine/diploma.asm
+++ b/engine/diploma.asm
@@ -22,7 +22,7 @@
ld de, .EmptyString
hlcoord 15, 5
call PlaceString
- ld de, PlayerName
+ ld de, wPlayerName
hlcoord 9, 5
call PlaceString
ld de, .Certification
@@ -68,12 +68,12 @@
hlcoord 3, 15
call PlaceString
hlcoord 12, 15
- ld de, GameTimeHours
+ ld de, wGameTimeHours
lb bc, 2, 4
call PrintNum
ld [hl], $67 ; colon
inc hl
- ld de, GameTimeMinutes
+ ld de, wGameTimeMinutes
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
ret
--- a/engine/dma_transfer.asm
+++ b/engine/dma_transfer.asm
@@ -3,7 +3,7 @@
jp CallInSafeGFXMode
.Function:
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
ld hl, wScratchAttrMap
call PadAttrMapForHDMATransfer
decoord 0, 0
@@ -40,7 +40,7 @@
jp CallInSafeGFXMode
.Function:
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
ld hl, wScratchAttrMap
call PadAttrMapForHDMATransfer
ld a, $1
@@ -55,7 +55,7 @@
jp CallInSafeGFXMode
.Function:
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
ld hl, wScratchAttrMap
call PadAttrMapForHDMATransfer
decoord 0, 0
@@ -86,7 +86,7 @@
jp CallInSafeGFXMode
.Function:
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
ld hl, wScratchAttrMap
call PadAttrMapForHDMATransfer
decoord 0, 0
@@ -156,10 +156,10 @@
jp CallInSafeGFXMode
.Function:
- ; Transfer AttrMap and Tilemap to BGMap
+ ; Transfer wAttrMap and Tilemap to BGMap
; Fill vBGAttrs with $00
; Fill vBGTiles with " "
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
ld hl, wScratchAttrMap
call PadAttrMapForHDMATransfer
decoord 0, 0
@@ -189,10 +189,10 @@
jp CallInSafeGFXMode
.Function:
- ; Transfer AttrMap and Tilemap to BGMap
+ ; Transfer wAttrMap and Tilemap to BGMap
; Fill vBGAttrs with $00
; Fill vBGTiles with $ff
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
ld hl, wScratchAttrMap
call PadAttrMapForHDMATransfer
ld c, $ff
@@ -588,7 +588,7 @@
decoord 0, 0
call .Copy
ld hl, wScratchTileMap + $80
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
call .Copy
ld a, $1
ld [rVBK], a
--- a/engine/events.asm
+++ b/engine/events.asm
@@ -5,12 +5,12 @@
OverworldLoop:: ; 966b0
xor a
- ld [MapStatus], a
+ ld [wMapStatus], a
.loop
- ld a, [MapStatus]
+ ld a, [wMapStatus]
ld hl, .jumps
rst JumpTable
- ld a, [MapStatus]
+ ld a, [wMapStatus]
cp 3 ; done
jr nz, .loop
.done
@@ -25,90 +25,90 @@
DisableEvents: ; 966cb
xor a
- ld [ScriptFlags3], a
+ ld [wScriptFlags3], a
ret
; 966d0
EnableEvents:: ; 966d0
ld a, $ff
- ld [ScriptFlags3], a
+ ld [wScriptFlags3], a
ret
; 966d6
CheckBit5_ScriptFlags3: ; 966d6
- ld hl, ScriptFlags3
+ ld hl, wScriptFlags3
bit 5, [hl]
ret
; 966dc
DisableWarpsConnxns: ; 966dc
- ld hl, ScriptFlags3
+ ld hl, wScriptFlags3
res 2, [hl]
ret
; 966e2
DisableCoordEvents: ; 966e2
- ld hl, ScriptFlags3
+ ld hl, wScriptFlags3
res 1, [hl]
ret
; 966e8
DisableStepCount: ; 966e8
- ld hl, ScriptFlags3
+ ld hl, wScriptFlags3
res 0, [hl]
ret
; 966ee
DisableWildEncounters: ; 966ee
- ld hl, ScriptFlags3
+ ld hl, wScriptFlags3
res 4, [hl]
ret
; 966f4
EnableWarpsConnxns: ; 966f4
- ld hl, ScriptFlags3
+ ld hl, wScriptFlags3
set 2, [hl]
ret
; 966fa
EnableCoordEvents: ; 966fa
- ld hl, ScriptFlags3
+ ld hl, wScriptFlags3
set 1, [hl]
ret
; 96700
EnableStepCount: ; 96700
- ld hl, ScriptFlags3
+ ld hl, wScriptFlags3
set 0, [hl]
ret
; 96706
EnableWildEncounters: ; 96706
- ld hl, ScriptFlags3
+ ld hl, wScriptFlags3
set 4, [hl]
ret
; 9670c
CheckWarpConnxnScriptFlag: ; 9670c
- ld hl, ScriptFlags3
+ ld hl, wScriptFlags3
bit 2, [hl]
ret
; 96712
CheckCoordEventScriptFlag: ; 96712
- ld hl, ScriptFlags3
+ ld hl, wScriptFlags3
bit 1, [hl]
ret
; 96718
CheckStepCountScriptFlag: ; 96718
- ld hl, ScriptFlags3
+ ld hl, wScriptFlags3
bit 0, [hl]
ret
; 9671e
CheckWildEncountersScriptFlag: ; 9671e
- ld hl, ScriptFlags3
+ ld hl, wScriptFlags3
bit 4, [hl]
ret
; 96724
@@ -115,11 +115,11 @@
StartMap: ; 96724
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
xor a
- ld [ScriptRunning], a
- ld hl, MapStatus
- ld bc, wMapStatusEnd - MapStatus
+ ld [wScriptRunning], a
+ ld hl, wMapStatus
+ ld bc, wMapStatusEnd - wMapStatus
call ByteFill
farcall InitCallReceiveDelay
call ClearJoypad
@@ -141,13 +141,13 @@
cp MAPSETUP_RELOADMAP
jr nz, .dontresetpoison
xor a
- ld [PoisonStepCount], a
+ ld [wPoisonStepCount], a
.dontresetpoison
xor a ; end map entry
ld [hMapEntryMethod], a
ld a, 2 ; HandleMap
- ld [MapStatus], a
+ ld [wMapStatus], a
ret
; 9676d
@@ -164,7 +164,7 @@
call MapEvents
; Not immediately entering a connected map will cause problems.
- ld a, [MapStatus]
+ ld a, [wMapStatus]
cp 2 ; HandleMap
ret nz
@@ -176,7 +176,7 @@
; 96795
MapEvents: ; 96795
- ld a, [MapEventStatus]
+ ld a, [wMapEventStatus]
ld hl, .jumps
rst JumpTable
ret
@@ -203,12 +203,12 @@
ResetOverworldDelay: ; 967b0
ld a, [MaxOverworldDelay]
- ld [OverworldDelay], a
+ ld [wOverworldDelay], a
ret
; 967b7
NextOverworldFrame: ; 967b7
- ld a, [OverworldDelay]
+ ld a, [wOverworldDelay]
and a
ret z
ld c, a
@@ -217,7 +217,7 @@
; 967c1
HandleMapTimeAndJoypad: ; 967c1
- ld a, [MapEventStatus]
+ ld a, [wMapEventStatus]
cp 1 ; no events
ret z
@@ -252,12 +252,12 @@
call EnableEvents
.events
ld a, 0 ; events
- ld [MapEventStatus], a
+ ld [wMapEventStatus], a
ret
.noevents
ld a, 1 ; no events
- ld [MapEventStatus], a
+ ld [wMapEventStatus], a
ret
; 96812
@@ -272,7 +272,7 @@
PlayerEvents: ; 9681f
xor a
; If there's already a player event, don't interrupt it.
- ld a, [ScriptRunning]
+ ld a, [wScriptRunning]
and a
ret nz
@@ -304,9 +304,9 @@
farcall EnableScriptMode
pop af
- ld [ScriptRunning], a
+ ld [wScriptRunning], a
call DoPlayerEvent
- ld a, [ScriptRunning]
+ ld a, [wScriptRunning]
cp PLAYEREVENT_CONNECTION
jr z, .ok2
cp PLAYEREVENT_JOYCHANGEFACING
@@ -379,7 +379,7 @@
ret
.warp_tile
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
call CheckPitTile
jr nz, .not_pit
ld a, PLAYEREVENT_FALL
@@ -463,13 +463,13 @@
call GetMapScriptsBank
call CallScript
- ld hl, ScriptFlags
+ ld hl, wScriptFlags
res 3, [hl]
farcall EnableScriptMode
farcall ScriptEvents
- ld hl, ScriptFlags
+ ld hl, wScriptFlags
bit 3, [hl]
jr z, .nope
@@ -647,7 +647,7 @@
ld h, [hl]
ld l, a
call GetMapScriptsBank
- ld de, EngineBuffer1
+ ld de, wEngineBuffer1
ld bc, 2
call FarCopyBytes
ld a, PLAYEREVENT_ITEMBALL
@@ -689,7 +689,7 @@
ret
.is_bg_event:
- ld a, [EngineBuffer3]
+ ld a, [wEngineBuffer3]
ld hl, .bg_events
rst JumpTable
ret
@@ -720,7 +720,7 @@
jr .checkdir
.checkdir
- ld a, [PlayerDirection]
+ ld a, [wPlayerDirection]
and %1100
cp b
jp nz, .dontread
@@ -727,7 +727,7 @@
.read
call PlayTalkObject
- ld hl, EngineBuffer4
+ ld hl, wEngineBuffer4
ld a, [hli]
ld h, [hl]
ld l, a
@@ -741,7 +741,7 @@
jp nz, .dontread
call PlayTalkObject
call GetMapScriptsBank
- ld de, EngineBuffer1
+ ld de, wEngineBuffer1
ld bc, 3
call FarCopyBytes
ld a, BANK(HiddenItemScript)
@@ -754,7 +754,7 @@
call CheckBGEventFlag
jr nz, .dontread
call GetMapScriptsBank
- ld de, EngineBuffer1
+ ld de, wEngineBuffer1
ld bc, 3
call FarCopyBytes
jr .dontread
@@ -787,7 +787,7 @@
; 96ad8
CheckBGEventFlag: ; 96ad8
- ld hl, EngineBuffer4
+ ld hl, wEngineBuffer4
ld a, [hli]
ld h, [hl]
ld l, a
@@ -943,9 +943,9 @@
jr c, .doscript
; Count the step for poison and total steps
- ld hl, PoisonStepCount
+ ld hl, wPoisonStepCount
inc [hl]
- ld hl, StepCount
+ ld hl, wStepCount
inc [hl]
; Every 256 steps, increase the happiness of all your Pokemon.
jr nz, .skip_happiness
@@ -956,7 +956,7 @@
; Every 256 steps, offset from the happiness incrementor by 128 steps,
; decrease the hatch counter of all your eggs until you reach the first
; one that is ready to hatch.
- ld a, [StepCount]
+ ld a, [wStepCount]
cp $80
jr nz, .skip_egg
@@ -968,7 +968,7 @@
farcall DayCareStep
; Every four steps, deal damage to all Poisoned Pokemon
- ld hl, PoisonStepCount
+ ld hl, wPoisonStepCount
ld a, [hl]
cp 4
jr c, .skip_poison
@@ -1019,7 +1019,7 @@
; 96beb
DoPlayerEvent: ; 96beb
- ld a, [ScriptRunning]
+ ld a, [wScriptRunning]
and a
ret z
@@ -1036,11 +1036,11 @@
add hl, bc
add hl, bc
ld a, [hli]
- ld [ScriptBank], a
+ ld [wScriptBank], a
ld a, [hli]
- ld [ScriptPos], a
+ ld [wScriptPos], a
ld a, [hl]
- ld [ScriptPos + 1], a
+ ld [wScriptPos + 1], a
ret
; 96c0c
--- a/engine/events/basement_key.asm
+++ b/engine/events/basement_key.asm
@@ -1,10 +1,10 @@
_BasementKey: ; 507b4
; Are we even in the right map to use this?
- ld a, [MapGroup]
+ ld a, [wMapGroup]
cp GROUP_GOLDENROD_UNDERGROUND
jr nz, .nope
- ld a, [MapNumber]
+ ld a, [wMapNumber]
cp MAP_GOLDENROD_UNDERGROUND
jr nz, .nope
; Are we on the tile in front of the door?
--- a/engine/events/battle_tower/battle_tower.asm
+++ b/engine/events/battle_tower/battle_tower.asm
@@ -96,9 +96,9 @@
ld a, l
ld [wMisc + 1], a
ld hl, wBT_OTTempPkmn1DVs
- ld a, [PlayerID]
+ ld a, [wPlayerID]
ld [hli], a
- ld a, [PlayerID + 1]
+ ld a, [wPlayerID + 1]
ld [hli], a
ld a, [wSecretID]
ld [hli], a
@@ -106,10 +106,10 @@
ld [hli], a
ld e, l
ld d, h
- ld hl, PlayerName
+ ld hl, wPlayerName
ld bc, NAME_LENGTH_JAPANESE - 1
call CopyBytes
- ld bc, PlayerID
+ ld bc, wPlayerID
ld de, wPlayerGender
farcall GetMobileOTTrainerClass
ld de, wBT_OTTempPkmn1CaughtGender
@@ -116,13 +116,13 @@
ld a, c
ld [de], a
inc de
- ld a, LOW(PartyMons)
+ ld a, LOW(wPartyMons)
ld [wcd49], a
- ld a, HIGH(PartyMons)
+ ld a, HIGH(wPartyMons)
ld [wcd4a], a
- ld a, LOW(PartyMonNicknames)
+ ld a, LOW(wPartyMonNicknames)
ld [wcd4b], a
- ld a, HIGH(PartyMonNicknames)
+ ld a, HIGH(wPartyMonNicknames)
ld [wcd4c], a
ld a, 3
.CopyLoop:
@@ -231,15 +231,15 @@
; 17024d
RunBattleTowerTrainer: ; 17024d
- ld a, [Options]
+ ld a, [wOptions]
push af
- ld hl, Options
+ ld hl, wOptions
set BATTLE_SHIFT, [hl] ; SET MODE
- ld a, [InBattleTowerBattle]
+ ld a, [wInBattleTowerBattle]
push af
or $1
- ld [InBattleTowerBattle], a
+ ld [wInBattleTowerBattle], a
xor a
ld [wLinkMode], a
@@ -253,7 +253,7 @@
farcall LoadPokemonData
farcall HealParty
ld a, [wBattleResult]
- ld [ScriptVar], a
+ ld [wScriptVar], a
and a
jr nz, .lost
ld a, BANK(sNrOfBeatenBattleTowerTrainers)
@@ -261,7 +261,7 @@
ld a, [sNrOfBeatenBattleTowerTrainers]
ld [wNrOfBeatenBattleTowerTrainers], a
call CloseSRAM
- ld hl, StringBuffer3
+ ld hl, wStringBuffer3
ld a, [wNrOfBeatenBattleTowerTrainers]
add "1"
ld [hli], a
@@ -270,9 +270,9 @@
.lost
pop af
- ld [InBattleTowerBattle], a
+ ld [wInBattleTowerBattle], a
pop af
- ld [Options], a
+ ld [wOptions], a
ld a, $1
ld [wBattleTowerBattleEnded], a
ret
@@ -334,7 +334,7 @@
ld [wBT_OTTempPkmn3NameEnd - 1], a ; $c68a + 57 = $c6c3
; Fix errors in the movesets
call CheckBTMonMovesForErrors
-; Repair the trainer name if needed, then copy it to OTPlayerName
+; Repair the trainer name if needed, then copy it to wOTPlayerName
ld de, wBT_OTTempName
ld c, NAME_LENGTH - 1
farcall CheckStringForErrors
@@ -346,7 +346,7 @@
ld hl, wBT_OTTempName ; 0xc608
.done_trainer_name
- ld de, OTPlayerName
+ ld de, wOTPlayerName
ld bc, NAME_LENGTH - 1
call CopyBytes
ld a, "@"
@@ -354,15 +354,15 @@
ld hl, wBT_OTTempTrainerClass
ld a, [hli]
- ld [OtherTrainerClass], a
- ld a, LOW(OTPartyMonNicknames)
- ld [BGMapBuffer], a
- ld a, HIGH(OTPartyMonNicknames)
- ld [BGMapBuffer + 1], a
+ ld [wOtherTrainerClass], a
+ ld a, LOW(wOTPartyMonNicknames)
+ ld [wBGMapBuffer], a
+ ld a, HIGH(wOTPartyMonNicknames)
+ ld [wBGMapBuffer + 1], a
; Copy Pkmn into Memory from the address in hl
- ld de, OTPartyMon1Species
- ld bc, OTPartyCount
+ ld de, wOTPartyMon1Species
+ ld bc, wOTPartyCount
ld a, BATTLETOWER_PARTY_LENGTH
ld [bc], a
inc bc
@@ -375,16 +375,16 @@
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
push de
- ld a, [BGMapBuffer]
+ ld a, [wBGMapBuffer]
ld e, a
- ld a, [BGMapBuffer + 1]
+ ld a, [wBGMapBuffer + 1]
ld d, a
ld bc, MON_NAME_LENGTH
call CopyBytes
ld a, e
- ld [BGMapBuffer], a
+ ld [wBGMapBuffer], a
ld a, d
- ld [BGMapBuffer + 1], a
+ ld [wBGMapBuffer + 1], a
pop de
pop bc
pop af
@@ -420,7 +420,7 @@
ld [hl], a
.valid
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
ld a, $5
call GetSRAMBank
@@ -442,7 +442,7 @@
ld [hl], a
.dont_load
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld hl, MON_MOVES
add hl, bc
ld d, NUM_MOVES - 1
@@ -574,13 +574,13 @@
CopyBTTrainer_FromBT_OT_TowBT_OTTemp: ; 1704a2
-; copy the BattleTower-Trainer data that lies at 'BT_OTTrainer' to 'wBT_OTTemp'
+; copy the BattleTower-Trainer data that lies at 'wBT_OTTrainer' to 'wBT_OTTemp'
ld a, [rSVBK]
push af
- ld a, BANK(BT_OTTrainer)
+ ld a, BANK(wBT_OTTrainer)
ld [rSVBK], a
- ld hl, BT_OTTrainer
+ ld hl, wBT_OTTrainer
ld de, wBT_OTTemp
ld bc, BATTLE_TOWER_STRUCT_LENGTH
call CopyBytes
@@ -669,7 +669,7 @@
call GetSRAMBank
ld hl, $a89c
- ld de, StringBuffer3
+ ld de, wStringBuffer3
ld bc, $16
call CopyBytes
@@ -680,13 +680,13 @@
call CloseSRAM
hlcoord 1, 1
- ld de, StringBuffer3
+ ld de, wStringBuffer3
call PlaceString
hlcoord 1, 3
ld de, .String_Mail
call PlaceString
hlcoord 4, 3
- ld de, StringBuffer4
+ ld de, wStringBuffer4
call PlaceString
hlcoord 8, 3
ld de, .String_PastReaders
@@ -901,7 +901,7 @@
; 170687
Special_BattleTowerAction: ; 170687
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld e, a
ld d, 0
ld hl, .dw
@@ -972,13 +972,13 @@
ld a, [sBattleTowerReward]
call CloseSRAM
- ld [ScriptVar], a
- ld hl, NumItems
+ ld [wScriptVar], a
+ ld hl, wNumItems
ld a, [hli]
cp MAX_ITEMS
ret c
ld b, MAX_ITEMS
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld c, a
.loop
ld a, [hli]
@@ -992,7 +992,7 @@
dec b
jr nz, .loop
ld a, POTION
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Function17071b: ; 17071b (5c:471b) BattleTowerAction $1c
@@ -1038,7 +1038,7 @@
BattleTowerAction_CheckExplanationRead: ; 17075f (5c:475f) BattleTowerAction $00
call BattleTower_CheckSaveFileExistsAndIsYours
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
ret z
@@ -1046,7 +1046,7 @@
call GetSRAMBank
ld a, [sBattleTowerSaveFileFlags]
and $2
- ld [ScriptVar], a
+ ld [wScriptVar], a
call CloseSRAM
ret
@@ -1055,7 +1055,7 @@
ld a, BANK(sBattleTowerChallengeState)
call GetSRAMBank
ld a, [hl]
- ld [ScriptVar], a
+ ld [wScriptVar], a
call CloseSRAM
ret
@@ -1088,7 +1088,7 @@
ld a, [$aa8c]
ld b, a
ld a, [$be46]
- ld [ScriptVar], a
+ ld [wScriptVar], a
call CloseSRAM
and a
ret z
@@ -1103,7 +1103,7 @@
ld a, [$aa8b]
call CloseSRAM
ld c, a
- ld a, [CurDay]
+ ld a, [wCurDay]
sub c
jr c, .asm_1707e5
cp $8
@@ -1113,7 +1113,7 @@
jr nz, .asm_1707ef
ret
.asm_1707e5
- ld hl, CurDay
+ ld hl, wCurDay
ld a, $8c
sub c
add [hl]
@@ -1121,7 +1121,7 @@
ret c
.asm_1707ef
ld a, $8
- ld [ScriptVar], a
+ ld [wScriptVar], a
Function1707f4: ; 1707f4 (5c:47f4) BattleTowerAction $06
ld a, $5
@@ -1137,7 +1137,7 @@
call UpdateTime
ld a, $5
call GetSRAMBank
- ld a, [CurDay]
+ ld a, [wCurDay]
ld [$b2f9], a
xor a
ld [$b2fa], a
@@ -1146,7 +1146,7 @@
Function17081d: ; 17081d (5c:481d) BattleTowerAction $17
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld a, $5
call GetSRAMBank
ld a, [$b2f9]
@@ -1159,7 +1159,7 @@
push bc
call UpdateTime
pop bc
- ld a, [CurDay]
+ ld a, [wCurDay]
sub c
jr c, .asm_170849
cp $b
@@ -1170,7 +1170,7 @@
ret
.asm_170849
- ld hl, CurDay
+ ld hl, wCurDay
ld a, 140
sub c
add [hl]
@@ -1178,7 +1178,7 @@
ret c
.asm_170853
ld a, $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld a, $5
call GetSRAMBank
xor a
@@ -1228,7 +1228,7 @@
ld a, $1
.nope
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 1708b1
@@ -1235,7 +1235,7 @@
Function1708b1: ; 1708b1 (5c:48b1) BattleTowerAction $0a
xor a
- ld [MusicFade], a
+ ld [wMusicFade], a
call MaxVolume
ret
@@ -1243,7 +1243,7 @@
ld a, BANK(sMobileEventIndex)
call GetSRAMBank
ld a, [sMobileEventIndex]
- ld [ScriptVar], a
+ ld [wScriptVar], a
call CloseSRAM
ret
@@ -1251,7 +1251,7 @@
call UpdateTime
ld a, $5
call GetSRAMBank
- ld a, [CurDay]
+ ld a, [wCurDay]
ld [$aa8b], a
xor a
ld [$aa8c], a
@@ -1258,7 +1258,7 @@
ld a, [$aa5d]
cp $2
jr nc, .asm_1708ec
- ld a, [CurDay]
+ ld a, [wCurDay]
ld [$aa48], a
ld a, $1
ld [$aa47], a
@@ -1268,7 +1268,7 @@
Function1708f0: ; 1708f0 (5c:48f0) BattleTowerAction $0d
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
call UpdateTime
ld a, $5
call GetSRAMBank
@@ -1278,7 +1278,7 @@
call CloseSRAM
and a
ret z
- ld hl, CurDay
+ ld hl, wCurDay
ld a, c
cp [hl]
jr nz, Function170923
@@ -1289,7 +1289,7 @@
cp $5
ret c
ld a, $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
@@ -1309,22 +1309,22 @@
BattleTowerAction_EggTicket: ; 17093c (5c:493c) BattleTowerAction $0e
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld a, EGG_TICKET
- ld [CurItem], a
- ld hl, NumItems
+ ld [wCurItem], a
+ ld hl, wNumItems
call CheckItem
ret nc
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld b, 0
ld c, a
- ld hl, PartySpecies
+ ld hl, wPartySpecies
.loop
ld a, [hli]
cp EGG
jr nz, .not_egg
push hl
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
ld de, NAME_LENGTH_JAPANESE
ld a, b
and a
@@ -1354,15 +1354,15 @@
ld [hli], a
pop hl
ld a, EGG_TICKET
- ld [CurItem], a
+ ld [wCurItem], a
ld a, 1
ld [wItemQuantityChangeBuffer], a
ld a, -1
- ld [CurItemQuantity], a
- ld hl, NumItems
+ ld [wCurItemQuantity], a
+ ld hl, wNumItems
call TossItem
ld a, $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.different
@@ -1384,7 +1384,7 @@
ld a, BANK(w3_d090)
ld [rSVBK], a
ld a, [w3_d090]
- ld [ScriptVar], a
+ ld [wScriptVar], a
pop af
ld [rSVBK], a
ret
@@ -1391,7 +1391,7 @@
Function1709bb: ; 1709bb (5c:49bb) BattleTowerAction $10
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld a, $5
call GetSRAMBank
ld a, [$a800]
@@ -1452,7 +1452,7 @@
farcall Function11b6b4
farcall Function17d0f3
ld a, $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 170a33
@@ -1478,9 +1478,9 @@
dec c
jr nz, .compare_loop
call CloseSRAM
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetMapSceneID
ld a, d
@@ -1492,7 +1492,7 @@
.no_scene
ld a, $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.different
@@ -1502,10 +1502,10 @@
xor a
ld [$a800], a
call CloseSRAM
- ld [ScriptVar], a
- ld a, [MapGroup]
+ ld [wScriptVar], a
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetMapSceneID
ld a, d
@@ -1536,13 +1536,13 @@
ld a, $5
call GetSRAMBank
ld a, [$aa8d]
- ld [ScriptVar], a
+ ld [wScriptVar], a
call CloseSRAM
ret
Function170abe: ; 170abe (5c:4abe) BattleTowerAction $14
call BattleTower_CheckSaveFileExistsAndIsYours
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
ret z
@@ -1550,7 +1550,7 @@
call GetSRAMBank
ld a, [sBattleTowerSaveFileFlags]
and $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
call CloseSRAM
ret
@@ -1573,7 +1573,7 @@
ld a, b
ld [wcd4f], a
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
farcall BattleTower_LevelCheck ; level check
ret nc
ld a, $5
@@ -1580,7 +1580,7 @@
call GetSRAMBank
ld a, [$b2fb]
call CloseSRAM
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
BattleTowerAction_UbersCheck: ; 170b16 (5c:4b16) BattleTowerAction $19
@@ -1593,7 +1593,7 @@
ld a, b
ld [wcd4f], a
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
farcall BattleTower_UbersCheck
ret nc
ld a, $5
@@ -1600,7 +1600,7 @@
call GetSRAMBank
ld a, [$b2fb]
call CloseSRAM
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Special_LoadOpponentTrainerAndPokemonWithOTSprite: ; 0x170b44
@@ -1609,7 +1609,7 @@
push af
ld a, $3
ld [rSVBK], a
- ld hl, BT_OTTrainerClass
+ ld hl, wBT_OTTrainerClass
ld a, [hl]
dec a
ld c, a
@@ -1623,7 +1623,7 @@
; Load sprite of the opponent trainer
; because s/he is chosen randomly and appears out of nowhere
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
dec a
sla a
ld e, a
@@ -1633,12 +1633,12 @@
ld c, a
ld b, 0
ld d, 0
- ld hl, MapObjects
+ ld hl, wMapObjects
add hl, bc
inc hl
ld a, [wBTTempOTSprite]
ld [hl], a
- ld hl, UsedSprites
+ ld hl, wUsedSprites
add hl, de
ld [hli], a
ld [hUsedSpriteIndex], a
@@ -1664,6 +1664,6 @@
ld a, TRUE
.asm_170be0
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 170be4
--- a/engine/events/battle_tower/load_trainer.asm
+++ b/engine/events/battle_tower/load_trainer.asm
@@ -1,23 +1,23 @@
Function_LoadOpponentTrainerAndPokemons: ; 1f8000
ld a, [rSVBK]
push af
- ld a, BANK(BT_OTTrainer)
+ ld a, BANK(wBT_OTTrainer)
ld [rSVBK], a
- ; Fill BT_OTTrainer with zeros
+ ; Fill wBT_OTTrainer with zeros
xor a
- ld hl, BT_OTTrainer
- ld bc, BT_OTTrainerEnd - BT_OTTrainer
+ ld hl, wBT_OTTrainer
+ ld bc, wBT_OTTrainerEnd - wBT_OTTrainer
call ByteFill
; Write $ff into the Item-Slots
ld a, $ff
- ld [BT_OTPkmn1Item], a
- ld [BT_OTPkmn2Item], a
- ld [BT_OTPkmn3Item], a
+ ld [wBT_OTPkmn1Item], a
+ ld [wBT_OTPkmn2Item], a
+ ld [wBT_OTPkmn3Item], a
- ; Set BT_OTTrainer as start address to write the following data to
- ld de, BT_OTTrainer
+ ; Set wBT_OTTrainer as start address to write the following data to
+ ld de, wBT_OTTrainer
ld a, [hRandomAdd]
ld b, a
@@ -129,22 +129,22 @@
ld b, a
ld a, [hld]
ld c, a
- ld a, [BT_OTPkmn1]
+ ld a, [wBT_OTPkmn1]
cp b
jr z, .FindARandomBattleTowerPkmn
- ld a, [BT_OTPkmn1Item]
+ ld a, [wBT_OTPkmn1Item]
cp c
jr z, .FindARandomBattleTowerPkmn
- ld a, [BT_OTPkmn2]
+ ld a, [wBT_OTPkmn2]
cp b
jr z, .FindARandomBattleTowerPkmn
- ld a, [BT_OTPkmn2Item]
+ ld a, [wBT_OTPkmn2Item]
cp c
jr z, .FindARandomBattleTowerPkmn
- ld a, [BT_OTPkmn3]
+ ld a, [wBT_OTPkmn3]
cp b
jr z, .FindARandomBattleTowerPkmn
- ld a, [BT_OTPkmn3Item]
+ ld a, [wBT_OTPkmn3Item]
cp c
jr z, .FindARandomBattleTowerPkmn
ld a, [sBTPkmnPrevTrainer1]
@@ -199,11 +199,11 @@
ld [sBTPkmnPrevPrevTrainer2], a
ld a, [sBTPkmnPrevTrainer3]
ld [sBTPkmnPrevPrevTrainer3], a
- ld a, [BT_OTPkmn1]
+ ld a, [wBT_OTPkmn1]
ld [sBTPkmnPrevTrainer1], a
- ld a, [BT_OTPkmn2]
+ ld a, [wBT_OTPkmn2]
ld [sBTPkmnPrevTrainer2], a
- ld a, [BT_OTPkmn3]
+ ld a, [wBT_OTPkmn3]
ld [sBTPkmnPrevTrainer3], a
call CloseSRAM
ret
--- a/engine/events/battle_tower/rules.asm
+++ b/engine/events/battle_tower/rules.asm
@@ -30,7 +30,7 @@
; 0x8b201
CheckForBattleTowerRules: ; 8b201
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
ld [hl], "3"
inc hl
ld [hl], "@"
@@ -212,13 +212,13 @@
; 8b2bb
BattleTower_CheckPartyLengthIs3: ; 8b2bb
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp BATTLETOWER_PARTY_LENGTH
ret
; 8b2c1
BattleTower_CheckPartyHasThreeMonsThatAreNotEggs: ; 8b2c1
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [hli]
ld b, $0
ld c, a
@@ -231,7 +231,7 @@
.egg
dec c
jr nz, .loop
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp b
ret z
ld a, b
@@ -240,7 +240,7 @@
; 8b2da
Function_PartyCountEq3: ; 8b2da
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp BATTLETOWER_PARTY_LENGTH
ret z
scf
@@ -248,13 +248,13 @@
; 8b2e2
Function_PartySpeciesAreUnique: ; 8b2e2
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
call VerifyUniqueness
ret
; 8b2e9
VerifyUniqueness: ; 8b2e9
- ld de, PartyCount
+ ld de, wPartyCount
ld a, [de]
inc de
dec a
@@ -318,13 +318,13 @@
; 8b32a
Function_PartyItemsAreUnique: ; 8b32a
- ld hl, PartyMon1Item
+ ld hl, wPartyMon1Item
call VerifyUniqueness
ret
; 8b331
Function_HasPartyAnEgg: ; 8b331
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [hli]
ld c, a
.loop
--- a/engine/events/battle_tower/trainer_text.asm
+++ b/engine/events/battle_tower/trainer_text.asm
@@ -1,14 +1,14 @@
BattleTowerText:: ; 11c000
-; Print text c for trainer [BT_OTTrainerClass]
+; Print text c for trainer [wBT_OTTrainerClass]
; 1: Intro text
; 2: Player lost
; 3: Player won
ld a, [rSVBK]
push af
- ld a, BANK(BT_OTTrainerClass)
+ ld a, BANK(wBT_OTTrainerClass)
ld [rSVBK], a
if DEF(_CRYSTAL11)
- ld hl, BT_OTTrainerClass
+ ld hl, wBT_OTTrainerClass
else
; BUG ALERT
; Instead of loading the Trainer Class, this routine
@@ -16,7 +16,7 @@
; uses it to get the gender of the trainer.
; As a consequence, the enemy trainer's dialog will
; always be sampled from the female array.
- ld hl, BT_OTName + NAME_LENGTH_JAPANESE - 1
+ ld hl, wBT_OTName + NAME_LENGTH_JAPANESE - 1
endc
ld a, [hl]
dec a
@@ -53,11 +53,11 @@
ld b, 0
dec c
jr nz, .restore
- ld [BT_TrainerTextIndex], a
+ ld [wBT_TrainerTextIndex], a
jr .okay2
.restore
- ld a, [BT_TrainerTextIndex]
+ ld a, [wBT_TrainerTextIndex]
.okay2
push af
--- a/engine/events/buena.asm
+++ b/engine/events/buena.asm
@@ -14,7 +14,7 @@
call DoNthMenu ; menu
farcall Buena_ExitMenu
ld b, $0
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld c, a
ld a, [wBuenasPassword]
maskbits NUM_PASSWORDS_PER_CATEGORY
@@ -24,7 +24,7 @@
.wrong
ld a, b
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 8afa9
@@ -58,7 +58,7 @@
ld a, [wBuenasPassword]
and $f0
ld c, a
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
add c
ld c, a
farcall GetBuenasPassword
@@ -71,7 +71,7 @@
xor a
ld [wMenuScrollPosition], a
ld a, $1
- ld [MenuSelection], a
+ ld [wMenuSelection], a
call Buena_PlacePrizeMenuBox
call Buena_DisplayBlueCardBalance
ld hl, .Text_AskWhichPrize
@@ -88,7 +88,7 @@
call PrintBlueCardBalance
call Buena_PrizeMenu
jr z, .done
- ld [MenuSelectionQuantity], a
+ ld [wMenuSelectionQuantity], a
call Buena_getprize
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
@@ -98,7 +98,7 @@
call YesNoBox
jr c, .loop
- ld a, [MenuSelectionQuantity]
+ ld a, [wMenuSelectionQuantity]
call Buena_getprize
inc hl
ld a, [hld]
@@ -109,10 +109,10 @@
ld a, [hli]
push hl
- ld [CurItem], a
+ ld [wCurItem], a
ld a, $1
ld [wItemQuantityChangeBuffer], a
- ld hl, NumItems
+ ld hl, wNumItems
call ReceiveItem
pop hl
jr nc, .BagFull
@@ -246,7 +246,7 @@
Buena_PrizeMenu: ; 8b0e2
ld hl, .MenuDataHeader
call CopyMenuDataHeader
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld [wMenuCursorBuffer], a
xor a
ld [wWhichIndexSet], a
@@ -254,10 +254,10 @@
call InitScrollingMenu
call UpdateSprites
call ScrollingMenu
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld c, a
ld a, [wMenuCursorY]
- ld [MenuSelection], a
+ ld [wMenuSelection], a
ld a, [wMenuJoypad]
cp $2
jr z, .cancel
@@ -301,7 +301,7 @@
; 8b134
.prizeitem ; 8b134
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
call Buena_getprize
ld a, [hl]
push de
@@ -313,7 +313,7 @@
; 8b147
.prizepoints ; 8b147
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
call Buena_getprize
inc hl
ld a, [hl]
--- a/engine/events/buena_menu.asm
+++ b/engine/events/buena_menu.asm
@@ -5,7 +5,7 @@
ld a, $1
.okay
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.DoMenu: ; 4ae1f
--- a/engine/events/bug_contest/caught_mon.asm
+++ b/engine/events/bug_contest/caught_mon.asm
@@ -11,7 +11,7 @@
.firstcatch
call .generatestats
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
ld [wd265], a
call GetPokemonName
ld hl, .caughttext
@@ -19,9 +19,9 @@
ret
.generatestats ; e6fd
- ld a, [TempEnemyMonSpecies]
- ld [CurSpecies], a
- ld [CurPartySpecies], a
+ ld a, [wTempEnemyMonSpecies]
+ ld [wCurSpecies], a
+ ld [wCurPartySpecies], a
call GetBaseData
xor a
ld bc, PARTYMON_STRUCT_LENGTH
@@ -28,7 +28,7 @@
ld hl, wContestMon
call ByteFill
xor a
- ld [MonType], a
+ ld [wMonType], a
ld hl, wContestMon
jp GeneratePartyMonStats
--- a/engine/events/bug_contest/contest_2.asm
+++ b/engine/events/bug_contest/contest_2.asm
@@ -77,12 +77,12 @@
INCLUDE "data/bug_contest_flags.asm"
Special_ContestDropOffMons: ; 13a12
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
ld a, [hli]
or [hl]
jr z, .fainted
; Mask the rest of your party by setting the count to 1...
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, 1
ld [hli], a
inc hl
@@ -92,18 +92,18 @@
; ... and replacing it with the terminator byte
ld [hl], -1
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.fainted
ld a, $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 13a31
Special_ContestReturnMons: ; 13a31
; Restore the species of the second mon.
- ld hl, PartySpecies + 1
+ ld hl, wPartySpecies + 1
ld a, [wBugContestSecondPartySpecies]
ld [hl], a
; Restore the party count, which must be recomputed.
@@ -117,6 +117,6 @@
.done
ld a, b
- ld [PartyCount], a
+ ld [wPartyCount], a
ret
; 13a47
--- a/engine/events/bug_contest/display_stats.asm
+++ b/engine/events/bug_contest/display_stats.asm
@@ -4,7 +4,7 @@
call ClearSprites
call LoadFontsBattleExtra
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set 4, [hl]
@@ -38,7 +38,7 @@
ld a, [wContestMon]
ld [wd265], a
call GetPokemonName
- ld de, StringBuffer1
+ ld de, wStringBuffer1
hlcoord 1, 2
call PlaceString
@@ -45,17 +45,17 @@
ld h, b
ld l, c
ld a, [wContestMonLevel]
- ld [TempMonLevel], a
+ ld [wTempMonLevel], a
call PrintLevel
- ld de, EnemyMonNick
+ ld de, wEnemyMonNick
hlcoord 1, 8
call PlaceString
ld h, b
ld l, c
- ld a, [EnemyMonLevel]
- ld [TempMonLevel], a
+ ld a, [wEnemyMonLevel]
+ ld [wTempMonLevel], a
call PrintLevel
hlcoord 11, 4
@@ -64,7 +64,7 @@
call PrintNum
hlcoord 11, 10
- ld de, EnemyMonMaxHP
+ ld de, wEnemyMonMaxHP
call PrintNum
ld hl, SwitchMonText
@@ -71,7 +71,7 @@
call PrintText
pop af
- ld [Options], a
+ ld [wOptions], a
call WaitBGMap
ld b, SCGB_DIPLOMA
--- a/engine/events/bug_contest/judging.asm
+++ b/engine/events/bug_contest/judging.asm
@@ -97,7 +97,7 @@
push bc
; Get the Trainer Class name and copy it into wBugContestWinnerName.
callfar GetTrainerClassName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wBugContestWinnerName
ld bc, TRAINER_CLASS_NAME_LENGTH
call CopyBytes
@@ -121,13 +121,13 @@
ld b, a
callfar GetTrainerName
; Append the name to wBugContestWinnerName.
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
pop de
ld bc, NAME_LENGTH - 1
jp CopyBytes
.player
- ld hl, PlayerName
+ ld hl, wPlayerName
ld de, wBugContestWinnerName
ld bc, NAME_LENGTH
jp CopyBytes
--- a/engine/events/card_key.asm
+++ b/engine/events/card_key.asm
@@ -1,14 +1,14 @@
_CardKey: ; 50779
; Are we even in the right map to use this?
- ld a, [MapGroup]
+ ld a, [wMapGroup]
cp GROUP_RADIO_TOWER_3F
jr nz, .nope
- ld a, [MapNumber]
+ ld a, [wMapNumber]
cp MAP_RADIO_TOWER_3F
jr nz, .nope
; Are we facing the slot?
- ld a, [PlayerDirection]
+ ld a, [wPlayerDirection]
and %1100
cp OW_UP
jr nz, .nope
--- a/engine/events/catch_tutorial.asm
+++ b/engine/events/catch_tutorial.asm
@@ -1,5 +1,5 @@
CatchTutorial:: ; 4e554
- ld a, [BattleType]
+ ld a, [wBattleType]
dec a
ld c, a
ld hl, .dw
@@ -18,13 +18,13 @@
.DudeTutorial: ; 4e56a (13:656a)
; Back up your name to your Mom's name.
- ld hl, PlayerName
- ld de, MomsName
+ ld hl, wPlayerName
+ ld de, wMomsName
ld bc, NAME_LENGTH
call CopyBytes
; Copy Dude's name to your name
ld hl, .Dude
- ld de, PlayerName
+ ld de, wPlayerName
ld bc, NAME_LENGTH
call CopyBytes
@@ -33,11 +33,11 @@
xor a
ld [hJoyDown], a
ld [hJoyPressed], a
- ld a, [Options]
+ ld a, [wOptions]
push af
and $f8
add $3
- ld [Options], a
+ ld [wOptions], a
ld hl, .AutoInput
ld a, BANK(.AutoInput)
call StartAutoInput
@@ -45,9 +45,9 @@
call StopAutoInput
pop af
- ld [Options], a
- ld hl, MomsName
- ld de, PlayerName
+ ld [wOptions], a
+ ld hl, wMomsName
+ ld de, wPlayerName
ld bc, NAME_LENGTH
call CopyBytes
ret
--- a/engine/events/celebi.asm
+++ b/engine/events/celebi.asm
@@ -2,10 +2,10 @@
Special_CelebiShrineEvent: ; 4989a
call DelayFrame
- ld a, [VramState]
+ ld a, [wVramState]
push af
xor a
- ld [VramState], a
+ ld [wVramState], a
call LoadCelebiGFX
depixel 0, 10, 7, 0
ld a, SPRITE_ANIM_INDEX_CELEBI
@@ -44,7 +44,7 @@
.done
pop af
- ld [VramState], a
+ ld [wVramState], a
call .RestorePlayerSprite_DespawnLeaves
call CelebiEvent_SetBattleType
ret
@@ -52,7 +52,7 @@
; 498f9
.RestorePlayerSprite_DespawnLeaves: ; 498f9
- ld hl, Sprite01TileID
+ ld hl, wVirtualOAMSprite00TileID
xor a
ld c, 4
.OAMloop:
@@ -63,8 +63,8 @@
inc a
dec c
jr nz, .OAMloop
- ld hl, Sprite05
- ld bc, SpritesEnd - Sprite05
+ ld hl, wVirtualOAMSprite04
+ ld bc, wVirtualOAMEnd - wVirtualOAMSprite04
xor a
call ByteFill
ret
@@ -357,7 +357,7 @@
CelebiEvent_SetBattleType: ; 49bf3
ld a, BATTLETYPE_CELEBI
- ld [BattleType], a
+ ld [wBattleType], a
ret
; 49bf9
@@ -367,13 +367,13 @@
bit 6, a
jr z, .false
ld a, $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
jr .done
.false
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
.done
ret
--- a/engine/events/checkforhiddenitems.asm
+++ b/engine/events/checkforhiddenitems.asm
@@ -1,14 +1,14 @@
CheckForHiddenItems: ; b8172
; Checks to see if there are hidden items on the screen that have not yet been found. If it finds one, returns carry.
call GetMapScriptsBank
- ld [Buffer1], a
-; Get the coordinate of the bottom right corner of the screen, and load it in Buffer3/Buffer4.
- ld a, [XCoord]
+ ld [wBuffer1], a
+; Get the coordinate of the bottom right corner of the screen, and load it in wBuffer3/wBuffer4.
+ ld a, [wXCoord]
add SCREEN_WIDTH / 4
- ld [Buffer4], a
- ld a, [YCoord]
+ ld [wBuffer4], a
+ ld a, [wYCoord]
add SCREEN_HEIGHT / 4
- ld [Buffer3], a
+ ld [wBuffer3], a
; Get the pointer for the first bg_event in the map...
ld hl, wCurrMapBGEventsPointer
ld a, [hli]
@@ -20,14 +20,14 @@
jr z, .nobgeventitems
; For i = 1:wCurrMapBGEventCount...
.loop
-; Store the counter in Buffer2, and store the bg_event pointer in the stack.
- ld [Buffer2], a
+; Store the counter in wBuffer2, and store the bg_event pointer in the stack.
+ ld [wBuffer2], a
push hl
; Get the Y coordinate of the BG event.
call .GetFarByte
ld e, a
; Is the Y coordinate of the BG event on the screen? If not, go to the next BG event.
- ld a, [Buffer3]
+ ld a, [wBuffer3]
sub e
jr c, .next
cp SCREEN_HEIGHT / 2
@@ -35,7 +35,7 @@
; Is the X coordinate of the BG event on the screen? If not, go to the next BG event.
call .GetFarByte
ld d, a
- ld a, [Buffer4]
+ ld a, [wBuffer4]
sub d
jr c, .next
cp SCREEN_WIDTH / 2
@@ -45,9 +45,9 @@
cp BGEVENT_ITEM
jr nz, .next
; Has this item already been found? If not, set off the Itemfinder.
- ld a, [Buffer1]
+ ld a, [wBuffer1]
call GetFarHalfword
- ld a, [Buffer1]
+ ld a, [wBuffer1]
call GetFarHalfword
ld d, h
ld e, l
@@ -63,7 +63,7 @@
ld bc, 5
add hl, bc
; Restore the BG event counter and decrement it. If it hits zero, there are no hidden items in range.
- ld a, [Buffer2]
+ ld a, [wBuffer2]
dec a
jr nz, .loop
@@ -78,7 +78,7 @@
; b81e2
.GetFarByte: ; b81e2
- ld a, [Buffer1]
+ ld a, [wBuffer1]
call GetFarByte
inc hl
ret
--- a/engine/events/daycare.asm
+++ b/engine/events/daycare.asm
@@ -119,7 +119,7 @@
; 16798
DayCareAskDepositPokemon: ; 16798
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp 2
jr c, .OnlyOneMon
ld a, DAYCARETEXT_WHICH_ONE
@@ -127,20 +127,20 @@
ld b, PARTYMENUACTION_GIVE_MON
farcall SelectTradeOrDayCareMon
jr c, .Declined
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .Egg
farcall CheckCurPartyMonFainted
jr c, .OutOfUsableMons
- ld hl, PartyMon1Item
+ ld hl, wPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld d, [hl]
farcall ItemIsMail
jr c, .HoldingMail
- ld hl, PartyMonNicknames
- ld a, [CurPartyMon]
+ ld hl, wPartyMonNicknames
+ ld a, [wCurPartyMon]
call GetNick
and a
ret
@@ -180,7 +180,7 @@
DayCare_DepositPokemonText: ; 167f6
ld a, DAYCARETEXT_DEPOSIT
call PrintDayCareText
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call PlayMonCry
ld a, DAYCARETEXT_COME_BACK_LATER
call PrintDayCareText
@@ -188,7 +188,7 @@
; 16807
DayCare_AskWithdrawBreedMon: ; 16807
- ld a, [StringBuffer2 + 1]
+ ld a, [wStringBuffer2 + 1]
and a
jr nz, .grew_at_least_one_level
ld a, DAYCARETEXT_TOO_SOON
@@ -208,11 +208,11 @@
jr c, .refused
.check_money
- ld de, Money
- ld bc, StringBuffer2 + 2
+ ld de, wMoney
+ ld bc, wStringBuffer2 + 2
farcall CompareMoney
jr c, .not_enough_money
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp PARTY_LENGTH
jr nc, .PartyFull
and a
@@ -235,12 +235,12 @@
; 16850
DayCare_GetBackMonForMoney: ; 16850
- ld bc, StringBuffer2 + 2
- ld de, Money
+ ld bc, wStringBuffer2 + 2
+ ld de, wMoney
farcall TakeMoney
ld a, DAYCARETEXT_WITHDRAW
call PrintDayCareText
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call PlayMonCry
ld a, DAYCARETEXT_GOT_BACK
call PrintDayCareText
@@ -249,24 +249,24 @@
GetPriceToRetrieveBreedmon: ; 1686d
ld a, b
- ld [StringBuffer2], a
+ ld [wStringBuffer2], a
ld a, d
- ld [StringBuffer2 + 1], a
- ld de, StringBuffer1
+ ld [wStringBuffer2 + 1], a
+ ld de, wStringBuffer1
ld bc, NAME_LENGTH
call CopyBytes
ld hl, 0
ld bc, 100
- ld a, [StringBuffer2 + 1]
+ ld a, [wStringBuffer2 + 1]
call AddNTimes
ld de, 100
add hl, de
xor a
- ld [StringBuffer2 + 2], a
+ ld [wStringBuffer2 + 2], a
ld a, h
- ld [StringBuffer2 + 3], a
+ ld [wStringBuffer2 + 3], a
ld a, l
- ld [StringBuffer2 + 4], a
+ ld [wStringBuffer2 + 4], a
ret
; 1689b
@@ -446,7 +446,7 @@
call PrintText
call YesNoBox
jr c, .Declined
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp PARTY_LENGTH
jr nc, .PartyFull
call DayCare_GiveEgg
@@ -468,7 +468,7 @@
.Load0:
call PrintText
xor a ; FALSE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.PartyFull:
@@ -475,7 +475,7 @@
ld hl, .PartyFullText
call PrintText
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 16993
@@ -511,8 +511,8 @@
DayCare_GiveEgg: ; 169ac
ld a, [wEggMonLevel]
- ld [CurPartyLevel], a
- ld hl, PartyCount
+ ld [wCurPartyLevel], a
+ ld hl, wPartyCount
ld a, [hl]
cp PARTY_LENGTH
jr nc, .PartyFull
@@ -525,24 +525,24 @@
ld a, EGG
ld [hli], a
ld a, [wEggMonSpecies]
- ld [CurSpecies], a
- ld [CurPartySpecies], a
+ ld [wCurSpecies], a
+ ld [wCurPartySpecies], a
ld a, -1
ld [hl], a
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
call DayCare_GetCurrentPartyMember
ld hl, wEggNick
call CopyBytes
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
ld bc, NAME_LENGTH
call DayCare_GetCurrentPartyMember
ld hl, wEggOT
call CopyBytes
- ld hl, PartyMon1
+ ld hl, wPartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call DayCare_GetCurrentPartyMember
ld hl, wEggMon
@@ -550,9 +550,9 @@
call CopyBytes
call GetBaseData
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1
+ ld hl, wPartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld b, h
@@ -583,7 +583,7 @@
; 16a31
DayCare_GetCurrentPartyMember: ; 16a31
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
call AddNTimes
ld d, h
@@ -626,13 +626,13 @@
ld bc, NAME_LENGTH
call ByteFill
ld a, [wBreedMon1DVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wBreedMon1DVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld a, [wBreedMon1Species]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, $3
- ld [MonType], a
+ ld [wMonType], a
ld a, [wBreedMon1Species]
cp DITTO
ld a, $1
@@ -654,13 +654,13 @@
ld a, [wBreedMon2Species]
.GotMother:
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
callfar GetPreEvolution
callfar GetPreEvolution
ld a, EGG_LEVEL
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp NIDORAN_F
jr nz, .GotEggSpecies
call Random
@@ -669,8 +669,8 @@
jr c, .GotEggSpecies
ld a, NIDORAN_M
.GotEggSpecies:
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
ld [wEggMonSpecies], a
call GetBaseData
@@ -677,7 +677,7 @@
ld hl, wEggNick
ld de, .String_EGG
call CopyName2
- ld hl, PlayerName
+ ld hl, wPlayerName
ld de, wEggOT
ld bc, NAME_LENGTH
call CopyBytes
@@ -685,15 +685,15 @@
ld [wEggMonItem], a
ld de, wEggMonMoves
xor a
- ld [Buffer1], a
+ ld [wBuffer1], a
predef FillMoves
farcall InitEggMoves
ld hl, wEggMonID
- ld a, [PlayerID]
+ ld a, [wPlayerID]
ld [hli], a
- ld a, [PlayerID + 1]
+ ld a, [wPlayerID + 1]
ld [hl], a
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld d, a
callfar CalcExpAtLevel
ld hl, wEggMonExp
@@ -713,10 +713,10 @@
ld hl, wEggMonDVs
call Random
ld [hli], a
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
call Random
ld [hld], a
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld de, wBreedMon1DVs
ld a, [wBreedMon1Species]
cp DITTO
@@ -726,7 +726,7 @@
cp DITTO
jr z, .GotDVs
ld a, TEMPMON
- ld [MonType], a
+ ld [wMonType], a
push hl
farcall GetGender
pop hl
@@ -766,7 +766,7 @@
ld [hl], a
.SkipDVs:
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wMonOrItemNameBuffer
ld bc, NAME_LENGTH
call CopyBytes
@@ -774,10 +774,10 @@
ld de, wEggMonPP
predef FillPP
ld hl, wMonOrItemNameBuffer
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld bc, NAME_LENGTH
call CopyBytes
- ld a, [BaseEggSteps]
+ ld a, [wBaseEggSteps]
ld hl, wEggMonHappiness
ld [hli], a
xor a
@@ -784,7 +784,7 @@
ld [hli], a
ld [hli], a
ld [hl], a
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld [wEggMonLevel], a
ret
; 16be0
--- a/engine/events/dratini.asm
+++ b/engine/events/dratini.asm
@@ -1,12 +1,12 @@
Special_Dratini: ; 0x8b170
-; if ScriptVar is 0 or 1, change the moveset of the last Dratini in the party.
+; if wScriptVar is 0 or 1, change the moveset of the last Dratini in the party.
; 0: give it a special moveset with Extremespeed.
; 1: give it the normal moveset of a level 15 Dratini.
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
cp $2
ret nc
- ld bc, PartyCount
+ ld bc, wPartyCount
ld a, [bc]
ld hl, MON_SPECIES
call .GetNthPartyMon
@@ -30,7 +30,7 @@
.GiveMoveset:
push hl
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld hl, .Movesets
ld bc, .Moveset1 - .Moveset0
call AddNTimes
@@ -93,7 +93,7 @@
; returns the address of the last Pokémon in the party in hl.
; sets carry if a is 0.
- ld de, PartyMon1
+ ld de, wPartyMon1
add hl, de
and a
jr z, .EmptyParty
--- a/engine/events/elevator.asm
+++ b/engine/events/elevator.asm
@@ -29,7 +29,7 @@
; 1345a
.LoadFloors: ; 1345a
- ld de, CurElevator
+ ld de, wCurElevator
ld bc, 4
ld hl, wElevatorPointer
ld a, [hli]
@@ -60,9 +60,9 @@
call GetFarByte
ld c, a
inc hl
- ld a, [BackupMapGroup]
+ ld a, [wBackupMapGroup]
ld d, a
- ld a, [BackupMapNumber]
+ ld a, [wBackupMapNumber]
ld e, a
ld b, 0
.loop2
@@ -111,7 +111,7 @@
ld bc, 4
call AddNTimes
inc hl
- ld de, BackupWarpNumber
+ ld de, wBackupWarpNumber
ld a, [wElevatorPointerBank]
ld bc, 3
call FarCopyBytes
@@ -151,7 +151,7 @@
Elevator_GetCurrentFloorText: ; 13512
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -165,7 +165,7 @@
hlcoord 4, 4
call Elevator_GetCurrentFloorString
pop af
- ld [Options], a
+ ld [wOptions], a
ret
; 13537
@@ -179,7 +179,7 @@
ld a, [wElevatorOriginFloor]
ld e, a
ld d, 0
- ld hl, CurElevatorFloors
+ ld hl, wCurElevatorFloors
add hl, de
ld a, [hl]
pop de
@@ -198,7 +198,7 @@
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 0 ; rows, columns
db 1 ; horizontal spacing
- dbw 0, CurElevator
+ dbw 0, wCurElevator
dba GetElevatorFloorStrings
dba NULL
dba NULL
@@ -205,7 +205,7 @@
; 13568
GetElevatorFloorStrings: ; 13568
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
GetFloorString: ; 1356b
push de
call FloorToString
--- a/engine/events/field_moves.asm
+++ b/engine/events/field_moves.asm
@@ -62,8 +62,8 @@
xor a
ld [hBGMapMode], a
farcall ClearSpriteAnims
- ld hl, Sprite37
- ld bc, SpritesEnd - Sprite37
+ ld hl, wVirtualOAMSprite36
+ ld bc, wVirtualOAMEnd - wVirtualOAMSprite36
xor a
call ByteFill
ld de, Font
@@ -81,7 +81,7 @@
HideHeadbuttTree: ; 8c913
xor a
ld [hBGMapMode], a
- ld a, [PlayerDirection]
+ ld a, [wPlayerDirection]
and %00001100
srl a
ld e, a
@@ -262,7 +262,7 @@
jr z, .top_side
set 1, e
.top_side
- ld a, [PlayerDirection]
+ ld a, [wPlayerDirection]
and %00001100
add e
ld e, a
@@ -298,7 +298,7 @@
; 8cad3
Cut_Headbutt_GetPixelFacing: ; 8cad3 (23:4ad3)
- ld a, [PlayerDirection]
+ ld a, [wPlayerDirection]
and %00001100
srl a
ld e, a
@@ -321,10 +321,10 @@
FlyFromAnim: ; 8caed
call DelayFrame
- ld a, [VramState]
+ ld a, [wVramState]
push af
xor a
- ld [VramState], a
+ ld [wVramState], a
call FlyFunction_InitGFX
depixel 10, 10, 4, 0
ld a, SPRITE_ANIM_INDEX_RED_WALK
@@ -350,16 +350,16 @@
.exit
pop af
- ld [VramState], a
+ ld [wVramState], a
ret
; 8cb33
FlyToAnim: ; 8cb33
call DelayFrame
- ld a, [VramState]
+ ld a, [wVramState]
push af
xor a
- ld [VramState], a
+ ld [wVramState], a
call FlyFunction_InitGFX
depixel 31, 10, 4, 0
ld a, SPRITE_ANIM_INDEX_RED_WALK
@@ -388,12 +388,12 @@
.exit
pop af
- ld [VramState], a
+ ld [wVramState], a
call .RestorePlayerSprite_DespawnLeaves
ret
.RestorePlayerSprite_DespawnLeaves: ; 8cb82 (23:4b82)
- ld hl, Sprite01TileID
+ ld hl, wVirtualOAMSprite00TileID
xor a
ld c, 4
.OAMloop
@@ -404,8 +404,8 @@
inc a
dec c
jr nz, .OAMloop
- ld hl, Sprite05
- ld bc, SpritesEnd - Sprite05
+ ld hl, wVirtualOAMSprite04
+ ld bc, wVirtualOAMEnd - wVirtualOAMSprite04
xor a
call ByteFill
ret
@@ -416,8 +416,8 @@
ld hl, vTiles1 tile $00
lb bc, BANK(CutGrassGFX), 4
call Request2bpp
- ld a, [CurPartyMon]
- ld hl, PartySpecies
+ ld a, [wCurPartyMon]
+ ld hl, wPartySpecies
ld e, a
ld d, 0
add hl, de
--- a/engine/events/fish.asm
+++ b/engine/events/fish.asm
@@ -79,7 +79,7 @@
add hl, de
endr
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
maskbits NUM_DAYTIMES
cp NITE_F
jr c, .time_species
--- a/engine/events/fruit_trees.asm
+++ b/engine/events/fruit_trees.asm
@@ -1,7 +1,7 @@
FruitTreeScript:: ; 44000
callasm GetCurTreeFruit
opentext
- copybytetovar CurFruit
+ copybytetovar wCurFruit
itemtotext USE_SCRIPT_VAR, MEM_BUFFER_0
writetext FruitBearingTreeText
buttonsound
@@ -14,7 +14,7 @@
.fruit
writetext HeyItsFruitText
- copybytetovar CurFruit
+ copybytetovar wCurFruit
giveitem ITEM_FROM_MEM
iffalse .packisfull
buttonsound
@@ -35,10 +35,10 @@
; 44041
GetCurTreeFruit: ; 44041
- ld a, [CurFruitTree]
+ ld a, [wCurFruitTree]
dec a
call GetFruitTreeItem
- ld [CurFruit], a
+ ld [wCurFruit], a
ret
; 4404c
@@ -53,7 +53,7 @@
ld b, 2
call GetFruitTreeFlag
ld a, c
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 4405f
@@ -65,7 +65,7 @@
ResetFruitTrees: ; 4406a
xor a
- ld hl, FruitTreeFlags
+ ld hl, wFruitTreeFlags
ld [hli], a
ld [hli], a
ld [hli], a
@@ -78,11 +78,11 @@
GetFruitTreeFlag: ; 44078
push hl
push de
- ld a, [CurFruitTree]
+ ld a, [wCurFruitTree]
dec a
ld e, a
ld d, 0
- ld hl, FruitTreeFlags
+ ld hl, wFruitTreeFlags
call FlagAction
pop de
pop hl
--- a/engine/events/halloffame.asm
+++ b/engine/events/halloffame.asm
@@ -37,14 +37,14 @@
RedCredits:: ; 86455
ld a, LOW(MUSIC_NONE)
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, HIGH(MUSIC_NONE)
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld a, 10
- ld [MusicFade], a
+ ld [wMusicFade], a
farcall Special_FadeOutPalettes
xor a
- ld [VramState], a
+ ld [wVramState], a
ld [hMapAnims], a
farcall InitDisplayForRedCredits
ld c, 8
@@ -60,14 +60,14 @@
HallOfFame_FadeOutMusic: ; 8648e
ld a, LOW(MUSIC_NONE)
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, HIGH(MUSIC_NONE)
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld a, 10
- ld [MusicFade], a
+ ld [wMusicFade], a
farcall Special_FadeOutPalettes
xor a
- ld [VramState], a
+ ld [wVramState], a
ld [hMapAnims], a
farcall InitDisplayForHallOfFame
ld c, 100
@@ -115,7 +115,7 @@
.done
call HOF_AnimatePlayerPic
ld a, $4
- ld [MusicFade], a
+ ld [wMusicFade], a
call RotateThreePalettesRight
ld c, 8
call DelayFrames
@@ -143,15 +143,15 @@
GetHallOfFameParty: ; 8653f
- ld hl, OverworldMap
+ ld hl, wOverworldMap
ld bc, HOF_LENGTH
xor a
call ByteFill
ld a, [wHallOfFameCount]
- ld de, OverworldMap
+ ld de, wOverworldMap
ld [de], a
inc de
- ld hl, PartySpecies
+ ld hl, wPartySpecies
ld c, 0
.next
ld a, [hli]
@@ -168,7 +168,7 @@
push bc
ld a, c
- ld hl, PartyMons
+ ld hl, wPartyMons
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld c, l
@@ -207,7 +207,7 @@
pop bc
push bc
ld a, c
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
call AddNTimes
ld bc, MON_NAME_LENGTH - 1
@@ -235,15 +235,15 @@
farcall ResetDisplayBetweenHallOfFameMons
pop hl
ld a, [hli]
- ld [TempMonSpecies], a
- ld [CurPartySpecies], a
+ ld [wTempMonSpecies], a
+ ld [wCurPartySpecies], a
inc hl
inc hl
ld a, [hli]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [hli]
- ld [TempMonDVs + 1], a
- ld hl, TempMonDVs
+ ld [wTempMonDVs + 1], a
+ ld hl, wTempMonDVs
predef GetUnownLetter
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
@@ -448,22 +448,22 @@
xor a
ld [hBGMapMode], a
ld a, [hli]
- ld [TempMonSpecies], a
+ ld [wTempMonSpecies], a
ld a, [hli]
- ld [TempMonID], a
+ ld [wTempMonID], a
ld a, [hli]
- ld [TempMonID + 1], a
+ ld [wTempMonID + 1], a
ld a, [hli]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [hli]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld a, [hli]
- ld [TempMonLevel], a
- ld de, StringBuffer2
+ ld [wTempMonLevel], a
+ ld de, wStringBuffer2
ld bc, MON_NAME_LENGTH - 1
call CopyBytes
ld a, "@"
- ld [StringBuffer2 + 10], a
+ ld [wStringBuffer2 + 10], a
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
@@ -474,16 +474,16 @@
hlcoord 0, 12
lb bc, 4, SCREEN_WIDTH - 2
call TextBox
- ld a, [TempMonSpecies]
- ld [CurPartySpecies], a
+ ld a, [wTempMonSpecies]
+ ld [wCurPartySpecies], a
ld [wd265], a
- ld hl, TempMonDVs
+ ld hl, wTempMonDVs
predef GetUnownLetter
xor a
ld [wBoxAlignment], a
hlcoord 6, 5
call _PrepMonFrontpic
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .print_id_no
hlcoord 1, 13
@@ -498,7 +498,7 @@
hlcoord 7, 13
call PlaceString
ld a, TEMPMON
- ld [MonType], a
+ ld [wMonType], a
farcall GetGender
ld a, " "
jr c, .got_gender
@@ -512,7 +512,7 @@
hlcoord 8, 14
ld a, "/"
ld [hli], a
- ld de, StringBuffer2
+ ld de, wStringBuffer2
call PlaceString
hlcoord 1, 16
call PrintLevel
@@ -525,7 +525,7 @@
ld [hli], a
ld [hl], "/"
hlcoord 10, 16
- ld de, TempMonID
+ ld de, wTempMonID
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
ret
@@ -554,7 +554,7 @@
call WaitBGMap
xor a
ld [hBGMapMode], a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
call SetPalettes
@@ -587,7 +587,7 @@
lb bc, 4, 18
call TextBox
hlcoord 2, 4
- ld de, PlayerName
+ ld de, wPlayerName
call PlaceString
hlcoord 1, 6
ld a, "<ID>"
@@ -596,7 +596,7 @@
ld [hli], a
ld [hl], "/"
hlcoord 4, 6
- ld de, PlayerID
+ ld de, wPlayerID
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
hlcoord 1, 8
@@ -603,12 +603,12 @@
ld de, .PlayTime
call PlaceString
hlcoord 3, 9
- ld de, GameTimeHours
+ ld de, wGameTimeHours
lb bc, 2, 3
call PrintNum
ld [hl], HALLOFFAME_COLON
inc hl
- ld de, GameTimeMinutes
+ ld de, wGameTimeMinutes
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
call WaitBGMap
--- a/engine/events/happiness_egg.asm
+++ b/engine/events/happiness_egg.asm
@@ -1,7 +1,7 @@
Special_GetFirstPokemonHappiness: ; 718d
- ld hl, PartyMon1Happiness
+ ld hl, wPartyMon1Happiness
ld bc, PARTYMON_STRUCT_LENGTH
- ld de, PartySpecies
+ ld de, wPartySpecies
.loop
ld a, [de]
cp EGG
@@ -13,12 +13,12 @@
.done
ld [wd265], a
ld a, [hl]
- ld [ScriptVar], a
+ ld [wScriptVar], a
call GetPokemonName
jp CopyPokemonName_Buffer1_Buffer3
Special_CheckFirstMonIsEgg: ; 71ac
- ld a, [PartySpecies]
+ ld a, [wPartySpecies]
ld [wd265], a
cp EGG
ld a, 1
@@ -26,18 +26,18 @@
xor a
.egg
- ld [ScriptVar], a
+ ld [wScriptVar], a
call GetPokemonName
jp CopyPokemonName_Buffer1_Buffer3
ChangeHappiness: ; 71c2
-; Perform happiness action c on CurPartyMon
+; Perform happiness action c on wCurPartyMon
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
inc a
ld e, a
ld d, 0
- ld hl, PartySpecies - 1
+ ld hl, wPartySpecies - 1
add hl, de
ld a, [hl]
cp EGG
@@ -44,9 +44,9 @@
ret z
push bc
- ld hl, PartyMon1Happiness
+ ld hl, wPartyMon1Happiness
ld bc, PARTYMON_STRUCT_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
pop bc
@@ -93,13 +93,13 @@
ld a, [wBattleMode]
and a
ret z
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld b, a
ld a, [wPartyMenuCursor]
cp b
ret nz
ld a, [de]
- ld [BattleMonHappiness], a
+ ld [wBattleMonHappiness], a
ret
@@ -116,13 +116,13 @@
ld [hl], a
ret nz
- ld de, PartyCount
+ ld de, wPartyCount
ld a, [de]
and a
ret z
ld c, a
- ld hl, PartyMon1Happiness
+ ld hl, wPartyMon1Happiness
.loop
inc de
ld a, [de]
--- a/engine/events/heal_machine_anim.asm
+++ b/engine/events/heal_machine_anim.asm
@@ -9,19 +9,19 @@
Special_HealMachineAnim: ; 12324
; If you have no Pokemon, don't change the buffer. This can lead to some glitchy effects if you have no Pokemon.
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret z
- ; The location of the healing machine relative to the player is stored in ScriptVar.
+ ; The location of the healing machine relative to the player is stored in wScriptVar.
; 0: Up and left (Pokemon Center)
; 1: Left (Elm's Lab)
; 2: Up (Hall of Fame)
- ld a, [ScriptVar]
- ld [Buffer1], a
+ ld a, [wScriptVar]
+ ld [wBuffer1], a
ld a, [rOBP1]
- ld [Buffer2], a
+ ld [wBuffer2], a
call .DoJumptableFunctions
- ld a, [Buffer2]
+ ld a, [wBuffer2]
call DmgToCgbObjPal1
ret
; 1233e
@@ -28,9 +28,9 @@
.DoJumptableFunctions: ; 1233e
xor a
- ld [Buffer3], a
+ ld [wBuffer3], a
.jumpable_loop
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld e, a
ld d, 0
ld hl, .Pointers
@@ -39,10 +39,10 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [Buffer3]
+ ld a, [wBuffer3]
ld e, a
inc a
- ld [Buffer3], a
+ ld [wBuffer3], a
add hl, de
ld a, [hl]
cp HEALMACHINESTATE_FINISH
@@ -97,7 +97,7 @@
; 12393
.PC_LoadBallsOntoMachine: ; 12393
- ld hl, Sprite33
+ ld hl, wVirtualOAMSprite32
ld de, .PC_ElmsLab_OAM
call .PlaceHealingMachineTile
call .PlaceHealingMachineTile
@@ -104,11 +104,11 @@
jr .LoadBallsOntoMachine
.HOF_LoadBallsOntoMachine: ; 123a1
- ld hl, Sprite33
+ ld hl, wVirtualOAMSprite32
ld de, .HOF_OAM
.LoadBallsOntoMachine: ; 123a7
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld b, a
.party_loop
call .PlaceHealingMachineTile
@@ -254,7 +254,7 @@
.PlaceHealingMachineTile: ; 124a3
push bc
- ld a, [Buffer1]
+ ld a, [wBuffer1]
bcpixel 2, 4
cp HEALMACHINE_ELMS_LAB
jr z, .okay
--- a/engine/events/kurt.asm
+++ b/engine/events/kurt.asm
@@ -33,13 +33,13 @@
call Kurt_PrintTextWhichApricorn
pop bc
ld a, c
- ld [MenuSelection], a
+ ld [wMenuSelection], a
call Kurt_SelectApricorn
ld a, c
- ld [ScriptVar], a
+ ld [wScriptVar], a
and a
jr z, .done
- ld [CurItem], a
+ ld [wCurItem], a
ld a, [wMenuCursorY]
ld c, a
push bc
@@ -61,7 +61,7 @@
jr c, .nope
ld hl, .MenuDataHeader
call CopyMenuDataHeader
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld [wMenuCursorBuffer], a
xor a
ld [hBGMapMode], a
@@ -71,7 +71,7 @@
ld a, [wMenuJoypad]
cp B_BUTTON
jr z, .nope
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp -1
jr nz, .done
@@ -96,13 +96,13 @@
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 7
db 1
- dbw 0, Buffer1
+ dbw 0, wBuffer1
dba .Name
dba .Quantity
dba NULL
.Name: ; 8809f
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
and a
ret z
farcall PlaceMenuItemName
@@ -110,19 +110,19 @@
; 880ab
.Quantity: ; 880ab
- ld a, [MenuSelection]
- ld [CurItem], a
+ ld a, [wMenuSelection]
+ ld [wCurItem], a
call Kurt_GetQuantityOfApricorn
ret z
ld a, [wItemQuantityChangeBuffer]
- ld [MenuSelectionQuantity], a
+ ld [wMenuSelectionQuantity], a
farcall PlaceMenuItemQuantity
ret
; 880c2
Kurt_SelectQuantity: ; 880c2
- ld a, [CurItem]
- ld [MenuSelection], a
+ ld a, [wCurItem]
+ ld [wMenuSelection], a
call Kurt_GetQuantityOfApricorn
jr z, .done
ld a, [wItemQuantityChangeBuffer]
@@ -187,8 +187,8 @@
Kurt_GetQuantityOfApricorn: ; 88139
push bc
- ld hl, NumItems
- ld a, [CurItem]
+ ld hl, wNumItems
+ ld a, [wCurItem]
ld c, a
ld b, $0
.loop
@@ -219,27 +219,27 @@
; 88161
Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161
-; Get the quantity of Apricorns of type [CurItem]
+; Get the quantity of Apricorns of type [wCurItem]
; in the bag. Compatible with multiple stacks.
; Initialize the search.
push de
push bc
- ld hl, NumItems
- ld a, [CurItem]
+ ld hl, wNumItems
+ ld a, [wCurItem]
ld c, a
ld e, $0
xor a
- ld [CurItemQuantity], a
+ ld [wCurItemQuantity], a
ld a, -1
ld [wApricorns], a
-; Search for [CurItem] in the bag.
+; Search for [wCurItem] in the bag.
.loop1
; Increase the total count.
- ld a, [CurItemQuantity]
+ ld a, [wCurItemQuantity]
inc a
- ld [CurItemQuantity], a
+ ld [wCurItemQuantity], a
; Get the index of the next item.
inc hl
ld a, [hli]
@@ -255,7 +255,7 @@
ld hl, wApricorns
add hl, de
inc e
- ld a, [CurItemQuantity]
+ ld a, [wCurItemQuantity]
dec a
ld [hli], a
ld a, -1
@@ -321,7 +321,7 @@
cp -1
jr z, .done
push hl
- ld [CurItemQuantity], a
+ ld [wCurItemQuantity], a
call Kurt_GetRidOfItem
pop hl
ld a, [wItemQuantityChangeBuffer]
@@ -357,7 +357,7 @@
Kurt_GetAddressOfApricornQuantity: ; 88201
push hl
push bc
- ld hl, NumItems
+ ld hl, wNumItems
inc hl
ld c, a
ld b, $0
@@ -372,14 +372,14 @@
Kurt_GetRidOfItem: ; 88211
push bc
- ld hl, NumItems
- ld a, [CurItemQuantity]
+ ld hl, wNumItems
+ ld a, [wCurItemQuantity]
ld c, a
ld b, $0
inc hl
add hl, bc
add hl, bc
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
ld a, [hli]
cp -1
@@ -397,7 +397,7 @@
.okay
push bc
- ld hl, NumItems
+ ld hl, wNumItems
ld a, b
ld [wItemQuantityChangeBuffer], a
call TossItem
--- a/engine/events/lucky_number.asm
+++ b/engine/events/lucky_number.asm
@@ -1,13 +1,13 @@
Special_CheckForLuckyNumberWinners: ; 4d87a
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld [wFoundMatchingIDInParty], a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret z
ld d, a
- ld hl, PartyMon1ID
- ld bc, PartySpecies
+ ld hl, wPartyMon1ID
+ ld bc, wPartySpecies
.PartyLoop:
ld a, [bc]
inc bc
@@ -79,7 +79,7 @@
cp EGG
jr z, .SkipBoxMon
- call .CompareLuckyNumberToMonID ; sets ScriptVar and CurPartySpecies appropriately
+ call .CompareLuckyNumberToMonID ; sets wScriptVar and wCurPartySpecies appropriately
jr nc, .SkipBoxMon
ld a, 1
ld [wFoundMatchingIDInParty], a
@@ -100,7 +100,7 @@
jr c, .BoxesLoop
call CloseSRAM
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
ret z ; found nothing
farcall StubbedTrainerRankings_LuckyNumberShow
@@ -107,7 +107,7 @@
ld a, [wFoundMatchingIDInParty]
and a
push af
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, .FoundPartymonText
@@ -124,17 +124,17 @@
push hl
ld d, h
ld e, l
- ld hl, Buffer1
+ ld hl, wBuffer1
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
- ld hl, LuckyNumberDigit1Buffer
+ ld hl, wLuckyNumberDigit1Buffer
ld de, wLuckyIDNumber
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
ld b, 5
ld c, 0
- ld hl, LuckyNumberDigit5Buffer
- ld de, Buffer5
+ ld hl, wLuckyNumberDigit5Buffer
+ ld de, wBuffer5
.loop
ld a, [de]
cp [hl]
@@ -167,7 +167,7 @@
.okay
inc b
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
jr z, .bettermatch
cp b
@@ -176,10 +176,10 @@
.bettermatch
dec b
ld a, b
- ld [ScriptVar], a
+ ld [wScriptVar], a
pop bc
ld a, b
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
pop bc
scf
ret
@@ -217,10 +217,10 @@
db "@"
Special_PrintTodaysLuckyNumber: ; 4d9d3
- ld hl, StringBuffer3
+ ld hl, wStringBuffer3
ld de, wLuckyIDNumber
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
ld a, "@"
- ld [StringBuffer3 + 5], a
+ ld [wStringBuffer3 + 5], a
ret
--- a/engine/events/magikarp.asm
+++ b/engine/events/magikarp.asm
@@ -7,13 +7,13 @@
; Let's start by selecting a Magikarp.
farcall SelectMonFromParty
jr c, .declined
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp MAGIKARP
jr nz, .not_magikarp
; Now let's compute its length based on its DVs and ID.
- ld a, [CurPartyMon]
- ld hl, PartyMon1Species
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
push hl
@@ -48,27 +48,27 @@
ld a, [hl]
ld [de], a
inc de
- ld a, [CurPartyMon]
- ld hl, PartyMonOT
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonOT
call SkipNames
call CopyBytes
ld a, MAGIKARPLENGTH_BEAT_RECORD
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.not_long_enough
ld a, MAGIKARPLENGTH_TOO_SHORT
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.declined
ld a, MAGIKARPLENGTH_REFUSED
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.not_magikarp
xor a ; MAGIKARPLENGTH_NOT_MAGIKARP
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; fbba9
@@ -92,7 +92,7 @@
PrintMagikarpLength: ; fbbdb
call Magikarp_LoadFeetInchesChars
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wMagikarpLength
lb bc, PRINTNUM_RIGHTALIGN | 1, 2
call PrintNum
@@ -111,8 +111,8 @@
; Return Magikarp's length (in feet and inches) at wMagikarpLength (big endian).
;
; input:
-; de: EnemyMonDVs
-; bc: PlayerID
+; de: wEnemyMonDVs
+; bc: wPlayerID
; This function is poorly commented.
--- a/engine/events/magnet_train.asm
+++ b/engine/events/magnet_train.asm
@@ -1,5 +1,5 @@
Special_MagnetTrain: ; 8cc04
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
jr nz, .ToGoldenrod
ld a, 1 ; forwards
@@ -65,11 +65,11 @@
ld [hLYOverrideStart], a
ld [hLYOverrideEnd], a
ld [hSCX], a
- ld [Requested2bppSource], a
- ld [Requested2bppSource + 1], a
- ld [Requested2bppDest], a
- ld [Requested2bppDest + 1], a
- ld [Requested2bpp], a
+ ld [wRequested2bppSource], a
+ ld [wRequested2bppSource + 1], a
+ ld [wRequested2bppDest], a
+ ld [wRequested2bppDest + 1], a
+ ld [wRequested2bpp], a
call ClearTileMap
pop af
@@ -84,7 +84,7 @@
; 8cc99
MagnetTrain_UpdateLYOverrides: ; 8cc99
- ld hl, LYOverridesBackup
+ ld hl, wLYOverridesBackup
ld c, $2f
ld a, [wMagnetTrainOffset]
add a
@@ -242,12 +242,12 @@
; 8cda6
MagnetTrain_InitLYOverrides: ; 8cda6
- ld hl, LYOverrides
- ld bc, LYOverridesEnd - LYOverrides
+ ld hl, wLYOverrides
+ ld bc, wLYOverridesEnd - wLYOverrides
ld a, [wMagnetTrainInitPosition]
call ByteFill
- ld hl, LYOverridesBackup
- ld bc, LYOverridesBackupEnd - LYOverridesBackup
+ ld hl, wLYOverridesBackup
+ ld bc, wLYOverridesBackupEnd - wLYOverridesBackup
ld a, [wMagnetTrainInitPosition]
call ByteFill
ld a, rSCX - $ff00
@@ -430,13 +430,13 @@
push af
ld a, BANK(wEnvironment)
ld [rSVBK], a
- ld a, [TimeOfDayPal]
+ ld a, [wTimeOfDayPal]
push af
ld a, [wEnvironment]
push af
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
maskbits NUM_DAYTIMES
- ld [TimeOfDayPal], a
+ ld [wTimeOfDayPal], a
ld a, $1
ld [wEnvironment], a
ld b, SCGB_MAPPALS
@@ -451,7 +451,7 @@
pop af
ld [wEnvironment], a
pop af
- ld [TimeOfDayPal], a
+ ld [wTimeOfDayPal], a
pop af
ld [rSVBK], a
ret
--- a/engine/events/map_name_sign.asm
+++ b/engine/events/map_name_sign.asm
@@ -9,9 +9,9 @@
; should have just been a fallthrough
.inefficient_farcall ; b800a
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
ld [wCurrentLandmark], a
@@ -91,10 +91,10 @@
; b8089
.CheckNationalParkGate: ; b8089
- ld a, [MapGroup]
+ ld a, [wMapGroup]
cp GROUP_ROUTE_35_NATIONAL_PARK_GATE
ret nz
- ld a, [MapNumber]
+ ld a, [wMapNumber]
cp MAP_ROUTE_35_NATIONAL_PARK_GATE
ret z
cp MAP_ROUTE_36_NATIONAL_PARK_GATE
@@ -161,7 +161,7 @@
ld c, a
hlcoord 0, 2
add hl, bc
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call PlaceString
ret
@@ -168,7 +168,7 @@
.GetNameLength: ; b8101 (2e:4101)
ld c, 0
push hl
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
.loop
ld a, [hli]
cp "@"
@@ -183,7 +183,7 @@
InitMapSignAttrMap: ; b8115
- ld de, AttrMap - TileMap
+ ld de, wAttrMap - wTileMap
add hl, de
inc b
inc b
--- a/engine/events/misc_scripts.asm
+++ b/engine/events/misc_scripts.asm
@@ -43,20 +43,20 @@
.TryReceiveItem: ; 122f8
xor a
- ld [ScriptVar], a
- ld a, [EngineBuffer1]
+ ld [wScriptVar], a
+ ld a, [wEngineBuffer1]
ld [wNamedObjectIndexBuffer], a
call GetItemName
- ld hl, StringBuffer3
+ ld hl, wStringBuffer3
call CopyName2
- ld a, [EngineBuffer1]
- ld [CurItem], a
- ld a, [CurFruit]
+ ld a, [wEngineBuffer1]
+ ld [wCurItem], a
+ ld a, [wCurFruit]
ld [wItemQuantityChangeBuffer], a
- ld hl, NumItems
+ ld hl, wNumItems
call ReceiveItem
ret nc
ld a, $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 12324
--- a/engine/events/misc_scripts_2.asm
+++ b/engine/events/misc_scripts_2.asm
@@ -12,7 +12,7 @@
HiddenItemScript:: ; 0x13625
opentext
- copybytetovar EngineBuffer3
+ copybytetovar wEngineBuffer3
itemtotext USE_SCRIPT_VAR, MEM_BUFFER_0
writetext .found_text
giveitem ITEM_FROM_MEM
@@ -42,7 +42,7 @@
db "@"
SetMemEvent: ; 1364f
- ld hl, EngineBuffer1
+ ld hl, wEngineBuffer1
ld a, [hli]
ld d, [hl]
ld e, a
--- a/engine/events/mom.asm
+++ b/engine/events/mom.asm
@@ -141,7 +141,7 @@
ld hl, UnknownText_0x16662
call PrintText
xor a
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
ld [hli], a
ld [hli], a
ld [hl], a
@@ -153,28 +153,28 @@
call Mom_WithdrawDepositMenuJoypad
call CloseWindow
jr c, .CancelDeposit
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
ld a, [hli]
or [hl]
inc hl
or [hl]
jr z, .CancelDeposit
- ld de, Money
- ld bc, StringBuffer2
+ ld de, wMoney
+ ld bc, wStringBuffer2
farcall CompareMoney
jr c, .DontHaveThatMuchToDeposit
- ld hl, StringBuffer2
- ld de, StringBuffer2 + 3
+ ld hl, wStringBuffer2
+ ld de, wStringBuffer2 + 3
ld bc, 3
call CopyBytes
ld bc, wMomsMoney
- ld de, StringBuffer2
+ ld de, wStringBuffer2
farcall GiveMoney
jr c, .CantDepositThatMuch
- ld bc, StringBuffer2 + 3
- ld de, Money
+ ld bc, wStringBuffer2 + 3
+ ld de, wMoney
farcall TakeMoney
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
ld de, wMomsMoney
ld bc, 3
call CopyBytes
@@ -208,7 +208,7 @@
ld hl, UnknownText_0x16667
call PrintText
xor a
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
ld [hli], a
ld [hli], a
ld [hl], a
@@ -220,29 +220,29 @@
call Mom_WithdrawDepositMenuJoypad
call CloseWindow
jr c, .CancelWithdraw
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
ld a, [hli]
or [hl]
inc hl
or [hl]
jr z, .CancelWithdraw
- ld hl, StringBuffer2
- ld de, StringBuffer2 + 3
+ ld hl, wStringBuffer2
+ ld de, wStringBuffer2 + 3
ld bc, 3
call CopyBytes
ld de, wMomsMoney
- ld bc, StringBuffer2
+ ld bc, wStringBuffer2
farcall CompareMoney
jr c, .InsufficientFundsInBank
- ld bc, Money
- ld de, StringBuffer2
+ ld bc, wMoney
+ ld de, wStringBuffer2
farcall GiveMoney
jr c, .NotEnoughRoomInWallet
- ld bc, StringBuffer2 + 3
+ ld bc, wStringBuffer2 + 3
ld de, wMomsMoney
farcall TakeMoney
- ld hl, StringBuffer2
- ld de, Money
+ ld hl, wStringBuffer2
+ ld de, wMoney
ld bc, 3
call CopyBytes
ld de, SFX_TRANSACTION
@@ -367,33 +367,33 @@
; 164b9
.SetClockForward: ; 164b9
- ld a, [StartHour]
+ ld a, [wStartHour]
add 1
sub 24
jr nc, .DontLoopHourForward
add 24
.DontLoopHourForward:
- ld [StartHour], a
+ ld [wStartHour], a
ccf
- ld a, [StartDay]
+ ld a, [wStartDay]
adc 0
- ld [StartDay], a
+ ld [wStartDay], a
ret
; 164d1
.SetClockBack: ; 164d1
- ld a, [StartHour]
+ ld a, [wStartHour]
sub 1
jr nc, .DontLoopHourBack
add 24
.DontLoopHourBack:
- ld [StartHour], a
- ld a, [StartDay]
+ ld [wStartHour], a
+ ld a, [wStartDay]
sbc 0
jr nc, .DontLoopDayBack
add 7
.DontLoopDayBack:
- ld [StartDay], a
+ ld [wStartDay], a
ret
; 164ea
@@ -465,7 +465,7 @@
ld de, Mom_HeldString
call PlaceString
hlcoord 12, 4
- ld de, Money
+ ld de, wMoney
lb bc, PRINTNUM_MONEY | 3, 6
call PrintNum
hlcoord 1, 6
@@ -472,7 +472,7 @@
pop de
call PlaceString
hlcoord 12, 6
- ld de, StringBuffer2
+ ld de, wStringBuffer2
lb bc, PRINTNUM_MONEY | PRINTNUM_LEADINGZEROS | 3, 6
call PrintNum
call UpdateSprites
@@ -504,7 +504,7 @@
ld a, " "
call ByteFill
hlcoord 12, 6
- ld de, StringBuffer2
+ ld de, wStringBuffer2
lb bc, PRINTNUM_MONEY | PRINTNUM_LEADINGZEROS | 3, 6
call PrintNum
ld a, [hVBlankCounter]
@@ -567,7 +567,7 @@
call .getdigitquantity
ld c, l
ld b, h
- ld de, StringBuffer2
+ ld de, wStringBuffer2
farcall GiveMoney
ret
@@ -576,7 +576,7 @@
call .getdigitquantity
ld c, l
ld b, h
- ld de, StringBuffer2
+ ld de, wStringBuffer2
farcall TakeMoney
ret
--- a/engine/events/mom_phone.asm
+++ b/engine/events/mom_phone.asm
@@ -41,13 +41,13 @@
.ok
ld a, PHONE_MOM
ld [wCurrentCaller], a
- ld bc, EngineBuffer2
+ ld bc, wEngineBuffer2
ld hl, 0
add hl, bc
ld [hl], 0
inc hl
ld [hl], 1
- ld hl, wPhoneScriptPointer - EngineBuffer2
+ ld hl, wPhoneScriptPointer - wEngineBuffer2
add hl, bc
ld a, BANK(Mom_GetScriptPointer)
ld [hli], a
@@ -89,7 +89,7 @@
inc hl
ld [hl], LOW(MOM_MONEY)
.loop
- ld de, MomItemTriggerBalance
+ ld de, wMomItemTriggerBalance
ld bc, wMomsMoney
farcall CompareMoney
jr z, .exact
@@ -111,7 +111,7 @@
ret
.AddMoney:
- ld de, MomItemTriggerBalance
+ ld de, wMomItemTriggerBalance
ld bc, hMoneyTemp
farcall AddMoney
ret
@@ -150,10 +150,10 @@
.not_doll
ld a, [hl]
- ld [CurItem], a
+ ld [wCurItem], a
ld a, 1
ld [wItemQuantityChangeBuffer], a
- ld hl, PCItems
+ ld hl, wPCItems
call ReceiveItem
ret
; fd0eb
--- a/engine/events/move_deleter.asm
+++ b/engine/events/move_deleter.asm
@@ -7,11 +7,11 @@
call PrintText
farcall SelectMonFromParty
jr c, .declined
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
- ld a, [CurPartyMon]
- ld hl, PartyMon1Moves + 1
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1Moves + 1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld a, [hl]
@@ -27,7 +27,7 @@
jr c, .declined
ld a, [wMenuCursorY]
push af
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
ld [wd265], a
call GetMoveName
ld hl, .ConfirmDeleteText
@@ -113,9 +113,9 @@
dec a
ld c, a
ld b, 0
- ld hl, PartyMon1Moves
+ ld hl, wPartyMon1Moves
add hl, bc
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
pop bc
@@ -142,9 +142,9 @@
dec a
ld c, a
ld b, 0
- ld hl, PartyMon1PP
+ ld hl, wPartyMon1PP
add hl, bc
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
pop bc
--- a/engine/events/move_tutor.asm
+++ b/engine/events/move_tutor.asm
@@ -23,18 +23,18 @@
call CheckCanLearnMoveTutorMove
jr nc, .loop
xor a ; FALSE
- ld [ScriptVar], a
+ ld [wScriptVar], a
jr .quit
.cancel
ld a, -1
- ld [ScriptVar], a
+ ld [wScriptVar], a
.quit
call CloseSubmenu
ret
.GetMoveTutorMove: ; 492a5
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
cp MOVETUTOR_FLAMETHROWER
jr z, .flamethrower
cp MOVETUTOR_THUNDERBOLT
@@ -58,8 +58,8 @@
predef CanLearnTMHMMove
push bc
- ld a, [CurPartyMon]
- ld hl, PartyMonNicknames
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonNicknames
call GetNick
pop bc
--- a/engine/events/name_rater.asm
+++ b/engine/events/name_rater.asm
@@ -10,7 +10,7 @@
farcall SelectMonFromParty
jr c, .cancel
; He can't rename an egg...
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
; ... or a Pokemon you got from a trade.
@@ -25,15 +25,15 @@
; What name shall I give it then?
ld hl, NameRaterWhichNameText
call PrintText
-; Load the new nickname into StringBuffer2
+; Load the new nickname into wStringBuffer2
xor a ; PARTYMON
- ld [MonType], a
- ld a, [CurPartySpecies]
+ ld [wMonType], a
+ ld a, [wCurPartySpecies]
ld [wd265], a
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
ld b, 0
- ld de, StringBuffer2
+ ld de, wStringBuffer2
farcall _NamingScreen
; If the new name is empty, treat it as unchanged.
call IsNewNameEmpty
@@ -43,14 +43,14 @@
call CompareNewToOld
ld hl, NameRaterSameAsBeforeText
jr c, .samename
-; Copy the new name from StringBuffer2
- ld hl, PartyMonNicknames
+; Copy the new name from wStringBuffer2
+ ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld e, l
ld d, h
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
ld bc, MON_NAME_LENGTH
call CopyBytes
ld hl, NameRaterEvenBetterText
@@ -80,21 +80,21 @@
; fb78a
CheckIfMonIsYourOT: ; fb78a
-; Checks to see if the partymon loaded in [CurPartyMon] has the different OT as you. Returns carry if not.
- ld hl, PartyMonOT
+; Checks to see if the partymon loaded in [wCurPartyMon] has the different OT as you. Returns carry if not.
+ ld hl, wPartyMonOT
ld bc, NAME_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
- ld de, PlayerName
+ ld de, wPlayerName
ld c, NAME_LENGTH
call .loop
jr c, .nope
- ld hl, PartyMon1ID
+ ld hl, wPartyMon1ID
ld bc, PARTYMON_STRUCT_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
- ld de, PlayerID
+ ld de, wPlayerID
ld c, 2 ; number of bytes in which your ID is stored
.loop
ld a, [de]
@@ -113,8 +113,8 @@
; fb7be
IsNewNameEmpty: ; fb7be
-; Checks to see if the nickname loaded in StringBuffer2 is empty. If so, return carry.
- ld hl, StringBuffer2
+; Checks to see if the nickname loaded in wStringBuffer2 is empty. If so, return carry.
+ ld hl, wStringBuffer2
ld c, MON_NAME_LENGTH - 1
.loop
ld a, [hli]
@@ -135,21 +135,21 @@
; fb7d3
CompareNewToOld: ; fb7d3
-; Compares the nickname in StringBuffer2 to the previous nickname. If they are the same, return carry.
- ld hl, PartyMonNicknames
+; Compares the nickname in wStringBuffer2 to the previous nickname. If they are the same, return carry.
+ ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
push hl
call GetNicknameLength
ld b, c
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
call GetNicknameLength
pop hl
ld a, c
cp b
jr nz, .different
- ld de, StringBuffer2
+ ld de, wStringBuffer2
.loop
ld a, [de]
cp "@"
--- a/engine/events/odd_egg.asm
+++ b/engine/events/odd_egg.asm
@@ -42,17 +42,17 @@
ld a, OddEgg2 - OddEgg1
call AddNTimes
- ld de, OddEggSpecies
+ ld de, wOddEggSpecies
ld bc, PARTYMON_STRUCT_LENGTH + 2 * MON_NAME_LENGTH
call CopyBytes
ld a, EGG_TICKET
- ld [CurItem], a
+ ld [wCurItem], a
ld a, 1
ld [wItemQuantityChangeBuffer], a
ld a, -1
- ld [CurItemQuantity], a
- ld hl, NumItems
+ ld [wCurItemQuantity], a
+ ld hl, wNumItems
call TossItem
; load species in wcd2a
@@ -64,10 +64,10 @@
ld [wMobileMonSpeciesPointerBuffer], a
ld a, HIGH(wMobileMonSpeciesBuffer - 1)
ld [wMobileMonSpeciesPointerBuffer + 1], a
- ; load pointer to OddEggSpecies in wMobileMonStructurePointerBuffer
- ld a, LOW(OddEggSpecies)
+ ; load pointer to wOddEggSpecies in wMobileMonStructurePointerBuffer
+ ld a, LOW(wOddEggSpecies)
ld [wMobileMonStructurePointerBuffer], a
- ld a, HIGH(OddEggSpecies)
+ ld a, HIGH(wOddEggSpecies)
ld [wMobileMonStructurePointerBuffer + 1], a
; load Odd Egg Name in wTempOddEggNickname
--- a/engine/events/overworld.asm
+++ b/engine/events/overworld.asm
@@ -1,14 +1,14 @@
FieldMoveJumptableReset: ; c6ea
xor a
- ld hl, Buffer1
+ ld hl, wBuffer1
ld bc, 7
call ByteFill
ret
FieldMoveJumptable: ; c6f5
- ld a, [Buffer1]
+ ld a, [wBuffer1]
rst JumpTable
- ld [Buffer1], a
+ ld [wBuffer1], a
bit 7, a
jr nz, .okay
and a
@@ -20,16 +20,16 @@
ret
GetPartyNick: ; c706
-; write CurPartyMon nickname to StringBuffer1-3
- ld hl, PartyMonNicknames
+; write wCurPartyMon nickname to wStringBuffer1-3
+ ld hl, wPartyMonNicknames
ld a, BOXMON
- ld [MonType], a
- ld a, [CurPartyMon]
+ ld [wMonType], a
+ ld a, [wCurPartyMon]
call GetNick
call CopyName1
-; copy text from StringBuffer2 to StringBuffer3
- ld de, StringBuffer2
- ld hl, StringBuffer3
+; copy text from wStringBuffer2 to wStringBuffer3
+ ld de, wStringBuffer2
+ ld hl, wStringBuffer3
call CopyName2
ret
@@ -68,11 +68,11 @@
ld e, 0
xor a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
.loop
ld c, e
ld b, 0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, bc
ld a, [hl]
and a
@@ -83,7 +83,7 @@
jr z, .next
ld bc, PARTYMON_STRUCT_LENGTH
- ld hl, PartyMon1Moves
+ ld hl, wPartyMon1Moves
ld a, e
call AddNTimes
ld b, NUM_MOVES
@@ -100,7 +100,7 @@
.yes
ld a, e
- ld [CurPartyMon], a ; which mon has the move
+ ld [wCurPartyMon], a ; which mon has the move
xor a
ret
.no
@@ -179,7 +179,7 @@
farcall CheckCutCollision
pop de
jr nc, .fail
- ; Get the location of the current block in OverworldMap.
+ ; Get the location of the current block in wOverworldMap.
call GetBlockLocation
ld c, [hl]
; See if that block contains something that can be cut.
@@ -188,17 +188,17 @@
call CheckOverworldTileArrays
pop hl
jr nc, .fail
- ; Back up the OverworldMap address to Buffer3
+ ; Back up the wOverworldMap address to wBuffer3
ld a, l
- ld [Buffer3], a
+ ld [wBuffer3], a
ld a, h
- ld [Buffer4], a
- ; Back up the replacement tile to Buffer5
+ ld [wBuffer4], a
+ ; Back up the replacement tile to wBuffer5
ld a, b
- ld [Buffer5], a
- ; Back up the animation index to Buffer6
+ ld [wBuffer5], a
+ ; Back up the animation index to wBuffer6
ld a, c
- ld [Buffer6], a
+ ld [wBuffer6], a
xor a
ret
@@ -219,11 +219,11 @@
end
CutDownTreeOrGrass: ; c810
- ld hl, Buffer3 ; OverworldMapTile
+ ld hl, wBuffer3 ; OverworldMapTile
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [Buffer5] ; ReplacementTile
+ ld a, [wBuffer5] ; ReplacementTile
ld [hl], a
xor a
ld [hBGMapMode], a
@@ -230,7 +230,7 @@
call OverworldTextModeSwitch
call UpdateSprites
call DelayFrame
- ld a, [Buffer6] ; Animation type
+ ld a, [wBuffer6] ; Animation type
ld e, a
farcall OWCutAnimation
call BufferScreen
@@ -248,7 +248,7 @@
; Dictionary lookup for pointer to tile replacement table
push bc
- ld a, [wTileset]
+ ld a, [wMapTileset]
ld de, 3
call IsInArray
pop bc
@@ -360,7 +360,7 @@
ld hl, wBikeFlags
bit 1, [hl] ; always on bike
jr nz, .cannotsurf
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_SURF
jr z, .alreadyfail
cp PLAYER_SURF_PIKA
@@ -387,7 +387,7 @@
.DoSurf: ; c95f (3:495f)
call GetSurfType
- ld [Buffer2], a
+ ld [wBuffer2], a
call GetPartyNick
ld hl, SurfFromMenuScript
call QueueScript
@@ -416,7 +416,7 @@
callasm .empty_fn ; empty function
- copybytetovar Buffer2
+ copybytetovar wBuffer2
writevarcode VAR_MOVEMENT
special ReplaceKrisSprite
@@ -423,7 +423,7 @@
special PlayMapMusic
; step into the water
special Special_SurfStartStep ; (slow_step_x, step_end)
- applymovement PLAYER, MovementBuffer ; PLAYER, MovementBuffer
+ applymovement PLAYER, wMovementBuffer ; PLAYER, MovementBuffer
end
.empty_fn ; c9a2
@@ -446,10 +446,10 @@
; Surfing on Pikachu uses an alternate sprite.
; This is done by using a separate movement type.
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld e, a
ld d, 0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, de
ld a, [hl]
@@ -464,7 +464,7 @@
; from moving in the direction you're facing.
; Get player direction
- ld a, [PlayerDirection]
+ ld a, [wPlayerDirection]
and %00001100 ; bits 2 and 3 contain direction
rrca
rrca
@@ -474,7 +474,7 @@
add hl, de
; Can you walk in this direction?
- ld a, [TilePermissions]
+ ld a, [wTilePermissions]
and [hl]
jr nz, .quit
xor a
@@ -495,7 +495,7 @@
; Return carry if fail is allowed.
; Don't ask to surf if already fail.
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_SURF_PIKA
jr z, .quit
cp PLAYER_SURF
@@ -502,7 +502,7 @@
jr z, .quit
; Must be facing water.
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
call GetTileCollision
cp WATERTILE
jr nz, .quit
@@ -524,7 +524,7 @@
jr nz, .quit
call GetSurfType
- ld [Buffer2], a
+ ld [wBuffer2], a
call GetPartyNick
ld a, BANK(AskSurfScript)
@@ -587,7 +587,7 @@
cp NUM_SPAWNS
jr nc, .illegal
- ld [DefaultSpawnpoint], a
+ ld [wDefaultSpawnpoint], a
call CloseWindow
ld a, $1
ret
@@ -664,11 +664,11 @@
ret
CheckMapCanWaterfall: ; cb07
- ld a, [PlayerDirection]
+ ld a, [wPlayerDirection]
and $c
cp FACE_UP
jr nz, .failed
- ld a, [TileUp]
+ ld a, [wTileUp]
call CheckWaterfallTile
jr nz, .failed
xor a
@@ -696,13 +696,13 @@
.CheckContinueWaterfall: ; cb38
xor a
- ld [ScriptVar], a
- ld a, [PlayerStandingTile]
+ ld [wScriptVar], a
+ ld a, [wPlayerStandingTile]
call CheckWaterfallTile
ret z
farcall StubbedTrainerRankings_Waterfall
ld a, $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.WaterfallStep: ; cb4f
@@ -767,7 +767,7 @@
ld a, $2
dig_incave
- ld [Buffer2], a
+ ld [wBuffer2], a
.loop
ld hl, .DigTable
call FieldMoveJumptable
@@ -811,7 +811,7 @@
ld bc, 3
call CopyBytes
call GetPartyNick
- ld a, [Buffer2]
+ ld a, [wBuffer2]
cp $2
jr nz, .escaperope
ld hl, .UsedDigScript
@@ -827,7 +827,7 @@
ret
.FailDig: ; cc06
- ld a, [Buffer2]
+ ld a, [wBuffer2]
cp $2
jr nz, .failescaperope
ld hl, .Text_CantUseHere
@@ -917,7 +917,7 @@
farcall IsSpawnPoint
jr nc, .nope
ld a, c
- ld [DefaultSpawnpoint], a
+ ld [wDefaultSpawnpoint], a
ld a, $1
ret
@@ -1009,13 +1009,13 @@
SetStrengthFlag: ; cd12
ld hl, wBikeFlags
set 0, [hl]
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld e, a
ld d, 0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, de
ld a, [hl]
- ld [Buffer6], a
+ ld [wBuffer6], a
call GetPartyNick
ret
@@ -1026,7 +1026,7 @@
Script_UsedStrength: ; 0xcd2d
callasm SetStrengthFlag
writetext .UsedStrength
- copybytetovar Buffer6
+ copybytetovar wBuffer6
cry 0
pause 3
writetext .StrengthAllowedItToMoveBoulders
@@ -1101,7 +1101,7 @@
jr .done
.done
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
WhirlpoolFunction: ; cd9d
@@ -1167,13 +1167,13 @@
pop hl
jr nc, .failed
ld a, l
- ld [Buffer3], a
+ ld [wBuffer3], a
ld a, h
- ld [Buffer4], a
+ ld [wBuffer4], a
ld a, b
- ld [Buffer5], a
+ ld [wBuffer5], a
ld a, c
- ld [Buffer6], a
+ ld [wBuffer6], a
xor a
ret
@@ -1194,16 +1194,16 @@
end
DisappearWhirlpool: ; ce1d
- ld hl, Buffer3
+ ld hl, wBuffer3
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [Buffer5]
+ ld a, [wBuffer5]
ld [hl], a
xor a
ld [hBGMapMode], a
call OverworldTextModeSwitch
- ld a, [Buffer6]
+ ld a, [wBuffer6]
ld e, a
farcall PlayWhirlpoolSound
call BufferScreen
@@ -1395,7 +1395,7 @@
disappear -2
callasm RockMonEncounter
- copybytetovar TempWildMonSpecies
+ copybytetovar wTempWildMonSpecies
iffalse .done
randomwildmon
startbattle
@@ -1445,7 +1445,7 @@
xor a
jr .done
.done
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
FishFunction: ; cf8e
@@ -1453,7 +1453,7 @@
push af
call FieldMoveJumptableReset
pop af
- ld [Buffer2], a
+ ld [wBuffer2], a
.loop
ld hl, .FishTable
call FieldMoveJumptable
@@ -1470,7 +1470,7 @@
dw .FishNoFish
.TryFish: ; cfaf
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_SURF
jr z, .fail
cp PLAYER_SURF_PIKA
@@ -1492,17 +1492,17 @@
.goodtofish
ld d, a
- ld a, [Buffer2]
+ ld a, [wBuffer2]
ld e, a
farcall Fish
ld a, d
and a
jr z, .nonibble
- ld [TempWildMonSpecies], a
+ ld [wTempWildMonSpecies], a
ld a, e
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld a, BATTLETYPE_FISH
- ld [BattleType], a
+ ld [wBattleType], a
ld a, $2
ret
@@ -1516,7 +1516,7 @@
.FishGotSomething: ; cff4
ld a, $1
- ld [Buffer6], a
+ ld [wBuffer6], a
ld hl, Script_GotABite
call QueueScript
ld a, $81
@@ -1524,7 +1524,7 @@
.FishNoBite: ; d002
ld a, $2
- ld [Buffer6], a
+ ld [wBuffer6], a
ld hl, Script_NotEvenANibble
call QueueScript
ld a, $81
@@ -1532,7 +1532,7 @@
.FishNoFish: ; d010
ld a, $0
- ld [Buffer6], a
+ ld [wBuffer6], a
ld hl, Script_NotEvenANibble2
call QueueScript
ld a, $81
@@ -1597,7 +1597,7 @@
step_end
Fishing_CheckFacingUp: ; d06c
- ld a, [PlayerDirection]
+ ld a, [wPlayerDirection]
and $c
cp OW_UP
ld a, $1
@@ -1605,7 +1605,7 @@
xor a
.up
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_FishCastRod: ; 0xd07c
@@ -1627,7 +1627,7 @@
xor a
ld [hBGMapMode], a
ld a, $1
- ld [PlayerAction], a
+ ld [wPlayerAction], a
call UpdateSprites
call ReplaceKrisSprite
ret
@@ -1656,7 +1656,7 @@
.TryBike: ; d0bc
call .CheckEnvironment
jr c, .CannotUseBike
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_NORMAL
jr z, .GetOnBike
cp PLAYER_BIKE
@@ -1669,7 +1669,7 @@
call .CheckIfRegistered
call QueueScript
xor a
- ld [MusicFade], a
+ ld [wMusicFade], a
ld de, MUSIC_NONE
call PlayMusic
call DelayFrame
@@ -1826,11 +1826,11 @@
.CheckMap: ; d1ba
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
call CheckMapForSomethingToCut
ret c
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
UnknownText_0xd1c8: ; 0xd1c8
--- a/engine/events/poisonstep.asm
+++ b/engine/events/poisonstep.asm
@@ -1,11 +1,11 @@
DoPoisonStep:: ; 505da
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
jr z, .no_faint
xor a
ld c, 7
- ld hl, EngineBuffer1
+ ld hl, wEngineBuffer1
.loop_clearEngineBuffer1
ld [hli], a
dec c
@@ -12,33 +12,33 @@
jr nz, .loop_clearEngineBuffer1
xor a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
.loop_check_poison
call .DamageMonIfPoisoned
jr nc, .not_poisoned
-; the output flag is stored in c, copy it to the ([CurPartyMon] + 2)nd EngineBuffer
-; and set the corresponding flag in EngineBuffer1
- ld a, [CurPartyMon]
+; the output flag is stored in c, copy it to the ([wCurPartyMon] + 2)nd EngineBuffer
+; and set the corresponding flag in wEngineBuffer1
+ ld a, [wCurPartyMon]
ld e, a
ld d, 0
- ld hl, EngineBuffer2
+ ld hl, wEngineBuffer2
add hl, de
ld [hl], c
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
or c
- ld [EngineBuffer1], a
+ ld [wEngineBuffer1], a
.not_poisoned
- ld a, [PartyCount]
- ld hl, CurPartyMon
+ ld a, [wPartyCount]
+ ld hl, wCurPartyMon
inc [hl]
cp [hl]
jr nz, .loop_check_poison
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
and %10
jr nz, .someone_has_fainted
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
and %01
jr z, .no_faint
call .PlayPoisonSFX
@@ -124,8 +124,8 @@
.CheckWhitedOut: ; 5067b
xor a
- ld [CurPartyMon], a
- ld de, EngineBuffer2
+ ld [wCurPartyMon], a
+ ld de, wEngineBuffer2
.party_loop
push de
ld a, [de]
@@ -140,14 +140,14 @@
.mon_not_fainted
pop de
inc de
- ld hl, CurPartyMon
+ ld hl, wCurPartyMon
inc [hl]
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp [hl]
jr nz, .party_loop
predef CheckPlayerPartyForFitPkmn
ld a, d
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 506b2
--- a/engine/events/poisonstep_pals.asm
+++ b/engine/events/poisonstep_pals.asm
@@ -9,7 +9,7 @@
ld a, [hCGB]
and a
jr nz, .cgb
- ld a, [TimeOfDayPal]
+ ld a, [wTimeOfDayPal]
maskbits NUM_DAYTIMES
cp DARKNESS_F
ld a, %00000000
--- a/engine/events/poke_seer.asm
+++ b/engine/events/poke_seer.asm
@@ -24,7 +24,7 @@
farcall SelectMonFromParty
jr c, .cancel
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
@@ -118,12 +118,12 @@
ld a, MON_ID
call GetPartyParamLocation
- ld a, [PlayerID]
+ ld a, [wPlayerID]
cp [hl]
jr nz, .traded
inc hl
- ld a, [PlayerID + 1]
+ ld a, [wPlayerID + 1]
; cp [hl]
jr nz, .traded
@@ -146,8 +146,8 @@
; 4f176
GetCaughtName: ; 4f176
- ld a, [CurPartyMon]
- ld hl, PartyMonNicknames
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
call AddNTimes
ld de, wSeerNickname
@@ -241,7 +241,7 @@
jr z, .fail
ld e, a
farcall GetLandmarkName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wSeerCaughtLocation
ld bc, 17
call CopyBytes
@@ -266,8 +266,8 @@
; 4f242
GetCaughtOT: ; 4f242
- ld a, [CurPartyMon]
- ld hl, PartyMonOT
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonOT
ld bc, NAME_LENGTH
call AddNTimes
ld de, wSeerOTName
--- a/engine/events/pokecenter_pc.asm
+++ b/engine/events/pokecenter_pc.asm
@@ -15,7 +15,7 @@
ld [wWhichIndexSet], a
call DoNthMenu
jr c, .shutdown
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld hl, .JumpTable
call MenuJumptable
jr nc, .loop
@@ -84,7 +84,7 @@
; 15650
PC_CheckPartyForPokemon: ; 15650
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret nz
ld de, SFX_CHOOSE_PC_OPTION
@@ -289,13 +289,13 @@
db -1
PC_DisplayTextWaitMenu: ; 157bb
- ld a, [Options]
+ ld a, [wOptions]
push af
set NO_TEXT_SCROLL, a
- ld [Options], a
+ ld [wOptions], a
call MenuTextBox
pop af
- ld [Options], a
+ ld [wOptions], a
ret
; 157cc
@@ -341,17 +341,17 @@
.withdraw
ld a, [wItemQuantityChangeBuffer]
- ld [Buffer1], a ; quantity
- ld a, [CurItemQuantity]
- ld [Buffer2], a
- ld hl, NumItems
+ ld [wBuffer1], a ; quantity
+ ld a, [wCurItemQuantity]
+ ld [wBuffer2], a
+ ld hl, wNumItems
call ReceiveItem
jr nc, .PackFull
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld [wItemQuantityChangeBuffer], a
- ld a, [Buffer2]
- ld [CurItemQuantity], a
- ld hl, PCItems
+ ld a, [wBuffer2]
+ ld [wCurItemQuantity], a
+ ld hl, wPCItems
call TossItem
predef PartyMonItemName
ld hl, .WithdrewText
@@ -387,7 +387,7 @@
.loop
call PCItemsJoypad
jr c, .quit
- ld de, PCItems
+ ld de, wPCItems
farcall TossItemFromPC
jr .loop
@@ -473,15 +473,15 @@
ret
.tossable
- ld a, [Buffer1]
+ ld a, [wBuffer1]
push af
- ld a, [Buffer2]
+ ld a, [wBuffer2]
push af
call .DepositItem_
pop af
- ld [Buffer2], a
+ ld [wBuffer2], a
pop af
- ld [Buffer1], a
+ ld [wBuffer1], a
ret
.DepositItem_:
@@ -505,17 +505,17 @@
.DepositItem:
ld a, [wItemQuantityChangeBuffer]
- ld [Buffer1], a
- ld a, [CurItemQuantity]
- ld [Buffer2], a
- ld hl, PCItems
+ ld [wBuffer1], a
+ ld a, [wCurItemQuantity]
+ ld [wBuffer2], a
+ ld hl, wPCItems
call ReceiveItem
jr nc, .NoRoomInPC
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld [wItemQuantityChangeBuffer], a
- ld a, [Buffer2]
- ld [CurItemQuantity], a
- ld hl, NumItems
+ ld a, [wBuffer2]
+ ld [wCurItemQuantity], a
+ ld hl, wNumItems
call TossItem
predef PartyMonItemName
ld hl, .DepositText
@@ -628,7 +628,7 @@
db SCROLLINGMENU_ENABLE_SELECT | SCROLLINGMENU_ENABLE_FUNCTION3 | SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 8 ; rows/cols?
db 2 ; horizontal spacing?
- dbw 0, PCItems
+ dbw 0, wPCItems
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
--- a/engine/events/pokepic.asm
+++ b/engine/events/pokepic.asm
@@ -8,8 +8,8 @@
call GetSGBLayout
xor a
ld [hBGMapMode], a
- ld a, [CurPartySpecies]
- ld [CurSpecies], a
+ ld a, [wCurPartySpecies]
+ ld [wCurSpecies], a
call GetBaseData
ld de, vTiles1
predef GetMonFrontpic
--- a/engine/events/pokerus/apply_pokerus_tick.asm
+++ b/engine/events/pokerus/apply_pokerus_tick.asm
@@ -1,7 +1,7 @@
ApplyPokerusTick: ; 13988
; decreases all pokemon's pokerus counter by b. if the lower nybble reaches zero, the pokerus is cured.
- ld hl, PartyMon1PokerusStatus ; PartyMon1 + MON_PKRS
- ld a, [PartyCount]
+ ld hl, wPartyMon1PokerusStatus ; wPartyMon1 + MON_PKRS
+ ld a, [wPartyCount]
and a
ret z ; make sure it's not wasting time on an empty party
ld c, a
--- a/engine/events/pokerus/check_pokerus.asm
+++ b/engine/events/pokerus/check_pokerus.asm
@@ -2,12 +2,12 @@
; Return carry if a monster in your party has Pokerus
; Get number of monsters to iterate over
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
jr z, .NoPokerus
ld b, a
; Check each monster in the party for Pokerus
- ld hl, PartyMon1PokerusStatus
+ ld hl, wPartyMon1PokerusStatus
ld de, PARTYMON_STRUCT_LENGTH
.Check:
ld a, [hl]
--- a/engine/events/pokerus/pokerus.asm
+++ b/engine/events/pokerus/pokerus.asm
@@ -1,7 +1,7 @@
GivePokerusAndConvertBerries: ; 2ed44
call ConvertBerriesToBerryJuice
- ld hl, PartyMon1PokerusStatus
- ld a, [PartyCount]
+ ld hl, wPartyMon1PokerusStatus
+ ld a, [wPartyCount]
ld b, a
ld de, PARTYMON_STRUCT_LENGTH
; Check to see if any of your Pokemon already has Pokerus.
@@ -28,7 +28,7 @@
ld a, [hRandomSub]
cp $3
ret nc ; 3/65536 chance (00 00, 00 01 or 00 02)
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld b, a
.randomMonSelectLoop
call Random
@@ -35,7 +35,7 @@
and $7
cp b
jr nc, .randomMonSelectLoop
- ld hl, PartyMon1PokerusStatus
+ ld hl, wPartyMon1PokerusStatus
call GetPartyLocation ; get pokerus byte of random mon
ld a, [hl]
and $f0
@@ -64,7 +64,7 @@
cp 1 + 33 percent
ret nc ; 1/3 chance
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp 1
ret z ; only one mon, nothing to do
@@ -91,7 +91,7 @@
ret
.checkPreviousMonsLoop
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp b
ret z ; no more mons
ld a, l
@@ -129,8 +129,8 @@
call Random
cp $10
ret nc ; 1/16 chance
- ld hl, PartyMons
- ld a, [PartyCount]
+ ld hl, wPartyMons
+ ld a, [wPartyCount]
.partyMonLoop
push af
push hl
--- a/engine/events/print_photo.asm
+++ b/engine/events/print_photo.asm
@@ -3,7 +3,7 @@
call PrintText
farcall SelectMonFromParty
jr c, .cancel
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
--- a/engine/events/print_unown.asm
+++ b/engine/events/print_unown.asm
@@ -1,5 +1,5 @@
UnownPrinter: ; 16be4
- ld a, [UnownDex]
+ ld a, [wUnownDex]
and a
ret z
@@ -7,10 +7,10 @@
push af
ld a, $1
ld [hInMenu], a
- ld a, [Options]
+ ld a, [wOptions]
push af
set NO_TEXT_SCROLL, a
- ld [Options], a
+ ld [wOptions], a
call ClearBGPalettes
call ClearTileMap
@@ -54,10 +54,10 @@
call WaitBGMap
ld a, UNOWN
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
xor a
- ld [TempMonDVs], a
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs], a
+ ld [wTempMonDVs + 1], a
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
@@ -89,7 +89,7 @@
.pressed_b
pop af
- ld [Options], a
+ ld [wOptions], a
pop af
ld [hInMenu], a
call ReturnToMapFromSubmenu
@@ -134,9 +134,9 @@
cp 26
jr z, .vacant
inc a
- ld [UnownLetter], a
+ ld [wUnownLetter], a
ld a, UNOWN
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
xor a
ld [wBoxAlignment], a
ld de, vTiles2
--- a/engine/events/print_unown_2.asm
+++ b/engine/events/print_unown_2.asm
@@ -30,7 +30,7 @@
cp 7 * 7
jr c, .loop
- ld hl, OverworldMap
+ ld hl, wOverworldMap
ld de, sScratch
ld bc, 7 * 7 tiles
call CopyBytes
@@ -100,7 +100,7 @@
rept \1
x = \1 * (\2 +- 1) + y
rept \2
- dw OverworldMap tile x
+ dw wOverworldMap tile x
x = x +- \2
endr
y = y + 1
--- a/engine/events/prof_oaks_pc.asm
+++ b/engine/events/prof_oaks_pc.asm
@@ -33,12 +33,12 @@
Rate: ; 0x26616
; calculate Seen/Owned
- ld hl, PokedexSeen
- ld b, EndPokedexSeen - PokedexSeen
+ ld hl, wPokedexSeen
+ ld b, wEndPokedexSeen - wPokedexSeen
call CountSetBits
ld [wd002], a
- ld hl, PokedexCaught
- ld b, EndPokedexCaught - PokedexCaught
+ ld hl, wPokedexCaught
+ ld b, wEndPokedexCaught - wPokedexCaught
call CountSetBits
ld [wd003], a
@@ -56,10 +56,10 @@
ret
.UpdateRatingBuffers: ; 0x26647
- ld hl, StringBuffer3
+ ld hl, wStringBuffer3
ld de, wd002
call .UpdateRatingBuffer
- ld hl, StringBuffer4
+ ld hl, wStringBuffer4
ld de, wd003
call .UpdateRatingBuffer
ret
--- a/engine/events/sacred_ash.asm
+++ b/engine/events/sacred_ash.asm
@@ -14,9 +14,9 @@
CheckAnyFaintedMon: ; 507fb
ld de, PARTYMON_STRUCT_LENGTH
- ld bc, PartySpecies
- ld hl, PartyMon1HP
- ld a, [PartyCount]
+ ld bc, wPartySpecies
+ ld hl, wPartyMon1HP
+ ld a, [wPartyCount]
and a
ret z
--- a/engine/events/special.asm
+++ b/engine/events/special.asm
@@ -4,13 +4,13 @@
; Adding to the party.
xor a
- ld [MonType], a
+ ld [wMonType], a
; Level 15 Shuckle.
ld a, SHUCKLE
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, 15
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
predef TryAddMonToParty
jr nc, .NotGiven
@@ -21,11 +21,11 @@
; Holding a Berry.
ld bc, PARTYMON_STRUCT_LENGTH
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
push af
push bc
- ld hl, PartyMon1Item
+ ld hl, wPartyMon1Item
call AddNTimes
ld [hl], BERRY
pop bc
@@ -32,7 +32,7 @@
pop af
; OT ID.
- ld hl, PartyMon1ID
+ ld hl, wPartyMon1ID
call AddNTimes
ld a, HIGH(MANIA_OT_ID)
ld [hli], a
@@ -39,17 +39,17 @@
ld [hl], LOW(MANIA_OT_ID)
; Nickname.
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
call SkipNames
ld de, SpecialShuckleNick
call CopyName2
; OT.
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
call SkipNames
ld de, SpecialShuckleOT
call CopyName2
@@ -58,12 +58,12 @@
ld hl, wDailyFlags
set 5, [hl] ; ENGINE_SHUCKLE_GIVEN
ld a, 1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.NotGiven:
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
SpecialShuckleOT:
@@ -75,12 +75,12 @@
farcall SelectMonFromParty
jr c, .refused
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp SHUCKLE
jr nz, .DontReturn
- ld a, [CurPartyMon]
- ld hl, PartyMon1ID
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1ID
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
@@ -93,8 +93,8 @@
jr nz, .DontReturn
; OT
- ld a, [CurPartyMon]
- ld hl, PartyMonOT
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonOT
call SkipNames
ld de, SpecialShuckleOT
.CheckOT:
@@ -110,8 +110,8 @@
.done
farcall CheckCurPartyMonFainted
jr c, .fainted
- ld a, [CurPartyMon]
- ld hl, PartyMon1Happiness
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1Happiness
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld a, [hl]
@@ -123,29 +123,29 @@
callfar RemoveMonFromPartyOrBox
ld a, SHUCKIE_RETURNED
.HappyToStayWithYou:
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.refused
ld a, SHUCKIE_REFUSED
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.DontReturn:
xor a ; SHUCKIE_WRONG_MON
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.fainted
ld a, SHUCKIE_FAINTED
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Special_BillsGrandfather: ; 73f7
farcall SelectMonFromParty
jr c, .cancel
- ld a, [CurPartySpecies]
- ld [ScriptVar], a
+ ld a, [wCurPartySpecies]
+ ld [wScriptVar], a
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
jp CopyPokemonName_Buffer1_Buffer3
@@ -152,7 +152,7 @@
.cancel
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Special_YoungerHaircutBrother: ; 7413
@@ -171,7 +171,7 @@
farcall SelectMonFromParty
pop hl
jr c, .nope
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
push hl
@@ -197,7 +197,7 @@
.ok
inc hl
ld a, [hli]
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld c, [hl]
call ChangeHappiness
ret
@@ -204,12 +204,12 @@
.nope
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.egg
ld a, 1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Data_YoungerHaircutBrother: ; 7459
@@ -226,8 +226,8 @@
db $ff, 2, HAPPINESS_MASSAGE ; 99.6% chance
CopyPokemonName_Buffer1_Buffer3: ; 746e
- ld hl, StringBuffer1
- ld de, StringBuffer3
+ ld hl, wStringBuffer1
+ ld de, wStringBuffer3
ld bc, MON_NAME_LENGTH
jp CopyBytes
--- a/engine/events/squirtbottle.asm
+++ b/engine/events/squirtbottle.asm
@@ -21,11 +21,11 @@
db "@"
.CheckCanUseSquirtbottle:
- ld a, [MapGroup]
+ ld a, [wMapGroup]
cp GROUP_ROUTE_36
jr nz, .nope
- ld a, [MapNumber]
+ ld a, [wMapNumber]
cp MAP_ROUTE_36
jr nz, .nope
@@ -37,11 +37,11 @@
jr nz, .nope
ld a, 1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.nope
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 50779
--- a/engine/events/sweet_scent.asm
+++ b/engine/events/sweet_scent.asm
@@ -52,13 +52,13 @@
.start_battle
ld a, $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.no_battle
xor a
- ld [ScriptVar], a
- ld [BattleType], a
+ ld [wScriptVar], a
+ ld [wBattleType], a
ret
; 50726
--- a/engine/events/trainer_scripts.asm
+++ b/engine/events/trainer_scripts.asm
@@ -11,7 +11,7 @@
encountermusic
showemote EMOTE_SHOCK, LAST_TALKED, 30
callasm TrainerWalkToPlayer
- applymovement2 MovementBuffer
+ applymovement2 wMovementBuffer
writeobjectxy LAST_TALKED
faceobject PLAYER, LAST_TALKED
jump StartBattleWithMapTrainerScript
--- a/engine/events/treemons.asm
+++ b/engine/events/treemons.asm
@@ -2,8 +2,8 @@
farcall StubbedTrainerRankings_TreeEncounters
xor a
- ld [TempWildMonSpecies], a
- ld [CurPartyLevel], a
+ ld [wTempWildMonSpecies], a
+ ld [wCurPartyLevel], a
ld hl, TreeMonMaps
call GetTreeMonSet
@@ -16,14 +16,14 @@
jr nc, .no_battle
ld a, BATTLETYPE_TREE
- ld [BattleType], a
+ ld [wBattleType], a
ld a, 1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.no_battle
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; b8219
@@ -30,8 +30,8 @@
RockMonEncounter: ; b8219
xor a
- ld [TempWildMonSpecies], a
- ld [CurPartyLevel], a
+ ld [wTempWildMonSpecies], a
+ ld [wCurPartyLevel], a
ld hl, RockMonMaps
call GetTreeMonSet
@@ -61,9 +61,9 @@
GetTreeMonSet: ; b823f
; Return carry and treemon set in a
; if the current map is in table hl.
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld e, a
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld d, a
.loop
ld a, [hli]
@@ -189,26 +189,26 @@
jr z, NoTreeMon
ld a, [hli]
- ld [TempWildMonSpecies], a
+ ld [wTempWildMonSpecies], a
ld a, [hl]
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
scf
ret
NoTreeMon: ; b843b
xor a
- ld [TempWildMonSpecies], a
- ld [CurPartyLevel], a
+ ld [wTempWildMonSpecies], a
+ ld [wCurPartyLevel], a
ret
; b8443
GetTreeScore: ; b8443
call .CoordScore
- ld [Buffer1], a
+ ld [wBuffer1], a
call .OTIDScore
- ld [Buffer2], a
+ ld [wBuffer2], a
ld c, a
- ld a, [Buffer1]
+ ld a, [wBuffer1]
sub c
jr z, .rare
jr nc, .ok
@@ -272,9 +272,9 @@
; b849d
.OTIDScore: ; b849d
- ld a, [PlayerID]
+ ld a, [wPlayerID]
ld [hDividend], a
- ld a, [PlayerID + 1]
+ ld a, [wPlayerID + 1]
ld [hDividend + 1], a
ld a, 10
ld [hDivisor], a
--- a/engine/events/unown_walls.asm
+++ b/engine/events/unown_walls.asm
@@ -1,5 +1,5 @@
Special_HoOhChamber: ; 0x8addb
- ld hl, PartySpecies
+ ld hl, wPartySpecies
ld a, [hl]
cp HO_OH ; is Ho-oh the first Pokémon in the party?
jr nz, .done ; if not, we're done
@@ -21,12 +21,12 @@
jr nz, .nope
ld a, WATER_STONE
- ld [CurItem], a
- ld hl, NumItems
+ ld [wCurItem], a
+ ld hl, wNumItems
call CheckItem
jr c, .open
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld b, a
inc b
.loop
@@ -34,7 +34,7 @@
jr z, .nope
ld a, b
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
push bc
ld a, MON_ITEM
call GetPartyParamLocation
@@ -104,7 +104,7 @@
; 8ae68
Special_DisplayUnownWords: ; 8ae68
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld hl, MenuDataHeaders_UnownWalls
and a
jr z, .load
@@ -129,7 +129,7 @@
ld e, SCREEN_WIDTH
add hl, de
add hl, de
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld c, a
ld de, UnownWalls
and a
@@ -143,7 +143,7 @@
jr nz, .loop2
.copy
call _DisplayUnownWords_CopyWord
- ld bc, AttrMap - TileMap
+ ld bc, wAttrMap - wTileMap
add hl, bc
call _DisplayUnownWords_FillAttr
call WaitBGMap2
--- a/engine/events/whiteout.asm
+++ b/engine/events/whiteout.asm
@@ -52,7 +52,7 @@
farcall StubbedTrainerRankings_WhiteOuts
; Halve the player's money.
- ld hl, Money
+ ld hl, wMoney
ld a, [hl]
srl a
ld [hli], a
@@ -77,6 +77,6 @@
xor a ; SPAWN_HOME
.yes
- ld [DefaultSpawnpoint], a
+ ld [wDefaultSpawnpoint], a
ret
; 1253d
--- a/engine/events_2.asm
+++ b/engine/events_2.asm
@@ -52,7 +52,7 @@
TryTileCollisionEvent:: ; 97c5f
call GetFacingTileCoord
- ld [EngineBuffer1], a
+ ld [wEngineBuffer1], a
ld c, a
farcall CheckFacingTileForStdScript
jr c, .done
@@ -63,7 +63,7 @@
jr .done
.whirlpool
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
call CheckWhirlpoolTile
jr nz, .waterfall
farcall TryWhirlpoolOW
@@ -70,7 +70,7 @@
jr .done
.waterfall
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
call CheckWaterfallTile
jr nz, .headbutt
farcall TryWaterfallOW
@@ -77,7 +77,7 @@
jr .done
.headbutt
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
call CheckHeadbuttTreeTile
jr nz, .surf
farcall TryHeadbuttOW
@@ -161,7 +161,7 @@
jr nc, .no
.ice_check
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
call CheckIceTile
jr z, .no
scf
@@ -202,7 +202,7 @@
; Species
ld a, [hli]
- ld [TempWildMonSpecies], a
+ ld [wTempWildMonSpecies], a
; Min level
ld a, [hli]
@@ -228,7 +228,7 @@
add d
.GotLevel:
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
xor a
ret
@@ -235,7 +235,7 @@
; 97d64
TryWildEncounter_BugContest: ; 97d64
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
call CheckSuperTallGrassTile
ld b, 40 percent
jr z, .ok
@@ -268,7 +268,7 @@
jr z, .NoCall
; If we're not on the bike, we don't have to be here.
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_BIKE
jr nz, .NoCall
@@ -594,7 +594,7 @@
.IsPlayerFacingDown: ; 97f38
push bc
- ld bc, PlayerStruct
+ ld bc, wPlayerStruct
call GetSpriteDirection
and a
pop bc
@@ -602,7 +602,7 @@
; 97f42
CmdQueue_StoneTable: ; 97f42
- ld de, PlayerStruct
+ ld de, wPlayerStruct
ld a, NUM_OBJECT_STRUCTS
.loop
push af
--- a/engine/evolution_animation.asm
+++ b/engine/evolution_animation.asm
@@ -2,21 +2,21 @@
push hl
push de
push bc
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
push af
ld a, [rOBP0]
push af
- ld a, [BaseDexNo]
+ ld a, [wBaseDexNo]
push af
call .EvolutionAnimation
pop af
- ld [BaseDexNo], a
+ ld [wBaseDexNo], a
pop af
ld [rOBP0], a
pop af
- ld [CurSpecies], a
+ ld [wCurSpecies], a
pop bc
pop de
pop hl
@@ -44,18 +44,18 @@
call Request2bpp
xor a
- ld [Danger], a
+ ld [wLowHealthAlarm], a
call WaitBGMap
xor a
ld [hBGMapMode], a
ld a, [wEvolutionOldSpecies]
- ld [PlayerHPPal], a
+ ld [wPlayerHPPal], a
ld c, $0
call .GetSGBLayout
ld a, [wEvolutionOldSpecies]
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
call .PlaceFrontpic
ld de, vTiles2
@@ -67,12 +67,12 @@
ld [wEvolutionPicOffset], a
call .ReplaceFrontpic
ld a, [wEvolutionNewSpecies]
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
call .LoadFrontpic
ld a, [wEvolutionOldSpecies]
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
ld a, $1
ld [hBGMapMode], a
@@ -101,7 +101,7 @@
ld [wEvolutionCanceled], a
ld a, [wEvolutionNewSpecies]
- ld [PlayerHPPal], a
+ ld [wPlayerHPPal], a
ld c, $0
call .GetSGBLayout
@@ -114,11 +114,11 @@
push af
ld a, $1
ld [wBoxAlignment], a
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
push af
- ld a, [PlayerHPPal]
- ld [CurPartySpecies], a
+ ld a, [wPlayerHPPal]
+ ld [wCurPartySpecies], a
hlcoord 7, 2
ld d, $0
ld e, ANIM_MON_EVOLVE
@@ -125,7 +125,7 @@
predef AnimateFrontpic
pop af
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
pop af
ld [wBoxAlignment], a
ret
@@ -138,7 +138,7 @@
ld [wEvolutionCanceled], a
ld a, [wEvolutionOldSpecies]
- ld [PlayerHPPal], a
+ ld [wPlayerHPPal], a
ld c, $0
call .GetSGBLayout
@@ -147,7 +147,7 @@
call .check_statused
ret c
- ld a, [PlayerHPPal]
+ ld a, [wPlayerHPPal]
call PlayMonCry
ret
; 4e703
@@ -258,8 +258,8 @@
; 4e794
.check_statused ; 4e794
- ld a, [CurPartyMon]
- ld hl, PartyMon1Species
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1Species
call GetPartyLocation
ld b, h
ld c, l
@@ -346,7 +346,7 @@
inc a
and $7
ld b, a
- ld hl, Sprite01Attributes
+ ld hl, wVirtualOAMSprite00Attributes
ld c, NUM_SPRITE_OAM_STRUCTS
.loop6
ld a, [hl]
--- a/engine/evolve.asm
+++ b/engine/evolve.asm
@@ -1,8 +1,8 @@
EvolvePokemon: ; 421d8
- ld hl, EvolvableFlags
+ ld hl, wEvolvableFlags
xor a
ld [hl], a
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld c, a
ld b, SET_FLAG
call EvoFlagAction
@@ -10,16 +10,16 @@
xor a
ld [wMonTriedToEvolve], a
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
push hl
push bc
push de
- ld hl, PartyCount
+ ld hl, wPartyCount
push hl
EvolveAfterBattle_MasterLoop
- ld hl, CurPartyMon
+ ld hl, wCurPartyMon
inc [hl]
pop hl
@@ -32,9 +32,9 @@
ld [wEvolutionOldSpecies], a
push hl
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld c, a
- ld hl, EvolvableFlags
+ ld hl, wEvolvableFlags
ld b, CHECK_FLAG
call EvoFlagAction
ld a, c
@@ -54,7 +54,7 @@
push hl
xor a
- ld [MonType], a
+ ld [wMonType], a
predef CopyPkmnToTempMon
pop hl
@@ -89,7 +89,7 @@
; EVOLVE_STAT
- ld a, [TempMonLevel]
+ ld a, [wTempMonLevel]
cp [hl]
jp c, .dont_evolve_1
@@ -97,8 +97,8 @@
jp z, .dont_evolve_1
push hl
- ld de, TempMonAttack
- ld hl, TempMonDefense
+ ld de, wTempMonAttack
+ ld hl, wTempMonDefense
ld c, 2
call StringCmp
ld a, ATK_EQ_DEF
@@ -118,7 +118,7 @@
.happiness
- ld a, [TempMonHappiness]
+ ld a, [wTempMonHappiness]
cp HAPPINESS_TO_EVOLVE
jp c, .dont_evolve_2
@@ -132,13 +132,13 @@
jr z, .happiness_daylight
; TR_NITE
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
cp NITE_F
jp nz, .dont_evolve_3
jr .proceed
.happiness_daylight
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
cp NITE_F
jp z, .dont_evolve_3
jr .proceed
@@ -161,12 +161,12 @@
cp LINK_TIMECAPSULE
jp z, .dont_evolve_3
- ld a, [TempMonItem]
+ ld a, [wTempMonItem]
cp b
jp nz, .dont_evolve_3
xor a
- ld [TempMonItem], a
+ ld [wTempMonItem], a
jr .proceed
@@ -173,7 +173,7 @@
.item
ld a, [hli]
ld b, a
- ld a, [CurItem]
+ ld a, [wCurItem]
cp b
jp nz, .dont_evolve_3
@@ -189,7 +189,7 @@
.level
ld a, [hli]
ld b, a
- ld a, [TempMonLevel]
+ ld a, [wTempMonLevel]
cp b
jp c, .dont_evolve_3
call IsMonHoldingEverstone
@@ -196,8 +196,8 @@
jp z, .dont_evolve_3
.proceed
- ld a, [TempMonLevel]
- ld [CurPartyLevel], a
+ ld a, [wTempMonLevel]
+ ld [wCurPartyLevel], a
ld a, $1
ld [wMonTriedToEvolve], a
@@ -205,8 +205,8 @@
ld a, [hl]
ld [wEvolutionNewSpecies], a
- ld a, [CurPartyMon]
- ld hl, PartyMonNicknames
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonNicknames
call GetNick
call CopyName1
ld hl, Text_WhatEvolving
@@ -238,8 +238,8 @@
pop hl
ld a, [hl]
- ld [CurSpecies], a
- ld [TempMonSpecies], a
+ ld [wCurSpecies], a
+ ld [wTempMonSpecies], a
ld [wEvolutionNewSpecies], a
ld [wd265], a
call GetPokemonName
@@ -262,13 +262,13 @@
call UpdateSpeciesNameIfNotNicknamed
call GetBaseData
- ld hl, TempMonExp + 2
- ld de, TempMonMaxHP
+ ld hl, wTempMonExp + 2
+ ld de, wTempMonMaxHP
ld b, $1
predef CalcPkmnStats
- ld a, [CurPartyMon]
- ld hl, PartyMons
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMons
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld e, l
@@ -278,7 +278,7 @@
ld a, [hli]
ld b, a
ld c, [hl]
- ld hl, TempMonMaxHP + 1
+ ld hl, wTempMonMaxHP + 1
ld a, [hld]
sub c
ld c, a
@@ -285,7 +285,7 @@
ld a, [hl]
sbc b
ld b, a
- ld hl, TempMonHP + 1
+ ld hl, wTempMonHP + 1
ld a, [hl]
add c
ld [hld], a
@@ -293,14 +293,14 @@
adc b
ld [hl], a
- ld hl, TempMonSpecies
+ ld hl, wTempMonSpecies
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
ld [wd265], a
xor a
- ld [MonType], a
+ ld [wMonType], a
call LearnLevelMoves
ld a, [wd265]
dec a
@@ -310,7 +310,7 @@
cp UNOWN
jr nz, .skip_unown
- ld hl, TempMonDVs
+ ld hl, wTempMonDVs
predef GetUnownLetter
callfar UpdateUnownDex
@@ -317,7 +317,7 @@
.skip_unown
pop de
pop hl
- ld a, [TempMonSpecies]
+ ld a, [wTempMonSpecies]
ld [hl], a
push hl
ld l, e
@@ -352,15 +352,15 @@
; 42414
UpdateSpeciesNameIfNotNicknamed: ; 42414
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
push af
- ld a, [BaseDexNo]
+ ld a, [wBaseDexNo]
ld [wd265], a
call GetPokemonName
pop af
- ld [CurSpecies], a
- ld hl, StringBuffer1
- ld de, StringBuffer2
+ ld [wCurSpecies], a
+ ld hl, wStringBuffer1
+ ld de, wStringBuffer2
.loop
ld a, [de]
inc de
@@ -370,15 +370,15 @@
cp "@"
jr nz, .loop
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld bc, MON_NAME_LENGTH
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
call AddNTimes
push hl
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
ld [wd265], a
call GetPokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
pop de
ld bc, MON_NAME_LENGTH
jp CopyBytes
@@ -394,8 +394,8 @@
IsMonHoldingEverstone: ; 42461
push hl
- ld a, [CurPartyMon]
- ld hl, PartyMon1Item
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld a, [hl]
@@ -431,7 +431,7 @@
LearnLevelMoves: ; 42487
ld a, [wd265]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
dec a
ld b, 0
ld c, a
@@ -453,7 +453,7 @@
jr z, .done
ld b, a
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
cp b
ld a, [hli]
jr nz, .find_move
@@ -460,8 +460,8 @@
push hl
ld d, a
- ld hl, PartyMon1Moves
- ld a, [CurPartyMon]
+ ld hl, wPartyMon1Moves
+ ld a, [wCurPartyMon]
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
@@ -489,7 +489,7 @@
jr .find_move
.done
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
ret
; 424e1
@@ -496,7 +496,7 @@
FillMoves: ; 424e1
-; Fill in moves at de for CurPartySpecies at CurPartyLevel
+; Fill in moves at de for wCurPartySpecies at wCurPartyLevel
push hl
push de
@@ -503,7 +503,7 @@
push bc
ld hl, EvosAttacksPointers
ld b, 0
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
dec a
add a
rl b
@@ -527,7 +527,7 @@
and a
jp z, .done
ld b, a
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
cp b
jp c, .done
ld a, [wEvolutionOldSpecies]
@@ -567,7 +567,7 @@
and a
jr z, .ShiftedMove
push de
- ld bc, PartyMon1PP - (PartyMon1Moves + NUM_MOVES - 1)
+ ld bc, wPartyMon1PP - (wPartyMon1Moves + NUM_MOVES - 1)
add hl, bc
ld d, h
ld e, l
@@ -627,9 +627,9 @@
; 42581
GetPreEvolution: ; 42581
-; Find the first mon to evolve into CurPartySpecies.
+; Find the first mon to evolve into wCurPartySpecies.
-; Return carry and the new species in CurPartySpecies
+; Return carry and the new species in wCurPartySpecies
; if a pre-evolution is found.
ld c, 0
@@ -644,7 +644,7 @@
.loop2 ; For each evolution...
ld a, [hli]
and a
- jr z, .no_evolve ; If we jump, this Pokemon does not evolve into CurPartySpecies.
+ jr z, .no_evolve ; If we jump, this Pokemon does not evolve into wCurPartySpecies.
cp EVOLVE_STAT ; This evolution type has the extra parameter of stat comparison.
jr nz, .not_tyrogue
inc hl
@@ -651,7 +651,7 @@
.not_tyrogue
inc hl
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp [hl]
jr z, .found_preevo
inc hl
@@ -670,7 +670,7 @@
.found_preevo
inc c
ld a, c
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
scf
ret
; 425b1
--- a/engine/experience.asm
+++ b/engine/experience.asm
@@ -1,6 +1,6 @@
CalcLevel: ; 50e1b
- ld a, [TempMonSpecies]
- ld [CurSpecies], a
+ ld a, [wTempMonSpecies]
+ ld [wCurSpecies], a
call GetBaseData
ld d, 1
.next_level
@@ -10,7 +10,7 @@
jr z, .got_level
call CalcExpAtLevel
push hl
- ld hl, TempMonExp + 2
+ ld hl, wTempMonExp + 2
ld a, [hProduct + 3]
ld c, a
ld a, [hld]
@@ -32,7 +32,7 @@
CalcExpAtLevel: ; 50e47
; (a/b)*n**3 + c*n**2 + d*n - e
- ld a, [BaseGrowthRate]
+ ld a, [wBaseGrowthRate]
add a
add a
ld c, a
--- a/engine/health.asm
+++ b/engine/health.asm
@@ -1,7 +1,7 @@
HealParty: ; c658
xor a
- ld [CurPartyMon], a
- ld hl, PartySpecies
+ ld [wCurPartyMon], a
+ ld hl, wPartySpecies
.loop
ld a, [hli]
cp -1
@@ -14,9 +14,9 @@
pop hl
.next
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
inc a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
jr .loop
.done
--- a/engine/init_gender.asm
+++ b/engine/init_gender.asm
@@ -65,11 +65,11 @@
InitGenderScreen: ; 48e14 (12:4e14)
ld a, $10
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, MUSIC_NONE
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, $0
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld c, 8
call DelayFrames
call ClearBGPalettes
@@ -79,7 +79,7 @@
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
ld a, $0
call ByteFill
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
xor a
call ByteFill
--- a/engine/init_hof_credits.asm
+++ b/engine/init_hof_credits.asm
@@ -9,7 +9,7 @@
ld bc, vBGMap1 - vBGMap0
ld a, " "
call ByteFill
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a
call ByteFill
@@ -39,7 +39,7 @@
ld bc, vBGMap1 - vBGMap0
ld a, " "
call ByteFill
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
xor a
call ByteFill
--- a/engine/init_map.asm
+++ b/engine/init_map.asm
@@ -16,7 +16,7 @@
ld [hBGMapMode], a
pop af
ld [hOAMUpdate], a
- ld hl, VramState
+ ld hl, wVramState
set 6, [hl]
ret
--- a/engine/intro_menu.asm
+++ b/engine/intro_menu.asm
@@ -78,7 +78,7 @@
ld [wPreviousLandmark], a
ld a, SPAWN_HOME
- ld [DefaultSpawnpoint], a
+ ld [wDefaultSpawnpoint], a
ld a, MAPSETUP_WARP
ld [hMapEntryMethod], a
@@ -106,8 +106,8 @@
_ResetWRAM: ; 5bae
- ld hl, Sprites
- ld bc, Options - Sprites
+ ld hl, wVirtualOAM
+ ld bc, wOptions - wVirtualOAM
xor a
call ByteFill
@@ -125,13 +125,13 @@
ld [hSecondsBackup], a
call DelayFrame
ld a, [hRandomSub]
- ld [PlayerID], a
+ ld [wPlayerID], a
ld a, [rLY]
ld [hSecondsBackup], a
call DelayFrame
ld a, [hRandomAdd]
- ld [PlayerID + 1], a
+ ld [wPlayerID + 1], a
call Random
ld [wSecretID], a
@@ -139,7 +139,7 @@
call Random
ld [wSecretID + 1], a
- ld hl, PartyCount
+ ld hl, wPartyCount
call .InitList
xor a
@@ -154,16 +154,16 @@
call .InitList
call CloseSRAM
- ld hl, NumItems
+ ld hl, wNumItems
call .InitList
- ld hl, NumKeyItems
+ ld hl, wNumKeyItems
call .InitList
- ld hl, NumBalls
+ ld hl, wNumBalls
call .InitList
- ld hl, PCItems
+ ld hl, wPCItems
call .InitList
xor a
@@ -191,27 +191,27 @@
call InitializeMagikarpHouse
xor a
- ld [MonType], a
+ ld [wMonType], a
ld [wJohtoBadges], a
ld [wKantoBadges], a
- ld [Coins], a
- ld [Coins + 1], a
+ ld [wCoins], a
+ ld [wCoins + 1], a
if START_MONEY >= $10000
ld a, HIGH(START_MONEY >> 8)
endc
- ld [Money], a
+ ld [wMoney], a
ld a, HIGH(START_MONEY) ; mid
- ld [Money + 1], a
+ ld [wMoney + 1], a
ld a, LOW(START_MONEY)
- ld [Money + 2], a
+ ld [wMoney + 2], a
xor a
ld [wWhichMomItem], a
- ld hl, MomItemTriggerBalance
+ ld hl, wMomItemTriggerBalance
ld [hl], HIGH(MOM_MONEY >> 8)
inc hl
ld [hl], HIGH(MOM_MONEY) ; mid
@@ -289,19 +289,19 @@
InitializeNPCNames: ; 5ce9
ld hl, .Rival
- ld de, RivalName
+ ld de, wRivalName
call .Copy
ld hl, .Mom
- ld de, MomsName
+ ld de, wMomsName
call .Copy
ld hl, .Red
- ld de, RedsName
+ ld de, wRedsName
call .Copy
ld hl, .Green
- ld de, GreensName
+ ld de, wGreensName
.Copy:
ld bc, NAME_LENGTH
@@ -324,7 +324,7 @@
LoadOrRegenerateLuckyIDNumber: ; 5d33
ld a, BANK(sLuckyIDNumber)
call GetSRAMBank
- ld a, [CurDay]
+ ld a, [wCurDay]
inc a
ld b, a
ld a, [sLuckyNumberDay]
@@ -371,11 +371,11 @@
.Check2Pass:
ld a, $8
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, LOW(MUSIC_NONE)
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, HIGH(MUSIC_NONE)
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
call ClearBGPalettes
call Continue_MobileAdapterMenu
call CloseWindow
@@ -397,7 +397,7 @@
.SpawnAfterE4:
ld a, SPAWN_NEW_BARK
- ld [DefaultSpawnpoint], a
+ ld [wDefaultSpawnpoint], a
call PostCreditsSpawn
jp FinishContinueFunction
; 5de2
@@ -404,7 +404,7 @@
SpawnAfterRed: ; 5de2
ld a, SPAWN_MT_SILVER
- ld [DefaultSpawnpoint], a
+ ld [wDefaultSpawnpoint], a
; 5de7
PostCreditsSpawn: ; 5de7
@@ -425,11 +425,11 @@
bit 1, [hl]
ret nz
ld a, 5
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, LOW(MUSIC_MOBILE_ADAPTER_MENU)
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, HIGH(MUSIC_MOBILE_ADAPTER_MENU)
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld c, 20
call DelayFrames
ld c, $1
@@ -436,11 +436,11 @@
farcall InitMobileProfile ; mobile
farcall _SaveData
ld a, 8
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, LOW(MUSIC_NONE)
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, HIGH(MUSIC_NONE)
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld c, 35
call DelayFrames
ret
@@ -643,7 +643,7 @@
bit 0, a ; Pokedex
ret z
push hl
- ld hl, PokedexCaught
+ ld hl, wPokedexCaught
if NUM_POKEMON % 8
ld b, NUM_POKEMON / 8 + 1
else
@@ -657,12 +657,12 @@
; 5f84
Continue_DisplayGameTime: ; 5f84
- ld de, GameTimeHours
+ ld de, wGameTimeHours
lb bc, 2, 3
call PrintNum
ld [hl], "<COLON>"
inc hl
- ld de, GameTimeMinutes
+ ld de, wGameTimeMinutes
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
jp PrintNum
; 5f99
@@ -679,9 +679,9 @@
call RotateFourPalettesRight
call RotateThreePalettesRight
xor a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, POKEMON_PROF
- ld [TrainerClass], a
+ ld [wTrainerClass], a
call Intro_PrepTrainerPic
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
@@ -694,8 +694,8 @@
call ClearTileMap
ld a, WOOPER
- ld [CurSpecies], a
- ld [CurPartySpecies], a
+ ld [wCurSpecies], a
+ ld [wCurPartySpecies], a
call GetBaseData
hlcoord 6, 4
@@ -702,8 +702,8 @@
call PrepMonFrontpic
xor a
- ld [TempMonDVs], a
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs], a
+ ld [wTempMonDVs + 1], a
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
@@ -717,9 +717,9 @@
call ClearTileMap
xor a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, POKEMON_PROF
- ld [TrainerClass], a
+ ld [wTrainerClass], a
call Intro_PrepTrainerPic
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
@@ -732,7 +732,7 @@
call ClearTileMap
xor a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
farcall DrawIntroPlayerPic
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
@@ -792,7 +792,7 @@
.NewName:
ld b, 1
- ld de, PlayerName
+ ld de, wPlayerName
farcall NamingScreen
call RotateThreePalettesRight
@@ -802,7 +802,7 @@
call WaitBGMap
xor a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
farcall DrawIntroPlayerPic
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
@@ -809,7 +809,7 @@
call GetSGBLayout
call RotateThreePalettesLeft
- ld hl, PlayerName
+ ld hl, wPlayerName
ld de, .Chris
ld a, [wPlayerGender]
bit 0, a
@@ -838,10 +838,10 @@
StorePlayerName: ; 60fa
ld a, "@"
ld bc, NAME_LENGTH
- ld hl, PlayerName
+ ld hl, wPlayerName
call ByteFill
- ld hl, PlayerName
- ld de, StringBuffer2
+ ld hl, wPlayerName
+ ld de, wStringBuffer2
call CopyName2
ret
; 610f
@@ -852,12 +852,12 @@
push af
ld a, 32 ; fade time
- ld [MusicFade], a
+ ld [wMusicFade], a
ld de, MUSIC_NONE
ld a, e
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, d
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld de, SFX_ESCAPE_ROPE
call PlaySFX
@@ -969,7 +969,7 @@
ld hl, vTiles0
call Request2bpp
- ld hl, Sprite01
+ ld hl, wVirtualOAMSprite00
ld de, .sprites
ld a, [de]
inc de
@@ -1097,7 +1097,7 @@
ld a, [hVBlankCounter]
and $7
ret nz
- ld hl, LYOverrides + $5f
+ ld hl, wLYOverrides + $5f
ld a, [hl]
dec a
ld bc, 2 * SCREEN_WIDTH
@@ -1143,7 +1143,7 @@
; Lay out a base (all lines scrolling together).
ld e, a
- ld hl, LYOverrides
+ ld hl, wLYOverrides
ld bc, 8 * 10 ; logo height
call ByteFill
@@ -1154,7 +1154,7 @@
inc a
ld b, 8 * 10 / 2 ; logo height / 2
- ld hl, LYOverrides + 1
+ ld hl, wLYOverrides + 1
.loop
ld [hli], a
inc hl
@@ -1279,9 +1279,9 @@
; Fade out the title screen music
xor a
- ld [MusicFadeID], a
- ld [MusicFadeID + 1], a
- ld hl, MusicFade
+ ld [wMusicFadeID], a
+ ld [wMusicFadeID + 1], a
+ ld hl, wMusicFade
ld [hl], 8 ; 1 second
ld hl, wTitleScreenTimer
@@ -1305,7 +1305,7 @@
ld hl, wTitleScreenTimer
inc [hl]
- ld a, [MusicFade]
+ ld a, [wMusicFade]
and a
ret nz
@@ -1333,7 +1333,7 @@
ld a, [wTitleScreenTimer]
and %00000011
ret nz
- ld bc, SpriteAnim10
+ ld bc, wSpriteAnim10
ld hl, SPRITEANIMSTRUCT_FRAME
add hl, bc ; over-the-top compicated way to load wc3ae into hl
ld l, [hl]
--- a/engine/item_effects.asm
+++ b/engine/item_effects.asm
@@ -1,11 +1,11 @@
_DoItemEffect:: ; e722
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [wd265], a
call GetItemName
call CopyName1
ld a, 1
ld [wItemEffectSucceeded], a
- ld a, [CurItem]
+ ld a, [wCurItem]
dec a
ld hl, ItemEffects
rst JumpTable
@@ -213,7 +213,7 @@
dec a
jp nz, UseBallInTrainerBattle
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp PARTY_LENGTH
jr nz, .room_in_party
@@ -227,24 +227,24 @@
.room_in_party
xor a
ld [wWildMon], a
- ld a, [CurItem]
+ ld a, [wCurItem]
cp PARK_BALL
call nz, ReturnToBattle_UseBall
- ld hl, Options
+ ld hl, wOptions
res NO_TEXT_SCROLL, [hl]
ld hl, UsedItemText
call PrintText
- ld a, [EnemyMonCatchRate]
+ ld a, [wEnemyMonCatchRate]
ld b, a
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
jp z, .catch_without_fail
- ld a, [CurItem]
+ ld a, [wCurItem]
cp MASTER_BALL
jp z, .catch_without_fail
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
ld hl, BallMultiplierFunctionTable
@@ -267,7 +267,7 @@
jp hl
.skip_or_return_from_ball_fn
- ld a, [CurItem]
+ ld a, [wCurItem]
cp LEVEL_BALL
ld a, b
jp z, .skip_hp_calc
@@ -275,7 +275,7 @@
ld a, b
ld [hMultiplicand + 2], a
- ld hl, EnemyMonHP
+ ld hl, wEnemyMonHP
ld b, [hl]
inc hl
ld c, [hl]
@@ -339,11 +339,11 @@
; benefit.
; Uncomment the line below to fix this.
ld b, a
- ld a, [EnemyMonStatus]
+ ld a, [wEnemyMonStatus]
and 1 << FRZ | SLP
ld c, 10
jr nz, .addstatus
- ; ld a, [EnemyMonStatus]
+ ; ld a, [wEnemyMonStatus]
and a
ld c, 5
jr nz, .addstatus
@@ -367,7 +367,7 @@
; Uncomment the line below to fix.
- ld a, [BattleMonItem]
+ ld a, [wBattleMonItem]
; ld b, a
farcall GetItemHeldEffect
ld a, b
@@ -383,7 +383,7 @@
.skip_hp_calc
ld b, a
- ld [Buffer1], a
+ ld [wBuffer1], a
call Random
cp b
@@ -392,7 +392,7 @@
jr nc, .fail_to_catch
.catch_without_fail
- ld a, [EnemyMonSpecies]
+ ld a, [wEnemyMonSpecies]
.fail_to_catch
ld [wWildMon], a
@@ -399,7 +399,7 @@
ld c, 20
call DelayFrames
- ld a, [CurItem]
+ ld a, [wCurItem]
cp POKE_BALL + 1 ; Assumes Master/Ultra/Great come before
jr c, .not_kurt_ball
ld a, POKE_BALL
@@ -408,12 +408,12 @@
ld de, ANIM_THROW_POKE_BALL
ld a, e
- ld [FXAnimID], a
+ ld [wFXAnimID], a
ld a, d
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
xor a
ld [hBattleTurn], a
- ld [Buffer2], a
+ ld [wBuffer2], a
ld [wNumHits], a
predef PlayBattleAnim
@@ -420,7 +420,7 @@
ld a, [wWildMon]
and a
jr nz, .caught
- ld a, [Buffer2]
+ ld a, [wBuffer2]
cp $1
ld hl, Text_NoShake
jp z, .shake_and_break_free
@@ -435,7 +435,7 @@
jp z, .shake_and_break_free
.caught
- ld hl, EnemyMonStatus
+ ld hl, wEnemyMonStatus
ld a, [hli]
push af
inc hl
@@ -444,11 +444,11 @@
ld a, [hl]
push af
push hl
- ld hl, EnemyMonItem
+ ld hl, wEnemyMonItem
ld a, [hl]
push af
push hl
- ld hl, EnemySubStatus5
+ ld hl, wEnemySubStatus5
ld a, [hl]
push af
set SUBSTATUS_TRANSFORMED, [hl]
@@ -455,7 +455,7 @@
; This code is buggy. Any wild Pokémon that has Transformed will be
; caught as a Ditto, even if it was something else like Mew.
-; To fix, do not set [TempEnemyMonSpecies] to DITTO.
+; To fix, do not set [wTempEnemyMonSpecies] to DITTO.
bit SUBSTATUS_TRANSFORMED, a
jr nz, .ditto
jr .not_ditto
@@ -462,26 +462,26 @@
.ditto
ld a, DITTO
- ld [TempEnemyMonSpecies], a
+ ld [wTempEnemyMonSpecies], a
jr .load_data
.not_ditto
set SUBSTATUS_TRANSFORMED, [hl]
ld hl, wEnemyBackupDVs
- ld a, [EnemyMonDVs]
+ ld a, [wEnemyMonDVs]
ld [hli], a
- ld a, [EnemyMonDVs + 1]
+ ld a, [wEnemyMonDVs + 1]
ld [hl], a
.load_data
- ld a, [TempEnemyMonSpecies]
- ld [CurPartySpecies], a
- ld a, [EnemyMonLevel]
- ld [CurPartyLevel], a
+ ld a, [wTempEnemyMonSpecies]
+ ld [wCurPartySpecies], a
+ ld a, [wEnemyMonLevel]
+ ld [wCurPartyLevel], a
farcall LoadEnemyMon
pop af
- ld [EnemySubStatus5], a
+ ld [wEnemySubStatus5], a
pop hl
pop af
@@ -495,25 +495,25 @@
pop af
ld [hl], a
- ld hl, EnemySubStatus5
+ ld hl, wEnemySubStatus5
bit SUBSTATUS_TRANSFORMED, [hl]
jr nz, .Transformed
ld hl, wWildMonMoves
- ld de, EnemyMonMoves
+ ld de, wEnemyMonMoves
ld bc, NUM_MOVES
call CopyBytes
ld hl, wWildMonPP
- ld de, EnemyMonPP
+ ld de, wEnemyMonPP
ld bc, NUM_MOVES
call CopyBytes
.Transformed:
- ld a, [EnemyMonSpecies]
+ ld a, [wEnemyMonSpecies]
ld [wWildMon], a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld [wd265], a
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
jp z, .FinishTutorial
@@ -545,12 +545,12 @@
call ClearSprites
- ld a, [EnemyMonSpecies]
+ ld a, [wEnemyMonSpecies]
ld [wd265], a
predef NewPokedexEntry
.skip_pokedex
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_CONTEST
jp z, .catch_bug_contest_mon
cp BATTLETYPE_CELEBI
@@ -559,12 +559,12 @@
set 6, [hl]
.not_celebi
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp PARTY_LENGTH
jr z, .SendToPC
xor a ; PARTYMON
- ld [MonType], a
+ ld [wMonType], a
call ClearSprites
predef TryAddMonToParty
@@ -571,13 +571,13 @@
farcall SetCaughtData
- ld a, [CurItem]
+ ld a, [wCurItem]
cp FRIEND_BALL
jr nz, .SkipPartyMonFriendBall
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1Happiness
+ ld hl, wPartyMon1Happiness
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
@@ -588,7 +588,7 @@
ld hl, Text_AskNicknameNewlyCaughtMon
call PrintText
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
call GetPokemonName
@@ -595,10 +595,10 @@
call YesNoBox
jp c, .return_from_capture
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld [CurPartyMon], a
- ld hl, PartyMonNicknames
+ ld [wCurPartyMon], a
+ ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
call AddNTimes
@@ -606,7 +606,7 @@
ld e, l
push de
xor a ; PARTYMON
- ld [MonType], a
+ ld [wMonType], a
ld b, 0
farcall NamingScreen
@@ -615,7 +615,7 @@
call LoadStandardFont
pop hl
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call InitName
jp .return_from_capture
@@ -636,7 +636,7 @@
ld hl, wBattleResult
set 7, [hl]
.BoxNotFullYet:
- ld a, [CurItem]
+ ld a, [wCurItem]
cp FRIEND_BALL
jr nz, .SkipBoxMonFriendBall
; The captured mon is now first in the box
@@ -648,7 +648,7 @@
ld hl, Text_AskNicknameNewlyCaughtMon
call PrintText
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
call GetPokemonName
@@ -656,9 +656,9 @@
jr c, .SkipBoxMonNickname
xor a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld a, BOXMON
- ld [MonType], a
+ ld [wMonType], a
ld de, wMonOrItemNameBuffer
ld b, $0
farcall NamingScreen
@@ -672,7 +672,7 @@
call CopyBytes
ld hl, sBoxMonNicknames
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call InitName
call CloseSRAM
@@ -707,7 +707,7 @@
call ClearSprites
.return_from_capture
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
ret z
cp BATTLETYPE_DEBUG
@@ -723,7 +723,7 @@
call ClearTileMap
.toss
- ld hl, NumItems
+ ld hl, wNumItems
inc a
ld [wItemQuantityChangeBuffer], a
jp TossItem
@@ -772,7 +772,7 @@
GetPokedexEntryBank:
push hl
push de
- ld a, [EnemyMonSpecies]
+ ld a, [wEnemyMonSpecies]
rlca
rlca
maskbits NUM_DEX_ENTRY_BANKS
@@ -797,7 +797,7 @@
; else add 20 to catch rate if weight < 307.2 kg
; else add 30 to catch rate if weight < 409.6 kg
; else add 40 to catch rate (never happens)
- ld a, [EnemyMonSpecies]
+ ld a, [wEnemyMonSpecies]
ld hl, PokedexDataPointerTable
dec a
ld e, a
@@ -893,7 +893,7 @@
LureBallMultiplier:
; multiply catch rate by 3 if this is a fishing rod battle
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_FISH
ret nz
@@ -918,7 +918,7 @@
GLOBAL EvosAttacksPointers
push bc
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
dec a
ld c, a
ld b, 0
@@ -965,20 +965,20 @@
; Reality: multiply catch rate by 8 if mons are of same species, same sex
; does species match?
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
ld c, a
- ld a, [TempBattleMonSpecies]
+ ld a, [wTempBattleMonSpecies]
cp c
ret nz
; check player mon species
push bc
- ld a, [TempBattleMonSpecies]
- ld [CurPartySpecies], a
+ ld a, [wTempBattleMonSpecies]
+ ld [wCurPartySpecies], a
xor a ; PARTYMON
- ld [MonType], a
- ld a, [CurBattleMon]
- ld [CurPartyMon], a
+ ld [wMonType], a
+ ld a, [wCurBattleMon]
+ ld [wCurPartyMon], a
farcall GetGender
jr c, .done1 ; no effect on genderless
@@ -989,10 +989,10 @@
; check wild mon species
push de
- ld a, [TempEnemyMonSpecies]
- ld [CurPartySpecies], a
+ ld a, [wTempEnemyMonSpecies]
+ ld [wCurPartySpecies], a
ld a, WILDMON
- ld [MonType], a
+ ld [wMonType], a
farcall GetGender
jr c, .done2 ; no effect on genderless
@@ -1030,7 +1030,7 @@
; FleeMons tables.
; Reality: multiply catch rate by 4 if enemy mon is one of the first three in
; the first FleeMons table.
- ld a, [TempEnemyMonSpecies]
+ ld a, [wTempEnemyMonSpecies]
ld c, a
ld hl, FleeMons
ld d, 3
@@ -1063,9 +1063,9 @@
; multiply catch rate by 8 if player mon level / 4 > enemy mon level
; multiply catch rate by 4 if player mon level / 2 > enemy mon level
; multiply catch rate by 2 if player mon level > enemy mon level
- ld a, [BattleMonLevel]
+ ld a, [wBattleMonLevel]
ld c, a
- ld a, [EnemyMonLevel]
+ ld a, [wEnemyMonLevel]
cp c
ret nc ; if player is lower level, we're done here
sla b
@@ -1253,7 +1253,7 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld de, StringBuffer2
+ ld de, wStringBuffer2
ld bc, ITEM_NAME_LENGTH
call CopyBytes
@@ -1316,7 +1316,7 @@
GetStatExpRelativePointer: ; eed9
- ld a, [CurItem]
+ ld a, [wCurItem]
ld hl, Table_eeeb
.next
cp [hl]
@@ -1342,16 +1342,16 @@
RareCandy_StatBooster_GetParameters: ; eef5
- ld a, [CurPartySpecies]
- ld [CurSpecies], a
+ ld a, [wCurPartySpecies]
+ ld [wCurSpecies], a
ld [wd265], a
ld a, MON_LEVEL
call GetPartyParamLocation
ld a, [hl]
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
call GetBaseData
- ld a, [CurPartyMon]
- ld hl, PartyMonNicknames
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonNicknames
call GetNick
ret
; 0xef14
@@ -1374,7 +1374,7 @@
inc a
ld [hl], a
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
push de
ld d, a
farcall CalcExpAtLevel
@@ -1421,7 +1421,7 @@
call ItemActionText
xor a ; PARTYMON
- ld [MonType], a
+ ld [wMonType], a
predef CopyPkmnToTempMon
hlcoord 9, 0
@@ -1436,8 +1436,8 @@
call WaitPressAorB_BlinkCursor
xor a ; PARTYMON
- ld [MonType], a
- ld a, [CurPartySpecies]
+ ld [wMonType], a
+ ld a, [wCurPartySpecies]
ld [wd265], a
predef LearnLevelMoves
@@ -1511,7 +1511,7 @@
xor a
ld [hl], a
ld a, b
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
call HealStatus
call Play_SFX_FULL_HEAL
call ItemActionTextWaitButton
@@ -1522,7 +1522,7 @@
IsItemUsedOnConfusedMon: ; f009 (3:7009)
call IsItemUsedOnBattleMon
jr nc, .nope
- ld a, [PlayerSubStatus3]
+ ld a, [wPlayerSubStatus3]
bit SUBSTATUS_CONFUSED, a
jr z, .nope
ld a, c
@@ -1541,9 +1541,9 @@
ld a, MON_HP
call GetPartyParamLocation
ld a, [hli]
- ld [BattleMonHP], a
+ ld [wBattleMonHP], a
ld a, [hld]
- ld [BattleMonHP + 1], a
+ ld [wBattleMonHP + 1], a
ret
HealStatus: ; f030 (3:7030)
@@ -1550,16 +1550,16 @@
call IsItemUsedOnBattleMon
ret nc
xor a
- ld [BattleMonStatus], a
- ld hl, PlayerSubStatus5
+ ld [wBattleMonStatus], a
+ ld hl, wPlayerSubStatus5
res SUBSTATUS_TOXIC, [hl]
- ld hl, PlayerSubStatus1
+ ld hl, wPlayerSubStatus1
res SUBSTATUS_NIGHTMARE, [hl]
call GetItemHealingAction
ld a, c
cp %11111111
jr nz, .not_full_heal
- ld hl, PlayerSubStatus3
+ ld hl, wPlayerSubStatus3
res SUBSTATUS_CONFUSED, [hl]
.not_full_heal
push bc
@@ -1569,7 +1569,7 @@
GetItemHealingAction: ; f058 (3:7058)
push hl
- ld a, [CurItem]
+ ld a, [wCurItem]
ld hl, StatusHealingActions
ld bc, 3
.next
@@ -1640,7 +1640,7 @@
and a
jr z, .skip_to_revive
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld c, a
ld d, 0
ld hl, wBattleParticipantsIncludingFainted
@@ -1650,7 +1650,7 @@
and a
jr z, .skip_to_revive
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld c, a
ld hl, wBattleParticipantsNotFainted
ld b, SET_FLAG
@@ -1658,8 +1658,8 @@
.skip_to_revive
xor a
- ld [Danger], a
- ld a, [CurItem]
+ ld [wLowHealthAlarm], a
+ ld a, [wCurItem]
cp REVIVE
jr z, .revive_half_hp
@@ -1672,7 +1672,7 @@
.finish_revive
call HealHP_SFX_GFX
ld a, PARTYMENUTEXT_REVIVE
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
call ItemActionTextWaitButton
call UseDisposableItem
ld a, 0
@@ -1701,7 +1701,7 @@
.FullRestore: ; f144
xor a
- ld [Danger], a
+ ld [wLowHealthAlarm], a
call ReviveFullHP
ld a, MON_STATUS
call GetPartyParamLocation
@@ -1712,7 +1712,7 @@
call BattlemonRestoreHealth
call HealHP_SFX_GFX
ld a, PARTYMENUTEXT_HEAL_HP
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
call ItemActionTextWaitButton
call UseDisposableItem
ld a, 0
@@ -1721,7 +1721,7 @@
BitterBerry: ; f16a
- ld hl, PlayerSubStatus3
+ ld hl, wPlayerSubStatus3
bit SUBSTATUS_CONFUSED, [hl]
ld a, 1
jr z, .done
@@ -1798,13 +1798,13 @@
ret nc
xor a
- ld [Danger], a
+ ld [wLowHealthAlarm], a
call GetHealingItemAmount
call RestoreHealth
call BattlemonRestoreHealth
call HealHP_SFX_GFX
ld a, PARTYMENUTEXT_HEAL_HP
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
call ItemActionTextWaitButton
call UseDisposableItem
ld a, 0
@@ -1815,7 +1815,7 @@
ld de, SFX_POTION
call WaitPlaySFX
pop de
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
hlcoord 11, 0
ld bc, SCREEN_WIDTH * 2
call AddNTimes
@@ -1827,7 +1827,7 @@
call .SelectMon
ret c
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr nz, .not_egg
@@ -1841,7 +1841,7 @@
.SelectMon: ; f20b (3:720b)
ld a, b
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
push hl
push de
push bc
@@ -1865,10 +1865,10 @@
ret
ItemActionText: ; f24a (3:724a)
- ld [PartyMenuActionText], a
- ld a, [CurPartySpecies]
+ ld [wPartyMenuActionText], a
+ ld a, [wCurPartySpecies]
push af
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
push af
push hl
push de
@@ -1882,9 +1882,9 @@
pop de
pop hl
pop af
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
pop af
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ret
ItemActionTextWaitButton: ; f279 (3:7279)
@@ -1891,10 +1891,10 @@
xor a
ld [hBGMapMode], a
hlcoord 0, 0
- ld bc, TileMapEnd - TileMap
+ ld bc, wTileMapEnd - wTileMap
ld a, " "
call ByteFill
- ld a, [PartyMenuActionText]
+ ld a, [wPartyMenuActionText]
call ItemActionText
ld a, $1
ld [hBGMapMode], a
@@ -1917,9 +1917,9 @@
ld a, [wBattleMode]
and a
ret z
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
push hl
- ld hl, CurBattleMon
+ ld hl, wCurBattleMon
cp [hl]
pop hl
jr nz, .nope
@@ -2017,24 +2017,24 @@
ld a, MON_HP
call GetPartyParamLocation
ld a, [hli]
- ld [Buffer6], a
+ ld [wBuffer6], a
ld a, [hl]
- ld [Buffer5], a
+ ld [wBuffer5], a
ret
; f336 (3:7336)
LoadHPIntoBuffer5: ; f336
ld a, d
- ld [Buffer6], a
+ ld [wBuffer6], a
ld a, e
- ld [Buffer5], a
+ ld [wBuffer5], a
ret
; f33f
LoadHPFromBuffer5: ; f33f
- ld a, [Buffer6]
+ ld a, [wBuffer6]
ld d, a
- ld a, [Buffer5]
+ ld a, [wBuffer5]
ld e, a
ret
; f348
@@ -2043,15 +2043,15 @@
ld a, MON_HP
call GetPartyParamLocation
ld a, [hli]
- ld [Buffer4], a
+ ld [wBuffer4], a
ld a, [hl]
- ld [Buffer3], a
+ ld [wBuffer3], a
ret
LoadHPFromBuffer3: ; f356 (3:7356)
- ld a, [Buffer4]
+ ld a, [wBuffer4]
ld d, a
- ld a, [Buffer3]
+ ld a, [wBuffer3]
ld e, a
ret
@@ -2060,16 +2060,16 @@
ld a, MON_MAXHP
call GetPartyParamLocation
ld a, [hli]
- ld [Buffer2], a
+ ld [wBuffer2], a
ld a, [hl]
- ld [Buffer1], a
+ ld [wBuffer1], a
pop hl
ret
LoadHPFromBuffer1: ; f36f (3:736f)
- ld a, [Buffer2]
+ ld a, [wBuffer2]
ld d, a
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld e, a
ret
@@ -2094,7 +2094,7 @@
GetHealingItemAmount: ; f395 (3:7395)
push hl
- ld a, [CurItem]
+ ld a, [wCurItem]
ld hl, HealingHPAmounts
ld d, a
.next
@@ -2127,7 +2127,7 @@
call .SelectMilkDrinkRecipient ; select pokemon
jr c, .skip
ld a, b
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
call IsMonFainted
call GetOneFifthMaxHP
call RemoveHP
@@ -2136,7 +2136,7 @@
pop bc
call GetOneFifthMaxHP
ld a, c
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
call IsMonFainted
call RestoreHealth
call HealHP_SFX_GFX
@@ -2153,7 +2153,7 @@
.loop
push bc
ld a, PARTYMENUACTION_HEALING_ITEM
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
call ChoosePkmnToUseItemOn
pop bc
jr c, .set_carry
@@ -2164,7 +2164,7 @@
cp c
jr z, .cant_use ; chose the same mon as user
ld a, c
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
call IsMonFainted
jr z, .cant_use
call IsMonAtFullHealth
@@ -2236,7 +2236,7 @@
XAccuracy: ; f482
- ld hl, PlayerSubStatus4
+ ld hl, wPlayerSubStatus4
bit SUBSTATUS_X_ACCURACY, [hl]
jp nz, WontHaveAnyEffect_NotUsedMessage
set SUBSTATUS_X_ACCURACY, [hl]
@@ -2264,7 +2264,7 @@
GuardSpec: ; f4ab
- ld hl, PlayerSubStatus4
+ ld hl, wPlayerSubStatus4
bit SUBSTATUS_MIST, [hl]
jp nz, WontHaveAnyEffect_NotUsedMessage
set SUBSTATUS_MIST, [hl]
@@ -2273,7 +2273,7 @@
DireHit: ; f4b8
- ld hl, PlayerSubStatus4
+ ld hl, wPlayerSubStatus4
bit SUBSTATUS_FOCUS_ENERGY, [hl]
jp nz, WontHaveAnyEffect_NotUsedMessage
set SUBSTATUS_FOCUS_ENERGY, [hl]
@@ -2287,7 +2287,7 @@
XSpecial: ; f4c5
call UseItemText
- ld a, [CurItem]
+ ld a, [wCurItem]
ld hl, XItemStats
.loop
@@ -2302,8 +2302,8 @@
ld b, [hl]
xor a
ld [hBattleTurn], a
- ld [AttackMissed], a
- ld [EffectFailed], a
+ ld [wAttackMissed], a
+ ld [wEffectFailed], a
farcall CheckIfStatCanBeRaised
call WaitSFX
@@ -2310,8 +2310,8 @@
farcall BattleCommand_StatUpMessage
farcall BattleCommand_StatUpFailText
- ld a, [CurBattleMon]
- ld [CurPartyMon], a
+ ld a, [wCurBattleMon]
+ ld [wCurPartyMon], a
ld c, HAPPINESS_USEDXITEM
farcall ChangeHappiness
ret
@@ -2331,21 +2331,21 @@
ld b, $ff ^ SLP
- ld hl, PartyMon1Status
+ ld hl, wPartyMon1Status
call .CureSleep
ld a, [wBattleMode]
cp WILD_BATTLE
jr z, .skip_otrainer
- ld hl, OTPartyMon1Status
+ ld hl, wOTPartyMon1Status
call .CureSleep
.skip_otrainer
- ld hl, BattleMonStatus
+ ld hl, wBattleMonStatus
ld a, [hl]
and b
ld [hl], a
- ld hl, EnemyMonStatus
+ ld hl, wEnemyMonStatus
ld a, [hl]
and b
ld [hl], a
@@ -2357,7 +2357,7 @@
ld hl, .PlayedTheFlute
call PrintText
- ld a, [Danger]
+ ld a, [wLowHealthAlarm]
and 1 << DANGER_ON_F
jr nz, .dummy2
.dummy2
@@ -2471,7 +2471,7 @@
MaxEther:
Elixer:
Mysteryberry: ; f5bf
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [wd002], a
.loop
@@ -2496,10 +2496,10 @@
.ppup
call PrintText
- ld a, [CurMoveNum]
+ ld a, [wCurMoveNum]
push af
xor a
- ld [CurMoveNum], a
+ ld [wCurMoveNum], a
ld a, $2
ld [wMoveSelectionMenuType], a
farcall MoveSelectionScreen
@@ -2506,9 +2506,9 @@
pop bc
ld a, b
- ld [CurMoveNum], a
+ ld [wCurMoveNum], a
jr nz, .loop
- ld hl, PartyMon1Moves
+ ld hl, wPartyMon1Moves
ld bc, PARTYMON_STRUCT_LENGTH
call GetMthMoveOfNthPartymon
@@ -2560,12 +2560,12 @@
ld a, [wBattleMode]
and a
jr z, .not_in_battle
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld b, a
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
cp b
jr nz, .not_in_battle
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_TRANSFORMED, a
jr nz, .not_in_battle
call .UpdateBattleMonPP
@@ -2577,11 +2577,11 @@
jr FinishPPRestore
.UpdateBattleMonPP:
- ld a, [CurPartyMon]
- ld hl, PartyMon1Moves
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1Moves
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
- ld de, BattleMonMoves
+ ld de, wBattleMonMoves
ld b, NUM_MOVES
.loop
ld a, [de]
@@ -2592,7 +2592,7 @@
push hl
push de
push bc
- rept NUM_MOVES + 2 ; BattleMonPP - BattleMonMoves
+ rept NUM_MOVES + 2 ; wBattleMonPP - wBattleMonMoves
inc de
endr
ld bc, MON_PP - MON_MOVES
@@ -2627,7 +2627,7 @@
ld b, NUM_MOVES
.moveLoop
push bc
- ld hl, PartyMon1Moves
+ ld hl, wPartyMon1Moves
ld bc, PARTYMON_STRUCT_LENGTH
call GetMthMoveOfNthPartymon
ld a, [hl]
@@ -2661,9 +2661,9 @@
RestorePP: ; f6e8
xor a ; PARTYMON
- ld [MonType], a
+ ld [wMonType], a
call GetMaxPPOfMove
- ld hl, PartyMon1PP
+ ld hl, wPartyMon1PP
ld bc, PARTYMON_STRUCT_LENGTH
call GetMthMoveOfNthPartymon
ld a, [wd265]
@@ -2895,7 +2895,7 @@
call Play_SFX_FULL_HEAL
call WaitPressAorB_BlinkCursor
UseDisposableItem: ; f795
- ld hl, NumItems
+ ld hl, wNumItems
ld a, 1
ld [wItemQuantityChangeBuffer], a
jp TossItem
@@ -2905,9 +2905,9 @@
call ReturnToBattle_UseBall
ld de, ANIM_THROW_POKE_BALL
ld a, e
- ld [FXAnimID], a
+ ld [wFXAnimID], a
ld a, d
- ld [FXAnimID + 1], a
+ ld [wFXAnimID + 1], a
xor a
ld [wBattleAnimParam], a
ld [hBattleTurn], a
@@ -3058,12 +3058,12 @@
ld a, MON_MOVES
call GetPartyParamLocation
push hl
- ld de, Buffer1
+ ld de, wBuffer1
predef FillPP
pop hl
ld bc, MON_PP - MON_MOVES
add hl, bc
- ld de, Buffer1
+ ld de, wBuffer1
ld b, 0
.loop
inc b
@@ -3151,7 +3151,7 @@
pop de
xor a ; PARTYMON
ld [wMenuCursorY], a
- ld [MonType], a
+ ld [wMonType], a
ld c, NUM_MOVES
.loop
ld a, [hli]
@@ -3180,31 +3180,31 @@
GetMaxPPOfMove: ; f8ec
- ld a, [StringBuffer1 + 0]
+ ld a, [wStringBuffer1 + 0]
push af
- ld a, [StringBuffer1 + 1]
+ ld a, [wStringBuffer1 + 1]
push af
- ld a, [MonType]
+ ld a, [wMonType]
and a
- ld hl, PartyMon1Moves
+ ld hl, wPartyMon1Moves
ld bc, PARTYMON_STRUCT_LENGTH
jr z, .got_partymon ; PARTYMON
- ld hl, OTPartyMon1Moves
+ ld hl, wOTPartyMon1Moves
dec a
jr z, .got_partymon ; OTPARTYMON
- ld hl, TempMonMoves
+ ld hl, wTempMonMoves
dec a
jr z, .got_nonpartymon ; BOXMON
- ld hl, TempMonMoves ; Wasted cycles
+ ld hl, wTempMonMoves ; Wasted cycles
dec a
jr z, .got_nonpartymon ; TEMPMON
- ld hl, BattleMonMoves ; WILDMON
+ ld hl, wBattleMonMoves ; WILDMON
.got_nonpartymon ; BOXMON, TEMPMON, WILDMON
call GetMthMoveOfCurrentMon
@@ -3224,16 +3224,16 @@
ld a, BANK(Moves)
call GetFarByte
ld b, a
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld [de], a
pop hl
push bc
ld bc, MON_PP - MON_MOVES
- ld a, [MonType]
+ ld a, [wMonType]
cp WILDMON
jr nz, .notwild
- ld bc, EnemyMonPP - EnemyMonMoves
+ ld bc, wEnemyMonPP - wEnemyMonMoves
.notwild
add hl, bc
ld a, [hl]
@@ -3241,7 +3241,7 @@
pop bc
or b
- ld hl, StringBuffer1 + 1
+ ld hl, wStringBuffer1 + 1
ld [hl], a
xor a
ld [wd265], a
@@ -3252,14 +3252,14 @@
ld [wd265], a
pop af
- ld [StringBuffer1 + 1], a
+ ld [wStringBuffer1 + 1], a
pop af
- ld [StringBuffer1 + 0], a
+ ld [wStringBuffer1 + 0], a
ret
; f963
GetMthMoveOfNthPartymon: ; f963
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
GetMthMoveOfCurrentMon: ; f969
--- a/engine/items.asm
+++ b/engine/items.asm
@@ -27,13 +27,13 @@
jp ReceiveKeyItem
.Ball: ; d1fb
- ld hl, NumBalls
+ ld hl, wNumBalls
jp PutItemInPocket
.TMHM: ; d201
ld h, d
ld l, e
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
call GetTMHMNumber
jp ReceiveTMHM
@@ -57,13 +57,13 @@
dw .TMHM
.Ball: ; d228
- ld hl, NumBalls
+ ld hl, wNumBalls
jp RemoveItemFromPocket
.TMHM: ; d22e
ld h, d
ld l, e
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
call GetTMHMNumber
jp TossTMHM
@@ -99,13 +99,13 @@
dw .TMHM
.Ball: ; d25f
- ld hl, NumBalls
+ ld hl, wNumBalls
jp CheckTheItem
.TMHM: ; d265
ld h, d
ld l, e
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
call GetTMHMNumber
jp CheckTMHM
@@ -124,28 +124,28 @@
DoesHLEqualNumItems: ; d27b
ld a, l
- cp LOW(NumItems)
+ cp LOW(wNumItems)
ret nz
ld a, h
- cp HIGH(NumItems)
+ cp HIGH(wNumItems)
ret
GetPocketCapacity: ; d283
ld c, MAX_ITEMS
ld a, e
- cp LOW(NumItems)
+ cp LOW(wNumItems)
jr nz, .not_bag
ld a, d
- cp HIGH(NumItems)
+ cp HIGH(wNumItems)
ret z
.not_bag
ld c, MAX_PC_ITEMS
ld a, e
- cp LOW(PCItems)
+ cp LOW(wPCItems)
jr nz, .not_pc
ld a, d
- cp HIGH(PCItems)
+ cp HIGH(wPCItems)
ret z
.not_pc
@@ -156,7 +156,7 @@
ld d, h
ld e, l
inc hl
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
ld b, 0
.loop
@@ -189,7 +189,7 @@
.ok
ld h, d
ld l, e
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
ld a, [wItemQuantityChangeBuffer]
ld [wItemQuantityBuffer], a
@@ -215,7 +215,7 @@
.terminator2
dec hl
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [hli], a
ld a, [wItemQuantityBuffer]
ld [hli], a
@@ -233,7 +233,7 @@
ld e, l
ld a, [hli]
ld c, a
- ld a, [CurItemQuantity]
+ ld a, [wCurItemQuantity]
cp c
jr nc, .ok ; memory
ld c, a
@@ -240,7 +240,7 @@
ld b, $0
add hl, bc
add hl, bc
- ld a, [CurItem]
+ ld a, [wCurItem]
cp [hl]
inc hl
jr z, .skip
@@ -249,7 +249,7 @@
inc hl
.ok
- ld a, [CurItem]
+ ld a, [wCurItem]
ld b, a
.loop
ld a, [hli]
@@ -294,7 +294,7 @@
ret
CheckTheItem: ; d349
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
.loop
inc hl
@@ -311,7 +311,7 @@
ret
ReceiveKeyItem: ; d35a
- ld hl, NumKeyItems
+ ld hl, wNumKeyItems
ld a, [hli]
cp MAX_KEY_ITEMS
jr nc, .nope
@@ -318,10 +318,10 @@
ld c, a
ld b, 0
add hl, bc
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [hli], a
ld [hl], -1
- ld hl, NumKeyItems
+ ld hl, wNumKeyItems
inc [hl]
scf
ret
@@ -331,10 +331,10 @@
ret
TossKeyItem: ; d374
- ld a, [CurItemQuantity]
+ ld a, [wCurItemQuantity]
ld e, a
ld d, 0
- ld hl, NumKeyItems
+ ld hl, wNumKeyItems
ld a, [hl]
cp e
jr nc, .ok
@@ -361,8 +361,8 @@
ret
.Toss: ; d396
- ld hl, NumKeyItems
- ld a, [CurItem]
+ ld hl, wNumKeyItems
+ ld a, [wCurItem]
ld c, a
.loop3
inc hl
@@ -375,16 +375,16 @@
ret
.ok3
- ld a, [NumKeyItems]
+ ld a, [wNumKeyItems]
dec a
- ld [NumKeyItems], a
+ ld [wNumKeyItems], a
scf
ret
CheckKeyItems: ; d3b1
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
- ld hl, KeyItems
+ ld hl, wKeyItems
.loop
ld a, [hli]
cp c
@@ -401,7 +401,7 @@
ReceiveTMHM: ; d3c4
dec c
ld b, 0
- ld hl, TMsHMs
+ ld hl, wTMsHMs
add hl, bc
ld a, [wItemQuantityChangeBuffer]
add [hl]
@@ -418,7 +418,7 @@
TossTMHM: ; d3d8
dec c
ld b, 0
- ld hl, TMsHMs
+ ld hl, wTMsHMs
add hl, bc
ld a, [wItemQuantityChangeBuffer]
ld b, a
@@ -445,7 +445,7 @@
CheckTMHM: ; d3fb
dec c
ld b, $0
- ld hl, TMsHMs
+ ld hl, wTMsHMs
add hl, bc
ld a, [hl]
and a
@@ -489,7 +489,7 @@
ret
_CheckTossableItem:: ; d427
-; Return 1 in wItemAttributeParamBuffer and carry if CurItem can't be removed from the bag.
+; Return 1 in wItemAttributeParamBuffer and carry if wCurItem can't be removed from the bag.
ld a, ITEMATTR_PERMISSIONS
call GetItemAttr
bit 7, a
@@ -498,7 +498,7 @@
ret
CheckSelectableItem: ; d432
-; Return 1 in wItemAttributeParamBuffer and carry if CurItem can't be selected.
+; Return 1 in wItemAttributeParamBuffer and carry if wCurItem can't be selected.
ld a, ITEMATTR_PERMISSIONS
call GetItemAttr
bit 6, a
@@ -507,7 +507,7 @@
ret
CheckItemPocket:: ; d43d
-; Return the pocket for CurItem in wItemAttributeParamBuffer.
+; Return the pocket for wCurItem in wItemAttributeParamBuffer.
ld a, ITEMATTR_POCKET
call GetItemAttr
and $f
@@ -515,7 +515,7 @@
ret
CheckItemContext: ; d448
-; Return the context for CurItem in wItemAttributeParamBuffer.
+; Return the context for wCurItem in wItemAttributeParamBuffer.
ld a, ITEMATTR_HELP
call GetItemAttr
and $f
@@ -523,7 +523,7 @@
ret
CheckItemMenu: ; d453
-; Return the menu for CurItem in wItemAttributeParamBuffer.
+; Return the menu for wCurItem in wItemAttributeParamBuffer.
ld a, ITEMATTR_HELP
call GetItemAttr
swap a
@@ -532,7 +532,7 @@
ret
GetItemAttr: ; d460
-; Get attribute a of CurItem.
+; Get attribute a of wCurItem.
push hl
push bc
@@ -545,7 +545,7 @@
xor a
ld [wItemAttributeParamBuffer], a
- ld a, [CurItem]
+ ld a, [wCurItem]
dec a
ld c, a
ld a, ITEMATTR_STRUCT_LENGTH
@@ -564,7 +564,7 @@
ret
GetItemPrice: ; d486
-; Return the price of CurItem in de.
+; Return the price of wCurItem in de.
push hl
push bc
ld a, ITEMATTR_PRICE
--- a/engine/landmarks.asm
+++ b/engine/landmarks.asm
@@ -16,7 +16,7 @@
GetLandmarkName:: ; 0x1ca8a5
-; Copy the name of landmark e to StringBuffer1.
+; Copy the name of landmark e to wStringBuffer1.
push hl
push de
push bc
@@ -31,7 +31,7 @@
ld h, [hl]
ld l, a
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld c, 18
.copy
ld a, [hli]
@@ -54,9 +54,9 @@
; Checks if the player is in Kanto or Johto.
; If in Johto, returns 0 in e.
; If in Kanto, returns 1 in e.
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
cp FAST_SHIP ; S.S. Aqua
@@ -65,9 +65,9 @@
jr nz, .checkagain
; In a special map, get the backup map group / map id
- ld a, [BackupMapGroup]
+ ld a, [wBackupMapGroup]
ld b, a
- ld a, [BackupMapNumber]
+ ld a, [wBackupMapNumber]
ld c, a
call GetWorldMapLocation
--- a/engine/learn.asm
+++ b/engine/learn.asm
@@ -1,17 +1,17 @@
LearnMove: ; 6508
call LoadTileMapToTempTileMap
- ld a, [CurPartyMon]
- ld hl, PartyMonNicknames
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonNicknames
call GetNick
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wMonOrItemNameBuffer
ld bc, MON_NAME_LENGTH
call CopyBytes
.loop
- ld hl, PartyMon1Moves
+ ld hl, wPartyMon1Moves
ld bc, PARTYMON_STRUCT_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld d, h
ld e, l
@@ -42,12 +42,12 @@
ld a, [wBattleMode]
and a
jr z, .not_disabled
- ld a, [DisabledMove]
+ ld a, [wDisabledMove]
cp b
jr nz, .not_disabled
xor a
- ld [DisabledMove], a
- ld [PlayerDisableCount], a
+ ld [wDisabledMove], a
+ ld [wPlayerDisableCount], a
.not_disabled
call GetMoveName
@@ -79,24 +79,24 @@
and a
jp z, .learned
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld b, a
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
cp b
jp nz, .learned
- ld a, [PlayerSubStatus5]
+ ld a, [wPlayerSubStatus5]
bit SUBSTATUS_TRANSFORMED, a
jp nz, .learned
ld h, d
ld l, e
- ld de, BattleMonMoves
+ ld de, wBattleMonMoves
ld bc, NUM_MOVES
call CopyBytes
- ld bc, PartyMon1PP - (PartyMon1Moves + NUM_MOVES)
+ ld bc, wPartyMon1PP - (wPartyMon1Moves + NUM_MOVES)
add hl, bc
- ld de, BattleMonPP
+ ld de, wBattleMonPP
ld bc, NUM_MOVES
call CopyBytes
jp .learned
@@ -143,7 +143,7 @@
call TextBox
hlcoord 5 + 2, 2 + 2
ld a, SCREEN_WIDTH * 2
- ld [Buffer1], a
+ ld [wBuffer1], a
predef ListMoves
; wMenuData3
ld a, $4
--- a/engine/link.asm
+++ b/engine/link.asm
@@ -73,13 +73,13 @@
ld a, $8
ld [rIE], a
ld hl, wd1f3
- ld de, EnemyMonSpecies
+ ld de, wEnemyMonSpecies
ld bc, $11
call Serial_ExchangeBytes
ld a, SERIAL_NO_DATA_BYTE
ld [de], a
ld hl, wLinkData
- ld de, OTPlayerName
+ ld de, wOTPlayerName
ld bc, $1a8
call Serial_ExchangeBytes
ld a, SERIAL_NO_DATA_BYTE
@@ -93,7 +93,7 @@
ld a, $1d
ld [rIE], a
call Link_CopyRandomNumbers
- ld hl, OTPlayerName
+ ld hl, wOTPlayerName
call Link_FindFirstNonControlCharacter_SkipZero
push hl
ld bc, NAME_LENGTH
@@ -138,10 +138,10 @@
dec c
jr nz, .loop
ld hl, wLinkPlayerName
- ld de, OTPlayerName
+ ld de, wOTPlayerName
ld bc, NAME_LENGTH
call CopyBytes
- ld de, OTPartyCount
+ ld de, wOTPartyCount
ld a, [hli]
ld [de], a
inc de
@@ -164,9 +164,9 @@
ld [de], a
ld hl, wTimeCapsulePartyMon1Species
call Function2868a
- ld a, LOW(OTPartyMonOT)
+ ld a, LOW(wOTPartyMonOT)
ld [wUnusedD102], a
- ld a, HIGH(OTPartyMonOT)
+ ld a, HIGH(wOTPartyMonOT)
ld [wUnusedD102 + 1], a
ld de, MUSIC_NONE
call PlayMusic
@@ -184,7 +184,7 @@
call Link_PrepPartyData_Gen2
call FixDataForLinkTransfer
call Function29dba
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
jp z, LinkTimeout
ld a, [hSerialConnectionStatus]
@@ -218,13 +218,13 @@
ld a, $8
ld [rIE], a
ld hl, wd1f3
- ld de, EnemyMonSpecies
+ ld de, wEnemyMonSpecies
ld bc, $11
call Serial_ExchangeBytes
ld a, SERIAL_NO_DATA_BYTE
ld [de], a
ld hl, wLinkData
- ld de, OTPlayerName
+ ld de, wOTPlayerName
ld bc, $1c2
call Serial_ExchangeBytes
ld a, SERIAL_NO_DATA_BYTE
@@ -249,7 +249,7 @@
ld de, MUSIC_NONE
call PlayMusic
call Link_CopyRandomNumbers
- ld hl, OTPlayerName
+ ld hl, wOTPlayerName
call Link_FindFirstNonControlCharacter_SkipZero
ld de, wLinkData
ld bc, $1b9
@@ -395,21 +395,21 @@
.skip_mail
ld hl, wLinkPlayerName
- ld de, OTPlayerName
+ ld de, wOTPlayerName
ld bc, NAME_LENGTH
call CopyBytes
- ld de, OTPartyCount
+ ld de, wOTPartyCount
ld bc, 1 + PARTY_LENGTH + 1
call CopyBytes
- ld de, OTPlayerID
+ ld de, wOTPlayerID
ld bc, 2
call CopyBytes
- ld de, OTPartyMons
- ld bc, OTPartyDataEnd - OTPartyMons
+ ld de, wOTPartyMons
+ ld bc, wOTPartyDataEnd - wOTPartyMons
call CopyBytes
- ld a, LOW(OTPartyMonOT)
+ ld a, LOW(wOTPartyMonOT)
ld [wUnusedD102], a
- ld a, HIGH(OTPartyMonOT)
+ ld a, HIGH(wOTPartyMonOT)
ld [wUnusedD102 + 1], a
ld de, MUSIC_NONE
call PlayMusic
@@ -421,17 +421,17 @@
cp LINK_COLOSSEUM
jr nz, .ready_to_trade
ld a, CAL
- ld [OtherTrainerClass], a
+ ld [wOtherTrainerClass], a
call ClearScreen
farcall Link_WaitBGMap
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
and 1 << STEREO
or TEXT_DELAY_MED
ld [hl], a
- ld hl, OTPlayerName
- ld de, OTClassName
+ ld hl, wOTPlayerName
+ ld de, wOTClassName
ld bc, NAME_LENGTH
call CopyBytes
call ReturnToMapFromSubmenu
@@ -466,7 +466,7 @@
pop af
ld [wDisableTextAcceleration], a
pop af
- ld [Options], a
+ ld [wOptions], a
farcall LoadPokemonData
jp Function28b22
@@ -568,12 +568,12 @@
FixDataForLinkTransfer: ; 28434
ld hl, wd1f3
ld a, SERIAL_PREAMBLE_BYTE
- ld b, LinkBattleRNs - wd1f3
+ ld b, wLinkBattleRNs - wd1f3
.loop1
ld [hli], a
dec b
jr nz, .loop1
- ld b, TempEnemyMonSpecies - LinkBattleRNs
+ ld b, wTempEnemyMonSpecies - wLinkBattleRNs
.loop2
call Random
cp SERIAL_PREAMBLE_BYTE
@@ -647,11 +647,11 @@
inc de
dec b
jr nz, .loop1
- ld hl, PlayerName
+ ld hl, wPlayerName
ld bc, NAME_LENGTH
call CopyBytes
push de
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [hli]
ld [de], a
inc de
@@ -677,7 +677,7 @@
add hl, de
ld d, h
ld e, l
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
ld c, PARTY_LENGTH
.mon_loop
push bc
@@ -687,9 +687,9 @@
pop bc
dec c
jr nz, .mon_loop
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
call .copy_ot_nicks
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
.copy_ot_nicks
ld bc, PARTY_LENGTH * NAME_LENGTH
jp CopyBytes
@@ -761,7 +761,7 @@
add hl, bc
ld a, [hl]
ld [de], a
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
inc de
push bc
@@ -783,7 +783,7 @@
add hl, bc
ld a, BANK(KantoMonSpecials)
call GetFarByte
- ld [BaseSpecialAttack], a
+ ld [wBaseSpecialAttack], a
pop bc
ld hl, MON_STAT_EXP - 1
@@ -815,22 +815,22 @@
inc de
dec b
jr nz, .loop1
- ld hl, PlayerName
+ ld hl, wPlayerName
ld bc, NAME_LENGTH
call CopyBytes
- ld hl, PartyCount
+ ld hl, wPartyCount
ld bc, 1 + PARTY_LENGTH + 1
call CopyBytes
- ld hl, PlayerID
+ ld hl, wPlayerID
ld bc, 2
call CopyBytes
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
ld bc, PARTY_LENGTH * PARTYMON_STRUCT_LENGTH
call CopyBytes
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
ld bc, PARTY_LENGTH * NAME_LENGTH
call CopyBytes
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
ld bc, PARTY_LENGTH * MON_NAME_LENGTH
call CopyBytes
@@ -963,7 +963,7 @@
ld a, c
ld [hli], a
ld [hl], b
- ld hl, OTPartyMon1Species
+ ld hl, wOTPartyMon1Species
ld c, PARTY_LENGTH
.loop
push bc
@@ -974,10 +974,10 @@
pop hl
ld bc, PARTY_LENGTH * REDMON_STRUCT_LENGTH
add hl, bc
- ld de, OTPartyMonOT
+ ld de, wOTPartyMonOT
ld bc, PARTY_LENGTH * NAME_LENGTH
call CopyBytes
- ld de, OTPartyMonNicknames
+ ld de, wOTPartyMonNicknames
ld bc, PARTY_LENGTH * MON_NAME_LENGTH
jp CopyBytes
; 286ba
@@ -995,7 +995,7 @@
pop bc
ld a, [wd265]
ld [bc], a
- ld [CurSpecies], a
+ ld [wCurSpecies], a
ld hl, MON_HP
add hl, bc
ld a, [de]
@@ -1049,7 +1049,7 @@
ld a, [de]
inc de
ld [hl], a
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
push bc
ld hl, $24
add hl, bc
@@ -1148,9 +1148,9 @@
ld a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
ret z
- ld hl, EnemyMonSpecies
+ ld hl, wEnemyMonSpecies
call Link_FindFirstNonControlCharacter_AllowZero
- ld de, LinkBattleRNs
+ ld de, wLinkBattleRNs
ld c, 10
.loop
ld a, [hli]
@@ -1208,10 +1208,10 @@
LinkTrade_OTPartyMenu: ; 28803
ld a, OTPARTYMON
- ld [MonType], a
+ ld [wMonType], a
ld a, A_BUTTON | D_UP | D_DOWN
ld [wMenuJoypadFilter], a
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
ld [w2DMenuNumRows], a
ld a, 1
ld [w2DMenuNumCols], a
@@ -1238,7 +1238,7 @@
ld a, INIT_ENEMYOT_LIST
ld [wInitListType], a
callfar InitList
- ld hl, OTPartyMon1Species
+ ld hl, wOTPartyMon1Species
farcall LinkMonStatsScreen
jp LinkTradePartiesMenuMasterLoop
@@ -1247,11 +1247,11 @@
jr z, .not_d_up
ld a, [wMenuCursorY]
ld b, a
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
cp b
jp nz, LinkTradePartiesMenuMasterLoop
xor a
- ld [MonType], a
+ ld [wMonType], a
call HideCursor
push hl
push bc
@@ -1260,7 +1260,7 @@
ld [hl], " "
pop bc
pop hl
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld [wMenuCursorY], a
jr LinkTrade_PlayerPartyMenu
@@ -1273,10 +1273,10 @@
LinkTrade_PlayerPartyMenu: ; 2888b
farcall InitMG_Mobile_LinkTradePalMap
xor a
- ld [MonType], a
+ ld [wMonType], a
ld a, A_BUTTON | D_UP | D_DOWN
ld [wMenuJoypadFilter], a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld [w2DMenuNumRows], a
ld a, 1
ld [w2DMenuNumCols], a
@@ -1313,7 +1313,7 @@
dec a
jp nz, LinkTradePartiesMenuMasterLoop
ld a, OTPARTYMON
- ld [MonType], a
+ ld [wMonType], a
call HideCursor
push hl
push bc
@@ -1331,7 +1331,7 @@
jr z, LinkTradePartiesMenuMasterLoop
ld a, [wMenuCursorY]
ld b, a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp b
jr nz, LinkTradePartiesMenuMasterLoop
call HideCursor
@@ -1346,7 +1346,7 @@
; 2891c
LinkTradePartiesMenuMasterLoop: ; 2891c
- ld a, [MonType]
+ ld a, [wMonType]
and a
jp z, LinkTradePartymonMenuLoop ; PARTYMON
jp LinkTradeOTPartymonMenuLoop ; OTPARTYMON
@@ -1480,7 +1480,7 @@
ld [wcf57], a
ld [wOtherPlayerLinkAction], a
ld a, [wd003]
- ld hl, OTPartySpecies
+ ld hl, wOTPartySpecies
ld c, a
ld b, 0
add hl, bc
@@ -1558,7 +1558,7 @@
pop af
bit D_UP_F, a
jr z, .d_up
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
ld [wMenuCursorY], a
jp LinkTrade_OTPartyMenu
@@ -1648,7 +1648,7 @@
call LinkTextboxAtHL
farcall Link_WaitBGMap
ld a, [wd002]
- ld hl, PartySpecies
+ ld hl, wPartySpecies
ld c, a
ld b, 0
add hl, bc
@@ -1655,12 +1655,12 @@
ld a, [hl]
ld [wd265], a
call GetPokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wd004
ld bc, MON_NAME_LENGTH
call CopyBytes
ld a, [wd003]
- ld hl, OTPartySpecies
+ ld hl, wOTPartySpecies
ld c, a
ld b, 0
add hl, bc
@@ -1763,7 +1763,7 @@
.asm_28ca6
ld hl, sPartyMail
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
ld bc, MAIL_STRUCT_LENGTH
call AddNTimes
@@ -1776,12 +1776,12 @@
ld bc, MAIL_STRUCT_LENGTH
call CopyBytes
call CloseSRAM
- ld hl, PlayerName
+ ld hl, wPlayerName
ld de, wPlayerTrademonSenderName
ld bc, NAME_LENGTH
call CopyBytes
ld a, [wd002]
- ld hl, PartySpecies
+ ld hl, wPartySpecies
ld b, 0
ld c, a
add hl, bc
@@ -1789,12 +1789,12 @@
ld [wPlayerTrademonSpecies], a
push af
ld a, [wd002]
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
call SkipNames
ld de, wPlayerTrademonOTName
ld bc, NAME_LENGTH
call CopyBytes
- ld hl, PartyMon1ID
+ ld hl, wPartyMon1ID
ld a, [wd002]
call GetPartyLocation
ld a, [hli]
@@ -1801,7 +1801,7 @@
ld [wPlayerTrademonID], a
ld a, [hl]
ld [wPlayerTrademonID + 1], a
- ld hl, PartyMon1DVs
+ ld hl, wPartyMon1DVs
ld a, [wd002]
call GetPartyLocation
ld a, [hli]
@@ -1809,7 +1809,7 @@
ld a, [hl]
ld [wPlayerTrademonDVs + 1], a
ld a, [wd002]
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
call GetPartyLocation
ld b, h
ld c, l
@@ -1816,12 +1816,12 @@
farcall GetCaughtGender
ld a, c
ld [wPlayerTrademonCaughtData], a
- ld hl, OTPlayerName
+ ld hl, wOTPlayerName
ld de, wOTTrademonSenderName
ld bc, NAME_LENGTH
call CopyBytes
ld a, [wd003]
- ld hl, OTPartySpecies
+ ld hl, wOTPartySpecies
ld b, 0
ld c, a
add hl, bc
@@ -1828,12 +1828,12 @@
ld a, [hl]
ld [wOTTrademonSpecies], a
ld a, [wd003]
- ld hl, OTPartyMonOT
+ ld hl, wOTPartyMonOT
call SkipNames
ld de, wOTTrademonOTName
ld bc, NAME_LENGTH
call CopyBytes
- ld hl, OTPartyMon1ID
+ ld hl, wOTPartyMon1ID
ld a, [wd003]
call GetPartyLocation
ld a, [hli]
@@ -1840,7 +1840,7 @@
ld [wOTTrademonID], a
ld a, [hl]
ld [wOTTrademonID + 1], a
- ld hl, OTPartyMon1DVs
+ ld hl, wOTPartyMon1DVs
ld a, [wd003]
call GetPartyLocation
ld a, [hli]
@@ -1848,7 +1848,7 @@
ld a, [hl]
ld [wOTTrademonDVs + 1], a
ld a, [wd003]
- ld hl, OTPartyMon1Species
+ ld hl, wOTPartyMon1Species
call GetPartyLocation
ld b, h
ld c, l
@@ -1856,8 +1856,8 @@
ld a, c
ld [wOTTrademonCaughtData], a
ld a, [wd002]
- ld [CurPartyMon], a
- ld hl, PartySpecies
+ ld [wCurPartyMon], a
+ ld hl, wPartySpecies
ld b, 0
ld c, a
add hl, bc
@@ -1866,14 +1866,14 @@
xor a
ld [wPokemonWithdrawDepositParameter], a
callfar RemoveMonFromPartyOrBox
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld a, TRUE
ld [wForceEvolution], a
ld a, [wd003]
push af
- ld hl, OTPartySpecies
+ ld hl, wOTPartySpecies
ld b, 0
ld c, a
add hl, bc
@@ -1897,23 +1897,23 @@
.done_animation
pop af
ld c, a
- ld [CurPartyMon], a
- ld hl, OTPartySpecies
+ ld [wCurPartyMon], a
+ ld hl, wOTPartySpecies
ld d, 0
ld e, a
add hl, de
ld a, [hl]
- ld [CurPartySpecies], a
- ld hl, OTPartyMon1Species
+ ld [wCurPartySpecies], a
+ ld hl, wOTPartyMon1Species
ld a, c
call GetPartyLocation
- ld de, TempMonSpecies
+ ld de, wTempMonSpecies
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
predef AddTempmonToParty
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
callfar EvolvePokemon
call ClearScreen
call LoadTradeScreenBorder
@@ -1924,7 +1924,7 @@
ld c, a
cp MEW
jr z, .loop
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp MEW
jr z, .loop
ld b, $2
@@ -1931,7 +1931,7 @@
ld a, c
cp CELEBI
jr z, .loop
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp CELEBI
jr z, .loop
ld b, $0
@@ -2032,7 +2032,7 @@
INCLUDE "engine/trade_animation.asm"
Special_CheckTimeCapsuleCompatibility: ; 29bfb
-; Checks to see if your Party is compatible with the generation 1 games. Returns the following in ScriptVar:
+; Checks to see if your Party is compatible with the generation 1 games. Returns the following in wScriptVar:
; 0: Party is okay
; 1: At least one Pokemon was introduced in GS
; 2: At least one Pokemon has a move that was introduced in GS
@@ -2039,7 +2039,7 @@
; 3: At least one Pokemon is holding mail
; If any party Pokemon was introduced in the generation 2 games, don't let it in.
- ld hl, PartySpecies
+ ld hl, wPartySpecies
ld b, PARTY_LENGTH
.loop
ld a, [hli]
@@ -2052,9 +2052,9 @@
; If any party Pokemon is holding mail, don't let it in.
.checkitem
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld b, a
- ld hl, PartyMon1Item
+ ld hl, wPartyMon1Item
.itemloop
push hl
push bc
@@ -2069,8 +2069,8 @@
jr nz, .itemloop
; If any party Pokemon has a move that was introduced in the generation 2 games, don't let it in.
- ld hl, PartyMon1Moves
- ld a, [PartyCount]
+ ld hl, wPartyMon1Moves
+ ld a, [wPartyCount]
ld b, a
.move_loop
ld c, NUM_MOVES
@@ -2080,7 +2080,7 @@
jr nc, .move_too_new
dec c
jr nz, .move_next
- ld de, PartyMon2 - (PartyMon1 + NUM_MOVES)
+ ld de, wPartyMon2 - (wPartyMon1 + NUM_MOVES)
add hl, de
dec b
jr nz, .move_loop
@@ -2108,17 +2108,17 @@
ld a, $3
.done
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 29c67
Function29c67: ; 29c67
- ld a, [PartyCount]
+ ld a, [wPartyCount]
sub b
ld c, a
inc c
ld b, 0
- ld hl, PartyCount
+ ld hl, wPartyCount
add hl, bc
ld a, [hl]
ld [wd265], a
@@ -2280,12 +2280,12 @@
ld c, 50
call DelayFrames
ld a, $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.done
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 29d92
@@ -2305,7 +2305,7 @@
call Link_CheckCommunicationError
xor a
ld [hVBlank], a
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
ret nz
jp Link_ResetSerialRegistersAfterLinkClosure
@@ -2325,7 +2325,7 @@
call DelayFrame
call DelayFrame
call Link_CheckCommunicationError
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
jr z, .vblank
ld bc, -1
@@ -2350,7 +2350,7 @@
.script_var
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.vblank
@@ -2382,7 +2382,7 @@
ld a, $1
.load_scriptvar
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld hl, wLinkTimeoutFrames
xor a
ld [hli], a
@@ -2435,7 +2435,7 @@
jr nc, .return_result
xor a ; FALSE
.return_result
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld c, 30
call DelayFrames
pop af
@@ -2461,12 +2461,12 @@
xor a
ld [hVBlank], a
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.fail
xor a ; FALSE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 29eaf
@@ -2568,7 +2568,7 @@
dec a ; FALSE
.yes
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 29f54
--- a/engine/link_2.asm
+++ b/engine/link_2.asm
@@ -1,10 +1,10 @@
LinkMonStatsScreen: ; 4d319
ld a, [wMenuCursorY]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
call LowVolume
predef StatsScreenInit
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
inc a
ld [wMenuCursorY], a
call ClearScreen
@@ -31,7 +31,7 @@
pop hl
pop bc
- ld de, AttrMap - TileMap
+ ld de, wAttrMap - wTileMap
add hl, de
inc b
inc b
--- a/engine/link_trade.asm
+++ b/engine/link_trade.asm
@@ -52,7 +52,7 @@
pop hl
pop bc
- ld de, AttrMap - TileMap
+ ld de, wAttrMap - wTileMap
add hl, de
inc b
inc b
--- a/engine/load_font.asm
+++ b/engine/load_font.asm
@@ -81,7 +81,7 @@
; fb4cc
LoadFrame: ; fb4cc
- ld a, [TextBoxFrame]
+ ld a, [wTextBoxFrame]
maskbits NUM_FRAMES
ld bc, 6 * LEN_1BPP_TILE
ld hl, Frames
--- a/engine/load_pics.asm
+++ b/engine/load_pics.asm
@@ -1,5 +1,5 @@
GetUnownLetter: ; 51040
-; Return Unown letter in UnownLetter based on DVs at hl
+; Return Unown letter in wUnownLetter based on DVs at hl
; Take the middle 2 bits of each DV and place them in order:
; atk def spd spc
@@ -45,12 +45,12 @@
; Increment to get 1-26
ld a, [hQuotient + 2]
inc a
- ld [UnownLetter], a
+ ld [wUnownLetter], a
ret
GetMonFrontpic: ; 51077
- ld a, [CurPartySpecies]
- ld [CurSpecies], a
+ ld a, [wCurPartySpecies]
+ ld [wCurSpecies], a
call IsAPokemon
ret c
ld a, [rSVBK]
@@ -61,8 +61,8 @@
ret
GetAnimatedFrontpic: ; 5108b
- ld a, [CurPartySpecies]
- ld [CurSpecies], a
+ ld a, [wCurPartySpecies]
+ ld [wCurSpecies], a
call IsAPokemon
ret c
ld a, [rSVBK]
@@ -78,7 +78,7 @@
_GetFrontpic: ; 510a5
push de
call GetBaseData
- ld a, [BasePicSize]
+ ld a, [wBasePicSize]
and $f
ld b, a
push bc
@@ -105,15 +105,15 @@
GetFrontpicPointer: ; 510d7
GLOBAL PokemonPicPointers, UnownPicPointers
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp UNOWN
jr z, .unown
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld d, BANK(PokemonPicPointers)
jr .ok
.unown
- ld a, [UnownLetter]
+ ld a, [wUnownLetter]
ld d, BANK(UnownPicPointers)
.ok
@@ -144,8 +144,8 @@
ld de, 7 * 7 tiles
add hl, de
push hl
- ld a, BANK(BasePicSize)
- ld hl, BasePicSize
+ ld a, BANK(wBasePicSize)
+ ld hl, wBasePicSize
call GetFarWRAMByte
pop hl
and $f
@@ -196,13 +196,13 @@
ret
GetMonBackpic: ; 5116c
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call IsAPokemon
ret c
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld b, a
- ld a, [UnownLetter]
+ ld a, [wUnownLetter]
ld c, a
ld a, [rSVBK]
push af
@@ -311,7 +311,7 @@
ret
GetTrainerPic: ; 5120d
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
and a
ret z
cp NUM_TRAINER_CLASSES
@@ -320,7 +320,7 @@
xor a
ld [hBGMapMode], a
ld hl, TrainerPicPointers
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
dec a
ld bc, 3
call AddNTimes
--- a/engine/mail.asm
+++ b/engine/mail.asm
@@ -12,7 +12,7 @@
call AddNTimes
ld d, h
ld e, l
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld bc, MAIL_STRUCT_LENGTH
ld hl, sPartyMail
call AddNTimes
@@ -92,7 +92,7 @@
ld hl, sMailbox
call AddNTimes
push hl
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld bc, MAIL_STRUCT_LENGTH
ld hl, sPartyMail
call AddNTimes
@@ -106,8 +106,8 @@
ld de, PARTYMON_STRUCT_LENGTH - MON_MOVES
add hl, de
ld d, [hl]
- ld a, [CurPartyMon]
- ld hl, PartyMon1Item
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld [hl], d
@@ -131,8 +131,8 @@
ld a, POKEMAIL_REFUSED
jr c, .pop_return
- ld a, [CurPartyMon]
- ld hl, PartyMon1Item
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, [hl]
@@ -142,7 +142,7 @@
ld a, BANK(sPartyMail)
call GetSRAMBank
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld hl, sPartyMail
ld bc, MAIL_STRUCT_LENGTH
call AddNTimes
@@ -189,17 +189,17 @@
pop bc
.return
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 446cc
GivePokeItem:: ; 446cc
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
push af
push bc
- ld hl, PartyMon1Item
+ ld hl, wPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
pop bc
@@ -219,13 +219,13 @@
call CopyBytes
pop af
push af
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
ld bc, NAME_LENGTH
call AddNTimes
ld bc, NAME_LENGTH - 1
call CopyBytes
pop af
- ld hl, PartyMon1ID
+ ld hl, wPartyMon1ID
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld a, [hli]
@@ -234,7 +234,7 @@
ld a, [hl]
ld [de], a
inc de
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [de], a
inc de
pop bc
@@ -287,11 +287,11 @@
IsAnyMonHoldingMail: ; 44781
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
jr z, .no_mons
ld e, a
- ld hl, PartyMon1Item
+ ld hl, wPartyMon1Item
.loop
ld d, [hl]
push hl
@@ -362,7 +362,7 @@
call AddNTimes
ld a, BANK(sMailboxCount)
call GetSRAMBank
- ld de, StringBuffer2
+ ld de, wStringBuffer2
push de
ld bc, NAME_LENGTH - 1
call CopyBytes
@@ -375,7 +375,7 @@
MailboxPC_PrintMailAuthor: ; 0x447fb
push de
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
call MailboxPC_GetMailAuthor
pop hl
jp PlaceString
@@ -439,7 +439,7 @@
.ReadMail: ; 0x44869
call FadeToMenu
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
dec a
ld b, a
call ReadMailMessage
@@ -452,12 +452,12 @@
call YesNoBox
call ExitMenu
ret c
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
dec a
call .GetMailType
ld a, 1
ld [wItemQuantityChangeBuffer], a
- ld hl, NumItems
+ ld hl, wNumItems
call ReceiveItem
jr c, .put_in_bag
ld hl, .PackFullText
@@ -464,7 +464,7 @@
jp MenuTextBoxBackup
.put_in_bag
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
dec a
ld b, a
call DeleteMailFromPC
@@ -493,7 +493,7 @@
ld bc, MAIL_STRUCT_LENGTH
call AddNTimes
ld a, [hl]
- ld [CurItem], a
+ ld [wCurItem], a
jp CloseSRAM
; 0x448d2
@@ -500,7 +500,7 @@
.AttachMail: ; 0x448d2
call FadeToMenu
xor a
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
call ClearBGPalettes
.try_again
farcall LoadPartyMenuGFX
@@ -513,7 +513,7 @@
call DelayFrame
farcall PartyMenuSelect
jr c, .exit2
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
ld a, MON_ITEM
@@ -531,7 +531,7 @@
jr .try_again
.attach_mail
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
dec a
ld b, a
call MoveMailFromPCToParty
--- a/engine/mail_2.asm
+++ b/engine/mail_2.asm
@@ -1,5 +1,5 @@
ReadPartyMonMail: ; b9229
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld hl, sPartyMail
ld bc, MAIL_STRUCT_LENGTH
call AddNTimes
@@ -35,7 +35,7 @@
call .LoadGFX
call EnableLCD
call WaitBGMap
- ld a, [Buffer3]
+ ld a, [wBuffer3]
ld e, a
farcall LoadMailPalettes
call SetPalettes
@@ -74,11 +74,11 @@
ld de, sPartyMon1MailAuthorID - sPartyMon1Mail
add hl, de
ld a, [hli]
- ld [Buffer1], a
+ ld [wBuffer1], a
ld a, [hli]
- ld [Buffer2], a
+ ld [wBuffer2], a
ld a, [hli]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld b, [hl]
call CloseSRAM
ld hl, MailGFXPointers
@@ -100,7 +100,7 @@
.got_pointer
ld a, c
- ld [Buffer3], a
+ ld [wBuffer3], a
ld a, [hli]
ld h, [hl]
ld l, a
@@ -567,7 +567,7 @@
call Mail_DrawRowLoop
call LovelyEonMail_PlaceIcons
ld a, $1
- ld [UnownLetter], a
+ ld [wUnownLetter], a
hlcoord 1, 10
call PrepMonFrontpic
pop hl
@@ -712,7 +712,7 @@
ld a, [de]
and a
ret z
- ld a, [Buffer3]
+ ld a, [wBuffer3]
hlcoord 8, 14
cp $3 ; PORTRAITMAIL
jr z, .place_author
--- a/engine/main_menu.asm
+++ b/engine/main_menu.asm
@@ -20,7 +20,7 @@
call CloseWindow
jr c, .quit
call ClearTileMap
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld hl, .Jumptable
rst JumpTable
jr MainMenu
@@ -225,13 +225,13 @@
xor a
ld [hBGMapMode], a
call .PlaceBox
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
call .PlaceTime
pop af
- ld [Options], a
+ ld [wOptions], a
ld a, $1
ld [hBGMapMode], a
ret
--- a/engine/map_object_action.asm
+++ b/engine/map_object_action.asm
@@ -263,7 +263,7 @@
; 45c5
SetFacingBigDoll: ; 45c5
- ld a, [VariableSprites + SPRITE_BIG_DOLL - SPRITE_VARS]
+ ld a, [wVariableSprites + SPRITE_BIG_DOLL - SPRITE_VARS]
ld d, FACING_BIG_DOLL_SYM ; symmetric
cp SPRITE_BIG_SNORLAX
jr z, .ok
--- a/engine/map_objects.asm
+++ b/engine/map_objects.asm
@@ -40,7 +40,7 @@
ld hl, OBJECT_FLAGS2
add hl, bc
res 6, [hl]
- ld a, [XCoord]
+ ld a, [wXCoord]
ld e, a
ld hl, OBJECT_NEXT_MAP_X
add hl, bc
@@ -50,7 +50,7 @@
jr c, .ok
cp MAPOBJECT_SCREEN_WIDTH
jr nc, .ok
- ld a, [YCoord]
+ ld a, [wYCoord]
ld e, a
ld hl, OBJECT_NEXT_MAP_Y
add hl, bc
@@ -66,7 +66,7 @@
ld hl, OBJECT_FLAGS2
add hl, bc
set 6, [hl]
- ld a, [XCoord]
+ ld a, [wXCoord]
ld e, a
ld hl, OBJECT_INIT_X
add hl, bc
@@ -76,7 +76,7 @@
jr c, .ok2
cp MAPOBJECT_SCREEN_WIDTH
jr nc, .ok2
- ld a, [YCoord]
+ ld a, [wYCoord]
ld e, a
ld hl, OBJECT_INIT_Y
add hl, bc
@@ -169,7 +169,7 @@
; 444d
_HandleObjectAction
-; call [4 * ObjectStructs[ObjInd, OBJECT_ACTION] + de]
+; call [4 * wObjectStructs[ObjInd, OBJECT_ACTION] + de]
ld hl, OBJECT_ACTION
add hl, bc
ld a, [hl]
@@ -2149,7 +2149,7 @@
ret
.DeleteEmote:
- ld de, ObjectStructs
+ ld de, wObjectStructs
ld a, NUM_OBJECT_STRUCTS
.loop
push af
@@ -2223,10 +2223,10 @@
; 55e0
Function55e0:: ; 55e0
- ld a, [VramState]
+ ld a, [wVramState]
bit 0, a
ret z
- ld bc, ObjectStructs
+ ld bc, wObjectStructs
xor a
.loop
ld [hMapObjectIndexBuffer], a
@@ -2289,7 +2289,7 @@
Function5645: ; 5645
xor a
- ld bc, ObjectStructs
+ ld bc, wObjectStructs
.loop
ld [hMapObjectIndexBuffer], a
call SetFacing_Standing
@@ -2359,7 +2359,7 @@
ld e, [hl]
inc d
inc e
- ld a, [XCoord]
+ ld a, [wXCoord]
cp d
jr z, .equal_x
jr nc, .nope
@@ -2367,7 +2367,7 @@
cp d
jr c, .nope
.equal_x
- ld a, [YCoord]
+ ld a, [wYCoord]
cp e
jr z, .equal_y
jr nc, .nope
@@ -2508,7 +2508,7 @@
ret
.DoStepsForAllObjects:
- ld bc, ObjectStructs
+ ld bc, wObjectStructs
xor a
.loop
ld [hMapObjectIndexBuffer], a
@@ -2533,7 +2533,7 @@
ld [wPlayerMovement], a
xor a
ld [wPlayerTurningDirection], a
- ld [PlayerObjectStepFrame], a
+ ld [wPlayerObjectStepFrame], a
call .TryResetPlayerAction
farcall CheckWarpFacingDown
call c, SpawnInFacingDown
@@ -2549,7 +2549,7 @@
.ok
ld a, OBJECT_ACTION_00
- ld [PlayerAction], a
+ ld [wPlayerAction], a
ret
; 57ca
@@ -2567,7 +2567,7 @@
SpawnInFacingDown: ; 57d9
ld a, 0
ContinueSpawnFacing: ; 57db
- ld bc, PlayerStruct
+ ld bc, wPlayerStruct
call SetSpriteDirection
ret
; 57e2
@@ -2586,7 +2586,7 @@
swap a
and %00000111
ld d, a
- ld bc, PlayerStruct
+ ld bc, wPlayerStruct
ld hl, OBJECT_PALETTE
add hl, bc
ld a, [hl]
@@ -2681,7 +2681,7 @@
; 587a
Function587a: ; 587a
- ld bc, ObjectStructs
+ ld bc, wObjectStructs
xor a
.loop
push af
@@ -2726,7 +2726,7 @@
Function58b9:: ; 58b9
push bc
- ld bc, ObjectStructs
+ ld bc, wObjectStructs
xor a
.loop
push af
@@ -2803,7 +2803,7 @@
; 5920
_UpdateSprites:: ; 5920
- ld a, [VramState]
+ ld a, [wVramState]
bit 0, a
ret z
xor a
@@ -2819,9 +2819,9 @@
ret
.fill
- ld a, [VramState]
+ ld a, [wVramState]
bit 1, a
- ld b, LOW(SpritesEnd)
+ ld b, LOW(wVirtualOAMEnd)
jr z, .ok
ld b, 28 * SPRITEOAMSTRUCT_LENGTH
.ok
@@ -2829,7 +2829,7 @@
cp b
ret nc
ld l, a
- ld h, HIGH(Sprites)
+ ld h, HIGH(wVirtualOAM)
ld de, SPRITEOAMSTRUCT_LENGTH
ld a, b
ld c, SCREEN_HEIGHT_PX + 2 * TILE_WIDTH
@@ -2849,7 +2849,7 @@
ld d, a
ld a, [wPlayerBGMapOffsetY]
ld e, a
- ld bc, ObjectStructs
+ ld bc, wObjectStructs
ld a, NUM_OBJECT_STRUCTS
.loop
push af
@@ -2903,7 +2903,7 @@
ld bc, NUM_OBJECT_STRUCTS
call ByteFill
ld d, 0
- ld bc, ObjectStructs
+ ld bc, wObjectStructs
ld hl, wMovementPointer
.loop
push hl
@@ -3043,11 +3043,11 @@
ld l, a
ld a, [hUsedSpriteIndex]
ld c, a
- ld b, HIGH(Sprites)
+ ld b, HIGH(wVirtualOAM)
ld a, [hli]
ld [hUsedSpriteTile], a
add c
- cp LOW(SpritesEnd)
+ cp LOW(wVirtualOAMEnd)
jr nc, .full
.addsprite
ld a, [hFFC0]
@@ -3107,17 +3107,17 @@
ret
.Addresses: ; 5ace
- dw PlayerStruct
- dw Object1Struct
- dw Object2Struct
- dw Object3Struct
- dw Object4Struct
- dw Object5Struct
- dw Object6Struct
- dw Object7Struct
- dw Object8Struct
- dw Object9Struct
- dw Object10Struct
- dw Object11Struct
- dw Object12Struct
+ dw wPlayerStruct
+ dw wObject1Struct
+ dw wObject2Struct
+ dw wObject3Struct
+ dw wObject4Struct
+ dw wObject5Struct
+ dw wObject6Struct
+ dw wObject7Struct
+ dw wObject8Struct
+ dw wObject9Struct
+ dw wObject10Struct
+ dw wObject11Struct
+ dw wObject12Struct
; 5ae8
--- a/engine/map_objects_2.asm
+++ b/engine/map_objects_2.asm
@@ -4,7 +4,7 @@
ld bc, NUM_OBJECTS
call ByteFill
nop
- ld bc, MapObjects
+ ld bc, wMapObjects
ld de, wObjectMasks
xor a
.loop
--- a/engine/map_palettes.asm
+++ b/engine/map_palettes.asm
@@ -1,6 +1,6 @@
SwapTextboxPalettes:: ; 4c000
hlcoord 0, 0
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
ld b, SCREEN_HEIGHT
.loop
push bc
@@ -10,10 +10,10 @@
push hl
srl a
jr c, .UpperNybble
- ld hl, TilesetPalettes
+ ld hl, wTilesetPalettes
add [hl]
ld l, a
- ld a, [TilesetPalettes + 1]
+ ld a, [wTilesetPalettes + 1]
adc $0
ld h, a
ld a, [hl]
@@ -21,10 +21,10 @@
jr .next
.UpperNybble:
- ld hl, TilesetPalettes
+ ld hl, wTilesetPalettes
add [hl]
ld l, a
- ld a, [TilesetPalettes + 1]
+ ld a, [wTilesetPalettes + 1]
adc $0
ld h, a
ld a, [hl]
@@ -45,8 +45,8 @@
ret
ScrollBGMapPalettes:: ; 4c03f
- ld hl, BGMapBuffer
- ld de, BGMapPalBuffer
+ ld hl, wBGMapBuffer
+ ld de, wBGMapPalBuffer
.loop
ld a, [hl]
push hl
@@ -54,10 +54,10 @@
jr c, .UpperNybble
; .LowerNybble
- ld hl, TilesetPalettes
+ ld hl, wTilesetPalettes
add [hl]
ld l, a
- ld a, [TilesetPalettes + 1]
+ ld a, [wTilesetPalettes + 1]
adc $0
ld h, a
ld a, [hl]
@@ -65,10 +65,10 @@
jr .next
.UpperNybble:
- ld hl, TilesetPalettes
+ ld hl, wTilesetPalettes
add [hl]
ld l, a
- ld a, [TilesetPalettes + 1]
+ ld a, [wTilesetPalettes + 1]
adc $0
ld h, a
ld a, [hl]
--- a/engine/map_setup.asm
+++ b/engine/map_setup.asm
@@ -172,12 +172,12 @@
bit 1, [hl]
ret z
ld a, PLAYER_BIKE
- ld [PlayerState], a
+ ld [wPlayerState], a
scf
ret
.CheckSurfing2: ; 1551a (5:551a)
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_NORMAL
jr z, .nope
cp PLAYER_SKATE
@@ -195,12 +195,12 @@
jr z, .checkbiking
jr .nope
.checkbiking
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_BIKE
jr nz, .nope
.surfing
ld a, PLAYER_NORMAL
- ld [PlayerState], a
+ ld [wPlayerState], a
scf
ret
@@ -211,13 +211,13 @@
.CheckSurfing: ; 1554e (5:554e)
call CheckOnWater
jr nz, .ret_nc
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_SURF
jr z, ._surfing
cp PLAYER_SURF_PIKA
jr z, ._surfing
ld a, PLAYER_SURF
- ld [PlayerState], a
+ ld [wPlayerState], a
._surfing
scf
ret
@@ -238,22 +238,22 @@
RotatePalettesRightMapAndMusic: ; 15574
ld e, 0
- ld a, [MusicFadeID]
+ ld a, [wMusicFadeID]
ld d, 0
- ld a, [MusicFadeID + 1]
+ ld a, [wMusicFadeID + 1]
ld a, $4
- ld [MusicFade], a
+ ld [wMusicFade], a
call RotateThreePalettesRight
ret
; 15587
ForceMapMusic: ; 15587
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_BIKE
jr nz, .notbiking
call VolumeOff
ld a, $88
- ld [MusicFade], a
+ ld [wMusicFade], a
.notbiking
call TryRestartMapMusic
ret
--- a/engine/mapgroup_roofs.asm
+++ b/engine/mapgroup_roofs.asm
@@ -1,5 +1,5 @@
LoadMapGroupRoof:: ; 1c000
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld e, a
ld d, 0
ld hl, MapGroupRoofs
--- a/engine/mart.asm
+++ b/engine/mart.asm
@@ -9,9 +9,9 @@
OpenMartDialog:: ; 15a45
call GetMart
ld a, c
- ld [EngineBuffer1], a
+ ld [wEngineBuffer1], a
call LoadMartPointer
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
ld hl, .dialogs
rst JumpTable
ret
@@ -27,9 +27,9 @@
MartDialog: ; 15a61
ld a, 0
- ld [EngineBuffer1], a
+ ld [wEngineBuffer1], a
xor a
- ld [EngineBuffer5], a
+ ld [wEngineBuffer5], a
call StandardMart
ret
; 15a6e
@@ -103,19 +103,19 @@
LoadMartPointer: ; 15b10
ld a, b
- ld [MartPointerBank], a
+ ld [wMartPointerBank], a
ld a, e
- ld [MartPointer], a
+ ld [wMartPointer], a
ld a, d
- ld [MartPointer + 1], a
- ld hl, CurMart
+ ld [wMartPointer + 1], a
+ ld hl, wCurMart
xor a
ld bc, 16
call ByteFill
xor a
- ld [EngineBuffer5], a
+ ld [wEngineBuffer5], a
ld [wBargainShopFlags], a
- ld [FacingDirection], a
+ ld [wFacingDirection], a
ret
; 15b31
@@ -140,10 +140,10 @@
StandardMart: ; 15b47
.loop
- ld a, [EngineBuffer5]
+ ld a, [wEngineBuffer5]
ld hl, .MartFunctions
rst JumpTable
- ld [EngineBuffer5], a
+ ld [wEngineBuffer5], a
cp $ff
jr nz, .loop
ret
@@ -219,13 +219,13 @@
; 15bbb
FarReadMart: ; 15bbb
- ld hl, MartPointer
+ ld hl, wMartPointer
ld a, [hli]
ld h, [hl]
ld l, a
- ld de, CurMart
+ ld de, wCurMart
.CopyMart:
- ld a, [MartPointerBank]
+ ld a, [wMartPointerBank]
call GetFarByte
ld [de], a
inc hl
@@ -233,7 +233,7 @@
cp -1
jr nz, .CopyMart
ld hl, wMartItem1BCD
- ld de, CurMart + 1
+ ld de, wCurMart + 1
.ReadMartItem:
ld a, [de]
inc de
@@ -249,26 +249,26 @@
; 15be5
GetMartItemPrice: ; 15be5
-; Return the price of item a in BCD at hl and in tiles at StringBuffer1.
+; Return the price of item a in BCD at hl and in tiles at wStringBuffer1.
push hl
- ld [CurItem], a
+ ld [wCurItem], a
farcall GetItemPrice
pop hl
GetMartPrice: ; 15bf0
-; Return price de in BCD at hl and in tiles at StringBuffer1.
+; Return price de in BCD at hl and in tiles at wStringBuffer1.
push hl
ld a, d
- ld [StringBuffer2], a
+ ld [wStringBuffer2], a
ld a, e
- ld [StringBuffer2 + 1], a
- ld hl, StringBuffer1
- ld de, StringBuffer2
+ ld [wStringBuffer2 + 1], a
+ ld hl, wStringBuffer1
+ ld de, wStringBuffer2
lb bc, PRINTNUM_LEADINGZEROS | 2, 6 ; 6 digits
call PrintNum
pop hl
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld c, 6 / 2 ; 6 digits
.loop
call .CharToNybble
@@ -296,7 +296,7 @@
ReadMart: ; 15c25
; Load the mart pointer. Mart data is local (no need for bank).
- ld hl, MartPointer
+ ld hl, wMartPointer
ld a, [hli]
ld h, [hl]
ld l, a
@@ -304,9 +304,9 @@
; set hl to the first item
inc hl
ld bc, wMartItem1BCD
- ld de, CurMart + 1
+ ld de, wCurMart + 1
.loop
-; copy the item to CurMart + (ItemIndex)
+; copy the item to wCurMart + (ItemIndex)
ld a, [hli]
ld [de], a
inc de
@@ -335,7 +335,7 @@
.done
pop hl
ld a, [hl]
- ld [CurMart], a
+ ld [wCurMart], a
ret
; 15c51
@@ -358,7 +358,7 @@
LoadBuyMenuText: ; 15c7d
; load text from a nested table
-; which table is in EngineBuffer1
+; which table is in wEngineBuffer1
; which entry is in register a
push af
call GetMartDialogGroup ; gets a pointer from GetMartDialogGroup.MartTextFunctionPointers
@@ -390,7 +390,7 @@
; 15ca3
GetMartDialogGroup: ; 15ca3
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
ld e, a
ld d, 0
ld hl, .MartTextFunctionPointers
@@ -468,12 +468,12 @@
jr c, .cancel
call MartConfirmPurchase
jr c, .cancel
- ld de, Money
+ ld de, wMoney
ld bc, hMoneyTemp
ld a, $3 ; useless load
call CompareMoney
jr c, .insufficient_funds
- ld hl, NumItems
+ ld hl, wNumItems
call ReceiveItem
jr nc, .insufficient_bag_space
ld a, [wMartItemID]
@@ -483,7 +483,7 @@
ld hl, wBargainShopFlags
call FlagAction
call PlayTransactionSound
- ld de, Money
+ ld de, wMoney
ld bc, hMoneyTemp
call TakeMoney
ld a, MARTTEXT_HERE_YOU_GO
@@ -547,7 +547,7 @@
ld a, [wMartItemID]
ld e, a
ld d, $0
- ld hl, MartPointer
+ ld hl, wMartPointer
ld a, [hli]
ld h, [hl]
ld l, a
@@ -588,7 +588,7 @@
ld a, [wMartItemID]
ld e, a
ld d, 0
- ld hl, MartPointer
+ ld hl, wMartPointer
ld a, [hli]
ld h, [hl]
ld l, a
@@ -627,7 +627,7 @@
db SCROLLINGMENU_DISPLAY_ARROWS | SCROLLINGMENU_ENABLE_FUNCTION3 ; flags
db 4, 8 ; rows, columns
db 1 ; horizontal spacing
- dbw 0, CurMart
+ dbw 0, wCurMart
dba PlaceMenuItemName
dba .PrintBCDPrices
dba UpdateItemDescription
@@ -857,11 +857,11 @@
call PrintTextBoxText
call YesNoBox
jr c, .declined
- ld de, Money
+ ld de, wMoney
ld bc, hMoneyTemp
call GiveMoney
ld a, [wMartItemID]
- ld hl, NumItems
+ ld hl, wNumItems
call TossItem
predef PartyMonItemName
hlcoord 1, 14
--- a/engine/menu.asm
+++ b/engine/menu.asm
@@ -725,7 +725,7 @@
; 24423
Unreferenced_Function24423: ; 24423
- ld a, [VramState]
+ ld a, [wVramState]
bit 0, a
ret z
xor a ; sScratch
--- a/engine/menu_2.asm
+++ b/engine/menu_2.asm
@@ -1,6 +1,6 @@
PlaceMenuItemName: ; 0x24ab4
push de
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld [wNamedObjectIndexBuffer], a
call GetItemName
pop hl
@@ -9,8 +9,8 @@
PlaceMenuItemQuantity: ; 0x24ac3
push de
- ld a, [MenuSelection]
- ld [CurItem], a
+ ld a, [wMenuSelection]
+ ld [wCurItem], a
farcall _CheckTossableItem
ld a, [wItemAttributeParamBuffer]
pop hl
@@ -20,7 +20,7 @@
add hl, de
ld [hl], "×"
inc hl
- ld de, MenuSelectionQuantity
+ ld de, wMenuSelectionQuantity
lb bc, 1, 2
call PrintNum
@@ -47,7 +47,7 @@
call MenuBoxCoord2Tile
ld de, SCREEN_WIDTH + 1
add hl, de
- ld de, Money
+ ld de, wMoney
lb bc, PRINTNUM_MONEY | 3, 6
call PrintNum
ret
@@ -76,7 +76,7 @@
hlcoord 17, 1
ld de, ShowMoney_TerminatorString
call PlaceString
- ld de, Coins
+ ld de, wCoins
lb bc, 2, 4
hlcoord 13, 1
call PrintNum
@@ -91,7 +91,7 @@
ld de, MoneyString
call PlaceString
hlcoord 12, 1
- ld de, Money
+ ld de, wMoney
lb bc, PRINTNUM_MONEY | 3, 6
call PrintNum
hlcoord 6, 3
@@ -98,7 +98,7 @@
ld de, CoinString
call PlaceString
hlcoord 15, 3
- ld de, Coins
+ ld de, wCoins
lb bc, 2, 4
call PrintNum
ret
@@ -112,7 +112,7 @@
Unreferenced_Function24b8f: ; 24b8f
; related to safari?
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -135,7 +135,7 @@
lb bc, 1, 2
call PrintNum
pop af
- ld [Options], a
+ ld [wOptions], a
ret
.slash_500 ; 24bcf
@@ -151,7 +151,7 @@
ret
StartMenu_PrintBugContestStatus: ; 24be7
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -191,7 +191,7 @@
.skip_level
pop af
- ld [Options], a
+ ld [wOptions], a
ret
.Balls_JP: ; 24c43
@@ -207,7 +207,7 @@
FindApricornsInBag: ; 24c64
; Checks the bag for Apricorns.
- ld hl, Buffer1
+ ld hl, wBuffer1
xor a
ld [hli], a
dec a
@@ -220,8 +220,8 @@
cp -1
jr z, .done
push hl
- ld [CurItem], a
- ld hl, NumItems
+ ld [wCurItem], a
+ ld hl, wNumItems
call CheckItem
pop hl
jr nc, .nope
@@ -233,7 +233,7 @@
jr .loop
.done
- ld a, [Buffer1]
+ ld a, [wBuffer1]
and a
ret nz
scf
@@ -241,7 +241,7 @@
.addtobuffer ; 24c94
push hl
- ld hl, Buffer1
+ ld hl, wBuffer1
inc [hl]
ld e, [hl]
ld d, 0
--- a/engine/mon_icons.asm
+++ b/engine/mon_icons.asm
@@ -55,7 +55,7 @@
.GetPartyMonItemGFX: ; 8e86c (23:686c)
push bc
ld a, [hObjectStructIndexBuffer]
- ld hl, PartyMon1Item
+ ld hl, wPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
pop bc
@@ -129,7 +129,7 @@
.SpawnItemIcon: ; 8e8df (23:68df)
push bc
ld a, [hObjectStructIndexBuffer]
- ld hl, PartyMon1Item
+ ld hl, wPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
pop bc
@@ -158,13 +158,13 @@
ld a, [wCurIconTile]
push af
ld a, [hObjectStructIndexBuffer]
- ld hl, PartySpecies
+ ld hl, wPartySpecies
ld e, a
ld d, $0
add hl, de
ld a, [hl]
call ReadMonMenuIcon
- ld [CurIcon], a
+ ld [wCurIcon], a
call GetMemIconGFX
ld a, [hObjectStructIndexBuffer]
; y coord
@@ -222,7 +222,7 @@
NamingScreen_InitAnimatedMonIcon: ; 8e961 (23:6961)
ld a, [wd265]
call ReadMonMenuIcon
- ld [CurIcon], a
+ ld [wCurIcon], a
xor a
call GetIconGFX
depixel 4, 4, 4, 0
@@ -236,7 +236,7 @@
MoveList_InitAnimatedMonIcon: ; 8e97d (23:697d)
ld a, [wd265]
call ReadMonMenuIcon
- ld [CurIcon], a
+ ld [wCurIcon], a
xor a
call GetIconGFX
ld d, 3 * 8 + 2 ; depixel 3, 4, 2, 4
@@ -251,7 +251,7 @@
Trade_LoadMonIconGFX: ; 8e99a (23:699a)
ld a, [wd265]
call ReadMonMenuIcon
- ld [CurIcon], a
+ ld [wCurIcon], a
ld a, $62
ld [wCurIconTile], a
call GetMemIconGFX
@@ -262,7 +262,7 @@
push de
ld a, [wd265]
call ReadMonMenuIcon
- ld [CurIcon], a
+ ld [wCurIcon], a
pop de
ld a, e
call GetIconGFX
@@ -274,7 +274,7 @@
push de
ld a, [wd265]
call ReadMonMenuIcon
- ld [CurIcon], a
+ ld [wCurIcon], a
pop de
ld a, e
call GetIcon_a
@@ -285,7 +285,7 @@
push de
ld a, [wd265]
call ReadMonMenuIcon
- ld [CurIcon], a
+ ld [wCurIcon], a
pop de
call GetIcon_de
ret
@@ -335,7 +335,7 @@
; The icons are contiguous, in order and of the same
; size, so the pointer table is somewhat redundant.
- ld a, [CurIcon]
+ ld a, [wCurIcon]
push hl
ld l, a
ld h, 0
--- a/engine/mon_menu.asm
+++ b/engine/mon_menu.asm
@@ -48,7 +48,7 @@
ld a, 1
ld [hBGMapMode], a
call MonMenuLoop
- ld [MenuSelection], a
+ ld [wMenuSelection], a
call ExitMenu
ret
@@ -63,7 +63,7 @@
.GetTopCoord: ; 24d47
; TopCoord = 1 + BottomCoord - 2 * (NumSubmenuItems + 1)
- ld a, [Buffer1]
+ ld a, [wBuffer1]
inc a
add a
ld b, a
@@ -79,7 +79,7 @@
.loop
ld a, MENU_UNUSED_3 | MENU_BACKUP_TILES_2 ; flags
ld [wMenuData2Flags], a
- ld a, [Buffer1] ; items
+ ld a, [wBuffer1] ; items
ld [wMenuData2Items], a
call InitVerticalMenuCursor
ld hl, w2DMenuFlags1
@@ -103,7 +103,7 @@
dec a
ld c, a
ld b, 0
- ld hl, Buffer2
+ ld hl, wBuffer2
add hl, bc
ld a, [hl]
ret
@@ -113,7 +113,7 @@
call MenuBoxCoord2Tile
ld bc, $2a ; 42
add hl, bc
- ld de, Buffer2
+ ld de, wBuffer2
.loop
ld a, [de]
inc de
@@ -157,7 +157,7 @@
GetMonSubmenuItems: ; 24dd4
call ResetMonSubmenu
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
ld a, [wLinkMode]
@@ -211,7 +211,7 @@
call AddMonMenuItem
.skip2
- ld a, [Buffer1]
+ ld a, [wBuffer1]
cp NUM_MONMENU_ITEMS
jr z, .ok2
ld a, MONMENU_CANCEL
@@ -255,8 +255,8 @@
ResetMonSubmenu: ; 24e68
xor a
- ld [Buffer1], a
- ld hl, Buffer2
+ ld [wBuffer1], a
+ ld hl, wBuffer2
ld bc, NUM_MONMENU_ITEMS + 1
call ByteFill
ret
@@ -263,10 +263,10 @@
; 24e76
TerminateMonSubmenu: ; 24e76
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld e, a
ld d, $0
- ld hl, Buffer2
+ ld hl, wBuffer2
add hl, de
ld [hl], -1
ret
@@ -276,12 +276,12 @@
push hl
push de
push af
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld e, a
inc a
- ld [Buffer1], a
+ ld [wBuffer1], a
ld d, $0
- ld hl, Buffer2
+ ld hl, wBuffer2
add hl, de
pop af
ld [hl], a
--- a/engine/mon_stats.asm
+++ b/engine/mon_stats.asm
@@ -10,13 +10,13 @@
push hl
push bc
; box mons have full HP
- ld a, [MonType]
+ ld a, [wMonType]
cp BOXMON
jr z, .at_least_1_hp
- ld a, [TempMonHP]
+ ld a, [wTempMonHP]
ld b, a
- ld a, [TempMonHP + 1]
+ ld a, [wTempMonHP + 1]
ld c, a
; Any HP?
@@ -31,11 +31,11 @@
jp .fainted
.at_least_1_hp
- ld a, [TempMonMaxHP]
+ ld a, [wTempMonMaxHP]
ld d, a
- ld a, [TempMonMaxHP + 1]
+ ld a, [wTempMonMaxHP + 1]
ld e, a
- ld a, [MonType]
+ ld a, [wMonType]
cp BOXMON
jr nz, .not_boxmon
@@ -62,11 +62,11 @@
; Print HP
bccoord 1, 1, 0
add hl, bc
- ld de, TempMonHP
- ld a, [MonType]
+ ld de, wTempMonHP
+ ld a, [wMonType]
cp BOXMON
jr nz, .not_boxmon_2
- ld de, TempMonMaxHP
+ ld de, wTempMonMaxHP
.not_boxmon_2
lb bc, 2, 3
call PrintNum
@@ -75,7 +75,7 @@
ld [hli], a
; Print max HP
- ld de, TempMonMaxHP
+ ld de, wTempMonMaxHP
lb bc, 2, 3
call PrintNum
pop hl
@@ -83,7 +83,7 @@
ret
PrintTempMonStats: ; 50b7b
-; Print TempMon's stats at hl, with spacing bc.
+; Print wTempMon's stats at hl, with spacing bc.
push bc
push hl
ld de, .StatNames
@@ -93,16 +93,16 @@
add hl, bc
ld bc, SCREEN_WIDTH
add hl, bc
- ld de, TempMonAttack
+ ld de, wTempMonAttack
lb bc, 2, 3
call .PrintStat
- ld de, TempMonDefense
+ ld de, wTempMonDefense
call .PrintStat
- ld de, TempMonSpclAtk
+ ld de, wTempMonSpclAtk
call .PrintStat
- ld de, TempMonSpclDef
+ ld de, wTempMonSpclDef
call .PrintStat
- ld de, TempMonSpeed
+ ld de, wTempMonSpeed
jp PrintNum
.PrintStat: ; 50bab
@@ -122,8 +122,8 @@
next "@"
GetGender: ; 50bdd
-; Return the gender of a given monster (CurPartyMon/CurOTMon/CurWildMon).
-; When calling this function, a should be set to an appropriate MonType value.
+; Return the gender of a given monster (wCurPartyMon/wCurOTMon/CurWildMon).
+; When calling this function, a should be set to an appropriate wMonType value.
; return values:
; a = 1: f = nc|nz; male
@@ -136,14 +136,14 @@
; Figure out what type of monster struct we're looking at.
; 0: PartyMon
- ld hl, PartyMon1DVs
+ ld hl, wPartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
- ld a, [MonType]
+ ld a, [wMonType]
and a
jr z, .PartyMon
; 1: OTPartyMon
- ld hl, OTPartyMon1DVs
+ ld hl, wOTPartyMon1DVs
dec a
jr z, .PartyMon
@@ -154,12 +154,12 @@
jr z, .sBoxMon
; 3: Unknown
- ld hl, TempMonDVs
+ ld hl, wTempMonDVs
dec a
jr z, .DVs
; else: WildMon
- ld hl, EnemyMonDVs
+ ld hl, wEnemyMonDVs
jr .DVs
; Get our place in the party/box.
@@ -166,13 +166,13 @@
.PartyMon:
.sBoxMon
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
.DVs:
; sBoxMon data is read directly from SRAM.
- ld a, [MonType]
+ ld a, [wMonType]
cp BOXMON
ld a, BANK(sBox)
call z, GetSRAMBank
@@ -191,13 +191,13 @@
ld b, a
; Close SRAM if we were dealing with a sBoxMon.
- ld a, [MonType]
+ ld a, [wMonType]
cp BOXMON
call z, CloseSRAM
; We need the gender ratio to do anything with this.
push bc
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
dec a
ld hl, BaseData + BASE_GENDER
ld bc, BASE_DATA_SIZE
@@ -243,7 +243,7 @@
sub c
ld b, a
push hl
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld e, a
ld d, $0
ld a, $3e ; P
@@ -262,7 +262,7 @@
inc hl
ld d, h
ld e, l
- ld hl, TempMonMoves
+ ld hl, wTempMonMoves
ld b, 0
.loop
ld a, [hli]
@@ -283,15 +283,15 @@
pop de
pop hl
push hl
- ld bc, TempMonPP - (TempMonMoves + 1)
+ ld bc, wTempMonPP - (wTempMonMoves + 1)
add hl, bc
ld a, [hl]
and $3f
- ld [StringBuffer1 + 4], a
+ ld [wStringBuffer1 + 4], a
ld h, d
ld l, e
push hl
- ld de, StringBuffer1 + 4
+ ld de, wStringBuffer1 + 4
lb bc, 1, 2
call PrintNum
ld a, "/"
@@ -300,7 +300,7 @@
lb bc, 1, 2
call PrintNum
pop hl
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld e, a
ld d, 0
add hl, de
@@ -338,14 +338,14 @@
Unused_PlaceEnemyHPLevel:
push hl
push hl
- ld hl, PartyMonNicknames
- ld a, [CurPartyMon]
+ ld hl, wPartyMonNicknames
+ ld a, [wCurPartyMon]
call GetNick
pop hl
call PlaceString
call CopyPkmnToTempMon
pop hl
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
push hl
@@ -431,7 +431,7 @@
ParString: db "PAR@"
ListMoves: ; 50d6f
-; List moves at hl, spaced every [Buffer1] tiles.
+; List moves at hl, spaced every [wBuffer1] tiles.
ld de, wListMoves_MoveIndicesBuffer
ld b, $0
.moves_loop
@@ -442,11 +442,11 @@
push de
push hl
push hl
- ld [CurSpecies], a
+ ld [wCurSpecies], a
ld a, MOVE_NAME
ld [wNamedObjectTypeBuffer], a
call GetName
- ld de, StringBuffer1
+ ld de, wStringBuffer1
pop hl
push bc
call PlaceString
@@ -456,7 +456,7 @@
inc b
pop hl
push bc
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld c, a
ld b, 0
add hl, bc
@@ -472,7 +472,7 @@
.nonmove_loop
push af
ld [hl], "-"
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld c, a
ld b, 0
add hl, bc
--- a/engine/money.asm
+++ b/engine/money.asm
@@ -171,7 +171,7 @@
GiveCoins:: ; 1606f
ld a, 2
- ld de, Coins
+ ld de, wCoins
call AddFunds
ld a, 2
ld bc, .maxcoins
@@ -198,7 +198,7 @@
TakeCoins:: ; 1608f
ld a, 2
- ld de, Coins
+ ld de, wCoins
call SubtractFunds
jr nc, .okay
; leave with 0 coins
@@ -216,6 +216,6 @@
CheckCoins:: ; 160a1
ld a, 2
- ld de, Coins
+ ld de, wCoins
jp CompareFunds
; 160a9
--- a/engine/move_mon.asm
+++ b/engine/move_mon.asm
@@ -1,11 +1,11 @@
TryAddMonToParty: ; d88c
; Check if to copy wild Pkmn or generate new Pkmn
; Whose is it?
- ld de, PartyCount
- ld a, [MonType]
+ ld de, wPartyCount
+ ld a, [wMonType]
and $f
jr z, .getpartylocation ; PARTYMON
- ld de, OTPartyCount
+ ld de, wOTPartyCount
.getpartylocation
; Do we have room for it?
@@ -25,7 +25,7 @@
.loadspecies
; Load the species of the Pokemon into the party list.
; The terminator is usually here, but it'll be back.
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [de], a
; Load the terminator into the next slot.
inc de
@@ -32,11 +32,11 @@
ld a, -1
ld [de], a
; Now let's load the OT name.
- ld hl, PartyMonOT
- ld a, [MonType]
+ ld hl, wPartyMonOT
+ ld a, [wMonType]
and $f
jr z, .loadOTname
- ld hl, OTPartyMonOT
+ ld hl, wOTPartyMonOT
.loadOTname
ld a, [hMoveMon] ; Restore index from backup
@@ -44,31 +44,31 @@
call SkipNames
ld d, h
ld e, l
- ld hl, PlayerName
+ ld hl, wPlayerName
ld bc, NAME_LENGTH
call CopyBytes
- ld a, [MonType]
+ ld a, [wMonType]
and a
jr nz, .skipnickname
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
call GetPokemonName
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
ld a, [hMoveMon]
dec a
call SkipNames
ld d, h
ld e, l
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld bc, MON_NAME_LENGTH
call CopyBytes
.skipnickname
- ld hl, PartyMon1Species
- ld a, [MonType]
+ ld hl, wPartyMon1Species
+ ld a, [wMonType]
and $f
jr z, .initializeStats
- ld hl, OTPartyMon1Species
+ ld hl, wOTPartyMon1Species
.initializeStats
ld a, [hMoveMon]
@@ -79,10 +79,10 @@
ld e, l
ld d, h
push hl
- ld a, [CurPartySpecies]
- ld [CurSpecies], a
+ ld a, [wCurPartySpecies]
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [BaseDexNo]
+ ld a, [wBaseDexNo]
ld [de], a
inc de
ld a, [wBattleMode]
@@ -89,7 +89,7 @@
and a
ld a, $0
jr z, .skipitem
- ld a, [EnemyMonItem]
+ ld a, [wEnemyMonItem]
.skipitem
ld [de], a
@@ -100,10 +100,10 @@
ld a, [wBattleMode]
and a
jr z, .randomlygeneratemoves
- ld a, [MonType]
+ ld a, [wMonType]
and a
jr nz, .randomlygeneratemoves
- ld de, EnemyMonMoves
+ ld de, wEnemyMonMoves
rept NUM_MOVES + -1
ld a, [de]
inc de
@@ -119,7 +119,7 @@
ld [hli], a
endr
ld [hl], a
- ld [Buffer1], a
+ ld [wBuffer1], a
predef FillMoves
.next
@@ -127,14 +127,14 @@
rept 4
inc de
endr
- ld a, [PlayerID]
+ ld a, [wPlayerID]
ld [de], a
inc de
- ld a, [PlayerID + 1]
+ ld a, [wPlayerID + 1]
ld [de], a
inc de
push de
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld d, a
callfar CalcExpAtLevel
pop de
@@ -156,7 +156,7 @@
jr nz, .loop
pop hl
push hl
- ld a, [MonType]
+ ld a, [wMonType]
and $f
jr z, .generateDVs
push hl
@@ -165,7 +165,7 @@
jr .initializetrainermonstats
.generateDVs
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
dec a
push de
@@ -211,7 +211,7 @@
inc de
ld [de], a
inc de
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld [de], a
inc de
xor a
@@ -234,15 +234,15 @@
jr .next2
.copywildmonstats
- ld a, [EnemyMonDVs]
+ ld a, [wEnemyMonDVs]
ld [de], a
inc de
- ld a, [EnemyMonDVs + 1]
+ ld a, [wEnemyMonDVs + 1]
ld [de], a
inc de
push hl
- ld hl, EnemyMonPP
+ ld hl, wEnemyMonPP
ld b, NUM_MOVES
.wildmonpploop
ld a, [hli]
@@ -262,11 +262,11 @@
inc de
ld [de], a
inc de
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld [de], a
inc de
- ld hl, EnemyMonStatus
- ; Copy EnemyMonStatus
+ ld hl, wEnemyMonStatus
+ ; Copy wEnemyMonStatus
ld a, [hli]
ld [de], a
inc de
@@ -274,7 +274,7 @@
ld a, [hli]
ld [de], a
inc de
- ; Copy EnemyMonHP
+ ; Copy wEnemyMonHP
ld a, [hli]
ld [de], a
inc de
@@ -286,7 +286,7 @@
ld a, [wBattleMode]
dec a
jr nz, .generatestats
- ld hl, EnemyMonMaxHP
+ ld hl, wEnemyMonMaxHP
ld bc, 2 * 6 ; MaxHP + 5 Stats
call CopyBytes
pop hl
@@ -300,14 +300,14 @@
call CalcPkmnStats
.next3
- ld a, [MonType]
+ ld a, [wMonType]
and $f
jr nz, .done
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp UNOWN
jr nz, .done
- ld hl, PartyMon1DVs
- ld a, [PartyCount]
+ ld hl, wPartyMon1DVs
+ ld a, [wPartyCount]
dec a
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
@@ -333,13 +333,13 @@
ld hl, Moves
ld bc, MOVE_LENGTH
call AddNTimes
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld a, BANK(Moves)
call FarCopyBytes
pop bc
pop de
pop hl
- ld a, [StringBuffer1 + MOVE_PP]
+ ld a, [wStringBuffer1 + MOVE_PP]
.next
ld [de], a
@@ -351,7 +351,7 @@
; da96
AddTempmonToParty: ; da96
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [hl]
cp PARTY_LENGTH
scf
@@ -362,52 +362,52 @@
ld c, a
ld b, 0
add hl, bc
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [hli], a
ld [hl], $ff
- ld hl, PartyMon1Species
- ld a, [PartyCount]
+ ld hl, wPartyMon1Species
+ ld a, [wPartyCount]
dec a
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld e, l
ld d, h
- ld hl, TempMonSpecies
+ ld hl, wTempMonSpecies
call CopyBytes
- ld hl, PartyMonOT
- ld a, [PartyCount]
+ ld hl, wPartyMonOT
+ ld a, [wPartyCount]
dec a
call SkipNames
ld d, h
ld e, l
- ld hl, OTPartyMonOT
- ld a, [CurPartyMon]
+ ld hl, wOTPartyMonOT
+ ld a, [wCurPartyMon]
call SkipNames
ld bc, NAME_LENGTH
call CopyBytes
- ld hl, PartyMonNicknames
- ld a, [PartyCount]
+ ld hl, wPartyMonNicknames
+ ld a, [wPartyCount]
dec a
call SkipNames
ld d, h
ld e, l
- ld hl, OTPartyMonNicknames
- ld a, [CurPartyMon]
+ ld hl, wOTPartyMonNicknames
+ ld a, [wCurPartyMon]
call SkipNames
ld bc, MON_NAME_LENGTH
call CopyBytes
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wNamedObjectIndexBuffer], a
cp EGG
jr z, .egg
dec a
call SetSeenAndCaughtMon
- ld hl, PartyMon1Happiness
- ld a, [PartyCount]
+ ld hl, wPartyMon1Happiness
+ ld a, [wPartyCount]
dec a
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
@@ -414,11 +414,11 @@
ld [hl], BASE_HAPPINESS
.egg
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp UNOWN
jr nz, .done
- ld hl, PartyMon1DVs
- ld a, [PartyCount]
+ ld hl, wPartyMon1DVs
+ ld a, [wPartyCount]
dec a
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
@@ -427,7 +427,7 @@
ld a, [wFirstUnownSeen]
and a
jr nz, .done
- ld a, [UnownLetter]
+ ld a, [wUnownLetter]
ld [wFirstUnownSeen], a
.done
@@ -461,7 +461,7 @@
jp CloseSRAM_And_SetCarryFlag
.check_IfPartyIsFull
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [hl]
cp PARTY_LENGTH
jp z, CloseSRAM_And_SetCarryFlag
@@ -476,7 +476,7 @@
cp DAY_CARE_WITHDRAW
ld a, [wBreedMon1Species]
jr z, .okay1
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
.okay1
ld [hli], a
@@ -483,9 +483,9 @@
ld [hl], $ff
ld a, [wPokemonWithdrawDepositParameter]
dec a
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
- ld a, [PartyCount]
+ ld a, [wPartyCount]
jr nz, .okay2
ld hl, sBoxMon1Species
ld bc, BOXMON_STRUCT_LENGTH
@@ -492,7 +492,7 @@
ld a, [sBoxCount]
.okay2
- dec a ; PartyCount - 1
+ dec a ; wPartyCount - 1
call AddNTimes
.breedmon
@@ -507,11 +507,11 @@
cp DAY_CARE_WITHDRAW
ld hl, wBreedMon1Species
jr z, .okay4
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
.okay3
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
.okay4
@@ -522,8 +522,8 @@
ld de, wBreedMon1OT
jr z, .okay5
dec a
- ld hl, PartyMonOT
- ld a, [PartyCount]
+ ld hl, wPartyMonOT
+ ld a, [wPartyCount]
jr nz, .okay6
ld hl, sBoxMonOT
ld a, [sBoxCount]
@@ -542,10 +542,10 @@
ld hl, wBreedMon1OT
cp DAY_CARE_WITHDRAW
jr z, .okay8
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
.okay7
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call SkipNames
.okay8
@@ -556,8 +556,8 @@
ld de, wBreedMon1Nick
jr z, .okay9
dec a
- ld hl, PartyMonNicknames
- ld a, [PartyCount]
+ ld hl, wPartyMonNicknames
+ ld a, [wPartyCount]
jr nz, .okay10
ld hl, sBoxMonNicknames
ld a, [sBoxCount]
@@ -576,10 +576,10 @@
ld hl, wBreedMon1Nick
cp DAY_CARE_WITHDRAW
jr z, .okay12
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
.okay11
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call SkipNames
.okay12
@@ -596,11 +596,11 @@
push hl
srl a
add $2
- ld [MonType], a
+ ld [wMonType], a
predef CopyPkmnToTempMon
callfar CalcLevel
ld a, d
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
pop hl
ld b, h
@@ -631,7 +631,7 @@
add hl, bc
ld d, h
ld e, l
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
inc hl
@@ -678,7 +678,7 @@
add hl, bc
push hl
push bc
- ld de, TempMonPP
+ ld de, wTempMonPP
ld bc, NUM_MOVES
call CopyBytes
pop bc
@@ -685,7 +685,7 @@
ld hl, MON_MOVES
add hl, bc
push hl
- ld de, TempMonMoves
+ ld de, wTempMonMoves
ld bc, NUM_MOVES
call CopyBytes
pop hl
@@ -693,7 +693,7 @@
ld a, [wMenuCursorY]
push af
- ld a, [MonType]
+ ld a, [wMonType]
push af
ld b, 0
.loop
@@ -700,9 +700,9 @@
ld a, [hli]
and a
jr z, .done
- ld [TempMonMoves], a
+ ld [wTempMonMoves], a
ld a, BOXMON
- ld [MonType], a
+ ld [wMonType], a
ld a, b
ld [wMenuCursorY], a
push bc
@@ -726,7 +726,7 @@
.done
pop af
- ld [MonType], a
+ ld [wMonType], a
pop af
ld [wMenuCursorY], a
ret
@@ -734,7 +734,7 @@
RetrievePokemonFromDayCareMan: ; dd21
ld a, [wBreedMon1Species]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld de, SFX_TRANSACTION
call PlaySFX
call WaitSFX
@@ -742,7 +742,7 @@
ld a, b
ld [wd002], a
ld a, e
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
xor a
ld [wPokemonWithdrawDepositParameter], a
jp Functiondd64
@@ -750,7 +750,7 @@
RetrievePokemonFromDayCareLady: ; dd42
ld a, [wBreedMon2Species]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld de, SFX_TRANSACTION
call PlaySFX
call WaitSFX
@@ -758,7 +758,7 @@
ld a, b
ld [wd002], a
ld a, e
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld a, PC_DEPOSIT
ld [wPokemonWithdrawDepositParameter], a
jp Functiondd64
@@ -765,7 +765,7 @@
; dd64
Functiondd64: ; dd64
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [hl]
cp PARTY_LENGTH
jr nz, .room_in_party
@@ -788,11 +788,11 @@
.okay
ld [hli], a
- ld [CurSpecies], a
+ ld [wCurSpecies], a
ld a, $ff
ld [hl], a
- ld hl, PartyMonNicknames
- ld a, [PartyCount]
+ ld hl, wPartyMonNicknames
+ ld a, [wPartyCount]
dec a
call SkipNames
push hl
@@ -801,8 +801,8 @@
pop de
call CopyBytes
push hl
- ld hl, PartyMonOT
- ld a, [PartyCount]
+ ld hl, wPartyMonOT
+ ld a, [wPartyCount]
dec a
call SkipNames
ld d, h
@@ -820,7 +820,7 @@
ld c, e
ld hl, MON_LEVEL
add hl, bc
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld [hl], a
ld hl, MON_MAXHP
add hl, bc
@@ -831,8 +831,8 @@
push bc
ld b, $1
call CalcPkmnStats
- ld hl, PartyMon1Moves
- ld a, [PartyCount]
+ ld hl, wPartyMon1Moves
+ ld a, [wPartyCount]
dec a
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
@@ -839,13 +839,13 @@
ld d, h
ld e, l
ld a, $1
- ld [Buffer1], a
+ ld [wBuffer1], a
predef FillMoves
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
farcall HealPartyMon
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld d, a
callfar CalcExpAtLevel
pop bc
@@ -862,9 +862,9 @@
; de1a
Functionde1a: ; de1a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld d, h
@@ -889,16 +889,16 @@
; de44
DepositBreedmon: ; de44
- ld a, [CurPartyMon]
- ld hl, PartyMonNicknames
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonNicknames
call SkipNames
call CopyBytes
- ld a, [CurPartyMon]
- ld hl, PartyMonOT
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonOT
call SkipNames
call CopyBytes
- ld a, [CurPartyMon]
- ld hl, PartyMon1Species
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld bc, BOXMON_STRUCT_LENGTH
@@ -906,7 +906,7 @@
SendPkmnIntoBox: ; de6e
; Sends the Pkmn into one of Bills Boxes
-; the data comes mainly from 'EnemyMon:'
+; the data comes mainly from 'wEnemyMon:'
ld a, BANK(sBoxCount)
call GetSRAMBank
ld de, sBoxCount
@@ -916,8 +916,8 @@
inc a
ld [de], a
- ld a, [CurPartySpecies]
- ld [CurSpecies], a
+ ld a, [wCurPartySpecies]
+ ld [wCurSpecies], a
ld c, a
.loop
inc de
@@ -932,26 +932,26 @@
call GetBaseData
call ShiftBoxMon
- ld hl, PlayerName
+ ld hl, wPlayerName
ld de, sBoxMonOT
ld bc, NAME_LENGTH
call CopyBytes
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
call GetPokemonName
ld de, sBoxMonNicknames
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld bc, MON_NAME_LENGTH
call CopyBytes
- ld hl, EnemyMon
+ ld hl, wEnemyMon
ld de, sBoxMon1
ld bc, 1 + 1 + NUM_MOVES ; species + item + moves
call CopyBytes
- ld hl, PlayerID
+ ld hl, wPlayerID
ld a, [hli]
ld [de], a
inc de
@@ -959,7 +959,7 @@
ld [de], a
inc de
push de
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld d, a
callfar CalcExpAtLevel
pop de
@@ -982,8 +982,8 @@
dec b
jr nz, .loop2
- ld hl, EnemyMonDVs
- ld b, 2 + NUM_MOVES ; DVs and PP ; EnemyMonHappiness - EnemyMonDVs
+ ld hl, wEnemyMonDVs
+ ld b, 2 + NUM_MOVES ; DVs and PP ; wEnemyMonHappiness - wEnemyMonDVs
.loop3
ld a, [hli]
ld [de], a
@@ -1001,12 +1001,12 @@
inc de
ld [de], a
inc de
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld [de], a
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
dec a
call SetSeenAndCaughtMon
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp UNOWN
jr nz, .not_unown
ld hl, sBoxMon1DVs
@@ -1015,12 +1015,12 @@
.not_unown
ld hl, sBoxMon1Moves
- ld de, TempMonMoves
+ ld de, wTempMonMoves
ld bc, NUM_MOVES
call CopyBytes
ld hl, sBoxMon1PP
- ld de, TempMonPP
+ ld de, wTempMonPP
ld bc, NUM_MOVES
call CopyBytes
@@ -1087,11 +1087,11 @@
; df8c
GiveEgg:: ; df8c
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
push af
callfar GetPreEvolution
callfar GetPreEvolution
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
dec a
; TryAddMonToParty sets Seen and Caught flags
@@ -1113,11 +1113,11 @@
ld a, c
and a
jr nz, .skip_caught_flag
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
dec a
ld c, a
ld d, $0
- ld hl, PokedexCaught
+ ld hl, wPokedexCaught
ld b, RESET_FLAG
predef SmallFarFlagAction
@@ -1129,25 +1129,25 @@
ld a, c
and a
jr nz, .skip_seen_flag
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
dec a
ld c, a
ld d, $0
- ld hl, PokedexSeen
+ ld hl, wPokedexSeen
ld b, RESET_FLAG
predef SmallFarFlagAction
.skip_seen_flag
pop af
- ld [CurPartySpecies], a
- ld a, [PartyCount]
+ ld [wCurPartySpecies], a
+ ld a, [wPartyCount]
dec a
ld bc, PARTYMON_STRUCT_LENGTH
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
call AddNTimes
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [hl], a
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [hl]
ld b, 0
ld c, a
@@ -1154,15 +1154,15 @@
add hl, bc
ld a, EGG
ld [hl], a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
call SkipNames
ld de, String_Egg
call CopyName2
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1Happiness
+ ld hl, wPartyMon1Happiness
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld a, [wMonStatusFlags]
@@ -1169,13 +1169,13 @@
bit 1, a
ld a, 1
jr nz, .got_init_happiness
- ld a, [BaseEggSteps]
+ ld a, [wBaseEggSteps]
.got_init_happiness
ld [hl], a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
xor a
@@ -1190,7 +1190,7 @@
; e039
RemoveMonFromPartyOrBox: ; e039
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [wPokemonWithdrawDepositParameter]
and a
@@ -1204,7 +1204,7 @@
ld a, [hl]
dec a
ld [hli], a
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld c, a
ld b, 0
add hl, bc
@@ -1217,7 +1217,7 @@
ld [hli], a
inc a
jr nz, .loop
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
ld d, PARTY_LENGTH - 1
ld a, [wPokemonWithdrawDepositParameter]
and a
@@ -1228,9 +1228,9 @@
.party
; If this is the last mon in our party (box),
; shift all the other mons up to close the gap.
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call SkipNames
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
cp d
jr nz, .delete_inside
ld [hl], -1
@@ -1242,7 +1242,7 @@
ld e, l
ld bc, MON_NAME_LENGTH
add hl, bc
- ld bc, PartyMonNicknames
+ ld bc, wPartyMonNicknames
ld a, [wPokemonWithdrawDepositParameter]
and a
jr z, .party2
@@ -1250,7 +1250,7 @@
.party2
call CopyDataUntil
; Shift the struct
- ld hl, PartyMons
+ ld hl, wPartyMons
ld bc, PARTYMON_STRUCT_LENGTH
ld a, [wPokemonWithdrawDepositParameter]
and a
@@ -1258,7 +1258,7 @@
ld hl, sBoxMons
ld bc, BOXMON_STRUCT_LENGTH
.party4
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld d, h
ld e, l
@@ -1273,11 +1273,11 @@
.party5
ld bc, PARTYMON_STRUCT_LENGTH
add hl, bc
- ld bc, PartyMonOT
+ ld bc, wPartyMonOT
.copy
call CopyDataUntil
; Shift the nicknames
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
ld a, [wPokemonWithdrawDepositParameter]
and a
jr z, .party6
@@ -1284,13 +1284,13 @@
ld hl, sBoxMonNicknames
.party6
ld bc, MON_NAME_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld d, h
ld e, l
ld bc, MON_NAME_LENGTH
add hl, bc
- ld bc, PartyMonNicknamesEnd
+ ld bc, wPartyMonNicknamesEnd
ld a, [wPokemonWithdrawDepositParameter]
and a
jr z, .party7
@@ -1309,8 +1309,8 @@
ld a, BANK(sPartyMail)
call GetSRAMBank
; If this is the last mon in our party, no need to shift mail.
- ld hl, PartyCount
- ld a, [CurPartyMon]
+ ld hl, wPartyCount
+ ld a, [wCurPartyMon]
cp [hl]
jr z, .close_sram
; Shift our mail messages up.
@@ -1320,7 +1320,7 @@
push hl
add hl, bc
pop de
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld b, a
.loop2
push bc
@@ -1334,7 +1334,7 @@
pop de
pop bc
inc b
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp b
jr nz, .loop2
.close_sram
@@ -1350,7 +1350,7 @@
ld a, MON_SPECIES
call GetPartyParamLocation
ld a, [hl]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
ld a, MON_MAXHP
call GetPartyParamLocation
@@ -1375,7 +1375,7 @@
CalcPkmnStats: ; e167
; Calculates all 6 Stats of a Pkmn
; b: Take into account stat EXP if TRUE
-; 'c' counts from 1-6 and points with 'BaseStats' to the base value
+; 'c' counts from 1-6 and points with 'wBaseStats' to the base value
; hl is the path to the Stat EXP
; results in $ffb5 and $ffb6 are saved in [de]
@@ -1409,7 +1409,7 @@
ld a, b
ld d, a
push hl
- ld hl, BaseStats
+ ld hl, wBaseStats
dec hl ; has to be decreased, because 'c' begins with 1
ld b, $0
add hl, bc
@@ -1527,7 +1527,7 @@
ld [hMultiplicand + 1], a
xor a
ld [hMultiplicand + 0], a
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld [hMultiplier], a
call Multiply
ld a, [hProduct + 1]
@@ -1545,7 +1545,7 @@
cp STAT_HP
ld a, STAT_MIN_NORMAL
jr nz, .not_hp
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
ld b, a
ld a, [hQuotient + 2]
add b
@@ -1595,13 +1595,13 @@
push de
push bc
xor a ; PARTYMON
- ld [MonType], a
+ ld [wMonType], a
call TryAddMonToParty
jr nc, .failed
- ld hl, PartyMonNicknames
- ld a, [PartyCount]
+ ld hl, wPartyMonNicknames
+ ld a, [wPartyCount]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
call SkipNames
ld d, h
ld e, l
@@ -1611,27 +1611,27 @@
push bc
push de
push af
- ld a, [CurItem]
+ ld a, [wCurItem]
and a
jr z, .done
- ld a, [CurPartyMon]
- ld hl, PartyMon1Item
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [hl], a
jr .done
.failed
- ld a, [CurPartySpecies]
- ld [TempEnemyMonSpecies], a
+ ld a, [wCurPartySpecies]
+ ld [wTempEnemyMonSpecies], a
callfar LoadEnemyMon
call SendPkmnIntoBox
jp nc, .FailedToGiveMon
ld a, BOXMON
- ld [MonType], a
+ ld [wMonType], a
xor a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld de, wMonOrItemNameBuffer
pop bc
ld a, b
@@ -1639,18 +1639,18 @@
push bc
push de
push af
- ld a, [CurItem]
+ ld a, [wCurItem]
and a
jr z, .done
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [sBoxMon1Item], a
.done
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
- ld [TempEnemyMonSpecies], a
+ ld [wTempEnemyMonSpecies], a
call GetPokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wMonOrItemNameBuffer
ld bc, MON_NAME_LENGTH
call CopyBytes
@@ -1662,15 +1662,15 @@
pop hl
push bc
push hl
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
call GetFarHalfword
ld bc, MON_NAME_LENGTH
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
call FarCopyBytes
pop hl
inc hl
inc hl
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
call GetFarHalfword
pop bc
ld a, b
@@ -1680,14 +1680,14 @@
jr nz, .send_to_box
push hl
- ld a, [CurPartyMon]
- ld hl, PartyMonOT
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonOT
call SkipNames
ld d, h
ld e, l
pop hl
.otnameloop
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
call GetFarByte
ld [de], a
inc hl
@@ -1694,12 +1694,12 @@
inc de
cp "@"
jr nz, .otnameloop
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
call GetFarByte
ld b, a
push bc
- ld a, [CurPartyMon]
- ld hl, PartyMon1ID
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1ID
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld a, HIGH(01001)
@@ -1714,7 +1714,7 @@
call GetSRAMBank
ld de, sBoxMonOT
.loop
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
call GetFarByte
ld [de], a
inc hl
@@ -1721,7 +1721,7 @@
inc de
cp "@"
jr nz, .loop
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
call GetFarByte
ld b, a
ld hl, sBoxMon1ID
@@ -1793,7 +1793,7 @@
ld b, $0
farcall NamingScreen
pop hl
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call InitName
ld a, $4 ; ExitAllMenus is in bank 0, XXX could this be in bank 4 in pokered?
ld hl, ExitAllMenus
--- a/engine/move_mon_wo_mail.asm
+++ b/engine/move_mon_wo_mail.asm
@@ -25,39 +25,39 @@
ld de, wBufferMon
call InsertDataIntoBoxOrParty
ld hl, wBufferMonMoves
- ld de, TempMonMoves
+ ld de, wTempMonMoves
ld bc, NUM_MOVES
call CopyBytes
ld hl, wBufferMonPP
- ld de, TempMonPP
+ ld de, wTempMonPP
ld bc, NUM_MOVES
call CopyBytes
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld b, a
farcall RestorePPofDepositedPokemon
jp CloseSRAM
InsertPokemonIntoParty: ; 5138b
- ld hl, PartyCount
+ ld hl, wPartyCount
call InsertSpeciesIntoBoxOrParty
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
ld [wd265], a
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
ld de, wBufferMonNick
call InsertDataIntoBoxOrParty
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
ld [wd265], a
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
ld bc, NAME_LENGTH
ld de, wBufferMonOT
call InsertDataIntoBoxOrParty
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
ld [wd265], a
- ld hl, PartyMons
+ ld hl, wPartyMons
ld bc, PARTYMON_STRUCT_LENGTH
ld de, wBufferMon
call InsertDataIntoBoxOrParty
@@ -66,11 +66,11 @@
InsertSpeciesIntoBoxOrParty: ; 513cb
inc [hl]
inc hl
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld c, a
ld b, 0
add hl, bc
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld c, a
.loop
ld a, [hl]
@@ -97,7 +97,7 @@
push bc
ld a, [wd265]
ld b, a
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
cp b
pop bc
jr z, .insert
@@ -124,7 +124,7 @@
.insert
pop bc
pop hl
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld d, h
ld e, l
--- a/engine/movement.asm
+++ b/engine/movement.asm
@@ -215,7 +215,7 @@
add hl, bc
ld [hl], $0
- ld hl, VramState
+ ld hl, wVramState
res 7, [hl]
ld hl, OBJECT_STEP_TYPE
@@ -243,7 +243,7 @@
add hl, bc
ld [hl], STEP_TYPE_03
- ld hl, VramState
+ ld hl, wVramState
res 7, [hl]
ret
; 51fd
@@ -257,7 +257,7 @@
ld [hl], -1
.not_leading
- ld hl, VramState
+ ld hl, wVramState
res 7, [hl]
ret
; 5210
@@ -271,7 +271,7 @@
add hl, bc
ld [hl], STEP_TYPE_04
- ld hl, VramState
+ ld hl, wVramState
res 7, [hl]
ret
; 5222
--- a/engine/mystery_gift.asm
+++ b/engine/mystery_gift.asm
@@ -79,7 +79,7 @@
callfar GetDecorationName_c
ld h, d
ld l, e
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld bc, ITEM_NAME_LENGTH
call CopyBytes
ld hl, .Text_SentToHome ; sent decoration to home
@@ -394,7 +394,7 @@
jp nz, Function104d32
call Function104d38
ret nz
- ld hl, OverworldMap
+ ld hl, wOverworldMap
ld a, [wca02]
ld b, a
call Function104d4e
@@ -551,7 +551,7 @@
jp nz, Function104d32
call Function104d38
ret nz
- ld hl, OverworldMap
+ ld hl, wOverworldMap
ld a, [wca02]
ld b, a
call Function104d4e
@@ -1229,8 +1229,8 @@
ld a, BANK(sPokemonData)
call GetSRAMBank
ld de, wMysteryGiftStaging
- ld bc, sPokemonData + PartyMons - wPokemonData
- ld hl, sPokemonData + PartySpecies - wPokemonData
+ ld bc, sPokemonData + wPartyMons - wPokemonData
+ ld hl, sPokemonData + wPartySpecies - wPokemonData
.loop
ld a, [hli]
cp -1
@@ -1458,7 +1458,7 @@
Function1056eb: ; 1056eb (41:56eb)
ld c, 16
.loop
- ld hl, Sprite01YCoord
+ ld hl, wVirtualOAMSprite00YCoord
ld b, 8
.dec_y_loop
dec [hl]
@@ -1467,7 +1467,7 @@
endr
dec b
jr nz, .dec_y_loop
- ld hl, Sprite09YCoord
+ ld hl, wVirtualOAMSprite08YCoord
ld b, 8
.inc_y_loop
inc [hl]
@@ -1543,13 +1543,13 @@
ret
Function10578c: ; 10578c (41:578c)
- ld de, OverworldMap
+ ld de, wOverworldMap
ld a, BANK(sPlayerData)
call GetSRAMBank
- ld hl, sPlayerData + PlayerName - wPlayerData
+ ld hl, sPlayerData + wPlayerName - wPlayerData
ld bc, NAME_LENGTH
call CopyBytes
- ld hl, sPlayerData + PlayerID - wPlayerData
+ ld hl, sPlayerData + wPlayerID - wPlayerData
ld bc, 2
call CopyBytes
ld hl, sPlayerData + wSecretID - wPlayerData
@@ -1656,7 +1656,7 @@
ld [hl], $3c
hlcoord 17, 15
ld [hl], $3e
- ld de, Sprite01
+ ld de, wVirtualOAMSprite00
ld hl, .OAM_data
ld bc, 16 * SPRITEOAMSTRUCT_LENGTH
call CopyBytes
--- a/engine/mystery_gift_2.asm
+++ b/engine/mystery_gift_2.asm
@@ -5,7 +5,7 @@
inc de ; wc801
ld a, BANK(sGameData)
call GetSRAMBank
- ld hl, sPlayerData + PlayerID - wPlayerData
+ ld hl, sPlayerData + wPlayerID - wPlayerData
ld a, [hli]
ld [de], a
ld b, a
@@ -15,12 +15,12 @@
ld c, a
inc de ; wc803
push bc
- ld hl, sPlayerData + PlayerName - wPlayerData
+ ld hl, sPlayerData + wPlayerName - wPlayerData
ld bc, NAME_LENGTH
call CopyBytes
push de ; wc80e
- ld hl, sPokemonData + PokedexCaught - wPokemonData
- ld b, EndPokedexCaught - PokedexCaught
+ ld hl, sPokemonData + wPokedexCaught - wPokemonData
+ ld b, wEndPokedexCaught - wPokedexCaught
call CountSetBits
pop de
pop bc
--- a/engine/naming_screen.asm
+++ b/engine/naming_screen.asm
@@ -19,7 +19,7 @@
ld [hl], d
ld hl, wNamingScreenType
ld [hl], b
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -41,7 +41,7 @@
pop af
ld [hMapAnims], a
pop af
- ld [Options], a
+ ld [wOptions], a
call ClearJoypad
ret
@@ -91,13 +91,13 @@
dw .Pokemon
.Pokemon: ; 1173e (4:573e)
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
ld hl, LoadMenuMonIcon
ld a, BANK(LoadMenuMonIcon)
ld e, $1
rst FarCall ; ; indirect jump to LoadMenuMonIcon (8e83f (23:683f))
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
call GetPokemonName
hlcoord 5, 2
--- a/engine/npc_movement.asm
+++ b/engine/npc_movement.asm
@@ -235,7 +235,7 @@
call CheckCounterTile
jr nz, .asm_6ff1
- ld a, [PlayerStandingMapX]
+ ld a, [wPlayerStandingMapX]
sub d
cpl
inc a
@@ -242,7 +242,7 @@
add d
ld d, a
- ld a, [PlayerStandingMapY]
+ ld a, [wPlayerStandingMapY]
sub e
cpl
inc a
@@ -250,7 +250,7 @@
ld e, a
.asm_6ff1
- ld bc, ObjectStructs ; redundant
+ ld bc, wObjectStructs ; redundant
ld a, 0
ld [hMapObjectIndexBuffer], a
call IsNPCAtCoord
@@ -317,7 +317,7 @@
; 7041
IsNPCAtCoord: ; 7041
- ld bc, ObjectStructs
+ ld bc, wObjectStructs
xor a
.loop
ld [hObjectStructIndexBuffer], a
@@ -454,7 +454,7 @@
IsObjectMovingOffEdgeOfScreen: ; 70ed
ld hl, OBJECT_NEXT_MAP_X
add hl, bc
- ld a, [XCoord]
+ ld a, [wXCoord]
cp [hl]
jr z, .check_y
jr nc, .yes
@@ -465,7 +465,7 @@
.check_y
ld hl, OBJECT_NEXT_MAP_Y
add hl, bc
- ld a, [YCoord]
+ ld a, [wYCoord]
cp [hl]
jr z, .nope
jr nc, .yes
@@ -483,11 +483,11 @@
; 7113
Unreferenced_Function7113:
- ld a, [PlayerStandingMapX]
+ ld a, [wPlayerStandingMapX]
ld d, a
- ld a, [PlayerStandingMapY]
+ ld a, [wPlayerStandingMapY]
ld e, a
- ld bc, ObjectStructs
+ ld bc, wObjectStructs
xor a
.loop
ld [hObjectStructIndexBuffer], a
--- a/engine/npctrade.asm
+++ b/engine/npctrade.asm
@@ -22,7 +22,7 @@
ld e, TRADE_GIVEMON
call GetTradeAttribute
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp [hl]
ld a, TRADE_WRONG
jr nz, .done
@@ -70,7 +70,7 @@
CheckTradeGender: ; fcc23
xor a
- ld [MonType], a
+ ld [wMonType], a
ld e, TRADE_GENDER
call GetTradeAttribute
@@ -136,29 +136,29 @@
call GetTradeMonName
call CopyTradeName
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
ld bc, NAME_LENGTH
call Trade_GetAttributeOfCurrentPartymon
ld de, wPlayerTrademonOTName
call CopyTradeName
- ld hl, PlayerName
+ ld hl, wPlayerName
ld de, wPlayerTrademonSenderName
call CopyTradeName
- ld hl, PartyMon1ID
+ ld hl, wPartyMon1ID
ld bc, PARTYMON_STRUCT_LENGTH
call Trade_GetAttributeOfCurrentPartymon
ld de, wPlayerTrademonID
call Trade_CopyTwoBytes
- ld hl, PartyMon1DVs
+ ld hl, wPartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
call Trade_GetAttributeOfCurrentPartymon
ld de, wPlayerTrademonDVs
call Trade_CopyTwoBytes
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call Trade_GetAttributeOfCurrentPartymon
ld b, h
@@ -177,15 +177,15 @@
.okay
ld [wOTTrademonCaughtData], a
- ld hl, PartyMon1Level
+ ld hl, wPartyMon1Level
ld bc, PARTYMON_STRUCT_LENGTH
call Trade_GetAttributeOfCurrentPartymon
ld a, [hl]
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld a, [wOTTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
xor a
- ld [MonType], a
+ ld [wMonType], a
ld [wPokemonWithdrawDepositParameter], a
callfar RemoveMonFromPartyOrBox
predef TryAddMonToParty
@@ -205,7 +205,7 @@
ld de, wOTTrademonNickname
call CopyTradeName
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
call Trade_GetAttributeOfLastPartymon
ld hl, wOTTrademonNickname
@@ -220,7 +220,7 @@
ld de, wOTTrademonSenderName
call CopyTradeName
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
ld bc, NAME_LENGTH
call Trade_GetAttributeOfLastPartymon
ld hl, wOTTrademonOTName
@@ -231,7 +231,7 @@
ld de, wOTTrademonDVs
call Trade_CopyTwoBytes
- ld hl, PartyMon1DVs
+ ld hl, wPartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
call Trade_GetAttributeOfLastPartymon
ld hl, wOTTrademonDVs
@@ -242,7 +242,7 @@
ld de, wOTTrademonID + 1
call Trade_CopyTwoBytesReverseEndian
- ld hl, PartyMon1ID
+ ld hl, wPartyMon1ID
ld bc, PARTYMON_STRUCT_LENGTH
call Trade_GetAttributeOfLastPartymon
ld hl, wOTTrademonID
@@ -251,7 +251,7 @@
ld e, TRADE_ITEM
call GetTradeAttribute
push hl
- ld hl, PartyMon1Item
+ ld hl, wPartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
call Trade_GetAttributeOfLastPartymon
pop hl
@@ -262,14 +262,14 @@
push bc
push de
push hl
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
push af
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
farcall ComputeNPCTrademonStats
pop af
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
pop hl
pop de
pop bc
@@ -295,13 +295,13 @@
; 0xfcdd7
Trade_GetAttributeOfCurrentPartymon: ; fcdd7
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ret
; fcdde
Trade_GetAttributeOfLastPartymon: ; fcdde
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
call AddNTimes
ld e, l
@@ -313,7 +313,7 @@
push de
ld [wd265], a
call GetBasePokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
pop de
ret
; fcdf4
@@ -364,7 +364,7 @@
ld a, [hl]
call GetTradeMonName
- ld de, StringBuffer2
+ ld de, wStringBuffer2
call CopyTradeName
ld e, TRADE_GIVEMON
@@ -375,7 +375,7 @@
ld de, wMonOrItemNameBuffer
call CopyTradeName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
.loop
ld a, [hli]
cp "@"
--- a/engine/options_menu.asm
+++ b/engine/options_menu.asm
@@ -139,10 +139,10 @@
.Save:
ld b, a
- ld a, [Options]
+ ld a, [wOptions]
and $f0
or b
- ld [Options], a
+ ld [wOptions], a
.NonePressed:
ld b, 0
@@ -173,7 +173,7 @@
GetTextSpeed: ; e4346
; converts TEXT_DELAY_* value in a to OPT_TEXT_SPEED_* value in c,
; with previous/next TEXT_DELAY_* values in d/e
- ld a, [Options]
+ ld a, [wOptions]
and $7
cp TEXT_DELAY_SLOW
jr z, .slow
@@ -197,7 +197,7 @@
Options_BattleScene: ; e4365
- ld hl, Options
+ ld hl, wOptions
ld a, [hJoyPressed]
bit D_LEFT_F, a
jr nz, .LeftPressed
@@ -239,7 +239,7 @@
Options_BattleStyle: ; e43a0
- ld hl, Options
+ ld hl, wOptions
ld a, [hJoyPressed]
bit D_LEFT_F, a
jr nz, .LeftPressed
@@ -280,7 +280,7 @@
Options_Sound: ; e43dd
- ld hl, Options
+ ld hl, wOptions
ld a, [hJoyPressed]
bit D_LEFT_F, a
jr nz, .LeftPressed
@@ -363,7 +363,7 @@
.Save:
ld b, a
- ld [GBPrinter], a
+ ld [wGBPrinter], a
.NonePressed:
ld b, $0
@@ -398,7 +398,7 @@
GetPrinterSetting: ; e4491
; converts GBPRINTER_* value in a to OPT_PRINT_* value in c,
; with previous/next GBPRINTER_* values in d/e
- ld a, [GBPrinter]
+ ld a, [wGBPrinter]
and a
jr z, .IsLightest
cp GBPRINTER_LIGHTER
@@ -434,7 +434,7 @@
; e44c1
Options_MenuAccount: ; e44c1
- ld hl, Options2
+ ld hl, wOptions2
ld a, [hJoyPressed]
bit D_LEFT_F, a
jr nz, .LeftPressed
@@ -475,7 +475,7 @@
Options_Frame: ; e44fa
- ld hl, TextBoxFrame
+ ld hl, wTextBoxFrame
ld a, [hJoyPressed]
bit D_LEFT_F, a
jr nz, .LeftPressed
@@ -497,7 +497,7 @@
and $7
ld [hl], a
UpdateFrame: ; e4512
- ld a, [TextBoxFrame]
+ ld a, [wTextBoxFrame]
hlcoord 16, 15 ; where on the screen the number is drawn
add "1"
ld [hl], a
--- a/engine/overworld.asm
+++ b/engine/overworld.asm
@@ -9,9 +9,9 @@
_ReplaceKrisSprite:: ; 14135
call GetPlayerSprite
- ld a, [UsedSprites]
+ ld a, [wUsedSprites]
ld [hUsedSpriteIndex], a
- ld a, [UsedSprites + 1]
+ ld a, [wUsedSprites + 1]
ld [hUsedSpriteTile], a
call GetUsedSprite
ret
@@ -49,8 +49,8 @@
.Refresh: ; 1416f
xor a
- ld bc, UsedSpritesEnd - UsedSprites
- ld hl, UsedSprites
+ ld bc, wUsedSpritesEnd - wUsedSprites
+ ld hl, wUsedSprites
call ByteFill
call GetPlayerSprite
call AddMapSprites
@@ -70,7 +70,7 @@
ld hl, .Kris
.go
- ld a, [PlayerState]
+ ld a, [wPlayerState]
ld c, a
.loop
ld a, [hli]
@@ -82,7 +82,7 @@
; Any player state not in the array defaults to Chris's sprite.
xor a ; ld a, PLAYER_NORMAL
- ld [PlayerState], a
+ ld [wPlayerState], a
ld a, SPRITE_CHRIS
jr .finish
@@ -90,9 +90,9 @@
ld a, [hl]
.finish
- ld [UsedSprites + 0], a
- ld [PlayerSprite], a
- ld [PlayerObjectSprite], a
+ ld [wUsedSprites + 0], a
+ ld [wPlayerSprite], a
+ ld [wPlayerObjectSprite], a
ret
.Chris:
@@ -125,7 +125,7 @@
AddIndoorSprites: ; 141d9
- ld hl, Map1ObjectSprite
+ ld hl, wMap1ObjectSprite
ld a, 1
.loop
push af
@@ -142,7 +142,7 @@
AddOutdoorSprites: ; 141ee
- ld a, [MapGroup]
+ ld a, [wMapGroup]
dec a
ld c, a
ld b, 0
@@ -276,7 +276,7 @@
sub SPRITE_VARS
ld e, a
ld d, 0
- ld hl, VariableSprites
+ ld hl, wVariableSprites
add hl, de
ld a, [hl]
and a
@@ -355,7 +355,7 @@
push hl
push bc
ld b, a
- ld hl, UsedSprites + 2
+ ld hl, wUsedSprites + 2
ld c, SPRITE_GFX_LIST_CAPACITY - 1
.loop
ld a, [hl]
@@ -392,7 +392,7 @@
; Bug: b is not preserved, so it's useless as a next count.
; Uncomment the lines below to fix.
- ld hl, UsedSprites
+ ld hl, wUsedSprites
ld b, SPRITE_GFX_LIST_CAPACITY
.loop
ld a, [hli]
@@ -420,10 +420,10 @@
SortUsedSprites: ; 1431e
; Bubble-sort sprites by type.
-; Run backwards through UsedSprites to find the last one.
+; Run backwards through wUsedSprites to find the last one.
ld c, SPRITE_GFX_LIST_CAPACITY
- ld de, UsedSprites + (SPRITE_GFX_LIST_CAPACITY - 1) * 2
+ ld de, wUsedSprites + (SPRITE_GFX_LIST_CAPACITY - 1) * 2
.FindLastSprite:
ld a, [de]
and a
@@ -440,7 +440,7 @@
; higher than a later one, swap them.
inc de
- ld hl, UsedSprites + 1
+ ld hl, wUsedSprites + 1
.CheckSprite:
push bc
@@ -493,7 +493,7 @@
; Get the length of each sprite and space them out in VRAM.
; Crystal introduces a second table in VRAM bank 0.
- ld hl, UsedSprites
+ ld hl, wUsedSprites
ld c, SPRITE_GFX_LIST_CAPACITY
ld b, 0
.FirstTableLength:
@@ -573,7 +573,7 @@
GetUsedSprites: ; 1439b
- ld hl, UsedSprites
+ ld hl, wUsedSprites
ld c, SPRITE_GFX_LIST_CAPACITY
.loop
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -13,7 +13,7 @@
const PACKSTATE_QUITRUNSCRIPT ; 10
Pack: ; 10000
- ld hl, Options
+ ld hl, wOptions
set NO_TEXT_SCROLL, [hl]
call InitPackBuffers
.loop
@@ -28,7 +28,7 @@
.done
ld a, [wCurrPocket]
ld [wLastPocket], a
- ld hl, Options
+ ld hl, wOptions
res NO_TEXT_SCROLL, [hl]
ret
; 10026
@@ -207,13 +207,13 @@
ret c
farcall ChooseMonToLearnTMHM
jr c, .declined
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
res NO_TEXT_SCROLL, [hl]
farcall TeachTMHM
pop af
- ld [Options], a
+ ld [wOptions], a
.declined
xor a
ld [hBGMapMode], a
@@ -482,7 +482,7 @@
ret
.Party: ; 10338 (4:4338)
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
jr z, .NoPokemon
call DoItemEffect
@@ -524,8 +524,8 @@
call ExitMenu
pop af
jr c, .finish
- ld hl, NumItems
- ld a, [CurItemQuantity]
+ ld hl, wNumItems
+ ld a, [wCurItemQuantity]
call TossItem
call Pack_GetItemName
ld hl, Text_ThrewAway
@@ -573,13 +573,13 @@
rrca
and $c0
ld b, a
- ld a, [CurItemQuantity]
+ ld a, [wCurItemQuantity]
inc a
and $3f
or b
- ld [WhichRegisteredItem], a
- ld a, [CurItem]
- ld [RegisteredItem], a
+ ld [wWhichRegisteredItem], a
+ ld a, [wCurItem]
+ ld [wRegisteredItem], a
call Pack_GetItemName
ld de, SFX_FULL_HEAL
call WaitPlaySFX
@@ -594,15 +594,15 @@
; 103fd
GiveItem: ; 103fd
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
jp z, .NoPokemon
- ld a, [Options]
+ ld a, [wOptions]
push af
res NO_TEXT_SCROLL, a
- ld [Options], a
+ ld [wOptions], a
ld a, PARTYMENUACTION_GIVE_ITEM
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
call ClearBGPalettes
farcall LoadPartyMenuGFX
farcall InitPartyMenuWithCancel
@@ -615,7 +615,7 @@
call DelayFrame
farcall PartyMenuSelect
jr c, .finish
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr nz, .give
ld hl, .Egg
@@ -628,7 +628,7 @@
ld a, [wPackJumptableIndex]
push af
call GetCurNick
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wMonOrItemNameBuffer
ld bc, MON_NAME_LENGTH
call CopyBytes
@@ -639,7 +639,7 @@
ld [wJumptableIndex], a
.finish
pop af
- ld [Options], a
+ ld [wOptions], a
xor a
ld [hBGMapMode], a
call Pack_InitGFX
@@ -663,7 +663,7 @@
; 10493
BattlePack: ; 10493
- ld hl, Options
+ ld hl, wOptions
set NO_TEXT_SCROLL, [hl]
call InitPackBuffers
.loop
@@ -678,7 +678,7 @@
.end
ld a, [wCurrPocket]
ld [wLastPocket], a
- ld hl, Options
+ ld hl, wOptions
res NO_TEXT_SCROLL, [hl]
ret
; 104b9
@@ -1040,8 +1040,8 @@
call InitPocket
call WaitBGMap_DrawPackGFX
farcall TMHMPocket
- ld a, [CurItem]
- ld [CurItem], a
+ ld a, [wCurItem]
+ ld [wCurItem], a
ret
.BallsPocket: ; 1073b (4:473b)
@@ -1123,7 +1123,7 @@
TutorialPack: ; 107bb
call DepositSellInitPackBuffers
- ld a, [InputType]
+ ld a, [wInputType]
or a
jr z, .loop
farcall _DudeAutoInput_RightA
@@ -1148,7 +1148,7 @@
; entries correspond to *_POCKET constants
dw .Items
dw .Balls
- dw .KeyItems
+ dw .wKeyItems
dw .TMHM
.Items: ; 107e9 (4:47e9)
@@ -1174,7 +1174,7 @@
dba UpdateItemDescription
; 10807
-.KeyItems: ; 10807 (4:4807)
+.wKeyItems: ; 10807 (4:4807)
ld a, KEY_ITEM_POCKET
ld hl, .KeyItemsMenuDataHeader
jr .DisplayPocket
@@ -1202,8 +1202,8 @@
call InitPocket
call WaitBGMap_DrawPackGFX
farcall TMHMPocket
- ld a, [CurItem]
- ld [CurItem], a
+ ld a, [wCurItem]
+ ld [wCurItem], a
ret
.Balls: ; 1083b (4:483b)
@@ -1268,13 +1268,13 @@
ret
Pack_PrintTextNoScroll: ; 10889 (4:4889)
- ld a, [Options]
+ ld a, [wOptions]
push af
set NO_TEXT_SCROLL, a
- ld [Options], a
+ ld [wOptions], a
call PrintText
pop af
- ld [Options], a
+ ld [wOptions], a
ret
WaitBGMap_DrawPackGFX: ; 1089a (4:489a)
@@ -1284,7 +1284,7 @@
maskbits NUM_POCKETS
ld e, a
ld d, $0
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
jr z, .male_dude
ld a, [wPlayerGender]
@@ -1506,7 +1506,7 @@
; 10a1d
Pack_GetItemName: ; 10a1d
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [wNamedObjectIndexBuffer], a
call GetItemName
call CopyName1
@@ -1547,7 +1547,7 @@
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
- dbw 0, NumItems
+ dbw 0, wNumItems
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
@@ -1564,7 +1564,7 @@
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
- dbw 0, NumItems
+ dbw 0, wNumItems
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
@@ -1581,7 +1581,7 @@
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
db 1 ; horizontal spacing
- dbw 0, NumKeyItems
+ dbw 0, wNumKeyItems
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
@@ -1598,7 +1598,7 @@
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags
db 5, 8 ; rows, columns
db 1 ; horizontal spacing
- dbw 0, NumKeyItems
+ dbw 0, wNumKeyItems
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
@@ -1615,7 +1615,7 @@
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
- dbw 0, NumBalls
+ dbw 0, wNumBalls
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
@@ -1632,7 +1632,7 @@
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags
db 5, 8 ; rows, columns
db 2 ; horizontal spacing
- dbw 0, NumBalls
+ dbw 0, wNumBalls
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
--- a/engine/party_menu.asm
+++ b/engine/party_menu.asm
@@ -1,7 +1,7 @@
SelectMonFromParty: ; 50000
call DisableSpriteUpdates
xor a
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
call ClearBGPalettes
call InitPartyMenuLayout
call WaitBGMap
@@ -15,7 +15,7 @@
SelectTradeOrDayCareMon: ; 5001d
ld a, b
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
call DisableSpriteUpdates
call ClearBGPalettes
call InitPartyMenuLayout
@@ -47,7 +47,7 @@
WritePartyMenuTilemap: ; 0x5005f
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -69,7 +69,7 @@
jr .loop
.end
pop af
- ld [Options], a
+ ld [wOptions], a
ret
; 0x50089
@@ -88,7 +88,7 @@
PlacePartyNicknames: ; 5009b
hlcoord 3, 1
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
jr z, .end
ld c, a
@@ -97,7 +97,7 @@
push bc
push hl
push hl
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
ld a, b
call GetNick
pop hl
@@ -126,7 +126,7 @@
PlacePartyHPBar: ; 500cf
xor a
ld [wSGBPals], a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret z
ld c, a
@@ -169,7 +169,7 @@
PlacePartymonHPBar: ; 50117
ld a, b
ld bc, PARTYMON_STRUCT_LENGTH
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
call AddNTimes
ld a, [hli]
or [hl]
@@ -194,7 +194,7 @@
; 50138
PlacePartyMenuHPDigits: ; 50138
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret z
ld c, a
@@ -208,7 +208,7 @@
push hl
ld a, b
ld bc, PARTYMON_STRUCT_LENGTH
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
call AddNTimes
ld e, l
ld d, h
@@ -236,7 +236,7 @@
; 50176
PlacePartyMonLevel: ; 50176
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret z
ld c, a
@@ -250,7 +250,7 @@
push hl
ld a, b
ld bc, PARTYMON_STRUCT_LENGTH
- ld hl, PartyMon1Level
+ ld hl, wPartyMon1Level
call AddNTimes
ld e, l
ld d, h
@@ -279,7 +279,7 @@
; 501b2
PlacePartyMonStatus: ; 501b2
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret z
ld c, a
@@ -293,7 +293,7 @@
push hl
ld a, b
ld bc, PARTYMON_STRUCT_LENGTH
- ld hl, PartyMon1Status
+ ld hl, wPartyMon1Status
call AddNTimes
ld e, l
ld d, h
@@ -312,7 +312,7 @@
; 501e0
PlacePartyMonTMHMCompatibility: ; 501e0
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret z
ld c, a
@@ -324,12 +324,12 @@
call PartyMenuCheckEgg
jr z, .next
push hl
- ld hl, PartySpecies
+ ld hl, wPartySpecies
ld e, b
ld d, 0
add hl, de
ld a, [hl]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
predef CanLearnTMHMMove
pop hl
call .PlaceAbleNotAble
@@ -368,7 +368,7 @@
PlacePartyMonEvoStoneCompatibility: ; 5022f
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret z
ld c, a
@@ -382,7 +382,7 @@
push hl
ld a, b
ld bc, PARTYMON_STRUCT_LENGTH
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
call AddNTimes
ld a, [hl]
dec a
@@ -407,19 +407,19 @@
; 50268
.DetermineCompatibility: ; 50268
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld a, BANK(EvosAttacksPointers)
ld bc, 2
call FarCopyBytes
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld a, [hli]
ld h, [hl]
ld l, a
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld a, BANK(EvosAttacks)
ld bc, $a
call FarCopyBytes
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
.loop2
ld a, [hli]
and a
@@ -430,7 +430,7 @@
jr nz, .loop2
dec hl
dec hl
- ld a, [CurItem]
+ ld a, [wCurItem]
cp [hl]
inc hl
inc hl
@@ -452,7 +452,7 @@
PlacePartyMonGender: ; 502b1
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret z
ld c, a
@@ -463,12 +463,12 @@
push hl
call PartyMenuCheckEgg
jr z, .next
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
push hl
ld a, b
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
xor a
- ld [MonType], a
+ ld [wMonType], a
call GetGender
ld de, .unknown
jr c, .got_gender
@@ -505,7 +505,7 @@
PlacePartyMonMobileBattleSelection: ; 50307
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret z
ld c, a
@@ -588,10 +588,10 @@
PartyMenuCheckEgg: ; 50389
- ld a, LOW(PartySpecies)
+ ld a, LOW(wPartySpecies)
add b
ld e, a
- ld a, HIGH(PartySpecies)
+ ld a, HIGH(wPartySpecies)
adc 0
ld d, a
ld a, [de]
@@ -600,10 +600,10 @@
; 50396
GetPartyMenuQualityIndexes: ; 50396
- ld a, [PartyMenuActionText]
+ ld a, [wPartyMenuActionText]
and $f0
jr nz, .skip
- ld a, [PartyMenuActionText]
+ ld a, [wPartyMenuActionText]
and $f
ld e, a
ld d, 0
@@ -624,7 +624,7 @@
InitPartyMenuGFX: ; 503e0
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [hli]
and a
ret z
@@ -655,7 +655,7 @@
ld [wSwitchMon], a
ld de, PartyMenuAttributes
call SetMenuAttributes
- ld a, [PartyCount]
+ ld a, [wPartyCount]
inc a
ld [w2DMenuNumRows], a ; list length
dec a
@@ -681,7 +681,7 @@
; no cancel
ld de, PartyMenuAttributes
call SetMenuAttributes
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld [w2DMenuNumRows], a ; list length
ld b, a
ld a, [wPartyMenuCursor]
@@ -719,7 +719,7 @@
; sets carry if exitted menu.
call StaticMenuJoypad
call PlaceHollowCursor
- ld a, [PartyCount]
+ ld a, [wPartyCount]
inc a
ld b, a
ld a, [wMenuCursorY] ; menu selection?
@@ -732,13 +732,13 @@
jr nz, .exitmenu ; B button
ld a, [wMenuCursorY]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld c, a
ld b, $0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, bc
ld a, [hl]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld de, SFX_READ_TEXT_2
call PlaySFX
@@ -759,13 +759,13 @@
hlcoord 0, 14
lb bc, 2, 18
call TextBox
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
jr nz, .haspokemon
ld de, YouHaveNoPKMNString
jr .gotstring
.haspokemon ; 504ae
- ld a, [PartyMenuActionText]
+ ld a, [wPartyMenuActionText]
and $f ; drop high nibble
ld hl, PartyMenuStrings
ld e, a
@@ -776,14 +776,14 @@
ld d, [hl]
ld e, a
.gotstring ; 504be
- ld a, [Options]
+ ld a, [wOptions]
push af
set 4, a ; disable text delay
- ld [Options], a
+ ld [wOptions], a
hlcoord 1, 16 ; Coord
call PlaceString
pop af
- ld [Options], a
+ ld [wOptions], a
ret
; 0x504d2
@@ -828,10 +828,10 @@
db "You have no <PK><MN>!@"
PrintPartyMenuActionText: ; 50566
- ld a, [CurPartyMon]
- ld hl, PartyMonNicknames
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonNicknames
call GetNick
- ld a, [PartyMenuActionText]
+ ld a, [wPartyMenuActionText]
and $f
ld hl, .MenuActionTexts
call .PrintText
@@ -920,12 +920,12 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [Options]
+ ld a, [wOptions]
push af
set NO_TEXT_SCROLL, a
- ld [Options], a
+ ld [wOptions], a
call PrintText
pop af
- ld [Options], a
+ ld [wOptions], a
ret
; 505da
--- a/engine/phone/phone.asm
+++ b/engine/phone/phone.asm
@@ -68,7 +68,7 @@
GetRemainingSpaceInPhoneList: ; 90040
xor a
- ld [Buffer1], a
+ ld [wBuffer1], a
ld hl, PermanentNumbers
.loop
ld a, [hli]
@@ -82,7 +82,7 @@
ld c, a
call _CheckCellNum
jr c, .permanent
- ld hl, Buffer1
+ ld hl, wBuffer1
inc [hl]
.permanent
pop hl
@@ -93,7 +93,7 @@
.done
ld a, CONTACT_LIST_SIZE
- ld hl, Buffer1
+ ld hl, wBuffer1
sub [hl]
ret
; 90066
@@ -173,7 +173,7 @@
ChooseRandomCaller: ; 900bf (24:40bf)
; If no one is available to call, don't return anything.
- ld a, [EngineBuffer3]
+ ld a, [wEngineBuffer3]
and a
jr z, .NothingToSample
@@ -188,7 +188,7 @@
; Return the caller ID you just sampled.
ld c, a
ld b, 0
- ld hl, EngineBuffer4
+ ld hl, wEngineBuffer4
add hl, bc
ld a, [hl]
scf
@@ -201,8 +201,8 @@
GetAvailableCallers: ; 900de (24:40de)
farcall CheckTime
ld a, c
- ld [EngineBuffer1], a
- ld hl, EngineBuffer3
+ ld [wEngineBuffer1], a
+ ld hl, wEngineBuffer3
ld bc, 11
xor a
call ByteFill
@@ -210,7 +210,7 @@
ld a, CONTACT_LIST_SIZE
.loop
- ld [EngineBuffer2], a
+ ld [wEngineBuffer2], a
ld a, [de]
and a
jr z, .not_good_for_call
@@ -217,31 +217,31 @@
ld hl, PhoneContacts + PHONE_CONTACT_SCRIPT2_TIME
ld bc, PHONE_TABLE_WIDTH
call AddNTimes
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
and [hl]
jr z, .not_good_for_call
ld bc, PHONE_CONTACT_MAP_GROUP - PHONE_CONTACT_SCRIPT2_TIME
add hl, bc
- ld a, [MapGroup]
+ ld a, [wMapGroup]
cp [hl]
jr nz, .different_map
inc hl
- ld a, [MapNumber]
+ ld a, [wMapNumber]
cp [hl]
jr z, .not_good_for_call
.different_map
- ld a, [EngineBuffer3]
+ ld a, [wEngineBuffer3]
ld c, a
ld b, $0
inc a
- ld [EngineBuffer3], a
- ld hl, EngineBuffer4
+ ld [wEngineBuffer3], a
+ ld hl, wEngineBuffer4
add hl, bc
ld a, [de]
ld [hl], a
.not_good_for_call
inc de
- ld a, [EngineBuffer2]
+ ld a, [wEngineBuffer2]
dec a
jr nz, .loop
ret
@@ -348,12 +348,12 @@
; use the "Just talk to that person" script.
ld hl, PHONE_CONTACT_MAP_GROUP
add hl, de
- ld a, [MapGroup]
+ ld a, [wMapGroup]
cp [hl]
jr nz, .GetPhoneScript
ld hl, PHONE_CONTACT_MAP_NUMBER
add hl, de
- ld a, [MapNumber]
+ ld a, [wMapNumber]
cp [hl]
jr nz, .GetPhoneScript
ld b, BANK(PhoneScript_JustTalkToThem)
@@ -379,11 +379,11 @@
.DoPhoneCall:
ld a, b
- ld [PhoneScriptBank], a
+ ld [wPhoneScriptBank], a
ld a, l
- ld [PhoneCaller], a
+ ld [wPhoneCaller], a
ld a, h
- ld [PhoneCaller + 1], a
+ ld [wPhoneCaller + 1], a
ld b, BANK(UnknownScript_0x90205)
ld de, UnknownScript_0x90205
call ExecuteCallbackScript
@@ -418,7 +418,7 @@
call AddNTimes
ld a, BANK(PhoneContacts)
.proceed
- ld de, EngineBuffer2
+ ld de, wEngineBuffer2
ld bc, 12
call FarCopyBytes
ret
@@ -491,11 +491,11 @@
PhoneCall:: ; 9029a
ld a, b
- ld [PhoneScriptBank], a
+ ld [wPhoneScriptBank], a
ld a, e
- ld [PhoneCaller], a
+ ld [wPhoneCaller], a
ld a, d
- ld [PhoneCaller + 1], a
+ ld [wPhoneCaller + 1], a
call Phone_FirstOfTwoRings
call Phone_FirstOfTwoRings
farcall StubbedTrainerRankings_PhoneCalls
@@ -519,11 +519,11 @@
ld [hl], "☎"
inc hl
inc hl
- ld a, [PhoneScriptBank]
+ ld a, [wPhoneScriptBank]
ld b, a
- ld a, [PhoneCaller]
+ ld a, [wPhoneCaller]
ld e, a
- ld a, [PhoneCaller + 1]
+ ld a, [wPhoneCaller + 1]
ld d, a
call FarPlaceString
ret
--- a/engine/pic_animation.asm
+++ b/engine/pic_animation.asm
@@ -267,7 +267,7 @@
PokeAnim_StereoCry: ; d0196
ld a, $f
- ld [CryTracks], a
+ ld [wCryTracks], a
ld a, [wPokeAnimSpecies]
call PlayStereoCry2
ld a, [wPokeAnimSceneIndex]
@@ -291,7 +291,7 @@
; d01c6
AnimateMon_CheckIfPokemon: ; d01c6
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .fail
call IsAPokemon
@@ -326,7 +326,7 @@
ld [wPokeAnimPointer], a
ld a, b
ld [wPokeAnimPointer + 1], a
-; hl contains TileMap coords
+; hl contains tilemap coords
ld a, l
ld [wPokeAnimCoord], a
ld a, h
@@ -335,13 +335,13 @@
ld a, d
ld [wPokeAnimGraphicStartTile], a
- ld a, BANK(CurPartySpecies)
- ld hl, CurPartySpecies
+ ld a, BANK(wCurPartySpecies)
+ ld hl, wCurPartySpecies
call GetFarWRAMByte
ld [wPokeAnimSpecies], a
- ld a, BANK(UnownLetter)
- ld hl, UnownLetter
+ ld a, BANK(wUnownLetter)
+ ld hl, wUnownLetter
call GetFarWRAMByte
ld [wPokeAnimUnownLetter], a
@@ -938,7 +938,7 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld de, AttrMap - TileMap
+ ld de, wAttrMap - wTileMap
add hl, de
ret
; d055c
@@ -1001,12 +1001,12 @@
PokeAnim_GetFrontpicDims: ; d05b4
ld a, [rSVBK]
push af
- ld a, BANK(CurPartySpecies)
+ ld a, BANK(wCurPartySpecies)
ld [rSVBK], a
- ld a, [CurPartySpecies]
- ld [CurSpecies], a
+ ld a, [wCurPartySpecies]
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [BasePicSize]
+ ld a, [wBasePicSize]
and $f
ld c, a
pop af
@@ -1136,6 +1136,6 @@
xor a
ld [wBoxAlignment], a
inc a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ret
; d0695
--- a/engine/player_gfx.asm
+++ b/engine/player_gfx.asm
@@ -7,7 +7,7 @@
.okay
ld a, c
- ld [TrainerClass], a
+ ld [wTrainerClass], a
ret
MovePlayerPicRight: ; 88258
@@ -73,7 +73,7 @@
INCLUDE "data/player_names.asm"
GetPlayerNameArray: ; 88318 This Function is never called
- ld hl, PlayerName
+ ld hl, wPlayerName
ld de, MalePlayerNameArray
ld a, [wPlayerGender]
bit 0, a
@@ -156,7 +156,7 @@
.GotClass:
ld a, e
- ld [TrainerClass], a
+ ld [wTrainerClass], a
ld de, ChrisPic
ld a, [wPlayerGender]
bit 0, a
@@ -184,7 +184,7 @@
ld e, KRIS
.GotClass:
ld a, e
- ld [TrainerClass], a
+ ld [wTrainerClass], a
; Load pic
ld de, ChrisPic
--- a/engine/player_movement.asm
+++ b/engine/player_movement.asm
@@ -2,12 +2,12 @@
call .GetDPad
ld a, movement_step_sleep
- ld [MovementAnimation], a
+ ld [wMovementAnimation], a
xor a
ld [wd041], a
call .TranslateIntoMovement
ld c, a
- ld a, [MovementAnimation]
+ ld a, [wMovementAnimation]
ld [wPlayerNextMovement], a
ret
@@ -14,7 +14,7 @@
.GetDPad:
ld a, [hJoyDown]
- ld [CurInput], a
+ ld [wCurInput], a
; Standing downhill instead moves down.
@@ -28,12 +28,12 @@
ld a, c
or D_DOWN
- ld [CurInput], a
+ ld [wCurInput], a
ret
; 8002d
.TranslateIntoMovement:
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_NORMAL
jr z, .Normal
cp PLAYER_SURF
@@ -84,7 +84,7 @@
ret c
call .CheckWarp
ret c
- ld a, [WalkingDirection]
+ ld a, [wWalkingDirection]
cp STANDING
jr z, .HitWall
call .BumpSound
@@ -94,12 +94,12 @@
ret
.NotMoving:
- ld a, [WalkingDirection]
+ ld a, [wWalkingDirection]
cp STANDING
jr z, .Standing
; Walking into an edge warp won't bump.
- ld a, [EngineBuffer4]
+ ld a, [wEngineBuffer4]
and a
jr nz, .CantMove
call .BumpSound
@@ -118,7 +118,7 @@
; Tiles such as waterfalls and warps move the player
; in a given direction, overriding input.
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
ld c, a
call CheckWhirlpoolTile
jr c, .not_whirlpool
@@ -146,7 +146,7 @@
ld hl, .water_table
add hl, bc
ld a, [hl]
- ld [WalkingDirection], a
+ ld [wWalkingDirection], a
jr .continue_walk
.water_table
@@ -165,7 +165,7 @@
ld a, [hl]
cp STANDING
jr z, .no_walk
- ld [WalkingDirection], a
+ ld [wWalkingDirection], a
jr .continue_walk
.land1_table
@@ -188,7 +188,7 @@
ld a, [hl]
cp STANDING
jr z, .no_walk
- ld [WalkingDirection], a
+ ld [wWalkingDirection], a
jr .continue_walk
.land2_table
@@ -214,7 +214,7 @@
.down
ld a, DOWN
- ld [WalkingDirection], a
+ ld [wWalkingDirection], a
jr .continue_walk
.no_walk
@@ -236,12 +236,12 @@
ld a, [wPlayerTurningDirection]
cp 0
jr nz, .not_turning
- ld a, [WalkingDirection]
+ ld a, [wWalkingDirection]
cp STANDING
jr z, .not_turning
ld e, a
- ld a, [PlayerDirection]
+ ld a, [wPlayerDirection]
rrca
rrca
maskbits NUM_DIRECTIONS
@@ -262,7 +262,7 @@
.TryStep: ; 8016b
; Surfing actually calls .TrySurf directly instead of passing through here.
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_SURF
jr z, .TrySurf
cp PLAYER_SURF_PIKA
@@ -277,7 +277,7 @@
cp 2
jr z, .bump
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
call CheckIceTile
jr nc, .ice
@@ -289,7 +289,7 @@
bit 2, [hl] ; downhill
jr z, .fast
- ld a, [WalkingDirection]
+ ld a, [wWalkingDirection]
cp DOWN
jr z, .fast
@@ -362,7 +362,7 @@
; 801f3
.TryJump: ; 801f3
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
ld e, a
and $f0
cp HI_NYBBLE_LEDGES
@@ -374,7 +374,7 @@
ld d, 0
ld hl, .data_8021e
add hl, de
- ld a, [FacingDirection]
+ ld a, [wFacingDirection]
and [hl]
jr z, .DontJump
@@ -408,7 +408,7 @@
; This causes wd041 to be nonzero when standing on tile $3e,
; making bumps silent.
- ld a, [WalkingDirection]
+ ld a, [wWalkingDirection]
; cp STANDING
; jr z, .not_warp
ld e, a
@@ -415,19 +415,19 @@
ld d, 0
ld hl, .EdgeWarps
add hl, de
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
cp [hl]
jr nz, .not_warp
ld a, 1
ld [wd041], a
- ld a, [WalkingDirection]
+ ld a, [wWalkingDirection]
; This is in the wrong place.
cp STANDING
jr z, .not_warp
ld e, a
- ld a, [PlayerDirection]
+ ld a, [wPlayerDirection]
rrca
rrca
maskbits NUM_DIRECTIONS
@@ -462,7 +462,7 @@
ld h, [hl]
ld l, a
- ld a, [WalkingDirection]
+ ld a, [wWalkingDirection]
ld e, a
cp STANDING
jp z, .StandInPlace
@@ -469,7 +469,7 @@
add hl, de
ld a, [hl]
- ld [MovementAnimation], a
+ ld [wMovementAnimation], a
ld hl, .FinishFacing
add hl, de
@@ -535,7 +535,7 @@
ld a, 0
ld [wPlayerTurningDirection], a
ld a, movement_step_sleep
- ld [MovementAnimation], a
+ ld [wMovementAnimation], a
xor a
ret
; 802bf
@@ -544,7 +544,7 @@
ld a, 0
ld [wPlayerTurningDirection], a
ld a, movement_step_bump
- ld [MovementAnimation], a
+ ld [wMovementAnimation], a
xor a
ret
; 802cb
@@ -564,10 +564,10 @@
ld d, 0
ld hl, .forced_dpad
add hl, de
- ld a, [CurInput]
+ ld a, [wCurInput]
and BUTTONS
or [hl]
- ld [CurInput], a
+ ld [wCurInput], a
ret
.forced_dpad
@@ -579,7 +579,7 @@
ld hl, .table
ld de, .table2 - .table1
- ld a, [CurInput]
+ ld a, [wCurInput]
bit D_DOWN_F, a
jr nz, .d_down
bit D_UP_F, a
@@ -598,18 +598,18 @@
.update
ld a, [hli]
- ld [WalkingDirection], a
+ ld [wWalkingDirection], a
ld a, [hli]
- ld [FacingDirection], a
+ ld [wFacingDirection], a
ld a, [hli]
- ld [WalkingX], a
+ ld [wWalkingX], a
ld a, [hli]
- ld [WalkingY], a
+ ld [wWalkingY], a
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [hl]
- ld [WalkingTile], a
+ ld [wWalkingTile], a
ret
.table
@@ -621,16 +621,16 @@
; tile collision pointer
.table1
db STANDING, FACE_CURRENT, 0, 0
- dw PlayerStandingTile
+ dw wPlayerStandingTile
.table2
db RIGHT, FACE_RIGHT, 1, 0
- dw TileRight
+ dw wTileRight
db LEFT, FACE_LEFT, -1, 0
- dw TileLeft
+ dw wTileLeft
db UP, FACE_UP, 0, -1
- dw TileUp
+ dw wTileUp
db DOWN, FACE_DOWN, 0, 1
- dw TileDown
+ dw wTileDown
; 80341
.CheckNPC: ; 80341
@@ -640,19 +640,19 @@
ld a, 0
ld [hMapObjectIndexBuffer], a
; Load the next X coordinate into d
- ld a, [PlayerStandingMapX]
+ ld a, [wPlayerStandingMapX]
ld d, a
- ld a, [WalkingX]
+ ld a, [wWalkingX]
add d
ld d, a
; Load the next Y coordinate into e
- ld a, [PlayerStandingMapY]
+ ld a, [wPlayerStandingMapY]
ld e, a
- ld a, [WalkingY]
+ ld a, [wWalkingY]
add e
ld e, a
; Find an object struct with coordinates equal to d,e
- ld bc, ObjectStructs ; redundant
+ ld bc, wObjectStructs ; redundant
farcall IsNPCAtCoord
jr nc, .is_npc
call .CheckStrengthBoulder
@@ -691,7 +691,7 @@
add hl, bc
set 2, [hl]
- ld a, [WalkingDirection]
+ ld a, [wWalkingDirection]
ld d, a
ld hl, OBJECT_RANGE
add hl, bc
@@ -712,13 +712,13 @@
; Return 0 if walking onto land and tile permissions allow it.
; Otherwise, return carry.
- ld a, [TilePermissions]
+ ld a, [wTilePermissions]
ld d, a
- ld a, [FacingDirection]
+ ld a, [wFacingDirection]
and d
jr nz, .NotWalkable
- ld a, [WalkingTile]
+ ld a, [wWalkingTile]
call .CheckWalkable
jr c, .NotWalkable
@@ -734,13 +734,13 @@
; Return 0 if moving in water, or 1 if moving onto land.
; Otherwise, return carry.
- ld a, [TilePermissions]
+ ld a, [wTilePermissions]
ld d, a
- ld a, [FacingDirection]
+ ld a, [wFacingDirection]
and d
jr nz, .NotSurfable
- ld a, [WalkingTile]
+ ld a, [wWalkingTile]
call .CheckSurfable
jr c, .NotSurfable
@@ -753,7 +753,7 @@
; 803ca
.BikeCheck: ; 803ca
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_BIKE
ret z
cp PLAYER_SKATE
@@ -810,7 +810,7 @@
.GetOutOfWater: ; 803f9
push bc
ld a, PLAYER_NORMAL
- ld [PlayerState], a
+ ld [wPlayerState], a
call ReplaceKrisSprite ; UpdateSprites
pop bc
ret
@@ -822,10 +822,10 @@
jr z, .not_ice
cp $f0
jr z, .not_ice
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
call CheckIceTile
jr nc, .yep
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_SKATE
jr nz, .not_ice
--- a/engine/player_object.asm
+++ b/engine/player_object.asm
@@ -5,11 +5,11 @@
call ClearBGPalettes
call ClearSprites
hlcoord 0, 0
- ld bc, TileMapEnd - TileMap
+ ld bc, wTileMapEnd - wTileMap
ld a, " "
call ByteFill
- hlcoord 0, 0, AttrMap
- ld bc, AttrMapEnd - AttrMap
+ hlcoord 0, 0, wAttrMap
+ ld bc, wAttrMapEnd - wAttrMap
ld a, $7
call ByteFill
call WaitBGMap2
@@ -42,10 +42,10 @@
ld [hl], e
ld a, $0
ld [hMapObjectIndexBuffer], a
- ld bc, MapObjects
+ ld bc, wMapObjects
ld a, $0
ld [hObjectStructIndexBuffer], a
- ld de, ObjectStructs
+ ld de, wObjectStructs
call CopyMapObjectToObjectStruct
ld a, PLAYER
ld [wCenteredObject], a
@@ -72,10 +72,10 @@
PlayerSpawn_ConvertCoords: ; 808f
push bc
- ld a, [XCoord]
+ ld a, [wXCoord]
add 4
ld d, a
- ld a, [YCoord]
+ ld a, [wYCoord]
add 4
ld e, a
pop bc
@@ -100,26 +100,26 @@
ret
RefreshPlayerCoords: ; 80b8
- ld a, [XCoord]
+ ld a, [wXCoord]
add 4
ld d, a
- ld hl, PlayerStandingMapX
+ ld hl, wPlayerStandingMapX
sub [hl]
ld [hl], d
- ld hl, MapObjects + MAPOBJECT_X_COORD
+ ld hl, wMapObjects + MAPOBJECT_X_COORD
ld [hl], d
- ld hl, PlayerLastMapX
+ ld hl, wPlayerLastMapX
ld [hl], d
ld d, a
- ld a, [YCoord]
+ ld a, [wYCoord]
add 4
ld e, a
- ld hl, PlayerStandingMapY
+ ld hl, wPlayerStandingMapY
sub [hl]
ld [hl], e
- ld hl, MapObjects + MAPOBJECT_Y_COORD
+ ld hl, wMapObjects + MAPOBJECT_Y_COORD
ld [hl], e
- ld hl, PlayerLastMapY
+ ld hl, wPlayerLastMapY
ld [hl], e
ld e, a
ld a, [wObjectFollow_Leader]
@@ -132,7 +132,7 @@
and a
ret nz ; masked
- ld hl, ObjectStructs + OBJECT_STRUCT_LENGTH * 1
+ ld hl, wObjectStructs + OBJECT_STRUCT_LENGTH * 1
ld a, 1
ld de, OBJECT_STRUCT_LENGTH
.loop
@@ -152,7 +152,7 @@
ld d, h
ld e, l
call CopyMapObjectToObjectStruct
- ld hl, VramState
+ ld hl, wVramState
bit 7, [hl]
ret z
@@ -224,7 +224,7 @@
ret
InitializeVisibleSprites: ; 8177
- ld bc, MapObjects + OBJECT_LENGTH
+ ld bc, wMapObjects + OBJECT_LENGTH
ld a, 1
.loop
ld [hMapObjectIndexBuffer], a
@@ -240,9 +240,9 @@
cp -1
jr nz, .next
- ld a, [XCoord]
+ ld a, [wXCoord]
ld d, a
- ld a, [YCoord]
+ ld a, [wYCoord]
ld e, a
ld hl, MAPOBJECT_X_COORD
@@ -300,18 +300,18 @@
dw .Right
.Up: ; 81de
- ld a, [YCoord]
+ ld a, [wYCoord]
sub 1
jr .Vertical
.Down: ; 81e5
- ld a, [YCoord]
+ ld a, [wYCoord]
add 9
.Vertical: ; 81ea
ld d, a
- ld a, [XCoord]
+ ld a, [wXCoord]
ld e, a
- ld bc, MapObjects + OBJECT_LENGTH
+ ld bc, wMapObjects + OBJECT_LENGTH
ld a, 1
.loop_v
ld [hMapObjectIndexBuffer], a
@@ -356,18 +356,18 @@
ret
.Left: ; 8232
- ld a, [XCoord]
+ ld a, [wXCoord]
sub 1
jr .Horizontal
.Right: ; 8239
- ld a, [XCoord]
+ ld a, [wXCoord]
add 10
.Horizontal: ; 823e
ld e, a
- ld a, [YCoord]
+ ld a, [wYCoord]
ld d, a
- ld bc, MapObjects + OBJECT_LENGTH
+ ld bc, wMapObjects + OBJECT_LENGTH
ld a, 1
.loop_h
ld [hMapObjectIndexBuffer], a
@@ -470,7 +470,7 @@
add hl, de
ld [hl], a
- ld hl, YCoord
+ ld hl, wYCoord
sub [hl]
and $f
swap a
@@ -488,7 +488,7 @@
ld hl, OBJECT_NEXT_MAP_X
add hl, de
ld [hl], a
- ld hl, XCoord
+ ld hl, wXCoord
sub [hl]
and $f
swap a
@@ -586,7 +586,7 @@
ret
.GetMovementData: ; 8388
- ld a, [PlayerDirection]
+ ld a, [wPlayerDirection]
srl a
srl a
maskbits NUM_DIRECTIONS
@@ -656,7 +656,7 @@
add hl, de
ld [hl], b
ld a, b
- ld hl, XCoord
+ ld hl, wXCoord
sub [hl]
and $f
swap a
@@ -669,7 +669,7 @@
add hl, de
ld [hl], c
ld a, c
- ld hl, YCoord
+ ld hl, wYCoord
sub [hl]
and $f
swap a
--- a/engine/player_step.asm
+++ b/engine/player_step.asm
@@ -86,7 +86,7 @@
ld a, [wPlayerStepDirection]
and a
jr nz, .check_step_down
- ld hl, YCoord
+ ld hl, wYCoord
inc [hl]
ret
@@ -93,7 +93,7 @@
.check_step_down
cp UP
jr nz, .check_step_left
- ld hl, YCoord
+ ld hl, wYCoord
dec [hl]
ret
@@ -100,7 +100,7 @@
.check_step_left
cp LEFT
jr nz, .check_step_right
- ld hl, XCoord
+ ld hl, wXCoord
dec [hl]
ret
@@ -107,7 +107,7 @@
.check_step_right
cp RIGHT
ret nz
- ld hl, XCoord
+ ld hl, wXCoord
inc [hl]
ret
@@ -170,7 +170,7 @@
.Add6ToOverworldMapAnchor: ; d595 (3:5595)
ld hl, wOverworldMapAnchor
- ld a, [MapWidth]
+ ld a, [wMapWidth]
add 6
add [hl]
ld [hli], a
@@ -201,7 +201,7 @@
.Sub6FromOverworldMapAnchor: ; d5c6 (3:55c6)
ld hl, wOverworldMapAnchor
- ld a, [MapWidth]
+ ld a, [wMapWidth]
add 6
ld b, a
ld a, [hl]
--- a/engine/pokedex/newpokedexentry.asm
+++ b/engine/pokedex/newpokedexentry.asm
@@ -42,9 +42,9 @@
call WaitBGMap2
farcall GetEnemyMonDVs
ld a, [hli]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [hl]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
call SetPalettes
--- a/engine/pokedex/pokedex.asm
+++ b/engine/pokedex/pokedex.asm
@@ -27,14 +27,14 @@
push hl
ld a, [hSCX]
push af
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
- ld a, [VramState]
+ ld a, [wVramState]
push af
xor a
- ld [VramState], a
+ ld [wVramState], a
ld a, [hInMenu]
push af
ld a, $1
@@ -65,9 +65,9 @@
pop af
ld [hInMenu], a
pop af
- ld [VramState], a
+ ld [wVramState], a
pop af
- ld [Options], a
+ ld [wOptions], a
pop af
ld [hSCX], a
pop hl
@@ -163,9 +163,9 @@
ret
Pokedex_GetLandmark: ; 400ed
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
@@ -172,9 +172,9 @@
cp SPECIAL_MAP
jr nz, .load
- ld a, [BackupMapGroup]
+ ld a, [wBackupMapGroup]
ld b, a
- ld a, [BackupMapNumber]
+ ld a, [wBackupMapNumber]
ld c, a
call GetWorldMapLocation
@@ -220,7 +220,7 @@
ld [hBGMapMode], a
call ClearSprites
xor a
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
call ByteFill
farcall DrawPokedexListWindow
@@ -249,7 +249,7 @@
call Pokedex_ResetBGMapMode
ld a, -1
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_POKEDEX
call Pokedex_GetSGBLayout
call Pokedex_UpdateCursorOAM
@@ -342,10 +342,10 @@
ld a, $a7
ld [hWX], a
call Pokedex_GetSelectedMon
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_POKEDEX
call Pokedex_GetSGBLayout
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call PlayMonCry
call Pokedex_IncrementDexPointer
ret
@@ -372,11 +372,11 @@
jp hl
.return_to_prev_screen
- ld a, [LastVolume]
+ ld a, [wLastVolume]
and a
jr z, .max_volume
ld a, $77
- ld [LastVolume], a
+ ld [wLastVolume], a
.max_volume
call MaxVolume
@@ -411,10 +411,10 @@
call Pokedex_LoadSelectedMonTiles
call WaitBGMap
call Pokedex_GetSelectedMon
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_POKEDEX
call Pokedex_GetSGBLayout
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call PlayMonCry
ld hl, wJumptableIndex
dec [hl]
@@ -460,7 +460,7 @@
call Pokedex_LoadSelectedMonTiles
call WaitBGMap
call Pokedex_GetSelectedMon
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_POKEDEX
call Pokedex_GetSGBLayout
ret
@@ -720,7 +720,7 @@
xor a
ld [hBGMapMode], a
xor a
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
call Pokedex_SetBGMapMode4
@@ -745,7 +745,7 @@
call Pokedex_PlaceSearchResultsTypeStrings
call Pokedex_UpdateSearchResultsCursorOAM
ld a, -1
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, SCGB_POKEDEX
call Pokedex_GetSGBLayout
call Pokedex_IncrementDexPointer
@@ -1088,8 +1088,8 @@
hlcoord 1, 11
ld de, String_SEEN
call Pokedex_PlaceString
- ld hl, PokedexSeen
- ld b, EndPokedexSeen - PokedexSeen
+ ld hl, wPokedexSeen
+ ld b, wEndPokedexSeen - wPokedexSeen
call CountSetBits
ld de, wd265
hlcoord 5, 12
@@ -1098,8 +1098,8 @@
hlcoord 1, 14
ld de, String_OWN
call Pokedex_PlaceString
- ld hl, PokedexCaught
- ld b, EndPokedexCaught - PokedexCaught
+ ld hl, wPokedexCaught
+ ld b, wEndPokedexCaught - wPokedexCaught
call CountSetBits
ld de, wd265
hlcoord 5, 15
@@ -1322,7 +1322,7 @@
ld b, 0
ld c, 26
.loop
- ld hl, UnownDex
+ ld hl, wUnownDex
add hl, de
ld a, [hl]
and a
@@ -1911,7 +1911,7 @@
and a
jr z, .next_mon
ld [wd265], a
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call Pokedex_CheckCaught
jr z, .next_mon
push hl
@@ -1921,10 +1921,10 @@
pop hl
ld a, [wDexConvertedMonType]
ld b, a
- ld a, [BaseType1]
+ ld a, [wBaseType1]
cp b
jr z, .match_found
- ld a, [BaseType2]
+ ld a, [wBaseType2]
cp b
jr nz, .next_mon
@@ -2117,7 +2117,7 @@
db -1
Pokedex_LoadCursorOAM: ; 412f1 (10:52f1)
- ld de, Sprite01
+ ld de, wVirtualOAMSprite00
.loop
ld a, [hl]
cp -1
@@ -2366,9 +2366,9 @@
call Pokedex_CheckSeen
jr z, .QuestionMark
ld a, [wFirstUnownSeen]
- ld [UnownLetter], a
+ ld [wUnownLetter], a
ld a, [wd265]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
call GetBaseData
ld de, vTiles2
predef GetMonFrontpic
@@ -2511,22 +2511,22 @@
ret
Pokedex_LoadUnownFrontpicTiles: ; 41a58 (10:5a58)
- ld a, [UnownLetter]
+ ld a, [wUnownLetter]
push af
ld a, [wDexCurrentUnownIndex]
ld e, a
ld d, 0
- ld hl, UnownDex
+ ld hl, wUnownDex
add hl, de
ld a, [hl]
- ld [UnownLetter], a
+ ld [wUnownLetter], a
ld a, UNOWN
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
call GetBaseData
ld de, vTiles2 tile $00
predef GetMonFrontpic
pop af
- ld [UnownLetter], a
+ ld [wUnownLetter], a
ret
_NewPokedexEntry: ; 41a7f
@@ -2540,7 +2540,7 @@
call Pokedex_LoadGFX
call Pokedex_LoadAnyFootprint
ld a, [wd265]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
call Pokedex_DrawDexEntryScreenBG
call Pokedex_DrawFootprint
hlcoord 0, 17
@@ -2557,7 +2557,7 @@
predef GetMonFrontpic
ld a, SCGB_POKEDEX
call Pokedex_GetSGBLayout
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call PlayMonCry
ret
--- a/engine/pokedex/pokedex_2.asm
+++ b/engine/pokedex/pokedex_2.asm
@@ -41,7 +41,7 @@
DoDexSearchSlowpokeFrame: ; 44207
ld a, [wDexSearchSlowpokeFrame]
ld hl, .SlowpokeSpriteData
- ld de, Sprite01
+ ld de, wVirtualOAMSprite00
.loop
ld a, [hli]
cp -1
@@ -107,8 +107,8 @@
pop bc
ret z
; Get the height of the Pokemon.
- ld a, [CurPartySpecies]
- ld [CurSpecies], a
+ ld a, [wCurPartySpecies]
+ ld [wCurSpecies], a
inc hl
ld a, b
push af
--- a/engine/pokedex/pokedex_3.asm
+++ b/engine/pokedex/pokedex_3.asm
@@ -140,7 +140,7 @@
ld [hl], $3c
xor a
ld b, SCREEN_HEIGHT
- hlcoord 19, 0, AttrMap
+ hlcoord 19, 0, wAttrMap
call Bank77_FillColumn
call WaitBGMap2
pop hl
--- a/engine/pokedex/unown_dex.asm
+++ b/engine/pokedex/unown_dex.asm
@@ -1,8 +1,8 @@
UpdateUnownDex: ; fba18
- ld a, [UnownLetter]
+ ld a, [wUnownLetter]
ld c, a
ld b, NUM_UNOWN
- ld hl, UnownDex
+ ld hl, wUnownDex
.loop
ld a, [hli]
and a
@@ -27,7 +27,7 @@
ld a, [wDexCurrentUnownIndex]
ld e, a
ld d, 0
- ld hl, UnownDex
+ ld hl, wUnownDex
add hl, de
ld a, [hl]
ld e, a
--- a/engine/pokegear.asm
+++ b/engine/pokegear.asm
@@ -23,7 +23,7 @@
const POKEGEARSTATE_RADIOJOYPAD ; c
PokeGear: ; 90b8d (24:4b8d)
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -31,10 +31,10 @@
push af
ld a, $1
ld [hInMenu], a
- ld a, [VramState]
+ ld a, [wVramState]
push af
xor a
- ld [VramState], a
+ ld [wVramState], a
call .InitTilemap
call DelayFrame
.loop
@@ -53,11 +53,11 @@
call PlaySFX
call WaitSFX
pop af
- ld [VramState], a
+ ld [wVramState], a
pop af
ld [hInMenu], a
pop af
- ld [Options], a
+ ld [wOptions], a
call ClearBGPalettes
xor a ; LOW(vBGMap0)
ld [hBGMapAddress], a
@@ -123,9 +123,9 @@
ld de, vTiles0
ld a, BANK(PokegearSpritesGFX)
call Decompress
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
cp FAST_SHIP
@@ -194,16 +194,16 @@
; 90d56
TownMap_GetCurrentLandmark: ; 90d56
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
cp SPECIAL_MAP
ret nz
- ld a, [BackupMapGroup]
+ ld a, [wBackupMapGroup]
ld b, a
- ld a, [BackupMapNumber]
+ ld a, [wBackupMapNumber]
ld c, a
call GetWorldMapLocation
ret
@@ -211,9 +211,9 @@
; 90d70
TownMap_InitCursorAndPlayerIconPositions: ; 90d70 (24:4d70)
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
cp FAST_SHIP
@@ -220,9 +220,9 @@
jr z, .FastShip
cp SPECIAL_MAP
jr nz, .LoadLandmark
- ld a, [BackupMapGroup]
+ ld a, [wBackupMapGroup]
ld b, a
- ld a, [BackupMapNumber]
+ ld a, [wBackupMapNumber]
ld c, a
call GetWorldMapLocation
.LoadLandmark:
@@ -247,7 +247,7 @@
xor a
ld [hBGMapMode], a
hlcoord 0, 0
- ld bc, TileMapEnd - TileMap
+ ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, $4f
call ByteFill
ld a, [wPokegearCard]
@@ -929,7 +929,7 @@
call GetMapPhoneService
and a
jr nz, .no_service
- ld hl, Options
+ ld hl, wOptions
res NO_TEXT_SCROLL, [hl]
xor a
ld [hInMenu], a
@@ -948,7 +948,7 @@
call Function90199
ld c, 10
call DelayFrames
- ld hl, Options
+ ld hl, wOptions
set NO_TEXT_SCROLL, [hl]
ld a, $1
ld [hInMenu], a
@@ -1384,8 +1384,8 @@
; 914ab
DeleteSpriteAnimStruct2ToEnd: ; 914ab (24:54ab)
- ld hl, SpriteAnim2
- ld bc, wSpriteAnimationStructsEnd - SpriteAnim2
+ ld hl, wSpriteAnim2
+ ld bc, wSpriteAnimationStructsEnd - wSpriteAnim2
xor a
call ByteFill
ld a, 2
@@ -1560,7 +1560,7 @@
; Oak's Pokémon Talk in the afternoon and evening
call .InJohto
jr nc, .NoSignal
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
and a
jp z, LoadStation_PokedexShow
jp LoadStation_OaksPokemonTalk
@@ -1858,7 +1858,7 @@
; 9191c
_TownMap: ; 9191c
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -1868,10 +1868,10 @@
ld a, $1
ld [hInMenu], a
- ld a, [VramState]
+ ld a, [wVramState]
push af
xor a
- ld [VramState], a
+ ld [wVramState], a
call ClearBGPalettes
call ClearTileMap
@@ -1923,11 +1923,11 @@
.resume
pop af
- ld [VramState], a
+ ld [wVramState], a
pop af
ld [hInMenu], a
pop af
- ld [Options], a
+ ld [wOptions], a
call ClearBGPalettes
ret
@@ -2028,7 +2028,7 @@
; 91a53
PlayRadio: ; 91a53
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -2054,7 +2054,7 @@
.stop
pop af
- ld [Options], a
+ ld [wOptions], a
call ExitPokegearRadio_HandleMusic
ret
@@ -2111,7 +2111,7 @@
and a
jr nz, .kanto
call UpdateTime
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
and a
jp z, LoadStation_PokedexShow
jp LoadStation_OaksPokemonTalk
@@ -2202,9 +2202,9 @@
; 91b73
FlyMapScroll: ; 91b73
- ld a, [StartFlypoint]
+ ld a, [wStartFlypoint]
ld e, a
- ld a, [EndFlypoint]
+ ld a, [wEndFlypoint]
ld d, a
ld hl, hJoyLast
ld a, [hl]
@@ -2308,7 +2308,7 @@
ld e, [hl]
farcall GetLandmarkName
hlcoord 2, 1
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call PlaceString
ret
@@ -2376,9 +2376,9 @@
; 91c90
FlyMap: ; 91c90
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
; If we're not in a valid location, i.e. Pokecenter floor 2F,
@@ -2385,9 +2385,9 @@
; the backup map information is used.
cp SPECIAL_MAP
jr nz, .CheckRegion
- ld a, [BackupMapGroup]
+ ld a, [wBackupMapGroup]
ld b, a
- ld a, [BackupMapNumber]
+ ld a, [wBackupMapNumber]
ld c, a
call GetWorldMapLocation
.CheckRegion:
@@ -2401,10 +2401,10 @@
ld a, FLY_NEW_BARK
ld [wTownMapPlayerIconLandmark], a
; Flypoints begin at New Bark Town...
- ld [StartFlypoint], a
+ ld [wStartFlypoint], a
; ..and end at Silver Cave.
ld a, FLY_MT_SILVER
- ld [EndFlypoint], a
+ ld [wEndFlypoint], a
; Fill out the map
call FillJohtoMap
call .MapHud
@@ -2430,10 +2430,10 @@
; Flypoints begin at Pallet Town...
ld a, FLY_PALLET
- ld [StartFlypoint], a
+ ld [wStartFlypoint], a
; ...and end at Indigo Plateau
ld a, FLY_INDIGO
- ld [EndFlypoint], a
+ ld [wEndFlypoint], a
; Because Indigo Plateau is the first flypoint the player
; visits, it's made the default flypoint.
ld [wTownMapPlayerIconLandmark], a
@@ -2451,10 +2451,10 @@
ld a, FLY_NEW_BARK
ld [wTownMapPlayerIconLandmark], a
; Flypoints begin at New Bark Town...
- ld [StartFlypoint], a
+ ld [wStartFlypoint], a
; ..and end at Silver Cave
ld a, FLY_MT_SILVER
- ld [EndFlypoint], a
+ ld [wEndFlypoint], a
call FillJohtoMap
pop af
.MapHud:
@@ -2588,8 +2588,8 @@
.copy_sprites
hlcoord 0, 0
- ld de, Sprites
- ld bc, SpritesEnd - Sprites
+ ld de, wVirtualOAM
+ ld bc, wVirtualOAMEnd - wVirtualOAM
call CopyBytes
ret
@@ -2625,9 +2625,9 @@
.GetAndPlaceNest: ; 91e1e
ld [wTownMapCursorLandmark], a
ld e, a
- farcall FindNest ; load nest landmarks into TileMap[0,0]
+ farcall FindNest ; load nest landmarks into wTileMap[0,0]
decoord 0, 0
- ld hl, Sprite01
+ ld hl, wVirtualOAMSprite00
.nestloop
ld a, [de]
and a
@@ -2654,9 +2654,9 @@
jr .nestloop
.done_nest
- ld hl, Sprites
+ ld hl, wVirtualOAM
decoord 0, 0
- ld bc, SpritesEnd - Sprites
+ ld bc, wVirtualOAMEnd - wVirtualOAM
call CopyBytes
ret
@@ -2671,7 +2671,7 @@
ld c, e
ld b, d
ld de, .PlayerOAM
- ld hl, Sprite01
+ ld hl, wVirtualOAMSprite00
.ShowPlayerLoop:
ld a, [de]
cp $80
@@ -2700,8 +2700,8 @@
jr .ShowPlayerLoop
.clear_oam
- ld hl, Sprite05
- ld bc, SpritesEnd - Sprite05
+ ld hl, wVirtualOAMSprite04
+ ld bc, wVirtualOAMEnd - wVirtualOAMSprite04
xor a
call ByteFill
ret
@@ -2741,8 +2741,8 @@
ret
.clear
- ld hl, Sprites
- ld bc, SpritesEnd - Sprites
+ ld hl, wVirtualOAM
+ ld bc, wVirtualOAMEnd - wVirtualOAM
xor a
call ByteFill
scf
@@ -2816,7 +2816,7 @@
TownMapPals: ; 91f13
; Assign palettes based on tile ids
hlcoord 0, 0
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
.loop
; Current tile
@@ -2872,8 +2872,8 @@
; Draw the FlyMon icon at town map location
; Get FlyMon species
- ld a, [CurPartyMon]
- ld hl, PartySpecies
+ ld a, [wCurPartyMon]
+ ld hl, wPartySpecies
ld e, a
ld d, $0
add hl, de
--- a/engine/predef.asm
+++ b/engine/predef.asm
@@ -1,14 +1,14 @@
GetPredefPointer:: ; 854b
-; Return the bank and address of PredefID in a and PredefAddress.
+; Return the bank and address of wPredefID in a and wPredefAddress.
; Save hl for later (back in Predef)
ld a, h
- ld [PredefTemp], a
+ ld [wPredefTemp], a
ld a, l
- ld [PredefTemp + 1], a
+ ld [wPredefTemp + 1], a
push de
- ld a, [PredefID]
+ ld a, [wPredefID]
ld e, a
ld d, 0
ld hl, PredefPointers
@@ -18,9 +18,9 @@
pop de
ld a, [hli]
- ld [PredefAddress + 1], a
+ ld [wPredefAddress + 1], a
ld a, [hli]
- ld [PredefAddress], a
+ ld [wPredefAddress], a
ld a, [hl]
ret
--- a/engine/print_party.asm
+++ b/engine/print_party.asm
@@ -158,7 +158,7 @@
call Get2bpp
xor a
- ld [MonType], a
+ ld [wMonType], a
farcall CopyPkmnToTempMon
hlcoord 0, 7
ld b, 9
@@ -165,18 +165,18 @@
ld c, 18
call TextBox
hlcoord 8, 2
- ld a, [TempMonLevel]
+ ld a, [wTempMonLevel]
call PrintLevel_Force3Digits
hlcoord 12, 2
ld [hl], PRINTPARTY_HP
inc hl
- ld de, TempMonMaxHP
+ ld de, wTempMonMaxHP
lb bc, 2, 3
call PrintNum
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wd265], a
- ld [CurSpecies], a
- ld hl, PartyMonNicknames
+ ld [wCurSpecies], a
+ ld hl, wPartyMonNicknames
call Function1dc50e
hlcoord 8, 4
call PlaceString
@@ -196,7 +196,7 @@
hlcoord 1, 9
ld de, String1dc550
call PlaceString
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
call Function1dc50e
hlcoord 4, 9
call PlaceString
@@ -204,7 +204,7 @@
ld de, String1dc559
call PlaceString
hlcoord 4, 11
- ld de, TempMonID
+ ld de, wTempMonID
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
hlcoord 1, 14
@@ -211,15 +211,15 @@
ld de, String1dc554
call PlaceString
hlcoord 7, 14
- ld a, [TempMonMoves + 0]
+ ld a, [wTempMonMoves + 0]
call Function1dc51a
call Function1dc52c
- ld hl, TempMonDVs
+ ld hl, wTempMonDVs
predef GetUnownLetter
ld hl, wBoxAlignment
xor a
ld [hl], a
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp UNOWN
jr z, .asm_1dc469
inc [hl]
@@ -242,7 +242,7 @@
ld [hBGMapMode], a
call LoadFontsBattleExtra
xor a
- ld [MonType], a
+ ld [wMonType], a
farcall CopyPkmnToTempMon
hlcoord 0, 0
ld b, 15
@@ -253,31 +253,31 @@
hlcoord 0, 1
call CopyBytes
hlcoord 7, 0
- ld a, [TempMonMoves + 1]
+ ld a, [wTempMonMoves + 1]
call Function1dc51a
hlcoord 7, 2
- ld a, [TempMonMoves + 2]
+ ld a, [wTempMonMoves + 2]
call Function1dc51a
hlcoord 7, 4
- ld a, [TempMonMoves + 3]
+ ld a, [wTempMonMoves + 3]
call Function1dc51a
hlcoord 7, 7
ld de, String1dc55d
call PlaceString
hlcoord 16, 7
- ld de, TempMonAttack
+ ld de, wTempMonAttack
call .PrintTempMonStats
hlcoord 16, 9
- ld de, TempMonDefense
+ ld de, wTempMonDefense
call .PrintTempMonStats
hlcoord 16, 11
- ld de, TempMonSpclAtk
+ ld de, wTempMonSpclAtk
call .PrintTempMonStats
hlcoord 16, 13
- ld de, TempMonSpclDef
+ ld de, wTempMonSpclDef
call .PrintTempMonStats
hlcoord 16, 15
- ld de, TempMonSpeed
+ ld de, wTempMonSpeed
call .PrintTempMonStats
call WaitBGMap
ld b, SCGB_STATS_SCREEN_HP_PALS
@@ -294,7 +294,7 @@
Function1dc50e: ; 1dc50e
ld bc, NAME_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld e, l
ld d, h
@@ -328,7 +328,7 @@
.got_gender
hlcoord 17, 2
ld [hl], a
- ld bc, TempMonDVs
+ ld bc, wTempMonDVs
farcall CheckShininess
ret nc
hlcoord 18, 2
--- a/engine/printer.asm
+++ b/engine/printer.asm
@@ -751,7 +751,7 @@
cp $ff
jp z, .finish
ld [wd265], a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
push bc
push hl
@@ -769,7 +769,7 @@
push hl
call PlaceString
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
pop hl
jr z, .ok2
@@ -850,7 +850,7 @@
ld bc, BOXMON_STRUCT_LENGTH
ld a, [wWhichBoxMonToPrint]
call AddNTimes
- ld de, TempMonDVs
+ ld de, wTempMonDVs
ld a, [hli]
ld [de], a
inc de
@@ -857,9 +857,9 @@
ld a, [hli]
ld [de], a
ld a, [wWhichBoxMonToPrint]
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld a, TEMPMON
- ld [MonType], a
+ ld [wMonType], a
farcall GetGender
ld a, " "
jr c, .got_gender
--- a/engine/printer_serial.asm
+++ b/engine/printer_serial.asm
@@ -9,7 +9,7 @@
ld [wPrinterOpcode], a
ld hl, wPrinterConnectionOpen
set 0, [hl]
- ld a, [GBPrinter]
+ ld a, [wGBPrinter]
ld [wGBPrinterSettings], a
xor a
ld [wJumptableIndex], a
--- a/engine/radio.asm
+++ b/engine/radio.asm
@@ -269,9 +269,9 @@
ld a, BANK(JohtoGrassWildMons)
call GetFarByte
ld [wNamedObjectIndexBuffer], a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
call GetPokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wMonOrItemNameBuffer
ld bc, MON_NAME_LENGTH
call CopyBytes
@@ -335,7 +335,7 @@
db "@"
OaksPkmnTalk7:
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, OPT_MaryText1
@@ -688,7 +688,7 @@
PokedexShow_GetDexEntryBank:
push hl
push de
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
dec a
rlca
rlca
@@ -722,7 +722,7 @@
jr z, .loop
inc c
ld a, c
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, PokedexShowText
@@ -730,7 +730,7 @@
jp NextRadioLine
PokedexShow2:
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
dec a
ld hl, PokedexDataPointerTable
ld c, a
@@ -1011,12 +1011,12 @@
jp NextRadioLine
LuckyNumberShow8:
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wLuckyIDNumber
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
ld a, "@"
- ld [StringBuffer1 + 5], a
+ ld [wStringBuffer1 + 5], a
ld hl, LC_Text8
ld a, LUCKY_NUMBER_SHOW_9
jp NextRadioLine
@@ -1188,7 +1188,7 @@
jr c, PeoplePlaces4
push bc
callfar GetTrainerClassName
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call CopyName1
pop bc
ld b, 1
@@ -1669,9 +1669,9 @@
jr nz, .read_loop
dec c
jr nz, .read_loop
-; ... and copy it into StringBuffer1.
+; ... and copy it into wStringBuffer1.
.skip
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
.copy_loop
ld a, [de]
inc de
@@ -1678,7 +1678,7 @@
ld [hli], a
cp "@"
jr nz, .copy_loop
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ret
INCLUDE "data/radio/buenas_passwords.asm"
--- a/engine/routines/checktime.asm
+++ b/engine/routines/checktime.asm
@@ -1,5 +1,5 @@
CheckTime:: ; c000
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
ld hl, .TimeOfDayTable
ld de, 2
call IsInArray
--- a/engine/routines/correcterrorsinplayerparty.asm
+++ b/engine/routines/correcterrorsinplayerparty.asm
@@ -1,5 +1,5 @@
Unreferenced_CorrectErrorsInPlayerParty:
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [hl]
and a
ret z
@@ -27,7 +27,7 @@
push hl
push bc
ld a, c
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
call GetPartyLocation
ld [hl], SMEARGLE
pop bc
@@ -40,8 +40,8 @@
jr nz, .loop1
ld [hl], $ff
- ld hl, PartyMon1
- ld a, [PartyCount]
+ ld hl, wPartyMon1
+ ld a, [wPartyCount]
ld d, a
ld e, 0
.loop2
@@ -59,7 +59,7 @@
ld [hl], SMEARGLE
push de
ld d, 0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, de
pop de
ld a, SMEARGLE
@@ -66,7 +66,7 @@
ld [hl], a
.check_level
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
ld hl, MON_LEVEL
add hl, bc
@@ -81,7 +81,7 @@
.invalid_level
ld [hl], a
.load_level
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld hl, MON_MAXHP
add hl, bc
@@ -99,8 +99,8 @@
dec d
jr nz, .loop2
- ld de, PartyMonNicknames
- ld a, [PartyCount]
+ ld de, wPartyMonNicknames
+ ld a, [wPartyCount]
ld b, a
ld c, 0
.loop3
@@ -114,7 +114,7 @@
push bc
push hl
- ld hl, PartySpecies
+ ld hl, wPartySpecies
push bc
ld b, 0
add hl, bc
@@ -125,7 +125,7 @@
jr z, .got_nickname
ld [wd265], a
call GetPokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
.got_nickname
pop de
ld bc, MON_NAME_LENGTH
@@ -137,8 +137,8 @@
dec b
jr nz, .loop3
- ld de, PartyMonOT
- ld a, [PartyCount]
+ ld de, wPartyMonOT
+ ld a, [wPartyCount]
ld b, a
ld c, 0
.loop4
@@ -150,7 +150,7 @@
jr nc, .valid_ot_name
ld d, h
ld e, l
- ld hl, PlayerName
+ ld hl, wPlayerName
ld bc, NAME_LENGTH
call CopyBytes
.valid_ot_name
@@ -159,8 +159,8 @@
dec b
jr nz, .loop4
- ld hl, PartyMon1Moves
- ld a, [PartyCount]
+ ld hl, wPartyMon1Moves
+ ld a, [wPartyCount]
ld b, a
.loop5
push hl
--- a/engine/routines/getbreedmonlevelgrowth.asm
+++ b/engine/routines/getbreedmonlevelgrowth.asm
@@ -1,6 +1,6 @@
GetBreedMon1LevelGrowth: ; e698
ld hl, wBreedMon1Stats
- ld de, TempMon
+ ld de, wTempMon
ld bc, BOXMON_STRUCT_LENGTH
call CopyBytes
callfar CalcLevel
@@ -14,7 +14,7 @@
GetBreedMon2LevelGrowth: ; e6b3
ld hl, wBreedMon2Stats
- ld de, TempMon
+ ld de, wTempMon
ld bc, BOXMON_STRUCT_LENGTH
call CopyBytes
callfar CalcLevel
--- a/engine/routines/initlist.asm
+++ b/engine/routines/initlist.asm
@@ -3,8 +3,8 @@
cp INIT_ENEMYOT_LIST
jr nz, .check_party_ot_name
- ld hl, OTPartyCount
- ld de, OTPartyMonOT
+ ld hl, wOTPartyCount
+ ld de, wOTPartyMonOT
ld a, ENEMY_OT_NAME
jr .done
@@ -11,8 +11,8 @@
.check_party_ot_name
cp INIT_PLAYEROT_LIST
jr nz, .check_mon_name
- ld hl, PartyCount
- ld de, PartyMonOT
+ ld hl, wPartyCount
+ ld de, wPartyMonOT
ld a, PARTY_OT_NAME
jr .done
@@ -19,7 +19,7 @@
.check_mon_name
cp INIT_MON_LIST
jr nz, .check_item_name
- ld hl, CurMart
+ ld hl, wCurMart
ld de, PokemonNames
ld a, MON_NAME
jr .done
@@ -27,13 +27,13 @@
.check_item_name
cp INIT_BAG_ITEM_LIST
jr nz, .check_ob_item_name
- ld hl, NumItems
+ ld hl, wNumItems
ld de, ItemNames
ld a, ITEM_NAME
jr .done
.check_ob_item_name
- ld hl, CurMart
+ ld hl, wCurMart
ld de, ItemNames
ld a, ITEM_NAME
.done
--- a/engine/routines/leveluphappinessmod.asm
+++ b/engine/routines/leveluphappinessmod.asm
@@ -1,13 +1,13 @@
LevelUpHappinessMod: ; 2709e
- ld a, [CurPartyMon]
- ld hl, PartyMon1CaughtLocation
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1CaughtLocation
call GetPartyLocation
ld a, [hl]
and $7f
ld d, a
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
cp d
--- a/engine/routines/loadpushoam.asm
+++ b/engine/routines/loadpushoam.asm
@@ -1,5 +1,5 @@
-LoadPushOAM:: ; 4031
- ld c, hPushOAM - $ff00
+WriteOAMDMACodeToHRAM:: ; 4031
+ ld c, hTransferVirtualOAM - $ff00
ld b, .PushOAMEnd - .PushOAM
ld hl, .PushOAM
.loop
@@ -11,7 +11,7 @@
ret
.PushOAM: ; 403f
- ld a, HIGH(Sprites)
+ ld a, HIGH(wVirtualOAM)
ld [rDMA], a
ld a, NUM_SPRITE_OAM_STRUCTS
.pushoam_loop
--- a/engine/routines/phonering_copytilemapatonce.asm
+++ b/engine/routines/phonering_copytilemapatonce.asm
@@ -23,7 +23,7 @@
di
ld a, BANK(vBGMap2)
ld [rVBK], a
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
call .CopyTilemapAtOnce
ld a, BANK(vBGMap0)
ld [rVBK], a
--- a/engine/routines/playslowcry.asm
+++ b/engine/routines/playslowcry.asm
@@ -1,9 +1,9 @@
Special_PlaySlowCry: ; fb841
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
call LoadCry
jr c, .done
- ld hl, CryPitch
+ ld hl, wCryPitch
ld a, [hli]
ld h, [hl]
ld l, a
@@ -10,10 +10,10 @@
ld bc, -$140
add hl, bc
ld a, l
- ld [CryPitch], a
+ ld [wCryPitch], a
ld a, h
- ld [CryPitch + 1], a
- ld hl, CryLength
+ ld [wCryPitch + 1], a
+ ld hl, wCryLength
ld a, [hli]
ld h, [hl]
ld l, a
@@ -20,9 +20,9 @@
ld bc, $60
add hl, bc
ld a, l
- ld [CryLength], a
+ ld [wCryLength], a
ld a, h
- ld [CryLength + 1], a
+ ld [wCryLength + 1], a
farcall _PlayCry
call WaitSFX
--- a/engine/routines/printitemdescription.asm
+++ b/engine/routines/printitemdescription.asm
@@ -1,16 +1,16 @@
PrintItemDescription: ; 0x1c8955
-; Print the description for item [CurSpecies] at de.
+; Print the description for item [wCurSpecies] at de.
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
cp TM01
jr c, .not_a_tm
- ld [CurItem], a
+ ld [wCurItem], a
push de
farcall GetTMHMItemMove
pop hl
ld a, [wd265]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
predef PrintMoveDesc
ret
@@ -17,7 +17,7 @@
.not_a_tm
push de
ld hl, ItemDescriptions
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
dec a
ld c, a
ld b, 0
--- a/engine/routines/savemenu_copytilemapatonce.asm
+++ b/engine/routines/savemenu_copytilemapatonce.asm
@@ -20,7 +20,7 @@
di
ld a, BANK(vBGMap2)
ld [rVBK], a
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
call .CopyTilemapAtOnce
ld a, BANK(vBGMap0)
ld [rVBK], a
--- a/engine/routines/switchpartymons.asm
+++ b/engine/routines/switchpartymons.asm
@@ -1,17 +1,17 @@
_SwitchPartyMons:
ld a, [wd0e3]
dec a
- ld [Buffer3], a
+ ld [wBuffer3], a
ld b, a
ld a, [wMenuCursorY]
dec a
- ld [Buffer2], a
+ ld [wBuffer2], a
cp b
jr z, .skip
call .SwapMonAndMail
- ld a, [Buffer3]
+ ld a, [wBuffer3]
call .ClearSprite
- ld a, [Buffer2]
+ ld a, [wBuffer2]
call .ClearSprite
.skip
ret
@@ -25,7 +25,7 @@
ld a, " "
call ByteFill
pop af
- ld hl, Sprite01
+ ld hl, wVirtualOAMSprite00
ld bc, 4 * SPRITEOAMSTRUCT_LENGTH
call AddNTimes
ld de, SPRITEOAMSTRUCT_LENGTH
@@ -43,14 +43,14 @@
push hl
push de
push bc
- ld bc, PartySpecies
- ld a, [Buffer2]
+ ld bc, wPartySpecies
+ ld a, [wBuffer2]
ld l, a
ld h, $0
add hl, bc
ld d, h
ld e, l
- ld a, [Buffer3]
+ ld a, [wBuffer3]
ld l, a
ld h, $0
add hl, bc
@@ -60,8 +60,8 @@
ld [hl], a
pop af
ld [de], a
- ld a, [Buffer2]
- ld hl, PartyMon1Species
+ ld a, [wBuffer2]
+ ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
push hl
@@ -68,8 +68,8 @@
ld de, wd002
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
- ld a, [Buffer3]
- ld hl, PartyMon1
+ ld a, [wBuffer3]
+ ld hl, wPartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
pop de
@@ -80,13 +80,13 @@
ld hl, wd002
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
- ld a, [Buffer2]
- ld hl, PartyMonOT
+ ld a, [wBuffer2]
+ ld hl, wPartyMonOT
call SkipNames
push hl
call .CopyNameTowd002
- ld a, [Buffer3]
- ld hl, PartyMonOT
+ ld a, [wBuffer3]
+ ld hl, wPartyMonOT
call SkipNames
pop de
push hl
@@ -94,13 +94,13 @@
pop de
ld hl, wd002
call .CopyName
- ld hl, PartyMonNicknames
- ld a, [Buffer2]
+ ld hl, wPartyMonNicknames
+ ld a, [wBuffer2]
call SkipNames
push hl
call .CopyNameTowd002
- ld hl, PartyMonNicknames
- ld a, [Buffer3]
+ ld hl, wPartyMonNicknames
+ ld a, [wBuffer3]
call SkipNames
pop de
push hl
@@ -109,7 +109,7 @@
ld hl, wd002
call .CopyName
ld hl, sPartyMail
- ld a, [Buffer2]
+ ld a, [wBuffer2]
ld bc, MAIL_STRUCT_LENGTH
call AddNTimes
push hl
@@ -119,7 +119,7 @@
call GetSRAMBank
call CopyBytes
ld hl, sPartyMail
- ld a, [Buffer3]
+ ld a, [wBuffer3]
ld bc, MAIL_STRUCT_LENGTH
call AddNTimes
pop de
--- a/engine/routines/townmap_convertlinebreakcharacters.asm
+++ b/engine/routines/townmap_convertlinebreakcharacters.asm
@@ -1,5 +1,5 @@
TownMap_ConvertLineBreakCharacters: ; 1de2c5
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
.loop
ld a, [hl]
cp "@"
@@ -15,7 +15,7 @@
ld [hl], "<LNBRK>"
.end
- ld de, StringBuffer1
+ ld de, wStringBuffer1
hlcoord 9, 0
call PlaceString
ret
--- a/engine/routines/trademonfrontpic.asm
+++ b/engine/routines/trademonfrontpic.asm
@@ -6,8 +6,8 @@
push af
predef GetUnownLetter
pop af
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
call GetBaseData
pop de
predef GetAnimatedFrontpic
@@ -19,11 +19,11 @@
ret c
farcall ShowOTTrademonStats
ld a, [wOTTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [wOTTrademonDVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wOTTrademonDVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
@@ -30,7 +30,7 @@
call DmgToCgbBGPals
farcall TradeAnim_ShowGetmonFrontpic
ld a, [wOTTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
hlcoord 7, 2
ld d, $0
ld e, ANIM_MON_TRADE
--- a/engine/routines/unreferenced_getgen1trainerclassname.asm
+++ b/engine/routines/unreferenced_getgen1trainerclassname.asm
@@ -1,6 +1,6 @@
Unreferenced_GetGen1TrainerClassName: ; 50a28
ld hl, Gen1TrainerClassNames
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
dec a
ld c, a
ld b, 0
@@ -9,7 +9,7 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld de, StringBuffer1
+ ld de, wStringBuffer1
.copy
ld a, [hli]
ld [de], a
--- a/engine/routines/updateitemdescription.asm
+++ b/engine/routines/updateitemdescription.asm
@@ -1,11 +1,11 @@
UpdateItemDescription: ; 0x244c3
- ld a, [MenuSelection]
- ld [CurSpecies], a
+ ld a, [wMenuSelection]
+ ld [wCurSpecies], a
hlcoord 0, 12
ld b, 4
ld c, SCREEN_WIDTH - 2
call TextBox
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp -1
ret z
decoord 1, 14
--- a/engine/rtc.asm
+++ b/engine/rtc.asm
@@ -44,7 +44,7 @@
; get time of day
inc hl
ld a, [hl]
- ld [TimeOfDay], a
+ ld [wTimeOfDay], a
ret
; 14044
@@ -68,7 +68,7 @@
StageRTCTimeForSave: ; 14056
call UpdateTime
ld hl, wRTC
- ld a, [CurDay]
+ ld a, [wCurDay]
ld [hli], a
ld a, [hHours]
ld [hli], a
@@ -138,7 +138,7 @@
call UpdateTime
ld a, [wRTC + 0]
ld b, a
- ld a, [CurDay]
+ ld a, [wCurDay]
cp b
jr c, .dont_update
@@ -166,9 +166,9 @@
call GetClock
call FixDays
ld hl, hRTCSeconds
- ld de, StartSecond
+ ld de, wStartSecond
- ld a, [StringBuffer2 + 3]
+ ld a, [wStringBuffer2 + 3]
sub [hl]
dec hl
jr nc, .okay_secs
@@ -177,7 +177,7 @@
ld [de], a
dec de
- ld a, [StringBuffer2 + 2]
+ ld a, [wStringBuffer2 + 2]
sbc [hl]
dec hl
jr nc, .okay_mins
@@ -186,7 +186,7 @@
ld [de], a
dec de
- ld a, [StringBuffer2 + 1]
+ ld a, [wStringBuffer2 + 1]
sbc [hl]
dec hl
jr nc, .okay_hrs
@@ -195,7 +195,7 @@
ld [de], a
dec de
- ld a, [StringBuffer2]
+ ld a, [wStringBuffer2]
sbc [hl]
dec hl
jr nc, .okay_days
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -165,7 +165,7 @@
ld a, c
or b
jr nz, .loop
- ld hl, OverworldMap
+ ld hl, wOverworldMap
ld de, sHallOfFame
ld bc, HOF_LENGTH
call CopyBytes
@@ -226,15 +226,15 @@
CompareLoadedAndSavedPlayerID: ; 14bcb
ld a, BANK(sPlayerData)
call GetSRAMBank
- ld hl, sPlayerData + (PlayerID - wPlayerData)
+ ld hl, sPlayerData + (wPlayerID - wPlayerData)
ld a, [hli]
ld c, [hl]
ld b, a
call CloseSRAM
- ld a, [PlayerID]
+ ld a, [wPlayerID]
cp b
ret nz
- ld a, [PlayerID + 1]
+ ld a, [wPlayerID + 1]
cp c
ret
; 14be3
@@ -247,17 +247,17 @@
ld c, $20
call DelayFrames
; copy the original text speed setting to the stack
- ld a, [Options]
+ ld a, [wOptions]
push af
; set text speed super slow
ld a, 3
- ld [Options], a
+ ld [wOptions], a
; <PLAYER> saved the game!
ld hl, Text_PlayerSavedTheGame
call PrintText
; restore the original text speed setting
pop af
- ld [Options], a
+ ld [wOptions], a
ld de, SFX_SAVE
call WaitPlaySFX
call WaitSFX
@@ -332,7 +332,7 @@
FindStackTop: ; 14c90
; Find the furthest point that sp has traversed to.
; This is distinct from the current value of sp.
- ld hl, Stack - $ff
+ ld hl, wStack - $ff
.loop
ld a, [hl]
or a
@@ -349,17 +349,17 @@
ld [hJoypadSum], a
ld [hJoypadDown], a
; Save the text speed setting to the stack
- ld a, [Options]
+ ld a, [wOptions]
push af
; Set the text speed to super slow
ld a, $3
- ld [Options], a
+ ld [wOptions], a
; SAVING... DON'T TURN OFF THE POWER.
ld hl, Text_SavingDontTurnOffThePower
call PrintText
; Restore the text speed setting
pop af
- ld [Options], a
+ ld [wOptions], a
; Wait for 16 frames
ld c, $10
call DelayFrames
@@ -508,11 +508,11 @@
SaveOptions: ; 14dbb
ld a, BANK(sOptions)
call GetSRAMBank
- ld hl, Options
+ ld hl, wOptions
ld de, sOptions
- ld bc, OptionsEnd - Options
+ ld bc, wOptionsEnd - wOptions
call CopyBytes
- ld a, [Options]
+ ld a, [wOptions]
and $ff ^ (1 << NO_TEXT_SCROLL)
ld [sOptions], a
jp CloseSRAM
@@ -577,9 +577,9 @@
SaveBackupOptions: ; 14e40
ld a, BANK(sBackupOptions)
call GetSRAMBank
- ld hl, Options
+ ld hl, wOptions
ld de, sBackupOptions
- ld bc, OptionsEnd - Options
+ ld bc, wOptionsEnd - wOptions
call CopyBytes
call CloseSRAM
ret
@@ -661,14 +661,14 @@
ret
.corrupt
- ld a, [Options]
+ ld a, [wOptions]
push af
set NO_TEXT_SCROLL, a
- ld [Options], a
+ ld [wOptions], a
ld hl, Text_SaveFileCorrupted
call PrintText
pop af
- ld [Options], a
+ ld [wOptions], a
scf
ret
@@ -683,8 +683,8 @@
ld a, BANK(sPlayerData)
call GetSRAMBank
- ld hl, sPlayerData + StartDay - wPlayerData
- ld de, StartDay
+ ld hl, sPlayerData + wStartDay - wPlayerData
+ ld de, wStartDay
ld bc, 8
call CopyBytes
ld hl, sPlayerData + wStatusFlags - wPlayerData
@@ -702,8 +702,8 @@
ld a, BANK(sBackupPlayerData)
call GetSRAMBank
- ld hl, sBackupPlayerData + StartDay - wPlayerData
- ld de, StartDay
+ ld hl, sBackupPlayerData + wStartDay - wPlayerData
+ ld de, wStartDay
ld bc, 8
call CopyBytes
ld hl, sBackupPlayerData + wStatusFlags - wPlayerData
@@ -715,8 +715,8 @@
.corrupt
ld hl, DefaultOptions
- ld de, Options
- ld bc, OptionsEnd - Options
+ ld de, wOptions
+ ld bc, wOptionsEnd - wOptions
call CopyBytes
call PanicResetClock
ret
@@ -736,8 +736,8 @@
cp SAVE_CHECK_VALUE_2
jr nz, .nope
ld hl, sOptions
- ld de, Options
- ld bc, OptionsEnd - Options
+ ld de, wOptions
+ ld bc, wOptionsEnd - wOptions
call CopyBytes
call CloseSRAM
ld a, $1
@@ -758,8 +758,8 @@
cp SAVE_CHECK_VALUE_2
jr nz, .nope
ld hl, sBackupOptions
- ld de, Options
- ld bc, OptionsEnd - Options
+ ld de, wOptions
+ ld bc, wOptionsEnd - wOptions
call CopyBytes
ld a, $2
ld [wSaveFileExists], a
@@ -882,7 +882,7 @@
call CopyBytes
; This block originally had some mobile functionality, but since we're still in
- ; BANK(sCrystalData), it instead overwrites the sixteen EventFlags starting at 1:a603 with
+ ; BANK(sCrystalData), it instead overwrites the sixteen wEventFlags starting at 1:a603 with
; garbage from wd479. This isn't an issue, since ErasePreviousSave is followed by a regular
; save that unwrites the garbage.
@@ -904,7 +904,7 @@
call CopyBytes
; This block originally had some mobile functionality to mirror _SaveData above, but instead it
- ; (harmlessly) writes the aforementioned EventFlags to the unused wd479.
+ ; (harmlessly) writes the aforementioned wEventFlags to the unused wd479.
ld hl, wd479
ld a, [$a60e + 0]
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -4,7 +4,7 @@
EnableScriptMode::
push af
ld a, SCRIPT_READ
- ld [ScriptMode], a
+ ld [wScriptMode], a
pop af
ret
@@ -11,7 +11,7 @@
ScriptEvents::
call StartScript
.loop
- ld a, [ScriptMode]
+ ld a, [wScriptMode]
ld hl, .modes
rst JumpTable
call CheckScript
@@ -31,7 +31,7 @@
WaitScript:
call StopScript
- ld hl, ScriptDelay
+ ld hl, wScriptDelay
dec [hl]
ret nz
@@ -38,7 +38,7 @@
farcall Function58b9
ld a, SCRIPT_READ
- ld [ScriptMode], a
+ ld [wScriptMode], a
call StartScript
ret
@@ -45,7 +45,7 @@
WaitScriptMovement:
call StopScript
- ld hl, VramState
+ ld hl, wVramState
bit 7, [hl]
ret nz
@@ -52,7 +52,7 @@
farcall Function58b9
ld a, SCRIPT_READ
- ld [ScriptMode], a
+ ld [wScriptMode], a
call StartScript
ret
@@ -239,17 +239,17 @@
dw Script_check_save ; a9
StartScript:
- ld hl, ScriptFlags
+ ld hl, wScriptFlags
set SCRIPT_RUNNING, [hl]
ret
CheckScript:
- ld hl, ScriptFlags
+ ld hl, wScriptFlags
bit SCRIPT_RUNNING, [hl]
ret
StopScript:
- ld hl, ScriptFlags
+ ld hl, wScriptFlags
res SCRIPT_RUNNING, [hl]
ret
@@ -299,7 +299,7 @@
; script command 0x51
; parameters: text_pointer
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld [wScriptTextBank], a
call GetScriptByte
ld [wScriptTextAddr], a
@@ -313,7 +313,7 @@
; script command 0x53
; parameters: text_pointer
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld [wScriptTextBank], a
call GetScriptByte
ld [wScriptTextAddr], a
@@ -360,7 +360,7 @@
ld l, a
call GetScriptByte
ld h, a
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld b, a
call MapTextbox
ret
@@ -429,7 +429,7 @@
jr c, .no
ld a, TRUE
.no
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_loadmenudata:
@@ -441,7 +441,7 @@
call GetScriptByte
ld h, a
ld de, LoadMenuDataHeader
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
call Call_a_de
call UpdateSprites
ret
@@ -460,9 +460,9 @@
call GetScriptByte
and a
jr nz, .ok
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
.ok
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
farcall Pokepic
ret
@@ -475,7 +475,7 @@
Script_verticalmenu:
; script command 0x59
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld hl, VerticalMenu
rst FarCall
ld a, [wMenuCursorY]
@@ -482,13 +482,13 @@
jr nc, .ok
xor a
.ok
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script__2dmenu:
; script command 0x58
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld hl, _2DMenu
rst FarCall
ld a, [wMenuCursorBuffer]
@@ -495,7 +495,7 @@
jr nc, .ok
xor a
.ok
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_battletowertext:
@@ -514,7 +514,7 @@
call Script_giveitem
call CurItemName
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld a, 1
call CopyConvertedText
ld b, BANK(GiveItemScript)
@@ -552,22 +552,22 @@
call GetScriptByte
cp -1
jr nz, .ok
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
.ok
- ld [CurItem], a
+ ld [wCurItem], a
call GetScriptByte
call GetVarAction
ld a, [de]
ld [wItemQuantityChangeBuffer], a
- ld hl, NumItems
+ ld hl, wNumItems
call ReceiveItem
ld a, TRUE
jr c, .ok2
xor a
.ok2
- ld [ScriptVar], a
+ ld [wScriptVar], a
call CurItemName
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld a, 1
call CopyConvertedText
ld b, BANK(GiveItemScript)
@@ -622,7 +622,7 @@
ld a, [hli]
ld d, [hl]
ld e, a
- ld hl, StringBuffer3
+ ld hl, wStringBuffer3
call CopyName2
ret
@@ -642,7 +642,7 @@
db "TM POCKET@"
CurItemName:
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [wd265], a
call GetItemName
ret
@@ -667,7 +667,7 @@
ld e, a
call GetScriptByte
ld d, a
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld b, a
farcall OpenMartDialog
ret
@@ -677,17 +677,17 @@
; parameters: floor_list_pointer
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
call GetScriptByte
ld e, a
call GetScriptByte
ld d, a
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld b, a
farcall Elevator
ret c
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_trade:
@@ -707,7 +707,7 @@
ld e, a
call GetScriptByte
ld d, a
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld b, a
farcall PhoneCall
ret
@@ -737,7 +737,7 @@
call GetScriptByte
ld a, PHONE_CONTACT_REFUSED
.done
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_describedecoration:
@@ -756,7 +756,7 @@
; parameters: tree_id
call GetScriptByte
- ld [CurFruitTree], a
+ ld [wCurFruitTree], a
ld b, BANK(FruitTreeScript)
ld hl, FruitTreeScript
jp ScriptJump
@@ -781,13 +781,13 @@
call GetScriptByte
ld c, a
ld b, 0
- ld hl, WalkingX
+ ld hl, wWalkingX
add hl, bc
add hl, bc
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
ld b, a
call MapTextbox
ret
@@ -799,7 +799,7 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
ld b, a
jp ScriptJump
@@ -808,7 +808,7 @@
; parameters: action
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld hl, wd041
ld e, [hl]
inc hl
@@ -820,7 +820,7 @@
and a
ret z
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_winlosstext:
@@ -851,18 +851,18 @@
; script command 0x67
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld a, [wRunningTrainerBattleScript]
and a
ret nz
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_encountermusic:
; script command 0x80
- ld a, [OtherTrainerClass]
+ ld a, [wOtherTrainerClass]
ld e, a
farcall PlayTrainerEncounterMusic
ret
@@ -880,7 +880,7 @@
ld de, MUSIC_NONE
call PlayMusic
xor a
- ld [MusicFade], a
+ ld [wMusicFade], a
call MaxVolume
call GetScriptByte
ld e, a
@@ -894,12 +894,12 @@
; parameters: music, fadetime
call GetScriptByte
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
call GetScriptByte
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
call GetScriptByte
and $ff ^ (1 << MUSIC_FADE_IN_F)
- ld [MusicFade], a
+ ld [wMusicFade], a
ret
Script_playsound:
@@ -936,7 +936,7 @@
pop af
and a
jr nz, .ok
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
.ok
call PlayMonCry
ret
@@ -980,13 +980,13 @@
ld l, a
call GetScriptByte
ld h, a
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld b, a
call GetMovementData
ret c
ld a, SCRIPT_WAIT_MOVEMENT
- ld [ScriptMode], a
+ ld [wScriptMode], a
call StopScript
ret
@@ -1089,7 +1089,7 @@
pop de
ld a, e
call SetSpriteDirection
- ld hl, VramState
+ ld hl, wVramState
bit 6, [hl]
jr nz, .text_state
call .DisableTextTiles
@@ -1122,7 +1122,7 @@
call GetScriptByte
ld e, a
ld d, $0
- ld hl, VariableSprites
+ ld hl, wVariableSprites
add hl, de
call GetScriptByte
ld [hl], a
@@ -1246,7 +1246,7 @@
call GetScriptByte
cp -1
jr nz, .not_var_emote
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
.not_var_emote
ld c, a
farcall LoadEmote
@@ -1257,7 +1257,7 @@
; parameters: bubble, object_id, time
call GetScriptByte
- ld [ScriptVar], a
+ ld [wScriptVar], a
call GetScriptByte
call GetScriptObject
cp LAST_TALKED
@@ -1265,7 +1265,7 @@
ld [hLastTalked], a
.ok
call GetScriptByte
- ld [ScriptDelay], a
+ ld [wScriptDelay], a
ld b, BANK(ShowEmoteScript)
ld de, ShowEmoteScript
jp ScriptCall
@@ -1319,9 +1319,9 @@
; script command 0x5a
ld a, PIKACHU
- ld [TempWildMonSpecies], a
+ ld [wTempWildMonSpecies], a
ld a, 5
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ret
Script_randomwildmon:
@@ -1337,9 +1337,9 @@
ld a, (1 << 7) | 1
ld [wBattleScriptFlags], a
ld a, [wTempTrainerClass]
- ld [OtherTrainerClass], a
+ ld [wOtherTrainerClass], a
ld a, [wTempTrainerID]
- ld [OtherTrainerID], a
+ ld [wOtherTrainerID], a
ret
Script_loadwildmon:
@@ -1349,9 +1349,9 @@
ld a, (1 << 7)
ld [wBattleScriptFlags], a
call GetScriptByte
- ld [TempWildMonSpecies], a
+ ld [wTempWildMonSpecies], a
call GetScriptByte
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ret
Script_loadtrainer:
@@ -1361,9 +1361,9 @@
ld a, (1 << 7) | 1
ld [wBattleScriptFlags], a
call GetScriptByte
- ld [OtherTrainerClass], a
+ ld [wOtherTrainerClass], a
call GetScriptByte
- ld [OtherTrainerID], a
+ ld [wOtherTrainerID], a
ret
Script_startbattle:
@@ -1373,7 +1373,7 @@
predef StartBattle
ld a, [wBattleResult]
and $3f
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_catchtutorial:
@@ -1381,7 +1381,7 @@
; parameters: byte
call GetScriptByte
- ld [BattleType], a
+ ld [wBattleType], a
call BufferScreen
farcall CatchTutorial
jp Script_reloadmap
@@ -1432,7 +1432,7 @@
; script command 0x0
; parameters: pointer
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld b, a
call GetScriptByte
ld e, a
@@ -1471,7 +1471,7 @@
; Bug: The script stack has a capacity of 5 scripts, yet there is
; nothing to stop you from pushing a sixth script. The high part
; of the script address can then be overwritten by modifications
-; to ScriptDelay, causing the script to return to the rst/interrupt
+; to wScriptDelay, causing the script to return to the rst/interrupt
; space.
push de
@@ -1484,24 +1484,24 @@
add hl, de
add hl, de
pop de
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld [hli], a
- ld a, [ScriptPos]
+ ld a, [wScriptPos]
ld [hli], a
- ld a, [ScriptPos + 1]
+ ld a, [wScriptPos + 1]
ld [hl], a
ld a, b
- ld [ScriptBank], a
+ ld [wScriptBank], a
ld a, e
- ld [ScriptPos], a
+ ld [wScriptPos], a
ld a, d
- ld [ScriptPos + 1], a
+ ld [wScriptPos + 1], a
ret
CallCallback::
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
or $80
- ld [ScriptBank], a
+ ld [wScriptBank], a
jp ScriptCall
Script_jump:
@@ -1512,7 +1512,7 @@
ld l, a
call GetScriptByte
ld h, a
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld b, a
jp ScriptJump
@@ -1547,7 +1547,7 @@
; script command 0x8
; parameters: pointer
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
jp nz, SkipTwoScriptBytes
jp Script_jump
@@ -1556,7 +1556,7 @@
; script command 0x9
; parameters: pointer
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
jp nz, Script_jump
jp SkipTwoScriptBytes
@@ -1566,7 +1566,7 @@
; parameters: byte, pointer
call GetScriptByte
- ld hl, ScriptVar
+ ld hl, wScriptVar
cp [hl]
jr z, Script_jump
jr SkipTwoScriptBytes
@@ -1576,7 +1576,7 @@
; parameters: byte, pointer
call GetScriptByte
- ld hl, ScriptVar
+ ld hl, wScriptVar
cp [hl]
jr nz, Script_jump
jr SkipTwoScriptBytes
@@ -1585,7 +1585,7 @@
; script command 0xa
; parameters: byte, pointer
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld b, a
call GetScriptByte
cp b
@@ -1598,7 +1598,7 @@
call GetScriptByte
ld b, a
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
cp b
jr c, Script_jump
jr SkipTwoScriptBytes
@@ -1643,11 +1643,11 @@
ScriptJump:
ld a, b
- ld [ScriptBank], a
+ ld [wScriptBank], a
ld a, l
- ld [ScriptPos], a
+ ld [wScriptPos], a
ld a, h
- ld [ScriptPos + 1], a
+ ld [wScriptPos + 1], a
ret
Script_priorityjump:
@@ -1654,13 +1654,13 @@
; script command 0x8d
; parameters: pointer
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld [wPriorityScriptBank], a
call GetScriptByte
ld [wPriorityScriptAddr], a
call GetScriptByte
ld [wPriorityScriptAddr + 1], a
- ld hl, ScriptFlags
+ ld hl, wScriptFlags
set 3, [hl]
ret
@@ -1669,12 +1669,12 @@
call CheckScenes
jr z, .no_scene
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.no_scene
ld a, $ff
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_checkmapscene:
@@ -1690,12 +1690,12 @@
or e
jr z, .no_scene
ld a, [de]
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.no_scene
ld a, $ff
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_setscene:
@@ -1702,9 +1702,9 @@
; script command 0x14
; parameters: scene_id
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
jr DoScene
@@ -1735,7 +1735,7 @@
call GetScriptByte
ld h, a
ld a, [hl]
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_copyvartobyte:
@@ -1746,7 +1746,7 @@
ld l, a
call GetScriptByte
ld h, a
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld [hl], a
ret
@@ -1767,7 +1767,7 @@
; parameters: value
call GetScriptByte
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_addvar:
@@ -1775,7 +1775,7 @@
; parameters: value
call GetScriptByte
- ld hl, ScriptVar
+ ld hl, wScriptVar
add [hl]
ld [hl], a
ret
@@ -1785,7 +1785,7 @@
; parameters: input
call GetScriptByte
- ld [ScriptVar], a
+ ld [wScriptVar], a
and a
ret z
@@ -1814,11 +1814,11 @@
.finish
push af
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld c, a
pop af
call SimpleDivide
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.Divide256byC:
@@ -1840,7 +1840,7 @@
call GetScriptByte
call GetVarAction
ld a, [de]
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_writevarcode:
@@ -1849,7 +1849,7 @@
call GetScriptByte
call GetVarAction
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld [de], a
ret
@@ -1872,7 +1872,7 @@
; script command 0x18
ld a, [.gs_version]
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.gs_version:
@@ -1880,16 +1880,16 @@
Script_pokenamemem:
; script command 0x40
-; parameters: pokemon (0 aka USE_SCRIPT_VAR to use ScriptVar), memory
+; parameters: pokemon (0 aka USE_SCRIPT_VAR to use wScriptVar), memory
call GetScriptByte
and a
jr nz, .gotit
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
.gotit
ld [wd265], a
call GetPokemonName
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ConvertMemToText:
call GetScriptByte
@@ -1899,8 +1899,8 @@
.ok
CopyConvertedText:
- ld hl, StringBuffer3
- ld bc, StringBuffer4 - StringBuffer3
+ ld hl, wStringBuffer3
+ ld bc, wStringBuffer4 - wStringBuffer3
call AddNTimes
call CopyName2
ret
@@ -1907,16 +1907,16 @@
Script_itemtotext:
; script command 0x41
-; parameters: item (0 aka USE_SCRIPT_VAR to use ScriptVar), memory
+; parameters: item (0 aka USE_SCRIPT_VAR to use wScriptVar), memory
call GetScriptByte
and a ; USE_SCRIPT_VAR
jr nz, .ok
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
.ok
ld [wd265], a
call GetItemName
- ld de, StringBuffer1
+ ld de, wStringBuffer1
jr ConvertMemToText
Script_mapnametotext:
@@ -1923,9 +1923,9 @@
; script command 0x42
; parameters: memory
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
@@ -1932,7 +1932,7 @@
ConvertLandmarkToText:
ld e, a
farcall GetLandmarkName
- ld de, StringBuffer1
+ ld de, wStringBuffer1
jp ConvertMemToText
Script_landmarktotext:
@@ -1962,9 +1962,9 @@
ContinueToGetName:
call GetScriptByte
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetName
- ld de, StringBuffer1
+ ld de, wStringBuffer1
jp ConvertMemToText
Script_trainerclassname:
@@ -1981,10 +1981,10 @@
call ResetStringBuffer1
call GetMoneyAccount
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
lb bc, PRINTNUM_RIGHTALIGN | 3, 6
call PrintNum
- ld de, StringBuffer1
+ ld de, wStringBuffer1
jp ConvertMemToText
Script_readcoins:
@@ -1992,11 +1992,11 @@
; parameters: memory
call ResetStringBuffer1
- ld hl, StringBuffer1
- ld de, Coins
+ ld hl, wStringBuffer1
+ ld de, wCoins
lb bc, PRINTNUM_RIGHTALIGN | 2, 6
call PrintNum
- ld de, StringBuffer1
+ ld de, wStringBuffer1
jp ConvertMemToText
Script_vartomem:
@@ -2004,15 +2004,15 @@
; parameters: memory
call ResetStringBuffer1
- ld de, ScriptVar
- ld hl, StringBuffer1
+ ld de, wScriptVar
+ ld hl, wStringBuffer1
lb bc, PRINTNUM_RIGHTALIGN | 1, 3
call PrintNum
- ld de, StringBuffer1
+ ld de, wStringBuffer1
jp ConvertMemToText
ResetStringBuffer1:
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld bc, NAME_LENGTH
ld a, "@"
call ByteFill
@@ -2026,10 +2026,10 @@
ld e, a
call GetScriptByte
ld d, a
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld hl, CopyName1
rst FarCall
- ld de, StringBuffer2
+ ld de, wStringBuffer2
jp ConvertMemToText
Script_givepokeitem:
@@ -2040,7 +2040,7 @@
ld l, a
call GetScriptByte
ld h, a
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
call GetFarByte
ld b, a
push bc
@@ -2047,7 +2047,7 @@
inc hl
ld bc, MAIL_MSG_LENGTH
ld de, wd002
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
call FarCopyBytes
pop bc
farcall GivePokeItem
@@ -2061,7 +2061,7 @@
ld e, a
call GetScriptByte
ld d, a
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld b, a
farcall CheckPokeItem
ret
@@ -2073,20 +2073,20 @@
call GetScriptByte
cp ITEM_FROM_MEM
jr nz, .ok
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
.ok
- ld [CurItem], a
+ ld [wCurItem], a
call GetScriptByte
ld [wItemQuantityChangeBuffer], a
- ld hl, NumItems
+ ld hl, wNumItems
call ReceiveItem
jr nc, .full
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.full
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_takeitem:
@@ -2094,18 +2094,18 @@
; parameters: item, quantity
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
call GetScriptByte
- ld [CurItem], a
+ ld [wCurItem], a
call GetScriptByte
ld [wItemQuantityChangeBuffer], a
ld a, -1
- ld [CurItemQuantity], a
- ld hl, NumItems
+ ld [wCurItemQuantity], a
+ ld hl, wNumItems
call TossItem
ret nc
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_checkitem:
@@ -2113,14 +2113,14 @@
; parameters: item
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
call GetScriptByte
- ld [CurItem], a
- ld hl, NumItems
+ ld [wCurItem], a
+ ld hl, wNumItems
call CheckItem
ret nc
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_givemoney:
@@ -2160,13 +2160,13 @@
.less
ld a, HAVE_LESS
.done
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
GetMoneyAccount:
call GetScriptByte
and a
- ld de, Money ; YOUR_MONEY
+ ld de, wMoney ; YOUR_MONEY
ret z
ld de, wMomsMoney ; MOMS_MONEY
ret
@@ -2222,13 +2222,13 @@
; parameters: time
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
farcall CheckTime
call GetScriptByte
and c
ret z
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_checkpoke:
@@ -2236,14 +2236,14 @@
; parameters: pokemon
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
call GetScriptByte
- ld hl, PartySpecies
+ ld hl, wPartySpecies
ld de, 1
call IsInArray
ret nc
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_addcellnum:
@@ -2251,13 +2251,13 @@
; parameters: person
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
call GetScriptByte
ld c, a
farcall AddPhoneNumber
ret nc
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_delcellnum:
@@ -2265,13 +2265,13 @@
; parameters: person
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
call GetScriptByte
ld c, a
farcall DelCellNum
ret nc
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_checkcellnum:
@@ -2280,13 +2280,13 @@
; returns false if the cell number is not in your phone
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
call GetScriptByte
ld c, a
farcall CheckCellNum
ret nc
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_specialphonecall:
@@ -2308,7 +2308,7 @@
jr z, .ok
ld a, TRUE
.ok
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_givepoke:
@@ -2316,16 +2316,16 @@
; parameters: pokemon, level, item, trainer, trainer_name_pointer, pkmn_nickname
call GetScriptByte
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
call GetScriptByte
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
call GetScriptByte
- ld [CurItem], a
+ ld [wCurItem], a
call GetScriptByte
and a
ld b, a
jr z, .ok
- ld hl, ScriptPos
+ ld hl, wScriptPos
ld e, [hl]
inc hl
ld d, [hl]
@@ -2336,25 +2336,25 @@
.ok
farcall GivePoke
ld a, b
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_giveegg:
; script command 0x2e
; parameters: pokemon, level
-; if no room in the party, return 0 in ScriptVar; else, return 2
+; if no room in the party, return 0 in wScriptVar; else, return 2
xor a ; PARTYMON
- ld [ScriptVar], a
- ld [MonType], a
+ ld [wScriptVar], a
+ ld [wMonType], a
call GetScriptByte
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
call GetScriptByte
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
farcall GiveEgg
ret nc
ld a, 2
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_setevent:
@@ -2396,7 +2396,7 @@
jr z, .false
ld a, TRUE
.false
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_setflag:
@@ -2438,7 +2438,7 @@
jr z, .false
ld a, TRUE
.false
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
_EngineFlagAction:
@@ -2490,15 +2490,15 @@
call GetScriptByte
and a
jr z, .not_ok
- ld [MapGroup], a
+ ld [wMapGroup], a
call GetScriptByte
- ld [MapNumber], a
+ ld [wMapNumber], a
call GetScriptByte
- ld [XCoord], a
+ ld [wXCoord], a
call GetScriptByte
- ld [YCoord], a
+ ld [wYCoord], a
ld a, -1
- ld [DefaultSpawnpoint], a
+ ld [wDefaultSpawnpoint], a
ld a, MAPSETUP_WARP
ld [hMapEntryMethod], a
ld a, 1
@@ -2511,7 +2511,7 @@
call GetScriptByte
call GetScriptByte
ld a, -1
- ld [DefaultSpawnpoint], a
+ ld [wDefaultSpawnpoint], a
ld a, MAPSETUP_BADWARP
ld [hMapEntryMethod], a
ld a, 1
@@ -2524,11 +2524,11 @@
; parameters: warp_id, map_group, map_id
call GetScriptByte
- ld [BackupWarpNumber], a
+ ld [wBackupWarpNumber], a
call GetScriptByte
- ld [BackupMapGroup], a
+ ld [wBackupMapGroup], a
call GetScriptByte
- ld [BackupMapNumber], a
+ ld [wBackupMapNumber], a
ret
Script_blackoutmod:
@@ -2556,7 +2556,7 @@
ld e, a
call GetScriptByte
ld d, a
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
ld b, a
farcall WriteCmdQueue ; no need to farcall
ret
@@ -2566,13 +2566,13 @@
; parameters: byte
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
call GetScriptByte
ld b, a
farcall DelCmdQueue ; no need to farcall
ret c
ld a, 1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Script_changemap:
@@ -2580,11 +2580,11 @@
; parameters: map_data_pointer
call GetScriptByte
- ld [MapBlocksBank], a
+ ld [wMapBlocksBank], a
call GetScriptByte
- ld [MapBlocksPointer], a
+ ld [wMapBlocksPointer], a
call GetScriptByte
- ld [MapBlocksPointer + 1], a
+ ld [wMapBlocksPointer + 1], a
call ChangeMap
call BufferScreen
ret
@@ -2699,11 +2699,11 @@
call GetScriptByte
and a
jr z, .loop
- ld [ScriptDelay], a
+ ld [wScriptDelay], a
.loop
ld c, 2
call DelayFrames
- ld hl, ScriptDelay
+ ld hl, wScriptDelay
dec [hl]
jr nz, .loop
ret
@@ -2715,10 +2715,10 @@
call GetScriptByte
and a
jr z, .no_time
- ld [ScriptDelay], a
+ ld [wScriptDelay], a
.no_time
ld a, SCRIPT_WAIT
- ld [ScriptMode], a
+ ld [wScriptMode], a
call StopScript
ret
@@ -2738,10 +2738,10 @@
.resume
xor a
- ld [ScriptRunning], a
+ ld [wScriptRunning], a
ld a, SCRIPT_OFF
- ld [ScriptMode], a
- ld hl, ScriptFlags
+ ld [wScriptMode], a
+ ld hl, wScriptFlags
res 0, [hl]
call StopScript
ret
@@ -2752,7 +2752,7 @@
call ExitScriptSubroutine
jr c, .dummy
.dummy
- ld hl, ScriptFlags
+ ld hl, wScriptFlags
res 0, [hl]
call StopScript
ret
@@ -2774,13 +2774,13 @@
ld a, [hli]
ld b, a
and " "
- ld [ScriptBank], a
+ ld [wScriptBank], a
ld a, [hli]
ld e, a
- ld [ScriptPos], a
+ ld [wScriptPos], a
ld a, [hl]
ld d, a
- ld [ScriptPos + 1], a
+ ld [wScriptPos + 1], a
and a
ret
.done
@@ -2792,10 +2792,10 @@
xor a
ld [wScriptStackSize], a
- ld [ScriptRunning], a
+ ld [wScriptRunning], a
ld a, SCRIPT_OFF
- ld [ScriptMode], a
- ld hl, ScriptFlags
+ ld [wScriptMode], a
+ ld hl, wScriptFlags
res 0, [hl]
call StopScript
ret
@@ -2844,13 +2844,13 @@
farcall CheckSave
ld a, c
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; unused
ld a, [.byte]
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.byte
--- a/engine/scrolling_menu.asm
+++ b/engine/scrolling_menu.asm
@@ -44,7 +44,7 @@
ScrollingMenu_InitDisplay: ; 245f1
xor a
ld [hBGMapMode], a
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -52,7 +52,7 @@
call ScrollingMenu_PlaceCursor
call ScrollingMenu_CheckCallFunction3
pop af
- ld [Options], a
+ ld [wOptions], a
ret
; 24609
@@ -95,15 +95,15 @@
ld a, [wMenuCursorY]
dec a
call ScrollingMenu_GetListItemCoordAndFunctionArgs
- ld a, [MenuSelection]
- ld [CurItem], a
- ld a, [MenuSelectionQuantity]
+ ld a, [wMenuSelection]
+ ld [wCurItem], a
+ ld a, [wMenuSelectionQuantity]
ld [wItemQuantityBuffer], a
call ScrollingMenu_GetCursorPosition
dec a
ld [wScrollingMenuCursorPosition], a
- ld [CurItemQuantity], a
- ld a, [MenuSelection]
+ ld [wCurItemQuantity], a
+ ld a, [wMenuSelection]
cp -1
jr z, .b_button
ld a, A_BUTTON
@@ -124,7 +124,7 @@
ld a, [wMenuCursorY]
dec a
call ScrollingMenu_GetListItemCoordAndFunctionArgs
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp -1
jp z, xor_a_dec_a
call ScrollingMenu_GetCursorPosition
@@ -389,7 +389,7 @@
ld [wScrollingMenuCursorPosition], a
ld a, c
call ScrollingMenu_GetListItemCoordAndFunctionArgs
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp -1
jr z, .cancel
push bc
@@ -531,12 +531,12 @@
add hl, de
ld a, [wMenuData2_ItemsPointerBank]
call GetFarByte
- ld [MenuSelection], a
- ld [CurItem], a
+ ld [wMenuSelection], a
+ ld [wCurItem], a
inc hl
ld a, [wMenuData2_ItemsPointerBank]
call GetFarByte
- ld [MenuSelectionQuantity], a
+ ld [wMenuSelectionQuantity], a
pop hl
pop de
ret
--- a/engine/search.asm
+++ b/engine/search.asm
@@ -1,37 +1,37 @@
Special_BeastsCheck: ; 0x4a6e8
; Check if the player owns all three legendary beasts.
; They must exist in either party or PC, and have the player's OT and ID.
-; Return the result in ScriptVar.
+; Return the result in wScriptVar.
ld a, RAIKOU
- ld [ScriptVar], a
+ ld [wScriptVar], a
call CheckOwnMonAnywhere
jr nc, .notexist
ld a, ENTEI
- ld [ScriptVar], a
+ ld [wScriptVar], a
call CheckOwnMonAnywhere
jr nc, .notexist
ld a, SUICUNE
- ld [ScriptVar], a
+ ld [wScriptVar], a
call CheckOwnMonAnywhere
jr nc, .notexist
; they exist
ld a, 1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.notexist
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Special_MonCheck: ; 0x4a711
-; Check if the player owns any monsters of the species in ScriptVar.
-; Return the result in ScriptVar.
+; Check if the player owns any monsters of the species in wScriptVar.
+; Return the result in wScriptVar.
call CheckOwnMonAnywhere
jr c, .exists
@@ -38,29 +38,29 @@
; doesn't exist
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.exists
ld a, 1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
CheckOwnMonAnywhere: ; 0x4a721
-; Check if the player owns any monsters of the species in ScriptVar.
+; Check if the player owns any monsters of the species in wScriptVar.
; It must exist in either party or PC, and have the player's OT and ID.
; If there are no monsters in the party,
; the player must not own any yet.
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret z
ld d, a
ld e, 0
- ld hl, PartyMon1Species
- ld bc, PartyMonOT
+ ld hl, wPartyMon1Species
+ ld bc, wPartyMonOT
; Run CheckOwnMon on each Pokémon in the party.
.partymon
@@ -185,7 +185,7 @@
; inputs:
; hl, pointer to PartyMonNSpecies
; bc, pointer to PartyMonNOT
-; ScriptVar should contain the species we're looking for
+; wScriptVar should contain the species we're looking for
; outputs:
; sets carry if monster matches species, ID, and OT name.
@@ -197,7 +197,7 @@
ld e, c
; check species
- ld a, [ScriptVar] ; species we're looking for
+ ld a, [wScriptVar] ; species we're looking for
ld b, [hl] ; species we have
cp b
jr nz, .notfound ; species doesn't match
@@ -205,11 +205,11 @@
; check ID number
ld bc, MON_ID
add hl, bc ; now hl points to ID number
- ld a, [PlayerID]
+ ld a, [wPlayerID]
cp [hl]
jr nz, .notfound ; ID doesn't match
inc hl
- ld a, [PlayerID + 1]
+ ld a, [wPlayerID + 1]
cp [hl]
jr nz, .notfound ; ID doesn't match
@@ -217,7 +217,7 @@
; This only checks five characters, which is fine for the Japanese version,
; but in the English version the player name is 7 characters, so this is wrong.
- ld hl, PlayerName
+ ld hl, wPlayerName
rept NAME_LENGTH_JAPANESE +- 2 ; should be PLAYER_NAME_LENGTH +- 2
ld a, [de]
--- a/engine/search2.asm
+++ b/engine/search2.asm
@@ -1,30 +1,30 @@
_FindGreaterThanThatLevel: ; 4dbd2
- ld hl, PartyMon1Level
+ ld hl, wPartyMon1Level
call FindGreaterThanThatLevel
ret
_FindAtLeastThatHappy: ; 4dbd9
- ld hl, PartyMon1Happiness
+ ld hl, wPartyMon1Happiness
call FindAtLeastThatHappy
ret
_FindThatSpecies: ; 4dbe0
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
jp FindThatSpecies
_FindThatSpeciesYourTrainerID: ; 4dbe6
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
call FindThatSpecies
ret z
ld a, c
- ld hl, PartyMon1ID
+ ld hl, wPartyMon1ID
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
- ld a, [PlayerID]
+ ld a, [wPlayerID]
cp [hl]
jr nz, .nope
inc hl
- ld a, [PlayerID + 1]
+ ld a, [wPlayerID + 1]
cp [hl]
jr nz, .nope
ld a, $1
@@ -39,7 +39,7 @@
; Sets the bits for the Pokemon that have a happiness greater than or equal to b.
; The lowest bits are used. Sets z if no Pokemon in your party is at least that happy.
ld c, $0
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld d, a
.loop
ld a, d
@@ -71,7 +71,7 @@
FindGreaterThanThatLevel: ; 4dc31
ld c, $0
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld d, a
.loop
ld a, d
@@ -104,7 +104,7 @@
; If that species is in your party, returns its location in c, and nz.
; Otherwise, returns z.
ld c, -1
- ld hl, PartySpecies
+ ld hl, wPartySpecies
.loop
ld a, [hli]
cp -1
@@ -118,7 +118,7 @@
RetroactivelyIgnoreEggs: ; 4dc67
ld e, -2
- ld hl, PartySpecies
+ ld hl, wPartySpecies
.loop
ld a, [hli]
cp -1
--- a/engine/select_menu.asm
+++ b/engine/select_menu.asm
@@ -22,7 +22,7 @@
CheckRegisteredItem: ; 13345
- ld a, [WhichRegisteredItem]
+ ld a, [wWhichRegisteredItem]
and a
jr z, .NoRegisteredItem
and REGISTERED_POCKET
@@ -39,7 +39,7 @@
dw .CheckTMHM
.CheckItem:
- ld hl, NumItems
+ ld hl, wNumItems
call .CheckRegisteredNo
jr c, .NoRegisteredItem
inc hl
@@ -53,18 +53,18 @@
ret
.CheckKeyItem:
- ld a, [RegisteredItem]
- ld hl, KeyItems
+ ld a, [wRegisteredItem]
+ ld hl, wKeyItems
ld de, 1
call IsInArray
jr nc, .NoRegisteredItem
- ld a, [RegisteredItem]
- ld [CurItem], a
+ ld a, [wRegisteredItem]
+ ld [wCurItem], a
and a
ret
.CheckBall:
- ld hl, NumBalls
+ ld hl, wNumBalls
call .CheckRegisteredNo
jr nc, .NoRegisteredItem
inc hl
@@ -81,8 +81,8 @@
.NoRegisteredItem:
xor a
- ld [WhichRegisteredItem], a
- ld [RegisteredItem], a
+ ld [wWhichRegisteredItem], a
+ ld [wRegisteredItem], a
scf
ret
; 133a6
@@ -89,12 +89,12 @@
.CheckRegisteredNo: ; 133a6
- ld a, [WhichRegisteredItem]
+ ld a, [wWhichRegisteredItem]
and REGISTERED_NUMBER
dec a
cp [hl]
jr nc, .NotEnoughItems
- ld [CurItemQuantity], a
+ ld [wCurItemQuantity], a
and a
ret
@@ -105,10 +105,10 @@
.IsSameItem: ; 133b6
- ld a, [RegisteredItem]
+ ld a, [wRegisteredItem]
cp [hl]
jr nz, .NotSameItem
- ld [CurItem], a
+ ld [wCurItem], a
and a
ret
--- a/engine/sgb_layouts.asm
+++ b/engine/sgb_layouts.asm
@@ -5,7 +5,7 @@
ld a, b
cp SCGB_RAM
jr nz, .not_ram
- ld a, [SGBPredef]
+ ld a, [wSGBPredef]
.not_ram
cp SCGB_PARTY_MENU_HP_PALS
jp z, SGB_ApplyPartyMenuHPPals
@@ -71,7 +71,7 @@
ld bc, PALPACKET_LENGTH
call CopyBytes
- ld a, [PlayerHPPal]
+ ld a, [wPlayerHPPal]
ld l, a
ld h, 0
add hl, hl
@@ -88,7 +88,7 @@
ld a, [hl]
ld [wSGBPals + 6], a
- ld a, [EnemyHPPal]
+ ld a, [wEnemyHPPal]
ld l, a
ld h, 0
add hl, hl
@@ -133,7 +133,7 @@
ld hl, wSGBPals
ld de, wSGBPals + PALPACKET_LENGTH
ld a, SCGB_BATTLE_COLORS
- ld [SGBPredef], a
+ ld [wSGBPredef], a
ret
; 873c
@@ -148,7 +148,7 @@
inc hl
inc hl
- ld a, [PlayerHPPal]
+ ld a, [wPlayerHPPal]
add PREDEFPAL_HP_GREEN
ld [hl], a
ld hl, wSGBPals
@@ -182,8 +182,8 @@
ld [wSGBPals + 5], a
ld a, [hl]
ld [wSGBPals + 6], a
- ld a, [CurPartySpecies]
- ld bc, TempMonDVs
+ ld a, [wCurPartySpecies]
+ ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
ld a, [hli]
ld [wSGBPals + 9], a
@@ -217,7 +217,7 @@
ld [hl], LOW(palred 26 + palgreen 10 + palblue 6)
inc hl
ld [hl], HIGH(palred 26 + palgreen 10 + palblue 6)
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call GetMonPalettePointer_
ld a, [hli]
ld [wSGBPals + 9], a
@@ -245,8 +245,8 @@
ld [hl], LOW(palred 26 + palgreen 10 + palblue 6)
inc hl
ld [hl], HIGH(palred 26 + palgreen 10 + palblue 6)
- ld a, [CurPartySpecies]
- ld bc, TempMonDVs
+ ld a, [wCurPartySpecies]
+ ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
ld a, [hli]
ld [wSGBPals + 9], a
@@ -336,7 +336,7 @@
ld hl, PalPacket_GSTitleScreen
ld de, BlkPacket_GSTitleScreen
ld a, SCGB_DIPLOMA
- ld [SGBPredef], a
+ ld [wSGBPredef], a
ret
; 8890
@@ -354,7 +354,7 @@
.SGB11: ; 889e
ld hl, BlkPacket_9a86
- ld de, PlayerLightScreenCount ; ???
+ ld de, wPlayerLightScreenCount ; ???
ld bc, PALPACKET_LENGTH
call CopyBytes
ld hl, PalPacket_SCGB_11
@@ -372,7 +372,7 @@
ld [hld], a
ld de, BlkPacket_9a86
ld a, SCGB_MAPPALS
- ld [SGBPredef], a
+ ld [wSGBPredef], a
ret
; 88cd
@@ -398,13 +398,13 @@
jr .done
.partymon
- ld hl, PartyMon1DVs
+ ld hl, wPartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld c, l
ld b, h
- ld a, [PlayerHPPal]
+ ld a, [wPlayerHPPal]
call GetPlayerOrMonPalettePointer
ld a, [hli]
ld [wSGBPals + 3], a
@@ -469,7 +469,7 @@
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld l, a
ld h, 0
add hl, hl
@@ -508,8 +508,8 @@
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
- ld a, [CurPartySpecies]
- ld bc, TempMonDVs
+ ld a, [wCurPartySpecies]
+ ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
ld a, [hli]
ld [wSGBPals + 3], a
@@ -535,8 +535,8 @@
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
- ld a, [CurPartySpecies]
- ld bc, TempMonDVs
+ ld a, [wCurPartySpecies]
+ ld bc, wTempMonDVs
call GetFrontpicPalettePointer
ld a, [hli]
ld [wSGBPals + 3], a
@@ -552,7 +552,7 @@
; 8a0c
.GetMapPalsIndex: ; 8a0c
- ld a, [TimeOfDayPal]
+ ld a, [wTimeOfDayPal]
cp NITE_F
jr c, .morn_day
ld a, PREDEFPAL_NITE
@@ -570,7 +570,7 @@
jr z, .perm5
cp GATE
jr z, .gate
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld e, a
ld d, 0
ld hl, MapGroupRoofSGBPalInds
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -75,7 +75,7 @@
const REEL_ACTION_DROP_REEL
_SlotMachine:
- ld hl, Options
+ ld hl, wOptions
set NO_TEXT_SCROLL, [hl]
call .InitGFX
call DelayFrame
@@ -88,7 +88,7 @@
call WaitSFX
call ClearBGPalettes
farcall StubbedTrainerRankings_EndSlotsWinStreak
- ld hl, Options
+ ld hl, wOptions
res NO_TEXT_SCROLL, [hl]
ld hl, rLCDC
res rLCDC_SPRITE_SIZE, [hl] ; 8x8
@@ -211,7 +211,7 @@
ret
.matching_sevens
- ld a, [TextDelayFrames]
+ ld a, [wTextDelayFrames]
and $7
ret nz
ld a, [rBGP]
@@ -223,7 +223,7 @@
.PrintCoinsAndPayout: ; 927f8 (24:67f8)
hlcoord 5, 1
- ld de, Coins
+ ld de, wCoins
lb bc, PRINTNUM_LEADINGZEROS | 2, 4
call PrintNum
hlcoord 11, 1
@@ -261,7 +261,7 @@
inc [hl]
and $7
ret nz
- ld hl, Sprite17TileID
+ ld hl, wVirtualOAMSprite16TileID
ld c, NUM_SPRITE_OAM_STRUCTS - 16
.loop
ld a, [hl]
@@ -480,7 +480,7 @@
ld [hl], e
dec hl
ld [hl], d
- ld hl, Coins
+ ld hl, wCoins
ld d, [hl]
inc hl
ld e, [hl]
@@ -671,7 +671,7 @@
ld bc, wReel1
ld hl, REEL_OAM_ADDR
add hl, bc
- ld de, Sprite17
+ ld de, wVirtualOAMSprite16
ld [hl], e
inc hl
ld [hl], d
@@ -689,7 +689,7 @@
ld bc, wReel2
ld hl, REEL_OAM_ADDR
add hl, bc
- ld de, Sprite25
+ ld de, wVirtualOAMSprite24
ld [hl], e
inc hl
ld [hl], d
@@ -707,7 +707,7 @@
ld bc, wReel3
ld hl, REEL_OAM_ADDR
add hl, bc
- ld de, Sprite33
+ ld de, wVirtualOAMSprite32
ld [hl], e
inc hl
ld [hl], d
@@ -1725,7 +1725,7 @@
and a
ret z
ld hl, .Normal
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
jr z, .okay
ld hl, .Lucky
@@ -1819,7 +1819,7 @@
ld a, 4
sub b
ld [wSlotBet], a
- ld hl, Coins
+ ld hl, wCoins
ld c, a
ld a, [hli]
and a
@@ -1832,7 +1832,7 @@
jr .loop
.Start:
- ld hl, Coins + 1
+ ld hl, wCoins + 1
ld a, [hl]
sub c
ld [hld], a
@@ -1883,7 +1883,7 @@
; 0x930e9
Slots_AskPlayAgain: ; 930e9 (24:70e9)
- ld hl, Coins
+ ld hl, wCoins
ld a, [hli]
or [hl]
jr nz, .you_have_coins
@@ -1971,7 +1971,7 @@
add hl, de
add hl, de
add hl, de
- ld de, StringBuffer2
+ ld de, wStringBuffer2
ld bc, 4
call CopyBytes
ld a, [hli]
--- a/engine/spawn_points.asm
+++ b/engine/spawn_points.asm
@@ -2,10 +2,10 @@
LoadSpawnPoint: ; 1531f
- ; loads the spawn point in DefaultSpawnpoint
+ ; loads the spawn point in wDefaultSpawnpoint
push hl
push de
- ld a, [DefaultSpawnpoint]
+ ld a, [wDefaultSpawnpoint]
cp SPAWN_N_A
jr z, .spawn_n_a
ld l, a
@@ -15,13 +15,13 @@
ld de, SpawnPoints
add hl, de
ld a, [hli]
- ld [MapGroup], a
+ ld [wMapGroup], a
ld a, [hli]
- ld [MapNumber], a
+ ld [wMapNumber], a
ld a, [hli]
- ld [XCoord], a
+ ld [wXCoord], a
ld a, [hli]
- ld [YCoord], a
+ ld [wYCoord], a
.spawn_n_a
pop de
pop hl
--- a/engine/specials.asm
+++ b/engine/specials.asm
@@ -21,7 +21,7 @@
; c225
Special_SetPlayerPalette: ; c225
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld d, a
farcall SetPlayerPalette
ret
@@ -28,15 +28,15 @@
; c230
Special_GameCornerPrizeMonCheckDex: ; c230
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
dec a
call CheckCaughtMon
ret nz
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
dec a
call SetSeenAndCaughtMon
call FadeToMenu
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld [wd265], a
farcall NewPokedexEntry
call ExitAllMenus
@@ -44,7 +44,7 @@
; c252
UnusedSpecial_SeenMon: ; c252
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
dec a
call SetSeenMon
ret
@@ -51,7 +51,7 @@
; c25a
Special_FindGreaterThanThatLevel: ; c25a
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld b, a
farcall _FindGreaterThanThatLevel
jr z, FoundNone
@@ -58,7 +58,7 @@
jr FoundOne
Special_FindAtLeastThatHappy: ; c268
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld b, a
farcall _FindAtLeastThatHappy
jr z, FoundNone
@@ -65,7 +65,7 @@
jr FoundOne
Special_FindThatSpecies: ; c276
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld b, a
farcall _FindThatSpecies
jr z, FoundNone
@@ -72,7 +72,7 @@
jr FoundOne
Special_FindThatSpeciesYourTrainerID: ; c284
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld b, a
farcall _FindThatSpeciesYourTrainerID
jr z, FoundNone
@@ -80,21 +80,21 @@
FoundOne: ; c292
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
FoundNone: ; c298
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; c29d
Special_NameRival: ; 0xc29d
ld b, $2 ; rival
- ld de, RivalName
+ ld de, wRivalName
farcall _NamingScreen
; default to "SILVER"
- ld hl, RivalName
+ ld hl, wRivalName
ld de, DefaultRivalName
call InitName
ret
@@ -131,10 +131,10 @@
Special_KrissHousePC: ; c2e7
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
farcall _KrissHousePC
ld a, c
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; c2f6
@@ -147,7 +147,7 @@
inc a
.no
- ld [ScriptVar], a
+ ld [wScriptVar], a
call CloseSRAM
ret
; c309
@@ -156,28 +156,28 @@
ld a, BANK(sMysteryGiftItem)
call GetSRAMBank
ld a, [sMysteryGiftItem]
- ld [CurItem], a
+ ld [wCurItem], a
ld a, 1
ld [wItemQuantityChangeBuffer], a
- ld hl, NumItems
+ ld hl, wNumItems
call ReceiveItem
jr nc, .no_room
xor a
ld [sMysteryGiftItem], a
call CloseSRAM
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [wd265], a
call GetItemName
ld hl, .ReceiveItemText
call PrintText
ld a, TRUE
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.no_room
call CloseSRAM
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; c345
@@ -190,12 +190,12 @@
Special_BugContestJudging: ; c34a
farcall _BugContestJudging
ld a, b
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; c355
Special_MapRadio: ; c355
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld e, a
farcall PlayRadio
ret
@@ -205,7 +205,7 @@
call FadeToMenu
farcall UnownPuzzle
ld a, [wSolvedUnownPuzzle]
- ld [ScriptVar], a
+ ld [wScriptVar], a
call ExitAllMenus
ret
; c373
@@ -253,13 +253,13 @@
; c3ae
Special_CheckCoins: ; c3ae
- ld hl, Coins
+ ld hl, wCoins
ld a, [hli]
or [hl]
jr z, .no_coins
ld a, COIN_CASE
- ld [CurItem], a
- ld hl, NumItems
+ ld [wCurItem], a
+ ld hl, wNumItems
call CheckItem
jr nc, .no_coin_case
and a
@@ -299,11 +299,11 @@
ScriptReturnCarry: ; c3e2
jr c, .carry
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.carry
ld a, 1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; c3ef
@@ -310,12 +310,12 @@
UnusedSpecial_CheckUnusedTwoDayTimer: ; c3ef
farcall CheckUnusedTwoDayTimer
ld a, [wUnusedTwoDayTimer]
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; c3fc
Special_ActivateFishingSwarm: ; c3fc
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld [wFishingSwarmFlag], a
ret
; c403
@@ -365,7 +365,7 @@
; next to Snorlax.
; outputs:
-; ScriptVar is 1 if the conditions are met, otherwise 0.
+; wScriptVar is 1 if the conditions are met, otherwise 0.
; check background music
ld a, [wMapMusic]
@@ -372,9 +372,9 @@
cp MUSIC_POKE_FLUTE_CHANNEL
jr nz, .nope
- ld a, [XCoord]
+ ld a, [wXCoord]
ld b, a
- ld a, [YCoord]
+ ld a, [wYCoord]
ld c, a
ld hl, .ProximityCoords
@@ -398,7 +398,7 @@
.nope
xor a
.done
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.ProximityCoords:
@@ -412,7 +412,7 @@
Special_PlayCurMonCry: ; c472
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
jp PlayMonCry
; c478
@@ -435,17 +435,17 @@
.cgb
ld a, GBCHECK_CGB
.done
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
Special_FadeOutMusic: ; c48f
ld a, LOW(MUSIC_NONE)
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, HIGH(MUSIC_NONE)
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld a, $2
- ld [MusicFade], a
+ ld [wMusicFade], a
ret
; c49f
@@ -467,5 +467,5 @@
ld a, BANK(sMysteryGiftTrainerHouseFlag)
call GetSRAMBank
ld a, [sMysteryGiftTrainerHouseFlag]
- ld [ScriptVar], a
+ ld [wScriptVar], a
jp CloseSRAM
--- a/engine/sprites.asm
+++ b/engine/sprites.asm
@@ -23,7 +23,7 @@
push bc
push af
- ld a, LOW(Sprites)
+ ld a, LOW(wVirtualOAM)
ld [wCurrSpriteOAMAddr], a
call DoNextFrameForAllSprites
@@ -60,11 +60,11 @@
ld a, [wCurrSpriteOAMAddr]
ld l, a
- ld h, HIGH(Sprites)
+ ld h, HIGH(wVirtualOAM)
-.loop2 ; Clear (Sprites + [wCurrSpriteOAMAddr] --> SpritesEnd)
+.loop2 ; Clear (wVirtualOAM + [wCurrSpriteOAMAddr] --> wVirtualOAMEnd)
ld a, l
- cp LOW(SpritesEnd)
+ cp LOW(wVirtualOAMEnd)
jr nc, .done
xor a
ld [hli], a
@@ -100,11 +100,11 @@
ld a, [wCurrSpriteOAMAddr]
ld l, a
- ld h, HIGH(Sprite17)
+ ld h, HIGH(wVirtualOAMSprite16)
-.loop2 ; Clear (Sprites + [wCurrSpriteOAMAddr] --> Sprites + $40)
+.loop2 ; Clear (wVirtualOAM + [wCurrSpriteOAMAddr] --> Sprites + $40)
ld a, l
- cp LOW(Sprite17)
+ cp LOW(wVirtualOAMSprite16)
jr nc, .done
xor a
ld [hli], a
@@ -253,7 +253,7 @@
push bc
ld a, [wCurrSpriteOAMAddr]
ld e, a
- ld d, HIGH(Sprites)
+ ld d, HIGH(wVirtualOAM)
ld a, [hli]
ld c, a ; number of objects
.loop
@@ -302,7 +302,7 @@
inc de
ld a, e
ld [wCurrSpriteOAMAddr], a
- cp LOW(SpritesEnd)
+ cp LOW(wVirtualOAMEnd)
jr nc, .reached_the_end
dec c
jr nz, .loop
@@ -649,7 +649,7 @@
; 8e7c6
.AnimateFrame: ; 8e7c6
- ld hl, Sprite01
+ ld hl, wVirtualOAMSprite00
ld c, 8 ; number of animated circles
.anim_loop
ld a, c
--- a/engine/start_menu.asm
+++ b/engine/start_menu.asm
@@ -88,7 +88,7 @@
call .DrawMenuAccount
call SetUpMenu
ld a, $ff
- ld [MenuSelection], a
+ ld [wMenuSelection], a
.loop
call .PrintMenuAccount
call GetScrollingMenuJoypad
@@ -166,7 +166,7 @@
.MenuData:
db STATICMENU_CURSOR | STATICMENU_WRAP | STATICMENU_ENABLE_START ; flags
dn 0, 0 ; rows, columns
- dw MenuItemsList
+ dw wMenuItemsList
dw .MenuString
dw .Items
@@ -220,7 +220,7 @@
.OpenMenu: ; 127e5
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
call .GetMenuAccountTextPointer
ld a, [hli]
ld h, [hl]
@@ -230,7 +230,7 @@
.MenuString: ; 127ef
push de
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
call .GetMenuAccountTextPointer
inc hl
inc hl
@@ -244,7 +244,7 @@
.MenuDesc: ; 12800
push de
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp $ff
jr z, .none
call .GetMenuAccountTextPointer
@@ -289,7 +289,7 @@
call .AppendMenuList
.no_pokedex
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
jr z, .no_pokemon
ld a, 1 ; pokemon
@@ -333,7 +333,7 @@
ld a, 6 ; exit
call .AppendMenuList
ld a, c
- ld [MenuItemsList], a
+ ld [wMenuItemsList], a
ret
; 1288d
@@ -340,12 +340,12 @@
.FillMenuList: ; 1288d
xor a
- ld hl, MenuItemsList
+ ld hl, wMenuItemsList
ld [hli], a
ld a, -1
- ld bc, MenuItemsListEnd - (MenuItemsList + 1)
+ ld bc, wMenuItemsListEnd - (wMenuItemsList + 1)
call ByteFill
- ld de, MenuItemsList + 1
+ ld de, wMenuItemsList + 1
ld c, 0
ret
; 128a0
@@ -382,7 +382,7 @@
; 128cb
.IsMenuAccountOn: ; 128cb
- ld a, [Options2]
+ ld a, [wOptions2]
and 1
ret
; 128d1
@@ -473,7 +473,7 @@
StartMenu_Pokedex: ; 12937
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
jr z, .asm_12949
@@ -517,7 +517,7 @@
StartMenu_Pokemon: ; 12976
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
jr z, .return
@@ -525,7 +525,7 @@
.choosemenu
xor a
- ld [PartyMenuActionText], a ; Choose a POKéMON.
+ ld [wPartyMenuActionText], a ; Choose a POKéMON.
call ClearBGPalettes
.menu
@@ -566,16 +566,16 @@
; 129d5
HasNoItems: ; 129d5
- ld a, [NumItems]
+ ld a, [wNumItems]
and a
ret nz
- ld a, [NumKeyItems]
+ ld a, [wNumKeyItems]
and a
ret nz
- ld a, [NumBalls]
+ ld a, [wNumBalls]
and a
ret nz
- ld hl, TMsHMs
+ ld hl, wTMsHMs
ld b, NUM_TMS + NUM_HMS
.loop
ld a, [hli]
@@ -612,7 +612,7 @@
pop af
jr c, .quit
pop hl
- ld a, [CurItemQuantity]
+ ld a, [wCurItemQuantity]
call TossItem
call PartyMonItemName
ld hl, .TossedThisMany
@@ -667,7 +667,7 @@
PartyMonItemName: ; 12a6c
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [wd265], a
call GetItemName
call CopyName1
@@ -689,7 +689,7 @@
call ClearBox
farcall MonSubmenu
call GetCurNick
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld hl, .Actions
ld de, 3
call IsInArray
@@ -732,11 +732,11 @@
SwitchPartyMons: ; 12aec
; Don't try if there's nothing to switch!
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp 2
jr c, .DontSwitch
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
inc a
ld [wSwitchMon], a
@@ -744,7 +744,7 @@
farcall InitPartyMenuNoCancel
ld a, PARTYMENUACTION_MOVE
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
farcall WritePartyMenuTilemap
farcall PrintPartyMenuText
@@ -765,7 +765,7 @@
farcall _SwitchPartyMons
xor a
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
farcall LoadPartyMenuGFX
farcall InitPartyMenuWithCancel
@@ -776,7 +776,7 @@
.DontSwitch:
xor a
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
call CancelPokemonAction
ret
; 12b60
@@ -785,7 +785,7 @@
GiveTakePartyMonItem: ; 12b60
; Eggs can't hold items!
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .cancel
@@ -796,7 +796,7 @@
jr c, .cancel
call GetCurNick
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wMonOrItemNameBuffer
ld bc, MON_NAME_LENGTH
call CopyBytes
@@ -896,10 +896,10 @@
call GiveItemToPokemon
ld a, [wd265]
push af
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [wd265], a
pop af
- ld [CurItem], a
+ ld [wCurItem], a
call ReceiveItemFromPokemon
jr nc, .bag_full
@@ -906,13 +906,13 @@
ld hl, TookAndMadeHoldText
call MenuTextBoxBackup
ld a, [wd265]
- ld [CurItem], a
+ ld [wCurItem], a
call GivePartyItem
ret
.bag_full
ld a, [wd265]
- ld [CurItem], a
+ ld [wCurItem], a
call ReceiveItemFromPokemon
ld hl, ItemStorageIsFullText
call MenuTextBoxBackup
@@ -925,7 +925,7 @@
GivePartyItem: ; 12c4c
call GetPartyItemLocation
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [hl], a
ld d, a
farcall ItemIsMail
@@ -945,7 +945,7 @@
and a
jr z, .asm_12c8c
- ld [CurItem], a
+ ld [wCurItem], a
call ReceiveItemFromPokemon
jr nc, .asm_12c94
@@ -1040,7 +1040,7 @@
ReceiveItemFromPokemon: ; 12cdf
ld a, $1
ld [wItemQuantityChangeBuffer], a
- ld hl, NumItems
+ ld hl, wNumItems
jp ReceiveItem
; 12cea
@@ -1048,7 +1048,7 @@
GiveItemToPokemon: ; 12cea (4:6cea)
ld a, $1
ld [wItemQuantityChangeBuffer], a
- ld hl, NumItems
+ ld hl, wNumItems
jp TossItem
StartMenuYesNo: ; 12cf5
@@ -1061,19 +1061,19 @@
ComposeMailMessage: ; 12cfe (4:6cfe)
ld de, wTempMailMessage
farcall _ComposeMailMessage
- ld hl, PlayerName
+ ld hl, wPlayerName
ld de, wTempMailAuthor
ld bc, NAME_LENGTH - 1
call CopyBytes
- ld hl, PlayerID
+ ld hl, wPlayerID
ld bc, 2
call CopyBytes
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld [de], a
inc de
- ld a, [CurItem]
+ ld a, [wCurItem]
ld [de], a
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld hl, sPartyMail
ld bc, MAIL_STRUCT_LENGTH
call AddNTimes
@@ -1121,7 +1121,7 @@
ld hl, .sendmailtopctext
call StartMenuYesNo
jr c, .RemoveMailToBag
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld b, a
farcall SendMailToPC
jr c, .MailboxFull
@@ -1140,7 +1140,7 @@
jr c, .done
call GetPartyItemLocation
ld a, [hl]
- ld [CurItem], a
+ ld [wCurItem], a
call ReceiveItemFromPokemon
jr nc, .BagIsFull
call GetPartyItemLocation
@@ -1219,7 +1219,7 @@
call ClearSprites
; PartyMon
xor a
- ld [MonType], a
+ ld [wMonType], a
call LowVolume
predef StatsScreenInit
call MaxVolume
@@ -1379,7 +1379,7 @@
.finish
xor a
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
ld a, $3
ret
; 12f00
@@ -1448,7 +1448,7 @@
; 12f5b
ChooseMoveToDelete: ; 12f5b
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -1456,7 +1456,7 @@
call .ChooseMoveToDelete
pop bc
ld a, b
- ld [Options], a
+ ld [wOptions], a
push af
call ClearBGPalettes
pop af
@@ -1513,16 +1513,16 @@
; 12fba
ManagePokemonMoves: ; 12fba
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
call MoveScreenLoop
pop af
- ld [Options], a
+ ld [wOptions], a
call ClearBGPalettes
.egg
@@ -1531,7 +1531,7 @@
; 12fd5
MoveScreenLoop: ; 12fd5
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
inc a
ld [wPartyMenuCursor], a
call SetUpMoveScreenBG
@@ -1597,12 +1597,12 @@
and a
jp nz, .joy_loop
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld b, a
push bc
call .cycle_right
pop bc
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
cp b
jp z, .joy_loop
jp MoveScreenLoop
@@ -1611,23 +1611,23 @@
ld a, [wMoveSwapBuffer]
and a
jp nz, .joy_loop
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld b, a
push bc
call .cycle_left
pop bc
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
cp b
jp z, .joy_loop
jp MoveScreenLoop
.cycle_right
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
inc a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld c, a
ld b, 0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, bc
ld a, [hl]
cp -1
@@ -1637,21 +1637,21 @@
jr .cycle_right
.cycle_left
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
and a
ret z
.cycle_left_loop
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld c, a
ld b, 0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, bc
ld a, [hl]
cp EGG
ret nz
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
and a
jr z, .cycle_right
jr .cycle_left_loop
@@ -1669,9 +1669,9 @@
jp .moving_move
.place_move
- ld hl, PartyMon1Moves
+ ld hl, wPartyMon1Moves
ld bc, PARTYMON_STRUCT_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
push hl
call .copy_move
@@ -1681,9 +1681,9 @@
call .copy_move
ld a, [wBattleMode]
jr z, .swap_moves
- ld hl, BattleMonMoves
+ ld hl, wBattleMonMoves
ld bc, $20
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
push hl
call .copy_move
@@ -1760,10 +1760,10 @@
ld [hBGMapMode], a
farcall LoadStatsScreenPageTilesGFX
farcall ClearSpriteAnims2
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld e, a
ld d, $0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, de
ld a, [hl]
ld [wd265], a
@@ -1781,9 +1781,9 @@
lb bc, 2, 3
call ClearBox
xor a
- ld [MonType], a
- ld hl, PartyMonNicknames
- ld a, [CurPartyMon]
+ ld [wMonType], a
+ ld hl, wPartyMonNicknames
+ ld a, [wCurPartyMon]
call GetNick
hlcoord 5, 1
call PlaceString
@@ -1791,7 +1791,7 @@
farcall CopyPkmnToTempMon
pop hl
call PrintLevel
- ld hl, PlayerHPPal
+ ld hl, wPlayerHPPal
call SetHPPal
ld b, SCGB_MOVE_LIST
call GetSGBLayout
@@ -1804,14 +1804,14 @@
xor a
ld [hBGMapMode], a
ld [wMoveSwapBuffer], a
- ld [MonType], a
+ ld [wMonType], a
predef CopyPkmnToTempMon
- ld hl, TempMonMoves
+ ld hl, wTempMonMoves
ld de, wListMoves_MoveIndicesBuffer
ld bc, NUM_MOVES
call CopyBytes
ld a, SCREEN_WIDTH * 2
- ld [Buffer1], a
+ ld [wBuffer1], a
hlcoord 2, 3
predef ListMoves
hlcoord 10, 4
@@ -1828,9 +1828,9 @@
; 13235
PrepareToPlaceMoveData: ; 13235
- ld hl, PartyMon1Moves
+ ld hl, wPartyMon1Moves
ld bc, PARTYMON_STRUCT_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld a, [wMenuCursorY]
dec a
@@ -1838,7 +1838,7 @@
ld b, $0
add hl, bc
ld a, [hl]
- ld [CurMove], a
+ ld [wCurMove], a
hlcoord 1, 12
lb bc, 5, 18
jp ClearBox
@@ -1856,11 +1856,11 @@
hlcoord 12, 12
ld de, String_132ca
call PlaceString
- ld a, [CurMove]
+ ld a, [wCurMove]
ld b, a
hlcoord 2, 12
predef PrintMoveType
- ld a, [CurMove]
+ ld a, [wCurMove]
dec a
ld hl, Moves + MOVE_POWER
ld bc, MOVE_LENGTH
@@ -1908,13 +1908,13 @@
; 132da
Function132da: ; 132da
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
and a
ret z
ld c, a
ld e, a
ld d, 0
- ld hl, PartyCount
+ ld hl, wPartyCount
add hl, de
.loop
ld a, [hl]
@@ -1938,15 +1938,15 @@
; 132fe
Function132fe: ; 132fe
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
inc a
ld c, a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp c
ret z
ld e, c
ld d, 0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, de
.loop
ld a, [hl]
--- a/engine/stats_screen.asm
+++ b/engine/stats_screen.asm
@@ -156,7 +156,7 @@
call ClearTileMap
farcall HDMATransferTileMapToWRAMBank3
call StatsScreen_CopyToTempMon
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
call StatsScreen_InitUpperHalf
@@ -227,14 +227,14 @@
ret
StatsScreen_CopyToTempMon: ; 4ddf2 (13:5df2)
- ld a, [MonType]
+ ld a, [wMonType]
cp TEMPMON
jr nz, .breedmon
ld a, [wBufferMon]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
ld hl, wBufferMon
- ld de, TempMon
+ ld de, wTempMon
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
jr .done
@@ -241,10 +241,10 @@
.breedmon
farcall CopyPkmnToTempMon
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .done
- ld a, [MonType]
+ ld a, [wMonType]
cp BOXMON
jr c, .done
farcall CalcTempmonStats
@@ -254,7 +254,7 @@
StatsScreen_GetJoypad: ; 4de2c (13:5e2c)
call GetJoypad
- ld a, [MonType]
+ ld a, [wMonType]
cp TEMPMON
jr nz, .notbreedmon
push hl
@@ -301,22 +301,22 @@
jr .done
.d_down
- ld a, [MonType]
+ ld a, [wMonType]
cp BOXMON
jr nc, .done
and a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
jr z, .next_mon
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
.next_mon
ld b, a
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
inc a
cp b
jr z, .done
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld b, a
- ld a, [MonType]
+ ld a, [wMonType]
and a
jr nz, .load_mon
ld a, b
@@ -325,13 +325,13 @@
jr .load_mon
.d_up
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
and a
jr z, .done
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld b, a
- ld a, [MonType]
+ ld a, [wMonType]
and a
jr nz, .load_mon
ld a, b
@@ -383,9 +383,9 @@
call .PlaceHPBar
xor a
ld [hBGMapMode], a
- ld a, [BaseDexNo]
+ ld a, [wBaseDexNo]
ld [wd265], a
- ld [CurSpecies], a
+ ld [wCurSpecies], a
hlcoord 8, 0
ld [hl], "№"
inc hl
@@ -407,7 +407,7 @@
hlcoord 9, 4
ld a, "/"
ld [hli], a
- ld a, [BaseDexNo]
+ ld a, [wBaseDexNo]
ld [wd265], a
call GetPokemonName
call PlaceString
@@ -417,11 +417,11 @@
ret
.PlaceHPBar: ; 4df45 (13:5f45)
- ld hl, TempMonHP
+ ld hl, wTempMonHP
ld a, [hli]
ld b, a
ld c, [hl]
- ld hl, TempMonMaxHP
+ ld hl, wTempMonMaxHP
ld a, [hli]
ld d, a
ld e, [hl]
@@ -447,8 +447,8 @@
; 4df77 (13:5f77)
.NicknamePointers: ; 4df77
- dw PartyMonNicknames
- dw OTPartyMonNicknames
+ dw wPartyMonNicknames
+ dw wOTPartyMonNicknames
dw sBoxMonNicknames
dw wBufferMonNick
; 4df7f
@@ -484,7 +484,7 @@
ret
StatsScreen_PlaceShinyIcon: ; 4dfa6 (13:5fa6)
- ld bc, TempMonDVs
+ ld bc, wTempMonDVs
farcall CheckShininess
ret nc
hlcoord 19, 0
@@ -492,9 +492,9 @@
ret
StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6)
- ld a, [BaseDexNo]
+ ld a, [wBaseDexNo]
ld [wd265], a
- ld [CurSpecies], a
+ ld [wCurSpecies], a
xor a
ld [hBGMapMode], a
call .ClearBox
@@ -553,7 +553,7 @@
ld de, .Status_Type
hlcoord 0, 12
call PlaceString
- ld a, [TempMonPokerusStatus]
+ ld a, [wTempMonPokerusStatus]
ld b, a
and $f
jr nz, .HasPokerus
@@ -563,12 +563,12 @@
hlcoord 8, 8
ld [hl], "." ; Pokérus immunity dot
.NotImmuneToPkrs:
- ld a, [MonType]
+ ld a, [wMonType]
cp BOXMON
jr z, .StatusOK
hlcoord 6, 13
push hl
- ld de, TempMonStatus
+ ld de, wTempMonStatus
predef PlaceStatusString
pop hl
jr nz, .done_status
@@ -600,12 +600,12 @@
call .PrintNextLevel
hlcoord 13, 10
lb bc, 3, 7
- ld de, TempMonExp
+ ld de, wTempMonExp
call PrintNum
call .CalcExpToNextLevel
hlcoord 13, 13
lb bc, 3, 7
- ld de, Buffer1
+ ld de, wBuffer1
call PrintNum
ld de, .LevelUpStr
hlcoord 10, 12
@@ -614,9 +614,9 @@
hlcoord 14, 14
call PlaceString
hlcoord 11, 16
- ld a, [TempMonLevel]
+ ld a, [wTempMonLevel]
ld b, a
- ld de, TempMonExp + 2
+ ld de, wTempMonExp + 2
predef FillInExpBar
hlcoord 10, 16
ld [hl], $40 ; left exp bar end cap
@@ -625,42 +625,42 @@
ret
.PrintNextLevel: ; 4e0d3 (13:60d3)
- ld a, [TempMonLevel]
+ ld a, [wTempMonLevel]
push af
cp MAX_LEVEL
jr z, .AtMaxLevel
inc a
- ld [TempMonLevel], a
+ ld [wTempMonLevel], a
.AtMaxLevel:
call PrintLevel
pop af
- ld [TempMonLevel], a
+ ld [wTempMonLevel], a
ret
.CalcExpToNextLevel: ; 4e0e7 (13:60e7)
- ld a, [TempMonLevel]
+ ld a, [wTempMonLevel]
cp MAX_LEVEL
jr z, .AlreadyAtMaxLevel
inc a
ld d, a
farcall CalcExpAtLevel
- ld hl, TempMonExp + 2
- ld hl, TempMonExp + 2
+ ld hl, wTempMonExp + 2
+ ld hl, wTempMonExp + 2
ld a, [hQuotient + 2]
sub [hl]
dec hl
- ld [Buffer3], a
+ ld [wBuffer3], a
ld a, [hQuotient + 1]
sbc [hl]
dec hl
- ld [Buffer2], a
+ ld [wBuffer2], a
ld a, [hQuotient]
sbc [hl]
- ld [Buffer1], a
+ ld [wBuffer1], a
ret
.AlreadyAtMaxLevel:
- ld hl, Buffer1
+ ld hl, wBuffer1
xor a
ld [hli], a
ld [hli], a
@@ -703,23 +703,23 @@
ld de, .Move
hlcoord 0, 10
call PlaceString
- ld hl, TempMonMoves
+ ld hl, wTempMonMoves
ld de, wListMoves_MoveIndicesBuffer
ld bc, NUM_MOVES
call CopyBytes
hlcoord 8, 10
ld a, SCREEN_WIDTH * 2
- ld [Buffer1], a
+ ld [wBuffer1], a
predef ListMoves
hlcoord 12, 11
ld a, SCREEN_WIDTH * 2
- ld [Buffer1], a
+ ld [wBuffer1], a
predef ListMovePP
ret
.GetItemName: ; 4e189 (13:6189)
ld de, .ThreeDashes
- ld a, [TempMonItem]
+ ld a, [wTempMonItem]
and a
ret z
ld b, a
@@ -767,7 +767,7 @@
call PlaceString
hlcoord 2, 10
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
- ld de, TempMonID
+ ld de, wTempMonID
call PrintNum
ld hl, .OTNamePointers
call GetNicknamePointer
@@ -775,7 +775,7 @@
farcall CheckNickErrors
hlcoord 2, 13
call PlaceString
- ld a, [TempMonCaughtGender]
+ ld a, [wTempMonCaughtGender]
and a
jr z, .done
cp $7f
@@ -792,8 +792,8 @@
; 4e216 (13:6216)
.OTNamePointers: ; 4e216
- dw PartyMonOT
- dw OTPartyMonOT
+ dw wPartyMonOT
+ dw wOTPartyMonOT
dw sBoxMonOT
dw wBufferMonOT
; 4e21e
@@ -807,7 +807,7 @@
StatsScreen_PlaceFrontpic: ; 4e226 (13:6226)
- ld hl, TempMonDVs
+ ld hl, wTempMonDVs
predef GetUnownLetter
call StatsScreen_GetAnimationParam
jr c, .egg
@@ -828,7 +828,7 @@
.cry
call SetPalettes
call .AnimateMon
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call PlayMonCry2
ret
@@ -835,7 +835,7 @@
.AnimateMon: ; 4e253 (13:6253)
ld hl, wcf64
set 5, [hl]
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp UNOWN
jr z, .unown
hlcoord 0, 0
@@ -850,7 +850,7 @@
ret
.AnimateEgg: ; 4e271 (13:6271)
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp UNOWN
jr z, .unownegg
ld a, TRUE
@@ -865,7 +865,7 @@
ret
.get_animation ; 4e289 (13:6289)
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call IsAPokemon
ret c
call StatsScreen_LoadTextBoxSpaceGFX
@@ -880,7 +880,7 @@
ret
StatsScreen_GetAnimationParam: ; 4e2ad (13:62ad)
- ld a, [MonType]
+ ld a, [wMonType]
ld hl, .Jumptable
rst JumpTable
ret
@@ -893,8 +893,8 @@
dw .Wildmon
.PartyMon: ; 4e2bf (13:62bf)
- ld a, [CurPartyMon]
- ld hl, PartyMon1
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
ld b, h
@@ -908,7 +908,7 @@
.BoxMon: ; 4e2d1 (13:62d1)
ld hl, sBoxMons
ld bc, PARTYMON_STRUCT_LENGTH
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
ld b, h
ld c, l
@@ -921,11 +921,11 @@
ret
.Tempmon: ; 4e2ed (13:62ed)
- ld bc, TempMonSpecies
+ ld bc, wTempMonSpecies
jr .CheckEggFaintedFrzSlp ; utterly pointless
.CheckEggFaintedFrzSlp: ; 4e2f2 (13:62f2)
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
call CheckFaintedFrzSlp
@@ -996,7 +996,7 @@
ld de, FiveQMarkString
hlcoord 11, 5
call PlaceString
- ld a, [TempMonHappiness] ; egg status
+ ld a, [wTempMonHappiness] ; egg status
ld de, EggSoonString
cp $6
jr c, .picked
@@ -1019,7 +1019,7 @@
farcall HDMATransferTileMapToWRAMBank3
call StatsScreen_AnimateEgg
- ld a, [TempMonHappiness]
+ ld a, [wTempMonHappiness]
cp 6
ret nc
ld de, SFX_2_BOOPS
@@ -1059,7 +1059,7 @@
StatsScreen_AnimateEgg: ; 4e497 (13:6497)
call StatsScreen_GetAnimationParam
ret nc
- ld a, [TempMonHappiness]
+ ld a, [wTempMonHappiness]
ld e, $7
cp 6
jr c, .animate
@@ -1116,11 +1116,11 @@
ret
CopyNickname: ; 4e505 (13:6505)
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld bc, MON_NAME_LENGTH
jr .okay ; utterly pointless
.okay
- ld a, [MonType]
+ ld a, [wMonType]
cp BOXMON
jr nz, .partymon
ld a, BANK(sBoxMonNicknames)
@@ -1138,7 +1138,7 @@
ret
GetNicknamePointer: ; 4e528 (13:6528)
- ld a, [MonType]
+ ld a, [wMonType]
add a
ld c, a
ld b, 0
@@ -1146,10 +1146,10 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [MonType]
+ ld a, [wMonType]
cp TEMPMON
ret z
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
jp SkipNames
--- a/engine/tempmon.asm
+++ b/engine/tempmon.asm
@@ -1,20 +1,20 @@
CopyPkmnToTempMon: ; 5084a
; gets the BaseData of a Pkmn
-; and copys the PkmnStructure to TempMon
+; and copys the PkmnStructure to wTempMon
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld e, a
call GetPkmnSpecies
- ld a, [CurPartySpecies]
- ld [CurSpecies], a
+ ld a, [wCurPartySpecies]
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [MonType]
- ld hl, PartyMon1Species
+ ld a, [wMonType]
+ ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
and a
jr z, .copywholestruct
- ld hl, OTPartyMon1Species
+ ld hl, wOTPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
cp OTPARTYMON
jr z, .copywholestruct
@@ -23,9 +23,9 @@
jr .done
.copywholestruct
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call AddNTimes
- ld de, TempMon
+ ld de, wTempMon
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
@@ -37,12 +37,12 @@
jr _TempMonStatsCalculation
CalcTempmonStats: ; 50890
- ld bc, TempMon
+ ld bc, wTempMon
_TempMonStatsCalculation: ; 50893
ld hl, MON_LEVEL
add hl, bc
ld a, [hl]
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld hl, MON_MAXHP
add hl, bc
ld d, h
@@ -57,7 +57,7 @@
add hl, bc
ld d, h
ld e, l
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr nz, .not_egg
xor a
@@ -83,10 +83,10 @@
ret
GetPkmnSpecies: ; 508d5
-; [MonType] has the type of the Pkmn
-; e = Nr. of Pkmn (i.e. [CurPartyMon])
+; [wMonType] has the type of the Pkmn
+; e = Nr. of Pkmn (i.e. [wCurPartyMon])
- ld a, [MonType]
+ ld a, [wMonType]
and a ; PARTYMON
jr z, .partymon
cp OTPARTYMON
@@ -98,11 +98,11 @@
; WILDMON
.partymon
- ld hl, PartySpecies
+ ld hl, wPartySpecies
jr .done
.otpartymon
- ld hl, OTPartySpecies
+ ld hl, wOTPartySpecies
jr .done
.boxmon
@@ -123,5 +123,5 @@
ld a, [hl]
.done2
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ret
--- a/engine/tile_events.asm
+++ b/engine/tile_events.asm
@@ -1,6 +1,6 @@
CheckWarpCollision:: ; 1499a
; Is this tile a warp?
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
cp COLL_PIT
jr z, .warp
cp COLL_PIT_68
@@ -19,7 +19,7 @@
CheckDirectionalWarp:: ; 149af
; If this is a directional warp, clear carry (press the designated button to warp).
; Else, set carry (immediate warp).
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
cp COLL_WARP_CARPET_DOWN
jr z, .directional
cp COLL_WARP_CARPET_LEFT
@@ -39,7 +39,7 @@
CheckWarpFacingDown: ; 149c6
ld de, 1
ld hl, .blocks
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
call IsInArray
ret
; 149d3
@@ -58,7 +58,7 @@
; 149dd
CheckGrassCollision:: ; 149dd
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
ld hl, .blocks
ld de, 1
call IsInArray
@@ -98,7 +98,7 @@
; 14a07
GetWarpSFX:: ; 14a07
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
ld de, SFX_ENTER_DOOR
cp COLL_DOOR
ret z
--- a/engine/tileset_anims.asm
+++ b/engine/tileset_anims.asm
@@ -4,9 +4,9 @@
; Typically in wra1, vra0
- ld a, [TilesetAnim]
+ ld a, [wTilesetAnim]
ld e, a
- ld a, [TilesetAnim + 1]
+ ld a, [wTilesetAnim + 1]
ld d, a
ld a, [hTileAnimFrame]
@@ -301,10 +301,10 @@
; fc2ff
StandingTileFrame8: ; fc2ff
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
inc a
and %111
- ld [TileAnimationTimer], a
+ ld [wTileAnimationTimer], a
ret
; fc309
@@ -311,10 +311,10 @@
ScrollTileRightLeft: ; fc309
; Scroll right for 4 ticks, then left for 4 ticks.
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
inc a
and %111
- ld [TileAnimationTimer], a
+ ld [wTileAnimationTimer], a
and %100
jr nz, ScrollTileLeft
jr ScrollTileRight
@@ -322,10 +322,10 @@
ScrollTileUpDown: ; fc318
; Scroll up for 4 ticks, then down for 4 ticks.
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
inc a
and %111
- ld [TileAnimationTimer], a
+ ld [wTileAnimationTimer], a
and %100
jr nz, ScrollTileDown
jr ScrollTileUp
@@ -423,7 +423,7 @@
ld b, h
ld c, l
ld hl, .frames
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
and %111
add a
add l
@@ -465,7 +465,7 @@
ld b, h
ld c, l
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
; 4 tile graphics, updated every other frame.
and %110
@@ -481,7 +481,7 @@
adc HIGH(WaterTileFrames)
ld h, a
-; Stack now points to the start of the tile for this frame.
+; The stack now points to the start of the tile for this frame.
ld sp, hl
ld l, e
@@ -508,7 +508,7 @@
jr .asm_fc47d
.asm_fc46c
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
call GetForestTreeFrame
add a
add a
@@ -550,7 +550,7 @@
jr .asm_fc4eb
.asm_fc4d4
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
call GetForestTreeFrame
add a
add a
@@ -585,7 +585,7 @@
jr .asm_fc515
.asm_fc502
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
call GetForestTreeFrame
xor 2
add a
@@ -617,7 +617,7 @@
jr .asm_fc545
.asm_fc52c
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
call GetForestTreeFrame
xor 2
add a
@@ -675,7 +675,7 @@
ld c, l
; Alternate tile graphic every other frame
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
and %10
ld e, a
@@ -709,7 +709,7 @@
ld hl, sp+0
ld b, h
ld c, l
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
and %110
srl a
inc a
@@ -731,7 +731,7 @@
ld hl, sp+0
ld b, h
ld c, l
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
and %110
add a
add a
@@ -763,7 +763,7 @@
ld b, h
ld c, l
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
and %111
; Get frame index a
@@ -803,7 +803,7 @@
StandingTileFrame: ; fc673
- ld hl, TileAnimationTimer
+ ld hl, wTileAnimationTimer
inc [hl]
ret
; fc678
@@ -833,7 +833,7 @@
; Tile address is now at hl.
; Get the tile for this frame.
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
and %11 ; 4 frames x2
swap a ; * 16 bytes per tile
@@ -845,7 +845,7 @@
adc h
ld h, a
-; Stack now points to the desired frame.
+; The stack now points to the desired frame.
ld sp, hl
ld l, e
@@ -929,7 +929,7 @@
ret nz
; Only update on even frames.
- ld a, [TileAnimationTimer]
+ ld a, [wTileAnimationTimer]
ld l, a
and 1 ; odd
ret nz
--- a/engine/tileset_palettes.asm
+++ b/engine/tileset_palettes.asm
@@ -1,5 +1,5 @@
LoadSpecialMapPalette: ; 494ac
- ld a, [wTileset]
+ ld a, [wMapTileset]
cp TILESET_POKECOM_CENTER
jr z, .pokecom_2f
cp TILESET_BATTLE_TOWER
--- a/engine/time.asm
+++ b/engine/time.asm
@@ -188,13 +188,13 @@
InitializeStartDay: ; 114dd
call UpdateTime
- ld hl, wStartDay
+ ld hl, wTimerEventStartDay
call CopyDayToHL
ret
; 114e7
CheckPokerusTick:: ; 114e7
- ld hl, wStartDay
+ ld hl, wTimerEventStartDay
call CalcDaysSince
call GetDaysSince
and a
@@ -271,15 +271,15 @@
call GetSRAMBank
ld hl, sMysteryGiftTimer
ld a, [hli]
- ld [Buffer1], a
+ ld [wBuffer1], a
ld a, [hl]
- ld [Buffer2], a
+ ld [wBuffer2], a
call CloseSRAM
- ld hl, Buffer1
+ ld hl, wBuffer1
call CheckDayDependentEventHL
jr nc, .not_timed_out
- ld hl, Buffer1
+ ld hl, wBuffer1
call InitOneDayCountdown
call CloseSRAM
farcall Function1050c8
@@ -287,7 +287,7 @@
.not_timed_out
ld a, BANK(sMysteryGiftTimer)
call GetSRAMBank
- ld hl, Buffer1
+ ld hl, wBuffer1
ld a, [hli]
ld [sMysteryGiftTimer], a
ld a, [hl]
@@ -417,7 +417,7 @@
ld [wHoursSince], a ; hours since
_CalcDaysSince:
- ld a, [CurDay]
+ ld a, [wCurDay]
ld c, a
sbc [hl]
jr nc, .skip
@@ -429,7 +429,7 @@
; 11613
CopyDayHourMinSecToHL: ; 11613
- ld a, [CurDay]
+ ld a, [wCurDay]
ld [hli], a
ld a, [hHours]
ld [hli], a
@@ -441,13 +441,13 @@
; 11621
CopyDayToHL: ; 11621
- ld a, [CurDay]
+ ld a, [wCurDay]
ld [hl], a
ret
; 11626
CopyDayHourToHL: ; 11626
- ld a, [CurDay]
+ ld a, [wCurDay]
ld [hli], a
ld a, [hHours]
ld [hli], a
@@ -455,7 +455,7 @@
; 1162e
CopyDayHourMinToHL: ; 1162e
- ld a, [CurDay]
+ ld a, [wCurDay]
ld [hli], a
ld a, [hHours]
ld [hli], a
--- a/engine/time_capsule.asm
+++ b/engine/time_capsule.asm
@@ -2,7 +2,7 @@
ValidateOTTrademon: ; fb57e
ld a, [wd003]
- ld hl, OTPartyMon1Species
+ ld hl, wOTPartyMon1Species
call GetPartyLocation
push hl
ld a, [wd003]
@@ -9,7 +9,7 @@
inc a
ld c, a
ld b, 0
- ld hl, OTPartyCount
+ ld hl, wOTPartyCount
add hl, bc
ld a, [hl]
pop hl
@@ -29,7 +29,7 @@
ld a, [wLinkMode]
cp LINK_TIMECAPSULE
jr nz, .normal
- ld hl, OTPartySpecies
+ ld hl, wOTPartySpecies
ld a, [wd003]
ld c, a
ld b, 0
@@ -43,16 +43,16 @@
cp MAGNETON
jr z, .normal
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
ld hl, wLinkOTPartyMonTypes
add hl, bc
add hl, bc
- ld a, [BaseType1]
+ ld a, [wBaseType1]
cp [hl]
jr nz, .abnormal
inc hl
- ld a, [BaseType2]
+ ld a, [wBaseType2]
cp [hl]
jr nz, .abnormal
@@ -68,7 +68,7 @@
Functionfb5dd: ; fb5dd
ld a, [wd002]
ld d, a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld b, a
ld c, $0
.loop
@@ -77,7 +77,7 @@
jr z, .next
push bc
ld a, c
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
call GetPartyLocation
pop bc
ld a, [hli]
@@ -89,7 +89,7 @@
dec b
jr nz, .loop
ld a, [wd003]
- ld hl, OTPartyMon1HP
+ ld hl, wOTPartyMon1HP
call GetPartyLocation
ld a, [hli]
or [hl]
@@ -104,20 +104,20 @@
PlaceTradePartnerNamesAndParty: ; fb60d
hlcoord 4, 0
- ld de, PlayerName
+ ld de, wPlayerName
call PlaceString
ld a, $14
ld [bc], a
hlcoord 4, 8
- ld de, OTPlayerName
+ ld de, wOTPlayerName
call PlaceString
ld a, $14
ld [bc], a
hlcoord 7, 1
- ld de, PartySpecies
+ ld de, wPartySpecies
call .PlaceSpeciesNames
hlcoord 7, 9
- ld de, OTPartySpecies
+ ld de, wOTPartySpecies
.PlaceSpeciesNames: ; fb634
ld c, $0
.loop
--- a/engine/timeofdaypals.asm
+++ b/engine/timeofdaypals.asm
@@ -4,10 +4,10 @@
UpdateTimeOfDayPal:: ; 8c001
call UpdateTime
- ld a, [TimeOfDay]
- ld [CurTimeOfDay], a
+ ld a, [wTimeOfDay]
+ ld [wCurTimeOfDay], a
call GetTimePalette
- ld [TimeOfDayPal], a
+ ld [wTimeOfDayPal], a
ret
; 8c011
@@ -21,25 +21,25 @@
jr nz, .dontchange
; do we need to bother updating?
- ld a, [TimeOfDay]
- ld hl, CurTimeOfDay
+ ld a, [wTimeOfDay]
+ ld hl, wCurTimeOfDay
cp [hl]
jr z, .dontchange
; if so, the time of day has changed
- ld a, [TimeOfDay]
- ld [CurTimeOfDay], a
+ ld a, [wTimeOfDay]
+ ld [wCurTimeOfDay], a
; get palette id
call GetTimePalette
; same palette as before?
- ld hl, TimeOfDayPal
+ ld hl, wTimeOfDayPal
cp [hl]
jr z, .dontchange
; update palette id
- ld [TimeOfDayPal], a
+ ld [wTimeOfDayPal], a
; save bg palette 7
ld hl, wBGPals1 palette PAL_BG_TEXT
@@ -240,7 +240,7 @@
; 8c117
GetTimePalette: ; 8c117
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
ld e, a
ld d, 0
ld hl, .TimePalettes
@@ -336,7 +336,7 @@
; else: dmg
; index
- ld a, [TimeOfDayPal]
+ ld a, [wTimeOfDayPal]
and %11
; get fade table
--- a/engine/timeset.asm
+++ b/engine/timeset.asm
@@ -11,11 +11,11 @@
ld a, $0
ld [wSpriteUpdatesEnabled], a
ld a, $10
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, LOW(MUSIC_NONE)
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, HIGH(MUSIC_NONE)
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld c, 8
call DelayFrames
call RotateFourPalettesLeft
@@ -72,7 +72,7 @@
jr nc, .SetHourLoop
ld a, [wInitHourBuffer]
- ld [StringBuffer2 + 1], a
+ ld [wStringBuffer2 + 1], a
call .ClearScreen
ld hl, Text_WhatHrs
call PrintText
@@ -102,7 +102,7 @@
jr nc, .SetMinutesLoop
ld a, [wInitMinuteBuffer]
- ld [StringBuffer2 + 2], a
+ ld [wStringBuffer2 + 2], a
call .ClearScreen
ld hl, Text_WhoaMins
call PrintText
@@ -453,7 +453,7 @@
call YesNoBox
jr c, .loop
ld a, [wTempDayOfWeek]
- ld [StringBuffer2], a
+ ld [wStringBuffer2], a
call SetDayOfWeek
call LoadStandardFont
pop af
@@ -534,7 +534,7 @@
; 909f2
.WeekdayStrings: ; 909f2
-; entries correspond to CurDay constants (see constants/wram_constants.asm)
+; entries correspond to wCurDay constants (see constants/wram_constants.asm)
dw .Sunday
dw .Monday
dw .Tuesday
@@ -667,7 +667,7 @@
ld [hl], " "
inc hl
- ld de, StartDay
+ ld de, wStartDay
call .PrintTime
ld [hl], " "
--- a/engine/title.asm
+++ b/engine/title.asm
@@ -162,7 +162,7 @@
ld a, [rSVBK]
push af
- ld a, BANK(LYOverrides)
+ ld a, BANK(wLYOverrides)
ld [rSVBK], a
; Make alternating lines come in from opposite sides
@@ -171,7 +171,7 @@
; see anything until these values are overwritten!)
ld b, 80 / 2 ; alternate for 80 lines
- ld hl, LYOverrides
+ ld hl, wLYOverrides
.loop
; $00 is the middle position
ld [hl], +112 ; coming from the left
@@ -182,9 +182,9 @@
jr nz, .loop
; Make sure the rest of the buffer is empty
- ld hl, LYOverrides + 80
+ ld hl, wLYOverrides + 80
xor a
- ld bc, LYOverridesEnd - (LYOverrides + 80)
+ ld bc, wLYOverridesEnd - (wLYOverrides + 80)
call ByteFill
; Let LCD Stat know we're messing around with SCX
@@ -323,7 +323,7 @@
; 10ef06
InitializeBackground: ; 10ef06
- ld hl, Sprite01
+ ld hl, wVirtualOAMSprite00
ld d, -$22
ld e, $0
ld c, 5
@@ -366,7 +366,7 @@
; Stop at y=6
; y is really from the bottom of the sprite, which is two tiles high
- ld hl, Sprite01YCoord
+ ld hl, wVirtualOAMSprite00YCoord
ld a, [hl]
cp 6 + 2 * TILE_WIDTH
ret z
--- a/engine/tmhm.asm
+++ b/engine/tmhm.asm
@@ -1,8 +1,8 @@
CanLearnTMHMMove: ; 11639
- ld a, [CurPartySpecies]
- ld [CurSpecies], a
+ ld a, [wCurPartySpecies]
+ ld [wCurSpecies], a
call GetBaseData
- ld hl, BaseTMHM
+ ld hl, wBaseTMHM
push hl
ld a, [wPutativeTMHMMove]
--- a/engine/tmhm2.asm
+++ b/engine/tmhm2.asm
@@ -7,10 +7,10 @@
ret nc
call PlaceHollowCursor
call WaitBGMap
- ld a, [CurItem]
+ ld a, [wCurItem]
dec a
- ld [CurItemQuantity], a
- ld hl, TMsHMs
+ ld [wCurItemQuantity], a
+ ld hl, wTMsHMs
ld c, a
ld b, 0
add hl, bc
@@ -21,15 +21,15 @@
ret
.ConvertItemToTMHMNumber: ; 2c798 (b:4798)
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
callfar GetNumberedTMHM
ld a, c
- ld [CurItem], a
+ ld [wCurItem], a
ret
ConvertCurItemIntoCurTMHM: ; 2c7a7 (b:47a7)
- ld a, [CurItem]
+ ld a, [wCurItem]
ld c, a
callfar GetTMHMNumber
ld a, c
@@ -42,11 +42,11 @@
ret
AskTeachTMHM: ; 2c7bf (b:47bf)
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
res NO_TEXT_SCROLL, [hl]
- ld a, [CurItem]
+ ld a, [wCurItem]
cp TM01
jr c, .NotTMHM
call GetTMHMItemMove
@@ -55,7 +55,7 @@
call GetMoveName
call CopyName1
ld hl, Text_BootedTM ; Booted up a TM
- ld a, [CurItem]
+ ld a, [wCurItem]
cp HM01
jr c, .TM
ld hl, Text_BootedHM ; Booted up an HM
@@ -67,11 +67,11 @@
.NotTMHM:
pop bc
ld a, b
- ld [Options], a
+ ld [wOptions], a
ret
ChooseMonToLearnTMHM: ; 2c7fb
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
ld de, wTMHMMoveNameBackup
ld bc, 12
call CopyBytes
@@ -81,7 +81,7 @@
farcall InitPartyMenuWithCancel
farcall InitPartyMenuGFX
ld a, PARTYMENUACTION_TEACH_TMHM
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
.loopback
farcall WritePartyMenuTilemap
farcall PrintPartyMenuText
@@ -90,13 +90,13 @@
call DelayFrame
farcall PartyMenuSelect
push af
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
pop bc ; now contains the former contents of af
jr z, .egg
push bc
ld hl, wTMHMMoveNameBackup
- ld de, StringBuffer2
+ ld de, wStringBuffer2
ld bc, 12
call CopyBytes
pop af ; now contains the original contents of af
@@ -121,8 +121,8 @@
predef CanLearnTMHMMove
push bc
- ld a, [CurPartyMon]
- ld hl, PartyMonNicknames
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonNicknames
call GetNick
pop bc
@@ -147,7 +147,7 @@
jr z, .nope
farcall StubbedTrainerRankings_TMsHMsTaught
- ld a, [CurItem]
+ ld a, [wCurItem]
call IsHM
ret c
@@ -254,13 +254,13 @@
ld b, 4
ld c, SCREEN_WIDTH - 2
call TextBox
- ld a, [CurItem]
+ ld a, [wCurItem]
cp NUM_TMS + NUM_HMS + 1
jr nc, TMHM_JoypadLoop
ld [wd265], a
predef GetTMHMMove
ld a, [wd265]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
hlcoord 1, 14
call PrintMoveDesc
jp TMHM_JoypadLoop
@@ -293,7 +293,7 @@
jr nz, .loop
ld a, c
.okay
- ld [CurItem], a
+ ld [wCurItem], a
cp -1
ret
@@ -340,7 +340,7 @@
jp TMHM_ShowTMMoveDescription
TMHM_DisplayPocketItems: ; 2c9e2 (b:49e2)
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
jp z, Tutorial_TMHMPocket
@@ -466,7 +466,7 @@
; 2cab5
TMHM_GetCurrentPocketPosition: ; 2cab5 (b:4ab5)
- ld hl, TMsHMs
+ ld hl, wTMsHMs
ld a, [wTMHMPocketScrollPosition]
ld b, a
inc b
@@ -523,7 +523,7 @@
.CheckHaveRoomForTMHM: ; 2cafa
ld a, [wd265]
dec a
- ld hl, TMsHMs
+ ld hl, wTMsHMs
ld b, 0
ld c, a
add hl, bc
@@ -539,7 +539,7 @@
call ConvertCurItemIntoCurTMHM
ld a, [wd265]
dec a
- ld hl, TMsHMs
+ ld hl, wTMsHMs
ld b, 0
ld c, a
add hl, bc
@@ -559,7 +559,7 @@
CountTMsHMs: ; 2cb2a (b:4b2a)
ld b, 0
ld c, NUM_TMS + NUM_HMS
- ld hl, TMsHMs
+ ld hl, wTMsHMs
.loop
ld a, [hli]
and a
@@ -575,7 +575,7 @@
PrintMoveDesc: ; 2cb3e
push hl
ld hl, MoveDescriptions
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
dec a
ld c, a
ld b, 0
--- a/engine/trade_animation.asm
+++ b/engine/trade_animation.asm
@@ -119,11 +119,11 @@
push af
xor a
ld [hMapAnims], a
- ld hl, VramState
+ ld hl, wVramState
ld a, [hl]
push af
res 0, [hl]
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set 4, [hl]
@@ -137,9 +137,9 @@
call DoTradeAnimation
jr nc, .anim_loop
pop af
- ld [Options], a
+ ld [wOptions], a
pop af
- ld [VramState], a
+ ld [wVramState], a
pop af
ld [hMapAnims], a
ret
@@ -831,11 +831,11 @@
TradeAnim_ShowGivemonData: ; 2942e
call ShowPlayerTrademonStats
ld a, [wPlayerTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [wPlayerTrademonDVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wPlayerTrademonDVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
@@ -858,11 +858,11 @@
TradeAnim_ShowGetmonData: ; 29461
call ShowOTTrademonStats
ld a, [wOTTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [wOTTrademonDVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wOTTrademonDVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
@@ -885,8 +885,8 @@
push af
predef GetUnownLetter
pop af
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
call GetBaseData
pop de
predef GetMonFrontpic
@@ -898,7 +898,7 @@
push de
ld [wd265], a
call GetPokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
pop de
ld bc, NAME_LENGTH
call CopyBytes
--- a/engine/trainer_card.asm
+++ b/engine/trainer_card.asm
@@ -9,11 +9,11 @@
const TRAINERCARDSTATE_QUIT ; 6
TrainerCard: ; 25105
- ld a, [VramState]
+ ld a, [wVramState]
push af
xor a
- ld [VramState], a
- ld hl, Options
+ ld [wVramState], a
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -33,9 +33,9 @@
.quit
pop af
- ld [Options], a
+ ld [wOptions], a
pop af
- ld [VramState], a
+ ld [wVramState], a
ret
.InitRAM: ; 2513b (9:513b)
@@ -237,14 +237,14 @@
ld de, .ID_No
call TrainerCardSetup_PlaceTilemapString
hlcoord 7, 2
- ld de, PlayerName
+ ld de, wPlayerName
call PlaceString
hlcoord 5, 4
- ld de, PlayerID
+ ld de, wPlayerID
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
hlcoord 7, 6
- ld de, Money
+ ld de, wMoney
lb bc, PRINTNUM_MONEY | 3, 6
call PrintNum
hlcoord 1, 3
@@ -278,8 +278,8 @@
hlcoord 10, 15
ld de, .Badges
call PlaceString
- ld hl, PokedexCaught
- ld b, EndPokedexCaught - PokedexCaught
+ ld hl, wPokedexCaught
+ ld b, wEndPokedexCaught - wPokedexCaught
call CountSetBits
ld de, wd265
hlcoord 15, 10
@@ -444,11 +444,11 @@
TrainerCard_Page1_PrintGameTime: ; 25415 (9:5415)
hlcoord 11, 12
- ld de, GameTimeHours
+ ld de, wGameTimeHours
lb bc, 2, 4
call PrintNum
inc hl
- ld de, GameTimeMinutes
+ ld de, wGameTimeMinutes
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
ld a, [hVBlankCounter]
@@ -479,7 +479,7 @@
ld d, a
ld a, [de]
ld c, a
- ld de, Sprite01
+ ld de, wVirtualOAMSprite00
ld b, NUM_JOHTO_BADGES
.loop
srl c
--- a/engine/types.asm
+++ b/engine/types.asm
@@ -1,5 +1,5 @@
PrintMonTypes: ; 5090d
-; Print one or both types of [CurSpecies]
+; Print one or both types of [wCurSpecies]
; on the stats screen at hl.
push hl
@@ -7,14 +7,14 @@
pop hl
push hl
- ld a, [BaseType1]
+ ld a, [wBaseType1]
call .Print
; Single-typed monsters really
; have two of the same type.
- ld a, [BaseType1]
+ ld a, [wBaseType1]
ld b, a
- ld a, [BaseType2]
+ ld a, [wBaseType2]
cp b
pop hl
jr z, .hide_type_2
@@ -49,10 +49,10 @@
ld bc, MOVE_LENGTH
ld hl, Moves
call AddNTimes
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld a, BANK(Moves)
call FarCopyBytes
- ld a, [StringBuffer1 + MOVE_TYPE]
+ ld a, [wStringBuffer1 + MOVE_TYPE]
pop hl
ld b, a
@@ -79,7 +79,7 @@
GetTypeName: ; 50964
-; Copy the name of type [wd265] to StringBuffer1.
+; Copy the name of type [wd265] to wStringBuffer1.
ld a, [wd265]
ld hl, TypeNames
@@ -90,7 +90,7 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld bc, MOVE_NAME_LENGTH
jp CopyBytes
; 5097b
--- a/engine/unown_puzzle.asm
+++ b/engine/unown_puzzle.asm
@@ -549,7 +549,7 @@
ld hl, .OAM_NotHoldingPiece
.load
- ld de, Sprite01
+ ld de, wVirtualOAMSprite00
.loop
ld a, [hli]
cp -1
@@ -834,7 +834,7 @@
INCBIN "gfx/unown_puzzle/tile_borders.2bpp"
LoadUnownPuzzlePiecesGFX: ; e17a3
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
maskbits NUM_UNOWN_PUZZLES
ld e, a
ld d, 0
--- a/engine/unused_title.asm
+++ b/engine/unused_title.asm
@@ -49,7 +49,7 @@
jr nz, .copy
ld hl, UnusedTitleFG_OAM
- ld de, Sprite01
+ ld de, wVirtualOAMSprite00
ld bc, SPRITEOAMSTRUCT_LENGTH * NUM_SPRITE_OAM_STRUCTS
call CopyBytes
--- a/engine/variables.asm
+++ b/engine/variables.asm
@@ -29,7 +29,7 @@
ret
.loadstringbuffer2 ; 8066c (20:466c)
- ld de, StringBuffer2
+ ld de, wStringBuffer2
ld [de], a
ret
; 80671 (20:4671)
@@ -36,29 +36,29 @@
.VarActionTable: ; 80671
; entries correspond to VAR_* constants
- ; RETVAR_STRBUF2: copy [de] to StringBuffer2
+ ; RETVAR_STRBUF2: copy [de] to wStringBuffer2
; RETVAR_ADDR_DE: return address in de
; RETVAR_EXECUTE: call function
- dwb StringBuffer2, RETVAR_STRBUF2
- dwb PartyCount, RETVAR_STRBUF2
+ dwb wStringBuffer2, RETVAR_STRBUF2
+ dwb wPartyCount, RETVAR_STRBUF2
dwb .BattleResult, RETVAR_EXECUTE
- dwb BattleType, RETVAR_ADDR_DE
- dwb TimeOfDay, RETVAR_STRBUF2
+ dwb wBattleType, RETVAR_ADDR_DE
+ dwb wTimeOfDay, RETVAR_STRBUF2
dwb .CountCaughtMons, RETVAR_EXECUTE
dwb .CountSeenMons, RETVAR_EXECUTE
dwb .CountBadges, RETVAR_EXECUTE
- dwb PlayerState, RETVAR_ADDR_DE
+ dwb wPlayerState, RETVAR_ADDR_DE
dwb .PlayerFacing, RETVAR_EXECUTE
dwb hHours, RETVAR_STRBUF2
dwb .DayOfWeek, RETVAR_EXECUTE
- dwb MapGroup, RETVAR_STRBUF2
- dwb MapNumber, RETVAR_STRBUF2
+ dwb wMapGroup, RETVAR_STRBUF2
+ dwb wMapNumber, RETVAR_STRBUF2
dwb .UnownCaught, RETVAR_EXECUTE
- dwb wEnvironment, RETVAR_STRBUF2
+ dwb wEnvironment, RETVAR_STRBUF2
dwb .BoxFreeSpace, RETVAR_EXECUTE
dwb wBugContestMinsRemaining, RETVAR_STRBUF2
- dwb XCoord, RETVAR_STRBUF2
- dwb YCoord, RETVAR_STRBUF2
+ dwb wXCoord, RETVAR_STRBUF2
+ dwb wYCoord, RETVAR_STRBUF2
dwb wSpecialPhoneCallID, RETVAR_STRBUF2
dwb wNrOfBeatenBattleTowerTrainers, RETVAR_STRBUF2
dwb wKurtApricornQuantity, RETVAR_STRBUF2
@@ -71,8 +71,8 @@
.CountCaughtMons: ; 806c5
; Caught mons.
- ld hl, PokedexCaught
- ld b, EndPokedexCaught - PokedexCaught
+ ld hl, wPokedexCaught
+ ld b, wEndPokedexCaught - wPokedexCaught
call CountSetBits
ld a, [wd265]
jp .loadstringbuffer2
@@ -80,8 +80,8 @@
.CountSeenMons: ; 806d3
; Seen mons.
- ld hl, PokedexSeen
- ld b, EndPokedexSeen - PokedexSeen
+ ld hl, wPokedexSeen
+ ld b, wEndPokedexSeen - wPokedexSeen
call CountSetBits
ld a, [wd265]
jp .loadstringbuffer2
@@ -89,7 +89,7 @@
.CountBadges: ; 806e1
; Number of owned badges.
- ld hl, Badges
+ ld hl, wBadges
ld b, 2
call CountSetBits
ld a, [wd265]
@@ -98,7 +98,7 @@
.PlayerFacing: ; 806ef
; The direction the player is facing.
- ld a, [PlayerDirection]
+ ld a, [wPlayerDirection]
and $c
rrca
rrca
@@ -118,7 +118,7 @@
jp .loadstringbuffer2
.count
- ld hl, UnownDex
+ ld hl, wUnownDex
ld b, 0
.loop
ld a, [hli]
--- a/engine/warp_connection.asm
+++ b/engine/warp_connection.asm
@@ -30,24 +30,24 @@
ret
.west
- ld a, [WestConnectedMapGroup]
- ld [MapGroup], a
- ld a, [WestConnectedMapNumber]
- ld [MapNumber], a
- ld a, [WestConnectionStripXOffset]
- ld [XCoord], a
- ld a, [WestConnectionStripYOffset]
- ld hl, YCoord
+ ld a, [wWestConnectedMapGroup]
+ ld [wMapGroup], a
+ ld a, [wWestConnectedMapNumber]
+ ld [wMapNumber], a
+ ld a, [wWestConnectionStripXOffset]
+ ld [wXCoord], a
+ ld a, [wWestConnectionStripYOffset]
+ ld hl, wYCoord
add [hl]
ld [hl], a
ld c, a
- ld hl, WestConnectionWindow
+ ld hl, wWestConnectionWindow
ld a, [hli]
ld h, [hl]
ld l, a
srl c
jr z, .skip_to_load
- ld a, [WestConnectedMapWidth]
+ ld a, [wWestConnectedMapWidth]
add 6
ld e, a
ld d, 0
@@ -65,24 +65,24 @@
jp .done
.east
- ld a, [EastConnectedMapGroup]
- ld [MapGroup], a
- ld a, [EastConnectedMapNumber]
- ld [MapNumber], a
- ld a, [EastConnectionStripXOffset]
- ld [XCoord], a
- ld a, [EastConnectionStripYOffset]
- ld hl, YCoord
+ ld a, [wEastConnectedMapGroup]
+ ld [wMapGroup], a
+ ld a, [wEastConnectedMapNumber]
+ ld [wMapNumber], a
+ ld a, [wEastConnectionStripXOffset]
+ ld [wXCoord], a
+ ld a, [wEastConnectionStripYOffset]
+ ld hl, wYCoord
add [hl]
ld [hl], a
ld c, a
- ld hl, EastConnectionWindow
+ ld hl, wEastConnectionWindow
ld a, [hli]
ld h, [hl]
ld l, a
srl c
jr z, .skip_to_load2
- ld a, [EastConnectedMapWidth]
+ ld a, [wEastConnectedMapWidth]
add 6
ld e, a
ld d, 0
@@ -100,18 +100,18 @@
jp .done
.north
- ld a, [NorthConnectedMapGroup]
- ld [MapGroup], a
- ld a, [NorthConnectedMapNumber]
- ld [MapNumber], a
- ld a, [NorthConnectionStripYOffset]
- ld [YCoord], a
- ld a, [NorthConnectionStripXOffset]
- ld hl, XCoord
+ ld a, [wNorthConnectedMapGroup]
+ ld [wMapGroup], a
+ ld a, [wNorthConnectedMapNumber]
+ ld [wMapNumber], a
+ ld a, [wNorthConnectionStripYOffset]
+ ld [wYCoord], a
+ ld a, [wNorthConnectionStripXOffset]
+ ld hl, wXCoord
add [hl]
ld [hl], a
ld c, a
- ld hl, NorthConnectionWindow
+ ld hl, wNorthConnectionWindow
ld a, [hli]
ld h, [hl]
ld l, a
@@ -125,18 +125,18 @@
jp .done
.south
- ld a, [SouthConnectedMapGroup]
- ld [MapGroup], a
- ld a, [SouthConnectedMapNumber]
- ld [MapNumber], a
- ld a, [SouthConnectionStripYOffset]
- ld [YCoord], a
- ld a, [SouthConnectionStripXOffset]
- ld hl, XCoord
+ ld a, [wSouthConnectedMapGroup]
+ ld [wMapGroup], a
+ ld a, [wSouthConnectedMapNumber]
+ ld [wMapNumber], a
+ ld a, [wSouthConnectionStripYOffset]
+ ld [wYCoord], a
+ ld a, [wSouthConnectionStripXOffset]
+ ld hl, wXCoord
add [hl]
ld [hl], a
ld c, a
- ld hl, SouthConnectionWindow
+ ld hl, wSouthConnectionWindow
ld a, [hli]
ld h, [hl]
ld l, a
@@ -156,11 +156,11 @@
call .SaveDigWarp
call .SetSpawn
ld a, [wNextWarp]
- ld [WarpNumber], a
+ ld [wWarpNumber], a
ld a, [wNextMapGroup]
- ld [MapGroup], a
+ ld [wMapGroup], a
ld a, [wNextMapNumber]
- ld [MapNumber], a
+ ld [wMapNumber], a
ret
.SaveDigWarp: ; 1046df (41:46df)
@@ -228,7 +228,7 @@
ret
LoadMapTimeOfDay: ; 104750
- ld hl, VramState
+ ld hl, wVramState
res 6, [hl]
ld a, $1
ld [wSpriteUpdatesEnabled], a
@@ -274,7 +274,7 @@
and a
ret z
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
ld a, $1
ld [rVBK], a
.copy
@@ -324,7 +324,7 @@
ld hl, wPlayerSpriteSetupFlags
bit 6, [hl]
jr nz, .skip
- ld hl, VramState
+ ld hl, wVramState
set 0, [hl]
call SafeUpdateSprites
.skip
@@ -349,10 +349,10 @@
ret
.down
- ld a, [PlayerStandingMapY]
+ ld a, [wPlayerStandingMapY]
sub 4
ld b, a
- ld a, [MapHeight]
+ ld a, [wMapHeight]
add a
cp b
jr z, .ok
@@ -360,7 +360,7 @@
ret
.up
- ld a, [PlayerStandingMapY]
+ ld a, [wPlayerStandingMapY]
sub 4
cp -1
jr z, .ok
@@ -368,7 +368,7 @@
ret
.left
- ld a, [PlayerStandingMapX]
+ ld a, [wPlayerStandingMapX]
sub 4
cp -1
jr z, .ok
@@ -376,10 +376,10 @@
ret
.right
- ld a, [PlayerStandingMapX]
+ ld a, [wPlayerStandingMapX]
sub 4
ld b, a
- ld a, [MapWidth]
+ ld a, [wMapWidth]
add a
cp b
jr z, .ok
@@ -392,8 +392,8 @@
GetCoordOfUpperLeftCorner:: ; 10486d
- ld hl, OverworldMap
- ld a, [XCoord]
+ ld hl, wOverworldMap
+ ld a, [wXCoord]
bit 0, a
jr nz, .increment_then_halve1
srl a
@@ -408,11 +408,11 @@
ld c, a
ld b, $0
add hl, bc
- ld a, [MapWidth]
+ ld a, [wMapWidth]
add $6
ld c, a
ld b, $0
- ld a, [YCoord]
+ ld a, [wYCoord]
bit 0, a
jr nz, .increment_then_halve2
srl a
@@ -429,10 +429,10 @@
ld [wOverworldMapAnchor], a
ld a, h
ld [wOverworldMapAnchor + 1], a
- ld a, [YCoord]
+ ld a, [wYCoord]
and $1
ld [wMetatileStandingY], a
- ld a, [XCoord]
+ ld a, [wXCoord]
and $1
ld [wMetatileStandingX], a
ret
--- a/engine/wildmons.asm
+++ b/engine/wildmons.asm
@@ -193,8 +193,8 @@
.no_battle
xor a ; BATTLETYPE_NORMAL
- ld [TempWildMonSpecies], a
- ld [BattleType], a
+ ld [wTempWildMonSpecies], a
+ ld [wBattleType], a
ld a, 1
and a
ret
@@ -214,7 +214,7 @@
call CheckOnWater
ld a, wWaterEncounterRate - wMornEncounterRate
jr z, .ok
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
.ok
ld c, a
ld b, 0
@@ -243,9 +243,9 @@
ApplyCleanseTagEffectOnEncounterRate:: ; 2a138
; Cleanse Tag halves encounter rate.
- ld hl, PartyMon1Item
+ ld hl, wPartyMon1Item
ld de, PARTYMON_STRUCT_LENGTH
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld c, a
.loop
ld a, [hl]
@@ -275,7 +275,7 @@
jr z, .watermon
inc hl
inc hl
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
ld bc, $e
call AddNTimes
ld de, GrassMonProbTable
@@ -326,7 +326,7 @@
; Store the level
.ok
ld a, b
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld b, [hl]
; ld a, b
call ValidateTempWildMonSpecies
@@ -350,7 +350,7 @@
.loadwildmon
ld a, b
- ld [TempWildMonSpecies], a
+ ld [wTempWildMonSpecies], a
.startwildbattle
xor a
@@ -365,7 +365,7 @@
and a
jr z, .encounter
; Get the first Pokemon in your party that isn't fainted.
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
ld bc, PARTYMON_STRUCT_LENGTH - 1
.loop
ld a, [hli]
@@ -380,7 +380,7 @@
dec hl
endr
- ld a, [CurPartyLevel]
+ ld a, [wCurPartyLevel]
cp [hl]
jr nc, .encounter
and a
@@ -470,9 +470,9 @@
; 2a27f
CopyCurrMapDE: ; 2a27f
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld d, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld e, a
ret
; 2a288
@@ -585,11 +585,11 @@
dec hl
dec hl
ld a, [hli]
- ld [TempWildMonSpecies], a
+ ld [wTempWildMonSpecies], a
ld a, [hl]
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld a, BATTLETYPE_ROAMING
- ld [BattleType], a
+ ld [wBattleType], a
pop hl
scf
@@ -756,11 +756,11 @@
jr .innerloop2
; Check to see if the selected map is the one the player is currently in. If so, try again.
.ok
- ld a, [MapGroup]
+ ld a, [wMapGroup]
cp [hl]
jr nz, .done
inc hl
- ld a, [MapNumber]
+ ld a, [wMapNumber]
cp [hl]
jr z, .loop
dec hl
@@ -777,9 +777,9 @@
ld [wRoamMons_LastMapNumber], a
ld a, [wRoamMons_CurrentMapGroup]
ld [wRoamMons_LastMapGroup], a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld [wRoamMons_CurrentMapNumber], a
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld [wRoamMons_CurrentMapGroup], a
ret
; 2a40f
@@ -820,7 +820,7 @@
push hl
ld bc, 5 + 4 * 2 ; Location of the level of the 5th wild Pokemon in that map
add hl, bc
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
ld bc, NUM_GRASSMON * 2
call AddNTimes
.randloop1
@@ -855,7 +855,7 @@
pop bc
jr nz, .done
; Since we haven't seen it, have the caller tell us about it.
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call CopyName1
ld a, c
ld [wNamedObjectIndexBuffer], a
@@ -863,12 +863,12 @@
ld hl, .SawRareMonText
call PrintText
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.done
ld a, $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.SawRareMonText:
@@ -891,7 +891,7 @@
.ok
ld bc, 5 + 0 * 2
add hl, bc
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
inc a
ld bc, NUM_GRASSMON * 2
.loop
@@ -911,8 +911,8 @@
ld a, [hl]
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
- ld hl, StringBuffer1
- ld de, StringBuffer4
+ ld hl, wStringBuffer1
+ ld de, wStringBuffer4
ld bc, MON_NAME_LENGTH
jp CopyBytes
; 2a567
@@ -995,8 +995,8 @@
call GetFarByte
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
- ld hl, StringBuffer1
- ld de, StringBuffer4
+ ld hl, wStringBuffer1
+ ld de, wStringBuffer4
ld bc, MON_NAME_LENGTH
jp CopyBytes
; 2a5e9
--- a/home.asm
+++ b/home.asm
@@ -91,9 +91,9 @@
; disables overworld sprite updating?
xor a
ld [hMapAnims], a
- ld a, [VramState]
+ ld a, [wVramState]
res 0, a
- ld [VramState], a
+ ld [wVramState], a
ld a, $0
ld [wSpriteUpdatesEnabled], a
ret
@@ -102,9 +102,9 @@
EnableSpriteUpdates:: ; 2ee4
ld a, $1
ld [wSpriteUpdatesEnabled], a
- ld a, [VramState]
+ ld a, [wVramState]
set 0, a
- ld [VramState], a
+ ld [wVramState], a
ld a, $1
ld [hMapAnims], a
ret
@@ -115,9 +115,9 @@
IsInJohto:: ; 2f17
; Return 0 if the player is in Johto, and 1 in Kanto.
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
@@ -127,9 +127,9 @@
cp SPECIAL_MAP
jr nz, .CheckRegion
- ld a, [BackupMapGroup]
+ ld a, [wBackupMapGroup]
ld b, a
- ld a, [BackupMapNumber]
+ ld a, [wBackupMapNumber]
ld c, a
call GetWorldMapLocation
@@ -169,8 +169,8 @@
ClearSprites:: ; 300b
; Erase OAM data
- ld hl, Sprites
- ld b, SpritesEnd - Sprites
+ ld hl, wVirtualOAM
+ ld b, wVirtualOAMEnd - wVirtualOAM
xor a
.loop
ld [hli], a
@@ -181,7 +181,7 @@
HideSprites:: ; 3016
; Set all OAM y-positions to 160 to hide them offscreen
- ld hl, Sprite01YCoord
+ ld hl, wVirtualOAMSprite00YCoord
ld de, SPRITEOAMSTRUCT_LENGTH
ld b, NUM_SPRITE_OAM_STRUCTS
ld a, SCREEN_WIDTH_PX
@@ -196,14 +196,14 @@
INCLUDE "home/copy2.asm"
LoadTileMapToTempTileMap:: ; 309d
-; Load TileMap into TempTileMap
+; Load wTileMap into wTempTileMap
ld a, [rSVBK]
push af
- ld a, BANK(TempTileMap)
+ ld a, BANK(wTempTileMap)
ld [rSVBK], a
hlcoord 0, 0
- decoord 0, 0, TempTileMap
- ld bc, TileMapEnd - TileMap
+ decoord 0, 0, wTempTileMap
+ ld bc, wTileMapEnd - wTileMap
call CopyBytes
pop af
ld [rSVBK], a
@@ -220,14 +220,14 @@
; 30bf
LoadTempTileMapToTileMap:: ; 30bf
-; Load TempTileMap into TileMap
+; Load wTempTileMap into wTileMap
ld a, [rSVBK]
push af
- ld a, BANK(TempTileMap)
+ ld a, BANK(wTempTileMap)
ld [rSVBK], a
- hlcoord 0, 0, TempTileMap
+ hlcoord 0, 0, wTempTileMap
decoord 0, 0
- ld bc, TileMapEnd - TileMap
+ ld bc, wTileMapEnd - wTileMap
call CopyBytes
pop af
ld [rSVBK], a
@@ -235,8 +235,8 @@
; 30d6
CopyName1:: ; 30d6
-; Copies the name from de to StringBuffer2
- ld hl, StringBuffer2
+; Copies the name from de to wStringBuffer2
+ ld hl, wStringBuffer2
CopyName2:: ; 30d9
; Copies the name from de to hl
@@ -291,20 +291,20 @@
PrintLetterDelay:: ; 313d
; Wait before printing the next letter.
-; The text speed setting in Options is actually a frame count:
+; The text speed setting in wOptions is actually a frame count:
; fast: 1 frame
; mid: 3 frames
; slow: 5 frames
-; TextBoxFlags[!0] and A or B override text speed with a one-frame delay.
-; Options[4] and TextBoxFlags[!1] disable the delay.
+; wTextBoxFlags[!0] and A or B override text speed with a one-frame delay.
+; wOptions[4] and wTextBoxFlags[!1] disable the delay.
- ld a, [Options]
+ ld a, [wOptions]
bit NO_TEXT_SCROLL, a
ret nz
; non-scrolling text?
- ld a, [TextBoxFlags]
+ ld a, [wTextBoxFlags]
bit NO_TEXT_DELAY_F, a
ret z
@@ -321,12 +321,12 @@
ld [hl], a
; force fast scroll?
- ld a, [TextBoxFlags]
+ ld a, [wTextBoxFlags]
bit FAST_TEXT_DELAY_F, a
jr z, .fast
; text speed
- ld a, [Options]
+ ld a, [wOptions]
and %111
jr .updatedelay
@@ -334,7 +334,7 @@
ld a, TEXT_DELAY_FAST
.updatedelay
- ld [TextDelayFrames], a
+ ld [wTextDelayFrames], a
.checkjoypad
call GetJoypad
@@ -358,7 +358,7 @@
jr .end
.wait
- ld a, [TextDelayFrames]
+ ld a, [wTextDelayFrames]
and a
jr nz, .checkjoypad
@@ -575,7 +575,7 @@
di
ld a, BANK(vTiles3)
ld [rVBK], a
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
call .StackPointerMagic
ld a, BANK(vTiles0)
ld [rVBK], a
@@ -760,7 +760,7 @@
; 0x3376
GetWeekday:: ; 3376
- ld a, [CurDay]
+ ld a, [wCurDay]
.mod
sub 7
jr nc, .mod
@@ -792,7 +792,7 @@
; 3524
.UpdatePalettes: ; 3524
- ld hl, VramState
+ ld hl, wVramState
bit 0, [hl]
jp nz, UpdateTimePals
jp SetPalettes
@@ -1068,7 +1068,7 @@
ld [wBoxAlignment], a
_PrepMonFrontpic:: ; 378b
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
call IsAPokemon
jr c, .not_pokemon
@@ -1088,7 +1088,7 @@
xor a
ld [wBoxAlignment], a
inc a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ret
; 37b6
@@ -1095,9 +1095,9 @@
INCLUDE "home/cry.asm"
PrintLevel:: ; 382d
-; Print TempMonLevel at hl
+; Print wTempMonLevel at hl
- ld a, [TempMonLevel]
+ ld a, [wTempMonLevel]
ld [hl], "<LV>"
inc hl
@@ -1146,7 +1146,7 @@
rst Bankswitch
; Egg doesn't have BaseData
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
cp EGG
jr z, .egg
@@ -1155,7 +1155,7 @@
ld bc, BASE_DATA_SIZE
ld hl, BaseData
call AddNTimes
- ld de, CurBaseData
+ ld de, wCurBaseData
ld bc, BASE_DATA_SIZE
call CopyBytes
jr .end
@@ -1166,11 +1166,11 @@
; Sprite dimensions
ld b, $55 ; 5x5
- ld hl, BasePicSize
+ ld hl, wBasePicSize
ld [hl], b
; ????
- ld hl, BasePadding
+ ld hl, wBasePadding
ld [hl], e
inc hl
ld [hl], d
@@ -1182,8 +1182,8 @@
.end
; Replace Pokedex # with species
- ld a, [CurSpecies]
- ld [BaseDexNo], a
+ ld a, [wCurSpecies]
+ ld [wBaseDexNo], a
pop af
rst Bankswitch
@@ -1194,8 +1194,8 @@
; 389c
GetCurNick:: ; 389c
- ld a, [CurPartyMon]
- ld hl, PartyMonNicknames
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMonNicknames
GetNick:: ; 38a2
; Get nickname a from list hl.
@@ -1204,7 +1204,7 @@
push bc
call SkipNames
- ld de, StringBuffer1
+ ld de, wStringBuffer1
push de
ld bc, MON_NAME_LENGTH
@@ -1301,13 +1301,13 @@
; 0x3917
GetPartyParamLocation:: ; 3917
-; Get the location of parameter a from CurPartyMon in hl
+; Get the location of parameter a from wCurPartyMon in hl
push bc
- ld hl, PartyMons
+ ld hl, wPartyMons
ld c, a
ld b, 0
add hl, bc
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
call GetPartyLocation
pop bc
ret
@@ -1347,18 +1347,18 @@
and a
ret z
- ld a, LOW(LYOverridesBackup)
- ld [Requested2bppSource], a
- ld a, HIGH(LYOverridesBackup)
- ld [Requested2bppSource + 1], a
+ ld a, LOW(wLYOverridesBackup)
+ ld [wRequested2bppSource], a
+ ld a, HIGH(wLYOverridesBackup)
+ ld [wRequested2bppSource + 1], a
- ld a, LOW(LYOverrides)
- ld [Requested2bppDest], a
- ld a, HIGH(LYOverrides)
- ld [Requested2bppDest + 1], a
+ ld a, LOW(wLYOverrides)
+ ld [wRequested2bppDest], a
+ ld a, HIGH(wLYOverrides)
+ ld [wRequested2bppDest + 1], a
- ld a, (LYOverridesEnd - LYOverrides) / 16
- ld [Requested2bpp], a
+ ld a, (wLYOverridesEnd - wLYOverrides) / 16
+ ld [wRequested2bpp], a
ret
; 3b2a
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -55,7 +55,7 @@
_LoadMusicByte:: ; 3b86
-; CurMusicByte = [a:de]
+; wCurMusicByte = [a:de]
GLOBAL LoadMusicByte
ld [hROMBank], a
@@ -62,7 +62,7 @@
ld [MBC3RomBank], a
ld a, [de]
- ld [CurMusicByte], a
+ ld [wCurMusicByte], a
ld a, BANK(LoadMusicByte)
ld [hROMBank], a
@@ -168,13 +168,13 @@
inc hl
ld a, [hli]
- ld [CryPitch], a
+ ld [wCryPitch], a
ld a, [hli]
- ld [CryPitch + 1], a
+ ld [wCryPitch + 1], a
ld a, [hli]
- ld [CryLength], a
+ ld [wCryLength], a
ld a, [hl]
- ld [CryLength + 1], a
+ ld [wCryLength + 1], a
ld a, BANK(_PlayCry)
ld [hROMBank], a
@@ -208,7 +208,7 @@
jr nc, .play
; Does it have priority?
- ld a, [CurSFX]
+ ld a, [wCurSFX]
cp e
jr c, .done
@@ -220,7 +220,7 @@
ld [MBC3RomBank], a
ld a, e
- ld [CurSFX], a
+ ld [wCurSFX], a
call _PlaySFX
pop af
@@ -249,16 +249,16 @@
push hl
.wait
- ld hl, Channel5Flags
+ ld hl, wChannel5Flags
bit 0, [hl]
jr nz, .wait
- ld hl, Channel6Flags
+ ld hl, wChannel6Flags
bit 0, [hl]
jr nz, .wait
- ld hl, Channel7Flags
+ ld hl, wChannel7Flags
bit 0, [hl]
jr nz, .wait
- ld hl, Channel8Flags
+ ld hl, wChannel8Flags
bit 0, [hl]
jr nz, .wait
@@ -271,16 +271,16 @@
; The inverse of CheckSFX.
push hl
- ld hl, Channel5Flags
+ ld hl, wChannel5Flags
bit 0, [hl]
jr nz, .playing
- ld hl, Channel6Flags
+ ld hl, wChannel6Flags
bit 0, [hl]
jr nz, .playing
- ld hl, Channel7Flags
+ ld hl, wChannel7Flags
bit 0, [hl]
jr nz, .playing
- ld hl, Channel8Flags
+ ld hl, wChannel8Flags
bit 0, [hl]
jr nz, .playing
@@ -296,31 +296,31 @@
MaxVolume:: ; 3c97
ld a, MAX_VOLUME
- ld [Volume], a
+ ld [wVolume], a
ret
; 3c9d
LowVolume:: ; 3c9d
ld a, $33 ; 40%
- ld [Volume], a
+ ld [wVolume], a
ret
; 3ca3
VolumeOff:: ; 3ca3
xor a
- ld [Volume], a
+ ld [wVolume], a
ret
; 3ca8
Unused_FadeOutMusic:: ; 3ca8
ld a, 4
- ld [MusicFade], a
+ ld [wMusicFade], a
ret
; 3cae
FadeInMusic:: ; 3cae
ld a, 4 | (1 << MUSIC_FADE_IN_F)
- ld [MusicFade], a
+ ld [wMusicFade], a
ret
; 3cb4
@@ -346,11 +346,11 @@
jr z, .done
ld a, 8
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, e
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, d
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld a, e
ld [wMapMusic], a
@@ -399,7 +399,7 @@
xor a
ld [wDontPlayMapMusicOnReload], a
ld de, MUSIC_BICYCLE
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_BIKE
jr z, .play
call GetMapMusic_MaybeSpecial
@@ -455,7 +455,7 @@
; 3d62
SpecialMapMusic:: ; 3d62
- ld a, [PlayerState]
+ ld a, [wPlayerState]
cp PLAYER_SURF
jr z, .surf
cp PLAYER_SURF_PIKA
@@ -480,10 +480,10 @@
ret
.contest
- ld a, [MapGroup]
+ ld a, [wMapGroup]
cp GROUP_ROUTE_35_NATIONAL_PARK_GATE
jr nz, .no
- ld a, [MapNumber]
+ ld a, [wMapNumber]
cp MAP_ROUTE_35_NATIONAL_PARK_GATE
jr z, .ranking
cp MAP_ROUTE_36_NATIONAL_PARK_GATE
@@ -506,15 +506,15 @@
; Places a BCD number at the
; upper center of the screen.
ld a, 4 * TILE_WIDTH
- ld [Sprite39YCoord], a
- ld [Sprite40YCoord], a
+ ld [wVirtualOAMSprite38YCoord], a
+ ld [wVirtualOAMSprite39YCoord], a
ld a, 10 * TILE_WIDTH
- ld [Sprite39XCoord], a
+ ld [wVirtualOAMSprite38XCoord], a
ld a, 11 * TILE_WIDTH
- ld [Sprite40XCoord], a
+ ld [wVirtualOAMSprite39XCoord], a
xor a
- ld [Sprite39Attributes], a
- ld [Sprite40Attributes], a
+ ld [wVirtualOAMSprite38Attributes], a
+ ld [wVirtualOAMSprite39Attributes], a
ld a, [wc296]
cp 100
jr nc, .max
@@ -524,32 +524,32 @@
swap a
and $f
add "0"
- ld [Sprite39TileID], a
+ ld [wVirtualOAMSprite38TileID], a
ld a, b
and $f
add "0"
- ld [Sprite40TileID], a
+ ld [wVirtualOAMSprite39TileID], a
ret
.max
ld a, "9"
- ld [Sprite39TileID], a
- ld [Sprite40TileID], a
+ ld [wVirtualOAMSprite38TileID], a
+ ld [wVirtualOAMSprite39TileID], a
ret
; 3dde
CheckSFX:: ; 3dde
; Return carry if any SFX channels are active.
- ld a, [Channel5Flags]
+ ld a, [wChannel5Flags]
bit 0, a
jr nz, .playing
- ld a, [Channel6Flags]
+ ld a, [wChannel6Flags]
bit 0, a
jr nz, .playing
- ld a, [Channel7Flags]
+ ld a, [wChannel7Flags]
bit 0, a
jr nz, .playing
- ld a, [Channel8Flags]
+ ld a, [wChannel8Flags]
bit 0, a
jr nz, .playing
and a
@@ -561,8 +561,8 @@
TerminateExpBarSound:: ; 3dfe
xor a
- ld [Channel5Flags], a
- ld [SoundInput], a
+ ld [wChannel5Flags], a
+ ld [wSoundInput], a
ld [rNR10], a
ld [rNR11], a
ld [rNR12], a
@@ -575,11 +575,11 @@
ChannelsOff:: ; 3e10
; Quickly turn off music channels
xor a
- ld [Channel1Flags], a
- ld [Channel2Flags], a
- ld [Channel3Flags], a
- ld [Channel4Flags], a
- ld [SoundInput], a
+ ld [wChannel1Flags], a
+ ld [wChannel2Flags], a
+ ld [wChannel3Flags], a
+ ld [wChannel4Flags], a
+ ld [wSoundInput], a
ret
; 3e21
@@ -586,10 +586,10 @@
SFXChannelsOff:: ; 3e21
; Quickly turn off sound effect channels
xor a
- ld [Channel5Flags], a
- ld [Channel6Flags], a
- ld [Channel7Flags], a
- ld [Channel8Flags], a
- ld [SoundInput], a
+ ld [wChannel5Flags], a
+ ld [wChannel6Flags], a
+ ld [wChannel7Flags], a
+ ld [wChannel8Flags], a
+ ld [wSoundInput], a
ret
; 3e32
--- a/home/battle.asm
+++ b/home/battle.asm
@@ -25,13 +25,13 @@
BattlePartyAttr:: ; 395d
-; Get attribute a from the active BattleMon's party struct.
+; Get attribute a from the party struct of the active battle mon.
push bc
ld c, a
ld b, 0
- ld hl, PartyMons
+ ld hl, wPartyMons
add hl, bc
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
call GetPartyLocation
pop bc
ret
@@ -39,13 +39,13 @@
OTPartyAttr:: ; 396d
-; Get attribute a from the active EnemyMon's party struct.
+; Get attribute a from the party struct of the active enemy mon.
push bc
ld c, a
ld b, 0
- ld hl, OTPartyMon1Species
+ ld hl, wOTPartyMon1Species
add hl, bc
- ld a, [CurOTMon]
+ ld a, [wCurOTMon]
call GetPartyLocation
pop bc
ret
@@ -54,8 +54,8 @@
ResetDamage:: ; 397d
xor a
- ld [CurDamage], a
- ld [CurDamage + 1], a
+ ld [wCurDamage], a
+ ld [wCurDamage + 1], a
ret
; 3985
@@ -89,16 +89,16 @@
UpdateBattleMonInParty:: ; 399c
; Update level, status, current HP
- ld a, [CurBattleMon]
+ ld a, [wCurBattleMon]
UpdateBattleMon:: ; 399f
- ld hl, PartyMon1Level
+ ld hl, wPartyMon1Level
call GetPartyLocation
ld d, h
ld e, l
- ld hl, BattleMonLevel
- ld bc, BattleMonMaxHP - BattleMonLevel
+ ld hl, wBattleMonLevel
+ ld bc, wBattleMonMaxHP - wBattleMonLevel
jp CopyBytes
; 39b0
@@ -110,14 +110,14 @@
dec a
ret z
- ld a, [CurOTMon]
- ld hl, OTPartyMon1Level
+ ld a, [wCurOTMon]
+ ld hl, wOTPartyMon1Level
call GetPartyLocation
ld d, h
ld e, l
- ld hl, EnemyMonLevel
- ld bc, EnemyMonMaxHP - EnemyMonLevel
+ ld hl, wEnemyMonLevel
+ ld bc, wEnemyMonMaxHP - wEnemyMonLevel
jp CopyBytes
; 39c9
@@ -136,102 +136,9 @@
; 39e1
-GetBattleVar:: ; 39e1
-; Preserves hl.
- push hl
- call GetBattleVarAddr
- pop hl
- ret
-; 39e7
+INCLUDE "home/battle_vars.asm"
-GetBattleVarAddr:: ; 39e7
-; Get variable from pair a, depending on whose turn it is.
-; There are 21 variable pairs.
- push bc
-
- ld hl, .battlevarpairs
- ld c, a
- ld b, 0
- add hl, bc
- add hl, bc
-
- ld a, [hli]
- ld h, [hl]
- ld l, a
-
-; Enemy turn uses the second byte instead.
-; This lets battle variable calls be side-neutral.
- ld a, [hBattleTurn]
- and a
- jr z, .getvar
- inc hl
-
-.getvar
-; var id
- ld a, [hl]
- ld c, a
- ld b, 0
-
- ld hl, .vars
- add hl, bc
- add hl, bc
-
- ld a, [hli]
- ld h, [hl]
- ld l, a
-
- ld a, [hl]
-
- pop bc
- ret
-
-.battlevarpairs
- dw .substatus1, .substatus2, .substatus3, .substatus4, .substatus5
- dw .substatus1opp, .substatus2opp, .substatus3opp, .substatus4opp, .substatus5opp
- dw .status, .statusopp, .animation, .effect, .power, .type
- dw .curmove, .lastcounter, .lastcounteropp, .lastmove, .lastmoveopp
-
-; player enemy
-.substatus1 db PLAYER_SUBSTATUS_1, ENEMY_SUBSTATUS_1
-.substatus1opp db ENEMY_SUBSTATUS_1, PLAYER_SUBSTATUS_1
-.substatus2 db PLAYER_SUBSTATUS_2, ENEMY_SUBSTATUS_2
-.substatus2opp db ENEMY_SUBSTATUS_2, PLAYER_SUBSTATUS_2
-.substatus3 db PLAYER_SUBSTATUS_3, ENEMY_SUBSTATUS_3
-.substatus3opp db ENEMY_SUBSTATUS_3, PLAYER_SUBSTATUS_3
-.substatus4 db PLAYER_SUBSTATUS_4, ENEMY_SUBSTATUS_4
-.substatus4opp db ENEMY_SUBSTATUS_4, PLAYER_SUBSTATUS_4
-.substatus5 db PLAYER_SUBSTATUS_5, ENEMY_SUBSTATUS_5
-.substatus5opp db ENEMY_SUBSTATUS_5, PLAYER_SUBSTATUS_5
-.status db PLAYER_STATUS, ENEMY_STATUS
-.statusopp db ENEMY_STATUS, PLAYER_STATUS
-.animation db PLAYER_MOVE_ANIMATION, ENEMY_MOVE_ANIMATION
-.effect db PLAYER_MOVE_EFFECT, ENEMY_MOVE_EFFECT
-.power db PLAYER_MOVE_POWER, ENEMY_MOVE_POWER
-.type db PLAYER_MOVE_TYPE, ENEMY_MOVE_TYPE
-.curmove db PLAYER_CUR_MOVE, ENEMY_CUR_MOVE
-.lastcounter db PLAYER_COUNTER_MOVE, ENEMY_COUNTER_MOVE
-.lastcounteropp db ENEMY_COUNTER_MOVE, PLAYER_COUNTER_MOVE
-.lastmove db PLAYER_LAST_MOVE, ENEMY_LAST_MOVE
-.lastmoveopp db ENEMY_LAST_MOVE, PLAYER_LAST_MOVE
-
-.vars
- dw PlayerSubStatus1, EnemySubStatus1
- dw PlayerSubStatus2, EnemySubStatus2
- dw PlayerSubStatus3, EnemySubStatus3
- dw PlayerSubStatus4, EnemySubStatus4
- dw PlayerSubStatus5, EnemySubStatus5
- dw BattleMonStatus, EnemyMonStatus
- dw wPlayerMoveStructAnimation, wEnemyMoveStructAnimation
- dw wPlayerMoveStructEffect, wEnemyMoveStructEffect
- dw wPlayerMoveStructPower, wEnemyMoveStructPower
- dw wPlayerMoveStructType, wEnemyMoveStructType
- dw CurPlayerMove, CurEnemyMove
- dw LastPlayerCounterMove, LastEnemyCounterMove
- dw LastPlayerMove, LastEnemyMove
-; 3a90
-
-
FarCopyRadioText:: ; 3a90
inc hl
ld a, [hROMBank]
@@ -293,8 +200,6 @@
StdBattleTextBox:: ; 3ad5
; Open a textbox and print battle text at 20:hl.
-GLOBAL BattleText
-
ld a, [hROMBank]
push af
@@ -310,16 +215,13 @@
GetBattleAnimPointer:: ; 3ae1
-GLOBAL BattleAnimations
-GLOBAL BattleAnimCommands
-
ld a, BANK(BattleAnimations)
rst Bankswitch
ld a, [hli]
- ld [BattleAnimAddress], a
+ ld [wBattleAnimAddress], a
ld a, [hl]
- ld [BattleAnimAddress + 1], a
+ ld [wBattleAnimAddress + 1], a
ld a, BANK(BattleAnimCommands)
rst Bankswitch
@@ -332,7 +234,7 @@
push hl
push de
- ld hl, BattleAnimAddress
+ ld hl, wBattleAnimAddress
ld e, [hl]
inc hl
ld d, [hl]
@@ -341,7 +243,7 @@
rst Bankswitch
ld a, [de]
- ld [BattleAnimByte], a
+ ld [wBattleAnimByte], a
inc de
ld a, BANK(BattleAnimCommands)
@@ -354,6 +256,6 @@
pop de
pop hl
- ld a, [BattleAnimByte]
+ ld a, [wBattleAnimByte]
ret
; 3b0c
--- /dev/null
+++ b/home/battle_vars.asm
@@ -1,0 +1,111 @@
+GetBattleVar:: ; 39e1
+; Preserves hl.
+ push hl
+ call GetBattleVarAddr
+ pop hl
+ ret
+; 39e7
+
+GetBattleVarAddr:: ; 39e7
+; Get variable from pair a, depending on whose turn it is.
+; There are 21 variable pairs.
+
+ push bc
+
+ ld hl, .BattleVarPairs
+ ld c, a
+ ld b, 0
+ add hl, bc
+ add hl, bc
+
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+
+; Enemy turn uses the second byte instead.
+; This lets battle variable calls be side-neutral.
+ ld a, [hBattleTurn]
+ and a
+ jr z, .get_var
+ inc hl
+
+.get_var
+; var id
+ ld a, [hl]
+ ld c, a
+ ld b, 0
+
+ ld hl, .BattleVarPointers
+ add hl, bc
+ add hl, bc
+
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+
+ ld a, [hl]
+
+ pop bc
+ ret
+
+.BattleVarPairs:
+ dw .Substatus1
+ dw .Substatus2
+ dw .Substatus3
+ dw .Substatus4
+ dw .Substatus5
+ dw .Substatus1Opp
+ dw .Substatus2Opp
+ dw .Substatus3Opp
+ dw .Substatus4Opp
+ dw .Substatus5Opp
+ dw .Status
+ dw .StatusOpp
+ dw .MoveAnim
+ dw .MoveEffect
+ dw .MovePower
+ dw .MoveType
+ dw .CurMove
+ dw .LastCounter
+ dw .LastCounterOpp
+ dw .LastMove
+ dw .LastMoveOpp
+
+; player enemy
+.Substatus1: db PLAYER_SUBSTATUS_1, ENEMY_SUBSTATUS_1
+.Substatus1Opp: db ENEMY_SUBSTATUS_1, PLAYER_SUBSTATUS_1
+.Substatus2: db PLAYER_SUBSTATUS_2, ENEMY_SUBSTATUS_2
+.Substatus2Opp: db ENEMY_SUBSTATUS_2, PLAYER_SUBSTATUS_2
+.Substatus3: db PLAYER_SUBSTATUS_3, ENEMY_SUBSTATUS_3
+.Substatus3Opp: db ENEMY_SUBSTATUS_3, PLAYER_SUBSTATUS_3
+.Substatus4: db PLAYER_SUBSTATUS_4, ENEMY_SUBSTATUS_4
+.Substatus4Opp: db ENEMY_SUBSTATUS_4, PLAYER_SUBSTATUS_4
+.Substatus5: db PLAYER_SUBSTATUS_5, ENEMY_SUBSTATUS_5
+.Substatus5Opp: db ENEMY_SUBSTATUS_5, PLAYER_SUBSTATUS_5
+.Status: db PLAYER_STATUS, ENEMY_STATUS
+.StatusOpp: db ENEMY_STATUS, PLAYER_STATUS
+.MoveAnim: db PLAYER_MOVE_ANIMATION, ENEMY_MOVE_ANIMATION
+.MoveEffect: db PLAYER_MOVE_EFFECT, ENEMY_MOVE_EFFECT
+.MovePower: db PLAYER_MOVE_POWER, ENEMY_MOVE_POWER
+.MoveType: db PLAYER_MOVE_TYPE, ENEMY_MOVE_TYPE
+.CurMove: db PLAYER_CUR_MOVE, ENEMY_CUR_MOVE
+.LastCounter: db PLAYER_COUNTER_MOVE, ENEMY_COUNTER_MOVE
+.LastCounterOpp: db ENEMY_COUNTER_MOVE, PLAYER_COUNTER_MOVE
+.LastMove: db PLAYER_LAST_MOVE, ENEMY_LAST_MOVE
+.LastMoveOpp: db ENEMY_LAST_MOVE, PLAYER_LAST_MOVE
+
+.BattleVarPointers:
+ dw wPlayerSubStatus1, wEnemySubStatus1
+ dw wPlayerSubStatus2, wEnemySubStatus2
+ dw wPlayerSubStatus3, wEnemySubStatus3
+ dw wPlayerSubStatus4, wEnemySubStatus4
+ dw wPlayerSubStatus5, wEnemySubStatus5
+ dw wBattleMonStatus, wEnemyMonStatus
+ dw wPlayerMoveStructAnimation, wEnemyMoveStructAnimation
+ dw wPlayerMoveStructEffect, wEnemyMoveStructEffect
+ dw wPlayerMoveStructPower, wEnemyMoveStructPower
+ dw wPlayerMoveStructType, wEnemyMoveStructType
+ dw wCurPlayerMove, wCurEnemyMove
+ dw wLastPlayerCounterMove, wLastEnemyCounterMove
+ dw wLastPlayerMove, wLastEnemyMove
+; 3a90
--- a/home/copy.asm
+++ b/home/copy.asm
@@ -235,13 +235,13 @@
.NotMobile:
ld a, e
- ld [Requested2bppSource], a
+ ld [wRequested2bppSource], a
ld a, d
- ld [Requested2bppSource + 1], a
+ ld [wRequested2bppSource + 1], a
ld a, l
- ld [Requested2bppDest], a
+ ld [wRequested2bppDest], a
ld a, h
- ld [Requested2bppDest + 1], a
+ ld [wRequested2bppDest + 1], a
.loop
ld a, c
ld hl, hTilesPerCycle
@@ -248,10 +248,10 @@
cp [hl]
jr nc, .iterate
- ld [Requested2bpp], a
+ ld [wRequested2bpp], a
.wait
call DelayFrame
- ld a, [Requested2bpp]
+ ld a, [wRequested2bpp]
and a
jr nz, .wait
@@ -267,11 +267,11 @@
.iterate
ld a, [hTilesPerCycle]
- ld [Requested2bpp], a
+ ld [wRequested2bpp], a
.wait2
call DelayFrame
- ld a, [Requested2bpp]
+ ld a, [wRequested2bpp]
and a
jr nz, .wait2
@@ -311,13 +311,13 @@
.NotMobile:
ld a, e
- ld [Requested1bppSource], a
+ ld [wRequested1bppSource], a
ld a, d
- ld [Requested1bppSource + 1], a
+ ld [wRequested1bppSource + 1], a
ld a, l
- ld [Requested1bppDest], a
+ ld [wRequested1bppDest], a
ld a, h
- ld [Requested1bppDest + 1], a
+ ld [wRequested1bppDest + 1], a
.loop
ld a, c
ld hl, hTilesPerCycle
@@ -324,10 +324,10 @@
cp [hl]
jr nc, .iterate
- ld [Requested1bpp], a
+ ld [wRequested1bpp], a
.wait
call DelayFrame
- ld a, [Requested1bpp]
+ ld a, [wRequested1bpp]
and a
jr nz, .wait
@@ -343,11 +343,11 @@
.iterate
ld a, [hTilesPerCycle]
- ld [Requested1bpp], a
+ ld [wRequested1bpp], a
.wait2
call DelayFrame
- ld a, [Requested1bpp]
+ ld a, [wRequested1bpp]
and a
jr nz, .wait2
--- a/home/cry.asm
+++ b/home/cry.asm
@@ -29,7 +29,7 @@
push af
xor a
ld [wStereoPanningMask], a
- ld [CryTracks], a
+ ld [wCryTracks], a
pop af
call _PlayMonCry
ret
@@ -76,13 +76,13 @@
inc hl
ld a, [hli]
- ld [CryPitch], a
+ ld [wCryPitch], a
ld a, [hli]
- ld [CryPitch + 1], a
+ ld [wCryPitch + 1], a
ld a, [hli]
- ld [CryLength], a
+ ld [wCryLength], a
ld a, [hl]
- ld [CryLength + 1], a
+ ld [wCryLength + 1], a
pop af
rst Bankswitch
--- a/home/delay.asm
+++ b/home/delay.asm
@@ -1,12 +1,12 @@
DelayFrame:: ; 45a
; Wait for one frame
ld a, 1
- ld [VBlankOccurred], a
+ ld [wVBlankOccurred], a
; Wait for the next VBlank, halting to conserve battery
.halt
halt ; rgbasm adds a nop after this instruction by default
- ld a, [VBlankOccurred]
+ ld a, [wVBlankOccurred]
and a
jr nz, .halt
ret
--- a/home/fade.asm
+++ b/home/fade.asm
@@ -3,7 +3,7 @@
Unreferenced_Function48c:: ; 48c
; TimeOfDayFade
- ld a, [TimeOfDayPal]
+ ld a, [wTimeOfDayPal]
ld b, a
ld hl, IncGradGBPalTable_11
ld a, l
--- a/home/flag.asm
+++ b/home/flag.asm
@@ -1,6 +1,6 @@
ResetMapBufferEventFlags:: ; 2e50
xor a
- ld hl, EventFlags
+ ld hl, wEventFlags
ld [hli], a
ret
; 2e56
@@ -29,7 +29,7 @@
EventFlagAction:: ; 0x2e6f
- ld hl, EventFlags
+ ld hl, wEventFlags
call FlagAction
ret
--- a/home/game_time.asm
+++ b/home/game_time.asm
@@ -1,11 +1,11 @@
ResetGameTime:: ; 208a
xor a
- ld [GameTimeCap], a
- ld [GameTimeHours], a
- ld [GameTimeHours + 1], a
- ld [GameTimeMinutes], a
- ld [GameTimeSeconds], a
- ld [GameTimeFrames], a
+ ld [wGameTimeCap], a
+ ld [wGameTimeHours], a
+ ld [wGameTimeHours + 1], a
+ ld [wGameTimeMinutes], a
+ ld [wGameTimeSeconds], a
+ ld [wGameTimeFrames], a
ret
; 209e
@@ -16,7 +16,7 @@
ld a, [rSVBK]
push af
- ld a, BANK(GameTime)
+ ld a, BANK(wGameTime)
ld [rSVBK], a
call UpdateGameTimer
@@ -43,13 +43,13 @@
ret z
; Is the timer already capped?
- ld hl, GameTimeCap
+ ld hl, wGameTimeCap
bit 0, [hl]
ret nz
; +1 frame
- ld hl, GameTimeFrames
+ ld hl, wGameTimeFrames
ld a, [hl]
inc a
@@ -65,7 +65,7 @@
ld [hl], a
; +1 second
- ld hl, GameTimeSeconds
+ ld hl, wGameTimeSeconds
ld a, [hl]
inc a
@@ -81,7 +81,7 @@
ld [hl], a
; +1 minute
- ld hl, GameTimeMinutes
+ ld hl, wGameTimeMinutes
ld a, [hl]
inc a
@@ -97,9 +97,9 @@
ld [hl], a
; +1 hour
- ld a, [GameTimeHours]
+ ld a, [wGameTimeHours]
ld h, a
- ld a, [GameTimeHours + 1]
+ ld a, [wGameTimeHours + 1]
ld l, a
inc hl
@@ -113,19 +113,19 @@
cp LOW(1000)
jr c, .ok
- ld hl, GameTimeCap
+ ld hl, wGameTimeCap
set 0, [hl]
ld a, 59 ; 999:59:59.00
- ld [GameTimeMinutes], a
- ld [GameTimeSeconds], a
+ ld [wGameTimeMinutes], a
+ ld [wGameTimeSeconds], a
ret
.ok
ld a, h
- ld [GameTimeHours], a
+ ld [wGameTimeHours], a
ld a, l
- ld [GameTimeHours + 1], a
+ ld [wGameTimeHours + 1], a
ret
; 210f
--- a/home/init.asm
+++ b/home/init.asm
@@ -79,7 +79,7 @@
or c
jr nz, .ByteFill
- ld sp, Stack
+ ld sp, wStack
; Clear HRAM
ld a, [hCGB]
@@ -103,10 +103,10 @@
call ClearsScratch
- ld a, BANK(LoadPushOAM)
+ ld a, BANK(WriteOAMDMACodeToHRAM)
rst Bankswitch
- call LoadPushOAM
+ call WriteOAMDMACodeToHRAM
xor a
ld [hMapAnims], a
--- a/home/joypad.asm
+++ b/home/joypad.asm
@@ -129,7 +129,7 @@
; The player input can be automated using an input stream.
; See more below.
- ld a, [InputType]
+ ld a, [wInputType]
cp AUTO_INPUT
jr z, .auto
@@ -173,22 +173,22 @@
; Read from the input stream.
ld a, [hROMBank]
push af
- ld a, [AutoInputBank]
+ ld a, [wAutoInputBank]
rst Bankswitch
- ld hl, AutoInputAddress
+ ld hl, wAutoInputAddress
ld a, [hli]
ld h, [hl]
ld l, a
; We only update when the input duration has expired.
- ld a, [AutoInputLength]
+ ld a, [wAutoInputLength]
and a
jr z, .updateauto
; Until then, don't change anything.
dec a
- ld [AutoInputLength], a
+ ld [wAutoInputLength], a
pop af
rst Bankswitch
jr .quit
@@ -203,7 +203,7 @@
; A duration of $ff will end the stream indefinitely.
ld a, [hli]
- ld [AutoInputLength], a
+ ld [wAutoInputLength], a
cp -1
jr nz, .next
@@ -216,9 +216,9 @@
.next
; On to the next input...
ld a, l
- ld [AutoInputAddress], a
+ ld [wAutoInputAddress], a
ld a, h
- ld [AutoInputAddress+1], a
+ ld [wAutoInputAddress+1], a
jr .finishauto
.stopauto
@@ -238,14 +238,14 @@
StartAutoInput:: ; 9ee
; Start reading automated input stream at a:hl.
- ld [AutoInputBank], a
+ ld [wAutoInputBank], a
ld a, l
- ld [AutoInputAddress], a
+ ld [wAutoInputAddress], a
ld a, h
- ld [AutoInputAddress+1], a
+ ld [wAutoInputAddress+1], a
; Start reading the stream immediately.
xor a
- ld [AutoInputLength], a
+ ld [wAutoInputLength], a
; Reset input mirrors.
xor a
ld [hJoyPressed], a ; pressed this frame
@@ -253,7 +253,7 @@
ld [hJoyDown], a ; currently pressed
ld a, AUTO_INPUT
- ld [InputType], a
+ ld [wInputType], a
ret
; a0a
@@ -261,12 +261,12 @@
StopAutoInput:: ; a0a
; Clear variables related to automated input.
xor a
- ld [AutoInputBank], a
- ld [AutoInputAddress], a
- ld [AutoInputAddress+1], a
- ld [AutoInputLength], a
+ ld [wAutoInputBank], a
+ ld [wAutoInputAddress], a
+ ld [wAutoInputAddress+1], a
+ ld [wAutoInputLength], a
; Back to normal input.
- ld [InputType], a
+ ld [wInputType], a
ret
; a1b
@@ -336,11 +336,11 @@
and a
jr z, .checkframedelay
ld a, 15
- ld [TextDelayFrames], a
+ ld [wTextDelayFrames], a
ret
.checkframedelay
- ld a, [TextDelayFrames]
+ ld a, [wTextDelayFrames]
and a
jr z, .restartframedelay
xor a
@@ -349,7 +349,7 @@
.restartframedelay
ld a, 5
- ld [TextDelayFrames], a
+ ld [wTextDelayFrames], a
ret
; a80
@@ -411,7 +411,7 @@
push af
ld a, $1
ld [hOAMUpdate], a
- ld a, [InputType]
+ ld a, [wInputType]
or a
jr z, .input_wait_loop
farcall _DudeAutoInput_A
--- a/home/lcd.asm
+++ b/home/lcd.asm
@@ -6,7 +6,7 @@
cp rSCX - $ff00
ret nz
ld c, a
- ld a, [LYOverrides]
+ ld a, [wLYOverrides]
ld [$ff00+c], a
ret
; 552
@@ -22,7 +22,7 @@
push bc
ld a, [rLY]
ld c, a
- ld b, HIGH(LYOverrides)
+ ld b, HIGH(wLYOverrides)
ld a, [bc]
ld b, a
ld a, [hLCDCPointer]
--- a/home/map.asm
+++ b/home/map.asm
@@ -29,9 +29,9 @@
; Grabs the wram map scene script pointer for the current map and loads it into wCurrMapSceneScriptPointer.
; If there is no scene, both bytes of wCurrMapSceneScriptPointer are wiped clean.
; Copy the current map group and number into bc. This is needed for GetMapSceneID.
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
; Blank out wCurrMapSceneScriptPointer; this is the default scenario.
xor a
@@ -105,7 +105,7 @@
ld a, [hROMBank]
push af
- ld a, [TilesetBlocksBank]
+ ld a, [wTilesetBlocksBank]
rst Bankswitch
call LoadMetatiles
@@ -145,13 +145,13 @@
ld a, [de]
and a
jr nz, .ok
- ld a, [MapBorderBlock]
+ ld a, [wMapBorderBlock]
.ok
; Load the current wMisc address into de.
ld e, l
ld d, h
- ; Set hl to the address of the current metatile data ([TilesetBlocksAddress] + (a) tiles).
+ ; Set hl to the address of the current metatile data ([wTilesetBlocksAddress] + (a) tiles).
; This is buggy; it wraps around past 128 blocks.
; To fix, uncomment the line below.
add a ; Comment or delete this line to fix the above bug.
@@ -161,10 +161,10 @@
add hl, hl
add hl, hl
add hl, hl
- ld a, [TilesetBlocksAddress]
+ ld a, [wTilesetBlocksAddress]
add l
ld l, a
- ld a, [TilesetBlocksAddress + 1]
+ ld a, [wTilesetBlocksAddress + 1]
adc h
ld h, a
@@ -200,7 +200,7 @@
ld de, WMISC_WIDTH * 4
add hl, de
pop de
- ld a, [MapWidth]
+ ld a, [wMapWidth]
add 6
add e
ld e, a
@@ -259,10 +259,10 @@
; 2266
.GetDestinationWarpNumber: ; 2266
- ld a, [PlayerStandingMapY]
+ ld a, [wPlayerStandingMapY]
sub $4
ld e, a
- ld a, [PlayerStandingMapX]
+ ld a, [wPlayerStandingMapX]
sub $4
ld d, a
ld a, [wCurrMapWarpCount]
@@ -345,7 +345,7 @@
ld a, [hli]
cp $ff
jr nz, .skip
- ld hl, BackupWarpNumber
+ ld hl, wBackupWarpNumber
ld a, [hli]
.skip
@@ -358,9 +358,9 @@
ld a, c
ld [wPrevWarp], a
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld [wPrevMapGroup], a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld [wPrevMapNumber], a
scf
ret
@@ -422,7 +422,7 @@
ReadMapEvents:: ; 2336
push af
- ld hl, MapEventsPointer
+ ld hl, wMapEventsPointer
ld a, [hli]
ld h, [hl]
ld l, a
@@ -441,7 +441,7 @@
; 234f
ReadMapScripts:: ; 234f
- ld hl, MapScriptsPointer
+ ld hl, wMapScriptsPointer
ld a, [hli]
ld h, [hl]
ld l, a
@@ -464,35 +464,35 @@
GetMapConnections:: ; 2368
ld a, $ff
- ld [NorthConnectedMapGroup], a
- ld [SouthConnectedMapGroup], a
- ld [WestConnectedMapGroup], a
- ld [EastConnectedMapGroup], a
+ ld [wNorthConnectedMapGroup], a
+ ld [wSouthConnectedMapGroup], a
+ ld [wWestConnectedMapGroup], a
+ ld [wEastConnectedMapGroup], a
- ld a, [MapConnections]
+ ld a, [wMapConnections]
ld b, a
bit NORTH_F, b
jr z, .no_north
- ld de, NorthMapConnection
+ ld de, wNorthMapConnection
call GetMapConnection
.no_north
bit SOUTH_F, b
jr z, .no_south
- ld de, SouthMapConnection
+ ld de, wSouthMapConnection
call GetMapConnection
.no_south
bit WEST_F, b
jr z, .no_west
- ld de, WestMapConnection
+ ld de, wWestMapConnection
call GetMapConnection
.no_west
bit EAST_F, b
jr z, .no_east
- ld de, EastMapConnection
+ ld de, wEastMapConnection
call GetMapConnection
.no_east
@@ -501,7 +501,7 @@
GetMapConnection:: ; 23a3
; Load map connection struct at hl into de.
- ld c, SouthMapConnection - NorthMapConnection
+ ld c, wSouthMapConnection - wNorthMapConnection
.loop
ld a, [hli]
ld [de], a
@@ -601,7 +601,7 @@
push hl
call ClearObjectStructs
pop de
- ld hl, Map1Object
+ ld hl, wMap1Object
ld a, [de]
inc de
ld [wCurrMapObjectEventCount], a
@@ -671,13 +671,13 @@
; 2471
ClearObjectStructs:: ; 2471
- ld hl, Object1Struct
+ ld hl, wObject1Struct
ld bc, OBJECT_STRUCT_LENGTH * (NUM_OBJECT_STRUCTS - 1)
xor a
call ByteFill
; Just to make sure (this is rather pointless)
- ld hl, Object1Struct
+ ld hl, wObject1Struct
ld de, OBJECT_STRUCT_LENGTH
ld c, NUM_OBJECT_STRUCTS - 1
xor a
@@ -693,7 +693,7 @@
call GetMapScriptsBank
rst Bankswitch
- ld hl, MapEventsPointer
+ ld hl, wMapEventsPointer
ld a, [hli]
ld h, [hl]
ld l, a
@@ -700,7 +700,7 @@
inc hl ; get to the warp coords
inc hl ; get to the warp coords
inc hl ; get to the warp coords
- ld a, [WarpNumber]
+ ld a, [wWarpNumber]
dec a
ld c, a
ld b, 0
@@ -707,9 +707,9 @@
ld a, 5
call AddNTimes
ld a, [hli]
- ld [YCoord], a
+ ld [wYCoord], a
ld a, [hli]
- ld [XCoord], a
+ ld [wXCoord], a
; destination warp number
ld a, [hli]
cp $ff
@@ -723,17 +723,17 @@
.backup
ld a, [wPrevWarp]
- ld [BackupWarpNumber], a
+ ld [wBackupWarpNumber], a
ld a, [wPrevMapGroup]
- ld [BackupMapGroup], a
+ ld [wBackupMapGroup], a
ld a, [wPrevMapNumber]
- ld [BackupMapNumber], a
+ ld [wBackupMapNumber], a
ret
; 24cd
LoadBlockData:: ; 24cd
- ld hl, OverworldMap
- ld bc, OverworldMapEnd - OverworldMap
+ ld hl, wOverworldMap
+ ld bc, wOverworldMapEnd - wOverworldMap
ld a, 0
call ByteFill
call ChangeMap
@@ -747,8 +747,8 @@
ld a, [hROMBank]
push af
- ld hl, OverworldMap
- ld a, [MapWidth]
+ ld hl, wOverworldMap
+ ld a, [wMapWidth]
ld [hConnectedMapWidth], a
add $6
ld [hConnectionStripLength], a
@@ -759,14 +759,14 @@
add hl, bc
ld c, 3
add hl, bc
- ld a, [MapBlocksBank]
+ ld a, [wMapBlocksBank]
rst Bankswitch
- ld a, [MapBlocksPointer]
+ ld a, [wMapBlocksPointer]
ld e, a
- ld a, [MapBlocksPointer + 1]
+ ld a, [wMapBlocksPointer + 1]
ld d, a
- ld a, [MapHeight]
+ ld a, [wMapHeight]
ld b, a
.row
push hl
@@ -796,94 +796,94 @@
FillMapConnections:: ; 2524
; North
- ld a, [NorthConnectedMapGroup]
+ ld a, [wNorthConnectedMapGroup]
cp $ff
jr z, .South
ld b, a
- ld a, [NorthConnectedMapNumber]
+ ld a, [wNorthConnectedMapNumber]
ld c, a
call GetAnyMapBlocksBank
- ld a, [NorthConnectionStripPointer]
+ ld a, [wNorthConnectionStripPointer]
ld l, a
- ld a, [NorthConnectionStripPointer + 1]
+ ld a, [wNorthConnectionStripPointer + 1]
ld h, a
- ld a, [NorthConnectionStripLocation]
+ ld a, [wNorthConnectionStripLocation]
ld e, a
- ld a, [NorthConnectionStripLocation + 1]
+ ld a, [wNorthConnectionStripLocation + 1]
ld d, a
- ld a, [NorthConnectionStripLength]
+ ld a, [wNorthConnectionStripLength]
ld [hConnectionStripLength], a
- ld a, [NorthConnectedMapWidth]
+ ld a, [wNorthConnectedMapWidth]
ld [hConnectedMapWidth], a
call FillNorthConnectionStrip
.South:
- ld a, [SouthConnectedMapGroup]
+ ld a, [wSouthConnectedMapGroup]
cp $ff
jr z, .West
ld b, a
- ld a, [SouthConnectedMapNumber]
+ ld a, [wSouthConnectedMapNumber]
ld c, a
call GetAnyMapBlocksBank
- ld a, [SouthConnectionStripPointer]
+ ld a, [wSouthConnectionStripPointer]
ld l, a
- ld a, [SouthConnectionStripPointer + 1]
+ ld a, [wSouthConnectionStripPointer + 1]
ld h, a
- ld a, [SouthConnectionStripLocation]
+ ld a, [wSouthConnectionStripLocation]
ld e, a
- ld a, [SouthConnectionStripLocation + 1]
+ ld a, [wSouthConnectionStripLocation + 1]
ld d, a
- ld a, [SouthConnectionStripLength]
+ ld a, [wSouthConnectionStripLength]
ld [hConnectionStripLength], a
- ld a, [SouthConnectedMapWidth]
+ ld a, [wSouthConnectedMapWidth]
ld [hConnectedMapWidth], a
call FillSouthConnectionStrip
.West:
- ld a, [WestConnectedMapGroup]
+ ld a, [wWestConnectedMapGroup]
cp $ff
jr z, .East
ld b, a
- ld a, [WestConnectedMapNumber]
+ ld a, [wWestConnectedMapNumber]
ld c, a
call GetAnyMapBlocksBank
- ld a, [WestConnectionStripPointer]
+ ld a, [wWestConnectionStripPointer]
ld l, a
- ld a, [WestConnectionStripPointer + 1]
+ ld a, [wWestConnectionStripPointer + 1]
ld h, a
- ld a, [WestConnectionStripLocation]
+ ld a, [wWestConnectionStripLocation]
ld e, a
- ld a, [WestConnectionStripLocation + 1]
+ ld a, [wWestConnectionStripLocation + 1]
ld d, a
- ld a, [WestConnectionStripLength]
+ ld a, [wWestConnectionStripLength]
ld b, a
- ld a, [WestConnectedMapWidth]
+ ld a, [wWestConnectedMapWidth]
ld [hConnectionStripLength], a
call FillWestConnectionStrip
.East:
- ld a, [EastConnectedMapGroup]
+ ld a, [wEastConnectedMapGroup]
cp $ff
jr z, .Done
ld b, a
- ld a, [EastConnectedMapNumber]
+ ld a, [wEastConnectedMapNumber]
ld c, a
call GetAnyMapBlocksBank
- ld a, [EastConnectionStripPointer]
+ ld a, [wEastConnectionStripPointer]
ld l, a
- ld a, [EastConnectionStripPointer + 1]
+ ld a, [wEastConnectionStripPointer + 1]
ld h, a
- ld a, [EastConnectionStripLocation]
+ ld a, [wEastConnectionStripLocation]
ld e, a
- ld a, [EastConnectionStripLocation + 1]
+ ld a, [wEastConnectionStripLocation + 1]
ld d, a
- ld a, [EastConnectionStripLength]
+ ld a, [wEastConnectionStripLength]
ld b, a
- ld a, [EastConnectedMapWidth]
+ ld a, [wEastConnectedMapWidth]
ld [hConnectionStripLength], a
call FillEastConnectionStrip
@@ -915,7 +915,7 @@
add hl, de
pop de
- ld a, [MapWidth]
+ ld a, [wMapWidth]
add 6
add e
ld e, a
@@ -931,7 +931,7 @@
FillEastConnectionStrip:: ; 25f6
.loop
- ld a, [MapWidth]
+ ld a, [wMapWidth]
add 6
ld [hConnectedMapWidth], a
@@ -967,7 +967,7 @@
; 261b
LoadMapStatus:: ; 261b
- ld [MapStatus], a
+ ld [wMapStatus], a
ret
; 261f
@@ -974,14 +974,14 @@
CallScript:: ; 261f
; Call a script at a:hl.
- ld [ScriptBank], a
+ ld [wScriptBank], a
ld a, l
- ld [ScriptPos], a
+ ld [wScriptPos], a
ld a, h
- ld [ScriptPos + 1], a
+ ld [wScriptPos + 1], a
ld a, PLAYEREVENT_MAPSCRIPT
- ld [ScriptRunning], a
+ ld [wScriptRunning], a
scf
ret
@@ -989,7 +989,7 @@
CallMapScript:: ; 2631
; Call a script at hl in the current bank if there isn't already a script running
- ld a, [ScriptRunning]
+ ld a, [wScriptRunning]
and a
ret nz
call GetMapScriptsBank
@@ -1051,9 +1051,9 @@
ExecuteCallbackScript:: ; 2674
; Do map callback de and return to script bank b.
farcall CallCallback
- ld a, [ScriptMode]
+ ld a, [wScriptMode]
push af
- ld hl, ScriptFlags
+ ld hl, wScriptFlags
ld a, [hl]
push af
set 1, [hl]
@@ -1060,9 +1060,9 @@
farcall EnableScriptMode
farcall ScriptEvents
pop af
- ld [ScriptFlags], a
+ ld [wScriptFlags], a
pop af
- ld [ScriptMode], a
+ ld [wScriptMode], a
ret
; 269a
@@ -1126,16 +1126,16 @@
; 26d4
GetScriptByte:: ; 0x26d4
-; Return byte at ScriptBank:ScriptPos in a.
+; Return byte at wScriptBank:wScriptPos in a.
push hl
push bc
ld a, [hROMBank]
push af
- ld a, [ScriptBank]
+ ld a, [wScriptBank]
rst Bankswitch
- ld hl, ScriptPos
+ ld hl, wScriptPos
ld c, [hl]
inc hl
ld b, [hl]
@@ -1215,7 +1215,7 @@
ScrollMapDown:: ; 272a
hlcoord 0, 0
- ld de, BGMapBuffer
+ ld de, wBGMapBuffer
call BackupBGMapRow
ld c, 2 * SCREEN_WIDTH
call FarCallScrollBGMapPalettes
@@ -1231,7 +1231,7 @@
ScrollMapUp:: ; 2748
hlcoord 0, SCREEN_HEIGHT - 2
- ld de, BGMapBuffer
+ ld de, wBGMapBuffer
call BackupBGMapRow
ld c, 2 * SCREEN_WIDTH
call FarCallScrollBGMapPalettes
@@ -1255,7 +1255,7 @@
ScrollMapRight:: ; 2771
hlcoord 0, 0
- ld de, BGMapBuffer
+ ld de, wBGMapBuffer
call BackupBGMapColumn
ld c, 2 * SCREEN_HEIGHT
call FarCallScrollBGMapPalettes
@@ -1271,7 +1271,7 @@
ScrollMapLeft:: ; 278f
hlcoord SCREEN_WIDTH - 2, 0
- ld de, BGMapBuffer
+ ld de, wBGMapBuffer
call BackupBGMapColumn
ld c, 2 * SCREEN_HEIGHT
call FarCallScrollBGMapPalettes
@@ -1325,7 +1325,7 @@
; 27d3
UpdateBGMapRow:: ; 27d3
- ld hl, BGMapBufferPtrs
+ ld hl, wBGMapBufferPtrs
push de
call .iteration
pop de
@@ -1357,7 +1357,7 @@
; 27f8
UpdateBGMapColumn:: ; 27f8
- ld hl, BGMapBufferPtrs
+ ld hl, wBGMapBufferPtrs
ld c, SCREEN_HEIGHT
.loop
ld a, e
@@ -1384,8 +1384,8 @@
; 2816
Unreferenced_Function2816::
- ld hl, BGMapBuffer
- ld bc, BGMapBufferEnd - BGMapBuffer
+ ld hl, wBGMapBuffer
+ ld bc, wBGMapBufferEnd - wBGMapBuffer
xor a
call ByteFill
ret
@@ -1392,11 +1392,11 @@
; 2821
LoadTilesetGFX:: ; 2821
- ld hl, TilesetAddress
+ ld hl, wTilesetAddress
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [TilesetBank]
+ ld a, [wTilesetBank]
ld e, a
ld a, [rSVBK]
@@ -1430,7 +1430,7 @@
ld [rSVBK], a
; These tilesets support dynamic per-mapgroup roof tiles.
- ld a, [wTileset]
+ ld a, [wMapTileset]
cp TILESET_JOHTO
jr z, .load_roof
cp TILESET_JOHTO_MODERN
@@ -1466,7 +1466,7 @@
dec b
jr nz, .col
pop hl
- ld a, [MapWidth]
+ ld a, [wMapWidth]
add $6
ld c, a
ld b, $0
@@ -1483,7 +1483,7 @@
ld h, [hl]
ld l, a
ld de, wScreenSave
- ld a, [MapWidth]
+ ld a, [wMapWidth]
add 6
ld [hMapObjectIndexBuffer], a
ld a, [wPlayerStepDirection]
@@ -1529,7 +1529,7 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [MapWidth]
+ ld a, [wMapWidth]
add 6
ld [hConnectionStripLength], a
ld de, wScreenSave
@@ -1568,20 +1568,20 @@
GetMovementPermissions:: ; 2914
xor a
- ld [TilePermissions], a
+ ld [wTilePermissions], a
call .LeftRight
call .UpDown
; get coords of current tile
- ld a, [PlayerStandingMapX]
+ ld a, [wPlayerStandingMapX]
ld d, a
- ld a, [PlayerStandingMapY]
+ ld a, [wPlayerStandingMapY]
ld e, a
call GetCoordTile
- ld [PlayerStandingTile], a
+ ld [wPlayerStandingTile], a
call .CheckHiNybble
ret nz
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
and 7
ld hl, .MovementPermissionsData
add l
@@ -1590,7 +1590,7 @@
adc h
ld h, a
ld a, [hl]
- ld hl, TilePermissions
+ ld hl, wTilePermissions
or [hl]
ld [hl], a
ret
@@ -1608,41 +1608,41 @@
; 294d
.UpDown:
- ld a, [PlayerStandingMapX]
+ ld a, [wPlayerStandingMapX]
ld d, a
- ld a, [PlayerStandingMapY]
+ ld a, [wPlayerStandingMapY]
ld e, a
push de
inc e
call GetCoordTile
- ld [TileDown], a
+ ld [wTileDown], a
call .Down
pop de
dec e
call GetCoordTile
- ld [TileUp], a
+ ld [wTileUp], a
call .Up
ret
; 296c
.LeftRight:
- ld a, [PlayerStandingMapX]
+ ld a, [wPlayerStandingMapX]
ld d, a
- ld a, [PlayerStandingMapY]
+ ld a, [wPlayerStandingMapY]
ld e, a
push de
dec d
call GetCoordTile
- ld [TileLeft], a
+ ld [wTileLeft], a
call .Left
pop de
inc d
call GetCoordTile
- ld [TileRight], a
+ ld [wTileRight], a
call .Right
ret
; 298b
@@ -1650,7 +1650,7 @@
.Down:
call .CheckHiNybble
ret nz
- ld a, [TileDown]
+ ld a, [wTileDown]
and 7
cp $2
jr z, .ok_down
@@ -1660,9 +1660,9 @@
ret nz
.ok_down
- ld a, [TilePermissions]
+ ld a, [wTilePermissions]
or FACE_DOWN
- ld [TilePermissions], a
+ ld [wTilePermissions], a
ret
; 29a8
@@ -1669,7 +1669,7 @@
.Up:
call .CheckHiNybble
ret nz
- ld a, [TileUp]
+ ld a, [wTileUp]
and 7
cp $3
jr z, .ok_up
@@ -1679,9 +1679,9 @@
ret nz
.ok_up
- ld a, [TilePermissions]
+ ld a, [wTilePermissions]
or FACE_UP
- ld [TilePermissions], a
+ ld [wTilePermissions], a
ret
; 29c5
@@ -1688,7 +1688,7 @@
.Right:
call .CheckHiNybble
ret nz
- ld a, [TileRight]
+ ld a, [wTileRight]
and 7
cp $1
jr z, .ok_right
@@ -1698,9 +1698,9 @@
ret nz
.ok_right
- ld a, [TilePermissions]
+ ld a, [wTilePermissions]
or FACE_RIGHT
- ld [TilePermissions], a
+ ld [wTilePermissions], a
ret
; 29e2
@@ -1707,7 +1707,7 @@
.Left:
call .CheckHiNybble
ret nz
- ld a, [TileLeft]
+ ld a, [wTileLeft]
and 7
cp $0
jr z, .ok_left
@@ -1717,9 +1717,9 @@
ret nz
.ok_left
- ld a, [TilePermissions]
+ ld a, [wTilePermissions]
or FACE_LEFT
- ld [TilePermissions], a
+ ld [wTilePermissions], a
ret
; 29ff
@@ -1735,7 +1735,7 @@
; Return map coordinates in (d, e) and tile id in a
; of the tile the player is facing.
- ld a, [PlayerDirection]
+ ld a, [wPlayerDirection]
and %1100
srl a
srl a
@@ -1755,10 +1755,10 @@
ld h, [hl]
ld l, a
- ld a, [PlayerStandingMapX]
+ ld a, [wPlayerStandingMapX]
add d
ld d, a
- ld a, [PlayerStandingMapY]
+ ld a, [wPlayerStandingMapY]
add e
ld e, a
ld a, [hl]
@@ -1767,13 +1767,13 @@
.Directions:
; x, y
db 0, 1
- dw TileDown
+ dw wTileDown
db 0, -1
- dw TileUp
+ dw wTileUp
db -1, 0
- dw TileLeft
+ dw wTileLeft
db 1, 0
- dw TileRight
+ dw wTileRight
; 2a3c
GetCoordTile:: ; 2a3c
@@ -1786,9 +1786,9 @@
ld h, $0
add hl, hl
add hl, hl
- ld a, [TilesetCollisionAddress]
+ ld a, [wTilesetCollisionAddress]
ld c, a
- ld a, [TilesetCollisionAddress + 1]
+ ld a, [wTilesetCollisionAddress + 1]
ld b, a
add hl, bc
rr d
@@ -1802,7 +1802,7 @@
inc hl
.nocarry2
- ld a, [TilesetCollisionBank]
+ ld a, [wTilesetCollisionBank]
call GetFarByte
ret
@@ -1812,11 +1812,11 @@
; 2a66
GetBlockLocation:: ; 2a66
- ld a, [MapWidth]
+ ld a, [wMapWidth]
add 6
ld c, a
ld b, 0
- ld hl, OverworldMap + 1
+ ld hl, wOverworldMap + 1
add hl, bc
ld a, e
srl a
@@ -1869,7 +1869,7 @@
; 2aaa
CheckIfFacingTileCoordIsBGEvent:: ; 2aaa
-; Checks to see if you are facing a BG event. If so, copies it into EngineBuffer1 and sets carry.
+; Checks to see if you are facing a BG event. If so, copies it into wEngineBuffer1 and sets carry.
ld hl, wCurrMapBGEventsPointer
ld a, [hli]
ld h, [hl]
@@ -1924,7 +1924,7 @@
ret
.CoordEventCheck:
-; Checks to see if you are standing on a coord event. If yes, copies the event to EngineBuffer1 and sets carry.
+; Checks to see if you are standing on a coord event. If yes, copies the event to wEngineBuffer1 and sets carry.
ld hl, wCurrMapCoordEventsPointer
ld a, [hli]
ld h, [hl]
@@ -1933,10 +1933,10 @@
call CheckScenes
ld b, a
; Load your current coordinates into de. This will be used to check if your position is in the coord event table for the current map.
- ld a, [PlayerStandingMapX]
+ ld a, [wPlayerStandingMapX]
sub 4
ld d, a
- ld a, [PlayerStandingMapY]
+ ld a, [wPlayerStandingMapY]
sub 4
ld e, a
@@ -2025,7 +2025,7 @@
hlcoord 0, 12
lb bc, 4, 18
call TextBox
- ld hl, VramState
+ ld hl, wVramState
set 0, [hl]
call UpdateSprites
call WaitBGMap2
@@ -2048,9 +2048,9 @@
call LoadFontsExtra
ld a, [hROMBank]
push af
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call SwitchToAnyMapDataBank
farcall UpdateTimeOfDayPal
@@ -2066,9 +2066,9 @@
; 2be5
GetMapDefPointer:: ; 2be5
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
GetAnyMapDefPointer:: ; 0x2bed
; Prior to calling this function, you must have switched banks so that
@@ -2112,9 +2112,9 @@
; bc = data from the current map's map_def
; (e.g., de = MAPDEF_TILESET would return a pointer to the tileset id)
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
GetAnyMapDefField:: ; 0x2c0c
; bankswitch
@@ -2136,9 +2136,9 @@
; 0x2c1c
SwitchToMapDataBank:: ; 2c1c
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
SwitchToAnyMapDataBank:: ; 2c24
call GetAnyMapDataBank
@@ -2147,9 +2147,9 @@
; 2c29
GetMapDataBank:: ; 2c29
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
GetAnyMapDataBank:: ; 2c31
push hl
@@ -2181,13 +2181,13 @@
; 2c52
SwitchToMapScriptsBank:: ; 2c52
- ld a, [MapScriptsBank]
+ ld a, [wMapScriptsBank]
rst Bankswitch
ret
; 2c57
GetMapScriptsBank:: ; 2c57
- ld a, [MapScriptsBank]
+ ld a, [wMapScriptsBank]
ret
; 2c5b
@@ -2377,12 +2377,12 @@
push bc
ld hl, Tilesets
- ld bc, TilesetEnd - Tileset
- ld a, [wTileset]
+ ld bc, wTilesetEnd - wTileset
+ ld a, [wMapTileset]
call AddNTimes
- ld de, TilesetBank
- ld bc, TilesetEnd - Tileset
+ ld de, wTilesetBank
+ ld bc, wTilesetEnd - wTileset
ld a, BANK(Tilesets)
call FarCopyBytes
--- a/home/map_objects.asm
+++ b/home/map_objects.asm
@@ -18,7 +18,7 @@
GetSpriteVTile:: ; 180e
push hl
push bc
- ld hl, UsedSprites + 2
+ ld hl, wUsedSprites + 2
ld c, SPRITE_GFX_LIST_CAPACITY - 1
ld b, a
ld a, [hMapObjectIndexBuffer]
@@ -32,12 +32,12 @@
inc hl
dec c
jr nz, .loop
- ld a, [UsedSprites + 1]
+ ld a, [wUsedSprites + 1]
scf
jr .done
.nope
- ld a, [UsedSprites + 1]
+ ld a, [wUsedSprites + 1]
jr .done
.found
@@ -75,7 +75,7 @@
; 184a
GetPlayerStandingTile:: ; 184a
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
call GetTileCollision
ld b, a
ret
@@ -82,7 +82,7 @@
; 1852
CheckOnWater:: ; 1852
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
call GetTileCollision
sub WATERTILE
ret z
@@ -204,7 +204,7 @@
; 18c3
CheckStandingOnEntrance:: ; 18c3
- ld a, [PlayerStandingTile]
+ ld a, [wPlayerStandingTile]
cp COLL_DOOR
ret z
cp COLL_DOOR_79
@@ -217,7 +217,7 @@
GetMapObject:: ; 18d2
; Return the location of map object a in bc.
- ld hl, MapObjects
+ ld hl, wMapObjects
ld bc, OBJECT_LENGTH
call AddNTimes
ld b, h
@@ -256,7 +256,7 @@
cp -1
jr z, .timeofday_always
ld hl, .TimeOfDayValues_191e
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
add l
ld l, a
jr nc, .ok
@@ -434,7 +434,7 @@
add hl, bc
ld [hl], STEP_TYPE_00
- ld hl, VramState
+ ld hl, wVramState
set 7, [hl]
and a
ret
@@ -446,7 +446,7 @@
; Preserves BC and DE.
push bc
push de
- ld hl, ObjectStructs
+ ld hl, wObjectStructs
ld de, OBJECT_STRUCT_LENGTH
ld c, NUM_OBJECT_STRUCTS
.loop
@@ -604,19 +604,19 @@
; 1ac6
SetVramState_Bit0:: ; 1ac6
- ld hl, VramState
+ ld hl, wVramState
set 0, [hl]
ret
; 1acc
ResetVramState_Bit0:: ; 1acc
- ld hl, VramState
+ ld hl, wVramState
res 0, [hl]
ret
; 1ad2
UpdateSprites:: ; 1ad2
- ld a, [VramState]
+ ld a, [wVramState]
bit 0, a
ret z
@@ -627,7 +627,7 @@
GetObjectStruct:: ; 1ae5
ld bc, OBJECT_STRUCT_LENGTH
- ld hl, ObjectStructs
+ ld hl, wObjectStructs
call AddNTimes
ld b, h
ld c, l
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -315,7 +315,7 @@
ld a, [de]
cp -1
ret z
- ld [MenuSelection], a
+ ld [wMenuSelection], a
push de
push hl
ld d, h
@@ -405,7 +405,7 @@
ld h, $0
add hl, de
ld a, [hl]
- ld [MenuSelection], a
+ ld [wMenuSelection], a
ld a, [wMenuCursorY]
ld [wMenuCursorBuffer], a
and a
@@ -415,7 +415,7 @@
ld a, B_BUTTON
ld [wMenuJoypad], a
ld a, -1
- ld [MenuSelection], a
+ ld [wMenuSelection], a
scf
ret
; 1f79
@@ -426,7 +426,7 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
call GetNthString
ld d, h
ld e, l
@@ -437,7 +437,7 @@
PlaceNthMenuStrings:: ; 1f8d
push de
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
call GetMenuDataPointerTableEntry
inc hl
inc hl
@@ -460,7 +460,7 @@
; 1fa7
MenuJumptable:: ; 1fa7
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
call GetMenuDataPointerTableEntry
ld a, [hli]
ld h, [hl]
--- a/home/mobile.asm
+++ b/home/mobile.asm
@@ -146,7 +146,7 @@
Function3eea:: ; 3eea
push hl
push bc
- ld de, AttrMap - TileMap
+ ld de, wAttrMap - wTileMap
add hl, de
inc b
inc b
@@ -173,7 +173,7 @@
.fill_attr
push hl
push bc
- ld de, AttrMap - TileMap
+ ld de, wAttrMap - wTileMap
add hl, de
inc b
inc b
@@ -187,7 +187,7 @@
; 3f20
Function3f20:: ; 3f20
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld b, 6
ld c, 20
call Function3f35
--- a/home/movement.asm
+++ b/home/movement.asm
@@ -4,9 +4,9 @@
ld [wMovementBufferCount], a
ld a, $0 ; useless
ld [wUnusedMovementBufferBank], a
- ld a, LOW(MovementBuffer)
+ ld a, LOW(wMovementBuffer)
ld [wUnusedMovementBufferPointer], a
- ld a, HIGH(MovementBuffer)
+ ld a, HIGH(wMovementBuffer)
ld [wUnusedMovementBufferPointer + 1], a
ret
; 1b35
@@ -27,7 +27,7 @@
ld e, [hl]
inc [hl]
ld d, 0
- ld hl, MovementBuffer
+ ld hl, wMovementBuffer
add hl, de
ld [hl], a
pop de
--- a/home/names.asm
+++ b/home/names.asm
@@ -4,14 +4,14 @@
dba MoveNames ; MOVE_NAME
dbw 0, NULL ; DUMMY_NAME
dba ItemNames ; ITEM_NAME
- dbw 0, PartyMonOT ; PARTY_OT_NAME
- dbw 0, OTPartyMonOT ; ENEMY_OT_NAME
+ dbw 0, wPartyMonOT ; PARTY_OT_NAME
+ dbw 0, wOTPartyMonOT ; ENEMY_OT_NAME
dba TrainerClassNames ; TRAINER_NAME
dbw 4, MoveDescriptions ; MOVE_DESC_NAME_BROKEN (wrong bank)
; 33c3
GetName:: ; 33c3
-; Return name CurSpecies from name list wNamedObjectTypeBuffer in StringBuffer1.
+; Return name wCurSpecies from name list wNamedObjectTypeBuffer in wStringBuffer1.
ld a, [hROMBank]
push af
@@ -23,7 +23,7 @@
cp MON_NAME
jr nz, .NotPokeName
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
ld [wd265], a
call GetPokemonName
ld hl, MON_NAME_LENGTH
@@ -47,11 +47,11 @@
ld h, [hl]
ld l, a
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
dec a
call GetNthString
- ld de, StringBuffer1
+ ld de, wStringBuffer1
ld bc, ITEM_NAME_LENGTH
call CopyBytes
@@ -95,7 +95,7 @@
push hl
call GetPokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
.loop
ld a, [hl]
cp "@"
@@ -138,11 +138,11 @@
add hl, de
; Terminator
- ld de, StringBuffer1
+ ld de, wStringBuffer1
push de
ld bc, MON_NAME_LENGTH - 1
call CopyBytes
- ld hl, StringBuffer1 + MON_NAME_LENGTH - 1
+ ld hl, wStringBuffer1 + MON_NAME_LENGTH - 1
ld [hl], "@"
pop de
@@ -162,7 +162,7 @@
cp TM01
jr nc, .TM
- ld [CurSpecies], a
+ ld [wCurSpecies], a
ld a, ITEM_NAME
ld [wNamedObjectTypeBuffer], a
call GetName
@@ -170,7 +170,7 @@
.TM:
call GetTMHMName
.Copied:
- ld de, StringBuffer1
+ ld de, wStringBuffer1
pop bc
pop hl
ret
@@ -199,7 +199,7 @@
ld bc, .TMTextEnd - .TMText
.asm_34a1
- ld de, StringBuffer1
+ ld de, wStringBuffer1
call CopyBytes
; TM/HM number
@@ -268,10 +268,10 @@
ld [wNamedObjectTypeBuffer], a
ld a, [wNamedObjectIndexBuffer] ; move id
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetName
- ld de, StringBuffer1
+ ld de, wStringBuffer1
pop hl
ret
--- a/home/pokedex_flags.asm
+++ b/home/pokedex_flags.asm
@@ -1,7 +1,7 @@
SetSeenAndCaughtMon:: ; 3380
push af
ld c, a
- ld hl, PokedexCaught
+ ld hl, wPokedexCaught
ld b, SET_FLAG
call PokedexFlagAction
pop af
@@ -10,7 +10,7 @@
SetSeenMon:: ; 338b
ld c, a
- ld hl, PokedexSeen
+ ld hl, wPokedexSeen
ld b, SET_FLAG
jr PokedexFlagAction
; 3393
@@ -17,7 +17,7 @@
CheckCaughtMon:: ; 3393
ld c, a
- ld hl, PokedexCaught
+ ld hl, wPokedexCaught
ld b, CHECK_FLAG
jr PokedexFlagAction
; 339b
@@ -24,7 +24,7 @@
CheckSeenMon:: ; 339b
ld c, a
- ld hl, PokedexSeen
+ ld hl, wPokedexSeen
ld b, CHECK_FLAG
; fallthrough
; 33a1
--- a/home/predef.asm
+++ b/home/predef.asm
@@ -2,13 +2,13 @@
; Call predefined function a.
; Preserves bc, de, hl and f.
- ld [PredefID], a
+ ld [wPredefID], a
ld a, [hROMBank]
push af
ld a, BANK(GetPredefPointer)
rst Bankswitch
- call GetPredefPointer ; stores hl in PredefTemp
+ call GetPredefPointer ; stores hl in wPredefTemp
; Switch to the new function's bank
rst Bankswitch
@@ -20,16 +20,16 @@
push hl
; Call the Predef function
- ld a, [PredefAddress]
+ ld a, [wPredefAddress]
ld h, a
- ld a, [PredefAddress + 1]
+ ld a, [wPredefAddress + 1]
ld l, a
push hl
; Get hl back
- ld a, [PredefTemp]
+ ld a, [wPredefTemp]
ld h, a
- ld a, [PredefTemp + 1]
+ ld a, [wPredefTemp + 1]
ld l, a
ret
@@ -37,17 +37,17 @@
; Clean up after the Predef call
ld a, h
- ld [PredefTemp], a
+ ld [wPredefTemp], a
ld a, l
- ld [PredefTemp+1], a
+ ld [wPredefTemp+1], a
pop hl
ld a, h
rst Bankswitch
- ld a, [PredefTemp]
+ ld a, [wPredefTemp]
ld h, a
- ld a, [PredefTemp + 1]
+ ld a, [wPredefTemp + 1]
ld l, a
ret
; 2dba
--- a/home/random.asm
+++ b/home/random.asm
@@ -42,10 +42,10 @@
call _BattleRandom
- ld [PredefTemp + 1], a
+ ld [wPredefTemp + 1], a
pop af
rst Bankswitch
- ld a, [PredefTemp + 1]
+ ld a, [wPredefTemp + 1]
ret
; 2fb1
--- a/home/rtc.asm
+++ b/home/rtc.asm
@@ -9,7 +9,7 @@
call UpdateTime
; obj update on?
- ld a, [VramState]
+ ld a, [wVramState]
bit 0, a ; obj update
ret z
--- a/home/text.asm
+++ b/home/text.asm
@@ -22,11 +22,11 @@
ClearTileMap:: ; fc8
-; Fill TileMap with blank tiles.
+; Fill wTileMap with blank tiles.
hlcoord 0, 0
ld a, " "
- ld bc, TileMapEnd - TileMap
+ ld bc, wTileMapEnd - wTileMap
call ByteFill
; Update the BG Map.
@@ -39,7 +39,7 @@
ClearScreen:: ; fdb
ld a, PAL_BG_TEXT
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
jr ClearTileMap
@@ -111,7 +111,7 @@
TextBoxPalette:: ; 1024
; Fill text box width c height b at hl with pal 7
- ld de, AttrMap - TileMap
+ ld de, wAttrMap - wTileMap
add hl, de
inc b
inc b
@@ -313,11 +313,11 @@
jp PlaceCommandCharacter
ENDM
-PrintMomsName: print_name MomsName ; 1186
-PrintPlayerName: print_name PlayerName ; 118d
-PrintRivalName: print_name RivalName ; 1194
-PrintRedsName: print_name RedsName ; 119b
-PrintGreensName: print_name GreensName ; 11a2
+PrintMomsName: print_name wMomsName ; 1186
+PrintPlayerName: print_name wPlayerName ; 118d
+PrintRivalName: print_name wRivalName ; 1194
+PrintRedsName: print_name wRedsName ; 119b
+PrintGreensName: print_name wGreensName ; 11a2
TrainerChar: print_name TrainerCharText ; 11a9
TMChar: print_name TMCharText ; 11b0
@@ -346,7 +346,7 @@
and a
jr nz, .enemy
- ld de, BattleMonNick
+ ld de, wBattleMonNick
jr PlaceCommandCharacter
.enemy
@@ -354,7 +354,7 @@
call PlaceString
ld h, b
ld l, c
- ld de, EnemyMonNick
+ ld de, wEnemyMonNick
jr PlaceCommandCharacter
@@ -365,13 +365,13 @@
and a
jr nz, .linkbattle
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
cp RIVAL1
jr z, .rival
cp RIVAL2
jr z, .rival
- ld de, OTClassName
+ ld de, wOTClassName
call PlaceString
ld h, b
ld l, c
@@ -380,21 +380,21 @@
push bc
callfar Battle_GetTrainerName
pop hl
- ld de, StringBuffer1
+ ld de, wStringBuffer1
jr PlaceCommandCharacter
.rival
- ld de, RivalName
+ ld de, wRivalName
jr PlaceCommandCharacter
.linkbattle
- ld de, OTClassName
+ ld de, wOTClassName
jr PlaceCommandCharacter
PlaceGenderedPlayerName:: ; 1252
push de
- ld de, PlayerName
+ ld de, wPlayerName
call PlaceString
ld h, b
ld l, c
@@ -452,7 +452,7 @@
TextFar:: ; 12b9
pop hl
push de
- ld bc, -TileMap + $10000
+ ld bc, -wTileMap + $10000
add hl, bc
ld de, -SCREEN_WIDTH
ld c, 1
@@ -696,15 +696,15 @@
PlaceHLTextAtBC:: ; 13e5
- ld a, [TextBoxFlags]
+ ld a, [wTextBoxFlags]
push af
set NO_TEXT_DELAY_F, a
- ld [TextBoxFlags], a
+ ld [wTextBoxFlags], a
call DoTextUntilTerminator
pop af
- ld [TextBoxFlags], a
+ ld [wTextBoxFlags], a
ret
; 13f6
@@ -1082,13 +1082,13 @@
Text_TX_STRINGBUFFER:: ; 156a
; Print a string from one of the following:
-; 0: StringBuffer3
-; 1: StringBuffer4
-; 2: StringBuffer5
-; 3: StringBuffer2
-; 4: StringBuffer1
-; 5: EnemyMonNick
-; 6: BattleMonNick
+; 0: wStringBuffer3
+; 1: wStringBuffer4
+; 2: wStringBuffer5
+; 3: wStringBuffer2
+; 4: wStringBuffer1
+; 5: wEnemyMonNick
+; 6: wBattleMonNick
; [$14][id]
ld a, [hli]
--- a/home/tilemap.asm
+++ b/home/tilemap.asm
@@ -117,7 +117,7 @@
inc hl
ld d, [hl]
call GetMenuTextStartCoord
- call Coord2Tile ; hl now contains the TileMap address where we will start printing text.
+ call Coord2Tile ; hl now contains the tilemap address where we will start printing text.
inc de
ld a, [de] ; Number of items
inc de
@@ -207,7 +207,7 @@
Coord2Tile:: ; 1d05
-; Return the address of TileMap(c, b) in hl.
+; Return the address of wTileMap(c, b) in hl.
xor a
ld h, a
ld l, b
@@ -235,7 +235,7 @@
ld b, a
Coord2Attr:: ; 1d21
-; Return the address of AttrMap(c, b) in hl.
+; Return the address of wAttrMap(c, b) in hl.
xor a
ld h, a
ld l, b
@@ -251,7 +251,7 @@
xor a
ld b, a
add hl, bc
- bccoord 0, 0, AttrMap
+ bccoord 0, 0, wAttrMap
add hl, bc
ret
; 1d35
--- a/home/time.asm
+++ b/home/time.asm
@@ -140,12 +140,12 @@
FixTime:: ; 61d
; add ingame time (set at newgame) to current time
; day hr min sec
-; store time in CurDay, hHours, hMinutes, hSeconds
+; store time in wCurDay, hHours, hMinutes, hSeconds
; second
ld a, [hRTCSeconds] ; S
ld c, a
- ld a, [StartSecond]
+ ld a, [wStartSecond]
add c
sub 60
jr nc, .updatesec
@@ -157,7 +157,7 @@
ccf ; carry is set, so turn it off
ld a, [hRTCMinutes] ; M
ld c, a
- ld a, [StartMinute]
+ ld a, [wStartMinute]
adc c
sub 60
jr nc, .updatemin
@@ -169,7 +169,7 @@
ccf ; carry is set, so turn it off
ld a, [hRTCHours] ; H
ld c, a
- ld a, [StartHour]
+ ld a, [wStartHour]
adc c
sub 24
jr nc, .updatehr
@@ -181,27 +181,27 @@
ccf ; carry is set, so turn it off
ld a, [hRTCDayLo] ; DL
ld c, a
- ld a, [StartDay]
+ ld a, [wStartDay]
adc c
- ld [CurDay], a
+ ld [wCurDay], a
ret
; 658
SetTimeOfDay:: ; 658
xor a
- ld [StringBuffer2], a
+ ld [wStringBuffer2], a
ld a, $0 ; useless
- ld [StringBuffer2 + 3], a
+ ld [wStringBuffer2 + 3], a
jr InitTime
SetDayOfWeek:: ; 663
call UpdateTime
ld a, [hHours]
- ld [StringBuffer2 + 1], a
+ ld [wStringBuffer2 + 1], a
ld a, [hMinutes]
- ld [StringBuffer2 + 2], a
+ ld [wStringBuffer2 + 2], a
ld a, [hSeconds]
- ld [StringBuffer2 + 3], a
+ ld [wStringBuffer2 + 3], a
jr InitTime ; useless
InitTime:: ; 677
--- a/home/trainers.asm
+++ b/home/trainers.asm
@@ -16,7 +16,7 @@
; Skip the player object.
ld a, 1
- ld de, MapObjects + OBJECT_LENGTH
+ ld de, wMapObjects + OBJECT_LENGTH
.loop
@@ -97,21 +97,21 @@
pop af
ld [hLastTalked], a
ld a, b
- ld [EngineBuffer2], a
+ ld [wEngineBuffer2], a
ld a, c
- ld [EngineBuffer3], a
+ ld [wEngineBuffer3], a
jr LoadTrainer_continue
; 3674
TalkToTrainer:: ; 3674
ld a, 1
- ld [EngineBuffer2], a
+ ld [wEngineBuffer2], a
ld a, -1
- ld [EngineBuffer3], a
+ ld [wEngineBuffer3], a
LoadTrainer_continue:: ; 367e
call GetMapScriptsBank
- ld [EngineBuffer1], a
+ ld [wEngineBuffer1], a
ld a, [hLastTalked]
call GetMapObject
@@ -118,11 +118,11 @@
ld hl, MAPOBJECT_SCRIPT_POINTER
add hl, bc
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
call GetFarHalfword
ld de, wTempTrainer
ld bc, wTempTrainerEnd - wTempTrainer
- ld a, [EngineBuffer1]
+ ld a, [wEngineBuffer1]
call FarCopyBytes
xor a
ld [wRunningTrainerBattleScript], a
@@ -152,11 +152,11 @@
add hl, bc
ld e, [hl]
- ld a, [PlayerStandingMapX]
+ ld a, [wPlayerStandingMapX]
cp d
jr z, .CheckY
- ld a, [PlayerStandingMapY]
+ ld a, [wPlayerStandingMapY]
cp e
jr z, .CheckX
@@ -164,7 +164,7 @@
ret
.CheckY:
- ld a, [PlayerStandingMapY]
+ ld a, [wPlayerStandingMapY]
sub e
jr z, .NotFacing
jr nc, .Above
@@ -182,7 +182,7 @@
jr .CheckFacing
.CheckX:
- ld a, [PlayerStandingMapX]
+ ld a, [wPlayerStandingMapX]
sub d
jr z, .NotFacing
jr nc, .Left
@@ -236,7 +236,7 @@
; 3718
PrintWinLossText:: ; 3718
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_CANLOSE
jr .canlose ; ??????????
--- a/home/vblank.asm
+++ b/home/vblank.asm
@@ -113,7 +113,7 @@
ld a, [hOAMUpdate]
and a
jr nz, .done_oam
- call hPushOAM
+ call hTransferVirtualOAM
.done_oam
@@ -120,20 +120,20 @@
; vblank-sensitive operations are done
xor a
- ld [VBlankOccurred], a
+ ld [wVBlankOccurred], a
- ld a, [OverworldDelay]
+ ld a, [wOverworldDelay]
and a
jr z, .ok
dec a
- ld [OverworldDelay], a
+ ld [wOverworldDelay], a
.ok
- ld a, [TextDelayFrames]
+ ld a, [wTextDelayFrames]
and a
jr z, .ok2
dec a
- ld [TextDelayFrames], a
+ ld [wTextDelayFrames], a
.ok2
call Joypad
@@ -165,7 +165,7 @@
rst Bankswitch
xor a
- ld [VBlankOccurred], a
+ ld [wVBlankOccurred], a
ret
; 337
@@ -192,11 +192,11 @@
call UpdateBGMap
call Serve2bppRequest_VBlank
- call hPushOAM
+ call hTransferVirtualOAM
.done
xor a
- ld [VBlankOccurred], a
+ ld [wVBlankOccurred], a
; get requested ints
ld a, [rIF]
@@ -282,11 +282,11 @@
call UpdateBGMap
call Serve2bppRequest_VBlank
- call hPushOAM
+ call hTransferVirtualOAM
.done
xor a
- ld [VBlankOccurred], a
+ ld [wVBlankOccurred], a
ld a, [rIF]
push af
@@ -338,12 +338,12 @@
call UpdateBGMap
call Serve2bppRequest
- call hPushOAM
+ call hTransferVirtualOAM
call Joypad
xor a
- ld [VBlankOccurred], a
+ ld [wVBlankOccurred], a
call AskSerial
@@ -379,7 +379,7 @@
.done
xor a
- ld [VBlankOccurred], a
+ ld [wVBlankOccurred], a
call Joypad
@@ -429,7 +429,7 @@
.done
xor a
- ld [VBlankOccurred], a
+ ld [wVBlankOccurred], a
ld a, BANK(_UpdateSound)
rst Bankswitch
--- a/home/video.asm
+++ b/home/video.asm
@@ -20,8 +20,8 @@
UpdateBGMapBuffer:: ; 15e3
-; Copy [hBGMapTileCount] 16x8 tiles from BGMapBuffer
-; to bg map addresses in BGMapBufferPtrs.
+; Copy [hBGMapTileCount] 16x8 tiles from wBGMapBuffer
+; to bg map addresses in wBGMapBufferPtrs.
; [hBGMapTileCount] must be even since this is done in pairs.
@@ -35,13 +35,13 @@
push af
ld [hSPBuffer], sp
- ld hl, BGMapBufferPtrs
+ ld hl, wBGMapBufferPtrs
ld sp, hl
; We can now pop the addresses of affected spots on the BG Map
- ld hl, BGMapPalBuffer
- ld de, BGMapBuffer
+ ld hl, wBGMapPalBuffer
+ ld de, wBGMapBuffer
.next
@@ -122,7 +122,7 @@
UpdateBGMap:: ; 164c
-; Update the BG Map, in thirds, from TileMap and AttrMap.
+; Update the BG Map, in thirds, from wTileMap and wAttrMap.
ld a, [hBGMapMode]
and a
@@ -168,7 +168,7 @@
ld a, 1
ld [rVBK], a
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
call .update
ld a, 0
@@ -250,7 +250,7 @@
; Rows of tiles in a third
ld a, SCREEN_HEIGHT / 3
-; Discrepancy between TileMap and BGMap
+; Discrepancy between wTileMap and BGMap
ld bc, BG_MAP_WIDTH - (SCREEN_WIDTH - 1)
@@ -285,7 +285,7 @@
Serve1bppRequest:: ; 170a
; Only call during the first fifth of VBlank
- ld a, [Requested1bpp]
+ ld a, [wRequested1bpp]
and a
ret z
@@ -296,12 +296,12 @@
cp LY_VBLANK + 2
ret nc
-; Copy [Requested1bpp] 1bpp tiles from [Requested1bppSource] to [Requested1bppDest]
+; Copy [wRequested1bpp] 1bpp tiles from [wRequested1bppSource] to [wRequested1bppDest]
ld [hSPBuffer], sp
; Source
- ld hl, Requested1bppSource
+ ld hl, wRequested1bppSource
ld a, [hli]
ld h, [hl]
ld l, a
@@ -308,17 +308,17 @@
ld sp, hl
; Destination
- ld hl, Requested1bppDest
+ ld hl, wRequested1bppDest
ld a, [hli]
ld h, [hl]
ld l, a
; # tiles to copy
- ld a, [Requested1bpp]
+ ld a, [wRequested1bpp]
ld b, a
xor a
- ld [Requested1bpp], a
+ ld [wRequested1bpp], a
.next
@@ -348,11 +348,11 @@
ld a, l
- ld [Requested1bppDest], a
+ ld [wRequested1bppDest], a
ld a, h
- ld [Requested1bppDest + 1], a
+ ld [wRequested1bppDest + 1], a
- ld [Requested1bppSource], sp
+ ld [wRequested1bppSource], sp
ld a, [hSPBuffer]
ld l, a
@@ -366,7 +366,7 @@
Serve2bppRequest:: ; 1769
; Only call during the first fifth of VBlank
- ld a, [Requested2bpp]
+ ld a, [wRequested2bpp]
and a
ret z
@@ -381,17 +381,17 @@
Serve2bppRequest_VBlank:: ; 1778
- ld a, [Requested2bpp]
+ ld a, [wRequested2bpp]
and a
ret z
_Serve2bppRequest:: ; 177d
-; Copy [Requested2bpp] 2bpp tiles from [Requested2bppSource] to [Requested2bppDest]
+; Copy [wRequested2bpp] 2bpp tiles from [wRequested2bppSource] to [wRequested2bppDest]
ld [hSPBuffer], sp
; Source
- ld hl, Requested2bppSource
+ ld hl, wRequested2bppSource
ld a, [hli]
ld h, [hl]
ld l, a
@@ -398,17 +398,17 @@
ld sp, hl
; Destination
- ld hl, Requested2bppDest
+ ld hl, wRequested2bppDest
ld a, [hli]
ld h, [hl]
ld l, a
; # tiles to copy
- ld a, [Requested2bpp]
+ ld a, [wRequested2bpp]
ld b, a
xor a
- ld [Requested2bpp], a
+ ld [wRequested2bpp], a
.next
@@ -430,11 +430,11 @@
ld a, l
- ld [Requested2bppDest], a
+ ld [wRequested2bppDest], a
ld a, h
- ld [Requested2bppDest + 1], a
+ ld [wRequested2bppDest + 1], a
- ld [Requested2bppSource], sp
+ ld [wRequested2bppSource], sp
ld a, [hSPBuffer]
ld l, a
@@ -466,7 +466,7 @@
ld a, [rSVBK]
push af
- ld a, BANK(TilesetAnim)
+ ld a, BANK(wTilesetAnim)
ld [rSVBK], a
ld a, [rVBK]
--- a/home/window.asm
+++ b/home/window.asm
@@ -26,7 +26,7 @@
pop af
ld [hOAMUpdate], a
- ld hl, VramState
+ ld hl, wVramState
res 6, [hl]
ret
; 2de2
--- a/hram.asm
+++ b/hram.asm
@@ -2,7 +2,7 @@
; "ld a, [hAddress]" and "ld [hAddress], a" will
; use the more efficient "ldh" instruction.
-hPushOAM EQU $ff80 ; 10 bytes
+hTransferVirtualOAM EQU $ff80 ; 10 bytes
hROMBankBackup EQU $ff8a
hBuffer EQU $ff8b
--- a/macros/coords.asm
+++ b/macros/coords.asm
@@ -5,7 +5,7 @@
coord: MACRO
; register, x, y[, origin]
if _NARG < 4
- ld \1, (\3) * SCREEN_WIDTH + (\2) + TileMap
+ ld \1, (\3) * SCREEN_WIDTH + (\2) + wTileMap
else
ld \1, (\3) * SCREEN_WIDTH + (\2) + \4
endc
@@ -27,7 +27,7 @@
dwcoord: MACRO
; x, y
rept _NARG / 2
- dw (\2) * SCREEN_WIDTH + (\1) + TileMap
+ dw (\2) * SCREEN_WIDTH + (\1) + wTileMap
shift
shift
endr
@@ -36,7 +36,7 @@
ldcoord_a: MACRO
; x, y[, origin]
if _NARG < 3
- ld [(\2) * SCREEN_WIDTH + (\1) + TileMap], a
+ ld [(\2) * SCREEN_WIDTH + (\1) + wTileMap], a
else
ld [(\2) * SCREEN_WIDTH + (\1) + \3], a
endc
@@ -45,7 +45,7 @@
lda_coord: MACRO
; x, y[, origin]
if _NARG < 3
- ld a, [(\2) * SCREEN_WIDTH + (\1) + TileMap]
+ ld a, [(\2) * SCREEN_WIDTH + (\1) + wTileMap]
else
ld a, [(\2) * SCREEN_WIDTH + (\1) + \3]
endc
--- a/macros/wram.asm
+++ b/macros/wram.asm
@@ -129,7 +129,7 @@
ENDM
channel_struct: MACRO
-; Addreses are Channel1 (c101).
+; Addreses are wChannel1 (c101).
\1MusicID:: dw
\1MusicBank:: db
\1Flags:: db ; 0:on/off 1:subroutine 3:sfx 4:noise 5:rest
--- a/maps/BattleTower1F.asm
+++ b/maps/BattleTower1F.asm
@@ -527,7 +527,7 @@
Text_PlayerGotFive: ; 0x9eb7e
text "<PLAYER> got five"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "!@"
sound_item
text_waitbutton
@@ -637,7 +637,7 @@
Text_NextUpOpponentNo: ; 0x9eebc
text "Next up, opponent"
line "no.@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text ". Ready?"
done
@@ -736,7 +736,7 @@
text "One or more of"
line "your #MON's"
cont "levels exceeds @"
- deciram ScriptVar, 1, 3
+ deciram wScriptVar, 1, 3
text "."
done
@@ -748,7 +748,7 @@
para "This BATTLE ROOM"
line "is for L@"
- deciram ScriptVar, 1, 3
+ deciram wScriptVar, 1, 3
text "."
done
--- a/maps/BattleTowerHallway.asm
+++ b/maps/BattleTowerHallway.asm
@@ -28,7 +28,7 @@
ld a, BANK(wBTChoiceOfLvlGroup)
ld [rSVBK], a
ld a, [wBTChoiceOfLvlGroup]
- ld [ScriptVar], a
+ ld [wScriptVar], a
pop af
ld [rSVBK], a
--- a/maps/BillsHouse.asm
+++ b/maps/BillsHouse.asm
@@ -241,7 +241,7 @@
BillsGrandpaShownPokemonText:
text "Ah, so that is"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "?"
para "Isn't it cute!"
--- a/maps/BluesHouse.asm
+++ b/maps/BluesHouse.asm
@@ -106,7 +106,7 @@
done
GroomedMonLooksContentText:
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " looks"
line "content."
done
--- a/maps/CeladonCafe.asm
+++ b/maps/CeladonCafe.asm
@@ -198,7 +198,7 @@
FoundLeftoversText:
text "<PLAYER> found"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
--- a/maps/CeladonDeptStore6F.asm
+++ b/maps/CeladonDeptStore6F.asm
@@ -109,7 +109,7 @@
text "Clang!"
para "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "popped out."
done
--- a/maps/CeladonGameCornerPrizeRoom.asm
+++ b/maps/CeladonGameCornerPrizeRoom.asm
@@ -235,7 +235,7 @@
CeladonPrizeRoom_ConfirmPurchaseText:
text "OK, so you wanted"
line "a @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "?"
done
--- a/maps/DragonsDenB1F.asm
+++ b/maps/DragonsDenB1F.asm
@@ -396,7 +396,7 @@
Text_FoundDragonFang:
text "<PLAYER> found"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
--- a/maps/ElmsLab.asm
+++ b/maps/ElmsLab.asm
@@ -893,7 +893,7 @@
ReceivedStarterText:
text "<PLAYER> received"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "!"
done
--- a/maps/GoldenrodDeptStore6F.asm
+++ b/maps/GoldenrodDeptStore6F.asm
@@ -102,7 +102,7 @@
GoldenrodClangText:
text "Clang! A can of"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
cont "popped out!"
done
--- a/maps/GoldenrodGameCorner.asm
+++ b/maps/GoldenrodGameCorner.asm
@@ -328,7 +328,7 @@
done
GoldenrodGameCornerPrizeVendorConfirmPrizeText:
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "Is that right?"
done
--- a/maps/GoldenrodHappinessRater.asm
+++ b/maps/GoldenrodHappinessRater.asm
@@ -80,7 +80,7 @@
para "Oh? Let me see"
line "your @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "…"
done
--- a/maps/GoldenrodPokecenter1F.asm
+++ b/maps/GoldenrodPokecenter1F.asm
@@ -182,10 +182,10 @@
line "to trade your"
para "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " for"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "."
para "We'll have to hold"
@@ -202,7 +202,7 @@
line "to trade your"
para "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " for a"
line "#MON that you"
cont "have never seen."
--- a/maps/GoldenrodUnderground.asm
+++ b/maps/GoldenrodUnderground.asm
@@ -36,7 +36,7 @@
clearevent EVENT_SWITCH_13
clearevent EVENT_SWITCH_14
writebyte 0
- copyvartobyte UndergroundSwitchPositions
+ copyvartobyte wUndergroundSwitchPositions
return
.CheckBasementKey:
@@ -619,19 +619,19 @@
done
HaircutBrosText_SlightlyHappier:
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " looks a"
line "little happier."
done
HaircutBrosText_Happier:
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " looks"
line "happy."
done
HaircutBrosText_MuchHappier:
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " looks"
line "delighted!"
done
--- a/maps/GoldenrodUndergroundSwitchRoomEntrances.asm
+++ b/maps/GoldenrodUndergroundSwitchRoomEntrances.asm
@@ -281,9 +281,9 @@
writetext SwitchRoomText_OffTurnOn
yesorno
iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle
- copybytetovar UndergroundSwitchPositions
+ copybytetovar wUndergroundSwitchPositions
addvar 1
- copyvartobyte UndergroundSwitchPositions
+ copyvartobyte wUndergroundSwitchPositions
setevent EVENT_SWITCH_1
jump GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors
@@ -291,9 +291,9 @@
writetext SwitchRoomText_OnTurnOff
yesorno
iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle
- copybytetovar UndergroundSwitchPositions
+ copybytetovar wUndergroundSwitchPositions
addvar -1
- copyvartobyte UndergroundSwitchPositions
+ copyvartobyte wUndergroundSwitchPositions
clearevent EVENT_SWITCH_1
jump GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors
@@ -306,9 +306,9 @@
writetext SwitchRoomText_OffTurnOn
yesorno
iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle
- copybytetovar UndergroundSwitchPositions
+ copybytetovar wUndergroundSwitchPositions
addvar 2
- copyvartobyte UndergroundSwitchPositions
+ copyvartobyte wUndergroundSwitchPositions
setevent EVENT_SWITCH_2
jump GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors
@@ -316,9 +316,9 @@
writetext SwitchRoomText_OnTurnOff
yesorno
iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle
- copybytetovar UndergroundSwitchPositions
+ copybytetovar wUndergroundSwitchPositions
addvar -2
- copyvartobyte UndergroundSwitchPositions
+ copyvartobyte wUndergroundSwitchPositions
clearevent EVENT_SWITCH_2
jump GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors
@@ -331,9 +331,9 @@
writetext SwitchRoomText_OffTurnOn
yesorno
iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle
- copybytetovar UndergroundSwitchPositions
+ copybytetovar wUndergroundSwitchPositions
addvar 3
- copyvartobyte UndergroundSwitchPositions
+ copyvartobyte wUndergroundSwitchPositions
setevent EVENT_SWITCH_3
jump GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors
@@ -341,9 +341,9 @@
writetext SwitchRoomText_OnTurnOff
yesorno
iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle
- copybytetovar UndergroundSwitchPositions
+ copybytetovar wUndergroundSwitchPositions
addvar -3
- copyvartobyte UndergroundSwitchPositions
+ copyvartobyte wUndergroundSwitchPositions
clearevent EVENT_SWITCH_3
jump GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors
@@ -357,7 +357,7 @@
yesorno
iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle
writebyte 7
- copyvartobyte UndergroundSwitchPositions
+ copyvartobyte wUndergroundSwitchPositions
setevent EVENT_EMERGENCY_SWITCH
setevent EVENT_SWITCH_1
setevent EVENT_SWITCH_2
@@ -369,7 +369,7 @@
yesorno
iffalse GoldenrodUndergroundSwitchRoomEntrances_DontToggle
writebyte 0
- copyvartobyte UndergroundSwitchPositions
+ copyvartobyte wUndergroundSwitchPositions
clearevent EVENT_EMERGENCY_SWITCH
clearevent EVENT_SWITCH_1
clearevent EVENT_SWITCH_2
@@ -381,7 +381,7 @@
end
GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors:
- copybytetovar UndergroundSwitchPositions
+ copybytetovar wUndergroundSwitchPositions
if_equal 0, .Position0
if_equal 1, .Position1
if_equal 2, .Position2
@@ -501,7 +501,7 @@
reloadmappart
closetext
writebyte 6
- copyvartobyte UndergroundSwitchPositions
+ copyvartobyte wUndergroundSwitchPositions
end
.Set4:
--- a/maps/GoldenrodUndergroundWarehouse.asm
+++ b/maps/GoldenrodUndergroundWarehouse.asm
@@ -32,7 +32,7 @@
clearevent EVENT_SWITCH_13
clearevent EVENT_SWITCH_14
writebyte 0
- copyvartobyte UndergroundSwitchPositions
+ copyvartobyte wUndergroundSwitchPositions
return
TrainerGruntM24:
--- a/maps/IlexForest.asm
+++ b/maps/IlexForest.asm
@@ -22,7 +22,7 @@
.FarfetchdCallback:
checkevent EVENT_GOT_HM01_CUT
iftrue .Static
- copybytetovar FarfetchdPosition
+ copybytetovar wFarfetchdPosition
if_equal 1, .PositionOne
if_equal 2, .PositionTwo
if_equal 3, .PositionThree
@@ -103,7 +103,7 @@
end
IlexForestFarfetchdScript:
- copybytetovar FarfetchdPosition
+ copybytetovar wFarfetchdPosition
if_equal 1, .Position1
if_equal 2, .Position2
if_equal 3, .Position3
@@ -128,7 +128,7 @@
moveobject ILEXFOREST_FARFETCHD, 15, 25
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 2
+ loadvar wFarfetchdPosition, 2
end
.Position2:
@@ -138,7 +138,7 @@
moveobject ILEXFOREST_FARFETCHD, 20, 24
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 3
+ loadvar wFarfetchdPosition, 3
end
.Position2_Down:
@@ -146,7 +146,7 @@
moveobject ILEXFOREST_FARFETCHD, 15, 29
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 8
+ loadvar wFarfetchdPosition, 8
end
.Position3:
@@ -156,7 +156,7 @@
moveobject ILEXFOREST_FARFETCHD, 29, 22
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 4
+ loadvar wFarfetchdPosition, 4
end
.Position3_Left:
@@ -164,7 +164,7 @@
moveobject ILEXFOREST_FARFETCHD, 15, 25
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 2
+ loadvar wFarfetchdPosition, 2
end
.Position4:
@@ -174,7 +174,7 @@
moveobject ILEXFOREST_FARFETCHD, 28, 31
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 5
+ loadvar wFarfetchdPosition, 5
end
.Position4_Up:
@@ -182,7 +182,7 @@
moveobject ILEXFOREST_FARFETCHD, 20, 24
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 3
+ loadvar wFarfetchdPosition, 3
end
.Position5:
@@ -194,7 +194,7 @@
moveobject ILEXFOREST_FARFETCHD, 24, 35
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 6
+ loadvar wFarfetchdPosition, 6
end
.Position5_Left:
@@ -202,7 +202,7 @@
moveobject ILEXFOREST_FARFETCHD, 22, 31
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 7
+ loadvar wFarfetchdPosition, 7
end
.Position5_Up:
@@ -210,7 +210,7 @@
moveobject ILEXFOREST_FARFETCHD, 29, 22
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 4
+ loadvar wFarfetchdPosition, 4
end
.Position5_Right:
@@ -218,7 +218,7 @@
moveobject ILEXFOREST_FARFETCHD, 29, 22
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 4
+ loadvar wFarfetchdPosition, 4
end
.Position6:
@@ -228,7 +228,7 @@
moveobject ILEXFOREST_FARFETCHD, 22, 31
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 7
+ loadvar wFarfetchdPosition, 7
end
.Position6_Right:
@@ -236,7 +236,7 @@
moveobject ILEXFOREST_FARFETCHD, 28, 31
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 5
+ loadvar wFarfetchdPosition, 5
end
.Position7:
@@ -247,7 +247,7 @@
moveobject ILEXFOREST_FARFETCHD, 15, 29
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 8
+ loadvar wFarfetchdPosition, 8
end
.Position7_Left:
@@ -255,7 +255,7 @@
moveobject ILEXFOREST_FARFETCHD, 24, 35
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 6
+ loadvar wFarfetchdPosition, 6
end
.Position7_Down:
@@ -263,7 +263,7 @@
moveobject ILEXFOREST_FARFETCHD, 28, 31
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 5
+ loadvar wFarfetchdPosition, 5
end
.Position8:
@@ -275,7 +275,7 @@
moveobject ILEXFOREST_FARFETCHD, 10, 35
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 9
+ loadvar wFarfetchdPosition, 9
end
.Position8_Right:
@@ -283,7 +283,7 @@
moveobject ILEXFOREST_FARFETCHD, 22, 31
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 7
+ loadvar wFarfetchdPosition, 7
end
.Position8_Up:
@@ -292,7 +292,7 @@
moveobject ILEXFOREST_FARFETCHD, 15, 25
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 2
+ loadvar wFarfetchdPosition, 2
end
.Position9:
@@ -303,7 +303,7 @@
moveobject ILEXFOREST_FARFETCHD, 6, 28
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 10
+ loadvar wFarfetchdPosition, 10
appear ILEXFOREST_BLACK_BELT
setevent EVENT_CHARCOAL_KILN_BOSS
setevent EVENT_HERDED_FARFETCHD
@@ -314,7 +314,7 @@
moveobject ILEXFOREST_FARFETCHD, 15, 29
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 8
+ loadvar wFarfetchdPosition, 8
end
.Position9_Down:
@@ -322,7 +322,7 @@
moveobject ILEXFOREST_FARFETCHD, 15, 29
disappear ILEXFOREST_FARFETCHD
appear ILEXFOREST_FARFETCHD
- loadvar FarfetchdPosition, 8
+ loadvar wFarfetchdPosition, 8
end
.Position10:
--- a/maps/KrissHouse2F.asm
+++ b/maps/KrissHouse2F.asm
@@ -40,7 +40,7 @@
Doll2:
describedecoration DECODESC_RIGHT_DOLL
-BigDoll:
+wDecoBigDoll:
describedecoration DECODESC_BIG_DOLL
GameConsole:
@@ -138,4 +138,4 @@
object_event 4, 2, SPRITE_CONSOLE, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, GameConsole, EVENT_KRISS_HOUSE_2F_CONSOLE
object_event 4, 4, SPRITE_DOLL_1, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Doll1, EVENT_KRISS_HOUSE_2F_DOLL_1
object_event 5, 4, SPRITE_DOLL_2, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Doll2, EVENT_KRISS_HOUSE_2F_DOLL_2
- object_event 0, 1, SPRITE_BIG_DOLL, SPRITEMOVEDATA_BIGDOLL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, BigDoll, EVENT_KRISS_HOUSE_2F_BIG_DOLL
+ object_event 0, 1, SPRITE_BIG_DOLL, SPRITEMOVEDATA_BIGDOLL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, wDecoBigDoll, EVENT_KRISS_HOUSE_2F_BIG_DOLL
--- a/maps/LakeOfRageMagikarpHouse.asm
+++ b/maps/LakeOfRageMagikarpHouse.asm
@@ -200,10 +200,10 @@
text "CURRENT RECORD"
para "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " caught by"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
db "@@"
LakeOfRageMagikarpHouse_MapEvents:
--- a/maps/Pokecenter2F.asm
+++ b/maps/Pokecenter2F.asm
@@ -914,7 +914,7 @@
Text_RejectNewMon:
text "Sorry--@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text_start
line "can't be taken."
prompt
@@ -922,10 +922,10 @@
Text_RejectMonWithNewMove:
text "You can't take the"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " with a"
cont "@"
- text_from_ram StringBuffer2
+ text_from_ram wStringBuffer2
text "."
prompt
@@ -932,7 +932,7 @@
Text_RejectMonWithMail:
text "You can't take the"
line "@"
- text_from_ram StringBuffer1
+ text_from_ram wStringBuffer1
text " that"
cont "has MAIL with you."
prompt
--- a/maps/RadioTower1F.asm
+++ b/maps/RadioTower1F.asm
@@ -239,7 +239,7 @@
UnknownText_0x5cf3a:
text "This week's ID"
line "number is @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
done
--- a/maps/Route35NationalParkGate.asm
+++ b/maps/Route35NationalParkGate.asm
@@ -226,7 +226,7 @@
UnknownText_0x6a2eb:
text "Today's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "That means the"
@@ -289,7 +289,7 @@
para "You'll have to use"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text ", the"
para "first #MON in"
@@ -373,7 +373,7 @@
UnknownText_0x6a79a:
text "You still have @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "minute(s) left."
--- a/maps/Route36NationalParkGate.asm
+++ b/maps/Route36NationalParkGate.asm
@@ -476,7 +476,7 @@
UnknownText_0x6add5:
text "Today's @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "."
line "That means the"
@@ -539,7 +539,7 @@
para "You'll have to use"
line "@"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text ", the"
para "first #MON in"
@@ -623,7 +623,7 @@
UnknownText_0x6b284:
text "You still have @"
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text_start
line "minute(s) left."
--- a/maps/Route39Barn.asm
+++ b/maps/Route39Barn.asm
@@ -69,9 +69,9 @@
checkitem BERRY
iffalse .NoBerriesInBag
takeitem BERRY
- copybytetovar MooMooBerries
+ copybytetovar wMooMooBerries
addvar 1
- copyvartobyte MooMooBerries
+ copyvartobyte wMooMooBerries
if_equal 3, .ThreeBerries
if_equal 5, .FiveBerries
if_equal 7, .SevenBerries
--- a/maps/TrainerHouseB1F.asm
+++ b/maps/TrainerHouseB1F.asm
@@ -121,7 +121,7 @@
done
TrainerHouseB1FYourOpponentIsText:
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text " is your"
line "opponent today."
done
--- a/mobile/fixed_words.asm
+++ b/mobile/fixed_words.asm
@@ -269,7 +269,7 @@
ld a, e
ld [wd265], a
call GetPokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld bc, MON_NAME_LENGTH - 1
jr .copy_string
; 11c1ab
@@ -337,7 +337,7 @@
ld a, $5
ld [rSVBK], a
ld hl, $c6d0
- ld de, LYOverrides
+ ld de, wLYOverrides
ld bc, $100
call CopyBytes
pop af
@@ -711,11 +711,11 @@
Function11c4be: ; 11c4be (47:44be)
ld a, $1
- hlcoord 0, 6, AttrMap
+ hlcoord 0, 6, wAttrMap
ld bc, $a0
call ByteFill
ld a, $7
- hlcoord 0, 14, AttrMap
+ hlcoord 0, 14, wAttrMap
ld bc, $28
call ByteFill
farcall ReloadMapPart
@@ -914,7 +914,7 @@
Function11c618: ; 11c618 (47:4618)
ld a, $2
- hlcoord 0, 6, AttrMap
+ hlcoord 0, 6, wAttrMap
ld bc, $c8
call ByteFill
farcall ReloadMapPart
@@ -1526,7 +1526,7 @@
Function11c9ab: ; 11c9ab (47:49ab)
ld a, $7
- hlcoord 0, 6, AttrMap
+ hlcoord 0, 6, wAttrMap
ld bc, $c8
call ByteFill
farcall ReloadMapPart
@@ -1583,7 +1583,7 @@
ret
Function11ca01: ; 11ca01 (47:4a01)
- hlcoord 14, 7, AttrMap
+ hlcoord 14, 7, wAttrMap
ld de, $14
ld a, $5
ld c, a
@@ -1602,7 +1602,7 @@
jr nz, .asm_11ca0a
Function11ca19: ; 11ca19 (47:4a19)
- hlcoord 0, 12, AttrMap
+ hlcoord 0, 12, wAttrMap
ld de, $14
ld a, $6
ld c, a
@@ -2035,11 +2035,11 @@
Function11cdaa: ; 11cdaa (47:4daa)
ld a, $2
- hlcoord 0, 6, AttrMap
+ hlcoord 0, 6, wAttrMap
ld bc, 6 * SCREEN_WIDTH
call ByteFill
ld a, $7
- hlcoord 0, 12, AttrMap
+ hlcoord 0, 12, wAttrMap
ld bc, 4 * SCREEN_WIDTH
call ByteFill
farcall ReloadMapPart
--- a/mobile/mobile_12.asm
+++ b/mobile/mobile_12.asm
@@ -38,11 +38,11 @@
jr .asm_480d7
.asm_4808a
ld a, $5
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, LOW(MUSIC_MOBILE_ADAPTER_MENU)
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, HIGH(MUSIC_MOBILE_ADAPTER_MENU)
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld c, 20
call DelayFrames
ld b, $1
@@ -459,7 +459,7 @@
Function483e8: ; 483e8
push de
ld hl, Prefectures
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp $ff
jr nz, .asm_483f8
ld hl, Wakayama ; last string
@@ -1681,7 +1681,7 @@
call Function48cfd
pop hl
pop bc
- ld de, AttrMap - TileMap
+ ld de, wAttrMap - wTileMap
add hl, de
inc b
inc b
--- a/mobile/mobile_12_2.asm
+++ b/mobile/mobile_12_2.asm
@@ -2,14 +2,14 @@
; Like CheckOwnMonAnywhere, but only check for species.
; OT/ID don't matter.
- ld a, [PartyCount]
+ ld a, [wPartyCount]
and a
ret z
ld d, a
ld e, 0
- ld hl, PartyMon1Species
- ld bc, PartyMonOT
+ ld hl, wPartyMon1Species
+ ld bc, wPartyMonOT
.asm_4a851
call .CheckMatch
ret c
@@ -111,7 +111,7 @@
push de
ld d, b
ld e, c
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
ld b, [hl]
cp b
jr nz, .no_match
@@ -160,25 +160,25 @@
; 4a927
UnusedSpecial_FindItemInPCOrBag: ; 4a927
- ld a, [ScriptVar]
- ld [CurItem], a
- ld hl, PCItems
+ ld a, [wScriptVar]
+ ld [wCurItem], a
+ ld hl, wPCItems
call CheckItem
jr c, .found
- ld a, [ScriptVar]
- ld [CurItem], a
- ld hl, NumItems
+ ld a, [wScriptVar]
+ ld [wCurItem], a
+ ld hl, wNumItems
call CheckItem
jr c, .found
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.found
ld a, 1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 4a94e
@@ -272,15 +272,15 @@
Function4a9d7: ; 4a9d7
ld a, [wd002]
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
call GetNick
ld h, d
ld l, e
- ld de, EndFlypoint
+ ld de, wEndFlypoint
ld bc, 6
call CopyBytes
ld a, [wd003]
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
call GetNick
ld h, d
ld l, e
@@ -288,7 +288,7 @@
ld bc, 6
call CopyBytes
ld a, [wd004]
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
call GetNick
ld h, d
ld l, e
@@ -317,10 +317,10 @@
Function4aa34: ; 4aa34
ld a, PARTYMENUACTION_MOBILE
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
farcall WritePartyMenuTilemap
xor a
- ld [PartyMenuActionText], a
+ ld [wPartyMenuActionText], a
farcall PrintPartyMenuText
call Function4aab6
call WaitBGMap
@@ -431,7 +431,7 @@
; 4aad3
Function4aad3: ; 4aad3
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [hli]
and a
ret z ; Nothing in your party
@@ -458,7 +458,7 @@
; 4aafb
Function4aafb: ; 4aafb
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp EGG
jr z, .egg
and a
@@ -470,9 +470,9 @@
; 4ab06
Function4ab06: ; 4ab06
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld bc, PARTYMON_STRUCT_LENGTH
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
call AddNTimes
ld a, [hli]
ld b, a
@@ -503,7 +503,7 @@
pop af
bit 1, a
jr nz, .asm_4ab6d
- ld a, [PartyCount]
+ ld a, [wPartyCount]
inc a
ld b, a
ld a, [wMenuCursorY]
@@ -512,13 +512,13 @@
jr z, .asm_4ab7e
ld a, [wMenuCursorY]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld c, a
ld b, $0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, bc
ld a, [hl]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld de, SFX_READ_TEXT_2
call PlaySFX
call WaitSFX
@@ -591,7 +591,7 @@
Function4abc3: ; 4abc3
bit 3, a
jr z, .asm_4abd5
- ld a, [PartyCount]
+ ld a, [wPartyCount]
inc a
ld [wMenuCursorY], a
ld a, $1
@@ -605,7 +605,7 @@
ld [wMenuCursorY], a
and a
jr nz, .asm_4ac29
- ld a, [PartyCount]
+ ld a, [wPartyCount]
inc a
ld [wMenuCursorY], a
jr .asm_4ac29
@@ -615,7 +615,7 @@
jr z, .asm_4ac08
ld a, [wMenuCursorY]
ld [wMenuCursorY], a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
inc a
inc a
ld b, a
@@ -635,7 +635,7 @@
.asm_4ac10
ld a, [wMenuCursorY]
ld b, a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
inc a
cp b
jr nz, .asm_4ac29
@@ -653,7 +653,7 @@
lb bc, 13, 1
call ClearBox
call Function4aab6
- ld a, [PartyCount]
+ ld a, [wPartyCount]
hlcoord 6, 1
.asm_4ac3b
ld bc, $28
@@ -663,7 +663,7 @@
ld [hl], $7f
ld a, [wMenuCursorY]
ld b, a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
inc a
cp b
jr z, .asm_4ac54
@@ -800,7 +800,7 @@
ret
.asm_4ad39
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
ld [hl], a
call Function4a9c3
ret c
@@ -876,7 +876,7 @@
Function4adb2: ; 4adb2
ld hl, wd002
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
cp [hl]
ret z
inc hl
@@ -923,7 +923,7 @@
ld a, [wd019]
bit 0, a
ret z
- ld a, [PartyCount]
+ ld a, [wPartyCount]
inc a
ld [wMenuCursorY], a
ld a, $1
--- a/mobile/mobile_22.asm
+++ b/mobile/mobile_22.asm
@@ -133,7 +133,7 @@
Function891de: ; 891de
call Mobile22_SetBGMapMode0
call ClearPalettes
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld a, $7
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
@@ -169,7 +169,7 @@
Function89215: ; 89215
push hl
push bc
- ld bc, AttrMap - TileMap
+ ld bc, wAttrMap - wTileMap
add hl, bc
ld [hl], a
pop bc
@@ -345,12 +345,12 @@
Function89305: ; 89305 (22:5305)
xor a
- ld [MenuSelection], a
+ ld [wMenuSelection], a
ld c, 40
.loop
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
inc a
- ld [MenuSelection], a
+ ld [wMenuSelection], a
push bc
call Function892b4
pop bc
@@ -361,7 +361,7 @@
Function8931b: ; 8931b
push hl
ld hl, $a03b ; 4:a03b
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
dec a
ld bc, 37
call AddNTimes
@@ -568,9 +568,9 @@
ret
Function89448: ; 89448 (22:5448)
-; Clears the Sprites array
+; Clears the sprite array
push af
- ld hl, Sprites
+ ld hl, wVirtualOAM
ld d, 24 * SPRITEOAMSTRUCT_LENGTH
xor a
.loop
@@ -778,7 +778,7 @@
ld c, l
farcall GetMobileOTTrainerClass
ld a, c
- ld [TrainerClass], a
+ ld [wTrainerClass], a
ld a, [rSVBK]
push af
ld a, 5
@@ -790,7 +790,7 @@
ld [hl], a
pop af
ld [rSVBK], a
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
ld h, 0
ld l, a
add hl, hl
@@ -845,7 +845,7 @@
Function895e6: ; 895e6
ld a, 7
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
ret
@@ -854,7 +854,7 @@
Function895f2: ; 895f2
push bc
xor a
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
call Function89605
@@ -864,7 +864,7 @@
; 89605
Function89605: ; 89605
- hlcoord 19, 2, AttrMap
+ hlcoord 19, 2, wAttrMap
ld a, 1
ld de, SCREEN_WIDTH
ld c, 14
@@ -881,7 +881,7 @@
jr nz, .loop
.done
- hlcoord 0, 16, AttrMap
+ hlcoord 0, 16, wAttrMap
ld c, 10
ld a, 2
.loop2
@@ -891,7 +891,7 @@
inc a
dec c
jr nz, .loop2
- hlcoord 1, 11, AttrMap
+ hlcoord 1, 11, wAttrMap
ld a, 4
ld bc, 4
call ByteFill
@@ -902,7 +902,7 @@
; 8963d
Function8963d: ; 8963d
- hlcoord 12, 3, AttrMap
+ hlcoord 12, 3, wAttrMap
ld a, 6
ld de, SCREEN_WIDTH
lb bc, 7, 7
@@ -921,7 +921,7 @@
; 89655
Function89655: ; 89655
- hlcoord 1, 12, AttrMap
+ hlcoord 1, 12, wAttrMap
ld de, SCREEN_WIDTH
ld a, 5
ld b, 4
@@ -1223,9 +1223,9 @@
ld c, l
farcall GetMobileOTTrainerClass
ld a, c
- ld [TrainerClass], a
+ ld [wTrainerClass], a
xor a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld de, vTiles2 tile $37
farcall GetTrainerPic
pop bc
@@ -1236,7 +1236,7 @@
push bc
call Function8934a
jr nc, .asm_897f3
- hlcoord 12, 3, AttrMap
+ hlcoord 12, 3, wAttrMap
xor a
ld de, SCREEN_WIDTH
lb bc, 7, 7
@@ -1354,12 +1354,12 @@
ret
Function898aa: ; 898aa
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
and a
ret z
push bc
hlcoord 6, 1
- ld de, MenuSelection
+ ld de, wMenuSelection
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
pop bc
@@ -1376,7 +1376,7 @@
.asm_898cd
hlcoord 9, 1
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
and a
jr nz, .asm_898d7
dec hl
@@ -1544,7 +1544,7 @@
Function8999c: ; 8999c (22:599c)
- ld de, PlayerName
+ ld de, wPlayerName
call PlaceString
inc bc
ld h, b
@@ -1559,10 +1559,10 @@
; 899b2
Function899b2: ; 899b2 (22:59b2)
- ld bc, PlayerName
+ ld bc, wPlayerName
call Function89346
jr c, .asm_899bf
- ld de, PlayerName
+ ld de, wPlayerName
jr .asm_899c2
.asm_899bf
ld de, String_89116
@@ -1572,7 +1572,7 @@
ret
Function899c9: ; 899c9 (22:59c9)
- ld de, PlayerID
+ ld de, wPlayerID
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
ret
@@ -1716,11 +1716,11 @@
; 89aa3
.ApplyCursorMovement: ; 89aa3
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld c, a
push bc
.loop
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp d
jr z, .equal_to_d
add e
@@ -1728,10 +1728,10 @@
inc a
.not_zero
- ld [MenuSelection], a
+ ld [wMenuSelection], a
call .Function89ac7 ; BCD conversion of data in SRAM?
jr nc, .loop
- call .Function89ae6 ; split [MenuSelection] into [wd030] + [wd031] where [wd030] <= 5
+ call .Function89ae6 ; split [wMenuSelection] into [wd030] + [wd031] where [wd030] <= 5
pop bc
and a
ret
@@ -1739,7 +1739,7 @@
.equal_to_d
pop bc
ld a, c
- ld [MenuSelection], a
+ ld [wMenuSelection], a
scf
ret
; 89ac7
@@ -1773,7 +1773,7 @@
ld hl, wd031
xor a
ld [hl], a
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
.loop2
cp 6
jr c, .load_and_ret
@@ -1923,7 +1923,7 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld de, Sprite01
+ ld de, wVirtualOAMSprite00
.asm_89bb4
ld a, [hli]
cp $ff
@@ -2013,7 +2013,7 @@
pop de
ret
.asm_89c4f
- ld hl, Sprite01
+ ld hl, wVirtualOAMSprite00
push de
ld a, b
ld [hli], a ; y
@@ -2123,7 +2123,7 @@
ld c, a
ld e, $2
ld a, $2
- ld hl, Sprite01
+ ld hl, wVirtualOAMSprite00
.asm_89cee
push af
push bc
@@ -2378,10 +2378,10 @@
hlcoord 7, 4
call Function8a58d
ld a, $5
- hlcoord 7, 4, AttrMap
+ hlcoord 7, 4, wAttrMap
call Function8a5a3
ld a, $6
- hlcoord 10, 4, AttrMap
+ hlcoord 10, 4, wAttrMap
call Function8a5a3
call Function891ab
call SetPalettes
@@ -2415,10 +2415,10 @@
hlcoord 7, 4
call Function8a58d
ld a, $5
- hlcoord 7, 4, AttrMap
+ hlcoord 7, 4, wAttrMap
call Function8a5a3
ld a, $6
- hlcoord 10, 4, AttrMap
+ hlcoord 10, 4, wAttrMap
call Function8a5a3
call Function891ab
call SetPalettes
@@ -2550,7 +2550,7 @@
Function89f9a: ; 89f9a (22:5f9a)
dec a
- ld hl, Sprites
+ ld hl, wVirtualOAM
and a
ret z
.asm_89fa0
@@ -2595,10 +2595,10 @@
Function89fce: ; 89fce (22:5fce)
call Function8a5b6
ld a, $5
- hlcoord 7, 4, AttrMap
+ hlcoord 7, 4, wAttrMap
call Function8a5a3
ld a, $6
- hlcoord 10, 4, AttrMap
+ hlcoord 10, 4, wAttrMap
call Function8a5a3
call Function89448
call SetPalettes
@@ -2678,11 +2678,11 @@
hlcoord 12, 4
call Function8a58d
ld a, $5
- hlcoord 12, 4, AttrMap
+ hlcoord 12, 4, wAttrMap
call Function8a5a3
pop hl
ld a, $6
- hlcoord 15, 4, AttrMap
+ hlcoord 15, 4, wAttrMap
call Function8a5a3
call CGBOnly_CopyTilemapAtOnce
jp Function89e36
@@ -2710,7 +2710,7 @@
Function8a0c1: ; 8a0c1 (22:60c1)
push hl
- ld bc, AttrMap - TileMap
+ ld bc, wAttrMap - wTileMap
add hl, bc
ld a, [hl]
pop hl
@@ -2736,7 +2736,7 @@
Function8a0de: ; 8a0de (22:60de)
call Function8a0c9
- ld de, AttrMap - TileMap
+ ld de, wAttrMap - wTileMap
add hl, de
ret
@@ -2962,10 +2962,10 @@
hlcoord 12, 4
call Function8a58d
ld a, $5
- hlcoord 12, 4, AttrMap
+ hlcoord 12, 4, wAttrMap
call Function8a5a3
ld a, $6
- hlcoord 15, 4, AttrMap
+ hlcoord 15, 4, wAttrMap
call Function8a5a3
xor a
ld [wd02e], a
@@ -3058,7 +3058,7 @@
pop bc
ld a, c
ld [wMenuCursorBuffer], a
- ld [MenuSelection], a
+ ld [wMenuSelection], a
call PlaceVerticalMenuItems
call InitVerticalMenuCursor
ld hl, w2DMenuFlags1
@@ -3083,7 +3083,7 @@
call Function89448
call PlaceHollowCursor
call Function8a3a2
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp $ff
jr z, .asm_8a36a
ld e, a
@@ -3118,12 +3118,12 @@
ld d, $0
add hl, de
ld a, [hl]
- ld [MenuSelection], a
+ ld [wMenuSelection], a
ret
Function8a3b2: ; 8a3b2 (22:63b2)
ld a, $1
- ld [MenuSelection], a
+ ld [wMenuSelection], a
call Function8a4fc
call Function8a3df
jr nc, .asm_8a3ce
@@ -3210,7 +3210,7 @@
call TextBox
hlcoord 1, 14
ld de, String_8a476
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp $ff
jr z, .asm_8a472
ld de, Strings_8a483
@@ -3238,27 +3238,27 @@
; 8a4d3
Function8a4d3: ; 8a4d3 (22:64d3)
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp $1
jr nz, .asm_8a4eb
ld a, $5
- hlcoord 12, 4, AttrMap
+ hlcoord 12, 4, wAttrMap
call Function8a5a3
ld a, $7
- hlcoord 15, 4, AttrMap
+ hlcoord 15, 4, wAttrMap
call Function8a5a3
ret
.asm_8a4eb
ld a, $7
- hlcoord 12, 4, AttrMap
+ hlcoord 12, 4, wAttrMap
call Function8a5a3
ld a, $6
- hlcoord 15, 4, AttrMap
+ hlcoord 15, 4, wAttrMap
call Function8a5a3
ret
Function8a4fc: ; 8a4fc (22:64fc)
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp $3
jr nz, asm_8a529
ld hl, wd012
@@ -3293,7 +3293,7 @@
ld [hli], a
ld a, $ff
ld [hli], a
- ld hl, Sprites
+ ld hl, wVirtualOAM
xor a
ld bc, 8 * SPRITEOAMSTRUCT_LENGTH
call ByteFill
@@ -3476,7 +3476,7 @@
ld a, c
and a
jr z, .asm_8a66a
- ld [MenuSelection], a
+ ld [wMenuSelection], a
ld b, a
ld a, [wScrollingMenuCursorPosition]
inc a
@@ -3489,7 +3489,7 @@
ld c, a
ld hl, Jumptable_8a671
ld a, b
- ld [MenuSelection], a
+ ld [wMenuSelection], a
ld a, c
dec a
rst JumpTable
@@ -3674,7 +3674,7 @@
ret
Function8a7cb: ; 8a7cb (22:67cb)
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
push af
call Function891de
ld de, wd008
@@ -3692,7 +3692,7 @@
call Function89193
.asm_8a7f4
pop af
- ld [MenuSelection], a
+ ld [wMenuSelection], a
call Function891de
call ClearBGPalettes
call Function893cc
@@ -3829,7 +3829,7 @@
; 8a930
Function8a930: ; 8a930 (22:6930)
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
push af
xor a
ld [wd032], a
@@ -3853,7 +3853,7 @@
cp c
jr z, .asm_8a995
push bc
- ld [MenuSelection], a
+ ld [wMenuSelection], a
call Function8931b
push bc
ld h, b
@@ -3864,7 +3864,7 @@
pop de
pop bc
ld a, c
- ld [MenuSelection], a
+ ld [wMenuSelection], a
call Function8931b
push bc
ld h, b
@@ -4013,7 +4013,7 @@
Function8aa73: ; 8aa73 (22:6a73)
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld e, a
push de
call Function891de
@@ -4039,7 +4039,7 @@
call Function894ca
pop de
ld a, e
- ld [MenuSelection], a
+ ld [wMenuSelection], a
and a
ret
@@ -4168,7 +4168,7 @@
call Function8b7bd
jr z, .asm_8abdf
ld a, c
- ld [MenuSelection], a
+ ld [wMenuSelection], a
call OpenSRAMBank4
call Function8931b
ld hl, $0011
@@ -4220,7 +4220,7 @@
ld a, $1
call Function8925e
jp c, .asm_8abb3
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld c, a
ret
; 8ac3b
@@ -4232,7 +4232,7 @@
Function8ac4e: ; 8ac4e
xor a
- ld [MenuSelection], a
+ ld [wMenuSelection], a
push de
call Function891de
call ClearBGPalettes
@@ -4261,7 +4261,7 @@
jr z, .asm_8acf0
ld a, c
ld [wd02f], a
- ld [MenuSelection], a
+ ld [wMenuSelection], a
call OpenSRAMBank4
call Function8931b
call Function8932d
@@ -4341,7 +4341,7 @@
Function8ad0b: ; 8ad0b
.asm_8ad0b
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
ld [wd02f], a
call Function891de
call ClearBGPalettes
--- a/mobile/mobile_22_2.asm
+++ b/mobile/mobile_22_2.asm
@@ -645,11 +645,11 @@
; 8b6ed
Function8b6ed: ; 8b6ed
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, $012c
xor a
call ByteFill
- hlcoord 0, 14, AttrMap
+ hlcoord 0, 14, wAttrMap
ld bc, $0050
ld a, $7
call ByteFill
@@ -709,7 +709,7 @@
; 8b744
Function8b744: ; 8b744
- ld de, AttrMap - TileMap
+ ld de, wAttrMap - wTileMap
add hl, de
inc b
inc b
@@ -781,10 +781,10 @@
; 8b79e
Function8b79e: ; 8b79e
- hlcoord 0, 1, AttrMap
+ hlcoord 0, 1, wAttrMap
ld a, $1
ld [hli], a
- hlcoord 9, 1, AttrMap
+ hlcoord 9, 1, wAttrMap
ld e, $b
.asm_8b7a9
ld a, $2
@@ -853,7 +853,7 @@
jr .asm_8b7ea
.asm_8b81c
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp $ff
jr nz, .asm_8b824
@@ -931,7 +931,7 @@
Function8b880: ; 8b880
ld h, d
ld l, e
- ld de, MenuSelection
+ ld de, wMenuSelection
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
ret
--- a/mobile/mobile_40.asm
+++ b/mobile/mobile_40.asm
@@ -43,7 +43,7 @@
farcall Stubbed_Function106462
farcall Function106464 ; load broken gfx
farcall Function11615a ; init RAM
- ld hl, VramState
+ ld hl, wVramState
set 1, [hl]
ret
; 100057
@@ -51,7 +51,7 @@
Function100057: ; 100057
call DisableMobile
call ReturnToMapFromSubmenu
- ld hl, VramState
+ ld hl, wVramState
res 1, [hl]
ret
; 100063
@@ -58,7 +58,7 @@
SetRAMStateForMobile: ; 100063
xor a
- ld hl, BGMapBuffer
+ ld hl, wBGMapBuffer
ld bc, $65
call ByteFill
xor a
@@ -66,7 +66,7 @@
ld bc, $100
call ByteFill
ld a, [rIE]
- ld [BGMapBuffer], a
+ ld [wBGMapBuffer], a
xor a
ld [hMapAnims], a
ld [hLCDCPointer], a
@@ -75,8 +75,8 @@
EnableMobile: ; 100082
xor a
- ld hl, OverworldMap
- ld bc, OverworldMapEnd - OverworldMap
+ ld hl, wOverworldMap
+ ld bc, wOverworldMapEnd - wOverworldMap
call ByteFill
di
@@ -106,7 +106,7 @@
call NormalSpeed
xor a
ld [rIF], a
- ld a, [BGMapBuffer]
+ ld a, [wBGMapBuffer]
ld [rIE], a
ei
ret
@@ -590,7 +590,7 @@
ld b, 0
push hl
add hl, bc
- ld a, [BGMapPalBuffer]
+ ld a, [wBGMapPalBuffer]
ld [hl], a
pop hl
inc bc
@@ -630,7 +630,7 @@
cp d
jr nz, .asm_100426
dec hl
- ld a, [BGMapPalBuffer]
+ ld a, [wBGMapPalBuffer]
cp [hl]
jr nz, .asm_10042d
xor a
@@ -692,7 +692,7 @@
dw Function1004a4
Function10046a: ; 10046a
- ld hl, BGMapPalBuffer
+ ld hl, wBGMapPalBuffer
inc [hl]
call Function1003d8
call Function1003ba
@@ -1355,7 +1355,7 @@
.asm_100830
ld [hld], a
ccf
- ld a, [BGMapBufferPtrs]
+ ld a, [wBGMapBufferPtrs]
adc [hl]
sub $3c
jr nc, .asm_10083c
@@ -1384,18 +1384,18 @@
add $3c
.asm_100858
- ld [StringBuffer2 + 2], a
+ ld [wStringBuffer2 + 2], a
ld a, [wcd6d]
ld c, a
ld a, $0a
sbc c
- ld [StringBuffer2 + 1], a
+ ld [wStringBuffer2 + 1], a
xor a
- ld [StringBuffer2], a
+ ld [wStringBuffer2], a
ld de, String_10088e
hlcoord 1, 14
call PlaceString
- ld de, StringBuffer2
+ ld de, wStringBuffer2
hlcoord 4, 16
call Function100697
ret
@@ -1425,13 +1425,13 @@
ld hl, $a800
call GetSRAMBank
ld a, [hli]
- ld [StringBuffer2], a
+ ld [wStringBuffer2], a
ld a, [hli]
- ld [StringBuffer2 + 1], a
+ ld [wStringBuffer2 + 1], a
ld a, [hli]
- ld [StringBuffer2 + 2], a
+ ld [wStringBuffer2 + 2], a
call CloseSRAM
- ld a, [StringBuffer2 + 2]
+ ld a, [wStringBuffer2 + 2]
ld b, a
ld a, 0
sub b
@@ -1440,13 +1440,13 @@
.asm_1008c8
ld b, a
- ld a, [StringBuffer2 + 1]
+ ld a, [wStringBuffer2 + 1]
ld c, a
ld a, $0a
sbc c
ld c, a
jr c, .asm_1008da
- ld a, [StringBuffer2]
+ ld a, [wStringBuffer2]
and a
jr nz, .asm_1008da
ret
@@ -1489,7 +1489,7 @@
ld c, a
ld a, $0a
sub c
- ld [StringBuffer2], a
+ ld [wStringBuffer2], a
jr z, .asm_10093f
ld de, .string_100966
hlcoord 4, 11
@@ -1496,7 +1496,7 @@
call PlaceString
hlcoord 8, 11
lb bc, 1, 2
- ld de, StringBuffer2
+ ld de, wStringBuffer2
call PrintNum
ld de, SFX_TWO_PC_BEEPS
call PlaySFX
@@ -1528,7 +1528,7 @@
hlcoord 0, 0
ld de, w3_dc00
call Function1009a5
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld de, w3_dd68
call Function1009a5
call Function1009d2
@@ -1543,7 +1543,7 @@
call Function1009ae
farcall ReloadMapPart
ld hl, w3_dd68
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
call Function1009a5
ret
; 1009a5
@@ -1562,7 +1562,7 @@
ld [rSVBK], a
ld hl, w3_d800
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
ld c, SCREEN_WIDTH
ld b, SCREEN_HEIGHT
.loop_row
@@ -1646,10 +1646,10 @@
; 100a2e
.StageForSend: ; 100a2e
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
and a
jr nz, .switch
- ld a, [CurPlayerMove]
+ ld a, [wCurPlayerMove]
ld b, BATTLEACTION_E
cp STRUGGLE
jr z, .struggle
@@ -1656,11 +1656,11 @@
ld b, BATTLEACTION_D
cp $ff
jr z, .struggle
- ld a, [CurMoveNum]
+ ld a, [wCurMoveNum]
jr .use_move
.switch
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
add BATTLEACTION_SWITCH1
jr .use_move
@@ -1925,7 +1925,7 @@
.b_button
ld a, [wMenuCursorY]
dec a
- ld [CurMoveNum], a
+ ld [wCurMoveNum], a
ld a, $01
and a
ret
@@ -1933,17 +1933,17 @@
.a_button
ld a, [wMenuCursorY]
dec a
- ld [CurMoveNum], a
+ ld [wCurMoveNum], a
ld a, [wMenuCursorY]
dec a
ld c, a
ld b, 0
- ld hl, BattleMonPP
+ ld hl, wBattleMonPP
add hl, bc
ld a, [hl]
and $3f
jr z, .no_pp_left
- ld a, [PlayerDisableCount]
+ ld a, [wPlayerDisableCount]
swap a
and $0f
dec a
@@ -1953,10 +1953,10 @@
dec a
ld c, a
ld b, 0
- ld hl, BattleMonMoves
+ ld hl, wBattleMonMoves
add hl, bc
ld a, [hl]
- ld [CurPlayerMove], a
+ ld [wCurPlayerMove], a
xor a
ret
@@ -1978,12 +1978,12 @@
ld b, 8
ld c, 8
call TextBox
- ld hl, BattleMonMoves
+ ld hl, wBattleMonMoves
ld de, wListMoves_MoveIndicesBuffer
ld bc, NUM_MOVES
call CopyBytes
ld a, SCREEN_WIDTH * 2
- ld [Buffer1], a
+ ld [wBuffer1], a
hlcoord 2, 10
predef ListMoves
ret
@@ -1995,7 +1995,7 @@
ld a, [wNumMoves]
inc a
ld [w2DMenuNumRows], a
- ld a, [CurMoveNum]
+ ld a, [wCurMoveNum]
inc a
ld [wMenuCursorY], a
ret
@@ -2027,7 +2027,7 @@
and c
jr z, .loop
call PlaceHollowCursor
- ld a, [PartyCount]
+ ld a, [wPartyCount]
inc a
ld b, a
ld a, [wMenuCursorY]
@@ -2040,13 +2040,13 @@
jr nz, .done
ld a, [wMenuCursorY]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld c, a
ld b, 0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, bc
ld a, [hl]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld de, SFX_READ_TEXT_2
call PlaySFX
call WaitSFX
@@ -2173,7 +2173,7 @@
Mobile_SetOverworldDelay: ; 100dd2
ld a, 30
- ld [OverworldDelay], a
+ ld [wOverworldDelay], a
ret
; 100dd8
@@ -2199,7 +2199,7 @@
; 100dfd
MobileComms_CheckInactivityTimer: ; 100dfd
- ld a, [OverworldDelay]
+ ld a, [wOverworldDelay]
ld c, a
ld a, 30
sub c
@@ -2227,7 +2227,7 @@
; 100e2d
Function100e2d: ; 100e2d
- ld a, [OverworldDelay]
+ ld a, [wOverworldDelay]
ld c, a
ld a, 30
sub c
@@ -2378,21 +2378,21 @@
asm_100f02:
ld a, c
- ld [StringBuffer2], a
+ ld [wStringBuffer2], a
; someting that was previously stored in de gets backed up to here
ld a, e
- ld [StringBuffer2 + 1], a
+ ld [wStringBuffer2 + 1], a
ld a, d
- ld [StringBuffer2 + 2], a
+ ld [wStringBuffer2 + 2], a
; empty this
xor a
- ld [StringBuffer2 + 4], a
- ld [StringBuffer2 + 5], a
+ ld [wStringBuffer2 + 4], a
+ ld [wStringBuffer2 + 5], a
.loop
ld a, [hl]
cp $ff
jr z, .done
- ld [StringBuffer2 + 3], a ; bank
+ ld [wStringBuffer2 + 3], a ; bank
push hl
inc hl
; addr 1
@@ -2418,9 +2418,9 @@
.done
; recover the values into bc
- ld a, [StringBuffer2 + 4]
+ ld a, [wStringBuffer2 + 4]
ld c, a
- ld a, [StringBuffer2 + 5]
+ ld a, [wStringBuffer2 + 5]
ld b, a
ret
; 100f3d
@@ -2427,7 +2427,7 @@
Function100f3d: ; 100f3d
; parameter
- ld a, [StringBuffer2]
+ ld a, [wStringBuffer2]
cp $02
jr z, .two
cp $01
@@ -2440,15 +2440,15 @@
; what was once in de gets copied to hl,
; modified by Function100f8d, and put back
; into this backup
- ld a, [StringBuffer2 + 1]
+ ld a, [wStringBuffer2 + 1]
ld l, a
- ld a, [StringBuffer2 + 2]
+ ld a, [wStringBuffer2 + 2]
ld h, a
call Function100f8d
ld a, l
- ld [StringBuffer2 + 1], a
+ ld [wStringBuffer2 + 1], a
ld a, h
- ld [StringBuffer2 + 2], a
+ ld [wStringBuffer2 + 2], a
ret
.two
@@ -2456,15 +2456,15 @@
; do the same as in .three
ld d, h
ld e, l
- ld a, [StringBuffer2 + 1]
+ ld a, [wStringBuffer2 + 1]
ld l, a
- ld a, [StringBuffer2 + 2]
+ ld a, [wStringBuffer2 + 2]
ld h, a
call Function100f8d
ld a, l
- ld [StringBuffer2 + 1], a
+ ld [wStringBuffer2 + 1], a
ld a, h
- ld [StringBuffer2 + 2], a
+ ld [wStringBuffer2 + 2], a
ret
.one
@@ -2474,31 +2474,31 @@
; and store the de result
ld h, d
ld l, e
- ld a, [StringBuffer2 + 1]
+ ld a, [wStringBuffer2 + 1]
ld e, a
- ld a, [StringBuffer2 + 2]
+ ld a, [wStringBuffer2 + 2]
ld d, a
call Function100f8d
ld a, e
- ld [StringBuffer2 + 1], a
+ ld [wStringBuffer2 + 1], a
ld a, d
- ld [StringBuffer2 + 2], a
+ ld [wStringBuffer2 + 2], a
ret
; 100f8d
Function100f8d: ; 100f8d
push hl
- ld a, [StringBuffer2 + 4]
+ ld a, [wStringBuffer2 + 4]
ld l, a
- ld a, [StringBuffer2 + 5]
+ ld a, [wStringBuffer2 + 5]
ld h, a
add hl, bc
ld a, l
- ld [StringBuffer2 + 4], a
+ ld [wStringBuffer2 + 4], a
ld a, h
- ld [StringBuffer2 + 5], a
+ ld [wStringBuffer2 + 5], a
pop hl
- ld a, [StringBuffer2 + 3]
+ ld a, [wStringBuffer2 + 3]
bit 7, a
res 7, a
jr z, .sram
@@ -2524,12 +2524,12 @@
; Bit 7 set: Not SRAM
; Lower 7 bits: Bank
; Address, size (dw), address
- dbwww $80, PlayerName, NAME_LENGTH, OTPlayerName
- dbwww $80, PartyCount, 1 + PARTY_LENGTH + 1, OTPartyCount
- dbwww $80, PlayerID, 2, OTPlayerID
- dbwww $80, PartyMons, PARTYMON_STRUCT_LENGTH * PARTY_LENGTH, OTPartyMons
- dbwww $80, PartyMonOT, NAME_LENGTH * PARTY_LENGTH, OTPartyMonOT
- dbwww $80, PartyMonNicknames, MON_NAME_LENGTH * PARTY_LENGTH, OTPartyMonNicknames
+ dbwww $80, wPlayerName, NAME_LENGTH, wOTPlayerName
+ dbwww $80, wPartyCount, 1 + PARTY_LENGTH + 1, wOTPartyCount
+ dbwww $80, wPlayerID, 2, wOTPlayerID
+ dbwww $80, wPartyMons, PARTYMON_STRUCT_LENGTH * PARTY_LENGTH, wOTPartyMons
+ dbwww $80, wPartyMonOT, NAME_LENGTH * PARTY_LENGTH, wOTPartyMonOT
+ dbwww $80, wPartyMonNicknames, MON_NAME_LENGTH * PARTY_LENGTH, wOTPartyMonNicknames
db -1
Unknown_100feb: ; 100feb
@@ -2538,9 +2538,9 @@
Unknown_100ff3: ; 100ff3
dbwww $80, wdc41, 1, NULL
- dbwww $80, PlayerName, NAME_LENGTH, NULL
- dbwww $80, PlayerName, NAME_LENGTH, NULL
- dbwww $80, PlayerID, 2, NULL
+ dbwww $80, wPlayerName, NAME_LENGTH, NULL
+ dbwww $80, wPlayerName, NAME_LENGTH, NULL
+ dbwww $80, wPlayerID, 2, NULL
dbwww $80, wSecretID, 2, NULL
dbwww $80, wPlayerGender, 1, NULL
dbwww $04, $a603, 8, NULL
@@ -2548,17 +2548,17 @@
db -1
Unknown_10102c: ; 10102c
- dbwww $80, OTPlayerName, NAME_LENGTH, NULL
- dbwww $80, OTPlayerID, 2, NULL
- dbwww $80, OTPartyMonNicknames, MON_NAME_LENGTH * PARTY_LENGTH, NULL
- dbwww $80, OTPartyMonOT, NAME_LENGTH * PARTY_LENGTH, NULL
- dbwww $80, OTPartyMons, PARTYMON_STRUCT_LENGTH * PARTY_LENGTH, NULL
+ dbwww $80, wOTPlayerName, NAME_LENGTH, NULL
+ dbwww $80, wOTPlayerID, 2, NULL
+ dbwww $80, wOTPartyMonNicknames, MON_NAME_LENGTH * PARTY_LENGTH, NULL
+ dbwww $80, wOTPartyMonOT, NAME_LENGTH * PARTY_LENGTH, NULL
+ dbwww $80, wOTPartyMons, PARTYMON_STRUCT_LENGTH * PARTY_LENGTH, NULL
db -1
; 10104f
Function101050: ; 101050
call Function10107d
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
rept 2 ; ???
ld hl, wc608
endr
@@ -2583,7 +2583,7 @@
ld hl, wc608
ld bc, wc7bd - wc608
call ByteFill
- ld hl, OTPlayerName
+ ld hl, wOTPlayerName
ld de, wc608
ld bc, NAME_LENGTH
call CopyBytes
@@ -2592,15 +2592,15 @@
ld [wc608 + 11], a
ld a, [hl]
ld [wc608 + 12], a
- ld hl, OTPartyMonNicknames
+ ld hl, wOTPartyMonNicknames
ld de, wc608 + 13
ld bc, NAME_LENGTH
call .CopyAllFromOT
- ld hl, OTPartyMonOT
- ld de, OTClassName + 1
+ ld hl, wOTPartyMonOT
+ ld de, wOTClassName + 1
ld bc, NAME_LENGTH
call .CopyAllFromOT
- ld hl, OTPartyMon1Species
+ ld hl, wOTPartyMon1Species
ld de, $c699
ld bc, PARTYMON_STRUCT_LENGTH
call .CopyAllFromOT
@@ -2614,7 +2614,7 @@
.CopyAllFromOT: ; 1010cd
push hl
ld hl, 0
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
call AddNTimes
ld b, h
ld c, l
@@ -2645,32 +2645,32 @@
LoadSelectedPartiesForColosseum: ; 1010f2
xor a
- ld hl, StringBuffer2
+ ld hl, wStringBuffer2
ld bc, 9
call ByteFill
ld hl, wPlayerMonSelection
- ld de, PartyCount
+ ld de, wPartyCount
call .CopyThreeSpecies
ld hl, wPlayerMonSelection
- ld de, PartyMon1Species
+ ld de, wPartyMon1Species
call .CopyPartyStruct
ld hl, wPlayerMonSelection
- ld de, PartyMonOT
+ ld de, wPartyMonOT
call .CopyName
ld hl, wPlayerMonSelection
- ld de, PartyMonNicknames
+ ld de, wPartyMonNicknames
call .CopyName
ld hl, wOTMonSelection
- ld de, OTPartyCount
+ ld de, wOTPartyCount
call .CopyThreeSpecies
ld hl, wOTMonSelection
- ld de, OTPartyMon1Species
+ ld de, wOTPartyMon1Species
call .CopyPartyStruct
ld hl, wOTMonSelection
- ld de, OTPartyMonOT
+ ld de, wOTPartyMonOT
call .CopyName
ld hl, wOTMonSelection
- ld de, OTPartyMonNicknames
+ ld de, wOTPartyMonNicknames
call .CopyName
ret
; 101145
@@ -2678,7 +2678,7 @@
.CopyThreeSpecies: ; 101145
; Load the 3 choices to the buffer
push de
- ld bc, StringBuffer2 + NAME_LENGTH_JAPANESE
+ ld bc, wStringBuffer2 + NAME_LENGTH_JAPANESE
xor a
.party_loop
push af
@@ -2694,7 +2694,7 @@
ld a, 3
ld [de], a
inc de
- ld hl, StringBuffer2 + NAME_LENGTH_JAPANESE
+ ld hl, wStringBuffer2 + NAME_LENGTH_JAPANESE
ld bc, 3
call CopyBytes
ld a, $ff
@@ -2736,19 +2736,19 @@
.ContinueCopy:
; Copy, via wc608...
ld a, LOW(wc608)
- ld [StringBuffer2], a
+ ld [wStringBuffer2], a
ld a, HIGH(wc608)
- ld [StringBuffer2 + 1], a
+ ld [wStringBuffer2 + 1], a
; ... bc bytes...
ld a, c
- ld [StringBuffer2 + 2], a
+ ld [wStringBuffer2 + 2], a
ld a, b
- ld [StringBuffer2 + 3], a
+ ld [wStringBuffer2 + 3], a
; ... to de...
ld a, e
- ld [StringBuffer2 + 4], a
+ ld [wStringBuffer2 + 4], a
ld a, d
- ld [StringBuffer2 + 5], a
+ ld [wStringBuffer2 + 5], a
; ... 3 times.
ld a, 3
.big_copy_loop
@@ -2760,15 +2760,15 @@
call .GetCopySize
pop af
call AddNTimes
- ld a, [StringBuffer2]
+ ld a, [wStringBuffer2]
ld e, a
- ld a, [StringBuffer2 + 1]
+ ld a, [wStringBuffer2 + 1]
ld d, a
call CopyBytes
ld a, e
- ld [StringBuffer2], a
+ ld [wStringBuffer2], a
ld a, d
- ld [StringBuffer2 + 1], a
+ ld [wStringBuffer2 + 1], a
pop hl
pop af
dec a
@@ -2788,17 +2788,17 @@
; 1011df
.GetDestinationAddress: ; 1011df
- ld a, [StringBuffer2 + 4]
+ ld a, [wStringBuffer2 + 4]
ld l, a
- ld a, [StringBuffer2 + 5]
+ ld a, [wStringBuffer2 + 5]
ld h, a
ret
; 1011e8
.GetCopySize: ; 1011e8
- ld a, [StringBuffer2 + 2]
+ ld a, [wStringBuffer2 + 2]
ld c, a
- ld a, [StringBuffer2 + 3]
+ ld a, [wStringBuffer2 + 3]
ld b, a
ret
; 1011f1
@@ -2849,7 +2849,7 @@
Function10123d: ; 10123d
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld a, c
ld hl, Jumptable_101247
rst JumpTable
@@ -3922,7 +3922,7 @@
ld hl, wccb5
.asm_101909
- ld de, LinkBattleRNs
+ ld de, wLinkBattleRNs
ld bc, 10
call CopyBytes
ret
@@ -4045,9 +4045,9 @@
ld [rSVBK], a
ld a, c
- ld [OtherTrainerClass], a
- ld hl, OTPlayerName
- ld de, OTClassName
+ ld [wOtherTrainerClass], a
+ ld hl, wOTPlayerName
+ ld de, wOTClassName
ld bc, NAME_LENGTH
call CopyBytes
ld a, [wcd2f]
@@ -4062,7 +4062,7 @@
StartMobileBattle: ; 101a21
; force stereo and fast text speed
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
and (1 << STEREO)
@@ -4078,7 +4078,7 @@
ld a, CONNECTION_NOT_ESTABLISHED
ld [hSerialConnectionStatus], a
pop af
- ld [Options], a
+ ld [wOptions], a
ret
; 101a4f
@@ -5053,7 +5053,7 @@
Function102180: ; 102180
ld hl, wc608 + 1
- ld de, StringBuffer2
+ ld de, wStringBuffer2
ld bc, 11
call CopyBytes
ret
@@ -5086,7 +5086,7 @@
ld de, wPlayerMoveStruct
farcall Function8ac70
ld a, c
- ld [StringBuffer1], a
+ ld [wStringBuffer1], a
push af
call Function1013aa
pop af
@@ -5215,7 +5215,7 @@
Function102283: ; 102283
ld a, $01
- ld [AttrMapEnd], a
+ ld [wAttrMapEnd], a
ld hl, wcd4b
set 0, [hl]
ret
@@ -5223,7 +5223,7 @@
Function10228e: ; 10228e
xor a
- ld [AttrMapEnd], a
+ ld [wAttrMapEnd], a
ld hl, wcd4b
res 0, [hl]
ret
@@ -5255,13 +5255,13 @@
.asm_1022c1
call Function10304f
ld a, $01
- ld [AttrMapEnd], a
+ ld [wAttrMapEnd], a
ret
; 1022ca
Function1022ca: ; 1022ca
ld a, 30
- ld [OverworldDelay], a
+ ld [wOverworldDelay], a
ret
; 1022d0
@@ -5271,7 +5271,7 @@
and a
jr nz, .asm_1022f3
call Function102298
- ld a, [OverworldDelay]
+ ld a, [wOverworldDelay]
ld c, a
ld a, 30
sub c
@@ -5409,11 +5409,11 @@
call Function102c87
ld a, [wcd4c]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
xor a
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
- ld hl, PartyCount
+ ld hl, wPartyCount
inc [hl]
ld a, [hli]
ld c, a
@@ -5420,7 +5420,7 @@
ld b, 0
add hl, bc
ld [hl], $ff
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld [wcd4c], a
call Function102c07
call Function102d48
@@ -5749,11 +5749,11 @@
.d_up
ld a, [wMenuCursorY]
ld b, a
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
cp b
ret nz
call HideCursor
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld [wMenuCursorY], a
ld a, $1d ; Function102652
ld [wcd49], a
@@ -5820,7 +5820,7 @@
.d_up
ld a, [wMenuCursorY]
ld b, a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp b
ret nz
ld a, $23 ; Function1026b7
@@ -5886,7 +5886,7 @@
.asm_102712
hlcoord 9, 17
ld [hl], " "
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
ld [wMenuCursorY], a
ld a, $1f ; Function1025e9
ld [wcd49], a
@@ -6128,7 +6128,7 @@
Function1028c6: ; 1028c6
xor a
- ld [MonType], a
+ ld [wMonType], a
call Function102bac
ld a, $1d ; Function102652
ld [wcd49], a
@@ -6142,7 +6142,7 @@
Function1028da: ; 1028da
ld a, OTPARTYMON
- ld [MonType], a
+ ld [wMonType], a
call Function102bac
ld a, $1f ; Function1025e9
ld [wcd49], a
@@ -6204,7 +6204,7 @@
call LoadMenuDataHeader
call Function102e07
ld a, $32
- ld [TextDelayFrames], a
+ ld [wTextDelayFrames], a
ld hl, wcd4b
set 1, [hl]
ld a, [wcd4a]
@@ -6215,7 +6215,7 @@
; 10294f
Function10294f: ; 10294f
- ld a, [TextDelayFrames]
+ ld a, [wTextDelayFrames]
and a
ret nz
ld a, [wcd4a]
@@ -6367,7 +6367,7 @@
Function102a3b: ; 102a3b
ld a, [wcd30]
ld [wc74e], a
- ld hl, PlayerName
+ ld hl, wPlayerName
ld de, wPlayerTrademonSenderName
ld bc, NAME_LENGTH
call CopyBytes
@@ -6375,13 +6375,13 @@
dec a
ld c, a
ld b, 0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, bc
ld a, [hl]
ld [wPlayerTrademonSpecies], a
ld a, [wcd4c]
dec a
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
call SkipNames
ld de, wPlayerTrademonOTName
ld bc, NAME_LENGTH
@@ -6388,7 +6388,7 @@
call CopyBytes
ld a, [wcd4c]
dec a
- ld hl, PartyMon1ID
+ ld hl, wPartyMon1ID
call GetPartyLocation
ld a, [hli]
ld [wPlayerTrademonID], a
@@ -6396,7 +6396,7 @@
ld [wPlayerTrademonID + 1], a
ld a, [wcd4c]
dec a
- ld hl, PartyMon1DVs
+ ld hl, wPartyMon1DVs
call GetPartyLocation
ld a, [hli]
ld [wPlayerTrademonDVs], a
@@ -6404,7 +6404,7 @@
ld [wPlayerTrademonDVs + 1], a
ld a, [wcd4c]
dec a
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
call GetPartyLocation
ld b, h
ld c, l
@@ -6411,7 +6411,7 @@
farcall GetCaughtGender
ld a, c
ld [wPlayerTrademonCaughtData], a
- ld hl, OTPlayerName
+ ld hl, wOTPlayerName
ld de, wOTTrademonSenderName
ld bc, NAME_LENGTH
call CopyBytes
@@ -6420,13 +6420,13 @@
dec a
ld c, a
ld b, 0
- ld hl, OTPartySpecies
+ ld hl, wOTPartySpecies
add hl, bc
ld a, [hl]
ld [wOTTrademonSpecies], a
ld a, [wcd4d]
dec a
- ld hl, OTPartyMonOT
+ ld hl, wOTPartyMonOT
call SkipNames
ld de, wOTTrademonOTName
ld bc, NAME_LENGTH
@@ -6433,7 +6433,7 @@
call CopyBytes
ld a, [wcd4d]
dec a
- ld hl, OTPartyMon1ID
+ ld hl, wOTPartyMon1ID
call GetPartyLocation
ld a, [hli]
ld [wOTTrademonID], a
@@ -6441,7 +6441,7 @@
ld [wOTTrademonID + 1], a
ld a, [wcd4d]
dec a
- ld hl, OTPartyMon1DVs
+ ld hl, wOTPartyMon1DVs
call GetPartyLocation
ld a, [hli]
ld [wOTTrademonDVs], a
@@ -6449,7 +6449,7 @@
ld [wOTTrademonDVs + 1], a
ld a, [wcd4d]
dec a
- ld hl, OTPartyMon1Species
+ ld hl, wOTPartyMon1Species
call GetPartyLocation
ld b, h
ld c, l
@@ -6480,7 +6480,7 @@
Function102b32: ; 102b32
ld a, [wcd4c]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld a, $01
ld [wForceEvolution], a
farcall EvolvePokemon
@@ -6492,7 +6492,7 @@
Function102b4e: ; 102b4e
ld a, OTPARTYMON
- ld [MonType], a
+ ld [wMonType], a
ld a, [wMenuCursorY]
push af
ld de, Unknown_102b73
@@ -6499,7 +6499,7 @@
call SetMenuAttributes
pop af
ld [wMenuCursorY], a
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
ld [w2DMenuNumRows], a
ret
; 102b68
@@ -6521,7 +6521,7 @@
Function102b7b: ; 102b7b
xor a
- ld [MonType], a
+ ld [wMonType], a
ld a, [wMenuCursorY]
push af
ld de, Unknown_102b94
@@ -6528,7 +6528,7 @@
call SetMenuAttributes
pop af
ld [wMenuCursorY], a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld [w2DMenuNumRows], a
ret
; 102b94
@@ -6553,11 +6553,11 @@
Function102bac: ; 102bac
ld a, [wMenuCursorY]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
call LowVolume
call ClearSprites
farcall _MobileStatsScreenInit
- ld a, [CurPartyMon]
+ ld a, [wCurPartyMon]
inc a
ld [wMenuCursorY], a
call Function102d9a
@@ -6573,13 +6573,13 @@
Function102bdc: ; 102bdc
ld a, [wcd4d]
dec a
- ld hl, OTPartyMon1Species
+ ld hl, wOTPartyMon1Species
call GetPartyLocation
push hl
ld a, [wcd4d]
ld c, a
ld b, 0
- ld hl, OTPartyCount
+ ld hl, wOTPartyCount
add hl, bc
ld a, [hl]
pop hl
@@ -6611,8 +6611,8 @@
; 102c14
Function102c14: ; 102c14
- ld hl, PartySpecies
- ld de, OTPartySpecies
+ ld hl, wPartySpecies
+ ld de, wOTPartySpecies
ld bc, 1
call Function102c71
ret
@@ -6619,8 +6619,8 @@
; 102c21
Function102c21: ; 102c21
- ld hl, PartyMonNicknames
- ld de, OTPartyMonNicknames
+ ld hl, wPartyMonNicknames
+ ld de, wOTPartyMonNicknames
ld bc, 11
call Function102c71
ret
@@ -6627,8 +6627,8 @@
; 102c2e
Function102c2e: ; 102c2e
- ld hl, PartyMonOT
- ld de, OTPartyMonOT
+ ld hl, wPartyMonOT
+ ld de, wOTPartyMonOT
ld bc, 11
call Function102c71
ret
@@ -6635,8 +6635,8 @@
; 102c3b
Function102c3b: ; 102c3b
- ld hl, PartyMon1
- ld de, OTPartyMon1
+ ld hl, wPartyMon1
+ ld de, wOTPartyMon1
ld bc, $30
call Function102c71
ret
@@ -6681,7 +6681,7 @@
push af
ld a, [wcd4c]
ld [wJumptableIndex], a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
ld [wcf64], a
ld a, 0
ld hl, $a600
@@ -6696,7 +6696,7 @@
call Function102d3e
ld a, [wcd4d]
ld [wJumptableIndex], a
- ld a, [OTPartyCount]
+ ld a, [wOTPartyCount]
ld [wcf64], a
ld a, $05
ld hl, w5_da00
@@ -6770,7 +6770,7 @@
ld a, [wcd4c]
ld e, a
ld d, 0
- ld hl, PartyCount
+ ld hl, wPartyCount
add hl, de
ld a, [hl]
ld [wd265], a
@@ -6781,7 +6781,7 @@
ld a, [wcd4c]
dec a
ld bc, PARTYMON_STRUCT_LENGTH
- ld hl, PartyMon1Happiness
+ ld hl, wPartyMon1Happiness
call AddNTimes
ld [hl], BASE_HAPPINESS
@@ -6792,7 +6792,7 @@
ld a, [wcd4c]
dec a
ld bc, PARTYMON_STRUCT_LENGTH
- ld hl, PartyMon1DVs
+ ld hl, wPartyMon1DVs
call AddNTimes
predef GetUnownLetter
farcall UpdateUnownDex
@@ -6799,7 +6799,7 @@
ld a, [wFirstUnownSeen]
and a
jr nz, .asm_102d98
- ld a, [UnownLetter]
+ ld a, [wUnownLetter]
ld [wFirstUnownSeen], a
.asm_102d98
@@ -6813,7 +6813,7 @@
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
ld a, $07
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
farcall HDMATransferAttrMapAndTileMapToWRAMBank3
@@ -6905,21 +6905,21 @@
Function102e4f: ; 102e4f
farcall Function16d42e
farcall _InitMG_Mobile_LinkTradePalMap
- ld de, PlayerName
+ ld de, wPlayerName
hlcoord 4, 0
call PlaceString
ld a, $14
ld [bc], a
- ld de, OTPlayerName
+ ld de, wOTPlayerName
hlcoord 4, 8
call PlaceString
ld a, $14
ld [bc], a
hlcoord 7, 1
- ld de, PartySpecies
+ ld de, wPartySpecies
call .PlaceSpeciesNames
hlcoord 7, 9
- ld de, OTPartySpecies
+ ld de, wOTPartySpecies
call .PlaceSpeciesNames
ret
; 102e86
@@ -6956,13 +6956,13 @@
dec a
ld c, a
ld b, 0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, bc
ld a, [hl]
ld [wd265], a
call GetPokemonName
- ld hl, StringBuffer1
- ld de, StringBuffer2
+ ld hl, wStringBuffer1
+ ld de, wStringBuffer2
ld bc, 11
call CopyBytes
ld a, [wcd4d]
@@ -6969,7 +6969,7 @@
dec a
ld c, a
ld b, 0
- ld hl, OTPartySpecies
+ ld hl, wOTPartySpecies
add hl, bc
ld a, [hl]
ld [wd265], a
@@ -7049,7 +7049,7 @@
ld a, [wd003]
ld c, a
ld b, 0
- ld hl, OTPartySpecies
+ ld hl, wOTPartySpecies
add hl, bc
ld a, [hl]
ld [wd265], a
@@ -7058,7 +7058,7 @@
ld de, String_102fb2
hlcoord 1, 14
call PlaceString
- ld de, StringBuffer1
+ ld de, wStringBuffer1
hlcoord 13, 14
call PlaceString
ld de, String_102fcc
@@ -7120,7 +7120,7 @@
Function10304f: ; 10304f
xor a
- ld [AttrMapEnd], a
+ ld [wAttrMapEnd], a
ld [wcf42], a
ld [wcf44], a
ld [wcf45], a
@@ -7129,7 +7129,7 @@
Function10305d: ; 10305d
nop
- ld a, [AttrMapEnd]
+ ld a, [wAttrMapEnd]
and a
ret z
call Function10307f
@@ -7143,7 +7143,7 @@
ld a, $01
ld [hOAMUpdate], a
call ClearSprites
- ld de, Sprites
+ ld de, wVirtualOAM
call Function1030cd
xor a
ld [hOAMUpdate], a
@@ -7361,7 +7361,7 @@
Function103309: ; 103309
xor a
ld [hBGMapMode], a
- ld hl, Buffer1
+ ld hl, wBuffer1
ld bc, 10
xor a
call ByteFill
@@ -7369,7 +7369,7 @@
call GetSRAMBank
ld a, [wdc41]
ld [$a60c], a
- ld [Buffer1], a
+ ld [wBuffer1], a
call CloseSRAM
call Function1035c6
ld a, [hli]
@@ -7412,15 +7412,15 @@
call Function10339a
call Function10342c
farcall HDMATransferTileMapToWRAMBank3
- ld a, [Buffer2]
+ ld a, [wBuffer2]
bit 7, a
jr z, .asm_103362
- ld hl, Buffer2
+ ld hl, wBuffer2
bit 6, [hl]
jr z, .asm_103398
ld a, $04
call GetSRAMBank
- ld a, [Buffer1]
+ ld a, [wBuffer1]
ld [$a60c], a
ld [wdc41], a
call CloseSRAM
@@ -7488,7 +7488,7 @@
.b
call PlayClickSFX
- ld hl, Buffer2
+ ld hl, wBuffer2
set 7, [hl]
ret
@@ -7498,9 +7498,9 @@
jr nz, .a_return
ld de, SFX_TRANSACTION
call PlaySFX
- ld hl, Buffer2
+ ld hl, wBuffer2
set 7, [hl]
- ld hl, Buffer2
+ ld hl, wBuffer2
set 6, [hl]
ret
@@ -7514,9 +7514,9 @@
call PlaySFX
ld bc, 8
call Function10350f
- ld a, [Buffer1]
+ ld a, [wBuffer1]
xor e
- ld [Buffer1], a
+ ld [wBuffer1], a
ret
; 10342c
@@ -7554,7 +7554,7 @@
call Function103487
ld bc, 8
call Function10350f
- ld a, [Buffer1]
+ ld a, [wBuffer1]
and e
ld bc, 2
jr z, .asm_10347d
@@ -7628,7 +7628,7 @@
push hl
call ClearBox
pop hl
- ld bc, AttrMap - TileMap
+ ld bc, wAttrMap - wTileMap
add hl, bc
pop bc
ld a, $06
@@ -7768,7 +7768,7 @@
call CloseWindow
jr c, .pressed_b
ld a, [wMenuCursorY]
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld c, a
ld a, [wMobileOrCable_LastSelection]
and $f0
@@ -7778,7 +7778,7 @@
.pressed_b
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 103640
@@ -7826,12 +7826,12 @@
.asm_103690
ld a, $01
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.asm_103696
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.asm_10369b
@@ -7871,7 +7871,7 @@
.asm_1036e6
ld a, $01
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.asm_1036ec
@@ -7881,7 +7881,7 @@
.asm_1036f4
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 1036f9
@@ -7900,8 +7900,8 @@
.asm_10370f
ld a, c
- ld [StringBuffer2], a
- ld a, [StringBuffer2]
+ ld [wStringBuffer2], a
+ ld a, [wStringBuffer2]
cp $05
jr nc, .asm_103724
cp $02
@@ -8003,7 +8003,7 @@
pop bc
jr c, .failed_to_save
ld a, $01
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld a, c
and a
ret z
@@ -8012,7 +8012,7 @@
.failed_to_save
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld a, c
and a
ret z
@@ -8032,13 +8032,13 @@
call YesNoBox
jr c, .nope
ld a, $01
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.nope
xor a
ld [wdc5f], a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 1037e6
@@ -8057,7 +8057,7 @@
call PrintText
call JoyWaitAorB
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.asm_103807
@@ -8065,12 +8065,12 @@
and a
jr nz, .asm_103813
ld a, $01
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.asm_103813
ld a, $02
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 103819
@@ -8121,12 +8121,12 @@
ld bc, 3
call CopyBytes
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.asm_103870
ld a, $01
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 103876
@@ -8141,7 +8141,7 @@
ret nz
farcall Function1008a6
ld a, c
- ld [StringBuffer2], a
+ ld [wStringBuffer2], a
ld hl, UnknownText_0x103898
call PrintText
call JoyWaitAorB
--- a/mobile/mobile_41.asm
+++ b/mobile/mobile_41.asm
@@ -7,7 +7,7 @@
ld a, BANK(sTrainerRankingGameTimeHOF)
call GetSRAMBank
- ld hl, GameTimeHours
+ ld hl, wGameTimeHours
ld de, sTrainerRankingGameTimeHOF
ld bc, 4
call CopyBytes
@@ -38,7 +38,7 @@
ret
ld a, BANK(sTrainerRankingLongestMagikarp)
call GetSRAMBank
- ld de, Buffer1
+ ld de, wBuffer1
ld hl, sTrainerRankingLongestMagikarp
; Is this Magikarp the longest measured?
@@ -270,7 +270,7 @@
StubbedTrainerRankings_Battles: ; 106050
ret
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL ; Exclude the Dude’s tutorial battle
ret z
ld hl, sTrainerRankingBattles
@@ -278,7 +278,7 @@
StubbedTrainerRankings_WildBattles: ; 10605d
ret
- ld a, [BattleType]
+ ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL ; Exclude the Dude’s tutorial battle
ret z
ld hl, sTrainerRankingWildBattles
@@ -814,7 +814,7 @@
Special_Mobile_DummyReturnFalse: ; 10630f
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 106314
@@ -1071,7 +1071,7 @@
; 10649b
Function10649b: ; 10649b
- ld a, [TextBoxFrame]
+ ld a, [wTextBoxFrame]
maskbits NUM_FRAMES
ld bc, 6 * LEN_1BPP_TILE
ld hl, Frames
--- a/mobile/mobile_42.asm
+++ b/mobile/mobile_42.asm
@@ -91,11 +91,11 @@
push af
xor a
ld [hMapAnims], a
- ld hl, VramState
+ ld hl, wVramState
ld a, [hl]
push af
res 0, [hl]
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -104,9 +104,9 @@
call MobileTradeAnim_JumptableLoop
jr nc, .loop
pop af
- ld [Options], a
+ ld [wOptions], a
pop af
- ld [VramState], a
+ ld [wVramState], a
pop af
ld [hMapAnims], a
ret
@@ -121,11 +121,11 @@
push af
xor a
ld [hMapAnims], a
- ld hl, VramState
+ ld hl, wVramState
ld a, [hl]
push af
res 0, [hl]
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
@@ -134,9 +134,9 @@
call MobileTradeAnim_JumptableLoop
jr nc, .loop
pop af
- ld [Options], a
+ ld [wOptions], a
pop af
- ld [VramState], a
+ ld [wVramState], a
pop af
ld [hMapAnims], a
ret
@@ -292,8 +292,8 @@
push af
predef GetUnownLetter
pop af
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
call GetBaseData
pop de
predef GetMonFrontpic
@@ -305,8 +305,8 @@
push af
predef GetUnownLetter
pop af
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
call GetBaseData
pop de
predef GetAnimatedFrontpic
@@ -314,7 +314,7 @@
; 108219
Function108219: ; 108219
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
hlcoord 7, 2
ld d, $0
ld e, ANIM_MON_TRADE
@@ -323,7 +323,7 @@
; 108229
Function108229: ; 108229
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
hlcoord 7, 2
ld d, $0
ld e, ANIM_MON_TRADE
@@ -335,7 +335,7 @@
push de
ld [wd265], a
call GetPokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
pop de
ld bc, MON_NAME_LENGTH
call CopyBytes
@@ -485,12 +485,12 @@
ld [hWY], a
call MobileTradeAnim_DisplayMonToBeSent
ld a, [wPlayerTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
call Function10895e
ld a, [wPlayerTrademonDVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wPlayerTrademonDVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
@@ -546,7 +546,7 @@
call DisableLCD
call MobileTradeAnim_ClearBGMap
ld a, [wOTTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld hl, wOTTrademonDVs
ld de, vTiles2
call Function108201
@@ -579,11 +579,11 @@
ld a, $50
ld [hWY], a
ld a, [wOTTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [wOTTrademonDVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wOTTrademonDVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
@@ -610,7 +610,7 @@
ld [hWY], a
call MobileTradeAnim_DisplayMonToBeSent
ld a, [wPlayerTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld hl, wPlayerTrademonDVs
call Function10898a
call DelayFrame
@@ -623,9 +623,9 @@
lb bc, BANK(TradePoofGFX), 12
call Request2bpp
ld a, [wPlayerTrademonDVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wPlayerTrademonDVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
@@ -681,7 +681,7 @@
call DisableLCD
call MobileTradeAnim_ClearBGMap
ld a, [wOTTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld hl, wOTTrademonDVs
ld de, vTiles2
call Function108201
@@ -723,11 +723,11 @@
ld a, $50
ld [hWY], a
ld a, [wOTTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [wOTTrademonDVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wOTTrademonDVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
@@ -750,7 +750,7 @@
call DisableLCD
call MobileTradeAnim_ClearBGMap
ld a, [wOTTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld hl, wOTTrademonDVs
ld de, vTiles2
call Function108201
@@ -792,11 +792,11 @@
ld a, $50
ld [hWY], a
ld a, [wOTTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [wOTTrademonDVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wOTTrademonDVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
--- a/mobile/mobile_45.asm
+++ b/mobile/mobile_45.asm
@@ -650,7 +650,7 @@
ld a, [de]
ld [hl], a
xor a
- ld [BigDoll], a
+ ld [wDecoBigDoll], a
ld [$dc17], a
ld a, $2
ld [$dc0e], a
@@ -691,7 +691,7 @@
ld a, [$dc0d]
ld [de], a
ld b, $0
- ld a, [BigDoll]
+ ld a, [wDecoBigDoll]
and a
jr z, .asm_114537
ld b, $1
@@ -753,7 +753,7 @@
Function114576: ; 114576
xor a
- ld [Bed], a
+ ld [wDecoBed], a
ld b, $7
call Function1143f3
cp $2
@@ -802,7 +802,7 @@
.asm_1145bf
ld a, $1
- ld [Bed], a
+ ld [wDecoBed], a
ret
; 1145c5
@@ -895,7 +895,7 @@
.asm_114636
ld a, b
- ld [PartyMon5Defense], a
+ ld [wPartyMon5Defense], a
xor a
ret
@@ -906,7 +906,7 @@
push af
push de
ld hl, $ddc8
- ld a, [PartyMon5Defense]
+ ld a, [wPartyMon5Defense]
ld b, a
.asm_114648
ld a, [de]
@@ -924,7 +924,7 @@
cp $d
jr nz, .asm_11468a
xor a
- ld [Carpet], a
+ ld [wDecoCarpet], a
.asm_114662
inc e
call z, Function11469b
@@ -947,7 +947,7 @@
inc e
call z, Function11469b
ld a, $1
- ld [Carpet], a
+ ld [wDecoCarpet], a
ld a, [de]
cp $d
jr z, .asm_114662
@@ -959,7 +959,7 @@
ld [hFF8C], a
ld [MBC3SRamBank], a
xor a
- ld [Carpet], a
+ ld [wDecoCarpet], a
ld a, $1
ret
@@ -1021,7 +1021,7 @@
and a
jr z, .asm_1146f5
ld a, $1
- ld [BigDoll], a
+ ld [wDecoBigDoll], a
jr .asm_1146da
.asm_1146f5
@@ -1057,7 +1057,7 @@
ld [hFF8C], a
ld [MBC3SRamBank], a
ld a, $1
- ld [RightOrnament], a
+ ld [wDecoRightOrnament], a
call Function1147cd
and a
jp nz, .asm_1147b7
@@ -1069,13 +1069,13 @@
and a
jr z, .asm_114794
ld a, $1
- ld [BigDoll], a
+ ld [wDecoBigDoll], a
.asm_114749
call Function11494d
and a
jr nz, .asm_11478a
- ld a, [BigDoll]
+ ld a, [wDecoBigDoll]
and a
jr nz, .asm_114786
ld hl, $dc03
@@ -1102,7 +1102,7 @@
ld a, [$dc0d]
inc a
ld [$dc0d], a
- ld a, [BigDoll]
+ ld a, [wDecoBigDoll]
and a
jr z, .asm_114799
@@ -1127,7 +1127,7 @@
ret
.asm_114799
- ld a, [Carpet]
+ ld a, [wDecoCarpet]
and a
jr z, .asm_114737
jr .asm_1147cb
@@ -1141,7 +1141,7 @@
and a
jr z, .asm_1147cb
xor a
- ld [BigDoll], a
+ ld [wDecoBigDoll], a
.asm_1147b7
ld a, [$dc17]
@@ -1148,7 +1148,7 @@
and a
jr z, .asm_114794
ld a, $1
- ld [BigDoll], a
+ ld [wDecoBigDoll], a
ld a, [$dc0d]
cp $1
jr nz, .asm_114773
@@ -1162,7 +1162,7 @@
Function1147cd: ; 1147cd
ld bc, NULL
- ld a, [RightOrnament]
+ ld a, [wDecoRightOrnament]
and a
jr nz, .asm_11480c
.asm_1147d6
@@ -1364,7 +1364,7 @@
call z, Function114944
cp $3
jr nz, .asm_114904
- ld hl, Plant
+ ld hl, wDecoPlant
ld a, [hli]
ld [de], a
inc e
@@ -1458,7 +1458,7 @@
call z, Function1149c3
cp $3
jr nz, .asm_114983
- ld hl, Plant
+ ld hl, wDecoPlant
ld a, [hli]
ld [de], a
inc e
@@ -1810,7 +1810,7 @@
call z, Function114b4c
.asm_114b26
- ld hl, Plant
+ ld hl, wDecoPlant
ld a, [$dc00]
ld [hli], a
ld [hl], e
@@ -2050,7 +2050,7 @@
; 114c5e
Function114c5e: ; 114c5e
- ld de, PartyMon5Defense
+ ld de, wPartyMon5Defense
push hl
.asm_114c62
ld a, [hli]
@@ -2133,7 +2133,7 @@
.asm_114cc6
ld [de], a
pop hl
- ld de, PartyMon5Defense
+ ld de, wPartyMon5Defense
ld bc, NULL
.asm_114cce
inc bc
@@ -2194,7 +2194,7 @@
ld e, a
ld a, [hli]
ld d, a
- ld hl, PartyMon5Defense
+ ld hl, wPartyMon5Defense
call Function115d6a
xor a
jp Function11425c
@@ -2287,7 +2287,7 @@
; 114d99
Function114d99: ; 114d99
- ld de, PartyMon5Defense
+ ld de, wPartyMon5Defense
xor a
ld [de], a
.asm_114d9e
@@ -2321,17 +2321,17 @@
.asm_114dc4
pop hl
- ld a, [PartyMon5Defense]
+ ld a, [wPartyMon5Defense]
and a
jr z, .asm_114dd2
ld a, $2c
inc de
ld [de], a
- ld a, [PartyMon5Defense]
+ ld a, [wPartyMon5Defense]
.asm_114dd2
inc a
- ld [PartyMon5Defense], a
+ ld [wPartyMon5Defense], a
.asm_114dd6
inc de
ld a, [hli]
@@ -2453,7 +2453,7 @@
ld a, c
and a
jr nz, .asm_114e6f
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
and a
jp z, Function11425c
jr .asm_114e76
@@ -2460,7 +2460,7 @@
.asm_114e6f
xor a
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
call Function114ee9
.asm_114e76
@@ -2532,7 +2532,7 @@
ld [hli], a
ld [hl], b
xor a
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
ret
.asm_114edb
@@ -2656,7 +2656,7 @@
; 114f59
Function114f59: ; 114f59
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
and a
jr nz, .asm_114f7c
ld a, [$dc03]
@@ -2674,7 +2674,7 @@
and a
jr nz, .asm_114fe7
ld a, $1
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
.asm_114f7c
ld a, [$dc03]
@@ -2703,7 +2703,7 @@
ret
.asm_114fa7
- ld hl, Bed
+ ld hl, wDecoBed
ld c, [hl]
inc hl
ld a, [hli]
@@ -2842,7 +2842,7 @@
; 115062
Function115062: ; 115062
- ld hl, Bed
+ ld hl, wDecoBed
ld a, [hli]
and a
jr z, .asm_1150ae
@@ -2856,7 +2856,7 @@
ld d, [hl]
ld b, $0
ld hl, $dc24
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
cp $1
jr z, .asm_11509b
cp $2
@@ -2881,7 +2881,7 @@
call Function115d53
call Function1150b3
call Function115136
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
inc a
cp $4
jr nz, .asm_1150ae
@@ -2888,7 +2888,7 @@
ld a, $2
.asm_1150ae
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
xor a
.asm_1150b2
@@ -2898,7 +2898,7 @@
Function1150b3: ; 1150b3
ld hl, $dc24
- ld de, PartyMon5Defense
+ ld de, wPartyMon5Defense
ld b, $0
.asm_1150bb
ld c, $0
@@ -2948,9 +2948,9 @@
.asm_1150f8
ld a, l
- ld [Console], a
+ ld [wDecoConsole], a
ld a, h
- ld [LeftOrnament], a
+ ld [wDecoLeftOrnament], a
ld hl, String_114232
.asm_115103
ld a, [hli]
@@ -2987,9 +2987,9 @@
ld a, $3d
ld [de], a
inc de
- ld a, [Console]
+ ld a, [wDecoConsole]
ld l, a
- ld a, [LeftOrnament]
+ ld a, [wDecoLeftOrnament]
ld h, a
jr .asm_1150bb
@@ -3014,7 +3014,7 @@
ld c, a
ld a, [hli]
ld b, a
- ld hl, PartyMon5Defense
+ ld hl, wPartyMon5Defense
.asm_11514d
ld a, [hli]
and a
@@ -3275,7 +3275,7 @@
; 11528f
Function11528f: ; 11528f
- ld hl, Bed
+ ld hl, wDecoBed
ld c, [hl]
inc hl
ld a, [hli]
@@ -3383,7 +3383,7 @@
call Function114ea0
and a
jr nz, .asm_1152f9
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
ld a, [$dc03]
cp $6
jr nz, .asm_1152ca
@@ -3391,7 +3391,7 @@
.asm_115335
call Function1153b5
xor a
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
call Function114f59
and a
jr nz, .asm_1152f9
@@ -3409,7 +3409,7 @@
jr z, .asm_11536b
call Function1153b5
xor a
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
call Function114f59
and a
jr nz, .asm_1152f9
@@ -3458,7 +3458,7 @@
ld a, b
ld [hli], a
inc de
- ld hl, RightOrnament
+ ld hl, wDecoRightOrnament
ld a, [de]
ld [hli], a
inc de
@@ -3480,7 +3480,7 @@
ld [hl], d
xor a
ld [$dc03], a
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
ret
; 1153b5
@@ -3502,7 +3502,7 @@
ld [hl], a
inc de
ld a, [de]
- ld [Bed], a
+ ld [wDecoBed], a
inc de
ld hl, $dc0d
ld [hl], e
@@ -3522,9 +3522,9 @@
ld [$dc03], a
ld [$dc04], a
ld a, $24
- ld [Console], a
+ ld [wDecoConsole], a
ld a, $dc
- ld [LeftOrnament], a
+ ld [wDecoLeftOrnament], a
push bc
jr .asm_1153f4
@@ -3548,9 +3548,9 @@
ld c, [hl]
inc hl
push hl
- ld a, [Console]
+ ld a, [wDecoConsole]
ld l, a
- ld a, [LeftOrnament]
+ ld a, [wDecoLeftOrnament]
ld h, a
push bc
ld b, $0
@@ -3560,10 +3560,10 @@
pop bc
ld a, l
ld e, a
- ld [Console], a
+ ld [wDecoConsole], a
ld a, h
ld d, a
- ld [LeftOrnament], a
+ ld [wDecoLeftOrnament], a
dec b
jr z, .asm_11542b
pop hl
@@ -3582,9 +3582,9 @@
.asm_115430
ld a, l
- ld [Console], a
+ ld [wDecoConsole], a
ld a, h
- ld [LeftOrnament], a
+ ld [wDecoLeftOrnament], a
xor a
ld [de], a
ld hl, $dc24
@@ -3670,7 +3670,7 @@
inc de
ld a, h
ld [de], a
- ld hl, RightOrnament
+ ld hl, wDecoRightOrnament
ld a, [hli]
ld [wCurrMapBGEventCount], a
ld [hFF8C], a
@@ -3680,15 +3680,15 @@
ld d, [hl]
ld hl, $ddc8
call Function115d6a
- ld hl, RightOrnament
+ ld hl, wDecoRightOrnament
ld a, [wCurrMapBGEventCount]
ld [hli], a
ld [hl], e
inc hl
ld [hl], d
- ld a, [Console]
+ ld a, [wDecoConsole]
ld e, a
- ld a, [LeftOrnament]
+ ld a, [wDecoLeftOrnament]
ld d, a
pop hl
ld a, h
@@ -3702,15 +3702,15 @@
Function1154d4: ; 1154d4
xor a
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
call Function1155af
call Function11560a
and a
jr nz, .asm_11552c
call Function1155d1
- ld a, [RightOrnament]
+ ld a, [wDecoRightOrnament]
dec a
- ld [RightOrnament], a
+ ld [wDecoRightOrnament], a
and a
jp z, .asm_115577
cp $1
@@ -3718,7 +3718,7 @@
xor a
ld [wDailyResetTimer], a
.asm_1154f7
- ld a, [BigDoll]
+ ld a, [wDecoBigDoll]
cp $2
jr z, .asm_115502
cp $3
@@ -3822,9 +3822,9 @@
jp Function11425c
.asm_1155a0
- ld a, [RightOrnament]
+ ld a, [wDecoRightOrnament]
dec a
- ld [RightOrnament], a
+ ld [wDecoRightOrnament], a
and a
jr z, .asm_115560
call Function1155d1
@@ -3854,7 +3854,7 @@
ld [hli], a
inc de
ld a, [de]
- ld [RightOrnament], a
+ ld [wDecoRightOrnament], a
inc de
ld a, e
ld [hli], a
@@ -3870,10 +3870,10 @@
ld a, [$dc0e]
ld h, a
ld a, [hli]
- ld [BigDoll], a
+ ld [wDecoBigDoll], a
cp $3
jr nz, .asm_1155f0
- ld de, Carpet
+ ld de, wDecoCarpet
ld a, [hli]
ld [de], a
inc de
@@ -3883,7 +3883,7 @@
ld a, [hli]
ld [de], a
ld a, [hli]
- ld [Bed], a
+ ld [wDecoBed], a
.asm_1155f0
ld de, $dc17
@@ -4038,7 +4038,7 @@
; 1156cc
Function1156cc: ; 1156cc
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
and a
jp z, Function11425c
cp $2
@@ -4056,9 +4056,9 @@
call Function115732
call Function11575c
ld a, h
- ld [Poster], a
+ ld [wDecoPoster], a
ld a, l
- ld [Plant], a
+ ld [wDecoPlant], a
.asm_1156fa
call Function1157d0
@@ -4067,12 +4067,12 @@
call Function11581e
and a
jr nz, .asm_11572b
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
cp $5
jr z, .asm_115716
- ld a, [Poster]
+ ld a, [wDecoPoster]
ld h, a
- ld a, [Plant]
+ ld a, [wDecoPlant]
ld l, a
xor a
jp Function11425c
@@ -4091,7 +4091,7 @@
ld l, a
add hl, de
xor a
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
jp Function11425c
.asm_11572b
@@ -4228,7 +4228,7 @@
pop hl
add hl, bc
ld a, $2
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
ret
; 1157d0
@@ -4240,7 +4240,7 @@
ld l, a
ld a, [$dc0e]
ld c, a
- ld a, [Bed]
+ ld a, [wDecoBed]
ld b, a
cp h
jr c, .asm_1157eb
@@ -4275,9 +4275,9 @@
ld a, c
ld [$dc0e], a
ld a, b
- ld [Bed], a
+ ld [wDecoBed], a
ld a, $4
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
ret
.asm_11580f
@@ -4285,20 +4285,20 @@
ld a, c
ld [$dc0e], a
ld a, b
- ld [Bed], a
+ ld [wDecoBed], a
ld a, $3
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
ret
; 11581e
Function11581e: ; 11581e
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
and a
ret z
ld a, [$dc0e]
ld c, a
- ld a, [Bed]
+ ld a, [wDecoBed]
ld b, a
ld hl, $dc02
ld a, [hli]
@@ -4319,9 +4319,9 @@
inc hl
ld [hl], d
ld hl, $dc24
- ld de, PartyMon5Defense
+ ld de, wPartyMon5Defense
call Function1158c2
- ld hl, PartyMon5Defense
+ ld hl, wPartyMon5Defense
ld c, [hl]
inc hl
ld b, [hl]
@@ -4362,7 +4362,7 @@
ld e, [hl]
inc hl
ld d, [hl]
- ld hl, PartyMon5Speed
+ ld hl, wPartyMon5Speed
call Function115d6a
ld hl, wCurrMapSceneScriptCount
ld a, [wCurrMapBGEventCount]
@@ -4370,7 +4370,7 @@
ld a, e
ld [hli], a
ld [hl], d
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
cp $3
jr z, .asm_1158b4
cp $4
@@ -4379,12 +4379,12 @@
.asm_1158ad
ld a, $5
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
jr .asm_1158b9
.asm_1158b4
ld a, $2
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
.asm_1158b9
xor a
@@ -4395,7 +4395,7 @@
.asm_1158bc
ld a, $ff
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
ret
; 1158c2
@@ -4641,7 +4641,7 @@
; 1159fb
Function1159fb: ; 1159fb
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
and a
jp z, Function11425c
cp $2
@@ -4659,9 +4659,9 @@
call Function115732
call Function115a5f
ld a, h
- ld [Plant], a
+ ld [wDecoPlant], a
ld a, l
- ld [Poster], a
+ ld [wDecoPoster], a
.asm_115a29
call Function115ab0
@@ -4670,12 +4670,12 @@
call Function115b00
and a
jr nz, .asm_115a5a
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
cp $5
jr z, .asm_115a45
- ld a, [Poster]
+ ld a, [wDecoPoster]
ld h, a
- ld a, [Plant]
+ ld a, [wDecoPlant]
ld l, a
xor a
jp Function11425c
@@ -4694,7 +4694,7 @@
ld l, a
add hl, de
xor a
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
jp Function11425c
.asm_115a5a
@@ -4759,7 +4759,7 @@
rl b
add hl, bc
ld a, $2
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
ret
; 115ab0
@@ -4771,7 +4771,7 @@
ld l, a
ld a, [$dc0e]
ld c, a
- ld a, [Bed]
+ ld a, [wDecoBed]
ld b, a
cp h
jr c, .asm_115acb
@@ -4806,9 +4806,9 @@
ld a, c
ld [$dc0e], a
ld a, b
- ld [Bed], a
+ ld [wDecoBed], a
ld a, $4
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
xor a
ret
@@ -4817,9 +4817,9 @@
ld a, c
ld [$dc0e], a
ld a, b
- ld [Bed], a
+ ld [wDecoBed], a
ld a, $3
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
xor a
ret
@@ -4826,12 +4826,12 @@
; 115b00
Function115b00: ; 115b00
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
and a
ret z
ld a, [$dc0e]
ld c, a
- ld a, [Bed]
+ ld a, [wDecoBed]
ld b, a
ld hl, $dc02
ld a, [hli]
@@ -4841,7 +4841,7 @@
ld e, [hl]
inc hl
ld d, [hl]
- ld hl, PartyMon5Defense
+ ld hl, wPartyMon5Defense
push bc
call Function115bc8
pop hl
@@ -4849,7 +4849,7 @@
jr z, .asm_115b43
cp $2
jr z, .asm_115b3b
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
cp $4
jr z, .asm_115b43
inc hl
@@ -4866,11 +4866,11 @@
.asm_115b3d
ld a, $ff
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
ret
.asm_115b43
- ld a, [Carpet]
+ ld a, [wDecoCarpet]
add a
cpl
ld c, a
@@ -4885,7 +4885,7 @@
ld [hl], e
inc hl
ld [hl], d
- ld hl, PartyMon5Defense
+ ld hl, wPartyMon5Defense
ld de, $dc24
call Function115c49
ld hl, $dc24
@@ -4937,7 +4937,7 @@
ld a, e
ld [hli], a
ld [hl], d
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
cp $3
jr z, .asm_115bc1
cp $4
@@ -4946,12 +4946,12 @@
.asm_115bba
ld a, $5
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
jr .asm_115bc6
.asm_115bc1
ld a, $2
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
.asm_115bc6
xor a
@@ -4961,7 +4961,7 @@
Function115bc8: ; 115bc8
xor a
- ld [Carpet], a
+ ld [wDecoCarpet], a
.asm_115bcc
ld a, [de]
ld [hli], a
@@ -5009,9 +5009,9 @@
ld a, b
or c
jr z, .asm_115c46
- ld a, [Carpet]
+ ld a, [wDecoCarpet]
inc a
- ld [Carpet], a
+ ld [wDecoCarpet], a
dec bc
ld a, b
or c
@@ -5018,7 +5018,7 @@
jr nz, .asm_115bcc
.asm_115c1b
- ld a, [wStartDay]
+ ld a, [wTimerEventStartDay]
cp $4
jr z, .asm_115c33
ld a, [de]
@@ -5122,7 +5122,7 @@
.asm_115c99
ld a, $ff
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
ret
.asm_115c9f
@@ -5226,7 +5226,7 @@
pop hl
pop hl
ld a, $ff
- ld [wStartDay], a
+ ld [wTimerEventStartDay], a
ret
.asm_115d2f
@@ -7030,7 +7030,7 @@
Function1177cb: ; 1177cb (45:77cb)
ld a, $80
ld [wcd49], a
- ld [ScriptVar], a
+ ld [wScriptVar], a
jp MobilePassword_IncrementJumptable
Function117764_b_button: ; 1177d6 (45:77d6)
--- a/mobile/mobile_45_sprite_engine.asm
+++ b/mobile/mobile_45_sprite_engine.asm
@@ -22,7 +22,7 @@
xor a
ld [wc305], a
ld a, $a0
- ld hl, Sprite32
+ ld hl, wVirtualOAMSprite31
ld bc, 8 * SPRITEOAMSTRUCT_LENGTH
call ByteFill
ret
@@ -34,7 +34,7 @@
and a
ret z
ld a, $a0
- ld hl, Sprite32
+ ld hl, wVirtualOAMSprite31
ld bc, 8 * SPRITEOAMSTRUCT_LENGTH
call ByteFill
call Function115e22
@@ -50,7 +50,7 @@
ld d, a
push de
pop hl
- ld de, Sprite32
+ ld de, wVirtualOAMSprite31
ld a, [wc307]
ld c, a
ld a, [wc308]
@@ -360,7 +360,7 @@
cp $2
jr c, .asm_1161b4
ld a, $a0
- ld hl, Sprites
+ ld hl, wVirtualOAM
ld bc, 25 * SPRITEOAMSTRUCT_LENGTH
call ByteFill
@@ -493,12 +493,12 @@
farcall ReloadMapPart
ld a, $8
- ld [MusicFade], a
+ ld [wMusicFade], a
ld de, MUSIC_MOBILE_ADAPTER
ld a, e
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, d
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld a, [$c319]
inc a
ld [$c319], a
@@ -585,7 +585,7 @@
ld e, a
ld a, [hli]
sub e
- ld de, Sprite10
+ ld de, wVirtualOAMSprite09
.asm_116321
push af
ld a, [hli]
@@ -626,7 +626,7 @@
ld e, a
ld a, [hli]
sub e
- ld de, Sprite01
+ ld de, wVirtualOAMSprite00
.asm_11635a
push af
ld a, [hli]
@@ -667,7 +667,7 @@
ld a, $1
ld [rSVBK], a
ld a, $a0
- ld hl, Sprites
+ ld hl, wVirtualOAM
ld bc, 16 * SPRITEOAMSTRUCT_LENGTH
call ByteFill
ld a, $90
@@ -677,11 +677,11 @@
ld [rSVBK], a
farcall ReloadMapPart
ld a, $8
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, [wMapMusic]
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
xor a
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
xor a
ld [$c319], a
ld [wc30d], a
@@ -695,7 +695,7 @@
ld a, $1
ld [rSVBK], a
ld a, $a0
- ld hl, Sprites
+ ld hl, wVirtualOAM
ld bc, 16 * SPRITEOAMSTRUCT_LENGTH
call ByteFill
call DelayFrame
@@ -725,20 +725,20 @@
cp $4
jr z, .asm_11642a
ld a, $8
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, [wMapMusic]
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
xor a
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
jr .asm_116439
.asm_11642a
ld a, $8
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, $0
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, $0
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
.asm_116439
xor a
@@ -754,11 +754,11 @@
ld [hWY], a
farcall ReloadMapPart
ld a, $8
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, [wMapMusic]
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
xor a
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
xor a
ld [$c319], a
ld [wc30d], a
--- a/mobile/mobile_46.asm
+++ b/mobile/mobile_46.asm
@@ -183,7 +183,7 @@
; 118180
Function118180: ; 118180
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
ret nz
ld a, [wcd38]
@@ -224,7 +224,7 @@
.return_d3
ld a, $d3
ld [wc300], a
- ld [ScriptVar], a
+ ld [wScriptVar], a
jr .reset_banks
; 1181da
@@ -477,7 +477,7 @@
ld [wc3ed], a
ld [wc3ee], a
ld [wc3ef], a
- ld hl, VramState
+ ld hl, wVramState
ld a, [hl]
ld [wcd7f], a
set 1, [hl]
@@ -524,9 +524,9 @@
ld [rIE], a
ei
ld a, [wcd7f]
- ld [VramState], a
+ ld [wVramState], a
ld a, [wc300]
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 118473
@@ -1062,7 +1062,7 @@
xor a
asm_11886f
- ld [BGMapPalBuffer], a
+ ld [wBGMapPalBuffer], a
ld a, $0
ld [wcd3c], a
call BattleTowerRoomMenu_IncrementJumptable
@@ -1189,7 +1189,7 @@
call MenuBox
call MenuBoxCoord2Tile
call ApplyTilemap
- hlcoord 16, 8, AttrMap
+ hlcoord 16, 8, wAttrMap
ld a, $40
or [hl]
ld [hl], a
@@ -1246,7 +1246,7 @@
push af
ld a, $1
ld [rSVBK], a
- ld bc, StringBuffer3
+ ld bc, wStringBuffer3
.asm_1189b5
ld a, [hli]
cp $50
@@ -1799,7 +1799,7 @@
Function118eb0: ; 118eb0
call Function118440
ld hl, $d802
- ld de, BGMapBuffer
+ ld de, wBGMapBuffer
ld bc, $000c
call CopyBytes
call Function1192cc
@@ -2045,7 +2045,7 @@
ld [$b1b3], a
ld a, [wcd50]
ld [$b1b4], a
- ld hl, BGMapBuffer
+ ld hl, wBGMapBuffer
ld de, $aa7f
ld bc, $000c
call CopyBytes
@@ -2083,7 +2083,7 @@
Function1190ec: ; 1190ec
ld a, $5
call GetSRAMBank
- ld hl, BGMapBuffer
+ ld hl, wBGMapBuffer
ld de, $aa73
ld bc, $000c
call CopyBytes
@@ -2137,12 +2137,12 @@
Function11915d: ; 11915d
ld hl, $d802
- ld de, BGMapBuffer
+ ld de, wBGMapBuffer
ld bc, $000c
call CopyBytes
ld a, $5
call GetSRAMBank
- ld hl, BGMapBuffer
+ ld hl, wBGMapBuffer
ld de, $aa7f
ld c, $c
.asm_119176
@@ -2393,7 +2393,7 @@
call CopyBytes
call CloseSRAM
ld hl, $c608
- ld de, BGMapBuffer
+ ld de, wBGMapBuffer
ld c, $c
.asm_1192e8
ld a, [de]
@@ -4005,8 +4005,8 @@
ld hl, wcd50
ld [hl], a
ld bc, PARTYMON_STRUCT_LENGTH
- ld de, PartyMon1Level
- ld a, [PartyCount]
+ ld de, wPartyMon1Level
+ ld a, [wPartyCount]
.party_loop
push af
ld a, [de]
@@ -4046,10 +4046,10 @@
jr nc, .level_70_or_more
ld a, $1
ld [rSVBK], a
- ld hl, PartyMon1Level
+ ld hl, wPartyMon1Level
ld bc, PARTYMON_STRUCT_LENGTH
- ld de, PartySpecies
- ld a, [PartyCount]
+ ld de, wPartySpecies
+ ld a, [wPartyCount]
.loop
push af
ld a, [de]
@@ -4082,7 +4082,7 @@
ld a, [de]
ld [wd265], a
call GetPokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
ld de, wcd49
ld bc, MON_NAME_LENGTH
call CopyBytes
@@ -4357,9 +4357,9 @@
call ExitMenu
call Function11a63c
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
call Function11a00e
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
jr z, .asm_119fd4
call ExitMenu
@@ -4414,7 +4414,7 @@
.asm_11a02a
call CloseSRAM
- ld a, [BGMapPalBuffer]
+ ld a, [wBGMapPalBuffer]
and a
jr z, .asm_11a039
dec a
@@ -5162,7 +5162,7 @@
ld a, $5
ld [wMenuBorderBottomCoord], a
call PushWindow
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld b, $6
ld c, $14
hlcoord 0, 0
@@ -5188,7 +5188,7 @@
ld a, $a
ld [wMenuBorderBottomCoord], a
call PushWindow
- hlcoord 14, 6, AttrMap
+ hlcoord 14, 6, wAttrMap
ld b, $5
ld c, $6
hlcoord 14, 6
@@ -5521,7 +5521,7 @@
ret
.asm_11a97f
- ld a, [Options]
+ ld a, [wOptions]
and $7
ld [hl], a
ld hl, wcd8d
@@ -5715,10 +5715,10 @@
; 0x11ac1f
Text_ThisBattleRoomPleaseWait: ; 0x11ac1f
- text_from_ram StringBuffer3
+ text_from_ram wStringBuffer3
text "'s ROOM"
line "@"
- text_from_ram StringBuffer4
+ text_from_ram wStringBuffer4
text "?"
cont "Please wait…"
done
@@ -5736,14 +5736,14 @@
Function11ac51: ; 11ac51
xor a
ld [hBGMapMode], a
- ld hl, Options
+ ld hl, wOptions
ld a, [hl]
push af
set 4, [hl]
- ld a, [VramState]
+ ld a, [wVramState]
push af
xor a
- ld [VramState], a
+ ld [wVramState], a
ld a, [hInMenu]
push af
ld a, $1
@@ -5776,9 +5776,9 @@
pop af
ld [hInMenu], a
pop af
- ld [VramState], a
+ ld [wVramState], a
pop af
- ld [Options], a
+ ld [wOptions], a
ret
; 11acb7
@@ -5908,7 +5908,7 @@
hlcoord 12, 12
ld de, String_11ae40
call PlaceString
- hlcoord 10, 10, AttrMap
+ hlcoord 10, 10, wAttrMap
lb bc, 8, 8
call Function11afd6
farcall ReloadMapPart
@@ -6021,10 +6021,10 @@
hlcoord 16, 8
ld de, String_11b01b
call PlaceString
- hlcoord 14, 7, AttrMap
+ hlcoord 14, 7, wAttrMap
lb bc, 5, 6
call Function11afd6
- hlcoord 9, 12, AttrMap
+ hlcoord 9, 12, wAttrMap
lb bc, 6, 11
call Function11afd6
farcall ReloadMapPart
@@ -6088,7 +6088,7 @@
cp $2
jr z, .asm_11aeb4
ld a, [wcd4b]
- ld [ScriptVar], a
+ ld [wScriptVar], a
call Function11b022
call Function11ad8a
@@ -6112,10 +6112,10 @@
hlcoord 16, 8
ld de, String_11b01b
call PlaceString
- hlcoord 14, 7, AttrMap
+ hlcoord 14, 7, wAttrMap
lb bc, 5, 6
call Function11afd6
- hlcoord 9, 12, AttrMap
+ hlcoord 9, 12, wAttrMap
lb bc, 6, 11
call Function11afd6
farcall ReloadMapPart
@@ -6181,7 +6181,7 @@
ld a, $6
ld [wJumptableIndex], a
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
.asm_11afaa
call ExitMenu
@@ -6273,7 +6273,7 @@
ld a, [wcd2e]
and a
jr z, .asm_11b02e
- ld hl, StringBuffer3
+ ld hl, wStringBuffer3
call Function11b03d
.asm_11b02e
@@ -6282,7 +6282,7 @@
ret z
cp $3
ret z
- ld hl, StringBuffer4
+ ld hl, wStringBuffer4
call Function11b03d
ret
; 11b03d
@@ -6684,13 +6684,13 @@
Function11b242: ; 11b242
hlcoord 3, 4
- ld de, StringBuffer3
+ ld de, wStringBuffer3
call PlaceString
xor a
- ld [MonType], a
+ ld [wMonType], a
farcall GetGender
hlcoord 1, 4
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
ld bc, wcd2f
ld [bc], a
dec bc
@@ -6725,11 +6725,11 @@
Function11b279: ; 11b279
ld a, [wd265]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call CheckSeenMemMon
jr z, .asm_11b28f
call GetBaseData
- ld a, [BaseGender]
+ ld a, [wBaseGender]
ld [wcf65], a
jr .asm_11b294
@@ -6783,7 +6783,7 @@
.asm_11b2e7
ld a, $6
- ld bc, StringBuffer4
+ ld bc, wStringBuffer4
.asm_11b2ec
push af
ld a, [de]
@@ -6795,7 +6795,7 @@
and a
jr nz, .asm_11b2ec
pop hl
- ld de, StringBuffer4
+ ld de, wStringBuffer4
call PlaceString
ret
; 11b2fe
@@ -6921,7 +6921,7 @@
db $39 ; 13
Function11b397: ; 11b397
- ld de, Sprite01
+ ld de, wVirtualOAMSprite00
.loop
ld a, [hl]
cp $ff
@@ -6979,7 +6979,7 @@
; 11b3d9
Function11b3d9: ; 11b3d9
- ld de, Sprite29
+ ld de, wVirtualOAMSprite28
push de
ld a, [wc7d2]
dec a
@@ -7092,7 +7092,7 @@
Function11b483: ; 11b483
call .InitRAM
- ld hl, PlayerName
+ ld hl, wPlayerName
ld a, NAME_LENGTH_JAPANESE - 1
.loop1
push af
@@ -7105,7 +7105,7 @@
jr nz, .loop1
ld de, PARTYMON_STRUCT_LENGTH
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
ld a, [wcd82]
dec a
push af
@@ -7132,12 +7132,12 @@
pop de
push bc
ld a, [de]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
ld hl, MON_LEVEL
add hl, de
ld a, [hl]
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld hl, MON_MAXHP
add hl, de
push hl
@@ -7159,7 +7159,7 @@
ld [hl], a
pop bc
ld de, NAME_LENGTH
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
pop af
push af
.loop4
@@ -7181,7 +7181,7 @@
and a
jr nz, .loop5
ld de, NAME_LENGTH
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
pop af
push af
.loop6
@@ -7230,12 +7230,12 @@
.InitRAM:
ld bc, $c626
- ld a, [PlayerID]
+ ld a, [wPlayerID]
ld [wcd2a], a
ld [bc], a
inc bc
- ld a, [PlayerID + 1]
+ ld a, [wPlayerID + 1]
ld [wcd2b], a
ld [bc], a
inc bc
@@ -7270,7 +7270,7 @@
Function11b570: ; 11b570
call Function118007
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
jr nz, .exit
call .SaveData
@@ -7322,7 +7322,7 @@
Function11b5c0: ; 11b5c0
ld a, [wcd82]
dec a
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
xor a
ld [wPokemonWithdrawDepositParameter], a
farcall RemoveMonFromPartyOrBox
@@ -7333,7 +7333,7 @@
Function11b5e0: ; 11b5e0
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
jp Function11ad8a
; 11b5e7
@@ -7396,7 +7396,7 @@
Function11b66d: ; 11b66d
call Function1180b8
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
jr nz, .asm_11b6b0
ld a, [rSVBK]
@@ -7417,11 +7417,11 @@
.asm_11b691
farcall Function17081d
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
jr z, .asm_11b6b0
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld a, [rSVBK]
push af
ld a, $3
@@ -7545,7 +7545,7 @@
.item_okay
ld a, [wcd31]
ld [$c60d], a
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
ld hl, $c60d + MON_LEVEL
@@ -7560,7 +7560,7 @@
.replace_level
ld [hl], a
.done_level
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld hl, $c60d + MON_STAT_EXP - 1
ld de, $c60d + MON_MAXHP
@@ -7580,7 +7580,7 @@
Special_Function11b7e5: ; 11b7e5
ld a, [$c60d] ; species
ld [wOTTrademonSpecies], a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [wcd81]
ld [wc74e], a
ld hl, $c63d ; OT
@@ -7619,9 +7619,9 @@
ld a, $5
ld [$a800], a
call CloseSRAM
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetMapSceneID
ld a, d
@@ -7638,13 +7638,13 @@
Special_Function11b879: ; 11b879
farcall BattleTower_CheckSaveFileExistsAndIsYours
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
ret z
ld a, $5
call GetSRAMBank
ld a, [$a800]
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld a, [$a890]
ld [wcd49], a
ld a, [$a891]
@@ -7654,7 +7654,7 @@
ld a, [$a893]
ld [wcd4c], a
call CloseSRAM
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
ret z
ld hl, wcd4c
@@ -7725,7 +7725,7 @@
bit 7, h
ret z
ld a, $2
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 11b920
@@ -7783,7 +7783,7 @@
; 11b98f
AddMobileMonToParty: ; 11b98f
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [hl]
ld e, a
inc [hl]
@@ -7793,7 +7793,7 @@
ld a, [wMobileMonSpeciesPointerBuffer + 1]
ld h, a
inc hl
- ld bc, PartySpecies
+ ld bc, wPartySpecies
ld d, e
.loop1
inc bc
@@ -7800,7 +7800,7 @@
dec d
jr nz, .loop1
ld a, e
- ld [CurPartyMon], a
+ ld [wCurPartyMon], a
ld a, [hl]
ld [bc], a
inc bc
@@ -7807,7 +7807,7 @@
ld a, -1
ld [bc], a
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
ld a, e
ld [wMobileMonSpeciesBuffer], a
@@ -7825,7 +7825,7 @@
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
ld bc, NAME_LENGTH
ld a, [wMobileMonSpeciesBuffer]
.loop3
@@ -7844,7 +7844,7 @@
ld a, "@"
ld [de], a
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
ld a, [wMobileMonSpeciesBuffer]
.loop4
@@ -7890,7 +7890,7 @@
farcall CheckCurPartyMonFainted
ret c
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 11ba44
--- a/mobile/mobile_5b.asm
+++ b/mobile/mobile_5b.asm
@@ -83,7 +83,7 @@
Function16c089: ; 16c089
ld a, $1
- ld [Buffer2], a
+ ld [wBuffer2], a
ld [wd1f1], a
xor a
ld [hWY], a
@@ -103,7 +103,7 @@
Function16c0a8: ; 16c0a8
xor a
- ld [Buffer2], a
+ ld [wBuffer2], a
ld [wd1f1], a
call ClearSprites
ld a, $90
@@ -200,7 +200,7 @@
ld bc, 20
xor a
call ByteFill
- ld hl, .TileMap
+ ld hl, .wTileMap
decoord 0, 1
ld bc, $0154
call CopyBytes
@@ -208,12 +208,12 @@
; 16c15c
.LoadAttrMap: ; 16c15c
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH
xor a
call ByteFill
- ld hl, .AttrMap
- decoord 0, 1, AttrMap
+ ld hl, .wAttrMap
+ decoord 0, 1, wAttrMap
ld bc, 17 * SCREEN_WIDTH
call CopyBytes
ret
@@ -222,10 +222,10 @@
.Tiles:
INCBIN "gfx/mobile/mobile_splash.2bpp"
-.TileMap:
+.wTileMap:
INCBIN "gfx/mobile/mobile_splash.tilemap"
-.AttrMap:
+.wAttrMap:
INCBIN "gfx/mobile/mobile_splash.attrmap"
UnknownMobilePalettes_16c903: ; 16c903
@@ -543,8 +543,8 @@
Function16cb0f: ; 16cb0f
xor a
- ld [Buffer1], a
- ld [Buffer2], a
+ ld [wBuffer1], a
+ ld [wBuffer2], a
xor a
ld [wd1ec], a
ld a, $70
@@ -559,12 +559,12 @@
; 16cb2e
Function16cb2e: ; 16cb2e
- ld a, [Buffer2]
+ ld a, [wBuffer2]
and a
ret z
call Function16cb40
ld hl, Unknown_16cb86
- ld de, Sprites
+ ld de, wVirtualOAM
call Function16cb5d
ret
; 16cb40
@@ -754,7 +754,7 @@
; 16cc62
Function16cc62: ; 16cc62
- hlcoord 0, 15, AttrMap
+ hlcoord 0, 15, wAttrMap
ld bc, $0028
ld a, $1
call ByteFill
@@ -776,7 +776,7 @@
pop hl
ld a, $1
ld [rVBK], a
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
call Function16cc90
pop af
ld [rVBK], a
--- a/mobile/mobile_5c.asm
+++ b/mobile/mobile_5c.asm
@@ -131,7 +131,7 @@
xor a
ld [wd265], a
.asm_170c30
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
ld a, [wd265]
call GetPartyLocation
ld a, [hli]
@@ -181,7 +181,7 @@
ld b, $0
ld c, $0
.asm_170c6f
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
ld a, b
push bc
call GetPartyLocation
@@ -206,7 +206,7 @@
; 170c8b
Function170c8b: ; 170c8b
- ld hl, LastEnemyCounterMove
+ ld hl, wLastEnemyCounterMove
ld b, $5
.asm_170c90
ld a, [hl]
@@ -698,7 +698,7 @@
ld bc, $168
call CopyBytes
ld hl, Attrmap_1727ed
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
ld bc, $168
call CopyBytes
hlcoord 3, 2
@@ -718,7 +718,7 @@
ld de, wBGPals1
ld bc, 8 palettes
call CopyBytes
- ld hl, EngineBuffer5
+ ld hl, wEngineBuffer5
ld a, $ff
ld [hli], a
ld a, $7f
@@ -770,7 +770,7 @@
ld bc, $168
call CopyBytes
ld hl, Attrmap_172955
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
ld bc, $168
call CopyBytes
hlcoord 2, 2
@@ -856,7 +856,7 @@
ld bc, $168
call ByteFill
ld a, $7
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, $168
call ByteFill
call DisableLCD
@@ -870,7 +870,7 @@
ld bc, $168
call CopyBytes
ld hl, Attrmap_173517
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
ld bc, $168
call CopyBytes
ret
--- a/mobile/mobile_5e.asm
+++ b/mobile/mobile_5e.asm
@@ -7,7 +7,7 @@
ld hl, $d088
bit 5, [hl]
jr z, .asm_17a6a6
- ld de, StringBuffer1 ; $d073
+ ld de, wStringBuffer1 ; $d073
push de
call Function17a721
pop de
@@ -21,11 +21,11 @@
Function17a6a8: ; 17a6a8 (5e:66a8)
push de
push bc
- ld hl, StringBuffer2 ; $d086
+ ld hl, wStringBuffer2 ; $d086
ld bc, $a
xor a
call ByteFill
- ld hl, Buffer1
+ ld hl, wBuffer1
ld bc, $10
ld a, $ff
call ByteFill
@@ -50,7 +50,7 @@
ret
Function17a6f5: ; 17a6f5 (5e:66f5)
- ld hl, Buffer1
+ ld hl, wBuffer1
ld c, $0
ld b, $8
.asm_17a6fc
@@ -91,7 +91,7 @@
ld a, $ff
call ByteFill
pop de
- ld hl, Buffer1
+ ld hl, wBuffer1
ld b, $8
.asm_17a732
ld c, $0
@@ -443,7 +443,7 @@
ld [$d08c], a
ld c, a
ld b, $0
- ld hl, Buffer1
+ ld hl, wBuffer1
add hl, bc
ld [hl], $ff
ld a, $2
@@ -465,7 +465,7 @@
ld b, $0
inc a
ld [$d08c], a
- ld hl, Buffer1
+ ld hl, wBuffer1
add hl, bc
ld [hl], e
and a
@@ -480,7 +480,7 @@
lb bc, 2, 18
call ClearBox
hlcoord 3, 2
- ld de, Buffer1
+ ld de, wBuffer1
ld a, [$d08c]
and a
ret z
@@ -517,7 +517,7 @@
; 17a9cb
Function17a9cb: ; 17a9cb (5e:69cb)
- ld de, Sprites ; $c400
+ ld de, wVirtualOAM ; $c400
ld hl, $d088
bit 6, [hl]
jr nz, .bit_6_set
@@ -663,7 +663,7 @@
call Function17aae3
ld c, a
ld b, $0
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
add hl, bc
push hl
ld a, $4
@@ -806,10 +806,10 @@
Function17ac2a: ; 17ac2a (5e:6c2a)
ld hl, Tilemap_17ae3d
- decoord 0, 4, AttrMap
+ decoord 0, 4, wAttrMap
ld bc, (SCREEN_HEIGHT - 4) * SCREEN_WIDTH
call CopyBytes
- hlcoord 0, 4, AttrMap
+ hlcoord 0, 4, wAttrMap
ld bc, (SCREEN_HEIGHT - 4) * SCREEN_WIDTH
.loop
ld a, [hl]
--- a/mobile/mobile_5f.asm
+++ b/mobile/mobile_5f.asm
@@ -11,7 +11,7 @@
ld hl, HaveWantMap
decoord 0, 0
- bccoord 0, 0, AttrMap
+ bccoord 0, 0, wAttrMap
ld a, SCREEN_HEIGHT
.y
@@ -271,7 +271,7 @@
Function17d0f3: ; 17d0f3
ld a, [$c608 + 5]
ld [wOTTrademonSpecies], a
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [wcd81]
ld [$c74e], a
ld hl, $c63d
@@ -310,9 +310,9 @@
ld a, $5
ld [$a800], a
call CloseSRAM
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetMapSceneID
ld a, d
@@ -399,16 +399,16 @@
; 17d1f1
Function17d1f1: ; 17d1f1
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
dec a
call SetSeenAndCaughtMon
- ld a, [CurPartySpecies]
+ ld a, [wCurPartySpecies]
cp UNOWN
jr nz, .asm_17d223
- ld hl, PartyMon1DVs
- ld a, [PartyCount]
+ ld hl, wPartyMon1DVs
+ ld a, [wPartyCount]
dec a
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
@@ -418,7 +418,7 @@
and a
jr nz, .asm_17d223
- ld a, [UnownLetter]
+ ld a, [wUnownLetter]
ld [wFirstUnownSeen], a
.asm_17d223
@@ -427,26 +427,26 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Parameter: [ScriptVar] = 0..1
+; Parameter: [wScriptVar] = 0..1
;
-; if [ScriptVar] == FALSE
+; if [wScriptVar] == FALSE
; Show japanese menu options
; - News - News - ??? - Cancel
-; if [ScriptVar] == TRUE
+; if [wScriptVar] == TRUE
; Show BattleTower-Menu with 3 options in english language
; - Challenge - Explanation - Cancel
Special_Menu_ChallengeExplanationCancel: ; 17d224
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
and a
jr nz, .English
ld a, $4
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld hl, MenuDataHeader_17d26a ; Japanese Menu, where you can choose 'News' as an option
jr .Load_Interpret
.English:
ld a, $4
- ld [ScriptVar], a
+ ld [wScriptVar], a
ld hl, MenuDataHeader_ChallengeExplanationCancel ; English Menu
.Load_Interpret:
@@ -459,7 +459,7 @@
Function17d246: ; 17d246
call VerticalMenu
jr c, .Exit
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
cp $5
jr nz, .UsewMenuCursorY
ld a, [wMenuCursorY]
@@ -473,12 +473,12 @@
ld a, [wMenuCursorY]
.LoadToScriptVar:
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.Exit:
ld a, $4
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 17d26a
@@ -534,7 +534,7 @@
and a
jr nz, .asm_17d2e2
ld a, $1
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
.asm_17d2e2
@@ -553,9 +553,9 @@
ld de, MUSIC_MOBILE_CENTER
ld a, e
ld [wMapMusic], a
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, d
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
call PlayMusic
call ReturnToMapFromSubmenu
call CloseSubmenu
@@ -610,7 +610,7 @@
call ByteFill
call CloseSRAM
ld a, $2
- ld [ScriptVar], a
+ ld [wScriptVar], a
scf
ret
; 17d370
@@ -654,7 +654,7 @@
call EnableLCD
call Function17d60b
ld a, $0
- ld [BGMapBuffer], a
+ ld [wBGMapBuffer], a
ld a, $d0
ld [wcd21], a
ld a, $6
@@ -722,7 +722,7 @@
.asm_17d46f
xor a
- ld [ScriptVar], a
+ ld [wScriptVar], a
ret
; 17d474
@@ -745,7 +745,7 @@
call CopyBytes
ld hl, TileAttrmap_17eb8e
decoord 0, 0
- bccoord 0, 0, AttrMap
+ bccoord 0, 0, wAttrMap
ld a, $12
.asm_17d4a4
push af
@@ -775,7 +775,7 @@
pop af
dec a
jr nz, .asm_17d4a4
- ld a, [BGMapBuffer]
+ ld a, [wBGMapBuffer]
ld l, a
ld a, [wcd21]
ld h, a
@@ -869,7 +869,7 @@
pop af
dec a
jr nz, .asm_17d53a
- ld de, CreditsTimer
+ ld de, wCreditsTimer
ld bc, $c
call CopyBytes
xor a
@@ -1079,7 +1079,7 @@
ld a, [hli]
ld [wcd47], a
ld a, [hl]
- ld [BGMapPalBuffer], a
+ ld [wBGMapPalBuffer], a
ld hl, $b1b3
add hl, bc
add hl, bc
@@ -1483,7 +1483,7 @@
ld a, [$c70c]
call Function17e6de
ld a, [$c70a]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [$c70c]
ld e, a
farcall LoadMonPaletteAsNthBGPal
@@ -1519,7 +1519,7 @@
ld a, [$c70b]
call Function17e6de
ld a, [$c70a]
- ld [TrainerClass], a
+ ld [wTrainerClass], a
ld a, [$c70b]
ld e, a
farcall LoadTrainerClassPaletteAsNthBGPal
@@ -2324,17 +2324,17 @@
ld [rSVBK], a
ld hl, $c708
ld a, [hli]
- ld [CurPartySpecies], a
- ld [TempEnemyMonSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wTempEnemyMonSpecies], a
ld a, [hli]
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld a, [hli]
ld b, a
- ld a, [PartyCount]
+ ld a, [wPartyCount]
cp $6
jp nc, Function17e026
xor a
- ld [MonType], a
+ ld [wMonType], a
push hl
push bc
predef TryAddMonToParty
@@ -2345,9 +2345,9 @@
jr z, .asm_17df33
push bc
push hl
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMonNicknames
+ ld hl, wPartyMonNicknames
call SkipNames
ld d, h
ld e, l
@@ -2365,9 +2365,9 @@
jr z, .asm_17df5a
push bc
push hl
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMonOT
+ ld hl, wPartyMonOT
call SkipNames
ld d, h
ld e, l
@@ -2390,9 +2390,9 @@
jr z, .asm_17df79
push bc
push hl
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1ID
+ ld hl, wPartyMon1ID
call GetPartyLocation
ld d, h
ld e, l
@@ -2414,9 +2414,9 @@
jr z, .asm_17dfd0
push bc
push hl
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1DVs
+ ld hl, wPartyMon1DVs
call GetPartyLocation
ld d, h
ld e, l
@@ -2427,16 +2427,16 @@
ld a, [hli]
ld [de], a
push hl
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
call GetPartyLocation
ld a, [hl]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1MaxHP
+ ld hl, wPartyMon1MaxHP
call GetPartyLocation
ld d, h
ld e, l
@@ -2443,9 +2443,9 @@
push hl
ld b, $0
farcall CalcPkmnStats
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1HP
+ ld hl, wPartyMon1HP
call GetPartyLocation
ld d, h
ld e, l
@@ -2468,9 +2468,9 @@
jr z, .asm_17dfea
push bc
push hl
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1Item
+ ld hl, wPartyMon1Item
call GetPartyLocation
ld d, h
ld e, l
@@ -2488,9 +2488,9 @@
jr z, .asm_17e01f
push bc
push hl
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1Moves
+ ld hl, wPartyMon1Moves
call GetPartyLocation
ld d, h
ld e, l
@@ -2501,9 +2501,9 @@
pop de
push hl
push de
- ld a, [PartyCount]
+ ld a, [wPartyCount]
dec a
- ld hl, PartyMon1PP
+ ld hl, wPartyMon1PP
call GetPartyLocation
ld d, h
ld e, l
@@ -2664,11 +2664,11 @@
ld [rSVBK], a
ld hl, $c708
ld a, [hli]
- ld [CurItem], a
+ ld [wCurItem], a
ld a, [hli]
ld [wItemQuantityChangeBuffer], a
push hl
- ld hl, NumItems
+ ld hl, wNumItems
call ReceiveItem
pop hl
jr c, .asm_17e127
@@ -2698,7 +2698,7 @@
ld [rSVBK], a
ld hl, $c708
ld a, [hli]
- ld [ScriptVar], a
+ ld [wScriptVar], a
push hl
farcall MobileCheckOwnMonAnywhere
pop hl
@@ -2729,14 +2729,14 @@
ld [rSVBK], a
ld hl, $c708
ld a, [hli]
- ld [CurItem], a
+ ld [wCurItem], a
push hl
- ld hl, NumItems
+ ld hl, wNumItems
call CheckItem
pop hl
jr c, .asm_17e195
push hl
- ld hl, PCItems
+ ld hl, wPCItems
call CheckItem
pop hl
jr c, .asm_17e195
@@ -3012,7 +3012,7 @@
ld de, $b0b1
ld bc, $40
call CopyBytes
- ld hl, BGMapBuffer
+ ld hl, wBGMapBuffer
ld bc, $5b
call CopyBytes
call CloseSRAM
@@ -3026,7 +3026,7 @@
ld de, $c608
ld bc, $40
call CopyBytes
- ld de, BGMapBuffer
+ ld de, wBGMapBuffer
ld bc, $5b
call CopyBytes
call CloseSRAM
@@ -3142,7 +3142,7 @@
; 17e43d
Function17e43d: ; 17e43d
- ld a, [BGMapBuffer]
+ ld a, [wBGMapBuffer]
ld l, a
ld a, [wcd21]
ld h, a
@@ -3151,7 +3151,7 @@
; 17e447
Function17e447: ; 17e447
- ld a, [BGMapBuffer]
+ ld a, [wBGMapBuffer]
ld l, a
ld a, [wcd21]
ld h, a
@@ -3182,7 +3182,7 @@
ld bc, $14
ld a, [wcd23]
call AddNTimes
- ld a, [CreditsTimer]
+ ld a, [wCreditsTimer]
ld c, a
ld b, $0
add hl, bc
@@ -3203,7 +3203,7 @@
ld d, a
push bc
push hl
- ld a, [BGMapBuffer]
+ ld a, [wBGMapBuffer]
ld l, a
ld a, [wcd21]
ld h, a
@@ -3289,7 +3289,7 @@
Function17e51b: ; 17e51b
ld a, [wcd28]
- ld hl, CreditsTimer
+ ld hl, wCreditsTimer
sub [hl]
inc a
ld [wcd4f], a
@@ -3298,7 +3298,7 @@
ld a, [wcd23]
dec a
call AddNTimes
- ld a, [CreditsTimer]
+ ld a, [wCreditsTimer]
ld c, a
ld b, $0
add hl, bc
@@ -3347,7 +3347,7 @@
ld bc, $14
ld a, [wcd23]
call AddNTimes
- ld a, [CreditsTimer]
+ ld a, [wCreditsTimer]
ld c, a
ld b, $0
add hl, bc
@@ -3407,7 +3407,7 @@
ld e, a
ld a, [hli]
ld d, a
- ld a, [BGMapBuffer]
+ ld a, [wBGMapBuffer]
ld l, a
ld a, [wcd21]
ld h, a
@@ -3590,7 +3590,7 @@
.asm_17e6c7
pop hl
- bccoord 0, 0, AttrMap
+ bccoord 0, 0, wAttrMap
add hl, bc
ld [hl], a
pop hl
@@ -3614,7 +3614,7 @@
ld l, a
ld a, [$c709]
ld h, a
- decoord 0, 0, AttrMap
+ decoord 0, 0, wAttrMap
add hl, de
pop af
ld b, $7
@@ -4197,7 +4197,7 @@
push bc
ld a, $1
ld [rSVBK], a
- ld hl, PlayerName
+ ld hl, wPlayerName
ld de, $c608
ld bc, $6
call CopyBytes
@@ -4374,7 +4374,7 @@
push af
ld l, c
ld h, b
- ld bc, -TileMap + $10000
+ ld bc, -wTileMap + $10000
add hl, bc
ld de, -SCREEN_WIDTH
ld c, $1
@@ -4532,7 +4532,7 @@
ld h, a
ld a, [wcd47]
ld c, a
- ld a, [BGMapPalBuffer]
+ ld a, [wBGMapPalBuffer]
ld b, a
ld a, [wcd2e]
.asm_17f509
@@ -4688,18 +4688,18 @@
Function17f5e4: ; 17f5e4
ld a, $8
- ld [MusicFade], a
+ ld [wMusicFade], a
ld de, MUSIC_NONE
ld a, e
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, d
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld a, " "
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
ld a, $6
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
hlcoord 2, 1
@@ -5235,11 +5235,11 @@
and a
ret z
ld a, $8
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, [wMapMusic]
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
xor a
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld hl, wc303
set 7, [hl]
ret
--- a/mobile/mobile_menu.asm
+++ b/mobile/mobile_menu.asm
@@ -190,8 +190,8 @@
call MenuClickSound
ld a, BANK(sPlayerData)
call GetSRAMBank
- ld hl, sPlayerData + PlayerName - wPlayerData
- ld de, PlayerName
+ ld hl, sPlayerData + wPlayerName - wPlayerData
+ ld de, wPlayerName
ld bc, NAME_LENGTH_JAPANESE
call CopyBytes
call CloseSRAM
@@ -637,13 +637,13 @@
MainMenu_MobileStudium: ; 4a496
- ld a, [StartDay]
+ ld a, [wStartDay]
ld b, a
- ld a, [StartHour]
+ ld a, [wStartHour]
ld c, a
- ld a, [StartMinute]
+ ld a, [wStartMinute]
ld d, a
- ld a, [StartSecond]
+ ld a, [wStartSecond]
ld e, a
push bc
push de
@@ -652,13 +652,13 @@
pop de
pop bc
ld a, b
- ld [StartDay], a
+ ld [wStartDay], a
ld a, c
- ld [StartHour], a
+ ld [wStartHour], a
ld a, d
- ld [StartMinute], a
+ ld [wStartMinute], a
ld a, e
- ld [StartSecond], a
+ ld [wStartSecond], a
ret
; 4a4c4
@@ -852,11 +852,11 @@
Function4a6c5: ; 4a6c5 (12:66c5)
ld a, $5
- ld [MusicFade], a
+ ld [wMusicFade], a
ld a, e
- ld [MusicFadeID], a
+ ld [wMusicFadeID], a
ld a, d
- ld [MusicFadeID + 1], a
+ ld [wMusicFadeID + 1], a
ld c, 22
call DelayFrames
ret
--- a/sram.asm
+++ b/sram.asm
@@ -77,7 +77,7 @@
SECTION "Backup Save", SRAM
-sBackupOptions:: ds OptionsEnd - Options
+sBackupOptions:: ds wOptionsEnd - wOptions
sBackupCheckValue1:: db ; loaded with SAVE_CHECK_VALUE_1, used to check save corruption
@@ -100,7 +100,7 @@
SECTION "Save", SRAM
-sOptions:: ds OptionsEnd - Options
+sOptions:: ds wOptionsEnd - wOptions
sCheckValue1:: db ; loaded with SAVE_CHECK_VALUE_1, used to check save corruption
--- a/wram.asm
+++ b/wram.asm
@@ -7,10 +7,10 @@
SECTION "Stack", WRAM0
-StackBottom::
+wStackBottom::
ds $100 - 1
-Stack::
-StackTop::
+wStack::
+wStackTop::
ds 1
@@ -19,19 +19,19 @@
wMusic::
; nonzero if playing
-MusicPlaying:: db ; c100
+wMusicPlaying:: db ; c100
-Channels::
-Channel1:: channel_struct Channel1 ; c101
-Channel2:: channel_struct Channel2 ; c133
-Channel3:: channel_struct Channel3 ; c165
-Channel4:: channel_struct Channel4 ; c197
+wChannels::
+wChannel1:: channel_struct wChannel1 ; c101
+wChannel2:: channel_struct wChannel2 ; c133
+wChannel3:: channel_struct wChannel3 ; c165
+wChannel4:: channel_struct wChannel4 ; c197
-SFXChannels::
-Channel5:: channel_struct Channel5 ; c1c9
-Channel6:: channel_struct Channel6 ; c1fb
-Channel7:: channel_struct Channel7 ; c22d
-Channel8:: channel_struct Channel8 ; c25f
+wSFXChannels::
+wChannel5:: channel_struct wChannel5 ; c1c9
+wChannel6:: channel_struct wChannel6 ; c1fb
+wChannel7:: channel_struct wChannel7 ; c22d
+wChannel8:: channel_struct wChannel8 ; c25f
ds 1 ; c291
@@ -41,9 +41,9 @@
wc296:: db ; BCD value, dummied out
wCurNoteDuration:: db ; used in MusicE0 and LoadNote
-CurMusicByte:: db ; c298
-CurChannel:: db ; c299
-Volume:: ; c29a
+wCurMusicByte:: db ; c298
+wCurChannel:: db ; c299
+wVolume:: ; c29a
; corresponds to $ff24
; Channel control / ON-OFF / Volume (R/W)
; bit 7 - Vin->SO2 ON/OFF
@@ -51,12 +51,12 @@
; bit 3 - Vin->SO1 ON/OFF
; bit 2-0 - SO1 output level (volume) (# 0-7)
db
-SoundOutput:: ; c29b
+wSoundOutput:: ; c29b
; corresponds to $ff25
; bit 4-7: ch1-4 so2 on/off
; bit 0-3: ch1-4 so1 on/off
db
-SoundInput:: ; c29c
+wSoundInput:: ; c29c
; corresponds to $ff26
; bit 7: global on/off
; bit 0: ch1 on/off
@@ -65,60 +65,60 @@
; bit 3: ch4 on/off
db
-MusicID:: dw ; c29d
-MusicBank:: db ; c29f
-NoiseSampleAddress:: dw ; c2a0
+wMusicID:: dw ; c29d
+wMusicBank:: db ; c29f
+wNoiseSampleAddress:: dw ; c2a0
wNoiseSampleDelay:: db ; c2a2
ds 1 ; c2a3
-MusicNoiseSampleSet:: db ; c2a4
-SFXNoiseSampleSet:: db ; c2a5
+wMusicNoiseSampleSet:: db ; c2a4
+wSFXNoiseSampleSet:: db ; c2a5
-Danger:: ; c2a6
+wLowHealthAlarm:: ; c2a6
; bit 7: on/off
; bit 4: pitch
; bit 0-3: counter
db
-MusicFade:: ; c2a7
+wMusicFade:: ; c2a7
; fades volume over x frames
; bit 7: fade in/out
; bit 0-5: number of frames for each volume level
; $00 = none (default)
db
-MusicFadeCount:: db ; c2a8
-MusicFadeID:: dw ; c2a9
+wMusicFadeCount:: db ; c2a8
+wMusicFadeID:: dw ; c2a9
ds 5
-CryPitch:: dw ; c2b0
-CryLength:: dw ; c2b2
+wCryPitch:: dw ; c2b0
+wCryLength:: dw ; c2b2
-LastVolume:: db ; c2b4
+wLastVolume:: db ; c2b4
wc2b5:: db ; c2b5
-SFXPriority:: ; c2b6
+wSFXPriority:: ; c2b6
; if nonzero, turn off music when playing sfx
db
ds 1
-Channel1JumpCondition:: db
-Channel2JumpCondition:: db
-Channel3JumpCondition:: db
-Channel4JumpCondition:: db
+wChannel1JumpCondition:: db
+wChannel2JumpCondition:: db
+wChannel3JumpCondition:: db
+wChannel4JumpCondition:: db
wStereoPanningMask:: db ; c2bc
-CryTracks:: ; c2bd
+wCryTracks:: ; c2bd
; plays only in left or right track depending on what side the monster is on
; both tracks active outside of battle
db
wSFXDuration:: db
-CurSFX:: ; c2bf
+wCurSFX:: ; c2bf
; id of sfx currently playing
db
-ChannelsEnd::
+wChannelsEnd::
wMapMusic:: db ; c2c0
@@ -135,10 +135,10 @@
wBoxAlignment:: db
-InputType:: db ; c2c7
-AutoInputAddress:: dw ; c2c8
-AutoInputBank:: db ; c2ca
-AutoInputLength:: db ; c2cb
+wInputType:: db ; c2c7
+wAutoInputAddress:: dw ; c2c8
+wAutoInputBank:: db ; c2ca
+wAutoInputLength:: db ; c2cb
wMonStatusFlags:: db
wGameLogicPaused:: db ; c2cd
@@ -163,7 +163,7 @@
; 4 mobile battle
db
-ScriptVar:: db ; c2dd
+wScriptVar:: db ; c2dd
wPlayerNextMovement:: db
wPlayerMovement:: db
@@ -190,12 +190,12 @@
ds 1
-TileDown:: db ; c2fa
-TileUp:: db ; c2fb
-TileLeft:: db ; c2fc
-TileRight:: db ; c2fd
+wTileDown:: db ; c2fa
+wTileUp:: db ; c2fb
+wTileLeft:: db ; c2fc
+wTileRight:: db ; c2fd
-TilePermissions:: ; c2fe
+wTilePermissions:: ; c2fe
; set if tile behavior prevents
; you from walking in that direction
; bit 3: down
@@ -218,16 +218,16 @@
wSpriteAnimationStructs::
; field 0: index
; fields 1-3: loaded from SpriteAnimSeqData
-SpriteAnim1:: sprite_anim_struct SpriteAnim1
-SpriteAnim2:: sprite_anim_struct SpriteAnim2
-SpriteAnim3:: sprite_anim_struct SpriteAnim3
-SpriteAnim4:: sprite_anim_struct SpriteAnim4
-SpriteAnim5:: sprite_anim_struct SpriteAnim5
-SpriteAnim6:: sprite_anim_struct SpriteAnim6
-SpriteAnim7:: sprite_anim_struct SpriteAnim7
-SpriteAnim8:: sprite_anim_struct SpriteAnim8
-SpriteAnim9:: sprite_anim_struct SpriteAnim9
-SpriteAnim10:: sprite_anim_struct SpriteAnim10
+wSpriteAnim1:: sprite_anim_struct wSpriteAnim1
+wSpriteAnim2:: sprite_anim_struct wSpriteAnim2
+wSpriteAnim3:: sprite_anim_struct wSpriteAnim3
+wSpriteAnim4:: sprite_anim_struct wSpriteAnim4
+wSpriteAnim5:: sprite_anim_struct wSpriteAnim5
+wSpriteAnim6:: sprite_anim_struct wSpriteAnim6
+wSpriteAnim7:: sprite_anim_struct wSpriteAnim7
+wSpriteAnim8:: sprite_anim_struct wSpriteAnim8
+wSpriteAnim9:: sprite_anim_struct wSpriteAnim9
+wSpriteAnim10:: sprite_anim_struct wSpriteAnim10
wSpriteAnimationStructsEnd::
NEXTU ; c300
@@ -258,7 +258,7 @@
wSpriteAnimCount:: db
wCurrSpriteOAMAddr:: db
-CurIcon:: db ; c3b6
+wCurIcon:: db ; c3b6
wCurIconTile:: db
wSpriteAnimAddrBackup::
@@ -302,56 +302,56 @@
SECTION "Sprites", WRAM0
-Sprites:: ; c400
-Sprite01:: sprite_oam_struct Sprite01
-Sprite02:: sprite_oam_struct Sprite02
-Sprite03:: sprite_oam_struct Sprite03
-Sprite04:: sprite_oam_struct Sprite04
-Sprite05:: sprite_oam_struct Sprite05
-Sprite06:: sprite_oam_struct Sprite06
-Sprite07:: sprite_oam_struct Sprite07
-Sprite08:: sprite_oam_struct Sprite08
-Sprite09:: sprite_oam_struct Sprite09
-Sprite10:: sprite_oam_struct Sprite10
-Sprite11:: sprite_oam_struct Sprite11
-Sprite12:: sprite_oam_struct Sprite12
-Sprite13:: sprite_oam_struct Sprite13
-Sprite14:: sprite_oam_struct Sprite14
-Sprite15:: sprite_oam_struct Sprite15
-Sprite16:: sprite_oam_struct Sprite16
-Sprite17:: sprite_oam_struct Sprite17
-Sprite18:: sprite_oam_struct Sprite18
-Sprite19:: sprite_oam_struct Sprite19
-Sprite20:: sprite_oam_struct Sprite20
-Sprite21:: sprite_oam_struct Sprite21
-Sprite22:: sprite_oam_struct Sprite22
-Sprite23:: sprite_oam_struct Sprite23
-Sprite24:: sprite_oam_struct Sprite24
-Sprite25:: sprite_oam_struct Sprite25
-Sprite26:: sprite_oam_struct Sprite26
-Sprite27:: sprite_oam_struct Sprite27
-Sprite28:: sprite_oam_struct Sprite28
-Sprite29:: sprite_oam_struct Sprite29
-Sprite30:: sprite_oam_struct Sprite30
-Sprite31:: sprite_oam_struct Sprite31
-Sprite32:: sprite_oam_struct Sprite32
-Sprite33:: sprite_oam_struct Sprite33
-Sprite34:: sprite_oam_struct Sprite34
-Sprite35:: sprite_oam_struct Sprite35
-Sprite36:: sprite_oam_struct Sprite36
-Sprite37:: sprite_oam_struct Sprite37
-Sprite38:: sprite_oam_struct Sprite38
-Sprite39:: sprite_oam_struct Sprite39
-Sprite40:: sprite_oam_struct Sprite40
-SpritesEnd::
+wVirtualOAM:: ; c400
+wVirtualOAMSprite00:: sprite_oam_struct wVirtualOAMSprite00
+wVirtualOAMSprite01:: sprite_oam_struct wVirtualOAMSprite01
+wVirtualOAMSprite02:: sprite_oam_struct wVirtualOAMSprite02
+wVirtualOAMSprite03:: sprite_oam_struct wVirtualOAMSprite03
+wVirtualOAMSprite04:: sprite_oam_struct wVirtualOAMSprite04
+wVirtualOAMSprite05:: sprite_oam_struct wVirtualOAMSprite05
+wVirtualOAMSprite06:: sprite_oam_struct wVirtualOAMSprite06
+wVirtualOAMSprite07:: sprite_oam_struct wVirtualOAMSprite07
+wVirtualOAMSprite08:: sprite_oam_struct wVirtualOAMSprite08
+wVirtualOAMSprite09:: sprite_oam_struct wVirtualOAMSprite09
+wVirtualOAMSprite10:: sprite_oam_struct wVirtualOAMSprite10
+wVirtualOAMSprite11:: sprite_oam_struct wVirtualOAMSprite11
+wVirtualOAMSprite12:: sprite_oam_struct wVirtualOAMSprite12
+wVirtualOAMSprite13:: sprite_oam_struct wVirtualOAMSprite13
+wVirtualOAMSprite14:: sprite_oam_struct wVirtualOAMSprite14
+wVirtualOAMSprite15:: sprite_oam_struct wVirtualOAMSprite15
+wVirtualOAMSprite16:: sprite_oam_struct wVirtualOAMSprite16
+wVirtualOAMSprite17:: sprite_oam_struct wVirtualOAMSprite17
+wVirtualOAMSprite18:: sprite_oam_struct wVirtualOAMSprite18
+wVirtualOAMSprite19:: sprite_oam_struct wVirtualOAMSprite19
+wVirtualOAMSprite20:: sprite_oam_struct wVirtualOAMSprite20
+wVirtualOAMSprite21:: sprite_oam_struct wVirtualOAMSprite21
+wVirtualOAMSprite22:: sprite_oam_struct wVirtualOAMSprite22
+wVirtualOAMSprite23:: sprite_oam_struct wVirtualOAMSprite23
+wVirtualOAMSprite24:: sprite_oam_struct wVirtualOAMSprite24
+wVirtualOAMSprite25:: sprite_oam_struct wVirtualOAMSprite25
+wVirtualOAMSprite26:: sprite_oam_struct wVirtualOAMSprite26
+wVirtualOAMSprite27:: sprite_oam_struct wVirtualOAMSprite27
+wVirtualOAMSprite28:: sprite_oam_struct wVirtualOAMSprite28
+wVirtualOAMSprite29:: sprite_oam_struct wVirtualOAMSprite29
+wVirtualOAMSprite30:: sprite_oam_struct wVirtualOAMSprite30
+wVirtualOAMSprite31:: sprite_oam_struct wVirtualOAMSprite31
+wVirtualOAMSprite32:: sprite_oam_struct wVirtualOAMSprite32
+wVirtualOAMSprite33:: sprite_oam_struct wVirtualOAMSprite33
+wVirtualOAMSprite34:: sprite_oam_struct wVirtualOAMSprite34
+wVirtualOAMSprite35:: sprite_oam_struct wVirtualOAMSprite35
+wVirtualOAMSprite36:: sprite_oam_struct wVirtualOAMSprite36
+wVirtualOAMSprite37:: sprite_oam_struct wVirtualOAMSprite37
+wVirtualOAMSprite38:: sprite_oam_struct wVirtualOAMSprite38
+wVirtualOAMSprite39:: sprite_oam_struct wVirtualOAMSprite39
+wVirtualOAMEnd::
SECTION "Tilemap", WRAM0
-TileMap:: ; c4a0
+wTileMap:: ; c4a0
; 20x18 grid of 8x8 tiles
ds SCREEN_WIDTH * SCREEN_HEIGHT
-TileMapEnd::
+wTileMapEnd::
SECTION "Battle", WRAM0
@@ -367,7 +367,7 @@
NEXTU ; c608
; odd egg
-wOddEgg:: party_struct OddEgg
+wOddEgg:: party_struct wOddEgg
wOddEggName:: ds MON_NAME_LENGTH
wOddEggOTName:: ds MON_NAME_LENGTH
@@ -398,10 +398,10 @@
wEnemyMoveStruct:: move_struct wEnemyMoveStruct ; c608
wPlayerMoveStruct:: move_struct wPlayerMoveStruct ; c60f
-EnemyMonNick:: ds MON_NAME_LENGTH ; c616
-BattleMonNick:: ds MON_NAME_LENGTH ; c621
+wEnemyMonNick:: ds MON_NAME_LENGTH ; c616
+wBattleMonNick:: ds MON_NAME_LENGTH ; c621
-BattleMon:: battle_struct BattleMon ; c62c
+wBattleMon:: battle_struct wBattleMon ; c62c
ds 2
@@ -411,9 +411,9 @@
wEnemyTrainerItem2:: db ; c651
wEnemyTrainerBaseReward:: db ; c652
wEnemyTrainerAIFlags:: ds 3 ; c653
-OTClassName:: ds TRAINER_CLASS_NAME_LENGTH ; c656
+wOTClassName:: ds TRAINER_CLASS_NAME_LENGTH ; c656
-CurOTMon:: db ; c663
+wCurOTMon:: db ; c663
wBattleParticipantsNotFainted::
; Bit array. Bits 0 - 5 correspond to party members 1 - 6.
@@ -423,7 +423,7 @@
; All bits cleared if the enemy faints.
db
-TypeModifier:: ; c665
+wTypeModifier:: ; c665
; >10: super-effective
; 10: normal
; <10: not very effective
@@ -430,17 +430,17 @@
; bit 7: stab
db
-CriticalHit:: ; c666
+wCriticalHit:: ; c666
; 0 if not critical
; 1 for a critical hit
; 2 for a OHKO
db
-AttackMissed:: ; c667
+wAttackMissed:: ; c667
; nonzero for a miss
db
-PlayerSubStatus1:: ; c668
+wPlayerSubStatus1:: ; c668
; bit
; 7 in love
; 6 rollout
@@ -451,7 +451,7 @@
; 1 curse
; 0 nightmare
db
-PlayerSubStatus2:: ; c669
+wPlayerSubStatus2:: ; c669
; bit
; 7
; 6
@@ -462,7 +462,7 @@
; 1
; 0 curled
db
-PlayerSubStatus3:: ; c66a
+wPlayerSubStatus3:: ; c66a
; bit
; 7 confused
; 6 flying
@@ -473,7 +473,7 @@
; 1 rampage
; 0 bide
db
-PlayerSubStatus4:: ; c66b
+wPlayerSubStatus4:: ; c66b
; bit
; 7 leech seed
; 6 rage
@@ -484,7 +484,7 @@
; 1 mist
; 0 x accuracy
db
-PlayerSubStatus5:: ; c66c
+wPlayerSubStatus5:: ; c66c
; bit
; 7 can't run
; 6 destiny bond
@@ -496,42 +496,42 @@
; 0 toxic
db
-EnemySubStatus1:: ; c66d
-; see PlayerSubStatus1
+wEnemySubStatus1:: ; c66d
+; see wPlayerSubStatus1
db
-EnemySubStatus2:: ; c66e
-; see PlayerSubStatus2
+wEnemySubStatus2:: ; c66e
+; see wPlayerSubStatus2
db
-EnemySubStatus3:: ; c66f
-; see PlayerSubStatus3
+wEnemySubStatus3:: ; c66f
+; see wPlayerSubStatus3
db
-EnemySubStatus4:: ; c670
-; see PlayerSubStatus4
+wEnemySubStatus4:: ; c670
+; see wPlayerSubStatus4
db
-EnemySubStatus5:: ; c671
-; see PlayerSubStatus5
+wEnemySubStatus5:: ; c671
+; see wPlayerSubStatus5
db
-PlayerRolloutCount:: db ; c672
-PlayerConfuseCount:: db ; c673
-PlayerToxicCount:: db ; c674
-PlayerDisableCount:: db ; c675
-PlayerEncoreCount:: db ; c676
-PlayerPerishCount:: db ; c677
-PlayerFuryCutterCount:: db ; c678
-PlayerProtectCount:: db ; c679
+wPlayerRolloutCount:: db ; c672
+wPlayerConfuseCount:: db ; c673
+wPlayerToxicCount:: db ; c674
+wPlayerDisableCount:: db ; c675
+wPlayerEncoreCount:: db ; c676
+wPlayerPerishCount:: db ; c677
+wPlayerFuryCutterCount:: db ; c678
+wPlayerProtectCount:: db ; c679
-EnemyRolloutCount:: db ; c67a
-EnemyConfuseCount:: db ; c67b
-EnemyToxicCount:: db ; c67c
-EnemyDisableCount:: db ; c67d
-EnemyEncoreCount:: db ; c67e
-EnemyPerishCount:: db ; c67f
-EnemyFuryCutterCount:: db ; c680
-EnemyProtectCount:: db ; c681
+wEnemyRolloutCount:: db ; c67a
+wEnemyConfuseCount:: db ; c67b
+wEnemyToxicCount:: db ; c67c
+wEnemyDisableCount:: db ; c67d
+wEnemyEncoreCount:: db ; c67e
+wEnemyPerishCount:: db ; c67f
+wEnemyFuryCutterCount:: db ; c680
+wEnemyProtectCount:: db ; c681
-PlayerDamageTaken:: dw ; c682
-EnemyDamageTaken:: dw ; c684
+wPlayerDamageTaken:: dw ; c682
+wEnemyDamageTaken:: dw ; c684
wBattleReward:: ds 3 ; c686
wBattleAnimParam::
@@ -538,76 +538,76 @@
wKickCounter::
wPresentPower::
db ; c689
-BattleScriptBuffer:: ds 40 ; c68a
+wBattleScriptBuffer:: ds 40 ; c68a
-BattleScriptBufferAddress:: dw ; c6b2
+wBattleScriptBufferAddress:: dw ; c6b2
wTurnEnded:: db ; c6b4
ds 1
-PlayerStats:: ; c6b6
-PlayerAttack:: dw
-PlayerDefense:: dw
-PlayerSpeed:: dw
-PlayerSpAtk:: dw
-PlayerSpDef:: dw
+wPlayerStats:: ; c6b6
+wPlayerAttack:: dw
+wPlayerDefense:: dw
+wPlayerSpeed:: dw
+wPlayerSpAtk:: dw
+wPlayerSpDef:: dw
ds 1
-EnemyStats:: ; c6c1
-EnemyAttack:: dw
-EnemyDefense:: dw
-EnemySpeed:: dw
-EnemySpAtk:: dw
-EnemySpDef:: dw
+wEnemyStats:: ; c6c1
+wEnemyAttack:: dw
+wEnemyDefense:: dw
+wEnemySpeed:: dw
+wEnemySpAtk:: dw
+wEnemySpDef:: dw
ds 1
-PlayerStatLevels:: ; c6cc
+wPlayerStatLevels:: ; c6cc
; 07 neutral
-PlayerAtkLevel:: db ; c6cc
-PlayerDefLevel:: db ; c6cd
-PlayerSpdLevel:: db ; c6ce
-PlayerSAtkLevel:: db ; c6cf
+wPlayerAtkLevel:: db ; c6cc
+wPlayerDefLevel:: db ; c6cd
+wPlayerSpdLevel:: db ; c6ce
+wPlayerSAtkLevel:: db ; c6cf
UNION ; c6d0
; finish battle RAM
-PlayerSDefLevel:: db ; c6d0
-PlayerAccLevel:: db ; c6d1
-PlayerEvaLevel:: db ; c6d2
+wPlayerSDefLevel:: db ; c6d0
+wPlayerAccLevel:: db ; c6d1
+wPlayerEvaLevel:: db ; c6d2
ds 1 ; c6d3
-PlayerStatLevelsEnd::
+wPlayerStatLevelsEnd::
-EnemyStatLevels:: ; c6d4
+wEnemyStatLevels:: ; c6d4
; 07 neutral
-EnemyAtkLevel:: db ; c6d4
-EnemyDefLevel:: db ; c6d5
-EnemySpdLevel:: db ; c6d6
-EnemySAtkLevel:: db ; c6d7
-EnemySDefLevel:: db ; c6d8
-EnemyAccLevel:: db ; c6d9
-EnemyEvaLevel:: db ; c6da
+wEnemyAtkLevel:: db ; c6d4
+wEnemyDefLevel:: db ; c6d5
+wEnemySpdLevel:: db ; c6d6
+wEnemySAtkLevel:: db ; c6d7
+wEnemySDefLevel:: db ; c6d8
+wEnemyAccLevel:: db ; c6d9
+wEnemyEvaLevel:: db ; c6da
ds 1
-EnemyTurnsTaken:: db ; c6dc
-PlayerTurnsTaken:: db ; c6dd
+wEnemyTurnsTaken:: db ; c6dc
+wPlayerTurnsTaken:: db ; c6dd
ds 1
-PlayerSubstituteHP:: db ; c6df
-EnemySubstituteHP:: db ; c6e0
+wPlayerSubstituteHP:: db ; c6df
+wEnemySubstituteHP:: db ; c6e0
wUnusedPlayerLockedMove:: db ; c6e1
ds 1
-CurPlayerMove:: db ; c6e3
-CurEnemyMove:: db ; c6e4
+wCurPlayerMove:: db ; c6e3
+wCurEnemyMove:: db ; c6e4
-LinkBattleRNCount:: ; c6e5
+wLinkBattleRNCount:: ; c6e5
; how far through the prng stream
db
wEnemyItemState:: db ; c6e6
ds 2
-CurEnemyMoveNum:: db ; c6e9
+wCurEnemyMoveNum:: db ; c6e9
wEnemyHPAtTimeOfPlayerSwitch:: dw ; c6ea
wPayDayMoney:: ds 3 ; c6ec
@@ -616,24 +616,24 @@
wSafariMonEating:: db
ds 1
wEnemyBackupDVs:: dw ; used when enemy is transformed
-AlreadyDisobeyed:: db ; c6f4
+wAlreadyDisobeyed:: db ; c6f4
-DisabledMove:: db ; c6f5
-EnemyDisabledMove:: db ; c6f6
+wDisabledMove:: db ; c6f5
+wEnemyDisabledMove:: db ; c6f6
wWhichMonFaintedFirst:: db
; exists so you can't counter on switch
-LastPlayerCounterMove:: db ; c6f8
-LastEnemyCounterMove:: db ; c6f9
+wLastPlayerCounterMove:: db ; c6f8
+wLastEnemyCounterMove:: db ; c6f9
wEnemyMinimized:: db ; c6fa
-AlreadyFailed:: db ; c6fb
+wAlreadyFailed:: db ; c6fb
wBattleParticipantsIncludingFainted:: db ; c6fc
-wDanger:: db ; c6fd
+wBattleLowHealthAlarm:: db ; c6fd
wPlayerMinimized:: db ; c6fe
-PlayerScreens:: ; c6ff
+wPlayerScreens:: ; c6ff
; bit
; 7
; 6
@@ -645,21 +645,21 @@
; 0 spikes
db
-EnemyScreens:: ; c700
-; see PlayerScreens
+wEnemyScreens:: ; c700
+; see wPlayerScreens
db
-PlayerSafeguardCount:: db ; c701
-PlayerLightScreenCount:: db ; c702
-PlayerReflectCount:: db ; c703
+wPlayerSafeguardCount:: db ; c701
+wPlayerLightScreenCount:: db ; c702
+wPlayerReflectCount:: db ; c703
ds 1
-EnemySafeguardCount:: db ; c705
-EnemyLightScreenCount:: db ; c706
-EnemyReflectCount:: db ; c707
+wEnemySafeguardCount:: db ; c705
+wEnemyLightScreenCount:: db ; c706
+wEnemyReflectCount:: db ; c707
ds 2
-Weather:: ; c70a
+wBattleWeather:: ; c70a
; 00 normal
; 01 rain
; 02 sun
@@ -669,19 +669,19 @@
; 06 sandstorm subsided
db
-WeatherCount:: ; c70b
+wWeatherCount:: ; c70b
; # turns remaining
db
-LoweredStat:: db ; c70c
-EffectFailed:: db ; c70d
-FailedMessage:: db ; c70e
+wLoweredStat:: db ; c70c
+wEffectFailed:: db ; c70d
+wFailedMessage:: db ; c70e
wEnemyGoesFirst:: db ; c70f
wPlayerIsSwitching:: db ; c710
wEnemyIsSwitching:: db ; c711
-PlayerUsedMoves:: ; c712
+wPlayerUsedMoves:: ; c712
; add a move that has been used once by the player
; added in order of use
ds NUM_MOVES
@@ -690,9 +690,9 @@
wEnemySwitchMonParam:: db ; c717
wEnemySwitchMonIndex:: db ; c718
wTempLevel:: db ; c719
-LastPlayerMon:: db ; c71a
-LastPlayerMove:: db ; c71b
-LastEnemyMove:: db ; c71c
+wLastPlayerMon:: db ; c71a
+wLastPlayerMove:: db ; c71b
+wLastEnemyMove:: db ; c71c
wPlayerFutureSightCount:: db ; c71d
wEnemyFutureSightCount:: db ; c71e
@@ -717,7 +717,7 @@
wPlayerCharging:: db ; c732
wEnemyCharging:: db ; c733
-BattleEnded:: db ; c734
+wBattleEnded:: db ; c734
wWildMonMoves:: ds NUM_MOVES ; c735
wWildMonPP:: ds NUM_MOVES ; c739
@@ -884,8 +884,8 @@
SECTION "Overworld Map", WRAM0
UNION ; c800
-OverworldMap:: ds 1300 ; c800
-OverworldMapEnd::
+wOverworldMap:: ds 1300 ; c800
+wOverworldMapEnd::
NEXTU ; c800
; GB Printer screen RAM
@@ -942,7 +942,7 @@
wLinkPlayerName:: ds NAME_LENGTH
wLinkPartyCount:: db
wLinkPartySpecies:: ds PARTY_LENGTH
-wLinkPartySpeciesEnd:: db ; legacy scripts don't check PartyCount
+wLinkPartySpeciesEnd:: db ; legacy scripts don't check wPartyCount
UNION ; c813
; time capsule party data
@@ -1101,17 +1101,17 @@
SECTION "Video", WRAM0
UNION ; cd20
-; BGMapBuffer
-BGMapBuffer:: ds 40 ; cd20
-BGMapPalBuffer:: ds 40 ; cd48
-BGMapBufferPtrs:: ds 40 ; cd70 ; 20 bg map addresses (16x8 tiles)
-BGMapBufferEnd::
+; wBGMapBuffer
+wBGMapBuffer:: ds 40 ; cd20
+wBGMapPalBuffer:: ds 40 ; cd48
+wBGMapBufferPtrs:: ds 40 ; cd70 ; 20 bg map addresses (16x8 tiles)
+wBGMapBufferEnd::
NEXTU ; cd20
; credits
-CreditsPos:: db
-CreditsUnusedCD21:: db
-CreditsTimer:: db
+wCreditsPos:: db
+wCreditsUnusedCD21:: db
+wCreditsTimer:: db
NEXTU ; cd20
; mobile data
@@ -1246,10 +1246,10 @@
wcd8d:: ds 11
ENDU ; cd98
-SGBPredef:: db ; cd98
+wSGBPredef:: db ; cd98
-PlayerHPPal:: db ; cd99
-EnemyHPPal:: db ; cd9a
+wPlayerHPPal:: db ; cd99
+wEnemyHPPal:: db ; cd9a
wHPPals:: ds PARTY_LENGTH
wCurHPPal:: db
@@ -1258,7 +1258,7 @@
wSGBPals:: ds 48 ; cda9
-AttrMap:: ; cdd9
+wAttrMap:: ; cdd9
; 20x18 grid of bg tile attributes for 8x8 tiles
; read horizontally from the top row
; bit 7: priority
@@ -1268,7 +1268,7 @@
; bit 3: vram bank (cgb only)
; bit 2-0: pal # (cgb only)
ds SCREEN_WIDTH * SCREEN_HEIGHT
-AttrMapEnd::
+wAttrMapEnd::
UNION ; cf41
; addresses dealing with serial comms
@@ -1292,10 +1292,10 @@
wLinkTimeoutFrames:: dw ; cf5b
wcf5d:: dw
-MonType:: db ; cf5f
+wMonType:: db ; cf5f
-CurSpecies::
-CurMove::
+wCurSpecies::
+wCurMove::
db ; cf60
wNamedObjectTypeBuffer:: db
@@ -1385,20 +1385,20 @@
db
ENDU ; cf67
-Requested2bpp::
-Requested2bppSize:: db ; cf67
-Requested2bppSource:: dw ; cf68
-Requested2bppDest:: dw ; cf6a
+wRequested2bpp::
+wRequested2bppSize:: db ; cf67
+wRequested2bppSource:: dw ; cf68
+wRequested2bppDest:: dw ; cf6a
-Requested1bpp::
-Requested1bppSize:: db ; cf6c
-Requested1bppSource:: dw ; cf6d
-Requested1bppDest:: dw ; cf6f
+wRequested1bpp::
+wRequested1bppSize:: db ; cf6c
+wRequested1bppSource:: dw ; cf6d
+wRequested1bppDest:: dw ; cf6f
wWindowStackPointer:: dw ; cf71
wMenuJoypad:: db ; cf73
-MenuSelection:: db ; cf74
-MenuSelectionQuantity:: db ; cf75
+wMenuSelection:: db ; cf74
+wMenuSelectionQuantity:: db ; cf75
wWhichIndexSet:: db ; cf76
wScrollingMenuCursorPosition:: db ; cf77
wWindowStackSize:: db ; cf78
@@ -1479,13 +1479,13 @@
ds 3
-OverworldDelay:: db ; cfb1
-TextDelayFrames:: db ; cfb2
-VBlankOccurred:: db ; cfb3
+wOverworldDelay:: db ; cfb1
+wTextDelayFrames:: db ; cfb2
+wVBlankOccurred:: db ; cfb3
-PredefID:: db ; cfb4
-PredefTemp:: dw ; cfb5
-PredefAddress:: dw ; cfb7
+wPredefID:: db ; cfb4
+wPredefTemp:: dw ; cfb5
+wPredefAddress:: dw ; cfb7
wFarCallBCBuffer:: dw ; cfb9
wcfbb:: db
@@ -1502,7 +1502,7 @@
ds 1
-InBattleTowerBattle:: ; cfc0
+wInBattleTowerBattle:: ; cfc0
; 0 not in BattleTower-Battle
; 1 BattleTower-Battle
db
@@ -1509,12 +1509,12 @@
ds 1
-FXAnimID:: dw ; cfc2
+wFXAnimID:: dw ; cfc2
wPlaceBallsX:: db ; cfc4
wPlaceBallsY:: db ; cfc5
-TileAnimationTimer:: db ; cfc6
+wTileAnimationTimer:: db ; cfc6
; palette backups?
wBGP:: db
@@ -1525,7 +1525,7 @@
ds 1
-Options:: ; cfcc
+wOptions:: ; cfcc
; bit 0-2: number of frames to delay when printing text
; fast 1; mid 3; slow 5
; bit 3: ?
@@ -1535,14 +1535,14 @@
; bit 7: battle scene off/on
db
wSaveFileExists:: db
-TextBoxFrame:: ; cfce
+wTextBoxFrame:: ; cfce
; bits 0-2: textbox frame 0-7
db
-TextBoxFlags::
+wTextBoxFlags::
; bit 0: 1-frame text delay
; bit 4: no text delay
db
-GBPrinter:: ; cfd0
+wGBPrinter:: ; cfd0
; bit 0-6: brightness
; lightest: $00
; lighter: $20
@@ -1550,11 +1550,11 @@
; darker: $60
; darkest: $7F
db
-Options2:: ; cfd1
+wOptions2:: ; cfd1
; bit 1: menu account off/on
db
ds 2
-OptionsEnd::
+wOptionsEnd::
; Time buffer, for counting the amount of time since
; an event began.
@@ -1568,7 +1568,7 @@
wGBCOnlyDecompressBuffer:: ds 1 ; also uses the next $53f bytes for $540 total
-DefaultSpawnpoint:: db
+wDefaultSpawnpoint:: db
UNION ; d002
; mail temp storage
@@ -1632,8 +1632,8 @@
NEXTU ; d002
; phone call data
-PhoneScriptBank:: db
-PhoneCaller:: dw
+wPhoneScriptBank:: db
+wPhoneCaller:: dw
NEXTU ; d002
; radio data
@@ -1648,11 +1648,11 @@
NEXTU ; d002
; lucky number show
-LuckyNumberDigit1Buffer:: db
-LuckyNumberDigit2Buffer:: db
-LuckyNumberDigit3Buffer:: db
-LuckyNumberDigit4Buffer:: db
-LuckyNumberDigit5Buffer:: db
+wLuckyNumberDigit1Buffer:: db
+wLuckyNumberDigit2Buffer:: db
+wLuckyNumberDigit3Buffer:: db
+wLuckyNumberDigit4Buffer:: db
+wLuckyNumberDigit5Buffer:: db
NEXTU ; d002
; movement buffer data
@@ -1660,7 +1660,7 @@
wMovementBufferObject:: db
wUnusedMovementBufferBank:: db
wUnusedMovementBufferPointer:: dw
-MovementBuffer:: ds 55
+wMovementBuffer:: ds 55
NEXTU ; d002
; box printing
@@ -1694,8 +1694,8 @@
wKeepSevenBiasChance:: ; used in the slots to handle the favoring of 7 symbol streaks
db
ds 2
-StartFlypoint:: db
-EndFlypoint:: db
+wStartFlypoint:: db
+wEndFlypoint:: db
NEXTU ; d002
; unidentified
@@ -1734,21 +1734,21 @@
UNION ; d03e
; engine buffers
-EngineBuffer1:: db
-EngineBuffer2:: db
-EngineBuffer3:: db
-EngineBuffer4:: db
-EngineBuffer5:: db
+wEngineBuffer1:: db
+wEngineBuffer2:: db
+wEngineBuffer3:: db
+wEngineBuffer4:: db
+wEngineBuffer5:: db
NEXTU ; d03e
; menu items list
-MenuItemsList:: ds 16
-MenuItemsListEnd::
+wMenuItemsList:: ds 16
+wMenuItemsListEnd::
NEXTU ; d03e
; fruit tree data
-CurFruitTree:: db
-CurFruit:: db
+wCurFruitTree:: db
+wCurFruit:: db
NEXTU ; d03e
; elevator data
@@ -1774,8 +1774,8 @@
NEXTU ; d03e
; mart data
ds 1
-MartPointerBank:: db
-MartPointer:: dw
+wMartPointerBank:: db
+wMartPointer:: dw
ds 1
wBargainShopFlags:: db
@@ -1795,16 +1795,16 @@
NEXTU ; d03e
; player movement data
-CurInput:: db
+wCurInput:: db
wd03f:: db
wd040:: db
wd041:: db
-MovementAnimation:: db
-WalkingDirection:: db
-FacingDirection:: db
-WalkingX:: db
-WalkingY:: db
-WalkingTile:: db
+wMovementAnimation:: db
+wWalkingDirection:: db
+wFacingDirection:: db
+wWalkingX:: db
+wWalkingY:: db
+wWalkingTile:: db
ds 6
wPlayerTurningDirection:: db
@@ -1829,16 +1829,16 @@
wTMHMMoveNameBackup:: ds MOVE_NAME_LENGTH ; d066
-StringBuffer1:: ds 19 ; d073
-StringBuffer2:: ds 19 ; d086
-StringBuffer3:: ds 19 ; d099
-StringBuffer4:: ds 19 ; d0ac
-StringBuffer5:: ds 19 ; d0bf
+wStringBuffer1:: ds 19 ; d073
+wStringBuffer2:: ds 19 ; d086
+wStringBuffer3:: ds 19 ; d099
+wStringBuffer4:: ds 19 ; d0ac
+wStringBuffer5:: ds 19 ; d0bf
wBattleMenuCursorBuffer:: dw ; d0d2
-CurBattleMon:: db ; d0d4
-CurMoveNum:: db ; d0d5
+wCurBattleMon:: db ; d0d4
+wCurMoveNum:: db ; d0d5
wLastPocket:: db
@@ -1871,7 +1871,7 @@
wFieldMoveSucceeded::
wItemEffectSucceeded::
-wPlayerAction::
+wBattlePlayerAction::
; 0 - use move
; 1 - use item
; 2 - switch
@@ -1878,7 +1878,7 @@
wSolvedUnownPuzzle::
db ; d0ec
-VramState:: ; d0ed
+wVramState:: ; d0ed
; bit 0: overworld sprite updating on/off
; bit 6: something to do with text
; bit 7: on when surf initiates
@@ -1890,13 +1890,13 @@
UNION ; d0f0
; mart data
-CurMart:: ds 16
-CurMartEnd::
+wCurMart:: ds 16
+wCurMartEnd::
NEXTU ; d0f0
; elevator data
-CurElevator:: db
-CurElevatorFloors:: db
+wCurElevator:: db
+wCurElevatorFloors:: db
NEXTU ; d0f0
; mailbox data
@@ -1911,14 +1911,14 @@
wUnusedD102:: dw ; d102
wItemAttributesPtr:: dw ; d104
-CurItem:: db ; d106
-CurItemQuantity:: ; d107
+wCurItem:: db ; d106
+wCurItemQuantity:: ; d107
wMartItemID::
db
-CurPartySpecies:: db ; d108
+wCurPartySpecies:: db ; d108
-CurPartyMon:: ; d109
+wCurPartyMon:: ; d109
; contains which monster in a party
; is being dealt with at the moment
; 0-5
@@ -1939,17 +1939,17 @@
wItemQuantityChangeBuffer:: db
wItemQuantityBuffer:: db
-TempMon:: party_struct TempMon ; d10e
+wTempMon:: party_struct wTempMon ; d10e
wSpriteFlags:: db ; d13e
wHandlePlayerStep:: dw ; d13f
-PartyMenuActionText:: db ; d141
+wPartyMenuActionText:: db ; d141
wItemAttributeParamBuffer:: db ; d142
-CurPartyLevel:: db ; d143
+wCurPartyLevel:: db ; d143
wScrollingMenuListSize:: dw
@@ -1981,8 +1981,8 @@
wBGMapAnchor:: dw ; d152
UNION ; d154
-UsedSprites:: ds 64
-UsedSpritesEnd::
+wUsedSprites:: ds 64
+wUsedSpritesEnd::
NEXTU ; d154
ds 31
@@ -1995,54 +1995,54 @@
wPartialMapDef::
wMapDataBank:: db ; d198
-wTileset:: db ; d199
+wMapTileset:: db ; d199
wEnvironment:: db ; d19a
wMapDataPointer:: dw ; d19b
wPartialMapDefEnd::
wMapData:: ; d19d
-MapBorderBlock:: db ; d19d
+wMapBorderBlock:: db ; d19d
; width/height are in blocks (2x2 walkable tiles, 4x4 graphics tiles)
-MapHeight:: db ; d19e
-MapWidth:: db ; d19f
-MapBlocksBank:: db; d1a0
-MapBlocksPointer:: dw ; d1a1
-MapScriptsBank:: db ; d1a3
-MapScriptsPointer:: dw ; d1a4
-MapEventsPointer:: dw ; d1a6
+wMapHeight:: db ; d19e
+wMapWidth:: db ; d19f
+wMapBlocksBank:: db; d1a0
+wMapBlocksPointer:: dw ; d1a1
+wMapScriptsBank:: db ; d1a3
+wMapScriptsPointer:: dw ; d1a4
+wMapEventsPointer:: dw ; d1a6
; bit set
-MapConnections:: db ; d1a8
+wMapConnections:: db ; d1a8
wMapDataEnd::
-NorthMapConnection:: map_connection_struct North ; d1a9
-SouthMapConnection:: map_connection_struct South ; d1b5
-WestMapConnection:: map_connection_struct West ; d1c1
-EastMapConnection:: map_connection_struct East ; d1cd
+wNorthMapConnection:: map_connection_struct wNorth ; d1a9
+wSouthMapConnection:: map_connection_struct wSouth ; d1b5
+wWestMapConnection:: map_connection_struct wWest ; d1c1
+wEastMapConnection:: map_connection_struct wEast ; d1cd
-Tileset::
-TilesetBank:: db ; d1d9
-TilesetAddress:: dw ; d1da
-TilesetBlocksBank:: db ; d1dc
-TilesetBlocksAddress:: dw ; d1dd
-TilesetCollisionBank:: db ; d1df
-TilesetCollisionAddress:: dw ; d1e0
-TilesetAnim:: dw ; bank 3f ; d1e2
+wTileset::
+wTilesetBank:: db ; d1d9
+wTilesetAddress:: dw ; d1da
+wTilesetBlocksBank:: db ; d1dc
+wTilesetBlocksAddress:: dw ; d1dd
+wTilesetCollisionBank:: db ; d1df
+wTilesetCollisionAddress:: dw ; d1e0
+wTilesetAnim:: dw ; bank 3f ; d1e2
ds 2 ; unused ; d1e4
-TilesetPalettes:: dw ; bank 3f ; d1e6
-TilesetEnd::
+wTilesetPalettes:: dw ; bank 3f ; d1e6
+wTilesetEnd::
-EvolvableFlags:: flag_array PARTY_LENGTH ; d1e8
+wEvolvableFlags:: flag_array PARTY_LENGTH ; d1e8
wForceEvolution:: db ; d1e9
UNION ; d1ea
; general-purpose buffers
-Buffer1:: db ; d1ea
-Buffer2:: db ; d1eb
-Buffer3:: db ; d1ec
-Buffer4:: db ; d1ed
-Buffer5:: db ; d1ee
-Buffer6:: db ; d1ef
+wBuffer1:: db ; d1ea
+wBuffer2:: db ; d1eb
+wBuffer3:: db ; d1ec
+wBuffer4:: db ; d1ed
+wBuffer5:: db ; d1ee
+wBuffer6:: db ; d1ef
NEXTU ; d1ea
; HP bar animations
@@ -2081,21 +2081,21 @@
wSelectedDecoration:: db
wOtherDecoration:: db
ds 3
-CurEnemyItem:: db
+wCurEnemyItem:: db
ENDU ; d1f7
ds 3
-LinkBattleRNs:: ds 10 ; d1fa
+wLinkBattleRNs:: ds 10 ; d1fa
-TempEnemyMonSpecies:: db ; d204
-TempBattleMonSpecies:: db ; d205
+wTempEnemyMonSpecies:: db ; d204
+wTempBattleMonSpecies:: db ; d205
-EnemyMon:: battle_struct EnemyMon ; d206
-EnemyMonBaseStats:: ds 5 ; d226
-EnemyMonCatchRate:: db ; d22b
-EnemyMonBaseExp:: db ; d22c
-EnemyMonEnd::
+wEnemyMon:: battle_struct wEnemyMon ; d206
+wEnemyMonBaseStats:: ds 5 ; d226
+wEnemyMonCatchRate:: db ; d22b
+wEnemyMonBaseExp:: db ; d22c
+wEnemyMonEnd::
wBattleMode:: ; d22d
@@ -2104,17 +2104,17 @@
; 2: trainer battle
db
-TempWildMonSpecies:: db
+wTempWildMonSpecies:: db
-OtherTrainerClass:: ; d22f
+wOtherTrainerClass:: ; d22f
; class (Youngster, Bug Catcher, etc.) of opposing trainer
; 0 if opponent is a wild Pokémon, not a trainer
db
; BATTLETYPE_* values
-BattleType:: db ; d230
+wBattleType:: db ; d230
-OtherTrainerID:: ; d231
+wOtherTrainerID:: ; d231
; which trainer of the class that you're fighting
; (Joey, Mikey, Albert, etc.)
db
@@ -2121,42 +2121,42 @@
wForcedSwitch:: db
-TrainerClass:: db ; d233
+wTrainerClass:: db ; d233
-UnownLetter:: db ; d234
+wUnownLetter:: db ; d234
wMoveSelectionMenuType:: db
; corresponds to the data/pokemon/base_stats/*.asm contents
-CurBaseData:: ; d236
-BaseDexNo:: db ; d236
-BaseStats:: ; d237
-BaseHP:: db ; d237
-BaseAttack:: db ; d238
-BaseDefense:: db ; d239
-BaseSpeed:: db ; d23a
-BaseSpecialAttack:: db ; d23b
-BaseSpecialDefense:: db ; d23c
-BaseType:: ; d23d
-BaseType1:: db ; d23d
-BaseType2:: db ; d23e
-BaseCatchRate:: db ; d23f
-BaseExp:: db ; d240
-BaseItems:: ; d241
-BaseItem1:: db ; d241
-BaseItem2:: db ; d242
-BaseGender:: db ; d243
-BaseUnknown1:: db ; d244
-BaseEggSteps:: db ; d245
-BaseUnknown2:: db ; d246
-BasePicSize:: db ; d247
-BasePadding:: ds 4 ; d248
-BaseGrowthRate:: db ; d24c
-BaseEggGroups:: db ; d24d
-BaseTMHM:: flag_array NUM_TM_HM_TUTOR ; d24e
-CurBaseDataEnd::
+wCurBaseData:: ; d236
+wBaseDexNo:: db ; d236
+wBaseStats:: ; d237
+wBaseHP:: db ; d237
+wBaseAttack:: db ; d238
+wBaseDefense:: db ; d239
+wBaseSpeed:: db ; d23a
+wBaseSpecialAttack:: db ; d23b
+wBaseSpecialDefense:: db ; d23c
+wBaseType:: ; d23d
+wBaseType1:: db ; d23d
+wBaseType2:: db ; d23e
+wBaseCatchRate:: db ; d23f
+wBaseExp:: db ; d240
+wBaseItems:: ; d241
+wBaseItem1:: db ; d241
+wBaseItem2:: db ; d242
+wBaseGender:: db ; d243
+wBaseUnknown1:: db ; d244
+wBaseEggSteps:: db ; d245
+wBaseUnknown2:: db ; d246
+wBasePicSize:: db ; d247
+wBasePadding:: ds 4 ; d248
+wBaseGrowthRate:: db ; d24c
+wBaseEggGroups:: db ; d24d
+wBaseTMHM:: flag_array NUM_TM_HM_TUTOR ; d24e
+wCurBaseDataEnd::
-CurDamage:: dw ; d256
+wCurDamage:: dw ; d256
ds 2
@@ -2180,7 +2180,7 @@
wNumFleeAttempts:: db
wMonTriedToEvolve:: db
-TimeOfDay:: db ; d269
+wTimeOfDay:: db ; d269
ds 1
@@ -2196,29 +2196,29 @@
NEXTU ; d26b
; enemy party
-OTPlayerName:: ds NAME_LENGTH ; d26b
+wOTPlayerName:: ds NAME_LENGTH ; d26b
ENDU ; d276
-OTPlayerID:: ds 2 ; d276
+wOTPlayerID:: ds 2 ; d276
ds 8
-OTPartyCount:: ds 1 ; d280
-OTPartySpecies:: ds PARTY_LENGTH ; d281
-OTPartyEnd:: ds 1 ; legacy scripts don't check PartyCount
+wOTPartyCount:: ds 1 ; d280
+wOTPartySpecies:: ds PARTY_LENGTH ; d281
+wOTPartyEnd:: ds 1 ; legacy scripts don't check wPartyCount
UNION ; d288
; ot party mons
-OTPartyMons::
-OTPartyMon1:: party_struct OTPartyMon1 ; d288
-OTPartyMon2:: party_struct OTPartyMon2 ; d2b8
-OTPartyMon3:: party_struct OTPartyMon3 ; d2e8
-OTPartyMon4:: party_struct OTPartyMon4 ; d318
-OTPartyMon5:: party_struct OTPartyMon5 ; d348
-OTPartyMon6:: party_struct OTPartyMon6 ; d378
-OTPartyMonsEnd::
+wOTPartyMons::
+wOTPartyMon1:: party_struct wOTPartyMon1 ; d288
+wOTPartyMon2:: party_struct wOTPartyMon2 ; d2b8
+wOTPartyMon3:: party_struct wOTPartyMon3 ; d2e8
+wOTPartyMon4:: party_struct wOTPartyMon4 ; d318
+wOTPartyMon5:: party_struct wOTPartyMon5 ; d348
+wOTPartyMon6:: party_struct wOTPartyMon6 ; d378
+wOTPartyMonsEnd::
-OTPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d3a8
-OTPartyMonNicknames:: ds MON_NAME_LENGTH * PARTY_LENGTH ; d3ea
-OTPartyDataEnd::
+wOTPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d3a8
+wOTPartyMonNicknames:: ds MON_NAME_LENGTH * PARTY_LENGTH ; d3ea
+wOTPartyDataEnd::
ds 4
NEXTU ; d288
@@ -2242,18 +2242,18 @@
wBattleAction:: db ; d430
wd431:: db
-MapStatus:: db ; d432
-MapEventStatus:: ; d433
+wMapStatus:: db ; d432
+wMapEventStatus:: ; d433
; 0: do map events
; 1: do background events
db
-ScriptFlags:: ; d434
+wScriptFlags:: ; d434
; bit 3: priority jump
db
-ScriptFlags2:: ; d435
+wScriptFlags2:: ; d435
db
-ScriptFlags3:: ; d436
+wScriptFlags3:: ; d436
; bit 0: count steps
; bit 1: coord events
; bit 2: warps and connections
@@ -2261,15 +2261,15 @@
; bit 5: unknown
db
-ScriptMode:: db ; d437
-ScriptRunning:: db ; d438
-ScriptBank:: db ; d439
-ScriptPos:: dw ; d43a
+wScriptMode:: db ; d437
+wScriptRunning:: db ; d438
+wScriptBank:: db ; d439
+wScriptPos:: dw ; d43a
wScriptStackSize:: db
wScriptStack:: ds 3 * 5
ds 1
-ScriptDelay:: db ; d44d
+wScriptDelay:: db ; d44d
wPriorityScriptBank::
wScriptTextBank::
@@ -2284,7 +2284,7 @@
wBattleScriptFlags:: dw ; d459
wPlayerSpriteSetupFlags:: ; d45b
-; bit 7: if set, cancel PlayerAction
+; bit 7: if set, cancel wPlayerAction
; bit 5: if set, set facing according to bits 0-1
; bits 0-1: direction facing
db
@@ -2319,37 +2319,37 @@
wGameData::
wPlayerData::
-PlayerID:: ; d47b
+wPlayerID:: ; d47b
dw
-PlayerName:: ds NAME_LENGTH ; d47d
-MomsName:: ds NAME_LENGTH ; d488
-RivalName:: ds NAME_LENGTH ; d493
-RedsName:: ds NAME_LENGTH ; d49e
-GreensName:: ds NAME_LENGTH ; d4a9
+wPlayerName:: ds NAME_LENGTH ; d47d
+wMomsName:: ds NAME_LENGTH ; d488
+wRivalName:: ds NAME_LENGTH ; d493
+wRedsName:: ds NAME_LENGTH ; d49e
+wGreensName:: ds NAME_LENGTH ; d4a9
wSavedAtLeastOnce:: db
wSpawnAfterChampion:: db
; init time set at newgame
-StartDay:: db ; d4b6
-StartHour:: db ; d4b7
-StartMinute:: db ; d4b8
-StartSecond:: db ; d4b9
+wStartDay:: db ; d4b6
+wStartHour:: db ; d4b7
+wStartMinute:: db ; d4b8
+wStartSecond:: db ; d4b9
wRTC:: ds 8 ; d4ba
wDST:: db ; d4c2
-GameTime::
-GameTimeCap:: db ; d4c3
-GameTimeHours:: dw ; d4c4
-GameTimeMinutes:: db ; d4c6
-GameTimeSeconds:: db ; d4c7
-GameTimeFrames:: db ; d4c8
+wGameTime::
+wGameTimeCap:: db ; d4c3
+wGameTimeHours:: dw ; d4c4
+wGameTimeMinutes:: db ; d4c6
+wGameTimeSeconds:: db ; d4c7
+wGameTimeFrames:: db ; d4c8
ds 2
-CurDay:: db ; d4cb
+wCurDay:: db ; d4cb
ds 1
@@ -2359,56 +2359,56 @@
wFollowerMovementQueueLength:: db
wFollowMovementQueue:: ds 5
-ObjectStructs:: ; d4d6
- object_struct Player
- object_struct Object1
- object_struct Object2
- object_struct Object3
- object_struct Object4
- object_struct Object5
- object_struct Object6
- object_struct Object7
- object_struct Object8
- object_struct Object9
- object_struct Object10
- object_struct Object11
- object_struct Object12
-ObjectStructsEnd:: ; d6de
+wObjectStructs:: ; d4d6
+ object_struct wPlayer
+ object_struct wObject1
+ object_struct wObject2
+ object_struct wObject3
+ object_struct wObject4
+ object_struct wObject5
+ object_struct wObject6
+ object_struct wObject7
+ object_struct wObject8
+ object_struct wObject9
+ object_struct wObject10
+ object_struct wObject11
+ object_struct wObject12
+wObjectStructsEnd:: ; d6de
wCmdQueue:: ds CMDQUEUE_CAPACITY * CMDQUEUE_ENTRY_SIZE
ds 40
-MapObjects:: ; d71e
- map_object Player
- map_object Map1
- map_object Map2
- map_object Map3
- map_object Map4
- map_object Map5
- map_object Map6
- map_object Map7
- map_object Map8
- map_object Map9
- map_object Map10
- map_object Map11
- map_object Map12
- map_object Map13
- map_object Map14
- map_object Map15
-MapObjectsEnd::
+wMapObjects:: ; d71e
+ map_object wPlayer
+ map_object wMap1
+ map_object wMap2
+ map_object wMap3
+ map_object wMap4
+ map_object wMap5
+ map_object wMap6
+ map_object wMap7
+ map_object wMap8
+ map_object wMap9
+ map_object wMap10
+ map_object wMap11
+ map_object wMap12
+ map_object wMap13
+ map_object wMap14
+ map_object wMap15
+wMapObjectsEnd::
wObjectMasks:: ds NUM_OBJECTS ; d81e
-VariableSprites:: ds 16; d82e
+wVariableSprites:: ds 16; d82e
wEnteredMapFromContinue:: db ; d83e
ds 2
-TimeOfDayPal:: db ; d841
+wTimeOfDayPal:: db ; d841
ds 4
wTimeOfDayPalFlags:: db ; d846
wTimeOfDayPalset:: db
-CurTimeOfDay:: db ; d848
+wCurTimeOfDay:: db ; d848
ds 1
@@ -2435,34 +2435,34 @@
; 7 - rockets in mahogany
db
-Money:: ds 3 ; d84e
+wMoney:: ds 3 ; d84e
wMomsMoney:: ds 3 ; d851
wMomSavingMoney:: db ; d854
-Coins:: dw ; d855
+wCoins:: dw ; d855
-Badges::
+wBadges::
wJohtoBadges:: flag_array NUM_JOHTO_BADGES ; d857
wKantoBadges:: flag_array NUM_KANTO_BADGES ; d858
-TMsHMs:: ds NUM_TMS + NUM_HMS ; d859
-TMsHMsEnd::
+wTMsHMs:: ds NUM_TMS + NUM_HMS ; d859
+wTMsHMsEnd::
-NumItems:: db ; d892
-Items:: ds MAX_ITEMS * 2 + 1 ; d893
-ItemsEnd::
+wNumItems:: db ; d892
+wItems:: ds MAX_ITEMS * 2 + 1 ; d893
+wItemsEnd::
-NumKeyItems:: db ; d8bc
-KeyItems:: ds MAX_KEY_ITEMS + 1 ; d8bd
-KeyItemsEnd::
+wNumKeyItems:: db ; d8bc
+wKeyItems:: ds MAX_KEY_ITEMS + 1 ; d8bd
+wKeyItemsEnd::
-NumBalls:: db ; d8d7
-Balls:: ds MAX_BALLS * 2 + 1 ; d8d8
-BallsEnd::
+wNumBalls:: db ; d8d7
+wBalls:: ds MAX_BALLS * 2 + 1 ; d8d8
+wBallsEnd::
-PCItems:: ds MAX_PC_ITEMS * 2 + 1 ; d8f1
-PCItemsEnd::
+wPCItems:: ds MAX_PC_ITEMS * 2 + 1 ; d8f1
+wPCItemsEnd::
ds 1
@@ -2476,17 +2476,17 @@
wRadioTuningKnob:: db
wLastDexMode:: db
ds 1
-WhichRegisteredItem:: db ; d95b
-RegisteredItem:: db ; d95c
+wWhichRegisteredItem:: db ; d95b
+wRegisteredItem:: db ; d95c
-PlayerState:: db ; d95d
+wPlayerState:: db ; d95d
wHallOfFameCount:: dw
wTradeFlags:: flag_array PARTY_LENGTH ; d960
ds 1
-MooMooBerries:: db ; d962
-UndergroundSwitchPositions:: db ; d963
-FarfetchdPosition:: db ; d964
+wMooMooBerries:: db ; d962
+wUndergroundSwitchPositions:: db ; d963
+wFarfetchdPosition:: db ; d964
ds 13
@@ -2606,7 +2606,7 @@
ds 100
-EventFlags:: flag_array NUM_EVENTS ; da72
+wEventFlags:: flag_array NUM_EVENTS ; da72
; db6c
ds 6
@@ -2649,19 +2649,19 @@
ds 2
; Sprite id of each decoration
-Bed:: db ; dc0f
-Carpet:: db ; dc10
-Plant:: db ; dc11
-Poster:: db ; dc12
-Console:: db ; dc13
-LeftOrnament:: db ; dc14
-RightOrnament:: db ; dc15
-BigDoll:: db ; dc16
+wDecoBed:: db ; dc0f
+wDecoCarpet:: db ; dc10
+wDecoPlant:: db ; dc11
+wDecoPoster:: db ; dc12
+wDecoConsole:: db ; dc13
+wDecoLeftOrnament:: db ; dc14
+wDecoRightOrnament:: db ; dc15
+wDecoBigDoll:: db ; dc16
; Items bought from Mom
wWhichMomItem:: db ; dc17
wWhichMomItemSet:: db ; dc18
-MomItemTriggerBalance:: ds 3 ; dc19
+wMomItemTriggerBalance:: ds 3 ; dc19
wDailyResetTimer:: dw ; dc1c
wDailyFlags:: db
@@ -2668,10 +2668,10 @@
wWeeklyFlags:: db
wSwarmFlags:: db
ds 2
-wStartDay:: db
+wTimerEventStartDay:: db
ds 3
-FruitTreeFlags:: flag_array NUM_FRUIT_TREES ; dc27
+wFruitTreeFlags:: flag_array NUM_FRUIT_TREES ; dc27
ds 2
@@ -2699,8 +2699,8 @@
wdc5f:: ds 1
wdc60:: ds 19
-StepCount:: db ; dc73
-PoisonStepCount:: db ; dc74
+wStepCount:: db ; dc73
+wPoisonStepCount:: db ; dc74
ds 2
wHappinessStepCount:: db
ds 1
@@ -2733,9 +2733,9 @@
; used on maps like second floor pokécenter, which are reused, so we know which
; map to return to
-BackupWarpNumber:: db ; dcad
-BackupMapGroup:: db ; dcae
-BackupMapNumber:: db ; dcaf
+wBackupWarpNumber:: db ; dcad
+wBackupMapGroup:: db ; dcae
+wBackupMapNumber:: db ; dcaf
ds 3
@@ -2742,11 +2742,11 @@
wLastSpawnMapGroup:: db
wLastSpawnMapNumber:: db
-WarpNumber:: db ; dcb4
-MapGroup:: db ; dcb5 ; map group of current map
-MapNumber:: db ; dcb6 ; map number of current map
-YCoord:: db ; dcb7 ; current y coordinate relative to top-left corner of current map
-XCoord:: db ; dcb8 ; current x coordinate relative to top-left corner of current map
+wWarpNumber:: db ; dcb4
+wMapGroup:: db ; dcb5 ; map group of current map
+wMapNumber:: db ; dcb6 ; map number of current map
+wYCoord:: db ; dcb7 ; current y coordinate relative to top-left corner of current map
+wXCoord:: db ; dcb8 ; current x coordinate relative to top-left corner of current map
wScreenSave:: ds 6 * 5
wCurrMapDataEnd::
@@ -2756,32 +2756,32 @@
wPokemonData::
-PartyCount:: db ; dcd7 ; number of Pokémon in party
-PartySpecies:: ds PARTY_LENGTH ; dcd8 ; species of each Pokémon in party
-PartyEnd:: db ; dcde ; legacy scripts don't check PartyCount
+wPartyCount:: db ; dcd7 ; number of Pokémon in party
+wPartySpecies:: ds PARTY_LENGTH ; dcd8 ; species of each Pokémon in party
+wPartyEnd:: db ; dcde ; legacy scripts don't check wPartyCount
-PartyMons::
-PartyMon1:: party_struct PartyMon1 ; dcdf
-PartyMon2:: party_struct PartyMon2 ; dd0f
-PartyMon3:: party_struct PartyMon3 ; dd3f
-PartyMon4:: party_struct PartyMon4 ; dd6f
-PartyMon5:: party_struct PartyMon5 ; dd9f
-PartyMon6:: party_struct PartyMon6 ; ddcf
+wPartyMons::
+wPartyMon1:: party_struct wPartyMon1 ; dcdf
+wPartyMon2:: party_struct wPartyMon2 ; dd0f
+wPartyMon3:: party_struct wPartyMon3 ; dd3f
+wPartyMon4:: party_struct wPartyMon4 ; dd6f
+wPartyMon5:: party_struct wPartyMon5 ; dd9f
+wPartyMon6:: party_struct wPartyMon6 ; ddcf
-PartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; ddff
+wPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; ddff
-PartyMonNicknames:: ds MON_NAME_LENGTH * PARTY_LENGTH ; de41
-PartyMonNicknamesEnd::
+wPartyMonNicknames:: ds MON_NAME_LENGTH * PARTY_LENGTH ; de41
+wPartyMonNicknamesEnd::
ds 22
-PokedexCaught:: flag_array NUM_POKEMON ; de99
-EndPokedexCaught::
+wPokedexCaught:: flag_array NUM_POKEMON ; de99
+wEndPokedexCaught::
-PokedexSeen:: flag_array NUM_POKEMON ; deb9
-EndPokedexSeen::
+wPokedexSeen:: flag_array NUM_POKEMON ; deb9
+wEndPokedexSeen::
-UnownDex:: ds NUM_UNOWN ; ded9
+wUnownDex:: ds NUM_UNOWN ; ded9
wUnlockedUnowns:: db ; def3
wFirstUnownSeen:: db
@@ -2845,7 +2845,7 @@
SECTION "Pic Animations", WRAMX
-TempTileMap::
+wTempTileMap::
; 20x18 grid of 8x8 tiles
ds SCREEN_WIDTH * SCREEN_HEIGHT ; $168 = 360
@@ -2893,9 +2893,9 @@
w3_d090:: ds $70
w3_d100::
-BT_OTTrainer:: battle_tower_struct BT_OT
+wBT_OTTrainer:: battle_tower_struct wBT_OT
ds $20
-BT_TrainerTextIndex:: db ; d200
+wBT_TrainerTextIndex:: db ; d200
ds 1
w3_d202:: battle_tower_struct w3_d202
w3_d2e2:: battle_tower_struct w3_d2e2
@@ -2943,14 +2943,14 @@
SECTION "GBC Video", WRAMX
; eight 4-color palettes each
-wPals::
+wGBCPalettes::
wBGPals1:: ds 8 palettes ; d000
wOBPals1:: ds 8 palettes ; d040
wBGPals2:: ds 8 palettes ; d080
wOBPals2:: ds 8 palettes ; d0c0
-LYOverrides:: ds SCREEN_HEIGHT_PX ; d100
-LYOverridesEnd:: ; d190
+wLYOverrides:: ds SCREEN_HEIGHT_PX ; d100
+wLYOverridesEnd:: ; d190
ds 1
@@ -2963,8 +2963,8 @@
ds 106
-LYOverridesBackup:: ds SCREEN_HEIGHT_PX ; d200
-LYOverridesBackupEnd::
+wLYOverridesBackup:: ds SCREEN_HEIGHT_PX ; d200
+wLYOverridesBackupEnd::
SECTION "Battle Animations", WRAMX
@@ -2971,36 +2971,36 @@
wBattleAnimTileDict:: ds 10
-ActiveAnimObjects:: ; d30a
-AnimObject01:: battle_anim_struct AnimObject01
-AnimObject02:: battle_anim_struct AnimObject02
-AnimObject03:: battle_anim_struct AnimObject03
-AnimObject04:: battle_anim_struct AnimObject04
-AnimObject05:: battle_anim_struct AnimObject05
-AnimObject06:: battle_anim_struct AnimObject06
-AnimObject07:: battle_anim_struct AnimObject07
-AnimObject08:: battle_anim_struct AnimObject08
-AnimObject09:: battle_anim_struct AnimObject09
-AnimObject10:: battle_anim_struct AnimObject10
-ActiveAnimObjectsEnd:: ; d3aa
+wActiveAnimObjects:: ; d30a
+wAnimObject01:: battle_anim_struct wAnimObject01
+wAnimObject02:: battle_anim_struct wAnimObject02
+wAnimObject03:: battle_anim_struct wAnimObject03
+wAnimObject04:: battle_anim_struct wAnimObject04
+wAnimObject05:: battle_anim_struct wAnimObject05
+wAnimObject06:: battle_anim_struct wAnimObject06
+wAnimObject07:: battle_anim_struct wAnimObject07
+wAnimObject08:: battle_anim_struct wAnimObject08
+wAnimObject09:: battle_anim_struct wAnimObject09
+wAnimObject10:: battle_anim_struct wAnimObject10
+wActiveAnimObjectsEnd:: ; d3aa
-ActiveBGEffects:: ; d3fa
-BGEffect1:: battle_bg_effect BGEffect1
-BGEffect2:: battle_bg_effect BGEffect2
-BGEffect3:: battle_bg_effect BGEffect3
-BGEffect4:: battle_bg_effect BGEffect4
-BGEffect5:: battle_bg_effect BGEffect5
-ActiveBGEffectsEnd::
+wActiveBGEffects:: ; d3fa
+wBGEffect1:: battle_bg_effect wBGEffect1
+wBGEffect2:: battle_bg_effect wBGEffect2
+wBGEffect3:: battle_bg_effect wBGEffect3
+wBGEffect4:: battle_bg_effect wBGEffect4
+wBGEffect5:: battle_bg_effect wBGEffect5
+wActiveBGEffectsEnd::
wNumActiveBattleAnims:: db ; d40e
-BattleAnimFlags:: db ; d40f
-BattleAnimAddress:: dw ; d410
-BattleAnimDuration:: db ; d412
-BattleAnimParent:: dw ; d413
-BattleAnimLoops:: db ; d415
-BattleAnimVar:: db ; d416
-BattleAnimByte:: db ; d417
+wBattleAnimFlags:: db ; d40f
+wBattleAnimAddress:: dw ; d410
+wBattleAnimDuration:: db ; d412
+wBattleAnimParent:: dw ; d413
+wBattleAnimLoops:: db ; d415
+wBattleAnimVar:: db ; d416
+wBattleAnimByte:: db ; d417
wBattleAnimOAMPointerLo:: db ; d418
UNION ; d419