summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorU-Fish-PC\Daniel <corrnondacqb@yahoo.com>2014-05-05 10:52:30 -0400
committerU-Fish-PC\Daniel <corrnondacqb@yahoo.com>2014-05-05 10:53:18 -0400
commit3204566c925b23db1eb92e8fcc2b9b2df477d58b (patch)
tree49bfbffaf06062c3ad32224d4899670489ea099f
parent69f45cb1e09518c6ada46f7b7cb11c79f14e84da (diff)
Add music wram labels
-rw-r--r--audio/music/battletheme1.asm4
-rw-r--r--audio/music/battletheme2.asm4
-rw-r--r--audio/music/battletheme3.asm6
-rw-r--r--audio/music/boosterpack.asm4
-rw-r--r--audio/music/challengehall.asm8
-rw-r--r--audio/music/club1.asm20
-rw-r--r--audio/music/club2.asm2
-rw-r--r--audio/music/club3.asm4
-rw-r--r--audio/music/credits.asm4
-rw-r--r--audio/music/hallofhonor.asm2
-rw-r--r--audio/music/imakuni.asm6
-rw-r--r--audio/music/matchloss.asm4
-rw-r--r--audio/music/matchvictory.asm4
-rw-r--r--audio/music/medal.asm4
-rw-r--r--audio/music/overworld.asm4
-rw-r--r--audio/music/pokemondome.asm4
-rw-r--r--audio/music/ronald.asm4
-rw-r--r--audio/music/titlescreen.asm4
-rwxr-xr-xengine/music1.asm211
-rwxr-xr-xengine/music2.asm211
-rwxr-xr-xmacros.asm2
-rwxr-xr-xwram.asm60
22 files changed, 312 insertions, 264 deletions
diff --git a/audio/music/battletheme1.asm b/audio/music/battletheme1.asm
index 50f5b71..5fb5eb6 100644
--- a/audio/music/battletheme1.asm
+++ b/audio/music/battletheme1.asm
@@ -1,7 +1,7 @@
Music_BattleTheme1_Ch1: ; f532a (3d:532a)
speed 7
musicdc 17
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 20
musice8 8
duty 2
@@ -512,7 +512,7 @@ Branch_f5580:
Music_BattleTheme1_Ch2: ; f55e7 (3d:55e7)
speed 7
musicdc 17
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 20
musice8 8
MainLoop
diff --git a/audio/music/battletheme2.asm b/audio/music/battletheme2.asm
index 7d78c8a..2b66f0d 100644
--- a/audio/music/battletheme2.asm
+++ b/audio/music/battletheme2.asm
@@ -1,7 +1,7 @@
Music_BattleTheme2_Ch1: ; f5d68 (3d:5d68)
speed 9
musicdc 17
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 20
musice8 8
octave 1
@@ -432,7 +432,7 @@ Branch_f5f90:
Music_BattleTheme2_Ch2: ; f5fad (3d:5fad)
speed 9
musicdc 17
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 15
musice8 8
octave 2
diff --git a/audio/music/battletheme3.asm b/audio/music/battletheme3.asm
index e499484..695e698 100644
--- a/audio/music/battletheme3.asm
+++ b/audio/music/battletheme3.asm
@@ -1,7 +1,7 @@
Music_BattleTheme3_Ch1: ; f63a1 (3d:63a1)
speed 11
musicdc 17
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 20
musice8 8
MainLoop
@@ -476,7 +476,7 @@ Branch_f661d:
Music_BattleTheme3_Ch2: ; f6649 (3d:6649)
speed 11
musicdc 17
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 20
musice8 8
MainLoop
@@ -913,7 +913,7 @@ Music_BattleTheme3_Ch3: ; f68c2 (3d:68c2)
volume 32
wave 1
musice9 96
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 0
musice8 8
MainLoop
diff --git a/audio/music/boosterpack.asm b/audio/music/boosterpack.asm
index d169785..e872fb8 100644
--- a/audio/music/boosterpack.asm
+++ b/audio/music/boosterpack.asm
@@ -1,6 +1,6 @@
Music_BoosterPack_Ch1: ; f7d60 (3d:7d60)
musicdc 17
- vibrato_rate 1
+ vibrato_type 1
vibrato_delay 20
musice8 8
octave 4
@@ -45,7 +45,7 @@ Music_BoosterPack_Ch1: ; f7d60 (3d:7d60)
Music_BoosterPack_Ch2: ; f7d9e (3d:7d9e)
musicdc 17
- vibrato_rate 1
+ vibrato_type 1
vibrato_delay 20
musice8 8
octave 3
diff --git a/audio/music/challengehall.asm b/audio/music/challengehall.asm
index c48e381..d133e50 100644
--- a/audio/music/challengehall.asm
+++ b/audio/music/challengehall.asm
@@ -1,6 +1,6 @@
Music_ChallengeHall_Ch1: ; f9646 (3e:5646)
musicdc 17
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 15
musice8 7
octave 3
@@ -402,7 +402,7 @@ Branch_f9848:
Music_ChallengeHall_Ch2: ; f9883 (3e:5883)
musicdc 17
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 15
musice8 7
octave 3
@@ -569,7 +569,7 @@ Music_ChallengeHall_Ch2: ; f9883 (3e:5883)
note B_, 7
inc_octave
inc_octave
- vibrato_rate 1
+ vibrato_type 1
duty 2
volume 80
note B_, 8
@@ -579,7 +579,7 @@ Music_ChallengeHall_Ch2: ; f9883 (3e:5883)
volume 39
speed 1
note C#, 15
- vibrato_rate 8
+ vibrato_type 8
duty 0
volume 112
octave 2
diff --git a/audio/music/club1.asm b/audio/music/club1.asm
index e16d946..d3592b5 100644
--- a/audio/music/club1.asm
+++ b/audio/music/club1.asm
@@ -1,7 +1,7 @@
Music_Club1_Ch1: ; f9be5 (3e:5be5)
speed 5
musicdc 17
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 20
musice8 8
octave 3
@@ -50,11 +50,11 @@ Music_Club1_Ch1: ; f9be5 (3e:5be5)
note B_, 1
inc_octave
note C_, 1
- vibrato_rate 1
+ vibrato_type 1
vibrato_delay 10
note C#, 4
dec_octave
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 20
note A_, 2
inc_octave
@@ -116,7 +116,7 @@ Music_Club1_Ch1: ; f9be5 (3e:5be5)
rest 2
dec_octave
note A_, 2
- vibrato_rate 1
+ vibrato_type 1
duty 2
volume 80
inc_octave
@@ -126,7 +126,7 @@ Music_Club1_Ch1: ; f9be5 (3e:5be5)
note C#, 5
dec_octave
dec_octave
- vibrato_rate 8
+ vibrato_type 8
duty 0
volume 160
note A_, 4
@@ -292,7 +292,7 @@ Music_Club1_Ch1: ; f9be5 (3e:5be5)
Music_Club1_Ch2: ; f9d5f (3e:5d5f)
speed 5
musicdc 17
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 20
musice8 7
octave 2
@@ -369,7 +369,7 @@ Music_Club1_Ch2: ; f9d5f (3e:5d5f)
volume 147
note E_, 4
rest 2
- vibrato_rate 1
+ vibrato_type 1
duty 2
volume 80
octave 5
@@ -409,7 +409,7 @@ Music_Club1_Ch2: ; f9d5f (3e:5d5f)
rest 2
volume 147
note C#, 2
- vibrato_rate 8
+ vibrato_type 8
volume 96
note D#, 4
note E_, 6
@@ -417,7 +417,7 @@ Music_Club1_Ch2: ; f9d5f (3e:5d5f)
note E_, 2
inc_octave
inc_octave
- vibrato_rate 1
+ vibrato_type 1
duty 2
volume 80
note C#, 1
@@ -502,7 +502,7 @@ Music_Club1_Ch2: ; f9d5f (3e:5d5f)
note E_, 2
rest 4
dec_octave
- vibrato_rate 8
+ vibrato_type 8
duty 0
volume 96
note A#, 2
diff --git a/audio/music/club2.asm b/audio/music/club2.asm
index 12432ff..e1e5df1 100644
--- a/audio/music/club2.asm
+++ b/audio/music/club2.asm
@@ -211,7 +211,7 @@ Music_Club2_Ch3: ; fa164 (3e:6164)
volume 32
musicdc 17
wave 0
- vibrato_rate 4
+ vibrato_type 4
vibrato_delay 35
musice8 6
musice9 64
diff --git a/audio/music/club3.asm b/audio/music/club3.asm
index 98719f7..d299e3e 100644
--- a/audio/music/club3.asm
+++ b/audio/music/club3.asm
@@ -1,7 +1,7 @@
Music_Club3_Ch1: ; fa210 (3e:6210)
speed 9
musicdc 17
- vibrato_rate 5
+ vibrato_type 5
vibrato_delay 20
musice8 8
MainLoop
@@ -435,7 +435,7 @@ Branch_fa403:
Music_Club3_Ch2: ; fa423 (3e:6423)
speed 9
musicdc 17
- vibrato_rate 5
+ vibrato_type 5
vibrato_delay 20
musice8 8
MainLoop
diff --git a/audio/music/credits.asm b/audio/music/credits.asm
index 73bd868..54075e3 100644
--- a/audio/music/credits.asm
+++ b/audio/music/credits.asm
@@ -1,7 +1,7 @@
Music_Credits_Ch1: ; fb1fe (3e:71fe)
speed 13
musicdc 17
- vibrato_rate 1
+ vibrato_type 1
vibrato_delay 20
musice8 8
octave 2
@@ -851,7 +851,7 @@ Branch_fb651:
Music_Credits_Ch2: ; fb68a (3e:768a)
musicdc 17
- vibrato_rate 1
+ vibrato_type 1
vibrato_delay 20
musice8 8
duty 1
diff --git a/audio/music/hallofhonor.asm b/audio/music/hallofhonor.asm
index 92777ab..06bd193 100644
--- a/audio/music/hallofhonor.asm
+++ b/audio/music/hallofhonor.asm
@@ -175,7 +175,7 @@ Music_HallOfHonor_Ch3: ; fb0d5 (3e:70d5)
volume 64
musicdc 17
wave 2
- vibrato_rate 4
+ vibrato_type 4
vibrato_delay 35
musice8 6
musice9 64
diff --git a/audio/music/imakuni.asm b/audio/music/imakuni.asm
index 1887a88..667e581 100644
--- a/audio/music/imakuni.asm
+++ b/audio/music/imakuni.asm
@@ -1,7 +1,7 @@
Music_Imakuni_Ch1: ; fad55 (3e:6d55)
speed 3
musicdc 17
- vibrato_rate 5
+ vibrato_type 5
vibrato_delay 20
musice8 8
duty 2
@@ -187,7 +187,7 @@ Branch_fae1d:
Music_Imakuni_Ch2: ; fae32 (3e:6e32)
musicdc 17
- vibrato_rate 0
+ vibrato_type 0
vibrato_delay 0
musice8 8
duty 1
@@ -295,7 +295,7 @@ Music_Imakuni_Ch3: ; faebc (3e:6ebc)
musicdc 17
volume 32
wave 1
- vibrato_rate 6
+ vibrato_type 6
vibrato_delay 0
musice9 0
musice8 8
diff --git a/audio/music/matchloss.asm b/audio/music/matchloss.asm
index 101f3ab..b402792 100644
--- a/audio/music/matchloss.asm
+++ b/audio/music/matchloss.asm
@@ -1,6 +1,6 @@
Music_MatchLoss_Ch1: ; f7c2e (3d:7c2e)
musicdc 17
- vibrato_rate 1
+ vibrato_type 1
vibrato_delay 20
musice8 8
octave 4
@@ -66,7 +66,7 @@ Music_MatchLoss_Ch1: ; f7c2e (3d:7c2e)
Music_MatchLoss_Ch2: ; f7c87 (3d:7c87)
musicdc 17
- vibrato_rate 5
+ vibrato_type 5
vibrato_delay 20
musice8 8
octave 3
diff --git a/audio/music/matchvictory.asm b/audio/music/matchvictory.asm
index 7e78648..1fe2ca5 100644
--- a/audio/music/matchvictory.asm
+++ b/audio/music/matchvictory.asm
@@ -1,6 +1,6 @@
Music_MatchVictory_Ch1: ; f7b61 (3d:7b61)
musicdc 17
- vibrato_rate 1
+ vibrato_type 1
vibrato_delay 20
musice8 8
octave 3
@@ -55,7 +55,7 @@ Music_MatchVictory_Ch1: ; f7b61 (3d:7b61)
Music_MatchVictory_Ch2: ; f7bb0 (3d:7bb0)
musicdc 17
- vibrato_rate 1
+ vibrato_type 1
vibrato_delay 20
musice8 8
octave 3
diff --git a/audio/music/medal.asm b/audio/music/medal.asm
index babc358..7499bd1 100644
--- a/audio/music/medal.asm
+++ b/audio/music/medal.asm
@@ -1,6 +1,6 @@
Music_Medal_Ch1: ; f7df8 (3d:7df8)
musicdc 17
- vibrato_rate 1
+ vibrato_type 1
vibrato_delay 20
musice8 8
octave 2
@@ -64,7 +64,7 @@ Music_Medal_Ch1: ; f7df8 (3d:7df8)
Music_Medal_Ch2: ; f7e4b (3d:7e4b)
musicdc 17
- vibrato_rate 1
+ vibrato_type 1
vibrato_delay 20
musice8 8
octave 1
diff --git a/audio/music/overworld.asm b/audio/music/overworld.asm
index bd86a95..32508fd 100644
--- a/audio/music/overworld.asm
+++ b/audio/music/overworld.asm
@@ -2,7 +2,7 @@ Music_Overworld_Ch1: ; f71a0 (3d:71a0)
speed 7
duty 0
musicdc 17
- vibrato_rate 9
+ vibrato_type 9
vibrato_delay 25
volume 162
musice8 7
@@ -289,7 +289,7 @@ Music_Overworld_Ch2: ; f7334 (3d:7334)
speed 7
duty 0
musicdc 17
- vibrato_rate 9
+ vibrato_type 9
vibrato_delay 30
musice8 7
octave 3
diff --git a/audio/music/pokemondome.asm b/audio/music/pokemondome.asm
index 744160c..e682f71 100644
--- a/audio/music/pokemondome.asm
+++ b/audio/music/pokemondome.asm
@@ -1,7 +1,7 @@
Music_PokemonDome_Ch1: ; f9251 (3e:5251)
speed 7
musicdc 17
- vibrato_rate 9
+ vibrato_type 9
vibrato_delay 20
musice8 8
octave 2
@@ -312,7 +312,7 @@ Music_PokemonDome_Ch1: ; f9251 (3e:5251)
Music_PokemonDome_Ch2: ; f93f8 (3e:53f8)
speed 7
musicdc 17
- vibrato_rate 9
+ vibrato_type 9
vibrato_delay 20
musice8 8
octave 1
diff --git a/audio/music/ronald.asm b/audio/music/ronald.asm
index d3e02c1..126c29d 100644
--- a/audio/music/ronald.asm
+++ b/audio/music/ronald.asm
@@ -1,6 +1,6 @@
Music_Ronald_Ch1: ; fa7a0 (3e:67a0)
musicdc 17
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 12
musice8 8
duty 0
@@ -509,7 +509,7 @@ Branch_fa9ec:
Music_Ronald_Ch2: ; faa0e (3e:6a0e)
musicdc 17
- vibrato_rate 8
+ vibrato_type 8
vibrato_delay 12
musice8 8
duty 0
diff --git a/audio/music/titlescreen.asm b/audio/music/titlescreen.asm
index 371568f..a17d954 100644
--- a/audio/music/titlescreen.asm
+++ b/audio/music/titlescreen.asm
@@ -2,7 +2,7 @@ Music_TitleScreen_Ch1: ; f5052 (3d:5052)
speed 7
duty 0
musicdc 17
- vibrato_rate 1
+ vibrato_type 1
vibrato_delay 20
volume 160
musice8 8
@@ -224,7 +224,7 @@ Music_TitleScreen_Ch2: ; f5193 (3d:5193)
speed 7
duty 0
musicdc 17
- vibrato_rate 1
+ vibrato_type 1
vibrato_delay 20
volume 128
musice8 8
diff --git a/engine/music1.asm b/engine/music1.asm
index b478b13..eca0613 100755
--- a/engine/music1.asm
+++ b/engine/music1.asm
@@ -123,28 +123,28 @@ Func_f407d: ; f407d (3d:407d)
xor a
ld [$dd8c], a
ld [$de53], a
- ld [$dd8b], a
+ ld [wMusicWaveChange], a
ld [$ddef], a
ld [$ddf0], a
ld [$ddf2], a
dec a
- ld [$dd84], a
+ ld [wMusicDC], a
ld de, $0001
ld bc, $0000
.asm_f40bb
- ld hl, $dd8d
+ ld hl, wMusicIsPlaying
add hl, bc
ld [hl], d
- ld hl, $dd91
+ ld hl, wMusicTie
add hl, bc
ld [hl], d
ld hl, $ddb3
add hl, bc
ld [hl], d
- ld hl, $ddcb
+ ld hl, wMusicEC
add hl, bc
ld [hl], d
- ld hl, $ddbf
+ ld hl, wMusicE8
add hl, bc
ld [hl], d
inc c
@@ -152,7 +152,7 @@ Func_f407d: ; f407d (3d:407d)
cp $4
jr nz, .asm_f40bb
ld hl, Unknown_f4c20
- ld bc, $ddf3
+ ld bc, wMusicReturnAddress
ld d, $8
.asm_f40e2
ld a, [hli]
@@ -212,7 +212,7 @@ Func_f414b: ; f414b (3d:414b)
ld a, [$dd8c]
ld d, a
xor a
- ld [$dd8d], a
+ ld [wMusicIsPlaying], a
bit 0, d
jr nz, .asm_f415f
ld a, $8
@@ -277,26 +277,26 @@ Music1_PlaySong: ; f418c (3d:418c)
ld a, [bc]
inc bc
ld [$dd95], a
- ld [$dd9d], a
+ ld [wMusicMainLoop], a
ld a, [bc]
inc bc
ld [$dd96], a
ld [$dd9e], a
ld a, $1
ld [$ddbb], a
- ld [$dd8d], a
+ ld [wMusicIsPlaying], a
xor a
- ld [$dd91], a
- ld [$ddea], a
- ld [$ddbf], a
- ld [$dddf], a
- ld [$ddcb], a
+ ld [wMusicTie], a
+ ld [wMusicE4], a
+ ld [wMusicE8], a
+ ld [wMusicVibratoDelay], a
+ ld [wMusicEC], a
ld a, [Unknown_f4c20]
- ld [$ddf3], a
+ ld [wMusicReturnAddress], a
ld a, [Unknown_f4c20 + 1]
ld [$ddf4], a
ld a, $8
- ld [$ddc7], a
+ ld [wMusicE9], a
.asm_f41eb
rr e
jr nc, .asm_f4228
@@ -383,7 +383,7 @@ Func_f42a4: ; f42a4 (3d:42a4)
ret
Func_f42a5: ; f42a5 (3d:42a5)
- ld a, [$dd8d]
+ ld a, [wMusicIsPlaying]
or a
jr z, .asm_f42fa
ld a, [$ddb7]
@@ -400,7 +400,7 @@ Func_f42a5: ; f42a5 (3d:42a5)
bit 0, a
jr nz, .asm_f42d4
ld hl, $ff12
- ld a, [$ddc7]
+ ld a, [wMusicE9]
ld [hli], a
inc hl
ld a, $80
@@ -416,7 +416,7 @@ Func_f42a5: ; f42a5 (3d:42a5)
ld l, a
ld bc, $0000
call Music1_PlayNextNote
- ld a, [$dd8d]
+ ld a, [wMusicIsPlaying]
or a
jr z, .asm_f42fa
call Func_f4714
@@ -622,7 +622,7 @@ Music1_CommandTable: ; f442c (3d:442c)
dw Music1_wave
dw Music1_musice8
dw Music1_musice9
- dw Music1_vibrato_rate
+ dw Music1_vibrato_type
dw Music1_vibrato_delay
dw Music1_musicec
dw Music1_musiced
@@ -649,7 +649,7 @@ Music1_note: ; f448c (3d:448c)
push af
ld a, [hl]
ld e, a
- ld hl, $dd91
+ ld hl, wMusicTie
add hl, bc
ld a, [hl]
cp $80
@@ -663,16 +663,16 @@ Music1_note: ; f448c (3d:448c)
add hl, bc
ld [hl], a
inc [hl]
- ld hl, $ddd7
+ ld hl, wMusicVibratoType2
add hl, bc
ld a, [hl]
- ld hl, $ddd3
+ ld hl, wMusicVibratoType
add hl, bc
ld [hl], a
.asm_f44b0
pop af
push de
- ld hl, $ddcf
+ ld hl, wMusicSpeed
add hl, bc
ld d, [hl]
and $f
@@ -700,7 +700,7 @@ Music1_note: ; f448c (3d:448c)
ld a, d
jr z, .asm_f44fb
ld e, a
- ld hl, $ddbf
+ ld hl, wMusicE8
add hl, bc
ld a, [hl]
cp $8
@@ -748,7 +748,7 @@ Music1_note: ; f448c (3d:448c)
jr .asm_f4564
.asm_f451a
push af
- ld hl, $ddaf
+ ld hl, wMusicOctave
add hl, bc
ld a, [hl]
ld d, a
@@ -772,10 +772,10 @@ Music1_note: ; f448c (3d:448c)
ld l, a
ld a, [hli]
ld d, a
- ld a, [$dd84]
+ ld a, [wMusicDC]
and $77
or d
- ld [$dd84], a
+ ld [wMusicDC], a
ld de, $ddab
ld a, [hli]
ld [de], a
@@ -804,7 +804,7 @@ Music1_note: ; f448c (3d:448c)
add hl, bc
add hl, bc
push hl
- ld hl, $ddaf
+ ld hl, wMusicOctave
add hl, bc
ld e, [hl]
ld d, $0
@@ -813,7 +813,7 @@ Music1_note: ; f448c (3d:448c)
add a
ld e, [hl]
add e
- ld hl, $ddcb
+ ld hl, wMusicEC
add hl, bc
ld e, [hl]
add e
@@ -843,7 +843,7 @@ Music1_speed: ; f4598 (3d:4598)
pop hl
ld a, [hli]
push hl
- ld hl, $ddcf
+ ld hl, wMusicSpeed
add hl, bc
ld [hl], a
jp Music1_PlayNextNote_pop
@@ -851,7 +851,7 @@ Music1_speed: ; f4598 (3d:4598)
Music1_octave: ; f45a3 (3d:45a3)
and $7
dec a
- ld hl, $ddaf
+ ld hl, wMusicOctave
add hl, bc
push af
ld a, c
@@ -867,19 +867,19 @@ Music1_octave: ; f45a3 (3d:45a3)
jp Music1_PlayNextNote_pop
Music1_inc_octave: ; f45bb (3d:45bb)
- ld hl, $ddaf
+ ld hl, wMusicOctave
add hl, bc
inc [hl]
jp Music1_PlayNextNote_pop
Music1_dec_octave: ; f45c3 (3d:45c3)
- ld hl, $ddaf
+ ld hl, wMusicOctave
add hl, bc
dec [hl]
jp Music1_PlayNextNote_pop
Music1_tie: ; f45cb (3d:45cb)
- ld hl, $dd91
+ ld hl, wMusicTie
add hl, bc
ld [hl], $80
jp Music1_PlayNextNote_pop
@@ -899,7 +899,7 @@ Music1_musicdc: ; f45d4 (3d:45d4)
jr .asm_f45db
.asm_f45e3
ld d, a
- ld hl, $dd84
+ ld hl, wMusicDC
ld a, [hl]
and e
or d
@@ -911,7 +911,7 @@ Music1_MainLoop: ; f45ef (3d:45ef)
pop de
push de
dec de
- ld hl, $dd9d
+ ld hl, wMusicMainLoop
add hl, bc
add hl, bc
ld [hl], e
@@ -921,7 +921,7 @@ Music1_MainLoop: ; f45ef (3d:45ef)
Music1_EndMainLoop: ; f45fd (3d:45fd)
pop hl
- ld hl, $dd9d
+ ld hl, wMusicMainLoop
add hl, bc
add hl, bc
ld a, [hli]
@@ -1008,7 +1008,7 @@ Music1_musice4: ; f4667 (3d:4667)
pop de
ld a, [de]
inc de
- ld hl, $ddea
+ ld hl, wMusicE4
add hl, bc
ld [hl], a
ld h, d
@@ -1020,7 +1020,7 @@ Music1_duty: ; f4674 (3d:4674)
ld a, [de]
and $c0
inc de
- ld hl, $dd86
+ ld hl, wMusicDuty
add hl, bc
ld [hl], a
ld h, d
@@ -1031,7 +1031,7 @@ Music1_volume: ; f4683 (3d:4683)
pop de
ld a, [de]
inc de
- ld hl, $dde7
+ ld hl, wMusicVolume
add hl, bc
ld [hl], a
ld h, d
@@ -1042,9 +1042,9 @@ Music1_wave: ; f4690 (3d:4690)
pop de
ld a, [de]
inc de
- ld [$dd8a], a
+ ld [wMusicWave], a
ld a, $1
- ld [$dd8b], a
+ ld [wMusicWaveChange], a
ld h, d
ld l, e
jp Music1_PlayNextNote
@@ -1053,7 +1053,7 @@ Music1_musice8: ; f46a0 (3d:46a0)
pop de
ld a, [de]
inc de
- ld hl, $ddbf
+ ld hl, wMusicE8
add hl, bc
ld [hl], a
ld h, d
@@ -1064,21 +1064,21 @@ Music1_musice9: ; f46ad (3d:46ad)
pop de
ld a, [de]
inc de
- ld hl, $ddc7
+ ld hl, wMusicE9
add hl, bc
ld [hl], a
ld h, d
ld l, e
jp Music1_PlayNextNote
-Music1_vibrato_rate: ; f46ba (3d:46ba)
+Music1_vibrato_type: ; f46ba (3d:46ba)
pop de
ld a, [de]
inc de
- ld hl, $ddd3
+ ld hl, wMusicVibratoType
add hl, bc
ld [hl], a
- ld hl, $ddd7
+ ld hl, wMusicVibratoType2
add hl, bc
ld [hl], a
ld h, d
@@ -1089,7 +1089,7 @@ Music1_vibrato_delay: ; f46cc (3d:46cc)
pop de
ld a, [de]
inc de
- ld hl, $dddf
+ ld hl, wMusicVibratoDelay
add hl, bc
ld [hl], a
ld h, d
@@ -1100,7 +1100,7 @@ Music1_musicec: ; f46d9 (3d:46d9)
pop de
ld a, [de]
inc de
- ld hl, $ddcb
+ ld hl, wMusicEC
add hl, bc
ld [hl], a
ld h, d
@@ -1111,7 +1111,7 @@ Music1_musiced: ; f46e6 (3d:46e6)
pop de
ld a, [de]
inc de
- ld hl, $ddcb
+ ld hl, wMusicEC
add hl, bc
add [hl]
ld [hl], a
@@ -1120,7 +1120,7 @@ Music1_musiced: ; f46e6 (3d:46e6)
jp Music1_PlayNextNote
Music1_end: ; f46f4 (3d:46f4)
- ld hl, $dd8d
+ ld hl, wMusicIsPlaying
add hl, bc
ld [hl], $0
pop hl
@@ -1129,7 +1129,7 @@ Music1_end: ; f46f4 (3d:46f4)
; returns the address where the address to
; return to is stored for the current channel
Music1_GetReturnAddress: ; f46fc (3d:46fc)
- ld hl, $ddf3
+ ld hl, wMusicReturnAddress
add hl, bc
add hl, bc
ld a, [hli]
@@ -1139,13 +1139,10 @@ Music1_GetReturnAddress: ; f46fc (3d:46fc)
; puts the address in hl where the address to
; return to is stored for the currentchannel
-; since this function is used for loops and calls, a song
-; should not use a loop inside a called piece of music
-; or call a piece of music inside a loop
Music1_SetReturnAddress: ; f4705 (3d:4705)
ld d, h
ld e, l
- ld hl, $ddf3
+ ld hl, wMusicReturnAddress
add hl, bc
add hl, bc
ld [hl], e
@@ -1165,18 +1162,18 @@ Func_f4714: ; f4714 (3d:4714)
cp $0
jr z, .asm_f474a
ld d, $0
- ld hl, $dd91
+ ld hl, wMusicTie
ld a, [hl]
cp $80
jr z, .asm_f4733
- ld a, [$dde7]
+ ld a, [wMusicVolume]
ld [$ff12], a
ld d, $80
.asm_f4733
ld [hl], $2
ld a, $8
ld [$ff10], a
- ld a, [$dd86]
+ ld a, [wMusicDuty]
ld [$ff11], a
ld a, [$dda5]
ld [$ff13], a
@@ -1186,7 +1183,7 @@ Func_f4714: ; f4714 (3d:4714)
.asm_f4749
ret
.asm_f474a
- ld hl, $dd91
+ ld hl, wMusicTie
ld [hl], $0
ld hl, $ff12
ld a, $8
@@ -1238,7 +1235,7 @@ Func_f479c: ; f479c (3d:479c)
bit 2, a
jr nz, .asm_f47e0
ld d, $0
- ld a, [$dd8b]
+ ld a, [wMusicWaveChange]
or a
jr z, .asm_f47b3
xor a
@@ -1272,14 +1269,14 @@ Func_f479c: ; f479c (3d:479c)
.asm_f47e0
ret
.asm_f47e1
- ld hl, $dd91
+ ld hl, wMusicTie
ld [hl], $0
xor a
ld [$ff1a], a
ret
Func_f47ea: ; f479c (3d:47ea)
- ld a, [$dd8a]
+ ld a, [wMusicWave]
add a
ld d, $0
ld e, a
@@ -1299,7 +1296,7 @@ Func_f47ea: ; f479c (3d:47ea)
cp $10
jr nz, .asm_f47fc
xor a
- ld [$dd8b], a
+ ld [wMusicWaveChange], a
ret
Func_f480a: ; f480a (3d:480a)
@@ -1374,7 +1371,7 @@ Func_f4866: ; f4866 (3d:4866)
ld [$ff24], a
ld a, [$dd8c]
or a
- ld hl, $dd84
+ ld hl, wMusicDC
ld a, [hli]
jr z, .asm_f4888
ld a, [$dd8c]
@@ -1404,7 +1401,7 @@ Func_f4866: ; f4866 (3d:4866)
ret
Func_f4898: ; f4898 (3d:4898)
- ld hl, $dddf
+ ld hl, wMusicVibratoDelay
add hl, bc
ld a, [hl]
cp $0
@@ -1416,7 +1413,7 @@ Func_f4898: ; f4898 (3d:4898)
inc [hl]
jr .asm_f4902
.asm_f48ab
- ld hl, $ddd3
+ ld hl, wMusicVibratoType
add hl, bc
ld e, [hl]
ld d, $0
@@ -1475,7 +1472,7 @@ Func_f4898: ; f4898 (3d:4898)
ld a, [hl]
cp $80
jr z, .asm_f48ab
- ld hl, $ddd3
+ ld hl, wMusicVibratoType
add hl, bc
ld [hl], a
jr .asm_f48ab
@@ -1491,7 +1488,7 @@ Func_f4898: ; f4898 (3d:4898)
Func_f490b: ; f490b (3d:490b)
cp $0
jr nz, .asm_f492c
- ld a, [$dddf]
+ ld a, [wMusicVibratoDelay]
cp $0
jr z, .asm_f4966
ld a, [$dd8c]
@@ -1542,7 +1539,7 @@ Func_f490b: ; f490b (3d:490b)
ret
Func_f4967: ; f4967 (3d:4967)
- ld hl, $ddea
+ ld hl, wMusicE4
add hl, bc
ld a, [hl]
bit 7, a
@@ -1596,7 +1593,7 @@ Func_f4980: ; f4980 (3d:4980)
ret
Func_f49b1: ; f49b1 (3d:49b1)
- ld hl, $dd8d
+ ld hl, wMusicIsPlaying
xor a
add [hl]
inc hl
@@ -1632,21 +1629,21 @@ Func_f49dc: ; f49dc (3d:49dc)
ld [$de55], a
ld a, [$dd81]
ld [$de56], a
- ld a, [$dd84]
+ ld a, [wMusicDC]
ld [$de57], a
- ld hl, $dd86
+ ld hl, wMusicDuty
ld de, $de58
ld a, $4
call Music1_CopyData
- ld a, [$dd8a]
+ ld a, [wMusicWave]
ld [$de5c], a
- ld a, [$dd8b]
+ ld a, [wMusicWaveChange]
ld [$de5d], a
- ld hl, $dd8d
+ ld hl, wMusicIsPlaying
ld de, $de5e
ld a, $4
call Music1_CopyData
- ld hl, $dd91
+ ld hl, wMusicTie
ld de, $de62
ld a, $4
call Music1_CopyData
@@ -1654,7 +1651,7 @@ Func_f49dc: ; f49dc (3d:49dc)
ld de, $de66
ld a, $8
call Music1_CopyData
- ld hl, $dd9d
+ ld hl, wMusicMainLoop
ld de, $de6e
ld a, $8
call Music1_CopyData
@@ -1662,7 +1659,7 @@ Func_f49dc: ; f49dc (3d:49dc)
ld [$de76], a
ld a, [$ddac]
ld [$de77], a
- ld hl, $ddaf
+ ld hl, wMusicOctave
ld de, $de78
ld a, $4
call Music1_CopyData
@@ -1678,7 +1675,7 @@ Func_f49dc: ; f49dc (3d:49dc)
ld de, $de84
ld a, $4
call Music1_CopyData
- ld hl, $ddbf
+ ld hl, wMusicE8
ld de, $de88
ld a, $4
call Music1_CopyData
@@ -1686,23 +1683,23 @@ Func_f49dc: ; f49dc (3d:49dc)
ld de, $de8c
ld a, $4
call Music1_CopyData
- ld hl, $ddc7
+ ld hl, wMusicE9
ld de, $de90
ld a, $4
call Music1_CopyData
- ld hl, $ddcb
+ ld hl, wMusicEC
ld de, $de94
ld a, $4
call Music1_CopyData
- ld hl, $ddcf
+ ld hl, wMusicSpeed
ld de, $de98
ld a, $4
call Music1_CopyData
- ld hl, $ddd7
+ ld hl, wMusicVibratoType2
ld de, $de9c
ld a, $4
call Music1_CopyData
- ld hl, $dddf
+ ld hl, wMusicVibratoDelay
ld de, $dea0
ld a, $4
call Music1_CopyData
@@ -1711,11 +1708,11 @@ Func_f49dc: ; f49dc (3d:49dc)
ld [$dddc], a
ld [$dddd], a
ld [$ddde], a
- ld hl, $dde7
+ ld hl, wMusicVolume
ld de, $dea4
ld a, $3
call Music1_CopyData
- ld hl, $ddea
+ ld hl, wMusicE4
ld de, $dea7
ld a, $3
call Music1_CopyData
@@ -1725,7 +1722,7 @@ Func_f49dc: ; f49dc (3d:49dc)
call Music1_CopyData
ld a, $0
ld [$deac], a
- ld hl, $ddf3
+ ld hl, wMusicReturnAddress
ld de, $dead
ld a, $8
call Music1_CopyData
@@ -1741,21 +1738,21 @@ Func_f4b01: ; f4b01 (3d:4b01)
ld a, [$de56]
ld [$dd81], a
ld a, [$de57]
- ld [$dd84], a
+ ld [wMusicDC], a
ld hl, $de58
- ld de, $dd86
+ ld de, wMusicDuty
ld a, $4
call Music1_CopyData
ld a, [$de5c]
- ld [$dd8a], a
+ ld [wMusicWave], a
ld a, $1
- ld [$dd8b], a
+ ld [wMusicWaveChange], a
ld hl, $de5e
- ld de, $dd8d
+ ld de, wMusicIsPlaying
ld a, $4
call Music1_CopyData
ld hl, $de62
- ld de, $dd91
+ ld de, wMusicTie
ld a, $4
call Music1_CopyData
ld hl, $de66
@@ -1763,7 +1760,7 @@ Func_f4b01: ; f4b01 (3d:4b01)
ld a, $8
call Music1_CopyData
ld hl, $de6e
- ld de, $dd9d
+ ld de, wMusicMainLoop
ld a, $8
call Music1_CopyData
ld a, [$de76]
@@ -1771,7 +1768,7 @@ Func_f4b01: ; f4b01 (3d:4b01)
ld a, [$de77]
ld [$ddac], a
ld hl, $de78
- ld de, $ddaf
+ ld de, wMusicOctave
ld a, $4
call Music1_CopyData
ld hl, $de7c
@@ -1787,7 +1784,7 @@ Func_f4b01: ; f4b01 (3d:4b01)
ld a, $4
call Music1_CopyData
ld hl, $de88
- ld de, $ddbf
+ ld de, wMusicE8
ld a, $4
call Music1_CopyData
ld hl, $de8c
@@ -1795,31 +1792,31 @@ Func_f4b01: ; f4b01 (3d:4b01)
ld a, $4
call Music1_CopyData
ld hl, $de90
- ld de, $ddc7
+ ld de, wMusicE9
ld a, $4
call Music1_CopyData
ld hl, $de94
- ld de, $ddcb
+ ld de, wMusicEC
ld a, $4
call Music1_CopyData
ld hl, $de98
- ld de, $ddcf
+ ld de, wMusicSpeed
ld a, $4
call Music1_CopyData
ld hl, $de9c
- ld de, $ddd7
+ ld de, wMusicVibratoType2
ld a, $4
call Music1_CopyData
ld hl, $dea0
- ld de, $dddf
+ ld de, wMusicVibratoDelay
ld a, $4
call Music1_CopyData
ld hl, $dea4
- ld de, $dde7
+ ld de, wMusicVolume
ld a, $3
call Music1_CopyData
ld hl, $dea7
- ld de, $ddea
+ ld de, wMusicE4
ld a, $3
call Music1_CopyData
ld hl, $deaa
@@ -1829,7 +1826,7 @@ Func_f4b01: ; f4b01 (3d:4b01)
ld a, [$deac]
ld [$ddef], a
ld hl, $dead
- ld de, $ddf3
+ ld de, wMusicReturnAddress
ld a, $8
call Music1_CopyData
ld hl, $deb5
diff --git a/engine/music2.asm b/engine/music2.asm
index bdce70e..38c4c46 100755
--- a/engine/music2.asm
+++ b/engine/music2.asm
@@ -123,28 +123,28 @@ Func_f807d: ; f807d (3e:407d)
xor a
ld [$dd8c], a
ld [$de53], a
- ld [$dd8b], a
+ ld [wMusicWaveChange], a
ld [$ddef], a
ld [$ddf0], a
ld [$ddf2], a
dec a
- ld [$dd84], a
+ ld [wMusicDC], a
ld de, $0001
ld bc, $0000
.asm_f80bb
- ld hl, $dd8d
+ ld hl, wMusicIsPlaying
add hl, bc
ld [hl], d
- ld hl, $dd91
+ ld hl, wMusicTie
add hl, bc
ld [hl], d
ld hl, $ddb3
add hl, bc
ld [hl], d
- ld hl, $ddcb
+ ld hl, wMusicEC
add hl, bc
ld [hl], d
- ld hl, $ddbf
+ ld hl, wMusicE8
add hl, bc
ld [hl], d
inc c
@@ -152,7 +152,7 @@ Func_f807d: ; f807d (3e:407d)
cp $4
jr nz, .asm_f80bb
ld hl, Unknown_f8c20
- ld bc, $ddf3
+ ld bc, wMusicReturnAddress
ld d, $8
.asm_f80e2
ld a, [hli]
@@ -212,7 +212,7 @@ Func_f814b: ; f814b (3e:414b)
ld a, [$dd8c]
ld d, a
xor a
- ld [$dd8d], a
+ ld [wMusicIsPlaying], a
bit 0, d
jr nz, .asm_f815f
ld a, $8
@@ -277,26 +277,26 @@ Music2_PlaySong: ; f818c (3e:418c)
ld a, [bc]
inc bc
ld [$dd95], a
- ld [$dd9d], a
+ ld [wMusicMainLoop], a
ld a, [bc]
inc bc
ld [$dd96], a
ld [$dd9e], a
ld a, $1
ld [$ddbb], a
- ld [$dd8d], a
+ ld [wMusicIsPlaying], a
xor a
- ld [$dd91], a
- ld [$ddea], a
- ld [$ddbf], a
- ld [$dddf], a
- ld [$ddcb], a
+ ld [wMusicTie], a
+ ld [wMusicE4], a
+ ld [wMusicE8], a
+ ld [wMusicVibratoDelay], a
+ ld [wMusicEC], a
ld a, [Unknown_f8c20]
- ld [$ddf3], a
+ ld [wMusicReturnAddress], a
ld a, [Unknown_f8c20 + 1]
ld [$ddf4], a
ld a, $8
- ld [$ddc7], a
+ ld [wMusicE9], a
.asm_f81eb
rr e
jr nc, .asm_f8228
@@ -383,7 +383,7 @@ Func_f82a4: ; f82a4 (3e:42a4)
ret
Func_f82a5: ; f82a5 (3e:42a5)
- ld a, [$dd8d]
+ ld a, [wMusicIsPlaying]
or a
jr z, .asm_f82fa
ld a, [$ddb7]
@@ -400,7 +400,7 @@ Func_f82a5: ; f82a5 (3e:42a5)
bit 0, a
jr nz, .asm_f82d4
ld hl, $ff12
- ld a, [$ddc7]
+ ld a, [wMusicE9]
ld [hli], a
inc hl
ld a, $80
@@ -416,7 +416,7 @@ Func_f82a5: ; f82a5 (3e:42a5)
ld l, a
ld bc, $0000
call Music2_PlayNextNote
- ld a, [$dd8d]
+ ld a, [wMusicIsPlaying]
or a
jr z, .asm_f82fa
call Func_f8714
@@ -622,7 +622,7 @@ Music2_CommandTable: ; f842c (3e:442c)
dw Music2_wave
dw Music2_musice8
dw Music2_musice9
- dw Music2_vibrato_rate
+ dw Music2_vibrato_type
dw Music2_vibrato_delay
dw Music2_musicec
dw Music2_musiced
@@ -649,7 +649,7 @@ Music2_note: ; f448c (3d:448c)
push af
ld a, [hl]
ld e, a
- ld hl, $dd91
+ ld hl, wMusicTie
add hl, bc
ld a, [hl]
cp $80
@@ -663,16 +663,16 @@ Music2_note: ; f448c (3d:448c)
add hl, bc
ld [hl], a
inc [hl]
- ld hl, $ddd7
+ ld hl, wMusicVibratoType2
add hl, bc
ld a, [hl]
- ld hl, $ddd3
+ ld hl, wMusicVibratoType
add hl, bc
ld [hl], a
.asm_f84b0
pop af
push de
- ld hl, $ddcf
+ ld hl, wMusicSpeed
add hl, bc
ld d, [hl]
and $f
@@ -700,7 +700,7 @@ Music2_note: ; f448c (3d:448c)
ld a, d
jr z, .asm_f84fb
ld e, a
- ld hl, $ddbf
+ ld hl, wMusicE8
add hl, bc
ld a, [hl]
cp $8
@@ -748,7 +748,7 @@ Music2_note: ; f448c (3d:448c)
jr .asm_f8564
.asm_f851a
push af
- ld hl, $ddaf
+ ld hl, wMusicOctave
add hl, bc
ld a, [hl]
ld d, a
@@ -772,10 +772,10 @@ Music2_note: ; f448c (3d:448c)
ld l, a
ld a, [hli]
ld d, a
- ld a, [$dd84]
+ ld a, [wMusicDC]
and $77
or d
- ld [$dd84], a
+ ld [wMusicDC], a
ld de, $ddab
ld a, [hli]
ld [de], a
@@ -804,7 +804,7 @@ Music2_note: ; f448c (3d:448c)
add hl, bc
add hl, bc
push hl
- ld hl, $ddaf
+ ld hl, wMusicOctave
add hl, bc
ld e, [hl]
ld d, $0
@@ -813,7 +813,7 @@ Music2_note: ; f448c (3d:448c)
add a
ld e, [hl]
add e
- ld hl, $ddcb
+ ld hl, wMusicEC
add hl, bc
ld e, [hl]
add e
@@ -843,7 +843,7 @@ Music2_speed: ; f8598 (3e:4598)
pop hl
ld a, [hli]
push hl
- ld hl, $ddcf
+ ld hl, wMusicSpeed
add hl, bc
ld [hl], a
jp Music2_PlayNextNote_pop
@@ -851,7 +851,7 @@ Music2_speed: ; f8598 (3e:4598)
Music2_octave: ; f85a3 (3e:45a3)
and $7
dec a
- ld hl, $ddaf
+ ld hl, wMusicOctave
add hl, bc
push af
ld a, c
@@ -867,19 +867,19 @@ Music2_octave: ; f85a3 (3e:45a3)
jp Music2_PlayNextNote_pop
Music2_inc_octave: ; f85bb (3e:45bb)
- ld hl, $ddaf
+ ld hl, wMusicOctave
add hl, bc
inc [hl]
jp Music2_PlayNextNote_pop
Music2_dec_octave: ; f85c3 (3e:45c3)
- ld hl, $ddaf
+ ld hl, wMusicOctave
add hl, bc
dec [hl]
jp Music2_PlayNextNote_pop
Music2_tie: ; f85cb (3e:45cb)
- ld hl, $dd91
+ ld hl, wMusicTie
add hl, bc
ld [hl], $80
jp Music2_PlayNextNote_pop
@@ -899,7 +899,7 @@ Music2_musicdc: ; f85d4 (3e:45d4)
jr .asm_f85db
.asm_f85e3
ld d, a
- ld hl, $dd84
+ ld hl, wMusicDC
ld a, [hl]
and e
or d
@@ -911,7 +911,7 @@ Music2_MainLoop: ; f85ef (3e:45ef)
pop de
push de
dec de
- ld hl, $dd9d
+ ld hl, wMusicMainLoop
add hl, bc
add hl, bc
ld [hl], e
@@ -921,7 +921,7 @@ Music2_MainLoop: ; f85ef (3e:45ef)
Music2_EndMainLoop: ; f85fd (3e:45fd)
pop hl
- ld hl, $dd9d
+ ld hl, wMusicMainLoop
add hl, bc
add hl, bc
ld a, [hli]
@@ -1008,7 +1008,7 @@ Music2_musice4: ; f8667 (3e:4667)
pop de
ld a, [de]
inc de
- ld hl, $ddea
+ ld hl, wMusicE4
add hl, bc
ld [hl], a
ld h, d
@@ -1020,7 +1020,7 @@ Music2_duty: ; f8674 (3e:4674)
ld a, [de]
and $c0
inc de
- ld hl, $dd86
+ ld hl, wMusicDuty
add hl, bc
ld [hl], a
ld h, d
@@ -1031,7 +1031,7 @@ Music2_volume: ; f8683 (3e:4683)
pop de
ld a, [de]
inc de
- ld hl, $dde7
+ ld hl, wMusicVolume
add hl, bc
ld [hl], a
ld h, d
@@ -1042,9 +1042,9 @@ Music2_wave: ; f8690 (3e:4690)
pop de
ld a, [de]
inc de
- ld [$dd8a], a
+ ld [wMusicWave], a
ld a, $1
- ld [$dd8b], a
+ ld [wMusicWaveChange], a
ld h, d
ld l, e
jp Music2_PlayNextNote
@@ -1053,7 +1053,7 @@ Music2_musice8: ; f86a0 (3e:46a0)
pop de
ld a, [de]
inc de
- ld hl, $ddbf
+ ld hl, wMusicE8
add hl, bc
ld [hl], a
ld h, d
@@ -1064,21 +1064,21 @@ Music2_musice9: ; f86ad (3e:46ad)
pop de
ld a, [de]
inc de
- ld hl, $ddc7
+ ld hl, wMusicE9
add hl, bc
ld [hl], a
ld h, d
ld l, e
jp Music2_PlayNextNote
-Music2_vibrato_rate: ; f86ba (3e:46ba)
+Music2_vibrato_type: ; f86ba (3e:46ba)
pop de
ld a, [de]
inc de
- ld hl, $ddd3
+ ld hl, wMusicVibratoType
add hl, bc
ld [hl], a
- ld hl, $ddd7
+ ld hl, wMusicVibratoType2
add hl, bc
ld [hl], a
ld h, d
@@ -1089,7 +1089,7 @@ Music2_vibrato_delay: ; f86cc (3e:46cc)
pop de
ld a, [de]
inc de
- ld hl, $dddf
+ ld hl, wMusicVibratoDelay
add hl, bc
ld [hl], a
ld h, d
@@ -1100,7 +1100,7 @@ Music2_musicec: ; f86d9 (3e:46d9)
pop de
ld a, [de]
inc de
- ld hl, $ddcb
+ ld hl, wMusicEC
add hl, bc
ld [hl], a
ld h, d
@@ -1111,7 +1111,7 @@ Music2_musiced: ; f86e6 (3e:46e6)
pop de
ld a, [de]
inc de
- ld hl, $ddcb
+ ld hl, wMusicEC
add hl, bc
add [hl]
ld [hl], a
@@ -1120,7 +1120,7 @@ Music2_musiced: ; f86e6 (3e:46e6)
jp Music2_PlayNextNote
Music2_end: ; f86f4 (3e:46f4)
- ld hl, $dd8d
+ ld hl, wMusicIsPlaying
add hl, bc
ld [hl], $0
pop hl
@@ -1129,7 +1129,7 @@ Music2_end: ; f86f4 (3e:46f4)
; returns the address where the address to
; return to is stored for the current channel
Music2_GetReturnAddress: ; f86fc (3e:46fc)
- ld hl, $ddf3
+ ld hl, wMusicReturnAddress
add hl, bc
add hl, bc
ld a, [hli]
@@ -1139,13 +1139,10 @@ Music2_GetReturnAddress: ; f86fc (3e:46fc)
; puts the address in hl where the address to
; return to is stored for the currentchannel
-; since this function is used for loops and calls, a song
-; should not use a loop inside a called piece of music
-; or call a piece of music inside a loop
Music2_SetReturnAddress: ; f8705 (3e:4705)
ld d, h
ld e, l
- ld hl, $ddf3
+ ld hl, wMusicReturnAddress
add hl, bc
add hl, bc
ld [hl], e
@@ -1165,18 +1162,18 @@ Func_f8714: ; f8714 (3e:4714)
cp $0
jr z, .asm_f874a
ld d, $0
- ld hl, $dd91
+ ld hl, wMusicTie
ld a, [hl]
cp $80
jr z, .asm_f8733
- ld a, [$dde7]
+ ld a, [wMusicVolume]
ld [$ff12], a
ld d, $80
.asm_f8733
ld [hl], $2
ld a, $8
ld [$ff10], a
- ld a, [$dd86]
+ ld a, [wMusicDuty]
ld [$ff11], a
ld a, [$dda5]
ld [$ff13], a
@@ -1186,7 +1183,7 @@ Func_f8714: ; f8714 (3e:4714)
.asm_f8749
ret
.asm_f874a
- ld hl, $dd91
+ ld hl, wMusicTie
ld [hl], $0
ld hl, $ff12
ld a, $8
@@ -1238,7 +1235,7 @@ Func_f879c: ; f879c (3e:479c)
bit 2, a
jr nz, .asm_f87e0
ld d, $0
- ld a, [$dd8b]
+ ld a, [wMusicWaveChange]
or a
jr z, .asm_f87b3
xor a
@@ -1272,14 +1269,14 @@ Func_f879c: ; f879c (3e:479c)
.asm_f87e0
ret
.asm_f87e1
- ld hl, $dd91
+ ld hl, wMusicTie
ld [hl], $0
xor a
ld [$ff1a], a
ret
Func_f87ea: ; f879c (3e:47ea)
- ld a, [$dd8a]
+ ld a, [wMusicWave]
add a
ld d, $0
ld e, a
@@ -1299,7 +1296,7 @@ Func_f87ea: ; f879c (3e:47ea)
cp $10
jr nz, .asm_f87fc
xor a
- ld [$dd8b], a
+ ld [wMusicWaveChange], a
ret
Func_f880a: ; f880a (3e:480a)
@@ -1374,7 +1371,7 @@ Func_f8866: ; f8866 (3e:4866)
ld [$ff24], a
ld a, [$dd8c]
or a
- ld hl, $dd84
+ ld hl, wMusicDC
ld a, [hli]
jr z, .asm_f8888
ld a, [$dd8c]
@@ -1404,7 +1401,7 @@ Func_f8866: ; f8866 (3e:4866)
ret
Func_f8898: ; f8898 (3e:4898)
- ld hl, $dddf
+ ld hl, wMusicVibratoDelay
add hl, bc
ld a, [hl]
cp $0
@@ -1416,7 +1413,7 @@ Func_f8898: ; f8898 (3e:4898)
inc [hl]
jr .asm_f8902
.asm_f88ab
- ld hl, $ddd3
+ ld hl, wMusicVibratoType
add hl, bc
ld e, [hl]
ld d, $0
@@ -1475,7 +1472,7 @@ Func_f8898: ; f8898 (3e:4898)
ld a, [hl]
cp $80
jr z, .asm_f88ab
- ld hl, $ddd3
+ ld hl, wMusicVibratoType
add hl, bc
ld [hl], a
jr .asm_f88ab
@@ -1491,7 +1488,7 @@ Func_f8898: ; f8898 (3e:4898)
Func_f890b: ; f890b (3e:490b)
cp $0
jr nz, .asm_f892c
- ld a, [$dddf]
+ ld a, [wMusicVibratoDelay]
cp $0
jr z, .asm_f8966
ld a, [$dd8c]
@@ -1542,7 +1539,7 @@ Func_f890b: ; f890b (3e:490b)
ret
Func_f8967: ; f8967 (3e:4967)
- ld hl, $ddea
+ ld hl, wMusicE4
add hl, bc
ld a, [hl]
bit 7, a
@@ -1596,7 +1593,7 @@ Func_f8980: ; f8980 (3e:4980)
ret
Func_f89b1: ; f89b1 (3e:49b1)
- ld hl, $dd8d
+ ld hl, wMusicIsPlaying
xor a
add [hl]
inc hl
@@ -1632,21 +1629,21 @@ Func_f89dc: ; f89dc (3e:49dc)
ld [$de55], a
ld a, [$dd81]
ld [$de56], a
- ld a, [$dd84]
+ ld a, [wMusicDC]
ld [$de57], a
- ld hl, $dd86
+ ld hl, wMusicDuty
ld de, $de58
ld a, $4
call Music2_CopyData
- ld a, [$dd8a]
+ ld a, [wMusicWave]
ld [$de5c], a
- ld a, [$dd8b]
+ ld a, [wMusicWaveChange]
ld [$de5d], a
- ld hl, $dd8d
+ ld hl, wMusicIsPlaying
ld de, $de5e
ld a, $4
call Music2_CopyData
- ld hl, $dd91
+ ld hl, wMusicTie
ld de, $de62
ld a, $4
call Music2_CopyData
@@ -1654,7 +1651,7 @@ Func_f89dc: ; f89dc (3e:49dc)
ld de, $de66
ld a, $8
call Music2_CopyData
- ld hl, $dd9d
+ ld hl, wMusicMainLoop
ld de, $de6e
ld a, $8
call Music2_CopyData
@@ -1662,7 +1659,7 @@ Func_f89dc: ; f89dc (3e:49dc)
ld [$de76], a
ld a, [$ddac]
ld [$de77], a
- ld hl, $ddaf
+ ld hl, wMusicOctave
ld de, $de78
ld a, $4
call Music2_CopyData
@@ -1678,7 +1675,7 @@ Func_f89dc: ; f89dc (3e:49dc)
ld de, $de84
ld a, $4
call Music2_CopyData
- ld hl, $ddbf
+ ld hl, wMusicE8
ld de, $de88
ld a, $4
call Music2_CopyData
@@ -1686,23 +1683,23 @@ Func_f89dc: ; f89dc (3e:49dc)
ld de, $de8c
ld a, $4
call Music2_CopyData
- ld hl, $ddc7
+ ld hl, wMusicE9
ld de, $de90
ld a, $4
call Music2_CopyData
- ld hl, $ddcb
+ ld hl, wMusicEC
ld de, $de94
ld a, $4
call Music2_CopyData
- ld hl, $ddcf
+ ld hl, wMusicSpeed
ld de, $de98
ld a, $4
call Music2_CopyData
- ld hl, $ddd7
+ ld hl, wMusicVibratoType2
ld de, $de9c
ld a, $4
call Music2_CopyData
- ld hl, $dddf
+ ld hl, wMusicVibratoDelay
ld de, $dea0
ld a, $4
call Music2_CopyData
@@ -1711,11 +1708,11 @@ Func_f89dc: ; f89dc (3e:49dc)
ld [$dddc], a
ld [$dddd], a
ld [$ddde], a
- ld hl, $dde7
+ ld hl, wMusicVolume
ld de, $dea4
ld a, $3
call Music2_CopyData
- ld hl, $ddea
+ ld hl, wMusicE4
ld de, $dea7
ld a, $3
call Music2_CopyData
@@ -1725,7 +1722,7 @@ Func_f89dc: ; f89dc (3e:49dc)
call Music2_CopyData
ld a, $0
ld [$deac], a
- ld hl, $ddf3
+ ld hl, wMusicReturnAddress
ld de, $dead
ld a, $8
call Music2_CopyData
@@ -1741,21 +1738,21 @@ Func_f8b01: ; f8b01 (3e:4b01)
ld a, [$de56]
ld [$dd81], a
ld a, [$de57]
- ld [$dd84], a
+ ld [wMusicDC], a
ld hl, $de58
- ld de, $dd86
+ ld de, wMusicDuty
ld a, $4
call Music2_CopyData
ld a, [$de5c]
- ld [$dd8a], a
+ ld [wMusicWave], a
ld a, $1
- ld [$dd8b], a
+ ld [wMusicWaveChange], a
ld hl, $de5e
- ld de, $dd8d
+ ld de, wMusicIsPlaying
ld a, $4
call Music2_CopyData
ld hl, $de62
- ld de, $dd91
+ ld de, wMusicTie
ld a, $4
call Music2_CopyData
ld hl, $de66
@@ -1763,7 +1760,7 @@ Func_f8b01: ; f8b01 (3e:4b01)
ld a, $8
call Music2_CopyData
ld hl, $de6e
- ld de, $dd9d
+ ld de, wMusicMainLoop
ld a, $8
call Music2_CopyData
ld a, [$de76]
@@ -1771,7 +1768,7 @@ Func_f8b01: ; f8b01 (3e:4b01)
ld a, [$de77]
ld [$ddac], a
ld hl, $de78
- ld de, $ddaf
+ ld de, wMusicOctave
ld a, $4
call Music2_CopyData
ld hl, $de7c
@@ -1787,7 +1784,7 @@ Func_f8b01: ; f8b01 (3e:4b01)
ld a, $4
call Music2_CopyData
ld hl, $de88
- ld de, $ddbf
+ ld de, wMusicE8
ld a, $4
call Music2_CopyData
ld hl, $de8c
@@ -1795,31 +1792,31 @@ Func_f8b01: ; f8b01 (3e:4b01)
ld a, $4
call Music2_CopyData
ld hl, $de90
- ld de, $ddc7
+ ld de, wMusicE9
ld a, $4
call Music2_CopyData
ld hl, $de94
- ld de, $ddcb
+ ld de, wMusicEC
ld a, $4
call Music2_CopyData
ld hl, $de98
- ld de, $ddcf
+ ld de, wMusicSpeed
ld a, $4
call Music2_CopyData
ld hl, $de9c
- ld de, $ddd7
+ ld de, wMusicVibratoType2
ld a, $4
call Music2_CopyData
ld hl, $dea0
- ld de, $dddf
+ ld de, wMusicVibratoDelay
ld a, $4
call Music2_CopyData
ld hl, $dea4
- ld de, $dde7
+ ld de, wMusicVolume
ld a, $3
call Music2_CopyData
ld hl, $dea7
- ld de, $ddea
+ ld de, wMusicE4
ld a, $3
call Music2_CopyData
ld hl, $deaa
@@ -1829,7 +1826,7 @@ Func_f8b01: ; f8b01 (3e:4b01)
ld a, [$deac]
ld [$ddef], a
ld hl, $dead
- ld de, $ddf3
+ ld de, wMusicReturnAddress
ld a, $8
call Music2_CopyData
ld hl, $deb5
diff --git a/macros.asm b/macros.asm
index 973fbc1..f94d7ab 100755
--- a/macros.asm
+++ b/macros.asm
@@ -141,7 +141,7 @@ musice9: MACRO
db $e9, \1
ENDM
-vibrato_rate: MACRO
+vibrato_type: MACRO
db $ea, \1
ENDM
diff --git a/wram.asm b/wram.asm
index dea3b91..8560af9 100755
--- a/wram.asm
+++ b/wram.asm
@@ -2,10 +2,64 @@ SECTION "WRAM1", WRAMX, BANK[1]
ds $32f
wCurMap: ; d32f
- ds 1
+ ds $1
wPlayerXCoord: ; d330
- ds 1
+ ds $1
wPlayerYCoord: ; d331
- ds 1 \ No newline at end of file
+ ds $a53
+
+wMusicDC: ; dd84
+ ds $2
+
+wMusicDuty: ; dd86
+ ds $4
+
+wMusicWave: ; dd8a
+ ds $1
+
+wMusicWaveChange: ; dd8b
+ ds $2
+
+wMusicIsPlaying: ; dd8d
+ ds $4
+
+wMusicTie: ; dd91
+ ds $c
+
+wMusicMainLoop: ; dd9d
+ ds $12
+
+wMusicOctave: ; ddaf
+ ds $10
+
+wMusicE8: ; ddbf
+ ds $8
+
+wMusicE9: ; ddc7
+ ds $4
+
+wMusicEC: ; ddcb
+ ds $4
+
+wMusicSpeed: ; ddcf
+ ds $4
+
+wMusicVibratoType: ; ddd3
+ ds $4
+
+wMusicVibratoType2: ; ddd7
+ ds $8
+
+wMusicVibratoDelay: ; dddf
+ ds $8
+
+wMusicVolume: ; dde7
+ ds $3
+
+wMusicE4: ; ddea
+ ds $9
+
+wMusicReturnAddress: ; ddf3
+ ds $8 \ No newline at end of file