ref: f2ae74079fc917cbf7e1f640eb8beda0d4740887
parent: c60f1331fef22b886adf3472d2b4f348832cfaf7
author: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>
date: Tue Jan 23 11:45:34 EST 2018
Prefix wram labels with w, part 1. Handle edge cases first.
--- a/audio/engine.asm
+++ b/audio/engine.asm
@@ -48,7 +48,7 @@
or d
jr nz, .clearchannels
ld a, MAX_VOLUME
- ld [Volume], a
+ ld [wVolume], a
call MusicOn
pop af
pop bc
@@ -97,15 +97,15 @@
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 @@
.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 @@
.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 @@
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,13 +176,13 @@
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]
@@ -189,13 +189,13 @@
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 @@
; 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 @@
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 @@
.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 @@
.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 @@
.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 @@
; 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 @@
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 @@
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 @@
.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 @@
; 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,7 +710,7 @@
ld d, a
swap a
or d
- ld [Volume], a
+ ld [wVolume], a
ret
; e83d1
@@ -717,12 +717,12 @@
LoadNote: ; e83d1
; wait for pitch wheel to finish
- ld hl, Channel1Flags2 - Channel1
+ ld hl, 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 @@
.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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
; 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 @@
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 @@
.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 @@
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 @@
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 @@
; 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 @@
.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 @@
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 @@
; 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 @@
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 @@
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 @@
.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,24 +1187,24 @@
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
@@ -1211,7 +1211,7 @@
.rest
; note = rest
- ld hl, Channel1NoteFlags - Channel1
+ ld hl, Channel1NoteFlags - wChannel1
add hl, bc
set NOTE_REST, [hl] ; Rest
ret
@@ -1218,7 +1218,7 @@
.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 @@
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 @@
.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 @@
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 @@
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 @@
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 @@
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 @@
; 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,12 +1490,12 @@
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
@@ -1502,13 +1502,13 @@
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 @@
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 @@
; 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 @@
; 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 @@
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 @@
.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 @@
; set condition
call GetMusicByte
- ld hl, Channel1Condition - Channel1
+ ld hl, Channel1Condition - wChannel1
add hl, bc
ld [hl], a
ret
@@ -1621,13 +1621,13 @@
; a = condition
call GetMusicByte
; if existing condition matches, jump to new address
- ld hl, Channel1Condition - Channel1
+ ld hl, 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 @@
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 @@
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 @@
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 @@
; 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,21 +1746,21 @@
; 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
@@ -1767,7 +1767,7 @@
; this is split into halves only to get added back together at the last second
; get extent/rate
call GetMusicByte
- ld hl, Channel1VibratoExtent - Channel1
+ ld hl, Channel1VibratoExtent - wChannel1
add hl, bc
ld d, a
; get top nybble
@@ -1780,7 +1780,7 @@
or e
ld [hl], a
; update rate
- ld hl, Channel1VibratoRate - Channel1
+ ld hl, Channel1VibratoRate - wChannel1
add hl, bc
; get bottom nybble
ld a, d
@@ -1813,13 +1813,13 @@
and $f
ld d, a
call GetFrequency
- ld hl, Channel1PitchWheelTarget - Channel1
+ ld hl, 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_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 @@
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,7 +1859,7 @@
Music_SoundDuty: ; e8906
; sequence of 4 duty cycles to be looped
; params: 1 (4 2-bit duty cycle arguments)
- ld hl, Channel1Flags2 - Channel1
+ ld hl, Channel1Flags2 - wChannel1
add hl, bc
set SOUND_DUTY, [hl] ; duty cycle
; sound duty sequence
@@ -1866,12 +1866,12 @@
call GetMusicByte
rrca
rrca
- ld hl, Channel1SFXDutyLoop - Channel1
+ ld hl, 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 @@
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 @@
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 @@
; 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 @@
; 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 @@
; 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 @@
; 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 @@
rrca
rrca
and $c0
- ld hl, Channel1DutyCycle - Channel1
+ ld hl, Channel1DutyCycle - wChannel1
add hl, bc
ld [hl], a
ret
@@ -2007,7 +2007,7 @@
; 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_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 @@
; 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 @@
; 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 @@
; reload param
ld a, [CurMusicByte]
; set volume
- ld [Volume], a
+ ld [wVolume], a
ret
; e89e1
@@ -2116,7 +2116,7 @@
.negative
ld d, -1
.ok
- ld hl, Channel1Tempo - Channel1
+ ld hl, Channel1Tempo - wChannel1
add hl, bc
ld a, [hli]
ld h, [hl]
@@ -2156,7 +2156,7 @@
; 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
@@ -2163,7 +2163,7 @@
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,13 +2205,13 @@
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
@@ -2218,7 +2218,7 @@
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 @@
; 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 @@
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 @@
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 @@
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 @@
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 @@
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,7 +2385,7 @@
; input:
; de: note length
; update Tempo
- ld hl, Channel1Tempo - Channel1
+ ld hl, Channel1Tempo - wChannel1
add hl, bc
ld [hl], e
inc hl
@@ -2392,7 +2392,7 @@
ld [hl], d
; clear ????
xor a
- ld hl, Channel1Field16 - Channel1
+ ld hl, Channel1Field16 - wChannel1
add hl, bc
ld [hl], a
ret
@@ -2401,7 +2401,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
.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 @@
push af
call LoadChannel
- ld hl, Channel1Flags - Channel1
+ ld hl, Channel1Flags - wChannel1
add hl, bc
set SOUND_SFX, [hl]
@@ -2745,11 +2745,11 @@
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 @@
; 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 @@
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 @@
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,7 +2822,7 @@
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
@@ -2829,7 +2829,7 @@
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,9 +2845,9 @@
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
@@ -2854,7 +2854,7 @@
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
@@ -2861,7 +2861,7 @@
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 @@
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
--- a/constants/audio_constants.asm
+++ b/constants/audio_constants.asm
@@ -66,7 +66,7 @@
const NOTE_REST ; 5
const NOTE_VIBRATO_OVERRIDE ; 6
-; Volume:
+; wVolume
VOLUME_SO1_F EQU 3
VOLUME_SO2_F EQU 7
VOLUME_SO1_LEVEL EQU %00000111
@@ -73,7 +73,7 @@
VOLUME_SO2_LEVEL EQU %01110000
MAX_VOLUME EQU $77
-; SoundInput:
+; SoundInput
SOUND_INPUT_CH1_F EQU 0
SOUND_INPUT_CH2_F EQU 1
SOUND_INPUT_CH3_F EQU 2
@@ -80,9 +80,9 @@
SOUND_INPUT_CH4_F EQU 3
SOUND_INPUT_GLOBAL_F EQU 7
-; Danger:
+; wLowHealthAlarm
DANGER_PITCH_F EQU 4
DANGER_ON_F EQU 7
-; MusicFade:
+; MusicFade
MUSIC_FADE_IN_F EQU 7
--- a/constants/battle_constants.asm
+++ b/constants/battle_constants.asm
@@ -214,7 +214,7 @@
enum SCREENS_UNUSED
enum SCREENS_SPIKES
-; Weather values
+; values in wBattleWeather
const_def
const WEATHER_NONE
const WEATHER_RAIN
--- a/constants/gfx_constants.asm
+++ b/constants/gfx_constants.asm
@@ -28,4 +28,4 @@
const SPRITEOAMSTRUCT_TILE_ID ; 2
const SPRITEOAMSTRUCT_ATTRIBUTES ; 3
SPRITEOAMSTRUCT_LENGTH EQU const_value
-NUM_SPRITE_OAM_STRUCTS EQU 40 ; see Sprites
+NUM_SPRITE_OAM_STRUCTS EQU 40 ; see wVirtualOAM
--- a/data/common_text/common_text_3.asm
+++ b/data/common_text/common_text_3.asm
@@ -1288,7 +1288,7 @@
UnknownText_0x1c5c7b::
text "Coins:"
line "@"
- deciram Coins, 2, 4
+ deciram wCoins, 2, 4
db "@@"
Text_RaiseThePPOfWhichMove::
--- a/engine/battle/ai/redundant.asm
+++ b/engine/battle/ai/redundant.asm
@@ -135,7 +135,7 @@
ret
.Sandstorm: ; 2c4f5
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_SANDSTORM
jr z, .Redundant
jr .NotRedundant
@@ -153,13 +153,13 @@
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
--- a/engine/battle/ai/scoring.asm
+++ b/engine/battle/ai/scoring.asm
@@ -2842,7 +2842,7 @@
; 80% chance to encourage this move when it's sunny.
; 90% chance to discourage this move when it's raining.
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_SUN
jr z, .asm_3921e
@@ -2870,7 +2870,7 @@
AI_Smart_Thunder: ; 39225
; 90% chance to discourage this move when it's sunny.
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_SUN
ret nz
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -4,7 +4,7 @@
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 @@
jr z, .use_move
sub BATTLEACTION_SWITCH1
jr c, .use_move
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
cp $2
jr nz, .switch
ld a, [hSerialConnectionStatus]
@@ -480,7 +480,7 @@
jp .enemy_first
.use_move
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
and a
jp nz, .player_first
call CompareMovePriority
@@ -623,7 +623,7 @@
jr .encored
.not_encored
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
cp $2
jr z, .reset_rage
and a
@@ -920,7 +920,7 @@
jp z, HandlePlayerMonFaint
call RefreshBattleHuds
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ret
; 3c664
@@ -970,7 +970,7 @@
jp z, HandleEnemyMonFaint
call RefreshBattleHuds
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ret
; 3c6cf
@@ -1716,7 +1716,7 @@
; 3cb9e
HandleWeather: ; 3cb9e
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_NONE
ret z
@@ -1727,7 +1727,7 @@
ld hl, .WeatherMessages
call .PrintWeatherMessage
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_SANDSTORM
ret nz
@@ -1790,11 +1790,11 @@
ld hl, .WeatherEndedMessages
call .PrintWeatherMessage
xor a
- ld [Weather], a
+ ld [wBattleWeather], a
ret
.PrintWeatherMessage:
- ld a, [Weather]
+ ld a, [wBattleWeather]
dec a
ld c, a
ld b, 0
@@ -2099,7 +2099,7 @@
jp c, WildFled_EnemyFled_LinkBattleCanceled
ld a, $1
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
call HandleEnemySwitch
jp z, WildFled_EnemyFled_LinkBattleCanceled
jr DoubleSwitch
@@ -2106,11 +2106,11 @@
.player_mon_not_fainted
ld a, $1
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
call HandleEnemySwitch
jp z, WildFled_EnemyFled_LinkBattleCanceled
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ret
; 3cdca
@@ -2140,7 +2140,7 @@
.done
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ret
; 3ce01
@@ -2173,7 +2173,7 @@
.wild2
call StopDangerSound
ld a, $1
- ld [wDanger], a
+ ld [wBattleLowHealthAlarm], a
.trainer
ld hl, BattleMonHP
@@ -2293,7 +2293,7 @@
StopDangerSound: ; 3ceec
xor a
- ld [Danger], a
+ ld [wLowHealthAlarm], a
ret
; 3cef1
@@ -2394,7 +2394,7 @@
call SpikesDamage
xor a
ld [wEnemyMoveStruct + MOVE_ANIM], a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
inc a
ret
; 3cfa4
@@ -2403,7 +2403,7 @@
; 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
ld a, $0
ld [wFailedToFlee], a
ret c
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
and a
ret nz
jp BattleMenu
@@ -5955,7 +5955,7 @@
jr z, .not_linked
call EmptyBattleTextBox
call LoadTileMapToTempTileMap
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
and a
call z, LinkBattleSendReceiveAction
call Call_LoadTempTileMapToTileMap
@@ -8560,7 +8560,7 @@
CleanUpBattleRAM: ; 3f6d0
call BattleEnd_HandleRoamMons
xor a
- ld [Danger], a
+ ld [wLowHealthAlarm], a
ld [wBattleMode], a
ld [BattleType], a
ld [AttackMissed], a
--- 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 @@
cp EFFECT_THUNDER
ret nz
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_RAIN
ret
@@ -5394,7 +5394,7 @@
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 @@
ret z
ld a, 1
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
call LoadStandardMenuDataHeader
ld hl, LinkBattleSendReceiveAction
@@ -9054,7 +9054,7 @@
call CloseWindow
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ret
; 37a82
@@ -9310,15 +9310,15 @@
; Don't factor in time of day in link battles.
ld a, [wLinkMode]
and a
- jr nz, .Weather
+ jr nz, .checkWeather
ld a, [TimeOfDay]
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_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_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_SkipSunCharge: ; 37d02
; mimicsuncharge
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_SUN
ret nz
ld b, charge_command
@@ -9690,7 +9690,7 @@
ld a, BATTLE_VARS_MOVE_TYPE
call GetBattleVarAddr
inc hl
- ld a, [Weather]
+ ld a, [wBattleWeather]
cp WEATHER_RAIN
jr z, .rain
cp WEATHER_SUN
--- 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
--- a/engine/battle/misc.asm
+++ b/engine/battle/misc.asm
@@ -53,7 +53,7 @@
DoWeatherModifiers: ; fbda4
ld de, .WeatherTypeModifiers
- ld a, [Weather]
+ ld a, [wBattleWeather]
ld b, a
ld a, [wd265] ; move type
ld c, a
--- a/engine/battle/start_battle.asm
+++ b/engine/battle/start_battle.asm
@@ -150,7 +150,7 @@
ClearBattleRAM: ; 2ef18
xor a
- ld [wPlayerAction], a
+ ld [wBattlePlayerAction], a
ld [wBattleResult], a
ld hl, wPartyMenuCursor
--- a/engine/battle_anims/anim_commands.asm
+++ b/engine/battle_anims/anim_commands.asm
@@ -271,8 +271,8 @@
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 @@
jr nz, .loop
ld a, [wBattleAnimOAMPointerLo]
ld l, a
- ld h, HIGH(Sprites)
+ ld h, HIGH(wVirtualOAM)
.loop2
ld a, l
cp LOW(SpritesEnd)
--- a/engine/battle_anims/core.asm
+++ b/engine/battle_anims/core.asm
@@ -106,7 +106,7 @@
ld l, a
ld a, [wBattleAnimOAMPointerLo]
ld e, a
- ld d, HIGH(Sprites)
+ ld d, HIGH(wVirtualOAM)
.loop
ld a, [wBattleAnimTempYCoord]
ld b, a
--- a/engine/card_flip.asm
+++ b/engine/card_flip.asm
@@ -126,9 +126,9 @@
; 0xe01d2
.DeductCoins: ; e01d2
- ld a, [Coins]
+ ld a, [wCoins]
ld h, a
- ld a, [Coins + 1]
+ ld a, [wCoins + 1]
ld l, a
ld a, h
and a
@@ -146,9 +146,9 @@
ld de, -3
add hl, de
ld a, h
- ld [Coins], a
+ ld [wCoins], a
ld a, l
- ld [Coins + 1], a
+ ld [wCoins + 1], a
ld de, SFX_TRANSACTION
call PlaySFX
xor a
@@ -535,7 +535,7 @@
ld de, .CoinStr
call PlaceString
hlcoord 15, 16
- ld de, Coins
+ ld de, wCoins
lb bc, PRINTNUM_LEADINGZEROS | 2, 4
call PrintNum
ret
@@ -1174,15 +1174,15 @@
; 0xe081b
.AddCoinPlaySFX: ; e081b
- ld a, [Coins]
+ ld a, [wCoins]
ld h, a
- ld a, [Coins + 1]
+ ld a, [wCoins + 1]
ld l, a
inc hl
ld a, h
- ld [Coins], a
+ ld [wCoins], a
ld a, l
- ld [Coins + 1], a
+ ld [wCoins + 1], a
ld de, SFX_PAY_DAY
call PlaySFX
ret
@@ -1189,7 +1189,7 @@
; e0833
.IsCoinCaseFull: ; e0833
- ld a, [Coins]
+ ld a, [wCoins]
cp HIGH(MAX_COINS)
jr c, .less
jr z, .check_low
@@ -1196,7 +1196,7 @@
jr .more
.check_low
- ld a, [Coins + 1]
+ ld a, [wCoins + 1]
cp LOW(MAX_COINS)
jr c, .less
--- a/engine/debug.asm
+++ b/engine/debug.asm
@@ -1029,7 +1029,7 @@
ld [hl], $ed
ld b, $70
ld c, $5
- ld hl, Sprites
+ ld hl, wVirtualOAM
ld de, wc608 + 10
call .asm_81fb7
ld de, wc608 + 11
--- 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 @@
; 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 @@
; 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 @@
; 26f69
DecorationDesc_Poster: ; 26f69
- ld a, [Poster]
+ ld a, [wDecoPoster]
ld hl, DecorationDesc_PosterPointers
ld de, 3
call IsInArray
@@ -1148,15 +1148,15 @@
; 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 @@
Special_ToggleMaptileDecorations: ; 26feb
lb de, 0, 4
- ld a, [Bed]
+ ld a, [wDecoBed]
call SetDecorationTile
lb de, 7, 4
- ld a, [Plant]
+ ld a, [wDecoPlant]
call SetDecorationTile
lb de, 6, 0
- ld a, [Poster]
+ ld a, [wDecoPoster]
call SetDecorationTile
call SetPosterVisibility
lb de, 0, 0
call PadCoords_de
- ld a, [Carpet]
+ ld a, [wDecoCarpet]
and a
ret z
call _GetDecorationSprite
@@ -1227,7 +1227,7 @@
SetPosterVisibility: ; 27027
ld b, SET_FLAG
- ld a, [Poster]
+ ld a, [wDecoPoster]
and a
jr nz, .ok
ld b, RESET_FLAG
@@ -1251,19 +1251,19 @@
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
--- a/engine/evolution_animation.asm
+++ b/engine/evolution_animation.asm
@@ -44,7 +44,7 @@
call Request2bpp
xor a
- ld [Danger], a
+ ld [wLowHealthAlarm], a
call WaitBGMap
xor a
ld [hBGMapMode], a
--- a/engine/intro_menu.asm
+++ b/engine/intro_menu.asm
@@ -106,8 +106,8 @@
_ResetWRAM: ; 5bae
- ld hl, Sprites
- ld bc, Options - Sprites
+ ld hl, wVirtualOAM
+ ld bc, Options - wVirtualOAM
xor a
call ByteFill
@@ -196,8 +196,8 @@
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)
--- a/engine/item_effects.asm
+++ b/engine/item_effects.asm
@@ -1658,7 +1658,7 @@
.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: ; f144
xor a
- ld [Danger], a
+ ld [wLowHealthAlarm], a
call ReviveFullHP
ld a, MON_STATUS
call GetPartyParamLocation
@@ -1798,7 +1798,7 @@
ret nc
xor a
- ld [Danger], a
+ ld [wLowHealthAlarm], a
call GetHealingItemAmount
call RestoreHealth
call BattlemonRestoreHealth
@@ -2357,7 +2357,7 @@
ld hl, .PlayedTheFlute
call PrintText
- ld a, [Danger]
+ ld a, [wLowHealthAlarm]
and 1 << DANGER_ON_F
jr nz, .dummy2
.dummy2
--- a/engine/map_objects.asm
+++ b/engine/map_objects.asm
@@ -2829,7 +2829,7 @@
cp b
ret nc
ld l, a
- ld h, HIGH(Sprites)
+ ld h, HIGH(wVirtualOAM)
ld de, SPRITEOAMSTRUCT_LENGTH
ld a, b
ld c, SCREEN_HEIGHT_PX + 2 * TILE_WIDTH
@@ -3043,7 +3043,7 @@
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
--- a/engine/menu_2.asm
+++ b/engine/menu_2.asm
@@ -76,7 +76,7 @@
hlcoord 17, 1
ld de, ShowMoney_TerminatorString
call PlaceString
- ld de, Coins
+ ld de, wCoins
lb bc, 2, 4
hlcoord 13, 1
call PrintNum
@@ -98,7 +98,7 @@
ld de, CoinString
call PlaceString
hlcoord 15, 3
- ld de, Coins
+ ld de, wCoins
lb bc, 2, 4
call PrintNum
ret
--- a/engine/money.asm
+++ b/engine/money.asm
@@ -171,7 +171,7 @@
GiveCoins:: ; 1606f
ld a, 2
- ld de, Coins
+ ld de, wCoins
call AddFunds
ld a, 2
ld bc, .maxcoins
@@ -198,7 +198,7 @@
TakeCoins:: ; 1608f
ld a, 2
- ld de, Coins
+ ld de, wCoins
call SubtractFunds
jr nc, .okay
; leave with 0 coins
@@ -216,6 +216,6 @@
CheckCoins:: ; 160a1
ld a, 2
- ld de, Coins
+ ld de, wCoins
jp CompareFunds
; 160a9
--- a/engine/pokegear.asm
+++ b/engine/pokegear.asm
@@ -2588,8 +2588,8 @@
.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 @@
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 @@
ret
.clear
- ld hl, Sprites
- ld bc, SpritesEnd - Sprites
+ ld hl, wVirtualOAM
+ ld bc, SpritesEnd - wVirtualOAM
xor a
call ByteFill
scf
--- a/engine/routines/loadpushoam.asm
+++ b/engine/routines/loadpushoam.asm
@@ -11,7 +11,7 @@
ret
.PushOAM: ; 403f
- ld a, HIGH(Sprites)
+ ld a, HIGH(wVirtualOAM)
ld [rDMA], a
ld a, NUM_SPRITE_OAM_STRUCTS
.pushoam_loop
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -1993,7 +1993,7 @@
call ResetStringBuffer1
ld hl, StringBuffer1
- ld de, Coins
+ ld de, wCoins
lb bc, PRINTNUM_RIGHTALIGN | 2, 6
call PrintNum
ld de, StringBuffer1
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -223,7 +223,7 @@
.PrintCoinsAndPayout: ; 927f8 (24:67f8)
hlcoord 5, 1
- ld de, Coins
+ ld de, wCoins
lb bc, PRINTNUM_LEADINGZEROS | 2, 4
call PrintNum
hlcoord 11, 1
@@ -480,7 +480,7 @@
ld [hl], e
dec hl
ld [hl], d
- ld hl, Coins
+ ld hl, wCoins
ld d, [hl]
inc hl
ld e, [hl]
@@ -1819,7 +1819,7 @@
ld a, 4
sub b
ld [wSlotBet], a
- ld hl, Coins
+ ld hl, wCoins
ld c, a
ld a, [hli]
and a
@@ -1832,7 +1832,7 @@
jr .loop
.Start:
- ld hl, Coins + 1
+ ld hl, wCoins + 1
ld a, [hl]
sub c
ld [hld], a
@@ -1883,7 +1883,7 @@
; 0x930e9
Slots_AskPlayAgain: ; 930e9 (24:70e9)
- ld hl, Coins
+ ld hl, wCoins
ld a, [hli]
or [hl]
jr nz, .you_have_coins
--- a/engine/specials.asm
+++ b/engine/specials.asm
@@ -253,7 +253,7 @@
; c3ae
Special_CheckCoins: ; c3ae
- ld hl, Coins
+ ld hl, wCoins
ld a, [hli]
or [hl]
jr z, .no_coins
--- a/engine/sprites.asm
+++ b/engine/sprites.asm
@@ -23,7 +23,7 @@
push bc
push af
- ld a, LOW(Sprites)
+ ld a, LOW(wVirtualOAM)
ld [wCurrSpriteOAMAddr], a
call DoNextFrameForAllSprites
@@ -60,9 +60,9 @@
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 @@
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 @@
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
--- a/engine/variables.asm
+++ b/engine/variables.asm
@@ -89,7 +89,7 @@
.CountBadges: ; 806e1
; Number of owned badges.
- ld hl, Badges
+ ld hl, wBadges
ld b, 2
call CountSetBits
ld a, [wd265]
--- a/home.asm
+++ b/home.asm
@@ -169,8 +169,8 @@
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
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -296,19 +296,19 @@
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
--- a/macros/wram.asm
+++ b/macros/wram.asm
@@ -129,7 +129,7 @@
ENDM
channel_struct: MACRO
-; Addreses are Channel1 (c101).
+; Addreses are wChannel1 (c101).
\1MusicID:: dw
\1MusicBank:: db
\1Flags:: db ; 0:on/off 1:subroutine 3:sfx 4:noise 5:rest
--- a/maps/KrissHouse2F.asm
+++ b/maps/KrissHouse2F.asm
@@ -40,7 +40,7 @@
Doll2:
describedecoration DECODESC_RIGHT_DOLL
-BigDoll:
+wDecoBigDoll:
describedecoration DECODESC_BIG_DOLL
GameConsole:
@@ -138,4 +138,4 @@
object_event 4, 2, SPRITE_CONSOLE, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, GameConsole, EVENT_KRISS_HOUSE_2F_CONSOLE
object_event 4, 4, SPRITE_DOLL_1, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Doll1, EVENT_KRISS_HOUSE_2F_DOLL_1
object_event 5, 4, SPRITE_DOLL_2, SPRITEMOVEDATA_ITEM_TREE, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Doll2, EVENT_KRISS_HOUSE_2F_DOLL_2
- object_event 0, 1, SPRITE_BIG_DOLL, SPRITEMOVEDATA_BIGDOLL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, BigDoll, EVENT_KRISS_HOUSE_2F_BIG_DOLL
+ object_event 0, 1, SPRITE_BIG_DOLL, SPRITEMOVEDATA_BIGDOLL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, wDecoBigDoll, EVENT_KRISS_HOUSE_2F_BIG_DOLL
--- a/mobile/mobile_22.asm
+++ b/mobile/mobile_22.asm
@@ -568,9 +568,9 @@
ret
Function89448: ; 89448 (22:5448)
-; Clears the Sprites array
+; Clears the sprite array
push af
- ld hl, Sprites
+ ld hl, wVirtualOAM
ld d, 24 * SPRITEOAMSTRUCT_LENGTH
xor a
.loop
@@ -2550,7 +2550,7 @@
Function89f9a: ; 89f9a (22:5f9a)
dec a
- ld hl, Sprites
+ ld hl, wVirtualOAM
and a
ret z
.asm_89fa0
@@ -3293,7 +3293,7 @@
ld [hli], a
ld a, $ff
ld [hli], a
- ld hl, Sprites
+ ld hl, wVirtualOAM
xor a
ld bc, 8 * SPRITEOAMSTRUCT_LENGTH
call ByteFill
--- a/mobile/mobile_40.asm
+++ b/mobile/mobile_40.asm
@@ -1646,7 +1646,7 @@
; 100a2e
.StageForSend: ; 100a2e
- ld a, [wPlayerAction]
+ ld a, [wBattlePlayerAction]
and a
jr nz, .switch
ld a, [CurPlayerMove]
@@ -7143,7 +7143,7 @@
ld a, $01
ld [hOAMUpdate], a
call ClearSprites
- ld de, Sprites
+ ld de, wVirtualOAM
call Function1030cd
xor a
ld [hOAMUpdate], a
--- a/mobile/mobile_45.asm
+++ b/mobile/mobile_45.asm
@@ -650,7 +650,7 @@
ld a, [de]
ld [hl], a
xor a
- ld [BigDoll], a
+ ld [wDecoBigDoll], a
ld [$dc17], a
ld a, $2
ld [$dc0e], a
@@ -691,7 +691,7 @@
ld a, [$dc0d]
ld [de], a
ld b, $0
- ld a, [BigDoll]
+ ld a, [wDecoBigDoll]
and a
jr z, .asm_114537
ld b, $1
@@ -753,7 +753,7 @@
Function114576: ; 114576
xor a
- ld [Bed], a
+ ld [wDecoBed], a
ld b, $7
call Function1143f3
cp $2
@@ -802,7 +802,7 @@
.asm_1145bf
ld a, $1
- ld [Bed], a
+ ld [wDecoBed], a
ret
; 1145c5
@@ -924,7 +924,7 @@
cp $d
jr nz, .asm_11468a
xor a
- ld [Carpet], a
+ ld [wDecoCarpet], a
.asm_114662
inc e
call z, Function11469b
@@ -947,7 +947,7 @@
inc e
call z, Function11469b
ld a, $1
- ld [Carpet], a
+ ld [wDecoCarpet], a
ld a, [de]
cp $d
jr z, .asm_114662
@@ -959,7 +959,7 @@
ld [hFF8C], a
ld [MBC3SRamBank], a
xor a
- ld [Carpet], a
+ ld [wDecoCarpet], a
ld a, $1
ret
@@ -1021,7 +1021,7 @@
and a
jr z, .asm_1146f5
ld a, $1
- ld [BigDoll], a
+ ld [wDecoBigDoll], a
jr .asm_1146da
.asm_1146f5
@@ -1057,7 +1057,7 @@
ld [hFF8C], a
ld [MBC3SRamBank], a
ld a, $1
- ld [RightOrnament], a
+ ld [wDecoRightOrnament], a
call Function1147cd
and a
jp nz, .asm_1147b7
@@ -1069,13 +1069,13 @@
and a
jr z, .asm_114794
ld a, $1
- ld [BigDoll], a
+ ld [wDecoBigDoll], a
.asm_114749
call Function11494d
and a
jr nz, .asm_11478a
- ld a, [BigDoll]
+ ld a, [wDecoBigDoll]
and a
jr nz, .asm_114786
ld hl, $dc03
@@ -1102,7 +1102,7 @@
ld a, [$dc0d]
inc a
ld [$dc0d], a
- ld a, [BigDoll]
+ ld a, [wDecoBigDoll]
and a
jr z, .asm_114799
@@ -1127,7 +1127,7 @@
ret
.asm_114799
- ld a, [Carpet]
+ ld a, [wDecoCarpet]
and a
jr z, .asm_114737
jr .asm_1147cb
@@ -1141,7 +1141,7 @@
and a
jr z, .asm_1147cb
xor a
- ld [BigDoll], a
+ ld [wDecoBigDoll], a
.asm_1147b7
ld a, [$dc17]
@@ -1148,7 +1148,7 @@
and a
jr z, .asm_114794
ld a, $1
- ld [BigDoll], a
+ ld [wDecoBigDoll], a
ld a, [$dc0d]
cp $1
jr nz, .asm_114773
@@ -1162,7 +1162,7 @@
Function1147cd: ; 1147cd
ld bc, NULL
- ld a, [RightOrnament]
+ ld a, [wDecoRightOrnament]
and a
jr nz, .asm_11480c
.asm_1147d6
@@ -1364,7 +1364,7 @@
call z, Function114944
cp $3
jr nz, .asm_114904
- ld hl, Plant
+ ld hl, wDecoPlant
ld a, [hli]
ld [de], a
inc e
@@ -1458,7 +1458,7 @@
call z, Function1149c3
cp $3
jr nz, .asm_114983
- ld hl, Plant
+ ld hl, wDecoPlant
ld a, [hli]
ld [de], a
inc e
@@ -1810,7 +1810,7 @@
call z, Function114b4c
.asm_114b26
- ld hl, Plant
+ ld hl, wDecoPlant
ld a, [$dc00]
ld [hli], a
ld [hl], e
@@ -2703,7 +2703,7 @@
ret
.asm_114fa7
- ld hl, Bed
+ ld hl, wDecoBed
ld c, [hl]
inc hl
ld a, [hli]
@@ -2842,7 +2842,7 @@
; 115062
Function115062: ; 115062
- ld hl, Bed
+ ld hl, wDecoBed
ld a, [hli]
and a
jr z, .asm_1150ae
@@ -2948,9 +2948,9 @@
.asm_1150f8
ld a, l
- ld [Console], a
+ ld [wDecoConsole], a
ld a, h
- ld [LeftOrnament], a
+ ld [wDecoLeftOrnament], a
ld hl, String_114232
.asm_115103
ld a, [hli]
@@ -2987,9 +2987,9 @@
ld a, $3d
ld [de], a
inc de
- ld a, [Console]
+ ld a, [wDecoConsole]
ld l, a
- ld a, [LeftOrnament]
+ ld a, [wDecoLeftOrnament]
ld h, a
jr .asm_1150bb
@@ -3275,7 +3275,7 @@
; 11528f
Function11528f: ; 11528f
- ld hl, Bed
+ ld hl, wDecoBed
ld c, [hl]
inc hl
ld a, [hli]
@@ -3458,7 +3458,7 @@
ld a, b
ld [hli], a
inc de
- ld hl, RightOrnament
+ ld hl, wDecoRightOrnament
ld a, [de]
ld [hli], a
inc de
@@ -3502,7 +3502,7 @@
ld [hl], a
inc de
ld a, [de]
- ld [Bed], a
+ ld [wDecoBed], a
inc de
ld hl, $dc0d
ld [hl], e
@@ -3522,9 +3522,9 @@
ld [$dc03], a
ld [$dc04], a
ld a, $24
- ld [Console], a
+ ld [wDecoConsole], a
ld a, $dc
- ld [LeftOrnament], a
+ ld [wDecoLeftOrnament], a
push bc
jr .asm_1153f4
@@ -3548,9 +3548,9 @@
ld c, [hl]
inc hl
push hl
- ld a, [Console]
+ ld a, [wDecoConsole]
ld l, a
- ld a, [LeftOrnament]
+ ld a, [wDecoLeftOrnament]
ld h, a
push bc
ld b, $0
@@ -3560,10 +3560,10 @@
pop bc
ld a, l
ld e, a
- ld [Console], a
+ ld [wDecoConsole], a
ld a, h
ld d, a
- ld [LeftOrnament], a
+ ld [wDecoLeftOrnament], a
dec b
jr z, .asm_11542b
pop hl
@@ -3582,9 +3582,9 @@
.asm_115430
ld a, l
- ld [Console], a
+ ld [wDecoConsole], a
ld a, h
- ld [LeftOrnament], a
+ ld [wDecoLeftOrnament], a
xor a
ld [de], a
ld hl, $dc24
@@ -3670,7 +3670,7 @@
inc de
ld a, h
ld [de], a
- ld hl, RightOrnament
+ ld hl, wDecoRightOrnament
ld a, [hli]
ld [wCurrMapBGEventCount], a
ld [hFF8C], a
@@ -3680,15 +3680,15 @@
ld d, [hl]
ld hl, $ddc8
call Function115d6a
- ld hl, RightOrnament
+ ld hl, wDecoRightOrnament
ld a, [wCurrMapBGEventCount]
ld [hli], a
ld [hl], e
inc hl
ld [hl], d
- ld a, [Console]
+ ld a, [wDecoConsole]
ld e, a
- ld a, [LeftOrnament]
+ ld a, [wDecoLeftOrnament]
ld d, a
pop hl
ld a, h
@@ -3708,9 +3708,9 @@
and a
jr nz, .asm_11552c
call Function1155d1
- ld a, [RightOrnament]
+ ld a, [wDecoRightOrnament]
dec a
- ld [RightOrnament], a
+ ld [wDecoRightOrnament], a
and a
jp z, .asm_115577
cp $1
@@ -3718,7 +3718,7 @@
xor a
ld [wDailyResetTimer], a
.asm_1154f7
- ld a, [BigDoll]
+ ld a, [wDecoBigDoll]
cp $2
jr z, .asm_115502
cp $3
@@ -3822,9 +3822,9 @@
jp Function11425c
.asm_1155a0
- ld a, [RightOrnament]
+ ld a, [wDecoRightOrnament]
dec a
- ld [RightOrnament], a
+ ld [wDecoRightOrnament], a
and a
jr z, .asm_115560
call Function1155d1
@@ -3854,7 +3854,7 @@
ld [hli], a
inc de
ld a, [de]
- ld [RightOrnament], a
+ ld [wDecoRightOrnament], a
inc de
ld a, e
ld [hli], a
@@ -3870,10 +3870,10 @@
ld a, [$dc0e]
ld h, a
ld a, [hli]
- ld [BigDoll], a
+ ld [wDecoBigDoll], a
cp $3
jr nz, .asm_1155f0
- ld de, Carpet
+ ld de, wDecoCarpet
ld a, [hli]
ld [de], a
inc de
@@ -3883,7 +3883,7 @@
ld a, [hli]
ld [de], a
ld a, [hli]
- ld [Bed], a
+ ld [wDecoBed], a
.asm_1155f0
ld de, $dc17
@@ -4056,9 +4056,9 @@
call Function115732
call Function11575c
ld a, h
- ld [Poster], a
+ ld [wDecoPoster], a
ld a, l
- ld [Plant], a
+ ld [wDecoPlant], a
.asm_1156fa
call Function1157d0
@@ -4070,9 +4070,9 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
ret
.asm_115b43
- ld a, [Carpet]
+ ld a, [wDecoCarpet]
add a
cpl
ld c, a
@@ -4961,7 +4961,7 @@
Function115bc8: ; 115bc8
xor a
- ld [Carpet], a
+ ld [wDecoCarpet], a
.asm_115bcc
ld a, [de]
ld [hli], a
@@ -5009,9 +5009,9 @@
ld a, b
or c
jr z, .asm_115c46
- ld a, [Carpet]
+ ld a, [wDecoCarpet]
inc a
- ld [Carpet], a
+ ld [wDecoCarpet], a
dec bc
ld a, b
or c
--- a/mobile/mobile_45_sprite_engine.asm
+++ b/mobile/mobile_45_sprite_engine.asm
@@ -360,7 +360,7 @@
cp $2
jr c, .asm_1161b4
ld a, $a0
- ld hl, Sprites
+ ld hl, wVirtualOAM
ld bc, 25 * SPRITEOAMSTRUCT_LENGTH
call ByteFill
@@ -667,7 +667,7 @@
ld a, $1
ld [rSVBK], a
ld a, $a0
- ld hl, Sprites
+ ld hl, wVirtualOAM
ld bc, 16 * SPRITEOAMSTRUCT_LENGTH
call ByteFill
ld a, $90
@@ -695,7 +695,7 @@
ld a, $1
ld [rSVBK], a
ld a, $a0
- ld hl, Sprites
+ ld hl, wVirtualOAM
ld bc, 16 * SPRITEOAMSTRUCT_LENGTH
call ByteFill
call DelayFrame
--- a/mobile/mobile_5b.asm
+++ b/mobile/mobile_5b.asm
@@ -564,7 +564,7 @@
ret z
call Function16cb40
ld hl, Unknown_16cb86
- ld de, Sprites
+ ld de, wVirtualOAM
call Function16cb5d
ret
; 16cb40
--- a/mobile/mobile_5e.asm
+++ b/mobile/mobile_5e.asm
@@ -517,7 +517,7 @@
; 17a9cb
Function17a9cb: ; 17a9cb (5e:69cb)
- ld de, Sprites ; $c400
+ ld de, wVirtualOAM ; $c400
ld hl, $d088
bit 6, [hl]
jr nz, .bit_6_set
--- a/wram.asm
+++ b/wram.asm
@@ -22,16 +22,16 @@
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 @@
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 @@
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 @@
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 @@
AlreadyFailed:: db ; c6fb
wBattleParticipantsIncludingFainted:: db ; c6fc
-wDanger:: db ; c6fd
+wBattleLowHealthAlarm:: db ; c6fd
wPlayerMinimized:: db ; c6fe
PlayerScreens:: ; c6ff
; bit
@@ -659,7 +659,7 @@
EnemyReflectCount:: db ; c707
ds 2
-Weather:: ; c70a
+wBattleWeather:: ; c70a
; 00 normal
; 01 rain
; 02 sun
@@ -1871,7 +1871,7 @@
wFieldMoveSucceeded::
wItemEffectSucceeded::
-wPlayerAction::
+wBattlePlayerAction::
; 0 - use move
; 1 - use item
; 2 - switch
@@ -2439,9 +2439,9 @@
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 @@
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 @@
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 @@
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