From f2ae74079fc917cbf7e1f640eb8beda0d4740887 Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Tue, 23 Jan 2018 16:45:34 -0500 Subject: [PATCH 1/8] Prefix wram labels with w, part 1. Handle edge cases first. --- audio/engine.asm | 390 ++++++++++---------- constants/audio_constants.asm | 8 +- constants/battle_constants.asm | 2 +- constants/gfx_constants.asm | 2 +- data/common_text/common_text_3.asm | 2 +- engine/battle/ai/redundant.asm | 6 +- engine/battle/ai/scoring.asm | 4 +- engine/battle/core.asm | 66 ++-- engine/battle/effect_commands.asm | 26 +- engine/battle/effect_commands/sandstorm.asm | 4 +- engine/battle/misc.asm | 2 +- engine/battle/start_battle.asm | 2 +- engine/battle_anims/anim_commands.asm | 6 +- engine/battle_anims/core.asm | 2 +- engine/card_flip.asm | 22 +- engine/debug.asm | 2 +- engine/decorations.asm | 58 +-- engine/evolution_animation.asm | 2 +- engine/intro_menu.asm | 8 +- engine/item_effects.asm | 8 +- engine/map_objects.asm | 4 +- engine/menu_2.asm | 4 +- engine/money.asm | 6 +- engine/pokegear.asm | 12 +- engine/routines/loadpushoam.asm | 2 +- engine/scripting.asm | 2 +- engine/slot_machine.asm | 10 +- engine/specials.asm | 2 +- engine/sprites.asm | 10 +- engine/variables.asm | 2 +- home.asm | 4 +- home/audio.asm | 6 +- macros/wram.asm | 2 +- maps/KrissHouse2F.asm | 4 +- mobile/mobile_22.asm | 8 +- mobile/mobile_40.asm | 4 +- mobile/mobile_45.asm | 138 +++---- mobile/mobile_45_sprite_engine.asm | 6 +- mobile/mobile_5b.asm | 2 +- mobile/mobile_5e.asm | 2 +- wram.asm | 52 +-- 41 files changed, 452 insertions(+), 452 deletions(-) diff --git a/audio/engine.asm b/audio/engine.asm index b097648c20a..7aefca7fdcc 100644 --- a/audio/engine.asm +++ b/audio/engine.asm @@ -48,7 +48,7 @@ _MapSetup_Sound_Off:: ; e8000 or d jr nz, .clearchannels ld a, MAX_VOLUME - ld [Volume], a + ld [wVolume], a call MusicOn pop af pop bc @@ -97,15 +97,15 @@ _UpdateSound:: ; e805c xor a ld [CurChannel], a ; just ld [SoundOutput], a ; off - ld bc, Channel1 + ld bc, wChannel1 .loop ; is the channel active? - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - 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, Channel1NoteDuration - wChannel1 add hl, bc ld a, [hl] cp $2 ; 1 or 0? @@ -115,14 +115,14 @@ _UpdateSound:: ; e805c .noteover ; reset vibrato delay - ld hl, Channel1VibratoDelay - Channel1 + ld hl, Channel1VibratoDelay - wChannel1 add hl, bc ld a, [hl] - ld hl, Channel1VibratoDelayCount - Channel1 + ld hl, Channel1VibratoDelayCount - wChannel1 add hl, bc ld [hl], a ; turn vibrato off for now - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc res SOUND_PITCH_WHEEL, [hl] ; get next note @@ -130,7 +130,7 @@ _UpdateSound:: ; e805c .continue_sound_update call ApplyPitchWheel ; duty cycle - ld hl, Channel1DutyCycle - Channel1 + ld hl, Channel1DutyCycle - wChannel1 add hl, bc ld a, [hli] ld [wCurTrackDuty], a @@ -168,7 +168,7 @@ _UpdateSound:: ; e805c bit SOUND_CHANNEL_ON, [hl] jr z, .next .restnote - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc set NOTE_REST, [hl] ; Rest .next @@ -176,26 +176,26 @@ _UpdateSound:: ; e805c ld a, [CurChannel] cp CHAN5 jr nc, .sfx_channel - ld hl, Channel5Flags - Channel1 + ld hl, Channel5Flags - wChannel1 add hl, bc bit SOUND_CHANNEL_ON, [hl] jr nz, .sound_channel_on .sfx_channel call UpdateChannels - ld hl, Channel1Tracks - Channel1 + ld hl, Channel1Tracks - wChannel1 add hl, bc ld a, [SoundOutput] or [hl] ld [SoundOutput], a .sound_channel_on ; clear note flags - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - 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 @@ -209,7 +209,7 @@ _UpdateSound:: ; e805c ; 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] @@ -244,11 +244,11 @@ UpdateChannels: ; e8125 dw .Channel8 .Channel1: - ld a, [Danger] + ld a, [wLowHealthAlarm] bit DANGER_ON_F, a ret nz .Channel5: - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc bit NOTE_UNKN_3, [hl] jr z, .asm_e8159 @@ -317,7 +317,7 @@ UpdateChannels: ; e8125 .Channel2: .Channel6: - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc bit NOTE_REST, [hl] ; rest jr nz, .ch2rest @@ -377,7 +377,7 @@ UpdateChannels: ; e8125 .Channel3: .Channel7: - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc bit NOTE_REST, [hl] ; rest jr nz, .ch3rest @@ -478,7 +478,7 @@ endr .Channel4: .Channel8: - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc bit NOTE_REST, [hl] ; rest jr nz, .ch4rest @@ -536,7 +536,7 @@ _CheckSFX: ; e82e7 ; e8307 PlayDanger: ; e8307 - ld a, [Danger] + ld a, [wLowHealthAlarm] bit DANGER_ON_F, a ret z and $ff ^ (1 << DANGER_ON_F) @@ -574,7 +574,7 @@ PlayDanger: ; e8307 xor a .asm_e833c or 1 << DANGER_ON_F - ld [Danger], a + ld [wLowHealthAlarm], a ; is hw ch1 on? ld a, [SoundOutput] and $11 @@ -631,7 +631,7 @@ FadeMusic: ; e8358 and $3f ld [MusicFadeCount], 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,7 +645,7 @@ FadeMusic: ; e8358 .novolume ; make sure volume is off xor a - ld [Volume], a + ld [wVolume], a ; did we just get on a bike? ld a, [PlayerState] cp PLAYER_BIKE @@ -677,7 +677,7 @@ FadeMusic: ; e8358 ; 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 e, a @@ -710,19 +710,19 @@ FadeMusic: ; e8358 ld d, a swap a or d - ld [Volume], a + ld [wVolume], a ret ; e83d1 LoadNote: ; e83d1 ; wait for pitch wheel to finish - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc bit SOUND_PITCH_WHEEL, [hl] ret z ; get note duration - ld hl, Channel1NoteDuration - Channel1 + ld hl, Channel1NoteDuration - wChannel1 add hl, bc ld a, [hl] ld hl, wCurNoteDuration @@ -732,13 +732,13 @@ LoadNote: ; e83d1 .ok ld [hl], a ; get frequency - ld hl, Channel1Frequency - Channel1 + ld hl, Channel1Frequency - wChannel1 add hl, bc ld e, [hl] inc hl ld d, [hl] ; get direction of pitch wheel - ld hl, Channel1PitchWheelTarget - Channel1 + ld hl, Channel1PitchWheelTarget - wChannel1 add hl, bc ld a, e sub [hl] @@ -746,21 +746,21 @@ LoadNote: ; e83d1 ld a, d sbc 0 ld d, a - ld hl, Channel1PitchWheelTarget + 1 - Channel1 + ld hl, Channel1PitchWheelTarget + 1 - wChannel1 add hl, bc sub [hl] jr nc, .greater_than - ld hl, Channel1Flags3 - Channel1 + ld hl, Channel1Flags3 - wChannel1 add hl, bc set SOUND_PITCH_WHEEL_DIR, [hl] ; get frequency - ld hl, Channel1Frequency - Channel1 + ld hl, Channel1Frequency - wChannel1 add hl, bc ld e, [hl] inc hl ld d, [hl] ; ???? - ld hl, Channel1PitchWheelTarget - Channel1 + ld hl, Channel1PitchWheelTarget - wChannel1 add hl, bc ld a, [hl] sub e @@ -769,7 +769,7 @@ LoadNote: ; e83d1 sbc 0 ld d, a ; ???? - ld hl, Channel1PitchWheelTarget + 1 - Channel1 + ld hl, Channel1PitchWheelTarget + 1 - wChannel1 add hl, bc ld a, [hl] sub d @@ -777,17 +777,17 @@ LoadNote: ; e83d1 jr .resume .greater_than - ld hl, Channel1Flags3 - Channel1 + ld hl, Channel1Flags3 - wChannel1 add hl, bc res SOUND_PITCH_WHEEL_DIR, [hl] ; get frequency - ld hl, Channel1Frequency - Channel1 + ld hl, Channel1Frequency - wChannel1 add hl, bc ld e, [hl] inc hl ld d, [hl] ; get distance from pitch wheel target - ld hl, Channel1PitchWheelTarget - Channel1 + ld hl, Channel1PitchWheelTarget - wChannel1 add hl, bc ld a, e sub [hl] @@ -795,7 +795,7 @@ LoadNote: ; e83d1 ld a, d sbc 0 ld d, a - ld hl, Channel1PitchWheelTarget + 1 - Channel1 + ld hl, Channel1PitchWheelTarget + 1 - wChannel1 add hl, bc sub [hl] ld d, a @@ -823,13 +823,13 @@ LoadNote: ; e83d1 add [hl] ld d, b ; quotient pop bc - ld hl, Channel1PitchWheelAmount - Channel1 + ld hl, Channel1PitchWheelAmount - wChannel1 add hl, bc ld [hl], d ; quotient - ld hl, Channel1PitchWheelAmountFraction - Channel1 + ld hl, Channel1PitchWheelAmountFraction - wChannel1 add hl, bc ld [hl], a ; remainder - ld hl, Channel1Field25 - Channel1 + ld hl, Channel1Field25 - wChannel1 add hl, bc xor a ld [hl], a @@ -839,11 +839,11 @@ LoadNote: ; e83d1 HandleTrackVibrato: ; e8466 ; handle duty, cry pitch, and vibrato - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc bit SOUND_DUTY, [hl] ; duty jr z, .next - ld hl, Channel1SFXDutyLoop - Channel1 + ld hl, Channel1SFXDutyLoop - wChannel1 add hl, bc ld a, [hl] rlca @@ -851,15 +851,15 @@ HandleTrackVibrato: ; e8466 ld [hl], a and $c0 ld [wCurTrackDuty], a - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc set NOTE_DUTY_OVERRIDE, [hl] .next - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc bit SOUND_CRY_PITCH, [hl] jr z, .vibrato - ld hl, Channel1CryPitch - Channel1 + ld hl, Channel1CryPitch - wChannel1 add hl, bc ld e, [hl] inc hl @@ -877,19 +877,19 @@ HandleTrackVibrato: ; e8466 ld [hl], d .vibrato ; is vibrato on? - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - 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, Channel1VibratoDelayCount - wChannel1 add hl, bc ld a, [hl] and a jr nz, .subexit ; is the extent nonzero? - ld hl, Channel1VibratoExtent - Channel1 + ld hl, Channel1VibratoExtent - wChannel1 add hl, bc ld a, [hl] and a @@ -897,7 +897,7 @@ HandleTrackVibrato: ; e8466 ; save it for later ld d, a ; is it time to toggle vibrato up/down? - ld hl, Channel1VibratoRate - Channel1 + ld hl, Channel1VibratoRate - wChannel1 add hl, bc ld a, [hl] and $f ; count @@ -916,7 +916,7 @@ HandleTrackVibrato: ; e8466 ld a, [wCurTrackFrequency] ld e, a ; toggle vibrato up/down - ld hl, Channel1Flags3 - Channel1 + ld hl, Channel1Flags3 - wChannel1 add hl, bc bit SOUND_VIBRATO_DIR, [hl] ; vibrato up/down jr z, .down @@ -948,7 +948,7 @@ HandleTrackVibrato: ; e8466 .no_carry ld [wCurTrackFrequency], a ; - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc set NOTE_VIBRATO_OVERRIDE, [hl] .quit @@ -958,23 +958,23 @@ HandleTrackVibrato: ; e8466 ApplyPitchWheel: ; e84f9 ; quit if pitch wheel inactive - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc bit SOUND_PITCH_WHEEL, [hl] ret z ; de = Frequency - ld hl, Channel1Frequency - Channel1 + ld hl, Channel1Frequency - 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, Channel1Flags3 - wChannel1 add hl, bc bit SOUND_PITCH_WHEEL_DIR, [hl] jr z, .decreasing ; frequency += [Channel*PitchWheelAmount] - ld hl, Channel1PitchWheelAmount - Channel1 + ld hl, Channel1PitchWheelAmount - wChannel1 add hl, bc ld l, [hl] ld h, 0 @@ -983,10 +983,10 @@ ApplyPitchWheel: ; e84f9 ld e, l ; [Channel*Field25] += [Channel*PitchWheelAmountFraction] ; if rollover: Frequency += 1 - ld hl, Channel1PitchWheelAmountFraction - Channel1 + ld hl, Channel1PitchWheelAmountFraction - wChannel1 add hl, bc ld a, [hl] - ld hl, Channel1Field25 - Channel1 + ld hl, Channel1Field25 - wChannel1 add hl, bc add [hl] ld [hl], a @@ -999,13 +999,13 @@ ApplyPitchWheel: ; e84f9 ; 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, Channel1PitchWheelTarget + 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, Channel1PitchWheelTarget - wChannel1 add hl, bc ld a, [hl] cp e @@ -1015,7 +1015,7 @@ ApplyPitchWheel: ; e84f9 .decreasing ; frequency -= [Channel*PitchWheelAmount] ld a, e - ld hl, Channel1PitchWheelAmount - Channel1 + ld hl, Channel1PitchWheelAmount - wChannel1 add hl, bc ld e, [hl] sub e @@ -1025,7 +1025,7 @@ ApplyPitchWheel: ; e84f9 ld d, a ; [Channel*Field25] *= 2 ; if rollover: Frequency -= 1 - ld hl, Channel1PitchWheelAmountFraction - Channel1 + ld hl, Channel1PitchWheelAmountFraction - wChannel1 add hl, bc ld a, [hl] add a @@ -1039,33 +1039,33 @@ ApplyPitchWheel: ; e84f9 ; 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, Channel1PitchWheelTarget + 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, Channel1PitchWheelTarget - wChannel1 add hl, bc ld a, e cp [hl] jr nc, .continue_pitch_wheel .finished_pitch_wheel - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc res SOUND_PITCH_WHEEL, [hl] - ld hl, Channel1Flags3 - Channel1 + ld hl, Channel1Flags3 - wChannel1 add hl, bc res SOUND_PITCH_WHEEL_DIR, [hl] ret .continue_pitch_wheel - ld hl, Channel1Frequency - Channel1 + ld hl, Channel1Frequency - wChannel1 add hl, bc ld [hl], e inc hl ld [hl], d - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc set NOTE_FREQ_OVERRIDE, [hl] set NOTE_DUTY_OVERRIDE, [hl] @@ -1075,7 +1075,7 @@ ApplyPitchWheel: ; e84f9 HandleNoise: ; e858c ; is noise sampling on? - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc bit SOUND_NOISE, [hl] ; noise sampling ret z @@ -1143,7 +1143,7 @@ ReadNoiseSample: ; e85af inc hl ld [hl], d - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc set NOTE_NOISE_SAMPLING, [hl] ret @@ -1168,7 +1168,7 @@ ParseMusic: ; e85e1 .readnote ; CurMusicByte contains current note ; special notes - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc bit SOUND_SFX, [hl] jp nz, ParseSFXOrRest @@ -1187,38 +1187,38 @@ ParseMusic: ; e85e1 and $f jr z, .rest ; pitch 0-> rest ; update pitch - ld hl, Channel1Pitch - Channel1 + ld hl, Channel1Pitch - wChannel1 add hl, bc ld [hl], a ; store pitch in e ld e, a ; store octave in d - ld hl, Channel1Octave - Channel1 + ld hl, Channel1Octave - wChannel1 add hl, bc ld d, [hl] ; update frequency call GetFrequency - ld hl, Channel1Frequency - Channel1 + ld hl, Channel1Frequency - wChannel1 add hl, bc ld [hl], e inc hl ld [hl], d ; ???? - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc set NOTE_NOISE_SAMPLING, [hl] jp LoadNote .rest ; note = rest - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc set NOTE_REST, [hl] ; Rest ret .endchannel ; $ff is reached in music data - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc bit SOUND_SUBROUTINE, [hl] ; in a subroutine? jr nz, .readcommand ; execute @@ -1226,12 +1226,12 @@ ParseMusic: ; e85e1 cp CHAN5 jr nc, .chan_5to8 ; ???? - ld hl, Channel5Flags - Channel1 + ld hl, Channel5Flags - wChannel1 add hl, bc bit SOUND_CHANNEL_ON, [hl] jr nz, .ok .chan_5to8 - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc bit SOUND_REST, [hl] call nz, RestoreVolume @@ -1245,15 +1245,15 @@ ParseMusic: ; e85e1 .ok ; stop playing ; turn channel off - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc res SOUND_CHANNEL_ON, [hl] ; note = rest - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc set NOTE_REST, [hl] ; clear music id & bank - ld hl, Channel1MusicID - Channel1 + ld hl, Channel1MusicID - wChannel1 add hl, bc xor a ld [hli], a ; id hi @@ -1276,7 +1276,7 @@ RestoreVolume: ; e8679 ld [hli], a ld [hl], a ld a, [LastVolume] - ld [Volume], a + ld [wVolume], a xor a ld [LastVolume], a ld [SFXPriority], a @@ -1286,7 +1286,7 @@ RestoreVolume: ; e8679 ParseSFXOrRest: ; e8698 ; turn noise sampling on - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc set NOTE_NOISE_SAMPLING, [hl] ; noise sample ; update note duration @@ -1294,12 +1294,12 @@ ParseSFXOrRest: ; e8698 call SetNoteDuration ; top nybble doesnt matter? ; update intensity from next param call GetMusicByte - ld hl, Channel1Intensity - Channel1 + ld hl, Channel1Intensity - wChannel1 add hl, bc ld [hl], a ; update lo frequency from next param call GetMusicByte - ld hl, Channel1FrequencyLo - Channel1 + ld hl, Channel1FrequencyLo - wChannel1 add hl, bc ld [hl], a ; are we on the last channel? (noise sampling) @@ -1309,7 +1309,7 @@ ParseSFXOrRest: ; e8698 ret z ; update hi frequency from next param call GetMusicByte - ld hl, Channel1FrequencyHi - Channel1 + ld hl, Channel1FrequencyHi - wChannel1 add hl, bc ld [hl], a ret @@ -1462,16 +1462,16 @@ Music_EndChannel: ; e8781 ; end music stream ; return to caller of the subroutine ; reset subroutine flag - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc res SOUND_SUBROUTINE, [hl] ; copy LastMusicAddress to MusicAddress - ld hl, Channel1LastMusicAddress - Channel1 + ld hl, Channel1LastMusicAddress - wChannel1 add hl, bc ld e, [hl] inc hl ld d, [hl] - ld hl, Channel1MusicAddress - Channel1 + ld hl, Channel1MusicAddress - wChannel1 add hl, bc ld [hl], e inc hl @@ -1490,25 +1490,25 @@ Music_CallChannel: ; e8796 ld d, a push de ; copy MusicAddress to LastMusicAddress - ld hl, Channel1MusicAddress - Channel1 + ld hl, Channel1MusicAddress - wChannel1 add hl, bc ld e, [hl] inc hl ld d, [hl] - ld hl, Channel1LastMusicAddress - Channel1 + ld hl, Channel1LastMusicAddress - wChannel1 add hl, bc ld [hl], e inc hl ld [hl], d ; load pointer into MusicAddress pop de - ld hl, Channel1MusicAddress - Channel1 + ld hl, Channel1MusicAddress - wChannel1 add hl, bc ld [hl], e inc hl ld [hl], d ; set subroutine flag - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc set SOUND_SUBROUTINE, [hl] ret @@ -1523,7 +1523,7 @@ Music_JumpChannel: ; e87bc ld e, a call GetMusicByte ld d, a - ld hl, Channel1MusicAddress - Channel1 + ld hl, Channel1MusicAddress - wChannel1 add hl, bc ld [hl], e inc hl @@ -1542,7 +1542,7 @@ Music_LoopChannel: ; e87cc ; get loop count call GetMusicByte - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc bit SOUND_LOOPING, [hl] ; has the loop been initiated? jr nz, .checkloop @@ -1551,11 +1551,11 @@ Music_LoopChannel: ; e87cc ; initiate loop dec a set SOUND_LOOPING, [hl] ; set loop flag - ld hl, Channel1LoopCount - Channel1 + ld hl, Channel1LoopCount - wChannel1 add hl, bc ld [hl], a ; store loop counter .checkloop - ld hl, Channel1LoopCount - Channel1 + ld hl, Channel1LoopCount - wChannel1 add hl, bc ld a, [hl] and a ; are we done? @@ -1568,7 +1568,7 @@ Music_LoopChannel: ; e87cc call GetMusicByte ld d, a ; load new pointer into MusicAddress - ld hl, Channel1MusicAddress - Channel1 + ld hl, Channel1MusicAddress - wChannel1 add hl, bc ld [hl], e inc hl @@ -1577,11 +1577,11 @@ Music_LoopChannel: ; e87cc .endloop ; reset loop flag - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc res SOUND_LOOPING, [hl] ; skip to next command - ld hl, Channel1MusicAddress - Channel1 + ld hl, Channel1MusicAddress - wChannel1 add hl, bc ld e, [hl] inc hl @@ -1603,7 +1603,7 @@ Music_SetCondition: ; e880e ; set condition call GetMusicByte - ld hl, Channel1Condition - Channel1 + ld hl, Channel1Condition - wChannel1 add hl, bc ld [hl], a ret @@ -1621,13 +1621,13 @@ Music_JumpIf: ; e8817 ; a = condition call GetMusicByte ; if existing condition matches, jump to new address - ld hl, Channel1Condition - Channel1 + ld hl, Channel1Condition - wChannel1 add hl, bc cp [hl] jr z, .jump ; skip to next command ; get address - ld hl, Channel1MusicAddress - Channel1 + ld hl, Channel1MusicAddress - wChannel1 add hl, bc ld e, [hl] inc hl @@ -1649,7 +1649,7 @@ Music_JumpIf: ; e8817 call GetMusicByte ld d, a ; update pointer in MusicAddress - ld hl, Channel1MusicAddress - Channel1 + ld hl, Channel1MusicAddress - wChannel1 add hl, bc ld [hl], e inc hl @@ -1680,7 +1680,7 @@ MusicEE; e883e jr nz, .jump ; skip to next command ; get address - ld hl, Channel1MusicAddress - Channel1 + ld hl, Channel1MusicAddress - wChannel1 add hl, bc ld e, [hl] inc hl @@ -1703,7 +1703,7 @@ MusicEE; e883e call GetMusicByte ld d, a ; update address - ld hl, Channel1MusicAddress - Channel1 + ld hl, Channel1MusicAddress - wChannel1 add hl, bc ld [hl], e inc hl @@ -1726,10 +1726,10 @@ MusicE2: ; e8873 ; seems to have been dummied out ; params: 1 call GetMusicByte - ld hl, Channel1Field2c - Channel1 + ld hl, Channel1Field2c - wChannel1 add hl, bc ld [hl], a - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc set SOUND_UNKN_0B, [hl] ret @@ -1746,28 +1746,28 @@ Music_Vibrato: ; e8882 ; z: rate (# frames per cycle) ; set vibrato flag? - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc set SOUND_VIBRATO, [hl] ; start at lower frequency (extent is positive) - ld hl, Channel1Flags3 - Channel1 + ld hl, Channel1Flags3 - wChannel1 add hl, bc res SOUND_VIBRATO_DIR, [hl] ; get delay call GetMusicByte ; update delay - ld hl, Channel1VibratoDelay - Channel1 + ld hl, Channel1VibratoDelay - wChannel1 add hl, bc ld [hl], a ; update delay count - ld hl, Channel1VibratoDelayCount - Channel1 + ld hl, Channel1VibratoDelayCount - wChannel1 add hl, bc ld [hl], a ; update extent ; 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, Channel1VibratoExtent - wChannel1 add hl, bc ld d, a ; get top nybble @@ -1780,7 +1780,7 @@ Music_Vibrato: ; e8882 or e ld [hl], a ; update rate - ld hl, Channel1VibratoRate - Channel1 + ld hl, Channel1VibratoRate - wChannel1 add hl, bc ; get bottom nybble ld a, d @@ -1813,13 +1813,13 @@ Music_SlidePitchTo: ; e88bd and $f ld d, a call GetFrequency - ld hl, Channel1PitchWheelTarget - Channel1 + ld hl, Channel1PitchWheelTarget - wChannel1 add hl, bc ld [hl], e - ld hl, Channel1PitchWheelTarget + 1 - Channel1 + ld hl, Channel1PitchWheelTarget + 1 - wChannel1 add hl, bc ld [hl], d - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc set SOUND_PITCH_WHEEL, [hl] ret @@ -1829,10 +1829,10 @@ Music_SlidePitchTo: ; e88bd Music_Tone: ; e88e4 ; tone ; params: 1 (dw) - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc set SOUND_CRY_PITCH, [hl] - ld hl, Channel1CryPitch + 1 - Channel1 + ld hl, Channel1CryPitch + 1 - wChannel1 add hl, bc call GetMusicByte ld [hld], a @@ -1845,11 +1845,11 @@ Music_Tone: ; e88e4 MusicE7: ; e88f7 ; unused ; params: 1 - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc set SOUND_UNKN_0E, [hl] call GetMusicByte - ld hl, Channel1Field29 - Channel1 + ld hl, Channel1Field29 - wChannel1 add hl, bc ld [hl], a ret @@ -1859,19 +1859,19 @@ MusicE7: ; e88f7 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, Channel1Flags2 - wChannel1 add hl, bc set SOUND_DUTY, [hl] ; duty cycle ; sound duty sequence call GetMusicByte rrca rrca - ld hl, Channel1SFXDutyLoop - Channel1 + ld hl, Channel1SFXDutyLoop - wChannel1 add hl, bc ld [hl], a ; update duty cycle and $c0 ; only uses top 2 bits - ld hl, Channel1DutyCycle - Channel1 + ld hl, Channel1DutyCycle - wChannel1 add hl, bc ld [hl], a ret @@ -1881,11 +1881,11 @@ Music_SoundDuty: ; e8906 MusicE8: ; e891e ; unused ; params: 1 - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc set SOUND_UNKN_0D, [hl] call GetMusicByte - ld hl, Channel1Field2a - Channel1 + ld hl, Channel1Field2a - wChannel1 add hl, bc ld [hl], a ret @@ -1895,7 +1895,7 @@ MusicE8: ; e891e Music_ToggleSFX: ; e892d ; toggle something ; params: none - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc bit SOUND_SFX, [hl] jr z, .on @@ -1915,7 +1915,7 @@ Music_ToggleNoise: ; e893b ; noise on: 1 ; noise off: 0 ; check if noise sampling is on - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc bit SOUND_NOISE, [hl] jr z, .on @@ -1938,7 +1938,7 @@ Music_SFXToggleNoise: ; e894f ; on: 1 ; off: 0 ; check if noise sampling is on - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc bit SOUND_NOISE, [hl] jr z, .on @@ -1962,7 +1962,7 @@ Music_NoteType: ; e8963 ; params: 2 ; note length call GetMusicByte - ld hl, Channel1NoteLength - Channel1 + ld hl, Channel1NoteLength - wChannel1 add hl, bc ld [hl], a ld a, [CurChannel] @@ -1980,7 +1980,7 @@ Music_SoundStatus: ; e8977 ; params: 1 call GetMusicByte ld [SoundInput], a - ld hl, Channel1NoteFlags - Channel1 + ld hl, Channel1NoteFlags - wChannel1 add hl, bc set NOTE_UNKN_3, [hl] ret @@ -1994,7 +1994,7 @@ Music_DutyCycle: ; e8984 rrca rrca and $c0 - ld hl, Channel1DutyCycle - Channel1 + ld hl, Channel1DutyCycle - wChannel1 add hl, bc ld [hl], a ret @@ -2007,7 +2007,7 @@ Music_Intensity: ; e8991 ; hi: pressure ; lo: velocity call GetMusicByte - ld hl, Channel1Intensity - Channel1 + ld hl, Channel1Intensity - wChannel1 add hl, bc ld [hl], a ret @@ -2036,7 +2036,7 @@ Music_Octave3: ; e89a6 Music_Octave2: ; e89a6 Music_Octave1: ; e89a6 ; set octave based on lo nybble of the command - ld hl, Channel1Octave - Channel1 + ld hl, Channel1Octave - wChannel1 add hl, bc ld a, [CurMusicByte] and 7 @@ -2050,7 +2050,7 @@ Music_ForceOctave: ; e89b1 ; this forces all notes up by the starting octave ; params: 1 call GetMusicByte - ld hl, Channel1PitchOffset - Channel1 + ld hl, Channel1PitchOffset - wChannel1 add hl, bc ld [hl], a ret @@ -2075,7 +2075,7 @@ Music_Panning: ; e89c5 ; params: 1 call SetLRTracks call GetMusicByte - ld hl, Channel1Tracks - Channel1 + ld hl, Channel1Tracks - wChannel1 add hl, bc and [hl] ld [hl], a @@ -2096,7 +2096,7 @@ Music_Volume: ; e89d2 ; reload param ld a, [CurMusicByte] ; set volume - ld [Volume], a + ld [wVolume], a ret ; e89e1 @@ -2116,7 +2116,7 @@ Music_TempoRelative: ; e89e1 .negative ld d, -1 .ok - ld hl, Channel1Tempo - Channel1 + ld hl, Channel1Tempo - wChannel1 add hl, bc ld a, [hli] ld h, [hl] @@ -2156,14 +2156,14 @@ Music_RestartChannel: ; e8a08 ; zzyy: pointer to new music data ; update music id - ld hl, Channel1MusicID - Channel1 + ld hl, Channel1MusicID - wChannel1 add hl, bc ld a, [hli] ld [MusicID], a ld a, [hl] ld [MusicID + 1], a ; update music bank - ld hl, Channel1MusicBank - Channel1 + ld hl, Channel1MusicBank - wChannel1 add hl, bc ld a, [hl] ld [MusicBank], a @@ -2205,20 +2205,20 @@ GetMusicByte: ; e8a3e push hl push de ; load address into de - ld hl, Channel1MusicAddress - Channel1 + ld hl, Channel1MusicAddress - wChannel1 add hl, bc ld a, [hli] ld e, a ld d, [hl] ; load bank into a - ld hl, Channel1MusicBank - Channel1 + ld hl, Channel1MusicBank - wChannel1 add hl, bc ld a, [hl] ; get byte call _LoadMusicByte ; load data into CurMusicByte inc de ; advance to next byte for next time this is called ; update channeldata address - ld hl, Channel1MusicAddress - Channel1 + ld hl, Channel1MusicAddress - wChannel1 add hl, bc ld a, e ld [hli], a @@ -2242,7 +2242,7 @@ GetFrequency: ; e8a5d ; get octave ; get starting octave - ld hl, Channel1PitchOffset - Channel1 + ld hl, Channel1PitchOffset - wChannel1 add hl, bc ld a, [hl] swap a ; hi nybble @@ -2251,7 +2251,7 @@ GetFrequency: ; e8a5d add d push af ; we'll use this later ; get starting octave - ld hl, Channel1PitchOffset - Channel1 + ld hl, Channel1PitchOffset - wChannel1 add hl, bc ld a, [hl] and $f ; lo nybble @@ -2293,7 +2293,7 @@ SetNoteDuration: ; e8a8d ld e, a ld d, 0 ; store NoteLength in a - ld hl, Channel1NoteLength - Channel1 + ld hl, Channel1NoteLength - wChannel1 add hl, bc ld a, [hl] ; multiply NoteLength by delay units @@ -2301,13 +2301,13 @@ SetNoteDuration: ; e8a8d call .Multiply ld a, l ; low ; store Tempo in de - ld hl, Channel1Tempo - Channel1 + ld hl, Channel1Tempo - wChannel1 add hl, bc ld e, [hl] inc hl ld d, [hl] ; add ???? to the next result - ld hl, Channel1Field16 - Channel1 + ld hl, Channel1Field16 - wChannel1 add hl, bc ld l, [hl] ; multiply Tempo by last result (NoteLength * LOW(delay)) @@ -2316,11 +2316,11 @@ SetNoteDuration: ; e8a8d ld e, l ld d, h ; store result in ???? - ld hl, Channel1Field16 - Channel1 + ld hl, Channel1Field16 - wChannel1 add hl, bc ld [hl], e ; store result in NoteDuration - ld hl, Channel1NoteDuration - Channel1 + ld hl, Channel1NoteDuration - wChannel1 add hl, bc ld [hl], d ret @@ -2356,24 +2356,24 @@ SetGlobalTempo: ; e8ac7 ld a, [CurChannel] 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,14 +2385,14 @@ Tempo: ; e8b03 ; input: ; de: note length ; update Tempo - ld hl, Channel1Tempo - Channel1 + ld hl, Channel1Tempo - wChannel1 add hl, bc ld [hl], e inc hl ld [hl], d ; clear ???? xor a - ld hl, Channel1Field16 - Channel1 + ld hl, Channel1Field16 - wChannel1 add hl, bc ld [hl], a ret @@ -2401,7 +2401,7 @@ Tempo: ; e8b03 StartChannel: ; e8b11 call SetLRTracks - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc set SOUND_CHANNEL_ON, [hl] ; turn channel on ret @@ -2422,7 +2422,7 @@ SetLRTracks: ; e8b1b add hl, de ; de = channel 0-3 ld a, [hl] ; load lr tracks into Tracks - ld hl, Channel1Tracks - Channel1 + ld hl, Channel1Tracks - wChannel1 add hl, bc ld [hl], a pop de @@ -2513,15 +2513,15 @@ _PlayCry:: ; e8b79 push af call LoadChannel - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc set SOUND_REST, [hl] - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc set SOUND_CRY_PITCH, [hl] - ld hl, Channel1CryPitch - Channel1 + ld hl, Channel1CryPitch - wChannel1 add hl, bc ld a, [CryPitch] ld [hli], a @@ -2535,7 +2535,7 @@ _PlayCry:: ; e8b79 jr nc, .start ; Tempo is effectively length - ld hl, Channel1Tempo - Channel1 + ld hl, Channel1Tempo - wChannel1 add hl, bc ld a, [CryLength] ld [hli], a @@ -2555,12 +2555,12 @@ _PlayCry:: ; e8b79 jr z, .next ; [Tracks] &= [CryTracks] - ld hl, Channel1Tracks - Channel1 + ld hl, Channel1Tracks - wChannel1 add hl, bc ld a, [hl] ld hl, CryTracks and [hl] - ld hl, Channel1Tracks - Channel1 + ld hl, Channel1Tracks - wChannel1 add hl, bc ld [hl], a @@ -2574,10 +2574,10 @@ _PlayCry:: ; e8b79 and a jr nz, .end - ld a, [Volume] + ld a, [wVolume] ld [LastVolume], a ld a, MAX_VOLUME - ld [Volume], a + ld [wVolume], a .end ld a, 1 ; stop playing music @@ -2674,7 +2674,7 @@ _PlaySFX:: ; e8c04 .startchannels push af call LoadChannel ; bc = current channel - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc set SOUND_SFX, [hl] call StartChannel @@ -2729,7 +2729,7 @@ PlayStereoSFX:: ; e8ca6 push af call LoadChannel - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc set SOUND_SFX, [hl] @@ -2745,11 +2745,11 @@ PlayStereoSFX:: ; e8ca6 ld hl, wStereoPanningMask and [hl] - ld hl, Channel1Tracks - Channel1 + ld hl, Channel1Tracks - wChannel1 add hl, bc ld [hl], a - ld hl, Channel1Field30 - Channel1 + ld hl, Channel1Field30 - wChannel1 add hl, bc ld [hl], a @@ -2760,15 +2760,15 @@ PlayStereoSFX:: ; e8ca6 ; ch3-4 ld a, [wSFXDuration] - ld hl, Channel1Field2e - Channel1 + ld hl, Channel1Field2e - wChannel1 add hl, bc ld [hl], a - ld hl, Channel1Field2f - Channel1 + ld hl, Channel1Field2f - wChannel1 add hl, bc ld [hl], a - ld hl, Channel1Flags2 - Channel1 + ld hl, Channel1Flags2 - wChannel1 add hl, bc set SOUND_UNKN_0F, [hl] @@ -2776,7 +2776,7 @@ PlayStereoSFX:: ; e8ca6 pop de ; turn channel on - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc set SOUND_CHANNEL_ON, [hl] ; on @@ -2808,12 +2808,12 @@ LoadChannel: ; e8d1b ld c, [hl] inc hl ld b, [hl] ; bc = channel pointer - ld hl, Channel1Flags - Channel1 + ld hl, Channel1Flags - wChannel1 add hl, bc res SOUND_CHANNEL_ON, [hl] ; channel off call ChannelInit ; load music pointer - ld hl, Channel1MusicAddress - Channel1 + ld hl, Channel1MusicAddress - wChannel1 add hl, bc call LoadMusicByte ld [hli], a @@ -2822,14 +2822,14 @@ LoadChannel: ; e8d1b ld [hl], a inc de ; load music id - ld hl, Channel1MusicID - Channel1 + ld hl, Channel1MusicID - wChannel1 add hl, bc ld a, [MusicID] ld [hli], a ld a, [MusicID + 1] ld [hl], a ; load music bank - ld hl, Channel1MusicBank - Channel1 + ld hl, Channel1MusicBank - wChannel1 add hl, bc ld a, [MusicBank] ld [hl], a @@ -2845,23 +2845,23 @@ ChannelInit: ; e8d5b push de xor a ; get channel struct location and length - ld hl, Channel1MusicID - Channel1 ; start + ld hl, Channel1MusicID - 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 dec e jr nz, .loop ; set tempo to default ($100) - ld hl, Channel1Tempo - Channel1 + ld hl, Channel1Tempo - wChannel1 add hl, bc xor a ld [hli], a inc a ld [hl], a ; set note length to default ($1) (fast) - ld hl, Channel1NoteLength - Channel1 + ld hl, Channel1NoteLength - wChannel1 add hl, bc ld [hl], a pop de @@ -2920,15 +2920,15 @@ StereoTracks: ; e8fd5 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 diff --git a/constants/audio_constants.asm b/constants/audio_constants.asm index 861c35ee099..020fdd176cb 100755 --- a/constants/audio_constants.asm +++ b/constants/audio_constants.asm @@ -66,23 +66,23 @@ NUM_CHANNELS EQU const_value 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 VOLUME_SO2_LEVEL EQU %01110000 MAX_VOLUME EQU $77 -; SoundInput: +; SoundInput SOUND_INPUT_CH1_F EQU 0 SOUND_INPUT_CH2_F EQU 1 SOUND_INPUT_CH3_F EQU 2 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: +; MusicFade MUSIC_FADE_IN_F EQU 7 diff --git a/constants/battle_constants.asm b/constants/battle_constants.asm index 816625e60ec..0bd719737e8 100644 --- a/constants/battle_constants.asm +++ b/constants/battle_constants.asm @@ -214,7 +214,7 @@ SUBSTATUS_CURLED EQU 0 enum SCREENS_UNUSED enum SCREENS_SPIKES -; Weather values +; values in wBattleWeather const_def const WEATHER_NONE const WEATHER_RAIN diff --git a/constants/gfx_constants.asm b/constants/gfx_constants.asm index 864a4bd50db..6ac7dbba465 100644 --- a/constants/gfx_constants.asm +++ b/constants/gfx_constants.asm @@ -28,4 +28,4 @@ EXP_BAR_LENGTH_PX EQU EXP_BAR_LENGTH * TILE_WIDTH ; pixels 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 diff --git a/data/common_text/common_text_3.asm b/data/common_text/common_text_3.asm index a04432637df..253fda4ac93 100644 --- a/data/common_text/common_text_3.asm +++ b/data/common_text/common_text_3.asm @@ -1288,7 +1288,7 @@ UnknownText_0x1c5c5e:: UnknownText_0x1c5c7b:: text "Coins:" line "@" - deciram Coins, 2, 4 + deciram wCoins, 2, 4 db "@@" Text_RaiseThePPOfWhichMove:: diff --git a/engine/battle/ai/redundant.asm b/engine/battle/ai/redundant.asm index 2e8f7c6df1e..68d7b020397 100755 --- a/engine/battle/ai/redundant.asm +++ b/engine/battle/ai/redundant.asm @@ -135,7 +135,7 @@ AI_Redundant: ; 2c41a ret .Sandstorm: ; 2c4f5 - ld a, [Weather] + ld a, [wBattleWeather] cp WEATHER_SANDSTORM jr z, .Redundant jr .NotRedundant @@ -153,13 +153,13 @@ AI_Redundant: ; 2c41a 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 diff --git a/engine/battle/ai/scoring.asm b/engine/battle/ai/scoring.asm index 73284435a11..2ea87cc825e 100644 --- a/engine/battle/ai/scoring.asm +++ b/engine/battle/ai/scoring.asm @@ -2842,7 +2842,7 @@ AI_Smart_Solarbeam: ; 3920b ; 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_Solarbeam: ; 3920b 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 diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 1a58b3df54b..e8eec98942c 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -4,7 +4,7 @@ DoBattle: ; 3c000 xor a ld [wBattleParticipantsNotFainted], a ld [wBattleParticipantsIncludingFainted], a - ld [wPlayerAction], a + ld [wBattlePlayerAction], a ld [BattleEnded], a inc a ld [wBattleHasJustStarted], a @@ -455,7 +455,7 @@ DetermineMoveOrder: ; 3c314 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 @@ DetermineMoveOrder: ; 3c314 jp .enemy_first .use_move - ld a, [wPlayerAction] + ld a, [wBattlePlayerAction] and a jp nz, .player_first call CompareMovePriority @@ -623,7 +623,7 @@ ParsePlayerAction: ; 3c434 jr .encored .not_encored - ld a, [wPlayerAction] + ld a, [wBattlePlayerAction] cp $2 jr z, .reset_rage and a @@ -920,7 +920,7 @@ Battle_EnemyFirst: ; 3c5fe jp z, HandlePlayerMonFaint call RefreshBattleHuds xor a - ld [wPlayerAction], a + ld [wBattlePlayerAction], a ret ; 3c664 @@ -970,7 +970,7 @@ Battle_PlayerFirst: ; 3c664 jp z, HandleEnemyMonFaint call RefreshBattleHuds xor a - ld [wPlayerAction], a + ld [wBattlePlayerAction], a ret ; 3c6cf @@ -1716,7 +1716,7 @@ HandleScreens: ; 3cb36 ; 3cb9e HandleWeather: ; 3cb9e - ld a, [Weather] + ld a, [wBattleWeather] cp WEATHER_NONE ret z @@ -1727,7 +1727,7 @@ HandleWeather: ; 3cb9e ld hl, .WeatherMessages call .PrintWeatherMessage - ld a, [Weather] + ld a, [wBattleWeather] cp WEATHER_SANDSTORM ret nz @@ -1790,11 +1790,11 @@ HandleWeather: ; 3cb9e 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 @@ -2099,18 +2099,18 @@ HandleEnemyMonFaint: ; 3cd55 jp c, WildFled_EnemyFled_LinkBattleCanceled ld a, $1 - ld [wPlayerAction], a + ld [wBattlePlayerAction], a call HandleEnemySwitch jp z, WildFled_EnemyFled_LinkBattleCanceled jr DoubleSwitch .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 @@ -2140,7 +2140,7 @@ DoubleSwitch: ; 3cdca .done xor a - ld [wPlayerAction], a + ld [wBattlePlayerAction], a ret ; 3ce01 @@ -2173,7 +2173,7 @@ UpdateBattleStateAndExperienceAfterEnemyFaint: ; 3ce01 .wild2 call StopDangerSound ld a, $1 - ld [wDanger], a + ld [wBattleLowHealthAlarm], a .trainer ld hl, BattleMonHP @@ -2293,7 +2293,7 @@ IsAnyMonHoldingExpShare: ; 3ceaa StopDangerSound: ; 3ceec xor a - ld [Danger], a + ld [wLowHealthAlarm], a ret ; 3cef1 @@ -2394,7 +2394,7 @@ EnemyPartyMonEntrance: ; 3cf78 call SpikesDamage xor a ld [wEnemyMoveStruct + MOVE_ANIM], a - ld [wPlayerAction], a + ld [wBattlePlayerAction], a inc a ret ; 3cfa4 @@ -2403,7 +2403,7 @@ WinTrainerBattle: ; 3cfa4 ; Player won the battle call StopDangerSound ld a, $1 - ld [wDanger], a + ld [wBattleLowHealthAlarm], a ld [BattleEnded], a ld a, [wLinkMode] and a @@ -2705,7 +2705,7 @@ HandlePlayerMonFaint: ; 3d14e and a ret nz ld a, $1 - ld [wPlayerAction], a + ld [wBattlePlayerAction], a call HandleEnemySwitch jp z, WildFled_EnemyFled_LinkBattleCanceled jp DoubleSwitch @@ -2720,7 +2720,7 @@ PlayerMonFaintHappinessMod: ; 3d1aa ld hl, EnemySubStatus3 res SUBSTATUS_IN_LOOP, [hl] xor a - ld [Danger], a + ld [wLowHealthAlarm], a ld hl, PlayerDamageTaken ld [hli], a ld [hl], a @@ -2788,12 +2788,12 @@ ForcePlayerMonChoice: ; 3d227 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 @@ -3229,7 +3229,7 @@ EnemySwitch: ; 3d4e1 xor a ld [wBattleParticipantsNotFainted], a ld [wBattleParticipantsIncludingFainted], a - ld [wPlayerAction], a + ld [wBattlePlayerAction], a inc a ld [wEnemyIsSwitching], a call LoadTileMapToTempTileMap @@ -3883,7 +3883,7 @@ TryToRunAwayFromBattle: ; 3d8b3 cp b jr nc, .can_escape ld a, $1 - ld [wPlayerAction], a + ld [wBattlePlayerAction], a ld hl, BattleText_CantEscape2 jr .print_inescapable_text @@ -3909,7 +3909,7 @@ TryToRunAwayFromBattle: ; 3d8b3 jr z, .fled call LoadTileMapToTempTileMap xor a - ld [wPlayerAction], a + ld [wBattlePlayerAction], a ld a, $f ld [CurMoveNum], a xor a @@ -4769,7 +4769,7 @@ CheckDanger: ; 3df9e ld a, [hli] or [hl] jr z, .no_danger - ld a, [wDanger] + ld a, [wBattleLowHealthAlarm] and a jr nz, .done ld a, [PlayerHPPal] @@ -4777,12 +4777,12 @@ CheckDanger: ; 3df9e 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 @@ -5116,7 +5116,7 @@ BattleMenu_Pack: ; 3e1c7 jr z, .contest farcall BattlePack - ld a, [wPlayerAction] + ld a, [wBattlePlayerAction] and a jr z, .didnt_use_item jr .got_item @@ -5329,7 +5329,7 @@ TryPlayerSwitch: ; 3e358 ld a, [CurBattleMon] ld [LastPlayerMon], a ld a, $2 - ld [wPlayerAction], a + ld [wBattlePlayerAction], a call ClearPalettes call DelayFrame call ClearSprites @@ -5464,7 +5464,7 @@ BattleMenu_Run: ; 3e489 ld a, $0 ld [wFailedToFlee], a ret c - ld a, [wPlayerAction] + ld a, [wBattlePlayerAction] and a ret nz jp BattleMenu @@ -5955,7 +5955,7 @@ ParseEnemyAction: ; 3e7c1 jr z, .not_linked call EmptyBattleTextBox call LoadTileMapToTempTileMap - ld a, [wPlayerAction] + ld a, [wBattlePlayerAction] and a call z, LinkBattleSendReceiveAction call Call_LoadTempTileMapToTileMap @@ -8560,7 +8560,7 @@ ExitBattle: ; 3f69e CleanUpBattleRAM: ; 3f6d0 call BattleEnd_HandleRoamMons xor a - ld [Danger], a + ld [wLowHealthAlarm], a ld [wBattleMode], a ld [BattleType], a ld [AttackMissed], a diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index c1bc3752aea..b07f9df210b 100644 --- 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 @@ -1908,7 +1908,7 @@ BattleCommand_CheckHit: ; 34d32 cp EFFECT_THUNDER ret nz - ld a, [Weather] + ld a, [wBattleWeather] cp WEATHER_RAIN ret @@ -5394,7 +5394,7 @@ BattleCommand_FreezeTarget: ; 36102 ld a, [TypeModifier] and $7f ret z - ld a, [Weather] + ld a, [wBattleWeather] cp WEATHER_SUN ret z call CheckMoveTypeMatchesTarget ; Don't freeze an Ice-type @@ -9046,7 +9046,7 @@ BatonPass_LinkPlayerSwitch: ; 37a67 ret z ld a, 1 - ld [wPlayerAction], a + ld [wBattlePlayerAction], a call LoadStandardMenuDataHeader ld hl, LinkBattleSendReceiveAction @@ -9054,7 +9054,7 @@ BatonPass_LinkPlayerSwitch: ; 37a67 call CloseWindow xor a - ld [wPlayerAction], a + ld [wBattlePlayerAction], a ret ; 37a82 @@ -9310,15 +9310,15 @@ BattleCommand_TimeBasedHealContinue: ; 37b7e ; Don't factor in time of day in link battles. ld a, [wLinkMode] and a - jr nz, .Weather + jr nz, .checkWeather ld a, [TimeOfDay] cp b - jr z, .Weather + jr z, .checkWeather dec c ; double -.Weather: - ld a, [Weather] +.checkWeather: + ld a, [wBattleWeather] and a jr z, .Heal @@ -9384,7 +9384,7 @@ BattleCommand_HiddenPower: ; 37be8 BattleCommand_StartRain: ; 37bf4 ; startrain ld a, WEATHER_RAIN - ld [Weather], a + ld [wBattleWeather], a ld a, 5 ld [WeatherCount], a call AnimateCurrentMove @@ -9397,7 +9397,7 @@ BattleCommand_StartRain: ; 37bf4 BattleCommand_StartSun: ; 37c07 ; startsun ld a, WEATHER_SUN - ld [Weather], a + ld [wBattleWeather], a ld a, 5 ld [WeatherCount], a call AnimateCurrentMove @@ -9588,7 +9588,7 @@ BattleCommand_DoubleMinimizeDamage: ; 37ce6 BattleCommand_SkipSunCharge: ; 37d02 ; mimicsuncharge - ld a, [Weather] + ld a, [wBattleWeather] cp WEATHER_SUN ret nz ld b, charge_command @@ -9690,7 +9690,7 @@ BattleCommand_ThunderAccuracy: ; 37d94 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 diff --git a/engine/battle/effect_commands/sandstorm.asm b/engine/battle/effect_commands/sandstorm.asm index 27b8e8e2caa..7bd6534207e 100644 --- a/engine/battle/effect_commands/sandstorm.asm +++ b/engine/battle/effect_commands/sandstorm.asm @@ -1,12 +1,12 @@ 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 call AnimateCurrentMove diff --git a/engine/battle/misc.asm b/engine/battle/misc.asm index a41d31d9ae5..d7b5584c7bf 100644 --- a/engine/battle/misc.asm +++ b/engine/battle/misc.asm @@ -53,7 +53,7 @@ GetPlayerBackpicCoords: ; fbd9d (3e:7d9d) DoWeatherModifiers: ; fbda4 ld de, .WeatherTypeModifiers - ld a, [Weather] + ld a, [wBattleWeather] ld b, a ld a, [wd265] ; move type ld c, a diff --git a/engine/battle/start_battle.asm b/engine/battle/start_battle.asm index e1377eec026..98a32c0dde8 100644 --- a/engine/battle/start_battle.asm +++ b/engine/battle/start_battle.asm @@ -150,7 +150,7 @@ PlayBattleMusic: ; 2ee6c ClearBattleRAM: ; 2ef18 xor a - ld [wPlayerAction], a + ld [wBattlePlayerAction], a ld [wBattleResult], a ld hl, wPartyMenuCursor diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index 0bbedf90964..a25e4a98e32 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -271,8 +271,8 @@ endr ret .delete - ld hl, Sprites - ld c, SpritesEnd - Sprites + ld hl, wVirtualOAM + ld c, SpritesEnd - wVirtualOAM xor a .loop2 ld [hli], a @@ -1499,7 +1499,7 @@ BattleAnim_UpdateOAM_All: ; cc96e jr nz, .loop ld a, [wBattleAnimOAMPointerLo] ld l, a - ld h, HIGH(Sprites) + ld h, HIGH(wVirtualOAM) .loop2 ld a, l cp LOW(SpritesEnd) diff --git a/engine/battle_anims/core.asm b/engine/battle_anims/core.asm index 55adeae8c62..2b0dcad3487 100755 --- a/engine/battle_anims/core.asm +++ b/engine/battle_anims/core.asm @@ -106,7 +106,7 @@ BattleAnimOAMUpdate: ; cca09 ld l, a ld a, [wBattleAnimOAMPointerLo] ld e, a - ld d, HIGH(Sprites) + ld d, HIGH(wVirtualOAM) .loop ld a, [wBattleAnimTempYCoord] ld b, a diff --git a/engine/card_flip.asm b/engine/card_flip.asm index ae90b124add..d7d24cba1b6 100755 --- a/engine/card_flip.asm +++ b/engine/card_flip.asm @@ -126,9 +126,9 @@ _CardFlip: ; e00ee (38:40ee) ; 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 @@ _CardFlip: ; e00ee (38:40ee) 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 @@ -535,7 +535,7 @@ CardFlip_PrintCoinBalance: ; e049c ld de, .CoinStr call PlaceString hlcoord 15, 16 - ld de, Coins + ld de, wCoins lb bc, PRINTNUM_LEADINGZEROS | 2, 4 call PrintNum ret @@ -1174,29 +1174,29 @@ CardFlip_CheckWinCondition: ; e0637 ; 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 ; e0833 .IsCoinCaseFull: ; e0833 - ld a, [Coins] + ld a, [wCoins] cp HIGH(MAX_COINS) jr c, .less jr z, .check_low jr .more .check_low - ld a, [Coins + 1] + ld a, [wCoins + 1] cp LOW(MAX_COINS) jr c, .less diff --git a/engine/debug.asm b/engine/debug.asm index c154819262b..dce32afda53 100755 --- a/engine/debug.asm +++ b/engine/debug.asm @@ -1029,7 +1029,7 @@ Function81f5e: ; 81f5e 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 diff --git a/engine/decorations.asm b/engine/decorations.asm index 413a049a28a..912966a73f3 100755 --- 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 @@ -645,62 +645,62 @@ DecoAction_nothing: ; 26ce3 ; 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 @@ -935,8 +935,8 @@ DecoAction_AskWhichSide: ; 26e70 ; 26e9a QueryWhichSide: ; 26e9a - ld hl, RightOrnament - ld de, LeftOrnament + ld hl, wDecoRightOrnament + ld de, wDecoLeftOrnament ld a, [Buffer2] cp 1 ret z @@ -1072,7 +1072,7 @@ DescribeDecoration:: ; 26f59 ; 26f69 DecorationDesc_Poster: ; 26f69 - ld a, [Poster] + ld a, [wDecoPoster] ld hl, DecorationDesc_PosterPointers ld de, 3 call IsInArray @@ -1148,15 +1148,15 @@ DecorationDesc_NullPoster: ; 26fb8 ; 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 @@ -1196,18 +1196,18 @@ DecorationDesc_GiantOrnament: ; 26fdd 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 @@ Special_ToggleMaptileDecorations: ; 26feb SetPosterVisibility: ; 27027 ld b, SET_FLAG - ld a, [Poster] + ld a, [wDecoPoster] and a jr nz, .ok ld b, RESET_FLAG @@ -1251,19 +1251,19 @@ SetDecorationTile: ; 27037 Special_ToggleDecorationsVisibility: ; 27043 ld de, EVENT_KRISS_HOUSE_2F_CONSOLE ld hl, VariableSprites + SPRITE_CONSOLE - SPRITE_VARS - ld a, [Console] + 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 a, [wDecoLeftOrnament] call ToggleDecorationVisibility ld de, EVENT_KRISS_HOUSE_2F_DOLL_2 ld hl, VariableSprites + SPRITE_DOLL_2 - SPRITE_VARS - ld a, [RightOrnament] + 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 a, [wDecoBigDoll] call ToggleDecorationVisibility ret ; 27074 diff --git a/engine/evolution_animation.asm b/engine/evolution_animation.asm index 2e6e82e2544..fe5cec38f00 100755 --- a/engine/evolution_animation.asm +++ b/engine/evolution_animation.asm @@ -44,7 +44,7 @@ EvolutionAnimation: ; 4e5e1 call Request2bpp xor a - ld [Danger], a + ld [wLowHealthAlarm], a call WaitBGMap xor a ld [hBGMapMode], a diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index a26ac1f8134..59aebd4d5d4 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -106,8 +106,8 @@ ResetWRAM: ; 5ba7 _ResetWRAM: ; 5bae - ld hl, Sprites - ld bc, Options - Sprites + ld hl, wVirtualOAM + ld bc, Options - wVirtualOAM xor a call ByteFill @@ -196,8 +196,8 @@ _ResetWRAM: ; 5bae 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) diff --git a/engine/item_effects.asm b/engine/item_effects.asm index c2bdd1f6139..72b1f4d2794 100644 --- a/engine/item_effects.asm +++ b/engine/item_effects.asm @@ -1658,7 +1658,7 @@ RevivePokemon: ; f0d6 .skip_to_revive xor a - ld [Danger], a + ld [wLowHealthAlarm], a ld a, [CurItem] cp REVIVE jr z, .revive_half_hp @@ -1701,7 +1701,7 @@ FullRestore: ; f128 .FullRestore: ; f144 xor a - ld [Danger], a + ld [wLowHealthAlarm], a call ReviveFullHP ld a, MON_STATUS call GetPartyParamLocation @@ -1798,7 +1798,7 @@ ItemRestoreHP: ; f1a9 (3:71a9) ret nc xor a - ld [Danger], a + ld [wLowHealthAlarm], a call GetHealingItemAmount call RestoreHealth call BattlemonRestoreHealth @@ -2357,7 +2357,7 @@ PokeFlute: ; f50c ld hl, .PlayedTheFlute call PrintText - ld a, [Danger] + ld a, [wLowHealthAlarm] and 1 << DANGER_ON_F jr nz, .dummy2 .dummy2 diff --git a/engine/map_objects.asm b/engine/map_objects.asm index 00ce599e3fb..0dbdf5e7059 100644 --- a/engine/map_objects.asm +++ b/engine/map_objects.asm @@ -2829,7 +2829,7 @@ _UpdateSprites:: ; 5920 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 @@ -3043,7 +3043,7 @@ InitSprites: ; 5991 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 diff --git a/engine/menu_2.asm b/engine/menu_2.asm index c8c4ebf5d82..293d72e2cc1 100644 --- a/engine/menu_2.asm +++ b/engine/menu_2.asm @@ -76,7 +76,7 @@ Special_DisplayCoinCaseBalance: ; 24b25 hlcoord 17, 1 ld de, ShowMoney_TerminatorString call PlaceString - ld de, Coins + ld de, wCoins lb bc, 2, 4 hlcoord 13, 1 call PrintNum @@ -98,7 +98,7 @@ Special_DisplayMoneyAndCoinBalance: ; 24b4e ld de, CoinString call PlaceString hlcoord 15, 3 - ld de, Coins + ld de, wCoins lb bc, 2, 4 call PrintNum ret diff --git a/engine/money.asm b/engine/money.asm index 60de97568f4..585c856184c 100755 --- a/engine/money.asm +++ b/engine/money.asm @@ -171,7 +171,7 @@ AddFunds: ; 16055 GiveCoins:: ; 1606f ld a, 2 - ld de, Coins + ld de, wCoins call AddFunds ld a, 2 ld bc, .maxcoins @@ -198,7 +198,7 @@ GiveCoins:: ; 1606f TakeCoins:: ; 1608f ld a, 2 - ld de, Coins + ld de, wCoins call SubtractFunds jr nc, .okay ; leave with 0 coins @@ -216,6 +216,6 @@ TakeCoins:: ; 1608f CheckCoins:: ; 160a1 ld a, 2 - ld de, Coins + ld de, wCoins jp CompareFunds ; 160a9 diff --git a/engine/pokegear.asm b/engine/pokegear.asm index f65f394bea1..8bea44671cd 100755 --- a/engine/pokegear.asm +++ b/engine/pokegear.asm @@ -2588,8 +2588,8 @@ Pokedex_GetArea: ; 91d11 .copy_sprites hlcoord 0, 0 - ld de, Sprites - ld bc, SpritesEnd - Sprites + ld de, wVirtualOAM + ld bc, SpritesEnd - wVirtualOAM call CopyBytes ret @@ -2654,9 +2654,9 @@ Pokedex_GetArea: ; 91d11 jr .nestloop .done_nest - ld hl, Sprites + ld hl, wVirtualOAM decoord 0, 0 - ld bc, SpritesEnd - Sprites + ld bc, SpritesEnd - wVirtualOAM call CopyBytes ret @@ -2741,8 +2741,8 @@ Pokedex_GetArea: ; 91d11 ret .clear - ld hl, Sprites - ld bc, SpritesEnd - Sprites + ld hl, wVirtualOAM + ld bc, SpritesEnd - wVirtualOAM xor a call ByteFill scf diff --git a/engine/routines/loadpushoam.asm b/engine/routines/loadpushoam.asm index c07c06d0f10..6351523588a 100644 --- a/engine/routines/loadpushoam.asm +++ b/engine/routines/loadpushoam.asm @@ -11,7 +11,7 @@ LoadPushOAM:: ; 4031 ret .PushOAM: ; 403f - ld a, HIGH(Sprites) + ld a, HIGH(wVirtualOAM) ld [rDMA], a ld a, NUM_SPRITE_OAM_STRUCTS .pushoam_loop diff --git a/engine/scripting.asm b/engine/scripting.asm index 84590f3c062..acbf1190c05 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -1993,7 +1993,7 @@ Script_readcoins: call ResetStringBuffer1 ld hl, StringBuffer1 - ld de, Coins + ld de, wCoins lb bc, PRINTNUM_RIGHTALIGN | 2, 6 call PrintNum ld de, StringBuffer1 diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm index cfec1109150..f960abd1cbf 100755 --- a/engine/slot_machine.asm +++ b/engine/slot_machine.asm @@ -223,7 +223,7 @@ SlotsLoop: ; 927af (24:67af) .PrintCoinsAndPayout: ; 927f8 (24:67f8) hlcoord 5, 1 - ld de, Coins + ld de, wCoins lb bc, PRINTNUM_LEADINGZEROS | 2, 4 call PrintNum hlcoord 11, 1 @@ -480,7 +480,7 @@ SlotsAction_PayoutAnim: ; 929a4 (24:69a4) ld [hl], e dec hl ld [hl], d - ld hl, Coins + ld hl, wCoins ld d, [hl] inc hl ld e, [hl] @@ -1819,7 +1819,7 @@ Slots_AskBet: ; 9307c (24:707c) 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 @@ Slots_AskBet: ; 9307c (24:707c) jr .loop .Start: - ld hl, Coins + 1 + ld hl, wCoins + 1 ld a, [hl] sub c ld [hld], a @@ -1883,7 +1883,7 @@ Slots_AskBet: ; 9307c (24:707c) ; 0x930e9 Slots_AskPlayAgain: ; 930e9 (24:70e9) - ld hl, Coins + ld hl, wCoins ld a, [hli] or [hl] jr nz, .you_have_coins diff --git a/engine/specials.asm b/engine/specials.asm index 965e3d58b49..587a8160c84 100644 --- a/engine/specials.asm +++ b/engine/specials.asm @@ -253,7 +253,7 @@ Special_StartGameCornerGame: ; c39a ; c3ae Special_CheckCoins: ; c3ae - ld hl, Coins + ld hl, wCoins ld a, [hli] or [hl] jr z, .no_coins diff --git a/engine/sprites.asm b/engine/sprites.asm index 7928fe1f081..6816e413324 100755 --- a/engine/sprites.asm +++ b/engine/sprites.asm @@ -23,7 +23,7 @@ PlaySpriteAnimations: ; 8cf69 push bc push af - ld a, LOW(Sprites) + ld a, LOW(wVirtualOAM) ld [wCurrSpriteOAMAddr], a call DoNextFrameForAllSprites @@ -60,9 +60,9 @@ DoNextFrameForAllSprites: ; 8cf7a ld a, [wCurrSpriteOAMAddr] ld l, a - ld h, HIGH(Sprites) + ld h, HIGH(wVirtualOAM) -.loop2 ; Clear (Sprites + [wCurrSpriteOAMAddr] --> SpritesEnd) +.loop2 ; Clear (wVirtualOAM + [wCurrSpriteOAMAddr] --> SpritesEnd) ld a, l cp LOW(SpritesEnd) jr nc, .done @@ -102,7 +102,7 @@ DoNextFrameForFirst16Sprites: ; 8cfa8 (23:4fa8) ld l, a ld h, HIGH(Sprite17) -.loop2 ; Clear (Sprites + [wCurrSpriteOAMAddr] --> Sprites + $40) +.loop2 ; Clear (wVirtualOAM + [wCurrSpriteOAMAddr] --> Sprites + $40) ld a, l cp LOW(Sprite17) jr nc, .done @@ -253,7 +253,7 @@ UpdateAnimFrame: ; 8d04c 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 diff --git a/engine/variables.asm b/engine/variables.asm index 56c49f085af..1d174443ef1 100755 --- a/engine/variables.asm +++ b/engine/variables.asm @@ -89,7 +89,7 @@ _GetVarAction:: ; 80648 (20:4648) .CountBadges: ; 806e1 ; Number of owned badges. - ld hl, Badges + ld hl, wBadges ld b, 2 call CountSetBits ld a, [wd265] diff --git a/home.asm b/home.asm index 35968744d35..58dcdb433a4 100644 --- a/home.asm +++ b/home.asm @@ -169,8 +169,8 @@ INCLUDE "home/double_speed.asm" ClearSprites:: ; 300b ; Erase OAM data - ld hl, Sprites - ld b, SpritesEnd - Sprites + ld hl, wVirtualOAM + ld b, SpritesEnd - wVirtualOAM xor a .loop ld [hli], a diff --git a/home/audio.asm b/home/audio.asm index 44786ee2957..307af3b8c5d 100644 --- a/home/audio.asm +++ b/home/audio.asm @@ -296,19 +296,19 @@ IsSFXPlaying:: ; 3c74 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 diff --git a/macros/wram.asm b/macros/wram.asm index 47138e40ce2..7c8ca44a1df 100755 --- a/macros/wram.asm +++ b/macros/wram.asm @@ -129,7 +129,7 @@ map_connection_struct: MACRO 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 diff --git a/maps/KrissHouse2F.asm b/maps/KrissHouse2F.asm index dcd63af1e40..f250d2cecc9 100644 --- a/maps/KrissHouse2F.asm +++ b/maps/KrissHouse2F.asm @@ -40,7 +40,7 @@ Doll1: Doll2: describedecoration DECODESC_RIGHT_DOLL -BigDoll: +wDecoBigDoll: describedecoration DECODESC_BIG_DOLL GameConsole: @@ -138,4 +138,4 @@ KrissHouse2F_MapEvents: 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 diff --git a/mobile/mobile_22.asm b/mobile/mobile_22.asm index 618c8a3126c..4ec048c4aaf 100644 --- a/mobile/mobile_22.asm +++ b/mobile/mobile_22.asm @@ -568,9 +568,9 @@ Function8942b: ; 8942b (22:542b) 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 @@ -2550,7 +2550,7 @@ Function89f77: ; 89f77 (22:5f77) Function89f9a: ; 89f9a (22:5f9a) dec a - ld hl, Sprites + ld hl, wVirtualOAM and a ret z .asm_89fa0 @@ -3293,7 +3293,7 @@ asm_8a529: ; 8a529 (22:6529) ld [hli], a ld a, $ff ld [hli], a - ld hl, Sprites + ld hl, wVirtualOAM xor a ld bc, 8 * SPRITEOAMSTRUCT_LENGTH call ByteFill diff --git a/mobile/mobile_40.asm b/mobile/mobile_40.asm index 48751e4fac3..2798914b813 100644 --- a/mobile/mobile_40.asm +++ b/mobile/mobile_40.asm @@ -1646,7 +1646,7 @@ _LinkBattleSendReceiveAction: ; 100a09 ; 100a2e .StageForSend: ; 100a2e - ld a, [wPlayerAction] + ld a, [wBattlePlayerAction] and a jr nz, .switch ld a, [CurPlayerMove] @@ -7143,7 +7143,7 @@ Function10306e: ; 10306e ld a, $01 ld [hOAMUpdate], a call ClearSprites - ld de, Sprites + ld de, wVirtualOAM call Function1030cd xor a ld [hOAMUpdate], a diff --git a/mobile/mobile_45.asm b/mobile/mobile_45.asm index af9bdb633ce..fad0bd482ef 100644 --- a/mobile/mobile_45.asm +++ b/mobile/mobile_45.asm @@ -650,7 +650,7 @@ Function1144d1: ; 1144d1 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 @@ Function1144d1: ; 1144d1 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 @@ Function114561: ; 114561 Function114576: ; 114576 xor a - ld [Bed], a + ld [wDecoBed], a ld b, $7 call Function1143f3 cp $2 @@ -802,7 +802,7 @@ Function114576: ; 114576 .asm_1145bf ld a, $1 - ld [Bed], a + ld [wDecoBed], a ret ; 1145c5 @@ -924,7 +924,7 @@ Function11463c: ; 11463c 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 @@ Function11463c: ; 11463c 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 @@ Function11463c: ; 11463c ld [hFF8C], a ld [MBC3SRamBank], a xor a - ld [Carpet], a + ld [wDecoCarpet], a ld a, $1 ret @@ -1021,7 +1021,7 @@ Function1146a4: ; 1146a4 and a jr z, .asm_1146f5 ld a, $1 - ld [BigDoll], a + ld [wDecoBigDoll], a jr .asm_1146da .asm_1146f5 @@ -1057,7 +1057,7 @@ Function1146fa: ; 1146fa 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 @@ Function1146fa: ; 1146fa 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 @@ Function1146fa: ; 1146fa ld a, [$dc0d] inc a ld [$dc0d], a - ld a, [BigDoll] + ld a, [wDecoBigDoll] and a jr z, .asm_114799 @@ -1127,7 +1127,7 @@ Function1146fa: ; 1146fa ret .asm_114799 - ld a, [Carpet] + ld a, [wDecoCarpet] and a jr z, .asm_114737 jr .asm_1147cb @@ -1141,14 +1141,14 @@ Function1146fa: ; 1146fa and a jr z, .asm_1147cb xor a - ld [BigDoll], a + ld [wDecoBigDoll], a .asm_1147b7 ld a, [$dc17] 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 @@ Function1146fa: ; 1146fa Function1147cd: ; 1147cd ld bc, NULL - ld a, [RightOrnament] + ld a, [wDecoRightOrnament] and a jr nz, .asm_11480c .asm_1147d6 @@ -1364,7 +1364,7 @@ Function1148c2: ; 1148c2 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 @@ Function11494d: ; 11494d 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 @@ Function114acf: ; 114acf call z, Function114b4c .asm_114b26 - ld hl, Plant + ld hl, wDecoPlant ld a, [$dc00] ld [hli], a ld [hl], e @@ -2703,7 +2703,7 @@ Function114f59: ; 114f59 ret .asm_114fa7 - ld hl, Bed + ld hl, wDecoBed ld c, [hl] inc hl ld a, [hli] @@ -2842,7 +2842,7 @@ Function115059: ; 115059 ; 115062 Function115062: ; 115062 - ld hl, Bed + ld hl, wDecoBed ld a, [hli] and a jr z, .asm_1150ae @@ -2948,9 +2948,9 @@ Function1150b3: ; 1150b3 .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 @@ Function1150b3: ; 1150b3 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 @@ -3275,7 +3275,7 @@ Function115286: ; 115286 ; 11528f Function11528f: ; 11528f - ld hl, Bed + ld hl, wDecoBed ld c, [hl] inc hl ld a, [hli] @@ -3458,7 +3458,7 @@ Function11537d: ; 11537d ld a, b ld [hli], a inc de - ld hl, RightOrnament + ld hl, wDecoRightOrnament ld a, [de] ld [hli], a inc de @@ -3502,7 +3502,7 @@ Function1153b5: ; 1153b5 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 @@ Function1153d2: ; 1153d2 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 @@ Function1153d2: ; 1153d2 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 @@ Function1153d2: ; 1153d2 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 @@ Function1153d2: ; 1153d2 .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 @@ Function1153d2: ; 1153d2 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 @@ Function1153d2: ; 1153d2 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 @@ -3708,9 +3708,9 @@ Function1154d4: ; 1154d4 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 @@ Function1154d4: ; 1154d4 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 @@ Function1154d4: ; 1154d4 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 @@ Function1155af: ; 1155af 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 @@ Function1155d1: ; 1155d1 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 @@ Function1155d1: ; 1155d1 ld a, [hli] ld [de], a ld a, [hli] - ld [Bed], a + ld [wDecoBed], a .asm_1155f0 ld de, $dc17 @@ -4056,9 +4056,9 @@ Function1156cc: ; 1156cc 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 @@ -4070,9 +4070,9 @@ Function1156cc: ; 1156cc ld a, [wStartDay] 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 @@ -4240,7 +4240,7 @@ Function1157d0: ; 1157d0 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,7 +4275,7 @@ Function1157d0: ; 1157d0 ld a, c ld [$dc0e], a ld a, b - ld [Bed], a + ld [wDecoBed], a ld a, $4 ld [wStartDay], a ret @@ -4285,7 +4285,7 @@ Function1157d0: ; 1157d0 ld a, c ld [$dc0e], a ld a, b - ld [Bed], a + ld [wDecoBed], a ld a, $3 ld [wStartDay], a ret @@ -4298,7 +4298,7 @@ Function11581e: ; 11581e ret z ld a, [$dc0e] ld c, a - ld a, [Bed] + ld a, [wDecoBed] ld b, a ld hl, $dc02 ld a, [hli] @@ -4659,9 +4659,9 @@ Function1159fb: ; 1159fb 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 @@ -4673,9 +4673,9 @@ Function1159fb: ; 1159fb ld a, [wStartDay] 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 @@ -4771,7 +4771,7 @@ Function115ab0: ; 115ab0 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,7 +4806,7 @@ Function115ab0: ; 115ab0 ld a, c ld [$dc0e], a ld a, b - ld [Bed], a + ld [wDecoBed], a ld a, $4 ld [wStartDay], a xor a @@ -4817,7 +4817,7 @@ Function115ab0: ; 115ab0 ld a, c ld [$dc0e], a ld a, b - ld [Bed], a + ld [wDecoBed], a ld a, $3 ld [wStartDay], a xor a @@ -4831,7 +4831,7 @@ Function115b00: ; 115b00 ret z ld a, [$dc0e] ld c, a - ld a, [Bed] + ld a, [wDecoBed] ld b, a ld hl, $dc02 ld a, [hli] @@ -4870,7 +4870,7 @@ Function115b00: ; 115b00 ret .asm_115b43 - ld a, [Carpet] + ld a, [wDecoCarpet] add a cpl ld c, a @@ -4961,7 +4961,7 @@ Function115b00: ; 115b00 Function115bc8: ; 115bc8 xor a - ld [Carpet], a + ld [wDecoCarpet], a .asm_115bcc ld a, [de] ld [hli], a @@ -5009,9 +5009,9 @@ Function115bc8: ; 115bc8 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 diff --git a/mobile/mobile_45_sprite_engine.asm b/mobile/mobile_45_sprite_engine.asm index 8f66da8cdd5..e8c0cc203c7 100755 --- a/mobile/mobile_45_sprite_engine.asm +++ b/mobile/mobile_45_sprite_engine.asm @@ -360,7 +360,7 @@ Function11619d: ; 11619d cp $2 jr c, .asm_1161b4 ld a, $a0 - ld hl, Sprites + ld hl, wVirtualOAM ld bc, 25 * SPRITEOAMSTRUCT_LENGTH call ByteFill @@ -667,7 +667,7 @@ Function11636e: ; 11636e 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 @@ -695,7 +695,7 @@ Function1163c0: ; 1163c0 ld a, $1 ld [rSVBK], a ld a, $a0 - ld hl, Sprites + ld hl, wVirtualOAM ld bc, 16 * SPRITEOAMSTRUCT_LENGTH call ByteFill call DelayFrame diff --git a/mobile/mobile_5b.asm b/mobile/mobile_5b.asm index bb005b564aa..e7e7e437fb4 100755 --- a/mobile/mobile_5b.asm +++ b/mobile/mobile_5b.asm @@ -564,7 +564,7 @@ Function16cb2e: ; 16cb2e ret z call Function16cb40 ld hl, Unknown_16cb86 - ld de, Sprites + ld de, wVirtualOAM call Function16cb5d ret ; 16cb40 diff --git a/mobile/mobile_5e.asm b/mobile/mobile_5e.asm index a736182cf73..ac1e21a9420 100644 --- a/mobile/mobile_5e.asm +++ b/mobile/mobile_5e.asm @@ -517,7 +517,7 @@ String_17a9b2: ; 17a9b2 ; 17a9cb Function17a9cb: ; 17a9cb (5e:69cb) - ld de, Sprites ; $c400 + ld de, wVirtualOAM ; $c400 ld hl, $d088 bit 6, [hl] jr nz, .bit_6_set diff --git a/wram.asm b/wram.asm index 05b91389c73..81e23e9dc83 100644 --- a/wram.asm +++ b/wram.asm @@ -22,16 +22,16 @@ wMusic:: MusicPlaying:: db ; c100 Channels:: -Channel1:: channel_struct Channel1 ; c101 -Channel2:: channel_struct Channel2 ; c133 -Channel3:: channel_struct Channel3 ; c165 -Channel4:: channel_struct Channel4 ; c197 +wChannel1:: channel_struct Channel1 ; c101 +wChannel2:: channel_struct Channel2 ; c133 +wChannel3:: channel_struct Channel3 ; c165 +wChannel4:: channel_struct Channel4 ; c197 SFXChannels:: -Channel5:: channel_struct Channel5 ; c1c9 -Channel6:: channel_struct Channel6 ; c1fb -Channel7:: channel_struct Channel7 ; c22d -Channel8:: channel_struct Channel8 ; c25f +wChannel5:: channel_struct Channel5 ; c1c9 +wChannel6:: channel_struct Channel6 ; c1fb +wChannel7:: channel_struct Channel7 ; c22d +wChannel8:: channel_struct Channel8 ; c25f ds 1 ; c291 @@ -43,7 +43,7 @@ wCurNoteDuration:: db ; used in MusicE0 and LoadNote CurMusicByte:: db ; c298 CurChannel:: db ; c299 -Volume:: ; c29a +wVolume:: ; c29a ; corresponds to $ff24 ; Channel control / ON-OFF / Volume (R/W) ; bit 7 - Vin->SO2 ON/OFF @@ -73,7 +73,7 @@ wNoiseSampleDelay:: db ; c2a2 MusicNoiseSampleSet:: db ; c2a4 SFXNoiseSampleSet:: db ; c2a5 -Danger:: ; c2a6 +wLowHealthAlarm:: ; c2a6 ; bit 7: on/off ; bit 4: pitch ; bit 0-3: counter @@ -302,7 +302,7 @@ wc3fc:: ds 1 SECTION "Sprites", WRAM0 -Sprites:: ; c400 +wVirtualOAM:: ; c400 Sprite01:: sprite_oam_struct Sprite01 Sprite02:: sprite_oam_struct Sprite02 Sprite03:: sprite_oam_struct Sprite03 @@ -631,7 +631,7 @@ wEnemyMinimized:: db ; c6fa AlreadyFailed:: db ; c6fb wBattleParticipantsIncludingFainted:: db ; c6fc -wDanger:: db ; c6fd +wBattleLowHealthAlarm:: db ; c6fd wPlayerMinimized:: db ; c6fe PlayerScreens:: ; c6ff ; bit @@ -659,7 +659,7 @@ EnemyLightScreenCount:: db ; c706 EnemyReflectCount:: db ; c707 ds 2 -Weather:: ; c70a +wBattleWeather:: ; c70a ; 00 normal ; 01 rain ; 02 sun @@ -1871,7 +1871,7 @@ wNumMoves:: db wFieldMoveSucceeded:: wItemEffectSucceeded:: -wPlayerAction:: +wBattlePlayerAction:: ; 0 - use move ; 1 - use item ; 2 - switch @@ -2439,9 +2439,9 @@ Money:: 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 @@ -2450,7 +2450,7 @@ TMsHMs:: ds NUM_TMS + NUM_HMS ; d859 TMsHMsEnd:: NumItems:: db ; d892 -Items:: ds MAX_ITEMS * 2 + 1 ; d893 +wItems:: ds MAX_ITEMS * 2 + 1 ; d893 ItemsEnd:: NumKeyItems:: db ; d8bc @@ -2458,7 +2458,7 @@ KeyItems:: ds MAX_KEY_ITEMS + 1 ; d8bd KeyItemsEnd:: NumBalls:: db ; d8d7 -Balls:: ds MAX_BALLS * 2 + 1 ; d8d8 +wBalls:: ds MAX_BALLS * 2 + 1 ; d8d8 BallsEnd:: PCItems:: ds MAX_PC_ITEMS * 2 + 1 ; d8f1 @@ -2649,14 +2649,14 @@ wCurrMapCallbacksPointer:: dw ; dc0b 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 From 79bd48f85c7dd1868264e290b12dad17a6e25b95 Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Tue, 23 Jan 2018 16:49:58 -0500 Subject: [PATCH 2/8] Replace Stack with wStack. --- engine/save.asm | 2 +- engine/tileset_anims.asm | 4 ++-- home/init.asm | 2 +- wram.asm | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/save.asm b/engine/save.asm index 4291754e90c..be9d7f109cc 100644 --- a/engine/save.asm +++ b/engine/save.asm @@ -332,7 +332,7 @@ UpdateStackTop: ; 14c6b 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 diff --git a/engine/tileset_anims.asm b/engine/tileset_anims.asm index 5113ae9a319..931fcba099f 100644 --- a/engine/tileset_anims.asm +++ b/engine/tileset_anims.asm @@ -481,7 +481,7 @@ AnimateWaterTile: ; fc402 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 @@ -845,7 +845,7 @@ AnimateWhirlpoolTile: ; fc678 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 diff --git a/home/init.asm b/home/init.asm index d8e476c3fde..88ab0b58bf8 100644 --- a/home/init.asm +++ b/home/init.asm @@ -79,7 +79,7 @@ Init:: ; 17d or c jr nz, .ByteFill - ld sp, Stack + ld sp, wStack ; Clear HRAM ld a, [hCGB] diff --git a/wram.asm b/wram.asm index 81e23e9dc83..023aa28b0d0 100644 --- a/wram.asm +++ b/wram.asm @@ -9,7 +9,7 @@ SECTION "Stack", WRAM0 StackBottom:: ds $100 - 1 -Stack:: +wStack:: StackTop:: ds 1 From a1951cefc09035e11077a433b28ec8c66b3b03db Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Tue, 23 Jan 2018 17:39:09 -0500 Subject: [PATCH 3/8] Prefix wram labels with w, part 2. --- audio/engine.asm | 616 +++---- charmap.asm | 10 +- constants/audio_constants.asm | 4 +- constants/battle_constants.asm | 18 +- constants/event_flags.asm | 2 +- constants/map_data_constants.asm | 4 +- constants/pokemon_data_constants.asm | 116 +- constants/script_constants.asm | 6 +- constants/sprite_constants.asm | 2 +- constants/wram_constants.asm | 34 +- data/battle/battle_text.asm | 98 +- data/common_text/common_text_1.asm | 124 +- data/common_text/common_text_2.asm | 140 +- data/common_text/common_text_3.asm | 86 +- data/default_options.asm | 10 +- data/maps/data.asm | 16 +- data/phone/text/bill.asm | 4 +- data/phone/text/extra.asm | 148 +- data/phone/text/extra2.asm | 172 +- data/phone/text/gaven_overworld.asm | 4 +- data/phone/text/jose_overworld.asm | 2 +- data/phone/text/mom.asm | 16 +- data/phone/text/trainers1.asm | 364 ++-- data/special_pointers.asm | 2 +- data/std_text.asm | 14 +- data/text_buffers.asm | 14 +- data/trainers/palettes.asm | 2 +- data/unused/gen_1_trainer_names.asm | 52 +- engine/battle/ai/items.asm | 108 +- engine/battle/ai/move.asm | 38 +- engine/battle/ai/redundant.asm | 46 +- engine/battle/ai/scoring.asm | 384 ++-- engine/battle/ai/switch.asm | 66 +- engine/battle/anim_hp_bar.asm | 8 +- engine/battle/battle_transition.asm | 30 +- engine/battle/checkbattlescene.asm | 2 +- engine/battle/consumehelditem.asm | 12 +- engine/battle/core.asm | 1542 ++++++++--------- engine/battle/effect_commands.asm | 1314 +++++++------- engine/battle/effect_commands/attract.asm | 24 +- engine/battle/effect_commands/curse.asm | 8 +- engine/battle/effect_commands/foresight.asm | 2 +- engine/battle/effect_commands/perish_song.asm | 8 +- engine/battle/effect_commands/present.asm | 2 +- engine/battle/effect_commands/protect.asm | 4 +- engine/battle/effect_commands/rollout.asm | 12 +- engine/battle/effect_commands/sandstorm.asm | 2 +- engine/battle/effect_commands/spikes.asm | 4 +- engine/battle/effect_commands/thief.asm | 8 +- engine/battle/effect_commands/transform.asm | 30 +- engine/battle/hidden_power.asm | 4 +- engine/battle/link_result.asm | 14 +- engine/battle/misc.asm | 16 +- engine/battle/read_trainer_attributes.asm | 22 +- engine/battle/read_trainer_dvs.asm | 4 +- engine/battle/read_trainer_party.asm | 78 +- engine/battle/returntobattle_useball.asm | 2 +- engine/battle/sliding_intro.asm | 8 +- engine/battle/start_battle.asm | 36 +- engine/battle/trainer_huds.asm | 42 +- engine/battle/updatebattlehuds.asm | 4 +- engine/battle/used_move_text.asm | 12 +- engine/battle_anims/anim_commands.asm | 184 +- engine/battle_anims/bg_effects.asm | 44 +- engine/battle_anims/core.asm | 6 +- engine/battle_anims/functions.asm | 4 +- engine/battle_anims/getpokeballwobble.asm | 8 +- engine/billspc.asm | 200 +-- engine/billspctop.asm | 26 +- engine/breeding.asm | 134 +- engine/buy_sell_toss.asm | 12 +- engine/card_flip.asm | 20 +- engine/caught_data.asm | 90 +- engine/cgb_layouts.asm | 152 +- engine/clock_reset.asm | 62 +- engine/color.asm | 44 +- engine/credits.asm | 56 +- engine/crystal_intro.asm | 26 +- engine/crystal_layouts.asm | 52 +- engine/debug.asm | 32 +- engine/decorations.asm | 98 +- engine/delete_save_change_clock.asm | 28 +- engine/diploma.asm | 6 +- engine/dma_transfer.asm | 18 +- engine/events.asm | 104 +- engine/events/basement_key.asm | 4 +- engine/events/battle_tower/battle_tower.asm | 186 +- engine/events/battle_tower/load_trainer.asm | 36 +- engine/events/battle_tower/rules.asm | 18 +- engine/events/battle_tower/trainer_text.asm | 12 +- engine/events/buena.asm | 26 +- engine/events/buena_menu.asm | 2 +- engine/events/bug_contest/caught_mon.asm | 10 +- engine/events/bug_contest/contest_2.asm | 12 +- engine/events/bug_contest/display_stats.asm | 16 +- engine/events/bug_contest/judging.asm | 6 +- engine/events/card_key.asm | 6 +- engine/events/catch_tutorial.asm | 18 +- engine/events/celebi.asm | 18 +- engine/events/checkforhiddenitems.asm | 28 +- engine/events/daycare.asm | 110 +- engine/events/dratini.asm | 10 +- engine/events/elevator.asm | 18 +- engine/events/field_moves.asm | 32 +- engine/events/fish.asm | 2 +- engine/events/fruit_trees.asm | 16 +- engine/events/halloffame.asm | 78 +- engine/events/happiness_egg.asm | 28 +- engine/events/heal_machine_anim.asm | 28 +- engine/events/kurt.asm | 56 +- engine/events/lucky_number.asm | 32 +- engine/events/magikarp.asm | 24 +- engine/events/magnet_train.asm | 30 +- engine/events/map_name_sign.asm | 14 +- engine/events/misc_scripts.asm | 16 +- engine/events/misc_scripts_2.asm | 4 +- engine/events/mom.asm | 66 +- engine/events/mom_phone.asm | 12 +- engine/events/move_deleter.asm | 16 +- engine/events/move_tutor.asm | 10 +- engine/events/name_rater.asm | 48 +- engine/events/odd_egg.asm | 14 +- engine/events/overworld.asm | 154 +- engine/events/poisonstep.asm | 36 +- engine/events/poisonstep_pals.asm | 2 +- engine/events/poke_seer.asm | 16 +- engine/events/pokecenter_pc.asm | 54 +- engine/events/pokepic.asm | 4 +- engine/events/pokerus/apply_pokerus_tick.asm | 4 +- engine/events/pokerus/check_pokerus.asm | 4 +- engine/events/pokerus/pokerus.asm | 16 +- engine/events/print_photo.asm | 2 +- engine/events/print_unown.asm | 18 +- engine/events/print_unown_2.asm | 4 +- engine/events/prof_oaks_pc.asm | 12 +- engine/events/sacred_ash.asm | 6 +- engine/events/special.asm | 64 +- engine/events/squirtbottle.asm | 8 +- engine/events/sweet_scent.asm | 6 +- engine/events/trainer_scripts.asm | 2 +- engine/events/treemons.asm | 36 +- engine/events/unown_walls.asm | 16 +- engine/events/whiteout.asm | 4 +- engine/events_2.asm | 22 +- engine/evolution_animation.asm | 42 +- engine/evolve.asm | 120 +- engine/experience.asm | 8 +- engine/health.asm | 8 +- engine/init_gender.asm | 8 +- engine/init_hof_credits.asm | 4 +- engine/init_map.asm | 2 +- engine/intro_menu.asm | 120 +- engine/item_effects.asm | 364 ++-- engine/items.asm | 82 +- engine/landmarks.asm | 12 +- engine/learn.asm | 30 +- engine/link.asm | 216 +-- engine/link_2.asm | 6 +- engine/link_trade.asm | 2 +- engine/load_font.asm | 2 +- engine/load_pics.asm | 34 +- engine/mail.asm | 50 +- engine/mail_2.asm | 16 +- engine/main_menu.asm | 6 +- engine/map_object_action.asm | 2 +- engine/map_objects.asm | 74 +- engine/map_objects_2.asm | 2 +- engine/map_palettes.asm | 22 +- engine/map_setup.asm | 22 +- engine/mapgroup_roofs.asm | 2 +- engine/mart.asm | 76 +- engine/menu.asm | 2 +- engine/menu_2.asm | 30 +- engine/mon_icons.asm | 22 +- engine/mon_menu.asm | 28 +- engine/mon_stats.asm | 82 +- engine/move_mon.asm | 390 ++--- engine/move_mon_wo_mail.asm | 28 +- engine/movement.asm | 8 +- engine/mystery_gift.asm | 22 +- engine/mystery_gift_2.asm | 8 +- engine/naming_screen.asm | 8 +- engine/npc_movement.asm | 18 +- engine/npctrade.asm | 50 +- engine/options_menu.asm | 22 +- engine/overworld.asm | 38 +- engine/pack.asm | 76 +- engine/party_menu.asm | 102 +- engine/phone/phone.asm | 54 +- engine/pic_animation.asm | 26 +- engine/player_gfx.asm | 8 +- engine/player_movement.asm | 114 +- engine/player_object.asm | 66 +- engine/player_step.asm | 12 +- engine/pokedex/newpokedexentry.asm | 4 +- engine/pokedex/pokedex.asm | 76 +- engine/pokedex/pokedex_2.asm | 6 +- engine/pokedex/pokedex_3.asm | 2 +- engine/pokedex/unown_dex.asm | 6 +- engine/pokegear.asm | 106 +- engine/predef.asm | 12 +- engine/print_party.asm | 44 +- engine/printer.asm | 10 +- engine/printer_serial.asm | 2 +- engine/radio.asm | 24 +- engine/routines/checktime.asm | 2 +- .../routines/correcterrorsinplayerparty.asm | 32 +- engine/routines/getbreedmonlevelgrowth.asm | 4 +- engine/routines/initlist.asm | 14 +- engine/routines/leveluphappinessmod.asm | 8 +- .../routines/phonering_copytilemapatonce.asm | 2 +- engine/routines/playslowcry.asm | 14 +- engine/routines/printitemdescription.asm | 10 +- .../routines/savemenu_copytilemapatonce.asm | 2 +- engine/routines/switchpartymons.asm | 44 +- .../townmap_convertlinebreakcharacters.asm | 4 +- engine/routines/trademonfrontpic.asm | 12 +- .../unreferenced_getgen1trainerclassname.asm | 4 +- engine/routines/updateitemdescription.asm | 6 +- engine/rtc.asm | 16 +- engine/save.asm | 60 +- engine/scripting.asm | 402 ++--- engine/scrolling_menu.asm | 24 +- engine/search.asm | 38 +- engine/search2.asm | 22 +- engine/select_menu.asm | 26 +- engine/sgb_layouts.asm | 46 +- engine/slot_machine.asm | 18 +- engine/spawn_points.asm | 12 +- engine/specials.asm | 80 +- engine/sprites.asm | 12 +- engine/start_menu.asm | 172 +- engine/stats_screen.asm | 140 +- engine/tempmon.asm | 36 +- engine/tile_events.asm | 10 +- engine/tileset_anims.asm | 42 +- engine/tileset_palettes.asm | 2 +- engine/time.asm | 24 +- engine/time_capsule.asm | 26 +- engine/timeofdaypals.asm | 22 +- engine/timeset.asm | 16 +- engine/title.asm | 12 +- engine/tmhm.asm | 6 +- engine/tmhm2.asm | 52 +- engine/trade_animation.asm | 26 +- engine/trainer_card.asm | 26 +- engine/types.asm | 16 +- engine/unown_puzzle.asm | 4 +- engine/unused_title.asm | 2 +- engine/variables.asm | 38 +- engine/warp_connection.asm | 112 +- engine/wildmons.asm | 56 +- home.asm | 116 +- home/audio.asm | 102 +- home/battle.asm | 60 +- home/copy.asm | 32 +- home/cry.asm | 10 +- home/delay.asm | 4 +- home/fade.asm | 2 +- home/flag.asm | 4 +- home/game_time.asm | 36 +- home/joypad.asm | 44 +- home/lcd.asm | 4 +- home/map.asm | 326 ++-- home/map_objects.asm | 28 +- home/menu.asm | 12 +- home/mobile.asm | 6 +- home/movement.asm | 6 +- home/names.asm | 28 +- home/pokedex_flags.asm | 8 +- home/predef.asm | 20 +- home/random.asm | 4 +- home/rtc.asm | 2 +- home/text.asm | 56 +- home/tilemap.asm | 8 +- home/time.asm | 22 +- home/trainers.asm | 26 +- home/vblank.asm | 22 +- home/video.asm | 56 +- home/window.asm | 2 +- macros/coords.asm | 8 +- maps/BattleTower1F.asm | 8 +- maps/BattleTowerHallway.asm | 2 +- maps/BillsHouse.asm | 2 +- maps/BluesHouse.asm | 2 +- maps/CeladonCafe.asm | 2 +- maps/CeladonDeptStore6F.asm | 2 +- maps/CeladonGameCornerPrizeRoom.asm | 2 +- maps/DragonsDenB1F.asm | 2 +- maps/ElmsLab.asm | 2 +- maps/GoldenrodDeptStore6F.asm | 2 +- maps/GoldenrodGameCorner.asm | 2 +- maps/GoldenrodHappinessRater.asm | 2 +- maps/GoldenrodPokecenter1F.asm | 6 +- maps/GoldenrodUnderground.asm | 8 +- ...oldenrodUndergroundSwitchRoomEntrances.asm | 32 +- maps/GoldenrodUndergroundWarehouse.asm | 2 +- maps/IlexForest.asm | 48 +- maps/LakeOfRageMagikarpHouse.asm | 4 +- maps/Pokecenter2F.asm | 8 +- maps/RadioTower1F.asm | 2 +- maps/Route35NationalParkGate.asm | 6 +- maps/Route36NationalParkGate.asm | 6 +- maps/Route39Barn.asm | 4 +- maps/TrainerHouseB1F.asm | 2 +- mobile/fixed_words.asm | 20 +- mobile/mobile_12.asm | 10 +- mobile/mobile_12_2.asm | 70 +- mobile/mobile_22.asm | 142 +- mobile/mobile_22_2.asm | 14 +- mobile/mobile_40.asm | 440 ++--- mobile/mobile_41.asm | 12 +- mobile/mobile_42.asm | 66 +- mobile/mobile_45.asm | 112 +- mobile/mobile_45_sprite_engine.asm | 40 +- mobile/mobile_46.asm | 162 +- mobile/mobile_5b.asm | 26 +- mobile/mobile_5c.asm | 16 +- mobile/mobile_5e.asm | 22 +- mobile/mobile_5f.asm | 168 +- mobile/mobile_menu.asm | 26 +- sram.asm | 4 +- wram.asm | 1082 ++++++------ 323 files changed, 8585 insertions(+), 8585 deletions(-) diff --git a/audio/engine.asm b/audio/engine.asm index 7aefca7fdcc..21a472fec54 100644 --- a/audio/engine.asm +++ b/audio/engine.asm @@ -38,8 +38,8 @@ _MapSetup_Sound_Off:: ; e8000 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 @@ -60,29 +60,29 @@ _MapSetup_Sound_Off:: ; e8000 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 MusicOn: ; e8051 ld a, 1 - ld [MusicPlaying], a + ld [wMusicPlaying], a ret ; e8057 MusicOff: ; e8057 xor a - ld [MusicPlaying], a + ld [wMusicPlaying], a ret ; e805c @@ -90,22 +90,22 @@ MusicOff: ; e8057 _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 [wCurChannel], a ; just + ld [wSoundOutput], a ; off ld bc, wChannel1 .loop ; is the channel active? - ld hl, Channel1Flags - wChannel1 + 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 - wChannel1 + ld hl, wChannel1NoteDuration - wChannel1 add hl, bc ld a, [hl] cp $2 ; 1 or 0? @@ -115,14 +115,14 @@ _UpdateSound:: ; e805c .noteover ; reset vibrato delay - ld hl, Channel1VibratoDelay - wChannel1 + ld hl, wChannel1VibratoDelay - wChannel1 add hl, bc ld a, [hl] - ld hl, Channel1VibratoDelayCount - wChannel1 + ld hl, wChannel1VibratoDelayCount - wChannel1 add hl, bc ld [hl], a ; turn vibrato off for now - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc res SOUND_PITCH_WHEEL, [hl] ; get next note @@ -130,7 +130,7 @@ _UpdateSound:: ; e805c .continue_sound_update call ApplyPitchWheel ; duty cycle - ld hl, Channel1DutyCycle - wChannel1 + ld hl, wChannel1DutyCycle - wChannel1 add hl, bc ld a, [hli] ld [wCurTrackDuty], a @@ -146,50 +146,50 @@ _UpdateSound:: ; e805c 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 - wChannel1 + 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 - wChannel1 + ld hl, wChannel5Flags - wChannel1 add hl, bc bit SOUND_CHANNEL_ON, [hl] jr nz, .sound_channel_on .sfx_channel call UpdateChannels - ld hl, Channel1Tracks - wChannel1 + 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 - wChannel1 + ld hl, wChannel1NoteFlags - wChannel1 add hl, bc xor a ld [hl], a @@ -199,9 +199,9 @@ _UpdateSound:: ; e805c 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 @@ -212,7 +212,7 @@ _UpdateSound:: ; e805c 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 @@ _UpdateSound:: ; e805c UpdateChannels: ; e8125 ld hl, .ChannelFnPtrs - ld a, [CurChannel] + ld a, [wCurChannel] and $7 add a ld e, a @@ -248,12 +248,12 @@ UpdateChannels: ; e8125 bit DANGER_ON_F, a ret nz .Channel5: - ld hl, Channel1NoteFlags - wChannel1 + 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 @@ UpdateChannels: ; e8125 .Channel2: .Channel6: - ld hl, Channel1NoteFlags - wChannel1 + ld hl, wChannel1NoteFlags - wChannel1 add hl, bc bit NOTE_REST, [hl] ; rest jr nz, .ch2rest @@ -377,7 +377,7 @@ UpdateChannels: ; e8125 .Channel3: .Channel7: - ld hl, Channel1NoteFlags - wChannel1 + ld hl, wChannel1NoteFlags - wChannel1 add hl, bc bit NOTE_REST, [hl] ; rest jr nz, .ch3rest @@ -478,7 +478,7 @@ endr .Channel4: .Channel8: - ld hl, Channel1NoteFlags - wChannel1 + ld hl, wChannel1NoteFlags - wChannel1 add hl, bc bit NOTE_REST, [hl] ; rest jr nz, .ch4rest @@ -514,16 +514,16 @@ endr _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 @@ -576,13 +576,13 @@ PlayDanger: ; e8307 or 1 << DANGER_ON_F 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,32 +604,32 @@ Tablee8354: ; e8354 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, [wVolume] and VOLUME_SO1_LEVEL @@ -647,18 +647,18 @@ FadeMusic: ; e8358 xor 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 ; 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 @@ FadeMusic: ; e8358 pop bc ; stop fading xor a - ld [MusicFade], a + ld [wMusicFade], a ret .bicycle @@ -679,15 +679,15 @@ FadeMusic: ; e8358 xor 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 @@ FadeMusic: ; e8358 .maxvolume ; we're done xor a - ld [MusicFade], a + ld [wMusicFade], a ret .updatevolume @@ -717,12 +717,12 @@ FadeMusic: ; e8358 LoadNote: ; e83d1 ; wait for pitch wheel to finish - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc bit SOUND_PITCH_WHEEL, [hl] ret z ; get note duration - ld hl, Channel1NoteDuration - wChannel1 + ld hl, wChannel1NoteDuration - wChannel1 add hl, bc ld a, [hl] ld hl, wCurNoteDuration @@ -732,13 +732,13 @@ LoadNote: ; e83d1 .ok ld [hl], a ; get frequency - ld hl, Channel1Frequency - wChannel1 + ld hl, wChannel1Frequency - wChannel1 add hl, bc ld e, [hl] inc hl ld d, [hl] ; get direction of pitch wheel - ld hl, Channel1PitchWheelTarget - wChannel1 + ld hl, wChannel1PitchWheelTarget - wChannel1 add hl, bc ld a, e sub [hl] @@ -746,21 +746,21 @@ LoadNote: ; e83d1 ld a, d sbc 0 ld d, a - ld hl, Channel1PitchWheelTarget + 1 - wChannel1 + ld hl, wChannel1PitchWheelTarget + 1 - wChannel1 add hl, bc sub [hl] jr nc, .greater_than - ld hl, Channel1Flags3 - wChannel1 + ld hl, wChannel1Flags3 - wChannel1 add hl, bc set SOUND_PITCH_WHEEL_DIR, [hl] ; get frequency - ld hl, Channel1Frequency - wChannel1 + ld hl, wChannel1Frequency - wChannel1 add hl, bc ld e, [hl] inc hl ld d, [hl] ; ???? - ld hl, Channel1PitchWheelTarget - wChannel1 + ld hl, wChannel1PitchWheelTarget - wChannel1 add hl, bc ld a, [hl] sub e @@ -769,7 +769,7 @@ LoadNote: ; e83d1 sbc 0 ld d, a ; ???? - ld hl, Channel1PitchWheelTarget + 1 - wChannel1 + ld hl, wChannel1PitchWheelTarget + 1 - wChannel1 add hl, bc ld a, [hl] sub d @@ -777,17 +777,17 @@ LoadNote: ; e83d1 jr .resume .greater_than - ld hl, Channel1Flags3 - wChannel1 + ld hl, wChannel1Flags3 - wChannel1 add hl, bc res SOUND_PITCH_WHEEL_DIR, [hl] ; get frequency - ld hl, Channel1Frequency - wChannel1 + ld hl, wChannel1Frequency - wChannel1 add hl, bc ld e, [hl] inc hl ld d, [hl] ; get distance from pitch wheel target - ld hl, Channel1PitchWheelTarget - wChannel1 + ld hl, wChannel1PitchWheelTarget - wChannel1 add hl, bc ld a, e sub [hl] @@ -795,7 +795,7 @@ LoadNote: ; e83d1 ld a, d sbc 0 ld d, a - ld hl, Channel1PitchWheelTarget + 1 - wChannel1 + ld hl, wChannel1PitchWheelTarget + 1 - wChannel1 add hl, bc sub [hl] ld d, a @@ -823,13 +823,13 @@ LoadNote: ; e83d1 add [hl] ld d, b ; quotient pop bc - ld hl, Channel1PitchWheelAmount - wChannel1 + ld hl, wChannel1PitchWheelAmount - wChannel1 add hl, bc ld [hl], d ; quotient - ld hl, Channel1PitchWheelAmountFraction - wChannel1 + ld hl, wChannel1PitchWheelAmountFraction - wChannel1 add hl, bc ld [hl], a ; remainder - ld hl, Channel1Field25 - wChannel1 + ld hl, wChannel1Field25 - wChannel1 add hl, bc xor a ld [hl], a @@ -839,11 +839,11 @@ LoadNote: ; e83d1 HandleTrackVibrato: ; e8466 ; handle duty, cry pitch, and vibrato - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc bit SOUND_DUTY, [hl] ; duty jr z, .next - ld hl, Channel1SFXDutyLoop - wChannel1 + ld hl, wChannel1SFXDutyLoop - wChannel1 add hl, bc ld a, [hl] rlca @@ -851,15 +851,15 @@ HandleTrackVibrato: ; e8466 ld [hl], a and $c0 ld [wCurTrackDuty], a - ld hl, Channel1NoteFlags - wChannel1 + ld hl, wChannel1NoteFlags - wChannel1 add hl, bc set NOTE_DUTY_OVERRIDE, [hl] .next - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc bit SOUND_CRY_PITCH, [hl] jr z, .vibrato - ld hl, Channel1CryPitch - wChannel1 + ld hl, wChannel1CryPitch - wChannel1 add hl, bc ld e, [hl] inc hl @@ -877,19 +877,19 @@ HandleTrackVibrato: ; e8466 ld [hl], d .vibrato ; is vibrato on? - ld hl, Channel1Flags2 - wChannel1 + 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 - wChannel1 + ld hl, wChannel1VibratoDelayCount - wChannel1 add hl, bc ld a, [hl] and a jr nz, .subexit ; is the extent nonzero? - ld hl, Channel1VibratoExtent - wChannel1 + ld hl, wChannel1VibratoExtent - wChannel1 add hl, bc ld a, [hl] and a @@ -897,7 +897,7 @@ HandleTrackVibrato: ; e8466 ; save it for later ld d, a ; is it time to toggle vibrato up/down? - ld hl, Channel1VibratoRate - wChannel1 + ld hl, wChannel1VibratoRate - wChannel1 add hl, bc ld a, [hl] and $f ; count @@ -916,7 +916,7 @@ HandleTrackVibrato: ; e8466 ld a, [wCurTrackFrequency] ld e, a ; toggle vibrato up/down - ld hl, Channel1Flags3 - wChannel1 + ld hl, wChannel1Flags3 - wChannel1 add hl, bc bit SOUND_VIBRATO_DIR, [hl] ; vibrato up/down jr z, .down @@ -948,7 +948,7 @@ HandleTrackVibrato: ; e8466 .no_carry ld [wCurTrackFrequency], a ; - ld hl, Channel1NoteFlags - wChannel1 + ld hl, wChannel1NoteFlags - wChannel1 add hl, bc set NOTE_VIBRATO_OVERRIDE, [hl] .quit @@ -958,23 +958,23 @@ HandleTrackVibrato: ; e8466 ApplyPitchWheel: ; e84f9 ; quit if pitch wheel inactive - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc bit SOUND_PITCH_WHEEL, [hl] ret z ; de = Frequency - ld hl, Channel1Frequency - wChannel1 + 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 - wChannel1 + ld hl, wChannel1Flags3 - wChannel1 add hl, bc bit SOUND_PITCH_WHEEL_DIR, [hl] jr z, .decreasing ; frequency += [Channel*PitchWheelAmount] - ld hl, Channel1PitchWheelAmount - wChannel1 + ld hl, wChannel1PitchWheelAmount - wChannel1 add hl, bc ld l, [hl] ld h, 0 @@ -983,10 +983,10 @@ ApplyPitchWheel: ; e84f9 ld e, l ; [Channel*Field25] += [Channel*PitchWheelAmountFraction] ; if rollover: Frequency += 1 - ld hl, Channel1PitchWheelAmountFraction - wChannel1 + ld hl, wChannel1PitchWheelAmountFraction - wChannel1 add hl, bc ld a, [hl] - ld hl, Channel1Field25 - wChannel1 + ld hl, wChannel1Field25 - wChannel1 add hl, bc add [hl] ld [hl], a @@ -999,13 +999,13 @@ ApplyPitchWheel: ; e84f9 ; 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 - wChannel1 + 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 - wChannel1 + ld hl, wChannel1PitchWheelTarget - wChannel1 add hl, bc ld a, [hl] cp e @@ -1015,7 +1015,7 @@ ApplyPitchWheel: ; e84f9 .decreasing ; frequency -= [Channel*PitchWheelAmount] ld a, e - ld hl, Channel1PitchWheelAmount - wChannel1 + ld hl, wChannel1PitchWheelAmount - wChannel1 add hl, bc ld e, [hl] sub e @@ -1025,7 +1025,7 @@ ApplyPitchWheel: ; e84f9 ld d, a ; [Channel*Field25] *= 2 ; if rollover: Frequency -= 1 - ld hl, Channel1PitchWheelAmountFraction - wChannel1 + ld hl, wChannel1PitchWheelAmountFraction - wChannel1 add hl, bc ld a, [hl] add a @@ -1039,33 +1039,33 @@ ApplyPitchWheel: ; e84f9 ; 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 - wChannel1 + 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 - wChannel1 + ld hl, wChannel1PitchWheelTarget - wChannel1 add hl, bc ld a, e cp [hl] jr nc, .continue_pitch_wheel .finished_pitch_wheel - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc res SOUND_PITCH_WHEEL, [hl] - ld hl, Channel1Flags3 - wChannel1 + ld hl, wChannel1Flags3 - wChannel1 add hl, bc res SOUND_PITCH_WHEEL_DIR, [hl] ret .continue_pitch_wheel - ld hl, Channel1Frequency - wChannel1 + ld hl, wChannel1Frequency - wChannel1 add hl, bc ld [hl], e inc hl ld [hl], d - ld hl, Channel1NoteFlags - wChannel1 + ld hl, wChannel1NoteFlags - wChannel1 add hl, bc set NOTE_FREQ_OVERRIDE, [hl] set NOTE_DUTY_OVERRIDE, [hl] @@ -1075,16 +1075,16 @@ ApplyPitchWheel: ; e84f9 HandleNoise: ; e858c ; is noise sampling on? - ld hl, Channel1Flags - wChannel1 + 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 @@ ReadNoiseSample: ; e85af ; 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 @@ ReadNoiseSample: ; e85af xor a ld [wCurTrackFrequency + 1], a - ld hl, NoiseSampleAddress + ld hl, wNoiseSampleAddress ld [hl], e inc hl ld [hl], d - ld hl, Channel1NoteFlags - wChannel1 + ld hl, wChannel1NoteFlags - wChannel1 add hl, bc set NOTE_NOISE_SAMPLING, [hl] ret @@ -1166,9 +1166,9 @@ ParseMusic: ; e85e1 jr ParseMusic ; start over .readnote -; CurMusicByte contains current note +; wCurMusicByte contains current note ; special notes - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc bit SOUND_SFX, [hl] jp nz, ParseSFXOrRest @@ -1178,65 +1178,65 @@ ParseMusic: ; e85e1 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 - wChannel1 + ld hl, wChannel1Pitch - wChannel1 add hl, bc ld [hl], a ; store pitch in e ld e, a ; store octave in d - ld hl, Channel1Octave - wChannel1 + ld hl, wChannel1Octave - wChannel1 add hl, bc ld d, [hl] ; update frequency call GetFrequency - ld hl, Channel1Frequency - wChannel1 + ld hl, wChannel1Frequency - wChannel1 add hl, bc ld [hl], e inc hl ld [hl], d ; ???? - ld hl, Channel1NoteFlags - wChannel1 + ld hl, wChannel1NoteFlags - wChannel1 add hl, bc set NOTE_NOISE_SAMPLING, [hl] jp LoadNote .rest ; note = rest - ld hl, Channel1NoteFlags - wChannel1 + ld hl, wChannel1NoteFlags - wChannel1 add hl, bc set NOTE_REST, [hl] ; Rest ret .endchannel ; $ff is reached in music data - ld hl, Channel1Flags - wChannel1 + 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 - wChannel1 + ld hl, wChannel5Flags - wChannel1 add hl, bc bit SOUND_CHANNEL_ON, [hl] jr nz, .ok .chan_5to8 - ld hl, Channel1Flags - wChannel1 + 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 @@ ParseMusic: ; e85e1 .ok ; stop playing ; turn channel off - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc res SOUND_CHANNEL_ON, [hl] ; note = rest - ld hl, Channel1NoteFlags - wChannel1 + ld hl, wChannel1NoteFlags - wChannel1 add hl, bc set NOTE_REST, [hl] ; clear music id & bank - ld hl, Channel1MusicID - wChannel1 + ld hl, wChannel1MusicID - wChannel1 add hl, bc xor a ld [hli], a ; id hi @@ -1265,51 +1265,51 @@ ParseMusic: ; e85e1 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 a, [wLastVolume] ld [wVolume], a xor a - ld [LastVolume], a - ld [SFXPriority], a + ld [wLastVolume], a + ld [wSFXPriority], a ret ; e8698 ParseSFXOrRest: ; e8698 ; turn noise sampling on - ld hl, Channel1NoteFlags - wChannel1 + 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 - wChannel1 + ld hl, wChannel1Intensity - wChannel1 add hl, bc ld [hl], a ; update lo frequency from next param call GetMusicByte - ld hl, Channel1FrequencyLo - wChannel1 + 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 - wChannel1 + ld hl, wChannel1FrequencyHi - wChannel1 add hl, bc ld [hl], a ret @@ -1317,29 +1317,29 @@ ParseSFXOrRest: ; e8698 ; 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 @@ GetNoiseSample: ; e86c5 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 @@ GetNoiseSample: ; e86c5 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 @@ GetNoiseSample: ; e86c5 ParseMusicCommand: ; e870f ; reload command - ld a, [CurMusicByte] + ld a, [wCurMusicByte] ; get command # sub $d0 ; first command ld e, a @@ -1462,16 +1462,16 @@ Music_EndChannel: ; e8781 ; end music stream ; return to caller of the subroutine ; reset subroutine flag - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc res SOUND_SUBROUTINE, [hl] ; copy LastMusicAddress to MusicAddress - ld hl, Channel1LastMusicAddress - wChannel1 + ld hl, wChannel1LastMusicAddress - wChannel1 add hl, bc ld e, [hl] inc hl ld d, [hl] - ld hl, Channel1MusicAddress - wChannel1 + ld hl, wChannel1MusicAddress - wChannel1 add hl, bc ld [hl], e inc hl @@ -1490,25 +1490,25 @@ Music_CallChannel: ; e8796 ld d, a push de ; copy MusicAddress to LastMusicAddress - ld hl, Channel1MusicAddress - wChannel1 + ld hl, wChannel1MusicAddress - wChannel1 add hl, bc ld e, [hl] inc hl ld d, [hl] - ld hl, Channel1LastMusicAddress - wChannel1 + ld hl, wChannel1LastMusicAddress - wChannel1 add hl, bc ld [hl], e inc hl ld [hl], d ; load pointer into MusicAddress pop de - ld hl, Channel1MusicAddress - wChannel1 + ld hl, wChannel1MusicAddress - wChannel1 add hl, bc ld [hl], e inc hl ld [hl], d ; set subroutine flag - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc set SOUND_SUBROUTINE, [hl] ret @@ -1523,7 +1523,7 @@ Music_JumpChannel: ; e87bc ld e, a call GetMusicByte ld d, a - ld hl, Channel1MusicAddress - wChannel1 + ld hl, wChannel1MusicAddress - wChannel1 add hl, bc ld [hl], e inc hl @@ -1542,7 +1542,7 @@ Music_LoopChannel: ; e87cc ; get loop count call GetMusicByte - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc bit SOUND_LOOPING, [hl] ; has the loop been initiated? jr nz, .checkloop @@ -1551,11 +1551,11 @@ Music_LoopChannel: ; e87cc ; initiate loop dec a set SOUND_LOOPING, [hl] ; set loop flag - ld hl, Channel1LoopCount - wChannel1 + ld hl, wChannel1LoopCount - wChannel1 add hl, bc ld [hl], a ; store loop counter .checkloop - ld hl, Channel1LoopCount - wChannel1 + ld hl, wChannel1LoopCount - wChannel1 add hl, bc ld a, [hl] and a ; are we done? @@ -1568,7 +1568,7 @@ Music_LoopChannel: ; e87cc call GetMusicByte ld d, a ; load new pointer into MusicAddress - ld hl, Channel1MusicAddress - wChannel1 + ld hl, wChannel1MusicAddress - wChannel1 add hl, bc ld [hl], e inc hl @@ -1577,11 +1577,11 @@ Music_LoopChannel: ; e87cc .endloop ; reset loop flag - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc res SOUND_LOOPING, [hl] ; skip to next command - ld hl, Channel1MusicAddress - wChannel1 + ld hl, wChannel1MusicAddress - wChannel1 add hl, bc ld e, [hl] inc hl @@ -1603,7 +1603,7 @@ Music_SetCondition: ; e880e ; set condition call GetMusicByte - ld hl, Channel1Condition - wChannel1 + ld hl, wChannel1Condition - wChannel1 add hl, bc ld [hl], a ret @@ -1621,13 +1621,13 @@ Music_JumpIf: ; e8817 ; a = condition call GetMusicByte ; if existing condition matches, jump to new address - ld hl, Channel1Condition - wChannel1 + ld hl, wChannel1Condition - wChannel1 add hl, bc cp [hl] jr z, .jump ; skip to next command ; get address - ld hl, Channel1MusicAddress - wChannel1 + ld hl, wChannel1MusicAddress - wChannel1 add hl, bc ld e, [hl] inc hl @@ -1649,7 +1649,7 @@ Music_JumpIf: ; e8817 call GetMusicByte ld d, a ; update pointer in MusicAddress - ld hl, Channel1MusicAddress - wChannel1 + ld hl, wChannel1MusicAddress - wChannel1 add hl, bc ld [hl], e inc hl @@ -1667,12 +1667,12 @@ MusicEE; e883e ; 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 @@ MusicEE; e883e jr nz, .jump ; skip to next command ; get address - ld hl, Channel1MusicAddress - wChannel1 + ld hl, wChannel1MusicAddress - wChannel1 add hl, bc ld e, [hl] inc hl @@ -1703,7 +1703,7 @@ MusicEE; e883e call GetMusicByte ld d, a ; update address - ld hl, Channel1MusicAddress - wChannel1 + ld hl, wChannel1MusicAddress - wChannel1 add hl, bc ld [hl], e inc hl @@ -1726,10 +1726,10 @@ MusicE2: ; e8873 ; seems to have been dummied out ; params: 1 call GetMusicByte - ld hl, Channel1Field2c - wChannel1 + ld hl, wChannel1Field2c - wChannel1 add hl, bc ld [hl], a - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc set SOUND_UNKN_0B, [hl] ret @@ -1746,28 +1746,28 @@ Music_Vibrato: ; e8882 ; z: rate (# frames per cycle) ; set vibrato flag? - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc set SOUND_VIBRATO, [hl] ; start at lower frequency (extent is positive) - ld hl, Channel1Flags3 - wChannel1 + ld hl, wChannel1Flags3 - wChannel1 add hl, bc res SOUND_VIBRATO_DIR, [hl] ; get delay call GetMusicByte ; update delay - ld hl, Channel1VibratoDelay - wChannel1 + ld hl, wChannel1VibratoDelay - wChannel1 add hl, bc ld [hl], a ; update delay count - ld hl, Channel1VibratoDelayCount - wChannel1 + ld hl, wChannel1VibratoDelayCount - wChannel1 add hl, bc ld [hl], a ; update extent ; this is split into halves only to get added back together at the last second ; get extent/rate call GetMusicByte - ld hl, Channel1VibratoExtent - wChannel1 + ld hl, wChannel1VibratoExtent - wChannel1 add hl, bc ld d, a ; get top nybble @@ -1780,7 +1780,7 @@ Music_Vibrato: ; e8882 or e ld [hl], a ; update rate - ld hl, Channel1VibratoRate - wChannel1 + ld hl, wChannel1VibratoRate - wChannel1 add hl, bc ; get bottom nybble ld a, d @@ -1813,13 +1813,13 @@ Music_SlidePitchTo: ; e88bd and $f ld d, a call GetFrequency - ld hl, Channel1PitchWheelTarget - wChannel1 + ld hl, wChannel1PitchWheelTarget - wChannel1 add hl, bc ld [hl], e - ld hl, Channel1PitchWheelTarget + 1 - wChannel1 + ld hl, wChannel1PitchWheelTarget + 1 - wChannel1 add hl, bc ld [hl], d - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc set SOUND_PITCH_WHEEL, [hl] ret @@ -1829,10 +1829,10 @@ Music_SlidePitchTo: ; e88bd Music_Tone: ; e88e4 ; tone ; params: 1 (dw) - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc set SOUND_CRY_PITCH, [hl] - ld hl, Channel1CryPitch + 1 - wChannel1 + ld hl, wChannel1CryPitch + 1 - wChannel1 add hl, bc call GetMusicByte ld [hld], a @@ -1845,11 +1845,11 @@ Music_Tone: ; e88e4 MusicE7: ; e88f7 ; unused ; params: 1 - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc set SOUND_UNKN_0E, [hl] call GetMusicByte - ld hl, Channel1Field29 - wChannel1 + ld hl, wChannel1Field29 - wChannel1 add hl, bc ld [hl], a ret @@ -1859,19 +1859,19 @@ MusicE7: ; e88f7 Music_SoundDuty: ; e8906 ; sequence of 4 duty cycles to be looped ; params: 1 (4 2-bit duty cycle arguments) - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc set SOUND_DUTY, [hl] ; duty cycle ; sound duty sequence call GetMusicByte rrca rrca - ld hl, Channel1SFXDutyLoop - wChannel1 + ld hl, wChannel1SFXDutyLoop - wChannel1 add hl, bc ld [hl], a ; update duty cycle and $c0 ; only uses top 2 bits - ld hl, Channel1DutyCycle - wChannel1 + ld hl, wChannel1DutyCycle - wChannel1 add hl, bc ld [hl], a ret @@ -1881,11 +1881,11 @@ Music_SoundDuty: ; e8906 MusicE8: ; e891e ; unused ; params: 1 - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc set SOUND_UNKN_0D, [hl] call GetMusicByte - ld hl, Channel1Field2a - wChannel1 + ld hl, wChannel1Field2a - wChannel1 add hl, bc ld [hl], a ret @@ -1895,7 +1895,7 @@ MusicE8: ; e891e Music_ToggleSFX: ; e892d ; toggle something ; params: none - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc bit SOUND_SFX, [hl] jr z, .on @@ -1915,7 +1915,7 @@ Music_ToggleNoise: ; e893b ; noise on: 1 ; noise off: 0 ; check if noise sampling is on - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc bit SOUND_NOISE, [hl] jr z, .on @@ -1927,7 +1927,7 @@ Music_ToggleNoise: ; e893b ; turn noise sampling on set SOUND_NOISE, [hl] call GetMusicByte - ld [MusicNoiseSampleSet], a + ld [wMusicNoiseSampleSet], a ret ; e894f @@ -1938,7 +1938,7 @@ Music_SFXToggleNoise: ; e894f ; on: 1 ; off: 0 ; check if noise sampling is on - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc bit SOUND_NOISE, [hl] jr z, .on @@ -1950,7 +1950,7 @@ Music_SFXToggleNoise: ; e894f ; turn noise sampling on set SOUND_NOISE, [hl] call GetMusicByte - ld [SFXNoiseSampleSet], a + ld [wSFXNoiseSampleSet], a ret ; e8963 @@ -1962,10 +1962,10 @@ Music_NoteType: ; e8963 ; params: 2 ; note length call GetMusicByte - ld hl, Channel1NoteLength - wChannel1 + 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 @@ Music_SoundStatus: ; e8977 ; update sound status ; params: 1 call GetMusicByte - ld [SoundInput], a - ld hl, Channel1NoteFlags - wChannel1 + ld [wSoundInput], a + ld hl, wChannel1NoteFlags - wChannel1 add hl, bc set NOTE_UNKN_3, [hl] ret @@ -1994,7 +1994,7 @@ Music_DutyCycle: ; e8984 rrca rrca and $c0 - ld hl, Channel1DutyCycle - wChannel1 + ld hl, wChannel1DutyCycle - wChannel1 add hl, bc ld [hl], a ret @@ -2007,7 +2007,7 @@ Music_Intensity: ; e8991 ; hi: pressure ; lo: velocity call GetMusicByte - ld hl, Channel1Intensity - wChannel1 + ld hl, wChannel1Intensity - wChannel1 add hl, bc ld [hl], a ret @@ -2036,9 +2036,9 @@ Music_Octave3: ; e89a6 Music_Octave2: ; e89a6 Music_Octave1: ; e89a6 ; set octave based on lo nybble of the command - ld hl, Channel1Octave - wChannel1 + ld hl, wChannel1Octave - wChannel1 add hl, bc - ld a, [CurMusicByte] + ld a, [wCurMusicByte] and 7 ld [hl], a ret @@ -2050,7 +2050,7 @@ Music_ForceOctave: ; e89b1 ; this forces all notes up by the starting octave ; params: 1 call GetMusicByte - ld hl, Channel1PitchOffset - wChannel1 + ld hl, wChannel1PitchOffset - wChannel1 add hl, bc ld [hl], a ret @@ -2061,7 +2061,7 @@ Music_StereoPanning: ; e89ba ; 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 @@ Music_Panning: ; e89c5 ; params: 1 call SetLRTracks call GetMusicByte - ld hl, Channel1Tracks - wChannel1 + ld hl, wChannel1Tracks - wChannel1 add hl, bc and [hl] ld [hl], a @@ -2090,11 +2090,11 @@ Music_Volume: ; e89d2 ; 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 [wVolume], a ret @@ -2116,7 +2116,7 @@ Music_TempoRelative: ; e89e1 .negative ld d, -1 .ok - ld hl, Channel1Tempo - wChannel1 + ld hl, wChannel1Tempo - wChannel1 add hl, bc ld a, [hli] ld h, [hl] @@ -2133,7 +2133,7 @@ Music_SFXPriorityOn: ; e89fd ; turn sfx priority on ; params: none ld a, 1 - ld [SFXPriority], a + ld [wSFXPriority], a ret ; e8a03 @@ -2142,7 +2142,7 @@ Music_SFXPriorityOff: ; e8a03 ; turn sfx priority off ; params: none xor a - ld [SFXPriority], a + ld [wSFXPriority], a ret ; e8a08 @@ -2156,17 +2156,17 @@ Music_RestartChannel: ; e8a08 ; zzyy: pointer to new music data ; update music id - ld hl, Channel1MusicID - wChannel1 + 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 - wChannel1 + 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 @@ GetMusicByte: ; e8a3e push hl push de ; load address into de - ld hl, Channel1MusicAddress - wChannel1 + ld hl, wChannel1MusicAddress - wChannel1 add hl, bc ld a, [hli] ld e, a ld d, [hl] ; load bank into a - ld hl, Channel1MusicBank - wChannel1 + 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 - wChannel1 + ld hl, wChannel1MusicAddress - wChannel1 add hl, bc ld a, e ld [hli], a @@ -2227,7 +2227,7 @@ GetMusicByte: ; e8a3e pop de pop hl ; store channeldata in a - ld a, [CurMusicByte] + ld a, [wCurMusicByte] ret ; e8a5d @@ -2242,7 +2242,7 @@ GetFrequency: ; e8a5d ; get octave ; get starting octave - ld hl, Channel1PitchOffset - wChannel1 + ld hl, wChannel1PitchOffset - wChannel1 add hl, bc ld a, [hl] swap a ; hi nybble @@ -2251,7 +2251,7 @@ GetFrequency: ; e8a5d add d push af ; we'll use this later ; get starting octave - ld hl, Channel1PitchOffset - wChannel1 + ld hl, wChannel1PitchOffset - wChannel1 add hl, bc ld a, [hl] and $f ; lo nybble @@ -2293,7 +2293,7 @@ SetNoteDuration: ; e8a8d ld e, a ld d, 0 ; store NoteLength in a - ld hl, Channel1NoteLength - wChannel1 + ld hl, wChannel1NoteLength - wChannel1 add hl, bc ld a, [hl] ; multiply NoteLength by delay units @@ -2301,13 +2301,13 @@ SetNoteDuration: ; e8a8d call .Multiply ld a, l ; low ; store Tempo in de - ld hl, Channel1Tempo - wChannel1 + ld hl, wChannel1Tempo - wChannel1 add hl, bc ld e, [hl] inc hl ld d, [hl] ; add ???? to the next result - ld hl, Channel1Field16 - wChannel1 + ld hl, wChannel1Field16 - wChannel1 add hl, bc ld l, [hl] ; multiply Tempo by last result (NoteLength * LOW(delay)) @@ -2316,11 +2316,11 @@ SetNoteDuration: ; e8a8d ld e, l ld d, h ; store result in ???? - ld hl, Channel1Field16 - wChannel1 + ld hl, wChannel1Field16 - wChannel1 add hl, bc ld [hl], e ; store result in NoteDuration - ld hl, Channel1NoteDuration - wChannel1 + ld hl, wChannel1NoteDuration - wChannel1 add hl, bc ld [hl], d ret @@ -2353,7 +2353,7 @@ SetNoteDuration: ; e8a8d 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, wChannel1 @@ -2385,14 +2385,14 @@ Tempo: ; e8b03 ; input: ; de: note length ; update Tempo - ld hl, Channel1Tempo - wChannel1 + ld hl, wChannel1Tempo - wChannel1 add hl, bc ld [hl], e inc hl ld [hl], d ; clear ???? xor a - ld hl, Channel1Field16 - wChannel1 + ld hl, wChannel1Field16 - wChannel1 add hl, bc ld [hl], a ret @@ -2401,7 +2401,7 @@ Tempo: ; e8b03 StartChannel: ; e8b11 call SetLRTracks - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc set SOUND_CHANNEL_ON, [hl] ; turn channel on ret @@ -2413,7 +2413,7 @@ SetLRTracks: ; e8b1b ; 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 @@ SetLRTracks: ; e8b1b add hl, de ; de = channel 0-3 ld a, [hl] ; load lr tracks into Tracks - ld hl, Channel1Tracks - wChannel1 + ld hl, wChannel1Tracks - wChannel1 add hl, bc ld [hl], a pop de @@ -2433,7 +2433,7 @@ SetLRTracks: ; e8b1b _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 @@ _PlayMusic:: ; e8b30 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 @@ _PlayMusic:: ; e8b30 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 @@ _PlayMusic:: ; e8b30 _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 @@ _PlayCry:: ; e8b79 add hl, de ld a, [hli] - ld [MusicBank], a + ld [wMusicBank], a ld e, [hl] inc hl @@ -2513,33 +2513,33 @@ _PlayCry:: ; e8b79 push af call LoadChannel - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc set SOUND_REST, [hl] - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc set SOUND_CRY_PITCH, [hl] - ld hl, Channel1CryPitch - wChannel1 + 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 - wChannel1 + 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 @@ _PlayCry:: ; e8b79 ; 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 - wChannel1 +; [Tracks] &= [wCryTracks] + ld hl, wChannel1Tracks - wChannel1 add hl, bc ld a, [hl] - ld hl, CryTracks + ld hl, wCryTracks and [hl] - ld hl, Channel1Tracks - wChannel1 + ld hl, wChannel1Tracks - wChannel1 add hl, bc ld [hl], a @@ -2570,18 +2570,18 @@ _PlayCry:: ; e8b79 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, [wVolume] - ld [LastVolume], a + ld [wLastVolume], a ld a, MAX_VOLUME ld [wVolume], a .end ld a, 1 ; stop playing music - ld [SFXPriority], a + ld [wSFXPriority], a call MusicOn ret @@ -2590,7 +2590,7 @@ _PlayCry:: ; e8b79 _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 @@ _PlaySFX:: ; e8c04 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 @@ _PlaySFX:: ; e8c04 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 @@ _PlaySFX:: ; e8c04 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 @@ _PlaySFX:: ; e8c04 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 @@ _PlaySFX:: ; e8c04 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 @@ _PlaySFX:: ; e8c04 .startchannels push af call LoadChannel ; bc = current channel - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc set SOUND_SFX, [hl] call StartChannel @@ -2683,7 +2683,7 @@ _PlaySFX:: ; e8c04 jr nz, .startchannels call MusicOn xor a - ld [SFXPriority], a + ld [wSFXPriority], a ret ; e8ca6 @@ -2694,12 +2694,12 @@ PlayStereoSFX:: ; e8ca6 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 @@ PlayStereoSFX:: ; e8ca6 ; bank ld a, [hli] - ld [MusicBank], a + ld [wMusicBank], a ; address ld e, [hl] inc hl @@ -2729,13 +2729,13 @@ PlayStereoSFX:: ; e8ca6 push af call LoadChannel - ld hl, Channel1Flags - wChannel1 + 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,30 +2745,30 @@ PlayStereoSFX:: ; e8ca6 ld hl, wStereoPanningMask and [hl] - ld hl, Channel1Tracks - wChannel1 + ld hl, wChannel1Tracks - wChannel1 add hl, bc ld [hl], a - ld hl, Channel1Field30 - wChannel1 + ld hl, wChannel1Field30 - wChannel1 add hl, bc ld [hl], a - ld a, [CryTracks] + ld a, [wCryTracks] cp 2 ; ch 1-2 jr c, .skip ; ch3-4 ld a, [wSFXDuration] - ld hl, Channel1Field2e - wChannel1 + ld hl, wChannel1Field2e - wChannel1 add hl, bc ld [hl], a - ld hl, Channel1Field2f - wChannel1 + ld hl, wChannel1Field2f - wChannel1 add hl, bc ld [hl], a - ld hl, Channel1Flags2 - wChannel1 + ld hl, wChannel1Flags2 - wChannel1 add hl, bc set SOUND_UNKN_0F, [hl] @@ -2776,7 +2776,7 @@ PlayStereoSFX:: ; e8ca6 pop de ; turn channel on - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc set SOUND_CHANNEL_ON, [hl] ; on @@ -2799,7 +2799,7 @@ LoadChannel: ; e8d1b 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 @@ LoadChannel: ; e8d1b ld c, [hl] inc hl ld b, [hl] ; bc = channel pointer - ld hl, Channel1Flags - wChannel1 + ld hl, wChannel1Flags - wChannel1 add hl, bc res SOUND_CHANNEL_ON, [hl] ; channel off call ChannelInit ; load music pointer - ld hl, Channel1MusicAddress - wChannel1 + ld hl, wChannel1MusicAddress - wChannel1 add hl, bc call LoadMusicByte ld [hli], a @@ -2822,16 +2822,16 @@ LoadChannel: ; e8d1b ld [hl], a inc de ; load music id - ld hl, Channel1MusicID - wChannel1 + 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 - wChannel1 + ld hl, wChannel1MusicBank - wChannel1 add hl, bc - ld a, [MusicBank] + ld a, [wMusicBank] ld [hl], a ret @@ -2845,7 +2845,7 @@ ChannelInit: ; e8d5b push de xor a ; get channel struct location and length - ld hl, Channel1MusicID - wChannel1 ; start + ld hl, wChannel1MusicID - wChannel1 ; start add hl, bc ld e, wChannel2 - wChannel1 ; channel struct length ; clear channel @@ -2854,14 +2854,14 @@ ChannelInit: ; e8d5b dec e jr nz, .loop ; set tempo to default ($100) - ld hl, Channel1Tempo - wChannel1 + ld hl, wChannel1Tempo - wChannel1 add hl, bc xor a ld [hli], a inc a ld [hl], a ; set note length to default ($1) (fast) - ld hl, Channel1NoteLength - wChannel1 + ld hl, wChannel1NoteLength - wChannel1 add hl, bc ld [hl], a pop de @@ -2873,10 +2873,10 @@ LoadMusicByte:: ; e8d76 ; 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 @@ INCLUDE "audio/drumkits.asm" 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 @@ -2973,7 +2973,7 @@ PlayTrainerEncounterMusic:: ; e900a ; 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 diff --git a/charmap.asm b/charmap.asm index 2835084162e..bd5813b002e 100644 --- a/charmap.asm +++ b/charmap.asm @@ -7,10 +7,10 @@ charmap "", $22 charmap "", $24 ; "" charmap "%", $25 ; soft linebreak in landmark names - charmap "", $38 ; RedsName - charmap "", $39 ; GreensName + charmap "", $38 ; wRedsName + charmap "", $39 ; wGreensName charmap "", $3f - charmap "", $49 ; MomsName + charmap "", $49 ; wMomsName charmap "", $4a ; "" charmap "<_CONT>", $4b ; implements "" charmap "", $4c @@ -18,8 +18,8 @@ charmap "", $4f charmap "@", $50 ; string terminator charmap "", $51 - charmap "", $52 ; PlayerName - charmap "", $53 ; RivalName + charmap "", $52 ; wPlayerName + charmap "", $53 ; wRivalName charmap "#", $54 ; "POKé" charmap "", $55 charmap "<……>", $56 ; "……" diff --git a/constants/audio_constants.asm b/constants/audio_constants.asm index 020fdd176cb..7aa0895a314 100755 --- a/constants/audio_constants.asm +++ b/constants/audio_constants.asm @@ -73,7 +73,7 @@ VOLUME_SO1_LEVEL EQU %00000111 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 @@ -84,5 +84,5 @@ SOUND_INPUT_GLOBAL_F EQU 7 DANGER_PITCH_F EQU 4 DANGER_ON_F EQU 7 -; MusicFade +; wMusicFade MUSIC_FADE_IN_F EQU 7 diff --git a/constants/battle_constants.asm b/constants/battle_constants.asm index 0bd719737e8..2355cc5d16b 100644 --- a/constants/battle_constants.asm +++ b/constants/battle_constants.asm @@ -27,7 +27,7 @@ EFFECTIVE EQU 10 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 @@ MOVE_LENGTH EQU const_value ; 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_value set 1 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 @@ const_value set 3 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 @@ ALL_STATUS EQU (1 << PSN) + (1 << BRN) + (1 << FRZ) + (1 << PAR) + SLP 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 @@ SUBSTATUS_CURLED EQU 0 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 @@ SUBSTATUS_CURLED EQU 0 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 @@ SUBSTATUS_CURLED EQU 0 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 diff --git a/constants/event_flags.asm b/constants/event_flags.asm index 4c7e9a5822d..9ee7ff40a29 100644 --- 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 diff --git a/constants/map_data_constants.asm b/constants/map_data_constants.asm index 7bb9dbd7067..2f1b690c34f 100644 --- a/constants/map_data_constants.asm +++ b/constants/map_data_constants.asm @@ -60,7 +60,7 @@ const_value set 1 const SOUTH_F const NORTH_F -; MapConnections +; wMapConnections const_def shift_const EAST shift_const WEST @@ -170,7 +170,7 @@ MAPOBJECT_SCREEN_WIDTH EQU 12 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 diff --git a/constants/pokemon_data_constants.asm b/constants/pokemon_data_constants.asm index cc9e4407b29..65015da6913 100644 --- 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_F75 EQU 75 percent 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 @@ GENDERLESS EQU 255 const FAST const SLOW -; BaseEggGroups values +; wBaseEggGroups values const_value set 1 const MONSTER ; 1 const AMPHIBIAN ; 2 @@ -68,37 +68,37 @@ NUM_DEX_ENTRY_BANKS EQU 4 ; 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 diff --git a/constants/script_constants.asm b/constants/script_constants.asm index fd5affce655..b72e50c1b63 100644 --- a/constants/script_constants.asm +++ b/constants/script_constants.asm @@ -5,9 +5,9 @@ LAST_TALKED EQU -2 ; 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 diff --git a/constants/sprite_constants.asm b/constants/sprite_constants.asm index 767d7a3c6c1..180be3323a9 100644 --- a/constants/sprite_constants.asm +++ b/constants/sprite_constants.asm @@ -149,7 +149,7 @@ const_value set $e0 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 diff --git a/constants/wram_constants.asm b/constants/wram_constants.asm index 6faa87be44b..074f8a7de78 100644 --- 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,19 +6,19 @@ const TEMPMON ; 3 const WILDMON ; 4 -; Options: (bits) ; cfcc +; wOptions: (bits) ; cfcc const_value set 4 const NO_TEXT_SCROLL ; 4 const STEREO ; 5 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,23 +30,23 @@ TEXT_DELAY_SLOW EQU 5 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 GBPRINTER_DARKER EQU $60 GBPRINTER_DARKEST EQU $7f -; WalkingDirection: ; d043 +; wWalkingDirection: ; d043 const_value set -1 const STANDING ; -1 const DOWN ; 0 @@ -60,14 +60,14 @@ UP_MASK EQU 1 << UP 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 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 @@ DARKNESS EQU 1 << DARKNESS_F 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 @@ SCRIPT_WAIT EQU 3 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 diff --git a/data/battle/battle_text.asm b/data/battle/battle_text.asm index eaff0201769..1a609b476f0 100644 --- a/data/battle/battle_text.asm +++ b/data/battle/battle_text.asm @@ -10,7 +10,7 @@ BattleText_PlayerPickedUpPayDayMoney: ; 0x80730 WildPokemonAppearedText: ; 0x80746 text "Wild @" - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text_start line "appeared!" prompt @@ -19,14 +19,14 @@ WildPokemonAppearedText: ; 0x80746 HookedPokemonAttackedText: ; 0x8075c text "The hooked" line "@" - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text_start cont "attacked!" prompt ; 0x80778 PokemonFellFromTreeText: ; 0x80778 - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text " fell" line "out of the tree!" prompt @@ -34,7 +34,7 @@ PokemonFellFromTreeText: ; 0x80778 WildCelebiAppearedText: ; 0x80793 text "Wild @" - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text_start line "appeared!" prompt @@ -48,7 +48,7 @@ WantsToBattleText:: ; 0x807a9 BattleText_WildFled: ; 0x807bd text "Wild @" - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text_start line "fled!" prompt @@ -56,7 +56,7 @@ BattleText_WildFled: ; 0x807bd BattleText_EnemyFled: ; 0x807cf text "Enemy @" - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text_start line "fled!" prompt @@ -110,7 +110,7 @@ BattleText_TargetRecoveredWithItem: ; 0x80880 text "" line "recovered with" cont "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." prompt ; 0x80899 @@ -119,7 +119,7 @@ BattleText_UserRecoveredPPUsing: ; 0x80899 text "" line "recovered PP using" cont "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." prompt ; 0x808b6 @@ -138,14 +138,14 @@ BattleText_SafeguardFaded: ; 0x808d2 ; 0x808e7 BattleText_PkmnLightScreenFell: ; 0x808e7 - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text " #MON's" line "LIGHT SCREEN fell!" prompt ; 0x80905 BattleText_PkmnReflectFaded: ; 0x80905 - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text " #MON's" line "REFLECT faded!" prompt @@ -188,7 +188,7 @@ BattleText_TheSandstormSubsided: ; 0x8098f BattleText_EnemyPkmnFainted: ; 0x809a8 text "Enemy @" - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text_start line "fainted!" prompt @@ -237,7 +237,7 @@ BattleText_0x80a4f: ; 0x80a4f ; 0x80a75 BattleText_PkmnFainted: ; 0x80a75 - text_from_ram BattleMonNick + text_from_ram wBattleMonNick text_start line "fainted!" prompt @@ -265,7 +265,7 @@ BattleText_EnemyIsAboutToUseWillPlayerChangePkmn: ; 0x80aca text "" line "is about to use" cont "@" - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text "." para "Will " @@ -277,7 +277,7 @@ BattleText_EnemySentOut: ; 0x80af8 text "" line "sent out" cont "@" - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text "!" done ; 0x80b0b @@ -313,7 +313,7 @@ BattleText_UserFledUsingAStringBuffer1: ; 0x80b89 text "" line "fled using a" cont "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!" prompt ; 0x80ba0 @@ -333,7 +333,7 @@ RecoveredUsingText: ; 0x80bc2 text "" line "recovered using a" cont "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!" prompt ; 0x80bde @@ -341,7 +341,7 @@ RecoveredUsingText: ; 0x80bc2 BattleText_UsersStringBuffer1Activated: ; 0x80bde text "'s" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text_start cont "activated!" prompt @@ -354,14 +354,14 @@ BattleText_ItemsCantBeUsedHere: ; 0x80bf3 ; 0x80c0d BattleText_PkmnIsAlreadyOut: ; 0x80c0d - text_from_ram BattleMonNick + text_from_ram wBattleMonNick text_start line "is already out." prompt ; 0x80c22 BattleText_PkmnCantBeRecalled: ; 0x80c22 - text_from_ram BattleMonNick + text_from_ram wBattleMonNick text_start line "can't be recalled!" prompt @@ -380,7 +380,7 @@ BattleText_TheMoveIsDisabled: ; 0x80c5b ; 0x80c72 BattleText_PkmnHasNoMovesLeft: ; 0x80c72 - text_from_ram BattleMonNick + text_from_ram wBattleMonNick text_start line "has no moves left!" done @@ -393,10 +393,10 @@ BattleText_TargetsEncoreEnded: ; 0x80c8a ; 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_StringBuffer1GrewToLevel: ; 0x80c9c BattleText_WildPkmnIsEating: ; 0x80cba text "Wild @" - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text_start line "is eating!" prompt @@ -412,7 +412,7 @@ BattleText_WildPkmnIsEating: ; 0x80cba BattleText_WildPkmnIsAngry: ; 0x80cd1 text "Wild @" - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text_start line "is angry!" prompt @@ -480,7 +480,7 @@ BecameConfusedText: ; 0x80d97 BattleText_ItemHealedConfusion: ; ItemHealedConfusion text "A @" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text " rid" line "" cont "of its confusion." @@ -497,7 +497,7 @@ BattleText_UsersHurtByStringBuffer1: ; 0x80de2 text "'s" line "hurt by" cont "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!" prompt ; 0x80df5 @@ -506,7 +506,7 @@ BattleText_UserWasReleasedFromStringBuffer1: ; 0x80df5 text "" line "was released from" cont "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!" prompt ; 0x80e11 @@ -560,7 +560,7 @@ HungOnText: ; 0x80e99 text "" line "hung on with" cont "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!" prompt ; 0x80eb0 @@ -588,49 +588,49 @@ InfatuationText: ; 0x80eda DisabledMoveText: ; 0x80f02 text "'s" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text " is" cont "DISABLED!" prompt ; 0x80f19 LoafingAroundText: ; 0x80f19 - text_from_ram BattleMonNick + text_from_ram wBattleMonNick text " is" line "loafing around." prompt ; 0x80f31 BeganToNapText: ; 0x80f31 - text_from_ram BattleMonNick + text_from_ram wBattleMonNick text " began" line "to nap!" prompt ; 0x80f44 WontObeyText: ; 0x80f44 - text_from_ram BattleMonNick + text_from_ram wBattleMonNick text " won't" line "obey!" prompt ; 0x80f54 TurnedAwayText: ; 0x80f54 - text_from_ram BattleMonNick + text_from_ram wBattleMonNick text " turned" line "away!" prompt ; 0x80f66 IgnoredOrdersText: ; 0x80f66 - text_from_ram BattleMonNick + text_from_ram wBattleMonNick text " ignored" line "orders!" prompt ; 0x80f7b IgnoredSleepingText: ; 0x80f7b - text_from_ram BattleMonNick + text_from_ram wBattleMonNick text " ignored" line "orders…sleeping!" prompt @@ -646,7 +646,7 @@ HasNoPPLeftText: ; 0x80fba text "" line "has no PP left for" cont "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "!" prompt ; 0x80fd7 @@ -758,7 +758,7 @@ SketchedText: ; 0x81143 text "" line "SKETCHED" cont "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!" prompt ; 0x81156 @@ -773,7 +773,7 @@ DestinyBondEffectText: ; 0x81156 SpiteEffectText: ; 0x8117f text "'s" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text " was" cont "reduced by @" deciram wd265, 1, 1 @@ -850,7 +850,7 @@ WasFrozenText: ; 0x8125d WontRiseAnymoreText: ; 0x81272 text "'s" line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text " won't" cont "rise anymore!" prompt @@ -859,7 +859,7 @@ WontRiseAnymoreText: ; 0x81272 WontDropAnymoreText: ; 0x8128f text "'s" line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text " won't" cont "drop anymore!" prompt @@ -885,14 +885,14 @@ BlownAwayText: ; 0x812d2 PlayerHitTimesText: ; 0x812e5 text "Hit @" - deciram PlayerDamageTaken, 1, 1 + deciram wPlayerDamageTaken, 1, 1 text " times!" prompt ; 0x812f8 EnemyHitTimesText: ; 0x812f8 text "Hit @" - deciram EnemyDamageTaken, 1, 1 + deciram wEnemyDamageTaken, 1, 1 text " times!" prompt ; 0x8130b @@ -957,7 +957,7 @@ LearnedMoveText: ; 0x813e6 text "" line "learned" cont "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!" prompt ; 0x813f8 @@ -977,7 +977,7 @@ EvadedText: ; 0x81407 WasDisabledText: ; 0x8141d text "'s" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text " was" cont "DISABLED!" prompt @@ -993,7 +993,7 @@ TransformedTypeText: ; 0x81452 text "" line "transformed into" cont "the @" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "-type!" prompt ; 0x81476 @@ -1008,7 +1008,7 @@ TransformedText: ; 0x81499 text "" line "TRANSFORMED into" cont "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!" prompt ; 0x814b4 @@ -1088,7 +1088,7 @@ ProtectedByText: ; 0x815a9 text "'s" line "protected by" cont "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!" prompt ; 0x815c1 @@ -1102,7 +1102,7 @@ MirrorMoveFailedText: ; 0x815c1 StoleText: ; 0x815da text "" line "stole @" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text_start cont "from its foe!" prompt @@ -1260,7 +1260,7 @@ ForesawAttackText: ; 0x81817 ; 0x8182d BeatUpAttackText: ; 0x8182d - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "'s" line "attack!" done diff --git a/data/common_text/common_text_1.asm b/data/common_text/common_text_1.asm index 38007bc43bf..80b47013d95 100644 --- a/data/common_text/common_text_1.asm +++ b/data/common_text/common_text_1.asm @@ -6,14 +6,14 @@ _FruitBearingTreeText:: _HeyItsFruitText:: text "Hey! It's" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done _ObtainedFruitText:: text "Obtained" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done @@ -38,7 +38,7 @@ UnknownText_0x1bc089:: done UnknownText_0x1bc0a2:: - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text_start line "recovered @" deciram wd1f3, 2, 3 @@ -46,59 +46,59 @@ UnknownText_0x1bc0a2:: 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 db "@@" UnknownText_0x1bc16e:: - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text " came" line "to its senses." done @@ -276,7 +276,7 @@ UnknownText_0x1bc4b2:: UnknownText_0x1bc4d7:: text "Put away the" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." prompt @@ -288,19 +288,19 @@ UnknownText_0x1bc4ec:: UnknownText_0x1bc509:: text "Set up the" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." prompt 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_0x1bc5b3:: UnknownText_0x1bc5d7:: text "It's an adorable" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done @@ -517,14 +517,14 @@ _OPT_OakText2:: _OPT_OakText3:: text_start line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." done _OPT_MaryText1:: text_start line "MARY: @" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "'s" done @@ -695,7 +695,7 @@ _OPT_PokemonChannelText:: _PokedexShowText:: text_start line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 db "@@" ; Pokémon Music Channel / Pokémusic @@ -793,7 +793,7 @@ _LC_Text8:: text_start line "Number is @" interpret_data - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!" done @@ -842,9 +842,9 @@ _PnP_Text3:: _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_odd:: _PnP_Text5:: text_start line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 db "@@" _RocketRadioText1:: @@ -1009,7 +1009,7 @@ _BuenaRadioText3:: _BuenaRadioText4:: text_start line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!" done @@ -1085,7 +1085,7 @@ Text_EnemyWithdrew:: text "" line "withdrew" cont "@" - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text "!" prompt @@ -1095,7 +1095,7 @@ Text_EnemyUsedOn:: text_from_ram wMonOrItemNameBuffer text_start cont "on @" - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text "!" prompt @@ -1111,7 +1111,7 @@ Text_ThatItemCantBePutInThePack:: 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_0x1bd05e:: UnknownText_0x1bd07f:: text "Will you play with" line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "?" done @@ -1173,7 +1173,7 @@ UnknownText_0x1bd11c:: UnknownText_0x1bd131:: text "Test event" line "@" - deciram StringBuffer2, 1, 2 + deciram wStringBuffer2, 1, 2 text "?" done @@ -1205,7 +1205,7 @@ UnknownText_0x1bd188:: UnknownText_0x1bd19a:: text "A new CARD arrived" line "from @" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "." done @@ -1215,10 +1215,10 @@ UnknownText_0x1bd1ba:: 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_0x1bd266:: 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_0x1bd308:: UnknownText_0x1bd321:: text " found" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done @@ -1298,10 +1298,10 @@ UnknownText_0x1bd331:: 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 @@ UnknownText_0x1bd39e:: 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 @@ UnknownText_0x1bd429:: text_from_ram wMonOrItemNameBuffer text " for" cont "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text ".@@" UnknownText_0x1bd445:: @@ -1356,12 +1356,12 @@ UnknownText_0x1bd449:: 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_0x1bd48c:: 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_0x1bd4aa:: 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_0x1bd4d2:: UnknownText_0x1bd4f4:: text "Hi, how's my old" line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text " doing?" done @@ -1399,12 +1399,12 @@ UnknownText_0x1bd512:: 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_0x1bd565:: 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 @@ UnknownText_0x1bd5cc:: para "I finally got" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." done @@ -1448,12 +1448,12 @@ UnknownText_0x1bd621:: 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_0x1bd673:: 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_0x1bd6cd:: 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_0x1bdcff:: UnknownText_0x1bdd30:: text "OK. I'll raise" line "your @" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." prompt @@ -1722,25 +1722,25 @@ UnknownText_0x1bdd64:: 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,14 +1752,14 @@ UnknownText_0x1bde04:: UnknownText_0x1bde1f:: text " got back" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." prompt 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." diff --git a/data/common_text/common_text_2.asm b/data/common_text/common_text_2.asm index bddd0d4703e..183d254fccb 100644 --- a/data/common_text/common_text_2.asm +++ b/data/common_text/common_text_2.asm @@ -27,7 +27,7 @@ UnknownText_0x1c00a0:: 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_0x1c019e:: 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,26 +90,26 @@ UnknownText_0x1c0272:: 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:: text_start line "a boosted" cont "@" - deciram StringBuffer2, 2, 4 + deciram wStringBuffer2, 2, 4 text " EXP. Points!" prompt Text_StringBuffer2ExpPoints:: text_start line "@" - deciram StringBuffer2, 2, 4 + deciram wStringBuffer2, 2, 4 text " EXP. Points!" prompt @@ -128,12 +128,12 @@ Text_YourFoesWeakGetmPkmn:: 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_0x1c0384:: 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,14 +191,14 @@ UnknownText_0x1c03fa:: text "You have no room" line "for any more" cont "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "S." prompt UnknownText_0x1c0421:: text "You received" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!" prompt @@ -236,7 +236,7 @@ UnknownText_0x1c04e9:: text_from_ram wMysteryGiftPartnerName text " sent" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." prompt @@ -244,7 +244,7 @@ UnknownText_0x1c04fa:: 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 @@ UnknownText_0x1c05c8:: prompt UnknownText_0x1c05dd:: - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text " used" line "CUT!" prompt @@ -309,7 +309,7 @@ UnknownText_0x1c0609:: db "@@" _UsedSurfText:: - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text " used" line "SURF!" done @@ -330,7 +330,7 @@ _AskSurfText:: done UnknownText_0x1c068e:: - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text " used" line "WATERFALL!" done @@ -346,7 +346,7 @@ UnknownText_0x1c06bf:: done UnknownText_0x1c06de:: - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text " used" line "DIG!" done @@ -379,13 +379,13 @@ UnknownText_0x1c0751:: 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 @@ UnknownText_0x1c07f4:: done UnknownText_0x1c0816:: - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text " used" line "WHIRLPOOL!" prompt @@ -431,7 +431,7 @@ UnknownText_0x1c0864:: done UnknownText_0x1c0897:: - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text " did a" line "HEADBUTT!" prompt @@ -449,7 +449,7 @@ UnknownText_0x1c08bc:: done UnknownText_0x1c08f0:: - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text " used" line "ROCK SMASH!" prompt @@ -489,14 +489,14 @@ UnknownText_0x1c099a:: UnknownText_0x1c09b2:: text " got on the" line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "." done UnknownText_0x1c09c7:: text " got off" line "the @" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "." done @@ -515,7 +515,7 @@ UnknownText_0x1c0a05:: UnknownText_0x1c0a1c:: text " found" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done @@ -545,7 +545,7 @@ UnknownText_0x1c0aa9:: prompt UnknownText_0x1c0acc:: - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start line "fainted!" prompt @@ -559,7 +559,7 @@ UnknownText_0x1c0ada:: prompt UnknownText_0x1c0b03:: - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " used" line "SWEET SCENT!" done @@ -601,14 +601,14 @@ UnknownText_0x1c0bbb:: deciram wItemQuantityChangeBuffer, 1, 2 text_start line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "(S)?" done UnknownText_0x1c0bd8:: text "Threw away" line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "(S)." prompt @@ -626,7 +626,7 @@ Text_YouDontHaveAPkmn:: UnknownText_0x1c0c2e:: text "Registered the" line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "." prompt @@ -657,7 +657,7 @@ Text_AreYouABoyOrAreYouAGirl:: UnknownText_0x1c0cc6:: text "'s" line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 db "@@" UnknownText_0x1c0cd0:: @@ -672,7 +672,7 @@ UnknownText_0x1c0ce0:: UnknownText_0x1c0ceb:: text "'s" line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 db "@@" UnknownText_0x1c0cf5:: @@ -733,7 +733,7 @@ _UsedInsteadText:: cont "@@" _MoveNameText:: - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 db "@@" _EndUsedMove1Text:: @@ -766,7 +766,7 @@ UnknownText_0x1c0db8:: 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_0x1c0dba:: UnknownText_0x1c0dd8:: text "Give a nickname to" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "?" done @@ -804,28 +804,28 @@ UnknownText_0x1c0e54:: UnknownText_0x1c0e6f:: text "It has no interest" line "in @" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." prompt UnknownText_0x1c0e8d:: text "It appears to care" line "for @" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." prompt UnknownText_0x1c0eac:: text "It's friendly with" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." prompt UnknownText_0x1c0ec6:: text "It shows interest" line "in @" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." prompt @@ -874,10 +874,10 @@ UnknownText_0x1c0fb8:: 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 @@ UnknownText_0x1c0fdd:: 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_0x1c10a2:: UnknownText_0x1c10c0:: text "Caught @" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!" prompt @@ -935,7 +935,7 @@ UnknownText_0x1c10cf:: UnknownText_0x1c10dd:: text "You already caught" line "a @" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." prompt @@ -950,7 +950,7 @@ ContestJudging_FirstPlaceText:: text "," line "who caught a" cont "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!@@" ContestJudging_FirstPlaceScoreText:: @@ -970,7 +970,7 @@ ContestJudging_SecondPlaceText:: para "who caught a" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!@@" ContestJudging_SecondPlaceScoreText:: @@ -990,7 +990,7 @@ ContestJudging_ThirdPlaceText:: para "who caught a" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "!@@" ContestJudging_ThirdPlaceScoreText:: @@ -1008,7 +1008,7 @@ UnknownText_0x1c1203:: para "…Hm, it measures" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." prompt @@ -1016,7 +1016,7 @@ UnknownText_0x1c123a:: text "CURRENT RECORD" para "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text " caught by" line "@" text_from_ram wMagikarpRecordHoldersName @@ -1030,7 +1030,7 @@ UnknownText_0x1c1261:: 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 @@ UnknownText_0x1c12ae:: 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_0x1c12ae:: 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 @@ _KrissPCWithdrewItemsText:: deciram wItemQuantityChangeBuffer, 1, 2 text_start line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "(S)." prompt @@ -1104,7 +1104,7 @@ _KrissPCDepositItemsText:: deciram wItemQuantityChangeBuffer, 1, 2 text_start line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "(S)." prompt @@ -1161,10 +1161,10 @@ _OakPCText2:: 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_0x1c1a6c:: UnknownText_0x1c1a90:: text "Toss out how many" line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "(S)?" done @@ -1361,14 +1361,14 @@ UnknownText_0x1c1aad:: deciram wItemQuantityChangeBuffer, 1, 2 text_start line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "(S)?" done UnknownText_0x1c1aca:: text "Discarded" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "(S)." prompt @@ -1388,12 +1388,12 @@ UnknownText_0x1c1b2c:: 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 @@ UnknownText_0x1c1b57:: text_from_ram wMonOrItemNameBuffer text_start line "hold @" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "." prompt @@ -1424,7 +1424,7 @@ UnknownText_0x1c1baa:: UnknownText_0x1c1bc4:: text "Took @" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text_start line "from @" text_from_ram wMonOrItemNameBuffer @@ -1437,7 +1437,7 @@ UnknownText_0x1c1bdc:: line "already holding" para "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." line "Switch items?" done @@ -1455,7 +1455,7 @@ UnknownText_0x1c1c22:: UnknownText_0x1c1c47:: text "MAIL detached from" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." prompt diff --git a/data/common_text/common_text_3.asm b/data/common_text/common_text_3.asm index 253fda4ac93..7724775a469 100644 --- a/data/common_text/common_text_3.asm +++ b/data/common_text/common_text_3.asm @@ -65,7 +65,7 @@ UnknownText_0x1c41b1:: 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 @@ UnknownText_0x1c4212:: text_from_ram wd004 text_start line "for @" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "?" done @@ -124,7 +124,7 @@ UnknownText_0x1c4298:: 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_0x1c439c:: 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_0x1c4508:: UnknownText_0x1c4525:: text "Today's remaining" line "time is @" - deciram StringBuffer2, 1, 2 + deciram wStringBuffer2, 1, 2 text " min." done @@ -257,23 +257,23 @@ UnknownText_0x1c4706:: UnknownText_0x1c4719:: text " received" line "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "." done UnknownText_0x1c472c:: text " 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_0x1c4ae5:: UnknownText_0x1c4b92:: text "Congratulations!" line "Your @" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 db "@@" UnknownText_0x1c4baf:: @@ -455,20 +455,20 @@ UnknownText_0x1c4baf:: 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 UnknownText_0x1c4be3:: text "What? @" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text_start line "is evolving!" done @@ -480,7 +480,7 @@ UnknownText_0x1c4bfd:: 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_0x1c4ca3:: 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 @@ UnknownText_0x1c4d47:: done UnknownText_0x1c4db0:: - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text " costs" line "¥@" deciram hMoneyTemp, 3, 6 @@ -592,7 +592,7 @@ UnknownText_0x1c4e7e:: 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 @@ UnknownText_0x1c502e:: deciram hMoneyTemp, 3, 6 text " for" line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "(S)." done @@ -705,7 +705,7 @@ UnknownText_0x1c5092:: UnknownText_0x1c509f:: text "lined up!" line "Won @" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text " coins!" done @@ -935,7 +935,7 @@ UnknownText_0x1c5660:: 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_0x1c5678:: UnknownText_0x1c5699:: text "Stop learning" line "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "?" done @@ -958,7 +958,7 @@ UnknownText_0x1c56af:: text_start line "did not learn" cont "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "." prompt @@ -967,7 +967,7 @@ UnknownText_0x1c56c9:: text " is" line "trying to learn" cont "@" - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "." para "But @" @@ -979,7 +979,7 @@ UnknownText_0x1c56c9:: 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 @@ UnknownText_0x1c574e:: text_from_ram wMonOrItemNameBuffer text " forgot" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "." para "And…" @@ -1077,7 +1077,7 @@ UnknownText_0x1c589f:: done UnknownText_0x1c58bc:: - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "?" line "Is that right?" done @@ -1148,7 +1148,7 @@ Text_OnlyThreePkmnMayBeEntered:: 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_ThePkmnMustAllBeDifferentKinds:: 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_0x1c5afa:: UnknownText_0x1c5b17:: text "Gotcha! @" - text_from_ram EnemyMonNick + text_from_ram wEnemyMonNick text_start line "was caught!@" sound_caught_mon @@ -1225,7 +1225,7 @@ UnknownText_0x1c5b38:: 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_0x1c5b53:: 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 @@ -1302,13 +1302,13 @@ Text_RestoreThePPOfWhichMove:: 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 @@ UnknownText_0x1c5d03:: text_start para "@" - text_from_ram PlayerName + text_from_ram wPlayerName text " sent the" line "trophy home." prompt @@ -1371,7 +1371,7 @@ UnknownText_0x1c5e01:: UnknownText_0x1c5e1d:: text "Can't get on your" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text " now." prompt @@ -1384,14 +1384,14 @@ UnknownText_0x1c5e3a:: UnknownText_0x1c5e68:: text " used the@" text_low - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "." done UnknownText_0x1c5e7b:: text " got on the@" text_low - text_from_ram StringBuffer2 + text_from_ram wStringBuffer2 text "." prompt @@ -1399,15 +1399,15 @@ UnknownText_0x1c5e90:: text " 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_0x1c5eba:: UnknownText_0x1c5eda:: text "Oh, make it forget" line "@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text "?" done diff --git a/data/default_options.asm b/data/default_options.asm index 4717dc2f071..7a4f7712828 100644 --- 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 diff --git a/data/maps/data.asm b/data/maps/data.asm index 0cdfb0826dc..6344f05723b 100644 --- a/data/maps/data.asm +++ b/data/maps/data.asm @@ -24,12 +24,12 @@ if "\1" == "north" ;\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 @@ if "\1" == "south" ;\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 @@ if "\1" == "west" ;\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 @@ if "\1" == "east" ;\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 diff --git a/data/phone/text/bill.asm b/data/phone/text/bill.asm index 2defde944ab..2eed7d98c4a 100644 --- a/data/phone/text/bill.asm +++ b/data/phone/text/bill.asm @@ -44,7 +44,7 @@ BillPhoneNotFullText: ; 0x1b452a para ", your BOX" line "has room for @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start cont "more #MON." @@ -59,7 +59,7 @@ BillPhoneNearlyFullText: ; 0x1b4587 para ", your BOX" line "has room for only" cont "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " more #MON." para "Maybe you should" diff --git a/data/phone/text/extra.asm b/data/phone/text/extra.asm index c7c4c2dfbb0..b4ae1d0c5fc 100644 --- a/data/phone/text/extra.asm +++ b/data/phone/text/extra.asm @@ -310,7 +310,7 @@ UnknownText_0x648dc: ; 0x648dc 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 @@ UnknownText_0x64a13: ; 0x64a13 line "here, I saw this" para "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " for the" line "first time." @@ -336,7 +336,7 @@ UnknownText_0x64a71: ; 0x64a71 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 @@ UnknownText_0x64ada: ; 0x64ada para "I'll be here on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x64b48 @@ -376,12 +376,12 @@ UnknownText_0x64b5f: ; 0x64b5f 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 @@ UnknownText_0x64c13: ; 0x64c13 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 @@ UnknownText_0x64c5a: ; 0x64c5a AlanGettingStrongerText: ; 0x64cbd text "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "'s" line "getting stronger," @@ -439,7 +439,7 @@ UnknownText_0x64cf3: ; 0x64cf3 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_0x64cf3: ; 0x64cf3 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 @@ UnknownText_0x64da4: ; 0x64da4 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 @@ UnknownText_0x64e2f: ; 0x64e2f 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 @@ UnknownText_0x64ed4: ; 0x64ed4 para "I'm waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x64f1a @@ -526,14 +526,14 @@ UnknownText_0x64f1a: ; 0x64f1a para "I'm waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x64f74 UnknownText_0x64f74: ; 0x64f74 text "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " is" line "getting prettier!" @@ -546,7 +546,7 @@ UnknownText_0x64fb2: ; 0x64fb2 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_0x64fb2: ; 0x64fb2 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_0x6501c: ; 0x6501c 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 @@ UnknownText_0x650ec: ; 0x650ec para "it! I'm waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x65161 @@ -630,7 +630,7 @@ UnknownText_0x651bf: ; 0x651bf para "I'm waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x6520f @@ -646,7 +646,7 @@ UnknownText_0x6520f: ; 0x6520f para "I'm waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x65271 @@ -655,7 +655,7 @@ ChadObservingWildText: ; 0x65271 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 @@ UnknownText_0x65318: ; 0x65318 line "to knock out a" para "wild @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " a" line "while back." @@ -694,7 +694,7 @@ UnknownText_0x65399: ; 0x65399 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 @@ UnknownText_0x65399: ; 0x65399 para "wanting to observe" line "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text ". Rats…" done ; 0x65419 @@ -717,7 +717,7 @@ UnknownText_0x65419: ; 0x65419 para "I'll be on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x65471 @@ -906,7 +906,7 @@ UnknownText_0x65a63: ; 0x65a63 para "The place is" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." para "Hurry over--I'm" @@ -917,7 +917,7 @@ UnknownText_0x65a63: ; 0x65a63 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 @@ UnknownText_0x65b29: ; 0x65b29 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_0x65b29: ; 0x65b29 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 @@ UnknownText_0x65da6: ; 0x65da6 para "I'm waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." para "Come pick this up" @@ -1030,7 +1030,7 @@ UnknownText_0x65da6: ; 0x65da6 TullyGrownText: ; 0x65de4 text "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " has" line "grown again." @@ -1045,7 +1045,7 @@ TullyGrownText: ; 0x65de4 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_0x65e42: ; 0x65e42 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 @@ UnknownText_0x65f17: ; 0x65f17 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 @@ UnknownText_0x65f88: ; 0x65f88 para "I'll be waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." done ; 0x65ff2 @@ -1126,7 +1126,7 @@ UnknownText_0x66043: ; 0x66043 para "Our battle will be" line "on @" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." done ; 0x66087 @@ -1137,7 +1137,7 @@ UnknownText_0x66087: ; 0x66087 para "Hustle over to" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." done ; 0x660be @@ -1162,7 +1162,7 @@ UnknownText_0x6613c: ; 0x6613c line "down this wild" para "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "." line "It wasn't rare" @@ -1202,7 +1202,7 @@ UnknownText_0x66214: ; 0x66214 para "You know where--" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." done ; 0x662a9 @@ -1318,14 +1318,14 @@ UnknownText_0x66579: ; 0x66579 para "Hurry over to" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." done ; 0x665ad UnknownText_0x665ad: ; 0x665ad text "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "'s" line "adorable, don't" @@ -1342,7 +1342,7 @@ UnknownText_0x66605: ; 0x66605 line "battle a wild" para "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " a while" line "ago…" @@ -1353,7 +1353,7 @@ UnknownText_0x66605: ; 0x66605 para "I hate those nasty" line "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "!" done ; 0x66688 @@ -1363,7 +1363,7 @@ UnknownText_0x66688: ; 0x66688 line "battle a wild" para "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " a while" line "ago…" @@ -1389,13 +1389,13 @@ UnknownText_0x66730: ; 0x66730 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 @@ UnknownText_0x66801: ; 0x66801 para "Come collect it on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." done ; 0x66882 @@ -1451,7 +1451,7 @@ UnknownText_0x668a3: ; 0x668a3 para "Please hurry to" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x6691d @@ -1466,14 +1466,14 @@ UnknownText_0x6691d: ; 0x6691d para "Please hurry to" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x66980 VanceLiftoffText: ; 0x66980 text "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "'s" line "become tougher." @@ -1485,7 +1485,7 @@ VanceLiftoffText: ; 0x66980 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_0x669b2: ; 0x669b2 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_0x669ed: ; 0x669ed 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 @@ VanceHurryHurryText: ; 0x66ad1 line "Hurry, hurry!" para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" line "FLY over now!" done @@ -1545,7 +1545,7 @@ VanceHurryHurryText: ; 0x66ad1 WiltonGrownText: ; 0x66afc text "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "'s" line "grown impressive!" @@ -1557,7 +1557,7 @@ WiltonGrownText: ; 0x66afc 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 @@ UnknownText_0x66b8f: ; 0x66b8f 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_0x66b8f: ; 0x66b8f 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 @@ UnknownText_0x66c6b: ; 0x66c6b para "Come pick it up on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." done ; 0x66ca7 @@ -1631,7 +1631,7 @@ WiltonNotBitingText: ; 0x66cf7 para "like before on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "…" para "You have to come" @@ -1647,7 +1647,7 @@ WiltonWantThisText: ; 0x66d45 line "know where?" para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "…" line "Just head from" @@ -1730,7 +1730,7 @@ UnknownText_0x66f52: ; 0x66f52 ParryNoMatchText: ; 0x66f9f text "Nothing can match" line "my @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " now." done ; 0x66fc0 @@ -1738,7 +1738,7 @@ ParryNoMatchText: ; 0x66f9f 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 @@ UnknownText_0x67001: ; 0x67001 line "spotted a wild" para "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "." line "We were debating" @@ -1775,7 +1775,7 @@ UnknownText_0x67096: ; 0x67096 para "Yep! We'll meet on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x670eb @@ -1795,7 +1795,7 @@ ParryBattleWithMeText: ; 0x67106 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 @@ ParryHaventYouGottenToText: ; 0x6712a ; 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 @@ UnknownText_0x671a4: ; 0x671a4 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 @@ UnknownText_0x671eb: ; 0x671eb 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 @@ UnknownText_0x6722e: ; 0x6722e para "I'll be waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x67281 @@ -1874,7 +1874,7 @@ ErinComeBattleText: ; 0x672d5 para "I'll be waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x67308 diff --git a/data/phone/text/extra2.asm b/data/phone/text/extra2.asm index f53c0ba25e8..88735353634 100644 --- a/data/phone/text/extra2.asm +++ b/data/phone/text/extra2.asm @@ -21,7 +21,7 @@ UnknownText_0x174000: ; 0x174000 JackIntelligenceText: ; 0x1740c0 text "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "'s" line "intelligence keeps" @@ -35,7 +35,7 @@ JackDefeatedMonText: ; 0x174106 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 @@ UnknownText_0x174165: ; 0x174165 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 @@ UnknownText_0x1741e1: ; 0x1741e1 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 @@ UnknownText_0x174638: ; 0x174638 para "I'll be at" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." done ; 0x174688 @@ -234,7 +234,7 @@ UnknownText_0x174638: ; 0x174638 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 @@ UnknownText_0x174734: ; 0x174734 line "showed it was" para "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text ". I was" line "quite miffed." done @@ -290,7 +290,7 @@ BeverlyFoundNuggetText: ; 0x1747cc para "I'll be at" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." para "Please come see me" @@ -315,7 +315,7 @@ UnknownText_0x174895: ; 0x174895 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 @@ UnknownText_0x1748ea: ; 0x1748ea line "last time!" para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "'s" line "where I'm waiting" @@ -361,7 +361,7 @@ UnknownText_0x1749c7: ; 0x1749c7 cont "about our battle!" para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" para "Hustle over quick!" @@ -371,14 +371,14 @@ UnknownText_0x1749c7: ; 0x1749c7 GavenGreaterText: ; 0x174a24 text "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text_start line "might be greater" cont "than I imagined." 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 @@ UnknownText_0x174a80: ; 0x174a80 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 @@ UnknownText_0x174b2d: ; 0x174b2d 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 @@ UnknownText_0x174bc5: ; 0x174bc5 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 @@ UnknownText_0x174c49: ; 0x174c49 para "I'll take you down" line "with @" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x174c7f @@ -465,11 +465,11 @@ UnknownText_0x174c49: ; 0x174c49 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_0x174c7f: ; 0x174c7f 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_0x174cf6: ; 0x174cf6 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 @@ UnknownText_0x174e4e: ; 0x174e4e line "for you around" para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." line "Look for me, OK?" done @@ -560,7 +560,7 @@ BethForgetDealText: ; 0x174ee2 line "deal?" para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." para "That's where I'm" @@ -571,7 +571,7 @@ BethForgetDealText: ; 0x174ee2 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 @@ UnknownText_0x174f90: ; 0x174f90 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_0x174f90: ; 0x174f90 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 @@ UnknownText_0x17507d: ; 0x17507d line "raring to go." para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "'s" line "where I'm at." @@ -649,7 +649,7 @@ JoseFoundSomethingText: ; 0x175116 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 @@ UnknownText_0x17520a: ; 0x17520a line "stick!" para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" para "Please come as" @@ -700,7 +700,7 @@ UnknownText_0x17529c: ; 0x17529c 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 @@ UnknownText_0x1752f5: ; 0x1752f5 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_0x1752f5: ; 0x1752f5 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 @@ UnknownText_0x1753c5: ; 0x1753c5 line "to catch a wild" para "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "…" line "Oh! Never mind!" done @@ -766,7 +766,7 @@ UnknownText_0x17543a: ; 0x17543a para "The place shall be" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" para "Don't make me" @@ -798,7 +798,7 @@ UnknownText_0x1754e5: ; 0x1754e5 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 @@ UnknownText_0x1754e5: ; 0x1754e5 JoeySharperText: ; 0x175530 text "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "'s" line "looking sharper" cont "than before!" @@ -822,7 +822,7 @@ JoeySharperText: ; 0x175530 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_0x175591: ; 0x175591 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 @@ UnknownText_0x175693: ; 0x175693 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_0x17570a: ; 0x17570a 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 @@ UnknownText_0x175786: ; 0x175786 para "I'm waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x1757d4 @@ -914,7 +914,7 @@ WadeAreYouGrowingText: ; 0x1757d4 line "It's overwhelming!" para "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "'s grow-" line "ing especially" @@ -926,7 +926,7 @@ WadeAreYouGrowingText: ; 0x1757d4 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_0x175869: ; 0x175869 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 @@ UnknownText_0x175976: ; 0x175976 line "last time!" para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "'s" line "where I'll be." @@ -1005,7 +1005,7 @@ WadeFoundBerryText: ; 0x175a60 para "I'll be waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." done ; 0x175abe @@ -1027,7 +1027,7 @@ UnknownText_0x175b1e: ; 0x175b1e line "already!" para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text " is" line "where I am." @@ -1041,7 +1041,7 @@ UnknownText_0x175b6d: ; 0x175b6d line "not here yet?" para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text " is" line "where I am." @@ -1055,7 +1055,7 @@ RalphNeglectingKidsText: ; 0x175bc4 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 @@ RalphNeglectingKidsText: ; 0x175bc4 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_0x175c24: ; 0x175c24 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 @@ UnknownText_0x175d40: ; 0x175d40 line "quite agreeable." para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text " is" line "the spot!" done @@ -1129,7 +1129,7 @@ UnknownText_0x175dd9: ; 0x175dd9 para "Uh, sorry! See," line "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " are" para "biting like there" @@ -1137,7 +1137,7 @@ UnknownText_0x175dd9: ; 0x175dd9 para "over here on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" para "Aiyee! Ouch!" @@ -1172,7 +1172,7 @@ UnknownText_0x175f11: ; 0x175f11 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 @@ UnknownText_0x175fda: ; 0x175fda line "hear this." para "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " is" line "so adorable!" @@ -1212,7 +1212,7 @@ UnknownText_0x17602d: ; 0x17602d 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 @@ UnknownText_0x176095: ; 0x176095 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 @@ UnknownText_0x17610a: ; 0x17610a 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 @@ UnknownText_0x176816: ; 0x176816 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 @@ UnknownText_0x1768b0: ; 0x1768b0 text "Listen, listen!" para "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "…" line "it… so pretty…" @@ -1515,7 +1515,7 @@ UnknownText_0x1769da: ; 0x1769da para "I'll be waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x176a2f @@ -1525,7 +1525,7 @@ AnthonyAteBerriesText: ; 0x176a2f line "was watching my" para "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " eat" line "some BERRIES." @@ -1548,7 +1548,7 @@ UnknownText_0x176aef: ; 0x176aef line "running across" para "wild @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text_start line "quite often." @@ -1562,7 +1562,7 @@ UnknownText_0x176b45: ; 0x176b45 line "battling this" para "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " the" line "other day…" @@ -1583,7 +1583,7 @@ UnknownText_0x176bee: ; 0x176bee line "battle right now!" para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text " is" line "where I am." @@ -1604,20 +1604,20 @@ UnknownText_0x176c61: ; 0x176c61 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!" 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 @@ UnknownText_0x176d85: ; 0x176d85 line "you?" para "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" line "I'm waiting!" done @@ -1671,7 +1671,7 @@ UnknownText_0x176dd1: ; 0x176dd1 ToddLooksCuteLikeMeText: ; 0x176e5d text "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " is" line "looking more and" @@ -1685,7 +1685,7 @@ UnknownText_0x176e9c: ; 0x176e9c para "Now we can KO" line "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " easily." para "I should challenge" @@ -1698,7 +1698,7 @@ UnknownText_0x176eee: ; 0x176eee 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 @@ UnknownText_0x176f60: ; 0x176f60 para "I'll be waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." done ; 0x176fdb @@ -1776,7 +1776,7 @@ UnknownText_0x177138: ; 0x177138 para "I'll be waiting on" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "." done ; 0x17717c @@ -1798,7 +1798,7 @@ UnknownText_0x17717c: ; 0x17717c 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_0x1771fd: ; 0x1771fd 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 @@ UnknownText_0x177297: ; 0x177297 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 @@ UnknownText_0x1772e2: ; 0x1772e2 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 @@ UnknownText_0x1773e7: ; 0x1773e7 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 @@ UnknownText_0x1774c1: ; 0x1774c1 para "Don't forget," line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x17750e @@ -1921,7 +1921,7 @@ UnknownText_0x17750e: ; 0x17750e para "Hurry over to" line "@" - text_from_ram StringBuffer5 + text_from_ram wStringBuffer5 text "!" done ; 0x177561 diff --git a/data/phone/text/gaven_overworld.asm b/data/phone/text/gaven_overworld.asm index 501aa0e79fa..a43c4080b61 100644 --- a/data/phone/text/gaven_overworld.asm +++ b/data/phone/text/gaven_overworld.asm @@ -12,7 +12,7 @@ GavenAskNumber1Text: 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 @@ GavenAskNumber2Text: line "again when I heal" para "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " and the" line "rest of my team." done diff --git a/data/phone/text/jose_overworld.asm b/data/phone/text/jose_overworld.asm index b266f18cd74..e57e78a9eba 100644 --- 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" diff --git a/data/phone/text/mom.asm b/data/phone/text/mom.asm index da7df47dea9..ddec4cf77be 100644 --- a/data/phone/text/mom.asm +++ b/data/phone/text/mom.asm @@ -8,12 +8,12 @@ MomPhoneGreetingText: ; 0x1b4000 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 @@ MomPhoneLandmarkText: ; 0x1b4021 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 @@ MomPhoneGenericAreaText: ; 0x1b406b 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 @@ MomPhoneNewBarkText: ; 0x1b40b1 MomPhoneCherrygroveText: ; 0x1b40e4 text "You're visiting" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "?" para "How about coming" @@ -53,7 +53,7 @@ MomPhoneCherrygroveText: ; 0x1b40e4 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 @@ MomDeterminedText: ; 0x1b4150 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 @@ MomYoureNotSavingText: ; 0x1b420d MomYouveSavedText: ; 0x1b4249 text "By the way, you've" line "saved up ¥@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "Want to start" diff --git a/data/phone/text/trainers1.asm b/data/phone/text/trainers1.asm index 8768b929530..e5dcccddf17 100644 --- 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_0x1b4dc5: ; 0x1b4dc5 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_0x1b4ded: ; 0x1b4ded UnknownText_0x1b4e16: ; 0x1b4e16 text "Hello. This is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Good evening," @@ -33,7 +33,7 @@ UnknownText_0x1b4e3e: ; 0x1b4e3e 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 @@ UnknownText_0x1b4e72: ; 0x1b4e72 text ", 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 @@ UnknownText_0x1b4e9e: ; 0x1b4e9e line "evening!" para "It's me, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "Got a minute?" done @@ -62,7 +62,7 @@ UnknownText_0x1b4ecd: ; 0x1b4ecd 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_0x1b4ecd: ; 0x1b4ecd 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_0x1b4f21: ; 0x1b4f21 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_0x1b4f4d: ; 0x1b4f4d 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 @@ UnknownText_0x1b4fa1: ; 0x1b4fa1 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_0x1b4fa1: ; 0x1b4fa1 UnknownText_0x1b4fda: ; 0x1b4fda text "Hi, ." line "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "How are you doing?" @@ -122,7 +122,7 @@ UnknownText_0x1b4fda: ; 0x1b4fda UnknownText_0x1b5004: ; 0x1b5004 text "Hi, ." line "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "Were you awake?" @@ -133,7 +133,7 @@ UnknownText_0x1b502b: ; 0x1b502b 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_0x1b502b: ; 0x1b502b 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_0x1b5073: ; 0x1b5073 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_0x1b509b: ; 0x1b509b 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 @@ UnknownText_0x1b50e9: ; 0x1b50e9 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 @@ UnknownText_0x1b511a: ; 0x1b511a 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 @@ UnknownText_0x1b5154: ; 0x1b5154 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 @@ UnknownText_0x1b518b: ; 0x1b518b line "bit too energetic." para "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "," line "especially." @@ -221,7 +221,7 @@ UnknownText_0x1b518b: ; 0x1b518b 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_0x1b522b: ; 0x1b522b UnknownText_0x1b5270: ; 0x1b5270 text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " speaking…" para "Hi, !" @@ -243,7 +243,7 @@ UnknownText_0x1b5270: ; 0x1b5270 UnknownText_0x1b52a5: ; 0x1b52a5 text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " speaking…" para "Hi, !" @@ -252,7 +252,7 @@ UnknownText_0x1b52a5: ; 0x1b52a5 UnknownText_0x1b52cc: ; 0x1b52cc text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " speaking…" para "Hi, !" @@ -264,7 +264,7 @@ UnknownText_0x1b5301: ; 0x1b5301 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 @@ UnknownText_0x1b5335: ; 0x1b5335 text "Hi, !" para "It's me, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "How are you doing?" done @@ -283,7 +283,7 @@ UnknownText_0x1b535f: ; 0x1b535f 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 @@ UnknownText_0x1b5393: ; 0x1b5393 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_0x1b5393: ; 0x1b5393 UnknownText_0x1b53f7: ; 0x1b53f7 text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "Oh, ." @@ -318,7 +318,7 @@ UnknownText_0x1b53f7: ; 0x1b53f7 UnknownText_0x1b5424: ; 0x1b5424 text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "Oh. Hi, ." @@ -327,7 +327,7 @@ UnknownText_0x1b5424: ; 0x1b5424 UnknownText_0x1b5446: ; 0x1b5446 text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "Oh, ." @@ -339,7 +339,7 @@ UnknownText_0x1b5472: ; 0x1b5472 line "!" para "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "Were you sleeping?" done @@ -347,7 +347,7 @@ UnknownText_0x1b5472: ; 0x1b5472 UnknownText_0x1b54a6: ; 0x1b54a6 text ", hi!" line "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "Do you have some" @@ -359,7 +359,7 @@ UnknownText_0x1b54d4: ; 0x1b54d4 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_0x1b5510: ; 0x1b5510 UnknownText_0x1b55ae: ; 0x1b55ae text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Oh, ?" @@ -396,7 +396,7 @@ UnknownText_0x1b55ae: ; 0x1b55ae UnknownText_0x1b55da: ; 0x1b55da text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Oh, ? Hi!" @@ -405,7 +405,7 @@ UnknownText_0x1b55da: ; 0x1b55da UnknownText_0x1b55fc: ; 0x1b55fc text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Oh, ?" @@ -417,7 +417,7 @@ UnknownText_0x1b5628: ; 0x1b5628 para "Tweet! Yeah, it's" line "me, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done @@ -426,7 +426,7 @@ UnknownText_0x1b564c: ; 0x1b564c para "Tweet! Yeah, it's" line "me, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done @@ -435,7 +435,7 @@ UnknownText_0x1b5670: ; 0x1b5670 para "Tweet! Yeah, it's" line "me, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done @@ -444,7 +444,7 @@ UnknownText_0x1b5694: ; 0x1b5694 line "still cooking?" para "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " has" line "too much energy." @@ -456,7 +456,7 @@ UnknownText_0x1b5694: ; 0x1b5694 UnknownText_0x1b5702: ; 0x1b5702 text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Oh. Hi, ." @@ -466,7 +466,7 @@ UnknownText_0x1b5702: ; 0x1b5702 UnknownText_0x1b572e: ; 0x1b572e text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Oh, hi, ," @@ -476,7 +476,7 @@ UnknownText_0x1b572e: ; 0x1b572e UnknownText_0x1b575a: ; 0x1b575a text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Oh, hi, ," @@ -488,7 +488,7 @@ UnknownText_0x1b5786: ; 0x1b5786 line "up and answer!" para "It's me, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done @@ -497,7 +497,7 @@ UnknownText_0x1b57b7: ; 0x1b57b7 line "up and answer!" para "It's me, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done @@ -506,7 +506,7 @@ UnknownText_0x1b57e8: ; 0x1b57e8 line "up and answer!" para "It's me, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done @@ -528,7 +528,7 @@ UnknownText_0x1b5819: ; 0x1b5819 UnknownText_0x1b589a: ; 0x1b589a text "Hi, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " here!" para "Oh, ? You" @@ -537,7 +537,7 @@ UnknownText_0x1b589a: ; 0x1b589a UnknownText_0x1b58c2: ; 0x1b58c2 text "Hi, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " here!" para "Oh, ? You" @@ -546,7 +546,7 @@ UnknownText_0x1b58c2: ; 0x1b58c2 UnknownText_0x1b58ea: ; 0x1b58ea text "Hi, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " here!" para "Oh, ? You" @@ -558,7 +558,7 @@ UnknownText_0x1b5912: ; 0x1b5912 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 @@ UnknownText_0x1b5948: ; 0x1b5948 line "it going?" para "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "Got a minute?" done @@ -578,7 +578,7 @@ UnknownText_0x1b597c: ; 0x1b597c 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 @@ UnknownText_0x1b59b2: ; 0x1b59b2 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_0x1b59b2: ; 0x1b59b2 UnknownText_0x1b5a3b: ; 0x1b5a3b text "Hello? This is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " speaking." para "Oh. Hi, !" @@ -613,7 +613,7 @@ UnknownText_0x1b5a3b: ; 0x1b5a3b UnknownText_0x1b5a74: ; 0x1b5a74 text "Hello? This is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " speaking." para "Oh, hi, !" @@ -622,7 +622,7 @@ UnknownText_0x1b5a74: ; 0x1b5a74 UnknownText_0x1b5a9f: ; 0x1b5a9f text "Hello? This is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " speaking." para "Oh, hi, !" @@ -634,7 +634,7 @@ UnknownText_0x1b5ad8: ; 0x1b5ad8 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 @@ UnknownText_0x1b5b0b: ; 0x1b5b0b text ", 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 @@ UnknownText_0x1b5b37: ; 0x1b5b37 line "!" para "It's me, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "Were you awake?" done @@ -670,7 +670,7 @@ UnknownText_0x1b5b68: ; 0x1b5b68 para "Of all my #MON," line "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " is the" cont "hardest to handle." @@ -711,21 +711,21 @@ UnknownText_0x1b5cb6: ; 0x1b5cb6 UnknownText_0x1b5d09: ; 0x1b5d09 text "Hiya, it's Uncle" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done UnknownText_0x1b5d21: ; 0x1b5d21 text "Hiya, it's Uncle" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done UnknownText_0x1b5d39: ; 0x1b5d39 text "Hiya, it's Uncle" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done @@ -740,7 +740,7 @@ UnknownText_0x1b5d51: ; 0x1b5d51 UnknownText_0x1b5d9f: ; 0x1b5d9f text "Hello, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start line "speaking." @@ -750,7 +750,7 @@ UnknownText_0x1b5d9f: ; 0x1b5d9f UnknownText_0x1b5dcc: ; 0x1b5dcc text "Hello, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start line "speaking." @@ -760,7 +760,7 @@ UnknownText_0x1b5dcc: ; 0x1b5dcc UnknownText_0x1b5df8: ; 0x1b5df8 text "Hello, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start line "speaking." @@ -773,7 +773,7 @@ UnknownText_0x1b5e25: ; 0x1b5e25 line "." para "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "Were you sleeping?" done @@ -781,7 +781,7 @@ UnknownText_0x1b5e25: ; 0x1b5e25 UnknownText_0x1b5e59: ; 0x1b5e59 text "Hi, ." line "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "How are things" @@ -793,7 +793,7 @@ UnknownText_0x1b5e8e: ; 0x1b5e8e line "." para "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "Are you awake?" done @@ -807,7 +807,7 @@ UnknownText_0x1b5ebe: ; 0x1b5ebe 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_0x1b5ebe: ; 0x1b5ebe UnknownText_0x1b5f7a: ; 0x1b5f7a text "Yeah, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " the" line "HIKER here." @@ -831,7 +831,7 @@ UnknownText_0x1b5f7a: ; 0x1b5f7a UnknownText_0x1b5f9e: ; 0x1b5f9e text "Yeah, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " the" line "HIKER here." @@ -841,7 +841,7 @@ UnknownText_0x1b5f9e: ; 0x1b5f9e UnknownText_0x1b5fc9: ; 0x1b5fc9 text "Yeah, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " the" line "HIKER here." @@ -853,7 +853,7 @@ UnknownText_0x1b5ff6: ; 0x1b5ff6 text "Yo, ?" para "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start line "the HIKER!" done @@ -863,7 +863,7 @@ UnknownText_0x1b6017: ; 0x1b6017 line "?" para "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start line "the HIKER!" done @@ -873,7 +873,7 @@ UnknownText_0x1b6041: ; 0x1b6041 line "awake?" para "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start line "the HIKER!" done @@ -883,7 +883,7 @@ UnknownText_0x1b606f: ; 0x1b606f 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_0x1b606f: ; 0x1b606f UnknownText_0x1b60f5: ; 0x1b60f5 text "Yes? This is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " speaking." para "Hey, !" @@ -906,7 +906,7 @@ UnknownText_0x1b60f5: ; 0x1b60f5 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_0x1b611b: ; 0x1b611b UnknownText_0x1b6149: ; 0x1b6149 text "Yes? This is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " speaking." para "Ah, !" @@ -925,7 +925,7 @@ UnknownText_0x1b6149: ; 0x1b6149 UnknownText_0x1b616e: ; 0x1b616e text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para ", right?" @@ -934,7 +934,7 @@ UnknownText_0x1b616e: ; 0x1b616e UnknownText_0x1b618f: ; 0x1b618f text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para ", what are" @@ -944,7 +944,7 @@ UnknownText_0x1b618f: ; 0x1b618f UnknownText_0x1b61bd: ; 0x1b61bd text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para ", sorry to" @@ -968,7 +968,7 @@ UnknownText_0x1b61f2: ; 0x1b61f2 UnknownText_0x1b626a: ; 0x1b626a text "Hello? This is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Oh, !" @@ -978,7 +978,7 @@ UnknownText_0x1b626a: ; 0x1b626a UnknownText_0x1b6296: ; 0x1b6296 text "Hello? This is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Oh, !" @@ -988,7 +988,7 @@ UnknownText_0x1b6296: ; 0x1b6296 UnknownText_0x1b62c5: ; 0x1b62c5 text "Hello? This is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Oh, !" @@ -999,7 +999,7 @@ UnknownText_0x1b62f1: ; 0x1b62f1 text "?" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "Good morning!" done @@ -1008,7 +1008,7 @@ UnknownText_0x1b630e: ; 0x1b630e text "?" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text ". Is" line "this a bad time?" done @@ -1017,7 +1017,7 @@ UnknownText_0x1b6331: ; 0x1b6331 text "?" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "Got time to chat?" done @@ -1028,13 +1028,13 @@ UnknownText_0x1b6352: ; 0x1b6352 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_0x1b638c: ; 0x1b638c UnknownText_0x1b63a8: ; 0x1b63a8 text "Hello? @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start line "here…" @@ -1052,7 +1052,7 @@ UnknownText_0x1b63a8: ; 0x1b63a8 UnknownText_0x1b63c4: ; 0x1b63c4 text "Hello? @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start line "here…" @@ -1065,7 +1065,7 @@ UnknownText_0x1b63e3: ; 0x1b63e3 para "It's your pal," line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done @@ -1075,7 +1075,7 @@ UnknownText_0x1b6407: ; 0x1b6407 para "It's your buddy" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done @@ -1085,14 +1085,14 @@ UnknownText_0x1b642c: ; 0x1b642c para "It's your sidekick" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done UnknownText_0x1b6454: ; 0x1b6454 text "Yeah, hello." line "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "…Huh, ? Yo!" @@ -1101,7 +1101,7 @@ UnknownText_0x1b6454: ; 0x1b6454 UnknownText_0x1b647e: ; 0x1b647e text "Yeah, hello, you" line "got @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "…Huh, ? Yo!" @@ -1110,7 +1110,7 @@ UnknownText_0x1b647e: ; 0x1b647e UnknownText_0x1b64a8: ; 0x1b64a8 text "Yeah, hello, you" line "got @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "…Huh, ? Yo!" @@ -1119,7 +1119,7 @@ UnknownText_0x1b64a8: ; 0x1b64a8 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_0x1b64d2: ; 0x1b64d2 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_0x1b6506: ; 0x1b6506 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_0x1b656c: ; 0x1b656c UnknownText_0x1b659d: ; 0x1b659d text "Yup, it's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" para "Is this ?" @@ -1163,7 +1163,7 @@ UnknownText_0x1b659d: ; 0x1b659d UnknownText_0x1b65c7: ; 0x1b65c7 text "Yup, it's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" para "Is that ?" @@ -1171,7 +1171,7 @@ UnknownText_0x1b65c7: ; 0x1b65c7 UnknownText_0x1b65e3: ; 0x1b65e3 text "Yup, it's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" para "Is that ?" @@ -1181,21 +1181,21 @@ UnknownText_0x1b65e3: ; 0x1b65e3 UnknownText_0x1b660d: ; 0x1b660d text "Hello! It's me," line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done UnknownText_0x1b6624: ; 0x1b6624 text "Hello! It's me," line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done UnknownText_0x1b663b: ; 0x1b663b text "Hello! It's me," line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done @@ -1214,7 +1214,7 @@ UnknownText_0x1b6652: ; 0x1b6652 UnknownText_0x1b66c8: ; 0x1b66c8 text "Hi, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " on the" line "line." @@ -1223,7 +1223,7 @@ UnknownText_0x1b66c8: ; 0x1b66c8 UnknownText_0x1b66ec: ; 0x1b66ec text "Hi, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " on the" line "line." @@ -1233,7 +1233,7 @@ UnknownText_0x1b66ec: ; 0x1b66ec UnknownText_0x1b6713: ; 0x1b6713 text "Hi, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " on the" line "line." @@ -1246,7 +1246,7 @@ UnknownText_0x1b6738: ; 0x1b6738 para "It's me!" line "It's me, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done @@ -1255,7 +1255,7 @@ UnknownText_0x1b6757: ; 0x1b6757 para "It's me!" line "It's me, @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done @@ -1264,13 +1264,13 @@ UnknownText_0x1b6776: ; 0x1b6776 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_0x1b6795: ; 0x1b6795 UnknownText_0x1b67e2: ; 0x1b67e2 text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Hi, !" @@ -1294,7 +1294,7 @@ UnknownText_0x1b67e2: ; 0x1b67e2 UnknownText_0x1b680e: ; 0x1b680e text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Hi, , good" @@ -1304,7 +1304,7 @@ UnknownText_0x1b680e: ; 0x1b680e UnknownText_0x1b6836: ; 0x1b6836 text "Hello, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Hi, , good" @@ -1316,7 +1316,7 @@ UnknownText_0x1b6862: ; 0x1b6862 line "morning!" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "How are you?" done @@ -1326,7 +1326,7 @@ UnknownText_0x1b6890: ; 0x1b6890 line "day!" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "How are you?" done @@ -1336,7 +1336,7 @@ UnknownText_0x1b68ba: ; 0x1b68ba line "evening!" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "How are you?" done @@ -1386,7 +1386,7 @@ UnknownText_0x1b6a22: ; 0x1b6a22 line "morning!" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text ", how" line "pika are you?" done @@ -1396,7 +1396,7 @@ UnknownText_0x1b6a56: ; 0x1b6a56 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 @@ UnknownText_0x1b6a8b: ; 0x1b6a8b line "evening!" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text ". Were" line "you pika awake?" done @@ -1416,7 +1416,7 @@ UnknownText_0x1b6ac2: ; 0x1b6ac2 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_0x1b6ac2: ; 0x1b6ac2 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_0x1b6b39: ; 0x1b6b39 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_0x1b6b65: ; 0x1b6b65 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_0x1b6b92: ; 0x1b6b92 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_0x1b6bb9: ; 0x1b6bb9 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_0x1b6bef: ; 0x1b6bef 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_0x1b6c56: ; 0x1b6c56 UnknownText_0x1b6c96: ; 0x1b6c96 text "Yes? @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " here…" para "Ah, . What" @@ -1504,7 +1504,7 @@ UnknownText_0x1b6c96: ; 0x1b6c96 UnknownText_0x1b6cc6: ; 0x1b6cc6 text "Yes? @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " here…" para "Ah, . What" @@ -1513,7 +1513,7 @@ UnknownText_0x1b6cc6: ; 0x1b6cc6 UnknownText_0x1b6cf6: ; 0x1b6cf6 text "Yes? @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " here…" para "Ah, . What" @@ -1526,7 +1526,7 @@ UnknownText_0x1b6d26: ; 0x1b6d26 para "Hey! It's me," line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done @@ -1536,7 +1536,7 @@ UnknownText_0x1b6d57: ; 0x1b6d57 para "Hey, it's me," line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done @@ -1546,7 +1546,7 @@ UnknownText_0x1b6d88: ; 0x1b6d88 para "Hey, it's me," line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done @@ -1564,7 +1564,7 @@ UnknownText_0x1b6db9: ; 0x1b6db9 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_0x1b6db9: ; 0x1b6db9 UnknownText_0x1b6e7c: ; 0x1b6e7c text "Yes? This is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "Oh, ." @@ -1586,7 +1586,7 @@ UnknownText_0x1b6e7c: ; 0x1b6e7c UnknownText_0x1b6ea6: ; 0x1b6ea6 text "Yes? This is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "Oh, ." @@ -1596,7 +1596,7 @@ UnknownText_0x1b6ea6: ; 0x1b6ea6 UnknownText_0x1b6ec9: ; 0x1b6ec9 text "Yes? This is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." para "Oh, , good" @@ -1608,7 +1608,7 @@ UnknownText_0x1b6ef3: ; 0x1b6ef3 para "Good morning. This" line "is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done @@ -1616,7 +1616,7 @@ UnknownText_0x1b6f1c: ; 0x1b6f1c text "Is this ?" para "Hi, it's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done @@ -1625,7 +1625,7 @@ UnknownText_0x1b6f37: ; 0x1b6f37 para "Good evening. This" line "is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done @@ -1641,7 +1641,7 @@ UnknownText_0x1b6f60: ; 0x1b6f60 line "too hard." para "My @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text " is" line "cute and lively" @@ -1655,7 +1655,7 @@ UnknownText_0x1b6f60: ; 0x1b6f60 UnknownText_0x1b7019: ; 0x1b7019 text "Yes, hello?" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " here!" para "Morning, !" @@ -1667,7 +1667,7 @@ UnknownText_0x1b7019: ; 0x1b7019 UnknownText_0x1b7057: ; 0x1b7057 text "Yes, hello?" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " here!" para "Hi, !" @@ -1679,7 +1679,7 @@ UnknownText_0x1b7057: ; 0x1b7057 UnknownText_0x1b7092: ; 0x1b7092 text "Yes, hello?" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " here!" para "Evening, !" @@ -1694,7 +1694,7 @@ UnknownText_0x1b70e7: ; 0x1b70e7 line "!" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" line "Good morning!" done @@ -1703,7 +1703,7 @@ UnknownText_0x1b7112: ; 0x1b7112 text "Hi, !" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" line "Remember me?" done @@ -1713,7 +1713,7 @@ UnknownText_0x1b7132: ; 0x1b7132 line "!" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" line "Are you free now?" done @@ -1723,7 +1723,7 @@ UnknownText_0x1b7161: ; 0x1b7161 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_0x1b7161: ; 0x1b7161 UnknownText_0x1b71d5: ; 0x1b71d5 text "Hello, you have" line "reached @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Ah, ." @@ -1746,7 +1746,7 @@ UnknownText_0x1b71d5: ; 0x1b71d5 UnknownText_0x1b71fc: ; 0x1b71fc text "Hello, you have" line "reached @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Ah, , is" @@ -1756,7 +1756,7 @@ UnknownText_0x1b71fc: ; 0x1b71fc 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_0x1b722a: ; 0x1b722a 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_0x1b725c: ; 0x1b725c 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_0x1b7283: ; 0x1b7283 UnknownText_0x1b72a5: ; 0x1b72a5 text "Ah, it's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Sorry for calling" @@ -1794,13 +1794,13 @@ UnknownText_0x1b72d0: ; 0x1b72d0 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 "! Beautiful" @@ -1808,7 +1808,7 @@ UnknownText_0x1b730b: ; 0x1b730b done UnknownText_0x1b7331: ; 0x1b7331 - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " here…" para "! Beautiful" @@ -1816,7 +1816,7 @@ UnknownText_0x1b7331: ; 0x1b7331 done UnknownText_0x1b7357: ; 0x1b7357 - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " here…" para "! Beautiful" @@ -1826,28 +1826,28 @@ UnknownText_0x1b7357: ; 0x1b7357 UnknownText_0x1b737f: ; 0x1b737f text "Hey, !" line "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done UnknownText_0x1b7397: ; 0x1b7397 text "Hey, !" line "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done UnknownText_0x1b73af: ; 0x1b73af text "Hey, !" line "This is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done 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_0x1b73c7: ; 0x1b73c7 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_0x1b73ef: ; 0x1b73ef 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_0x1b7417: ; 0x1b7417 UnknownText_0x1b743f: ; 0x1b743f text ", it's" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" para "Have you had a" @@ -1887,7 +1887,7 @@ UnknownText_0x1b743f: ; 0x1b743f UnknownText_0x1b746f: ; 0x1b746f text ", it's" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" para "Have you had a" @@ -1897,7 +1897,7 @@ UnknownText_0x1b746f: ; 0x1b746f UnknownText_0x1b749b: ; 0x1b749b text ", it's" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" para "Have you had a" @@ -1909,7 +1909,7 @@ UnknownText_0x1b74c8: ; 0x1b74c8 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_0x1b74c8: ; 0x1b74c8 UnknownText_0x1b751a: ; 0x1b751a text "Yes, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Oh. Hi, !" @@ -1930,7 +1930,7 @@ UnknownText_0x1b751a: ; 0x1b751a UnknownText_0x1b7548: ; 0x1b7548 text "Yes, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Oh, hi, !" @@ -1940,7 +1940,7 @@ UnknownText_0x1b7548: ; 0x1b7548 UnknownText_0x1b756f: ; 0x1b756f text "Yes, this is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" para "Oh, hi, !" @@ -1950,7 +1950,7 @@ UnknownText_0x1b758f: ; 0x1b758f text "!" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" line "Good morning!" done @@ -1959,7 +1959,7 @@ UnknownText_0x1b75ac: ; 0x1b75ac text "!" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" line "Working hard?" done @@ -1968,7 +1968,7 @@ UnknownText_0x1b75c9: ; 0x1b75c9 text "!" para "It's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" line "Were you up?" done @@ -1978,10 +1978,10 @@ UnknownText_0x1b75e5: ; 0x1b75e5 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 diff --git a/data/special_pointers.asm b/data/special_pointers.asm index 6320838fc8c..f788583a2fd 100644 --- 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:: diff --git a/data/std_text.asm b/data/std_text.asm index 4b027abac9d..238f0ac5db1 100644 --- a/data/std_text.asm +++ b/data/std_text.asm @@ -231,18 +231,18 @@ ContestResults_ReadyToJudgeText: ContestResults_PlayerWonAPrizeText: text ", 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 ReceivedItemText: text " received" line "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "." done @@ -279,14 +279,14 @@ ContestResults_PartyFullText: done GymStatue_CityGymText: - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start line "#MON GYM" done GymStatue_WinningTrainersText: text "LEADER: @" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text_start para "WINNING TRAINERS:" line "" @@ -376,13 +376,13 @@ HappinessText1: RegisteredNumber1Text: text " registered" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "'s number." done RegisteredNumber2Text: text " registered" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "'s number." done diff --git a/data/text_buffers.asm b/data/text_buffers.asm index 5a03c8cc717..7dd7af4289f 100644 --- 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 diff --git a/data/trainers/palettes.asm b/data/trainers/palettes.asm index c502846c468..ba546e417c6 100644 --- 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" diff --git a/data/unused/gen_1_trainer_names.asm b/data/unused/gen_1_trainer_names.asm index a802a5048f3..b3d60569d29 100644 --- a/data/unused/gen_1_trainer_names.asm +++ b/data/unused/gen_1_trainer_names.asm @@ -3,50 +3,50 @@ Gen1TrainerClassNames: ; 50a42 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 "むしとり@" diff --git a/engine/battle/ai/items.asm b/engine/battle/ai/items.asm index d0867fb3327..6ec490b7187 100644 --- a/engine/battle/ai/items.asm +++ b/engine/battle/ai/items.asm @@ -12,7 +12,7 @@ AI_SwitchOrTryItem: ; 38000 farcall CheckEnemyLockedIn ret nz - ld a, [PlayerSubStatus5] + ld a, [wPlayerSubStatus5] bit SUBSTATUS_CANT_RUN, a jr nz, DontSwitch @@ -21,11 +21,11 @@ AI_SwitchOrTryItem: ; 38000 jr nz, DontSwitch ld hl, TrainerClassAttributes + TRNATTR_AI_ITEM_SWITCH - ld a, [InBattleTowerBattle] ; Load always the first TrainerClass for BattleTower-Trainers + ld a, [wInBattleTowerBattle] ; Load always the first 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 @@ SwitchSometimes: ; 380c1 CheckSubstatusCantRun: ; 380ff - ld a, [EnemySubStatus5] + ld a, [wEnemySubStatus5] bit SUBSTATUS_CANT_RUN, a ret ; 38105 @@ -159,7 +159,7 @@ CheckSubstatusCantRun: ; 380ff AI_TryItem: ; 38105 ; items are not allowed in the BattleTower - ld a, [InBattleTowerBattle] + ld a, [wInBattleTowerBattle] and a ret nz @@ -172,7 +172,7 @@ AI_TryItem: ; 38105 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,29 +226,29 @@ AI_TryItem: ; 38105 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 .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 @@ AI_TryItem: ; 38105 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 @@ AI_Items: ; 39196 ; 381ca .Status: ; 381ca (e:41ca) - ld a, [EnemyMonStatus] + ld a, [wEnemyMonStatus] and a jp z, .DontUse @@ -318,17 +318,17 @@ AI_Items: ; 39196 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 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 @@ AI_Items: ; 39196 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 @@ AI_Items: ; 39196 ; 3834d .XItem: ; 3834d (e:434d) - ld a, [EnemyTurnsTaken] + ld a, [wEnemyTurnsTaken] and a jr nz, .notfirstturnout ld a, [bc] @@ -571,37 +571,37 @@ EnemyUsedFullHeal: ; 383a3 (e:43a3) 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 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 @@ EnemyUsedHyperPotion: ; 383f4 (e:43f4) 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 @@ EnemyPotionContinue: ; 383f8 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 @@ EnemyPotionFinish: ; 38436 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,20 +701,20 @@ AI_Switch: ; 3846c ld a, $1 ld [wEnemyIsSwitching], a ld [wEnemyGoesFirst], a - ld hl, EnemySubStatus4 + ld hl, wEnemySubStatus4 res SUBSTATUS_RAGE, [hl] xor a ld [hBattleTurn], a 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 @@ AI_Switch: ; 3846c ld [wBattleHasJustStarted], a callfar NewEnemyMonStatus callfar ResetEnemyStatLevels - ld hl, PlayerSubStatus1 + ld hl, wPlayerSubStatus1 res SUBSTATUS_IN_LOVE, [hl] farcall EnemySwitch farcall ResetBattleParticipants @@ -754,25 +754,25 @@ Function384d5: ; This appears to be unused ; 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 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 @@ EnemyUsedXAccuracy: ; 384f7 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 @@ EnemyUsedGuardSpec: ; 38504 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 @@ EnemyUsedDireHit: ; 38511 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 @@ Function3851e: ; This appears to be unused 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 @@ EnemyUsedXSpecial: ; 38553 ; 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 @@ EnemyUsedXItem: ; 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 diff --git a/engine/battle/ai/move.asm b/engine/battle/ai/move.asm index 7ccb20972b9..c3e9bed2792 100755 --- 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,18 +18,18 @@ AIChooseMove: ; 440ce ; 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 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,20 +38,20 @@ AIChooseMove: ; 440ce inc hl jr .CheckDisabledMove .ScoreDisabledMove: - ld hl, Buffer1 + ld hl, wBuffer1 ld b, 0 add hl, bc ld [hl], 80 ; 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 @@ AIChooseMove: ; 440ce .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 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 @@ AIChooseMove: ; 440ce ; 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 @@ AIChooseMove: ; 440ce 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 @@ AIChooseMove: ; 440ce ; 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 @@ AIChooseMove: ; 440ce and a jr z, .ChooseMove - ld [CurEnemyMove], a + ld [wCurEnemyMove], a ld a, c - ld [CurEnemyMoveNum], a + ld [wCurEnemyMoveNum], a ret ; 441af diff --git a/engine/battle/ai/redundant.asm b/engine/battle/ai/redundant.asm index 68d7b020397..d09b4da7376 100755 --- a/engine/battle/ai/redundant.asm +++ b/engine/battle/ai/redundant.asm @@ -47,90 +47,90 @@ AI_Redundant: ; 2c41a 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 @@ -143,12 +143,12 @@ AI_Redundant: ; 2c41a .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 @@ -165,18 +165,18 @@ AI_Redundant: ; 2c41a 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 diff --git a/engine/battle/ai/scoring.asm b/engine/battle/ai/scoring.asm index 2ea87cc825e..b250128a4d4 100644 --- a/engine/battle/ai/scoring.asm +++ b/engine/battle/ai/scoring.asm @@ -5,9 +5,9 @@ AI_Basic: ; 38591 ; -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 @@ AI_Basic: ; 38591 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 @@ AI_Setup: ; 385e0 ; 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,14 +120,14 @@ AI_Setup: ; 385e0 jr .checkmove .statup - ld a, [EnemyTurnsTaken] + ld a, [wEnemyTurnsTaken] and a jr nz, .discourage jr .encourage .statdown - ld a, [PlayerTurnsTaken] + ld a, [wPlayerTurnsTaken] and a jr nz, .discourage @@ -156,9 +156,9 @@ AI_Types: ; 38635 ; 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 @@ AI_Types: ; 38635 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_Types: ; 38635 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_Offensive: ; 386a2 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_LeechHit: ; 387f7 AI_Smart_LockOn: ; 3881d - ld a, [PlayerSubStatus5] + ld a, [wPlayerSubStatus5] bit SUBSTATUS_LOCK_ON, a jr nz, .asm_38882 @@ -477,20 +477,20 @@ AI_Smart_LockOn: ; 3881d 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 @@ AI_Smart_LockOn: ; 3881d .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_DreamEater: ; 388ca 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 @@ AI_Smart_EvasionUp: ; 388d4 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 @@ AI_Smart_EvasionUp: ; 388d4 ; 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 @@ AI_Smart_AlwaysHit: ; 38947 ; 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_AlwaysHit: ; 38947 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 @@ AI_Smart_AccuracyDown: ; 38985 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 @@ AI_Smart_AccuracyDown: ; 38985 ; 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 @@ AI_Smart_ResetStats: ; 389f5 ; 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 @@ AI_Smart_ResetStats: ; 389f5 ; 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 @@ AI_Smart_Ohko: ; 38a60 ; 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 @@ AI_Smart_TrapTarget: ; 38a71 ; 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< 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 @@ AI_Smart_SleepTalk: ; 38cba ; 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 @@ AI_Smart_DefrostOpponent: ; 38ccb ; 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_DefrostOpponent: ; 38ccb AI_Smart_Spite: ; 38cd5 - ld a, [LastPlayerCounterMove] + ld a, [wLastPlayerCounterMove] and a jr nz, .asm_38ce7 @@ -1633,8 +1633,8 @@ AI_Smart_Spite: ; 38cd5 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 @@ AI_Smart_HealBell: ; 38d1f ; 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 @@ AI_Smart_HealBell: ; 38d1f and a jr z, .no_status - ld a, [EnemyMonStatus] + ld a, [wEnemyMonStatus] and a jr z, .ok dec [hl] @@ -1742,7 +1742,7 @@ AI_Smart_HealBell: ; 38d1f ret .no_status - ld a, [EnemyMonStatus] + ld a, [wEnemyMonStatus] and a ret nz jp AIDiscourageMove @@ -1755,7 +1755,7 @@ AI_Smart_PriorityHit: ; 38d5a 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 @@ AI_Smart_PriorityHit: ; 38d5a 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_Thief: ; 38d93 AI_Smart_Conversion2: ; 38d98 - ld a, [LastPlayerMove] + ld a, [wLastPlayerMove] and a jr nz, .asm_38dc9 @@ -1839,7 +1839,7 @@ AI_Smart_Disable: ; 38dd1 jr nc, .asm_38df3 push hl - ld a, [LastPlayerCounterMove] + ld a, [wLastPlayerCounterMove] ld hl, UsefulMoves ld de, 1 call IsInArray @@ -1877,14 +1877,14 @@ AI_Smart_MeanLook: ; 38dfb 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< (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 @@ AskUseNextPokemon: ; 3d1f8 ld a, [wMenuCursorY] cp $1 ; YES jr z, .loop - ld hl, PartyMon1Speed - ld de, EnemyMonSpeed + ld hl, wPartyMon1Speed + ld de, wEnemyMonSpeed jp TryToRunAwayFromBattle ; 3d227 @@ -2796,7 +2796,7 @@ ForcePlayerMonChoice: ; 3d227 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 @@ ForcePlayerMonChoice: ; 3d227 .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 @@ ForcePlayerMonChoice: ; 3d227 ; 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 @@ SelectBattleMon: ; 3d329 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 @@ PickPartyMonInBattle: ; 3d33c ; 3d34f SwitchMonAlreadyOut: ; 3d34f - ld hl, CurBattleMon - ld a, [CurPartyMon] + ld hl, wCurBattleMon + ld a, [wCurPartyMon] cp [hl] jr nz, .notout @@ -2985,13 +2985,13 @@ ForcePickSwitchMonInBattle: ; 3d380 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 @@ -3288,10 +3288,10 @@ CheckWhetherSwitchmonIsPredetermined: ; 3d533 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 @@ ResetBattleParticipants: ; 3d57a 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 @@ AddBattleParticipant: ; 3d581 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,14 +3351,14 @@ FindPkmnInOTPartyToSwitchIntoBattle: ; 3d599 jr .loop .discourage - ld hl, Buffer2 + ld hl, wBuffer2 set 0, [hl] jr .loop ; 3d5d7 LookUpTheEffectivenessOfEveryMove: ; 3d5d7 push bc - ld hl, OTPartyMon1Moves + ld hl, wOTPartyMon1Moves ld a, b call GetPartyLocation pop bc @@ -3387,7 +3387,7 @@ LookUpTheEffectivenessOfEveryMove: ; 3d5d7 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 @@ IsThePlayerPkmnTypesEffectiveAgainstOTPkmn: ; 3d618 ; 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,18 +3409,18 @@ IsThePlayerPkmnTypesEffectiveAgainstOTPkmn: ; 3d618 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 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 @@ IsThePlayerPkmnTypesEffectiveAgainstOTPkmn: ; 3d618 .super_effective pop bc - ld hl, Buffer1 + ld hl, wBuffer1 bit 0, [hl] jr nz, .reset inc hl @@ -3445,12 +3445,12 @@ IsThePlayerPkmnTypesEffectiveAgainstOTPkmn: ; 3d618 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 @@ ScoreMonTypeMatchups: ; 3d672 jr .loop2 .okay - ld a, [Buffer1] + ld a, [wBuffer1] and a jr z, .okay2 ld b, $ff @@ -3474,7 +3474,7 @@ ScoreMonTypeMatchups: ; 3d672 .okay2 ld b, $ff - ld a, [Buffer2] + ld a, [wBuffer2] ld c, a .loop4 inc b @@ -3483,17 +3483,17 @@ ScoreMonTypeMatchups: ; 3d672 jr .quit .loop5 - ld a, [OTPartyCount] + ld a, [wOTPartyCount] ld b, a call BattleRandom and $7 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 @@ ScoreMonTypeMatchups: ; 3d672 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 @@ CheckWhetherToAskSwitch: ; 3d714 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 @@ CheckWhetherToAskSwitch: ; 3d714 ; 3d74b OfferSwitch: ; 3d74b - ld a, [CurPartyMon] + ld a, [wCurPartyMon] push af callfar Battle_GetTrainerName ld hl, BattleText_EnemyIsAboutToUseWillPlayerChangePkmn @@ -3591,18 +3591,18 @@ OfferSwitch: ; 3d74b 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 @@ OfferSwitch: ; 3d74b .said_no pop af - ld [CurPartyMon], a + ld [wCurPartyMon], a scf ret ; 3d7a0 @@ -3638,12 +3638,12 @@ Function_BattleTextEnemySentOut: ; 3d7b8 ; 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 @@ Function_SetEnemyPkmnAndSendOutAnimation: ; 3d7c7 call Call_PlayBattleAnim .not_shiny - ld bc, TempMonSpecies + ld bc, wTempMonSpecies farcall CheckFaintedFrzSlp jr c, .skip_cry farcall CheckBattleScene @@ -3675,8 +3675,8 @@ Function_SetEnemyPkmnAndSendOutAnimation: ; 3d7c7 .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 @@ Function_SetEnemyPkmnAndSendOutAnimation: ; 3d7c7 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 @@ endr 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 @@ ResetEnemyStatLevels: ; 3d867 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 @@ CheckPlayerPartyForFitPkmn: ; 3d873 ; 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 @@ CheckIfCurPartyMonIsFitToFight: ; 3d887 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 @@ CheckIfCurPartyMonIsFitToFight: ; 3d887 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 @@ TryToRunAwayFromBattle: ; 3d8b3 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 @@ TryToRunAwayFromBattle: ; 3d8b3 push hl push de - ld a, [BattleMonItem] + ld a, [wBattleMonItem] ld [wd265], a ld b, a callfar GetItemHeldEffect @@ -3911,9 +3911,9 @@ TryToRunAwayFromBattle: ; 3d8b3 xor 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 @@ TryToRunAwayFromBattle: ; 3d8b3 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,33 +4015,33 @@ BattleCheckShininess: ; 3da7c ; 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 ld a, [wBattleMode] dec a ret z - ld hl, OTPartyMon1DVs - ld a, [CurOTMon] + ld hl, wOTPartyMon1DVs + ld a, [wCurOTMon] jp GetPartyLocation ; 3dab1 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 @@ ResetPlayerStatLevels: ; 3dab1 ; 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 @@ InitEnemyMon: ; 3dabd 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,14 +4116,14 @@ SwitchPlayerMon: ; 3db32 call SendOutPlayerMon call EmptyBattleTextBox call LoadTileMapToTempTileMap - ld hl, EnemyMonHP + ld hl, wEnemyMonHP ld a, [hli] or [hl] ret ; 3db5f SendOutPlayerMon: ; 3db5f - ld hl, BattleMonDVs + ld hl, wBattleMonDVs predef GetUnownLetter hlcoord 1, 5 ld b, 7 @@ -4136,12 +4136,12 @@ SendOutPlayerMon: ; 3db5f 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 @@ SendOutPlayerMon: ; 3db5f 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 @@ SendOutPlayerMon: ; 3db5f 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 @@ PursuitSwitch: ; 3dc5b cp EFFECT_PURSUIT jr nz, .done - ld a, [CurBattleMon] + ld a, [wCurBattleMon] push af ld hl, DoPlayerTurn @@ -4273,8 +4273,8 @@ PursuitSwitch: ; 3dc5b 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 @@ PursuitSwitch: ; 3dc5b 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 @@ PursuitSwitch: ; 3dc5b jr .done_fainted .check_enemy_fainted - ld hl, EnemyMonHP + ld hl, wEnemyMonHP ld a, [hli] or [hl] jr nz, .done @@ -4378,26 +4378,26 @@ HandleHPHealingItem: ; 3dd2f 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. ; 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 @@ HandleHPHealingItem: ; 3dd2f .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 @@ HandleHPHealingItem: ; 3dd2f 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 @@ ItemRecoveryAnim: ; 3ddc8 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 @@ HandleStatBoostingHeldItems: ; 3de97 rst FarCall pop bc pop de - ld a, [FailedMessage] + ld a, [wFailedMessage] and a ret nz xor a @@ -4676,18 +4676,18 @@ HandleStatBoostingHeldItems: ; 3de97 ; 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 @@ UpdateBattleHUDs: ; 3df2c 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 @@ DrawPlayerHUD: ; 3df58 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,19 +4760,19 @@ DrawPlayerHUD: ; 3df58 ; 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, [wBattleLowHealthAlarm] and a jr nz, .done - ld a, [PlayerHPPal] + ld a, [wPlayerHPPal] cp HP_RED jr z, .danger @@ -4790,39 +4790,39 @@ CheckDanger: ; 3df9e ; 3dfbf PrintPlayerHUD: ; 3dfbf - ld de, BattleMonNick + ld de, wBattleMonNick hlcoord 10, 7 call ret_3e138 call PlaceString 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 dec hl ld a, TEMPMON - ld [MonType], a + ld [wMonType], a callfar GetGender ld a, " " jr c, .got_gender_char @@ -4836,7 +4836,7 @@ PrintPlayerHUD: ; 3dfbf 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 @@ PrintPlayerHUD: ; 3dfbf dec hl ; genderless .copy_level - ld a, [BattleMonLevel] - ld [TempMonLevel], a + ld a, [wBattleMonLevel] + ld [wTempMonLevel], a jp PrintLevel ; 3e036 @@ -4874,11 +4874,11 @@ DrawEnemyHUD: ; 3e043 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 @@ DrawEnemyHUD: ; 3e043 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 @@ DrawEnemyHUD: ; 3e043 ld [de], a ld a, TEMPMON - ld [MonType], a + ld [wMonType], a callfar GetGender ld a, " " jr c, .got_gender @@ -4915,7 +4915,7 @@ DrawEnemyHUD: ; 3e043 hlcoord 6, 1 push af push hl - ld de, EnemyMonStatus + ld de, wEnemyMonStatus predef PlaceNonFaintStatus pop hl pop bc @@ -4925,12 +4925,12 @@ DrawEnemyHUD: ; 3e043 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 @@ DrawEnemyHUD: ; 3e043 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 @@ DrawEnemyHUD: ; 3e043 ; 3e127 UpdateEnemyHPPal: ; 3e127 - ld hl, EnemyHPPal + ld hl, wEnemyHPPal call UpdateHPPal ret ; 3e12e @@ -5021,7 +5021,7 @@ BattleMenu: ; 3e139 ld [hBGMapMode], a call LoadTempTileMapToTileMap - ld a, [BattleType] + ld a, [wBattleType] cp BATTLETYPE_DEBUG jr z, .ok cp BATTLETYPE_TUTORIAL @@ -5033,7 +5033,7 @@ BattleMenu: ; 3e139 .ok .loop - ld a, [BattleType] + ld a, [wBattleType] cp BATTLETYPE_CONTEST jr nz, .not_contest farcall ContestBattleMenu @@ -5041,7 +5041,7 @@ BattleMenu: ; 3e139 .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 @@ BattleMenu_Pack: ; 3e1c7 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 @@ -5124,13 +5124,13 @@ BattleMenu_Pack: ; 3e1c7 .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 @@ BattleMenu_Pack: ; 3e1c7 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_ReturnFromStats: BattleMenuPKMN_Loop: call SetUpBattlePartyMenu xor a - ld [PartyMenuActionText], a + ld [wPartyMenuActionText], a call JumpToPartyMenuAndPrintText call SelectBattleMon jr c, .Cancel @@ -5280,7 +5280,7 @@ Battle_StatsScreen: ; 3e308 call ClearSprites call LowVolume xor a ; PARTYMON - ld [MonType], a + ld [wMonType], a farcall BattleStatsScreenInit call MaxVolume @@ -5301,9 +5301,9 @@ Battle_StatsScreen: ; 3e308 ; 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 @@ TryPlayerSwitch: ; 3e358 ld a, [wPlayerWrapCount] and a jr nz, .trapped - ld a, [EnemySubStatus5] + ld a, [wEnemySubStatus5] bit SUBSTATUS_CANT_RUN, a jr z, .try_switch @@ -5326,8 +5326,8 @@ TryPlayerSwitch: ; 3e358 .try_switch call CheckIfCurPartyMonIsFitToFight jp z, BattleMenuPKMN_Loop - ld a, [CurBattleMon] - ld [LastPlayerMon], a + ld a, [wCurBattleMon] + ld [wLastPlayerMon], a ld a, $2 ld [wBattlePlayerAction], a call ClearPalettes @@ -5337,8 +5337,8 @@ TryPlayerSwitch: ; 3e358 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 @@ BattleMonEntrance: ; 3e40b ld c, 50 call DelayFrames - ld hl, PlayerSubStatus4 + ld hl, wPlayerSubStatus4 res SUBSTATUS_RAGE, [hl] call SetEnemyTurn @@ -5414,8 +5414,8 @@ BattleMonEntrance: ; 3e40b 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 @@ PassedBattleMonEntrance: ; 3e459 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,8 +5458,8 @@ BattleMenu_Run: ; 3e489 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 @@ -5471,7 +5471,7 @@ BattleMenu_Run: ; 3e489 ; 3e4a8 CheckAmuletCoin: ; 3e4a8 - ld a, [BattleMonItem] + ld a, [wBattleMonItem] ld b, a callfar GetItemHeldEffect ld a, b @@ -5489,7 +5489,7 @@ MoveSelectionScreen: ; 3e4bc ret .not_mobile - ld hl, EnemyMonMoves + ld hl, wEnemyMonMoves ld a, [wMoveSelectionMenuType] dec a jr z, .got_menu_type @@ -5497,7 +5497,7 @@ MoveSelectionScreen: ; 3e4bc 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 @@ MoveSelectionScreen: ; 3e4bc 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 @@ MoveSelectionScreen: ; 3e4bc ld a, [wMoveSelectionMenuType] cp $1 jr z, .skip_inc - ld a, [CurMoveNum] + ld a, [wCurMoveNum] inc a .skip_inc @@ -5634,7 +5634,7 @@ MoveSelectionScreen: ; 3e4bc .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 @@ MoveSelectionScreen: ; 3e4bc pop af ret nz - ld hl, BattleMonPP + ld hl, wBattleMonPP ld a, [wMenuCursorY] ld c, a ld b, 0 @@ -5652,7 +5652,7 @@ MoveSelectionScreen: ; 3e4bc ld a, [hl] and PP_MASK jr z, .no_pp_left - ld a, [PlayerDisableCount] + ld a, [wPlayerDisableCount] swap a and $f dec a @@ -5662,14 +5662,14 @@ MoveSelectionScreen: ; 3e4bc and a jr nz, .skip2 ld a, [wMenuCursorY] - ld hl, BattleMonMoves + ld hl, wBattleMonMoves ld c, a ld b, 0 add hl, bc ld a, [hl] .skip2 - ld [CurPlayerMove], a + ld [wCurPlayerMove], a xor a ret @@ -5717,11 +5717,11 @@ MoveSelectionScreen: ; 3e4bc 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 @@ MoveSelectionScreen: ; 3e4bc .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 @@ MoveInfoBox: ; 3e6c8 call TextBox call MobileTextBorder - ld a, [PlayerDisableCount] + ld a, [wPlayerDisableCount] and a jr z, .not_disabled @@ -5828,29 +5828,29 @@ MoveInfoBox: ; 3e6c8 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 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 @@ MoveInfoBox: ; 3e6c8 hlcoord 5, 11 .ok push hl - ld de, StringBuffer1 + ld de, wStringBuffer1 lb bc, 1, 2 call PrintNum pop hl @@ -5900,10 +5900,10 @@ MoveInfoBox: ; 3e6c8 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] @@ -5966,30 +5966,30 @@ ParseEnemyAction: ; 3e7c1 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] 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 @@ ParseEnemyAction: ; 3e7c1 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 @@ ParseEnemyAction: ; 3e7c1 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,18 +6044,18 @@ ParseEnemyAction: ; 3e7c1 ld a, [hl] and a jr z, .loop2 - ld hl, EnemyMonPP + ld hl, wEnemyMonPP add hl, bc ld b, a ld a, [hl] 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 @@ ParseEnemyAction: ; 3e7c1 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 @@ ParseEnemyAction: ; 3e7c1 cp EFFECT_ENDURE ret z xor a - ld [EnemyProtectCount], a + ld [wEnemyProtectCount], a ret .struggle @@ -6098,25 +6098,25 @@ ParseEnemyAction: ; 3e7c1 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 @@ LinkBattleSendReceiveAction: ; 3e8e4 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 wEnemyMon struct 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 @@ LoadEnemyMon: ; 3e8eb 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 @@ LoadEnemyMon: ; 3e8eb 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 @@ LoadEnemyMon: ; 3e8eb ; 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 @@ LoadEnemyMon: ; 3e8eb ; 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 @@ LoadEnemyMon: ; 3e8eb 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 @@ LoadEnemyMon: ; 3e8eb ; 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 @@ LoadEnemyMon: ; 3e8eb 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 @@ LoadEnemyMon: ; 3e8eb .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 @@ LoadEnemyMon: ; 3e8eb ; 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 @@ LoadEnemyMon: ; 3e8eb ; 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 @@ LoadEnemyMon: ; 3e8eb ; 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 @@ LoadEnemyMon: ; 3e8eb .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 @@ LoadEnemyMon: ; 3e8eb and a jr z, .TreeMon - ld a, [EnemySubStatus5] + ld a, [wEnemySubStatus5] bit SUBSTATUS_TRANSFORMED, a jp nz, .Moves @@ -6433,7 +6433,7 @@ LoadEnemyMon: ; 3e8eb xor a .UpdateStatus: - ld hl, EnemyMonStatus + ld hl, wEnemyMonStatus ld [hli], a ; Unused byte @@ -6441,13 +6441,13 @@ LoadEnemyMon: ; 3e8eb 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 @@ LoadEnemyMon: ; 3e8eb 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,21 +6498,21 @@ LoadEnemyMon: ; 3e8eb 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 jr .PP .WildMoves: -; Clear EnemyMonMoves +; Clear wEnemyMonMoves xor a ld h, d ld l, e @@ -6532,25 +6532,25 @@ LoadEnemyMon: ; 3e8eb 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 @@ LoadEnemyMon: ; 3e8eb 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 @@ LoadEnemyMon: ; 3e8eb 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 @@ CheckSleepingTreeMon: ; 3eb38 ; 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 @@ CheckSleepingTreeMon: ; 3eb38 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 @@ CheckUnownLetter: ; 3eb75 ld l, a push de - ld a, [UnownLetter] + ld a, [wUnownLetter] ld de, 1 push bc call IsInArray @@ -6698,22 +6698,22 @@ CheckUnownLetter: ; 3eb75 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 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 @@ ApplyPrzEffectOnSpeed: ; 3ec39 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 @@ ApplyPrzEffectOnSpeed: ; 3ec39 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 @@ ApplyBrnEffectOnAttack: ; 3ec76 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 @@ ApplyBrnEffectOnAttack: ; 3ec76 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 @@ ApplyStatLevelMultiplier: ; 3ecb7 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,7 @@ ApplyStatLevelMultiplier: ; 3ecb7 ; 3ed45 BadgeStatBoosts: ; 3ed45 -; Raise BattleMon stats depending on which badges have been obtained. +; Raise wBattleMon stats depending on which badges have been obtained. ; Every other badge boosts a stat, starting from the first. @@ -7005,7 +7005,7 @@ BadgeStatBoosts: ; 3ed45 and a ret nz - ld a, [InBattleTowerBattle] + ld a, [wInBattleTowerBattle] and a ret nz @@ -7028,7 +7028,7 @@ BadgeStatBoosts: ; 3ed45 or c ld b, a - ld hl, BattleMonAttack + ld hl, wBattleMonAttack ld c, 4 .CheckBadge: ld a, b @@ -7124,13 +7124,13 @@ _BattleRandom:: ; 3edd8 ; 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 +7147,8 @@ _BattleRandom:: ; 3edd8 ; 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 +7188,9 @@ Call_PlayBattleAnim_OnlyIfVisible: ; 3ee0f 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 +7218,14 @@ GiveExperiencePoints: ; 3ee3b 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 +7236,7 @@ GiveExperiencePoints: ; 3ee3b push bc ld hl, wBattleParticipantsNotFainted - ld a, [CurPartyMon] + ld a, [wCurPartyMon] ld c, a ld b, CHECK_FLAG ld d, $0 @@ -7251,7 +7251,7 @@ GiveExperiencePoints: ; 3ee3b 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 +7303,9 @@ GiveExperiencePoints: ; 3ee3b 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 +7316,11 @@ GiveExperiencePoints: ; 3ee3b 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 +7331,7 @@ GiveExperiencePoints: ; 3ee3b .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 +7343,17 @@ GiveExperiencePoints: ; 3ee3b 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 +7380,13 @@ GiveExperiencePoints: ; 3ee3b 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 +7417,7 @@ GiveExperiencePoints: ; 3ee3b .not_max_exp xor a ; PARTYMON - ld [MonType], a + ld [wMonType], a predef CopyPkmnToTempMon callfar CalcLevel pop bc @@ -7430,15 +7430,15 @@ GiveExperiencePoints: ; 3ee3b jp z, .skip_stats ; 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 +7473,18 @@ GiveExperiencePoints: ; 3ee3b 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 +7492,13 @@ GiveExperiencePoints: ; 3ee3b 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 +7516,9 @@ GiveExperiencePoints: ; 3ee3b .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 +7530,7 @@ GiveExperiencePoints: ; 3ee3b .skip_animation2 xor a ; PARTYMON - ld [MonType], a + ld [wMonType], a predef CopyPkmnToTempMon hlcoord 9, 0 ld b, $a @@ -7544,10 +7544,10 @@ GiveExperiencePoints: ; 3ee3b 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 +7556,7 @@ GiveExperiencePoints: ; 3ee3b .level_loop inc b ld a, b - ld [CurPartyLevel], a + ld [wCurPartyLevel], a push bc predef LearnLevelMoves pop bc @@ -7564,23 +7564,23 @@ GiveExperiencePoints: ; 3ee3b 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 +7608,8 @@ GiveExperiencePoints: ; 3ee3b 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 +7651,7 @@ Text_PkmnGainedExpPoint: ; 3f11b 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 +7672,12 @@ TextJump_StringBuffer2ExpPoints: ; 3f131 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 +7690,16 @@ AnimateExpBar: ; 3f136 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 +7723,7 @@ AnimateExpBar: ; 3f136 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 +7756,16 @@ AnimateExpBar: ; 3f136 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 +7783,7 @@ AnimateExpBar: ; 3f136 .FinishExpBar: push bc ld b, d - ld de, TempMonExp + 2 + ld de, wTempMonExp + 2 call CalcExpBar ld a, b pop bc @@ -7868,7 +7868,7 @@ SendOutPkmnText: ; 3f26d .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 +7877,7 @@ SendOutPkmnText: ; 3f26d ; 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 +7887,7 @@ SendOutPkmnText: ; 3f26d ld a, 25 ld [hMultiplier], a call Multiply - ld hl, EnemyMonMaxHP + ld hl, wEnemyMonMaxHP ld a, [hli] ld b, [hl] srl a @@ -7959,7 +7959,7 @@ WithdrawPkmnText: ; 3f2f4 ; 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 +7974,7 @@ WithdrawPkmnText: ; 3f2f4 ld a, 25 ld [hMultiplier], a call Multiply - ld hl, EnemyMonMaxHP + ld hl, wEnemyMonMaxHP ld a, [hli] ld b, [hl] srl a @@ -8048,11 +8048,11 @@ Unreferenced_HandleSafariAngerEatingStatus: 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 +8205,7 @@ PlaceExpBar: ; 3f41c ; 3f43d GetBattleMonBackpic: ; 3f43d - ld a, [PlayerSubStatus4] + ld a, [wPlayerSubStatus4] bit SUBSTATUS_SUBSTITUTE, a ld hl, BattleAnimCmd_RaiseSub jr nz, GetBattleMonBackpic_DoAnim ; substitute @@ -8215,16 +8215,16 @@ DropPlayerSub: ; 3f447 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 +8241,7 @@ GetBattleMonBackpic_DoAnim: ; 3f46f ; 3f47c GetEnemyMonFrontpic: ; 3f47c - ld a, [EnemySubStatus4] + ld a, [wEnemySubStatus4] bit SUBSTATUS_SUBSTITUTE, a ld hl, BattleAnimCmd_RaiseSub jr nz, GetEnemyMonFrontpic_DoAnim @@ -8252,18 +8252,18 @@ DropEnemySub: ; 3f486 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 +8282,17 @@ StartBattle: ; 3f4c1 ; 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 +8306,7 @@ BattleIntro: ; 3f4dd farcall StubbedTrainerRankings_Battles ; mobile call LoadTrainerOrWildMonPic xor a - ld [TempBattleMonSpecies], a + ld [wTempBattleMonSpecies], a ld [wBattleMenuCursorBuffer], a xor a ld [hMapAnims], a @@ -8344,19 +8344,19 @@ BattleIntro: ; 3f4dd ; 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 +8387,19 @@ BackUpBGMap2: ; 3f568 ; 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,15 +8412,15 @@ InitEnemyTrainer: ; 3f594 lb bc, 7, 7 predef PlaceGraphic ld a, -1 - ld [CurOTMon], a + ld [wCurOTMon], a ld a, TRAINER_BATTLE ld [wBattleMode], a 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 +8435,7 @@ InitEnemyTrainer: ; 3f594 pop bc dec b jr z, .done - ld hl, CurPartyMon + ld hl, wCurPartyMon inc [hl] jr .partyloop .done @@ -8447,29 +8447,29 @@ InitEnemyWildmon: ; 3f607 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 +8478,7 @@ InitEnemyWildmon: ; 3f607 ; 3f662 Unreferenced_Function3f662: ; 3f662 - ld hl, EnemyMonMoves + ld hl, wEnemyMonMoves ld de, wListMoves_MoveIndicesBuffer ld b, NUM_MOVES .loop @@ -8500,7 +8500,7 @@ Unreferenced_Function3f662: ; 3f662 call GetFarByte pop hl - ld bc, EnemyMonPP - (EnemyMonMoves + 1) + ld bc, wEnemyMonPP - (wEnemyMonMoves + 1) add hl, bc ld [hl], a @@ -8518,7 +8518,7 @@ Unreferenced_Function3f662: ; 3f662 .clearpp push bc push hl - ld bc, EnemyMonPP - (EnemyMonMoves + 1) + ld bc, wEnemyMonPP - (wEnemyMonMoves + 1) add hl, bc xor a ld [hl], a @@ -8562,10 +8562,10 @@ CleanUpBattleRAM: ; 3f6d0 xor 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,15 +8573,15 @@ CleanUpBattleRAM: ; 3f6d0 ld [wKeyItemsPocketCursor], a ld [wItemsPocketCursor], a ld [wBattleMenuCursorBuffer], a - ld [CurMoveNum], a + ld [wCurMoveNum], a ld [wBallsPocketCursor], a ld [wLastPocket], a ld [wMenuScrollPosition], a 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 +8614,11 @@ CheckPayDay: ; 3f71d .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 +8629,10 @@ CheckPayDay: ; 3f71d 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 +8734,7 @@ DisplayLinkRecord: ; 3f836 call ReadAndPrintLinkBattleRecord call CloseSRAM - hlcoord 0, 0, AttrMap + hlcoord 0, 0, wAttrMap xor a ld bc, SCREEN_WIDTH * SCREEN_HEIGHT call ByteFill @@ -8883,14 +8883,14 @@ ReadAndPrintLinkBattleRecord: ; 3f85f ; 3f998 BattleEnd_HandleRoamMons: ; 3f998 - ld a, [BattleType] + ld a, [wBattleType] cp BATTLETYPE_ROAMING jr nz, .not_roaming ld a, [wBattleResult] 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 +8916,7 @@ BattleEnd_HandleRoamMons: ; 3f998 ; 3f9d1 GetRoamMonMapGroup: ; 3f9d1 - ld a, [TempEnemyMonSpecies] + ld a, [wTempEnemyMonSpecies] ld b, a ld a, [wRoamMon1Species] cp b @@ -8931,7 +8931,7 @@ GetRoamMonMapGroup: ; 3f9d1 ; 3f9e9 GetRoamMonMapNumber: ; 3f9e9 - ld a, [TempEnemyMonSpecies] + ld a, [wTempEnemyMonSpecies] ld b, a ld a, [wRoamMon1Species] cp b @@ -8947,7 +8947,7 @@ GetRoamMonMapNumber: ; 3f9e9 GetRoamMonHP: ; 3fa01 ; output: hl = wRoamMonHP - ld a, [TempEnemyMonSpecies] + ld a, [wTempEnemyMonSpecies] ld b, a ld a, [wRoamMon1Species] cp b @@ -8963,7 +8963,7 @@ GetRoamMonHP: ; 3fa01 GetRoamMonDVs: ; 3fa19 ; output: hl = wRoamMonDVs - ld a, [TempEnemyMonSpecies] + ld a, [wTempEnemyMonSpecies] ld b, a ld a, [wRoamMon1Species] cp b @@ -8978,7 +8978,7 @@ GetRoamMonDVs: ; 3fa19 ; 3fa31 GetRoamMonSpecies: ; 3fa31 - ld a, [TempEnemyMonSpecies] + ld a, [wTempEnemyMonSpecies] ld hl, wRoamMon1Species cp [hl] ret z @@ -8990,11 +8990,11 @@ GetRoamMonSpecies: ; 3fa31 ; 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 +9012,7 @@ AddLastMobileBattleToLinkRecord: ; 3fa42 jr z, .copy push de ld bc, 12 - ld de, StringBuffer1 + ld de, wStringBuffer1 call CompareLong pop de pop hl @@ -9028,7 +9028,7 @@ AddLastMobileBattleToLinkRecord: ; 3fa42 .copy ld d, h ld e, l - ld hl, StringBuffer1 + ld hl, wStringBuffer1 ld bc, 12 call CopyBytes ld b, 6 @@ -9275,7 +9275,7 @@ GetTrainerBackpic: ; 3fbff ; 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 +9326,7 @@ CopyBackpic: ; 3fc30 ; 3fc5b .LoadTrainerBackpicAsOAM: ; 3fc5b - ld hl, Sprite01 + ld hl, wSprite01 xor a ld [hMapObjectIndexBuffer], a ld b, 6 @@ -9406,12 +9406,12 @@ BattleStartMessage: ; 3fc8b .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 diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index b07f9df210b..48efba8faf8 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -56,7 +56,7 @@ DoMove: ; 3402c ld a, BANK(MoveEffectsPointers) call GetFarHalfword - ld de, BattleScriptBuffer + ld de, wBattleScriptBuffer .GetMoveEffect: ld a, BANK(MoveEffects) @@ -68,27 +68,27 @@ DoMove: ; 3402c 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] 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 @@ BattleCommand_CheckTurn: ; 34084 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 @@ BattleCommand_CheckTurn: ; 34084 CheckPlayerTurn: - ld hl, PlayerSubStatus4 + ld hl, wPlayerSubStatus4 bit SUBSTATUS_RECHARGE, [hl] jr z, .no_recharge @@ -161,13 +161,13 @@ CheckPlayerTurn: .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 @@ CheckPlayerTurn: 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 @@ CheckPlayerTurn: 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 @@ CheckPlayerTurn: .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 @@ CheckPlayerTurn: .not_frozen - ld hl, PlayerSubStatus3 + ld hl, wPlayerSubStatus3 bit SUBSTATUS_FLINCHED, [hl] jr z, .not_flinched @@ -241,7 +241,7 @@ CheckPlayerTurn: .not_flinched - ld hl, PlayerDisableCount + ld hl, wPlayerDisableCount ld a, [hl] and a jr z, .not_disabled @@ -252,21 +252,21 @@ CheckPlayerTurn: jr nz, .not_disabled ld [hl], a - ld [DisabledMove], a + ld [wDisabledMove], a ld hl, DisabledNoMoreText call StdBattleTextBox .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 @@ CheckPlayerTurn: 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 @@ CheckPlayerTurn: .not_confused - ld a, [PlayerSubStatus1] + ld a, [wPlayerSubStatus1] add a ; bit SUBSTATUS_ATTRACT jr nc, .not_infatuated @@ -323,12 +323,12 @@ CheckPlayerTurn: ; 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 @@ CheckPlayerTurn: .no_disabled_move - ld hl, BattleMonStatus + ld hl, wBattleMonStatus bit PAR, [hl] ret z @@ -397,7 +397,7 @@ OpponentCantMove: ; 34216 CheckEnemyTurn: ; 3421f - ld hl, EnemySubStatus4 + ld hl, wEnemySubStatus4 bit SUBSTATUS_RECHARGE, [hl] jr z, .no_recharge @@ -410,13 +410,13 @@ CheckEnemyTurn: ; 3421f .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 @@ CheckEnemyTurn: ; 3421f 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 @@ CheckEnemyTurn: ; 3421f .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 @@ CheckEnemyTurn: ; 3421f .not_frozen - ld hl, EnemySubStatus3 + ld hl, wEnemySubStatus3 bit SUBSTATUS_FLINCHED, [hl] jr z, .not_flinched @@ -487,7 +487,7 @@ CheckEnemyTurn: ; 3421f .not_flinched - ld hl, EnemyDisableCount + ld hl, wEnemyDisableCount ld a, [hl] and a jr z, .not_disabled @@ -498,7 +498,7 @@ CheckEnemyTurn: ; 3421f jr nz, .not_disabled ld [hl], a - ld [EnemyDisabledMove], a + ld [wEnemyDisabledMove], a ld hl, DisabledNoMoreText call StdBattleTextBox @@ -506,15 +506,15 @@ CheckEnemyTurn: ; 3421f .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 @@ CheckEnemyTurn: ; 3421f 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 @@ CheckEnemyTurn: ; 3421f .not_confused - ld a, [EnemySubStatus1] + ld a, [wEnemySubStatus1] add a ; bit SUBSTATUS_ATTRACT jr nc, .not_infatuated @@ -590,12 +590,12 @@ CheckEnemyTurn: ; 3421f ; 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 @@ CheckEnemyTurn: ; 3421f .no_disabled_move - ld hl, EnemyMonStatus + ld hl, wEnemyMonStatus bit PAR, [hl] ret z @@ -656,7 +656,7 @@ HitConfusion: ; 343a5 call StdBattleTextBox xor a - ld [CriticalHit], a + ld [wCriticalHit], a call HitSelfInConfusion call BattleCommand_DamageCalc @@ -695,12 +695,12 @@ BattleCommand_CheckObedience: ; 343db 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 @@ BattleCommand_CheckObedience: ; 343db and a ret nz - ld a, [InBattleTowerBattle] + ld a, [wInBattleTowerBattle] and a ret nz @@ -717,11 +717,11 @@ BattleCommand_CheckObedience: ; 343db 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 @@ BattleCommand_CheckObedience: ; 343db ld b, a ld c, a - ld a, [BattleMonLevel] + ld a, [wBattleMonLevel] ld d, a add b @@ -839,7 +839,7 @@ BattleCommand_CheckObedience: ; 343db and SLP jr z, .Nap - ld [BattleMonStatus], a + ld [wBattleMonStatus], a ld hl, BeganToNapText jr .Print @@ -872,18 +872,18 @@ BattleCommand_CheckObedience: ; 343db .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 @@ BattleCommand_CheckObedience: ; 343db .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 @@ BattleCommand_CheckObedience: ; 343db ; 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 @@ BattleCommand_CheckObedience: ; 343db 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 @@ BattleCommand_CheckObedience: ; 343db ; 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 @@ BattleCommand_CheckObedience: ; 343db ; 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 @@ BattleCommand_DoTurn: ; 34555 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 @@ BattleCommand_DoTurn: ; 34555 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 @@ BattleCommand_DoTurn: ; 34555 dec a jr z, .wild - ld hl, OTPartyMon1PP - ld a, [CurOTMon] + ld hl, wOTPartyMon1PP + ld a, [wCurOTMon] .player call GetPartyLocation @@ -1110,9 +1110,9 @@ BattleCommand_DoTurn: ; 34555 .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 @@ BattleCommand_DoTurn: ; 34555 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 @@ BattleCommand_DoTurn: ; 34555 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 @@ BattleCommand_Critical: ; 34631 ; 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 @@ BattleCommand_Critical: ; 34631 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 @@ BattleCommand_Critical: ; 34631 cp [hl] ret nc ld a, 1 - ld [CriticalHit], a + ld [wCriticalHit], a ret INCLUDE "data/battle/critical_hits.asm" @@ -1312,7 +1312,7 @@ BattleCommand_TripleKick: ; 346b2 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 @@ BattleCommand_Stab: ; 346d2 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 @@ BattleCommand_Stab: ; 346d2 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 @@ BattleCommand_Stab: ; 346d2 jr .SkipStab .stab - ld hl, CurDamage + 1 + ld hl, wCurDamage + 1 ld a, [hld] ld h, [hl] ld l, a @@ -1416,11 +1416,11 @@ BattleCommand_Stab: ; 346d2 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 @@ BattleCommand_Stab: ; 346d2 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 @@ BattleCommand_Stab: ; 346d2 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,21 +1525,21 @@ BattleCommand_Stab: ; 346d2 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 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 @@ BattleCommand_ResetTypeMatchup: ; 34833 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 @@ BattleCommand_DamageVariation: ; 34cfd ; 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 @@ BattleCommand_DamageVariation: ; 34cfd ; ...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 @@ BattleCommand_CheckHit: ; 34d32 .Missed: ld a, 1 - ld [AttackMissed], a + ld [wAttackMissed], a ret @@ -1927,17 +1927,17 @@ BattleCommand_CheckHit: ; 34d32 ; 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 @@ BattleCommand_EffectChance: ; 34ecc ; effectchance xor a - ld [EffectFailed], a + ld [wEffectFailed], a call CheckSubstituteOpp jr nz, .failed @@ -2039,7 +2039,7 @@ BattleCommand_EffectChance: ; 34ecc .failed ld a, 1 - ld [EffectFailed], a + ld [wEffectFailed], a and a ret @@ -2085,7 +2085,7 @@ BattleCommand_LowerSub: ; 34eee 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_HitTarget: ; 34f57 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_HitTargetNoSub: ; 34f60 BattleCommand_StatUpAnim: ; 34fd1 - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jp nz, BattleCommand_MoveDelay @@ -2211,7 +2211,7 @@ BattleCommand_StatUpAnim: ; 34fd1 BattleCommand_StatDownAnim: ; 34fdb - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jp nz, BattleCommand_MoveDelay @@ -2262,7 +2262,7 @@ BattleCommand_RaiseSub: ; 35004 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 @@ BattleCommand_FailureText: ; 35023 ; 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 @@ BattleCommand_CheckFaint: ; 3505e 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 @@ BattleCommand_CheckFaint: ; 3505e 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,25 +2422,25 @@ GetFailureResultText: ; 350e4 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 .got_text call FailText_CheckOpponentProtect xor a - ld [CriticalHit], a + ld [wCriticalHit], a ld a, BATTLE_VARS_MOVE_EFFECT call GetBattleVar 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 @@ FailText_CheckOpponentProtect: ; 35157 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 @@ BattleCommand_CriticalText: ; 35175 ; 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 @@ BattleCommand_CriticalText: ; 35175 call StdBattleTextBox xor a - ld [CriticalHit], a + ld [wCriticalHit], a .wait ld c, 20 @@ -2528,11 +2528,11 @@ BattleCommand_CriticalText: ; 35175 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_SuperEffectiveLoopText: ; 351a5 BattleCommand_SuperEffectiveText: ; 351ad ; supereffectivetext - ld a, [TypeModifier] + ld a, [wTypeModifier] and $7f cp 10 ; 1.0 ret z @@ -2574,11 +2574,11 @@ BattleCommand_CheckDestinyBond: ; 351c0 ; 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,30 +2595,30 @@ BattleCommand_CheckDestinyBond: ; 351c0 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 .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 @@ BattleCommand_CheckDestinyBond: ; 351c0 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 @@ BattleCommand_BuildOpponentRage: ; 35250 jp .start .start - ld a, [AttackMissed] + ld a, [wAttackMissed] and a ret nz @@ -2696,10 +2696,10 @@ BattleCommand_BuildOpponentRage: ; 35250 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,18 +2716,18 @@ BattleCommand_RageDamage: ; 3527b 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 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 @@ DittoMetalPowder: ; 352b1 and a ld a, [hl] jr nz, .Ditto - ld a, [TempEnemyMonSpecies] + ld a, [wTempEnemyMonSpecies] .Ditto: cp DITTO @@ -2804,51 +2804,51 @@ PlayerAttackDamage: ; 352e2 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 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 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 @@ PlayerAttackDamage: ; 352e2 .done call TruncateHL_BC - ld a, [BattleMonLevel] + ld a, [wBattleMonLevel] ld e, a call DittoMetalPowder @@ -2924,7 +2924,7 @@ TruncateHL_BC: ; 3534d GetDamageStatsCritical: ; 35378 ; Return carry if non-critical. - ld a, [CriticalHit] + ld a, [wCriticalHit] and a scf ret z @@ -2945,28 +2945,28 @@ GetDamageStats: ; 3537e 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 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 @@ SpeciesItemBoost: ; 353d1 and a ld a, [hl] jr z, .CompareSpecies - ld a, [TempEnemyMonSpecies] + ld a, [wTempEnemyMonSpecies] .CompareSpecies: pop hl @@ -3070,50 +3070,50 @@ EnemyAttackDamage: ; 353f6 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 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 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 @@ EnemyAttackDamage: ; 353f6 .done call TruncateHL_BC - ld a, [EnemyMonLevel] + ld a, [wEnemyMonLevel] ld e, a call DittoMetalPowder @@ -3143,27 +3143,27 @@ BattleCommand_BeatUp: ; 35461 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 @@ BattleCommand_BeatUp: ; 35461 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 @@ BattleCommand_BeatUp: ; 35461 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 @@ BattleCommand_BeatUp: ; 35461 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,14 +3239,14 @@ BattleCommand_BeatUp: ; 35461 and a jr nz, .link_or_tower - ld a, [InBattleTowerBattle] + ld a, [wInBattleTowerBattle] and a jr nz, .link_or_tower 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 @@ BattleCommand_BeatUp: ; 35461 .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 @@ BattleCommand_BeatUp: ; 35461 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 @@ BattleCommand_BeatUp: ; 35461 jr .finish_beatup .wild - ld a, [EnemyMonSpecies] + ld a, [wEnemyMonSpecies] ld [wNamedObjectIndexBuffer], a call GetPokemonName ld hl, BeatUpAttackText @@ -3295,18 +3295,18 @@ BattleCommand_BeatUp: ; 35461 .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 @@ GetBeatupMonLocation: ; 355bd 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 @@ GetBeatupMonLocation: ; 355bd BattleCommand_ClearMissDamage: ; 355d5 ; clearmissdamage - ld a, [AttackMissed] + ld a, [wAttackMissed] and a ret z @@ -3372,14 +3372,14 @@ HitSelfInConfusion: ; 355dd 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 @@ BattleCommand_DamageCalc: ; 35612 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 @@ BattleCommand_DamageCalc: ; 35612 .CriticalMultiplier: - ld a, [CriticalHit] + ld a, [wCriticalHit] and a ret z @@ -3648,11 +3648,11 @@ INCLUDE "data/battle/type_boost_items.asm" 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 @@ BattleCommand_ConstantDamage: ; 35726 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 @@ BattleCommand_ConstantDamage: ; 35726 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 @@ BattleCommand_Counter: ; 35813 ; 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 @@ BattleCommand_Counter: ; 35813 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 @@ BattleCommand_Counter: ; 35813 .capped xor a - ld [AttackMissed], a + ld [wAttackMissed], a ret ; 35864 @@ -3879,13 +3879,13 @@ BattleCommand_Counter: ; 35813 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 @@ BattleCommand_Encore: ; 35864 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 @@ BattleCommand_Encore: ; 35864 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 @@ BattleCommand_Encore: ; 35864 .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 @@ BattleCommand_Encore: ; 35864 .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 @@ BattleCommand_Encore: ; 35864 .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_Encore: ; 35864 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 @@ BattleCommand_PainSplit: ; 35926 .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 @@ BattleCommand_PainSplit: ; 35926 .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 @@ BattleCommand_Snore: ; 359d0 ret nz call ResetDamage ld a, $1 - ld [AttackMissed], a + ld [wAttackMissed], a call FailSnore jp EndMoveEffect @@ -4117,14 +4117,14 @@ BattleCommand_Snore: ; 359d0 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 @@ BattleCommand_LockOn: ; 35a53 call CheckSubstituteOpp jr nz, .fail - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr nz, .fail @@ -4235,11 +4235,11 @@ BattleCommand_Sketch: ; 35a74 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 @@ BattleCommand_Sketch: ; 35a74 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 @@ BattleCommand_SleepTalk: ; 35b33 ; 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 @@ BattleCommand_SleepTalk: ; 35b33 .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_DestinyBond: ; 35bff 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 @@ BattleCommand_Spite: ; 35c0f 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_Spite: ; 35c0f 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 @@ BattleCommand_FalseSwipe: ; 35c94 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 @@ BattleCommand_HealBell: ; 35cc9 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 @@ FarPlayBattleAnimation: ; 35d00 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 @@ PlayFXAnimID: ; 35d08 EnemyHurtItself: ; 35d1c - ld hl, CurDamage + ld hl, wCurDamage ld a, [hli] ld b, a ld a, [hl] @@ -4730,46 +4730,46 @@ EnemyHurtItself: ; 35d1c and a jr nz, .mimic_sub_check - ld a, [EnemySubStatus4] + ld a, [wEnemySubStatus4] bit SUBSTATUS_SUBSTITUTE, a jp nz, SelfInflictDamageToSubstitute .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 @@ EnemyHurtItself: ; 35d1c PlayerHurtItself: ; 35d7e - ld hl, CurDamage + ld hl, wCurDamage ld a, [hli] ld b, a ld a, [hl] @@ -4792,44 +4792,44 @@ PlayerHurtItself: ; 35d7e 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 @@ SelfInflictDamageToSubstitute: ; 35de0 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 @@ UpdateMoveData: ; 35e40 ld a, BATTLE_VARS_MOVE call GetBattleVar - ld [CurMove], a + ld [wCurMove], a ld [wNamedObjectIndexBuffer], a dec a @@ -4945,7 +4945,7 @@ BattleCommand_SleepTarget: ; 35e5c ld hl, AlreadyAsleepText jr nz, .fail - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jp nz, PrintDidntAffect2 @@ -4962,7 +4962,7 @@ BattleCommand_SleepTarget: ; 35e5c call AnimateCurrentMove ld b, $7 - ld a, [InBattleTowerBattle] + ld a, [wInBattleTowerBattle] and a jr z, .random_loop ld b, $3 @@ -5006,12 +5006,12 @@ BattleCommand_SleepTarget: ; 35e5c 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 @@ BattleCommand_PoisonTarget: ; 35eee call GetBattleVarAddr and a ret nz - ld a, [TypeModifier] + ld a, [wTypeModifier] and $7f ret z call CheckIfTargetIsPoisonType @@ -5044,7 +5044,7 @@ BattleCommand_PoisonTarget: ; 35eee 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 @@ BattleCommand_Poison: ; 35f2c ; poison ld hl, DoesntAffectText - ld a, [TypeModifier] + ld a, [wTypeModifier] and $7f jp z, .failed @@ -5107,11 +5107,11 @@ BattleCommand_Poison: ; 35f2c 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 @@ BattleCommand_Poison: ; 35f2c .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 @@ BattleCommand_Poison: ; 35f2c 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 @@ BattleCommand_Poison: ; 35f2c 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 @@ BattleCommand_EatDream: ; 36008 SapHealth: ; 36011 - ld hl, CurDamage + ld hl, wCurDamage ld a, [hli] srl a ld [hDividend], a @@ -5239,15 +5239,15 @@ SapHealth: ; 36011 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 @@ SapHealth: ; 36011 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 @@ SapHealth: ; 36011 .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 @@ BattleCommand_BurnTarget: ; 3608c 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 @@ BattleCommand_BurnTarget: ; 3608c 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 @@ Defrost: ; 360dd 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,7 +5391,7 @@ BattleCommand_FreezeTarget: ; 36102 call GetBattleVarAddr and a ret nz - ld a, [TypeModifier] + ld a, [wTypeModifier] and $7f ret z ld a, [wBattleWeather] @@ -5403,7 +5403,7 @@ BattleCommand_FreezeTarget: ; 36102 ld a, b cp HELD_PREVENT_FREEZE ret z - ld a, [EffectFailed] + ld a, [wEffectFailed] and a ret nz call SafeCheckSafeguard @@ -5447,14 +5447,14 @@ BattleCommand_ParalyzeTarget: ; 36165 call GetBattleVarAddr and a ret nz - ld a, [TypeModifier] + ld a, [wTypeModifier] and $7f ret z call GetOpponentItem 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_EvasionUp2: ; 361e0 BattleCommand_StatUp: ; 361e4 ; statup call CheckIfStatCanBeRaised - ld a, [FailedMessage] + ld a, [wFailedMessage] and a ret nz jp StatUpAnimation @@ -5558,20 +5558,20 @@ BattleCommand_StatUp: ; 361e4 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 @@ CheckIfStatCanBeRaised: ; 361ef 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 @@ CheckIfStatCanBeRaised: ; 361ef 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 @@ CheckIfStatCanBeRaised: ; 361ef .done_calcing_stats pop hl xor a - ld [FailedMessage], a + ld [wFailedMessage], a ret ; 3626e @@ -5647,9 +5647,9 @@ CheckIfStatCanBeRaised: ; 361ef .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 @@ CheckIfStatCanBeRaised: ; 361ef .stat_raise_failed ; 3627b ld a, $1 - ld [FailedMessage], a + ld [wFailedMessage], a ret ; 36281 @@ -5763,20 +5763,20 @@ BattleCommand_EvasionDown2: ; 362e1 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 @@ BattleCommand_StatDown: ; 362e3 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 @@ BattleCommand_StatDown: ; 362e3 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 @@ BattleCommand_StatDown: ; 362e3 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 @@ BattleCommand_StatDown: ; 362e3 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,29 +5858,29 @@ BattleCommand_StatDown: ; 362e3 .Hit: xor a - ld [FailedMessage], a + ld [wFailedMessage], a ret .CouldntLower: 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 @@ CheckMist: ; 36391 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 @@ BattleCommand_StatUpMessage: ; 363b8 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_StatUpMessage: ; 363b8 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 @@ BattleCommand_StatDownMessage: ; 363e9 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 @@ TryLowerStat: ; 3641a BattleCommand_StatUpFailText: ; 3644c ; statupfailtext - ld a, [FailedMessage] + ld a, [wFailedMessage] and a ret z push af @@ -6035,7 +6035,7 @@ BattleCommand_StatUpFailText: ; 3644c 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_StatUpFailText: ; 3644c BattleCommand_StatDownFailText: ; 3646a ; statdownfailtext - ld a, [FailedMessage] + ld a, [wFailedMessage] and a ret z push af @@ -6059,7 +6059,7 @@ BattleCommand_StatDownFailText: ; 3646a 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 @@ GetStatName: ; 3648f 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,23 +6125,23 @@ BattleCommand_AllStatsUp: ; 36500 ResetMiss: ; 3652d xor a - ld [AttackMissed], a + ld [wAttackMissed], a ret ; 36532 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 @@ LowerStat: ; 36532 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 @@ LowerStat: ; 36532 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 @@ LowerStat: ; 36532 .finish xor a - ld [FailedMessage], a + ld [wFailedMessage], a ret .failed @@ -6199,7 +6199,7 @@ LowerStat: ; 36532 .cant_lower_anymore ld a, 2 - ld [FailedMessage], a + ld [wFailedMessage], a ret ; 3658f @@ -6269,9 +6269,9 @@ BattleCommand_LowerSubNoAnim: ; 365c3 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 @@ CalcPlayerStats: ; 365d7 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 @@ BattleCommand_StoreEnergy: ; 36671 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 @@ BattleCommand_StoreEnergy: ; 36671 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_StoreEnergy: ; 36671 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_UnleashEnergy: ; 366e5 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 @@ BattleCommand_Rampage: ; 36751 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_Rampage: ; 36751 BattleCommand_Teleport: ; 36778 ; teleport - ld a, [BattleType] + ld a, [wBattleType] cp BATTLETYPE_SHINY jr z, .failed cp BATTLETYPE_TRAP @@ -6588,9 +6588,9 @@ BattleCommand_Teleport: ; 36778 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 @@ BattleCommand_Teleport: ; 36778 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 @@ SetBattleDraw: ; 36804 BattleCommand_ForceSwitch: ; 3680f ; forceswitch - ld a, [BattleType] + ld a, [wBattleType] cp BATTLETYPE_SHINY jp z, .fail cp BATTLETYPE_TRAP @@ -6680,15 +6680,15 @@ BattleCommand_ForceSwitch: ; 3680f 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 @@ BattleCommand_ForceSwitch: ; 3680f 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 @@ BattleCommand_ForceSwitch: ; 3680f 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 @@ BattleCommand_ForceSwitch: ; 3680f jp .fail .force_player_switch - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr nz, .player_miss @@ -6776,9 +6776,9 @@ BattleCommand_ForceSwitch: ; 3680f 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 @@ BattleCommand_ForceSwitch: ; 3680f 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 @@ BattleCommand_ForceSwitch: ; 3680f push af push bc - ld hl, PartyMon1HP + ld hl, wPartyMon1HP call GetPartyLocation ld a, [hli] or [hl] @@ -6851,7 +6851,7 @@ BattleCommand_ForceSwitch: ; 3680f jr z, .random_loop_trainer_playeristarget ld a, d - ld [CurPartyMon], a + ld [wCurPartyMon], a ld hl, SwitchPlayerMon call CallBattleCore @@ -6888,17 +6888,17 @@ BattleCommand_ForceSwitch: ; 3680f 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 @@ BattleCommand_EndLoop: ; 369b6 ; 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 @@ BattleCommand_EndLoop: ; 369b6 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 @@ BattleCommand_EndLoop: ; 369b6 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 @@ BattleCommand_EndLoop: ; 369b6 ; 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,16 +7049,16 @@ BattleCommand_EndLoop: ; 369b6 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 BattleCommand_FakeOut: ; 36a82 - ld a, [AttackMissed] + ld a, [wAttackMissed] and a ret nz @@ -7075,7 +7075,7 @@ BattleCommand_FakeOut: ; 36a82 .fail ld a, 1 - ld [AttackMissed], a + ld [wAttackMissed], a ret ; 36aa0 @@ -7093,7 +7093,7 @@ BattleCommand_FlinchTarget: ; 36aa0 call CheckOpponentWentFirst ret nz - ld a, [EffectFailed] + ld a, [wEffectFailed] and a ret nz @@ -7127,7 +7127,7 @@ CheckOpponentWentFirst: ; 36abf BattleCommand_HeldFlinch: ; 36ac9 ; kingsrock - ld a, [AttackMissed] + ld a, [wAttackMissed] and a ret nz @@ -7159,11 +7159,11 @@ BattleCommand_OHKO: ; 36af3 ; 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 @@ BattleCommand_OHKO: ; 36af3 .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 @@ BattleCommand_Charge: ; 36b4d set SUBSTATUS_CHARGED, [hl] ld hl, IgnoredOrders2Text - ld a, [AlreadyDisobeyed] + ld a, [wAlreadyDisobeyed] and a call nz, StdBattleTextBox @@ -7373,7 +7373,7 @@ BattleCommand3c: ; 36c2c BattleCommand_TrapTarget: ; 36c2d ; traptarget - ld a, [AttackMissed] + ld a, [wAttackMissed] and a ret nz ld hl, wEnemyWrapCount @@ -7469,19 +7469,19 @@ BattleCommand_FocusEnergy: ; 36c98 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 @@ BattleCommand_Recoil: ; 36cb2 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 @@ BattleCommand_ConfuseTarget: ; 36d1d 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 @@ BattleCommand_Confuse: ; 36d3b .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 @@ BattleCommand_Paralyze: ; 36dc7 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 @@ BattleCommand_Paralyze: ; 36dc7 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 @@ BattleCommand_Paralyze: ; 36dc7 call GetBattleVarAddr and a jr nz, .failed - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr nz, .failed call CheckSubstituteOpp @@ -7732,11 +7732,11 @@ CheckMoveTypeMatchesTarget: ; 36e5b 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 @@ BattleCommand_Substitute: ; 36e7c ; 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 @@ BattleCommand_Substitute: ; 36e7c 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 @@ BattleCommand_DoubleUndergroundDamage: ; 36f2f DoubleDamage: ; 36f37 - ld hl, CurDamage + 1 + ld hl, wCurDamage + 1 sla [hl] dec hl rl [hl] @@ -7928,14 +7928,14 @@ BattleCommand_Mimic: ; 36f46 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 @@ BattleCommand_Mimic: ; 36f46 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_Mimic: ; 36f46 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_Splash: ; 36fe1 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 @@ BattleCommand_Disable: ; 36fed 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 @@ BattleCommand_Disable: ; 36fed 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 @@ BattleCommand_PayDay: ; 3705c ; 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_PayDay: ; 3705c 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 @@ BattleCommand_Conversion: ; 3707f inc de ld [de], a pop de - ld hl, StringBuffer1 + ld hl, wStringBuffer1 .loop2 ld a, [hl] cp -1 @@ -8207,7 +8207,7 @@ BattleCommand_Conversion: ; 3707f 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 @@ BattleCommand_ResetStats: ; 3710e ; 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 @@ BattleCommand_ResetStats: ; 3710e jp StdBattleTextBox .Fill: - ld b, PlayerStatLevelsEnd - PlayerStatLevels + ld b, wPlayerStatLevelsEnd - wPlayerStatLevels .next ld [hli], a dec b @@ -8274,13 +8274,13 @@ BattleCommand_ResetStats: ; 3710e 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 @@ ResetActorDisable: ; 372e7 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 @@ ResetActorDisable: ; 372e7 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 @@ PrintNothingHappened: ; 37343 TryPrintButItFailed: ; 37349 - ld a, [AlreadyFailed] + ld a, [wAlreadyFailed] and a ret nz @@ -8590,11 +8590,11 @@ INCLUDE "engine/battle/effect_commands/metronome.asm" 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 @@ ResetTurn: ; 3747b .player ld [hl], 1 xor a - ld [AlreadyDisobeyed], a + ld [wAlreadyDisobeyed], a call DoMove jp EndMoveEffect @@ -8727,14 +8727,14 @@ BattleCommand5d: ; 37791 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 @@ BattleCommand_FuryCutter: ; 37792 ret z ; Double the damage - ld hl, CurDamage + 1 + ld hl, wCurDamage + 1 sla [hl] dec hl rl [hl] @@ -8771,11 +8771,11 @@ ResetFuryCutterCount: ; 377be 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 @@ INCLUDE "engine/battle/effect_commands/attract.asm" 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 @@ BattleCommand_FrustrationPower: ; 3790e ; 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_FrustrationPower: ; 3790e 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 @@ BattleCommand_Safeguard: ; 37939 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 @@ SafeCheckSafeguard: ; 37962 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 @@ -9069,7 +9069,7 @@ BatonPass_LinkEnemySwitch: ; 37a82 ld hl, LinkBattleSendReceiveAction call CallBattleCore - ld a, [OTPartyCount] + ld a, [wOTPartyCount] add BATTLEACTION_SWITCH1 ld b, a ld a, [wBattleAction] @@ -9079,7 +9079,7 @@ BatonPass_LinkEnemySwitch: ; 37a82 jr c, .switch .baton_pass - ld a, [CurOTMon] + ld a, [wCurOTMon] add BATTLEACTION_SWITCH1 ld [wBattleAction], a .switch @@ -9113,11 +9113,11 @@ ResetBatonPassStatus: ; 37ab1 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 @@ ResetBatonPassStatus: ; 37ab1 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 @@ CheckAnyOtherAlivePartyMons: ; 37ae9 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 @@ BattleCommand_Pursuit: ; 37b1d and a ret z - ld hl, CurDamage + 1 + ld hl, wCurDamage + 1 sla [hl] dec hl rl [hl] @@ -9237,12 +9237,12 @@ BattleCommand_ClearHazards: ; 37b39 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_HealNite: ; 37b7c 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 @@ -9312,7 +9312,7 @@ BattleCommand_TimeBasedHealContinue: ; 37b7e and a jr nz, .checkWeather - ld a, [TimeOfDay] + ld a, [wTimeOfDay] cp b jr z, .checkWeather dec c ; double @@ -9372,7 +9372,7 @@ BattleCommand_TimeBasedHealContinue: ; 37b7e BattleCommand_HiddenPower: ; 37be8 ; hiddenpower - ld a, [AttackMissed] + ld a, [wAttackMissed] and a ret nz farcall HiddenPowerDamage @@ -9386,7 +9386,7 @@ BattleCommand_StartRain: ; 37bf4 ld a, WEATHER_RAIN ld [wBattleWeather], a ld a, 5 - ld [WeatherCount], a + ld [wWeatherCount], a call AnimateCurrentMove ld hl, DownpourText jp StdBattleTextBox @@ -9399,7 +9399,7 @@ BattleCommand_StartSun: ; 37c07 ld a, WEATHER_SUN ld [wBattleWeather], a ld a, 5 - ld [WeatherCount], a + ld [wWeatherCount], a call AnimateCurrentMove ld hl, SunGotBrightText jp StdBattleTextBox @@ -9413,7 +9413,7 @@ BattleCommand_BellyDrum: ; 37c1a ; 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_BellyDrum: ; 37c1a 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 @@ BattleCommand_MirrorCoat: ; 37c95 ; mirrorcoat ld a, 1 - ld [AttackMissed], a + ld [wAttackMissed], a ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP call GetBattleVar @@ -9526,18 +9526,18 @@ BattleCommand_MirrorCoat: ; 37c95 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 @@ BattleCommand_MirrorCoat: ; 37c95 .capped xor a - ld [AttackMissed], a + ld [wAttackMissed], a ret ; 37ce6 @@ -9573,7 +9573,7 @@ BattleCommand_DoubleMinimizeDamage: ; 37ce6 ld a, [hl] and a ret z - ld hl, CurDamage + 1 + ld hl, wCurDamage + 1 sla [hl] dec hl rl [hl] @@ -9618,9 +9618,9 @@ BattleCommand_CheckFutureSight: ; 37d0d 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 @@ BattleCommand_FutureSight: ; 37d34 jr z, .StoreDamage ld de, wEnemyFutureSightDamage .StoreDamage: - ld hl, CurDamage + ld hl, wCurDamage ld a, [hl] ld [de], a ld [hl], 0 @@ -9718,11 +9718,11 @@ CheckHiddenOpponent: ; 37daa 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 @@ GetUserItem: ; 37db2 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,14 +9807,14 @@ AnimateCurrentMove: ; 37e01 PlayDamageAnim: ; 37e19 xor a - ld [FXAnimID + 1], a + ld [wFXAnimID + 1], a ld a, BATTLE_VARS_MOVE_ANIM call GetBattleVar and a ret z - ld [FXAnimID], a + ld [wFXAnimID], a ld a, [hBattleTurn] and a @@ -9833,7 +9833,7 @@ PlayDamageAnim: ; 37e19 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 @@ LoadMoveAnim: ; 37e36 LoadAnim: ; 37e44 - ld [FXAnimID], a + ld [wFXAnimID], a ; fallthrough ; 37e47 @@ -9867,9 +9867,9 @@ PlayUserBattleAnim: ; 37e47 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 @@ BattleCommand_ClearText: ; 37e85 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 @@ SkipToBattleCommand: ; 37e8c 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 diff --git a/engine/battle/effect_commands/attract.asm b/engine/battle/effect_commands/attract.asm index 0a6d7c975a2..da6a9c0e9ae 100755 --- 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 @@ CheckOppositeGender: ; 377f5 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 @@ CheckOppositeGender: ; 377f5 .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 diff --git a/engine/battle/effect_commands/curse.asm b/engine/battle/effect_commands/curse.asm index dceb3b8d546..b11b9f3fb72 100644 --- 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 diff --git a/engine/battle/effect_commands/foresight.asm b/engine/battle/effect_commands/foresight.asm index 6f4f97cd2f8..006e3b3d71c 100644 --- 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 diff --git a/engine/battle/effect_commands/perish_song.asm b/engine/battle/effect_commands/perish_song.asm index ac491ef6bb3..8c88c8739df 100644 --- a/engine/battle/effect_commands/perish_song.asm +++ b/engine/battle/effect_commands/perish_song.asm @@ -2,8 +2,8 @@ BattleCommand_PerishSong: ; 376c2 ; perishsong - ld hl, PlayerSubStatus1 - ld de, EnemySubStatus1 + ld hl, wPlayerSubStatus1 + ld de, wEnemySubStatus1 bit SUBSTATUS_PERISH, [hl] jr z, .ok @@ -17,7 +17,7 @@ BattleCommand_PerishSong: ; 376c2 set SUBSTATUS_PERISH, [hl] ld a, 4 - ld [PlayerPerishCount], a + ld [wPlayerPerishCount], a .enemy ld a, [de] @@ -27,7 +27,7 @@ BattleCommand_PerishSong: ; 376c2 set SUBSTATUS_PERISH, a ld [de], a ld a, 4 - ld [EnemyPerishCount], a + ld [wEnemyPerishCount], a .done call AnimateCurrentMove diff --git a/engine/battle/effect_commands/present.asm b/engine/battle/effect_commands/present.asm index 2b358e8b96d..f0cf8006d27 100755 --- a/engine/battle/effect_commands/present.asm +++ b/engine/battle/effect_commands/present.asm @@ -20,7 +20,7 @@ BattleCommand_Present: ; 37874 ld a, [wTypeMatchup] and a jp z, AnimateFailedMove - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jp nz, AnimateFailedMove diff --git a/engine/battle/effect_commands/protect.asm b/engine/battle/effect_commands/protect.asm index 568ac00f81f..6c65e0ed137 100644 --- a/engine/battle/effect_commands/protect.asm +++ b/engine/battle/effect_commands/protect.asm @@ -16,11 +16,11 @@ BattleCommand_Protect: ; 37618 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 diff --git a/engine/battle/effect_commands/rollout.asm b/engine/battle/effect_commands/rollout.asm index 4ce9ab3d8f7..f6966c48a32 100644 --- a/engine/battle/effect_commands/rollout.asm +++ b/engine/battle/effect_commands/rollout.asm @@ -4,11 +4,11 @@ MAX_ROLLOUT_COUNT EQU 5 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 @@ BattleCommand_RolloutPower: ; 37734 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 @@ BattleCommand_RolloutPower: ; 37734 ld [wSomeoneIsRampaging], a .skip_set_rampage - ld a, [AttackMissed] + ld a, [wAttackMissed] and a jr z, .hit @@ -84,7 +84,7 @@ BattleCommand_RolloutPower: ; 37734 dec b jr z, .done_damage - ld hl, CurDamage + 1 + ld hl, wCurDamage + 1 sla [hl] dec hl rl [hl] diff --git a/engine/battle/effect_commands/sandstorm.asm b/engine/battle/effect_commands/sandstorm.asm index 7bd6534207e..5aaa61deb14 100644 --- a/engine/battle/effect_commands/sandstorm.asm +++ b/engine/battle/effect_commands/sandstorm.asm @@ -8,7 +8,7 @@ BattleCommand_StartSandstorm: ; 376f8 ld a, WEATHER_SANDSTORM ld [wBattleWeather], a ld a, 5 - ld [WeatherCount], a + ld [wWeatherCount], a call AnimateCurrentMove ld hl, SandstormBrewedText jp StdBattleTextBox diff --git a/engine/battle/effect_commands/spikes.asm b/engine/battle/effect_commands/spikes.asm index 3d15e4cfdc1..a5e22a706dd 100644 --- 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! diff --git a/engine/battle/effect_commands/thief.asm b/engine/battle/effect_commands/thief.asm index 6d32d68d40f..5397c2bdf0f 100644 --- a/engine/battle/effect_commands/thief.asm +++ b/engine/battle/effect_commands/thief.asm @@ -26,7 +26,7 @@ BattleCommand_Thief: ; 37492 farcall ItemIsMail ret c - ld a, [EffectFailed] + ld a, [wEffectFailed] and a ret nz @@ -74,7 +74,7 @@ BattleCommand_Thief: ; 37492 farcall ItemIsMail ret c - ld a, [EffectFailed] + ld a, [wEffectFailed] and a ret nz @@ -103,7 +103,7 @@ BattleCommand_Thief: ; 37492 call BattlePartyAttr ld d, h ld e, l - ld hl, BattleMonItem + ld hl, wBattleMonItem ret .enemyitem @@ -111,6 +111,6 @@ BattleCommand_Thief: ; 37492 call OTPartyAttr ld d, h ld e, l - ld hl, EnemyMonItem + ld hl, wEnemyMonItem ret ; 37517 diff --git a/engine/battle/effect_commands/transform.asm b/engine/battle/effect_commands/transform.asm index 65c3f3e60b0..5ae7c1511e4 100755 --- a/engine/battle/effect_commands/transform.asm +++ b/engine/battle/effect_commands/transform.asm @@ -11,7 +11,7 @@ BattleCommand_Transform: ; 371cd 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 @@ BattleCommand_Transform: ; 371cd 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 @@ BattleCommand_Transform: ; 371cd 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 @@ BattleCommand_Transform: ; 371cd 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 @@ BattleCommand_Transform: ; 371cd 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 @@ BattleCommand_Transform: ; 371cd .after_anim xor a ld [wNumHits], a - ld [FXAnimID + 1], a + ld [wFXAnimID + 1], a ld a, $2 ld [wKickCounter], a pop af diff --git a/engine/battle/hidden_power.asm b/engine/battle/hidden_power.asm index a1d3957e4ef..9d9a8dc0e66 100644 --- 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 diff --git a/engine/battle/link_result.asm b/engine/battle/link_result.asm index cf6102accfe..8f456da9b18 100755 --- 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 @@ DetermineLinkBattleResult: ; 2b930 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 @@ DetermineLinkBattleResult: ; 2b930 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 diff --git a/engine/battle/misc.asm b/engine/battle/misc.asm index d7b5584c7bf..b79c274b95d 100644 --- a/engine/battle/misc.asm +++ b/engine/battle/misc.asm @@ -105,7 +105,7 @@ DoWeatherModifiers: ; fbda4 .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 @@ DoWeatherModifiers: ; fbda4 .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 @@ DoBadgeTypeBoosts: ; fbe24 and a ret nz - ld a, [InBattleTowerBattle] + ld a, [wInBattleTowerBattle] and a ret nz @@ -199,10 +199,10 @@ DoBadgeTypeBoosts: ; fbe24 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 @@ DoBadgeTypeBoosts: ; fbe24 .Update: ld a, h - ld [CurDamage], a + ld [wCurDamage], a ld a, l - ld [CurDamage + 1], a + ld [wCurDamage + 1], a .done pop bc diff --git a/engine/battle/read_trainer_attributes.asm b/engine/battle/read_trainer_attributes.asm index dfb8d368253..0b9507e0dfb 100644 --- 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,35 +20,35 @@ GetTrainerClassName: ; 3952d 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 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 diff --git a/engine/battle/read_trainer_dvs.asm b/engine/battle/read_trainer_dvs.asm index d7c0ff50b16..c021e8e8c4c 100644 --- 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 diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm index a09c6dd0802..9f7a4a4a8e6 100755 --- 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 @@ ReadTrainerParty: ; 39771 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 @@ ReadTrainerParty: ; 39771 ld h, [hl] ld l, a - ld a, [OtherTrainerID] + ld a, [wOtherTrainerID] ld b, a .skip_trainer dec b @@ -97,11 +97,11 @@ TrainerType1: ; 397eb 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 @@ TrainerType2: ; 39806 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 @@ TrainerType2: ; 39806 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 @@ TrainerType3: ; 39871 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 @@ TrainerType4: ; 3989d 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 @@ TrainerType4: ; 3989d 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 @@ TrainerType4: ; 3989d 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 @@ ComputeTrainerReward: ; 3991b (e:591b) 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 @@ ComputeTrainerReward: ; 3991b (e:591b) 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 @@ GetTrainerName:: ; 3994c jr .loop CopyTrainerName: ; 39984 - ld de, StringBuffer1 + ld de, wStringBuffer1 push de ld bc, NAME_LENGTH call CopyBytes @@ -389,7 +389,7 @@ CopyTrainerName: ; 39984 Function39990: ; 39990 ; This function is useless. - ld de, StringBuffer1 + ld de, wStringBuffer1 push de ld bc, NAME_LENGTH pop de diff --git a/engine/battle/returntobattle_useball.asm b/engine/battle/returntobattle_useball.asm index e6e33f9009b..b63881b2ccc 100644 --- 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 diff --git a/engine/battle/sliding_intro.asm b/engine/battle/sliding_intro.asm index 418454283be..781d30f3851 100755 --- 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 @@ BattleIntroSlidingPics: ; 4e980 ; 4e9d6 .subfunction3 ; 4e9d6 - ld hl, Sprite01XCoord + ld hl, wSprite01XCoord ld c, $12 ; 18 ld de, SPRITEOAMSTRUCT_LENGTH .loop3 @@ -73,7 +73,7 @@ BattleIntroSlidingPics: ; 4e980 ; 4e9e5 .subfunction4 ; 4e9e5 - ld hl, LYOverrides + ld hl, wLYOverrides ld a, $90 ld bc, SCREEN_HEIGHT_PX call ByteFill @@ -81,7 +81,7 @@ BattleIntroSlidingPics: ; 4e980 ; 4e9f1 .subfunction5 ; 4e9f1 - ld hl, LYOverrides + ld hl, wLYOverrides ld a, d ld c, $3e ; 62 .loop4 diff --git a/engine/battle/start_battle.asm b/engine/battle/start_battle.asm index 98a32c0dde8..84cd1e858d3 100644 --- a/engine/battle/start_battle.asm +++ b/engine/battle/start_battle.asm @@ -17,7 +17,7 @@ FindFirstAliveMonAndStartBattle: ; 2ee2f 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 @@ FindFirstAliveMonAndStartBattle: ; 2ee2f 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 @@ PlayBattleMusic: ; 2ee6c 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 @@ PlayBattleMusic: ; 2ee6c jp z, .done ; Are we fighting a trainer? - ld a, [OtherTrainerClass] + ld a, [wOtherTrainerClass] and a jr nz, .trainermusic @@ -76,7 +76,7 @@ PlayBattleMusic: ; 2ee6c 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 @@ PlayBattleMusic: ; 2ee6c 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 @@ -160,25 +160,25 @@ ClearBattleRAM: ; 2ef18 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 diff --git a/engine/battle/trainer_huds.asm b/engine/battle/trainer_huds.asm index 317e722143e..f35d2fcddac 100755 --- a/engine/battle/trainer_huds.asm +++ b/engine/battle/trainer_huds.asm @@ -18,8 +18,8 @@ EnemySwitch_TrainerHud: ; 2c012 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 @@ ShowPlayerMonsRemaining: ; 2c01c ld [hl], a ld a, 8 ld [wPlaceBallsDirection], a - ld hl, Sprite01 + ld hl, wSprite01 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,14 +44,14 @@ ShowOTTrainerMonsRemaining: ; 2c03a ld [hl], 4 * 8 ld a, -8 ld [wPlaceBallsDirection], a - ld hl, Sprite01 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH + ld hl, wSprite01 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH jp LoadTrainerHudOAM ; 2c059 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 @@ StageBallTilesData: ; 2c059 dec c jr nz, .loop1 pop af - ld de, Buffer1 + ld de, wBuffer1 .loop2 push af call .GetHUDTile @@ -147,7 +147,7 @@ DrawEnemyHUDBorder: ; 2c0c5 ld a, [wBattleMode] dec a ret nz - ld a, [TempEnemyMonSpecies] + ld a, [wTempEnemyMonSpecies] dec a call CheckCaughtMon ret z @@ -167,25 +167,25 @@ PlaceHUDBorderTiles: ; 2c0f1 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 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 @@ LinkBattle_TrainerHuds: ; 2c10d ld [hl], 8 * 8 ld a, $8 ld [wPlaceBallsDirection], a - ld hl, Sprite01 + ld hl, wSprite01 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, wSprite01 + 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 @@ _ShowLinkBattleParticipants: ; 2c1b2 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, "" diff --git a/engine/battle/updatebattlehuds.asm b/engine/battle/updatebattlehuds.asm index ec7f662e817..0c31f1c36b9 100644 --- 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 diff --git a/engine/battle/used_move_text.asm b/engine/battle/used_move_text.asm index 1b5aa564cbf..bab0ea834e6 100755 --- a/engine/battle/used_move_text.asm +++ b/engine/battle/used_move_text.asm @@ -46,7 +46,7 @@ UsedMoveText: ; 105db9 ; 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 @@ UsedMove2Text: ; 105e0b start_asm UsedMoveText_CheckObedience: ; 105e10 ; check obedience - ld a, [AlreadyDisobeyed] + ld a, [wAlreadyDisobeyed] and a jr z, .GetMoveNameText ; print "instead," @@ -183,11 +183,11 @@ INCLUDE "data/moves/grammar.asm" 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 @@ UpdateUsedMoves: ; 105ed0 ; 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 @@ UpdateUsedMoves: ; 105ed0 ld [hl], a ; 4 = new move ld a, b - ld [PlayerUsedMoves + 3], a + ld [wPlayerUsedMoves + 3], a jr .quit .add diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index a25e4a98e32..e0573d3d50d 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -5,7 +5,7 @@ PlayBattleAnim: ; cc0d6 ld a, [rSVBK] push af - ld a, BANK(ActiveAnimObjects) + ld a, BANK(wActiveAnimObjects) ld [rSVBK], a call _PlayBattleAnim @@ -56,7 +56,7 @@ _PlayBattleAnim: ; cc0e4 BattleAnimRunScript: ; cc11c - ld a, [FXAnimID + 1] + ld a, [wFXAnimID + 1] and a jr nz, .hi_byte @@ -85,9 +85,9 @@ BattleAnimRunScript: ; cc11c 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,18 +111,18 @@ RunBattleAnimScript: ; cc163 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 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 @@ RunBattleAnimScript: ; cc163 call BattleAnimDelayFrame .done - ld a, [BattleAnimFlags] + ld a, [wBattleAnimFlags] bit 0, a jr z, .playframe @@ -163,7 +163,7 @@ BattleAnimRestoreHuds: ; cc1bb 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 @@ BattleAnimDelayFrame: ; cc1fb ; 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 @@ Unreferenced_Functioncc220: ; cc220 BattleAnim_ClearCGB_OAMFlags: ; cc23d - ld a, [BattleAnimFlags] + ld a, [wBattleAnimFlags] bit 3, a jr z, .delete - ld hl, Sprite01Attributes + ld hl, wSprite01Attributes ld c, NUM_SPRITE_OAM_STRUCTS .loop ld a, [hl] @@ -272,7 +272,7 @@ endr .delete ld hl, wVirtualOAM - ld c, SpritesEnd - wVirtualOAM + ld c, wSpritesEnd - wVirtualOAM xor a .loop2 ld [hli], a @@ -289,12 +289,12 @@ RunBattleAnimCommand: ; cc25f ; 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 @@ RunBattleAnimCommand: ; cc25f 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 @@ RunBattleAnimCommand: ; cc25f cp $d0 jr nc, .do_anim - ld [BattleAnimDuration], a + ld [wBattleAnimDuration], a ret .do_anim @@ -332,8 +332,8 @@ RunBattleAnimCommand: ; cc25f ; 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 @@ BattleAnimCmd_ED: ; cc304 (33:4304) 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 @@ BattleAnimCmd_Call: ; cc317 (33:4317) 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 @@ BattleAnimCmd_Jump: ; cc339 (33:4339) ld e, a call GetBattleAnimByte ld d, a - ld hl, BattleAnimAddress + ld hl, wBattleAnimAddress ld [hl], e inc hl ld [hl], d @@ -456,16 +456,16 @@ BattleAnimCmd_Jump: ; cc339 (33:4339) BattleAnimCmd_Loop: ; cc348 (33:4348) call GetBattleAnimByte - ld hl, BattleAnimFlags + ld hl, wBattleAnimFlags bit 2, [hl] jr nz, .continue_loop and a 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,16 +475,16 @@ BattleAnimCmd_Loop: ; cc348 (33:4348) ld e, a call GetBattleAnimByte ld d, a - ld hl, BattleAnimAddress + ld hl, wBattleAnimAddress ld [hl], e inc hl ld [hl], d 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,14 +506,14 @@ BattleAnimCmd_JumpUntil: ; cc383 (33:4383) ld e, a call GetBattleAnimByte ld d, a - ld hl, BattleAnimAddress + ld hl, wBattleAnimAddress ld [hl], e inc hl ld [hl], d ret .dont_jump - ld hl, BattleAnimAddress + ld hl, wBattleAnimAddress ld e, [hl] inc hl ld d, [hl] @@ -526,21 +526,21 @@ BattleAnimCmd_JumpUntil: ; cc383 (33:4383) 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 @@ BattleAnimCmd_IfVarEqual: ; cc3b2 (33:43b2) 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 @@ BattleAnimCmd_IfParamEqual: ; cc3d6 (33:43d6) cp [hl] jr z, .jump - ld hl, BattleAnimAddress + ld hl, wBattleAnimAddress ld e, [hl] inc hl ld d, [hl] @@ -584,7 +584,7 @@ BattleAnimCmd_IfParamEqual: ; cc3d6 (33:43d6) 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 @@ BattleAnimCmd_IfParamAnd: ; cc3fa (33:43fa) and e jr nz, .jump - ld hl, BattleAnimAddress + ld hl, wBattleAnimAddress ld e, [hl] inc hl ld d, [hl] @@ -613,7 +613,7 @@ BattleAnimCmd_IfParamAnd: ; cc3fa (33:43fa) 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 @@ BattleAnimCmd_ResetObp0: ; cc46c (33:446c) ret BattleAnimCmd_ClearObjs: ; cc479 (33:4479) - ld hl, ActiveAnimObjects + ld hl, wActiveAnimObjects ld a, $a0 .loop ld [hl], $0 @@ -684,7 +684,7 @@ BattleAnimCmd_2GFX: 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 @@ rept 4 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 @@ endr 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_IncObj: ; cc4c0 (33:44c0) 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_IncBGEffect: ; cc4e3 (33:44e3) 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_PlayerHeadObj: ; cc57e (33:457e) BattleAnimCmd_CheckPokeball: ; cc5d0 (33:45d0) callfar GetPokeBallWobble ld a, c - ld [BattleAnimVar], a + ld [wBattleAnimVar], a ret BattleAnimCmd_E7: ; cc5db (33:45db) @@ -916,34 +916,34 @@ BattleAnimCmd_E7: ; cc5db (33:45db) 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] 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 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 .done pop af - ld [CurPartySpecies], a ; CurPartySpecies + ld [wCurPartySpecies], a ; CurPartySpecies pop af ld [rSVBK], a ret @@ -1117,10 +1117,10 @@ BattleAnimCmd_Minimize: ; cc735 (33:4735) 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 @@ BattleAnimCmd_DropSub: ; cc750 (33:4750) .done pop af - ld [CurPartySpecies], a ; CurPartySpecies + ld [wCurPartySpecies], a ; CurPartySpecies pop af ld [rSVBK], a ret @@ -1142,33 +1142,33 @@ BattleAnimCmd_DropSub: ; cc750 (33:4750) 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 jr .done .player - ld hl, EnemyMonDVs + ld hl, wEnemyMonDVs predef GetUnownLetter ld de, vTiles2 tile $31 predef GetMonBackpic .done pop af - ld [CurPartySpecies], a ; CurPartySpecies + ld [wCurPartySpecies], a ; CurPartySpecies ld b, SCGB_BATTLE_COLORS call GetSGBLayout pop af @@ -1186,7 +1186,7 @@ BattleAnimCmd_OAMOff: ; cc7bf (33:47bf) ret BattleAnimCmd_ClearSprites: ; cc7c4 (33:47c4) - ld hl, BattleAnimFlags + ld hl, wBattleAnimFlags set 3, [hl] ret @@ -1207,7 +1207,7 @@ BattleAnimCmd_Sound: ; cc7cd (33:47cd) 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 @@ endr 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 @@ endr 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,30 +1282,30 @@ endr 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 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 @@ PlayHitSound: ; cc881 ret nz .okay - ld a, [TypeModifier] + ld a, [wTypeModifier] and $7f ret z @@ -1382,8 +1382,8 @@ BattleAnimAssignPals: ; cc8a4 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 @@ ClearBattleAnims: ; cc8d3 or b jr nz, .loop - ld hl, FXAnimID + ld hl, wFXAnimID ld e, [hl] inc hl ld d, [hl] @@ -1476,7 +1476,7 @@ BattleAnim_SetOBPals: ; cc94b BattleAnim_UpdateOAM_All: ; cc96e ld a, $0 ld [wBattleAnimOAMPointerLo], a - ld hl, ActiveAnimObjects + ld hl, wActiveAnimObjects ld e, 10 .loop ld a, [hl] @@ -1502,7 +1502,7 @@ BattleAnim_UpdateOAM_All: ; cc96e ld h, HIGH(wVirtualOAM) .loop2 ld a, l - cp LOW(SpritesEnd) + cp LOW(wSpritesEnd) jr nc, .done xor a ld [hli], a diff --git a/engine/battle_anims/bg_effects.asm b/engine/battle_anims/bg_effects.asm index a7c2012e58e..3192774ddb4 100644 --- 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 @@ ExecuteBGEffects: ; c8000 (32:4000) ret QueueBGEffect: ; c801a (32:401a) - ld hl, ActiveBGEffects + ld hl, wActiveBGEffects ld e, 5 .loop ld a, [hl] @@ -960,7 +960,7 @@ BattleBGEffect_Surf: ; c8545 (32:4545) 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 @@ BattleBGEffect_DoubleTeam: ; c8689 (32:4689) 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 @@ BattleBGEffect_AcidArmor: ; c8709 (32:4709) 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 @@ BattleBGEffect_AcidArmor: ; c8709 (32:4709) .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 @@ Tackle_BGEffect25_2d_two: 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 @@ Functionc88a5: ; c88a5 (32:48a5) 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 @@ BattleBGEffect_2a: ; c8a3a (32:4a3a) 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 @@ BattleBGEffect_2a: ; c8a3a (32:4a3a) 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 @@ BattleBGEffect_1c: ; c8b00 (32:4b00) ret .DMG_LYOverrideLoads: - ld hl, LYOverridesBackup + ld hl, wLYOverridesBackup .loop1 ld [hl], d inc hl @@ -2314,7 +2314,7 @@ BattleBGEffect_2e: ; c8ce1 (32:4ce1) ld [hSCY], a xor $ff inc a - ld [AnimObject01YOffset], a + ld [wAnimObject01YOffset], a ret BattleBGEffect_1f: ; c8cf9 (32:4cf9) @@ -2657,13 +2657,13 @@ BattleBGEffect_GetNextDMGPal: ; c8eb2 (32:4eb2) 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 @@ Functionc8f2e: ; c8f2e (32:4f2e) 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 @@ Functionc8f9a: ; c8f9a (32:4f9a) 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 @@ BattleBGEffect_WavyScreenFX: ; c8fef (32:4fef) 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 @@ BattleBGEffect_WavyScreenFX: ; c8fef (32:4fef) 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 @@ BGEffect_DisplaceLYOverridesBackup: ; c901b (32:501b) 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 @@ BGEffect_CheckFlyDigStatus: ; c9042 (32:5042) 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 diff --git a/engine/battle_anims/core.asm b/engine/battle_anims/core.asm index 2b0dcad3487..11578f7f0af 100755 --- 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] @@ -249,10 +249,10 @@ InitBattleAnimBuffer: ; ccaaa .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 diff --git a/engine/battle_anims/functions.asm b/engine/battle_anims/functions.asm index 5e85ffdb0f5..115147d39d0 100755 --- a/engine/battle_anims/functions.asm +++ b/engine/battle_anims/functions.asm @@ -428,9 +428,9 @@ GetBallAnimPal: ; cd249 (33:5249) 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 diff --git a/engine/battle_anims/getpokeballwobble.asm b/engine/battle_anims/getpokeballwobble.asm index 2bc53d798a4..b3f5580391b 100755 --- a/engine/battle_anims/getpokeballwobble.asm +++ b/engine/battle_anims/getpokeballwobble.asm @@ -8,12 +8,12 @@ GetPokeBallWobble: ; f971 (3:7971) 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 @@ GetPokeBallWobble: ; f971 (3:7971) jr nz, .done ld hl, .WobbleProbabilities - ld a, [Buffer1] + ld a, [wBuffer1] ld b, a .loop ld a, [hli] diff --git a/engine/billspc.asm b/engine/billspc.asm index 5fa590c4159..53451e9c0bb 100755 --- 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 @@ _DepositPKMN: ; e2391 (38:6391) 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 @@ _DepositPKMN: ; e2391 (38:6391) 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 @@ _DepositPKMN: ; e2391 (38:6391) 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 @@ BillsPCDepositFuncStats: ; e24c8 (38:64c8) 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 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0) 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 @@ Unreferenced_BillsPCClearThreeBoxes: ; e2564 ; 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 @@ _WithdrawPKMN: ; e2583 (38:6583) 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 @@ _WithdrawPKMN: ; e2583 (38:6583) 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 @@ _WithdrawPKMN: ; e2583 (38:6583) 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 @@ BillsPC_Withdraw: ; e2675 (38:6675) 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 @@ BillsPC_Withdraw: ; e2675 (38:6675) 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 @@ BillsPC_Withdraw: ; e2675 (38:6675) ; 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 @@ _MovePKMNWithoutMail: ; e2759 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 @@ _MovePKMNWithoutMail: ; e2759 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 @@ _MovePKMNWithoutMail: ; e2759 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 @@ _MovePKMNWithoutMail: ; e2759 call ExitMenu call PCMonInfo call BillsPC_GetSelectedPokemonSpecies - ld [CurPartySpecies], a + ld [wCurPartySpecies], a ld a, SCGB_BILLS_PC call BillsPC_ApplyPalettes ret @@ -1092,16 +1092,16 @@ PCMonInfo: ; e2ac6 (38:6ac6) 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 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 @@ PCMonInfo: ; e2ac6 (38:6ac6) call PrintLevel ld a, $3 - ld [MonType], a + ld [wMonType], a farcall GetGender jr c, .skip_gender ld a, "♂" @@ -1125,7 +1125,7 @@ PCMonInfo: ; e2ac6 (38:6ac6) ld [hl], a .skip_gender - ld a, [TempMonItem] + ld a, [wTempMonItem] and a ret z @@ -1169,7 +1169,7 @@ BillsPC_LoadMonStats: ; e2b6d (38:6b6d) ld a, e call AddNTimes ld a, [hl] - ld [TempMonLevel], a + ld [wTempMonLevel], a pop hl push hl ld bc, sBoxMon1Item - sBox @@ -1178,14 +1178,14 @@ BillsPC_LoadMonStats: ; e2b6d (38:6b6d) ld a, e call AddNTimes ld a, [hl] - ld [TempMonItem], a + ld [wTempMonItem], a pop hl ld bc, sBoxMon1DVs - sBox add hl, bc 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 @@ BillsPC_LoadMonStats: ; e2b6d (38:6b6d) 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,20 +1227,20 @@ BillsPC_LoadMonStats: ; e2b6d (38:6b6d) ld a, e call AddNTimes ld a, [hl] - ld [TempMonLevel], a + ld [wTempMonLevel], a ld hl, sBoxMon1Item ld bc, BOXMON_STRUCT_LENGTH 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 @@ BillsPC_RefreshTextboxes: ; e2c2c (38:6c2c) 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 @@ BillsPC_RefreshTextboxes: ; e2c2c (38:6c2c) .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 @@ BillsPC_RefreshTextboxes: ; e2c2c (38:6c2c) 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 @@ CopyBoxmonSpecies: ; e2d30 (38:6d30) ret .party - ld hl, PartySpecies + ld hl, wPartySpecies copy_box_data 0 ret @@ -1498,7 +1498,7 @@ BillsPC_UpdateSelectionCursor: ; e2e01 (38:6e01) .place_cursor ld hl, .OAM - ld de, Sprite01 + ld de, wSprite01 .loop ld a, [hl] cp -1 @@ -1548,7 +1548,7 @@ endr BillsPC_UpdateInsertCursor: ; e2e8c ld hl, .OAM - ld de, Sprite01 + ld de, wSprite01 .loop ld a, [hl] cp -1 @@ -1645,7 +1645,7 @@ BillsPC_CheckMail_PreventBlackout: ; e2f18 (38:6f18) 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 @@ BillsPC_CheckMail_PreventBlackout: ; e2f18 (38:6f18) ret BillsPC_IsMonAnEgg: ; e2f5f (38:6f5f) - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp EGG jr z, .egg and a @@ -1697,7 +1697,7 @@ BillsPC_StatsScreen: ; e2f7e (38:6f7e) 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 @@ StatsScreenDPad: ; e2f95 (38:6f95) 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 @@ BillsPC_CopyMon: ; e2fd6 (38:6fd6) 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 @@ BillsPC_CopyMon: ; e2fd6 (38:6fd6) 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 @@ BillsPC_CopyMon: ; e2fd6 (38:6fd6) 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 @@ DepositPokemon: ; e307c (38:707c) 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 @@ DepositPokemon: ; e307c (38:707c) 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 @@ DepositPokemon: ; e307c (38:707c) 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 @@ TryWithdrawPokemon: ; e30fa (38:70fa) 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 @@ TryWithdrawPokemon: ; e30fa (38:70fa) 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 @@ TryWithdrawPokemon: ; e30fa (38:70fa) 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 @@ ReleasePKMN_ByePKMN: ; e3180 (38:7180) call TextBox call WaitBGMap - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] call GetCryIndex jr c, .skip_cry ld e, c @@ -1937,7 +1937,7 @@ ReleasePKMN_ByePKMN: ; e3180 (38:7180) call PlayCry .skip_cry - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] ld [wd265], a call GetPokemonName hlcoord 1, 16 @@ -1954,7 +1954,7 @@ ReleasePKMN_ByePKMN: ; e3180 (38:7180) 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 @@ MovePKMNWitoutMail_InsertMon: ; e31e7 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 @@ MovePKMNWitoutMail_InsertMon: ; e31e7 ld a, [wBillsPC_CursorPosition] ld hl, wBillsPC_ScrollPosition add [hl] - ld [CurPartyMon], a + ld [wCurPartyMon], a farcall InsertPokemonIntoBox ret ; e3316 @@ -2136,14 +2136,14 @@ MovePKMNWitoutMail_InsertMon: ; e31e7 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 @@ MovePKMNWitoutMail_InsertMon: ; e31e7 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 @@ CopyNicknameToTemp: ; e3363 (38:7363) 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 @@ CopyOTNameToTemp: ; e3376 (38:7376) ret CopyMonToTemp: ; e3389 (38:7389) - ld a, [CurPartyMon] + ld a, [wCurPartyMon] call AddNTimes ld de, wBufferMon call CopyBytes @@ -2357,7 +2357,7 @@ endr .boxnames ; e3619 push de - ld a, [MenuSelection] + ld a, [wMenuSelection] dec a call GetBoxName pop hl @@ -2378,7 +2378,7 @@ BillsPC_PrintBoxCountAndCapacity: ; e3632 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 @@ BillsPC_PrintBoxCountAndCapacity: ; e3632 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 @@ BillsPC_ChangeBoxSubmenu: ; e36f9 (38:76f9) 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 @@ BillsPC_ChangeBoxSubmenu: ; e36f9 (38:76f9) ret .Switch: - ld a, [MenuSelection] + ld a, [wMenuSelection] dec a ld e, a ld a, [wCurBox] @@ -2538,7 +2538,7 @@ BillsPC_ChangeBoxSubmenu: ; e36f9 (38:76f9) call ClearTileMap call LoadStandardFont call LoadFontsBattleExtra - ld a, [MenuSelection] + ld a, [wMenuSelection] dec a call GetBoxName ld e, l @@ -2546,7 +2546,7 @@ BillsPC_ChangeBoxSubmenu: ; e36f9 (38:76f9) ld hl, wd002 ld c, BOX_NAME_LENGTH - 1 call InitString - ld a, [MenuSelection] + ld a, [wMenuSelection] dec a call GetBoxName ld de, wd002 diff --git a/engine/billspctop.asm b/engine/billspctop.asm index ac70082d606..2c0a110ba41 100755 --- a/engine/billspctop.asm +++ b/engine/billspctop.asm @@ -6,7 +6,7 @@ _BillsPC: ; e3fd jp .LogOut .CheckCanUsePC: ; e40a (3:640a) - ld a, [PartyCount] + ld a, [wPartyCount] and a ret nz ld hl, .Text_GottaHavePokemon @@ -24,14 +24,14 @@ _BillsPC: ; e3fd ld [hBGMapMode], a call LoadStandardMenuDataHeader call ClearPCItemScreen - ld hl, Options + ld hl, wOptions ld a, [hl] push af set NO_TEXT_SCROLL, [hl] ld hl, .Text_What call PrintText pop af - ld [Options], a + ld [wOptions], a call LoadFontsBattleExtra ret @@ -58,7 +58,7 @@ _BillsPC: ; e3fd 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 @@ BillsPC_DepositMenu: ; e4fe (3:64fe) ret Unreferenced_Functione512: - ld a, [PartyCount] + ld a, [wPartyCount] and a jr z, .no_pkmn cp 2 @@ -174,11 +174,11 @@ Unreferenced_Functione512: 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 @@ CheckCurPartyMonFainted: ; e538 .skip inc b - ld a, [PartyCount] + ld a, [wPartyCount] cp b jr z, .done add hl, de @@ -212,7 +212,7 @@ BillsPC_WithdrawMenu: ; e559 (3:6559) ret Unreferenced_Functione56d: - ld a, [PartyCount] + ld a, [wPartyCount] cp PARTY_LENGTH jr nc, .asm_e576 and a @@ -255,11 +255,11 @@ ClearPCItemScreen: ; e58b 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 @@ Unreferenced_Functione5d9: ld a, [hl] ld [de], a inc de - ld [CurSpecies], a + ld [wCurSpecies], a call GetBaseData pop bc pop hl @@ -352,7 +352,7 @@ Unreferenced_Functione5d9: swap a or b ld b, a - ld a, [BaseGender] + ld a, [wBaseGender] cp b ld a, $1 jr c, .okay2 diff --git a/engine/breeding.asm b/engine/breeding.asm index b1674708917..7756d30ef0d 100755 --- a/engine/breeding.asm +++ b/engine/breeding.asm @@ -3,13 +3,13 @@ CheckBreedmonCompatibility: ; 16e1d 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 @@ CheckBreedmonCompatibility: ; 16e1d .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 @@ CheckBreedmonCompatibility: ; 16e1d ; 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 @@ CheckBreedmonCompatibility: ; 16e1d 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 @@ CheckBreedmonCompatibility: ; 16e1d 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 @@ CheckBreedmonCompatibility: ; 16e1d ; 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 @@ OverworldHatchEgg:: ; 16f5e ; 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 @@ HatchEggs: ; 16f70 (5:6f70) 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 @@ HatchEggs: ; 16f70 (5:6f70) 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 @@ HatchEggs: ; 16f70 (5:6f70) 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 @@ HatchEggs: ; 16f70 (5:6f70) 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 @@ HatchEggs: ; 16f70 (5:6f70) 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 @@ HatchEggs: ; 16f70 (5:6f70) ; 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,32 +580,32 @@ GetHeritableMoves: ; 17197 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 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 @@ GetHeritableMoves: ; 17197 .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,20 +643,20 @@ GetBreedmonMovePointer: ; 1720b 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 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_DoAnimFrame: ; 1727f (5:727f) 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 @@ EggHatch_AnimationSequence: ; 1728f (5:728f) 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 @@ DayCareMon1Text: ; 0x17467 DayCareMonCompatibilityText: ; 1746c push bc - ld de, StringBuffer1 + ld de, wStringBuffer1 ld bc, NAME_LENGTH call CopyBytes call CheckBreedmonCompatibility diff --git a/engine/buy_sell_toss.asm b/engine/buy_sell_toss.asm index ff2bd2967ee..d2cf1462886 100755 --- a/engine/buy_sell_toss.asm +++ b/engine/buy_sell_toss.asm @@ -9,9 +9,9 @@ SelectQuantityToBuy: ; 24fc9 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 @@ RooftopSale_SelectQuantityToBuy: ; 24fcf 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 @@ DisplaySellingPrice: ; 2509f 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 diff --git a/engine/card_flip.asm b/engine/card_flip.asm index d7d24cba1b6..0e85ef21b7e 100755 --- a/engine/card_flip.asm +++ b/engine/card_flip.asm @@ -11,7 +11,7 @@ ret_e00ed: ; e00ed (38:40ed) ret _CardFlip: ; e00ee (38:40ee) - ld hl, Options + ld hl, wOptions set 4, [hl] call ClearBGPalettes call ClearTileMap @@ -70,7 +70,7 @@ _CardFlip: ; e00ee (38:40ee) call PlaySFX call WaitSFX call ClearBGPalettes - ld hl, Options + ld hl, wOptions res 4, [hl] ret @@ -485,7 +485,7 @@ CardFlip_DisplayCardFaceUp: ; e03ec ret z ; Set the attributes - ld de, AttrMap - TileMap + ld de, wAttrMap - wTileMap add hl, de ld a, [wCardFlipFaceUpCard] and 3 @@ -601,7 +601,7 @@ CardFlip_CopyToBox: ; e04f7 (38:44f7) ; e0509 (38:4509) CardFlip_CopyOAM: ; e0509 - ld de, Sprite01 + ld de, wSprite01 ld a, [hli] .loop push af @@ -1625,32 +1625,32 @@ CardFlip_InitAttrPals: ; e0c37 (38:4c37) 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 diff --git a/engine/caught_data.asm b/engine/caught_data.asm index 9310b7b903f..997d708c1d2 100644 --- a/engine/caught_data.asm +++ b/engine/caught_data.asm @@ -2,10 +2,10 @@ Special_CheckPartyFullAfterContest: ; 4d9e5 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 @@ Special_CheckPartyFullAfterContest: ; 4d9e5 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 @@ Special_CheckPartyFullAfterContest: ; 4d9e5 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 @@ Special_CheckPartyFullAfterContest: ; 4d9e5 xor a ld [wContestMon], a and a ; BUGCONTEST_CAUGHT_MON - ld [ScriptVar], a + ld [wScriptVar], a ret .TryAddToBox: ; 4daa3 @@ -94,24 +94,24 @@ Special_CheckPartyFullAfterContest: ; 4d9e5 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 @@ Special_CheckPartyFullAfterContest: ; 4d9e5 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 @@ Special_CheckPartyFullAfterContest: ; 4d9e5 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 @@ TextJump_GiveANickname: ; 0x4db44 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 @@ SetBoxmonOrEggmonCaughtData: ; 4db53 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 @@ SetGiftBoxMonCaughtData: ; 4db92 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 @@ SetGiftMonCaughtData: ; 4dbaf 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 diff --git a/engine/cgb_layouts.asm b/engine/cgb_layouts.asm index 84fb6c9def1..1c2dfb7aa71 100644 --- a/engine/cgb_layouts.asm +++ b/engine/cgb_layouts.asm @@ -10,7 +10,7 @@ LoadSGBLayoutCGB: ; 8d59 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 @@ _CGB_BattleColors: ; 8ddb 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 @@ _CGB_BattleColors: ; 8ddb 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 @@ _CGB_BattleColors: ; 8ddb 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 @@ _CGB_StatsScreenHPPals: ; 8edb 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 @@ _CGB_StatsScreenHPPals: ; 8edb 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 @@ _CGB_Pokedex: ; 8f70 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 @@ _CGB_Pokedex: ; 8f70 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 @@ _CGB_BillsPC: ; 8fca 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 @@ _CGB_BillsPC: ; 8fca 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 @@ _CGB_BillsPC: ; 8fca 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 @@ _CGB_PokedexUnownMode: ; 903e 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 @@ _CGB_SlotMachine: ; 906e 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 @@ _CGB06: ; 90f8 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_Diploma: ; 91ad _CGB_MapPals: ; 91c8 call LoadMapPals ld a, SCGB_MAPPALS - ld [SGBPredef], a + ld [wSGBPredef], a ret ; 91d1 @@ -585,13 +585,13 @@ _CGB_Evolution: ; 91e4 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 @@ _CGB_GSTitleScreen: ; 9228 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 @@ _CGB_TrainerCard: ; 9289 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 @@ _CGB_TrainerCard: ; 9289 .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 @@ _CGB_TrainerCard: ; 9289 .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 @@ _CGB_TrainerCard: ; 9289 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 @@ _CGB_TrainerCard: ; 9289 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 @@ _CGB_MoveList: ; 9373 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 @@ _CGB_MoveList: ; 9373 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_PokedexSearchOption: ; 93ba _CGB_PackPals: ; 93d3 ; pack pals - ld a, [BattleType] + ld a, [wBattleType] cp BATTLETYPE_TUTORIAL jr z, .tutorial_male @@ -836,23 +836,23 @@ _CGB_PackPals: ; 93d3 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 @@ INCLUDE "gfx/pack/pack_f.pal" _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 @@ _CGB13: ; 94d0 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 @@ INCLUDE "gfx/splash/logo.pal" _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 @@ _CGB_PlayerOrMonFrontpicPals: ; 9529 _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_TradeTube: ; 9555 _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 @@ _CGB_MysteryGift: ; 9591 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 diff --git a/engine/clock_reset.asm b/engine/clock_reset.asm index 82b81b85ce4..4c4a96b9c5f 100755 --- a/engine/clock_reset.asm +++ b/engine/clock_reset.asm @@ -20,13 +20,13 @@ endr ; 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 @@ RestartClock: ; 20021 (8:4021) ; 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 @@ RestartClock: ; 20021 (8:4021) call .SetClock call ExitMenu pop bc - ld hl, Options + ld hl, wOptions ld [hl], b ld c, a ret @@ -65,17 +65,17 @@ RestartClock: ; 20021 (8:4021) .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 @@ RestartClock: ; 20021 (8:4021) 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 @@ RestartClock: ; 20021 (8:4021) ret .pressed_up - ld a, [Buffer1] + ld a, [wBuffer1] call ResetClock_GetWraparoundTime ld a, [de] inc a @@ -163,7 +163,7 @@ RestartClock: ; 20021 (8:4021) jr .done_scroll .pressed_down - ld a, [Buffer1] + ld a, [wBuffer1] call ResetClock_GetWraparoundTime ld a, [de] dec a @@ -176,14 +176,14 @@ RestartClock: ; 20021 (8:4021) jr .done_scroll .pressed_left - ld hl, Buffer1 + ld hl, wBuffer1 dec [hl] jr nz, .done_scroll ld [hl], $3 jr .done_scroll .pressed_right - ld hl, Buffer1 + ld hl, wBuffer1 inc [hl] ld a, [hl] cp $4 @@ -200,29 +200,29 @@ RestartClock: ; 20021 (8:4021) 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 @@ RestartClock: ; 20021 (8:4021) .PlaceChars: ; 20168 (8:4168) push de call ResetClock_GetWraparoundTime - ld a, [Buffer3] + ld a, [wBuffer3] dec a ld b, a call Coord2Tile diff --git a/engine/color.asm b/engine/color.asm index 48512582149..88dd8e8d650 100644 --- a/engine/color.asm +++ b/engine/color.asm @@ -239,13 +239,13 @@ Unreferenced_Function8b81: 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 @@ Unreferenced_Function8bec: 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 @@ Unreferenced_Function8bec: 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 @@ ApplyMonOrTrainerPals: 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 @@ ApplyHPBarPals: .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 @@ ResetBGPals: ret WipeAttrMap: - hlcoord 0, 0, AttrMap + hlcoord 0, 0, wAttrMap ld bc, SCREEN_WIDTH * SCREEN_HEIGHT xor a call ByteFill @@ -623,7 +623,7 @@ ApplyAttrMap: ret .UpdateVBank1: - hlcoord 0, 0, AttrMap + hlcoord 0, 0, wAttrMap debgcoord 0, 0 ld b, SCREEN_HEIGHT ld a, $1 @@ -660,7 +660,7 @@ CGB_ApplyPartyMenuHPPals: ; 96f3 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 @@ GetBattlemonBackpicPalettePointer: farcall GetPartyMonDVs ld c, l ld b, h - ld a, [TempBattleMonSpecies] + ld a, [wTempBattleMonSpecies] call GetPlayerOrMonPalettePointer pop de ret @@ -698,7 +698,7 @@ GetEnemyFrontpicPalettePointer: farcall GetEnemyMonDVs ld c, l ld b, h - ld a, [TempEnemyMonSpecies] + ld a, [wTempEnemyMonSpecies] call GetFrontpicPalettePointer pop de ret @@ -716,13 +716,13 @@ GetPlayerOrMonPalettePointer: 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 @@ LoadMapPals: 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 @@ LoadMapPals: 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 @@ LoadMapPals: cp ROUTE ret nz .outside - ld a, [MapGroup] + ld a, [wMapGroup] ld l, a ld h, 0 add hl, hl @@ -1300,7 +1300,7 @@ LoadMapPals: 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 diff --git a/engine/credits.asm b/engine/credits.asm index ac5064a41d5..eb5347f26e8 100644 --- a/engine/credits.asm +++ b/engine/credits.asm @@ -63,7 +63,7 @@ Credits:: ; 109847 xor a ld [wCreditsLYOverride], a - ld hl, LYOverrides + ld hl, wLYOverrides ld bc, $100 xor a call ByteFill @@ -81,9 +81,9 @@ Credits:: ; 109847 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 @@ Credits_HandleBButton: ; 109908 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 @@ Credits_HandleBButton: ; 109908 and a ret z .okay - ld hl, CreditsTimer + ld hl, wCreditsTimer ld a, [hl] and a ret z @@ -187,20 +187,20 @@ Credits_PrepBGMapUpdate: ; 10995e (42:595e) 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) 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 @@ Credits_LYOverride: ; 109986 (42:5986) 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 @@ ParseCredits: ; 1099aa 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 @@ ParseCredits: ; 1099aa .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,29 +370,29 @@ ParseCredits: ; 1099aa 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 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 @@ ConstructCreditsTilemap: ; 109a95 (42:5a95) 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 diff --git a/engine/crystal_intro.asm b/engine/crystal_intro.asm index ea6828f141a..d482c3cfa01 100755 --- a/engine/crystal_intro.asm +++ b/engine/crystal_intro.asm @@ -796,7 +796,7 @@ IntroScene9: ; e4c04 (39:4c04) 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 @@ Intro_RustleGrass: ; e546d (39:546d) 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_DecompressRequest2bpp_64Tiles: ; e54fa (39:54fa) 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_ResetLYOverrides: ; e5516 (39:5516) 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,20 +2048,20 @@ Intro_PerspectiveScrollBG: ; e552f (39:552f) and $1 jr z, .skip ; trees in the back - ld hl, LYOverrides + ld hl, wLYOverrides ld a, [hl] inc a ld bc, $5f 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 diff --git a/engine/crystal_layouts.asm b/engine/crystal_layouts.asm index 9fd01aac09f..1fbba9a5f63 100755 --- a/engine/crystal_layouts.asm +++ b/engine/crystal_layouts.asm @@ -2,7 +2,7 @@ GetMysteryGift_MobileAdapterLayout: ; 4930f (mobile) 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 @@ MG_Mobile_Layout_FillBox: ; 49336 ; 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 @@ MG_Mobile_Layout00: ; 4936e (12:536e) 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 @@ MG_Mobile_Layout_CreatePalBoxes: ; 49384 (12:5384) 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 @@ MG_Mobile_Layout_CreatePalBoxes: ; 49384 (12:5384) 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 @@ MG_Mobile_Layout_CreatePalBoxes: ; 49384 (12:5384) 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 @@ MG_Mobile_Layout01: ; 4942f 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 @@ MG_Mobile_Layout01: ; 4942f ; 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 @@ INCLUDE "gfx/unknown/49757.pal" ; 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 @@ _InitMG_Mobile_LinkTradePalMap: ; 49797 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 diff --git a/engine/debug.asm b/engine/debug.asm index dce32afda53..52bd15f286c 100755 --- a/engine/debug.asm +++ b/engine/debug.asm @@ -71,7 +71,7 @@ Function818f4: ; 818f4 ld hl, PokemonPalettes Function818fd: ; 818fd - ld de, OverworldMap + ld de, wOverworldMap ld c, NUM_POKEMON + 1 .asm_81902 push bc @@ -87,7 +87,7 @@ Function818fd: ; 818fd Function81911: ; 81911 ld hl, TrainerPalettes - ld de, OverworldMap + ld de, wOverworldMap ld c, NUM_TRAINER_CLASSES .asm_81919 push bc @@ -138,7 +138,7 @@ Function81948: ; 81948 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 @@ Function81adb: ; 81adb 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 @@ Function81adb: ; 81adb 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 @@ Function81adb: ; 81adb .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 @@ String_81bb9: db DEBUGTEST_A, "きりかえ▶@" ; (A) switches ; 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 @@ Function81bf4: ; 81bf4 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 @@ Function81df4: ; 81df4 call PlaceString ld a, [wd004] call Function81e55 - ld [CurItem], a + ld [wCurItem], a predef CanLearnTMHMMove ld a, c and a @@ -876,7 +876,7 @@ Function81eca: ; 81eca ld h, $0 add hl, hl add hl, hl - ld de, OverworldMap + ld de, wOverworldMap add hl, de ld e, l ld d, h @@ -1099,7 +1099,7 @@ TilesetColorTest: 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 @@ Function821d2: ; 821d2 Function821d8: ; 821d8 ld a, [wcf64] - hlcoord 0, 0, AttrMap + hlcoord 0, 0, wAttrMap Function821de: ; 821de add hl, de diff --git a/engine/decorations.asm b/engine/decorations.asm index 912966a73f3..cf372159aed 100755 --- a/engine/decorations.asm +++ b/engine/decorations.asm @@ -11,18 +11,18 @@ _KrisDecorationMenu: ; 0x2675c 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 @@ _KrisDecorationMenu: ; 0x2675c call ExitMenu pop af ld [wWhichIndexSet], a - ld a, [Buffer5] + ld a, [wBuffer5] ld c, a ret ; 0x2679a @@ -78,14 +78,14 @@ _KrisDecorationMenu: ; 0x2675c call .FindOwndDecos ld a, 7 call .AppendToStringBuffer2 - ld hl, StringBuffer2 + ld hl, wStringBuffer2 ld de, wd002 ld bc, ITEM_NAME_LENGTH call CopyBytes 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 @@ _KrisDecorationMenu: ; 0x2675c ret .AppendToStringBuffer2: ; 26830 (9:6830) - ld hl, StringBuffer2 + ld hl, wStringBuffer2 inc [hl] ld e, [hl] ld d, 0 @@ -471,7 +471,7 @@ GetDecorationName: ; 269e7 ; 269f3 DecorationMenuFunction: ; 269f3 - ld a, [MenuSelection] + ld a, [wMenuSelection] push de call GetDecorationData call GetDecoName @@ -481,7 +481,7 @@ DecorationMenuFunction: ; 269f3 ; 26a02 DoDecorationAction2: ; 26a02 - ld a, [MenuSelection] + ld a, [wMenuSelection] call GetDecorationData ld de, 2 ; function 2 add hl, de @@ -545,7 +545,7 @@ INCLUDE "data/decorations/names.asm" GetDecoName: ; 26c72 ld a, [hli] ld e, [hl] - ld bc, StringBuffer2 + ld bc, wStringBuffer2 push bc ld hl, .NameFunctions rst JumpTable @@ -706,14 +706,14 @@ DecoAction_putawaybigdoll: ; 26d27 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_TrySetItUp: ; 26d2d 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 @@ DecoAction_SetItUp: ; 26d46 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_SetItUp: ; 26d46 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 @@ DecoAction_setupornament: ; 26db3 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 @@ DecoAction_SetItUp_Ornament: ; 26de3 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 @@ DecoAction_SetItUp_Ornament: ; 26de3 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 @@ DecoAction_SetItUp_Ornament: ; 26de3 ; 26e33 .getwhichside ; 26e33 - ld a, [MenuSelection] + ld a, [wMenuSelection] ld b, a ld a, [wOtherDecoration] cp b @@ -886,10 +886,10 @@ DecoAction_PutItAway_Ornament: ; 26e46 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 @@ DecoAction_AskWhichSide: ; 26e70 ld a, [wMenuCursorY] cp 3 jr z, .nope - ld [Buffer2], a + ld [wBuffer2], a call QueryWhichSide ld a, [hl] ld [wSelectedDecoration], a @@ -937,7 +937,7 @@ DecoAction_AskWhichSide: ; 26e70 QueryWhichSide: ; 26e9a ld hl, wDecoRightOrnament ld de, wDecoLeftOrnament - ld a, [Buffer2] + ld a, [wBuffer2] cp 1 ret z push hl @@ -1009,7 +1009,7 @@ DecorationFlagAction_c: ; 26ef1 GetDecorationName_c: ; 26ef5 (9:6ef5) ld a, c call GetDecorationID - ld hl, StringBuffer1 + ld hl, wStringBuffer1 push hl call GetDecorationName pop de @@ -1161,7 +1161,7 @@ DecorationDesc_Console: ; 26fc3 DecorationDesc_OrnamentOrConsole: ; 26fc8 ld c, a - ld de, StringBuffer3 + ld de, wStringBuffer3 call GetDecorationName_c_de ld b, BANK(.OrnamentConsoleScript) ld de, .OrnamentConsoleScript @@ -1250,19 +1250,19 @@ SetDecorationTile: ; 27037 Special_ToggleDecorationsVisibility: ; 27043 ld de, EVENT_KRISS_HOUSE_2F_CONSOLE - ld hl, VariableSprites + SPRITE_CONSOLE - SPRITE_VARS + 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 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 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 hl, wVariableSprites + SPRITE_BIG_DOLL - SPRITE_VARS ld a, [wDecoBigDoll] call ToggleDecorationVisibility ret diff --git a/engine/delete_save_change_clock.asm b/engine/delete_save_change_clock.asm index 8a711cc5ec4..fd6ffae2c0d 100755 --- a/engine/delete_save_change_clock.asm +++ b/engine/delete_save_change_clock.asm @@ -61,12 +61,12 @@ _ResetClock: ; 4d3b1 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 @@ ClockResetPassword: ; 4d41e .updateIDdisplay ; 4d468 hlcoord 14, 15 - ld de, StringBuffer2 + ld de, wStringBuffer2 ld c, 5 .loop3 ld a, [de] @@ -122,7 +122,7 @@ ClockResetPassword: ; 4d41e 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 @@ ClockResetPassword: ; 4d41e 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 @@ ClockResetPassword: ; 4d41e 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 @@ ClockResetPassword: ; 4d41e 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 diff --git a/engine/diploma.asm b/engine/diploma.asm index ba45e4cd5d5..5d0482cc4d4 100644 --- a/engine/diploma.asm +++ b/engine/diploma.asm @@ -22,7 +22,7 @@ PlaceDiplomaOnScreen: ; 1dd709 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 @@ PrintDiplomaPage2: ; 1dd7ae 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 diff --git a/engine/dma_transfer.asm b/engine/dma_transfer.asm index 60b515acfc1..b4a500545f5 100755 --- a/engine/dma_transfer.asm +++ b/engine/dma_transfer.asm @@ -3,7 +3,7 @@ HDMATransferAttrMapAndTileMapToWRAMBank3:: ; 104000 jp CallInSafeGFXMode .Function: - decoord 0, 0, AttrMap + decoord 0, 0, wAttrMap ld hl, wScratchAttrMap call PadAttrMapForHDMATransfer decoord 0, 0 @@ -40,7 +40,7 @@ HDMATransferAttrMapToWRAMBank3: ; 104047 jp CallInSafeGFXMode .Function: - decoord 0, 0, AttrMap + decoord 0, 0, wAttrMap ld hl, wScratchAttrMap call PadAttrMapForHDMATransfer ld a, $1 @@ -55,7 +55,7 @@ ReloadMapPart:: ; 104061 jp CallInSafeGFXMode .Function: - decoord 0, 0, AttrMap + decoord 0, 0, wAttrMap ld hl, wScratchAttrMap call PadAttrMapForHDMATransfer decoord 0, 0 @@ -86,7 +86,7 @@ Mobile_ReloadMapPart: ; 104099 jp CallInSafeGFXMode .Function: - decoord 0, 0, AttrMap + decoord 0, 0, wAttrMap ld hl, wScratchAttrMap call PadAttrMapForHDMATransfer decoord 0, 0 @@ -156,10 +156,10 @@ OpenAndCloseMenu_HDMATransferTileMapAndAttrMap:: ; 104110 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 @@ Mobile_OpenAndCloseMenu_HDMATransferTileMapAndAttrMap: ; 104148 (41:4148) 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 @@ HDMATransfer_OnlyTopFourRows: ; 104303 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 diff --git a/engine/events.asm b/engine/events.asm index 96108730a2b..2b4cfd586d6 100644 --- a/engine/events.asm +++ b/engine/events.asm @@ -5,12 +5,12 @@ SECTION "Events", ROMX 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,101 +25,101 @@ OverworldLoop:: ; 966b0 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 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 @@ EnterMap: ; 9673e 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 @@ HandleMap: ; 96773 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 @@ HandleMap: ; 96773 ; 96795 MapEvents: ; 96795 - ld a, [MapEventStatus] + ld a, [wMapEventStatus] ld hl, .jumps rst JumpTable ret @@ -203,12 +203,12 @@ MaxOverworldDelay: ; 967af 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 @@ NextOverworldFrame: ; 967b7 ; 967c1 HandleMapTimeAndJoypad: ; 967c1 - ld a, [MapEventStatus] + ld a, [wMapEventStatus] cp 1 ; no events ret z @@ -252,12 +252,12 @@ CheckPlayerState: ; 967f4 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 @@ _CheckObjectEnteringVisibleRange: ; 96812 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 @@ PlayerEvents: ; 9681f 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 @@ CheckTileEvent: ; 96874 ret .warp_tile - ld a, [PlayerStandingTile] + ld a, [wPlayerStandingTile] call CheckPitTile jr nz, .not_pit ld a, PLAYEREVENT_FALL @@ -463,13 +463,13 @@ endr 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 @@ TryObjectEvent: ; 969b5 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 @@ TryBGEvent: ; 96a38 ret .is_bg_event: - ld a, [EngineBuffer3] + ld a, [wEngineBuffer3] ld hl, .bg_events rst JumpTable ret @@ -720,14 +720,14 @@ TryBGEvent: ; 96a38 jr .checkdir .checkdir - ld a, [PlayerDirection] + ld a, [wPlayerDirection] and %1100 cp b jp nz, .dontread .read call PlayTalkObject - ld hl, EngineBuffer4 + ld hl, wEngineBuffer4 ld a, [hli] ld h, [hl] ld l, a @@ -741,7 +741,7 @@ TryBGEvent: ; 96a38 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 @@ TryBGEvent: ; 96a38 call CheckBGEventFlag jr nz, .dontread call GetMapScriptsBank - ld de, EngineBuffer1 + ld de, wEngineBuffer1 ld bc, 3 call FarCopyBytes jr .dontread @@ -787,7 +787,7 @@ TryBGEvent: ; 96a38 ; 96ad8 CheckBGEventFlag: ; 96ad8 - ld hl, EngineBuffer4 + ld hl, wEngineBuffer4 ld a, [hli] ld h, [hl] ld l, a @@ -943,9 +943,9 @@ CountStep: ; 96b79 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 @@ CountStep: ; 96b79 ; 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 @@ CountStep: ; 96b79 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 @@ DoRepelStep: ; 96bd7 ; 96beb DoPlayerEvent: ; 96beb - ld a, [ScriptRunning] + ld a, [wScriptRunning] and a ret z @@ -1036,11 +1036,11 @@ DoPlayerEvent: ; 96beb 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 diff --git a/engine/events/basement_key.asm b/engine/events/basement_key.asm index b15288d0942..879c86a34e5 100755 --- 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? diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm index 94a29cdabeb..4b44949256e 100755 --- a/engine/events/battle_tower/battle_tower.asm +++ b/engine/events/battle_tower/battle_tower.asm @@ -96,9 +96,9 @@ Function170139: ; 170139 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,23 +106,23 @@ Function170139: ; 170139 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 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 @@ _BattleTowerBattle: ; 17022c ; 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 @@ RunBattleTowerTrainer: ; 17024d 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 @@ RunBattleTowerTrainer: ; 17024d 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 @@ RunBattleTowerTrainer: ; 17024d .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 @@ ReadBTTrainerParty: ; 1702b7 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 @@ ReadBTTrainerParty: ; 1702b7 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 @@ ReadBTTrainerParty: ; 1702b7 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 @@ ReadBTTrainerParty: ; 1702b7 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 @@ endr ld [hl], a .valid - ld [CurSpecies], a + ld [wCurSpecies], a call GetBaseData ld a, $5 call GetSRAMBank @@ -442,7 +442,7 @@ endr 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 @@ INCLUDE "data/battle_tower/unknown_levels.asm" 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 @@ UnusedSpecial_Function1704e1: ; 1704e1 call GetSRAMBank ld hl, $a89c - ld de, StringBuffer3 + ld de, wStringBuffer3 ld bc, $16 call CopyBytes @@ -680,13 +680,13 @@ UnusedSpecial_Function1704e1: ; 1704e1 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 @@ UnusedSpecial_Function1704e1: ; 1704e1 ; 170687 Special_BattleTowerAction: ; 170687 - ld a, [ScriptVar] + ld a, [wScriptVar] ld e, a ld d, 0 ld hl, .dw @@ -972,13 +972,13 @@ BattleTower_GiveReward: ; 1706ee (5c:46ee) BattleTowerAction $1b 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 @@ BattleTower_GiveReward: ; 1706ee (5c:46ee) BattleTowerAction $1b 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 @@ BattleTower_RandomlyChooseReward: ; 17073e (5c:473e) BattleTowerAction $1e BattleTowerAction_CheckExplanationRead: ; 17075f (5c:475f) BattleTowerAction $00 call BattleTower_CheckSaveFileExistsAndIsYours - ld a, [ScriptVar] + ld a, [wScriptVar] and a ret z @@ -1046,7 +1046,7 @@ BattleTowerAction_CheckExplanationRead: ; 17075f (5c:475f) BattleTowerAction $00 call GetSRAMBank ld a, [sBattleTowerSaveFileFlags] and $2 - ld [ScriptVar], a + ld [wScriptVar], a call CloseSRAM ret @@ -1055,7 +1055,7 @@ BattleTowerAction_GetChallengeState: ; 170778 (5c:4778) BattleTowerAction $02 ld a, BANK(sBattleTowerChallengeState) call GetSRAMBank ld a, [hl] - ld [ScriptVar], a + ld [wScriptVar], a call CloseSRAM ret @@ -1088,7 +1088,7 @@ Function1707ac: ; 1707ac (5c:47ac) BattleTowerAction $05 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 @@ Function1707ac: ; 1707ac (5c:47ac) BattleTowerAction $05 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 @@ Function1707ac: ; 1707ac (5c:47ac) BattleTowerAction $05 jr nz, .asm_1707ef ret .asm_1707e5 - ld hl, CurDay + ld hl, wCurDay ld a, $8c sub c add [hl] @@ -1121,7 +1121,7 @@ Function1707ac: ; 1707ac (5c:47ac) BattleTowerAction $05 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 @@ Function170807: ; 170807 (5c:4807) BattleTowerAction $16 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 @@ Function170807: ; 170807 (5c:4807) BattleTowerAction $16 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 @@ Function17081d: ; 17081d (5c:481d) BattleTowerAction $17 push bc call UpdateTime pop bc - ld a, [CurDay] + ld a, [wCurDay] sub c jr c, .asm_170849 cp $b @@ -1170,7 +1170,7 @@ Function17081d: ; 17081d (5c:481d) BattleTowerAction $17 ret .asm_170849 - ld hl, CurDay + ld hl, wCurDay ld a, 140 sub c add [hl] @@ -1178,7 +1178,7 @@ Function17081d: ; 17081d (5c:481d) BattleTowerAction $17 ret c .asm_170853 ld a, $1 - ld [ScriptVar], a + ld [wScriptVar], a ld a, $5 call GetSRAMBank xor a @@ -1228,14 +1228,14 @@ BattleTower_CheckSaveFileExistsAndIsYours: ; 17089a BattleTowerAction $09 ld a, $1 .nope - ld [ScriptVar], a + ld [wScriptVar], a ret ; 1708b1 Function1708b1: ; 1708b1 (5c:48b1) BattleTowerAction $0a xor a - ld [MusicFade], a + ld [wMusicFade], a call MaxVolume ret @@ -1243,7 +1243,7 @@ CheckMobileEventIndex: ; 1708b9 (5c:48b9) BattleTowerAction $0b something to do ld a, BANK(sMobileEventIndex) call GetSRAMBank ld a, [sMobileEventIndex] - ld [ScriptVar], a + ld [wScriptVar], a call CloseSRAM ret @@ -1251,14 +1251,14 @@ Function1708c8: ; 1708c8 (5c:48c8) BattleTowerAction $0c call UpdateTime ld a, $5 call GetSRAMBank - ld a, [CurDay] + ld a, [wCurDay] ld [$aa8b], a xor a ld [$aa8c], a 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 @@ Function1708c8: ; 1708c8 (5c:48c8) BattleTowerAction $0c 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 @@ Function1708f0: ; 1708f0 (5c:48f0) BattleTowerAction $0d call CloseSRAM and a ret z - ld hl, CurDay + ld hl, wCurDay ld a, c cp [hl] jr nz, Function170923 @@ -1289,7 +1289,7 @@ Function1708f0: ; 1708f0 (5c:48f0) BattleTowerAction $0d cp $5 ret c ld a, $1 - ld [ScriptVar], a + ld [wScriptVar], a ret @@ -1309,22 +1309,22 @@ Function170923: ; 170923 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 @@ endr 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,14 +1384,14 @@ Function1709aa: ; 1709aa (5c:49aa) BattleTowerAction $0f ld a, BANK(w3_d090) ld [rSVBK], a ld a, [w3_d090] - ld [ScriptVar], a + ld [wScriptVar], a pop af ld [rSVBK], a ret 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 @@ Jumptable_1709e7: ; 1709e7 farcall Function11b6b4 farcall Function17d0f3 ld a, $1 - ld [ScriptVar], a + ld [wScriptVar], a ret ; 170a33 @@ -1478,9 +1478,9 @@ Jumptable_1709e7: ; 1709e7 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 @@ Jumptable_1709e7: ; 1709e7 .no_scene ld a, $1 - ld [ScriptVar], a + ld [wScriptVar], a ret .different @@ -1502,10 +1502,10 @@ Jumptable_1709e7: ; 1709e7 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 @@ Function170aaf: ; 170aaf (5c:4aaf) BattleTowerAction $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 @@ Function170abe: ; 170abe (5c:4abe) BattleTowerAction $14 call GetSRAMBank ld a, [sBattleTowerSaveFileFlags] and $1 - ld [ScriptVar], a + ld [wScriptVar], a call CloseSRAM ret @@ -1573,14 +1573,14 @@ BattleTowerAction_LevelCheck: ; 170ae8 (5c:4ae8) BattleTowerAction $18 ld a, b ld [wcd4f], a xor a - ld [ScriptVar], a + ld [wScriptVar], a farcall BattleTower_LevelCheck ; level check ret nc ld a, $5 call GetSRAMBank ld a, [$b2fb] call CloseSRAM - ld [ScriptVar], a + ld [wScriptVar], a ret BattleTowerAction_UbersCheck: ; 170b16 (5c:4b16) BattleTowerAction $19 @@ -1593,14 +1593,14 @@ BattleTowerAction_UbersCheck: ; 170b16 (5c:4b16) BattleTowerAction $19 ld a, b ld [wcd4f], a xor a - ld [ScriptVar], a + ld [wScriptVar], a farcall BattleTower_UbersCheck ret nc ld a, $5 call GetSRAMBank ld a, [$b2fb] call CloseSRAM - ld [ScriptVar], a + ld [wScriptVar], a ret Special_LoadOpponentTrainerAndPokemonWithOTSprite: ; 0x170b44 @@ -1609,7 +1609,7 @@ Special_LoadOpponentTrainerAndPokemonWithOTSprite: ; 0x170b44 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 @@ Special_LoadOpponentTrainerAndPokemonWithOTSprite: ; 0x170b44 ; 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 @@ Special_LoadOpponentTrainerAndPokemonWithOTSprite: ; 0x170b44 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 @@ Special_CheckForBattleTowerRules: ; 170bd3 ld a, TRUE .asm_170be0 - ld [ScriptVar], a + ld [wScriptVar], a ret ; 170be4 diff --git a/engine/events/battle_tower/load_trainer.asm b/engine/events/battle_tower/load_trainer.asm index e0e4a5ca15d..bfb5cf885b6 100644 --- 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 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081 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 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081 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 diff --git a/engine/events/battle_tower/rules.asm b/engine/events/battle_tower/rules.asm index 0e994c27ea4..fc9fa948aee 100644 --- a/engine/events/battle_tower/rules.asm +++ b/engine/events/battle_tower/rules.asm @@ -30,7 +30,7 @@ CheckForMobileBattleRules: ; 8b1e1 ; 0x8b201 CheckForBattleTowerRules: ; 8b201 - ld hl, StringBuffer2 + ld hl, wStringBuffer2 ld [hl], "3" inc hl ld [hl], "@" @@ -212,13 +212,13 @@ BattleTower_ExecuteJumptable: ; 8b25b ; 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 @@ BattleTower_CheckPartyHasThreeMonsThatAreNotEggs: ; 8b2c1 .egg dec c jr nz, .loop - ld a, [PartyCount] + ld a, [wPartyCount] cp b ret z ld a, b @@ -240,7 +240,7 @@ BattleTower_CheckPartyHasThreeMonsThatAreNotEggs: ; 8b2c1 ; 8b2da Function_PartyCountEq3: ; 8b2da - ld a, [PartyCount] + ld a, [wPartyCount] cp BATTLETOWER_PARTY_LENGTH ret z scf @@ -248,13 +248,13 @@ Function_PartyCountEq3: ; 8b2da ; 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 @@ VerifyUniqueness: ; 8b2e9 ; 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 diff --git a/engine/events/battle_tower/trainer_text.asm b/engine/events/battle_tower/trainer_text.asm index 96c91caa9cd..c4bcedf64a7 100755 --- 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 @@ else ; 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 @@ endc 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 diff --git a/engine/events/buena.asm b/engine/events/buena.asm index d5a80ef2e3e..1991d6a869e 100644 --- a/engine/events/buena.asm +++ b/engine/events/buena.asm @@ -14,7 +14,7 @@ Special_BuenasPassword: ; 8af6b 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 @@ Special_BuenasPassword: ; 8af6b .wrong ld a, b - ld [ScriptVar], a + ld [wScriptVar], a ret ; 8afa9 @@ -58,7 +58,7 @@ endr 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 @@ Special_BuenaPrize: ; 8afd4 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 @@ Special_BuenaPrize: ; 8afd4 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 @@ Special_BuenaPrize: ; 8afd4 call YesNoBox jr c, .loop - ld a, [MenuSelectionQuantity] + ld a, [wMenuSelectionQuantity] call Buena_getprize inc hl ld a, [hld] @@ -109,10 +109,10 @@ Special_BuenaPrize: ; 8afd4 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_PlacePrizeMenuBox: ; 8b0d6 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 @@ Buena_PrizeMenu: ; 8b0e2 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 @@ endr ; 8b134 .prizeitem ; 8b134 - ld a, [MenuSelection] + ld a, [wMenuSelection] call Buena_getprize ld a, [hl] push de @@ -313,7 +313,7 @@ endr ; 8b147 .prizepoints ; 8b147 - ld a, [MenuSelection] + ld a, [wMenuSelection] call Buena_getprize inc hl ld a, [hl] diff --git a/engine/events/buena_menu.asm b/engine/events/buena_menu.asm index cf6fecf72ec..047d1e7e33a 100644 --- a/engine/events/buena_menu.asm +++ b/engine/events/buena_menu.asm @@ -5,7 +5,7 @@ Special_AskRememberPassword: ; 4ae12 ld a, $1 .okay - ld [ScriptVar], a + ld [wScriptVar], a ret .DoMenu: ; 4ae1f diff --git a/engine/events/bug_contest/caught_mon.asm b/engine/events/bug_contest/caught_mon.asm index 5d423f466fe..4bad0182971 100644 --- a/engine/events/bug_contest/caught_mon.asm +++ b/engine/events/bug_contest/caught_mon.asm @@ -11,7 +11,7 @@ BugContest_SetCaughtContestMon: ; e6ce .firstcatch call .generatestats - ld a, [TempEnemyMonSpecies] + ld a, [wTempEnemyMonSpecies] ld [wd265], a call GetPokemonName ld hl, .caughttext @@ -19,16 +19,16 @@ BugContest_SetCaughtContestMon: ; e6ce 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 ld hl, wContestMon call ByteFill xor a - ld [MonType], a + ld [wMonType], a ld hl, wContestMon jp GeneratePartyMonStats diff --git a/engine/events/bug_contest/contest_2.asm b/engine/events/bug_contest/contest_2.asm index 7ade4481571..8913dee6f37 100755 --- a/engine/events/bug_contest/contest_2.asm +++ b/engine/events/bug_contest/contest_2.asm @@ -77,12 +77,12 @@ Special_CheckBugContestContestantFlag: ; 139ed 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 @@ Special_ContestDropOffMons: ; 13a12 ; ... 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 @@ Special_ContestReturnMons: ; 13a31 .done ld a, b - ld [PartyCount], a + ld [wPartyCount], a ret ; 13a47 diff --git a/engine/events/bug_contest/display_stats.asm b/engine/events/bug_contest/display_stats.asm index 92b89a38f36..13b90d0a31b 100644 --- a/engine/events/bug_contest/display_stats.asm +++ b/engine/events/bug_contest/display_stats.asm @@ -4,7 +4,7 @@ DisplayCaughtContestMonStats: ; cc000 call ClearSprites call LoadFontsBattleExtra - ld hl, Options + ld hl, wOptions ld a, [hl] push af set 4, [hl] @@ -38,24 +38,24 @@ DisplayCaughtContestMonStats: ; cc000 ld a, [wContestMon] ld [wd265], a call GetPokemonName - ld de, StringBuffer1 + ld de, wStringBuffer1 hlcoord 1, 2 call PlaceString 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,14 +64,14 @@ DisplayCaughtContestMonStats: ; cc000 call PrintNum hlcoord 11, 10 - ld de, EnemyMonMaxHP + ld de, wEnemyMonMaxHP call PrintNum ld hl, SwitchMonText call PrintText pop af - ld [Options], a + ld [wOptions], a call WaitBGMap ld b, SCGB_DIPLOMA diff --git a/engine/events/bug_contest/judging.asm b/engine/events/bug_contest/judging.asm index a8cb80efe4a..c63087397d8 100755 --- a/engine/events/bug_contest/judging.asm +++ b/engine/events/bug_contest/judging.asm @@ -97,7 +97,7 @@ LoadContestantName: ; 13730 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 @@ LoadContestantName: ; 13730 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 diff --git a/engine/events/card_key.asm b/engine/events/card_key.asm index dc4c73ad200..0f0b0ff334c 100755 --- 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 diff --git a/engine/events/catch_tutorial.asm b/engine/events/catch_tutorial.asm index b9352ccd6ef..6ae3b4a3b88 100644 --- 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 @@ CatchTutorial:: ; 4e554 .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 @@ CatchTutorial:: ; 4e554 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 @@ CatchTutorial:: ; 4e554 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 diff --git a/engine/events/celebi.asm b/engine/events/celebi.asm index 81565c27e66..082a2318dbe 100755 --- a/engine/events/celebi.asm +++ b/engine/events/celebi.asm @@ -2,10 +2,10 @@ SPECIALCELEBIEVENT_CELEBI EQU $84 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 @@ Special_CelebiShrineEvent: ; 4989a .done pop af - ld [VramState], a + ld [wVramState], a call .RestorePlayerSprite_DespawnLeaves call CelebiEvent_SetBattleType ret @@ -52,7 +52,7 @@ Special_CelebiShrineEvent: ; 4989a ; 498f9 .RestorePlayerSprite_DespawnLeaves: ; 498f9 - ld hl, Sprite01TileID + ld hl, wSprite01TileID xor a ld c, 4 .OAMloop: @@ -63,8 +63,8 @@ endr inc a dec c jr nz, .OAMloop - ld hl, Sprite05 - ld bc, SpritesEnd - Sprite05 + ld hl, wSprite05 + ld bc, wSpritesEnd - wSprite05 xor a call ByteFill ret @@ -357,7 +357,7 @@ GetCelebiSpriteTile: ; 49bae CelebiEvent_SetBattleType: ; 49bf3 ld a, BATTLETYPE_CELEBI - ld [BattleType], a + ld [wBattleType], a ret ; 49bf9 @@ -367,13 +367,13 @@ Special_CheckCaughtCelebi: ; 49bf9 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 diff --git a/engine/events/checkforhiddenitems.asm b/engine/events/checkforhiddenitems.asm index 3cad2b8213d..7396bd39a71 100644 --- 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 @@ CheckForHiddenItems: ; b8172 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 @@ CheckForHiddenItems: ; b8172 ; 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 @@ CheckForHiddenItems: ; b8172 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 @@ CheckForHiddenItems: ; b8172 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 @@ CheckForHiddenItems: ; b8172 ; b81e2 .GetFarByte: ; b81e2 - ld a, [Buffer1] + ld a, [wBuffer1] call GetFarByte inc hl ret diff --git a/engine/events/daycare.asm b/engine/events/daycare.asm index f65464a8d8c..3d36bbfd7e7 100755 --- a/engine/events/daycare.asm +++ b/engine/events/daycare.asm @@ -119,7 +119,7 @@ DayCareManIntroText: ; 1678f ; 16798 DayCareAskDepositPokemon: ; 16798 - ld a, [PartyCount] + ld a, [wPartyCount] cp 2 jr c, .OnlyOneMon ld a, DAYCARETEXT_WHICH_ONE @@ -127,20 +127,20 @@ DayCareAskDepositPokemon: ; 16798 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 @@ DayCareAskDepositPokemon: ; 16798 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 @@ DayCare_DepositPokemonText: ; 167f6 ; 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 @@ DayCare_AskWithdrawBreedMon: ; 16807 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 @@ DayCare_AskWithdrawBreedMon: ; 16807 ; 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 @@ DayCare_GetBackMonForMoney: ; 16850 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 @@ Special_DayCareManOutside: ; 16936 call PrintText call YesNoBox jr c, .Declined - ld a, [PartyCount] + ld a, [wPartyCount] cp PARTY_LENGTH jr nc, .PartyFull call DayCare_GiveEgg @@ -468,14 +468,14 @@ Special_DayCareManOutside: ; 16936 .Load0: call PrintText xor a ; FALSE - ld [ScriptVar], a + ld [wScriptVar], a ret .PartyFull: ld hl, .PartyFullText call PrintText ld a, TRUE - ld [ScriptVar], a + ld [wScriptVar], a ret ; 16993 @@ -511,8 +511,8 @@ Special_DayCareManOutside: ; 16936 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 @@ DayCare_GiveEgg: ; 169ac 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 @@ DayCare_GiveEgg: ; 169ac 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 @@ DayCare_GiveEgg: ; 169ac ; 16a31 DayCare_GetCurrentPartyMember: ; 16a31 - ld a, [PartyCount] + ld a, [wPartyCount] dec a call AddNTimes ld d, h @@ -626,13 +626,13 @@ DayCare_InitBreeding: ; 16a3b 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 @@ DayCare_InitBreeding: ; 16a3b 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,15 +669,15 @@ DayCare_InitBreeding: ; 16a3b 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 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 @@ DayCare_InitBreeding: ; 16a3b 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 @@ DayCare_InitBreeding: ; 16a3b 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 @@ DayCare_InitBreeding: ; 16a3b cp DITTO jr z, .GotDVs ld a, TEMPMON - ld [MonType], a + ld [wMonType], a push hl farcall GetGender pop hl @@ -766,7 +766,7 @@ DayCare_InitBreeding: ; 16a3b ld [hl], a .SkipDVs: - ld hl, StringBuffer1 + ld hl, wStringBuffer1 ld de, wMonOrItemNameBuffer ld bc, NAME_LENGTH call CopyBytes @@ -774,17 +774,17 @@ DayCare_InitBreeding: ; 16a3b 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 ld [hli], a ld [hli], a ld [hl], a - ld a, [CurPartyLevel] + ld a, [wCurPartyLevel] ld [wEggMonLevel], a ret ; 16be0 diff --git a/engine/events/dratini.asm b/engine/events/dratini.asm index 83732bef225..a45f01195de 100644 --- 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 @@ Special_Dratini: ; 0x8b170 .GiveMoveset: push hl - ld a, [ScriptVar] + ld a, [wScriptVar] ld hl, .Movesets ld bc, .Moveset1 - .Moveset0 call AddNTimes @@ -93,7 +93,7 @@ Special_Dratini: ; 0x8b170 ; 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 diff --git a/engine/events/elevator.asm b/engine/events/elevator.asm index e0426c5bdd8..98d408b0e56 100755 --- a/engine/events/elevator.asm +++ b/engine/events/elevator.asm @@ -29,7 +29,7 @@ Elevator:: ; 1342d ; 1345a .LoadFloors: ; 1345a - ld de, CurElevator + ld de, wCurElevator ld bc, 4 ld hl, wElevatorPointer ld a, [hli] @@ -60,9 +60,9 @@ Elevator:: ; 1342d 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 @@ Elevator_GoToFloor: ; 134c0 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_WhichFloorText: ; 0x1350d Elevator_GetCurrentFloorText: ; 13512 - ld hl, Options + ld hl, wOptions ld a, [hl] push af set NO_TEXT_SCROLL, [hl] @@ -165,7 +165,7 @@ Elevator_GetCurrentFloorText: ; 13512 hlcoord 4, 4 call Elevator_GetCurrentFloorString pop af - ld [Options], a + ld [wOptions], a ret ; 13537 @@ -179,7 +179,7 @@ Elevator_GetCurrentFloorString: ; 1353f ld a, [wElevatorOriginFloor] ld e, a ld d, 0 - ld hl, CurElevatorFloors + ld hl, wCurElevatorFloors add hl, de ld a, [hl] pop de @@ -198,14 +198,14 @@ Elevator_MenuData2: ; 0x13558 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 ; 13568 GetElevatorFloorStrings: ; 13568 - ld a, [MenuSelection] + ld a, [wMenuSelection] GetFloorString: ; 1356b push de call FloorToString diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm index 3fb1fe9e62b..5fc06960270 100755 --- a/engine/events/field_moves.asm +++ b/engine/events/field_moves.asm @@ -62,8 +62,8 @@ ShakeHeadbuttTree: ; 8c80a xor a ld [hBGMapMode], a farcall ClearSpriteAnims - ld hl, Sprite37 - ld bc, SpritesEnd - Sprite37 + ld hl, wSprite37 + ld bc, wSpritesEnd - wSprite37 xor a call ByteFill ld de, Font @@ -81,7 +81,7 @@ INCBIN "gfx/overworld/headbutt_tree.2bpp" HideHeadbuttTree: ; 8c913 xor a ld [hBGMapMode], a - ld a, [PlayerDirection] + ld a, [wPlayerDirection] and %00001100 srl a ld e, a @@ -262,7 +262,7 @@ Cut_GetLeafSpawnCoords: ; 8ca8e (23:4a8e) 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 @@ Cut_GetLeafSpawnCoords: ; 8ca8e (23:4a8e) ; 8cad3 Cut_Headbutt_GetPixelFacing: ; 8cad3 (23:4ad3) - ld a, [PlayerDirection] + ld a, [wPlayerDirection] and %00001100 srl a ld e, a @@ -321,10 +321,10 @@ Cut_Headbutt_GetPixelFacing: ; 8cad3 (23:4ad3) 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 @@ FlyFromAnim: ; 8caed .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 @@ FlyToAnim: ; 8cb33 .exit pop af - ld [VramState], a + ld [wVramState], a call .RestorePlayerSprite_DespawnLeaves ret .RestorePlayerSprite_DespawnLeaves: ; 8cb82 (23:4b82) - ld hl, Sprite01TileID + ld hl, wSprite01TileID xor a ld c, 4 .OAMloop @@ -404,8 +404,8 @@ endr inc a dec c jr nz, .OAMloop - ld hl, Sprite05 - ld bc, SpritesEnd - Sprite05 + ld hl, wSprite05 + ld bc, wSpritesEnd - wSprite05 xor a call ByteFill ret @@ -416,8 +416,8 @@ FlyFunction_InitGFX: ; 8cb9b (23:4b9b) 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 diff --git a/engine/events/fish.asm b/engine/events/fish.asm index 39644847d8f..d79ac0a438d 100644 --- a/engine/events/fish.asm +++ b/engine/events/fish.asm @@ -79,7 +79,7 @@ rept 4 add hl, de endr - ld a, [TimeOfDay] + ld a, [wTimeOfDay] maskbits NUM_DAYTIMES cp NITE_F jr c, .time_species diff --git a/engine/events/fruit_trees.asm b/engine/events/fruit_trees.asm index 44f2315a026..796880175e9 100644 --- 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 @@ FruitTreeScript:: ; 44000 .fruit writetext HeyItsFruitText - copybytetovar CurFruit + copybytetovar wCurFruit giveitem ITEM_FROM_MEM iffalse .packisfull buttonsound @@ -35,10 +35,10 @@ FruitTreeScript:: ; 44000 ; 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 @@ CheckFruitTree: ; 44055 ld b, 2 call GetFruitTreeFlag ld a, c - ld [ScriptVar], a + ld [wScriptVar], a ret ; 4405f @@ -65,7 +65,7 @@ PickedFruitTree: ; 4405f ResetFruitTrees: ; 4406a xor a - ld hl, FruitTreeFlags + ld hl, wFruitTreeFlags ld [hli], a ld [hli], a ld [hli], a @@ -78,11 +78,11 @@ ResetFruitTrees: ; 4406a 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 diff --git a/engine/events/halloffame.asm b/engine/events/halloffame.asm index dbd3a2d5a00..78b5cbe03d3 100755 --- a/engine/events/halloffame.asm +++ b/engine/events/halloffame.asm @@ -37,14 +37,14 @@ HallOfFame:: ; 0x8640e 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 @@ RedCredits:: ; 86455 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 @@ AnimateHallOfFame: ; 864c3 .done call HOF_AnimatePlayerPic ld a, $4 - ld [MusicFade], a + ld [wMusicFade], a call RotateThreePalettesRight ld c, 8 call DelayFrames @@ -143,15 +143,15 @@ AnimateHallOfFame: ; 864c3 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 @@ GetHallOfFameParty: ; 8653f 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 @@ GetHallOfFameParty: ; 8653f 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 @@ AnimateHOFMonEntrance: ; 865b5 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 @@ DisplayHOFMon: ; 86748 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 @@ DisplayHOFMon: ; 86748 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 @@ DisplayHOFMon: ; 86748 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 @@ DisplayHOFMon: ; 86748 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 @@ DisplayHOFMon: ; 86748 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 @@ HOF_AnimatePlayerPic: ; 86810 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 @@ HOF_AnimatePlayerPic: ; 86810 lb bc, 4, 18 call TextBox hlcoord 2, 4 - ld de, PlayerName + ld de, wPlayerName call PlaceString hlcoord 1, 6 ld a, "" @@ -596,19 +596,19 @@ HOF_AnimatePlayerPic: ; 86810 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 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 diff --git a/engine/events/happiness_egg.asm b/engine/events/happiness_egg.asm index 2db54a1a79a..0c516247f4f 100755 --- 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 @@ Special_GetFirstPokemonHappiness: ; 718d .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,27 +26,27 @@ Special_CheckFirstMonIsEgg: ; 71ac 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 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 @@ ChangeHappiness: ; 71c2 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 @@ StepHappiness:: ; 725a 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] diff --git a/engine/events/heal_machine_anim.asm b/engine/events/heal_machine_anim.asm index 067b2f554a8..5e60425f6fb 100755 --- a/engine/events/heal_machine_anim.asm +++ b/engine/events/heal_machine_anim.asm @@ -9,28 +9,28 @@ 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 .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 @@ Special_HealMachineAnim: ; 12324 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,18 +97,18 @@ ENDM ; 12393 .PC_LoadBallsOntoMachine: ; 12393 - ld hl, Sprite33 + ld hl, wSprite33 ld de, .PC_ElmsLab_OAM call .PlaceHealingMachineTile call .PlaceHealingMachineTile jr .LoadBallsOntoMachine .HOF_LoadBallsOntoMachine: ; 123a1 - ld hl, Sprite33 + ld hl, wSprite33 ld de, .HOF_OAM .LoadBallsOntoMachine: ; 123a7 - ld a, [PartyCount] + ld a, [wPartyCount] ld b, a .party_loop call .PlaceHealingMachineTile @@ -254,7 +254,7 @@ INCLUDE "gfx/overworld/heal_machine.pal" .PlaceHealingMachineTile: ; 124a3 push bc - ld a, [Buffer1] + ld a, [wBuffer1] bcpixel 2, 4 cp HEALMACHINE_ELMS_LAB jr z, .okay diff --git a/engine/events/kurt.asm b/engine/events/kurt.asm index 13bde6f7ee5..79eb7da2ef8 100644 --- a/engine/events/kurt.asm +++ b/engine/events/kurt.asm @@ -33,13 +33,13 @@ Special_SelectApricornForKurt: ; 88018 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 @@ Kurt_SelectApricorn: ; 88055 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 @@ Kurt_SelectApricorn: ; 88055 ld a, [wMenuJoypad] cp B_BUTTON jr z, .nope - ld a, [MenuSelection] + ld a, [wMenuSelection] cp -1 jr nz, .done @@ -96,13 +96,13 @@ Kurt_SelectApricorn: ; 88055 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 @@ Kurt_SelectApricorn: ; 88055 ; 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 @@ PlaceApricornQuantity: ; 88126 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 @@ Kurt_GetQuantityOfApricorn: ; 88139 ; 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 @@ Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161 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 @@ Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161 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_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161 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_GetAddressOfApricornQuantity: ; 88201 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 @@ Kurt_GetRidOfItem: ; 88211 .okay push bc - ld hl, NumItems + ld hl, wNumItems ld a, b ld [wItemQuantityChangeBuffer], a call TossItem diff --git a/engine/events/lucky_number.asm b/engine/events/lucky_number.asm index a172fc43118..1582cec7db7 100644 --- 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 @@ Special_CheckForLuckyNumberWinners: ; 4d87a 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,14 +100,14 @@ Special_CheckForLuckyNumberWinners: ; 4d87a jr c, .BoxesLoop call CloseSRAM - ld a, [ScriptVar] + ld a, [wScriptVar] and a ret z ; found nothing farcall StubbedTrainerRankings_LuckyNumberShow 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 @@ Special_CheckForLuckyNumberWinners: ; 4d87a 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 @@ Special_CheckForLuckyNumberWinners: ; 4d87a .okay inc b - ld a, [ScriptVar] + ld a, [wScriptVar] and a jr z, .bettermatch cp b @@ -176,10 +176,10 @@ Special_CheckForLuckyNumberWinners: ; 4d87a .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 @@ Special_CheckForLuckyNumberWinners: ; 4d87a 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 diff --git a/engine/events/magikarp.asm b/engine/events/magikarp.asm index 6588295b89b..8d835960f52 100644 --- a/engine/events/magikarp.asm +++ b/engine/events/magikarp.asm @@ -7,13 +7,13 @@ Special_CheckMagikarpLength: ; fbb32 ; 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 @@ Special_CheckMagikarpLength: ; fbb32 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 @@ INCBIN "gfx/font/feet_inches.2bpp" 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 @@ CalcMagikarpLength: ; fbbfc ; 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. diff --git a/engine/events/magnet_train.asm b/engine/events/magnet_train.asm index 232372dbd15..ed7caf218d1 100755 --- 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 @@ Special_MagnetTrain: ; 8cc04 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 @@ Special_MagnetTrain: ; 8cc04 ; 8cc99 MagnetTrain_UpdateLYOverrides: ; 8cc99 - ld hl, LYOverridesBackup + ld hl, wLYOverridesBackup ld c, $2f ld a, [wMagnetTrainOffset] add a @@ -242,12 +242,12 @@ MagnetTrainBGTiles: ; 8cd82 ; 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 @@ MagnetTrain_Jumptable_FirstRunThrough: ; 8ceae 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 @@ MagnetTrain_Jumptable_FirstRunThrough: ; 8ceae pop af ld [wEnvironment], a pop af - ld [TimeOfDayPal], a + ld [wTimeOfDayPal], a pop af ld [rSVBK], a ret diff --git a/engine/events/map_name_sign.asm b/engine/events/map_name_sign.asm index b20d74ee499..b97d40798b1 100644 --- a/engine/events/map_name_sign.asm +++ b/engine/events/map_name_sign.asm @@ -9,9 +9,9 @@ ReturnFromMapSetupScript:: ; b8000 ; 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 @@ ReturnFromMapSetupScript:: ; b8000 ; 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,14 +161,14 @@ PlaceMapNameCenterAlign: ; b80e1 (2e:40e1) ld c, a hlcoord 0, 2 add hl, bc - ld de, StringBuffer1 + ld de, wStringBuffer1 call PlaceString ret .GetNameLength: ; b8101 (2e:4101) ld c, 0 push hl - ld hl, StringBuffer1 + ld hl, wStringBuffer1 .loop ld a, [hli] cp "@" @@ -183,7 +183,7 @@ PlaceMapNameCenterAlign: ; b80e1 (2e:40e1) InitMapSignAttrMap: ; b8115 - ld de, AttrMap - TileMap + ld de, wAttrMap - wTileMap add hl, de inc b inc b diff --git a/engine/events/misc_scripts.asm b/engine/events/misc_scripts.asm index 73ed89143fd..4e4d5dc8631 100755 --- a/engine/events/misc_scripts.asm +++ b/engine/events/misc_scripts.asm @@ -43,20 +43,20 @@ FindItemInBallScript:: ; 0x122ce .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 diff --git a/engine/events/misc_scripts_2.asm b/engine/events/misc_scripts_2.asm index 29416a9e590..dd705b547dc 100644 --- a/engine/events/misc_scripts_2.asm +++ b/engine/events/misc_scripts_2.asm @@ -12,7 +12,7 @@ RepelWoreOffScript:: ; 0x13619 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 @@ HiddenItemScript:: ; 0x13625 db "@" SetMemEvent: ; 1364f - ld hl, EngineBuffer1 + ld hl, wEngineBuffer1 ld a, [hli] ld d, [hl] ld e, a diff --git a/engine/events/mom.asm b/engine/events/mom.asm index c7e1cd6e927..fbda552ad76 100644 --- a/engine/events/mom.asm +++ b/engine/events/mom.asm @@ -141,7 +141,7 @@ Special_BankOfMom: ; 16218 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 @@ Special_BankOfMom: ; 16218 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 @@ Special_BankOfMom: ; 16218 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 @@ Special_BankOfMom: ; 16218 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 @@ DSTChecks: ; 16439 ; 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,14 +465,14 @@ Mom_ContinueMenuSetup: ; 1651a 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 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 @@ Mom_WithdrawDepositMenuJoypad: ; 16571 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 @@ Mom_WithdrawDepositMenuJoypad: ; 16571 call .getdigitquantity ld c, l ld b, h - ld de, StringBuffer2 + ld de, wStringBuffer2 farcall GiveMoney ret @@ -576,7 +576,7 @@ Mom_WithdrawDepositMenuJoypad: ; 16571 call .getdigitquantity ld c, l ld b, h - ld de, StringBuffer2 + ld de, wStringBuffer2 farcall TakeMoney ret diff --git a/engine/events/mom_phone.asm b/engine/events/mom_phone.asm index d12bf01550e..0b35fdb30eb 100755 --- a/engine/events/mom_phone.asm +++ b/engine/events/mom_phone.asm @@ -41,13 +41,13 @@ MomTriesToBuySomething:: ; fcfec .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 @@ CheckBalance_MomItem2: ; fd044 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 @@ CheckBalance_MomItem2: ; fd044 ret .AddMoney: - ld de, MomItemTriggerBalance + ld de, wMomItemTriggerBalance ld bc, hMoneyTemp farcall AddMoney ret @@ -150,10 +150,10 @@ Mom_GiveItemOrDoll: ; fd0c3 .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 diff --git a/engine/events/move_deleter.asm b/engine/events/move_deleter.asm index 3e06113aef9..fad33e222ad 100644 --- a/engine/events/move_deleter.asm +++ b/engine/events/move_deleter.asm @@ -7,11 +7,11 @@ Special_MoveDeletion: 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 @@ Special_MoveDeletion: 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 @@ Special_MoveDeletion: 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 @@ Special_MoveDeletion: 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 diff --git a/engine/events/move_tutor.asm b/engine/events/move_tutor.asm index be5f3756407..df599d3ae53 100644 --- a/engine/events/move_tutor.asm +++ b/engine/events/move_tutor.asm @@ -23,18 +23,18 @@ Special_MoveTutor: ; 4925b 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 @@ CheckCanLearnMoveTutorMove: ; 492b9 predef CanLearnTMHMMove push bc - ld a, [CurPartyMon] - ld hl, PartyMonNicknames + ld a, [wCurPartyMon] + ld hl, wPartyMonNicknames call GetNick pop bc diff --git a/engine/events/name_rater.asm b/engine/events/name_rater.asm index 796647f480c..ad4ea1c9c1f 100644 --- a/engine/events/name_rater.asm +++ b/engine/events/name_rater.asm @@ -10,7 +10,7 @@ NameRater: ; fb6ed 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 @@ NameRater: ; fb6ed ; 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 @@ NameRater: ; fb6ed 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 @@ NameRater: ; fb6ed ; 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 @@ CheckIfMonIsYourOT: ; fb78a ; 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 @@ IsNewNameEmpty: ; fb7be ; 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 "@" diff --git a/engine/events/odd_egg.asm b/engine/events/odd_egg.asm index de3107804fd..e4efc5c0ff6 100644 --- a/engine/events/odd_egg.asm +++ b/engine/events/odd_egg.asm @@ -42,17 +42,17 @@ GiveOddEgg: ; 1fb4b6 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 @@ GiveOddEgg: ; 1fb4b6 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 diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index c9e0a5fe51e..6223d875da4 100755 --- 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 @@ FieldMoveJumptable: ; c6f5 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 @@ CheckPartyMove: ; c742 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 @@ CheckPartyMove: ; c742 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 @@ CheckPartyMove: ; c742 .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 @@ CheckMapForSomethingToCut: ; c7ce 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 @@ CheckMapForSomethingToCut: ; c7ce 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,18 +219,18 @@ Script_Cut: ; 0xc802 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 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 @@ CheckOverworldTileArrays: ; c840 ; 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 @@ SurfFunction: ; c909 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 @@ SurfFunction: ; c909 .DoSurf: ; c95f (3:495f) call GetSurfType - ld [Buffer2], a + ld [wBuffer2], a call GetPartyNick ld hl, SurfFromMenuScript call QueueScript @@ -416,14 +416,14 @@ UsedSurfScript: ; c986 callasm .empty_fn ; empty function - copybytetovar Buffer2 + copybytetovar wBuffer2 writevarcode VAR_MOVEMENT special ReplaceKrisSprite 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 @@ GetSurfType: ; c9b8 ; 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 @@ CheckDirection: ; c9cb ; 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 @@ CheckDirection: ; c9cb add hl, de ; Can you walk in this direction? - ld a, [TilePermissions] + ld a, [wTilePermissions] and [hl] jr nz, .quit xor a @@ -495,14 +495,14 @@ TrySurfOW:: ; c9e7 ; 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 jr z, .quit ; Must be facing water. - ld a, [EngineBuffer1] + ld a, [wEngineBuffer1] call GetTileCollision cp WATERTILE jr nz, .quit @@ -524,7 +524,7 @@ TrySurfOW:: ; c9e7 jr nz, .quit call GetSurfType - ld [Buffer2], a + ld [wBuffer2], a call GetPartyNick ld a, BANK(AskSurfScript) @@ -587,7 +587,7 @@ FlyFunction: ; ca3b cp NUM_SPAWNS jr nc, .illegal - ld [DefaultSpawnpoint], a + ld [wDefaultSpawnpoint], a call CloseWindow ld a, $1 ret @@ -664,11 +664,11 @@ WaterfallFunction: ; cade 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 @@ Script_UsedWaterfall: ; 0xcb20 .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 @@ DigFunction: ; cb9c ld a, $2 dig_incave - ld [Buffer2], a + ld [wBuffer2], a .loop ld hl, .DigTable call FieldMoveJumptable @@ -811,7 +811,7 @@ dig_incave 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 @@ dig_incave ret .FailDig: ; cc06 - ld a, [Buffer2] + ld a, [wBuffer2] cp $2 jr nz, .failescaperope ld hl, .Text_CantUseHere @@ -917,7 +917,7 @@ TeleportFunction: ; cc61 farcall IsSpawnPoint jr nc, .nope ld a, c - ld [DefaultSpawnpoint], a + ld [wDefaultSpawnpoint], a ld a, $1 ret @@ -1009,13 +1009,13 @@ StrengthFunction: ; cce5 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_StrengthFromMenu: ; 0xcd29 Script_UsedStrength: ; 0xcd2d callasm SetStrengthFlag writetext .UsedStrength - copybytetovar Buffer6 + copybytetovar wBuffer6 cry 0 pause 3 writetext .StrengthAllowedItToMoveBoulders @@ -1101,7 +1101,7 @@ TryStrengthOW: ; cd78 jr .done .done - ld [ScriptVar], a + ld [wScriptVar], a ret WhirlpoolFunction: ; cd9d @@ -1167,13 +1167,13 @@ TryWhirlpoolMenu: ; cdde 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 @@ Script_UsedWhirlpool: ; 0xce0f 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 @@ RockSmashScript: ; cf32 disappear -2 callasm RockMonEncounter - copybytetovar TempWildMonSpecies + copybytetovar wTempWildMonSpecies iffalse .done randomwildmon startbattle @@ -1445,7 +1445,7 @@ HasRockSmash: ; cf7c xor a jr .done .done - ld [ScriptVar], a + ld [wScriptVar], a ret FishFunction: ; cf8e @@ -1453,7 +1453,7 @@ FishFunction: ; cf8e push af call FieldMoveJumptableReset pop af - ld [Buffer2], a + ld [wBuffer2], a .loop ld hl, .FishTable call FieldMoveJumptable @@ -1470,7 +1470,7 @@ FishFunction: ; cf8e dw .FishNoFish .TryFish: ; cfaf - ld a, [PlayerState] + ld a, [wPlayerState] cp PLAYER_SURF jr z, .fail cp PLAYER_SURF_PIKA @@ -1492,17 +1492,17 @@ FishFunction: ; cf8e .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 @@ FishFunction: ; cf8e .FishGotSomething: ; cff4 ld a, $1 - ld [Buffer6], a + ld [wBuffer6], a ld hl, Script_GotABite call QueueScript ld a, $81 @@ -1524,7 +1524,7 @@ FishFunction: ; cf8e .FishNoBite: ; d002 ld a, $2 - ld [Buffer6], a + ld [wBuffer6], a ld hl, Script_NotEvenANibble call QueueScript ld a, $81 @@ -1532,7 +1532,7 @@ FishFunction: ; cf8e .FishNoFish: ; d010 ld a, $0 - ld [Buffer6], a + ld [wBuffer6], a ld hl, Script_NotEvenANibble2 call QueueScript ld a, $81 @@ -1597,7 +1597,7 @@ Script_GotABite: ; 0xd035 step_end Fishing_CheckFacingUp: ; d06c - ld a, [PlayerDirection] + ld a, [wPlayerDirection] and $c cp OW_UP ld a, $1 @@ -1605,7 +1605,7 @@ Fishing_CheckFacingUp: ; d06c xor a .up - ld [ScriptVar], a + ld [wScriptVar], a ret Script_FishCastRod: ; 0xd07c @@ -1627,7 +1627,7 @@ PutTheRodAway: ; d095 xor a ld [hBGMapMode], a ld a, $1 - ld [PlayerAction], a + ld [wPlayerAction], a call UpdateSprites call ReplaceKrisSprite ret @@ -1656,7 +1656,7 @@ BikeFunction: ; d0b3 .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 @@ BikeFunction: ; d0b3 call .CheckIfRegistered call QueueScript xor a - ld [MusicFade], a + ld [wMusicFade], a ld de, MUSIC_NONE call PlayMusic call DelayFrame @@ -1826,11 +1826,11 @@ AskCutScript: ; 0xd1a9 .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 diff --git a/engine/events/poisonstep.asm b/engine/events/poisonstep.asm index 00c7477bce1..47916076f37 100755 --- a/engine/events/poisonstep.asm +++ b/engine/events/poisonstep.asm @@ -1,44 +1,44 @@ 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 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 @@ DoPoisonStep:: ; 505da .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 @@ DoPoisonStep:: ; 505da .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 diff --git a/engine/events/poisonstep_pals.asm b/engine/events/poisonstep_pals.asm index 5b5b642cec4..c1bfa49f030 100644 --- a/engine/events/poisonstep_pals.asm +++ b/engine/events/poisonstep_pals.asm @@ -9,7 +9,7 @@ LoadPoisonBGPals: ; cbcdd ld a, [hCGB] and a jr nz, .cgb - ld a, [TimeOfDayPal] + ld a, [wTimeOfDayPal] maskbits NUM_DAYTIMES cp DARKNESS_F ld a, %00000000 diff --git a/engine/events/poke_seer.asm b/engine/events/poke_seer.asm index fb9c6d9f9e9..85fc7af2d86 100644 --- a/engine/events/poke_seer.asm +++ b/engine/events/poke_seer.asm @@ -24,7 +24,7 @@ Special_PokeSeer: ; 4f0bc farcall SelectMonFromParty jr c, .cancel - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp EGG jr z, .egg @@ -118,12 +118,12 @@ ReadCaughtData: ; 4f134 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 @@ ReadCaughtData: ; 4f134 ; 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 @@ GetCaughtLocation: ; 4f20a 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 @@ GetCaughtLocation: ; 4f20a ; 4f242 GetCaughtOT: ; 4f242 - ld a, [CurPartyMon] - ld hl, PartyMonOT + ld a, [wCurPartyMon] + ld hl, wPartyMonOT ld bc, NAME_LENGTH call AddNTimes ld de, wSeerOTName diff --git a/engine/events/pokecenter_pc.asm b/engine/events/pokecenter_pc.asm index 75d2d539207..75309aaa159 100755 --- a/engine/events/pokecenter_pc.asm +++ b/engine/events/pokecenter_pc.asm @@ -15,7 +15,7 @@ Special_PokemonCenterPC: ; 1559a 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 @@ Special_PokemonCenterPC: ; 1559a ; 15650 PC_CheckPartyForPokemon: ; 15650 - ld a, [PartyCount] + ld a, [wPartyCount] and a ret nz ld de, SFX_CHOOSE_PC_OPTION @@ -289,13 +289,13 @@ LOG_OFF EQU 6 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 @@ KrisWithdrawItemMenu: ; 0x157d1 .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 @@ KrisTossItemMenu: ; 0x1585f .loop call PCItemsJoypad jr c, .quit - ld de, PCItems + ld de, wPCItems farcall TossItemFromPC jr .loop @@ -473,15 +473,15 @@ KrisDepositItemMenu: ; 0x1588b 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 @@ KrisDepositItemMenu: ; 0x1588b .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 @@ PCItemsJoypad: ; 0x15985 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 diff --git a/engine/events/pokepic.asm b/engine/events/pokepic.asm index e9e14bbf41d..a98ba47d349 100755 --- a/engine/events/pokepic.asm +++ b/engine/events/pokepic.asm @@ -8,8 +8,8 @@ Pokepic:: ; 244e3 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 diff --git a/engine/events/pokerus/apply_pokerus_tick.asm b/engine/events/pokerus/apply_pokerus_tick.asm index 3c97fdc5efb..e632fbfe4ac 100644 --- 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 diff --git a/engine/events/pokerus/check_pokerus.asm b/engine/events/pokerus/check_pokerus.asm index 285024754ad..d45055ab252 100644 --- a/engine/events/pokerus/check_pokerus.asm +++ b/engine/events/pokerus/check_pokerus.asm @@ -2,12 +2,12 @@ CheckPokerus: ; 4d860 ; 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] diff --git a/engine/events/pokerus/pokerus.asm b/engine/events/pokerus/pokerus.asm index d47bcb6c16f..b29d0d096fd 100644 --- 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,14 +28,14 @@ GivePokerusAndConvertBerries: ; 2ed44 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 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 @@ GivePokerusAndConvertBerries: ; 2ed44 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 @@ GivePokerusAndConvertBerries: ; 2ed44 ret .checkPreviousMonsLoop - ld a, [PartyCount] + ld a, [wPartyCount] cp b ret z ; no more mons ld a, l @@ -129,8 +129,8 @@ ConvertBerriesToBerryJuice: ; 2ede6 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 diff --git a/engine/events/print_photo.asm b/engine/events/print_photo.asm index 54aa1892d81..47766344c81 100755 --- a/engine/events/print_photo.asm +++ b/engine/events/print_photo.asm @@ -3,7 +3,7 @@ Special_PhotoStudio: ; 16dc7 call PrintText farcall SelectMonFromParty jr c, .cancel - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp EGG jr z, .egg diff --git a/engine/events/print_unown.asm b/engine/events/print_unown.asm index 771d3ea5a56..b0b7e856a39 100644 --- 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 @@ UnownPrinter: ; 16be4 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 @@ UnownPrinter: ; 16be4 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 @@ UnownPrinter: ; 16be4 .pressed_b pop af - ld [Options], a + ld [wOptions], a pop af ld [hInMenu], a call ReturnToMapFromSubmenu @@ -134,9 +134,9 @@ UnownPrinter: ; 16be4 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 diff --git a/engine/events/print_unown_2.asm b/engine/events/print_unown_2.asm index 1e0b90fc549..4583a59e062 100644 --- a/engine/events/print_unown_2.asm +++ b/engine/events/print_unown_2.asm @@ -30,7 +30,7 @@ RotateUnownFrontpic: ; e0000 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 @@ y = 0 rept \1 x = \1 * (\2 +- 1) + y rept \2 - dw OverworldMap tile x + dw wOverworldMap tile x x = x +- \2 endr y = y + 1 diff --git a/engine/events/prof_oaks_pc.asm b/engine/events/prof_oaks_pc.asm index ae84a43a52f..5dca38efe80 100755 --- a/engine/events/prof_oaks_pc.asm +++ b/engine/events/prof_oaks_pc.asm @@ -33,12 +33,12 @@ ProfOaksPCRating: ; 0x26601 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 @@ Rate: ; 0x26616 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 diff --git a/engine/events/sacred_ash.asm b/engine/events/sacred_ash.asm index 65ed83438fb..cf305355a0f 100755 --- a/engine/events/sacred_ash.asm +++ b/engine/events/sacred_ash.asm @@ -14,9 +14,9 @@ _SacredAsh: ; 507e6 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 diff --git a/engine/events/special.asm b/engine/events/special.asm index 128e7af297e..08160651286 100755 --- a/engine/events/special.asm +++ b/engine/events/special.asm @@ -4,13 +4,13 @@ Special_GiveShuckle: ; 7305 ; 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,35 +21,35 @@ Special_GiveShuckle: ; 7305 ; 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 pop af ; OT ID. - ld hl, PartyMon1ID + ld hl, wPartyMon1ID call AddNTimes ld a, HIGH(MANIA_OT_ID) ld [hli], a 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 @@ Special_GiveShuckle: ; 7305 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 @@ Special_ReturnShuckle: ; 737e 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 @@ Special_ReturnShuckle: ; 737e 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 @@ Special_ReturnShuckle: ; 737e .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,36 +123,36 @@ Special_ReturnShuckle: ; 737e 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 .cancel xor a - ld [ScriptVar], a + ld [wScriptVar], a ret Special_YoungerHaircutBrother: ; 7413 @@ -171,7 +171,7 @@ MassageOrHaircut: ; 7420 farcall SelectMonFromParty pop hl jr c, .nope - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp EGG jr z, .egg push hl @@ -197,19 +197,19 @@ MassageOrHaircut: ; 7420 .ok inc hl ld a, [hli] - ld [ScriptVar], a + ld [wScriptVar], a ld c, [hl] call ChangeHappiness ret .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 @@ Data_DaisyMassage: ; 746b 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 diff --git a/engine/events/squirtbottle.asm b/engine/events/squirtbottle.asm index 1134f1bb0b5..f6ab00951fe 100755 --- a/engine/events/squirtbottle.asm +++ b/engine/events/squirtbottle.asm @@ -21,11 +21,11 @@ _Squirtbottle: ; 50730 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 @@ _Squirtbottle: ; 50730 jr nz, .nope ld a, 1 - ld [ScriptVar], a + ld [wScriptVar], a ret .nope xor a - ld [ScriptVar], a + ld [wScriptVar], a ret ; 50779 diff --git a/engine/events/sweet_scent.asm b/engine/events/sweet_scent.asm index 9b75eb9b87f..2f1759a2b03 100755 --- a/engine/events/sweet_scent.asm +++ b/engine/events/sweet_scent.asm @@ -52,13 +52,13 @@ SweetScentEncounter: ; 506ef .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 diff --git a/engine/events/trainer_scripts.asm b/engine/events/trainer_scripts.asm index 212cd7f2828..abfcd8dee5d 100644 --- a/engine/events/trainer_scripts.asm +++ b/engine/events/trainer_scripts.asm @@ -11,7 +11,7 @@ SeenByTrainerScript:: ; 0xbe675 encountermusic showemote EMOTE_SHOCK, LAST_TALKED, 30 callasm TrainerWalkToPlayer - applymovement2 MovementBuffer + applymovement2 wMovementBuffer writeobjectxy LAST_TALKED faceobject PLAYER, LAST_TALKED jump StartBattleWithMapTrainerScript diff --git a/engine/events/treemons.asm b/engine/events/treemons.asm index 780fef2ccf1..6d55004f48e 100755 --- a/engine/events/treemons.asm +++ b/engine/events/treemons.asm @@ -2,8 +2,8 @@ TreeMonEncounter: ; b81ea farcall StubbedTrainerRankings_TreeEncounters xor a - ld [TempWildMonSpecies], a - ld [CurPartyLevel], a + ld [wTempWildMonSpecies], a + ld [wCurPartyLevel], a ld hl, TreeMonMaps call GetTreeMonSet @@ -16,22 +16,22 @@ TreeMonEncounter: ; b81ea 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 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 @@ RockMonEncounter: ; b8219 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 @@ SelectTreeMon: ; b841f 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 @@ GetTreeScore: ; b8443 ; 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 diff --git a/engine/events/unown_walls.asm b/engine/events/unown_walls.asm index 4d59a2f7ae5..5cc2419662d 100644 --- 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 @@ Special_OmanyteChamber: ; 8adef 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 @@ Special_OmanyteChamber: ; 8adef 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 @@ SpecialKabutoChamber: ; 8ae4e ; 8ae68 Special_DisplayUnownWords: ; 8ae68 - ld a, [ScriptVar] + ld a, [wScriptVar] ld hl, MenuDataHeaders_UnownWalls and a jr z, .load @@ -129,7 +129,7 @@ Special_DisplayUnownWords: ; 8ae68 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 @@ Special_DisplayUnownWords: ; 8ae68 jr nz, .loop2 .copy call _DisplayUnownWords_CopyWord - ld bc, AttrMap - TileMap + ld bc, wAttrMap - wTileMap add hl, bc call _DisplayUnownWords_FillAttr call WaitBGMap2 diff --git a/engine/events/whiteout.asm b/engine/events/whiteout.asm index aa629682f93..4adef9f4f34 100755 --- a/engine/events/whiteout.asm +++ b/engine/events/whiteout.asm @@ -52,7 +52,7 @@ HalveMoney: ; 12513 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 @@ GetWhiteoutSpawn: ; 12527 xor a ; SPAWN_HOME .yes - ld [DefaultSpawnpoint], a + ld [wDefaultSpawnpoint], a ret ; 1253d diff --git a/engine/events_2.asm b/engine/events_2.asm index 1149c24316d..b43ebdd6a99 100644 --- a/engine/events_2.asm +++ b/engine/events_2.asm @@ -52,7 +52,7 @@ LoadScriptBDE:: ; 97c4f TryTileCollisionEvent:: ; 97c5f call GetFacingTileCoord - ld [EngineBuffer1], a + ld [wEngineBuffer1], a ld c, a farcall CheckFacingTileForStdScript jr c, .done @@ -63,21 +63,21 @@ TryTileCollisionEvent:: ; 97c5f jr .done .whirlpool - ld a, [EngineBuffer1] + ld a, [wEngineBuffer1] call CheckWhirlpoolTile jr nz, .waterfall farcall TryWhirlpoolOW jr .done .waterfall - ld a, [EngineBuffer1] + ld a, [wEngineBuffer1] call CheckWaterfallTile jr nz, .headbutt farcall TryWaterfallOW jr .done .headbutt - ld a, [EngineBuffer1] + ld a, [wEngineBuffer1] call CheckHeadbuttTreeTile jr nz, .surf farcall TryHeadbuttOW @@ -161,7 +161,7 @@ CanUseSweetScent:: ; 97cfd jr nc, .no .ice_check - ld a, [PlayerStandingTile] + ld a, [wPlayerStandingTile] call CheckIceTile jr z, .no scf @@ -202,7 +202,7 @@ ChooseWildEncounter_BugContest:: ; 97d31 ; Species ld a, [hli] - ld [TempWildMonSpecies], a + ld [wTempWildMonSpecies], a ; Min level ld a, [hli] @@ -228,14 +228,14 @@ ChooseWildEncounter_BugContest:: ; 97d31 add d .GotLevel: - ld [CurPartyLevel], a + ld [wCurPartyLevel], a xor a ret ; 97d64 TryWildEncounter_BugContest: ; 97d64 - ld a, [PlayerStandingTile] + ld a, [wPlayerStandingTile] call CheckSuperTallGrassTile ld b, 40 percent jr z, .ok @@ -268,7 +268,7 @@ DoBikeStep:: ; 97db3 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 @@ CmdQueue_Type3: ; 97ef9 .IsPlayerFacingDown: ; 97f38 push bc - ld bc, PlayerStruct + ld bc, wPlayerStruct call GetSpriteDirection and a pop bc @@ -602,7 +602,7 @@ CmdQueue_Type3: ; 97ef9 ; 97f42 CmdQueue_StoneTable: ; 97f42 - ld de, PlayerStruct + ld de, wPlayerStruct ld a, NUM_OBJECT_STRUCTS .loop push af diff --git a/engine/evolution_animation.asm b/engine/evolution_animation.asm index fe5cec38f00..5b9623a296b 100755 --- a/engine/evolution_animation.asm +++ b/engine/evolution_animation.asm @@ -2,21 +2,21 @@ EvolutionAnimation: ; 4e5e1 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 @@ -49,13 +49,13 @@ EvolutionAnimation: ; 4e5e1 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 @@ EvolutionAnimation: ; 4e5e1 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 @@ EvolutionAnimation: ; 4e5e1 ld [wEvolutionCanceled], a ld a, [wEvolutionNewSpecies] - ld [PlayerHPPal], a + ld [wPlayerHPPal], a ld c, $0 call .GetSGBLayout @@ -114,18 +114,18 @@ EvolutionAnimation: ; 4e5e1 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 predef AnimateFrontpic pop af - ld [CurPartySpecies], a + ld [wCurPartySpecies], a pop af ld [wBoxAlignment], a ret @@ -138,7 +138,7 @@ EvolutionAnimation: ; 4e5e1 ld [wEvolutionCanceled], a ld a, [wEvolutionOldSpecies] - ld [PlayerHPPal], a + ld [wPlayerHPPal], a ld c, $0 call .GetSGBLayout @@ -147,7 +147,7 @@ EvolutionAnimation: ; 4e5e1 call .check_statused ret c - ld a, [PlayerHPPal] + ld a, [wPlayerHPPal] call PlayMonCry ret ; 4e703 @@ -258,8 +258,8 @@ EvolutionAnimation: ; 4e5e1 ; 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 @@ EvolutionAnimation: ; 4e5e1 inc a and $7 ld b, a - ld hl, Sprite01Attributes + ld hl, wSprite01Attributes ld c, NUM_SPRITE_OAM_STRUCTS .loop6 ld a, [hl] diff --git a/engine/evolve.asm b/engine/evolve.asm index 2e72320d445..5fb5aff4680 100755 --- 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 @@ EvolveAfterBattle: ; 421e6 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 @@ EvolveAfterBattle_MasterLoop 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 @@ EvolveAfterBattle_MasterLoop push hl xor a - ld [MonType], a + ld [wMonType], a predef CopyPkmnToTempMon pop hl @@ -89,7 +89,7 @@ EvolveAfterBattle_MasterLoop ; EVOLVE_STAT - ld a, [TempMonLevel] + ld a, [wTempMonLevel] cp [hl] jp c, .dont_evolve_1 @@ -97,8 +97,8 @@ EvolveAfterBattle_MasterLoop 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 @@ EvolveAfterBattle_MasterLoop .happiness - ld a, [TempMonHappiness] + ld a, [wTempMonHappiness] cp HAPPINESS_TO_EVOLVE jp c, .dont_evolve_2 @@ -132,13 +132,13 @@ EvolveAfterBattle_MasterLoop 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,19 +161,19 @@ EvolveAfterBattle_MasterLoop 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 .item ld a, [hli] ld b, a - ld a, [CurItem] + ld a, [wCurItem] cp b jp nz, .dont_evolve_3 @@ -189,15 +189,15 @@ EvolveAfterBattle_MasterLoop .level ld a, [hli] ld b, a - ld a, [TempMonLevel] + ld a, [wTempMonLevel] cp b jp c, .dont_evolve_3 call IsMonHoldingEverstone 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 @@ EvolveAfterBattle_MasterLoop 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 @@ EvolveAfterBattle_MasterLoop 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 @@ EvolveAfterBattle_MasterLoop 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,14 +278,14 @@ EvolveAfterBattle_MasterLoop 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 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 @@ EvolveAfterBattle_MasterLoop 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,14 +310,14 @@ EvolveAfterBattle_MasterLoop cp UNOWN jr nz, .skip_unown - ld hl, TempMonDVs + ld hl, wTempMonDVs predef GetUnownLetter callfar UpdateUnownDex .skip_unown pop de pop hl - ld a, [TempMonSpecies] + ld a, [wTempMonSpecies] ld [hl], a push hl ld l, e @@ -352,15 +352,15 @@ EvolveAfterBattle_MasterLoop ; 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 @@ UpdateSpeciesNameIfNotNicknamed: ; 42414 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 @@ CancelEvolution: ; 42454 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 @@ Text_WhatEvolving: ; 0x42482 LearnLevelMoves: ; 42487 ld a, [wd265] - ld [CurPartySpecies], a + ld [wCurPartySpecies], a dec a ld b, 0 ld c, a @@ -453,15 +453,15 @@ LearnLevelMoves: ; 42487 jr z, .done ld b, a - ld a, [CurPartyLevel] + ld a, [wCurPartyLevel] cp b ld a, [hli] jr nz, .find_move 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,21 +489,21 @@ LearnLevelMoves: ; 42487 jr .find_move .done - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] ld [wd265], a ret ; 424e1 FillMoves: ; 424e1 -; Fill in moves at de for CurPartySpecies at CurPartyLevel +; Fill in moves at de for wCurPartySpecies at wCurPartyLevel push hl push de push bc ld hl, EvosAttacksPointers ld b, 0 - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] dec a add a rl b @@ -527,7 +527,7 @@ FillMoves: ; 424e1 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 @@ FillMoves: ; 424e1 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 @@ EvoFlagAction: ; 42577 ; 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,14 +644,14 @@ GetPreEvolution: ; 42581 .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 .not_tyrogue inc hl - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp [hl] jr z, .found_preevo inc hl @@ -670,7 +670,7 @@ GetPreEvolution: ; 42581 .found_preevo inc c ld a, c - ld [CurPartySpecies], a + ld [wCurPartySpecies], a scf ret ; 425b1 diff --git a/engine/experience.asm b/engine/experience.asm index b1e1fb831e9..6b94ed3573d 100644 --- 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 @@ CalcLevel: ; 50e1b 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 @@ CalcLevel: ; 50e1b 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 diff --git a/engine/health.asm b/engine/health.asm index 0f7ba156d9f..cc47e825222 100755 --- 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 @@ HealParty: ; c658 pop hl .next - ld a, [CurPartyMon] + ld a, [wCurPartyMon] inc a - ld [CurPartyMon], a + ld [wCurPartyMon], a jr .loop .done diff --git a/engine/init_gender.asm b/engine/init_gender.asm index 76b1640d99d..945e9f61fc4 100755 --- a/engine/init_gender.asm +++ b/engine/init_gender.asm @@ -65,11 +65,11 @@ TextJump_AreYouABoyOrAreYouAGirl: ; 0x48e0f 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 @@ InitGenderScreen: ; 48e14 (12:4e14) 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 diff --git a/engine/init_hof_credits.asm b/engine/init_hof_credits.asm index d8eb7670aa8..e8e98a0e1b4 100644 --- a/engine/init_hof_credits.asm +++ b/engine/init_hof_credits.asm @@ -9,7 +9,7 @@ InitDisplayForHallOfFame: ; 4e881 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 @@ InitDisplayForRedCredits: ; 4e8c2 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 diff --git a/engine/init_map.asm b/engine/init_map.asm index 0ea2379d232..2eb4998a6c0 100644 --- a/engine/init_map.asm +++ b/engine/init_map.asm @@ -16,7 +16,7 @@ ReanchorBGMap_NoOAMUpdate:: ; 6454 ld [hBGMapMode], a pop af ld [hOAMUpdate], a - ld hl, VramState + ld hl, wVramState set 6, [hl] ret diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index 59aebd4d5d4..00c09aa304c 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -78,7 +78,7 @@ NewGame: ; 5b6b ld [wPreviousLandmark], a ld a, SPAWN_HOME - ld [DefaultSpawnpoint], a + ld [wDefaultSpawnpoint], a ld a, MAPSETUP_WARP ld [hMapEntryMethod], a @@ -107,7 +107,7 @@ ResetWRAM: ; 5ba7 _ResetWRAM: ; 5bae ld hl, wVirtualOAM - ld bc, Options - wVirtualOAM + ld bc, wOptions - wVirtualOAM xor a call ByteFill @@ -125,13 +125,13 @@ _ResetWRAM: ; 5bae 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 @@ _ResetWRAM: ; 5bae call Random ld [wSecretID + 1], a - ld hl, PartyCount + ld hl, wPartyCount call .InitList xor a @@ -154,16 +154,16 @@ _ResetWRAM: ; 5bae 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,7 +191,7 @@ _ResetWRAM: ; 5bae call InitializeMagikarpHouse xor a - ld [MonType], a + ld [wMonType], a ld [wJohtoBadges], a ld [wKantoBadges], a @@ -202,16 +202,16 @@ _ResetWRAM: ; 5bae 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 @@ InitializeMagikarpHouse: ; 5cd3 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 @@ InitializeWorld: ; 5d23 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 @@ Continue: ; 5d65 .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,14 +397,14 @@ Continue: ; 5d65 .SpawnAfterE4: ld a, SPAWN_NEW_BARK - ld [DefaultSpawnpoint], a + ld [wDefaultSpawnpoint], a call PostCreditsSpawn jp FinishContinueFunction ; 5de2 SpawnAfterRed: ; 5de2 ld a, SPAWN_MT_SILVER - ld [DefaultSpawnpoint], a + ld [wDefaultSpawnpoint], a ; 5de7 PostCreditsSpawn: ; 5de7 @@ -425,22 +425,22 @@ Continue_MobileAdapterMenu: ; 5df0 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 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 @@ Continue_DisplayPokedexNumCaught: ; 5f6b 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 @@ endc ; 5f84 Continue_DisplayGameTime: ; 5f84 - ld de, GameTimeHours + ld de, wGameTimeHours lb bc, 2, 3 call PrintNum ld [hl], "" inc hl - ld de, GameTimeMinutes + ld de, wGameTimeMinutes lb bc, PRINTNUM_LEADINGZEROS | 1, 2 jp PrintNum ; 5f99 @@ -679,9 +679,9 @@ OakSpeech: ; 0x5f99 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,16 +694,16 @@ OakSpeech: ; 0x5f99 call ClearTileMap ld a, WOOPER - ld [CurSpecies], a - ld [CurPartySpecies], a + ld [wCurSpecies], a + ld [wCurPartySpecies], a call GetBaseData hlcoord 6, 4 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 @@ OakSpeech: ; 0x5f99 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 @@ OakSpeech: ; 0x5f99 call ClearTileMap xor a - ld [CurPartySpecies], a + ld [wCurPartySpecies], a farcall DrawIntroPlayerPic ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS @@ -792,7 +792,7 @@ NamePlayer: ; 0x6074 .NewName: ld b, 1 - ld de, PlayerName + ld de, wPlayerName farcall NamingScreen call RotateThreePalettesRight @@ -802,14 +802,14 @@ NamePlayer: ; 0x6074 call WaitBGMap xor a - ld [CurPartySpecies], a + ld [wCurPartySpecies], a farcall DrawIntroPlayerPic ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS call GetSGBLayout call RotateThreePalettesLeft - ld hl, PlayerName + ld hl, wPlayerName ld de, .Chris ld a, [wPlayerGender] bit 0, a @@ -838,10 +838,10 @@ Unreferenced_Function60e9: 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 @@ ShrinkPlayer: ; 610f 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 @@ Intro_PlacePlayerSprite: ; 61cd ld hl, vTiles0 call Request2bpp - ld hl, Sprite01 + ld hl, wSprite01 ld de, .sprites ld a, [de] inc de @@ -1097,7 +1097,7 @@ Unreferenced_Function6292: ; 6292 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 @@ TitleScreenEntrance: ; 62bc ; 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 @@ TitleScreenEntrance: ; 62bc 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 @@ TitleScreenMain: ; 6304 ; 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 @@ TitleScreenEnd: ; 6375 ld hl, wTitleScreenTimer inc [hl] - ld a, [MusicFade] + ld a, [wMusicFade] and a ret nz @@ -1333,7 +1333,7 @@ Unreferenced_Function639b: 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] diff --git a/engine/item_effects.asm b/engine/item_effects.asm index 72b1f4d2794..114b2cb7086 100644 --- 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 @@ ParkBall: ; e8a2 dec a jp nz, UseBallInTrainerBattle - ld a, [PartyCount] + ld a, [wPartyCount] cp PARTY_LENGTH jr nz, .room_in_party @@ -227,24 +227,24 @@ ParkBall: ; e8a2 .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 @@ ParkBall: ; e8a2 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 @@ ParkBall: ; e8a2 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 @@ ParkBall: ; e8a2 ; 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 @@ ParkBall: ; e8a2 ; Uncomment the line below to fix. - ld a, [BattleMonItem] + ld a, [wBattleMonItem] ; ld b, a farcall GetItemHeldEffect ld a, b @@ -383,7 +383,7 @@ ParkBall: ; e8a2 .skip_hp_calc ld b, a - ld [Buffer1], a + ld [wBuffer1], a call Random cp b @@ -392,14 +392,14 @@ ParkBall: ; e8a2 jr nc, .fail_to_catch .catch_without_fail - ld a, [EnemyMonSpecies] + ld a, [wEnemyMonSpecies] .fail_to_catch ld [wWildMon], a 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,19 +408,19 @@ ParkBall: ; e8a2 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 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 @@ ParkBall: ; e8a2 jp z, .shake_and_break_free .caught - ld hl, EnemyMonStatus + ld hl, wEnemyMonStatus ld a, [hli] push af inc hl @@ -444,44 +444,44 @@ ParkBall: ; e8a2 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] ; 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 .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 @@ ParkBall: ; e8a2 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 @@ ParkBall: ; e8a2 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,25 +559,25 @@ ParkBall: ; e8a2 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 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,17 +588,17 @@ ParkBall: ; e8a2 ld hl, Text_AskNicknameNewlyCaughtMon call PrintText - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] ld [wd265], a call GetPokemonName 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 @@ ParkBall: ; e8a2 ld e, l push de xor a ; PARTYMON - ld [MonType], a + ld [wMonType], a ld b, 0 farcall NamingScreen @@ -615,7 +615,7 @@ ParkBall: ; e8a2 call LoadStandardFont pop hl - ld de, StringBuffer1 + ld de, wStringBuffer1 call InitName jp .return_from_capture @@ -636,7 +636,7 @@ ParkBall: ; e8a2 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 @@ ParkBall: ; e8a2 ld hl, Text_AskNicknameNewlyCaughtMon call PrintText - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] ld [wd265], a call GetPokemonName @@ -656,9 +656,9 @@ ParkBall: ; e8a2 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 @@ ParkBall: ; e8a2 call CopyBytes ld hl, sBoxMonNicknames - ld de, StringBuffer1 + ld de, wStringBuffer1 call InitName call CloseSRAM @@ -707,7 +707,7 @@ ParkBall: ; e8a2 call ClearSprites .return_from_capture - ld a, [BattleType] + ld a, [wBattleType] cp BATTLETYPE_TUTORIAL ret z cp BATTLETYPE_DEBUG @@ -723,7 +723,7 @@ ParkBall: ; e8a2 call ClearTileMap .toss - ld hl, NumItems + ld hl, wNumItems inc a ld [wItemQuantityChangeBuffer], a jp TossItem @@ -772,7 +772,7 @@ ParkBallMultiplier: GetPokedexEntryBank: push hl push de - ld a, [EnemyMonSpecies] + ld a, [wEnemyMonSpecies] rlca rlca maskbits NUM_DEX_ENTRY_BANKS @@ -797,7 +797,7 @@ HeavyBallMultiplier: ; 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 @@ HeavyBallMultiplier: 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 EvosAttacks GLOBAL EvosAttacksPointers push bc - ld a, [TempEnemyMonSpecies] + ld a, [wTempEnemyMonSpecies] dec a ld c, a ld b, 0 @@ -965,20 +965,20 @@ LoveBallMultiplier: ; 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 @@ LoveBallMultiplier: ; 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 @@ FastBallMultiplier: ; 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 @@ LevelBallMultiplier: ; 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 @@ Calcium: ; ee3d 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 @@ StatStrings: ; eeab GetStatExpRelativePointer: ; eed9 - ld a, [CurItem] + ld a, [wCurItem] ld hl, Table_eeeb .next cp [hl] @@ -1342,16 +1342,16 @@ Table_eeeb: ; eeeb 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 @@ RareCandy: ; ef14 inc a ld [hl], a - ld [CurPartyLevel], a + ld [wCurPartyLevel], a push de ld d, a farcall CalcExpAtLevel @@ -1421,7 +1421,7 @@ RareCandy: ; ef14 call ItemActionText xor a ; PARTYMON - ld [MonType], a + ld [wMonType], a predef CopyPkmnToTempMon hlcoord 9, 0 @@ -1436,8 +1436,8 @@ RareCandy: ; ef14 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 @@ UseStatusHealer: ; efda (3:6fda) 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 @@ UseStatusHealer: ; efda (3:6fda) 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,25 +1541,25 @@ BattlemonRestoreHealth: ; f01e (3:701e) 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) 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 @@ HealStatus: ; f030 (3:7030) GetItemHealingAction: ; f058 (3:7058) push hl - ld a, [CurItem] + ld a, [wCurItem] ld hl, StatusHealingActions ld bc, 3 .next @@ -1640,7 +1640,7 @@ RevivePokemon: ; f0d6 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 @@ RevivePokemon: ; f0d6 and a jr z, .skip_to_revive - ld a, [CurPartyMon] + ld a, [wCurPartyMon] ld c, a ld hl, wBattleParticipantsNotFainted ld b, SET_FLAG @@ -1659,7 +1659,7 @@ RevivePokemon: ; f0d6 .skip_to_revive xor a ld [wLowHealthAlarm], a - ld a, [CurItem] + ld a, [wCurItem] cp REVIVE jr z, .revive_half_hp @@ -1672,7 +1672,7 @@ RevivePokemon: ; f0d6 .finish_revive call HealHP_SFX_GFX ld a, PARTYMENUTEXT_REVIVE - ld [PartyMenuActionText], a + ld [wPartyMenuActionText], a call ItemActionTextWaitButton call UseDisposableItem ld a, 0 @@ -1712,7 +1712,7 @@ FullRestore: ; f128 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 @@ FullRestore: ; f128 BitterBerry: ; f16a - ld hl, PlayerSubStatus3 + ld hl, wPlayerSubStatus3 bit SUBSTATUS_CONFUSED, [hl] ld a, 1 jr z, .done @@ -1804,7 +1804,7 @@ ItemRestoreHP: ; f1a9 (3:71a9) 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 @@ HealHP_SFX_GFX: ; f1db (3:71db) 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 @@ UseItem_SelectMon: ; f1f9 (3:71f9) call .SelectMon ret c - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp EGG jr nz, .not_egg @@ -1841,7 +1841,7 @@ UseItem_SelectMon: ; f1f9 (3:71f9) .SelectMon: ; f20b (3:720b) ld a, b - ld [PartyMenuActionText], a + ld [wPartyMenuActionText], a push hl push de push bc @@ -1865,10 +1865,10 @@ ChoosePkmnToUseItemOn: ; f21c (3:721c) 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,19 +1882,19 @@ ItemActionText: ; f24a (3:724a) 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) 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 @@ IsItemUsedOnBattleMon: ; f2a6 (3:72a6) 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 @@ LoadCurHPIntoBuffer5: ; f328 (3:7328) 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 @@ LoadCurHPToBuffer3: ; f348 (3:7348) 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 @@ LoadMaxHPToBuffer1: ; f35f (3:735f) 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 @@ GetOneFifthMaxHP: ; f378 (3:7378) GetHealingItemAmount: ; f395 (3:7395) push hl - ld a, [CurItem] + ld a, [wCurItem] ld hl, HealingHPAmounts ld d, a .next @@ -2127,7 +2127,7 @@ Softboiled_MilkDrinkFunction: ; f3df (3:73df) 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 @@ Softboiled_MilkDrinkFunction: ; f3df (3:73df) 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 @@ Softboiled_MilkDrinkFunction: ; f3df (3:73df) .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 @@ Softboiled_MilkDrinkFunction: ; f3df (3:73df) 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 @@ TextJump_RepelUsedEarlierIsStillInEffect: ; 0xf47d 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 @@ PokeDoll: ; f48f GuardSpec: ; f4ab - ld hl, PlayerSubStatus4 + ld hl, wPlayerSubStatus4 bit SUBSTATUS_MIST, [hl] jp nz, WontHaveAnyEffect_NotUsedMessage set SUBSTATUS_MIST, [hl] @@ -2273,7 +2273,7 @@ GuardSpec: ; f4ab 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 @@ XSpeed: XSpecial: ; f4c5 call UseItemText - ld a, [CurItem] + ld a, [wCurItem] ld hl, XItemStats .loop @@ -2302,16 +2302,16 @@ XSpecial: ; f4c5 ld b, [hl] xor a ld [hBattleTurn], a - ld [AttackMissed], a - ld [EffectFailed], a + ld [wAttackMissed], a + ld [wEffectFailed], a farcall CheckIfStatCanBeRaised call WaitSFX 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 @@ PokeFlute: ; f50c 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 @@ -2471,7 +2471,7 @@ Ether: MaxEther: Elixer: Mysteryberry: ; f5bf - ld a, [CurItem] + ld a, [wCurItem] ld [wd002], a .loop @@ -2496,19 +2496,19 @@ Mysteryberry: ; f5bf .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 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 @@ BattleRestorePP: ; f652 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 @@ BattleRestorePP: ; f652 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 @@ BattleRestorePP: ; f652 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 @@ Elixer_RestorePPofAllMoves: ; f6af 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 @@ PPRestoreItem_Cancel: ; f6e0 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 @@ UseItemText: ; f789 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 @@ UseBallInTrainerBattle: ; f7a0 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 @@ ApplyPPUp: ; f84c 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 @@ RestoreAllPP: ; f8b9 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 @@ RestoreAllPP: ; f8b9 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 @@ GetMaxPPOfMove: ; f8ec 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 @@ GetMaxPPOfMove: ; f8ec pop bc or b - ld hl, StringBuffer1 + 1 + ld hl, wStringBuffer1 + 1 ld [hl], a xor a ld [wd265], a @@ -3252,14 +3252,14 @@ GetMaxPPOfMove: ; f8ec 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 diff --git a/engine/items.asm b/engine/items.asm index 503a76c6bcb..7246d560968 100755 --- a/engine/items.asm +++ b/engine/items.asm @@ -27,13 +27,13 @@ _ReceiveItem:: ; d1d5 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 @@ _TossItem:: ; d20d 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 @@ _CheckItem:: ; d244 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 @@ _CheckItem:: ; d244 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 @@ PutItemInPocket: ; d29c 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 @@ PutItemInPocket: ; d29c .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 @@ PutItemInPocket: ; d29c .terminator2 dec hl - ld a, [CurItem] + ld a, [wCurItem] ld [hli], a ld a, [wItemQuantityBuffer] ld [hli], a @@ -233,14 +233,14 @@ RemoveItemFromPocket: ; d2ff ld e, l ld a, [hli] ld c, a - ld a, [CurItemQuantity] + ld a, [wCurItemQuantity] cp c jr nc, .ok ; memory ld c, a 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 @@ RemoveItemFromPocket: ; d2ff inc hl .ok - ld a, [CurItem] + ld a, [wCurItem] ld b, a .loop ld a, [hli] @@ -294,7 +294,7 @@ RemoveItemFromPocket: ; d2ff ret CheckTheItem: ; d349 - ld a, [CurItem] + ld a, [wCurItem] ld c, a .loop inc hl @@ -311,17 +311,17 @@ CheckTheItem: ; d349 ret ReceiveKeyItem: ; d35a - ld hl, NumKeyItems + ld hl, wNumKeyItems ld a, [hli] cp MAX_KEY_ITEMS jr nc, .nope 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 @@ ReceiveKeyItem: ; d35a 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 @@ TossKeyItem: ; d374 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 @@ TossKeyItem: ; d374 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 @@ CheckKeyItems: ; d3b1 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 @@ ReceiveTMHM: ; d3c4 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 @@ TossTMHM: ; d3d8 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 @@ GetNumberedTMHM: ; d417 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 @@ _CheckTossableItem:: ; d427 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 @@ CheckSelectableItem: ; d432 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 @@ CheckItemPocket:: ; d43d 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 @@ CheckItemContext: ; d448 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 @@ CheckItemMenu: ; d453 ret GetItemAttr: ; d460 -; Get attribute a of CurItem. +; Get attribute a of wCurItem. push hl push bc @@ -545,7 +545,7 @@ GetItemAttr: ; d460 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 @@ ItemAttr_ReturnCarry: ; d47f 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 diff --git a/engine/landmarks.asm b/engine/landmarks.asm index 452bd2e927d..f16f48e6737 100644 --- a/engine/landmarks.asm +++ b/engine/landmarks.asm @@ -16,7 +16,7 @@ GetLandmarkCoords: ; 0x1ca896 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 @@ GetLandmarkName:: ; 0x1ca8a5 ld h, [hl] ld l, a - ld de, StringBuffer1 + ld de, wStringBuffer1 ld c, 18 .copy ld a, [hli] @@ -54,9 +54,9 @@ RegionCheck: ; 0x1caea1 ; 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 @@ RegionCheck: ; 0x1caea1 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 diff --git a/engine/learn.asm b/engine/learn.asm index 2f1038d7fa3..54ec8f6bb91 100755 --- 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 @@ LearnMove: ; 6508 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 @@ LearnMove: ; 6508 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 @@ ForgetMove: ; 65d3 call TextBox hlcoord 5 + 2, 2 + 2 ld a, SCREEN_WIDTH * 2 - ld [Buffer1], a + ld [wBuffer1], a predef ListMoves ; wMenuData3 ld a, $4 diff --git a/engine/link.asm b/engine/link.asm index 86a593284d1..59d1a149a5f 100755 --- a/engine/link.asm +++ b/engine/link.asm @@ -73,13 +73,13 @@ TimeCapsule: ; 2805d 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 @@ TimeCapsule: ; 2805d 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 @@ TimeCapsule: ; 2805d 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 @@ TimeCapsule: ; 2805d 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 @@ Gen2ToGen2LinkComms: ; 28177 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 @@ Gen2ToGen2LinkComms: ; 28177 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 @@ Gen2ToGen2LinkComms: ; 28177 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 @@ Gen2ToGen2LinkComms: ; 28177 .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 @@ Gen2ToGen2LinkComms: ; 28177 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 @@ Gen2ToGen2LinkComms: ; 28177 pop af ld [wDisableTextAcceleration], a pop af - ld [Options], a + ld [wOptions], a farcall LoadPokemonData jp Function28b22 @@ -568,12 +568,12 @@ ClearLinkData: ; 28426 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 @@ Link_PrepPartyData_Gen1: ; 28499 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 @@ Link_PrepPartyData_Gen1: ; 28499 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 @@ Link_PrepPartyData_Gen1: ; 28499 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 @@ Link_PrepPartyData_Gen1: ; 28499 add hl, bc ld a, [hl] ld [de], a - ld [CurPartyLevel], a + ld [wCurPartyLevel], a inc de push bc @@ -783,7 +783,7 @@ Link_PrepPartyData_Gen1: ; 28499 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 @@ Link_PrepPartyData_Gen2: ; 28595 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 @@ Function2868a: ; 2868a 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 @@ Function2868a: ; 2868a 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 @@ Function2868a: ; 2868a 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 @@ Function2868a: ; 2868a 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 @@ Link_CopyRandomNumbers: ; 287ab 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 @@ InitTradeMenuDisplay: ; 287e3 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 @@ LinkTradeOTPartymonMenuLoop: ; 28835 ld a, INIT_ENEMYOT_LIST ld [wInitListType], a callfar InitList - ld hl, OTPartyMon1Species + ld hl, wOTPartyMon1Species farcall LinkMonStatsScreen jp LinkTradePartiesMenuMasterLoop @@ -1247,11 +1247,11 @@ LinkTradeOTPartymonMenuLoop: ; 28835 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 @@ LinkTradeOTPartymonMenuLoop: ; 28835 ld [hl], " " pop bc pop hl - ld a, [PartyCount] + ld a, [wPartyCount] ld [wMenuCursorY], a jr LinkTrade_PlayerPartyMenu @@ -1273,10 +1273,10 @@ LinkTradeOTPartymonMenuLoop: ; 28835 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 @@ LinkTradePartymonMenuLoop: ; 288c5 dec a jp nz, LinkTradePartiesMenuMasterLoop ld a, OTPARTYMON - ld [MonType], a + ld [wMonType], a call HideCursor push hl push bc @@ -1331,7 +1331,7 @@ LinkTradePartymonMenuLoop: ; 288c5 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 @@ LinkTradePartymonMenuLoop: ; 288c5 ; 2891c LinkTradePartiesMenuMasterLoop: ; 2891c - ld a, [MonType] + ld a, [wMonType] and a jp z, LinkTradePartymonMenuLoop ; PARTYMON jp LinkTradeOTPartymonMenuLoop ; OTPARTYMON @@ -1480,7 +1480,7 @@ Function28926: ; 28926 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 @@ Function28ade: ; 28ade pop af bit D_UP_F, a jr z, .d_up - ld a, [OTPartyCount] + ld a, [wOTPartyCount] ld [wMenuCursorY], a jp LinkTrade_OTPartyMenu @@ -1648,19 +1648,19 @@ LinkTrade: ; 28b87 call LinkTextboxAtHL farcall Link_WaitBGMap ld a, [wd002] - ld hl, PartySpecies + ld hl, wPartySpecies ld c, a ld b, 0 add hl, bc 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 @@ LinkTrade: ; 28b87 .asm_28ca6 ld hl, sPartyMail - ld a, [PartyCount] + ld a, [wPartyCount] dec a ld bc, MAIL_STRUCT_LENGTH call AddNTimes @@ -1776,12 +1776,12 @@ LinkTrade: ; 28b87 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,19 +1789,19 @@ LinkTrade: ; 28b87 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] 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,38 +1809,38 @@ LinkTrade: ; 28b87 ld a, [hl] ld [wPlayerTrademonDVs + 1], a ld a, [wd002] - ld hl, PartyMon1Species + ld hl, wPartyMon1Species call GetPartyLocation ld b, h ld c, l 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 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] 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 @@ LinkTrade: ; 28b87 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 @@ LinkTrade: ; 28b87 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 @@ LinkTrade: ; 28b87 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 @@ LinkTrade: ; 28b87 .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,14 +1924,14 @@ LinkTrade: ; 28b87 ld c, a cp MEW jr z, .loop - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp MEW jr z, .loop ld b, $2 ld a, c cp CELEBI jr z, .loop - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp CELEBI jr z, .loop ld b, $0 @@ -2032,14 +2032,14 @@ Unreferenced_Function28f09: ; 28f09 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 ; 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 @@ Special_CheckTimeCapsuleCompatibility: ; 29bfb ; 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 @@ Special_CheckTimeCapsuleCompatibility: ; 29bfb 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 @@ Special_CheckTimeCapsuleCompatibility: ; 29bfb 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 @@ Special_CheckTimeCapsuleCompatibility: ; 29bfb 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 @@ Special_WaitForLinkedFriend: ; 29d11 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 @@ Special_CheckLinkTimeout: ; 29d92 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 @@ Function29dba: ; 29dba 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 @@ Function29dba: ; 29dba .script_var xor a - ld [ScriptVar], a + ld [wScriptVar], a ret .vblank @@ -2382,7 +2382,7 @@ Link_CheckCommunicationError: ; 29e0c ld a, $1 .load_scriptvar - ld [ScriptVar], a + ld [wScriptVar], a ld hl, wLinkTimeoutFrames xor a ld [hli], a @@ -2435,7 +2435,7 @@ Special_TryQuickSave: ; 29e66 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 @@ Special_CheckBothSelectedSameRoom: ; 29e82 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 @@ Special_CableClubCheckWhichChris: ; 29f47 dec a ; FALSE .yes - ld [ScriptVar], a + ld [wScriptVar], a ret ; 29f54 diff --git a/engine/link_2.asm b/engine/link_2.asm index 866126cd232..e2fe47dc589 100644 --- 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 @@ LinkTextbox2: ; 4d35b pop hl pop bc - ld de, AttrMap - TileMap + ld de, wAttrMap - wTileMap add hl, de inc b inc b diff --git a/engine/link_trade.asm b/engine/link_trade.asm index 504dc6d954b..bb342305125 100755 --- a/engine/link_trade.asm +++ b/engine/link_trade.asm @@ -52,7 +52,7 @@ _LinkTextbox: ; 16d61d pop hl pop bc - ld de, AttrMap - TileMap + ld de, wAttrMap - wTileMap add hl, de inc b inc b diff --git a/engine/load_font.asm b/engine/load_font.asm index 345fa6ff6ac..40dbb9c10e4 100644 --- a/engine/load_font.asm +++ b/engine/load_font.asm @@ -81,7 +81,7 @@ _LoadFontsBattleExtra:: ; fb4be ; fb4cc LoadFrame: ; fb4cc - ld a, [TextBoxFrame] + ld a, [wTextBoxFrame] maskbits NUM_FRAMES ld bc, 6 * LEN_1BPP_TILE ld hl, Frames diff --git a/engine/load_pics.asm b/engine/load_pics.asm index 5d3becf422c..0558fb7f7d9 100755 --- 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 @@ GetUnownLetter: ; 51040 ; 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 @@ GetMonFrontpic: ; 51077 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 @@ GetAnimatedFrontpic: ; 5108b _GetFrontpic: ; 510a5 push de call GetBaseData - ld a, [BasePicSize] + ld a, [wBasePicSize] and $f ld b, a push bc @@ -105,15 +105,15 @@ _GetFrontpic: ; 510a5 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 @@ GetAnimatedEnemyFrontpic: ; 51103 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 @@ LoadFrontpicTiles: ; 5114f 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 @@ Function511ec: ; 511ec ret GetTrainerPic: ; 5120d - ld a, [TrainerClass] + ld a, [wTrainerClass] and a ret z cp NUM_TRAINER_CLASSES @@ -320,7 +320,7 @@ GetTrainerPic: ; 5120d xor a ld [hBGMapMode], a ld hl, TrainerPicPointers - ld a, [TrainerClass] + ld a, [wTrainerClass] dec a ld bc, 3 call AddNTimes diff --git a/engine/mail.asm b/engine/mail.asm index 68b16fd10d1..c1a2db5aa60 100755 --- a/engine/mail.asm +++ b/engine/mail.asm @@ -12,7 +12,7 @@ SendMailToPC: ; 4456e 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 @@ MoveMailFromPCToParty: ; 44607 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 @@ MoveMailFromPCToParty: ; 44607 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 @@ CheckPokeItem:: ; 44654 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 @@ CheckPokeItem:: ; 44654 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 @@ CheckPokeItem:: ; 44654 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 @@ GivePokeItem:: ; 446cc 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 @@ GivePokeItem:: ; 446cc 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 @@ DeletePartyMonMail: ; 44765 (11:4765) 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 @@ MailboxPC_GetMailAuthor: ; 0x447da 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_GetMailAuthor: ; 0x447da MailboxPC_PrintMailAuthor: ; 0x447fb push de - ld a, [MenuSelection] + ld a, [wMenuSelection] call MailboxPC_GetMailAuthor pop hl jp PlaceString @@ -439,7 +439,7 @@ MailboxPC: ; 0x44806 .ReadMail: ; 0x44869 call FadeToMenu - ld a, [MenuSelection] + ld a, [wMenuSelection] dec a ld b, a call ReadMailMessage @@ -452,19 +452,19 @@ MailboxPC: ; 0x44806 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 jp MenuTextBoxBackup .put_in_bag - ld a, [MenuSelection] + ld a, [wMenuSelection] dec a ld b, a call DeleteMailFromPC @@ -493,14 +493,14 @@ MailboxPC: ; 0x44806 ld bc, MAIL_STRUCT_LENGTH call AddNTimes ld a, [hl] - ld [CurItem], a + ld [wCurItem], a jp CloseSRAM ; 0x448d2 .AttachMail: ; 0x448d2 call FadeToMenu xor a - ld [PartyMenuActionText], a + ld [wPartyMenuActionText], a call ClearBGPalettes .try_again farcall LoadPartyMenuGFX @@ -513,7 +513,7 @@ MailboxPC: ; 0x44806 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 @@ MailboxPC: ; 0x44806 jr .try_again .attach_mail - ld a, [MenuSelection] + ld a, [wMenuSelection] dec a ld b, a call MoveMailFromPCToParty diff --git a/engine/mail_2.asm b/engine/mail_2.asm index 4450063a4eb..6e326641bcf 100755 --- 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 @@ ReadAnyMail: ; b9237 call .LoadGFX call EnableLCD call WaitBGMap - ld a, [Buffer3] + ld a, [wBuffer3] ld e, a farcall LoadMailPalettes call SetPalettes @@ -74,11 +74,11 @@ ReadAnyMail: ; b9237 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 @@ ReadAnyMail: ; b9237 .got_pointer ld a, c - ld [Buffer3], a + ld [wBuffer3], a ld a, [hli] ld h, [hl] ld l, a @@ -567,7 +567,7 @@ LoadPortraitMailGFX: ; b96ca 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 @@ MailGFX_PlaceMessage: ; b9803 ld a, [de] and a ret z - ld a, [Buffer3] + ld a, [wBuffer3] hlcoord 8, 14 cp $3 ; PORTRAITMAIL jr z, .place_author diff --git a/engine/main_menu.asm b/engine/main_menu.asm index f82c6072aa3..9d3d8cbdbe2 100755 --- a/engine/main_menu.asm +++ b/engine/main_menu.asm @@ -20,7 +20,7 @@ MainMenu: ; 49cdc call CloseWindow jr c, .quit call ClearTileMap - ld a, [MenuSelection] + ld a, [wMenuSelection] ld hl, .Jumptable rst JumpTable jr MainMenu @@ -225,13 +225,13 @@ MainMenu_PrintCurrentTimeAndDay: ; 49e09 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 diff --git a/engine/map_object_action.asm b/engine/map_object_action.asm index ec5ad887edb..c82cd80a220 100755 --- a/engine/map_object_action.asm +++ b/engine/map_object_action.asm @@ -263,7 +263,7 @@ SetFacingBigDollAsym: ; 45be ; 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 diff --git a/engine/map_objects.asm b/engine/map_objects.asm index 0dbdf5e7059..85e5ccb23d2 100644 --- a/engine/map_objects.asm +++ b/engine/map_objects.asm @@ -40,7 +40,7 @@ Function437b: ; 437b 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 @@ Function437b: ; 437b 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 @@ Function437b: ; 437b 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 @@ Function437b: ; 437b 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 @@ asm_4448 ; 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 @@ DespawnEmote: ; 5579 ret .DeleteEmote: - ld de, ObjectStructs + ld de, wObjectStructs ld a, NUM_OBJECT_STRUCTS .loop push af @@ -2223,10 +2223,10 @@ CopyTempObjectData: ; 55b9 ; 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 @@ Function5629: ; 5629 Function5645: ; 5645 xor a - ld bc, ObjectStructs + ld bc, wObjectStructs .loop ld [hMapObjectIndexBuffer], a call SetFacing_Standing @@ -2359,7 +2359,7 @@ Function56a3: ; 56a3 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 @@ Function56a3: ; 56a3 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 @@ HandleNPCStep:: ; 576a ret .DoStepsForAllObjects: - ld bc, ObjectStructs + ld bc, wObjectStructs xor a .loop ld [hMapObjectIndexBuffer], a @@ -2533,7 +2533,7 @@ RefreshPlayerSprite: ; 579d 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 @@ RefreshPlayerSprite: ; 579d .ok ld a, OBJECT_ACTION_00 - ld [PlayerAction], a + ld [wPlayerAction], a ret ; 57ca @@ -2567,7 +2567,7 @@ RefreshPlayerSprite: ; 579d SpawnInFacingDown: ; 57d9 ld a, 0 ContinueSpawnFacing: ; 57db - ld bc, PlayerStruct + ld bc, wPlayerStruct call SetSpriteDirection ret ; 57e2 @@ -2586,7 +2586,7 @@ SetPlayerPalette: ; 57e2 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 @@ Function586e: ; 586e ; 587a Function587a: ; 587a - ld bc, ObjectStructs + ld bc, wObjectStructs xor a .loop push af @@ -2726,7 +2726,7 @@ _SetFlagsForMovement_2:: ; 5897 Function58b9:: ; 58b9 push bc - ld bc, ObjectStructs + ld bc, wObjectStructs xor a .loop push af @@ -2803,7 +2803,7 @@ Function5903: ; 5903 ; 5920 _UpdateSprites:: ; 5920 - ld a, [VramState] + ld a, [wVramState] bit 0, a ret z xor a @@ -2819,9 +2819,9 @@ _UpdateSprites:: ; 5920 ret .fill - ld a, [VramState] + ld a, [wVramState] bit 1, a - ld b, LOW(SpritesEnd) + ld b, LOW(wSpritesEnd) jr z, .ok ld b, 28 * SPRITEOAMSTRUCT_LENGTH .ok @@ -2849,7 +2849,7 @@ ApplyBGMapAnchorToObjects: ; 5958 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 @@ InitSprites: ; 5991 ld bc, NUM_OBJECT_STRUCTS call ByteFill ld d, 0 - ld bc, ObjectStructs + ld bc, wObjectStructs ld hl, wMovementPointer .loop push hl @@ -3047,7 +3047,7 @@ InitSprites: ; 5991 ld a, [hli] ld [hUsedSpriteTile], a add c - cp LOW(SpritesEnd) + cp LOW(wSpritesEnd) jr nc, .full .addsprite ld a, [hFFC0] @@ -3107,17 +3107,17 @@ InitSprites: ; 5991 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 diff --git a/engine/map_objects_2.asm b/engine/map_objects_2.asm index 3c9a9773c4c..038e2b49bcb 100644 --- a/engine/map_objects_2.asm +++ b/engine/map_objects_2.asm @@ -4,7 +4,7 @@ LoadObjectMasks: ; 2454f ld bc, NUM_OBJECTS call ByteFill nop - ld bc, MapObjects + ld bc, wMapObjects ld de, wObjectMasks xor a .loop diff --git a/engine/map_palettes.asm b/engine/map_palettes.asm index ffeef7bf6e5..f8e23e0580c 100644 --- 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 @@ SwapTextboxPalettes:: ; 4c000 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 @@ SwapTextboxPalettes:: ; 4c000 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 @@ SwapTextboxPalettes:: ; 4c000 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 @@ ScrollBGMapPalettes:: ; 4c03f 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 @@ ScrollBGMapPalettes:: ; 4c03f 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] diff --git a/engine/map_setup.asm b/engine/map_setup.asm index b3905b71e14..1cd660f86d9 100644 --- a/engine/map_setup.asm +++ b/engine/map_setup.asm @@ -172,12 +172,12 @@ CheckReplaceKrisSprite: ; 154f7 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 @@ CheckReplaceKrisSprite: ; 154f7 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 @@ CheckReplaceKrisSprite: ; 154f7 .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 @@ RetainOldPalettes: ; 1556d 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 diff --git a/engine/mapgroup_roofs.asm b/engine/mapgroup_roofs.asm index 2cd73423407..58e5e7cfe7f 100644 --- 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 diff --git a/engine/mart.asm b/engine/mart.asm index d4c0b623b32..84888eccc59 100755 --- 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 @@ OpenMartDialog:: ; 15a45 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 @@ INCLUDE "data/items/rooftop_sale.asm" 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 @@ GetMart: ; 15b31 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 @@ StandardMart: ; 15b47 ; 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 @@ FarReadMart: ; 15bbb 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 @@ FarReadMart: ; 15bbb ; 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 @@ GetMartPrice: ; 15bf0 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 @@ ReadMart: ; 15c25 ; 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 @@ ReadMart: ; 15c25 .done pop hl ld a, [hl] - ld [CurMart], a + ld [wCurMart], a ret ; 15c51 @@ -358,7 +358,7 @@ BuyMenu: ; 15c62 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 @@ MartAskPurchaseQuantity: ; 15c91 ; 15ca3 GetMartDialogGroup: ; 15ca3 - ld a, [EngineBuffer1] + ld a, [wEngineBuffer1] ld e, a ld d, 0 ld hl, .MartTextFunctionPointers @@ -468,12 +468,12 @@ BuyMenuLoop: ; 15cef 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 @@ BuyMenuLoop: ; 15cef 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 @@ BargainShopAskPurchaseQuantity: 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 @@ RooftopSaleAskPurchaseQuantity: 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 @@ MenuDataHeader_Buy: ; 0x15e18 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 @@ SellMenu: ; 15eb3 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 diff --git a/engine/menu.asm b/engine/menu.asm index 802bece08d1..846ad0ad9b1 100755 --- a/engine/menu.asm +++ b/engine/menu.asm @@ -725,7 +725,7 @@ _ExitMenu:: ; 243e8 ; 24423 Unreferenced_Function24423: ; 24423 - ld a, [VramState] + ld a, [wVramState] bit 0, a ret z xor a ; sScratch diff --git a/engine/menu_2.asm b/engine/menu_2.asm index 293d72e2cc1..44960783fc9 100644 --- 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 @@ PlaceMenuItemName: ; 0x24ab4 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 @@ PlaceMenuItemQuantity: ; 0x24ac3 add hl, de ld [hl], "×" inc hl - ld de, MenuSelectionQuantity + ld de, wMenuSelectionQuantity lb bc, 1, 2 call PrintNum @@ -47,7 +47,7 @@ PlaceMoneyDataHeader: ; 24b01 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 @@ -91,7 +91,7 @@ Special_DisplayMoneyAndCoinBalance: ; 24b4e 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 @@ -112,7 +112,7 @@ ShowMoney_TerminatorString: ; 24b8e 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 @@ Unreferenced_Function24b8f: ; 24b8f lb bc, 1, 2 call PrintNum pop af - ld [Options], a + ld [wOptions], a ret .slash_500 ; 24bcf @@ -151,7 +151,7 @@ StartMenu_DrawBugContestStatusBox: ; 24bdc ret StartMenu_PrintBugContestStatus: ; 24be7 - ld hl, Options + ld hl, wOptions ld a, [hl] push af set NO_TEXT_SCROLL, [hl] @@ -191,7 +191,7 @@ StartMenu_PrintBugContestStatus: ; 24be7 .skip_level pop af - ld [Options], a + ld [wOptions], a ret .Balls_JP: ; 24c43 @@ -207,7 +207,7 @@ StartMenu_PrintBugContestStatus: ; 24be7 FindApricornsInBag: ; 24c64 ; Checks the bag for Apricorns. - ld hl, Buffer1 + ld hl, wBuffer1 xor a ld [hli], a dec a @@ -220,8 +220,8 @@ FindApricornsInBag: ; 24c64 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 @@ FindApricornsInBag: ; 24c64 jr .loop .done - ld a, [Buffer1] + ld a, [wBuffer1] and a ret nz scf @@ -241,7 +241,7 @@ FindApricornsInBag: ; 24c64 .addtobuffer ; 24c94 push hl - ld hl, Buffer1 + ld hl, wBuffer1 inc [hl] ld e, [hl] ld d, 0 diff --git a/engine/mon_icons.asm b/engine/mon_icons.asm index db1a68ceb5f..5a26d2d7c3c 100755 --- a/engine/mon_icons.asm +++ b/engine/mon_icons.asm @@ -55,7 +55,7 @@ LoadMenuMonIcon: ; 8e83f .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 @@ PartyMenu_InitAnimatedMonIcon: ; 8e8d5 (23:68d5) .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 @@ InitPartyMenuIcon: ; 8e908 (23:6908) 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 @@ SetPartyMonIconAnimSpeed: ; 8e936 (23:6936) 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 @@ NamingScreen_InitAnimatedMonIcon: ; 8e961 (23:6961) 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 @@ MoveList_InitAnimatedMonIcon: ; 8e97d (23:697d) 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 @@ GetSpeciesIcon: ; 8e9ac push de ld a, [wd265] call ReadMonMenuIcon - ld [CurIcon], a + ld [wCurIcon], a pop de ld a, e call GetIconGFX @@ -274,7 +274,7 @@ FlyFunction_GetMonIcon: ; 8e9bc (23:69bc) 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 @@ Unreferenced_GetMonIcon2: ; 8e9cc push de ld a, [wd265] call ReadMonMenuIcon - ld [CurIcon], a + ld [wCurIcon], a pop de call GetIcon_de ret @@ -335,7 +335,7 @@ endr ; 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 diff --git a/engine/mon_menu.asm b/engine/mon_menu.asm index d7e8446d0c5..f398910ac7c 100755 --- a/engine/mon_menu.asm +++ b/engine/mon_menu.asm @@ -48,7 +48,7 @@ MonSubmenu: ; 24d19 ld a, 1 ld [hBGMapMode], a call MonMenuLoop - ld [MenuSelection], a + ld [wMenuSelection], a call ExitMenu ret @@ -63,7 +63,7 @@ MonSubmenu: ; 24d19 .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 @@ MonMenuLoop: ; 24d59 .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 @@ MonMenuLoop: ; 24d59 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 @@ PopulateMonMenu: ; 24d91 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 @@ GetMonMenuString: ; 24db0 GetMonSubmenuItems: ; 24dd4 call ResetMonSubmenu - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp EGG jr z, .egg ld a, [wLinkMode] @@ -211,7 +211,7 @@ GetMonSubmenuItems: ; 24dd4 call AddMonMenuItem .skip2 - ld a, [Buffer1] + ld a, [wBuffer1] cp NUM_MONMENU_ITEMS jr z, .ok2 ld a, MONMENU_CANCEL @@ -255,18 +255,18 @@ IsFieldMove: ; 24e52 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 ; 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 @@ AddMonMenuItem: ; 24e83 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 diff --git a/engine/mon_stats.asm b/engine/mon_stats.asm index 7a493c5912d..a06ad1a46cd 100644 --- a/engine/mon_stats.asm +++ b/engine/mon_stats.asm @@ -10,13 +10,13 @@ DrawHP: ; 50b10 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 @@ DrawHP: ; 50b10 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 @@ DrawHP: ; 50b10 ; 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 @@ DrawHP: ; 50b10 ld [hli], a ; Print max HP - ld de, TempMonMaxHP + ld de, wTempMonMaxHP lb bc, 2, 3 call PrintNum pop hl @@ -83,7 +83,7 @@ DrawHP: ; 50b10 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 @@ PrintTempMonStats: ; 50b7b 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 @@ PrintTempMonStats: ; 50b7b 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 @@ GetGender: ; 50bdd ; 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,25 +154,25 @@ GetGender: ; 50bdd 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. .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 @@ GetGender: ; 50bdd 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 @@ ListMovePP: ; 50c50 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 @@ ListMovePP: ; 50c50 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 @@ ListMovePP: ; 50c50 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 @@ ListMovePP: ; 50c50 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 @@ Unreferenced_Function50cd0: ; 50cd0 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 @@ FrzString: db "FRZ@" 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 @@ ListMoves: ; 50d6f 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 @@ ListMoves: ; 50d6f 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 @@ ListMoves: ; 50d6f .nonmove_loop push af ld [hl], "-" - ld a, [Buffer1] + ld a, [wBuffer1] ld c, a ld b, 0 add hl, bc diff --git a/engine/move_mon.asm b/engine/move_mon.asm index 52894359e33..0c06948511c 100755 --- 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,18 +25,18 @@ TryAddMonToParty: ; d88c .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 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 @@ TryAddMonToParty: ; d88c 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,17 +79,17 @@ GeneratePartyMonStats: ; d906 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] and a ld a, $0 jr z, .skipitem - ld a, [EnemyMonItem] + ld a, [wEnemyMonItem] .skipitem ld [de], a @@ -100,10 +100,10 @@ GeneratePartyMonStats: ; d906 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 @@ GeneratePartyMonStats: ; d906 ld [hli], a endr ld [hl], a - ld [Buffer1], a + ld [wBuffer1], a predef FillMoves .next @@ -127,14 +127,14 @@ GeneratePartyMonStats: ; d906 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 @@ endr jr nz, .loop pop hl push hl - ld a, [MonType] + ld a, [wMonType] and $f jr z, .generateDVs push hl @@ -165,7 +165,7 @@ endr jr .initializetrainermonstats .generateDVs - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] ld [wd265], a dec a push de @@ -211,7 +211,7 @@ endr inc de ld [de], a inc de - ld a, [CurPartyLevel] + ld a, [wCurPartyLevel] ld [de], a inc de xor a @@ -234,15 +234,15 @@ endr 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 @@ endr 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 @@ endr ld a, [hli] ld [de], a inc de - ; Copy EnemyMonHP + ; Copy wEnemyMonHP ld a, [hli] ld [de], a inc de @@ -286,7 +286,7 @@ endr 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 @@ endr 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 @@ FillPP: ; da6d 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 @@ FillPP: ; da6d ; da96 AddTempmonToParty: ; da96 - ld hl, PartyCount + ld hl, wPartyCount ld a, [hl] cp PARTY_LENGTH scf @@ -362,63 +362,63 @@ AddTempmonToParty: ; da96 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 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 @@ AddTempmonToParty: ; da96 ld a, [wFirstUnownSeen] and a jr nz, .done - ld a, [UnownLetter] + ld a, [wUnownLetter] ld [wFirstUnownSeen], a .done @@ -461,7 +461,7 @@ SendGetPkmnIntoFromBox: ; db3f jp CloseSRAM_And_SetCarryFlag .check_IfPartyIsFull - ld hl, PartyCount + ld hl, wPartyCount ld a, [hl] cp PARTY_LENGTH jp z, CloseSRAM_And_SetCarryFlag @@ -476,23 +476,23 @@ SendGetPkmnIntoFromBox: ; db3f cp DAY_CARE_WITHDRAW ld a, [wBreedMon1Species] jr z, .okay1 - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] .okay1 ld [hli], a 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 ld a, [sBoxCount] .okay2 - dec a ; PartyCount - 1 + dec a ; wPartyCount - 1 call AddNTimes .breedmon @@ -507,11 +507,11 @@ SendGetPkmnIntoFromBox: ; db3f 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 @@ SendGetPkmnIntoFromBox: ; db3f 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 @@ SendGetPkmnIntoFromBox: ; db3f 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 @@ SendGetPkmnIntoFromBox: ; db3f 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 @@ SendGetPkmnIntoFromBox: ; db3f 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 @@ SendGetPkmnIntoFromBox: ; db3f 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 @@ SendGetPkmnIntoFromBox: ; db3f add hl, bc ld d, h ld e, l - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp EGG jr z, .egg inc hl @@ -678,14 +678,14 @@ RestorePPofDepositedPokemon: ; dcb6 add hl, bc push hl push bc - ld de, TempMonPP + ld de, wTempMonPP ld bc, NUM_MOVES call CopyBytes pop bc ld hl, MON_MOVES add hl, bc push hl - ld de, TempMonMoves + ld de, wTempMonMoves ld bc, NUM_MOVES call CopyBytes pop hl @@ -693,16 +693,16 @@ RestorePPofDepositedPokemon: ; dcb6 ld a, [wMenuCursorY] push af - ld a, [MonType] + ld a, [wMonType] push af ld b, 0 .loop 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 @@ RestorePPofDepositedPokemon: ; dcb6 .done pop af - ld [MonType], a + ld [wMonType], a pop af ld [wMenuCursorY], a ret @@ -734,7 +734,7 @@ RestorePPofDepositedPokemon: ; dcb6 RetrievePokemonFromDayCareMan: ; dd21 ld a, [wBreedMon1Species] - ld [CurPartySpecies], a + ld [wCurPartySpecies], a ld de, SFX_TRANSACTION call PlaySFX call WaitSFX @@ -742,7 +742,7 @@ RetrievePokemonFromDayCareMan: ; dd21 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 @@ RetrievePokemonFromDayCareMan: ; dd21 RetrievePokemonFromDayCareLady: ; dd42 ld a, [wBreedMon2Species] - ld [CurPartySpecies], a + ld [wCurPartySpecies], a ld de, SFX_TRANSACTION call PlaySFX call WaitSFX @@ -758,14 +758,14 @@ RetrievePokemonFromDayCareLady: ; dd42 ld a, b ld [wd002], a ld a, e - ld [CurPartyLevel], a + ld [wCurPartyLevel], a ld a, PC_DEPOSIT ld [wPokemonWithdrawDepositParameter], a jp Functiondd64 ; dd64 Functiondd64: ; dd64 - ld hl, PartyCount + ld hl, wPartyCount ld a, [hl] cp PARTY_LENGTH jr nz, .room_in_party @@ -788,11 +788,11 @@ Functiondd64: ; dd64 .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 @@ Functiondd64: ; dd64 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 @@ Functiondd64: ; dd64 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,21 +831,21 @@ Functiondd64: ; dd64 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 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 @@ Functiondd64: ; dd64 ; 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 @@ DepositMonWithDayCareLady: ; de37 ; 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 @@ DepositBreedmon: ; de44 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 @@ SendPkmnIntoBox: ; de6e 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 @@ SendPkmnIntoBox: ; de6e 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 @@ SendPkmnIntoBox: ; de6e ld [de], a inc de push de - ld a, [CurPartyLevel] + ld a, [wCurPartyLevel] ld d, a callfar CalcExpAtLevel pop de @@ -982,8 +982,8 @@ SendPkmnIntoBox: ; de6e 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 @@ SendPkmnIntoBox: ; de6e 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 @@ SendPkmnIntoBox: ; de6e .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 @@ ShiftBoxMon: ; df47 ; 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 @@ GiveEgg:: ; df8c 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,53 +1129,53 @@ GiveEgg:: ; df8c 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 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] 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 @@ String_Egg: ; e035 ; e039 RemoveMonFromPartyOrBox: ; e039 - ld hl, PartyCount + ld hl, wPartyCount ld a, [wPokemonWithdrawDepositParameter] and a @@ -1204,7 +1204,7 @@ RemoveMonFromPartyOrBox: ; e039 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 @@ RemoveMonFromPartyOrBox: ; e039 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 @@ RemoveMonFromPartyOrBox: ; e039 .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 @@ RemoveMonFromPartyOrBox: ; e039 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 @@ RemoveMonFromPartyOrBox: ; e039 .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 @@ RemoveMonFromPartyOrBox: ; e039 ld hl, sBoxMons ld bc, BOXMON_STRUCT_LENGTH .party4 - ld a, [CurPartyMon] + ld a, [wCurPartyMon] call AddNTimes ld d, h ld e, l @@ -1273,24 +1273,24 @@ RemoveMonFromPartyOrBox: ; e039 .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 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 @@ RemoveMonFromPartyOrBox: ; e039 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 @@ RemoveMonFromPartyOrBox: ; e039 push hl add hl, bc pop de - ld a, [CurPartyMon] + ld a, [wCurPartyMon] ld b, a .loop2 push bc @@ -1334,7 +1334,7 @@ RemoveMonFromPartyOrBox: ; e039 pop de pop bc inc b - ld a, [PartyCount] + ld a, [wPartyCount] cp b jr nz, .loop2 .close_sram @@ -1350,7 +1350,7 @@ ComputeNPCTrademonStats: ; e134 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 @@ ComputeNPCTrademonStats: ; e134 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 @@ CalcPkmnStatC: ; e17b 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 @@ CalcPkmnStatC: ; e17b 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 @@ CalcPkmnStatC: ; e17b 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 @@ GivePoke:: ; e277 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 @@ GivePoke:: ; e277 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 @@ GivePoke:: ; e277 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 @@ GivePoke:: ; e277 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,26 +1680,26 @@ GivePoke:: ; e277 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 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,14 +1714,14 @@ GivePoke:: ; e277 call GetSRAMBank ld de, sBoxMonOT .loop - ld a, [ScriptBank] + ld a, [wScriptBank] call GetFarByte ld [de], a inc hl inc de cp "@" jr nz, .loop - ld a, [ScriptBank] + ld a, [wScriptBank] call GetFarByte ld b, a ld hl, sBoxMon1ID @@ -1793,7 +1793,7 @@ InitNickname: ; e3de 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 diff --git a/engine/move_mon_wo_mail.asm b/engine/move_mon_wo_mail.asm index e5e1d6e4919..5d81da8a0d7 100755 --- a/engine/move_mon_wo_mail.asm +++ b/engine/move_mon_wo_mail.asm @@ -25,39 +25,39 @@ InsertPokemonIntoBox: ; 51322 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 @@ InsertPokemonIntoParty: ; 5138b 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 @@ InsertDataIntoBoxOrParty: ; 513e0 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 @@ InsertDataIntoBoxOrParty: ; 513e0 .insert pop bc pop hl - ld a, [CurPartyMon] + ld a, [wCurPartyMon] call AddNTimes ld d, h ld e, l diff --git a/engine/movement.asm b/engine/movement.asm index 3ba48d60db6..a701ff6f912 100644 --- a/engine/movement.asm +++ b/engine/movement.asm @@ -215,7 +215,7 @@ Movement_step_end: ; 51c1 add hl, bc ld [hl], $0 - ld hl, VramState + ld hl, wVramState res 7, [hl] ld hl, OBJECT_STEP_TYPE @@ -243,7 +243,7 @@ Movement_48: ; 51db add hl, bc ld [hl], STEP_TYPE_03 - ld hl, VramState + ld hl, wVramState res 7, [hl] ret ; 51fd @@ -257,7 +257,7 @@ Movement_remove_object: ; 51fd ld [hl], -1 .not_leading - ld hl, VramState + ld hl, wVramState res 7, [hl] ret ; 5210 @@ -271,7 +271,7 @@ Movement_4b: ; 5210 add hl, bc ld [hl], STEP_TYPE_04 - ld hl, VramState + ld hl, wVramState res 7, [hl] ret ; 5222 diff --git a/engine/mystery_gift.asm b/engine/mystery_gift.asm index fccdcfcbce1..56b09000a52 100755 --- a/engine/mystery_gift.asm +++ b/engine/mystery_gift.asm @@ -79,7 +79,7 @@ DoMysteryGift: ; 1048ba (41:48ba) 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 @@ Function104b88: ; 104b88 (41:4b88) 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 @@ Function104cd2: ; 104cd2 (41:4cd2) 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 @@ StagePartyDataForMysteryGift: ; 10510b (41:510b) 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 @@ Function105688: ; 105688 (41:5688) Function1056eb: ; 1056eb (41:56eb) ld c, 16 .loop - ld hl, Sprite01YCoord + ld hl, wSprite01YCoord ld b, 8 .dec_y_loop dec [hl] @@ -1467,7 +1467,7 @@ rept SPRITEOAMSTRUCT_LENGTH endr dec b jr nz, .dec_y_loop - ld hl, Sprite09YCoord + ld hl, wSprite09YCoord ld b, 8 .inc_y_loop inc [hl] @@ -1543,13 +1543,13 @@ Function105777: ; 105777 (41:5777) 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 @@ Function1057d7: ; 1057d7 (41:57d7) ld [hl], $3c hlcoord 17, 15 ld [hl], $3e - ld de, Sprite01 + ld de, wSprite01 ld hl, .OAM_data ld bc, 16 * SPRITEOAMSTRUCT_LENGTH call CopyBytes diff --git a/engine/mystery_gift_2.asm b/engine/mystery_gift_2.asm index 72767aa1714..bb86e1ae671 100755 --- a/engine/mystery_gift_2.asm +++ b/engine/mystery_gift_2.asm @@ -5,7 +5,7 @@ PrepMysteryGiftDataToSend: ; 2c642 (b:4642) 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 @@ PrepMysteryGiftDataToSend: ; 2c642 (b:4642) 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 diff --git a/engine/naming_screen.asm b/engine/naming_screen.asm index b53a3b09d91..859e7a515aa 100755 --- a/engine/naming_screen.asm +++ b/engine/naming_screen.asm @@ -19,7 +19,7 @@ NamingScreen: ; 116c1 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 @@ NamingScreen: ; 116c1 pop af ld [hMapAnims], a pop af - ld [Options], a + ld [wOptions], a call ClearJoypad ret @@ -91,13 +91,13 @@ NamingScreen: ; 116c1 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 diff --git a/engine/npc_movement.asm b/engine/npc_movement.asm index e8b353fa622..ecb5205545b 100755 --- a/engine/npc_movement.asm +++ b/engine/npc_movement.asm @@ -235,14 +235,14 @@ CheckFacingObject:: ; 6fd9 call CheckCounterTile jr nz, .asm_6ff1 - ld a, [PlayerStandingMapX] + ld a, [wPlayerStandingMapX] sub d cpl inc a add d ld d, a - ld a, [PlayerStandingMapY] + ld a, [wPlayerStandingMapY] sub e cpl inc a @@ -250,7 +250,7 @@ CheckFacingObject:: ; 6fd9 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 @@ Unreferenced_Function7015: ; 7041 IsNPCAtCoord: ; 7041 - ld bc, ObjectStructs + ld bc, wObjectStructs xor a .loop ld [hObjectStructIndexBuffer], a @@ -454,7 +454,7 @@ HasObjectReachedMovementLimit: ; 70a4 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 @@ IsObjectMovingOffEdgeOfScreen: ; 70ed .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 @@ IsObjectMovingOffEdgeOfScreen: ; 70ed ; 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 diff --git a/engine/npctrade.asm b/engine/npctrade.asm index 40f6dd63830..7082d54425f 100755 --- a/engine/npctrade.asm +++ b/engine/npctrade.asm @@ -22,7 +22,7 @@ NPCTrade:: ; fcba8 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 @@ NPCTrade:: ; fcba8 CheckTradeGender: ; fcc23 xor a - ld [MonType], a + ld [wMonType], a ld e, TRADE_GENDER call GetTradeAttribute @@ -136,29 +136,29 @@ DoNPCTrade: ; fcc63 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 @@ DoNPCTrade: ; fcc63 .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 @@ DoNPCTrade: ; fcc63 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 @@ DoNPCTrade: ; fcc63 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 @@ DoNPCTrade: ; fcc63 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 @@ DoNPCTrade: ; fcc63 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 @@ DoNPCTrade: ; fcc63 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 @@ DoNPCTrade: ; fcc63 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 @@ GetTradeAttribute: ; 0xfcdc2 ; 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 @@ GetTradeMonName: ; fcde8 push de ld [wd265], a call GetBasePokemonName - ld hl, StringBuffer1 + ld hl, wStringBuffer1 pop de ret ; fcdf4 @@ -364,7 +364,7 @@ GetTradeMonNames: ; fce1b ld a, [hl] call GetTradeMonName - ld de, StringBuffer2 + ld de, wStringBuffer2 call CopyTradeName ld e, TRADE_GIVEMON @@ -375,7 +375,7 @@ GetTradeMonNames: ; fce1b ld de, wMonOrItemNameBuffer call CopyTradeName - ld hl, StringBuffer1 + ld hl, wStringBuffer1 .loop ld a, [hli] cp "@" diff --git a/engine/options_menu.asm b/engine/options_menu.asm index 4ab21528286..b6ca978d1eb 100755 --- a/engine/options_menu.asm +++ b/engine/options_menu.asm @@ -139,10 +139,10 @@ Options_TextSpeed: ; e42f5 .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 @@ Options_TextSpeed: ; e42f5 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 @@ GetTextSpeed: ; e4346 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_BattleScene: ; e4365 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_BattleStyle: ; e43a0 Options_Sound: ; e43dd - ld hl, Options + ld hl, wOptions ld a, [hJoyPressed] bit D_LEFT_F, a jr nz, .LeftPressed @@ -363,7 +363,7 @@ Options_Print: ; e4424 .Save: ld b, a - ld [GBPrinter], a + ld [wGBPrinter], a .NonePressed: ld b, $0 @@ -398,7 +398,7 @@ Options_Print: ; e4424 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 @@ GetPrinterSetting: ; e4491 ; 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_MenuAccount: ; e44c1 Options_Frame: ; e44fa - ld hl, TextBoxFrame + ld hl, wTextBoxFrame ld a, [hJoyPressed] bit D_LEFT_F, a jr nz, .LeftPressed @@ -497,7 +497,7 @@ Options_Frame: ; e44fa 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 diff --git a/engine/overworld.asm b/engine/overworld.asm index 4c379711d20..7e3a69c6fa2 100755 --- a/engine/overworld.asm +++ b/engine/overworld.asm @@ -9,9 +9,9 @@ GetEmote2bpp: ; 1412a _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 @@ Special_RefreshSprites:: ; 14168 .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 @@ GetPlayerSprite: ; 14183 ld hl, .Kris .go - ld a, [PlayerState] + ld a, [wPlayerState] ld c, a .loop ld a, [hli] @@ -82,7 +82,7 @@ GetPlayerSprite: ; 14183 ; 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 @@ GetPlayerSprite: ; 14183 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 @@ AddMapSprites: ; 141c9 AddIndoorSprites: ; 141d9 - ld hl, Map1ObjectSprite + ld hl, wMap1ObjectSprite ld a, 1 .loop push af @@ -142,7 +142,7 @@ AddIndoorSprites: ; 141d9 AddOutdoorSprites: ; 141ee - ld a, [MapGroup] + ld a, [wMapGroup] dec a ld c, a ld b, 0 @@ -276,7 +276,7 @@ GetMonSprite: ; 14259 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 @@ AddSpriteGFX: ; 142e5 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 @@ LoadSpriteGFX: ; 14306 ; 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 @@ LoadSpriteGFX: ; 14306 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 @@ SortUsedSprites: ; 1431e ; higher than a later one, swap them. inc de - ld hl, UsedSprites + 1 + ld hl, wUsedSprites + 1 .CheckSprite: push bc @@ -493,7 +493,7 @@ ArrangeUsedSprites: ; 14355 ; 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 @@ GetSpriteLength: ; 14386 GetUsedSprites: ; 1439b - ld hl, UsedSprites + ld hl, wUsedSprites ld c, SPRITE_GFX_LIST_CAPACITY .loop diff --git a/engine/pack.asm b/engine/pack.asm index f9c7490af14..dfe30612d38 100644 --- 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 @@ Pack: ; 10000 .done ld a, [wCurrPocket] ld [wLastPocket], a - ld hl, Options + ld hl, wOptions res NO_TEXT_SCROLL, [hl] ret ; 10026 @@ -207,13 +207,13 @@ Pack: ; 10000 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 @@ UseItem: ; 10311 ret .Party: ; 10338 (4:4338) - ld a, [PartyCount] + ld a, [wPartyCount] and a jr z, .NoPokemon call DoItemEffect @@ -524,8 +524,8 @@ TossMenu: ; 10364 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 @@ RegisterItem: ; 103c2 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 @@ RegisterItem: ; 103c2 ; 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 @@ GiveItem: ; 103fd 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 @@ GiveItem: ; 103fd 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 @@ GiveItem: ; 103fd ld [wJumptableIndex], a .finish pop af - ld [Options], a + ld [wOptions], a xor a ld [hBGMapMode], a call Pack_InitGFX @@ -663,7 +663,7 @@ QuitItemSubmenu: ; 10492 ; 10493 BattlePack: ; 10493 - ld hl, Options + ld hl, wOptions set NO_TEXT_SCROLL, [hl] call InitPackBuffers .loop @@ -678,7 +678,7 @@ BattlePack: ; 10493 .end ld a, [wCurrPocket] ld [wLastPocket], a - ld hl, Options + ld hl, wOptions res NO_TEXT_SCROLL, [hl] ret ; 104b9 @@ -1040,8 +1040,8 @@ DepositSellPack: ; 106be 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 @@ DepositSellTutorial_InterpretJoypad: ; 1076f TutorialPack: ; 107bb call DepositSellInitPackBuffers - ld a, [InputType] + ld a, [wInputType] or a jr z, .loop farcall _DudeAutoInput_RightA @@ -1148,7 +1148,7 @@ TutorialPack: ; 107bb ; entries correspond to *_POCKET constants dw .Items dw .Balls - dw .KeyItems + dw .wKeyItems dw .TMHM .Items: ; 107e9 (4:47e9) @@ -1174,7 +1174,7 @@ TutorialPack: ; 107bb 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 @@ TutorialPack: ; 107bb 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 @@ Pack_QuitRunScript: ; 1087e (4:487e) 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 @@ DrawPackGFX: ; 1089d 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 @@ DrawPocketName: ; 109bb ; 10a1d Pack_GetItemName: ; 10a1d - ld a, [CurItem] + ld a, [wCurItem] ld [wNamedObjectIndexBuffer], a call GetItemName call CopyName1 @@ -1547,7 +1547,7 @@ ItemsPocketMenuDataHeader: ; 0x10a4f 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 @@ PC_Mart_ItemsPocketMenuDataHeader: ; 0x10a67 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 @@ KeyItemsPocketMenuDataHeader: ; 0x10a7f 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 @@ PC_Mart_KeyItemsPocketMenuDataHeader: ; 0x10a97 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 @@ BallsPocketMenuDataHeader: ; 0x10aaf 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 @@ PC_Mart_BallsPocketMenuDataHeader: ; 0x10ac7 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 diff --git a/engine/party_menu.asm b/engine/party_menu.asm index 5ef9b50defb..9dffa4089f5 100644 --- 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 @@ SelectMonFromParty: ; 50000 SelectTradeOrDayCareMon: ; 5001d ld a, b - ld [PartyMenuActionText], a + ld [wPartyMenuActionText], a call DisableSpriteUpdates call ClearBGPalettes call InitPartyMenuLayout @@ -47,7 +47,7 @@ LoadPartyMenuGFX: ; 5004f WritePartyMenuTilemap: ; 0x5005f - ld hl, Options + ld hl, wOptions ld a, [hl] push af set NO_TEXT_SCROLL, [hl] @@ -69,7 +69,7 @@ WritePartyMenuTilemap: ; 0x5005f jr .loop .end pop af - ld [Options], a + ld [wOptions], a ret ; 0x50089 @@ -88,7 +88,7 @@ WritePartyMenuTilemap: ; 0x5005f PlacePartyNicknames: ; 5009b hlcoord 3, 1 - ld a, [PartyCount] + ld a, [wPartyCount] and a jr z, .end ld c, a @@ -97,7 +97,7 @@ PlacePartyNicknames: ; 5009b push bc push hl push hl - ld hl, PartyMonNicknames + ld hl, wPartyMonNicknames ld a, b call GetNick pop hl @@ -126,7 +126,7 @@ PlacePartyNicknames: ; 5009b PlacePartyHPBar: ; 500cf xor a ld [wSGBPals], a - ld a, [PartyCount] + ld a, [wPartyCount] and a ret z ld c, a @@ -169,7 +169,7 @@ PlacePartyHPBar: ; 500cf 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 @@ PlacePartymonHPBar: ; 50117 ; 50138 PlacePartyMenuHPDigits: ; 50138 - ld a, [PartyCount] + ld a, [wPartyCount] and a ret z ld c, a @@ -208,7 +208,7 @@ PlacePartyMenuHPDigits: ; 50138 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 @@ PlacePartyMenuHPDigits: ; 50138 ; 50176 PlacePartyMonLevel: ; 50176 - ld a, [PartyCount] + ld a, [wPartyCount] and a ret z ld c, a @@ -250,7 +250,7 @@ PlacePartyMonLevel: ; 50176 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 @@ PlacePartyMonLevel: ; 50176 ; 501b2 PlacePartyMonStatus: ; 501b2 - ld a, [PartyCount] + ld a, [wPartyCount] and a ret z ld c, a @@ -293,7 +293,7 @@ PlacePartyMonStatus: ; 501b2 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 @@ PlacePartyMonStatus: ; 501b2 ; 501e0 PlacePartyMonTMHMCompatibility: ; 501e0 - ld a, [PartyCount] + ld a, [wPartyCount] and a ret z ld c, a @@ -324,12 +324,12 @@ PlacePartyMonTMHMCompatibility: ; 501e0 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 @@ PlacePartyMonTMHMCompatibility: ; 501e0 PlacePartyMonEvoStoneCompatibility: ; 5022f - ld a, [PartyCount] + ld a, [wPartyCount] and a ret z ld c, a @@ -382,7 +382,7 @@ PlacePartyMonEvoStoneCompatibility: ; 5022f 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 @@ PlacePartyMonEvoStoneCompatibility: ; 5022f ; 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 @@ PlacePartyMonEvoStoneCompatibility: ; 5022f jr nz, .loop2 dec hl dec hl - ld a, [CurItem] + ld a, [wCurItem] cp [hl] inc hl inc hl @@ -452,7 +452,7 @@ PlacePartyMonEvoStoneCompatibility: ; 5022f PlacePartyMonGender: ; 502b1 - ld a, [PartyCount] + ld a, [wPartyCount] and a ret z ld c, a @@ -463,12 +463,12 @@ PlacePartyMonGender: ; 502b1 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 @@ PlacePartyMonGender: ; 502b1 PlacePartyMonMobileBattleSelection: ; 50307 - ld a, [PartyCount] + ld a, [wPartyCount] and a ret z ld c, a @@ -588,10 +588,10 @@ PlacePartyMonMobileBattleSelection: ; 50307 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 @@ PartyMenuCheckEgg: ; 50389 ; 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 @@ INCLUDE "data/party_menu_qualities.asm" InitPartyMenuGFX: ; 503e0 - ld hl, PartyCount + ld hl, wPartyCount ld a, [hli] and a ret z @@ -655,7 +655,7 @@ InitPartyMenuWithCancel: ; 50405 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 @@ InitPartyMenuNoCancel: ; 0x5042d ; 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 @@ PartyMenuSelect: ; 0x50457 ; 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 @@ PartyMenuSelect: ; 0x50457 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 @@ PrintPartyMenuText: ; 5049a 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 @@ PrintPartyMenuText: ; 5049a 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 @@ YouHaveNoPKMNString: ; 0x50556 db "You have no !@" 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 @@ PrintPartyMenuActionText: ; 50566 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 diff --git a/engine/phone/phone.asm b/engine/phone/phone.asm index f402e910231..fad859bfef7 100644 --- a/engine/phone/phone.asm +++ b/engine/phone/phone.asm @@ -68,7 +68,7 @@ Phone_FindOpenSlot: ; 9002d GetRemainingSpaceInPhoneList: ; 90040 xor a - ld [Buffer1], a + ld [wBuffer1], a ld hl, PermanentNumbers .loop ld a, [hli] @@ -82,7 +82,7 @@ GetRemainingSpaceInPhoneList: ; 90040 ld c, a call _CheckCellNum jr c, .permanent - ld hl, Buffer1 + ld hl, wBuffer1 inc [hl] .permanent pop hl @@ -93,7 +93,7 @@ GetRemainingSpaceInPhoneList: ; 90040 .done ld a, CONTACT_LIST_SIZE - ld hl, Buffer1 + ld hl, wBuffer1 sub [hl] ret ; 90066 @@ -173,7 +173,7 @@ CheckPhoneContactTimeOfDay: ; 900ad (24:40ad) 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 @@ ChooseRandomCaller: ; 900bf (24:40bf) ; 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 @@ ChooseRandomCaller: ; 900bf (24:40bf) 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,38 +210,38 @@ GetAvailableCallers: ; 900de (24:40de) ld a, CONTACT_LIST_SIZE .loop - ld [EngineBuffer2], a + ld [wEngineBuffer2], a ld a, [de] and a jr z, .not_good_for_call 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 @@ Function90199: ; 90199 (24:4199) ; 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 @@ Function90199: ; 90199 (24:4199) .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 @@ LoadCallerScript: ; 9020d (24:420d) call AddNTimes ld a, BANK(PhoneContacts) .proceed - ld de, EngineBuffer2 + ld de, wEngineBuffer2 ld bc, 12 call FarCopyBytes ret @@ -491,11 +491,11 @@ Phone_CallerTextboxWithName: ; 90292 (24:4292) 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 @@ Phone_CallerTextboxWithName2: ; 902c9 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 diff --git a/engine/pic_animation.asm b/engine/pic_animation.asm index 4317d96f8ce..b93a10dd232 100644 --- a/engine/pic_animation.asm +++ b/engine/pic_animation.asm @@ -267,7 +267,7 @@ PokeAnim_CryNoWait: ; d0188 PokeAnim_StereoCry: ; d0196 ld a, $f - ld [CryTracks], a + ld [wCryTracks], a ld a, [wPokeAnimSpecies] call PlayStereoCry2 ld a, [wPokeAnimSceneIndex] @@ -291,7 +291,7 @@ PokeAnim_DeinitFrames: ; d01a9 ; d01c6 AnimateMon_CheckIfPokemon: ; d01c6 - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp EGG jr z, .fail call IsAPokemon @@ -326,7 +326,7 @@ PokeAnim_InitPicAttributes: ; d01d6 ld [wPokeAnimPointer], a ld a, b ld [wPokeAnimPointer + 1], a -; hl contains TileMap coords +; hl contains wTileMap coords ld a, l ld [wPokeAnimCoord], a ld a, h @@ -335,13 +335,13 @@ PokeAnim_InitPicAttributes: ; d01d6 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 @@ PokeAnim_GetAttrMapCoord: ; d0551 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 @@ GetMonAnimPointer: ; d055c 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 @@ HOF_AnimateFrontpic: ; d066e xor a ld [wBoxAlignment], a inc a - ld [CurPartySpecies], a + ld [wCurPartySpecies], a ret ; d0695 diff --git a/engine/player_gfx.asm b/engine/player_gfx.asm index 21929e32c97..282d2e22fe1 100644 --- a/engine/player_gfx.asm +++ b/engine/player_gfx.asm @@ -7,7 +7,7 @@ Unreferenced_Function88248: ; 88248 .okay ld a, c - ld [TrainerClass], a + ld [wTrainerClass], a ret MovePlayerPicRight: ; 88258 @@ -73,7 +73,7 @@ ShowPlayerNamingChoices: ; 88297 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 @@ HOF_LoadTrainerFrontpic: ; 88840 .GotClass: ld a, e - ld [TrainerClass], a + ld [wTrainerClass], a ld de, ChrisPic ld a, [wPlayerGender] bit 0, a @@ -184,7 +184,7 @@ DrawIntroPlayerPic: ; 88874 ld e, KRIS .GotClass: ld a, e - ld [TrainerClass], a + ld [wTrainerClass], a ; Load pic ld de, ChrisPic diff --git a/engine/player_movement.asm b/engine/player_movement.asm index d6d10aea1d8..83fdf64baf4 100755 --- a/engine/player_movement.asm +++ b/engine/player_movement.asm @@ -2,19 +2,19 @@ DoPlayerMovement:: ; 80000 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 .GetDPad: ld a, [hJoyDown] - ld [CurInput], a + ld [wCurInput], a ; Standing downhill instead moves down. @@ -28,12 +28,12 @@ DoPlayerMovement:: ; 80000 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 @@ DoPlayerMovement:: ; 80000 ret c call .CheckWarp ret c - ld a, [WalkingDirection] + ld a, [wWalkingDirection] cp STANDING jr z, .HitWall call .BumpSound @@ -94,12 +94,12 @@ DoPlayerMovement:: ; 80000 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 @@ DoPlayerMovement:: ; 80000 ; 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 @@ DoPlayerMovement:: ; 80000 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 @@ DoPlayerMovement:: ; 80000 ld a, [hl] cp STANDING jr z, .no_walk - ld [WalkingDirection], a + ld [wWalkingDirection], a jr .continue_walk .land1_table @@ -188,7 +188,7 @@ DoPlayerMovement:: ; 80000 ld a, [hl] cp STANDING jr z, .no_walk - ld [WalkingDirection], a + ld [wWalkingDirection], a jr .continue_walk .land2_table @@ -214,7 +214,7 @@ DoPlayerMovement:: ; 80000 .down ld a, DOWN - ld [WalkingDirection], a + ld [wWalkingDirection], a jr .continue_walk .no_walk @@ -236,12 +236,12 @@ DoPlayerMovement:: ; 80000 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 @@ DoPlayerMovement:: ; 80000 .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 @@ DoPlayerMovement:: ; 80000 cp 2 jr z, .bump - ld a, [PlayerStandingTile] + ld a, [wPlayerStandingTile] call CheckIceTile jr nc, .ice @@ -289,7 +289,7 @@ DoPlayerMovement:: ; 80000 bit 2, [hl] ; downhill jr z, .fast - ld a, [WalkingDirection] + ld a, [wWalkingDirection] cp DOWN jr z, .fast @@ -362,7 +362,7 @@ DoPlayerMovement:: ; 80000 ; 801f3 .TryJump: ; 801f3 - ld a, [PlayerStandingTile] + ld a, [wPlayerStandingTile] ld e, a and $f0 cp HI_NYBBLE_LEDGES @@ -374,7 +374,7 @@ DoPlayerMovement:: ; 80000 ld d, 0 ld hl, .data_8021e add hl, de - ld a, [FacingDirection] + ld a, [wFacingDirection] and [hl] jr z, .DontJump @@ -408,26 +408,26 @@ DoPlayerMovement:: ; 80000 ; 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 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,14 +462,14 @@ DoPlayerMovement:: ; 80000 ld h, [hl] ld l, a - ld a, [WalkingDirection] + ld a, [wWalkingDirection] ld e, a cp STANDING jp z, .StandInPlace add hl, de ld a, [hl] - ld [MovementAnimation], a + ld [wMovementAnimation], a ld hl, .FinishFacing add hl, de @@ -535,7 +535,7 @@ DoPlayerMovement:: ; 80000 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 @@ DoPlayerMovement:: ; 80000 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 @@ DoPlayerMovement:: ; 80000 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 @@ DoPlayerMovement:: ; 80000 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 @@ DoPlayerMovement:: ; 80000 .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 @@ DoPlayerMovement:: ; 80000 ; 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 @@ DoPlayerMovement:: ; 80000 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 @@ DoPlayerMovement:: ; 80000 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 @@ DoPlayerMovement:: ; 80000 ; 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 @@ DoPlayerMovement:: ; 80000 ; 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 @@ DoPlayerMovement:: ; 80000 ; 803ca .BikeCheck: ; 803ca - ld a, [PlayerState] + ld a, [wPlayerState] cp PLAYER_BIKE ret z cp PLAYER_SKATE @@ -810,7 +810,7 @@ DoPlayerMovement:: ; 80000 .GetOutOfWater: ; 803f9 push bc ld a, PLAYER_NORMAL - ld [PlayerState], a + ld [wPlayerState], a call ReplaceKrisSprite ; UpdateSprites pop bc ret @@ -822,10 +822,10 @@ CheckStandingOnIce:: ; 80404 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 diff --git a/engine/player_object.asm b/engine/player_object.asm index b630078a266..b16afda5ce1 100755 --- a/engine/player_object.asm +++ b/engine/player_object.asm @@ -5,11 +5,11 @@ BlankScreen: ; 8000 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 @@ SpawnPlayer: ; 8029 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 @@ CopyDECoordsToMapObject:: ; 807e 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 @@ WriteObjectXY:: ; 80a1 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 @@ CopyObjectStruct:: ; 80e7 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 @@ CopyObjectStruct:: ; 80e7 ld d, h ld e, l call CopyMapObjectToObjectStruct - ld hl, VramState + ld hl, wVramState bit 7, [hl] ret z @@ -224,7 +224,7 @@ CopyMapObjectToObjectStruct: ; 8116 ret InitializeVisibleSprites: ; 8177 - ld bc, MapObjects + OBJECT_LENGTH + ld bc, wMapObjects + OBJECT_LENGTH ld a, 1 .loop ld [hMapObjectIndexBuffer], a @@ -240,9 +240,9 @@ InitializeVisibleSprites: ; 8177 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 @@ CheckObjectEnteringVisibleRange:: ; 81ca 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 @@ CheckObjectEnteringVisibleRange:: ; 81ca 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 @@ CopyTempObjectToObjectStruct: ; 8286 add hl, de ld [hl], a - ld hl, YCoord + ld hl, wYCoord sub [hl] and $f swap a @@ -488,7 +488,7 @@ CopyTempObjectToObjectStruct: ; 8286 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 @@ Special_SurfStartStep: ; 8379 ret .GetMovementData: ; 8388 - ld a, [PlayerDirection] + ld a, [wPlayerDirection] srl a srl a maskbits NUM_DIRECTIONS @@ -656,7 +656,7 @@ FollowNotExact:: ; 839e 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 @@ FollowNotExact:: ; 839e add hl, de ld [hl], c ld a, c - ld hl, YCoord + ld hl, wYCoord sub [hl] and $f swap a diff --git a/engine/player_step.asm b/engine/player_step.asm index 3af41be59c9..675c6553b52 100755 --- a/engine/player_step.asm +++ b/engine/player_step.asm @@ -86,28 +86,28 @@ UpdatePlayerCoords: ; d511 (3:5511) ld a, [wPlayerStepDirection] and a jr nz, .check_step_down - ld hl, YCoord + ld hl, wYCoord inc [hl] ret .check_step_down cp UP jr nz, .check_step_left - ld hl, YCoord + ld hl, wYCoord dec [hl] ret .check_step_left cp LEFT jr nz, .check_step_right - ld hl, XCoord + ld hl, wXCoord dec [hl] ret .check_step_right cp RIGHT ret nz - ld hl, XCoord + ld hl, wXCoord inc [hl] ret @@ -170,7 +170,7 @@ UpdateOverworldMap: ; d536 (3:5536) .Add6ToOverworldMapAnchor: ; d595 (3:5595) ld hl, wOverworldMapAnchor - ld a, [MapWidth] + ld a, [wMapWidth] add 6 add [hl] ld [hli], a @@ -201,7 +201,7 @@ UpdateOverworldMap: ; d536 (3:5536) .Sub6FromOverworldMapAnchor: ; d5c6 (3:55c6) ld hl, wOverworldMapAnchor - ld a, [MapWidth] + ld a, [wMapWidth] add 6 ld b, a ld a, [hl] diff --git a/engine/pokedex/newpokedexentry.asm b/engine/pokedex/newpokedexentry.asm index d6b7552008c..365cf1b7095 100644 --- a/engine/pokedex/newpokedexentry.asm +++ b/engine/pokedex/newpokedexentry.asm @@ -42,9 +42,9 @@ NewPokedexEntry: ; fb877 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 diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm index e96d0a7d750..70c5c460110 100644 --- a/engine/pokedex/pokedex.asm +++ b/engine/pokedex/pokedex.asm @@ -27,14 +27,14 @@ Pokedex: ; 40000 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 @@ Pokedex: ; 40000 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,18 +163,18 @@ Pokedex_InitCursorPosition: ; 400b4 ret Pokedex_GetLandmark: ; 400ed - ld a, [MapGroup] + ld a, [wMapGroup] ld b, a - ld a, [MapNumber] + ld a, [wMapNumber] ld c, a call GetWorldMapLocation 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 @@ Pokedex_InitMainScreen: ; 4013c (10:413c) 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 @@ Pokedex_InitMainScreen: ; 4013c (10:413c) 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 @@ Pokedex_InitDexEntryScreen: ; 40217 (10:4217) 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 @@ Pokedex_UpdateDexEntryScreen: ; 40258 (10:4258) 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 @@ Pokedex_ReinitDexEntryScreen: ; 402aa (10:42aa) 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 @@ DexEntryScreen_MenuActionJumptable: ; 402f2 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 @@ Pokedex_InitSearchResultsScreen: ; 4050a (10:450a) 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 @@ Pokedex_InitSearchResultsScreen: ; 4050a (10:450a) 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 @@ Pokedex_DrawMainScreenBG: ; 4074c (10:474c) 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 @@ Pokedex_DrawMainScreenBG: ; 4074c (10:474c) 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 @@ Pokedex_DrawUnownModeBG: ; 409f1 (10:49f1) 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 @@ Pokedex_SearchForMons: ; 41086 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 @@ Pokedex_SearchForMons: ; 41086 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 @@ Pokedex_UpdateSearchResultsCursorOAM: ; 41281 (10:5281) db -1 Pokedex_LoadCursorOAM: ; 412f1 (10:52f1) - ld de, Sprite01 + ld de, wSprite01 .loop ld a, [hl] cp -1 @@ -2366,9 +2366,9 @@ Pokedex_LoadSelectedMonTiles: ; 4143b 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 @@ Pokedex_LoadUnownFont: ; 41a2c 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 @@ _NewPokedexEntry: ; 41a7f 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 @@ _NewPokedexEntry: ; 41a7f predef GetMonFrontpic ld a, SCGB_POKEDEX call Pokedex_GetSGBLayout - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] call PlayMonCry ret diff --git a/engine/pokedex/pokedex_2.asm b/engine/pokedex/pokedex_2.asm index 4dd608ac012..6f4e27405e7 100644 --- a/engine/pokedex/pokedex_2.asm +++ b/engine/pokedex/pokedex_2.asm @@ -41,7 +41,7 @@ AnimateDexSearchSlowpoke: ; 441cf DoDexSearchSlowpokeFrame: ; 44207 ld a, [wDexSearchSlowpokeFrame] ld hl, .SlowpokeSpriteData - ld de, Sprite01 + ld de, wSprite01 .loop ld a, [hli] cp -1 @@ -107,8 +107,8 @@ DisplayDexEntry: ; 4424d 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 diff --git a/engine/pokedex/pokedex_3.asm b/engine/pokedex/pokedex_3.asm index dc52f83d325..f5247f2da72 100644 --- a/engine/pokedex/pokedex_3.asm +++ b/engine/pokedex/pokedex_3.asm @@ -140,7 +140,7 @@ DrawDexEntryScreenRightEdge: ; 1de247 ld [hl], $3c xor a ld b, SCREEN_HEIGHT - hlcoord 19, 0, AttrMap + hlcoord 19, 0, wAttrMap call Bank77_FillColumn call WaitBGMap2 pop hl diff --git a/engine/pokedex/unown_dex.asm b/engine/pokedex/unown_dex.asm index dc6db9dc614..cc3d4a27396 100755 --- 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 @@ PrintUnownWord: ; fba2e (3e:7a2e) ld a, [wDexCurrentUnownIndex] ld e, a ld d, 0 - ld hl, UnownDex + ld hl, wUnownDex add hl, de ld a, [hl] ld e, a diff --git a/engine/pokegear.asm b/engine/pokegear.asm index 8bea44671cd..a782b31b62b 100755 --- a/engine/pokegear.asm +++ b/engine/pokegear.asm @@ -23,7 +23,7 @@ NUM_POKEGEAR_CARDS EQU const_value 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 @@ PokeGear: ; 90b8d (24:4b8d) 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 @@ PokeGear: ; 90b8d (24:4b8d) 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 @@ Pokegear_LoadGFX: ; 90c4e 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 @@ AnimatePokegearModeIndicatorArrow: ; 90d41 (24:4d41) ; 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,18 +211,18 @@ TownMap_GetCurrentLandmark: ; 90d56 ; 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 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 @@ InitPokegearTilemap: ; 90da8 (24:4da8) xor a ld [hBGMapMode], a hlcoord 0, 0 - ld bc, TileMapEnd - TileMap + ld bc, wTileMapEnd - wTileMap ld a, $4f call ByteFill ld a, [wPokegearCard] @@ -929,7 +929,7 @@ PokegearPhone_MakePhoneCall: ; 911eb (24:51eb) 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 @@ PokegearPhone_MakePhoneCall: ; 911eb (24:51eb) 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 @@ ExitPokegearRadio_HandleMusic: ; 91492 ; 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 @@ RadioChannels: ; 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 @@ PokeFluteStationName: db "# FLUTE@" ; 9191c _TownMap: ; 9191c - ld hl, Options + ld hl, wOptions ld a, [hl] push af set NO_TEXT_SCROLL, [hl] @@ -1868,10 +1868,10 @@ _TownMap: ; 9191c 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 @@ _TownMap: ; 9191c .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 @@ _TownMap: ; 9191c ; 91a53 PlayRadio: ; 91a53 - ld hl, Options + ld hl, wOptions ld a, [hl] push af set NO_TEXT_SCROLL, [hl] @@ -2054,7 +2054,7 @@ PlayRadio: ; 91a53 .stop pop af - ld [Options], a + ld [wOptions], a call ExitPokegearRadio_HandleMusic ret @@ -2111,7 +2111,7 @@ PlayRadio: ; 91a53 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 @@ _FlyMap: ; 91af3 ; 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 @@ TownMapBubble: ; 91bb5 ld e, [hl] farcall GetLandmarkName hlcoord 2, 1 - ld de, StringBuffer1 + ld de, wStringBuffer1 call PlaceString ret @@ -2376,18 +2376,18 @@ ret_91c8f: ; 91c8f ; 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, ; 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 @@ FlyMap: ; 91c90 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 @@ FlyMap: ; 91c90 ; 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 @@ FlyMap: ; 91c90 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: @@ -2589,7 +2589,7 @@ Pokedex_GetArea: ; 91d11 .copy_sprites hlcoord 0, 0 ld de, wVirtualOAM - ld bc, SpritesEnd - wVirtualOAM + ld bc, wSpritesEnd - wVirtualOAM call CopyBytes ret @@ -2625,9 +2625,9 @@ Pokedex_GetArea: ; 91d11 .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, wSprite01 .nestloop ld a, [de] and a @@ -2656,7 +2656,7 @@ Pokedex_GetArea: ; 91d11 .done_nest ld hl, wVirtualOAM decoord 0, 0 - ld bc, SpritesEnd - wVirtualOAM + ld bc, wSpritesEnd - wVirtualOAM call CopyBytes ret @@ -2671,7 +2671,7 @@ Pokedex_GetArea: ; 91d11 ld c, e ld b, d ld de, .PlayerOAM - ld hl, Sprite01 + ld hl, wSprite01 .ShowPlayerLoop: ld a, [de] cp $80 @@ -2700,8 +2700,8 @@ Pokedex_GetArea: ; 91d11 jr .ShowPlayerLoop .clear_oam - ld hl, Sprite05 - ld bc, SpritesEnd - Sprite05 + ld hl, wSprite05 + ld bc, wSpritesEnd - wSprite05 xor a call ByteFill ret @@ -2742,7 +2742,7 @@ Pokedex_GetArea: ; 91d11 .clear ld hl, wVirtualOAM - ld bc, SpritesEnd - wVirtualOAM + ld bc, wSpritesEnd - wVirtualOAM xor a call ByteFill scf @@ -2816,7 +2816,7 @@ FillTownMap: ; 91f07 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 @@ TownMapMon: ; 91f7b ; 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 diff --git a/engine/predef.asm b/engine/predef.asm index 6c8c2c5f2b3..13c593c903d 100644 --- 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 @@ GetPredefPointer:: ; 854b 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 diff --git a/engine/print_party.asm b/engine/print_party.asm index 7c23528f3cb..5fe0e28c0ec 100755 --- a/engine/print_party.asm +++ b/engine/print_party.asm @@ -158,25 +158,25 @@ PrintPartyMonPage1: ; 1dc381 call Get2bpp xor a - ld [MonType], a + ld [wMonType], a farcall CopyPkmnToTempMon hlcoord 0, 7 ld b, 9 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 @@ PrintPartyMonPage1: ; 1dc381 hlcoord 1, 9 ld de, String1dc550 call PlaceString - ld hl, PartyMonOT + ld hl, wPartyMonOT call Function1dc50e hlcoord 4, 9 call PlaceString @@ -204,22 +204,22 @@ PrintPartyMonPage1: ; 1dc381 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 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 @@ PrintPartyMonPage2: ; 1dc47b 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 @@ PrintPartyMonPage2: ; 1dc47b 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 @@ PrintPartyMonPage2: ; 1dc47b Function1dc50e: ; 1dc50e ld bc, NAME_LENGTH - ld a, [CurPartyMon] + ld a, [wCurPartyMon] call AddNTimes ld e, l ld d, h @@ -328,7 +328,7 @@ Function1dc52c: ; 1dc52c .got_gender hlcoord 17, 2 ld [hl], a - ld bc, TempMonDVs + ld bc, wTempMonDVs farcall CheckShininess ret nc hlcoord 18, 2 diff --git a/engine/printer.asm b/engine/printer.asm index 4479d5d0b47..b9e55ef2a76 100755 --- a/engine/printer.asm +++ b/engine/printer.asm @@ -751,7 +751,7 @@ Printer_PrintBoxListSegment: ; 848e7 (21:48e7) cp $ff jp z, .finish ld [wd265], a - ld [CurPartySpecies], a + ld [wCurPartySpecies], a push bc push hl @@ -769,7 +769,7 @@ Printer_PrintBoxListSegment: ; 848e7 (21:48e7) push hl call PlaceString - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp EGG pop hl jr z, .ok2 @@ -850,16 +850,16 @@ Printer_GetMonGender: ; 8498a (21:498a) ld bc, BOXMON_STRUCT_LENGTH ld a, [wWhichBoxMonToPrint] call AddNTimes - ld de, TempMonDVs + ld de, wTempMonDVs ld a, [hli] ld [de], a inc de 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 diff --git a/engine/printer_serial.asm b/engine/printer_serial.asm index 02d0595fad7..4e0d10851a6 100755 --- a/engine/printer_serial.asm +++ b/engine/printer_serial.asm @@ -9,7 +9,7 @@ Printer_StartTransmission: ; 84000 ld [wPrinterOpcode], a ld hl, wPrinterConnectionOpen set 0, [hl] - ld a, [GBPrinter] + ld a, [wGBPrinter] ld [wGBPrinterSettings], a xor a ld [wJumptableIndex], a diff --git a/engine/radio.asm b/engine/radio.asm index df0d8167959..e6ee257eeaa 100644 --- a/engine/radio.asm +++ b/engine/radio.asm @@ -269,9 +269,9 @@ endr 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 @@ OPT_OakText3: db "@" OaksPkmnTalk7: - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] ld [wNamedObjectIndexBuffer], a call GetPokemonName ld hl, OPT_MaryText1 @@ -688,7 +688,7 @@ ClearBottomLine: PokedexShow_GetDexEntryBank: push hl push de - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] dec a rlca rlca @@ -722,7 +722,7 @@ PokedexShow1: 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 @@ PokedexShow1: jp NextRadioLine PokedexShow2: - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] dec a ld hl, PokedexDataPointerTable ld c, a @@ -1011,12 +1011,12 @@ LuckyNumberShow7: 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 @@ PeoplePlaces4: ; People jr c, PeoplePlaces4 push bc callfar GetTrainerClassName - ld de, StringBuffer1 + ld de, wStringBuffer1 call CopyName1 pop bc ld b, 1 @@ -1669,16 +1669,16 @@ GetBuenasPassword: 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 ld [hli], a cp "@" jr nz, .copy_loop - ld de, StringBuffer1 + ld de, wStringBuffer1 ret INCLUDE "data/radio/buenas_passwords.asm" diff --git a/engine/routines/checktime.asm b/engine/routines/checktime.asm index ada151dbfa8..4c7d033ff51 100644 --- 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 diff --git a/engine/routines/correcterrorsinplayerparty.asm b/engine/routines/correcterrorsinplayerparty.asm index 42e5509008f..5f2bba6bc73 100644 --- 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 @@ Unreferenced_CorrectErrorsInPlayerParty: push hl push bc ld a, c - ld hl, PartyMon1Species + ld hl, wPartyMon1Species call GetPartyLocation ld [hl], SMEARGLE pop bc @@ -40,8 +40,8 @@ Unreferenced_CorrectErrorsInPlayerParty: 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,14 +59,14 @@ Unreferenced_CorrectErrorsInPlayerParty: ld [hl], SMEARGLE push de ld d, 0 - ld hl, PartySpecies + ld hl, wPartySpecies add hl, de pop de ld a, SMEARGLE ld [hl], a .check_level - ld [CurSpecies], a + ld [wCurSpecies], a call GetBaseData ld hl, MON_LEVEL add hl, bc @@ -81,7 +81,7 @@ Unreferenced_CorrectErrorsInPlayerParty: .invalid_level ld [hl], a .load_level - ld [CurPartyLevel], a + ld [wCurPartyLevel], a ld hl, MON_MAXHP add hl, bc @@ -99,8 +99,8 @@ Unreferenced_CorrectErrorsInPlayerParty: 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 @@ Unreferenced_CorrectErrorsInPlayerParty: push bc push hl - ld hl, PartySpecies + ld hl, wPartySpecies push bc ld b, 0 add hl, bc @@ -125,7 +125,7 @@ Unreferenced_CorrectErrorsInPlayerParty: 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 @@ Unreferenced_CorrectErrorsInPlayerParty: 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 @@ Unreferenced_CorrectErrorsInPlayerParty: 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 @@ Unreferenced_CorrectErrorsInPlayerParty: dec b jr nz, .loop4 - ld hl, PartyMon1Moves - ld a, [PartyCount] + ld hl, wPartyMon1Moves + ld a, [wPartyCount] ld b, a .loop5 push hl diff --git a/engine/routines/getbreedmonlevelgrowth.asm b/engine/routines/getbreedmonlevelgrowth.asm index b029043d65e..dc22db7985e 100644 --- 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 @@ GetBreedMon1LevelGrowth: ; e698 GetBreedMon2LevelGrowth: ; e6b3 ld hl, wBreedMon2Stats - ld de, TempMon + ld de, wTempMon ld bc, BOXMON_STRUCT_LENGTH call CopyBytes callfar CalcLevel diff --git a/engine/routines/initlist.asm b/engine/routines/initlist.asm index b7260e55247..26c77b5bbea 100644 --- a/engine/routines/initlist.asm +++ b/engine/routines/initlist.asm @@ -3,23 +3,23 @@ InitList: ; 50db9 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 .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 .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 @@ InitList: ; 50db9 .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 diff --git a/engine/routines/leveluphappinessmod.asm b/engine/routines/leveluphappinessmod.asm index c253e8872b1..8c6dd92fe3f 100644 --- 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 diff --git a/engine/routines/phonering_copytilemapatonce.asm b/engine/routines/phonering_copytilemapatonce.asm index cefe9a66d85..b0d4ffa1e99 100644 --- a/engine/routines/phonering_copytilemapatonce.asm +++ b/engine/routines/phonering_copytilemapatonce.asm @@ -23,7 +23,7 @@ PhoneRing_CopyTilemapAtOnce: ; 4d188 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 diff --git a/engine/routines/playslowcry.asm b/engine/routines/playslowcry.asm index 545629e5116..1dc6c78acf9 100644 --- a/engine/routines/playslowcry.asm +++ b/engine/routines/playslowcry.asm @@ -1,28 +1,28 @@ 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 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 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 diff --git a/engine/routines/printitemdescription.asm b/engine/routines/printitemdescription.asm index e6d087dae8b..2a9007b97f7 100644 --- a/engine/routines/printitemdescription.asm +++ b/engine/routines/printitemdescription.asm @@ -1,23 +1,23 @@ 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 .not_a_tm push de ld hl, ItemDescriptions - ld a, [CurSpecies] + ld a, [wCurSpecies] dec a ld c, a ld b, 0 diff --git a/engine/routines/savemenu_copytilemapatonce.asm b/engine/routines/savemenu_copytilemapatonce.asm index 5d4ed8b7def..9b50494a4ad 100644 --- a/engine/routines/savemenu_copytilemapatonce.asm +++ b/engine/routines/savemenu_copytilemapatonce.asm @@ -20,7 +20,7 @@ SaveMenu_CopyTilemapAtOnce: ; 4cf45 (13:4f45) 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 diff --git a/engine/routines/switchpartymons.asm b/engine/routines/switchpartymons.asm index 1379dff9c1a..f1de8e27699 100644 --- 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 @@ _SwitchPartyMons: ld a, " " call ByteFill pop af - ld hl, Sprite01 + ld hl, wSprite01 ld bc, 4 * SPRITEOAMSTRUCT_LENGTH call AddNTimes ld de, SPRITEOAMSTRUCT_LENGTH @@ -43,14 +43,14 @@ _SwitchPartyMons: 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,16 +60,16 @@ _SwitchPartyMons: 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 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 @@ _SwitchPartyMons: 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 @@ _SwitchPartyMons: 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 @@ _SwitchPartyMons: 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 @@ _SwitchPartyMons: call GetSRAMBank call CopyBytes ld hl, sPartyMail - ld a, [Buffer3] + ld a, [wBuffer3] ld bc, MAIL_STRUCT_LENGTH call AddNTimes pop de diff --git a/engine/routines/townmap_convertlinebreakcharacters.asm b/engine/routines/townmap_convertlinebreakcharacters.asm index f08b436c9ce..6ccd79aae24 100644 --- 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 @@ TownMap_ConvertLineBreakCharacters: ; 1de2c5 ld [hl], "" .end - ld de, StringBuffer1 + ld de, wStringBuffer1 hlcoord 9, 0 call PlaceString ret diff --git a/engine/routines/trademonfrontpic.asm b/engine/routines/trademonfrontpic.asm index e9611553b4b..d5f7b55de76 100644 --- a/engine/routines/trademonfrontpic.asm +++ b/engine/routines/trademonfrontpic.asm @@ -6,8 +6,8 @@ GetTrademonFrontpic: ; 4d7fd 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,18 +19,18 @@ AnimateTrademonFrontpic: ; 4d81e 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 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 diff --git a/engine/routines/unreferenced_getgen1trainerclassname.asm b/engine/routines/unreferenced_getgen1trainerclassname.asm index 64c55ed84c3..66c80172d33 100644 --- 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 @@ Unreferenced_GetGen1TrainerClassName: ; 50a28 ld a, [hli] ld h, [hl] ld l, a - ld de, StringBuffer1 + ld de, wStringBuffer1 .copy ld a, [hli] ld [de], a diff --git a/engine/routines/updateitemdescription.asm b/engine/routines/updateitemdescription.asm index b684dd4d840..fdb1e864d30 100644 --- 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 diff --git a/engine/rtc.asm b/engine/rtc.asm index 571de9284b1..37e24c1edea 100755 --- a/engine/rtc.asm +++ b/engine/rtc.asm @@ -44,7 +44,7 @@ GetTimeOfDay:: ; 14032 ; get time of day inc hl ld a, [hl] - ld [TimeOfDay], a + ld [wTimeOfDay], a ret ; 14044 @@ -68,7 +68,7 @@ Unreferenced_1404e: 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 @@ Function140ae: ; 140ae 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 @@ _InitTime:: ; 140ed 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 @@ _InitTime:: ; 140ed 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 @@ _InitTime:: ; 140ed 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 @@ _InitTime:: ; 140ed ld [de], a dec de - ld a, [StringBuffer2] + ld a, [wStringBuffer2] sbc [hl] dec hl jr nc, .okay_days diff --git a/engine/save.asm b/engine/save.asm index be9d7f109cc..c519e50ad80 100644 --- a/engine/save.asm +++ b/engine/save.asm @@ -165,7 +165,7 @@ AddHallOfFameEntry: ; 14b5f 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 @@ SaveTheGame_yesorno: ; 14baf 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 @@ SavedTheGame: ; 14be6 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 ; 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 @@ -349,17 +349,17 @@ SavingDontTurnOffThePower: ; 14c99 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 @@ ValidateSave: ; 14da9 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 @@ ValidateBackupSave: ; 14e2d 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 @@ TryLoadSaveFile: ; 14ea5 (5:4ea5) 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 @@ TryLoadSaveData: ; 14f1c 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 @@ TryLoadSaveData: ; 14f1c 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 @@ TryLoadSaveData: ; 14f1c .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 @@ CheckPrimarySaveFile: ; 14f84 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 @@ CheckBackupSaveFile: ; 14faf 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 @@ _SaveData: ; 1509a 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 @@ _LoadData: ; 150b9 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] diff --git a/engine/scripting.asm b/engine/scripting.asm index acbf1190c05..dd2cfffe870 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -4,14 +4,14 @@ EnableScriptMode:: push af ld a, SCRIPT_READ - ld [ScriptMode], a + ld [wScriptMode], a pop af ret ScriptEvents:: call StartScript .loop - ld a, [ScriptMode] + ld a, [wScriptMode] ld hl, .modes rst JumpTable call CheckScript @@ -31,28 +31,28 @@ EndScript: WaitScript: call StopScript - ld hl, ScriptDelay + ld hl, wScriptDelay dec [hl] ret nz farcall Function58b9 ld a, SCRIPT_READ - ld [ScriptMode], a + ld [wScriptMode], a call StartScript ret WaitScriptMovement: call StopScript - ld hl, VramState + ld hl, wVramState bit 7, [hl] ret nz farcall Function58b9 ld a, SCRIPT_READ - ld [ScriptMode], a + ld [wScriptMode], a call StartScript ret @@ -239,17 +239,17 @@ endc 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_jumptextfaceplayer: ; 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_jumptext: ; script command 0x53 ; parameters: text_pointer - ld a, [ScriptBank] + ld a, [wScriptBank] ld [wScriptTextBank], a call GetScriptByte ld [wScriptTextAddr], a @@ -360,7 +360,7 @@ Script_writetext: ld l, a call GetScriptByte ld h, a - ld a, [ScriptBank] + ld a, [wScriptBank] ld b, a call MapTextbox ret @@ -429,7 +429,7 @@ Script_yesorno: jr c, .no ld a, TRUE .no - ld [ScriptVar], a + ld [wScriptVar], a ret Script_loadmenudata: @@ -441,7 +441,7 @@ Script_loadmenudata: 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 @@ Script_pokepic: call GetScriptByte and a jr nz, .ok - ld a, [ScriptVar] + ld a, [wScriptVar] .ok - ld [CurPartySpecies], a + ld [wCurPartySpecies], a farcall Pokepic ret @@ -475,27 +475,27 @@ Script_closepokepic: Script_verticalmenu: ; script command 0x59 - ld a, [ScriptBank] + ld a, [wScriptBank] ld hl, VerticalMenu rst FarCall ld a, [wMenuCursorY] 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] jr nc, .ok xor a .ok - ld [ScriptVar], a + ld [wScriptVar], a ret Script_battletowertext: @@ -514,7 +514,7 @@ Script_verbosegiveitem: call Script_giveitem call CurItemName - ld de, StringBuffer1 + ld de, wStringBuffer1 ld a, 1 call CopyConvertedText ld b, BANK(GiveItemScript) @@ -552,22 +552,22 @@ Script_verbosegiveitem2: 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 @@ GetPocketName: ld a, [hli] ld d, [hl] ld e, a - ld hl, StringBuffer3 + ld hl, wStringBuffer3 call CopyName2 ret @@ -642,7 +642,7 @@ GetPocketName: db "TM POCKET@" CurItemName: - ld a, [CurItem] + ld a, [wCurItem] ld [wd265], a call GetItemName ret @@ -667,7 +667,7 @@ Script_pokemart: ld e, a call GetScriptByte ld d, a - ld a, [ScriptBank] + ld a, [wScriptBank] ld b, a farcall OpenMartDialog ret @@ -677,17 +677,17 @@ Script_elevator: ; 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 @@ Script_phonecall: ld e, a call GetScriptByte ld d, a - ld a, [ScriptBank] + ld a, [wScriptBank] ld b, a farcall PhoneCall ret @@ -737,7 +737,7 @@ Script_askforphonenumber: call GetScriptByte ld a, PHONE_CONTACT_REFUSED .done - ld [ScriptVar], a + ld [wScriptVar], a ret Script_describedecoration: @@ -756,7 +756,7 @@ Script_fruittree: ; parameters: tree_id call GetScriptByte - ld [CurFruitTree], a + ld [wCurFruitTree], a ld b, BANK(FruitTreeScript) ld hl, FruitTreeScript jp ScriptJump @@ -781,13 +781,13 @@ Script_trainertext: 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 @@ Script_scripttalkafter: ld a, [hli] ld h, [hl] ld l, a - ld a, [EngineBuffer1] + ld a, [wEngineBuffer1] ld b, a jp ScriptJump @@ -808,7 +808,7 @@ Script_trainerflagaction: ; parameters: action xor a - ld [ScriptVar], a + ld [wScriptVar], a ld hl, wd041 ld e, [hl] inc hl @@ -820,7 +820,7 @@ Script_trainerflagaction: and a ret z ld a, TRUE - ld [ScriptVar], a + ld [wScriptVar], a ret Script_winlosstext: @@ -851,18 +851,18 @@ Script_check_just_battled: ; 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 @@ Script_playmusic: 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 @@ Script_musicfadeout: ; 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 @@ Script_cry: pop af and a jr nz, .ok - ld a, [ScriptVar] + ld a, [wScriptVar] .ok call PlayMonCry ret @@ -980,13 +980,13 @@ ApplyMovement: 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 @@ ApplyObjectFacing: 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 @@ Script_variablesprite: 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 @@ Script_loademote: 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 @@ Script_showemote: ; parameters: bubble, object_id, time call GetScriptByte - ld [ScriptVar], a + ld [wScriptVar], a call GetScriptByte call GetScriptObject cp LAST_TALKED @@ -1265,7 +1265,7 @@ Script_showemote: 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_loadpikachudata: ; 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 @@ Script_loadmemtrainer: 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 @@ Script_loadwildmon: 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 @@ Script_loadtrainer: 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 @@ Script_startbattle: predef StartBattle ld a, [wBattleResult] and $3f - ld [ScriptVar], a + ld [wScriptVar], a ret Script_catchtutorial: @@ -1381,7 +1381,7 @@ Script_catchtutorial: ; parameters: byte call GetScriptByte - ld [BattleType], a + ld [wBattleType], a call BufferScreen farcall CatchTutorial jp Script_reloadmap @@ -1432,7 +1432,7 @@ Script_scall: ; script command 0x0 ; parameters: pointer - ld a, [ScriptBank] + ld a, [wScriptBank] ld b, a call GetScriptByte ld e, a @@ -1471,7 +1471,7 @@ ScriptCall: ; 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 @@ ScriptCall: 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 @@ Script_jump: ld l, a call GetScriptByte ld h, a - ld a, [ScriptBank] + ld a, [wScriptBank] ld b, a jp ScriptJump @@ -1547,7 +1547,7 @@ Script_iffalse: ; script command 0x8 ; parameters: pointer - ld a, [ScriptVar] + ld a, [wScriptVar] and a jp nz, SkipTwoScriptBytes jp Script_jump @@ -1556,7 +1556,7 @@ Script_iftrue: ; script command 0x9 ; parameters: pointer - ld a, [ScriptVar] + ld a, [wScriptVar] and a jp nz, Script_jump jp SkipTwoScriptBytes @@ -1566,7 +1566,7 @@ Script_if_equal: ; parameters: byte, pointer call GetScriptByte - ld hl, ScriptVar + ld hl, wScriptVar cp [hl] jr z, Script_jump jr SkipTwoScriptBytes @@ -1576,7 +1576,7 @@ Script_if_not_equal: ; parameters: byte, pointer call GetScriptByte - ld hl, ScriptVar + ld hl, wScriptVar cp [hl] jr nz, Script_jump jr SkipTwoScriptBytes @@ -1585,7 +1585,7 @@ Script_if_greater_than: ; script command 0xa ; parameters: byte, pointer - ld a, [ScriptVar] + ld a, [wScriptVar] ld b, a call GetScriptByte cp b @@ -1598,7 +1598,7 @@ Script_if_less_than: call GetScriptByte ld b, a - ld a, [ScriptVar] + ld a, [wScriptVar] cp b jr c, Script_jump jr SkipTwoScriptBytes @@ -1643,24 +1643,24 @@ SkipTwoScriptBytes: 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: ; 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 @@ Script_checkscene: 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,21 +1690,21 @@ Script_checkmapscene: 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: ; 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 @@ Script_copybytetovar: call GetScriptByte ld h, a ld a, [hl] - ld [ScriptVar], a + ld [wScriptVar], a ret Script_copyvartobyte: @@ -1746,7 +1746,7 @@ Script_copyvartobyte: ld l, a call GetScriptByte ld h, a - ld a, [ScriptVar] + ld a, [wScriptVar] ld [hl], a ret @@ -1767,7 +1767,7 @@ Script_writebyte: ; parameters: value call GetScriptByte - ld [ScriptVar], a + ld [wScriptVar], a ret Script_addvar: @@ -1775,7 +1775,7 @@ Script_addvar: ; parameters: value call GetScriptByte - ld hl, ScriptVar + ld hl, wScriptVar add [hl] ld [hl], a ret @@ -1785,7 +1785,7 @@ Script_random: ; parameters: input call GetScriptByte - ld [ScriptVar], a + ld [wScriptVar], a and a ret z @@ -1814,11 +1814,11 @@ Script_random: .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 @@ Script_checkcode: call GetScriptByte call GetVarAction ld a, [de] - ld [ScriptVar], a + ld [wScriptVar], a ret Script_writevarcode: @@ -1849,7 +1849,7 @@ Script_writevarcode: call GetScriptByte call GetVarAction - ld a, [ScriptVar] + ld a, [wScriptVar] ld [de], a ret @@ -1872,7 +1872,7 @@ Script_checkver: ; script command 0x18 ld a, [.gs_version] - ld [ScriptVar], a + ld [wScriptVar], a ret .gs_version: @@ -1880,16 +1880,16 @@ Script_checkver: 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,40 +1899,40 @@ ConvertMemToText: .ok CopyConvertedText: - ld hl, StringBuffer3 - ld bc, StringBuffer4 - StringBuffer3 + ld hl, wStringBuffer3 + ld bc, wStringBuffer4 - wStringBuffer3 call AddNTimes call CopyName2 ret 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: ; 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 ConvertLandmarkToText: ld e, a farcall GetLandmarkName - ld de, StringBuffer1 + ld de, wStringBuffer1 jp ConvertMemToText Script_landmarktotext: @@ -1962,9 +1962,9 @@ Script_name: 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 @@ Script_readmoney: 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 @@ Script_readcoins: ; parameters: memory call ResetStringBuffer1 - ld hl, StringBuffer1 + 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 @@ Script_vartomem: ; 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 @@ Script_stringtotext: 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,14 +2040,14 @@ Script_givepokeitem: ld l, a call GetScriptByte ld h, a - ld a, [ScriptBank] + ld a, [wScriptBank] call GetFarByte ld b, a push bc 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 @@ Script_checkpokeitem: ld e, a call GetScriptByte ld d, a - ld a, [ScriptBank] + ld a, [wScriptBank] ld b, a farcall CheckPokeItem ret @@ -2073,20 +2073,20 @@ Script_giveitem: 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 @@ Script_takeitem: ; 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 @@ Script_checkitem: ; 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 @@ CompareMoneyAction: .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 @@ Script_checktime: ; 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 @@ Script_checkpoke: ; 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 @@ Script_addcellnum: ; 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 @@ Script_delcellnum: ; 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 @@ Script_checkcellnum: ; 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 @@ Script_checkphonecall: jr z, .ok ld a, TRUE .ok - ld [ScriptVar], a + ld [wScriptVar], a ret Script_givepoke: @@ -2316,16 +2316,16 @@ Script_givepoke: ; 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 @@ Script_givepoke: .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 @@ Script_checkevent: jr z, .false ld a, TRUE .false - ld [ScriptVar], a + ld [wScriptVar], a ret Script_setflag: @@ -2438,7 +2438,7 @@ Script_checkflag: jr z, .false ld a, TRUE .false - ld [ScriptVar], a + ld [wScriptVar], a ret _EngineFlagAction: @@ -2490,15 +2490,15 @@ Script_warp: 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 @@ Script_warp: 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 @@ Script_warpmod: ; 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 @@ Script_writecmdqueue: 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 @@ Script_delcmdqueue: ; 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 @@ Script_changemap: ; 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 @@ Script_pause: 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 @@ Script_deactivatefacing: 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 @@ Script_end: .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 @@ Script_return: call ExitScriptSubroutine jr c, .dummy .dummy - ld hl, ScriptFlags + ld hl, wScriptFlags res 0, [hl] call StopScript ret @@ -2774,13 +2774,13 @@ ExitScriptSubroutine: 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 @@ Script_end_all: 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 @@ Script_check_save: farcall CheckSave ld a, c - ld [ScriptVar], a + ld [wScriptVar], a ret ; unused ld a, [.byte] - ld [ScriptVar], a + ld [wScriptVar], a ret .byte diff --git a/engine/scrolling_menu.asm b/engine/scrolling_menu.asm index 32acf2defac..e12d4254d64 100755 --- a/engine/scrolling_menu.asm +++ b/engine/scrolling_menu.asm @@ -44,7 +44,7 @@ _ScrollingMenu:: ; 245cb 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 @@ ScrollingMenu_InitDisplay: ; 245f1 call ScrollingMenu_PlaceCursor call ScrollingMenu_CheckCallFunction3 pop af - ld [Options], a + ld [wOptions], a ret ; 24609 @@ -95,15 +95,15 @@ ScrollingMenuJoyAction: ; 24609 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 @@ ScrollingMenuJoyAction: ; 24609 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 @@ ScrollingMenu_UpdateDisplay: ; 247f0 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 @@ ScrollingMenu_GetListItemCoordAndFunctionArgs: ; 248d5 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 diff --git a/engine/search.asm b/engine/search.asm index 495d4cc5e49..6c18f3e3d42 100755 --- a/engine/search.asm +++ b/engine/search.asm @@ -1,66 +1,66 @@ 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 ; 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 @@ CheckOwnMon: ; 0x4a7ba ; 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 @@ CheckOwnMon: ; 0x4a7ba 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 @@ CheckOwnMon: ; 0x4a7ba ; 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 @@ CheckOwnMon: ; 0x4a7ba ; 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] diff --git a/engine/search2.asm b/engine/search2.asm index 9ef5491f06d..15b8ae1387f 100755 --- 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 @@ FindAtLeastThatHappy: ; 4dc0a ; 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 @@ FindAtLeastThatHappy: ; 4dc0a FindGreaterThanThatLevel: ; 4dc31 ld c, $0 - ld a, [PartyCount] + ld a, [wPartyCount] ld d, a .loop ld a, d @@ -104,7 +104,7 @@ FindThatSpecies: ; 4dc56 ; 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 @@ FindThatSpecies: ; 4dc56 RetroactivelyIgnoreEggs: ; 4dc67 ld e, -2 - ld hl, PartySpecies + ld hl, wPartySpecies .loop ld a, [hli] cp -1 diff --git a/engine/select_menu.asm b/engine/select_menu.asm index e92c3ee5035..2135cd5bf9e 100755 --- a/engine/select_menu.asm +++ b/engine/select_menu.asm @@ -22,7 +22,7 @@ ItemMayBeRegisteredText: ; 13340 CheckRegisteredItem: ; 13345 - ld a, [WhichRegisteredItem] + ld a, [wWhichRegisteredItem] and a jr z, .NoRegisteredItem and REGISTERED_POCKET @@ -39,7 +39,7 @@ CheckRegisteredItem: ; 13345 dw .CheckTMHM .CheckItem: - ld hl, NumItems + ld hl, wNumItems call .CheckRegisteredNo jr c, .NoRegisteredItem inc hl @@ -53,18 +53,18 @@ CheckRegisteredItem: ; 13345 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,20 +81,20 @@ CheckRegisteredItem: ; 13345 .NoRegisteredItem: xor a - ld [WhichRegisteredItem], a - ld [RegisteredItem], a + ld [wWhichRegisteredItem], a + ld [wRegisteredItem], a scf ret ; 133a6 .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 @@ CheckRegisteredItem: ; 13345 .IsSameItem: ; 133b6 - ld a, [RegisteredItem] + ld a, [wRegisteredItem] cp [hl] jr nz, .NotSameItem - ld [CurItem], a + ld [wCurItem], a and a ret diff --git a/engine/sgb_layouts.asm b/engine/sgb_layouts.asm index 5f2b8e12e5c..24bdc952edb 100644 --- a/engine/sgb_layouts.asm +++ b/engine/sgb_layouts.asm @@ -5,7 +5,7 @@ LoadSGBLayout: ; 864c 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 @@ LoadSGBLayout: ; 864c 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 @@ LoadSGBLayout: ; 864c 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 @@ LoadSGBLayout: ; 864c 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 @@ LoadSGBLayout: ; 864c inc hl inc hl - ld a, [PlayerHPPal] + ld a, [wPlayerHPPal] add PREDEFPAL_HP_GREEN ld [hl], a ld hl, wSGBPals @@ -182,8 +182,8 @@ LoadSGBLayout: ; 864c 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 @@ LoadSGBLayout: ; 864c 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 @@ LoadSGBLayout: ; 864c 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 @@ endr ld hl, PalPacket_GSTitleScreen ld de, BlkPacket_GSTitleScreen ld a, SCGB_DIPLOMA - ld [SGBPredef], a + ld [wSGBPredef], a ret ; 8890 @@ -354,7 +354,7 @@ endr .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 @@ endr ld [hld], a ld de, BlkPacket_9a86 ld a, SCGB_MAPPALS - ld [SGBPredef], a + ld [wSGBPredef], a ret ; 88cd @@ -398,13 +398,13 @@ endr 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 @@ endr 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 @@ endr 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 @@ endr 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 @@ endr ; 8a0c .GetMapPalsIndex: ; 8a0c - ld a, [TimeOfDayPal] + ld a, [wTimeOfDayPal] cp NITE_F jr c, .morn_day ld a, PREDEFPAL_NITE @@ -570,7 +570,7 @@ endr jr z, .perm5 cp GATE jr z, .gate - ld a, [MapGroup] + ld a, [wMapGroup] ld e, a ld d, 0 ld hl, MapGroupRoofSGBPalInds diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm index f960abd1cbf..db08380947e 100755 --- a/engine/slot_machine.asm +++ b/engine/slot_machine.asm @@ -75,7 +75,7 @@ SLOTS_END_LOOP_F EQU 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 @@ _SlotMachine: 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 @@ SlotsLoop: ; 927af (24:67af) ret .matching_sevens - ld a, [TextDelayFrames] + ld a, [wTextDelayFrames] and $7 ret nz ld a, [rBGP] @@ -261,7 +261,7 @@ Unreferenced_Function9282c: ; 9282c inc [hl] and $7 ret nz - ld hl, Sprite17TileID + ld hl, wSprite17TileID ld c, NUM_SPRITE_OAM_STRUCTS - 16 .loop ld a, [hl] @@ -671,7 +671,7 @@ Slots_InitReelTiles: ; 92a98 (24:6a98) ld bc, wReel1 ld hl, REEL_OAM_ADDR add hl, bc - ld de, Sprite17 + ld de, wSprite17 ld [hl], e inc hl ld [hl], d @@ -689,7 +689,7 @@ Slots_InitReelTiles: ; 92a98 (24:6a98) ld bc, wReel2 ld hl, REEL_OAM_ADDR add hl, bc - ld de, Sprite25 + ld de, wSprite25 ld [hl], e inc hl ld [hl], d @@ -707,7 +707,7 @@ Slots_InitReelTiles: ; 92a98 (24:6a98) ld bc, wReel3 ld hl, REEL_OAM_ADDR add hl, bc - ld de, Sprite33 + ld de, wSprite33 ld [hl], e inc hl ld [hl], d @@ -1725,7 +1725,7 @@ Slots_InitBias: ; 93002 (24:7002) and a ret z ld hl, .Normal - ld a, [ScriptVar] + ld a, [wScriptVar] and a jr z, .okay ld hl, .Lucky @@ -1971,7 +1971,7 @@ Slots_PayoutText: ; 93158 (24:7158) add hl, de add hl, de add hl, de - ld de, StringBuffer2 + ld de, wStringBuffer2 ld bc, 4 call CopyBytes ld a, [hli] diff --git a/engine/spawn_points.asm b/engine/spawn_points.asm index daebb6159df..1a3d1244111 100644 --- a/engine/spawn_points.asm +++ b/engine/spawn_points.asm @@ -2,10 +2,10 @@ INCLUDE "data/maps/spawn_points.asm" 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 @@ LoadSpawnPoint: ; 1531f 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 diff --git a/engine/specials.asm b/engine/specials.asm index 587a8160c84..facb1eb2579 100644 --- a/engine/specials.asm +++ b/engine/specials.asm @@ -21,22 +21,22 @@ DummySpecial_c224: ; c224 ; c225 Special_SetPlayerPalette: ; c225 - ld a, [ScriptVar] + ld a, [wScriptVar] ld d, a farcall SetPlayerPalette ret ; 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,35 +44,35 @@ Special_GameCornerPrizeMonCheckDex: ; c230 ; c252 UnusedSpecial_SeenMon: ; c252 - ld a, [ScriptVar] + ld a, [wScriptVar] dec a call SetSeenMon ret ; c25a Special_FindGreaterThanThatLevel: ; c25a - ld a, [ScriptVar] + ld a, [wScriptVar] ld b, a farcall _FindGreaterThanThatLevel jr z, FoundNone jr FoundOne Special_FindAtLeastThatHappy: ; c268 - ld a, [ScriptVar] + ld a, [wScriptVar] ld b, a farcall _FindAtLeastThatHappy jr z, FoundNone jr FoundOne Special_FindThatSpecies: ; c276 - ld a, [ScriptVar] + ld a, [wScriptVar] ld b, a farcall _FindThatSpecies jr z, FoundNone jr FoundOne Special_FindThatSpeciesYourTrainerID: ; c284 - ld a, [ScriptVar] + ld a, [wScriptVar] ld b, a farcall _FindThatSpeciesYourTrainerID jr z, FoundNone @@ -80,21 +80,21 @@ Special_FindThatSpeciesYourTrainerID: ; c284 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_DisplayLinkRecord: ; c2da 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 @@ Special_CheckMysteryGift: ; c2f6 inc a .no - ld [ScriptVar], a + ld [wScriptVar], a call CloseSRAM ret ; c309 @@ -156,28 +156,28 @@ Special_GetMysteryGiftItem: ; c309 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_GetMysteryGiftItem: ; c309 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 @@ Special_UnownPuzzle: ; c360 call FadeToMenu farcall UnownPuzzle ld a, [wSolvedUnownPuzzle] - ld [ScriptVar], a + ld [wScriptVar], a call ExitAllMenus ret ; c373 @@ -258,8 +258,8 @@ Special_CheckCoins: ; c3ae 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,23 +299,23 @@ Special_ClearBGPalettesBufferScreen: ; c3db 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 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,16 +365,16 @@ Special_SnorlaxAwake: ; 0xc43d ; 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] 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 @@ Special_SnorlaxAwake: ; 0xc43d .nope xor a .done - ld [ScriptVar], a + ld [wScriptVar], a ret .ProximityCoords: @@ -412,7 +412,7 @@ Special_SnorlaxAwake: ; 0xc43d Special_PlayCurMonCry: ; c472 - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] jp PlayMonCry ; c478 @@ -435,17 +435,17 @@ Special_GameboyCheck: ; c478 .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 @@ Special_TrainerHouse: ; 0xc4b9 ld a, BANK(sMysteryGiftTrainerHouseFlag) call GetSRAMBank ld a, [sMysteryGiftTrainerHouseFlag] - ld [ScriptVar], a + ld [wScriptVar], a jp CloseSRAM diff --git a/engine/sprites.asm b/engine/sprites.asm index 6816e413324..d97dab37417 100755 --- a/engine/sprites.asm +++ b/engine/sprites.asm @@ -62,9 +62,9 @@ DoNextFrameForAllSprites: ; 8cf7a ld l, a ld h, HIGH(wVirtualOAM) -.loop2 ; Clear (wVirtualOAM + [wCurrSpriteOAMAddr] --> SpritesEnd) +.loop2 ; Clear (wVirtualOAM + [wCurrSpriteOAMAddr] --> wSpritesEnd) ld a, l - cp LOW(SpritesEnd) + cp LOW(wSpritesEnd) jr nc, .done xor a ld [hli], a @@ -100,11 +100,11 @@ DoNextFrameForFirst16Sprites: ; 8cfa8 (23:4fa8) ld a, [wCurrSpriteOAMAddr] ld l, a - ld h, HIGH(Sprite17) + ld h, HIGH(wSprite17) .loop2 ; Clear (wVirtualOAM + [wCurrSpriteOAMAddr] --> Sprites + $40) ld a, l - cp LOW(Sprite17) + cp LOW(wSprite17) jr nc, .done xor a ld [hli], a @@ -302,7 +302,7 @@ UpdateAnimFrame: ; 8d04c inc de ld a, e ld [wCurrSpriteOAMAddr], a - cp LOW(SpritesEnd) + cp LOW(wSpritesEnd) jr nc, .reached_the_end dec c jr nz, .loop @@ -649,7 +649,7 @@ AnimateEndOfExpBar: ; 8e79d ; 8e7c6 .AnimateFrame: ; 8e7c6 - ld hl, Sprite01 + ld hl, wSprite01 ld c, 8 ; number of animated circles .anim_loop ld a, c diff --git a/engine/start_menu.asm b/engine/start_menu.asm index c0c4a38a3ab..f0cacc5b1c0 100755 --- a/engine/start_menu.asm +++ b/engine/start_menu.asm @@ -88,7 +88,7 @@ StartMenu:: ; 125cd call .DrawMenuAccount call SetUpMenu ld a, $ff - ld [MenuSelection], a + ld [wMenuSelection], a .loop call .PrintMenuAccount call GetScrollingMenuJoypad @@ -166,7 +166,7 @@ StartMenu:: ; 125cd .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 @@ StartMenu:: ; 125cd .OpenMenu: ; 127e5 - ld a, [MenuSelection] + ld a, [wMenuSelection] call .GetMenuAccountTextPointer ld a, [hli] ld h, [hl] @@ -230,7 +230,7 @@ StartMenu:: ; 125cd .MenuString: ; 127ef push de - ld a, [MenuSelection] + ld a, [wMenuSelection] call .GetMenuAccountTextPointer inc hl inc hl @@ -244,7 +244,7 @@ StartMenu:: ; 125cd .MenuDesc: ; 12800 push de - ld a, [MenuSelection] + ld a, [wMenuSelection] cp $ff jr z, .none call .GetMenuAccountTextPointer @@ -289,7 +289,7 @@ endr call .AppendMenuList .no_pokedex - ld a, [PartyCount] + ld a, [wPartyCount] and a jr z, .no_pokemon ld a, 1 ; pokemon @@ -333,19 +333,19 @@ endr ld a, 6 ; exit call .AppendMenuList ld a, c - ld [MenuItemsList], a + ld [wMenuItemsList], a ret ; 1288d .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 @@ endr ; 128cb .IsMenuAccountOn: ; 128cb - ld a, [Options2] + ld a, [wOptions2] and 1 ret ; 128d1 @@ -473,7 +473,7 @@ StartMenu_Status: ; 12928 StartMenu_Pokedex: ; 12937 - ld a, [PartyCount] + ld a, [wPartyCount] and a jr z, .asm_12949 @@ -517,7 +517,7 @@ StartMenu_Pack: ; 1295b StartMenu_Pokemon: ; 12976 - ld a, [PartyCount] + ld a, [wPartyCount] and a jr z, .return @@ -525,7 +525,7 @@ StartMenu_Pokemon: ; 12976 .choosemenu xor a - ld [PartyMenuActionText], a ; Choose a POKéMON. + ld [wPartyMenuActionText], a ; Choose a POKéMON. call ClearBGPalettes .menu @@ -566,16 +566,16 @@ StartMenu_Pokemon: ; 12976 ; 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 @@ TossItemFromPC: ; 129f4 pop af jr c, .quit pop hl - ld a, [CurItemQuantity] + ld a, [wCurItemQuantity] call TossItem call PartyMonItemName ld hl, .TossedThisMany @@ -667,7 +667,7 @@ CantUseItemText: ; 12a67 PartyMonItemName: ; 12a6c - ld a, [CurItem] + ld a, [wCurItem] ld [wd265], a call GetItemName call CopyName1 @@ -689,7 +689,7 @@ PokemonActionSubmenu: ; 12a88 call ClearBox farcall MonSubmenu call GetCurNick - ld a, [MenuSelection] + ld a, [wMenuSelection] ld hl, .Actions ld de, 3 call IsInArray @@ -732,11 +732,11 @@ PokemonActionSubmenu: ; 12a88 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 @@ SwitchPartyMons: ; 12aec farcall InitPartyMenuNoCancel ld a, PARTYMENUACTION_MOVE - ld [PartyMenuActionText], a + ld [wPartyMenuActionText], a farcall WritePartyMenuTilemap farcall PrintPartyMenuText @@ -765,7 +765,7 @@ SwitchPartyMons: ; 12aec farcall _SwitchPartyMons xor a - ld [PartyMenuActionText], a + ld [wPartyMenuActionText], a farcall LoadPartyMenuGFX farcall InitPartyMenuWithCancel @@ -776,7 +776,7 @@ SwitchPartyMons: ; 12aec .DontSwitch: xor a - ld [PartyMenuActionText], a + ld [wPartyMenuActionText], a call CancelPokemonAction ret ; 12b60 @@ -785,7 +785,7 @@ SwitchPartyMons: ; 12aec GiveTakePartyMonItem: ; 12b60 ; Eggs can't hold items! - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp EGG jr z, .cancel @@ -796,7 +796,7 @@ GiveTakePartyMonItem: ; 12b60 jr c, .cancel call GetCurNick - ld hl, StringBuffer1 + ld hl, wStringBuffer1 ld de, wMonOrItemNameBuffer ld bc, MON_NAME_LENGTH call CopyBytes @@ -896,23 +896,23 @@ TryGiveItemToPartymon: ; 12bd9 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 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 @@ TryGiveItemToPartymon: ; 12bd9 GivePartyItem: ; 12c4c call GetPartyItemLocation - ld a, [CurItem] + ld a, [wCurItem] ld [hl], a ld d, a farcall ItemIsMail @@ -945,7 +945,7 @@ TakePartyItem: ; 12c60 and a jr z, .asm_12c8c - ld [CurItem], a + ld [wCurItem], a call ReceiveItemFromPokemon jr nc, .asm_12c94 @@ -1040,7 +1040,7 @@ GetPartyItemLocation: ; 12cd7 ReceiveItemFromPokemon: ; 12cdf ld a, $1 ld [wItemQuantityChangeBuffer], a - ld hl, NumItems + ld hl, wNumItems jp ReceiveItem ; 12cea @@ -1048,7 +1048,7 @@ ReceiveItemFromPokemon: ; 12cdf GiveItemToPokemon: ; 12cea (4:6cea) ld a, $1 ld [wItemQuantityChangeBuffer], a - ld hl, NumItems + ld hl, wNumItems jp TossItem StartMenuYesNo: ; 12cf5 @@ -1061,19 +1061,19 @@ StartMenuYesNo: ; 12cf5 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 @@ MonMailAction: ; 12d45 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 @@ MonMailAction: ; 12d45 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 @@ OpenPartyStats: ; 12e00 call ClearSprites ; PartyMon xor a - ld [MonType], a + ld [wMonType], a call LowVolume predef StatsScreenInit call MaxVolume @@ -1379,7 +1379,7 @@ MonMenu_Softboiled_MilkDrink: ; 12ee6 .finish xor a - ld [PartyMenuActionText], a + ld [wPartyMenuActionText], a ld a, $3 ret ; 12f00 @@ -1448,7 +1448,7 @@ MonMenu_SweetScent: ; 12f50 ; 12f5b ChooseMoveToDelete: ; 12f5b - ld hl, Options + ld hl, wOptions ld a, [hl] push af set NO_TEXT_SCROLL, [hl] @@ -1456,7 +1456,7 @@ ChooseMoveToDelete: ; 12f5b call .ChooseMoveToDelete pop bc ld a, b - ld [Options], a + ld [wOptions], a push af call ClearBGPalettes pop af @@ -1513,16 +1513,16 @@ DeleteMoveScreenAttrs: ; 12fb2 ; 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 @@ ManagePokemonMoves: ; 12fba ; 12fd5 MoveScreenLoop: ; 12fd5 - ld a, [CurPartyMon] + ld a, [wCurPartyMon] inc a ld [wPartyMenuCursor], a call SetUpMoveScreenBG @@ -1597,12 +1597,12 @@ MoveScreenLoop: ; 12fd5 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 @@ MoveScreenLoop: ; 12fd5 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 @@ MoveScreenLoop: ; 12fd5 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 @@ MoveScreenLoop: ; 12fd5 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 @@ MoveScreenLoop: ; 12fd5 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 @@ SetUpMoveScreenBG: ; 13172 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 @@ SetUpMoveScreenBG: ; 13172 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 @@ SetUpMoveScreenBG: ; 13172 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 @@ SetUpMoveList: ; 131ef 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 @@ SetUpMoveList: ; 131ef ; 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 @@ PrepareToPlaceMoveData: ; 13235 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 @@ PlaceMoveData: ; 13256 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 @@ Function132d3: ; 132d3 ; 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 @@ Function132da: ; 132da ; 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] diff --git a/engine/stats_screen.asm b/engine/stats_screen.asm index a65cecc8aa7..e55c85c861a 100755 --- a/engine/stats_screen.asm +++ b/engine/stats_screen.asm @@ -156,7 +156,7 @@ MonStatsInit: ; 4dd72 (13:5d72) call ClearTileMap farcall HDMATransferTileMapToWRAMBank3 call StatsScreen_CopyToTempMon - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp EGG jr z, .egg call StatsScreen_InitUpperHalf @@ -227,24 +227,24 @@ StatsScreenWaitCry: ; 4dde6 (13:5de6) 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 .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_CopyToTempMon: ; 4ddf2 (13:5df2) StatsScreen_GetJoypad: ; 4de2c (13:5e2c) call GetJoypad - ld a, [MonType] + ld a, [wMonType] cp TEMPMON jr nz, .notbreedmon push hl @@ -301,22 +301,22 @@ StatsScreen_JoypadAction: ; 4de54 (13:5e54) 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 @@ StatsScreen_JoypadAction: ; 4de54 (13:5e54) 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 @@ StatsScreen_InitUpperHalf: ; 4deea (13:5eea) 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 @@ StatsScreen_InitUpperHalf: ; 4deea (13:5eea) 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 @@ StatsScreen_InitUpperHalf: ; 4deea (13:5eea) 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 @@ StatsScreen_InitUpperHalf: ; 4deea (13:5eea) ; 4df77 (13:5f77) .NicknamePointers: ; 4df77 - dw PartyMonNicknames - dw OTPartyMonNicknames + dw wPartyMonNicknames + dw wOTPartyMonNicknames dw sBoxMonNicknames dw wBufferMonNick ; 4df7f @@ -484,7 +484,7 @@ StatsScreen_PlacePageSwitchArrows: ; 4df9b (13:5f9b) ret StatsScreen_PlaceShinyIcon: ; 4dfa6 (13:5fa6) - ld bc, TempMonDVs + ld bc, wTempMonDVs farcall CheckShininess ret nc hlcoord 19, 0 @@ -492,9 +492,9 @@ StatsScreen_PlaceShinyIcon: ; 4dfa6 (13:5fa6) 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 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6) 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 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6) 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 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6) 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 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6) 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 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6) 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 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6) 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 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6) 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 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6) farcall CheckNickErrors hlcoord 2, 13 call PlaceString - ld a, [TempMonCaughtGender] + ld a, [wTempMonCaughtGender] and a jr z, .done cp $7f @@ -792,8 +792,8 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6) ; 4e216 (13:6216) .OTNamePointers: ; 4e216 - dw PartyMonOT - dw OTPartyMonOT + dw wPartyMonOT + dw wOTPartyMonOT dw sBoxMonOT dw wBufferMonOT ; 4e21e @@ -807,7 +807,7 @@ OTString: ; 4e222 StatsScreen_PlaceFrontpic: ; 4e226 (13:6226) - ld hl, TempMonDVs + ld hl, wTempMonDVs predef GetUnownLetter call StatsScreen_GetAnimationParam jr c, .egg @@ -828,14 +828,14 @@ StatsScreen_PlaceFrontpic: ; 4e226 (13:6226) .cry call SetPalettes call .AnimateMon - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] call PlayMonCry2 ret .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 @@ StatsScreen_PlaceFrontpic: ; 4e226 (13:6226) ret .AnimateEgg: ; 4e271 (13:6271) - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp UNOWN jr z, .unownegg ld a, TRUE @@ -865,7 +865,7 @@ StatsScreen_PlaceFrontpic: ; 4e226 (13:6226) ret .get_animation ; 4e289 (13:6289) - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] call IsAPokemon ret c call StatsScreen_LoadTextBoxSpaceGFX @@ -880,7 +880,7 @@ StatsScreen_PlaceFrontpic: ; 4e226 (13:6226) ret StatsScreen_GetAnimationParam: ; 4e2ad (13:62ad) - ld a, [MonType] + ld a, [wMonType] ld hl, .Jumptable rst JumpTable ret @@ -893,8 +893,8 @@ StatsScreen_GetAnimationParam: ; 4e2ad (13:62ad) 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 @@ StatsScreen_GetAnimationParam: ; 4e2ad (13:62ad) .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 @@ StatsScreen_GetAnimationParam: ; 4e2ad (13:62ad) 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 @@ EggStatsScreen: ; 4e33a 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 @@ EggStatsScreen: ; 4e33a farcall HDMATransferTileMapToWRAMBank3 call StatsScreen_AnimateEgg - ld a, [TempMonHappiness] + ld a, [wTempMonHappiness] cp 6 ret nc ld de, SFX_2_BOOPS @@ -1059,7 +1059,7 @@ EggALotMoreTimeString: ; 0x4e46e 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 @@ StatsScreen_LoadPageIndicators: ; 4e4cd (13:64cd) 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 @@ CopyNickname: ; 4e505 (13:6505) ret GetNicknamePointer: ; 4e528 (13:6528) - ld a, [MonType] + ld a, [wMonType] add a ld c, a ld b, 0 @@ -1146,10 +1146,10 @@ GetNicknamePointer: ; 4e528 (13:6528) 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 diff --git a/engine/tempmon.asm b/engine/tempmon.asm index be989d14be9..03bec37559a 100644 --- 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 @@ CopyPkmnToTempMon: ; 5084a 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 @@ CalcwBufferMonStats: ; 5088b 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 @@ _TempMonStatsCalculation: ; 50893 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 @@ _TempMonStatsCalculation: ; 50893 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 @@ GetPkmnSpecies: ; 508d5 ; WILDMON .partymon - ld hl, PartySpecies + ld hl, wPartySpecies jr .done .otpartymon - ld hl, OTPartySpecies + ld hl, wOTPartySpecies jr .done .boxmon @@ -123,5 +123,5 @@ GetPkmnSpecies: ; 508d5 ld a, [hl] .done2 - ld [CurPartySpecies], a + ld [wCurPartySpecies], a ret diff --git a/engine/tile_events.asm b/engine/tile_events.asm index 23a7a3c85b1..705c0e42736 100755 --- 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 @@ CheckWarpCollision:: ; 1499a 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 @@ CheckDirectionalWarp:: ; 149af CheckWarpFacingDown: ; 149c6 ld de, 1 ld hl, .blocks - ld a, [PlayerStandingTile] + ld a, [wPlayerStandingTile] call IsInArray ret ; 149d3 @@ -58,7 +58,7 @@ CheckWarpFacingDown: ; 149c6 ; 149dd CheckGrassCollision:: ; 149dd - ld a, [PlayerStandingTile] + ld a, [wPlayerStandingTile] ld hl, .blocks ld de, 1 call IsInArray @@ -98,7 +98,7 @@ CheckCutCollision: ; 149f5 ; 14a07 GetWarpSFX:: ; 14a07 - ld a, [PlayerStandingTile] + ld a, [wPlayerStandingTile] ld de, SFX_ENTER_DOOR cp COLL_DOOR ret z diff --git a/engine/tileset_anims.asm b/engine/tileset_anims.asm index 931fcba099f..9c32d7821e3 100644 --- a/engine/tileset_anims.asm +++ b/engine/tileset_anims.asm @@ -4,9 +4,9 @@ _AnimateTileset:: ; fc000 ; 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,20 +301,20 @@ WaitTileAnimation: ; fc2fe ; fc2ff StandingTileFrame8: ; fc2ff - ld a, [TileAnimationTimer] + ld a, [wTileAnimationTimer] inc a and %111 - ld [TileAnimationTimer], a + ld [wTileAnimationTimer], a ret ; fc309 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 @@ ScrollTileRightLeft: ; fc309 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 @@ AnimateFountain: ; fc387 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 @@ AnimateWaterTile: ; fc402 ld b, h ld c, l - ld a, [TileAnimationTimer] + ld a, [wTileAnimationTimer] ; 4 tile graphics, updated every other frame. and %110 @@ -508,7 +508,7 @@ ForestTreeLeftAnimation: ; fc45c jr .asm_fc47d .asm_fc46c - ld a, [TileAnimationTimer] + ld a, [wTileAnimationTimer] call GetForestTreeFrame add a add a @@ -550,7 +550,7 @@ ForestTreeRightAnimation: ; fc4c4 jr .asm_fc4eb .asm_fc4d4 - ld a, [TileAnimationTimer] + ld a, [wTileAnimationTimer] call GetForestTreeFrame add a add a @@ -585,7 +585,7 @@ ForestTreeLeftAnimation2: ; fc4f2 jr .asm_fc515 .asm_fc502 - ld a, [TileAnimationTimer] + ld a, [wTileAnimationTimer] call GetForestTreeFrame xor 2 add a @@ -617,7 +617,7 @@ ForestTreeRightAnimation2: ; fc51c jr .asm_fc545 .asm_fc52c - ld a, [TileAnimationTimer] + ld a, [wTileAnimationTimer] call GetForestTreeFrame xor 2 add a @@ -675,7 +675,7 @@ AnimateFlowerTile: ; fc56d ld c, l ; Alternate tile graphic every other frame - ld a, [TileAnimationTimer] + ld a, [wTileAnimationTimer] and %10 ld e, a @@ -709,7 +709,7 @@ LavaBubbleAnim1: ; fc5cc 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 @@ LavaBubbleAnim2: ; fc5eb 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 @@ AnimateTowerPillarTile: ; fc645 ld b, h ld c, l - ld a, [TileAnimationTimer] + ld a, [wTileAnimationTimer] and %111 ; Get frame index a @@ -803,7 +803,7 @@ AnimateTowerPillarTile: ; fc645 StandingTileFrame: ; fc673 - ld hl, TileAnimationTimer + ld hl, wTileAnimationTimer inc [hl] ret ; fc678 @@ -833,7 +833,7 @@ AnimateWhirlpoolTile: ; fc678 ; 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 @@ -929,7 +929,7 @@ TileAnimationPalette: ; fc6d7 ret nz ; Only update on even frames. - ld a, [TileAnimationTimer] + ld a, [wTileAnimationTimer] ld l, a and 1 ; odd ret nz diff --git a/engine/tileset_palettes.asm b/engine/tileset_palettes.asm index 5a2190fc789..e2c39c0aba4 100644 --- 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 diff --git a/engine/time.asm b/engine/time.asm index 29c811810f0..9013fd79f4b 100755 --- a/engine/time.asm +++ b/engine/time.asm @@ -188,13 +188,13 @@ CheckBugContestTimer:: ; 114a4 (4:54a4) 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 @@ DoMysteryGiftIfDayHasPassed: ; 11548 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 @@ DoMysteryGiftIfDayHasPassed: ; 11548 .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 @@ _CalcHoursDaysSince: ; 115f8 ld [wHoursSince], a ; hours since _CalcDaysSince: - ld a, [CurDay] + ld a, [wCurDay] ld c, a sbc [hl] jr nc, .skip @@ -429,7 +429,7 @@ _CalcDaysSince: ; 11613 CopyDayHourMinSecToHL: ; 11613 - ld a, [CurDay] + ld a, [wCurDay] ld [hli], a ld a, [hHours] ld [hli], a @@ -441,13 +441,13 @@ CopyDayHourMinSecToHL: ; 11613 ; 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 @@ CopyDayHourToHL: ; 11626 ; 1162e CopyDayHourMinToHL: ; 1162e - ld a, [CurDay] + ld a, [wCurDay] ld [hli], a ld a, [hHours] ld [hli], a diff --git a/engine/time_capsule.asm b/engine/time_capsule.asm index 96f61833b7a..e366c1bbdcc 100755 --- a/engine/time_capsule.asm +++ b/engine/time_capsule.asm @@ -2,14 +2,14 @@ ValidateOTTrademon: ; fb57e ld a, [wd003] - ld hl, OTPartyMon1Species + ld hl, wOTPartyMon1Species call GetPartyLocation push hl ld a, [wd003] 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 @@ ValidateOTTrademon: ; fb57e 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 @@ ValidateOTTrademon: ; fb57e 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 @@ ValidateOTTrademon: ; fb57e 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 @@ Functionfb5dd: ; fb5dd 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 @@ Functionfb5dd: ; fb5dd 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 @@ Functionfb5dd: ; fb5dd 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 diff --git a/engine/timeofdaypals.asm b/engine/timeofdaypals.asm index 6dfa5657afa..781c2e91aaf 100644 --- a/engine/timeofdaypals.asm +++ b/engine/timeofdaypals.asm @@ -4,10 +4,10 @@ DummyPredef36: 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 @@ _TimeOfDayPals:: ; 8c011 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 @@ ReplaceTimeOfDayPals: ; 8c0e5 ; 8c117 GetTimePalette: ; 8c117 - ld a, [TimeOfDay] + ld a, [wTimeOfDay] ld e, a ld d, 0 ld hl, .TimePalettes @@ -336,7 +336,7 @@ GetTimePalFade: ; 8c17c ; else: dmg ; index - ld a, [TimeOfDayPal] + ld a, [wTimeOfDayPal] and %11 ; get fade table diff --git a/engine/timeset.asm b/engine/timeset.asm index 67aa9973eb1..99e4e6843f9 100755 --- a/engine/timeset.asm +++ b/engine/timeset.asm @@ -11,11 +11,11 @@ InitClock: ; 90672 (24:4672) 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 @@ InitClock: ; 90672 (24:4672) 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 @@ InitClock: ; 90672 (24:4672) 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 @@ Special_SetDayOfWeek: ; 90913 call YesNoBox jr c, .loop ld a, [wTempDayOfWeek] - ld [StringBuffer2], a + ld [wStringBuffer2], a call SetDayOfWeek call LoadStandardFont pop af @@ -534,7 +534,7 @@ Special_SetDayOfWeek: ; 90913 ; 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 @@ DebugDisplayTime: ; 90abc ld [hl], " " inc hl - ld de, StartDay + ld de, wStartDay call .PrintTime ld [hl], " " diff --git a/engine/title.asm b/engine/title.asm index 55ba145bf26..91bb21064c8 100644 --- a/engine/title.asm +++ b/engine/title.asm @@ -162,7 +162,7 @@ _TitleScreen: ; 10ed67 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 @@ _TitleScreen: ; 10ed67 ; 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 @@ _TitleScreen: ; 10ed67 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 @@ DrawTitleGraphic: ; 10eeef ; 10ef06 InitializeBackground: ; 10ef06 - ld hl, Sprite01 + ld hl, wSprite01 ld d, -$22 ld e, $0 ld c, 5 @@ -366,7 +366,7 @@ AnimateTitleCrystal: ; 10ef32 ; Stop at y=6 ; y is really from the bottom of the sprite, which is two tiles high - ld hl, Sprite01YCoord + ld hl, wSprite01YCoord ld a, [hl] cp 6 + 2 * TILE_WIDTH ret z diff --git a/engine/tmhm.asm b/engine/tmhm.asm index 1cdbe1fff14..9db3dc29115 100755 --- 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] diff --git a/engine/tmhm2.asm b/engine/tmhm2.asm index e000ef6ba81..442f73cfa22 100755 --- a/engine/tmhm2.asm +++ b/engine/tmhm2.asm @@ -7,10 +7,10 @@ TMHMPocket: ; 2c76f (b:476f) 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 @@ TMHMPocket: ; 2c76f (b:476f) 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 @@ GetTMHMItemMove: ; 2c7b6 (b:47b6) 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 @@ AskTeachTMHM: ; 2c7bf (b:47bf) 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 @@ AskTeachTMHM: ; 2c7bf (b:47bf) .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 @@ ChooseMonToLearnTMHM_NoRefresh: ; 2c80a farcall InitPartyMenuWithCancel farcall InitPartyMenuGFX ld a, PARTYMENUACTION_TEACH_TMHM - ld [PartyMenuActionText], a + ld [wPartyMenuActionText], a .loopback farcall WritePartyMenuTilemap farcall PrintPartyMenuText @@ -90,13 +90,13 @@ ChooseMonToLearnTMHM_NoRefresh: ; 2c80a 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 @@ TeachTMHM: ; 2c867 predef CanLearnTMHMMove push bc - ld a, [CurPartyMon] - ld hl, PartyMonNicknames + ld a, [wCurPartyMon] + ld hl, wPartyMonNicknames call GetNick pop bc @@ -147,7 +147,7 @@ TeachTMHM: ; 2c867 jr z, .nope farcall StubbedTrainerRankings_TMsHMsTaught - ld a, [CurItem] + ld a, [wCurItem] call IsHM ret c @@ -254,13 +254,13 @@ TMHM_ShowTMMoveDescription: ; 2c946 (b:4946) 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 @@ TMHM_CheckHoveringOverCancel: ; 2c98a (b:498a) jr nz, .loop ld a, c .okay - ld [CurItem], a + ld [wCurItem], a cp -1 ret @@ -340,7 +340,7 @@ TMHM_ScrollPocket: ; 2c9b1 (b:49b1) 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 @@ TMHM_String_Cancel: ; 2caae ; 2cab5 TMHM_GetCurrentPocketPosition: ; 2cab5 (b:4ab5) - ld hl, TMsHMs + ld hl, wTMsHMs ld a, [wTMHMPocketScrollPosition] ld b, a inc b @@ -523,7 +523,7 @@ Unreferenced_Function2cadf: ; 2cadf .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 @@ ConsumeTM: ; 2cb0c (b:4b0c) 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 @@ ConsumeTM: ; 2cb0c (b:4b0c) 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 @@ CountTMsHMs: ; 2cb2a (b:4b2a) PrintMoveDesc: ; 2cb3e push hl ld hl, MoveDescriptions - ld a, [CurSpecies] + ld a, [wCurSpecies] dec a ld c, a ld b, 0 diff --git a/engine/trade_animation.asm b/engine/trade_animation.asm index d662a78940e..04c31df8010 100755 --- a/engine/trade_animation.asm +++ b/engine/trade_animation.asm @@ -119,11 +119,11 @@ RunTradeAnimScript: ; 28fa1 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 @@ RunTradeAnimScript: ; 28fa1 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_ScrollOutRight2: ; 2940c 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_ShowGivemonData: ; 2942e 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 @@ TradeAnim_GetFrontpic: ; 29491 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 @@ TradeAnim_GetNickname: ; 294a9 push de ld [wd265], a call GetPokemonName - ld hl, StringBuffer1 + ld hl, wStringBuffer1 pop de ld bc, NAME_LENGTH call CopyBytes diff --git a/engine/trainer_card.asm b/engine/trainer_card.asm index 6d59660f7ec..e9d9147f500 100755 --- 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 @@ TrainerCard: ; 25105 .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 @@ TrainerCard_PrintTopHalfOfCard: ; 25299 (9:5299) 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 @@ TrainerCard_Page1_PrintDexCaught_GameTime: ; 2530a (9:530a) 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_Page2_3_PlaceLeadersFaces: ; 253f4 (9:53f4) 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 @@ TrainerCard_Page2_3_OAMUpdate: ; 25448 (9:5448) ld d, a ld a, [de] ld c, a - ld de, Sprite01 + ld de, wSprite01 ld b, NUM_JOHTO_BADGES .loop srl c diff --git a/engine/types.asm b/engine/types.asm index 931e98b92e5..dc0df61aef6 100644 --- 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 @@ PrintMonTypes: ; 5090d 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 @@ PrintMoveType: ; 5093a 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 @@ PrintType: ; 50953 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 @@ GetTypeName: ; 50964 ld a, [hli] ld h, [hl] ld l, a - ld de, StringBuffer1 + ld de, wStringBuffer1 ld bc, MOVE_NAME_LENGTH jp CopyBytes ; 5097b diff --git a/engine/unown_puzzle.asm b/engine/unown_puzzle.asm index 36f6dacd2ad..53d0b4d0c47 100755 --- a/engine/unown_puzzle.asm +++ b/engine/unown_puzzle.asm @@ -549,7 +549,7 @@ RedrawUnownPuzzlePieces: ; e14d9 ld hl, .OAM_NotHoldingPiece .load - ld de, Sprite01 + ld de, wSprite01 .loop ld a, [hli] cp -1 @@ -834,7 +834,7 @@ PuzzlePieceBorderData: ; e1703 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 diff --git a/engine/unused_title.asm b/engine/unused_title.asm index 516fc902eb0..cb6ab808a69 100644 --- a/engine/unused_title.asm +++ b/engine/unused_title.asm @@ -49,7 +49,7 @@ UnusedTitleScreen: ; 10c000 jr nz, .copy ld hl, UnusedTitleFG_OAM - ld de, Sprite01 + ld de, wSprite01 ld bc, SPRITEOAMSTRUCT_LENGTH * NUM_SPRITE_OAM_STRUCTS call CopyBytes diff --git a/engine/variables.asm b/engine/variables.asm index 1d174443ef1..25870a96740 100755 --- a/engine/variables.asm +++ b/engine/variables.asm @@ -29,36 +29,36 @@ _GetVarAction:: ; 80648 (20:4648) ret .loadstringbuffer2 ; 8066c (20:466c) - ld de, StringBuffer2 + ld de, wStringBuffer2 ld [de], a ret ; 80671 (20:4671) .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 .PlayerFacing, RETVAR_EXECUTE + dwb wPlayerState, RETVAR_ADDR_DE + dwb .wPlayerFacing, 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 .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 @@ _GetVarAction:: ; 80648 (20:4648) .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 @@ _GetVarAction:: ; 80648 (20:4648) .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 @@ -96,9 +96,9 @@ _GetVarAction:: ; 80648 (20:4648) jp .loadstringbuffer2 ; 806ef -.PlayerFacing: ; 806ef +.wPlayerFacing: ; 806ef ; The direction the player is facing. - ld a, [PlayerDirection] + ld a, [wPlayerDirection] and $c rrca rrca @@ -118,7 +118,7 @@ _GetVarAction:: ; 80648 (20:4648) jp .loadstringbuffer2 .count - ld hl, UnownDex + ld hl, wUnownDex ld b, 0 .loop ld a, [hli] diff --git a/engine/warp_connection.asm b/engine/warp_connection.asm index e15809c04c6..8d673de4464 100755 --- a/engine/warp_connection.asm +++ b/engine/warp_connection.asm @@ -30,24 +30,24 @@ EnterMapConnection: ; 1045d6 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 @@ EnterMapConnection: ; 1045d6 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 @@ EnterMapConnection: ; 1045d6 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 @@ EnterMapConnection: ; 1045d6 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 @@ LoadWarpData: ; 1046c6 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 @@ LoadWarpData: ; 1046c6 ret LoadMapTimeOfDay: ; 104750 - ld hl, VramState + ld hl, wVramState res 6, [hl] ld a, $1 ld [wSpriteUpdatesEnabled], a @@ -274,7 +274,7 @@ LoadMapTimeOfDay: ; 104750 and a ret z - decoord 0, 0, AttrMap + decoord 0, 0, wAttrMap ld a, $1 ld [rVBK], a .copy @@ -324,7 +324,7 @@ RefreshMapSprites: ; 1047f0 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 @@ CheckMovingOffEdgeOfMap:: ; 104820 (41:4820) 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 @@ CheckMovingOffEdgeOfMap:: ; 104820 (41:4820) ret .up - ld a, [PlayerStandingMapY] + ld a, [wPlayerStandingMapY] sub 4 cp -1 jr z, .ok @@ -368,7 +368,7 @@ CheckMovingOffEdgeOfMap:: ; 104820 (41:4820) ret .left - ld a, [PlayerStandingMapX] + ld a, [wPlayerStandingMapX] sub 4 cp -1 jr z, .ok @@ -376,10 +376,10 @@ CheckMovingOffEdgeOfMap:: ; 104820 (41:4820) 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 @@ CheckMovingOffEdgeOfMap:: ; 104820 (41:4820) 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 @@ GetCoordOfUpperLeftCorner:: ; 10486d 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 @@ GetCoordOfUpperLeftCorner:: ; 10486d 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 diff --git a/engine/wildmons.asm b/engine/wildmons.asm index 50d4ea2509c..f578a4f846b 100755 --- a/engine/wildmons.asm +++ b/engine/wildmons.asm @@ -193,8 +193,8 @@ TryWildEncounter:: ; 2a0e7 .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 @@ GetMapEncounterRate: ; 2a111 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 @@ ApplyMusicEffectOnEncounterRate:: ; 2a124 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 @@ ChooseWildEncounter: ; 2a14f 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 @@ ChooseWildEncounter: ; 2a14f ; 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 @@ ChooseWildEncounter: ; 2a14f .loadwildmon ld a, b - ld [TempWildMonSpecies], a + ld [wTempWildMonSpecies], a .startwildbattle xor a @@ -365,7 +365,7 @@ CheckRepelEffect:: ; 2a1df 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 @@ rept 4 dec hl endr - ld a, [CurPartyLevel] + ld a, [wCurPartyLevel] cp [hl] jr nc, .encounter and a @@ -470,9 +470,9 @@ _NormalWildmonOK ; 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 @@ CheckEncounterRoamMon: ; 2a2ce 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 @@ JumpRoamMon: ; 2a3cd 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 @@ _BackUpMapIndices: ; 2a3f6 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 @@ Special_RandomUnseenWildMon: ; 2a4ab 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 @@ Special_RandomUnseenWildMon: ; 2a4ab 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 @@ Special_RandomUnseenWildMon: ; 2a4ab 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 @@ Special_RandomPhoneWildMon: ; 2a51f .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 @@ Special_RandomPhoneWildMon: ; 2a51f 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 @@ Special_RandomPhoneMon: ; 2a567 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 diff --git a/home.asm b/home.asm index 58dcdb433a4..a45c135b7d1 100644 --- a/home.asm +++ b/home.asm @@ -91,9 +91,9 @@ DisableSpriteUpdates:: ; 0x2ed3 ; 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 @@ DisableSpriteUpdates:: ; 0x2ed3 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 @@ INCLUDE "home/string.asm" 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 @@ IsInJohto:: ; 2f17 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 @@ -170,7 +170,7 @@ INCLUDE "home/double_speed.asm" ClearSprites:: ; 300b ; Erase OAM data ld hl, wVirtualOAM - ld b, SpritesEnd - wVirtualOAM + ld b, wSpritesEnd - wVirtualOAM xor a .loop ld [hli], a @@ -181,7 +181,7 @@ ClearSprites:: ; 300b HideSprites:: ; 3016 ; Set all OAM y-positions to 160 to hide them offscreen - ld hl, Sprite01YCoord + ld hl, wSprite01YCoord ld de, SPRITEOAMSTRUCT_LENGTH ld b, NUM_SPRITE_OAM_STRUCTS ld a, SCREEN_WIDTH_PX @@ -196,14 +196,14 @@ HideSprites:: ; 3016 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 @@ Call_LoadTempTileMapToTileMap:: ; 30b4 ; 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 @@ LoadTempTileMapToTileMap:: ; 30bf ; 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 @@ INCLUDE "home/math.asm" 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 @@ PrintLetterDelay:: ; 313d 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 @@ PrintLetterDelay:: ; 313d ld a, TEXT_DELAY_FAST .updatedelay - ld [TextDelayFrames], a + ld [wTextDelayFrames], a .checkjoypad call GetJoypad @@ -358,7 +358,7 @@ PrintLetterDelay:: ; 313d jr .end .wait - ld a, [TextDelayFrames] + ld a, [wTextDelayFrames] and a jr nz, .checkjoypad @@ -575,7 +575,7 @@ CopyTilemapAtOnce:: ; 323d 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 @@ CountSetBits:: ; 0x335f ; 0x3376 GetWeekday:: ; 3376 - ld a, [CurDay] + ld a, [wCurDay] .mod sub 7 jr nc, .mod @@ -792,7 +792,7 @@ ScrollingMenu:: ; 350c ; 3524 .UpdatePalettes: ; 3524 - ld hl, VramState + ld hl, wVramState bit 0, [hl] jp nz, UpdateTimePals jp SetPalettes @@ -1068,7 +1068,7 @@ PrepMonFrontpic:: ; 3786 ld [wBoxAlignment], a _PrepMonFrontpic:: ; 378b - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] call IsAPokemon jr c, .not_pokemon @@ -1088,16 +1088,16 @@ _PrepMonFrontpic:: ; 378b xor a ld [wBoxAlignment], a inc a - ld [CurPartySpecies], a + ld [wCurPartySpecies], a ret ; 37b6 INCLUDE "home/cry.asm" PrintLevel:: ; 382d -; Print TempMonLevel at hl +; Print wTempMonLevel at hl - ld a, [TempMonLevel] + ld a, [wTempMonLevel] ld [hl], "" inc hl @@ -1146,7 +1146,7 @@ GetBaseData:: ; 3856 rst Bankswitch ; Egg doesn't have BaseData - ld a, [CurSpecies] + ld a, [wCurSpecies] cp EGG jr z, .egg @@ -1155,7 +1155,7 @@ GetBaseData:: ; 3856 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 @@ GetBaseData:: ; 3856 ; 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 @@ GetBaseData:: ; 3856 .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 @@ GetBaseData:: ; 3856 ; 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 @@ GetNick:: ; 38a2 push bc call SkipNames - ld de, StringBuffer1 + ld de, wStringBuffer1 push de ld bc, MON_NAME_LENGTH @@ -1301,13 +1301,13 @@ PrintBCDDigit:: ; 38f2 ; 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 @@ PushLYOverrides:: ; 3b0c 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 diff --git a/home/audio.asm b/home/audio.asm index 307af3b8c5d..8809c52d2d3 100644 --- a/home/audio.asm +++ b/home/audio.asm @@ -55,14 +55,14 @@ UpdateSound:: ; 3b6a _LoadMusicByte:: ; 3b86 -; CurMusicByte = [a:de] +; wCurMusicByte = [a:de] GLOBAL LoadMusicByte ld [hROMBank], a ld [MBC3RomBank], a ld a, [de] - ld [CurMusicByte], a + ld [wCurMusicByte], a ld a, BANK(LoadMusicByte) ld [hROMBank], a @@ -168,13 +168,13 @@ endr 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 @@ PlaySFX:: ; 3c23 jr nc, .play ; Does it have priority? - ld a, [CurSFX] + ld a, [wCurSFX] cp e jr c, .done @@ -220,7 +220,7 @@ PlaySFX:: ; 3c23 ld [MBC3RomBank], a ld a, e - ld [CurSFX], a + ld [wCurSFX], a call _PlaySFX pop af @@ -249,16 +249,16 @@ WaitSFX:: ; 3c55 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 @@ IsSFXPlaying:: ; 3c74 ; 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 @@ -314,13 +314,13 @@ VolumeOff:: ; 3ca3 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 @@ FadeToMapMusic:: ; 3cbc 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 @@ EnterMapMusic:: ; 3d03 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 @@ RestartMapMusic:: ; 3d47 ; 3d62 SpecialMapMusic:: ; 3d62 - ld a, [PlayerState] + ld a, [wPlayerState] cp PLAYER_SURF jr z, .surf cp PLAYER_SURF_PIKA @@ -480,10 +480,10 @@ SpecialMapMusic:: ; 3d62 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 @@ Unreferenced_Function3d9f:: ; 3d9f ; Places a BCD number at the ; upper center of the screen. ld a, 4 * TILE_WIDTH - ld [Sprite39YCoord], a - ld [Sprite40YCoord], a + ld [wSprite39YCoord], a + ld [wSprite40YCoord], a ld a, 10 * TILE_WIDTH - ld [Sprite39XCoord], a + ld [wSprite39XCoord], a ld a, 11 * TILE_WIDTH - ld [Sprite40XCoord], a + ld [wSprite40XCoord], a xor a - ld [Sprite39Attributes], a - ld [Sprite40Attributes], a + ld [wSprite39Attributes], a + ld [wSprite40Attributes], a ld a, [wc296] cp 100 jr nc, .max @@ -524,32 +524,32 @@ Unreferenced_Function3d9f:: ; 3d9f swap a and $f add "0" - ld [Sprite39TileID], a + ld [wSprite39TileID], a ld a, b and $f add "0" - ld [Sprite40TileID], a + ld [wSprite40TileID], a ret .max ld a, "9" - ld [Sprite39TileID], a - ld [Sprite40TileID], a + ld [wSprite39TileID], a + ld [wSprite40TileID], 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 @@ CheckSFX:: ; 3dde 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,21 +575,21 @@ TerminateExpBarSound:: ; 3dfe 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 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 diff --git a/home/battle.asm b/home/battle.asm index 30096fd4a5b..b4b7cf84418 100644 --- a/home/battle.asm +++ b/home/battle.asm @@ -25,13 +25,13 @@ OpponentPartyAttr:: ; 3951 BattlePartyAttr:: ; 395d -; Get attribute a from the active BattleMon's party struct. +; Get attribute a from the active wBattleMon's party struct. 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 @@ BattlePartyAttr:: ; 395d OTPartyAttr:: ; 396d -; Get attribute a from the active EnemyMon's party struct. +; Get attribute a from the active wEnemyMon's party struct. 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 @@ OTPartyAttr:: ; 396d ResetDamage:: ; 397d xor a - ld [CurDamage], a - ld [CurDamage + 1], a + ld [wCurDamage], a + ld [wCurDamage + 1], a ret ; 3985 @@ -89,16 +89,16 @@ UpdateUserInParty:: ; 3995 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 @@ UpdateEnemyMonInParty:: ; 39b0 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 @@ -216,19 +216,19 @@ GetBattleVarAddr:: ; 39e7 .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 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 CurPlayerMove, CurEnemyMove - dw LastPlayerCounterMove, LastEnemyCounterMove - dw LastPlayerMove, LastEnemyMove + dw wCurPlayerMove, wCurEnemyMove + dw wLastPlayerCounterMove, wLastEnemyCounterMove + dw wLastPlayerMove, wLastEnemyMove ; 3a90 @@ -317,9 +317,9 @@ GLOBAL BattleAnimCommands 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 +332,7 @@ GetBattleAnimByte:: ; 3af0 push hl push de - ld hl, BattleAnimAddress + ld hl, wBattleAnimAddress ld e, [hl] inc hl ld d, [hl] @@ -341,7 +341,7 @@ GetBattleAnimByte:: ; 3af0 rst Bankswitch ld a, [de] - ld [BattleAnimByte], a + ld [wBattleAnimByte], a inc de ld a, BANK(BattleAnimCommands) @@ -354,6 +354,6 @@ GetBattleAnimByte:: ; 3af0 pop de pop hl - ld a, [BattleAnimByte] + ld a, [wBattleAnimByte] ret ; 3b0c diff --git a/home/copy.asm b/home/copy.asm index 33268b6bf09..9bd79ce3740 100644 --- a/home/copy.asm +++ b/home/copy.asm @@ -235,23 +235,23 @@ Request2bpp:: ; eba .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 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 @@ Request2bpp:: ; eba .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,23 +311,23 @@ Request1bpp:: ; f1e .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 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 @@ Request1bpp:: ; f1e .iterate ld a, [hTilesPerCycle] - ld [Requested1bpp], a + ld [wRequested1bpp], a .wait2 call DelayFrame - ld a, [Requested1bpp] + ld a, [wRequested1bpp] and a jr nz, .wait2 diff --git a/home/cry.asm b/home/cry.asm index 204b02ba4e2..93983a6aeb8 100644 --- a/home/cry.asm +++ b/home/cry.asm @@ -29,7 +29,7 @@ PlayMonCry2:: ; 37d5 push af xor a ld [wStereoPanningMask], a - ld [CryTracks], a + ld [wCryTracks], a pop af call _PlayMonCry ret @@ -76,13 +76,13 @@ endr 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 diff --git a/home/delay.asm b/home/delay.asm index 450b4190c80..300f65c88eb 100644 --- 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 diff --git a/home/fade.asm b/home/fade.asm index d81a49c6c5e..1a6f87c634c 100644 --- 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 diff --git a/home/flag.asm b/home/flag.asm index 5f1d783afca..0b1390c99a4 100644 --- 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 @@ ResetFlashIfOutOfCave:: ; 2e5d EventFlagAction:: ; 0x2e6f - ld hl, EventFlags + ld hl, wEventFlags call FlagAction ret diff --git a/home/game_time.asm b/home/game_time.asm index 36dcaa28247..feaa096083a 100644 --- 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 @@ GameTimer:: ; 209e ld a, [rSVBK] push af - ld a, BANK(GameTime) + ld a, BANK(wGameTime) ld [rSVBK], a call UpdateGameTimer @@ -43,13 +43,13 @@ UpdateGameTimer:: ; 20ad 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 @@ UpdateGameTimer:: ; 20ad ld [hl], a ; +1 second - ld hl, GameTimeSeconds + ld hl, wGameTimeSeconds ld a, [hl] inc a @@ -81,7 +81,7 @@ UpdateGameTimer:: ; 20ad ld [hl], a ; +1 minute - ld hl, GameTimeMinutes + ld hl, wGameTimeMinutes ld a, [hl] inc a @@ -97,9 +97,9 @@ UpdateGameTimer:: ; 20ad 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 @@ UpdateGameTimer:: ; 20ad 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 diff --git a/home/joypad.asm b/home/joypad.asm index 94d9610de1e..f46ab5c983e 100644 --- a/home/joypad.asm +++ b/home/joypad.asm @@ -129,7 +129,7 @@ GetJoypad:: ; 984 ; 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 @@ GetJoypad:: ; 984 ; 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 @@ GetJoypad:: ; 984 ; 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 @@ GetJoypad:: ; 984 .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 @@ GetJoypad:: ; 984 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 @@ StartAutoInput:: ; 9ee ld [hJoyDown], a ; currently pressed ld a, AUTO_INPUT - ld [InputType], a + ld [wInputType], a ret ; a0a @@ -261,12 +261,12 @@ StartAutoInput:: ; 9ee 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 @@ JoyTextDelay:: ; a57 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 @@ JoyTextDelay:: ; a57 .restartframedelay ld a, 5 - ld [TextDelayFrames], a + ld [wTextDelayFrames], a ret ; a80 @@ -411,7 +411,7 @@ ButtonSound:: ; aaf push af ld a, $1 ld [hOAMUpdate], a - ld a, [InputType] + ld a, [wInputType] or a jr z, .input_wait_loop farcall _DudeAutoInput_A diff --git a/home/lcd.asm b/home/lcd.asm index e2fb4c5a96b..3899f081623 100644 --- a/home/lcd.asm +++ b/home/lcd.asm @@ -6,7 +6,7 @@ Unreferenced_Function547:: ; 547 cp rSCX - $ff00 ret nz ld c, a - ld a, [LYOverrides] + ld a, [wLYOverrides] ld [$ff00+c], a ret ; 552 @@ -22,7 +22,7 @@ LCD:: ; 552 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] diff --git a/home/map.asm b/home/map.asm index a66391896f8..252b68cbe99 100644 --- a/home/map.asm +++ b/home/map.asm @@ -29,9 +29,9 @@ GetCurrentMapSceneID:: ; 212a ; 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 @@ LoadMapPart:: ; 217a ld a, [hROMBank] push af - ld a, [TilesetBlocksBank] + ld a, [wTilesetBlocksBank] rst Bankswitch call LoadMetatiles @@ -145,13 +145,13 @@ LoadMetatiles:: ; 2198 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 @@ LoadMetatiles:: ; 2198 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 @@ endr 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 @@ GetDestinationWarpNumber:: ; 2252 ; 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 @@ CopyWarpData:: ; 22a7 ld a, [hli] cp $ff jr nz, .skip - ld hl, BackupWarpNumber + ld hl, wBackupWarpNumber ld a, [hli] .skip @@ -358,9 +358,9 @@ CopyWarpData:: ; 22a7 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 @@ CopyMapDefAndData:: ; 2326 ReadMapEvents:: ; 2336 push af - ld hl, MapEventsPointer + ld hl, wMapEventsPointer ld a, [hli] ld h, [hl] ld l, a @@ -441,7 +441,7 @@ ReadMapEvents:: ; 2336 ; 234f ReadMapScripts:: ; 234f - ld hl, MapScriptsPointer + ld hl, wMapScriptsPointer ld a, [hli] ld h, [hl] ld l, a @@ -464,35 +464,35 @@ CopyMapData:: ; 235c 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 @@ GetMapConnections:: ; 2368 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 @@ ReadObjectEvents:: ; 241f push hl call ClearObjectStructs pop de - ld hl, Map1Object + ld hl, wMap1Object ld a, [de] inc de ld [wCurrMapObjectEventCount], a @@ -671,13 +671,13 @@ CopyMapObjectEvents:: ; 2457 ; 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,23 +693,23 @@ RestoreFacingAfterWarp:: ; 248a call GetMapScriptsBank rst Bankswitch - ld hl, MapEventsPointer + ld hl, wMapEventsPointer ld a, [hli] ld h, [hl] ld l, a 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 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 @@ RestoreFacingAfterWarp:: ; 248a .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 @@ ChangeMap:: ; 24e4 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 @@ ChangeMap:: ; 24e4 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 @@ ChangeMap:: ; 24e4 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 @@ FillSouthConnectionStrip:: ; 25d3 add hl, de pop de - ld a, [MapWidth] + ld a, [wMapWidth] add 6 add e ld e, a @@ -931,7 +931,7 @@ FillWestConnectionStrip:: FillEastConnectionStrip:: ; 25f6 .loop - ld a, [MapWidth] + ld a, [wMapWidth] add 6 ld [hConnectedMapWidth], a @@ -967,21 +967,21 @@ FillEastConnectionStrip:: ; 25f6 ; 261b LoadMapStatus:: ; 261b - ld [MapStatus], a + ld [wMapStatus], a ret ; 261f 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 @@ CallScript:: ; 261f 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,18 +1051,18 @@ RunMapCallback:: ; 263b 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] 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 @@ GetMovementData:: ; 26c7 ; 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 @@ UnmaskObject:: ; 271e ScrollMapDown:: ; 272a hlcoord 0, 0 - ld de, BGMapBuffer + ld de, wBGMapBuffer call BackupBGMapRow ld c, 2 * SCREEN_WIDTH call FarCallScrollBGMapPalettes @@ -1231,7 +1231,7 @@ ScrollMapDown:: ; 272a 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 @@ ScrollMapUp:: ; 2748 ScrollMapRight:: ; 2771 hlcoord 0, 0 - ld de, BGMapBuffer + ld de, wBGMapBuffer call BackupBGMapColumn ld c, 2 * SCREEN_HEIGHT call FarCallScrollBGMapPalettes @@ -1271,7 +1271,7 @@ ScrollMapRight:: ; 2771 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 @@ BackupBGMapColumn:: ; 27c0 ; 27d3 UpdateBGMapRow:: ; 27d3 - ld hl, BGMapBufferPtrs + ld hl, wBGMapBufferPtrs push de call .iteration pop de @@ -1357,7 +1357,7 @@ UpdateBGMapRow:: ; 27d3 ; 27f8 UpdateBGMapColumn:: ; 27f8 - ld hl, BGMapBufferPtrs + ld hl, wBGMapBufferPtrs ld c, SCREEN_HEIGHT .loop ld a, e @@ -1384,19 +1384,19 @@ UpdateBGMapColumn:: ; 27f8 ; 2816 Unreferenced_Function2816:: - ld hl, BGMapBuffer - ld bc, BGMapBufferEnd - BGMapBuffer + ld hl, wBGMapBuffer + ld bc, wBGMapBufferEnd - wBGMapBuffer xor a call ByteFill ret ; 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 @@ LoadTilesetGFX:: ; 2821 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 @@ BufferScreen:: ; 2879 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 @@ SaveScreen:: ; 289d 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 @@ LoadNeighboringBlockData:: ; 28e3 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 @@ SaveScreen_LoadNeighbor:: ; 28f7 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 @@ GetMovementPermissions:: ; 2914 adc h ld h, a ld a, [hl] - ld hl, TilePermissions + ld hl, wTilePermissions or [hl] ld [hl], a ret @@ -1608,41 +1608,41 @@ GetMovementPermissions:: ; 2914 ; 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 @@ GetMovementPermissions:: ; 2914 .Down: call .CheckHiNybble ret nz - ld a, [TileDown] + ld a, [wTileDown] and 7 cp $2 jr z, .ok_down @@ -1660,16 +1660,16 @@ GetMovementPermissions:: ; 2914 ret nz .ok_down - ld a, [TilePermissions] + ld a, [wTilePermissions] or FACE_DOWN - ld [TilePermissions], a + ld [wTilePermissions], a ret ; 29a8 .Up: call .CheckHiNybble ret nz - ld a, [TileUp] + ld a, [wTileUp] and 7 cp $3 jr z, .ok_up @@ -1679,16 +1679,16 @@ GetMovementPermissions:: ; 2914 ret nz .ok_up - ld a, [TilePermissions] + ld a, [wTilePermissions] or FACE_UP - ld [TilePermissions], a + ld [wTilePermissions], a ret ; 29c5 .Right: call .CheckHiNybble ret nz - ld a, [TileRight] + ld a, [wTileRight] and 7 cp $1 jr z, .ok_right @@ -1698,16 +1698,16 @@ GetMovementPermissions:: ; 2914 ret nz .ok_right - ld a, [TilePermissions] + ld a, [wTilePermissions] or FACE_RIGHT - ld [TilePermissions], a + ld [wTilePermissions], a ret ; 29e2 .Left: call .CheckHiNybble ret nz - ld a, [TileLeft] + ld a, [wTileLeft] and 7 cp $0 jr z, .ok_left @@ -1717,9 +1717,9 @@ GetMovementPermissions:: ; 2914 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 @@ GetFacingTileCoord:: ; 2a07 ; 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 @@ GetFacingTileCoord:: ; 2a07 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 @@ GetFacingTileCoord:: ; 2a07 .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 @@ GetCoordTile:: ; 2a3c 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 @@ GetCoordTile:: ; 2a3c inc hl .nocarry2 - ld a, [TilesetCollisionBank] + ld a, [wTilesetCollisionBank] call GetFarByte ret @@ -1812,11 +1812,11 @@ GetCoordTile:: ; 2a3c ; 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 @@ CheckFacingBGEvent:: ; 2a8b ; 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 @@ CheckCurrentMapCoordEvents:: ; 2ad4 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 @@ CheckCurrentMapCoordEvents:: ; 2ad4 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 @@ ReturnToMapWithSpeechTextbox:: ; 0x2b74 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 @@ ReloadTilesetAndPalettes:: ; 2bae 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 @@ ReloadTilesetAndPalettes:: ; 2bae ; 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 @@ GetMapDefField:: ; 0x2c04 ; 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 @@ GetAnyMapDefField:: ; 0x2c0c ; 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 @@ SwitchToAnyMapDataBank:: ; 2c24 ; 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 @@ PartialCopyMapDef:: ; 2c3d ; 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 @@ LoadTileset:: ; 2d27 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 diff --git a/home/map_objects.asm b/home/map_objects.asm index 1db2bb3bad4..97e4bae373f 100644 --- a/home/map_objects.asm +++ b/home/map_objects.asm @@ -18,7 +18,7 @@ GetSpritePalette:: ; 17ff 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 @@ GetSpriteVTile:: ; 180e 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,14 +75,14 @@ DoesSpriteHaveFacings:: ; 1836 ; 184a GetPlayerStandingTile:: ; 184a - ld a, [PlayerStandingTile] + ld a, [wPlayerStandingTile] call GetTileCollision ld b, a ret ; 1852 CheckOnWater:: ; 1852 - ld a, [PlayerStandingTile] + ld a, [wPlayerStandingTile] call GetTileCollision sub WATERTILE ret z @@ -204,7 +204,7 @@ CheckWaterfallTile:: ; 18bd ; 18c3 CheckStandingOnEntrance:: ; 18c3 - ld a, [PlayerStandingTile] + ld a, [wPlayerStandingTile] cp COLL_DOOR ret z cp COLL_DOOR_79 @@ -217,7 +217,7 @@ CheckStandingOnEntrance:: ; 18c3 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 @@ CheckObjectTime:: ; 18f5 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 @@ LoadMovementDataPointer:: ; 19e9 add hl, bc ld [hl], STEP_TYPE_00 - ld hl, VramState + ld hl, wVramState set 7, [hl] and a ret @@ -446,7 +446,7 @@ FindFirstEmptyObjectStruct:: ; 1a13 ; 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 @@ _GetMovementByte:: ; 1aae ; 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 @@ UpdateSprites:: ; 1ad2 GetObjectStruct:: ; 1ae5 ld bc, OBJECT_STRUCT_LENGTH - ld hl, ObjectStructs + ld hl, wObjectStructs call AddNTimes ld b, h ld c, l diff --git a/home/menu.asm b/home/menu.asm index f8ade3f5867..ae3252e969b 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -315,7 +315,7 @@ RunMenuItemPrintingFunction:: ; 1eda ld a, [de] cp -1 ret z - ld [MenuSelection], a + ld [wMenuSelection], a push de push hl ld d, h @@ -405,7 +405,7 @@ ContinueGettingMenuJoypad: 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 @@ ContinueGettingMenuJoypad: ld a, B_BUTTON ld [wMenuJoypad], a ld a, -1 - ld [MenuSelection], a + ld [wMenuSelection], a scf ret ; 1f79 @@ -426,7 +426,7 @@ PlaceMenuStrings:: ; 1f79 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 @@ PlaceMenuStrings:: ; 1f79 PlaceNthMenuStrings:: ; 1f8d push de - ld a, [MenuSelection] + ld a, [wMenuSelection] call GetMenuDataPointerTableEntry inc hl inc hl @@ -460,7 +460,7 @@ Unreferenced_Function1f9e:: ; 1f9e ; 1fa7 MenuJumptable:: ; 1fa7 - ld a, [MenuSelection] + ld a, [wMenuSelection] call GetMenuDataPointerTableEntry ld a, [hli] ld h, [hl] diff --git a/home/mobile.asm b/home/mobile.asm index 1248c3f7e1b..4be526bbccb 100644 --- a/home/mobile.asm +++ b/home/mobile.asm @@ -146,7 +146,7 @@ Unreferenced_Function3ed7:: ; 3ed7 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 @@ Unreferenced_Function3efd:: ; 3efd .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 @@ Unreferenced_Function3efd:: ; 3efd ; 3f20 Function3f20:: ; 3f20 - hlcoord 0, 0, AttrMap + hlcoord 0, 0, wAttrMap ld b, 6 ld c, 20 call Function3f35 diff --git a/home/movement.asm b/home/movement.asm index a7c9dbb5bc9..c2c45d12b08 100644 --- a/home/movement.asm +++ b/home/movement.asm @@ -4,9 +4,9 @@ InitMovementBuffer:: ; 1b1e 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 @@ AppendToMovementBuffer:: ; 1b3f ld e, [hl] inc [hl] ld d, 0 - ld hl, MovementBuffer + ld hl, wMovementBuffer add hl, de ld [hl], a pop de diff --git a/home/names.asm b/home/names.asm index 37ce4f37dfd..90a15c09301 100644 --- a/home/names.asm +++ b/home/names.asm @@ -4,14 +4,14 @@ NamesPointers:: ; 33ab 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 @@ GetName:: ; 33c3 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 @@ GetName:: ; 33c3 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 @@ GetBasePokemonName:: ; 3420 push hl call GetPokemonName - ld hl, StringBuffer1 + ld hl, wStringBuffer1 .loop ld a, [hl] cp "@" @@ -138,11 +138,11 @@ GetPokemonName:: ; 343b 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 @@ GetItemName:: ; 3468 cp TM01 jr nc, .TM - ld [CurSpecies], a + ld [wCurSpecies], a ld a, ITEM_NAME ld [wNamedObjectTypeBuffer], a call GetName @@ -170,7 +170,7 @@ GetItemName:: ; 3468 .TM: call GetTMHMName .Copied: - ld de, StringBuffer1 + ld de, wStringBuffer1 pop bc pop hl ret @@ -199,7 +199,7 @@ GetTMHMName:: ; 3487 ld bc, .TMTextEnd - .TMText .asm_34a1 - ld de, StringBuffer1 + ld de, wStringBuffer1 call CopyBytes ; TM/HM number @@ -268,10 +268,10 @@ GetMoveName:: ; 34f8 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 diff --git a/home/pokedex_flags.asm b/home/pokedex_flags.asm index bedb91d181c..e9ca2163e1f 100644 --- 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,21 +10,21 @@ SetSeenAndCaughtMon:: ; 3380 SetSeenMon:: ; 338b ld c, a - ld hl, PokedexSeen + ld hl, wPokedexSeen ld b, SET_FLAG jr PokedexFlagAction ; 3393 CheckCaughtMon:: ; 3393 ld c, a - ld hl, PokedexCaught + ld hl, wPokedexCaught ld b, CHECK_FLAG jr PokedexFlagAction ; 339b CheckSeenMon:: ; 339b ld c, a - ld hl, PokedexSeen + ld hl, wPokedexSeen ld b, CHECK_FLAG ; fallthrough ; 33a1 diff --git a/home/predef.asm b/home/predef.asm index f99e858910d..f03bdaa9402 100644 --- a/home/predef.asm +++ b/home/predef.asm @@ -2,13 +2,13 @@ Predef:: ; 2d83 ; 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 @@ Predef:: ; 2d83 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 @@ Predef:: ; 2d83 ; 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 diff --git a/home/random.asm b/home/random.asm index ae39f439caa..ceefdce6f1c 100644 --- a/home/random.asm +++ b/home/random.asm @@ -42,10 +42,10 @@ BattleRandom:: ; 2f9f call _BattleRandom - ld [PredefTemp + 1], a + ld [wPredefTemp + 1], a pop af rst Bankswitch - ld a, [PredefTemp + 1] + ld a, [wPredefTemp + 1] ret ; 2fb1 diff --git a/home/rtc.asm b/home/rtc.asm index 5b83f1079b0..9b8bc4ac3f8 100644 --- a/home/rtc.asm +++ b/home/rtc.asm @@ -9,7 +9,7 @@ RTC:: ; 46f call UpdateTime ; obj update on? - ld a, [VramState] + ld a, [wVramState] bit 0, a ; obj update ret z diff --git a/home/text.asm b/home/text.asm index 2dbb85f6d57..5e7e66d432a 100644 --- a/home/text.asm +++ b/home/text.asm @@ -22,11 +22,11 @@ FillBoxWithByte:: 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 @@ ClearTileMap:: ; fc8 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 @@ TextBoxBorder:: ; ff1 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 @@ print_name: MACRO 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 @@ PlaceMoveUsersName:: ; 1203 and a jr nz, .enemy - ld de, BattleMonNick + ld de, wBattleMonNick jr PlaceCommandCharacter .enemy @@ -354,7 +354,7 @@ PlaceMoveUsersName:: ; 1203 call PlaceString ld h, b ld l, c - ld de, EnemyMonNick + ld de, wEnemyMonNick jr PlaceCommandCharacter @@ -365,13 +365,13 @@ PlaceEnemysName:: ; 121b 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 @@ PlaceEnemysName:: ; 121b 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 @@ LineBreakChar:: ; 12b0 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 @@ PokeFluteTerminatorCharacter:: ; 13e0 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_LINK_WAIT_BUTTON:: ; 1562 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] diff --git a/home/tilemap.asm b/home/tilemap.asm index 9e15ed85b4d..00317e53bc5 100644 --- a/home/tilemap.asm +++ b/home/tilemap.asm @@ -117,7 +117,7 @@ PlaceVerticalMenuItems:: ; 1c89 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 wTileMap address where we will start printing text. inc de ld a, [de] ; Number of items inc de @@ -207,7 +207,7 @@ MenuBoxCoord2Tile:: ; 1cfd 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 @@ MenuBoxCoord2Attr:: ; 1d19 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 @@ Coord2Attr:: ; 1d21 xor a ld b, a add hl, bc - bccoord 0, 0, AttrMap + bccoord 0, 0, wAttrMap add hl, bc ret ; 1d35 diff --git a/home/time.asm b/home/time.asm index 9ed703686dc..5ede4917355 100644 --- a/home/time.asm +++ b/home/time.asm @@ -140,12 +140,12 @@ FixDays:: ; 5e8 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 @@ FixTime:: ; 61d 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 @@ FixTime:: ; 61d 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 @@ FixTime:: ; 61d 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 diff --git a/home/trainers.asm b/home/trainers.asm index 4eabfbcbb78..575af65a728 100644 --- a/home/trainers.asm +++ b/home/trainers.asm @@ -16,7 +16,7 @@ CheckTrainerBattle:: ; 360d ; Skip the player object. ld a, 1 - ld de, MapObjects + OBJECT_LENGTH + ld de, wMapObjects + OBJECT_LENGTH .loop @@ -97,32 +97,32 @@ CheckTrainerBattle:: ; 360d 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 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 @@ FacingPlayerDistance:: ; 36ad 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 @@ FacingPlayerDistance:: ; 36ad ret .CheckY: - ld a, [PlayerStandingMapY] + ld a, [wPlayerStandingMapY] sub e jr z, .NotFacing jr nc, .Above @@ -182,7 +182,7 @@ FacingPlayerDistance:: ; 36ad jr .CheckFacing .CheckX: - ld a, [PlayerStandingMapX] + ld a, [wPlayerStandingMapX] sub d jr z, .NotFacing jr nc, .Left @@ -236,7 +236,7 @@ CheckTrainerFlag:: ; 36f5 ; 3718 PrintWinLossText:: ; 3718 - ld a, [BattleType] + ld a, [wBattleType] cp BATTLETYPE_CANLOSE jr .canlose ; ?????????? diff --git a/home/vblank.asm b/home/vblank.asm index 5afecdad05c..d7a58cc1adb 100644 --- a/home/vblank.asm +++ b/home/vblank.asm @@ -120,20 +120,20 @@ VBlank0:: ; 2b1 ; 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 @@ VBlank2:: ; 325 rst Bankswitch xor a - ld [VBlankOccurred], a + ld [wVBlankOccurred], a ret ; 337 @@ -196,7 +196,7 @@ VBlank1:: ; 337 .done xor a - ld [VBlankOccurred], a + ld [wVBlankOccurred], a ; get requested ints ld a, [rIF] @@ -286,7 +286,7 @@ VBlank3:: ; 396 .done xor a - ld [VBlankOccurred], a + ld [wVBlankOccurred], a ld a, [rIF] push af @@ -343,7 +343,7 @@ VBlank4:: ; 3df call Joypad xor a - ld [VBlankOccurred], a + ld [wVBlankOccurred], a call AskSerial @@ -379,7 +379,7 @@ VBlank5:: ; 400 .done xor a - ld [VBlankOccurred], a + ld [wVBlankOccurred], a call Joypad @@ -429,7 +429,7 @@ VBlank6:: ; 436 .done xor a - ld [VBlankOccurred], a + ld [wVBlankOccurred], a ld a, BANK(_UpdateSound) rst Bankswitch diff --git a/home/video.asm b/home/video.asm index 2f06effa05d..1066197fff8 100644 --- a/home/video.asm +++ b/home/video.asm @@ -20,8 +20,8 @@ DMATransfer:: ; 15d8 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 @@ UpdateBGMapBuffer:: ; 15e3 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 @@ WaitTop:: ; 163a 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 @@ UpdateBGMap:: ; 164c ld a, 1 ld [rVBK], a - hlcoord 0, 0, AttrMap + hlcoord 0, 0, wAttrMap call .update ld a, 0 @@ -250,7 +250,7 @@ THIRD_HEIGHT EQU SCREEN_HEIGHT / 3 ; 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 @@ endr Serve1bppRequest:: ; 170a ; Only call during the first fifth of VBlank - ld a, [Requested1bpp] + ld a, [wRequested1bpp] and a ret z @@ -296,29 +296,29 @@ Serve1bppRequest:: ; 170a 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 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 @@ endr 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 @@ endr Serve2bppRequest:: ; 1769 ; Only call during the first fifth of VBlank - ld a, [Requested2bpp] + ld a, [wRequested2bpp] and a ret z @@ -381,34 +381,34 @@ Serve2bppRequest:: ; 1769 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 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 @@ endr 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 @@ AnimateTileset:: ; 17d3 ld a, [rSVBK] push af - ld a, BANK(TilesetAnim) + ld a, BANK(wTilesetAnim) ld [rSVBK], a ld a, [rVBK] diff --git a/home/window.asm b/home/window.asm index 67debe5d353..2d7c22569f0 100644 --- a/home/window.asm +++ b/home/window.asm @@ -26,7 +26,7 @@ CloseText:: ; 2dcf pop af ld [hOAMUpdate], a - ld hl, VramState + ld hl, wVramState res 6, [hl] ret ; 2de2 diff --git a/macros/coords.asm b/macros/coords.asm index a66fc6b29ff..95c4cb041cb 100644 --- a/macros/coords.asm +++ b/macros/coords.asm @@ -5,7 +5,7 @@ decoord EQUS "coord de," 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 @@ ENDM 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 @@ ENDM 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 @@ ENDM 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 diff --git a/maps/BattleTower1F.asm b/maps/BattleTower1F.asm index b7113f34731..910d27a6917 100644 --- a/maps/BattleTower1F.asm +++ b/maps/BattleTower1F.asm @@ -527,7 +527,7 @@ Text_AskRegisterRecord_Mobile: Text_PlayerGotFive: ; 0x9eb7e text " got five" line "@" - text_from_ram StringBuffer4 + text_from_ram wStringBuffer4 text "!@" sound_item text_waitbutton @@ -637,7 +637,7 @@ Text_YourPkmnWillBeHealedToFullHealth: ; 0x9ee92 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_APkmnLevelExceeds: ; 0x9f1e5 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 @@ Text_MayNotEnterABattleRoomUnderL70: ; 0x9f217 para "This BATTLE ROOM" line "is for L@" - deciram ScriptVar, 1, 3 + deciram wScriptVar, 1, 3 text "." done diff --git a/maps/BattleTowerHallway.asm b/maps/BattleTowerHallway.asm index 6b50783f5af..80075fee25e 100644 --- a/maps/BattleTowerHallway.asm +++ b/maps/BattleTowerHallway.asm @@ -28,7 +28,7 @@ BattleTowerHallway_MapScripts: ld a, BANK(wBTChoiceOfLvlGroup) ld [rSVBK], a ld a, [wBTChoiceOfLvlGroup] - ld [ScriptVar], a + ld [wScriptVar], a pop af ld [rSVBK], a diff --git a/maps/BillsHouse.asm b/maps/BillsHouse.asm index a4f2e0c0eb6..e21facaab2b 100644 --- a/maps/BillsHouse.asm +++ b/maps/BillsHouse.asm @@ -241,7 +241,7 @@ BillsGrandpaYouDontHaveItTextText: BillsGrandpaShownPokemonText: text "Ah, so that is" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "?" para "Isn't it cute!" diff --git a/maps/BluesHouse.asm b/maps/BluesHouse.asm index f31fefb9d24..bb8603fbfc0 100644 --- a/maps/BluesHouse.asm +++ b/maps/BluesHouse.asm @@ -106,7 +106,7 @@ DaisyAlrightText: done GroomedMonLooksContentText: - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " looks" line "content." done diff --git a/maps/CeladonCafe.asm b/maps/CeladonCafe.asm index d30baf17dae..09a8db2f2d5 100644 --- a/maps/CeladonCafe.asm +++ b/maps/CeladonCafe.asm @@ -198,7 +198,7 @@ EatathonContestPosterText: FoundLeftoversText: text " found" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done diff --git a/maps/CeladonDeptStore6F.asm b/maps/CeladonDeptStore6F.asm index 5a5e37afc6d..9a8c0bde800 100644 --- a/maps/CeladonDeptStore6F.asm +++ b/maps/CeladonDeptStore6F.asm @@ -109,7 +109,7 @@ CeladonClangText: text "Clang!" para "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start line "popped out." done diff --git a/maps/CeladonGameCornerPrizeRoom.asm b/maps/CeladonGameCornerPrizeRoom.asm index 1caed4b191b..6d55f57d81f 100644 --- a/maps/CeladonGameCornerPrizeRoom.asm +++ b/maps/CeladonGameCornerPrizeRoom.asm @@ -235,7 +235,7 @@ CeladonPrizeRoom_AskWhichPrizeText: CeladonPrizeRoom_ConfirmPurchaseText: text "OK, so you wanted" line "a @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "?" done diff --git a/maps/DragonsDenB1F.asm b/maps/DragonsDenB1F.asm index 10b079edfa5..172619fb60c 100644 --- a/maps/DragonsDenB1F.asm +++ b/maps/DragonsDenB1F.asm @@ -396,7 +396,7 @@ TwinsLeaandpia2AfterBattleText: Text_FoundDragonFang: text " found" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done diff --git a/maps/ElmsLab.asm b/maps/ElmsLab.asm index 9322aefe828..ff531500c5d 100644 --- a/maps/ElmsLab.asm +++ b/maps/ElmsLab.asm @@ -893,7 +893,7 @@ ChoseStarterText: ReceivedStarterText: text " received" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "!" done diff --git a/maps/GoldenrodDeptStore6F.asm b/maps/GoldenrodDeptStore6F.asm index 73cb0f17e8f..995afcada23 100644 --- a/maps/GoldenrodDeptStore6F.asm +++ b/maps/GoldenrodDeptStore6F.asm @@ -102,7 +102,7 @@ GoldenrodVendingText: GoldenrodClangText: text "Clang! A can of" line "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start cont "popped out!" done diff --git a/maps/GoldenrodGameCorner.asm b/maps/GoldenrodGameCorner.asm index d467e84c34e..58fc67192f5 100644 --- a/maps/GoldenrodGameCorner.asm +++ b/maps/GoldenrodGameCorner.asm @@ -328,7 +328,7 @@ GoldenrodGameCornerPrizeVendorWhichPrizeText: done GoldenrodGameCornerPrizeVendorConfirmPrizeText: - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "Is that right?" done diff --git a/maps/GoldenrodHappinessRater.asm b/maps/GoldenrodHappinessRater.asm index 4fa8506dc55..f31e8603f6c 100644 --- a/maps/GoldenrodHappinessRater.asm +++ b/maps/GoldenrodHappinessRater.asm @@ -80,7 +80,7 @@ UnknownText_0x549a3: para "Oh? Let me see" line "your @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "…" done diff --git a/maps/GoldenrodPokecenter1F.asm b/maps/GoldenrodPokecenter1F.asm index f0119431167..e835ff320a6 100644 --- a/maps/GoldenrodPokecenter1F.asm +++ b/maps/GoldenrodPokecenter1F.asm @@ -182,10 +182,10 @@ UnknownText_0x6113b: 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 @@ UnknownText_0x611c9: line "to trade your" para "@" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " for a" line "#MON that you" cont "have never seen." diff --git a/maps/GoldenrodUnderground.asm b/maps/GoldenrodUnderground.asm index e8e56666622..06e15d67af5 100644 --- a/maps/GoldenrodUnderground.asm +++ b/maps/GoldenrodUnderground.asm @@ -36,7 +36,7 @@ GoldenrodUnderground_MapScripts: clearevent EVENT_SWITCH_13 clearevent EVENT_SWITCH_14 writebyte 0 - copyvartobyte UndergroundSwitchPositions + copyvartobyte wUndergroundSwitchPositions return .CheckBasementKey: @@ -619,19 +619,19 @@ UnknownText_0x7c87b: 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 diff --git a/maps/GoldenrodUndergroundSwitchRoomEntrances.asm b/maps/GoldenrodUndergroundSwitchRoomEntrances.asm index 621c133fd7c..8e84d7d36f4 100644 --- a/maps/GoldenrodUndergroundSwitchRoomEntrances.asm +++ b/maps/GoldenrodUndergroundSwitchRoomEntrances.asm @@ -281,9 +281,9 @@ Switch1Script: 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 @@ Switch1Script: 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 @@ Switch2Script: 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 @@ Switch2Script: 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 @@ Switch3Script: 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 @@ Switch3Script: 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 @@ EmergencySwitchScript: 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 @@ EmergencySwitchScript: 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 @@ GoldenrodUndergroundSwitchRoomEntrances_DontToggle: end GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors: - copybytetovar UndergroundSwitchPositions + copybytetovar wUndergroundSwitchPositions if_equal 0, .Position0 if_equal 1, .Position1 if_equal 2, .Position2 @@ -501,7 +501,7 @@ GoldenrodUndergroundSwitchRoomEntrances_UpdateDoors: reloadmappart closetext writebyte 6 - copyvartobyte UndergroundSwitchPositions + copyvartobyte wUndergroundSwitchPositions end .Set4: diff --git a/maps/GoldenrodUndergroundWarehouse.asm b/maps/GoldenrodUndergroundWarehouse.asm index be5aa7e3185..65e8f648a3b 100644 --- a/maps/GoldenrodUndergroundWarehouse.asm +++ b/maps/GoldenrodUndergroundWarehouse.asm @@ -32,7 +32,7 @@ GoldenrodUndergroundWarehouse_MapScripts: clearevent EVENT_SWITCH_13 clearevent EVENT_SWITCH_14 writebyte 0 - copyvartobyte UndergroundSwitchPositions + copyvartobyte wUndergroundSwitchPositions return TrainerGruntM24: diff --git a/maps/IlexForest.asm b/maps/IlexForest.asm index 01351cd84e5..de3d7915298 100644 --- a/maps/IlexForest.asm +++ b/maps/IlexForest.asm @@ -22,7 +22,7 @@ IlexForest_MapScripts: .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 @@ IlexForestCharcoalApprenticeScript: end IlexForestFarfetchdScript: - copybytetovar FarfetchdPosition + copybytetovar wFarfetchdPosition if_equal 1, .Position1 if_equal 2, .Position2 if_equal 3, .Position3 @@ -128,7 +128,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 25 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 2 + loadvar wFarfetchdPosition, 2 end .Position2: @@ -138,7 +138,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 20, 24 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 3 + loadvar wFarfetchdPosition, 3 end .Position2_Down: @@ -146,7 +146,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 29 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 8 + loadvar wFarfetchdPosition, 8 end .Position3: @@ -156,7 +156,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 29, 22 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 4 + loadvar wFarfetchdPosition, 4 end .Position3_Left: @@ -164,7 +164,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 25 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 2 + loadvar wFarfetchdPosition, 2 end .Position4: @@ -174,7 +174,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 28, 31 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 5 + loadvar wFarfetchdPosition, 5 end .Position4_Up: @@ -182,7 +182,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 20, 24 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 3 + loadvar wFarfetchdPosition, 3 end .Position5: @@ -194,7 +194,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 24, 35 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 6 + loadvar wFarfetchdPosition, 6 end .Position5_Left: @@ -202,7 +202,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 22, 31 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 7 + loadvar wFarfetchdPosition, 7 end .Position5_Up: @@ -210,7 +210,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 29, 22 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 4 + loadvar wFarfetchdPosition, 4 end .Position5_Right: @@ -218,7 +218,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 29, 22 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 4 + loadvar wFarfetchdPosition, 4 end .Position6: @@ -228,7 +228,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 22, 31 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 7 + loadvar wFarfetchdPosition, 7 end .Position6_Right: @@ -236,7 +236,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 28, 31 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 5 + loadvar wFarfetchdPosition, 5 end .Position7: @@ -247,7 +247,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 29 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 8 + loadvar wFarfetchdPosition, 8 end .Position7_Left: @@ -255,7 +255,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 24, 35 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 6 + loadvar wFarfetchdPosition, 6 end .Position7_Down: @@ -263,7 +263,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 28, 31 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 5 + loadvar wFarfetchdPosition, 5 end .Position8: @@ -275,7 +275,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 10, 35 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 9 + loadvar wFarfetchdPosition, 9 end .Position8_Right: @@ -283,7 +283,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 22, 31 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 7 + loadvar wFarfetchdPosition, 7 end .Position8_Up: @@ -292,7 +292,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 25 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 2 + loadvar wFarfetchdPosition, 2 end .Position9: @@ -303,7 +303,7 @@ IlexForestFarfetchdScript: 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 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 29 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 8 + loadvar wFarfetchdPosition, 8 end .Position9_Down: @@ -322,7 +322,7 @@ IlexForestFarfetchdScript: moveobject ILEXFOREST_FARFETCHD, 15, 29 disappear ILEXFOREST_FARFETCHD appear ILEXFOREST_FARFETCHD - loadvar FarfetchdPosition, 8 + loadvar wFarfetchdPosition, 8 end .Position10: diff --git a/maps/LakeOfRageMagikarpHouse.asm b/maps/LakeOfRageMagikarpHouse.asm index c77d823c006..92900c486ec 100644 --- a/maps/LakeOfRageMagikarpHouse.asm +++ b/maps/LakeOfRageMagikarpHouse.asm @@ -200,10 +200,10 @@ UnknownText_0x19aabc: 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: diff --git a/maps/Pokecenter2F.asm b/maps/Pokecenter2F.asm index 11a73de0747..40900519c62 100644 --- a/maps/Pokecenter2F.asm +++ b/maps/Pokecenter2F.asm @@ -914,7 +914,7 @@ Text_PleaseEnter: Text_RejectNewMon: text "Sorry--@" - text_from_ram StringBuffer1 + text_from_ram wStringBuffer1 text_start line "can't be taken." prompt @@ -922,17 +922,17 @@ Text_RejectNewMon: 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 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 diff --git a/maps/RadioTower1F.asm b/maps/RadioTower1F.asm index 96cd013c633..d17798f1f7a 100644 --- a/maps/RadioTower1F.asm +++ b/maps/RadioTower1F.asm @@ -239,7 +239,7 @@ UnknownText_0x5ceba: UnknownText_0x5cf3a: text "This week's ID" line "number is @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." done diff --git a/maps/Route35NationalParkGate.asm b/maps/Route35NationalParkGate.asm index 754591060e9..6dbfe96718f 100644 --- a/maps/Route35NationalParkGate.asm +++ b/maps/Route35NationalParkGate.asm @@ -226,7 +226,7 @@ MovementData_0x6a2e9: UnknownText_0x6a2eb: text "Today's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "That means the" @@ -289,7 +289,7 @@ UnknownText_0x6a4c6: 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_0x6a71f: UnknownText_0x6a79a: text "You still have @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start line "minute(s) left." diff --git a/maps/Route36NationalParkGate.asm b/maps/Route36NationalParkGate.asm index fa74c7ee5be..5251fa47058 100644 --- a/maps/Route36NationalParkGate.asm +++ b/maps/Route36NationalParkGate.asm @@ -476,7 +476,7 @@ MovementData_0x6add1: UnknownText_0x6add5: text "Today's @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text "." line "That means the" @@ -539,7 +539,7 @@ UnknownText_0x6afb0: 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_0x6b209: UnknownText_0x6b284: text "You still have @" - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text_start line "minute(s) left." diff --git a/maps/Route39Barn.asm b/maps/Route39Barn.asm index 682b2dea185..5cc21eab519 100644 --- a/maps/Route39Barn.asm +++ b/maps/Route39Barn.asm @@ -69,9 +69,9 @@ MooMoo: 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 diff --git a/maps/TrainerHouseB1F.asm b/maps/TrainerHouseB1F.asm index bb6fd4316ba..bab0a5b6678 100644 --- a/maps/TrainerHouseB1F.asm +++ b/maps/TrainerHouseB1F.asm @@ -121,7 +121,7 @@ TrainerHouseB1FIntroText: done TrainerHouseB1FYourOpponentIsText: - text_from_ram StringBuffer3 + text_from_ram wStringBuffer3 text " is your" line "opponent today." done diff --git a/mobile/fixed_words.asm b/mobile/fixed_words.asm index a57722747b2..d2b20dff148 100755 --- a/mobile/fixed_words.asm +++ b/mobile/fixed_words.asm @@ -269,7 +269,7 @@ CopyMobileEZChatToC608: ; 11c156 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 @@ Function11c1b9: ; 11c1b9 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 @@ Function11c4a5: ; 11c4a5 (47:44a5) 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 @@ EZChat_PlaceCategoryNames: ; 11c5f0 (47:45f0) 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 @@ Function11c992: ; 11c992 (47:4992) 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 @@ Function11c9c3: ; 11c9c3 (47:49c3) 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 @@ Function11ca01: ; 11ca01 (47:4a01) 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 @@ Function11cd54: ; 11cd54 (47:4d54) 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 diff --git a/mobile/mobile_12.asm b/mobile/mobile_12.asm index 934afb45774..c7db74e7012 100755 --- a/mobile/mobile_12.asm +++ b/mobile/mobile_12.asm @@ -38,11 +38,11 @@ InitMobileProfile: ; 4802f (12:402f) 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 @@ Function483bb: ; 483bb (12:43bb) 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 @@ Function48cdc: ; 48cdc (12:4cdc) call Function48cfd pop hl pop bc - ld de, AttrMap - TileMap + ld de, wAttrMap - wTileMap add hl, de inc b inc b diff --git a/mobile/mobile_12_2.asm b/mobile/mobile_12_2.asm index 5553d66fbc5..66ed07bef46 100755 --- a/mobile/mobile_12_2.asm +++ b/mobile/mobile_12_2.asm @@ -2,14 +2,14 @@ MobileCheckOwnMonAnywhere: ; 4a843 ; 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 @@ MobileCheckOwnMonAnywhere: ; 4a843 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 @@ MobileCheckOwnMonAnywhere: ; 4a843 ; 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 @@ Function4a9c3: ; 4a9c3 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 @@ Function4a9d7: ; 4a9d7 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 @@ Function4aa25: ; 4aa25 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 @@ Function4aab6: ; 4aab6 ; 4aad3 Function4aad3: ; 4aad3 - ld hl, PartyCount + ld hl, wPartyCount ld a, [hli] and a ret z ; Nothing in your party @@ -458,7 +458,7 @@ Function4aad3: ; 4aad3 ; 4aafb Function4aafb: ; 4aafb - ld a, [CurPartySpecies] + ld a, [wCurPartySpecies] cp EGG jr z, .egg and a @@ -470,9 +470,9 @@ Function4aafb: ; 4aafb ; 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 @@ Function4ab1a: ; 4ab1a 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 @@ Function4ab1a: ; 4ab1a 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 @@ Function4aba8: ; 4aba8 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 @@ Function4abc3: ; 4abc3 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 @@ Function4abc3: ; 4abc3 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 @@ Function4abc3: ; 4abc3 .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 @@ Function4abc3: ; 4abc3 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 @@ Function4abc3: ; 4abc3 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 @@ Function4ad17: ; 4ad17 ret .asm_4ad39 - ld a, [CurPartyMon] + ld a, [wCurPartyMon] ld [hl], a call Function4a9c3 ret c @@ -876,7 +876,7 @@ String_4ada7: ; 4ada7 Function4adb2: ; 4adb2 ld hl, wd002 - ld a, [CurPartyMon] + ld a, [wCurPartyMon] cp [hl] ret z inc hl @@ -923,7 +923,7 @@ Function4adf7: ; 4adf7 ld a, [wd019] bit 0, a ret z - ld a, [PartyCount] + ld a, [wPartyCount] inc a ld [wMenuCursorY], a ld a, $1 diff --git a/mobile/mobile_22.asm b/mobile/mobile_22.asm index 4ec048c4aaf..08113bf66cd 100644 --- a/mobile/mobile_22.asm +++ b/mobile/mobile_22.asm @@ -133,7 +133,7 @@ Function891d3: ; 891d3 (22:51d3) 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 @@ Function8920f: ; 8920f 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 @@ Function892b7: ; 892b7 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 @@ Function89305: ; 89305 (22:5305) Function8931b: ; 8931b push hl ld hl, $a03b ; 4:a03b - ld a, [MenuSelection] + ld a, [wMenuSelection] dec a ld bc, 37 call AddNTimes @@ -778,7 +778,7 @@ Function8956f: ; 8956f 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 @@ Function8956f: ; 8956f 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 @@ Palette_895de: ; 895de 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 @@ Function895e6: ; 895e6 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 @@ Function895f2: ; 895f2 ; 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 @@ Function89605: ; 89605 jr nz, .loop .done - hlcoord 0, 16, AttrMap + hlcoord 0, 16, wAttrMap ld c, 10 ld a, 2 .loop2 @@ -891,7 +891,7 @@ Function89605: ; 89605 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 @@ Function89605: ; 89605 ; 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 @@ Function8963d: ; 8963d ; 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 @@ Function897af: ; 897af 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 @@ Function897d5: ; 897d5 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 @@ Function8987f: ; 8987f (22:587f) 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 @@ Function898be: ; 898be .asm_898cd hlcoord 9, 1 - ld a, [MenuSelection] + ld a, [wMenuSelection] and a jr nz, .asm_898d7 dec hl @@ -1544,7 +1544,7 @@ Function8998b: ; 8998b Function8999c: ; 8999c (22:599c) - ld de, PlayerName + ld de, wPlayerName call PlaceString inc bc ld h, b @@ -1559,10 +1559,10 @@ String_899ac: ; 899ac ; 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 @@ Function899b2: ; 899b2 (22:59b2) ret Function899c9: ; 899c9 (22:59c9) - ld de, PlayerID + ld de, wPlayerID lb bc, PRINTNUM_LEADINGZEROS | 2, 5 call PrintNum ret @@ -1716,11 +1716,11 @@ Function89a57: ; 89a57 ; 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 @@ Function89a57: ; 89a57 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 @@ Function89a57: ; 89a57 .equal_to_d pop bc ld a, c - ld [MenuSelection], a + ld [wMenuSelection], a scf ret ; 89ac7 @@ -1773,7 +1773,7 @@ Function89a57: ; 89a57 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 @@ Function89b97: ; 89b97 (22:5b97) ld a, [hli] ld h, [hl] ld l, a - ld de, Sprite01 + ld de, wSprite01 .asm_89bb4 ld a, [hli] cp $ff @@ -2013,7 +2013,7 @@ Function89c44: ; 89c44 (22:5c44) pop de ret .asm_89c4f - ld hl, Sprite01 + ld hl, wSprite01 push de ld a, b ld [hli], a ; y @@ -2123,7 +2123,7 @@ Function89cdf: ; 89cdf (22:5cdf) ld c, a ld e, $2 ld a, $2 - ld hl, Sprite01 + ld hl, wSprite01 .asm_89cee push af push bc @@ -2378,10 +2378,10 @@ Function89e6f: ; 89e6f (22:5e6f) 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 @@ Function89eb9: ; 89eb9 (22:5eb9) 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 @@ -2595,10 +2595,10 @@ Function89fa5: ; 89fa5 (22:5fa5) 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 @@ Function8a055: ; 8a055 (22:6055) 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 @@ Function8a0a1: ; 8a0a1 (22:60a1) 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 @@ Function8a0c9: ; 8a0c9 (22:60c9) Function8a0de: ; 8a0de (22:60de) call Function8a0c9 - ld de, AttrMap - TileMap + ld de, wAttrMap - wTileMap add hl, de ret @@ -2962,10 +2962,10 @@ Function8a262: ; 8a262 (22:6262) 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 @@ Function8a31c: ; 8a31c (22:631c) 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 @@ Function8a31c: ; 8a31c (22:631c) 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 @@ Function8a3a2: ; 8a3a2 (22:63a2) 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 @@ Function8a453: ; 8a453 (22:6453) 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 @@ Strings_8a483: ; 8a483 ; 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 @@ -3476,7 +3476,7 @@ Function8a62c: ; 8a62c (22:662c) 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 @@ Function8a62c: ; 8a62c (22:662c) 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 @@ Function8a78c: ; 8a78c (22:678c) ret Function8a7cb: ; 8a7cb (22:67cb) - ld a, [MenuSelection] + ld a, [wMenuSelection] push af call Function891de ld de, wd008 @@ -3692,7 +3692,7 @@ Function8a7cb: ; 8a7cb (22:67cb) call Function89193 .asm_8a7f4 pop af - ld [MenuSelection], a + ld [wMenuSelection], a call Function891de call ClearBGPalettes call Function893cc @@ -3829,7 +3829,7 @@ String_8a926: ; 8a926 ; 8a930 Function8a930: ; 8a930 (22:6930) - ld a, [MenuSelection] + ld a, [wMenuSelection] push af xor a ld [wd032], a @@ -3853,7 +3853,7 @@ Function8a930: ; 8a930 (22:6930) 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 @@ Function8a930: ; 8a930 (22:6930) pop de pop bc ld a, c - ld [MenuSelection], a + ld [wMenuSelection], a call Function8931b push bc ld h, b @@ -4013,7 +4013,7 @@ Jumptable_8aa6d: ; 8aa6d (22:6a6d) Function8aa73: ; 8aa73 (22:6a73) - ld a, [MenuSelection] + ld a, [wMenuSelection] ld e, a push de call Function891de @@ -4039,7 +4039,7 @@ Function8aa73: ; 8aa73 (22:6a73) call Function894ca pop de ld a, e - ld [MenuSelection], a + ld [wMenuSelection], a and a ret @@ -4168,7 +4168,7 @@ Function8aba9: ; 8aba9 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 @@ Function8aba9: ; 8aba9 ld a, $1 call Function8925e jp c, .asm_8abb3 - ld a, [MenuSelection] + ld a, [wMenuSelection] ld c, a ret ; 8ac3b @@ -4232,7 +4232,7 @@ String_8ac3b: ; 8ac3b Function8ac4e: ; 8ac4e xor a - ld [MenuSelection], a + ld [wMenuSelection], a push de call Function891de call ClearBGPalettes @@ -4261,7 +4261,7 @@ Function8ac7c: ; 8ac7c 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 @@ UnknownText_0x8ad06: ; 0x8ad06 Function8ad0b: ; 8ad0b .asm_8ad0b - ld a, [MenuSelection] + ld a, [wMenuSelection] ld [wd02f], a call Function891de call ClearBGPalettes diff --git a/mobile/mobile_22_2.asm b/mobile/mobile_22_2.asm index 6354da14622..a55daafc907 100644 --- a/mobile/mobile_22_2.asm +++ b/mobile/mobile_22_2.asm @@ -645,11 +645,11 @@ Palette_8b6d5: ; 8b6d5 ; 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 @@ Function8b73e: ; 8b73e ; 8b744 Function8b744: ; 8b744 - ld de, AttrMap - TileMap + ld de, wAttrMap - wTileMap add hl, de inc b inc b @@ -781,10 +781,10 @@ Function8b788: ; 8b788 ; 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 @@ Function8b7bd: ; 8b7bd jr .asm_8b7ea .asm_8b81c - ld a, [MenuSelection] + ld a, [wMenuSelection] cp $ff jr nz, .asm_8b824 @@ -931,7 +931,7 @@ MenuData2_0x8b870: ; 0x8b870 Function8b880: ; 8b880 ld h, d ld l, e - ld de, MenuSelection + ld de, wMenuSelection lb bc, PRINTNUM_LEADINGZEROS | 1, 2 call PrintNum ret diff --git a/mobile/mobile_40.asm b/mobile/mobile_40.asm index 2798914b813..b96e6c4700e 100644 --- a/mobile/mobile_40.asm +++ b/mobile/mobile_40.asm @@ -43,7 +43,7 @@ Function100022: ; 100022 farcall Stubbed_Function106462 farcall Function106464 ; load broken gfx farcall Function11615a ; init RAM - ld hl, VramState + ld hl, wVramState set 1, [hl] ret ; 100057 @@ -51,14 +51,14 @@ Function100022: ; 100022 Function100057: ; 100057 call DisableMobile call ReturnToMapFromSubmenu - ld hl, VramState + ld hl, wVramState res 1, [hl] ret ; 100063 SetRAMStateForMobile: ; 100063 xor a - ld hl, BGMapBuffer + ld hl, wBGMapBuffer ld bc, $65 call ByteFill xor a @@ -66,7 +66,7 @@ SetRAMStateForMobile: ; 100063 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 @@ SetRAMStateForMobile: ; 100063 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 @@ DisableMobile: ; 1000a4 call NormalSpeed xor a ld [rIF], a - ld a, [BGMapBuffer] + ld a, [wBGMapBuffer] ld [rIE], a ei ret @@ -590,7 +590,7 @@ Function1003d8: ; 1003d8 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 @@ Function100406: ; 100406 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 @@ Jumptable_10044e: ; 10044e (40:444e) dw Function1004a4 Function10046a: ; 10046a - ld hl, BGMapPalBuffer + ld hl, wBGMapPalBuffer inc [hl] call Function1003d8 call Function1003ba @@ -1355,7 +1355,7 @@ Function100826: ; 100826 .asm_100830 ld [hld], a ccf - ld a, [BGMapBufferPtrs] + ld a, [wBGMapBufferPtrs] adc [hl] sub $3c jr nc, .asm_10083c @@ -1384,18 +1384,18 @@ Function100846: ; 100846 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 @@ Function1008a6: ; 1008a6 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 @@ Function1008a6: ; 1008a6 .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,14 +1489,14 @@ Function100902: ; 100902 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 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 @@ Function100970: ; 100970 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 @@ Function100989: ; 100989 call Function1009ae farcall ReloadMapPart ld hl, w3_dd68 - decoord 0, 0, AttrMap + decoord 0, 0, wAttrMap call Function1009a5 ret ; 1009a5 @@ -1562,7 +1562,7 @@ Function1009ae: ; 1009ae 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 @@ -1649,18 +1649,18 @@ _LinkBattleSendReceiveAction: ; 100a09 ld a, [wBattlePlayerAction] and a jr nz, .switch - ld a, [CurPlayerMove] + ld a, [wCurPlayerMove] ld b, BATTLEACTION_E cp STRUGGLE jr z, .struggle 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 @@ MobileMoveSelectionScreen: ; 100b9f .b_button ld a, [wMenuCursorY] dec a - ld [CurMoveNum], a + ld [wCurMoveNum], a ld a, $01 and a ret @@ -1933,17 +1933,17 @@ MobileMoveSelectionScreen: ; 100b9f .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 @@ MobileMoveSelectionScreen: ; 100b9f 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 @@ Function100c74: ; 100c74 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 @@ Function100c98: ; 100c98 ld a, [wNumMoves] inc a ld [w2DMenuNumRows], a - ld a, [CurMoveNum] + ld a, [wCurMoveNum] inc a ld [wMenuCursorY], a ret @@ -2027,7 +2027,7 @@ Mobile_PartyMenuSelect: ; 100cb5 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 @@ Mobile_PartyMenuSelect: ; 100cb5 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 @@ Function100dc0: ; 100dc0 Mobile_SetOverworldDelay: ; 100dd2 ld a, 30 - ld [OverworldDelay], a + ld [wOverworldDelay], a ret ; 100dd8 @@ -2199,7 +2199,7 @@ Function100dd8: ; 100dd8 ; 100dfd MobileComms_CheckInactivityTimer: ; 100dfd - ld a, [OverworldDelay] + ld a, [wOverworldDelay] ld c, a ld a, 30 sub c @@ -2227,7 +2227,7 @@ MobileComms_CheckInactivityTimer: ; 100dfd ; 100e2d Function100e2d: ; 100e2d - ld a, [OverworldDelay] + ld a, [wOverworldDelay] ld c, a ld a, 30 sub c @@ -2378,21 +2378,21 @@ Function100efb: ; 100efb 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,16 +2418,16 @@ asm_100f02: .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 Function100f3d: ; 100f3d ; parameter - ld a, [StringBuffer2] + ld a, [wStringBuffer2] cp $02 jr z, .two cp $01 @@ -2440,15 +2440,15 @@ Function100f3d: ; 100f3d ; 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 @@ Function100f3d: ; 100f3d ; 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 @@ Function100f3d: ; 100f3d ; 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 @@ Unknown_100fc0: ; 100fc0 ; 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_100feb: ; 100feb 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 @@ Unknown_100ff3: ; 100ff3 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 @@ Function10107d: ; 10107d 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 @@ Function10107d: ; 10107d 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 @@ Function10107d: ; 10107d .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 @@ Function1010de: ; 1010de 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 @@ LoadSelectedPartiesForColosseum: ; 1010f2 .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 @@ LoadSelectedPartiesForColosseum: ; 1010f2 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 @@ LoadSelectedPartiesForColosseum: ; 1010f2 .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 @@ LoadSelectedPartiesForColosseum: ; 1010f2 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 @@ LoadSelectedPartiesForColosseum: ; 1010f2 ; 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 @@ Special_Function101231: ; 101231 Function10123d: ; 10123d xor a - ld [ScriptVar], a + ld [wScriptVar], a ld a, c ld hl, Jumptable_101247 rst JumpTable @@ -3922,7 +3922,7 @@ Function1018fb: ; 1018fb ld hl, wccb5 .asm_101909 - ld de, LinkBattleRNs + ld de, wLinkBattleRNs ld bc, 10 call CopyBytes ret @@ -4045,9 +4045,9 @@ _StartMobileBattle: ; 1019ab 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: ; 1019ab 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 @@ StartMobileBattle: ; 101a21 ld a, CONNECTION_NOT_ESTABLISHED ld [hSerialConnectionStatus], a pop af - ld [Options], a + ld [wOptions], a ret ; 101a4f @@ -5053,7 +5053,7 @@ Special_Function102142: ; 102142 Function102180: ; 102180 ld hl, wc608 + 1 - ld de, StringBuffer2 + ld de, wStringBuffer2 ld bc, 11 call CopyBytes ret @@ -5086,7 +5086,7 @@ Function1021b8: ; 1021b8 ld de, wPlayerMoveStruct farcall Function8ac70 ld a, c - ld [StringBuffer1], a + ld [wStringBuffer1], a push af call Function1013aa pop af @@ -5215,7 +5215,7 @@ Function102274: ; 102274 Function102283: ; 102283 ld a, $01 - ld [AttrMapEnd], a + ld [wAttrMapEnd], a ld hl, wcd4b set 0, [hl] ret @@ -5223,7 +5223,7 @@ Function102283: ; 102283 Function10228e: ; 10228e xor a - ld [AttrMapEnd], a + ld [wAttrMapEnd], a ld hl, wcd4b res 0, [hl] ret @@ -5255,13 +5255,13 @@ Function102298: ; 102298 .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 @@ Function1022d0: ; 1022d0 and a jr nz, .asm_1022f3 call Function102298 - ld a, [OverworldDelay] + ld a, [wOverworldDelay] ld c, a ld a, 30 sub c @@ -5409,18 +5409,18 @@ Function1023c6: ; 1023c6 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 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 @@ Function1025ff: ; 1025ff .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 @@ Function10266b: ; 10266b .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 @@ Function1026f3: ; 1026f3 .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 @@ Function1028bf: ; 1028bf Function1028c6: ; 1028c6 xor a - ld [MonType], a + ld [wMonType], a call Function102bac ld a, $1d ; Function102652 ld [wcd49], a @@ -6142,7 +6142,7 @@ Function1028d3: ; 1028d3 Function1028da: ; 1028da ld a, OTPARTYMON - ld [MonType], a + ld [wMonType], a call Function102bac ld a, $1f ; Function1025e9 ld [wcd49], a @@ -6204,7 +6204,7 @@ Function102933: ; 102933 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 @@ Function102933: ; 102933 ; 10294f Function10294f: ; 10294f - ld a, [TextDelayFrames] + ld a, [wTextDelayFrames] and a ret nz ld a, [wcd4a] @@ -6367,7 +6367,7 @@ MenuData3_102a33: Function102a3b: ; 102a3b ld a, [wcd30] ld [wc74e], a - ld hl, PlayerName + ld hl, wPlayerName ld de, wPlayerTrademonSenderName ld bc, NAME_LENGTH call CopyBytes @@ -6375,20 +6375,20 @@ Function102a3b: ; 102a3b 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 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 @@ Function102a3b: ; 102a3b ld [wPlayerTrademonID + 1], a ld a, [wcd4c] dec a - ld hl, PartyMon1DVs + ld hl, wPartyMon1DVs call GetPartyLocation ld a, [hli] ld [wPlayerTrademonDVs], a @@ -6404,14 +6404,14 @@ Function102a3b: ; 102a3b ld [wPlayerTrademonDVs + 1], a ld a, [wcd4c] dec a - ld hl, PartyMon1Species + ld hl, wPartyMon1Species call GetPartyLocation ld b, h ld c, l farcall GetCaughtGender ld a, c ld [wPlayerTrademonCaughtData], a - ld hl, OTPlayerName + ld hl, wOTPlayerName ld de, wOTTrademonSenderName ld bc, NAME_LENGTH call CopyBytes @@ -6420,20 +6420,20 @@ Function102a3b: ; 102a3b 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 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 @@ Function102a3b: ; 102a3b 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 @@ Function102a3b: ; 102a3b 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 @@ Function102b12: ; 102b12 Function102b32: ; 102b32 ld a, [wcd4c] dec a - ld [CurPartyMon], a + ld [wCurPartyMon], a ld a, $01 ld [wForceEvolution], a farcall EvolvePokemon @@ -6492,14 +6492,14 @@ Function102b32: ; 102b32 Function102b4e: ; 102b4e ld a, OTPARTYMON - ld [MonType], a + ld [wMonType], a ld a, [wMenuCursorY] push af ld de, Unknown_102b73 call SetMenuAttributes pop af ld [wMenuCursorY], a - ld a, [OTPartyCount] + ld a, [wOTPartyCount] ld [w2DMenuNumRows], a ret ; 102b68 @@ -6521,14 +6521,14 @@ Unknown_102b73: Function102b7b: ; 102b7b xor a - ld [MonType], a + ld [wMonType], a ld a, [wMenuCursorY] push af ld de, Unknown_102b94 call SetMenuAttributes pop af ld [wMenuCursorY], a - ld a, [PartyCount] + ld a, [wPartyCount] ld [w2DMenuNumRows], a ret ; 102b94 @@ -6553,11 +6553,11 @@ Function102b9c: ; 102b9c 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 @@ Function102bac: ; 102bac 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,32 +6611,32 @@ Function102c07: ; 102c07 ; 102c14 Function102c14: ; 102c14 - ld hl, PartySpecies - ld de, OTPartySpecies + ld hl, wPartySpecies + ld de, wOTPartySpecies ld bc, 1 call Function102c71 ret ; 102c21 Function102c21: ; 102c21 - ld hl, PartyMonNicknames - ld de, OTPartyMonNicknames + ld hl, wPartyMonNicknames + ld de, wOTPartyMonNicknames ld bc, 11 call Function102c71 ret ; 102c2e Function102c2e: ; 102c2e - ld hl, PartyMonOT - ld de, OTPartyMonOT + ld hl, wPartyMonOT + ld de, wOTPartyMonOT ld bc, 11 call Function102c71 ret ; 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 @@ Function102c87: ; 102c87 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 @@ Function102c87: ; 102c87 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 @@ Function102d48: ; 102d48 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 @@ Function102d48: ; 102d48 ld a, [wcd4c] dec a ld bc, PARTYMON_STRUCT_LENGTH - ld hl, PartyMon1Happiness + ld hl, wPartyMon1Happiness call AddNTimes ld [hl], BASE_HAPPINESS @@ -6792,14 +6792,14 @@ Function102d48: ; 102d48 ld a, [wcd4c] dec a ld bc, PARTYMON_STRUCT_LENGTH - ld hl, PartyMon1DVs + ld hl, wPartyMon1DVs call AddNTimes predef GetUnownLetter farcall UpdateUnownDex ld a, [wFirstUnownSeen] and a jr nz, .asm_102d98 - ld a, [UnownLetter] + ld a, [wUnownLetter] ld [wFirstUnownSeen], a .asm_102d98 @@ -6813,7 +6813,7 @@ Function102d9a: ; 102d9a 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 @@ Function102e3e: ; 102e3e 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,20 +6956,20 @@ Function102ea8: ; 102ea8 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] 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 @@ Function102f85: ; 102f85 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 @@ Function102f85: ; 102f85 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 @@ String_10302e: ; 10302e Function10304f: ; 10304f xor a - ld [AttrMapEnd], a + ld [wAttrMapEnd], a ld [wcf42], a ld [wcf44], a ld [wcf45], a @@ -7129,7 +7129,7 @@ Function10304f: ; 10304f Function10305d: ; 10305d nop - ld a, [AttrMapEnd] + ld a, [wAttrMapEnd] and a ret z call Function10307f @@ -7361,7 +7361,7 @@ Function103302: ; 103302 Function103309: ; 103309 xor a ld [hBGMapMode], a - ld hl, Buffer1 + ld hl, wBuffer1 ld bc, 10 xor a call ByteFill @@ -7369,7 +7369,7 @@ Function103309: ; 103309 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 @@ Function103362: ; 103362 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 @@ Function1033af: ; 1033af .b call PlayClickSFX - ld hl, Buffer2 + ld hl, wBuffer2 set 7, [hl] ret @@ -7498,9 +7498,9 @@ Function1033af: ; 1033af 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 @@ Function1033af: ; 1033af 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 @@ Function10343c: ; 10343c 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 @@ Function1034e0: ; 1034e0 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 @@ Special_AskMobileOrCable: ; 103612 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 @@ Special_AskMobileOrCable: ; 103612 .pressed_b xor a - ld [ScriptVar], a + ld [wScriptVar], a ret ; 103640 @@ -7826,12 +7826,12 @@ Special_Mobile_SelectThreeMons: ; 10366e .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 @@ Special_Mobile_SelectThreeMons: ; 10366e .asm_1036e6 ld a, $01 - ld [ScriptVar], a + ld [wScriptVar], a ret .asm_1036ec @@ -7881,7 +7881,7 @@ Special_Mobile_SelectThreeMons: ; 10366e .asm_1036f4 xor a - ld [ScriptVar], a + ld [wScriptVar], a ret ; 1036f9 @@ -7900,8 +7900,8 @@ Function103700: ; 103700 .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 @@ Function10378c: ; 10378c 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 @@ Function10378c: ; 10378c .failed_to_save xor a - ld [ScriptVar], a + ld [wScriptVar], a ld a, c and a ret z @@ -8032,13 +8032,13 @@ Special_Function1037c2: ; 1037c2 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 @@ Special_Function1037eb: ; 1037eb call PrintText call JoyWaitAorB xor a - ld [ScriptVar], a + ld [wScriptVar], a ret .asm_103807 @@ -8065,12 +8065,12 @@ Special_Function1037eb: ; 1037eb 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 @@ Special_Function10383c: ; 10383c 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 @@ Special_Function10387b: ; 10387b ret nz farcall Function1008a6 ld a, c - ld [StringBuffer2], a + ld [wStringBuffer2], a ld hl, UnknownText_0x103898 call PrintText call JoyWaitAorB diff --git a/mobile/mobile_41.asm b/mobile/mobile_41.asm index e51ab3eeaaa..e66618ef44b 100755 --- a/mobile/mobile_41.asm +++ b/mobile/mobile_41.asm @@ -7,7 +7,7 @@ StubbedTrainerRankings_HallOfFame2:: ; 0x105ef6 ld a, BANK(sTrainerRankingGameTimeHOF) call GetSRAMBank - ld hl, GameTimeHours + ld hl, wGameTimeHours ld de, sTrainerRankingGameTimeHOF ld bc, 4 call CopyBytes @@ -38,7 +38,7 @@ StubbedTrainerRankings_MagikarpLength: ; 105f33 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_TMsHMsTaught: ; 106049 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_Battles: ; 106050 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 @@ endr Special_Mobile_DummyReturnFalse: ; 10630f xor a - ld [ScriptVar], a + ld [wScriptVar], a ret ; 106314 @@ -1071,7 +1071,7 @@ Function106464:: ; 106464 ; 10649b Function10649b: ; 10649b - ld a, [TextBoxFrame] + ld a, [wTextBoxFrame] maskbits NUM_FRAMES ld bc, 6 * LEN_1BPP_TILE ld hl, Frames diff --git a/mobile/mobile_42.asm b/mobile/mobile_42.asm index ff815df3e88..eeedffb5a29 100644 --- a/mobile/mobile_42.asm +++ b/mobile/mobile_42.asm @@ -91,11 +91,11 @@ RunMobileTradeAnim_Frontpics: ; 10805b 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 @@ RunMobileTradeAnim_Frontpics: ; 10805b 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 @@ RunMobileTradeAnim_NoFrontpics: ; 108089 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 @@ RunMobileTradeAnim_NoFrontpics: ; 108089 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 @@ MobileTradeAnim_GetFrontpic: ; 1081e9 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 @@ Function108201: ; 108201 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 @@ Function108201: ; 108201 ; 108219 Function108219: ; 108219 - ld [CurPartySpecies], a + ld [wCurPartySpecies], a hlcoord 7, 2 ld d, $0 ld e, ANIM_MON_TRADE @@ -323,7 +323,7 @@ Function108219: ; 108219 ; 108229 Function108229: ; 108229 - ld [CurPartySpecies], a + ld [wCurPartySpecies], a hlcoord 7, 2 ld d, $0 ld e, ANIM_MON_TRADE @@ -335,7 +335,7 @@ MobileTradeAnim_InitSpeciesName: ; 108239 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 @@ MobileTradeAnim_ShowPlayerMonToBeSent: ; 10830e 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 @@ MobileTradeAnim_ShowOTMonFromTrade: ; 10839b 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 @@ MobileTradeAnim_ShowOTMonFromTrade: ; 10839b 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 @@ MobileTradeAnim_ShowPlayerMonForGTS: ; 10842c 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 @@ MobileTradeAnim_ShowPlayerMonForGTS: ; 10842c 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 @@ MobileTradeAnim_ShowOTMonFromGTS: ; 1084d7 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 @@ MobileTradeAnim_ShowOTMonFromGTS: ; 1084d7 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 @@ MobileTradeAnim_GetOddEgg: ; 108589 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 @@ MobileTradeAnim_GetOddEgg: ; 108589 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 diff --git a/mobile/mobile_45.asm b/mobile/mobile_45.asm index fad0bd482ef..a5d4ebf3555 100644 --- a/mobile/mobile_45.asm +++ b/mobile/mobile_45.asm @@ -895,7 +895,7 @@ Function1145c5: ; 1145c5 .asm_114636 ld a, b - ld [PartyMon5Defense], a + ld [wPartyMon5Defense], a xor a ret @@ -906,7 +906,7 @@ Function11463c: ; 11463c push af push de ld hl, $ddc8 - ld a, [PartyMon5Defense] + ld a, [wPartyMon5Defense] ld b, a .asm_114648 ld a, [de] @@ -2050,7 +2050,7 @@ Function114c55: ; 114c55 ; 114c5e Function114c5e: ; 114c5e - ld de, PartyMon5Defense + ld de, wPartyMon5Defense push hl .asm_114c62 ld a, [hli] @@ -2133,7 +2133,7 @@ Function114c5e: ; 114c5e .asm_114cc6 ld [de], a pop hl - ld de, PartyMon5Defense + ld de, wPartyMon5Defense ld bc, NULL .asm_114cce inc bc @@ -2194,7 +2194,7 @@ endr 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 @@ Function114d39: ; 114d39 ; 114d99 Function114d99: ; 114d99 - ld de, PartyMon5Defense + ld de, wPartyMon5Defense xor a ld [de], a .asm_114d9e @@ -2321,17 +2321,17 @@ Function114d99: ; 114d99 .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,14 +2453,14 @@ Function114e62: ; 114e62 ld a, c and a jr nz, .asm_114e6f - ld a, [wStartDay] + ld a, [wTimerEventStartDay] and a jp z, Function11425c jr .asm_114e76 .asm_114e6f xor a - ld [wStartDay], a + ld [wTimerEventStartDay], a call Function114ee9 .asm_114e76 @@ -2532,7 +2532,7 @@ Function114ea0: ; 114ea0 ld [hli], a ld [hl], b xor a - ld [wStartDay], a + ld [wTimerEventStartDay], a ret .asm_114edb @@ -2656,7 +2656,7 @@ Function114f39: ; 114f39 ; 114f59 Function114f59: ; 114f59 - ld a, [wStartDay] + ld a, [wTimerEventStartDay] and a jr nz, .asm_114f7c ld a, [$dc03] @@ -2674,7 +2674,7 @@ Function114f59: ; 114f59 and a jr nz, .asm_114fe7 ld a, $1 - ld [wStartDay], a + ld [wTimerEventStartDay], a .asm_114f7c ld a, [$dc03] @@ -2856,7 +2856,7 @@ Function115062: ; 115062 ld d, [hl] ld b, $0 ld hl, $dc24 - ld a, [wStartDay] + ld a, [wTimerEventStartDay] cp $1 jr z, .asm_11509b cp $2 @@ -2881,14 +2881,14 @@ Function115062: ; 115062 call Function115d53 call Function1150b3 call Function115136 - ld a, [wStartDay] + ld a, [wTimerEventStartDay] inc a cp $4 jr nz, .asm_1150ae ld a, $2 .asm_1150ae - ld [wStartDay], a + ld [wTimerEventStartDay], a xor a .asm_1150b2 @@ -2898,7 +2898,7 @@ Function115062: ; 115062 Function1150b3: ; 1150b3 ld hl, $dc24 - ld de, PartyMon5Defense + ld de, wPartyMon5Defense ld b, $0 .asm_1150bb ld c, $0 @@ -3014,7 +3014,7 @@ Function115136: ; 115136 ld c, a ld a, [hli] ld b, a - ld hl, PartyMon5Defense + ld hl, wPartyMon5Defense .asm_11514d ld a, [hli] and a @@ -3383,7 +3383,7 @@ Function1152b8: ; 1152b8 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 @@ Function1152b8: ; 1152b8 .asm_115335 call Function1153b5 xor a - ld [wStartDay], a + ld [wTimerEventStartDay], a call Function114f59 and a jr nz, .asm_1152f9 @@ -3409,7 +3409,7 @@ Function1152b8: ; 1152b8 jr z, .asm_11536b call Function1153b5 xor a - ld [wStartDay], a + ld [wTimerEventStartDay], a call Function114f59 and a jr nz, .asm_1152f9 @@ -3480,7 +3480,7 @@ Function11537d: ; 11537d ld [hl], d xor a ld [$dc03], a - ld [wStartDay], a + ld [wTimerEventStartDay], a ret ; 1153b5 @@ -3702,7 +3702,7 @@ Function1153d2: ; 1153d2 Function1154d4: ; 1154d4 xor a - ld [wStartDay], a + ld [wTimerEventStartDay], a call Function1155af call Function11560a and a @@ -4038,7 +4038,7 @@ Function11560a: ; 11560a ; 1156cc Function1156cc: ; 1156cc - ld a, [wStartDay] + ld a, [wTimerEventStartDay] and a jp z, Function11425c cp $2 @@ -4067,7 +4067,7 @@ Function1156cc: ; 1156cc call Function11581e and a jr nz, .asm_11572b - ld a, [wStartDay] + ld a, [wTimerEventStartDay] cp $5 jr z, .asm_115716 ld a, [wDecoPoster] @@ -4091,7 +4091,7 @@ Function1156cc: ; 1156cc ld l, a add hl, de xor a - ld [wStartDay], a + ld [wTimerEventStartDay], a jp Function11425c .asm_11572b @@ -4228,7 +4228,7 @@ Function11575c: ; 11575c pop hl add hl, bc ld a, $2 - ld [wStartDay], a + ld [wTimerEventStartDay], a ret ; 1157d0 @@ -4277,7 +4277,7 @@ Function1157d0: ; 1157d0 ld a, b ld [wDecoBed], a ld a, $4 - ld [wStartDay], a + ld [wTimerEventStartDay], a ret .asm_11580f @@ -4287,13 +4287,13 @@ Function1157d0: ; 1157d0 ld a, b 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] @@ -4319,9 +4319,9 @@ Function11581e: ; 11581e 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 @@ Function11581e: ; 11581e 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 @@ Function11581e: ; 11581e 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 @@ Function11581e: ; 11581e .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 @@ Function11581e: ; 11581e .asm_1158bc ld a, $ff - ld [wStartDay], a + ld [wTimerEventStartDay], a ret ; 1158c2 @@ -4641,7 +4641,7 @@ Function1159dc: ; 1159dc ; 1159fb Function1159fb: ; 1159fb - ld a, [wStartDay] + ld a, [wTimerEventStartDay] and a jp z, Function11425c cp $2 @@ -4670,7 +4670,7 @@ Function1159fb: ; 1159fb call Function115b00 and a jr nz, .asm_115a5a - ld a, [wStartDay] + ld a, [wTimerEventStartDay] cp $5 jr z, .asm_115a45 ld a, [wDecoPoster] @@ -4694,7 +4694,7 @@ Function1159fb: ; 1159fb ld l, a add hl, de xor a - ld [wStartDay], a + ld [wTimerEventStartDay], a jp Function11425c .asm_115a5a @@ -4759,7 +4759,7 @@ Function115a5f: ; 115a5f rl b add hl, bc ld a, $2 - ld [wStartDay], a + ld [wTimerEventStartDay], a ret ; 115ab0 @@ -4808,7 +4808,7 @@ Function115ab0: ; 115ab0 ld a, b ld [wDecoBed], a ld a, $4 - ld [wStartDay], a + ld [wTimerEventStartDay], a xor a ret @@ -4819,14 +4819,14 @@ Function115ab0: ; 115ab0 ld a, b ld [wDecoBed], a ld a, $3 - ld [wStartDay], a + ld [wTimerEventStartDay], a xor a ret ; 115b00 Function115b00: ; 115b00 - ld a, [wStartDay] + ld a, [wTimerEventStartDay] and a ret z ld a, [$dc0e] @@ -4841,7 +4841,7 @@ Function115b00: ; 115b00 ld e, [hl] inc hl ld d, [hl] - ld hl, PartyMon5Defense + ld hl, wPartyMon5Defense push bc call Function115bc8 pop hl @@ -4849,7 +4849,7 @@ Function115b00: ; 115b00 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,7 +4866,7 @@ Function115b00: ; 115b00 .asm_115b3d ld a, $ff - ld [wStartDay], a + ld [wTimerEventStartDay], a ret .asm_115b43 @@ -4885,7 +4885,7 @@ Function115b00: ; 115b00 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 @@ Function115b00: ; 115b00 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 @@ Function115b00: ; 115b00 .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 @@ -5018,7 +5018,7 @@ Function115bc8: ; 115bc8 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 @@ endr .asm_115c99 ld a, $ff - ld [wStartDay], a + ld [wTimerEventStartDay], a ret .asm_115c9f @@ -5226,7 +5226,7 @@ Function115cfd: ; 115cfd pop hl pop hl ld a, $ff - ld [wStartDay], a + ld [wTimerEventStartDay], a ret .asm_115d2f @@ -7030,7 +7030,7 @@ Function1177b7: ; 1177b7 (45:77b7) 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) diff --git a/mobile/mobile_45_sprite_engine.asm b/mobile/mobile_45_sprite_engine.asm index e8c0cc203c7..e9156b598d9 100755 --- a/mobile/mobile_45_sprite_engine.asm +++ b/mobile/mobile_45_sprite_engine.asm @@ -22,7 +22,7 @@ Function115dc3: ; 115dc3 xor a ld [wc305], a ld a, $a0 - ld hl, Sprite32 + ld hl, wSprite32 ld bc, 8 * SPRITEOAMSTRUCT_LENGTH call ByteFill ret @@ -34,7 +34,7 @@ Function115dd3: ; 115dd3 and a ret z ld a, $a0 - ld hl, Sprite32 + ld hl, wSprite32 ld bc, 8 * SPRITEOAMSTRUCT_LENGTH call ByteFill call Function115e22 @@ -50,7 +50,7 @@ Function115dd3: ; 115dd3 ld d, a push de pop hl - ld de, Sprite32 + ld de, wSprite32 ld a, [wc307] ld c, a ld a, [wc308] @@ -493,12 +493,12 @@ Function1161d5: ; 1161d5 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 @@ Function1162f2: ; 1162f2 ld e, a ld a, [hli] sub e - ld de, Sprite10 + ld de, wSprite10 .asm_116321 push af ld a, [hli] @@ -626,7 +626,7 @@ Function1162f2: ; 1162f2 ld e, a ld a, [hli] sub e - ld de, Sprite01 + ld de, wSprite01 .asm_11635a push af ld a, [hli] @@ -677,11 +677,11 @@ Function11636e: ; 11636e 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 @@ -725,20 +725,20 @@ Function1163c0: ; 1163c0 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 @@ Function116441: ; 116441 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 diff --git a/mobile/mobile_46.asm b/mobile/mobile_46.asm index 8090c3a9baa..76b2bb01f58 100755 --- a/mobile/mobile_46.asm +++ b/mobile/mobile_46.asm @@ -183,7 +183,7 @@ Function118125: ; 118125 ; 118180 Function118180: ; 118180 - ld a, [ScriptVar] + ld a, [wScriptVar] and a ret nz ld a, [wcd38] @@ -224,7 +224,7 @@ Function118180: ; 118180 .return_d3 ld a, $d3 ld [wc300], a - ld [ScriptVar], a + ld [wScriptVar], a jr .reset_banks ; 1181da @@ -477,7 +477,7 @@ BattleTowerRoomMenu_InitRAM: ; 1183cb 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 @@ BattleTowerRoomMenu_Cleanup: ; 118452 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 @@ Function11886e: xor a asm_11886f - ld [BGMapPalBuffer], a + ld [wBGMapPalBuffer], a ld a, $0 ld [wcd3c], a call BattleTowerRoomMenu_IncrementJumptable @@ -1189,7 +1189,7 @@ BattleTowerRoomMenu_PlacePickLevelMenu: 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 @@ BattleTowerRoomMenu_UpdatePickLevelMenu: 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 @@ Function118e92: ; 118e92 Function118eb0: ; 118eb0 call Function118440 ld hl, $d802 - ld de, BGMapBuffer + ld de, wBGMapBuffer ld bc, $000c call CopyBytes call Function1192cc @@ -2045,7 +2045,7 @@ Function119054: ; 119054 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 @@ Function1190d0: ; 1190d0 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 @@ Function11914e: ; 11914e 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 @@ Function1192cc: ; 1192cc 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 @@ BattleTower_LevelCheck: ; 119d93 (46:5d93) 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 @@ BattleTower_UbersCheck: ; 119dd1 (46:5dd1) 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 @@ BattleTower_UbersCheck: ; 119dd1 (46:5dd1) 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 @@ Function119f98: ; 119f98 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 @@ Function11a00e: ; 11a00e .asm_11a02a call CloseSRAM - ld a, [BGMapPalBuffer] + ld a, [wBGMapPalBuffer] and a jr z, .asm_11a039 dec a @@ -5162,7 +5162,7 @@ Function11a5b9: ; 11a5b9 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 @@ Function11a5f5: ; 11a5f5 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 @@ Function11a971: ; 11a971 ret .asm_11a97f - ld a, [Options] + ld a, [wOptions] and $7 ld [hl], a ld hl, wcd8d @@ -5715,10 +5715,10 @@ Text_WhichBattleRoom: ; 0x11ac0b ; 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 @@ Special_Function11ac3e: ; 11ac3e 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 @@ Function11ac51: ; 11ac51 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 @@ Function11ad95: ; 11ad95 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 @@ Function11ae4e: ; 11ae4e 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 @@ Function11ae98: cp $2 jr z, .asm_11aeb4 ld a, [wcd4b] - ld [ScriptVar], a + ld [wScriptVar], a call Function11b022 call Function11ad8a @@ -6112,10 +6112,10 @@ Function11af04: ; 11af04 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 @@ Function11af4e: ld a, $6 ld [wJumptableIndex], a xor a - ld [ScriptVar], a + ld [wScriptVar], a .asm_11afaa call ExitMenu @@ -6273,7 +6273,7 @@ Function11b022: ; 11b022 ld a, [wcd2e] and a jr z, .asm_11b02e - ld hl, StringBuffer3 + ld hl, wStringBuffer3 call Function11b03d .asm_11b02e @@ -6282,7 +6282,7 @@ Function11b022: ; 11b022 ret z cp $3 ret z - ld hl, StringBuffer4 + ld hl, wStringBuffer4 call Function11b03d ret ; 11b03d @@ -6684,13 +6684,13 @@ Function11b239: ; 11b239 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 @@ Function11b275: ; 11b275 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 @@ Function11b295: ; 11b295 .asm_11b2e7 ld a, $6 - ld bc, StringBuffer4 + ld bc, wStringBuffer4 .asm_11b2ec push af ld a, [de] @@ -6795,7 +6795,7 @@ Function11b295: ; 11b295 and a jr nz, .asm_11b2ec pop hl - ld de, StringBuffer4 + ld de, wStringBuffer4 call PlaceString ret ; 11b2fe @@ -6921,7 +6921,7 @@ Function11b31b: ; 11b31b db $39 ; 13 Function11b397: ; 11b397 - ld de, Sprite01 + ld de, wSprite01 .loop ld a, [hl] cp $ff @@ -6979,7 +6979,7 @@ Unreferenced_Function11b3b6: ; 11b3b6 ; 11b3d9 Function11b3d9: ; 11b3d9 - ld de, Sprite29 + ld de, wSprite29 push de ld a, [wc7d2] dec a @@ -7092,7 +7092,7 @@ Mobile46_RunJumptable: ; 11b45c Function11b483: ; 11b483 call .InitRAM - ld hl, PlayerName + ld hl, wPlayerName ld a, NAME_LENGTH_JAPANESE - 1 .loop1 push af @@ -7105,7 +7105,7 @@ Function11b483: ; 11b483 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 @@ Function11b483: ; 11b483 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 @@ Function11b483: ; 11b483 ld [hl], a pop bc ld de, NAME_LENGTH - ld hl, PartyMonOT + ld hl, wPartyMonOT pop af push af .loop4 @@ -7181,7 +7181,7 @@ Function11b483: ; 11b483 and a jr nz, .loop5 ld de, NAME_LENGTH - ld hl, PartyMonNicknames + ld hl, wPartyMonNicknames pop af push af .loop6 @@ -7230,12 +7230,12 @@ Function11b483: ; 11b483 .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 @@ Function11b483: ; 11b483 Function11b570: ; 11b570 call Function118007 - ld a, [ScriptVar] + ld a, [wScriptVar] and a jr nz, .exit call .SaveData @@ -7322,7 +7322,7 @@ Function11b570: ; 11b570 Function11b5c0: ; 11b5c0 ld a, [wcd82] dec a - ld [CurPartyMon], a + ld [wCurPartyMon], a xor a ld [wPokemonWithdrawDepositParameter], a farcall RemoveMonFromPartyOrBox @@ -7333,7 +7333,7 @@ Function11b5c0: ; 11b5c0 Function11b5e0: ; 11b5e0 xor a - ld [ScriptVar], a + ld [wScriptVar], a jp Function11ad8a ; 11b5e7 @@ -7396,7 +7396,7 @@ Special_Function11b5e8: ; 11b5e8 Function11b66d: ; 11b66d call Function1180b8 - ld a, [ScriptVar] + ld a, [wScriptVar] and a jr nz, .asm_11b6b0 ld a, [rSVBK] @@ -7417,11 +7417,11 @@ Function11b66d: ; 11b66d .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 @@ Function11b6b4: ; 11b6b4 .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 @@ Function11b6b4: ; 11b6b4 .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 @@ Function11b6b4: ; 11b6b4 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 @@ Special_Function11b7e5: ; 11b7e5 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_Function11b7e5: ; 11b7e5 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 @@ Special_Function11b879: ; 11b879 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 @@ Special_Function11b879: ; 11b879 bit 7, h ret z ld a, $2 - ld [ScriptVar], a + ld [wScriptVar], a ret ; 11b920 @@ -7783,7 +7783,7 @@ Special_Function11b93b: ; 11b93b ; 11b98f AddMobileMonToParty: ; 11b98f - ld hl, PartyCount + ld hl, wPartyCount ld a, [hl] ld e, a inc [hl] @@ -7793,21 +7793,21 @@ AddMobileMonToParty: ; 11b98f ld a, [wMobileMonSpeciesPointerBuffer + 1] ld h, a inc hl - ld bc, PartySpecies + ld bc, wPartySpecies ld d, e .loop1 inc bc dec d jr nz, .loop1 ld a, e - ld [CurPartyMon], a + ld [wCurPartyMon], a ld a, [hl] ld [bc], a inc bc 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 @@ AddMobileMonToParty: ; 11b98f 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 @@ AddMobileMonToParty: ; 11b98f ld a, "@" ld [de], a - ld hl, PartyMonNicknames + ld hl, wPartyMonNicknames ld bc, MON_NAME_LENGTH ld a, [wMobileMonSpeciesBuffer] .loop4 @@ -7890,7 +7890,7 @@ Special_Function11ba38: ; 11ba38 farcall CheckCurPartyMonFainted ret c xor a - ld [ScriptVar], a + ld [wScriptVar], a ret ; 11ba44 diff --git a/mobile/mobile_5b.asm b/mobile/mobile_5b.asm index e7e7e437fb4..a35c8564161 100755 --- a/mobile/mobile_5b.asm +++ b/mobile/mobile_5b.asm @@ -83,7 +83,7 @@ Unreferenced_Function16c000: ; 16c000 Function16c089: ; 16c089 ld a, $1 - ld [Buffer2], a + ld [wBuffer2], a ld [wd1f1], a xor a ld [hWY], a @@ -103,7 +103,7 @@ Function16c09e: ; 16c09e Function16c0a8: ; 16c0a8 xor a - ld [Buffer2], a + ld [wBuffer2], a ld [wd1f1], a call ClearSprites ld a, $90 @@ -200,7 +200,7 @@ MobileSystemSplashScreen_InitGFX: ; 16c108 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 @@ MobileSystemSplashScreen_InitGFX: ; 16c108 ; 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 @@ MobileSystemSplashScreen_InitGFX: ; 16c108 .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 @@ Function16cb08: ; 16cb08 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,7 +559,7 @@ Function16cb0f: ; 16cb0f ; 16cb2e Function16cb2e: ; 16cb2e - ld a, [Buffer2] + ld a, [wBuffer2] and a ret z call Function16cb40 @@ -754,7 +754,7 @@ Function16cc5a: ; 16cc5a ; 16cc62 Function16cc62: ; 16cc62 - hlcoord 0, 15, AttrMap + hlcoord 0, 15, wAttrMap ld bc, $0028 ld a, $1 call ByteFill @@ -776,7 +776,7 @@ Function16cc73: pop hl ld a, $1 ld [rVBK], a - decoord 0, 0, AttrMap + decoord 0, 0, wAttrMap call Function16cc90 pop af ld [rVBK], a diff --git a/mobile/mobile_5c.asm b/mobile/mobile_5c.asm index f973c23785c..474dde27031 100755 --- a/mobile/mobile_5c.asm +++ b/mobile/mobile_5c.asm @@ -131,7 +131,7 @@ Function170c06: ; 170c06 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 @@ Function170c06: ; 170c06 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 @@ Function170c06: ; 170c06 ; 170c8b Function170c8b: ; 170c8b - ld hl, LastEnemyCounterMove + ld hl, wLastEnemyCounterMove ld b, $5 .asm_170c90 ld a, [hl] @@ -698,7 +698,7 @@ Function171c87: ; 171c87 (5c:5c87) 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 @@ Function171ccd: ; 171ccd (5c:5ccd) 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 @@ Function171d2b: ; 171d2b (5c:5d2b) 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 @@ Function172e78: ; 172e78 (5c:6e78) 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 @@ Function172e78: ; 172e78 (5c:6e78) ld bc, $168 call CopyBytes ld hl, Attrmap_173517 - decoord 0, 0, AttrMap + decoord 0, 0, wAttrMap ld bc, $168 call CopyBytes ret diff --git a/mobile/mobile_5e.asm b/mobile/mobile_5e.asm index ac1e21a9420..3436d85b966 100644 --- a/mobile/mobile_5e.asm +++ b/mobile/mobile_5e.asm @@ -7,7 +7,7 @@ Function17a68f:: ; 17a68f (5e:668f) 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 @@ Function17a68f:: ; 17a68f (5e:668f) 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 @@ Function17a6a8: ; 17a6a8 (5e:66a8) ret Function17a6f5: ; 17a6f5 (5e:66f5) - ld hl, Buffer1 + ld hl, wBuffer1 ld c, $0 ld b, $8 .asm_17a6fc @@ -91,7 +91,7 @@ Function17a721: ; 17a721 (5e:6721) 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 @@ Function17a943: ; 17a943 (5e:6943) 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 @@ Function17a964: ; 17a964 (5e:6964) 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 @@ Function17a97b: ; 17a97b (5e:697b) lb bc, 2, 18 call ClearBox hlcoord 3, 2 - ld de, Buffer1 + ld de, wBuffer1 ld a, [$d08c] and a ret z @@ -663,7 +663,7 @@ Function17aaa9: ; 17aaa9 (5e:6aa9) 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 @@ Function17ac1d: ; 17ac1d (5e:6c1d) 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] diff --git a/mobile/mobile_5f.asm b/mobile/mobile_5f.asm index 6eeffa34a47..be9578d226e 100644 --- a/mobile/mobile_5f.asm +++ b/mobile/mobile_5f.asm @@ -11,7 +11,7 @@ Function17c000: ; 17c000 ld hl, HaveWantMap decoord 0, 0 - bccoord 0, 0, AttrMap + bccoord 0, 0, wAttrMap ld a, SCREEN_HEIGHT .y @@ -271,7 +271,7 @@ CheckStringForErrors_IgnoreTerminator: ; 17d0b3 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 @@ Function17d0f3: ; 17d0f3 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 @@ CheckStringContainsLessThanBNextCharacters: ; 17d1e1 ; 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 @@ Function17d1f1: ; 17d1f1 and a jr nz, .asm_17d223 - ld a, [UnownLetter] + ld a, [wUnownLetter] ld [wFirstUnownSeen], a .asm_17d223 @@ -427,26 +427,26 @@ Function17d1f1: ; 17d1f1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; 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 @@ Special_Menu_ChallengeExplanationCancel: ; 17d224 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 @@ Function17d246: ; 17d246 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 @@ Special_Function17d2ce: ; 17d2ce and a jr nz, .asm_17d2e2 ld a, $1 - ld [ScriptVar], a + ld [wScriptVar], a ret .asm_17d2e2 @@ -553,9 +553,9 @@ Special_Function17d2ce: ; 17d2ce 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 @@ Function17d314: ; 17d314 call ByteFill call CloseSRAM ld a, $2 - ld [ScriptVar], a + ld [wScriptVar], a scf ret ; 17d370 @@ -654,7 +654,7 @@ Function17d370: ; 17d370 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 @@ Function17d45a: ; 17d45a .asm_17d46f xor a - ld [ScriptVar], a + ld [wScriptVar], a ret ; 17d474 @@ -745,7 +745,7 @@ Function17d48d: ; 17d48d 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 @@ Function17d48d: ; 17d48d 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 @@ Function17d48d: ; 17d48d 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 @@ Function17d6a1: ; 17d6a1 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 @@ Function17d93a: ; 17d93a 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 @@ Function17d98b: ; 17d98b 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 @@ Function17ded9: ; 17ded9 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 @@ Function17ded9: ; 17ded9 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 @@ Function17ded9: ; 17ded9 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 @@ Function17ded9: ; 17ded9 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 @@ Function17ded9: ; 17ded9 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,25 +2427,25 @@ Function17ded9: ; 17ded9 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 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 @@ Function17ded9: ; 17ded9 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 @@ Function17ded9: ; 17ded9 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 @@ Function17ded9: ; 17ded9 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 @@ Function17e0fd: ; 17e0fd 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 @@ Function17e133: ; 17e133 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 @@ Function17e165: ; 17e165 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 @@ Function17e32b: ; 17e32b 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 @@ Function17e349: ; 17e349 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 @@ Function17e438: ; 17e438 ; 17e43d Function17e43d: ; 17e43d - ld a, [BGMapBuffer] + ld a, [wBGMapBuffer] ld l, a ld a, [wcd21] ld h, a @@ -3151,7 +3151,7 @@ Function17e43d: ; 17e43d ; 17e447 Function17e447: ; 17e447 - ld a, [BGMapBuffer] + ld a, [wBGMapBuffer] ld l, a ld a, [wcd21] ld h, a @@ -3182,7 +3182,7 @@ Function17e451: ; 17e451 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 @@ Function17e451: ; 17e451 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 @@ Function17e4dd: ; 17e4dd Function17e51b: ; 17e51b ld a, [wcd28] - ld hl, CreditsTimer + ld hl, wCreditsTimer sub [hl] inc a ld [wcd4f], a @@ -3298,7 +3298,7 @@ Function17e51b: ; 17e51b 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 @@ Function17e571: ; 17e571 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 @@ Function17e5af: ; 17e5af 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 @@ Function17e691: ; 17e691 .asm_17e6c7 pop hl - bccoord 0, 0, AttrMap + bccoord 0, 0, wAttrMap add hl, bc ld [hl], a pop hl @@ -3614,7 +3614,7 @@ Function17e6de: ; 17e6de 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 @@ Function17f2ff: ; 17f2ff 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 @@ Function17f41d: ; 17f41d 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 @@ Function17f4f6: ; 17f4f6 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 @@ Function17f5d2: ; 17f5d2 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 @@ Function17ff23: ; 17ff23 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 diff --git a/mobile/mobile_menu.asm b/mobile/mobile_menu.asm index 8c5786eb0cd..8de1f0f5e10 100755 --- a/mobile/mobile_menu.asm +++ b/mobile/mobile_menu.asm @@ -190,8 +190,8 @@ Function4a0c2: ; 4a0c2 (12:60c2) 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 @@ Function4a492: ; 4a492 (12:6492) 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 @@ MainMenu_MobileStudium: ; 4a496 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 @@ Function4a6ab: ; 4a6ab (12:66ab) 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 diff --git a/sram.asm b/sram.asm index ddfc6faf641..66c8af2c461 100644 --- a/sram.asm +++ b/sram.asm @@ -77,7 +77,7 @@ sLuckyIDNumber:: dw 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 @@ sStackTop:: dw SECTION "Save", SRAM -sOptions:: ds OptionsEnd - Options +sOptions:: ds wOptionsEnd - wOptions sCheckValue1:: db ; loaded with SAVE_CHECK_VALUE_1, used to check save corruption diff --git a/wram.asm b/wram.asm index 023aa28b0d0..ea50bf9432d 100644 --- a/wram.asm +++ b/wram.asm @@ -7,10 +7,10 @@ INCLUDE "vram.asm" SECTION "Stack", WRAM0 -StackBottom:: +wStackBottom:: ds $100 - 1 wStack:: -StackTop:: +wStackTop:: ds 1 @@ -19,19 +19,19 @@ SECTION "Audio RAM", WRAM0 wMusic:: ; nonzero if playing -MusicPlaying:: db ; c100 +wMusicPlaying:: db ; c100 -Channels:: -wChannel1:: channel_struct Channel1 ; c101 -wChannel2:: channel_struct Channel2 ; c133 -wChannel3:: channel_struct Channel3 ; c165 -wChannel4:: 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:: -wChannel5:: channel_struct Channel5 ; c1c9 -wChannel6:: channel_struct Channel6 ; c1fb -wChannel7:: channel_struct Channel7 ; c22d -wChannel8:: 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,8 +41,8 @@ wCurTrackFrequency:: dw wc296:: db ; BCD value, dummied out wCurNoteDuration:: db ; used in MusicE0 and LoadNote -CurMusicByte:: db ; c298 -CurChannel:: db ; c299 +wCurMusicByte:: db ; c298 +wCurChannel:: db ; c299 wVolume:: ; c29a ; corresponds to $ff24 ; Channel control / ON-OFF / Volume (R/W) @@ -51,12 +51,12 @@ wVolume:: ; c29a ; 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,13 +65,13 @@ SoundInput:: ; c29c ; 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 wLowHealthAlarm:: ; c2a6 ; bit 7: on/off @@ -79,46 +79,46 @@ wLowHealthAlarm:: ; c2a6 ; 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 @@ wLZBank:: db ; c2c4 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 @@ wLinkMode:: ; c2dc ; 4 mobile battle db -ScriptVar:: db ; c2dd +wScriptVar:: db ; c2dd wPlayerNextMovement:: db wPlayerMovement:: db @@ -190,12 +190,12 @@ wTempObjectCopyRadius:: db ; c2f8 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 @@ wSpriteAnimDict:: ds 10 * 2 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 @@ ENDU ; c3b4 wSpriteAnimCount:: db wCurrSpriteOAMAddr:: db -CurIcon:: db ; c3b6 +wCurIcon:: db ; c3b6 wCurIconTile:: db wSpriteAnimAddrBackup:: @@ -303,55 +303,55 @@ wc3fc:: ds 1 SECTION "Sprites", WRAM0 wVirtualOAM:: ; 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:: +wSprite01:: sprite_oam_struct wSprite01 +wSprite02:: sprite_oam_struct wSprite02 +wSprite03:: sprite_oam_struct wSprite03 +wSprite04:: sprite_oam_struct wSprite04 +wSprite05:: sprite_oam_struct wSprite05 +wSprite06:: sprite_oam_struct wSprite06 +wSprite07:: sprite_oam_struct wSprite07 +wSprite08:: sprite_oam_struct wSprite08 +wSprite09:: sprite_oam_struct wSprite09 +wSprite10:: sprite_oam_struct wSprite10 +wSprite11:: sprite_oam_struct wSprite11 +wSprite12:: sprite_oam_struct wSprite12 +wSprite13:: sprite_oam_struct wSprite13 +wSprite14:: sprite_oam_struct wSprite14 +wSprite15:: sprite_oam_struct wSprite15 +wSprite16:: sprite_oam_struct wSprite16 +wSprite17:: sprite_oam_struct wSprite17 +wSprite18:: sprite_oam_struct wSprite18 +wSprite19:: sprite_oam_struct wSprite19 +wSprite20:: sprite_oam_struct wSprite20 +wSprite21:: sprite_oam_struct wSprite21 +wSprite22:: sprite_oam_struct wSprite22 +wSprite23:: sprite_oam_struct wSprite23 +wSprite24:: sprite_oam_struct wSprite24 +wSprite25:: sprite_oam_struct wSprite25 +wSprite26:: sprite_oam_struct wSprite26 +wSprite27:: sprite_oam_struct wSprite27 +wSprite28:: sprite_oam_struct wSprite28 +wSprite29:: sprite_oam_struct wSprite29 +wSprite30:: sprite_oam_struct wSprite30 +wSprite31:: sprite_oam_struct wSprite31 +wSprite32:: sprite_oam_struct wSprite32 +wSprite33:: sprite_oam_struct wSprite33 +wSprite34:: sprite_oam_struct wSprite34 +wSprite35:: sprite_oam_struct wSprite35 +wSprite36:: sprite_oam_struct wSprite36 +wSprite37:: sprite_oam_struct wSprite37 +wSprite38:: sprite_oam_struct wSprite38 +wSprite39:: sprite_oam_struct wSprite39 +wSprite40:: sprite_oam_struct wSprite40 +wSpritesEnd:: 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 @@ wMiscEnd:: 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 @@ wBattle:: 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 @@ wEnemyTrainerItem1:: db ; c650 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,24 +423,24 @@ wBattleParticipantsNotFainted:: ; All bits cleared if the enemy faints. db -TypeModifier:: ; c665 +wTypeModifier:: ; c665 ; >10: super-effective ; 10: normal ; <10: not very effective ; 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 @@ PlayerSubStatus1:: ; c668 ; 1 curse ; 0 nightmare db -PlayerSubStatus2:: ; c669 +wPlayerSubStatus2:: ; c669 ; bit ; 7 ; 6 @@ -462,7 +462,7 @@ PlayerSubStatus2:: ; c669 ; 1 ; 0 curled db -PlayerSubStatus3:: ; c66a +wPlayerSubStatus3:: ; c66a ; bit ; 7 confused ; 6 flying @@ -473,7 +473,7 @@ PlayerSubStatus3:: ; c66a ; 1 rampage ; 0 bide db -PlayerSubStatus4:: ; c66b +wPlayerSubStatus4:: ; c66b ; bit ; 7 leech seed ; 6 rage @@ -484,7 +484,7 @@ PlayerSubStatus4:: ; c66b ; 1 mist ; 0 x accuracy db -PlayerSubStatus5:: ; c66c +wPlayerSubStatus5:: ; c66c ; bit ; 7 can't run ; 6 destiny bond @@ -496,118 +496,118 @@ PlayerSubStatus5:: ; c66c ; 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:: 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 @@ wSafariMonAngerCount:: db 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 wBattleLowHealthAlarm:: db ; c6fd wPlayerMinimized:: db ; c6fe -PlayerScreens:: ; c6ff +wPlayerScreens:: ; c6ff ; bit ; 7 ; 6 @@ -645,18 +645,18 @@ PlayerScreens:: ; c6ff ; 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 wBattleWeather:: ; c70a @@ -669,19 +669,19 @@ wBattleWeather:: ; c70a ; 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 @@ wEnemyAISwitchScore:: db ; c716 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 @@ wEnemyWrapCount:: db ; c731 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 @@ wc7e8_End:: 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 @@ NEXTU ; c800 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 @@ ENDU ; cd20 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 @@ wcd8c:: ds 1 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 @@ wCurHPPal:: db 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 @@ AttrMap:: ; cdd9 ; 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 @@ wcf57:: db wLinkTimeoutFrames:: dw ; cf5b wcf5d:: dw -MonType:: db ; cf5f +wMonType:: db ; cf5f -CurSpecies:: -CurMove:: +wCurSpecies:: +wCurMove:: db ; cf60 wNamedObjectTypeBuffer:: db @@ -1385,20 +1385,20 @@ wPrinterQueueLength:: 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 @@ wCursorCurrentTile:: dw ; cfac 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,19 +1502,19 @@ wcfbe:: ; SGB flags? ds 1 -InBattleTowerBattle:: ; cfc0 +wInBattleTowerBattle:: ; cfc0 ; 0 not in BattleTower-Battle ; 1 BattleTower-Battle db 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 @@ wNumHits:: db 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 @@ Options:: ; cfcc ; 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 @@ GBPrinter:: ; cfd0 ; 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 @@ SECTION "WRAM 1", WRAMX 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 @@ ENDU NEXTU ; d002 ; phone call data -PhoneScriptBank:: db -PhoneCaller:: dw +wPhoneScriptBank:: db +wPhoneCaller:: dw NEXTU ; d002 ; radio data @@ -1648,11 +1648,11 @@ wRadioTextEnd:: 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 @@ wMovementBufferCount:: db wMovementBufferObject:: db wUnusedMovementBufferBank:: db wUnusedMovementBufferPointer:: dw -MovementBuffer:: ds 55 +wMovementBuffer:: ds 55 NEXTU ; d002 ; box printing @@ -1694,8 +1694,8 @@ wApricorns:: 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 @@ wd036:: ds 2 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 @@ wCurBGEventScriptAddr:: dw NEXTU ; d03e ; mart data ds 1 -MartPointerBank:: db -MartPointer:: dw +wMartPointerBank:: db +wMartPointer:: dw ds 1 wBargainShopFlags:: db @@ -1795,16 +1795,16 @@ wTempTrainerEnd:: 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 @@ ENDU ; d066 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 @@ -1878,7 +1878,7 @@ wBattlePlayerAction:: 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 @@ wUsingItemWithSelect:: db ; d0ef 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 @@ wListPointer:: dw ; d100 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 @@ wPokemonWithdrawDepositParameter:: 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 @@ wPlayerStepDirection:: ; d151 wBGMapAnchor:: dw ; d152 UNION ; d154 -UsedSprites:: ds 64 -UsedSpritesEnd:: +wUsedSprites:: ds 64 +wUsedSpritesEnd:: NEXTU ; d154 ds 31 @@ -1995,54 +1995,54 @@ wMetatileStandingX:: db ; d197 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 - -Tileset:: -TilesetBank:: db ; d1d9 -TilesetAddress:: dw ; d1da -TilesetBlocksBank:: db ; d1dc -TilesetBlocksAddress:: dw ; d1dd -TilesetCollisionBank:: db ; d1df -TilesetCollisionAddress:: dw ; d1e0 -TilesetAnim:: dw ; bank 3f ; d1e2 +wNorthMapConnection:: map_connection_struct wNorth ; d1a9 +wSouthMapConnection:: map_connection_struct wSouth ; d1b5 +wWestMapConnection:: map_connection_struct wWest ; d1c1 +wEastMapConnection:: map_connection_struct wEast ; d1cd + +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 @@ wMagikarpLength:: dw 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,59 +2104,59 @@ wBattleMode:: ; d22d ; 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 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:: - -CurDamage:: dw ; d256 +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:: + +wCurDamage:: dw ; d256 ds 2 @@ -2180,7 +2180,7 @@ wFailedToFlee:: db wNumFleeAttempts:: db wMonTriedToEvolve:: db -TimeOfDay:: db ; d269 +wTimeOfDay:: db ; d269 ds 1 @@ -2196,29 +2196,29 @@ wd271:: ds 5 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:: - -OTPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d3a8 -OTPartyMonNicknames:: ds MON_NAME_LENGTH * PARTY_LENGTH ; d3ea -OTPartyDataEnd:: +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:: + +wOTPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d3a8 +wOTPartyMonNicknames:: ds MON_NAME_LENGTH * PARTY_LENGTH ; d3ea +wOTPartyDataEnd:: ds 4 NEXTU ; d288 @@ -2242,18 +2242,18 @@ wd430:: 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 @@ ScriptFlags3:: ; d436 ; 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 @@ wXYComparePointer:: dw ; d453 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 @@ wd479:: ds 2 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 @@ wCenteredObject:: db 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,7 +2435,7 @@ wStatusFlags2:: ; d84d ; 7 - rockets in mahogany db -Money:: ds 3 ; d84e +wMoney:: ds 3 ; d84e wMomsMoney:: ds 3 ; d851 wMomSavingMoney:: db ; d854 @@ -2446,23 +2446,23 @@ 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 +wNumItems:: db ; d892 wItems:: ds MAX_ITEMS * 2 + 1 ; d893 -ItemsEnd:: +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 +wNumBalls:: db ; d8d7 wBalls:: ds MAX_BALLS * 2 + 1 ; d8d8 -BallsEnd:: +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 @@ wPokegearFlags:: 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 @@ wErinFightCount:: db ds 100 -EventFlags:: flag_array NUM_EVENTS ; da72 +wEventFlags:: flag_array NUM_EVENTS ; da72 ; db6c ds 6 @@ -2661,17 +2661,17 @@ 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 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 @@ wPlayerMonSelection:: ds 3 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,20 +2733,20 @@ wDigMapNumber:: db ; dcac ; 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 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 @@ SECTION "Party", WRAMX 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 @@ wGameDataEnd:: SECTION "Pic Animations", WRAMX -TempTileMap:: +wTempTileMap:: ; 20x18 grid of 8x8 tiles ds SCREEN_WIDTH * SCREEN_HEIGHT ; $168 = 360 @@ -2893,9 +2893,9 @@ w3_d081:: ds $f 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 @@ -2949,8 +2949,8 @@ 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,44 +2963,44 @@ wMagnetTrainPlayerSpriteInitX:: db ds 106 -LYOverridesBackup:: ds SCREEN_HEIGHT_PX ; d200 -LYOverridesBackupEnd:: +wLYOverridesBackup:: ds SCREEN_HEIGHT_PX ; d200 +wLYOverridesBackupEnd:: SECTION "Battle Animations", WRAMX 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 - -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:: +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 + +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 From 3203ad7d50f6558cba8494a4e93d095d16c5e0d2 Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Tue, 30 Jan 2018 14:05:25 -0500 Subject: [PATCH 4/8] Fix comment/style issues caused from w-izing. --- engine/battle/ai/items.asm | 2 +- engine/battle/ai/move.asm | 2 +- engine/battle/core.asm | 5 +- engine/color.asm | 2 +- engine/credits.asm | 2 +- engine/crystal_intro.asm | 2 +- engine/pic_animation.asm | 2 +- engine/pokegear.asm | 2 +- engine/variables.asm | 24 ++++---- home/battle.asm | 104 +--------------------------------- home/battle_vars.asm | 111 +++++++++++++++++++++++++++++++++++++ home/tilemap.asm | 2 +- wram.asm | 2 +- 13 files changed, 138 insertions(+), 124 deletions(-) create mode 100644 home/battle_vars.asm diff --git a/engine/battle/ai/items.asm b/engine/battle/ai/items.asm index 6ec490b7187..4d1eea2e8c9 100644 --- a/engine/battle/ai/items.asm +++ b/engine/battle/ai/items.asm @@ -21,7 +21,7 @@ AI_SwitchOrTryItem: ; 38000 jr nz, DontSwitch ld hl, TrainerClassAttributes + TRNATTR_AI_ITEM_SWITCH - ld a, [wInBattleTowerBattle] ; Load always the first wTrainerClass for BattleTower-Trainers + ld a, [wInBattleTowerBattle] ; always load the first trainer class in wTrainerClass for BattleTower-Trainers and a jr nz, .ok diff --git a/engine/battle/ai/move.asm b/engine/battle/ai/move.asm index c3e9bed2792..b5ac966f86e 100755 --- a/engine/battle/ai/move.asm +++ b/engine/battle/ai/move.asm @@ -66,7 +66,7 @@ AIChooseMove: ; 440ce .ApplyLayers: ld hl, TrainerClassAttributes + TRNATTR_AI_MOVE_WEIGHTS - ; If we have a battle in BattleTower just load the Attributes of the first wTrainerClass (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, [wInBattleTowerBattle] bit 0, a diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 4cdd7f226f1..3742f00c986 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6133,7 +6133,7 @@ LoadEnemyMon: ; 3e8eb ; Notes: ; BattleRandom is used to ensure sync between Game Boys -; Clear the whole wEnemyMon struct +; Clear the whole enemy mon struct (wEnemyMon) xor a ld hl, wEnemyMonSpecies ld bc, wEnemyMonEnd - wEnemyMon @@ -6989,7 +6989,8 @@ ApplyStatLevelMultiplier: ; 3ecb7 ; 3ed45 BadgeStatBoosts: ; 3ed45 -; Raise wBattleMon 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. diff --git a/engine/color.asm b/engine/color.asm index 88dd8e8d650..21842b7b379 100644 --- a/engine/color.asm +++ b/engine/color.asm @@ -602,7 +602,7 @@ ApplyPals: ld hl, wBGPals1 ld de, wBGPals2 ld bc, 16 palettes - ld a, BANK(wPals) + ld a, BANK(wGBCPalettes) call FarCopyWRAM ret diff --git a/engine/credits.asm b/engine/credits.asm index eb5347f26e8..1aaecf64af8 100644 --- a/engine/credits.asm +++ b/engine/credits.asm @@ -13,7 +13,7 @@ Credits:: ; 109847 ld a, [rSVBK] push af - ld a, BANK(wPals) + ld a, BANK(wGBCPalettes) ld [rSVBK], a call ClearBGPalettes diff --git a/engine/crystal_intro.asm b/engine/crystal_intro.asm index d482c3cfa01..d6c467867e2 100755 --- a/engine/crystal_intro.asm +++ b/engine/crystal_intro.asm @@ -352,7 +352,7 @@ INCBIN "gfx/splash/logo2.1bpp" CrystalIntro: ; e48ac ld a, [rSVBK] push af - ld a, BANK(wPals) + ld a, BANK(wGBCPalettes) ld [rSVBK], a ld a, [hInMenu] push af diff --git a/engine/pic_animation.asm b/engine/pic_animation.asm index b93a10dd232..a84c3f44934 100644 --- a/engine/pic_animation.asm +++ b/engine/pic_animation.asm @@ -326,7 +326,7 @@ PokeAnim_InitPicAttributes: ; d01d6 ld [wPokeAnimPointer], a ld a, b ld [wPokeAnimPointer + 1], a -; hl contains wTileMap coords +; hl contains tilemap coords ld a, l ld [wPokeAnimCoord], a ld a, h diff --git a/engine/pokegear.asm b/engine/pokegear.asm index a782b31b62b..affe9d6bd65 100755 --- a/engine/pokegear.asm +++ b/engine/pokegear.asm @@ -247,7 +247,7 @@ InitPokegearTilemap: ; 90da8 (24:4da8) xor a ld [hBGMapMode], a hlcoord 0, 0 - ld bc, wTileMapEnd - wTileMap + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld a, $4f call ByteFill ld a, [wPokegearCard] diff --git a/engine/variables.asm b/engine/variables.asm index 25870a96740..89026fdba85 100755 --- a/engine/variables.asm +++ b/engine/variables.asm @@ -39,26 +39,26 @@ _GetVarAction:: ; 80648 (20:4648) ; RETVAR_STRBUF2: copy [de] to wStringBuffer2 ; RETVAR_ADDR_DE: return address in de ; RETVAR_EXECUTE: call function - dwb wStringBuffer2, RETVAR_STRBUF2 - dwb wPartyCount, RETVAR_STRBUF2 + dwb wStringBuffer2, RETVAR_STRBUF2 + dwb wPartyCount, RETVAR_STRBUF2 dwb .BattleResult, RETVAR_EXECUTE - dwb wBattleType, RETVAR_ADDR_DE - dwb wTimeOfDay, RETVAR_STRBUF2 + dwb wBattleType, RETVAR_ADDR_DE + dwb wTimeOfDay, RETVAR_STRBUF2 dwb .CountCaughtMons, RETVAR_EXECUTE dwb .CountSeenMons, RETVAR_EXECUTE dwb .CountBadges, RETVAR_EXECUTE - dwb wPlayerState, RETVAR_ADDR_DE - dwb .wPlayerFacing, RETVAR_EXECUTE + dwb wPlayerState, RETVAR_ADDR_DE + dwb .PlayerFacing, RETVAR_EXECUTE dwb hHours, RETVAR_STRBUF2 dwb .DayOfWeek, RETVAR_EXECUTE - dwb wMapGroup, RETVAR_STRBUF2 - dwb wMapNumber, 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 wXCoord, RETVAR_STRBUF2 - dwb wYCoord, RETVAR_STRBUF2 + dwb wXCoord, RETVAR_STRBUF2 + dwb wYCoord, RETVAR_STRBUF2 dwb wSpecialPhoneCallID, RETVAR_STRBUF2 dwb wNrOfBeatenBattleTowerTrainers, RETVAR_STRBUF2 dwb wKurtApricornQuantity, RETVAR_STRBUF2 @@ -96,7 +96,7 @@ _GetVarAction:: ; 80648 (20:4648) jp .loadstringbuffer2 ; 806ef -.wPlayerFacing: ; 806ef +.PlayerFacing: ; 806ef ; The direction the player is facing. ld a, [wPlayerDirection] and $c diff --git a/home/battle.asm b/home/battle.asm index b4b7cf84418..e59b1e3b4aa 100644 --- a/home/battle.asm +++ b/home/battle.asm @@ -25,7 +25,7 @@ OpponentPartyAttr:: ; 3951 BattlePartyAttr:: ; 395d -; Get attribute a from the active wBattleMon's party struct. +; Get attribute a from the party struct of the active battle mon. push bc ld c, a ld b, 0 @@ -39,7 +39,7 @@ BattlePartyAttr:: ; 395d OTPartyAttr:: ; 396d -; Get attribute a from the active wEnemyMon's party struct. +; Get attribute a from the party struct of the active enemy mon. push bc ld c, a ld b, 0 @@ -136,100 +136,7 @@ UpdateBattleHuds:: ; 39d4 ; 39e1 -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, .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 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 +INCLUDE "home/battle_vars.asm" FarCopyRadioText:: ; 3a90 @@ -293,8 +200,6 @@ BattleTextBox:: ; 3ac3 StdBattleTextBox:: ; 3ad5 ; Open a textbox and print battle text at 20:hl. -GLOBAL BattleText - ld a, [hROMBank] push af @@ -310,9 +215,6 @@ GLOBAL BattleText GetBattleAnimPointer:: ; 3ae1 -GLOBAL BattleAnimations -GLOBAL BattleAnimCommands - ld a, BANK(BattleAnimations) rst Bankswitch diff --git a/home/battle_vars.asm b/home/battle_vars.asm new file mode 100644 index 00000000000..44fc21d6dd3 --- /dev/null +++ b/home/battle_vars.asm @@ -0,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 diff --git a/home/tilemap.asm b/home/tilemap.asm index 00317e53bc5..4bbd1610222 100644 --- a/home/tilemap.asm +++ b/home/tilemap.asm @@ -117,7 +117,7 @@ PlaceVerticalMenuItems:: ; 1c89 inc hl ld d, [hl] call GetMenuTextStartCoord - call Coord2Tile ; hl now contains the wTileMap 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 diff --git a/wram.asm b/wram.asm index ea50bf9432d..42088db6f55 100644 --- a/wram.asm +++ b/wram.asm @@ -2943,7 +2943,7 @@ w3_dffc:: ds 4 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 From 3c7ba37de72795e46c76f791b50b4a3d89ba0c2c Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Tue, 30 Jan 2018 14:47:14 -0500 Subject: [PATCH 5/8] Fix wVirtualOAM labels, part 1. --- engine/battle_anims/functions.asm | 6 +++--- engine/routines/loadpushoam.asm | 4 ++-- home/init.asm | 4 ++-- home/vblank.asm | 8 ++++---- hram.asm | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/engine/battle_anims/functions.asm b/engine/battle_anims/functions.asm index 115147d39d0..e747feeefbc 100755 --- a/engine/battle_anims/functions.asm +++ b/engine/battle_anims/functions.asm @@ -1611,7 +1611,7 @@ Functioncd913: ; cd913 (33:5913) 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 @@ asm_cdbfa: ; cdbfa (33:5bfa) 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 @@ Functionce306: ; ce306 (33:6306) 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 diff --git a/engine/routines/loadpushoam.asm b/engine/routines/loadpushoam.asm index 6351523588a..95f67ff731a 100644 --- 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 diff --git a/home/init.asm b/home/init.asm index 88ab0b58bf8..ec541ad167b 100644 --- a/home/init.asm +++ b/home/init.asm @@ -103,10 +103,10 @@ Init:: ; 17d call ClearsScratch - ld a, BANK(LoadPushOAM) + ld a, BANK(WriteOAMDMACodeToHRAM) rst Bankswitch - call LoadPushOAM + call WriteOAMDMACodeToHRAM xor a ld [hMapAnims], a diff --git a/home/vblank.asm b/home/vblank.asm index d7a58cc1adb..3b33b1ec56e 100644 --- a/home/vblank.asm +++ b/home/vblank.asm @@ -113,7 +113,7 @@ VBlank0:: ; 2b1 ld a, [hOAMUpdate] and a jr nz, .done_oam - call hPushOAM + call hTransferVirtualOAM .done_oam @@ -192,7 +192,7 @@ VBlank1:: ; 337 call UpdateBGMap call Serve2bppRequest_VBlank - call hPushOAM + call hTransferVirtualOAM .done xor a @@ -282,7 +282,7 @@ VBlank3:: ; 396 call UpdateBGMap call Serve2bppRequest_VBlank - call hPushOAM + call hTransferVirtualOAM .done xor a @@ -338,7 +338,7 @@ VBlank4:: ; 3df call UpdateBGMap call Serve2bppRequest - call hPushOAM + call hTransferVirtualOAM call Joypad diff --git a/hram.asm b/hram.asm index 7810e5a01ea..d86fb395726 100644 --- 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 From 0b45e2e846c8b2feb7d2c4c4ebb854db07cf06fd Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Tue, 30 Jan 2018 14:52:46 -0500 Subject: [PATCH 6/8] Fix wVirtualOAM labels, part 2. --- engine/battle/core.asm | 2 +- engine/battle/sliding_intro.asm | 2 +- engine/battle/trainer_huds.asm | 8 +-- engine/battle_anims/anim_commands.asm | 2 +- engine/billspc.asm | 4 +- engine/card_flip.asm | 2 +- engine/events/celebi.asm | 6 +- engine/events/field_moves.asm | 10 ++-- engine/events/heal_machine_anim.asm | 4 +- engine/evolution_animation.asm | 2 +- engine/intro_menu.asm | 2 +- engine/mystery_gift.asm | 6 +- engine/pokedex/pokedex.asm | 2 +- engine/pokedex/pokedex_2.asm | 2 +- engine/pokegear.asm | 8 +-- engine/routines/switchpartymons.asm | 2 +- engine/slot_machine.asm | 8 +-- engine/sprites.asm | 6 +- engine/title.asm | 4 +- engine/trainer_card.asm | 2 +- engine/unown_puzzle.asm | 2 +- engine/unused_title.asm | 2 +- home.asm | 2 +- home/audio.asm | 20 +++---- mobile/mobile_22.asm | 6 +- mobile/mobile_45_sprite_engine.asm | 10 ++-- mobile/mobile_46.asm | 4 +- replace.sh | 1 + wram.asm | 80 +++++++++++++-------------- 29 files changed, 106 insertions(+), 105 deletions(-) create mode 100644 replace.sh diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 3742f00c986..0fe77df40d5 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -9327,7 +9327,7 @@ CopyBackpic: ; 3fc30 ; 3fc5b .LoadTrainerBackpicAsOAM: ; 3fc5b - ld hl, wSprite01 + ld hl, wVirtualOAMSprite00 xor a ld [hMapObjectIndexBuffer], a ld b, 6 diff --git a/engine/battle/sliding_intro.asm b/engine/battle/sliding_intro.asm index 781d30f3851..667f1819163 100755 --- a/engine/battle/sliding_intro.asm +++ b/engine/battle/sliding_intro.asm @@ -60,7 +60,7 @@ BattleIntroSlidingPics: ; 4e980 ; 4e9d6 .subfunction3 ; 4e9d6 - ld hl, wSprite01XCoord + ld hl, wVirtualOAMSprite00XCoord ld c, $12 ; 18 ld de, SPRITEOAMSTRUCT_LENGTH .loop3 diff --git a/engine/battle/trainer_huds.asm b/engine/battle/trainer_huds.asm index f35d2fcddac..0a18098ed4d 100755 --- a/engine/battle/trainer_huds.asm +++ b/engine/battle/trainer_huds.asm @@ -28,7 +28,7 @@ ShowPlayerMonsRemaining: ; 2c01c ld [hl], a ld a, 8 ld [wPlaceBallsDirection], a - ld hl, wSprite01 + ld hl, wVirtualOAMSprite00 jp LoadTrainerHudOAM ; 2c03a @@ -44,7 +44,7 @@ ShowOTTrainerMonsRemaining: ; 2c03a ld [hl], 4 * 8 ld a, -8 ld [wPlaceBallsDirection], a - ld hl, wSprite01 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH + ld hl, wVirtualOAMSprite00 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH jp LoadTrainerHudOAM ; 2c059 @@ -193,7 +193,7 @@ LinkBattle_TrainerHuds: ; 2c10d ld [hl], 8 * 8 ld a, $8 ld [wPlaceBallsDirection], a - ld hl, wSprite01 + ld hl, wVirtualOAMSprite00 call LoadTrainerHudOAM ld hl, wOTPartyMon1HP @@ -203,7 +203,7 @@ LinkBattle_TrainerHuds: ; 2c10d ld a, 10 * 8 ld [hli], a ld [hl], 13 * 8 - ld hl, wSprite01 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH + ld hl, wVirtualOAMSprite00 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH jp LoadTrainerHudOAM ; 2c143 diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index e0573d3d50d..a063a213a31 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -257,7 +257,7 @@ BattleAnim_ClearCGB_OAMFlags: ; cc23d bit 3, a jr z, .delete - ld hl, wSprite01Attributes + ld hl, wVirtualOAMSprite00Attributes ld c, NUM_SPRITE_OAM_STRUCTS .loop ld a, [hl] diff --git a/engine/billspc.asm b/engine/billspc.asm index 53451e9c0bb..57c4faac4c5 100755 --- a/engine/billspc.asm +++ b/engine/billspc.asm @@ -1498,7 +1498,7 @@ BillsPC_UpdateSelectionCursor: ; e2e01 (38:6e01) .place_cursor ld hl, .OAM - ld de, wSprite01 + ld de, wVirtualOAMSprite00 .loop ld a, [hl] cp -1 @@ -1548,7 +1548,7 @@ endr BillsPC_UpdateInsertCursor: ; e2e8c ld hl, .OAM - ld de, wSprite01 + ld de, wVirtualOAMSprite00 .loop ld a, [hl] cp -1 diff --git a/engine/card_flip.asm b/engine/card_flip.asm index 0e85ef21b7e..fbeb3e3b6d8 100755 --- a/engine/card_flip.asm +++ b/engine/card_flip.asm @@ -601,7 +601,7 @@ CardFlip_CopyToBox: ; e04f7 (38:44f7) ; e0509 (38:4509) CardFlip_CopyOAM: ; e0509 - ld de, wSprite01 + ld de, wVirtualOAMSprite00 ld a, [hli] .loop push af diff --git a/engine/events/celebi.asm b/engine/events/celebi.asm index 082a2318dbe..2c3950f0be6 100755 --- a/engine/events/celebi.asm +++ b/engine/events/celebi.asm @@ -52,7 +52,7 @@ Special_CelebiShrineEvent: ; 4989a ; 498f9 .RestorePlayerSprite_DespawnLeaves: ; 498f9 - ld hl, wSprite01TileID + ld hl, wVirtualOAMSprite00TileID xor a ld c, 4 .OAMloop: @@ -63,8 +63,8 @@ endr inc a dec c jr nz, .OAMloop - ld hl, wSprite05 - ld bc, wSpritesEnd - wSprite05 + ld hl, wVirtualOAMSprite04 + ld bc, wSpritesEnd - wVirtualOAMSprite04 xor a call ByteFill ret diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm index 5fc06960270..7ff726af243 100755 --- a/engine/events/field_moves.asm +++ b/engine/events/field_moves.asm @@ -62,8 +62,8 @@ ShakeHeadbuttTree: ; 8c80a xor a ld [hBGMapMode], a farcall ClearSpriteAnims - ld hl, wSprite37 - ld bc, wSpritesEnd - wSprite37 + ld hl, wVirtualOAMSprite36 + ld bc, wSpritesEnd - wVirtualOAMSprite36 xor a call ByteFill ld de, Font @@ -393,7 +393,7 @@ FlyToAnim: ; 8cb33 ret .RestorePlayerSprite_DespawnLeaves: ; 8cb82 (23:4b82) - ld hl, wSprite01TileID + ld hl, wVirtualOAMSprite00TileID xor a ld c, 4 .OAMloop @@ -404,8 +404,8 @@ endr inc a dec c jr nz, .OAMloop - ld hl, wSprite05 - ld bc, wSpritesEnd - wSprite05 + ld hl, wVirtualOAMSprite04 + ld bc, wSpritesEnd - wVirtualOAMSprite04 xor a call ByteFill ret diff --git a/engine/events/heal_machine_anim.asm b/engine/events/heal_machine_anim.asm index 5e60425f6fb..400645b4725 100755 --- a/engine/events/heal_machine_anim.asm +++ b/engine/events/heal_machine_anim.asm @@ -97,14 +97,14 @@ ENDM ; 12393 .PC_LoadBallsOntoMachine: ; 12393 - ld hl, wSprite33 + ld hl, wVirtualOAMSprite32 ld de, .PC_ElmsLab_OAM call .PlaceHealingMachineTile call .PlaceHealingMachineTile jr .LoadBallsOntoMachine .HOF_LoadBallsOntoMachine: ; 123a1 - ld hl, wSprite33 + ld hl, wVirtualOAMSprite32 ld de, .HOF_OAM .LoadBallsOntoMachine: ; 123a7 diff --git a/engine/evolution_animation.asm b/engine/evolution_animation.asm index 5b9623a296b..e78423ef149 100755 --- a/engine/evolution_animation.asm +++ b/engine/evolution_animation.asm @@ -346,7 +346,7 @@ EvolutionAnimation: ; 4e5e1 inc a and $7 ld b, a - ld hl, wSprite01Attributes + ld hl, wVirtualOAMSprite00Attributes ld c, NUM_SPRITE_OAM_STRUCTS .loop6 ld a, [hl] diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index 00c09aa304c..74daec6d8fa 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -969,7 +969,7 @@ Intro_PlacePlayerSprite: ; 61cd ld hl, vTiles0 call Request2bpp - ld hl, wSprite01 + ld hl, wVirtualOAMSprite00 ld de, .sprites ld a, [de] inc de diff --git a/engine/mystery_gift.asm b/engine/mystery_gift.asm index 56b09000a52..dc1daa1a3c7 100755 --- a/engine/mystery_gift.asm +++ b/engine/mystery_gift.asm @@ -1458,7 +1458,7 @@ Function105688: ; 105688 (41:5688) Function1056eb: ; 1056eb (41:56eb) ld c, 16 .loop - ld hl, wSprite01YCoord + ld hl, wVirtualOAMSprite00YCoord ld b, 8 .dec_y_loop dec [hl] @@ -1467,7 +1467,7 @@ rept SPRITEOAMSTRUCT_LENGTH endr dec b jr nz, .dec_y_loop - ld hl, wSprite09YCoord + ld hl, wVirtualOAMSprite08YCoord ld b, 8 .inc_y_loop inc [hl] @@ -1656,7 +1656,7 @@ Function1057d7: ; 1057d7 (41:57d7) ld [hl], $3c hlcoord 17, 15 ld [hl], $3e - ld de, wSprite01 + ld de, wVirtualOAMSprite00 ld hl, .OAM_data ld bc, 16 * SPRITEOAMSTRUCT_LENGTH call CopyBytes diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm index 70c5c460110..04b4a647226 100644 --- a/engine/pokedex/pokedex.asm +++ b/engine/pokedex/pokedex.asm @@ -2117,7 +2117,7 @@ Pokedex_UpdateSearchResultsCursorOAM: ; 41281 (10:5281) db -1 Pokedex_LoadCursorOAM: ; 412f1 (10:52f1) - ld de, wSprite01 + ld de, wVirtualOAMSprite00 .loop ld a, [hl] cp -1 diff --git a/engine/pokedex/pokedex_2.asm b/engine/pokedex/pokedex_2.asm index 6f4e27405e7..a467fe02c43 100644 --- a/engine/pokedex/pokedex_2.asm +++ b/engine/pokedex/pokedex_2.asm @@ -41,7 +41,7 @@ AnimateDexSearchSlowpoke: ; 441cf DoDexSearchSlowpokeFrame: ; 44207 ld a, [wDexSearchSlowpokeFrame] ld hl, .SlowpokeSpriteData - ld de, wSprite01 + ld de, wVirtualOAMSprite00 .loop ld a, [hli] cp -1 diff --git a/engine/pokegear.asm b/engine/pokegear.asm index affe9d6bd65..1b816725bc8 100755 --- a/engine/pokegear.asm +++ b/engine/pokegear.asm @@ -2627,7 +2627,7 @@ Pokedex_GetArea: ; 91d11 ld e, a farcall FindNest ; load nest landmarks into wTileMap[0,0] decoord 0, 0 - ld hl, wSprite01 + ld hl, wVirtualOAMSprite00 .nestloop ld a, [de] and a @@ -2671,7 +2671,7 @@ Pokedex_GetArea: ; 91d11 ld c, e ld b, d ld de, .PlayerOAM - ld hl, wSprite01 + ld hl, wVirtualOAMSprite00 .ShowPlayerLoop: ld a, [de] cp $80 @@ -2700,8 +2700,8 @@ Pokedex_GetArea: ; 91d11 jr .ShowPlayerLoop .clear_oam - ld hl, wSprite05 - ld bc, wSpritesEnd - wSprite05 + ld hl, wVirtualOAMSprite04 + ld bc, wSpritesEnd - wVirtualOAMSprite04 xor a call ByteFill ret diff --git a/engine/routines/switchpartymons.asm b/engine/routines/switchpartymons.asm index f1de8e27699..b011784173a 100644 --- a/engine/routines/switchpartymons.asm +++ b/engine/routines/switchpartymons.asm @@ -25,7 +25,7 @@ _SwitchPartyMons: ld a, " " call ByteFill pop af - ld hl, wSprite01 + ld hl, wVirtualOAMSprite00 ld bc, 4 * SPRITEOAMSTRUCT_LENGTH call AddNTimes ld de, SPRITEOAMSTRUCT_LENGTH diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm index db08380947e..fe9ea52d992 100755 --- a/engine/slot_machine.asm +++ b/engine/slot_machine.asm @@ -261,7 +261,7 @@ Unreferenced_Function9282c: ; 9282c inc [hl] and $7 ret nz - ld hl, wSprite17TileID + ld hl, wVirtualOAMSprite16TileID ld c, NUM_SPRITE_OAM_STRUCTS - 16 .loop ld a, [hl] @@ -671,7 +671,7 @@ Slots_InitReelTiles: ; 92a98 (24:6a98) ld bc, wReel1 ld hl, REEL_OAM_ADDR add hl, bc - ld de, wSprite17 + ld de, wVirtualOAMSprite16 ld [hl], e inc hl ld [hl], d @@ -689,7 +689,7 @@ Slots_InitReelTiles: ; 92a98 (24:6a98) ld bc, wReel2 ld hl, REEL_OAM_ADDR add hl, bc - ld de, wSprite25 + ld de, wVirtualOAMSprite24 ld [hl], e inc hl ld [hl], d @@ -707,7 +707,7 @@ Slots_InitReelTiles: ; 92a98 (24:6a98) ld bc, wReel3 ld hl, REEL_OAM_ADDR add hl, bc - ld de, wSprite33 + ld de, wVirtualOAMSprite32 ld [hl], e inc hl ld [hl], d diff --git a/engine/sprites.asm b/engine/sprites.asm index d97dab37417..3451687fcc2 100755 --- a/engine/sprites.asm +++ b/engine/sprites.asm @@ -100,11 +100,11 @@ DoNextFrameForFirst16Sprites: ; 8cfa8 (23:4fa8) ld a, [wCurrSpriteOAMAddr] ld l, a - ld h, HIGH(wSprite17) + ld h, HIGH(wVirtualOAMSprite16) .loop2 ; Clear (wVirtualOAM + [wCurrSpriteOAMAddr] --> Sprites + $40) ld a, l - cp LOW(wSprite17) + cp LOW(wVirtualOAMSprite16) jr nc, .done xor a ld [hli], a @@ -649,7 +649,7 @@ AnimateEndOfExpBar: ; 8e79d ; 8e7c6 .AnimateFrame: ; 8e7c6 - ld hl, wSprite01 + ld hl, wVirtualOAMSprite00 ld c, 8 ; number of animated circles .anim_loop ld a, c diff --git a/engine/title.asm b/engine/title.asm index 91bb21064c8..310e4d16481 100644 --- a/engine/title.asm +++ b/engine/title.asm @@ -323,7 +323,7 @@ DrawTitleGraphic: ; 10eeef ; 10ef06 InitializeBackground: ; 10ef06 - ld hl, wSprite01 + ld hl, wVirtualOAMSprite00 ld d, -$22 ld e, $0 ld c, 5 @@ -366,7 +366,7 @@ AnimateTitleCrystal: ; 10ef32 ; Stop at y=6 ; y is really from the bottom of the sprite, which is two tiles high - ld hl, wSprite01YCoord + ld hl, wVirtualOAMSprite00YCoord ld a, [hl] cp 6 + 2 * TILE_WIDTH ret z diff --git a/engine/trainer_card.asm b/engine/trainer_card.asm index e9d9147f500..cd6705e5ce2 100755 --- a/engine/trainer_card.asm +++ b/engine/trainer_card.asm @@ -479,7 +479,7 @@ TrainerCard_Page2_3_OAMUpdate: ; 25448 (9:5448) ld d, a ld a, [de] ld c, a - ld de, wSprite01 + ld de, wVirtualOAMSprite00 ld b, NUM_JOHTO_BADGES .loop srl c diff --git a/engine/unown_puzzle.asm b/engine/unown_puzzle.asm index 53d0b4d0c47..dcad1ce2079 100755 --- a/engine/unown_puzzle.asm +++ b/engine/unown_puzzle.asm @@ -549,7 +549,7 @@ RedrawUnownPuzzlePieces: ; e14d9 ld hl, .OAM_NotHoldingPiece .load - ld de, wSprite01 + ld de, wVirtualOAMSprite00 .loop ld a, [hli] cp -1 diff --git a/engine/unused_title.asm b/engine/unused_title.asm index cb6ab808a69..8e52a71bb16 100644 --- a/engine/unused_title.asm +++ b/engine/unused_title.asm @@ -49,7 +49,7 @@ UnusedTitleScreen: ; 10c000 jr nz, .copy ld hl, UnusedTitleFG_OAM - ld de, wSprite01 + ld de, wVirtualOAMSprite00 ld bc, SPRITEOAMSTRUCT_LENGTH * NUM_SPRITE_OAM_STRUCTS call CopyBytes diff --git a/home.asm b/home.asm index a45c135b7d1..b5d066639e6 100644 --- a/home.asm +++ b/home.asm @@ -181,7 +181,7 @@ ClearSprites:: ; 300b HideSprites:: ; 3016 ; Set all OAM y-positions to 160 to hide them offscreen - ld hl, wSprite01YCoord + ld hl, wVirtualOAMSprite00YCoord ld de, SPRITEOAMSTRUCT_LENGTH ld b, NUM_SPRITE_OAM_STRUCTS ld a, SCREEN_WIDTH_PX diff --git a/home/audio.asm b/home/audio.asm index 8809c52d2d3..2d6f27cdab6 100644 --- a/home/audio.asm +++ b/home/audio.asm @@ -506,15 +506,15 @@ Unreferenced_Function3d9f:: ; 3d9f ; Places a BCD number at the ; upper center of the screen. ld a, 4 * TILE_WIDTH - ld [wSprite39YCoord], a - ld [wSprite40YCoord], a + ld [wVirtualOAMSprite38YCoord], a + ld [wVirtualOAMSprite39YCoord], a ld a, 10 * TILE_WIDTH - ld [wSprite39XCoord], a + ld [wVirtualOAMSprite38XCoord], a ld a, 11 * TILE_WIDTH - ld [wSprite40XCoord], a + ld [wVirtualOAMSprite39XCoord], a xor a - ld [wSprite39Attributes], a - ld [wSprite40Attributes], a + ld [wVirtualOAMSprite38Attributes], a + ld [wVirtualOAMSprite39Attributes], a ld a, [wc296] cp 100 jr nc, .max @@ -524,17 +524,17 @@ Unreferenced_Function3d9f:: ; 3d9f swap a and $f add "0" - ld [wSprite39TileID], a + ld [wVirtualOAMSprite38TileID], a ld a, b and $f add "0" - ld [wSprite40TileID], a + ld [wVirtualOAMSprite39TileID], a ret .max ld a, "9" - ld [wSprite39TileID], a - ld [wSprite40TileID], a + ld [wVirtualOAMSprite38TileID], a + ld [wVirtualOAMSprite39TileID], a ret ; 3dde diff --git a/mobile/mobile_22.asm b/mobile/mobile_22.asm index 08113bf66cd..8af7cc896a6 100644 --- a/mobile/mobile_22.asm +++ b/mobile/mobile_22.asm @@ -1923,7 +1923,7 @@ Function89b97: ; 89b97 (22:5b97) ld a, [hli] ld h, [hl] ld l, a - ld de, wSprite01 + ld de, wVirtualOAMSprite00 .asm_89bb4 ld a, [hli] cp $ff @@ -2013,7 +2013,7 @@ Function89c44: ; 89c44 (22:5c44) pop de ret .asm_89c4f - ld hl, wSprite01 + ld hl, wVirtualOAMSprite00 push de ld a, b ld [hli], a ; y @@ -2123,7 +2123,7 @@ Function89cdf: ; 89cdf (22:5cdf) ld c, a ld e, $2 ld a, $2 - ld hl, wSprite01 + ld hl, wVirtualOAMSprite00 .asm_89cee push af push bc diff --git a/mobile/mobile_45_sprite_engine.asm b/mobile/mobile_45_sprite_engine.asm index e9156b598d9..438f4210731 100755 --- a/mobile/mobile_45_sprite_engine.asm +++ b/mobile/mobile_45_sprite_engine.asm @@ -22,7 +22,7 @@ Function115dc3: ; 115dc3 xor a ld [wc305], a ld a, $a0 - ld hl, wSprite32 + ld hl, wVirtualOAMSprite31 ld bc, 8 * SPRITEOAMSTRUCT_LENGTH call ByteFill ret @@ -34,7 +34,7 @@ Function115dd3: ; 115dd3 and a ret z ld a, $a0 - ld hl, wSprite32 + ld hl, wVirtualOAMSprite31 ld bc, 8 * SPRITEOAMSTRUCT_LENGTH call ByteFill call Function115e22 @@ -50,7 +50,7 @@ Function115dd3: ; 115dd3 ld d, a push de pop hl - ld de, wSprite32 + ld de, wVirtualOAMSprite31 ld a, [wc307] ld c, a ld a, [wc308] @@ -585,7 +585,7 @@ Function1162f2: ; 1162f2 ld e, a ld a, [hli] sub e - ld de, wSprite10 + ld de, wVirtualOAMSprite09 .asm_116321 push af ld a, [hli] @@ -626,7 +626,7 @@ Function1162f2: ; 1162f2 ld e, a ld a, [hli] sub e - ld de, wSprite01 + ld de, wVirtualOAMSprite00 .asm_11635a push af ld a, [hli] diff --git a/mobile/mobile_46.asm b/mobile/mobile_46.asm index 76b2bb01f58..0298c075bc7 100755 --- a/mobile/mobile_46.asm +++ b/mobile/mobile_46.asm @@ -6921,7 +6921,7 @@ Function11b31b: ; 11b31b db $39 ; 13 Function11b397: ; 11b397 - ld de, wSprite01 + ld de, wVirtualOAMSprite00 .loop ld a, [hl] cp $ff @@ -6979,7 +6979,7 @@ Unreferenced_Function11b3b6: ; 11b3b6 ; 11b3d9 Function11b3d9: ; 11b3d9 - ld de, wSprite29 + ld de, wVirtualOAMSprite28 push de ld a, [wc7d2] dec a diff --git a/replace.sh b/replace.sh new file mode 100644 index 00000000000..2982101cd0d --- /dev/null +++ b/replace.sh @@ -0,0 +1 @@ +sed -i 's/\<'$1'\>/'$2'/' $(grep -lwr --include="*.asm" --exclude-dir=".git" --exclude-dir="tools" --exclude-dir="extras" --exclude-dir="crowdmap" $1) \ No newline at end of file diff --git a/wram.asm b/wram.asm index 42088db6f55..93c0a8cc24e 100644 --- a/wram.asm +++ b/wram.asm @@ -303,46 +303,46 @@ wc3fc:: ds 1 SECTION "Sprites", WRAM0 wVirtualOAM:: ; c400 -wSprite01:: sprite_oam_struct wSprite01 -wSprite02:: sprite_oam_struct wSprite02 -wSprite03:: sprite_oam_struct wSprite03 -wSprite04:: sprite_oam_struct wSprite04 -wSprite05:: sprite_oam_struct wSprite05 -wSprite06:: sprite_oam_struct wSprite06 -wSprite07:: sprite_oam_struct wSprite07 -wSprite08:: sprite_oam_struct wSprite08 -wSprite09:: sprite_oam_struct wSprite09 -wSprite10:: sprite_oam_struct wSprite10 -wSprite11:: sprite_oam_struct wSprite11 -wSprite12:: sprite_oam_struct wSprite12 -wSprite13:: sprite_oam_struct wSprite13 -wSprite14:: sprite_oam_struct wSprite14 -wSprite15:: sprite_oam_struct wSprite15 -wSprite16:: sprite_oam_struct wSprite16 -wSprite17:: sprite_oam_struct wSprite17 -wSprite18:: sprite_oam_struct wSprite18 -wSprite19:: sprite_oam_struct wSprite19 -wSprite20:: sprite_oam_struct wSprite20 -wSprite21:: sprite_oam_struct wSprite21 -wSprite22:: sprite_oam_struct wSprite22 -wSprite23:: sprite_oam_struct wSprite23 -wSprite24:: sprite_oam_struct wSprite24 -wSprite25:: sprite_oam_struct wSprite25 -wSprite26:: sprite_oam_struct wSprite26 -wSprite27:: sprite_oam_struct wSprite27 -wSprite28:: sprite_oam_struct wSprite28 -wSprite29:: sprite_oam_struct wSprite29 -wSprite30:: sprite_oam_struct wSprite30 -wSprite31:: sprite_oam_struct wSprite31 -wSprite32:: sprite_oam_struct wSprite32 -wSprite33:: sprite_oam_struct wSprite33 -wSprite34:: sprite_oam_struct wSprite34 -wSprite35:: sprite_oam_struct wSprite35 -wSprite36:: sprite_oam_struct wSprite36 -wSprite37:: sprite_oam_struct wSprite37 -wSprite38:: sprite_oam_struct wSprite38 -wSprite39:: sprite_oam_struct wSprite39 -wSprite40:: sprite_oam_struct wSprite40 +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 wSpritesEnd:: From 4a3384ab09c735f1a8cac54dddf0e5741f1875a7 Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Tue, 30 Jan 2018 14:55:20 -0500 Subject: [PATCH 7/8] wSpritesEnd -> wVirtualOAMEnd. --- engine/battle_anims/anim_commands.asm | 4 ++-- engine/events/celebi.asm | 2 +- engine/events/field_moves.asm | 4 ++-- engine/map_objects.asm | 4 ++-- engine/pokegear.asm | 8 ++++---- engine/sprites.asm | 6 +++--- home.asm | 2 +- wram.asm | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index a063a213a31..ca492823330 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -272,7 +272,7 @@ endr .delete ld hl, wVirtualOAM - ld c, wSpritesEnd - wVirtualOAM + ld c, wVirtualOAMEnd - wVirtualOAM xor a .loop2 ld [hli], a @@ -1502,7 +1502,7 @@ BattleAnim_UpdateOAM_All: ; cc96e ld h, HIGH(wVirtualOAM) .loop2 ld a, l - cp LOW(wSpritesEnd) + cp LOW(wVirtualOAMEnd) jr nc, .done xor a ld [hli], a diff --git a/engine/events/celebi.asm b/engine/events/celebi.asm index 2c3950f0be6..fe4a490f21a 100755 --- a/engine/events/celebi.asm +++ b/engine/events/celebi.asm @@ -64,7 +64,7 @@ endr dec c jr nz, .OAMloop ld hl, wVirtualOAMSprite04 - ld bc, wSpritesEnd - wVirtualOAMSprite04 + ld bc, wVirtualOAMEnd - wVirtualOAMSprite04 xor a call ByteFill ret diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm index 7ff726af243..0f12338e0f2 100755 --- a/engine/events/field_moves.asm +++ b/engine/events/field_moves.asm @@ -63,7 +63,7 @@ ShakeHeadbuttTree: ; 8c80a ld [hBGMapMode], a farcall ClearSpriteAnims ld hl, wVirtualOAMSprite36 - ld bc, wSpritesEnd - wVirtualOAMSprite36 + ld bc, wVirtualOAMEnd - wVirtualOAMSprite36 xor a call ByteFill ld de, Font @@ -405,7 +405,7 @@ endr dec c jr nz, .OAMloop ld hl, wVirtualOAMSprite04 - ld bc, wSpritesEnd - wVirtualOAMSprite04 + ld bc, wVirtualOAMEnd - wVirtualOAMSprite04 xor a call ByteFill ret diff --git a/engine/map_objects.asm b/engine/map_objects.asm index 85e5ccb23d2..b3efc5fb7fd 100644 --- a/engine/map_objects.asm +++ b/engine/map_objects.asm @@ -2821,7 +2821,7 @@ _UpdateSprites:: ; 5920 .fill ld a, [wVramState] bit 1, a - ld b, LOW(wSpritesEnd) + ld b, LOW(wVirtualOAMEnd) jr z, .ok ld b, 28 * SPRITEOAMSTRUCT_LENGTH .ok @@ -3047,7 +3047,7 @@ InitSprites: ; 5991 ld a, [hli] ld [hUsedSpriteTile], a add c - cp LOW(wSpritesEnd) + cp LOW(wVirtualOAMEnd) jr nc, .full .addsprite ld a, [hFFC0] diff --git a/engine/pokegear.asm b/engine/pokegear.asm index 1b816725bc8..ea2afdc7893 100755 --- a/engine/pokegear.asm +++ b/engine/pokegear.asm @@ -2589,7 +2589,7 @@ Pokedex_GetArea: ; 91d11 .copy_sprites hlcoord 0, 0 ld de, wVirtualOAM - ld bc, wSpritesEnd - wVirtualOAM + ld bc, wVirtualOAMEnd - wVirtualOAM call CopyBytes ret @@ -2656,7 +2656,7 @@ Pokedex_GetArea: ; 91d11 .done_nest ld hl, wVirtualOAM decoord 0, 0 - ld bc, wSpritesEnd - wVirtualOAM + ld bc, wVirtualOAMEnd - wVirtualOAM call CopyBytes ret @@ -2701,7 +2701,7 @@ Pokedex_GetArea: ; 91d11 .clear_oam ld hl, wVirtualOAMSprite04 - ld bc, wSpritesEnd - wVirtualOAMSprite04 + ld bc, wVirtualOAMEnd - wVirtualOAMSprite04 xor a call ByteFill ret @@ -2742,7 +2742,7 @@ Pokedex_GetArea: ; 91d11 .clear ld hl, wVirtualOAM - ld bc, wSpritesEnd - wVirtualOAM + ld bc, wVirtualOAMEnd - wVirtualOAM xor a call ByteFill scf diff --git a/engine/sprites.asm b/engine/sprites.asm index 3451687fcc2..277b7512409 100755 --- a/engine/sprites.asm +++ b/engine/sprites.asm @@ -62,9 +62,9 @@ DoNextFrameForAllSprites: ; 8cf7a ld l, a ld h, HIGH(wVirtualOAM) -.loop2 ; Clear (wVirtualOAM + [wCurrSpriteOAMAddr] --> wSpritesEnd) +.loop2 ; Clear (wVirtualOAM + [wCurrSpriteOAMAddr] --> wVirtualOAMEnd) ld a, l - cp LOW(wSpritesEnd) + cp LOW(wVirtualOAMEnd) jr nc, .done xor a ld [hli], a @@ -302,7 +302,7 @@ UpdateAnimFrame: ; 8d04c inc de ld a, e ld [wCurrSpriteOAMAddr], a - cp LOW(wSpritesEnd) + cp LOW(wVirtualOAMEnd) jr nc, .reached_the_end dec c jr nz, .loop diff --git a/home.asm b/home.asm index b5d066639e6..2f628a735ee 100644 --- a/home.asm +++ b/home.asm @@ -170,7 +170,7 @@ INCLUDE "home/double_speed.asm" ClearSprites:: ; 300b ; Erase OAM data ld hl, wVirtualOAM - ld b, wSpritesEnd - wVirtualOAM + ld b, wVirtualOAMEnd - wVirtualOAM xor a .loop ld [hli], a diff --git a/wram.asm b/wram.asm index 93c0a8cc24e..1a14a0171ba 100644 --- a/wram.asm +++ b/wram.asm @@ -343,7 +343,7 @@ wVirtualOAMSprite36:: sprite_oam_struct wVirtualOAMSprite36 wVirtualOAMSprite37:: sprite_oam_struct wVirtualOAMSprite37 wVirtualOAMSprite38:: sprite_oam_struct wVirtualOAMSprite38 wVirtualOAMSprite39:: sprite_oam_struct wVirtualOAMSprite39 -wSpritesEnd:: +wVirtualOAMEnd:: SECTION "Tilemap", WRAM0 From 32ade4ac9bf113d630d904aab51f2c49c91bf8c2 Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Tue, 30 Jan 2018 14:59:01 -0500 Subject: [PATCH 8/8] Delete replace.sh. --- replace.sh | 1 - 1 file changed, 1 deletion(-) delete mode 100644 replace.sh diff --git a/replace.sh b/replace.sh deleted file mode 100644 index 2982101cd0d..00000000000 --- a/replace.sh +++ /dev/null @@ -1 +0,0 @@ -sed -i 's/\<'$1'\>/'$2'/' $(grep -lwr --include="*.asm" --exclude-dir=".git" --exclude-dir="tools" --exclude-dir="extras" --exclude-dir="crowdmap" $1) \ No newline at end of file