summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2014-05-26 14:04:56 -0700
committeryenatch <yenatch@gmail.com>2014-05-26 22:04:39 -0700
commit40c17c906b2b3f65b3b04b1933b90238a7ac5566 (patch)
tree6de26c959808d5a792b692f2300c33557c1dbfab /audio
parent52ba96f5f4ec53450a0ff6257ea1040d09b7e537 (diff)
Remove most static wram addresses. Use labels instead.
For unknown addresses, use "w<address>". Label overleads are still an issue.
Diffstat (limited to 'audio')
-rw-r--r--audio/engine_1.asm450
-rw-r--r--audio/engine_2.asm462
-rw-r--r--audio/engine_3.asm450
3 files changed, 681 insertions, 681 deletions
diff --git a/audio/engine_1.asm b/audio/engine_1.asm
index cf121bcd..774374f5 100644
--- a/audio/engine_1.asm
+++ b/audio/engine_1.asm
@@ -4,7 +4,7 @@ Func_9103:: ; 0x9103
ld c, CH0
.loop
ld b, $0
- ld hl, $c026
+ ld hl, wc026
add hl, bc
ld a, [hl]
and a
@@ -12,13 +12,13 @@ Func_9103:: ; 0x9103
ld a, c
cp CH4
jr nc, .asm_912e ; if sfx channel
- ld a, [$c002]
+ ld a, [wc002]
and a
jr z, .asm_912e
bit 7, a
jr nz, .nextChannel
set 7, a
- ld [$c002], a
+ ld [wc002], a
xor a
ld [$ff25], a
ld [$ff1a], a
@@ -36,14 +36,14 @@ Func_9103:: ; 0x9103
; this routine checks flags for music effects currently applied
; to the channel and calls certain functions based on flags.
-; known flags for $c02e:
+; known flags for wc02e:
; 1: call has been used
; 3: a toggle used only by this routine for vibrato
; 4: pitchbend flag
; 6: dutycycle flag
Music2_ApplyMusicAffects: ; 0x9138
ld b, $0
- ld hl, $c0b6 ; delay unitl next note
+ ld hl, wc0b6 ; delay unitl next note
add hl, bc
ld a, [hl]
cp $1 ; if the delay is 1, play next note
@@ -53,36 +53,36 @@ Music2_ApplyMusicAffects: ; 0x9138
ld a, c
cp CH4
jr nc, .startChecks ; if a sfx channel
- ld hl, $c02a
+ ld hl, wc02a
add hl, bc
ld a, [hl]
and a
jr z, .startChecks
ret
.startChecks
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 6, [hl] ; dutycycle
jr z, .checkForExecuteMusic
call Music2_ApplyDutyCycle
.checkForExecuteMusic
ld b, $0
- ld hl, $c036
+ ld hl, wc036
add hl, bc
bit 0, [hl]
jr nz, .checkForPitchBend
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 2, [hl]
jr nz, .disablePitchBendVibrato
.checkForPitchBend
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 4, [hl] ; pitchbend
jr z, .checkVibratoDelay
jp Music2_ApplyPitchBend
.checkVibratoDelay
- ld hl, $c04e ; vibrato delay
+ ld hl, wc04e ; vibrato delay
add hl, bc
ld a, [hl]
and a ; check if delay is over
@@ -91,7 +91,7 @@ Music2_ApplyMusicAffects: ; 0x9138
.disablePitchBendVibrato
ret
.checkForVibrato
- ld hl, $c056 ; vibrato rate
+ ld hl, wc056 ; vibrato rate
add hl, bc
ld a, [hl]
and a
@@ -99,7 +99,7 @@ Music2_ApplyMusicAffects: ; 0x9138
ret ; no vibrato
.vibrato
ld d, a
- ld hl, $c05e
+ ld hl, wc05e
add hl, bc
ld a, [hl]
and $f
@@ -112,10 +112,10 @@ Music2_ApplyMusicAffects: ; 0x9138
swap [hl]
or [hl]
ld [hl], a ; reset the vibrato value and start again
- ld hl, $c066
+ ld hl, wc066
add hl, bc
ld e, [hl] ; get note pitch
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 3, [hl] ; this is the only code that sets/resets bit three so
jr z, .unset ; it continuously alternates which path it takes
@@ -148,13 +148,13 @@ Music2_ApplyMusicAffects: ; 0x9138
; like tempo changes, duty changes etc. and doesn't return
; until the first note is reached
Music2_PlayNextNote ; 0x91d0
- ld hl, $c06e
+ ld hl, wc06e
add hl, bc
ld a, [hl]
- ld hl, $c04e
+ ld hl, wc04e
add hl, bc
ld [hl], a
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
res 4, [hl]
res 5, [hl]
@@ -167,7 +167,7 @@ Music2_endchannel: ; 0x91e6
cp $ff ; is this command an endchannel?
jp nz, Music2_callchannel ; no
ld b, $0 ; yes
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 1, [hl]
jr nz, .returnFromCall
@@ -177,7 +177,7 @@ Music2_endchannel: ; 0x91e6
jr .asm_923f
.noiseOrSfxChannel
res 2, [hl]
- ld hl, $c036
+ ld hl, wc036
add hl, bc
res 0, [hl]
cp CH6
@@ -188,11 +188,11 @@ Music2_endchannel: ; 0x91e6
ld [$ff1a], a
.notSfxChannel3
jr nz, .asm_9222
- ld a, [$c003]
+ ld a, [wc003]
and a
jr z, .asm_9222
xor a
- ld [$c003], a
+ ld [wc003], a
jr .asm_923f
.asm_9222
jr .asm_9248
@@ -202,10 +202,10 @@ Music2_endchannel: ; 0x91e6
ld a, c
add a
ld e, a
- ld hl, $c006
+ ld hl, wc006
add hl, de
push hl ; store current channel address
- ld hl, $c016
+ ld hl, wc016
add hl, de
ld e, l
ld d, h
@@ -223,12 +223,12 @@ Music2_endchannel: ; 0x91e6
and [hl]
ld [$ff25], a
.asm_9248
- ld a, [$c02a]
+ ld a, [wc02a]
cp $14
jr nc, .asm_9251
jr .asm_926e
.asm_9251
- ld a, [$c02a]
+ ld a, [wc02a]
cp $86
jr z, .asm_926e
jr c, .asm_925c
@@ -240,12 +240,12 @@ Music2_endchannel: ; 0x91e6
call Func_96c7
ret c
.asm_9265
- ld a, [$c005]
+ ld a, [wc005]
ld [$ff24], a
xor a
- ld [$c005], a
+ ld [wc005], a
.asm_926e
- ld hl, $c026
+ ld hl, wc026
add hl, bc
ld [hl], b
ret
@@ -264,10 +264,10 @@ Music2_callchannel: ; 0x9274
ld a, c
add a
ld e, a
- ld hl, $c006
+ ld hl, wc006
add hl, de
push hl
- ld hl, $c016
+ ld hl, wc016
add hl, de
ld e, l
ld d, h
@@ -282,7 +282,7 @@ Music2_callchannel: ; 0x9274
inc hl
ld [hl], d ; overwrite current address with pointer
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 1, [hl] ; set the call flag
jp Music2_endchannel
@@ -295,7 +295,7 @@ Music2_loopchannel: ; 0x92a9
and a
jr z, .infiniteLoop
ld b, $0
- ld hl, $c0be
+ ld hl, wc0be
add hl, bc
ld a, [hl]
cp e
@@ -318,7 +318,7 @@ Music2_loopchannel: ; 0x92a9
ld a, c
add a
ld e, a
- ld hl, $c006
+ ld hl, wc006
add hl, de
pop af
ld [hli], a
@@ -332,7 +332,7 @@ Music2_notetype: ; 0x92e4
ld a, d ; yes
and $f
ld b, $0
- ld hl, $c0c6
+ ld hl, wc0c6
add hl, bc
ld [hl], a ; store low nibble as speed
ld a, c
@@ -345,10 +345,10 @@ Music2_notetype: ; 0x92e4
jr z, .musicChannel3
cp CH6
jr nz, .notChannel3
- ld hl, $c0e7
+ ld hl, wc0e7
jr .sfxChannel3
.musicChannel3
- ld hl, $c0e6
+ ld hl, wc0e6
.sfxChannel3
ld a, d
and $f
@@ -363,7 +363,7 @@ Music2_notetype: ; 0x92e4
; else, store volume (high nibble) and fade (low nibble)
.notChannel3
ld b, $0
- ld hl, $c0de
+ ld hl, wc0de
add hl, bc
ld [hl], d
.noiseChannel
@@ -374,11 +374,11 @@ Music2_togglecall: ; 0x9323
cp $e8 ; is this command an togglecall?
jr nz, Music2_vibrato ; no
ld b, $0 ; yes
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
ld a, [hl]
xor $1
- ld [hl], a ; flip bit 0 of $c02e (toggle returning from call)
+ ld [hl], a ; flip bit 0 of wc02e (toggle returning from call)
jp Music2_endchannel
Music2_vibrato: ; 0x9335
@@ -386,10 +386,10 @@ Music2_vibrato: ; 0x9335
jr nz, Music2_pitchbend ; no
call Music2_GetNextMusicByte ; yes
ld b, $0
- ld hl, $c04e
+ ld hl, wc04e
add hl, bc
ld [hl], a ; store delay
- ld hl, $c06e
+ ld hl, wc06e
add hl, bc
ld [hl], a ; store delay
call Music2_GetNextMusicByte
@@ -397,7 +397,7 @@ Music2_vibrato: ; 0x9335
and $f0
swap a
ld b, $0
- ld hl, $c056
+ ld hl, wc056
add hl, bc
srl a
ld e, a
@@ -408,7 +408,7 @@ Music2_vibrato: ; 0x9335
ld a, d
and $f
ld d, a
- ld hl, $c05e
+ ld hl, wc05e
add hl, bc
swap a
or d
@@ -420,7 +420,7 @@ Music2_pitchbend: ; 0x936d
jr nz, Music2_duty ; no
call Music2_GetNextMusicByte ; yes
ld b, $0
- ld hl, $c076
+ ld hl, wc076
add hl, bc
ld [hl], a ; store first param
call Music2_GetNextMusicByte
@@ -432,14 +432,14 @@ Music2_pitchbend: ; 0x936d
and $f
call Func_9858
ld b, $0
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
ld [hl], d ; store unknown part of second param
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld [hl], e ; store unknown part of second param
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 4, [hl] ; set pitchbend flag
call Music2_GetNextMusicByte
@@ -454,7 +454,7 @@ Music2_duty: ; 0x93a5
rrca
and $c0
ld b, $0
- ld hl, $c03e
+ ld hl, wc03e
add hl, bc
ld [hl], a ; store duty
jp Music2_endchannel
@@ -466,25 +466,25 @@ Music2_tempo: ; 0x93ba
cp CH4
jr nc, .sfxChannel
call Music2_GetNextMusicByte
- ld [$c0e8], a ; store first param
+ ld [wc0e8], a ; store first param
call Music2_GetNextMusicByte
- ld [$c0e9], a ; store second param
+ ld [wc0e9], a ; store second param
xor a
- ld [$c0ce], a ; clear RAM
- ld [$c0cf], a
- ld [$c0d0], a
- ld [$c0d1], a
+ ld [wc0ce], a ; clear RAM
+ ld [wc0cf], a
+ ld [wc0d0], a
+ ld [wc0d1], a
jr .musicChannelDone
.sfxChannel
call Music2_GetNextMusicByte
- ld [$c0ea], a ; store first param
+ ld [wc0ea], a ; store first param
call Music2_GetNextMusicByte
- ld [$c0eb], a ; store second param
+ ld [wc0eb], a ; store second param
xor a
- ld [$c0d2], a ; clear RAM
- ld [$c0d3], a
- ld [$c0d4], a
- ld [$c0d5], a
+ ld [wc0d2], a ; clear RAM
+ ld [wc0d3], a
+ ld [wc0d4], a
+ ld [wc0d5], a
.musicChannelDone
jp Music2_endchannel
@@ -492,7 +492,7 @@ Music2_unknownmusic0xee: ; 0x93fa
cp $ee ; is this command an unknownmusic0xee?
jr nz, Music2_unknownmusic0xef ; no
call Music2_GetNextMusicByte ; yes
- ld [$c004], a ; store first param
+ ld [wc004], a ; store first param
jp Music2_endchannel
; this appears to never be used
@@ -503,13 +503,13 @@ Music2_unknownmusic0xef ; 0x9407
push bc
call Func_9876
pop bc
- ld a, [$c003]
+ ld a, [wc003]
and a
jr nz, .skip
- ld a, [$c02d]
- ld [$c003], a
+ ld a, [wc02d]
+ ld [wc003], a
xor a
- ld [$c02d], a
+ ld [wc02d], a
.skip
jp Music2_endchannel
@@ -518,14 +518,14 @@ Music2_dutycycle: ; 0x9426
jr nz, Music2_stereopanning ; no
call Music2_GetNextMusicByte ; yes
ld b, $0
- ld hl, $c046
+ ld hl, wc046
add hl, bc
ld [hl], a ; store full cycle
and $c0
- ld hl, $c03e
+ ld hl, wc03e
add hl, bc
ld [hl], a ; store first duty
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 6, [hl] ; set dutycycle flag
jp Music2_endchannel
@@ -541,7 +541,7 @@ Music2_executemusic: ; 0x9450
cp $f8 ; is this command an executemusic?
jr nz, Music2_octave ; no
ld b, $0 ; yes
- ld hl, $c036
+ ld hl, wc036
add hl, bc
set 0, [hl]
jp Music2_endchannel
@@ -550,7 +550,7 @@ Music2_octave: ; 0x945f
and $f0
cp $e0 ; is this command an octave?
jr nz, Music2_unknownsfx0x20 ; no
- ld hl, $c0d6 ; yes
+ ld hl, wc0d6 ; yes
ld b, $0
add hl, bc
ld a, d
@@ -565,14 +565,14 @@ Music2_unknownsfx0x20: ; 0x9472
cp CH3 ; is this a noise or sfx channel?
jr c, Music2_unknownsfx0x10 ; no
ld b, $0
- ld hl, $c036
+ ld hl, wc036
add hl, bc
bit 0, [hl]
jr nz, Music2_unknownsfx0x10 ; no
call Music2_notelength ; yes
ld d, a
ld b, $0
- ld hl, $c03e
+ ld hl, wc03e
add hl, bc
ld a, [hl]
or d
@@ -611,7 +611,7 @@ Music2_unknownsfx0x10:
cp $10 ; is this command a unknownsfx0x10?
jr nz, Music2_note ; no
ld b, $0
- ld hl, $c036
+ ld hl, wc036
add hl, bc
bit 0, [hl]
jr nz, Music2_note ; no
@@ -646,7 +646,7 @@ Music2_dnote:
call Music2_GetNextMusicByte ; get dnote instrument
asm_94fd
ld d, a
- ld a, [$c003]
+ ld a, [wc003]
and a
jr nz, .asm_9508
ld a, d
@@ -663,7 +663,7 @@ Music2_notelength: ; 0x950a
ld b, $0
ld e, a ; store note length (in 16ths)
ld d, b
- ld hl, $c0c6
+ ld hl, wc0c6
add hl, bc
ld a, [hl]
ld l, b
@@ -671,9 +671,9 @@ Music2_notelength: ; 0x950a
ld a, c
cp CH4
jr nc, .sfxChannel
- ld a, [$c0e8]
+ ld a, [wc0e8]
ld d, a
- ld a, [$c0e9]
+ ld a, [wc0e9]
ld e, a
jr .skip
.sfxChannel
@@ -682,31 +682,31 @@ Music2_notelength: ; 0x950a
cp CH7
jr z, .skip ; if noise channel
call Func_9693
- ld a, [$c0ea]
+ ld a, [wc0ea]
ld d, a
- ld a, [$c0eb]
+ ld a, [wc0eb]
ld e, a
.skip
ld a, l
ld b, $0
- ld hl, $c0ce
+ ld hl, wc0ce
add hl, bc
ld l, [hl]
call Func_9847
ld e, l
ld d, h
- ld hl, $c0ce
+ ld hl, wc0ce
add hl, bc
ld [hl], e
ld a, d
- ld hl, $c0b6
+ ld hl, wc0b6
add hl, bc
ld [hl], a
- ld hl, $c036
+ ld hl, wc036
add hl, bc
bit 0, [hl]
jr nz, Music2_notepitch
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 2, [hl]
jr z, Music2_notepitch
@@ -721,7 +721,7 @@ Music2_notepitch: ; 0x9568
ld a, c
cp CH4
jr nc, .sfxChannel
- ld hl, $c02a
+ ld hl, wc02a
add hl, bc
ld a, [hl]
and a
@@ -754,12 +754,12 @@ Music2_notepitch: ; 0x9568
.notRest
swap a
ld b, $0
- ld hl, $c0d6
+ ld hl, wc0d6
add hl, bc
ld b, [hl]
call Func_9858
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 4, [hl]
jr z, .asm_95b8
@@ -769,7 +769,7 @@ Music2_notepitch: ; 0x9568
ld a, c
cp CH4
jr nc, .skip ; if sfx channel
- ld hl, $c02a
+ ld hl, wc02a
ld d, $0
ld e, a
add hl, de
@@ -782,7 +782,7 @@ Music2_notepitch: ; 0x9568
ret
.skip
ld b, $0
- ld hl, $c0de
+ ld hl, wc0de
add hl, bc
ld d, [hl]
ld b, $2
@@ -792,7 +792,7 @@ Music2_notepitch: ; 0x9568
call Func_95f8
pop de
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 0, [hl]
jr z, .asm_95ef
@@ -800,7 +800,7 @@ Music2_notepitch: ; 0x9568
jr nc, .asm_95ef
inc d
.asm_95ef
- ld hl, $c066
+ ld hl, wc066
add hl, bc
ld [hl], e
call Func_964b
@@ -818,13 +818,13 @@ Func_95f8: ; 0x95f8
jr z, .sfxNoiseChannel
cp CH4
jr nc, .skip ; if sfx channel
- ld hl, $c02a
+ ld hl, wc02a
add hl, bc
ld a, [hl]
and a
jr nz, .skip
.sfxNoiseChannel
- ld a, [$c004]
+ ld a, [wc004]
ld hl, Unknown_9b27
add hl, bc
and [hl]
@@ -842,7 +842,7 @@ Func_95f8: ; 0x95f8
Func_9629: ; 0x9629
ld b, $0
- ld hl, $c0b6
+ ld hl, wc0b6
add hl, bc
ld d, [hl]
ld a, c
@@ -853,7 +853,7 @@ Func_9629: ; 0x9629
ld a, d
and $3f
ld d, a
- ld hl, $c03e
+ ld hl, wc03e
add hl, bc
ld a, [hl]
or d
@@ -873,10 +873,10 @@ Func_964b: ; 0x964b
; fall through
.channel3
push de
- ld de, $c0e6
+ ld de, wc0e6
cp CH2
jr z, .musicChannel3
- ld de, $c0e7
+ ld de, wc0e7
.musicChannel3
ld a, [de]
add a
@@ -919,27 +919,27 @@ Func_9693: ; 0x9693
call Func_96e5
jr nc, .asm_96ab
ld d, $0
- ld a, [$c0f2]
+ ld a, [wc0f2]
add $80
jr nc, .asm_96a2
inc d
.asm_96a2
- ld [$c0eb], a
+ ld [wc0eb], a
ld a, d
- ld [$c0ea], a
+ ld [wc0ea], a
jr .asm_96b4
.asm_96ab
xor a
- ld [$c0eb], a
+ ld [wc0eb], a
ld a, $1
- ld [$c0ea], a
+ ld [wc0ea], a
.asm_96b4
ret
Func_96b5: ; 0x96b5
call Func_96e5
jr nc, .asm_96c6
- ld a, [$c0f1]
+ ld a, [wc0f1]
add e
jr nc, .asm_96c1
inc d
@@ -955,7 +955,7 @@ Func_96b5: ; 0x96b5
Func_96c7: ; 0x96c7
call Func_96e5
jr nc, .asm_96e2
- ld hl, $c006
+ ld hl, wc006
ld e, c
ld d, $0
sla e
@@ -976,7 +976,7 @@ Func_96c7: ; 0x96c7
ret
Func_96e5: ; 0x96e5
- ld a, [$c02a]
+ ld a, [wc02a]
cp $14
jr nc, .asm_96ee
jr .asm_96f4
@@ -993,27 +993,27 @@ Func_96e5: ; 0x96e5
ret
Music2_ApplyPitchBend: ; 0x96f9
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 5, [hl]
jp nz, .asm_9740
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld e, [hl]
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld d, [hl]
- ld hl, $c07e
+ ld hl, wc07e
add hl, bc
ld l, [hl]
ld h, b
add hl, de
ld d, h
ld e, l
- ld hl, $c08e
+ ld hl, wc08e
add hl, bc
push hl
- ld hl, $c086
+ ld hl, wc086
add hl, bc
ld a, [hl]
pop hl
@@ -1025,26 +1025,26 @@ Music2_ApplyPitchBend: ; 0x96f9
ld a, $0
adc d
ld d, a
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
ld a, [hl]
cp d
jp c, .asm_9786
jr nz, .asm_9773
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld a, [hl]
cp e
jp c, .asm_9786
jr .asm_9773
.asm_9740
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld a, [hl]
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld d, [hl]
- ld hl, $c07e
+ ld hl, wc07e
add hl, bc
ld e, [hl]
sub e
@@ -1052,7 +1052,7 @@ Music2_ApplyPitchBend: ; 0x96f9
ld a, d
sbc b
ld d, a
- ld hl, $c086
+ ld hl, wc086
add hl, bc
ld a, [hl]
add a
@@ -1063,22 +1063,22 @@ Music2_ApplyPitchBend: ; 0x96f9
ld a, d
sbc b
ld d, a
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
ld a, d
cp [hl]
jr c, .asm_9786
jr nz, .asm_9773
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld a, e
cp [hl]
jr c, .asm_9786
.asm_9773
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld [hl], e
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld [hl], d
ld b, $3
@@ -1088,54 +1088,54 @@ Music2_ApplyPitchBend: ; 0x96f9
ld [hl], d
ret
.asm_9786
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
res 4, [hl]
res 5, [hl]
ret
Func_978f: ; 0x978f
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld [hl], d
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld [hl], e
- ld hl, $c0b6
+ ld hl, wc0b6
add hl, bc
ld a, [hl]
- ld hl, $c076
+ ld hl, wc076
add hl, bc
sub [hl]
jr nc, .asm_97a7
ld a, $1
.asm_97a7
ld [hl], a
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld a, e
sub [hl]
ld e, a
ld a, d
sbc b
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
sub [hl]
jr c, .asm_97c3
ld d, a
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 5, [hl]
jr .asm_97e6
.asm_97c3
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld d, [hl]
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld e, [hl]
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld a, [hl]
sub e
@@ -1143,17 +1143,17 @@ Func_978f: ; 0x978f
ld a, d
sbc b
ld d, a
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
ld a, [hl]
sub d
ld d, a
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
res 5, [hl]
.asm_97e6
- ld hl, $c076
+ ld hl, wc076
add hl, bc
.asm_97ea
inc b
@@ -1172,20 +1172,20 @@ Func_978f: ; 0x978f
add [hl]
ld d, b
ld b, $0
- ld hl, $c07e
+ ld hl, wc07e
add hl, bc
ld [hl], d
- ld hl, $c086
+ ld hl, wc086
add hl, bc
ld [hl], a
- ld hl, $c08e
+ ld hl, wc08e
add hl, bc
ld [hl], a
ret
Music2_ApplyDutyCycle: ; 0x980d
ld b, $0
- ld hl, $c046
+ ld hl, wc046
add hl, bc
ld a, [hl]
rlca
@@ -1206,7 +1206,7 @@ Music2_GetNextMusicByte: ; 0x9825
ld a, c
add a
ld e, a
- ld hl, $c006
+ ld hl, wc006
add hl, de
ld a, [hli]
ld e, a
@@ -1274,7 +1274,7 @@ Func_9858: ; 0x9858
ret
Func_9876:: ; 0x9876
- ld [$c001], a
+ ld [wc001], a
cp $ff
jp z, Func_9a34
cp $b9
@@ -1285,63 +1285,63 @@ Func_9876:: ; 0x9876
jp nc, Func_994e
.asm_988d
xor a
- ld [$c000], a
- ld [$c003], a
- ld [$c0e9], a
- ld [$c0e6], a
- ld [$c0e7], a
+ ld [wc000], a
+ ld [wc003], a
+ ld [wc0e9], a
+ ld [wc0e6], a
+ ld [wc0e7], a
ld d, $8
- ld hl, $c016
+ ld hl, wc016
call FillMusicRAM2
- ld hl, $c006
+ ld hl, wc006
call FillMusicRAM2
ld d, $4
- ld hl, $c026
+ ld hl, wc026
call FillMusicRAM2
- ld hl, $c02e
+ ld hl, wc02e
call FillMusicRAM2
- ld hl, $c03e
+ ld hl, wc03e
call FillMusicRAM2
- ld hl, $c046
+ ld hl, wc046
call FillMusicRAM2
- ld hl, $c04e
+ ld hl, wc04e
call FillMusicRAM2
- ld hl, $c056
+ ld hl, wc056
call FillMusicRAM2
- ld hl, $c05e
+ ld hl, wc05e
call FillMusicRAM2
- ld hl, $c066
+ ld hl, wc066
call FillMusicRAM2
- ld hl, $c06e
+ ld hl, wc06e
call FillMusicRAM2
- ld hl, $c036
+ ld hl, wc036
call FillMusicRAM2
- ld hl, $c076
+ ld hl, wc076
call FillMusicRAM2
- ld hl, $c07e
+ ld hl, wc07e
call FillMusicRAM2
- ld hl, $c086
+ ld hl, wc086
call FillMusicRAM2
- ld hl, $c08e
+ ld hl, wc08e
call FillMusicRAM2
- ld hl, $c096
+ ld hl, wc096
call FillMusicRAM2
- ld hl, $c09e
+ ld hl, wc09e
call FillMusicRAM2
- ld hl, $c0a6
+ ld hl, wc0a6
call FillMusicRAM2
- ld hl, $c0ae
+ ld hl, wc0ae
call FillMusicRAM2
ld a, $1
- ld hl, $c0be
+ ld hl, wc0be
call FillMusicRAM2
- ld hl, $c0b6
+ ld hl, wc0b6
call FillMusicRAM2
- ld hl, $c0c6
+ ld hl, wc0c6
call FillMusicRAM2
- ld [$c0e8], a
+ ld [wc0e8], a
ld a, $ff
- ld [$c004], a
+ ld [wc004], a
xor a
ld [$ff24], a
ld a, $8
@@ -1366,9 +1366,9 @@ Func_994e: ; 0x994e
ld de, SFX_Headers_02
add hl, de
ld a, h
- ld [$c0ec], a
+ ld [wc0ec], a
ld a, l
- ld [$c0ed], a
+ ld [wc0ed], a
ld a, [hl]
and $c0
rlca
@@ -1381,9 +1381,9 @@ Func_994e: ; 0x994e
add c
ld c, a
ld b, $0
- ld a, [$c0ec]
+ ld a, [wc0ec]
ld h, a
- ld a, [$c0ed]
+ ld a, [wc0ed]
ld l, a
add hl, bc
ld c, d
@@ -1391,7 +1391,7 @@ Func_994e: ; 0x994e
and $f
ld e, a
ld d, $0
- ld hl, $c026
+ ld hl, wc026
add hl, de
ld a, [hl]
and a
@@ -1399,7 +1399,7 @@ Func_994e: ; 0x994e
ld a, e
cp $7
jr nz, .asm_999a
- ld a, [$c001]
+ ld a, [wc001]
cp $14
jr nc, .asm_9993
ret
@@ -1409,7 +1409,7 @@ Func_994e: ; 0x994e
jr z, .asm_99a3
jr c, .asm_99a3
.asm_999a
- ld a, [$c001]
+ ld a, [wc001]
cp [hl]
jr z, .asm_99a3
jr c, .asm_99a3
@@ -1422,77 +1422,77 @@ Func_994e: ; 0x994e
add hl, hl
ld d, h
ld e, l
- ld hl, $c016
+ ld hl, wc016
add hl, de
ld [hli], a
ld [hl], a
- ld hl, $c006
+ ld hl, wc006
add hl, de
ld [hli], a
ld [hl], a
pop de
- ld hl, $c026
+ ld hl, wc026
add hl, de
ld [hl], a
- ld hl, $c02e
+ ld hl, wc02e
add hl, de
ld [hl], a
- ld hl, $c03e
+ ld hl, wc03e
add hl, de
ld [hl], a
- ld hl, $c046
+ ld hl, wc046
add hl, de
ld [hl], a
- ld hl, $c04e
+ ld hl, wc04e
add hl, de
ld [hl], a
- ld hl, $c056
+ ld hl, wc056
add hl, de
ld [hl], a
- ld hl, $c05e
+ ld hl, wc05e
add hl, de
ld [hl], a
- ld hl, $c066
+ ld hl, wc066
add hl, de
ld [hl], a
- ld hl, $c06e
+ ld hl, wc06e
add hl, de
ld [hl], a
- ld hl, $c076
+ ld hl, wc076
add hl, de
ld [hl], a
- ld hl, $c07e
+ ld hl, wc07e
add hl, de
ld [hl], a
- ld hl, $c086
+ ld hl, wc086
add hl, de
ld [hl], a
- ld hl, $c08e
+ ld hl, wc08e
add hl, de
ld [hl], a
- ld hl, $c096
+ ld hl, wc096
add hl, de
ld [hl], a
- ld hl, $c09e
+ ld hl, wc09e
add hl, de
ld [hl], a
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, de
ld [hl], a
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, de
ld [hl], a
- ld hl, $c036
+ ld hl, wc036
add hl, de
ld [hl], a
ld a, $1
- ld hl, $c0be
+ ld hl, wc0be
add hl, de
ld [hl], a
- ld hl, $c0b6
+ ld hl, wc0b6
add hl, de
ld [hl], a
- ld hl, $c0c6
+ ld hl, wc0c6
add hl, de
ld [hl], a
ld a, e
@@ -1526,24 +1526,24 @@ Func_9a34: ; 0x9a34
ld a, $77
ld [$ff24], a
xor a
- ld [$c000], a
- ld [$c003], a
- ld [$c002], a
- ld [$c0e9], a
- ld [$c0eb], a
- ld [$c0e6], a
- ld [$c0e7], a
+ ld [wc000], a
+ ld [wc003], a
+ ld [wc002], a
+ ld [wc0e9], a
+ ld [wc0eb], a
+ ld [wc0e6], a
+ ld [wc0e7], a
ld d, $a0
- ld hl, $c006
+ ld hl, wc006
call FillMusicRAM2
ld a, $1
ld d, $18
- ld hl, $c0b6
+ ld hl, wc0b6
call FillMusicRAM2
- ld [$c0e8], a
- ld [$c0ea], a
+ ld [wc0e8], a
+ ld [wc0ea], a
ld a, $ff
- ld [$c004], a
+ ld [wc004], a
ret
; fills d bytes at hl with a
@@ -1556,7 +1556,7 @@ FillMusicRAM2: ; 0x9a89
ret
Func_9a8f: ; 0x9a8f
- ld a, [$c001]
+ ld a, [wc001]
ld l, a
ld e, a
ld h, $0
@@ -1567,7 +1567,7 @@ Func_9a8f: ; 0x9a8f
add hl, de
ld e, l
ld d, h
- ld hl, $c006
+ ld hl, wc006
ld a, [de] ; get channel number
ld b, a
rlca
@@ -1593,14 +1593,14 @@ Func_9a8f: ; 0x9a8f
push af
ld b, $0
ld c, a
- ld hl, $c026
+ ld hl, wc026
add hl, bc
- ld a, [$c001]
+ ld a, [wc001]
ld [hl], a
pop af
cp $3
jr c, .asm_9ad2
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 2, [hl]
.asm_9ad2
@@ -1619,32 +1619,32 @@ Func_9a8f: ; 0x9a8f
ld a, [de]
inc de
jr nz, .asm_9ab1
- ld a, [$c001]
+ ld a, [wc001]
cp $14
jr nc, .asm_9aeb
jr .asm_9b15
.asm_9aeb
- ld a, [$c001]
+ ld a, [wc001]
cp $86
jr z, .asm_9b15
jr c, .asm_9af6
jr .asm_9b15
.asm_9af6
- ld hl, $c02a
+ ld hl, wc02a
ld [hli], a
ld [hli], a
ld [hli], a
ld [hl], a
- ld hl, $c012 ; sfx noise channel pointer
+ ld hl, wc012 ; sfx noise channel pointer
ld de, Noise2_endchannel
ld [hl], e
inc hl
ld [hl], d ; overwrite pointer to point to endchannel
- ld a, [$c005]
+ ld a, [wc005]
and a
jr nz, .asm_9b15
ld a, [$ff24]
- ld [$c005], a
+ ld [wc005], a
ld a, $77
ld [$ff24], a
.asm_9b15
diff --git a/audio/engine_2.asm b/audio/engine_2.asm
index 9c64b5c1..68a905c3 100644
--- a/audio/engine_2.asm
+++ b/audio/engine_2.asm
@@ -4,7 +4,7 @@ Func_21879:: ; 21879 (8:5879)
ld c, CH0
.loop
ld b, $0
- ld hl, $c026
+ ld hl, wc026
add hl, bc
ld a, [hl]
and a
@@ -12,13 +12,13 @@ Func_21879:: ; 21879 (8:5879)
ld a, c
cp CH4
jr nc, .applyAffects ; if sfx channel
- ld a, [$c002]
+ ld a, [wc002]
and a
jr z, .applyAffects
bit 7, a
jr nz, .nextChannel
set 7, a
- ld [$c002], a
+ ld [wc002], a
xor a
ld [$ff25], a
ld [$ff1a], a
@@ -36,14 +36,14 @@ Func_21879:: ; 21879 (8:5879)
; this routine checks flags for music effects currently applied
; to the channel and calls certain functions based on flags.
-; known flags for $c02e:
+; known flags for wc02e:
; 1: call has been used
; 3: a toggle used only by this routine for vibrato
; 4: pitchbend flag
; 6: dutycycle flag
Music8_ApplyMusicAffects: ; 218ae (8:58ae)
ld b, $0
- ld hl, $c0b6 ; delay unitl next note
+ ld hl, wc0b6 ; delay unitl next note
add hl, bc
ld a, [hl]
cp $1 ; if the delay is 1, play next note
@@ -53,36 +53,36 @@ Music8_ApplyMusicAffects: ; 218ae (8:58ae)
ld a, c
cp CH4
jr nc, .startChecks ; if a sfx channel
- ld hl, $c02a
+ ld hl, wc02a
add hl, bc
ld a, [hl]
and a
jr z, .startChecks
ret
.startChecks
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 6, [hl] ; dutycycle
jr z, .checkForExecuteMusic
call Music8_ApplyDutyCycle
.checkForExecuteMusic
ld b, $0
- ld hl, $c036
+ ld hl, wc036
add hl, bc
bit 0, [hl]
jr nz, .checkForPitchBend
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 2, [hl]
jr nz, .disablePitchBendVibrato
.checkForPitchBend
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 4, [hl] ; pitchbend
jr z, .checkVibratoDelay
jp Music8_ApplyPitchBend
.checkVibratoDelay
- ld hl, $c04e ; vibrato delay
+ ld hl, wc04e ; vibrato delay
add hl, bc
ld a, [hl]
and a ; check if delay is over
@@ -91,7 +91,7 @@ Music8_ApplyMusicAffects: ; 218ae (8:58ae)
.disablePitchBendVibrato
ret
.checkForVibrato
- ld hl, $c056 ; vibrato rate
+ ld hl, wc056 ; vibrato rate
add hl, bc
ld a, [hl]
and a
@@ -99,7 +99,7 @@ Music8_ApplyMusicAffects: ; 218ae (8:58ae)
ret ; no vibrato
.vibrato
ld d, a
- ld hl, $c05e
+ ld hl, wc05e
add hl, bc
ld a, [hl]
and $f
@@ -112,10 +112,10 @@ Music8_ApplyMusicAffects: ; 218ae (8:58ae)
swap [hl]
or [hl]
ld [hl], a ; reset the vibrato value and start again
- ld hl, $c066
+ ld hl, wc066
add hl, bc
ld e, [hl] ; get note pitch
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 3, [hl] ; this is the only code that sets/resets bit three so
jr z, .unset ; it continuously alternates which path it takes
@@ -148,20 +148,20 @@ Music8_ApplyMusicAffects: ; 218ae (8:58ae)
; like tempo changes, duty changes etc. and doesn't return
; until the first note is reached
Music8_PlayNextNote: ; 21946 (8:5946)
- ld hl, $c06e
+ ld hl, wc06e
add hl, bc
ld a, [hl]
- ld hl, $c04e
+ ld hl, wc04e
add hl, bc
ld [hl], a
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
res 4, [hl]
res 5, [hl]
ld a, c
cp CH4
jr nz, .beginChecks
- ld a, [$d083]
+ ld a, [wd083]
bit 7, a
ret nz
.beginChecks
@@ -174,7 +174,7 @@ Music8_endchannel: ; 21967 (8:5967)
cp $ff ; is this command an endchannel?
jp nz, Music8_callchannel ; no
ld b, $0 ; yes
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 1, [hl]
jr nz, .returnFromCall
@@ -184,7 +184,7 @@ Music8_endchannel: ; 21967 (8:5967)
jr .asm_219c0
.noiseOrSfxChannel
res 2, [hl]
- ld hl, $c036
+ ld hl, wc036
add hl, bc
res 0, [hl]
cp CH6
@@ -195,11 +195,11 @@ Music8_endchannel: ; 21967 (8:5967)
ld [$ff1a], a
.notSfxChannel3
jr nz, .asm_219a3
- ld a, [$c003]
+ ld a, [wc003]
and a
jr z, .asm_219a3
xor a
- ld [$c003], a
+ ld [wc003], a
jr .asm_219c0
.asm_219a3
jr .asm_219c9
@@ -209,10 +209,10 @@ Music8_endchannel: ; 21967 (8:5967)
ld a, c
add a
ld e, a
- ld hl, $c006
+ ld hl, wc006
add hl, de
push hl ; store current channel address
- ld hl, $c016
+ ld hl, wc016
add hl, de
ld e, l
ld d, h
@@ -230,12 +230,12 @@ Music8_endchannel: ; 21967 (8:5967)
and [hl]
ld [$ff25], a
.asm_219c9
- ld a, [$c02a]
+ ld a, [wc02a]
cp $14
jr nc, .asm_219d2
jr .asm_219ef
.asm_219d2
- ld a, [$c02a]
+ ld a, [wc02a]
cp $86
jr z, .asm_219ef
jr c, .asm_219dd
@@ -247,12 +247,12 @@ Music8_endchannel: ; 21967 (8:5967)
call Func_21e6d
ret c
.asm_219e6
- ld a, [$c005]
+ ld a, [wc005]
ld [$ff24], a
xor a
- ld [$c005], a
+ ld [wc005], a
.asm_219ef
- ld hl, $c026
+ ld hl, wc026
add hl, bc
ld [hl], b
ret
@@ -271,10 +271,10 @@ Music8_callchannel: ; 219f5 (8:59f5)
ld a, c
add a
ld e, a
- ld hl, $c006
+ ld hl, wc006
add hl, de
push hl
- ld hl, $c016
+ ld hl, wc016
add hl, de
ld e, l
ld d, h
@@ -289,7 +289,7 @@ Music8_callchannel: ; 219f5 (8:59f5)
inc hl
ld [hl], d ; overwrite current address with pointer
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 1, [hl] ; set the call flag
jp Music8_endchannel
@@ -302,7 +302,7 @@ Music8_loopchannel: ; 21a2a (8:5a2a)
and a
jr z, .infiniteLoop
ld b, $0
- ld hl, $c0be
+ ld hl, wc0be
add hl, bc
ld a, [hl]
cp e
@@ -325,7 +325,7 @@ Music8_loopchannel: ; 21a2a (8:5a2a)
ld a, c
add a
ld e, a
- ld hl, $c006
+ ld hl, wc006
add hl, de
pop af
ld [hli], a
@@ -339,7 +339,7 @@ Music8_notetype: ; 21a65 (8:5a65)
ld a, d ; yes
and $f
ld b, $0
- ld hl, $c0c6
+ ld hl, wc0c6
add hl, bc
ld [hl], a ; store low nibble as speed
ld a, c
@@ -352,10 +352,10 @@ Music8_notetype: ; 21a65 (8:5a65)
jr z, .musicChannel3
cp CH6
jr nz, .notChannel3
- ld hl, $c0e7
+ ld hl, wc0e7
jr .sfxChannel3
.musicChannel3
- ld hl, $c0e6
+ ld hl, wc0e6
.sfxChannel3
ld a, d
and $f
@@ -370,7 +370,7 @@ Music8_notetype: ; 21a65 (8:5a65)
; else, store volume (high nibble) and fade (low nibble)
.notChannel3
ld b, $0
- ld hl, $c0de
+ ld hl, wc0de
add hl, bc
ld [hl], d
.noiseChannel
@@ -381,11 +381,11 @@ Music8_togglecall: ; 21aa4 (8:5aa4)
cp $e8 ; is this command an togglecall?
jr nz, Music8_vibrato ; no
ld b, $0 ; yes
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
ld a, [hl]
xor $1
- ld [hl], a ; flip bit 0 of $c02e (toggle returning from call)
+ ld [hl], a ; flip bit 0 of wc02e (toggle returning from call)
jp Music8_endchannel
Music8_vibrato: ; 21ab6 (8:5ab6)
@@ -393,10 +393,10 @@ Music8_vibrato: ; 21ab6 (8:5ab6)
jr nz, Music8_pitchbend ; no
call Music8_GetNextMusicByte ; yes
ld b, $0
- ld hl, $c04e
+ ld hl, wc04e
add hl, bc
ld [hl], a ; store delay
- ld hl, $c06e
+ ld hl, wc06e
add hl, bc
ld [hl], a ; store delay
call Music8_GetNextMusicByte
@@ -404,7 +404,7 @@ Music8_vibrato: ; 21ab6 (8:5ab6)
and $f0
swap a
ld b, $0
- ld hl, $c056
+ ld hl, wc056
add hl, bc
srl a
ld e, a
@@ -415,7 +415,7 @@ Music8_vibrato: ; 21ab6 (8:5ab6)
ld a, d
and $f
ld d, a
- ld hl, $c05e
+ ld hl, wc05e
add hl, bc
swap a
or d
@@ -427,7 +427,7 @@ Music8_pitchbend: ; 21aee (8:5aee)
jr nz, Music8_duty ; no
call Music8_GetNextMusicByte ; yes
ld b, $0
- ld hl, $c076
+ ld hl, wc076
add hl, bc
ld [hl], a ; store first param
call Music8_GetNextMusicByte
@@ -439,14 +439,14 @@ Music8_pitchbend: ; 21aee (8:5aee)
and $f
call Func_22017
ld b, $0
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
ld [hl], d ; store unknown part of second param
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld [hl], e ; store unknown part of second param
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 4, [hl] ; set pitchbend flag
call Music8_GetNextMusicByte
@@ -461,7 +461,7 @@ Music8_duty: ; 21b26 (8:5b26)
rrca
and $c0
ld b, $0
- ld hl, $c03e
+ ld hl, wc03e
add hl, bc
ld [hl], a ; store duty
jp Music8_endchannel
@@ -473,25 +473,25 @@ Music8_tempo: ; 21b3b (8:5b3b)
cp CH4
jr nc, .sfxChannel
call Music8_GetNextMusicByte
- ld [$c0e8], a ; store first param
+ ld [wc0e8], a ; store first param
call Music8_GetNextMusicByte
- ld [$c0e9], a ; store second param
+ ld [wc0e9], a ; store second param
xor a
- ld [$c0ce], a ; clear RAM
- ld [$c0cf], a
- ld [$c0d0], a
- ld [$c0d1], a
+ ld [wc0ce], a ; clear RAM
+ ld [wc0cf], a
+ ld [wc0d0], a
+ ld [wc0d1], a
jr .musicChannelDone
.sfxChannel
call Music8_GetNextMusicByte
- ld [$c0ea], a ; store first param
+ ld [wc0ea], a ; store first param
call Music8_GetNextMusicByte
- ld [$c0eb], a ; store second param
+ ld [wc0eb], a ; store second param
xor a
- ld [$c0d2], a ; clear RAM
- ld [$c0d3], a
- ld [$c0d4], a
- ld [$c0d5], a
+ ld [wc0d2], a ; clear RAM
+ ld [wc0d3], a
+ ld [wc0d4], a
+ ld [wc0d5], a
.musicChannelDone
jp Music8_endchannel
@@ -499,7 +499,7 @@ Music8_unknownmusic0xee: ; 21b7b (8:5b7b)
cp $ee ; is this command an unknownmusic0xee?
jr nz, Music8_unknownmusic0xef ; no
call Music8_GetNextMusicByte ; yes
- ld [$c004], a ; store first param
+ ld [wc004], a ; store first param
jp Music8_endchannel
; this appears to never be used
@@ -510,13 +510,13 @@ Music8_unknownmusic0xef: ; 21b88 (8:5b88)
push bc
call Func_22035
pop bc
- ld a, [$c003]
+ ld a, [wc003]
and a
jr nz, .skip
- ld a, [$c02d]
- ld [$c003], a
+ ld a, [wc02d]
+ ld [wc003], a
xor a
- ld [$c02d], a
+ ld [wc02d], a
.skip
jp Music8_endchannel
@@ -525,14 +525,14 @@ Music8_dutycycle: ; 21ba7 (8:5ba7)
jr nz, Music8_stereopanning ; no
call Music8_GetNextMusicByte ; yes
ld b, $0
- ld hl, $c046
+ ld hl, wc046
add hl, bc
ld [hl], a ; store full cycle
and $c0
- ld hl, $c03e
+ ld hl, wc03e
add hl, bc
ld [hl], a ; store first duty
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 6, [hl] ; set dutycycle flag
jp Music8_endchannel
@@ -548,7 +548,7 @@ Music8_executemusic: ; 21bd1 (8:5bd1)
cp $f8 ; is this command an executemusic?
jr nz, Music8_octave ; no
ld b, $0 ; yes
- ld hl, $c036
+ ld hl, wc036
add hl, bc
set 0, [hl]
jp Music8_endchannel
@@ -557,7 +557,7 @@ Music8_octave: ; 21be0 (8:5be0)
and $f0
cp $e0 ; is this command an octave?
jr nz, Music8_unknownsfx0x20 ; no
- ld hl, $c0d6 ; yes
+ ld hl, wc0d6 ; yes
ld b, $0
add hl, bc
ld a, d
@@ -572,14 +572,14 @@ Music8_unknownsfx0x20: ; 21bf3
cp CH3 ; is this a noise or sfx channel?
jr c, Music8_unknownsfx0x10 ; no
ld b, $0
- ld hl, $c036
+ ld hl, wc036
add hl, bc
bit 0, [hl]
jr nz, Music8_unknownsfx0x10 ; no
call Music8_notelength
ld d, a
ld b, $0
- ld hl, $c03e
+ ld hl, wc03e
add hl, bc
ld a, [hl]
or d
@@ -618,7 +618,7 @@ Music8_unknownsfx0x10: ; 21c40 (8:5c40)
cp $10 ; is this command a unknownsfx0x10?
jr nz, Music8_note ; no
ld b, $0
- ld hl, $c036
+ ld hl, wc036
add hl, bc
bit 0, [hl]
jr nz, Music8_note ; no
@@ -653,7 +653,7 @@ Music8_dnote: ; 21c76 (8:5c76)
call Music8_GetNextMusicByte ; get dnote instrument
asm_21c7e
ld d, a
- ld a, [$c003]
+ ld a, [wc003]
and a
jr nz, .asm_21c89
ld a, d
@@ -670,7 +670,7 @@ Music8_notelength: ; 21c8b (8:5c8b)
ld b, $0
ld e, a ; store note length (in 16ths)
ld d, b
- ld hl, $c0c6
+ ld hl, wc0c6
add hl, bc
ld a, [hl]
ld l, b
@@ -678,9 +678,9 @@ Music8_notelength: ; 21c8b (8:5c8b)
ld a, c
cp CH4
jr nc, .sfxChannel
- ld a, [$c0e8]
+ ld a, [wc0e8]
ld d, a
- ld a, [$c0e9]
+ ld a, [wc0e9]
ld e, a
jr .skip
.sfxChannel
@@ -689,31 +689,31 @@ Music8_notelength: ; 21c8b (8:5c8b)
cp CH7
jr z, .skip ; if noise channel
call Func_21e2f
- ld a, [$c0ea]
+ ld a, [wc0ea]
ld d, a
- ld a, [$c0eb]
+ ld a, [wc0eb]
ld e, a
.skip
ld a, l
ld b, $0
- ld hl, $c0ce
+ ld hl, wc0ce
add hl, bc
ld l, [hl]
call Func_22006
ld e, l
ld d, h
- ld hl, $c0ce
+ ld hl, wc0ce
add hl, bc
ld [hl], e
ld a, d
- ld hl, $c0b6
+ ld hl, wc0b6
add hl, bc
ld [hl], a
- ld hl, $c036
+ ld hl, wc036
add hl, bc
bit 0, [hl]
jr nz, Music8_notepitch
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 2, [hl]
jr z, Music8_notepitch
@@ -728,7 +728,7 @@ Music8_notepitch: ; 21ce9 (8:5ce9)
ld a, c
cp CH4
jr nc, .sfxChannel
- ld hl, $c02a
+ ld hl, wc02a
add hl, bc
ld a, [hl]
and a
@@ -761,12 +761,12 @@ Music8_notepitch: ; 21ce9 (8:5ce9)
.notRest
swap a
ld b, $0
- ld hl, $c0d6
+ ld hl, wc0d6
add hl, bc
ld b, [hl]
call Func_22017
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 4, [hl]
jr z, .asm_21d39
@@ -776,7 +776,7 @@ Music8_notepitch: ; 21ce9 (8:5ce9)
ld a, c
cp CH4
jr nc, .skip ; if sfx channel
- ld hl, $c02a
+ ld hl, wc02a
ld d, $0
ld e, a
add hl, de
@@ -789,7 +789,7 @@ Music8_notepitch: ; 21ce9 (8:5ce9)
ret
.skip
ld b, $0
- ld hl, $c0de
+ ld hl, wc0de
add hl, bc
ld d, [hl]
ld b, $2
@@ -799,7 +799,7 @@ Music8_notepitch: ; 21ce9 (8:5ce9)
call Func_21d79
pop de
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 0, [hl]
jr z, .asm_21d70
@@ -807,7 +807,7 @@ Music8_notepitch: ; 21ce9 (8:5ce9)
jr nc, .asm_21d70
inc d
.asm_21d70
- ld hl, $c066
+ ld hl, wc066
add hl, bc
ld [hl], e
call Func_21dcc
@@ -825,13 +825,13 @@ Func_21d79: ; 21d79 (8:5d79)
jr z, .sfxNoiseChannel
cp CH4
jr nc, .skip ; if sfx channel
- ld hl, $c02a
+ ld hl, wc02a
add hl, bc
ld a, [hl]
and a
jr nz, .skip
.sfxNoiseChannel
- ld a, [$c004]
+ ld a, [wc004]
ld hl, Unknown_222e6
add hl, bc
and [hl]
@@ -849,7 +849,7 @@ Func_21d79: ; 21d79 (8:5d79)
Func_21daa: ; 21daa (8:5daa)
ld b, $0
- ld hl, $c0b6
+ ld hl, wc0b6
add hl, bc
ld d, [hl]
ld a, c
@@ -860,7 +860,7 @@ Func_21daa: ; 21daa (8:5daa)
ld a, d
and $3f
ld d, a
- ld hl, $c03e
+ ld hl, wc03e
add hl, bc
ld a, [hl]
or d
@@ -880,10 +880,10 @@ Func_21dcc: ; 21dcc (8:5dcc)
; fall through
.channel3
push de
- ld de, $c0e6
+ ld de, wc0e6
cp CH2
jr z, .musicChannel3
- ld de, $c0e7
+ ld de, wc0e7
.musicChannel3
ld a, [de]
add a
@@ -930,13 +930,13 @@ Func_21e19: ; 21e19 (8:5e19)
ld a, c
cp CH4
jr nz, .asm_21e2e
- ld a, [$d083]
+ ld a, [wd083]
bit 7, a
jr z, .asm_21e2e
xor a
- ld [$c0f1], a
+ ld [wc0f1], a
ld a, $80
- ld [$c0f2], a
+ ld [wc0f2], a
.asm_21e2e
ret
@@ -947,20 +947,20 @@ Func_21e2f: ; 21e2f (8:5e2f)
jr nc, .asm_21e4c
.asm_21e39
ld d, $0
- ld a, [$c0f2]
+ ld a, [wc0f2]
add $80
jr nc, .asm_21e43
inc d
.asm_21e43
- ld [$c0eb], a
+ ld [wc0eb], a
ld a, d
- ld [$c0ea], a
+ ld [wc0ea], a
jr .asm_21e55
.asm_21e4c
xor a
- ld [$c0eb], a
+ ld [wc0eb], a
ld a, $1
- ld [$c0ea], a
+ ld [wc0ea], a
.asm_21e55
ret
@@ -970,7 +970,7 @@ Func_21e56: ; 21e56 (8:5e56)
call Func_21e9f
jr nc, .asm_21e6c
.asm_21e60
- ld a, [$c0f1]
+ ld a, [wc0f1]
add e
jr nc, .asm_21e67
inc d
@@ -986,7 +986,7 @@ Func_21e56: ; 21e56 (8:5e56)
Func_21e6d: ; 21e6d (8:5e6d)
call Func_21e8b
jr nc, .asm_21e88
- ld hl, $c006
+ ld hl, wc006
ld e, c
ld d, $0
sla e
@@ -1007,7 +1007,7 @@ Func_21e6d: ; 21e6d (8:5e6d)
ret
Func_21e8b: ; 21e8b (8:5e8b)
- ld a, [$c02a]
+ ld a, [wc02a]
cp $14
jr nc, .asm_21e94
jr .asm_21e9a
@@ -1024,9 +1024,9 @@ Func_21e8b: ; 21e8b (8:5e8b)
ret
Func_21e9f: ; 21e9f (8:5e9f)
- ld a, [$c02d]
+ ld a, [wc02d]
ld b, a
- ld a, [$c02a]
+ ld a, [wc02a]
or b
cp $9d
jr nc, .asm_21ead
@@ -1044,27 +1044,27 @@ Func_21e9f: ; 21e9f (8:5e9f)
ret
Music8_ApplyPitchBend: ; 21eb8 (8:5eb8)
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 5, [hl]
jp nz, .asm_21eff
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld e, [hl]
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld d, [hl]
- ld hl, $c07e
+ ld hl, wc07e
add hl, bc
ld l, [hl]
ld h, b
add hl, de
ld d, h
ld e, l
- ld hl, $c08e
+ ld hl, wc08e
add hl, bc
push hl
- ld hl, $c086
+ ld hl, wc086
add hl, bc
ld a, [hl]
pop hl
@@ -1076,26 +1076,26 @@ Music8_ApplyPitchBend: ; 21eb8 (8:5eb8)
ld a, $0
adc d
ld d, a
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
ld a, [hl]
cp d
jp c, .asm_21f45
jr nz, .asm_21f32
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld a, [hl]
cp e
jp c, .asm_21f45
jr .asm_21f32
.asm_21eff
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld a, [hl]
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld d, [hl]
- ld hl, $c07e
+ ld hl, wc07e
add hl, bc
ld e, [hl]
sub e
@@ -1103,7 +1103,7 @@ Music8_ApplyPitchBend: ; 21eb8 (8:5eb8)
ld a, d
sbc b
ld d, a
- ld hl, $c086
+ ld hl, wc086
add hl, bc
ld a, [hl]
add a
@@ -1114,22 +1114,22 @@ Music8_ApplyPitchBend: ; 21eb8 (8:5eb8)
ld a, d
sbc b
ld d, a
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
ld a, d
cp [hl]
jr c, .asm_21f45
jr nz, .asm_21f32
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld a, e
cp [hl]
jr c, .asm_21f45
.asm_21f32
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld [hl], e
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld [hl], d
ld b, $3
@@ -1139,54 +1139,54 @@ Music8_ApplyPitchBend: ; 21eb8 (8:5eb8)
ld [hl], d
ret
.asm_21f45
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
res 4, [hl]
res 5, [hl]
ret
Func_21f4e: ; 21f4e (8:5f4e)
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld [hl], d
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld [hl], e
- ld hl, $c0b6
+ ld hl, wc0b6
add hl, bc
ld a, [hl]
- ld hl, $c076
+ ld hl, wc076
add hl, bc
sub [hl]
jr nc, .asm_21f66
ld a, $1
.asm_21f66
ld [hl], a
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld a, e
sub [hl]
ld e, a
ld a, d
sbc b
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
sub [hl]
jr c, .asm_21f82
ld d, a
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 5, [hl]
jr .asm_21fa5
.asm_21f82
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld d, [hl]
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld e, [hl]
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld a, [hl]
sub e
@@ -1194,17 +1194,17 @@ Func_21f4e: ; 21f4e (8:5f4e)
ld a, d
sbc b
ld d, a
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
ld a, [hl]
sub d
ld d, a
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
res 5, [hl]
.asm_21fa5
- ld hl, $c076
+ ld hl, wc076
add hl, bc
.asm_21fa9
inc b
@@ -1223,20 +1223,20 @@ Func_21f4e: ; 21f4e (8:5f4e)
add [hl]
ld d, b
ld b, $0
- ld hl, $c07e
+ ld hl, wc07e
add hl, bc
ld [hl], d
- ld hl, $c086
+ ld hl, wc086
add hl, bc
ld [hl], a
- ld hl, $c08e
+ ld hl, wc08e
add hl, bc
ld [hl], a
ret
Music8_ApplyDutyCycle: ; 21fcc (8:5fcc)
ld b, $0
- ld hl, $c046
+ ld hl, wc046
add hl, bc
ld a, [hl]
rlca
@@ -1257,7 +1257,7 @@ Music8_GetNextMusicByte: ; 21fe4 (8:5fe4)
ld a, c
add a
ld e, a
- ld hl, $c006
+ ld hl, wc006
add hl, de
ld a, [hli]
ld e, a
@@ -1325,7 +1325,7 @@ Func_22017: ; 22017 (8:6017)
ret
Func_22035:: ; 22035 (8:6035)
- ld [$c001], a
+ ld [wc001], a
cp $ff
jp z, Func_221f3
cp $e9
@@ -1336,63 +1336,63 @@ Func_22035:: ; 22035 (8:6035)
jp nc, Func_2210d
.asm_2204c
xor a
- ld [$c000], a
- ld [$c003], a
- ld [$c0e9], a
- ld [$c0e6], a
- ld [$c0e7], a
+ ld [wc000], a
+ ld [wc003], a
+ ld [wc0e9], a
+ ld [wc0e6], a
+ ld [wc0e7], a
ld d, $8
- ld hl, $c016
+ ld hl, wc016
call FillMusicRAM8
- ld hl, $c006
+ ld hl, wc006
call FillMusicRAM8
ld d, $4
- ld hl, $c026
+ ld hl, wc026
call FillMusicRAM8
- ld hl, $c02e
+ ld hl, wc02e
call FillMusicRAM8
- ld hl, $c03e
+ ld hl, wc03e
call FillMusicRAM8
- ld hl, $c046
+ ld hl, wc046
call FillMusicRAM8
- ld hl, $c04e
+ ld hl, wc04e
call FillMusicRAM8
- ld hl, $c056
+ ld hl, wc056
call FillMusicRAM8
- ld hl, $c05e
+ ld hl, wc05e
call FillMusicRAM8
- ld hl, $c066
+ ld hl, wc066
call FillMusicRAM8
- ld hl, $c06e
+ ld hl, wc06e
call FillMusicRAM8
- ld hl, $c036
+ ld hl, wc036
call FillMusicRAM8
- ld hl, $c076
+ ld hl, wc076
call FillMusicRAM8
- ld hl, $c07e
+ ld hl, wc07e
call FillMusicRAM8
- ld hl, $c086
+ ld hl, wc086
call FillMusicRAM8
- ld hl, $c08e
+ ld hl, wc08e
call FillMusicRAM8
- ld hl, $c096
+ ld hl, wc096
call FillMusicRAM8
- ld hl, $c09e
+ ld hl, wc09e
call FillMusicRAM8
- ld hl, $c0a6
+ ld hl, wc0a6
call FillMusicRAM8
- ld hl, $c0ae
+ ld hl, wc0ae
call FillMusicRAM8
ld a, $1
- ld hl, $c0be
+ ld hl, wc0be
call FillMusicRAM8
- ld hl, $c0b6
+ ld hl, wc0b6
call FillMusicRAM8
- ld hl, $c0c6
+ ld hl, wc0c6
call FillMusicRAM8
- ld [$c0e8], a
+ ld [wc0e8], a
ld a, $ff
- ld [$c004], a
+ ld [wc004], a
xor a
ld [$ff24], a
ld a, $8
@@ -1417,9 +1417,9 @@ Func_2210d: ; 2210d (8:610d)
ld de, SFX_Headers_08
add hl, de
ld a, h
- ld [$c0ec], a
+ ld [wc0ec], a
ld a, l
- ld [$c0ed], a
+ ld [wc0ed], a
ld a, [hl]
and $c0
rlca
@@ -1432,9 +1432,9 @@ Func_2210d: ; 2210d (8:610d)
add c
ld c, a
ld b, $0
- ld a, [$c0ec]
+ ld a, [wc0ec]
ld h, a
- ld a, [$c0ed]
+ ld a, [wc0ed]
ld l, a
add hl, bc
ld c, d
@@ -1442,7 +1442,7 @@ Func_2210d: ; 2210d (8:610d)
and $f
ld e, a
ld d, $0
- ld hl, $c026
+ ld hl, wc026
add hl, de
ld a, [hl]
and a
@@ -1450,7 +1450,7 @@ Func_2210d: ; 2210d (8:610d)
ld a, e
cp $7
jr nz, .asm_22159
- ld a, [$c001]
+ ld a, [wc001]
cp $14
jr nc, .asm_22152
ret
@@ -1460,7 +1460,7 @@ Func_2210d: ; 2210d (8:610d)
jr z, .asm_22162
jr c, .asm_22162
.asm_22159
- ld a, [$c001]
+ ld a, [wc001]
cp [hl]
jr z, .asm_22162
jr c, .asm_22162
@@ -1473,77 +1473,77 @@ Func_2210d: ; 2210d (8:610d)
add hl, hl
ld d, h
ld e, l
- ld hl, $c016
+ ld hl, wc016
add hl, de
ld [hli], a
ld [hl], a
- ld hl, $c006
+ ld hl, wc006
add hl, de
ld [hli], a
ld [hl], a
pop de
- ld hl, $c026
+ ld hl, wc026
add hl, de
ld [hl], a
- ld hl, $c02e
+ ld hl, wc02e
add hl, de
ld [hl], a
- ld hl, $c03e
+ ld hl, wc03e
add hl, de
ld [hl], a
- ld hl, $c046
+ ld hl, wc046
add hl, de
ld [hl], a
- ld hl, $c04e
+ ld hl, wc04e
add hl, de
ld [hl], a
- ld hl, $c056
+ ld hl, wc056
add hl, de
ld [hl], a
- ld hl, $c05e
+ ld hl, wc05e
add hl, de
ld [hl], a
- ld hl, $c066
+ ld hl, wc066
add hl, de
ld [hl], a
- ld hl, $c06e
+ ld hl, wc06e
add hl, de
ld [hl], a
- ld hl, $c076
+ ld hl, wc076
add hl, de
ld [hl], a
- ld hl, $c07e
+ ld hl, wc07e
add hl, de
ld [hl], a
- ld hl, $c086
+ ld hl, wc086
add hl, de
ld [hl], a
- ld hl, $c08e
+ ld hl, wc08e
add hl, de
ld [hl], a
- ld hl, $c096
+ ld hl, wc096
add hl, de
ld [hl], a
- ld hl, $c09e
+ ld hl, wc09e
add hl, de
ld [hl], a
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, de
ld [hl], a
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, de
ld [hl], a
- ld hl, $c036
+ ld hl, wc036
add hl, de
ld [hl], a
ld a, $1
- ld hl, $c0be
+ ld hl, wc0be
add hl, de
ld [hl], a
- ld hl, $c0b6
+ ld hl, wc0b6
add hl, de
ld [hl], a
- ld hl, $c0c6
+ ld hl, wc0c6
add hl, de
ld [hl], a
ld a, e
@@ -1577,24 +1577,24 @@ Func_221f3: ; 221f3 (8:61f3)
ld a, $77
ld [$ff24], a
xor a
- ld [$c000], a
- ld [$c003], a
- ld [$c002], a
- ld [$c0e9], a
- ld [$c0eb], a
- ld [$c0e6], a
- ld [$c0e7], a
+ ld [wc000], a
+ ld [wc003], a
+ ld [wc002], a
+ ld [wc0e9], a
+ ld [wc0eb], a
+ ld [wc0e6], a
+ ld [wc0e7], a
ld d, $a0
- ld hl, $c006
+ ld hl, wc006
call FillMusicRAM8
ld a, $1
ld d, $18
- ld hl, $c0b6
+ ld hl, wc0b6
call FillMusicRAM8
- ld [$c0e8], a
- ld [$c0ea], a
+ ld [wc0e8], a
+ ld [wc0ea], a
ld a, $ff
- ld [$c004], a
+ ld [wc004], a
ret
; fills d bytes at hl with a
@@ -1607,7 +1607,7 @@ FillMusicRAM8: ; 22248 (8:6248)
ret
Func_2224e: ; 2224e (8:624e)
- ld a, [$c001]
+ ld a, [wc001]
ld l, a
ld e, a
ld h, $0
@@ -1618,7 +1618,7 @@ Func_2224e: ; 2224e (8:624e)
add hl, de
ld e, l
ld d, h
- ld hl, $c006
+ ld hl, wc006
ld a, [de] ; get channel number
ld b, a
rlca
@@ -1644,14 +1644,14 @@ Func_2224e: ; 2224e (8:624e)
push af
ld b, $0
ld c, a
- ld hl, $c026
+ ld hl, wc026
add hl, bc
- ld a, [$c001]
+ ld a, [wc001]
ld [hl], a
pop af
cp $3
jr c, .asm_22291
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 2, [hl]
.asm_22291
@@ -1670,32 +1670,32 @@ Func_2224e: ; 2224e (8:624e)
ld a, [de]
inc de
jr nz, .asm_22270
- ld a, [$c001]
+ ld a, [wc001]
cp $14
jr nc, .asm_222aa
jr .asm_222d4
.asm_222aa
- ld a, [$c001]
+ ld a, [wc001]
cp $86
jr z, .asm_222d4
jr c, .asm_222b5
jr .asm_222d4
.asm_222b5
- ld hl, $c02a
+ ld hl, wc02a
ld [hli], a
ld [hli], a
ld [hli], a
ld [hl], a
- ld hl, $c012 ; sfx noise channel pointer
+ ld hl, wc012 ; sfx noise channel pointer
ld de, Noise8_endchannel
ld [hl], e
inc hl
ld [hl], d ; overwrite pointer to point to endchannel
- ld a, [$c005]
+ ld a, [wc005]
and a
jr nz, .asm_222d4
ld a, [$ff24]
- ld [$c005], a
+ ld [wc005], a
ld a, $77
ld [$ff24], a
.asm_222d4
diff --git a/audio/engine_3.asm b/audio/engine_3.asm
index 3d5ee66f..d215c56d 100644
--- a/audio/engine_3.asm
+++ b/audio/engine_3.asm
@@ -4,7 +4,7 @@ Func_7d177:: ; 7d177 (1f:5177)
ld c, CH0
.loop
ld b, $0
- ld hl, $c026
+ ld hl, wc026
add hl, bc
ld a, [hl]
and a
@@ -12,13 +12,13 @@ Func_7d177:: ; 7d177 (1f:5177)
ld a, c
cp CH4
jr nc, .applyAffects ; if sfx channel
- ld a, [$c002]
+ ld a, [wc002]
and a
jr z, .applyAffects
bit 7, a
jr nz, .nextChannel
set 7, a
- ld [$c002], a
+ ld [wc002], a
xor a
ld [$ff25], a
ld [$ff1a], a
@@ -36,14 +36,14 @@ Func_7d177:: ; 7d177 (1f:5177)
; this routine checks flags for music effects currently applied
; to the channel and calls certain functions based on flags.
-; known flags for $c02e:
+; known flags for wc02e:
; 1: call has been used
; 3: a toggle used only by this routine for vibrato
; 4: pitchbend flag
; 6: dutycycle flag
Music1f_Music2_ApplyMusicAffects: ; 7d1ac (1f:51ac)
ld b, $0
- ld hl, $c0b6 ; delay until next note
+ ld hl, wc0b6 ; delay until next note
add hl, bc
ld a, [hl]
cp $1 ; if delay is 1, play next note
@@ -53,36 +53,36 @@ Music1f_Music2_ApplyMusicAffects: ; 7d1ac (1f:51ac)
ld a, c
cp CH4
jr nc, .startChecks ; if a sfx channel
- ld hl, $c02a
+ ld hl, wc02a
add hl, bc
ld a, [hl]
and a
jr z, .startChecks
ret
.startChecks
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 6, [hl] ; dutycycle
jr z, .checkForExecuteMusic
call Music1f_ApplyDutyCycle
.checkForExecuteMusic
ld b, $0
- ld hl, $c036
+ ld hl, wc036
add hl, bc
bit 0, [hl]
jr nz, .checkForPitchBend
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 2, [hl]
jr nz, .disablePitchBendVibrato
.checkForPitchBend
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 4, [hl] ; pitchbend
jr z, .checkVibratoDelay
jp Music1f_ApplyPitchBend
.checkVibratoDelay
- ld hl, $c04e ; vibrato delay
+ ld hl, wc04e ; vibrato delay
add hl, bc
ld a, [hl]
and a ; check if delay is over
@@ -91,7 +91,7 @@ Music1f_Music2_ApplyMusicAffects: ; 7d1ac (1f:51ac)
.disablePitchBendVibrato
ret
.checkForVibrato
- ld hl, $c056 ; vibrato rate
+ ld hl, wc056 ; vibrato rate
add hl, bc
ld a, [hl]
and a
@@ -99,7 +99,7 @@ Music1f_Music2_ApplyMusicAffects: ; 7d1ac (1f:51ac)
ret ; no vibrato
.vibrato
ld d, a
- ld hl, $c05e
+ ld hl, wc05e
add hl, bc
ld a, [hl]
and $f
@@ -112,10 +112,10 @@ Music1f_Music2_ApplyMusicAffects: ; 7d1ac (1f:51ac)
swap [hl]
or [hl]
ld [hl], a ; reset the vibrato value and start again
- ld hl, $c066
+ ld hl, wc066
add hl, bc
ld e, [hl] ; get note pitch
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 3, [hl] ; this is the only code that sets/resets bit three so
jr z, .unset ; it continuously alternates which path it takes
@@ -148,13 +148,13 @@ Music1f_Music2_ApplyMusicAffects: ; 7d1ac (1f:51ac)
; like tempo changes, duty changes etc. and doesn't return
; until the first note is reached
Music1f_Music2_PlayNextNote: ; 7d244 (1f:5244)
- ld hl, $c06e
+ ld hl, wc06e
add hl, bc
ld a, [hl]
- ld hl, $c04e
+ ld hl, wc04e
add hl, bc
ld [hl], a
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
res 4, [hl]
res 5, [hl]
@@ -167,7 +167,7 @@ Music1f_endchannel: ; 7d25a (1f:525a)
cp $ff ; is this command an endchannel?
jp nz, Music1f_callchannel ; no
ld b, $0 ; yes
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 1, [hl]
jr nz, .returnFromCall
@@ -177,7 +177,7 @@ Music1f_endchannel: ; 7d25a (1f:525a)
jr .asm_7d2b3
.noiseOrSfxChannel
res 2, [hl]
- ld hl, $c036
+ ld hl, wc036
add hl, bc
res 0, [hl]
cp CH6
@@ -188,11 +188,11 @@ Music1f_endchannel: ; 7d25a (1f:525a)
ld [$ff1a], a
.notSfxChannel3
jr nz, .asm_7d296
- ld a, [$c003]
+ ld a, [wc003]
and a
jr z, .asm_7d296
xor a
- ld [$c003], a
+ ld [wc003], a
jr .asm_7d2b3
.asm_7d296
jr .asm_7d2bc
@@ -202,10 +202,10 @@ Music1f_endchannel: ; 7d25a (1f:525a)
ld a, c
add a
ld e, a
- ld hl, $c006
+ ld hl, wc006
add hl, de
push hl ; store current channel address
- ld hl, $c016
+ ld hl, wc016
add hl, de
ld e, l
ld d, h
@@ -223,12 +223,12 @@ Music1f_endchannel: ; 7d25a (1f:525a)
and [hl]
ld [$ff25], a
.asm_7d2bc
- ld a, [$c02a]
+ ld a, [wc02a]
cp $14
jr nc, .asm_7d2c5
jr .asm_7d2e2
.asm_7d2c5
- ld a, [$c02a]
+ ld a, [wc02a]
cp $86
jr z, .asm_7d2e2
jr c, .asm_7d2d0
@@ -240,12 +240,12 @@ Music1f_endchannel: ; 7d25a (1f:525a)
call Func_7d73b
ret c
.asm_7d2d9
- ld a, [$c005]
+ ld a, [wc005]
ld [$ff24], a
xor a
- ld [$c005], a
+ ld [wc005], a
.asm_7d2e2
- ld hl, $c026
+ ld hl, wc026
add hl, bc
ld [hl], b
ret
@@ -264,10 +264,10 @@ Music1f_callchannel: ; 7d2e8 (1f:52e8)
ld a, c
add a
ld e, a
- ld hl, $c006
+ ld hl, wc006
add hl, de
push hl
- ld hl, $c016
+ ld hl, wc016
add hl, de
ld e, l
ld d, h
@@ -282,7 +282,7 @@ Music1f_callchannel: ; 7d2e8 (1f:52e8)
inc hl
ld [hl], d ; overwrite current address with pointer
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 1, [hl] ; set the call flag
jp Music1f_endchannel
@@ -295,7 +295,7 @@ Music1f_loopchannel: ; 7d31d (1f:531d)
and a
jr z, .infiniteLoop
ld b, $0
- ld hl, $c0be
+ ld hl, wc0be
add hl, bc
ld a, [hl]
cp e
@@ -318,7 +318,7 @@ Music1f_loopchannel: ; 7d31d (1f:531d)
ld a, c
add a
ld e, a
- ld hl, $c006
+ ld hl, wc006
add hl, de
pop af
ld [hli], a
@@ -332,7 +332,7 @@ Music1f_notetype: ; 7d358 (1f:5358)
ld a, d ; yes
and $f
ld b, $0
- ld hl, $c0c6
+ ld hl, wc0c6
add hl, bc
ld [hl], a ; store low nibble as speed
ld a, c
@@ -345,10 +345,10 @@ Music1f_notetype: ; 7d358 (1f:5358)
jr z, .musicChannel3
cp CH6
jr nz, .notChannel3
- ld hl, $c0e7
+ ld hl, wc0e7
jr .sfxChannel3
.musicChannel3
- ld hl, $c0e6
+ ld hl, wc0e6
.sfxChannel3
ld a, d
and $f
@@ -363,7 +363,7 @@ Music1f_notetype: ; 7d358 (1f:5358)
; else, store volume (high nibble) and fade (low nibble)
.notChannel3
ld b, $0
- ld hl, $c0de
+ ld hl, wc0de
add hl, bc
ld [hl], d
.noiseChannel
@@ -374,11 +374,11 @@ Music1f_togglecall: ; 7d397 (1f:5397)
cp $e8 ; is this command an togglecall?
jr nz, Music1f_vibrato ; no
ld b, $0 ; yes
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
ld a, [hl]
xor $1
- ld [hl], a ; flip bit 0 of $c02e (toggle returning from call)
+ ld [hl], a ; flip bit 0 of wc02e (toggle returning from call)
jp Music1f_endchannel
Music1f_vibrato: ; 7d3a9 (1f:53a9)
@@ -386,10 +386,10 @@ Music1f_vibrato: ; 7d3a9 (1f:53a9)
jr nz, Music1f_pitchbend ; no
call Music1f_GetNextMusicByte ; yes
ld b, $0
- ld hl, $c04e
+ ld hl, wc04e
add hl, bc
ld [hl], a ; store delay
- ld hl, $c06e
+ ld hl, wc06e
add hl, bc
ld [hl], a ; store delay
call Music1f_GetNextMusicByte
@@ -397,7 +397,7 @@ Music1f_vibrato: ; 7d3a9 (1f:53a9)
and $f0
swap a
ld b, $0
- ld hl, $c056
+ ld hl, wc056
add hl, bc
srl a
ld e, a
@@ -408,7 +408,7 @@ Music1f_vibrato: ; 7d3a9 (1f:53a9)
ld a, d
and $f
ld d, a
- ld hl, $c05e
+ ld hl, wc05e
add hl, bc
swap a
or d
@@ -420,7 +420,7 @@ Music1f_pitchbend: ; 7d3e1 (1f:53e1)
jr nz, Music1f_duty ; no
call Music1f_GetNextMusicByte ; yes
ld b, $0
- ld hl, $c076
+ ld hl, wc076
add hl, bc
ld [hl], a ; store first param
call Music1f_GetNextMusicByte
@@ -432,14 +432,14 @@ Music1f_pitchbend: ; 7d3e1 (1f:53e1)
and $f
call Func_7d8cc
ld b, $0
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
ld [hl], d ; store unknown part of second param
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld [hl], e ; store unknown part of second param
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 4, [hl] ; set pitchbend flag
call Music1f_GetNextMusicByte
@@ -454,7 +454,7 @@ Music1f_duty: ; 7d419 (1f:5419)
rrca
and $c0
ld b, $0
- ld hl, $c03e
+ ld hl, wc03e
add hl, bc
ld [hl], a ; store duty
jp Music1f_endchannel
@@ -466,25 +466,25 @@ Music1f_tempo: ; 7d42e (1f:542e)
cp CH4
jr nc, .sfxChannel
call Music1f_GetNextMusicByte
- ld [$c0e8], a ; store first param
+ ld [wc0e8], a ; store first param
call Music1f_GetNextMusicByte
- ld [$c0e9], a ; store second param
+ ld [wc0e9], a ; store second param
xor a
- ld [$c0ce], a ; clear RAM
- ld [$c0cf], a
- ld [$c0d0], a
- ld [$c0d1], a
+ ld [wc0ce], a ; clear RAM
+ ld [wc0cf], a
+ ld [wc0d0], a
+ ld [wc0d1], a
jr .musicChannelDone
.sfxChannel
call Music1f_GetNextMusicByte
- ld [$c0ea], a ; store first param
+ ld [wc0ea], a ; store first param
call Music1f_GetNextMusicByte
- ld [$c0eb], a ; store second param
+ ld [wc0eb], a ; store second param
xor a
- ld [$c0d2], a ; clear RAM
- ld [$c0d3], a
- ld [$c0d4], a
- ld [$c0d5], a
+ ld [wc0d2], a ; clear RAM
+ ld [wc0d3], a
+ ld [wc0d4], a
+ ld [wc0d5], a
.musicChannelDone
jp Music1f_endchannel
@@ -492,7 +492,7 @@ Music1f_unknownmusic0xee: ; 7d46e (1f:546e)
cp $ee ; is this command an unknownmusic0xee?
jr nz, Music1f_unknownmusic0xef ; no
call Music1f_GetNextMusicByte ; yes
- ld [$c004], a ; store first param
+ ld [wc004], a ; store first param
jp Music1f_endchannel
; this appears to never be used
@@ -503,13 +503,13 @@ Music1f_unknownmusic0xef: ; 7d47b (1f:547b)
push bc
call Func_7d8ea
pop bc
- ld a, [$c003]
+ ld a, [wc003]
and a
jr nz, .skip
- ld a, [$c02d]
- ld [$c003], a
+ ld a, [wc02d]
+ ld [wc003], a
xor a
- ld [$c02d], a
+ ld [wc02d], a
.skip
jp Music1f_endchannel
@@ -518,14 +518,14 @@ Music1f_dutycycle: ; 7d49a (1f:549a)
jr nz, Music1f_stereopanning ; no
call Music1f_GetNextMusicByte ; yes
ld b, $0
- ld hl, $c046
+ ld hl, wc046
add hl, bc
ld [hl], a ; store full cycle
and $c0
- ld hl, $c03e
+ ld hl, wc03e
add hl, bc
ld [hl], a ; store first duty
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 6, [hl] ; set duty flag
jp Music1f_endchannel
@@ -541,7 +541,7 @@ Music1f_executemusic: ; 7d4c4 (1f:54c4)
cp $f8 ; is this command an executemusic?
jr nz, Music1f_octave ; no
ld b, $0 ; yes
- ld hl, $c036
+ ld hl, wc036
add hl, bc
set 0, [hl]
jp Music1f_endchannel
@@ -550,7 +550,7 @@ Music1f_octave: ; 7d4d3 (1f:54d3)
and $f0
cp $e0 ; is this command an octave?
jr nz, Music1f_unknownsfx0x20 ; no
- ld hl, $c0d6 ; yes
+ ld hl, wc0d6 ; yes
ld b, $0
add hl, bc
ld a, d
@@ -565,14 +565,14 @@ Music1f_unknownsfx0x20: ; 7d4e6 (1f:54e6)
cp CH3 ; is this a noise or sfx channel?
jr c, Music1f_unknownsfx0x10 ; no
ld b, $0
- ld hl, $c036
+ ld hl, wc036
add hl, bc
bit 0, [hl]
jr nz, Music1f_unknownsfx0x10 ; no
call Music1f_notelength ; yes
ld d, a
ld b, $0
- ld hl, $c03e
+ ld hl, wc03e
add hl, bc
ld a, [hl]
or d
@@ -611,7 +611,7 @@ Music1f_unknownsfx0x10 ; 7d533 (1f:5533)
cp $10 ; is this command an unknownsfx0x10?
jr nz, Music1f_note ; no
ld b, $0
- ld hl, $c036
+ ld hl, wc036
add hl, bc
bit 0, [hl]
jr nz, Music1f_note ; no
@@ -646,7 +646,7 @@ Music1f_dnote: ; 7d569 (1f:5569)
call Music1f_GetNextMusicByte ; get dnote instrument
asm_7d571
ld d, a
- ld a, [$c003]
+ ld a, [wc003]
and a
jr nz, .asm_7d57c
ld a, d
@@ -663,7 +663,7 @@ Music1f_notelength: ; 7d57e (1f:557e)
ld b, $0
ld e, a ; store note length (in 16ths)
ld d, b
- ld hl, $c0c6
+ ld hl, wc0c6
add hl, bc
ld a, [hl]
ld l, b
@@ -671,9 +671,9 @@ Music1f_notelength: ; 7d57e (1f:557e)
ld a, c
cp CH4
jr nc, .sfxChannel
- ld a, [$c0e8]
+ ld a, [wc0e8]
ld d, a
- ld a, [$c0e9]
+ ld a, [wc0e9]
ld e, a
jr .skip
.sfxChannel
@@ -682,31 +682,31 @@ Music1f_notelength: ; 7d57e (1f:557e)
cp CH7
jr z, .skip ; if noise channel
call Func_7d707
- ld a, [$c0ea]
+ ld a, [wc0ea]
ld d, a
- ld a, [$c0eb]
+ ld a, [wc0eb]
ld e, a
.skip
ld a, l
ld b, $0
- ld hl, $c0ce
+ ld hl, wc0ce
add hl, bc
ld l, [hl]
call Func_7d8bb
ld e, l
ld d, h
- ld hl, $c0ce
+ ld hl, wc0ce
add hl, bc
ld [hl], e
ld a, d
- ld hl, $c0b6
+ ld hl, wc0b6
add hl, bc
ld [hl], a
- ld hl, $c036
+ ld hl, wc036
add hl, bc
bit 0, [hl]
jr nz, Music1f_notepitch
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 2, [hl]
jr z, Music1f_notepitch
@@ -721,7 +721,7 @@ Music1f_notepitch: ; 7d5dc (1f:55dc)
ld a, c
cp CH4
jr nc, .sfxChannel
- ld hl, $c02a
+ ld hl, wc02a
add hl, bc
ld a, [hl]
and a
@@ -754,12 +754,12 @@ Music1f_notepitch: ; 7d5dc (1f:55dc)
.notRest
swap a
ld b, $0
- ld hl, $c0d6
+ ld hl, wc0d6
add hl, bc
ld b, [hl]
call Func_7d8cc
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 4, [hl]
jr z, .asm_7d62c
@@ -769,7 +769,7 @@ Music1f_notepitch: ; 7d5dc (1f:55dc)
ld a, c
cp CH4
jr nc, .skip ; if sfx Channel
- ld hl, $c02a
+ ld hl, wc02a
ld d, $0
ld e, a
add hl, de
@@ -782,7 +782,7 @@ Music1f_notepitch: ; 7d5dc (1f:55dc)
ret
.skip
ld b, $0
- ld hl, $c0de
+ ld hl, wc0de
add hl, bc
ld d, [hl]
ld b, $2
@@ -792,7 +792,7 @@ Music1f_notepitch: ; 7d5dc (1f:55dc)
call Func_7d66c
pop de
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 0, [hl]
jr z, .asm_7d663
@@ -800,7 +800,7 @@ Music1f_notepitch: ; 7d5dc (1f:55dc)
jr nc, .asm_7d663
inc d
.asm_7d663
- ld hl, $c066
+ ld hl, wc066
add hl, bc
ld [hl], e
call Func_7d6bf
@@ -818,13 +818,13 @@ Func_7d66c: ; 7d66c (1f:566c)
jr z, .sfxNoiseChannel
cp CH4
jr nc, .skip ; if sfx channel
- ld hl, $c02a
+ ld hl, wc02a
add hl, bc
ld a, [hl]
and a
jr nz, .skip
.sfxNoiseChannel
- ld a, [$c004]
+ ld a, [wc004]
ld hl, Unknown_7db9b
add hl, bc
and [hl]
@@ -842,7 +842,7 @@ Func_7d66c: ; 7d66c (1f:566c)
Func_7d69d: ; 7d69d (1f:569d)
ld b, $0
- ld hl, $c0b6
+ ld hl, wc0b6
add hl, bc
ld d, [hl]
ld a, c
@@ -853,7 +853,7 @@ Func_7d69d: ; 7d69d (1f:569d)
ld a, d
and $3f
ld d, a
- ld hl, $c03e
+ ld hl, wc03e
add hl, bc
ld a, [hl]
or d
@@ -873,10 +873,10 @@ Func_7d6bf: ; 7d6bf (1f:56bf)
; fall through
.channel3
push de
- ld de, $c0e6
+ ld de, wc0e6
cp CH2
jr z, .musicChannel3
- ld de, $c0e7
+ ld de, wc0e7
.musicChannel3
ld a, [de]
add a
@@ -919,27 +919,27 @@ Func_7d707: ; 7d707 (1f:5707)
call Func_7d759
jr nc, .asm_7d71f
ld d, $0
- ld a, [$c0f2]
+ ld a, [wc0f2]
add $80
jr nc, .asm_7d716
inc d
.asm_7d716
- ld [$c0eb], a
+ ld [wc0eb], a
ld a, d
- ld [$c0ea], a
+ ld [wc0ea], a
jr .asm_7d728
.asm_7d71f
xor a
- ld [$c0eb], a
+ ld [wc0eb], a
ld a, $1
- ld [$c0ea], a
+ ld [wc0ea], a
.asm_7d728
ret
Func_7d729: ; 7d729 (1f:5729)
call Func_7d759
jr nc, .asm_7d73a
- ld a, [$c0f1]
+ ld a, [wc0f1]
add e
jr nc, .asm_7d735
inc d
@@ -955,7 +955,7 @@ Func_7d729: ; 7d729 (1f:5729)
Func_7d73b: ; 7d73b (1f:573b)
call Func_7d759
jr nc, .asm_7d756
- ld hl, $c006
+ ld hl, wc006
ld e, c
ld d, $0
sla e
@@ -976,7 +976,7 @@ Func_7d73b: ; 7d73b (1f:573b)
ret
Func_7d759: ; 7d759 (1f:5759)
- ld a, [$c02a]
+ ld a, [wc02a]
cp $14
jr nc, .asm_7d762
jr .asm_7d768
@@ -993,27 +993,27 @@ Func_7d759: ; 7d759 (1f:5759)
ret
Music1f_ApplyPitchBend: ; 7d76d (1f:576d)
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
bit 5, [hl]
jp nz, .asm_7d7b4
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld e, [hl]
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld d, [hl]
- ld hl, $c07e
+ ld hl, wc07e
add hl, bc
ld l, [hl]
ld h, b
add hl, de
ld d, h
ld e, l
- ld hl, $c08e
+ ld hl, wc08e
add hl, bc
push hl
- ld hl, $c086
+ ld hl, wc086
add hl, bc
ld a, [hl]
pop hl
@@ -1025,26 +1025,26 @@ Music1f_ApplyPitchBend: ; 7d76d (1f:576d)
ld a, $0
adc d
ld d, a
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
ld a, [hl]
cp d
jp c, .asm_7d7fa
jr nz, .asm_7d7e7
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld a, [hl]
cp e
jp c, .asm_7d7fa
jr .asm_7d7e7
.asm_7d7b4
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld a, [hl]
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld d, [hl]
- ld hl, $c07e
+ ld hl, wc07e
add hl, bc
ld e, [hl]
sub e
@@ -1052,7 +1052,7 @@ Music1f_ApplyPitchBend: ; 7d76d (1f:576d)
ld a, d
sbc b
ld d, a
- ld hl, $c086
+ ld hl, wc086
add hl, bc
ld a, [hl]
add a
@@ -1063,22 +1063,22 @@ Music1f_ApplyPitchBend: ; 7d76d (1f:576d)
ld a, d
sbc b
ld d, a
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
ld a, d
cp [hl]
jr c, .asm_7d7fa
jr nz, .asm_7d7e7
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld a, e
cp [hl]
jr c, .asm_7d7fa
.asm_7d7e7
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld [hl], e
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld [hl], d
ld b, $3
@@ -1088,54 +1088,54 @@ Music1f_ApplyPitchBend: ; 7d76d (1f:576d)
ld [hl], d
ret
.asm_7d7fa
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
res 4, [hl]
res 5, [hl]
ret
Func_7d803: ; 7d803 (1f:5803)
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld [hl], d
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld [hl], e
- ld hl, $c0b6
+ ld hl, wc0b6
add hl, bc
ld a, [hl]
- ld hl, $c076
+ ld hl, wc076
add hl, bc
sub [hl]
jr nc, .asm_7d81b
ld a, $1
.asm_7d81b
ld [hl], a
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld a, e
sub [hl]
ld e, a
ld a, d
sbc b
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
sub [hl]
jr c, .asm_7d837
ld d, a
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 5, [hl]
jr .asm_7d85a
.asm_7d837
- ld hl, $c096
+ ld hl, wc096
add hl, bc
ld d, [hl]
- ld hl, $c09e
+ ld hl, wc09e
add hl, bc
ld e, [hl]
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, bc
ld a, [hl]
sub e
@@ -1143,17 +1143,17 @@ Func_7d803: ; 7d803 (1f:5803)
ld a, d
sbc b
ld d, a
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, bc
ld a, [hl]
sub d
ld d, a
ld b, $0
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
res 5, [hl]
.asm_7d85a
- ld hl, $c076
+ ld hl, wc076
add hl, bc
.asm_7d85e
inc b
@@ -1172,20 +1172,20 @@ Func_7d803: ; 7d803 (1f:5803)
add [hl]
ld d, b
ld b, $0
- ld hl, $c07e
+ ld hl, wc07e
add hl, bc
ld [hl], d
- ld hl, $c086
+ ld hl, wc086
add hl, bc
ld [hl], a
- ld hl, $c08e
+ ld hl, wc08e
add hl, bc
ld [hl], a
ret
Music1f_ApplyDutyCycle: ; 7d881 (1f:5881)
ld b, $0
- ld hl, $c046
+ ld hl, wc046
add hl, bc
ld a, [hl]
rlca
@@ -1206,7 +1206,7 @@ Music1f_GetNextMusicByte: ; 7d899 (1f:5899)
ld a, c
add a
ld e, a
- ld hl, $c006
+ ld hl, wc006
add hl, de
ld a, [hli]
ld e, a
@@ -1274,7 +1274,7 @@ Func_7d8cc: ; 7d8cc (1f:58cc)
ret
Func_7d8ea:: ; 7d8ea (1f:58ea)
- ld [$c001], a
+ ld [wc001], a
cp $ff
jp z, Func_7daa8
cp $c2
@@ -1285,63 +1285,63 @@ Func_7d8ea:: ; 7d8ea (1f:58ea)
jp nc, Func_7d9c2
.asm_7d901
xor a
- ld [$c000], a
- ld [$c003], a
- ld [$c0e9], a
- ld [$c0e6], a
- ld [$c0e7], a
+ ld [wc000], a
+ ld [wc003], a
+ ld [wc0e9], a
+ ld [wc0e6], a
+ ld [wc0e7], a
ld d, $8
- ld hl, $c016
+ ld hl, wc016
call FillMusicRAM1f
- ld hl, $c006
+ ld hl, wc006
call FillMusicRAM1f
ld d, $4
- ld hl, $c026
+ ld hl, wc026
call FillMusicRAM1f
- ld hl, $c02e
+ ld hl, wc02e
call FillMusicRAM1f
- ld hl, $c03e
+ ld hl, wc03e
call FillMusicRAM1f
- ld hl, $c046
+ ld hl, wc046
call FillMusicRAM1f
- ld hl, $c04e
+ ld hl, wc04e
call FillMusicRAM1f
- ld hl, $c056
+ ld hl, wc056
call FillMusicRAM1f
- ld hl, $c05e
+ ld hl, wc05e
call FillMusicRAM1f
- ld hl, $c066
+ ld hl, wc066
call FillMusicRAM1f
- ld hl, $c06e
+ ld hl, wc06e
call FillMusicRAM1f
- ld hl, $c036
+ ld hl, wc036
call FillMusicRAM1f
- ld hl, $c076
+ ld hl, wc076
call FillMusicRAM1f
- ld hl, $c07e
+ ld hl, wc07e
call FillMusicRAM1f
- ld hl, $c086
+ ld hl, wc086
call FillMusicRAM1f
- ld hl, $c08e
+ ld hl, wc08e
call FillMusicRAM1f
- ld hl, $c096
+ ld hl, wc096
call FillMusicRAM1f
- ld hl, $c09e
+ ld hl, wc09e
call FillMusicRAM1f
- ld hl, $c0a6
+ ld hl, wc0a6
call FillMusicRAM1f
- ld hl, $c0ae
+ ld hl, wc0ae
call FillMusicRAM1f
ld a, $1
- ld hl, $c0be
+ ld hl, wc0be
call FillMusicRAM1f
- ld hl, $c0b6
+ ld hl, wc0b6
call FillMusicRAM1f
- ld hl, $c0c6
+ ld hl, wc0c6
call FillMusicRAM1f
- ld [$c0e8], a
+ ld [wc0e8], a
ld a, $ff
- ld [$c004], a
+ ld [wc004], a
xor a
ld [$ff24], a
ld a, $8
@@ -1366,9 +1366,9 @@ Func_7d9c2: ; 7d9c2 (1f:59c2)
ld de, SFX_Headers_1f
add hl, de
ld a, h
- ld [$c0ec], a
+ ld [wc0ec], a
ld a, l
- ld [$c0ed], a
+ ld [wc0ed], a
ld a, [hl]
and $c0
rlca
@@ -1381,9 +1381,9 @@ Func_7d9c2: ; 7d9c2 (1f:59c2)
add c
ld c, a
ld b, $0
- ld a, [$c0ec]
+ ld a, [wc0ec]
ld h, a
- ld a, [$c0ed]
+ ld a, [wc0ed]
ld l, a
add hl, bc
ld c, d
@@ -1391,7 +1391,7 @@ Func_7d9c2: ; 7d9c2 (1f:59c2)
and $f
ld e, a
ld d, $0
- ld hl, $c026
+ ld hl, wc026
add hl, de
ld a, [hl]
and a
@@ -1399,7 +1399,7 @@ Func_7d9c2: ; 7d9c2 (1f:59c2)
ld a, e
cp $7
jr nz, .asm_7da0e
- ld a, [$c001]
+ ld a, [wc001]
cp $14
jr nc, .asm_7da07
ret
@@ -1409,7 +1409,7 @@ Func_7d9c2: ; 7d9c2 (1f:59c2)
jr z, .asm_7da17
jr c, .asm_7da17
.asm_7da0e
- ld a, [$c001]
+ ld a, [wc001]
cp [hl]
jr z, .asm_7da17
jr c, .asm_7da17
@@ -1422,77 +1422,77 @@ Func_7d9c2: ; 7d9c2 (1f:59c2)
add hl, hl
ld d, h
ld e, l
- ld hl, $c016
+ ld hl, wc016
add hl, de
ld [hli], a
ld [hl], a
- ld hl, $c006
+ ld hl, wc006
add hl, de
ld [hli], a
ld [hl], a
pop de
- ld hl, $c026
+ ld hl, wc026
add hl, de
ld [hl], a
- ld hl, $c02e
+ ld hl, wc02e
add hl, de
ld [hl], a
- ld hl, $c03e
+ ld hl, wc03e
add hl, de
ld [hl], a
- ld hl, $c046
+ ld hl, wc046
add hl, de
ld [hl], a
- ld hl, $c04e
+ ld hl, wc04e
add hl, de
ld [hl], a
- ld hl, $c056
+ ld hl, wc056
add hl, de
ld [hl], a
- ld hl, $c05e
+ ld hl, wc05e
add hl, de
ld [hl], a
- ld hl, $c066
+ ld hl, wc066
add hl, de
ld [hl], a
- ld hl, $c06e
+ ld hl, wc06e
add hl, de
ld [hl], a
- ld hl, $c076
+ ld hl, wc076
add hl, de
ld [hl], a
- ld hl, $c07e
+ ld hl, wc07e
add hl, de
ld [hl], a
- ld hl, $c086
+ ld hl, wc086
add hl, de
ld [hl], a
- ld hl, $c08e
+ ld hl, wc08e
add hl, de
ld [hl], a
- ld hl, $c096
+ ld hl, wc096
add hl, de
ld [hl], a
- ld hl, $c09e
+ ld hl, wc09e
add hl, de
ld [hl], a
- ld hl, $c0a6
+ ld hl, wc0a6
add hl, de
ld [hl], a
- ld hl, $c0ae
+ ld hl, wc0ae
add hl, de
ld [hl], a
- ld hl, $c036
+ ld hl, wc036
add hl, de
ld [hl], a
ld a, $1
- ld hl, $c0be
+ ld hl, wc0be
add hl, de
ld [hl], a
- ld hl, $c0b6
+ ld hl, wc0b6
add hl, de
ld [hl], a
- ld hl, $c0c6
+ ld hl, wc0c6
add hl, de
ld [hl], a
ld a, e
@@ -1526,24 +1526,24 @@ Func_7daa8: ; 7daa8 (1f:5aa8)
ld a, $77
ld [$ff24], a
xor a
- ld [$c000], a
- ld [$c003], a
- ld [$c002], a
- ld [$c0e9], a
- ld [$c0eb], a
- ld [$c0e6], a
- ld [$c0e7], a
+ ld [wc000], a
+ ld [wc003], a
+ ld [wc002], a
+ ld [wc0e9], a
+ ld [wc0eb], a
+ ld [wc0e6], a
+ ld [wc0e7], a
ld d, $a0
- ld hl, $c006
+ ld hl, wc006
call FillMusicRAM1f
ld a, $1
ld d, $18
- ld hl, $c0b6
+ ld hl, wc0b6
call FillMusicRAM1f
- ld [$c0e8], a
- ld [$c0ea], a
+ ld [wc0e8], a
+ ld [wc0ea], a
ld a, $ff
- ld [$c004], a
+ ld [wc004], a
ret
; fills d bytes at hl with a
@@ -1556,7 +1556,7 @@ FillMusicRAM1f: ; 7dafd (1f:5afd)
ret
Func_7db03: ; 7db03 (1f:5b03)
- ld a, [$c001]
+ ld a, [wc001]
ld l, a
ld e, a
ld h, $0
@@ -1567,7 +1567,7 @@ Func_7db03: ; 7db03 (1f:5b03)
add hl, de
ld e, l
ld d, h
- ld hl, $c006
+ ld hl, wc006
ld a, [de] ; get channel number
ld b, a
rlca
@@ -1593,14 +1593,14 @@ Func_7db03: ; 7db03 (1f:5b03)
push af
ld b, $0
ld c, a
- ld hl, $c026
+ ld hl, wc026
add hl, bc
- ld a, [$c001]
+ ld a, [wc001]
ld [hl], a
pop af
cp $3
jr c, .asm_7db46
- ld hl, $c02e
+ ld hl, wc02e
add hl, bc
set 2, [hl]
.asm_7db46
@@ -1619,32 +1619,32 @@ Func_7db03: ; 7db03 (1f:5b03)
ld a, [de]
inc de
jr nz, .asm_7db25
- ld a, [$c001]
+ ld a, [wc001]
cp $14
jr nc, .asm_7db5f
jr .asm_7db89
.asm_7db5f
- ld a, [$c001]
+ ld a, [wc001]
cp $86
jr z, .asm_7db89
jr c, .asm_7db6a
jr .asm_7db89
.asm_7db6a
- ld hl, $c02a
+ ld hl, wc02a
ld [hli], a
ld [hli], a
ld [hli], a
ld [hl], a
- ld hl, $c012 ; sfx noise channel pointer
+ ld hl, wc012 ; sfx noise channel pointer
ld de, Noise1f_endchannel
ld [hl], e
inc hl
ld [hl], d ; overwrite pointer to point to endchannel
- ld a, [$c005]
+ ld a, [wc005]
and a
jr nz, .asm_7db89
ld a, [$ff24]
- ld [$c005], a
+ ld [wc005], a
ld a, $77
ld [$ff24], a
.asm_7db89