summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
Diffstat (limited to 'audio')
-rw-r--r--audio/cries.asm232
-rw-r--r--audio/engine.asm337
-rw-r--r--audio/music/clair.asm6
-rw-r--r--audio/music/credits.asm16
-rw-r--r--audio/music/evolution.asm8
-rw-r--r--audio/music/goldenrodcity.asm3
-rw-r--r--audio/music/healpokemon.asm10
-rw-r--r--audio/music/johtowildbattle.asm3
-rw-r--r--audio/music/kantotrainerbattle.asm6
-rw-r--r--audio/music/kantowildbattle.asm28
-rw-r--r--audio/music/lookofficer.asm4
-rw-r--r--audio/music/lookrocket.asm6
-rw-r--r--audio/music/postcredits.asm4
-rw-r--r--audio/music/profoak.asm8
-rw-r--r--audio/music/ssaqua.asm4
-rw-r--r--audio/music/surf.asm4
-rw-r--r--audio/music/wildpokemonvictory.asm12
-rw-r--r--audio/sfx.asm38
-rw-r--r--audio/sfx_crystal.asm8
19 files changed, 361 insertions, 376 deletions
diff --git a/audio/cries.asm b/audio/cries.asm
index d6429b78f..66b6d3c98 100644
--- a/audio/cries.asm
+++ b/audio/cries.asm
@@ -174,7 +174,7 @@ Cry_Mantine: ; f2e74
Cry_Entei_Ch5: ; f2e7d
soundinput $ff
- unknownmusic0xde $63
+ sound_duty 3, 0, 2, 1
sound __, 2, $f8, $05f8
sound __, 9, $9f, $04d8
sound __, 7, $f8, $05c4
@@ -184,7 +184,7 @@ Cry_Entei_Ch5: ; f2e7d
; f2e94
Cry_Entei_Ch6: ; f2e94
- unknownmusic0xde $33
+ sound_duty 3, 0, 3, 0
sound __, 2, $c8, $0640
sound __, 7, $ff, $0668
sound __, 8, $a8, $0534
@@ -201,7 +201,7 @@ Cry_Entei_Ch8: ; f2ea7
; f2eb4
Cry_Magcargo_Ch5: ; f2eb4
- unknownmusic0xde $c4
+ sound_duty 0, 1, 0, 3
sound __, 5, $af, $0720
sound __, 3, $f8, $071c
sound __, 3, $f8, $0718
@@ -213,7 +213,7 @@ Cry_Magcargo_Ch5: ; f2eb4
; f2ed3
Cry_Magcargo_Ch6: ; f2ed3
- unknownmusic0xde $a
+ sound_duty 2, 2, 0, 0
sound __, 2, $b8, $0710
sound __, 4, $d8, $072c
sound __, 5, $d8, $0665
@@ -235,7 +235,7 @@ Cry_Magcargo_branch_f2ef5: ; f2ef5
; f2f03
Cry_Dunsparce_Ch5: ; f2f03
- unknownmusic0xde $22
+ sound_duty 2, 0, 2, 0
sound __, 2, $f8, $05b0
sound __, 2, $f8, $04b4
sound __, 2, $f8, $05b8
@@ -249,7 +249,7 @@ Cry_Dunsparce_Ch5: ; f2f03
; f2f26
Cry_Dunsparce_Ch6: ; f2f26
- unknownmusic0xde $22
+ sound_duty 2, 0, 2, 0
sound __, 9, $b8, $04c8
sound C#, 1, $b5, $0410
endchannel
@@ -263,7 +263,7 @@ Cry_Dunsparce_Ch8: ; f2f31
; f2f3b
Cry_Slowking_Ch5: ; f2f3b
- unknownmusic0xde $33
+ sound_duty 3, 0, 3, 0
sound __, 3, $f1, $0550
sound __, 3, $f1, $0530
sound __, 3, $f1, $0510
@@ -275,7 +275,7 @@ Cry_Slowking_Ch5: ; f2f3b
; f2f5a
Cry_Slowking_Ch6: ; f2f5a
- unknownmusic0xde $f2
+ sound_duty 2, 0, 3, 3
sound __, 5, $e1, $0620
sound __, 6, $e2, $0500
sound __, 7, $e1, $0620
@@ -312,7 +312,7 @@ Cry_Pichu_Ch5: ; f2f8a
; f2fab
Cry_Pichu_Ch6: ; f2fab
- unknownmusic0xde $10
+ sound_duty 0, 0, 1, 0
sound __, 3, $c8, $076d
sound __, 3, $c8, $0771
sound __, 3, $c8, $078d
@@ -331,7 +331,7 @@ Cry_Pichu_Ch8: ; f2fc2
; f2fd2
Cry_Marill_Ch5: ; f2fd2
- unknownmusic0xde $22
+ sound_duty 2, 0, 2, 0
sound __, 3, $88, $06d8
sound __, 9, $e2, $06e0
sound __, 3, $61, $06e5
@@ -343,7 +343,7 @@ Cry_Marill_Ch5: ; f2fd2
; f2ff1
Cry_Marill_Ch6: ; f2ff1
- unknownmusic0xde $63
+ sound_duty 3, 0, 2, 1
sound __, 3, $68, $06b1
sound __, 6, $c1, $06b9
sound __, 6, $99, $0760
@@ -367,7 +367,7 @@ Cry_Togepi_Ch5: ; f301f
tone $0002
Cry_Togepi_Ch6: ; f3022
Cry_Togetic_branch_f3022: ; f3022
- unknownmusic0xde $52
+ sound_duty 2, 0, 1, 1
sound __, 5, $f1, $0796
sound __, 5, $f1, $072d
sound __, 8, $0, 0
@@ -396,7 +396,7 @@ Cry_Spinarak_Ch5: ; f3048
; f305b
Cry_Spinarak_Ch6: ; f305b
- unknownmusic0xde $2a
+ sound_duty 2, 2, 2, 0
sound __, 4, $2c, $07c7
sound __, 2, $0, 0
sound __, 6, $59, $07be
@@ -413,7 +413,7 @@ Cry_Spinarak_Ch8: ; f306e
; f307b
Cry_Raikou_Ch5: ; f307b
- unknownmusic0xde $f8
+ sound_duty 0, 2, 3, 3
sound __, 3, $f1, $04b0
sound __, 3, $f7, $0590
sound __, 9, $f8, $0510
@@ -425,7 +425,7 @@ Cry_Raikou_Ch5: ; f307b
; f309a
Cry_Raikou_Ch6: ; f309a
- unknownmusic0xde $f2
+ sound_duty 2, 0, 3, 3
sound __, 3, $f1, $0720
sound __, 3, $e1, $0650
sound __, 5, $f1, $0750
@@ -450,7 +450,7 @@ Cry_Raikou_Ch8: ; f30bd
; f30d6
Cry_Hoothoot_Ch5: ; f30d6
- unknownmusic0xde $66
+ sound_duty 2, 1, 2, 1
sound __, 5, $78, $0650
sound __, 5, $f8, $0660
sound __, 5, $f8, $065c
@@ -463,7 +463,7 @@ Cry_Hoothoot_Ch5: ; f30d6
; f30f9
Cry_Hoothoot_Ch6: ; f30f9
- unknownmusic0xde $22
+ sound_duty 2, 0, 2, 0
Cry_Hoothoot_branch_f30fb: ; f30fb
sound __, 3, $a1, $0600
loopchannel 3, Cry_Hoothoot_branch_f30fb
@@ -490,7 +490,7 @@ Cry_Sentret_Ch5: ; f3121
; f3129
Cry_Sentret_Ch6: ; f3129
- unknownmusic0xde $1b
+ sound_duty 3, 2, 1, 0
Cry_Sentret_branch_f312b: ; f312b
sound __, 9, $39, $072d
sound __, 9, $f1, $0720
@@ -510,7 +510,7 @@ Cry_Mareep_Ch5: ; f313b
; f3143
Cry_Mareep_Ch6: ; f3143
- unknownmusic0xde $1
+ sound_duty 1, 0, 0, 0
Cry_Mareep_branch_f3145: ; f3145
Cry_Gligar_branch_f3145: ; f3145
sound __, 5, $3a, $073d
@@ -546,7 +546,7 @@ Cry_Gligar_Ch8: ; f3178
Cry_Chikorita_Ch5: ; f317f
tone $0020
Cry_Chikorita_Ch6: ; f3182
- unknownmusic0xde $21
+ sound_duty 1, 0, 2, 0
sound __, 3, $c8, $0641
sound __, 3, $48, $0641
sound __, 7, $f8, $0790
@@ -562,7 +562,7 @@ Cry_Chikorita_Ch8: ; f3199
; f31a0
Cry_Gligar_Ch5: ; f31a0
- unknownmusic0xde $a2
+ sound_duty 2, 0, 2, 2
jumpchannel Cry_Gligar_branch_f3145
; f31a5
@@ -573,7 +573,7 @@ Cry_Girafarig_Ch5: ; f31a5
; f31ad
Cry_Girafarig_Ch6: ; f31ad
- unknownmusic0xde $41
+ sound_duty 1, 0, 0, 1
Cry_Girafarig_branch_f31af: ; f31af
sound __, 5, $68, $0758
sound __, 3, $e8, $0760
@@ -593,7 +593,7 @@ Cry_Girafarig_Ch8: ; f31c4
; f31d4
Cry_Slugma_Ch5: ; f31d4
- unknownmusic0xde $91
+ sound_duty 1, 0, 1, 2
sound __, 13, $f2, $07a6
sound __, 5, $f8, $07b0
sound __, 5, $e8, $03b0
@@ -617,7 +617,7 @@ Cry_Ledyba_Ch5: ; f31f8
; f3200
Cry_Ledyba_Ch6: ; f3200
- unknownmusic0xde $1
+ sound_duty 1, 0, 0, 0
Cry_Ledyba_branch_f3202: ; f3202
sound __, 4, $f8, $0791
sound __, 4, $d8, $078d
@@ -652,7 +652,7 @@ Cry_Donphan_Ch5: ; f322e
Cry_Wooper_Ch6: ; f3249
Cry_Donphan_Ch6: ; f3249
- unknownmusic0xde $7
+ sound_duty 3, 1, 0, 0
sound __, 3, $b9, $0738
sound __, 5, $cb, $0742
sound __, 9, $cb, $0754
@@ -682,7 +682,7 @@ Cry_Donphan_Ch8: ; f3274
Cry_Typhlosion_Ch5: ; f3284
Cry_Teddiursa_Ch5: ; f3284
- unknownmusic0xde $12
+ sound_duty 2, 0, 1, 0
Cry_Typhlosion_branch_f3286: ; f3286
Cry_Teddiursa_branch_f3286: ; f3286
sound __, 4, $c1, $0791
@@ -711,7 +711,7 @@ Cry_Teddiursa_branch_f32ae: ; f32ae
Cry_Typhlosion_Ch6: ; f32bb
Cry_Teddiursa_Ch6: ; f32bb
- unknownmusic0xde $78
+ sound_duty 0, 2, 3, 1
sound __, 9, $99, $0740
sound __, 9, $79, $0746
sound C_, 1, $f6, $078d
@@ -731,7 +731,7 @@ Cry_Typhlosion_Ch8: ; f32da
; f32e7
Cry_Natu_Ch5: ; f32e7
- unknownmusic0xde $de
+ sound_duty 2, 3, 1, 3
Cry_Mantine_branch_f32e9: ; f32e9
Cry_Sunflora_branch_f32e9: ; f32e9
sound __, 5, $f8, $07b1
@@ -747,7 +747,7 @@ Cry_Mantine_branch_f32f5: ; f32f5
Cry_Mantine_branch_f3302: ; f3302
Cry_Natu_Ch6: ; f3302
Cry_Sunflora_Ch6: ; f3302
- unknownmusic0xde $f2
+ sound_duty 2, 0, 3, 3
sound __, 5, $f8, $07b2
sound __, 5, $f8, $07b1
sound __, 5, $28, $07b0
@@ -802,7 +802,7 @@ Cry_Mantine_Ch8: ; f334c
; f3353
Cry_Ampharos_Ch5: ; f3353
- unknownmusic0xde $de
+ sound_duty 2, 3, 1, 3
Cry_Ampharos_branch_f3355: ; f3355
sound __, 2, $c1, $0520
sound __, 2, $a1, $0420
@@ -815,7 +815,7 @@ Cry_Ampharos_branch_f3355: ; f3355
; f3370
Cry_Ampharos_Ch6: ; f3370
- unknownmusic0xde $32
+ sound_duty 2, 0, 3, 0
sound __, 9, $f8, $0700
sound __, 8, $f8, $0720
sound __, 5, $f8, $0790
@@ -835,7 +835,7 @@ Cry_Ampharos_Ch8: ; f3387
; f339a
Cry_Totodile_Ch5: ; f339a
- unknownmusic0xde $32
+ sound_duty 2, 0, 3, 0
sound __, 9, $f8, $0330
sound __, 9, $f8, $0340
sound __, 9, $c8, $07b2
@@ -845,7 +845,7 @@ Cry_Totodile_Ch5: ; f339a
; f33b1
Cry_Totodile_Ch6: ; f33b1
- unknownmusic0xde $12
+ sound_duty 2, 0, 1, 0
sound __, 9, $e8, $0320
sound __, 9, $e8, $0328
sound __, 9, $98, $0780
@@ -863,7 +863,7 @@ Cry_Totodile_Ch8: ; f33c8
; f33d5
Cry_Cleffa_Ch5: ; f33d5
- unknownmusic0xde $39
+ sound_duty 1, 2, 3, 0
soundinput $ff
sound __, 3, $f8, $0720
sound __, 3, $f8, $0727
@@ -879,7 +879,7 @@ Cry_Cleffa_Ch5: ; f33d5
; f33fc
Cry_Cleffa_Ch6: ; f33fc
- unknownmusic0xde $22
+ sound_duty 2, 0, 2, 0
sound __, 7, $b2, $071e
sound __, 6, $92, $0779
sound __, 5, $82, $073e
@@ -898,7 +898,7 @@ Cry_Cleffa_Ch8: ; f340f
; f3422
Cry_Aipom_Ch5: ; f3422
- unknownmusic0xde $d2
+ sound_duty 2, 0, 1, 3
sound __, 4, $f8, $06b0
sound __, 2, $f8, $06a5
sound __, 2, $f8, $069d
@@ -910,7 +910,7 @@ Cry_Aipom_Ch5: ; f3422
; f3441
Cry_Aipom_Ch6: ; f3441
- unknownmusic0xde $27
+ sound_duty 3, 1, 2, 0
Cry_Aipom_branch_f3443: ; f3443
sound __, 2, $f1, $07b4
loopchannel 8, Cry_Aipom_branch_f3443
@@ -1167,7 +1167,7 @@ Cry_Weepinbell: ; f35ca
; f35d3
Unknown_Cry_Ch5: ; f35d3
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 16, $e0, $0780
sound __, 16, $f0, $0784
sound __, 16, $c3, $05e0
@@ -1178,7 +1178,7 @@ Unknown_Cry_Ch5: ; f35d3
; f35ee
Unknown_Cry_Ch6: ; f35ee
- unknownmusic0xde $5
+ sound_duty 1, 1, 0, 0
sound __, 16, $a0, $0741
sound __, 16, $b0, $0743
sound __, 16, $93, $05b1
@@ -1200,11 +1200,11 @@ Unknown_Cry_Ch8: ; f3609
; f361f
Cry_Raichu_Ch5: ; f361f
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 16, $f7, $07a0
sound __, 7, $e6, $07a3
sound __, 11, $f4, $07a0
- unknownmusic0xde $a5
+ sound_duty 1, 1, 2, 2
sound __, 11, $f6, $07d8
sound __, 5, $e3, $07d7
sound __, 16, $f2, $07d8
@@ -1212,12 +1212,12 @@ Cry_Raichu_Ch5: ; f361f
; f363c
Cry_Raichu_Ch6: ; f363c
- unknownmusic0xde $5
+ sound_duty 1, 1, 0, 0
sound __, 3, $8, 0
sound __, 16, $a7, $06a1
sound __, 7, $86, $06a2
sound __, 11, $74, $06a1
- unknownmusic0xde $5f
+ sound_duty 3, 3, 1, 1
sound __, 11, $76, $06d6
sound __, 5, $83, $06d9
sound __, 16, $a2, $06d7
@@ -1237,7 +1237,7 @@ Cry_Raichu_Ch8: ; f365d
; f3676
Cry_Vileplume_Ch5: ; f3676
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 16, $f7, $07c0
sound __, 7, $e4, $07c1
sound __, 11, $f6, $07c0
@@ -1247,7 +1247,7 @@ Cry_Vileplume_Ch5: ; f3676
; f368d
Cry_Vileplume_Ch6: ; f368d
- unknownmusic0xde $5f
+ sound_duty 3, 3, 1, 1
sound __, 16, $97, $0781
sound __, 7, $84, $0780
sound __, 11, $96, $0781
@@ -1264,7 +1264,7 @@ Cry_Vileplume_Ch8: ; f36a0
; f36ad
Cry_Vulpix_Ch5: ; f36ad
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 16, $f7, $0680
sound __, 11, $e6, $0684
sound __, 16, $d7, $0690
@@ -1277,7 +1277,7 @@ Cry_Vulpix_Ch5: ; f36ad
; f36d0
Cry_Vulpix_Ch6: ; f36d0
- unknownmusic0xde $5
+ sound_duty 1, 1, 0, 0
sound __, 16, $b7, $0641
sound __, 11, $96, $0642
sound __, 16, $a7, $0651
@@ -1299,7 +1299,7 @@ Cry_Vulpix_Ch8: ; f36f3
; f3703
Cry_Rhydon_Ch5: ; f3703
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 7, $f7, $07a0
sound __, 9, $e6, $07a4
sound __, 5, $d6, $07a0
@@ -1311,7 +1311,7 @@ Cry_Rhydon_Ch5: ; f3703
; f3722
Cry_Rhydon_Ch6: ; f3722
- unknownmusic0xde $a
+ sound_duty 2, 2, 0, 0
sound __, 5, $8, 0
sound __, 7, $a7, $0741
sound __, 9, $86, $0743
@@ -1335,7 +1335,7 @@ Cry_Rhydon_Ch8: ; f3745
; f375b
Cry_Weepinbell_Ch5: ; f375b
- unknownmusic0xde $a5
+ sound_duty 1, 1, 2, 2
sound __, 7, $f4, $0740
sound __, 16, $e3, $0730
sound __, 5, $f4, $0740
@@ -1345,7 +1345,7 @@ Cry_Weepinbell_Ch5: ; f375b
; f3772
Cry_Weepinbell_Ch6: ; f3772
- unknownmusic0xde $77
+ sound_duty 3, 1, 3, 1
sound __, 7, $c3, $0712
sound __, 16, $b3, $0704
sound __, 4, $c3, $0712
@@ -1363,7 +1363,7 @@ Cry_Weepinbell_Ch8: ; f3789
; f3796
Cry_Kangaskhan_Ch5: ; f3796
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 5, $f7, $0608
sound __, 7, $e6, $0600
sound __, 7, $d7, $05f0
@@ -1375,7 +1375,7 @@ Cry_Kangaskhan_Ch5: ; f3796
; f37b5
Cry_Kangaskhan_Ch6: ; f37b5
- unknownmusic0xde $a
+ sound_duty 2, 2, 0, 0
sound __, 5, $c7, $0504
sound __, 7, $a6, $0502
sound __, 7, $97, $04f1
@@ -1395,7 +1395,7 @@ Cry_Kangaskhan_Ch8: ; f37d4
; f37e1
Cry_Bulbasaur_Ch5: ; f37e1
- unknownmusic0xde $f1
+ sound_duty 1, 0, 3, 3
sound __, 5, $f7, $07c0
sound __, 13, $e6, $07c2
sound __, 7, $b5, $0680
@@ -1406,7 +1406,7 @@ Cry_Bulbasaur_Ch5: ; f37e1
; f37fc
Cry_Bulbasaur_Ch6: ; f37fc
- unknownmusic0xde $cc
+ sound_duty 0, 3, 0, 3
sound __, 4, $c7, $0781
sound __, 13, $b6, $0780
sound __, 7, $a5, $0641
@@ -1426,7 +1426,7 @@ Cry_Bulbasaur_Ch8: ; f3817
; f3827
Cry_Spearow_Ch5: ; f3827
- unknownmusic0xde $c9
+ sound_duty 1, 2, 0, 3
sound __, 9, $f7, $0680
sound __, 3, $f7, $0660
sound __, 2, $e7, $0640
@@ -1439,7 +1439,7 @@ Cry_Spearow_Ch5: ; f3827
; f384a
Cry_Spearow_Ch6: ; f384a
- unknownmusic0xde $79
+ sound_duty 1, 2, 3, 1
sound __, 11, $e7, $0682
sound __, 3, $e7, $0662
sound __, 2, $d7, $0642
@@ -1459,7 +1459,7 @@ Cry_Spearow_Ch8: ; f386d
; f3877
Cry_Nidoran_M_Ch5: ; f3877
- unknownmusic0xde $f5
+ sound_duty 1, 1, 3, 3
sound __, 5, $f3, $0718
sound __, 16, $e5, $0798
sound __, 9, $91, $0758
@@ -1467,7 +1467,7 @@ Cry_Nidoran_M_Ch5: ; f3877
; f3886
Cry_Nidoran_M_Ch6: ; f3886
- unknownmusic0xde $a0
+ sound_duty 0, 0, 2, 2
sound __, 6, $b3, $0708
sound __, 16, $c5, $0788
sound __, 9, $71, $0748
@@ -1482,7 +1482,7 @@ Cry_Nidoran_M_Ch8: ; f3895
; f389f
Cry_Pidgey_Ch5: ; f389f
- unknownmusic0xde $a5
+ sound_duty 1, 1, 2, 2
sound __, 5, $e1, $0700
sound __, 5, $f2, $0780
sound __, 3, $92, $0740
@@ -1491,7 +1491,7 @@ Cry_Pidgey_Ch5: ; f389f
; f38b2
Cry_Pidgey_Ch6: ; f38b2
- unknownmusic0xde $a
+ sound_duty 2, 2, 0, 0
sound __, 5, $b1, $06e1
sound __, 4, $c2, $06e1
sound __, 4, $62, $0681
@@ -1507,7 +1507,7 @@ Cry_Pidgey_Ch8: ; f38c5
; f38cf
Cry_Voltorb_Ch5: ; f38cf
- unknownmusic0xde $fa
+ sound_duty 2, 2, 3, 3
sound __, 7, $83, $0247
sound __, 16, $62, $0226
sound __, 5, $52, $0245
@@ -1529,7 +1529,7 @@ Cry_Voltorb_Ch8: ; f38ea
; f38fd
Cry_Muk_Ch5: ; f38fd
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 5, $f3, $06e0
sound __, 16, $e4, $0640
sound __, 9, $c1, $0620
@@ -1537,7 +1537,7 @@ Cry_Muk_Ch5: ; f38fd
; f390c
Cry_Muk_Ch6: ; f390c
- unknownmusic0xde $a
+ sound_duty 2, 2, 0, 0
sound __, 4, $c3, $0683
sound __, 15, $b4, $0602
sound __, 9, $a1, $0601
@@ -1552,7 +1552,7 @@ Cry_Muk_Ch8: ; f391b
; f3925
Cry_Grimer_Ch5: ; f3925
- unknownmusic0xde $a
+ sound_duty 2, 2, 0, 0
sound __, 7, $e2, $0500
sound __, 7, $e3, $0580
sound __, 7, $d3, $0570
@@ -1561,7 +1561,7 @@ Cry_Grimer_Ch5: ; f3925
; f3938
Cry_Grimer_Ch6: ; f3938
- unknownmusic0xde $f5
+ sound_duty 1, 1, 3, 3
sound __, 7, $e2, $0482
sound __, 7, $d3, $0501
sound __, 7, $b2, $04e2
@@ -1571,7 +1571,7 @@ Cry_Grimer_Ch8: ; f394a
; f394b
Cry_Diglett_Ch5: ; f394b
- unknownmusic0xde $cc
+ sound_duty 0, 3, 0, 3
sound __, 5, $f1, $0700
sound __, 5, $e1, $0780
sound __, 5, $d1, $0740
@@ -1586,7 +1586,7 @@ Cry_Diglett_Ch5: ; f394b
; f3976
Cry_Diglett_Ch6: ; f3976
- unknownmusic0xde $44
+ sound_duty 0, 1, 0, 1
sound __, 13, $8, 0
sound __, 5, $f1, $0701
sound __, 5, $e1, $0782
@@ -1610,7 +1610,7 @@ Cry_Diglett_Ch8: ; f3995
; f39ae
Cry_Seel_Ch5: ; f39ae
- unknownmusic0xde $cc
+ sound_duty 0, 3, 0, 3
sound __, 9, $f5, $0600
sound __, 3, $d2, $0638
sound __, 3, $c2, $0630
@@ -1624,7 +1624,7 @@ Cry_Seel_Ch5: ; f39ae
; f39d5
Cry_Seel_Ch6: ; f39d5
- unknownmusic0xde $44
+ sound_duty 0, 1, 0, 1
sound __, 13, $c3, $05c0
sound __, 4, $b1, $05f9
sound __, 3, $a1, $05f1
@@ -1639,7 +1639,7 @@ Cry_Seel_Ch8: ; f39fb
; f39fc
Cry_Slowpoke_Ch5: ; f39fc
- unknownmusic0xde $0
+ sound_duty 0, 0, 0, 0
sound __, 9, $f5, $0480
sound __, 3, $e1, $05e0
sound __, 9, $d1, $05dc
@@ -1647,7 +1647,7 @@ Cry_Slowpoke_Ch5: ; f39fc
; f3a0b
Cry_Slowpoke_Ch6: ; f3a0b
- unknownmusic0xde $a5
+ sound_duty 1, 1, 2, 2
sound __, 8, $95, $0441
sound __, 3, $81, $0521
sound __, 9, $61, $051a
@@ -1657,7 +1657,7 @@ Cry_Slowpoke_Ch8: ; f3a19
Cry_Drowzee_Ch5: ; f3a1a
Cry_Drowzee_branch_f3a1a: ; f3a1a
- unknownmusic0xde $88
+ sound_duty 0, 2, 0, 2
sound __, 6, $f2, $0650
sound __, 10, $d1, $0660
sound __, 6, $e2, $0612
@@ -1669,7 +1669,7 @@ Cry_Drowzee_branch_f3a1a: ; f3a1a
; f3a39
Cry_Drowzee_Ch6: ; f3a39
- unknownmusic0xde $40
+ sound_duty 0, 0, 0, 1
sound __, 5, $8, 0
sound __, 6, $f2, $0651
sound __, 10, $d1, $0661
@@ -1699,7 +1699,7 @@ Cry_Drowzee_Ch8: ; f3a68
; f3a87
Cry_Nidoran_F_Ch5: ; f3a87
- unknownmusic0xde $a0
+ sound_duty 0, 0, 2, 2
sound __, 5, $f3, $0600
sound __, 9, $d5, $0760
sound __, 4, $e2, $0720
@@ -1708,7 +1708,7 @@ Cry_Nidoran_F_Ch5: ; f3a87
; f3a9a
Cry_Nidoran_F_Ch6: ; f3a9a
- unknownmusic0xde $5a
+ sound_duty 2, 2, 1, 1
sound __, 6, $b3, $06f1
sound __, 8, $c5, $0752
sound __, 4, $a2, $0711
@@ -1725,7 +1725,7 @@ Cry_Nidoran_F_Ch8: ; f3aad
; f3aba
Cry_Nidoqueen_Ch5: ; f3aba
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 9, $f7, $06e0
sound __, 7, $e6, $06e5
sound __, 4, $f4, $06e0
@@ -1737,7 +1737,7 @@ Cry_Nidoqueen_Ch5: ; f3aba
; f3ad9
Cry_Nidoqueen_Ch6: ; f3ad9
- unknownmusic0xde $5
+ sound_duty 1, 1, 0, 0
sound __, 4, $8, 0
sound __, 9, $a7, $06a1
sound __, 7, $86, $06a3
@@ -1762,7 +1762,7 @@ Cry_Nidoqueen_Ch8: ; f3afc
; f3b15
Cry_Oddish_Ch5: ; f3b15
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 16, $f6, $0565
sound __, 11, $e4, $057c
sound __, 4, $c2, $055c
@@ -1771,7 +1771,7 @@ Cry_Oddish_Ch5: ; f3b15
; f3b28
Cry_Oddish_Ch6: ; f3b28
- unknownmusic0xde $5a
+ sound_duty 2, 2, 1, 1
sound __, 15, $d6, $0503
sound __, 10, $b4, $051b
sound __, 5, $92, $04fa
@@ -1787,7 +1787,7 @@ Cry_Oddish_Ch8: ; f3b3b
; f3b45
Cry_Charmander_Ch5: ; f3b45
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 5, $f7, $06a0
sound __, 9, $e6, $06a4
sound __, 5, $d6, $06a0
@@ -1799,7 +1799,7 @@ Cry_Charmander_Ch5: ; f3b45
; f3b64
Cry_Charmander_Ch6: ; f3b64
- unknownmusic0xde $5a
+ sound_duty 2, 2, 1, 1
sound __, 5, $e7, $0601
sound __, 9, $d6, $0603
sound __, 5, $c6, $0601
@@ -1821,7 +1821,7 @@ Cry_Charmander_Ch8: ; f3b83
; f3b96
Cry_Clefairy_Ch5: ; f3b96
- unknownmusic0xde $1b
+ sound_duty 3, 2, 1, 0
sound __, 8, $d2, $0740
sound __, 16, $e5, $0760
sound C_, 9, $c1, $0730
@@ -1829,7 +1829,7 @@ Cry_Clefairy_Ch5: ; f3b96
; f3ba5
Cry_Clefairy_Ch6: ; f3ba5
- unknownmusic0xde $81
+ sound_duty 1, 0, 0, 2
sound __, 3, $c2, $0701
sound __, 5, $c2, $0708
sound __, 16, $d7, $0741
@@ -1839,7 +1839,7 @@ Cry_Clefairy_Ch8: ; f3bb7
; f3bb8
Cry_Caterpie_Ch5: ; f3bb8
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 16, $d7, $0780
sound __, 5, $e6, $07a0
sound __, 16, $d2, $0740
@@ -1847,7 +1847,7 @@ Cry_Caterpie_Ch5: ; f3bb8
; f3bc7
Cry_Caterpie_Ch6: ; f3bc7
- unknownmusic0xde $5a
+ sound_duty 2, 2, 1, 1
sound __, 16, $c7, $0753
sound __, 6, $b6, $0772
sound __, 16, $c2, $0711
@@ -1862,7 +1862,7 @@ Cry_Caterpie_Ch8: ; f3bd6
; f3be0
Cry_Lapras_Ch5: ; f3be0
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 7, $f7, $06c0
sound __, 16, $e7, $0700
sound __, 5, $f4, $06f0
@@ -1872,7 +1872,7 @@ Cry_Lapras_Ch5: ; f3be0
; f3bf7
Cry_Lapras_Ch6: ; f3bf7
- unknownmusic0xde $a
+ sound_duty 2, 2, 0, 0
sound __, 8, $e6, $0681
sound __, 15, $d5, $06c1
sound __, 5, $c4, $06b1
@@ -1890,7 +1890,7 @@ Cry_Lapras_Ch8: ; f3c0e
; f3c1b
Cry_Golem_Ch5: ; f3c1b
- unknownmusic0xde $a5
+ sound_duty 1, 1, 2, 2
sound __, 13, $f2, $0440
sound __, 16, $e3, $04a0
sound __, 5, $d2, $0490
@@ -1899,7 +1899,7 @@ Cry_Golem_Ch5: ; f3c1b
; f3c2e
Cry_Golem_Ch6: ; f3c2e
- unknownmusic0xde $ee
+ sound_duty 2, 3, 2, 3
sound __, 12, $d2, $0438
sound __, 15, $c6, $0498
sound __, 4, $b2, $0488
@@ -1916,7 +1916,7 @@ Cry_Golem_Ch8: ; f3c41
; f3c4e
Cry_Blastoise_Ch5: ; f3c4e
- unknownmusic0xde $33
+ sound_duty 3, 0, 3, 0
sound __, 16, $f6, $05c0
sound __, 9, $e3, $05bc
sound __, 7, $d2, $05d0
@@ -1927,7 +1927,7 @@ Cry_Blastoise_Ch5: ; f3c4e
; f3c69
Cry_Blastoise_Ch6: ; f3c69
- unknownmusic0xde $99
+ sound_duty 1, 2, 1, 2
sound __, 15, $c6, $04b1
sound __, 8, $c3, $04ad
sound __, 6, $b2, $04c1
@@ -1948,7 +1948,7 @@ Cry_Blastoise_Ch8: ; f3c84
; f3c97
Cry_Pidgeotto_Ch5: ; f3c97
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 9, $e4, $0790
sound __, 16, $f5, $07c0
sound __, 9, $d1, $07d8
@@ -1956,7 +1956,7 @@ Cry_Pidgeotto_Ch5: ; f3c97
; f3ca6
Cry_Pidgeotto_Ch6: ; f3ca6
- unknownmusic0xde $a5
+ sound_duty 1, 1, 2, 2
sound __, 11, $c4, $0771
sound __, 16, $b6, $07a2
sound __, 9, $a1, $07b7
@@ -1971,7 +1971,7 @@ Cry_Pidgeotto_Ch8: ; f3cb5
; f3cbf
Cry_Paras_Ch5: ; f3cbf
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 7, $f2, $0600
sound __, 7, $e2, $0640
sound __, 7, $d2, $0680
@@ -1984,7 +1984,7 @@ Cry_Paras_Ch5: ; f3cbf
; f3ce2
Cry_Paras_Ch6: ; f3ce2
- unknownmusic0xde $11
+ sound_duty 1, 0, 1, 0
sound __, 4, $8, $0001
sound __, 7, $c2, $05c1
sound __, 7, $b2, $0602
@@ -2011,7 +2011,7 @@ Cry_Paras_Ch8: ; f3d09
; f3d25
Cry_Weedle_Ch5: ; f3d25
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 5, $f3, $0780
sound __, 16, $e7, $0700
sound __, 9, $d3, $0710
@@ -2022,7 +2022,7 @@ Cry_Weedle_Ch5: ; f3d25
; f3d40
Cry_Weedle_Ch6: ; f3d40
- unknownmusic0xde $5a
+ sound_duty 2, 2, 1, 1
sound __, 7, $c3, $0701
sound __, 15, $b7, $0681
sound __, 8, $b3, $0692
@@ -2043,7 +2043,7 @@ Cry_Weedle_Ch8: ; f3d5b
; f3d6e
Cry_Ekans_Ch5: ; f3d6e
- unknownmusic0xde $f
+ sound_duty 3, 3, 0, 0
sound __, 16, $f7, $0500
sound __, 16, $e7, $0508
sound __, 9, $b4, $0480
@@ -2052,7 +2052,7 @@ Cry_Ekans_Ch5: ; f3d6e
; f3d81
Cry_Ekans_Ch6: ; f3d81
- unknownmusic0xde $44
+ sound_duty 0, 1, 0, 1
sound __, 15, $d7, $0481
sound __, 15, $c7, $0489
sound __, 11, $b4, $0401
@@ -2069,7 +2069,7 @@ Cry_Ekans_Ch8: ; f3d94
; f3da1
Cry_Metapod_Ch5: ; f3da1
- unknownmusic0xde $f5
+ sound_duty 1, 1, 3, 3
sound __, 8, $d6, $07e1
sound __, 7, $c6, $07e2
sound __, 10, $d6, $07e1
@@ -2082,7 +2082,7 @@ Cry_Metapod_Ch5: ; f3da1
; f3dc4
Cry_Metapod_Ch6: ; f3dc4
- unknownmusic0xde $44
+ sound_duty 0, 1, 0, 1
sound __, 7, $c3, $07c9
sound __, 7, $b3, $07c7
sound __, 11, $c4, $07c3
@@ -2102,7 +2102,7 @@ Cry_Metapod_Ch8: ; f3ddf
; f3def
Cry_Venonat_Ch5: ; f3def
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 7, $f7, $0740
sound __, 13, $e6, $0744
sound __, 7, $d5, $0750
@@ -2113,7 +2113,7 @@ Cry_Venonat_Ch5: ; f3def
; f3e0a
Cry_Venonat_Ch6: ; f3e0a
- unknownmusic0xde $a
+ sound_duty 2, 2, 0, 0
sound __, 7, $c7, $0701
sound __, 12, $b6, $0702
sound __, 7, $a5, $0711
@@ -2134,7 +2134,7 @@ Cry_Venonat_Ch8: ; f3e25
; f3e38
Cry_Squirtle_Ch5: ; f3e38
- unknownmusic0xde $f4
+ sound_duty 0, 1, 3, 3
sound __, 16, $f0, $0705
sound __, 11, $e0, $0700
sound __, 7, $b4, $0710
@@ -2145,7 +2145,7 @@ Cry_Squirtle_Ch5: ; f3e38
; f3e53
Cry_Squirtle_Ch6: ; f3e53
- unknownmusic0xde $22
+ sound_duty 2, 0, 2, 0
sound __, 16, $b0, $06c3
sound __, 11, $a0, $06c1
sound __, 7, $84, $06d2
@@ -2165,7 +2165,7 @@ Cry_Squirtle_Ch8: ; f3e6e
; f3e7e
Cry_Fearow_Ch5: ; f3e7e
- unknownmusic0xde $50
+ sound_duty 0, 0, 1, 1
sound __, 11, $f5, $0680
sound __, 4, $e2, $06a0
sound __, 4, $f2, $06c0
@@ -2178,7 +2178,7 @@ Cry_Fearow_Ch5: ; f3e7e
; f3ea1
Cry_Fearow_Ch6: ; f3ea1
- unknownmusic0xde $f
+ sound_duty 3, 3, 0, 0
sound __, 10, $d5, $0631
sound __, 4, $d2, $0652
sound __, 4, $e2, $0671
@@ -2201,7 +2201,7 @@ Cry_Fearow_Ch8: ; f3ec4
; f3ed7
Cry_Growlithe_Ch5: ; f3ed7
- unknownmusic0xde $a5
+ sound_duty 1, 1, 2, 2
sound __, 4, $f4, $0641
sound __, 14, $d6, $0721
sound __, 9, $f4, $0719
@@ -2210,7 +2210,7 @@ Cry_Growlithe_Ch5: ; f3ed7
; f3eea
Cry_Growlithe_Ch6: ; f3eea
- unknownmusic0xde $cc
+ sound_duty 0, 3, 0, 3
sound __, 5, $f4, $0580
sound __, 15, $e6, $06e0
sound __, 9, $d5, $06d8
@@ -2227,7 +2227,7 @@ Cry_Growlithe_Ch8: ; f3efd
; f3f0a
Cry_Krabby_Ch5: ; f3f0a
- unknownmusic0xde $f0
+ sound_duty 0, 0, 3, 3
sound __, 14, $f1, $0511
sound __, 14, $e1, $0515
sound __, 14, $e1, $0511
@@ -2236,7 +2236,7 @@ Cry_Krabby_Ch5: ; f3f0a
; f3f1d
Cry_Krabby_Ch6: ; f3f1d
- unknownmusic0xde $15
+ sound_duty 1, 1, 1, 0
sound __, 13, $e1, $050c
sound __, 13, $d1, $0510
sound __, 15, $c1, $050c
@@ -2253,7 +2253,7 @@ Cry_Krabby_Ch8: ; f3f30
; f3f3d
Cry_Psyduck_Ch5: ; f3f3d
- unknownmusic0xde $1b
+ sound_duty 3, 2, 1, 0
sound __, 4, $f3, $0564
sound __, 3, $e2, $0544
sound __, 6, $d1, $0522
@@ -2266,7 +2266,7 @@ Cry_Psyduck_Ch5: ; f3f3d
; f3f60
Cry_Psyduck_Ch6: ; f3f60
- unknownmusic0xde $cc
+ sound_duty 0, 3, 0, 3
sound __, 4, $d3, $0560
sound __, 3, $c2, $0540
sound __, 6, $c1, $0520
@@ -2280,7 +2280,7 @@ Cry_Psyduck_Ch8: ; f3f82
; f3f83
Cry_Rattata_Ch5: ; f3f83
- unknownmusic0xde $11
+ sound_duty 1, 0, 1, 0
sound __, 3, $3d, $0381
sound __, 8, $f5, $0601
sound __, 2, $c2, $0481
@@ -2289,7 +2289,7 @@ Cry_Rattata_Ch5: ; f3f83
; f3f96
Cry_Rattata_Ch6: ; f3f96
- unknownmusic0xde $ee
+ sound_duty 2, 3, 2, 3
sound __, 3, $3e, $05b0
sound __, 8, $d5, $075d
sound __, 2, $b2, $06b0
diff --git a/audio/engine.asm b/audio/engine.asm
index c8e976cc4..2cc921bd0 100644
--- a/audio/engine.asm
+++ b/audio/engine.asm
@@ -111,7 +111,7 @@ _UpdateSound:: ; e805c
cp $2 ; 1 or 0?
jr c, .noteover
dec [hl]
- jr .asm_e8093
+ jr .continue_sound_update
.noteover
; reset vibrato delay
@@ -124,12 +124,11 @@ _UpdateSound:: ; e805c
; turn vibrato off for now
ld hl, Channel1Flags2 - Channel1
add hl, bc
- res SOUND_UNKN_09, [hl]
+ res SOUND_PITCH_WHEEL, [hl]
; get next note
call ParseMusic
-.asm_e8093
- ;
- call Functione84f9
+.continue_sound_update
+ call ApplyPitchWheel
; duty cycle
ld hl, Channel1DutyCycle - Channel1
add hl, bc
@@ -143,8 +142,8 @@ _UpdateSound:: ; e805c
ld [wCurTrackFrequency], a
ld a, [hl]
ld [wCurTrackFrequency + 1], a
- ;
- call Functione8466 ; handle vibrato and other things
+ ; vibrato, noise
+ call HandleTrackVibrato ; handle vibrato and other things
call HandleNoise
; turn off music when playing sfx?
ld a, [SFXPriority]
@@ -176,19 +175,19 @@ _UpdateSound:: ; e805c
; are we in a sfx channel right now?
ld a, [CurChannel]
cp $4 ; sfx
- jr nc, .asm_e80ee
+ jr nc, .sfx_channel
ld hl, Channel5Flags - Channel1
add hl, bc
bit SOUND_CHANNEL_ON, [hl]
- jr nz, .asm_e80fc
-.asm_e80ee
+ jr nz, .sound_channel_on
+.sfx_channel
call UpdateChannels
ld hl, Channel1Tracks - Channel1
add hl, bc
ld a, [SoundOutput]
or [hl]
ld [SoundOutput], a
-.asm_e80fc
+.sound_channel_on
; clear note flags
ld hl, Channel1NoteFlags - Channel1
add hl, bc
@@ -232,7 +231,6 @@ UpdateChannels: ; e8125
ld l, a
jp [hl]
-
.ChannelFnPtrs:
dw .Channel1
dw .Channel2
@@ -260,21 +258,21 @@ UpdateChannels: ; e8125
.asm_e8159
bit NOTE_REST, [hl] ; rest
jr nz, .ch1rest
- bit NOTE_UNKN_4, [hl]
+ bit NOTE_NOISE_SAMPLING, [hl]
jr nz, .asm_e81a2
- bit NOTE_UNKN_1, [hl]
- jr nz, .asm_e816b
- bit NOTE_UNKN_6, [hl]
+ bit NOTE_FREQ_OVERRIDE, [hl]
+ jr nz, .frequency_override
+ bit NOTE_VIBRATO_OVERRIDE, [hl]
jr nz, .asm_e8184
- jr .asm_e8175
+ jr .check_duty_override
-.asm_e816b
+.frequency_override
ld a, [wCurTrackFrequency]
ld [rNR13], a
ld a, [wCurTrackFrequency + 1]
ld [rNR14], a
-.asm_e8175
- bit NOTE_UNKN_0, [hl]
+.check_duty_override
+ bit NOTE_DUTY_OVERRIDE, [hl]
ret z
ld a, [wCurTrackDuty]
ld d, a
@@ -323,11 +321,11 @@ UpdateChannels: ; e8125
add hl, bc
bit NOTE_REST, [hl] ; rest
jr nz, .ch2rest
- bit NOTE_UNKN_4, [hl]
+ bit NOTE_NOISE_SAMPLING, [hl]
jr nz, .asm_e8204
- bit NOTE_UNKN_6, [hl]
+ bit NOTE_VIBRATO_OVERRIDE, [hl]
jr nz, .asm_e81e6
- bit NOTE_UNKN_0, [hl]
+ bit NOTE_DUTY_OVERRIDE, [hl]
ret z
ld a, [wCurTrackDuty]
ld d, a
@@ -383,9 +381,9 @@ UpdateChannels: ; e8125
add hl, bc
bit NOTE_REST, [hl] ; rest
jr nz, .ch3rest
- bit NOTE_UNKN_4, [hl]
+ bit NOTE_NOISE_SAMPLING, [hl]
jr nz, .asm_e824d
- bit NOTE_UNKN_6, [hl]
+ bit NOTE_VIBRATO_OVERRIDE, [hl]
jr nz, .asm_e823a
ret
@@ -484,7 +482,7 @@ endr
add hl, bc
bit NOTE_REST, [hl] ; rest
jr nz, .ch4rest
- bit NOTE_UNKN_4, [hl]
+ bit NOTE_NOISE_SAMPLING, [hl]
jr nz, .asm_e82d4
ret
@@ -644,7 +642,6 @@ FadeMusic: ; e8358
dec a
jr .updatevolume
-
.novolume
; make sure volume is off
xor a
@@ -719,16 +716,16 @@ FadeMusic: ; e8358
; e83d1
LoadNote: ; e83d1
- ; check mute??
+ ; wait for pitch wheel to finish
ld hl, Channel1Flags2 - Channel1
add hl, bc
- bit SOUND_UNKN_09, [hl]
+ bit SOUND_PITCH_WHEEL, [hl]
ret z
; get note duration
ld hl, Channel1NoteDuration - Channel1
add hl, bc
ld a, [hl]
- ld hl, wc297 ; ????
+ ld hl, wCurNoteDuration
sub [hl]
jr nc, .ok
ld a, 1
@@ -740,8 +737,8 @@ LoadNote: ; e83d1
ld e, [hl]
inc hl
ld d, [hl]
- ; ????
- ld hl, Channel1Field0x21 - Channel1
+ ; get direction of pitch wheel
+ ld hl, Channel1PitchWheelTarget - Channel1
add hl, bc
ld a, e
sub [hl]
@@ -749,15 +746,13 @@ LoadNote: ; e83d1
ld a, d
sbc a, 0
ld d, a
- ; ????
- ld hl, Channel1Field0x22 - Channel1
+ ld hl, Channel1PitchWheelTarget + 1 - Channel1
add hl, bc
sub [hl]
jr nc, .greater_than
- ; ????
ld hl, Channel1Flags3 - Channel1
add hl, bc
- set SOUND_UNKN_11, [hl]
+ set SOUND_PITCH_WHEEL_DIR, [hl]
; get frequency
ld hl, Channel1Frequency - Channel1
add hl, bc
@@ -765,7 +760,7 @@ LoadNote: ; e83d1
inc hl
ld d, [hl]
; ????
- ld hl, Channel1Field0x21 - Channel1
+ ld hl, Channel1PitchWheelTarget - Channel1
add hl, bc
ld a, [hl]
sub e
@@ -774,7 +769,7 @@ LoadNote: ; e83d1
sbc a, 0
ld d, a
; ????
- ld hl, Channel1Field0x22 - Channel1
+ ld hl, Channel1PitchWheelTarget + 1 - Channel1
add hl, bc
ld a, [hl]
sub d
@@ -782,18 +777,17 @@ LoadNote: ; e83d1
jr .resume
.greater_than
- ; ????
ld hl, Channel1Flags3 - Channel1
add hl, bc
- res SOUND_UNKN_11, [hl]
+ res SOUND_PITCH_WHEEL_DIR, [hl]
; get frequency
ld hl, Channel1Frequency - Channel1
add hl, bc
ld e, [hl]
inc hl
ld d, [hl]
- ; ????
- ld hl, Channel1Field0x21 - Channel1
+ ; get distance from pitch wheel target
+ ld hl, Channel1PitchWheelTarget - Channel1
add hl, bc
ld a, e
sub [hl]
@@ -801,15 +795,17 @@ LoadNote: ; e83d1
ld a, d
sbc a, 0
ld d, a
- ; ????
- ld hl, Channel1Field0x22 - Channel1
+ ld hl, Channel1PitchWheelTarget + 1 - Channel1
add hl, bc
sub [hl]
ld d, a
.resume
+ ; de = x * [wCurNoteDuration] + y
+ ; x + 1 -> d
+ ; y -> a
push bc
- ld hl, wc297
- ld b, 0; loop count
+ ld hl, wCurNoteDuration
+ ld b, 0 ; quotient
.loop
inc b
ld a, e
@@ -823,18 +819,16 @@ LoadNote: ; e83d1
jr .loop
.quit
- ld a, e ; result
+ ld a, e ; remainder
add [hl]
- ld d, b ; loop count
- ; ????
+ ld d, b ; quotient
pop bc
- ld hl, Channel1Field0x23 - Channel1
+ ld hl, Channel1PitchWheelAmount - Channel1
add hl, bc
- ld [hl], d
- ld hl, Channel1Field0x24 - Channel1
+ ld [hl], d ; quotient
+ ld hl, Channel1PitchWheelAmountFraction - Channel1
add hl, bc
- ld [hl], a
- ; clear ????
+ ld [hl], a ; remainder
ld hl, Channel1Field0x25 - Channel1
add hl, bc
xor a
@@ -843,14 +837,13 @@ LoadNote: ; e83d1
; e8466
-Functione8466: ; e8466
-; handle vibrato and other things
-; unknowns: wCurTrackDuty, wCurTrackFrequency
+HandleTrackVibrato: ; e8466
+; handle duty, cry pitch, and vibrato
ld hl, Channel1Flags2 - Channel1
add hl, bc
bit SOUND_DUTY, [hl] ; duty
jr z, .next
- ld hl, Channel1Field0x1c - Channel1
+ ld hl, Channel1SFXDutyLoop - Channel1
add hl, bc
ld a, [hl]
rlca
@@ -860,7 +853,7 @@ Functione8466: ; e8466
ld [wCurTrackDuty], a
ld hl, Channel1NoteFlags - Channel1
add hl, bc
- set NOTE_UNKN_0, [hl]
+ set NOTE_DUTY_OVERRIDE, [hl]
.next
ld hl, Channel1Flags2 - Channel1
add hl, bc
@@ -937,9 +930,9 @@ Functione8466: ; e8466
ld d, a
ld a, e
sub d
- jr nc, .asm_e84ef
+ jr nc, .no_carry
ld a, 0
- jr .asm_e84ef
+ jr .no_carry
.down
; vibrato up
@@ -950,24 +943,24 @@ Functione8466: ; e8466
swap a ; move it to lo
;
add e
- jr nc, .asm_e84ef
+ jr nc, .no_carry
ld a, $ff
-.asm_e84ef
+.no_carry
ld [wCurTrackFrequency], a
;
ld hl, Channel1NoteFlags - Channel1
add hl, bc
- set NOTE_UNKN_6, [hl]
+ set NOTE_VIBRATO_OVERRIDE, [hl]
.quit
ret
; e84f9
-Functione84f9: ; e84f9
- ; quit if ????
+ApplyPitchWheel: ; e84f9
+ ; quit if pitch wheel inactive
ld hl, Channel1Flags2 - Channel1
add hl, bc
- bit SOUND_UNKN_09, [hl]
+ bit SOUND_PITCH_WHEEL, [hl]
ret z
; de = Frequency
ld hl, Channel1Frequency - Channel1
@@ -975,24 +968,24 @@ Functione84f9: ; e84f9
ld e, [hl]
inc hl
ld d, [hl]
- ;
+ ; check whether pitch wheel is going up or down
ld hl, Channel1Flags3 - Channel1
add hl, bc
- bit SOUND_UNKN_11, [hl]
- jr z, .next
- ;
- ld hl, Channel1Field0x23 - Channel1
+ bit SOUND_PITCH_WHEEL_DIR, [hl]
+ jr z, .decreasing
+ ; frequency += [Channel*PitchWheelAmount]
+ ld hl, Channel1PitchWheelAmount - Channel1
add hl, bc
ld l, [hl]
ld h, 0
add hl, de
ld d, h
ld e, l
- ; get ????
- ld hl, Channel1Field0x24 - Channel1
+ ; [Channel*Field0x25] += [Channel*PitchWheelAmountFraction]
+ ; if rollover: Frequency += 1
+ ld hl, Channel1PitchWheelAmountFraction - Channel1
add hl, bc
ld a, [hl]
- ; add it to ????
ld hl, Channel1Field0x25 - Channel1
add hl, bc
add [hl]
@@ -1003,23 +996,26 @@ Functione84f9: ; e84f9
ld a, 0
adc d
ld d, a
- ;
- ld hl, Channel1Field0x22 - Channel1
+ ; Compare the dw at [Channel*PitchWheelTarget] to de.
+ ; If frequency is greater, we're finished.
+ ; Otherwise, load the frequency and set two flags.
+ ld hl, Channel1PitchWheelTarget + 1 - Channel1
add hl, bc
ld a, [hl]
cp d
- jp c, .quit1
- jr nz, .quit2
- ld hl, Channel1Field0x21 - Channel1
+ jp c, .finished_pitch_wheel
+ jr nz, .continue_pitch_wheel
+ ld hl, Channel1PitchWheelTarget - Channel1
add hl, bc
ld a, [hl]
cp e
- jp c, .quit1
- jr .quit2
+ jp c, .finished_pitch_wheel
+ jr .continue_pitch_wheel
-.next
+.decreasing
+ ; frequency -= [Channel*PitchWheelAmount]
ld a, e
- ld hl, Channel1Field0x23 - Channel1
+ ld hl, Channel1PitchWheelAmount - Channel1
add hl, bc
ld e, [hl]
sub e
@@ -1027,7 +1023,9 @@ Functione84f9: ; e84f9
ld a, d
sbc a, 0
ld d, a
- ld hl, Channel1Field0x24 - Channel1
+ ; [Channel*Field0x25] *= 2
+ ; if rollover: Frequency -= 1
+ ld hl, Channel1PitchWheelAmountFraction - Channel1
add hl, bc
ld a, [hl]
add a
@@ -1037,28 +1035,31 @@ Functione84f9: ; e84f9
ld e, a
ld a, d
sbc a, 0
- ld d,a
- ld hl, Channel1Field0x22 - Channel1
+ ld d, a
+ ; Compare the dw at [Channel*PitchWheelTarget] to de.
+ ; If frequency is lower, we're finished.
+ ; Otherwise, load the frequency and set two flags.
+ ld hl, Channel1PitchWheelTarget + 1 - Channel1
add hl, bc
ld a, d
cp [hl]
- jr c, .quit1
- jr nz, .quit2
- ld hl, Channel1Field0x21 - Channel1
+ jr c, .finished_pitch_wheel
+ jr nz, .continue_pitch_wheel
+ ld hl, Channel1PitchWheelTarget - Channel1
add hl, bc
ld a, e
cp [hl]
- jr nc, .quit2
-.quit1
+ jr nc, .continue_pitch_wheel
+.finished_pitch_wheel
ld hl, Channel1Flags2 - Channel1
add hl, bc
- res SOUND_UNKN_09, [hl]
+ res SOUND_PITCH_WHEEL, [hl]
ld hl, Channel1Flags3 - Channel1
add hl, bc
- res SOUND_UNKN_11, [hl]
+ res SOUND_PITCH_WHEEL_DIR, [hl]
ret
-.quit2
+.continue_pitch_wheel
ld hl, Channel1Frequency - Channel1
add hl, bc
ld [hl], e
@@ -1066,8 +1067,8 @@ Functione84f9: ; e84f9
ld [hl], d
ld hl, Channel1NoteFlags - Channel1
add hl, bc
- set NOTE_UNKN_1, [hl]
- set NOTE_UNKN_0, [hl]
+ set NOTE_FREQ_OVERRIDE, [hl]
+ set NOTE_DUTY_OVERRIDE, [hl]
ret
; e858c
@@ -1144,7 +1145,7 @@ ReadNoiseSample: ; e85af
ld hl, Channel1NoteFlags - Channel1
add hl, bc
- set NOTE_UNKN_4, [hl]
+ set NOTE_NOISE_SAMPLING, [hl]
ret
.quit
@@ -1170,9 +1171,9 @@ ParseMusic: ; e85e1
ld hl, Channel1Flags - Channel1
add hl, bc
bit SOUND_SFX, [hl]
- jp nz, Functione8698
+ jp nz, ParseSFXOrRest
bit SOUND_REST, [hl] ; rest
- jp nz, Functione8698
+ jp nz, ParseSFXOrRest
bit SOUND_NOISE, [hl] ; noise sample
jp nz, GetNoiseSample
; normal note
@@ -1205,11 +1206,9 @@ ParseMusic: ; e85e1
; ????
ld hl, Channel1NoteFlags - Channel1
add hl, bc
- set NOTE_UNKN_4, [hl]
+ set NOTE_NOISE_SAMPLING, [hl]
jp LoadNote
-
-
.rest
; note = rest
ld hl, Channel1NoteFlags - Channel1
@@ -1217,7 +1216,6 @@ ParseMusic: ; e85e1
set NOTE_REST, [hl] ; Rest
ret
-;
.endchannel
; $ff is reached in music data
ld hl, Channel1Flags - Channel1
@@ -1286,11 +1284,11 @@ RestoreVolume: ; e8679
; e8698
-Functione8698: ; e8698
+ParseSFXOrRest: ; e8698
; turn noise sampling on
ld hl, Channel1NoteFlags - Channel1
add hl, bc
- set NOTE_UNKN_4, [hl] ; noise sample
+ set NOTE_NOISE_SAMPLING, [hl] ; noise sample
; update note duration
ld a, [CurMusicByte]
call SetNoteDuration ; top nybble doesnt matter?
@@ -1348,9 +1346,8 @@ GetNoiseSample: ; e86c5
ld d, 0
; load ptr to noise sample set in hl
ld hl, Drumkits
-rept 2
add hl, de
-endr
+ add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
@@ -1363,9 +1360,8 @@ endr
; use 'pitch' to seek noise sample set
ld e, a
ld d, 0
-rept 2
add hl, de
-endr
+ add hl, de
; load sample pointer into NoiseSampleAddress
ld a, [hli]
ld [NoiseSampleAddressLo], a
@@ -1387,9 +1383,8 @@ ParseMusicCommand: ; e870f
ld d, 0
; seek command pointer
ld hl, MusicCommands
-rept 2
add hl, de
-endr
+ add hl, de
; jump to the new pointer
ld a, [hli]
ld h, [hl]
@@ -1415,9 +1410,9 @@ MusicCommands: ; e8720
dw Music_DutyCycle ; duty cycle
dw Music_Intensity ; intensity
dw Music_SoundStatus ; update sound status
- dw MusicDE ; ???? + duty cycle
- dw Music_ToggleSFX ;
- dw MusicE0 ;
+ dw Music_SoundDuty ; sfx duty
+ dw Music_ToggleSFX ; sound on/off
+ dw Music_SlidePitchTo ; pitch wheel
dw Music_Vibrato ; vibrato
dw MusicE2 ; unused
dw Music_ToggleNoise ; music noise sampling
@@ -1443,8 +1438,8 @@ MusicCommands: ; e8720
dw MusicF7 ; nothing
dw MusicF8 ; nothing
dw MusicF9 ; unused
- dw Music_SetCondition ;
- dw Music_JumpIf ;
+ dw Music_SetCondition ; setcondition
+ dw Music_JumpIf ; jumpif
dw Music_JumpChannel ; jump
dw Music_LoopChannel ; loop
dw Music_CallChannel ; call
@@ -1639,9 +1634,8 @@ Music_JumpIf: ; e8817
inc hl
ld d, [hl]
; skip pointer
-rept 2
inc de
-endr
+ inc de
; update address
ld [hl], d
dec hl
@@ -1693,9 +1687,8 @@ MusicEE; e883e
inc hl
ld d, [hl]
; skip pointer
-rept 2
inc de
-endr
+ inc de
; update address
ld [hl], d
dec hl
@@ -1801,38 +1794,42 @@ Music_Vibrato: ; e8882
; e88bd
-MusicE0: ; e88bd
-; ????
+Music_SlidePitchTo: ; e88bd
+; set the target for pitch wheel
; params: 2
+; note duration
+; target note
call GetMusicByte
- ld [wc297], a
+ ld [wCurNoteDuration], a
call GetMusicByte
+ ; pitch in e
ld d, a
and $f
ld e, a
+ ; octave in d
ld a, d
swap a
and $f
ld d, a
call GetFrequency
- ld hl, Channel1Field0x21 - Channel1
+ ld hl, Channel1PitchWheelTarget - Channel1
add hl, bc
ld [hl], e
- ld hl, Channel1Field0x22 - Channel1
+ ld hl, Channel1PitchWheelTarget + 1 - Channel1
add hl, bc
ld [hl], d
ld hl, Channel1Flags2 - Channel1
add hl, bc
- set SOUND_UNKN_09, [hl]
+ set SOUND_PITCH_WHEEL, [hl]
ret
; e88e4
Music_Tone: ; e88e4
; tone
-; params: 2
+; params: 1 (dw)
ld hl, Channel1Flags2 - Channel1
add hl, bc
set SOUND_CRY_PITCH, [hl]
@@ -1860,18 +1857,17 @@ MusicE7: ; e88f7
; e8906
-MusicDE: ; e8906
-; ???? + duty cycle
-; params: 1
- ;
+Music_SoundDuty: ; e8906
+; sequence of 4 duty cycles to be looped
+; params: 1 (4 2-bit duty cycle arguments)
ld hl, Channel1Flags2 - Channel1
add hl, bc
set SOUND_DUTY, [hl] ; duty cycle
- ;
+ ; sound duty sequence
call GetMusicByte
rrca
rrca
- ld hl, Channel1Field0x1c - Channel1
+ ld hl, Channel1SFXDutyLoop - Channel1
add hl, bc
ld [hl], a
; update duty cycle
@@ -2055,7 +2051,7 @@ Music_ForceOctave: ; e89b1
; this forces all notes up by the starting octave
; params: 1
call GetMusicByte
- ld hl, Channel1StartingOctave - Channel1
+ ld hl, Channel1PitchOffset - Channel1
add hl, bc
ld [hl], a
ret
@@ -2247,7 +2243,7 @@ GetFrequency: ; e8a5d
; get octave
; get starting octave
- ld hl, Channel1StartingOctave - Channel1
+ ld hl, Channel1PitchOffset - Channel1
add hl, bc
ld a, [hl]
swap a ; hi nybble
@@ -2256,7 +2252,7 @@ GetFrequency: ; e8a5d
add d
push af ; we'll use this later
; get starting octave
- ld hl, Channel1StartingOctave - Channel1
+ ld hl, Channel1PitchOffset - Channel1
add hl, bc
ld a, [hl]
and $f ; lo nybble
@@ -2494,9 +2490,9 @@ _PlayCryHeader:: ; e8b79
; 3-byte pointers (bank, address)
ld hl, Cries
-rept 3
add hl, de
-endr
+ add hl, de
+ add hl, de
ld a, [hli]
ld [MusicBank], a
@@ -2574,7 +2570,6 @@ endr
dec a
jr nz, .loop
-
; Cries play at max volume, so we save the current volume for later.
ld a, [LastVolume]
and a
@@ -2694,7 +2689,6 @@ _PlaySFX:: ; e8c04
; e8ca6
-
PlayStereoSFX:: ; e8ca6
; play sfx de
@@ -2713,9 +2707,9 @@ PlayStereoSFX:: ; e8ca6
; get sfx ptr
ld hl, SFX
-rept 3
add hl, de
-endr
+ add hl, de
+ add hl, de
; bank
ld a, [hli]
@@ -2798,7 +2792,6 @@ endr
; e8d1b
-
LoadChannel: ; e8d1b
; prep channel for use
; input:
@@ -2811,9 +2804,8 @@ LoadChannel: ; e8d1b
ld c, a
ld b, 0
ld hl, ChannelPointers
-rept 2
add hl, bc
-endr
+ add hl, bc
ld c, [hl]
inc hl
ld b, [hl] ; bc = channel pointer
@@ -2891,31 +2883,31 @@ LoadMusicByte:: ; e8d76
; e8d80
FrequencyTable: ; e8d80
- dw 0 ; filler
- dw $f82c
- dw $f89d
- dw $f907
- dw $f96b
- dw $f9ca
- dw $fa23
- dw $fa77
- dw $fac7
- dw $fb12
- dw $fb58
- dw $fb9b
- dw $fbda
- dw $fc16
- dw $fc4e
- dw $fc83
- dw $fcb5
- dw $fce5
- dw $fd11
- dw $fd3b
- dw $fd63
- dw $fd89
- dw $fdac
- dw $fdcd
- dw $fded
+ dw 0 ; __
+ dw $f82c ; C_
+ dw $f89d ; C#
+ dw $f907 ; D_
+ dw $f96b ; D#
+ dw $f9ca ; E_
+ dw $fa23 ; F_
+ dw $fa77 ; F#
+ dw $fac7 ; G_
+ dw $fb12 ; G#
+ dw $fb58 ; A_
+ dw $fb9b ; A#
+ dw $fbda ; B_
+ dw $fc16 ; C_
+ dw $fc4e ; C#
+ dw $fc83 ; D_
+ dw $fcb5 ; D#
+ dw $fce5 ; E_
+ dw $fd11 ; F_
+ dw $fd3b ; F#
+ dw $fd63 ; G_
+ dw $fd89 ; G#
+ dw $fdac ; A_
+ dw $fdcd ; A#
+ dw $fded ; B_
; e8db2
WaveSamples: ; e8db2
@@ -3282,9 +3274,8 @@ ClearChannels:: ; e8fe9
; doesn't seem to be used, but functionally identical to MapSetup_Sound_Off
ld hl, rNR50
xor a
-rept 2
ld [hli], a
-endr
+ ld [hli], a
ld a, $80
ld [hli], a
ld hl, rNR10
diff --git a/audio/music/clair.asm b/audio/music/clair.asm
index d4ea143b3..bedfc4dee 100644
--- a/audio/music/clair.asm
+++ b/audio/music/clair.asm
@@ -207,9 +207,9 @@ Music_Clair_branch_1fb77: ; 1fb77
octave 3
note A#, 16
note __, 4
- forceoctave $c
+ pitchoffset 0, CC
callchannel Music_Clair_branch_1fba6
- forceoctave $0
+ pitchoffset 0, C_
octave 5
note F#, 2
note __, 4
@@ -254,7 +254,7 @@ Music_Clair_branch_1fba6: ; 1fba6
Music_Clair_Ch3: ; 1fbb9
notetype $c, $14
- forceoctave $c
+ pitchoffset 0, CC
octave 3
note C#, 2
note __, 4
diff --git a/audio/music/credits.asm b/audio/music/credits.asm
index 532faef70..708b70ee4 100644
--- a/audio/music/credits.asm
+++ b/audio/music/credits.asm
@@ -142,12 +142,12 @@ Music_Credits_Ch1: ; 1f328
note E_, 7
octave 3
note __, 1
- forceoctave $2
+ pitchoffset 0, D_
callchannel Music_Credits_branch_1f483
callchannel Music_Credits_branch_1f4ed
callchannel Music_Credits_branch_1f4f8
callchannel Music_Credits_branch_1f559
- forceoctave $0
+ pitchoffset 0, C_
octave 3
note A_, 12
notetype $8, $a7
@@ -664,11 +664,11 @@ Music_Credits_Ch2: ; 1f58d
note A_, 4
note G_, 4
notetype $6, $c7
- forceoctave $2
+ pitchoffset 0, D_
callchannel Music_Credits_branch_1f6cb
callchannel Music_Credits_branch_1f73f
callchannel Music_Credits_branch_1f748
- forceoctave $0
+ pitchoffset 0, C_
octave 5
note C#, 1
note D_, 11
@@ -1139,15 +1139,15 @@ Music_Credits_Ch3: ; 1f772
note F_, 1
note F#, 7
note G_, 8
- forceoctave $2
+ pitchoffset 0, D_
callchannel Music_Credits_branch_1f8aa
callchannel Music_Credits_branch_1f8db
- forceoctave $12
+ pitchoffset 1, D_
callchannel Music_Credits_branch_1f8e7
- forceoctave $2
+ pitchoffset 0, D_
callchannel Music_Credits_branch_1f934
callchannel Music_Credits_branch_1f94b
- forceoctave $0
+ pitchoffset 0, C_
octave 6
note C#, 2
octave 5
diff --git a/audio/music/evolution.asm b/audio/music/evolution.asm
index ce07a300b..61f7af716 100644
--- a/audio/music/evolution.asm
+++ b/audio/music/evolution.asm
@@ -13,13 +13,13 @@ Music_Evolution_Ch1: ; f06ed
dutycycle $2
notetype $c, $92
octave 3
- unknownmusic0xe0 $0, 4, A_
+ slidepitchto 1, 4, A_
note C_, 1
- unknownmusic0xe0 $0, 4, A_
+ slidepitchto 1, 4, A_
note G_, 1
- unknownmusic0xe0 $0, 4, A_
+ slidepitchto 1, 4, A_
note C_, 1
- unknownmusic0xe0 $0, 4, A_
+ slidepitchto 1, 4, A_
note G_, 1
note __, 4
dutycycle $3
diff --git a/audio/music/goldenrodcity.asm b/audio/music/goldenrodcity.asm
index 89ee7d5bb..d7318310e 100644
--- a/audio/music/goldenrodcity.asm
+++ b/audio/music/goldenrodcity.asm
@@ -275,9 +275,8 @@ Music_GoldenrodCity_Ch3: ; eb584
vibrato $8, $23
notetype $c, $25
Music_GoldenrodCity_branch_eb58c: ; eb58c
-rept 2
callchannel Music_GoldenrodCity_branch_eb5aa
-endr
+ callchannel Music_GoldenrodCity_branch_eb5aa
callchannel Music_GoldenrodCity_branch_eb5d2
note __, 3
octave 3
diff --git a/audio/music/healpokemon.asm b/audio/music/healpokemon.asm
index 25f4ff4f7..264d3db78 100644
--- a/audio/music/healpokemon.asm
+++ b/audio/music/healpokemon.asm
@@ -11,16 +11,16 @@ Music_HealPokemon_Ch1: ; f06a0
tone $0001
notetype $c, $81
note __, 2
- unknownmusic0xe0 $0, 4, __
+ slidepitchto 1, 4, __
note B_, 2
- unknownmusic0xe0 $0, 5, E_
+ slidepitchto 1, 5, E_
note B_, 2
- unknownmusic0xe0 $0, 4, E_
+ slidepitchto 1, 4, E_
note E_, 2
note __, 4
- unknownmusic0xe0 $0, 3, __
+ slidepitchto 1, 3, __
note E_, 4
- unknownmusic0xe0 $0, 4, __
+ slidepitchto 1, 4, __
note B_, 4
endchannel
; f06c4
diff --git a/audio/music/johtowildbattle.asm b/audio/music/johtowildbattle.asm
index e775fa648..bcfde1824 100644
--- a/audio/music/johtowildbattle.asm
+++ b/audio/music/johtowildbattle.asm
@@ -492,9 +492,8 @@ Music_JohtoWildBattle_branch_f5fdb: ; f5fdb
note G_, 2
loopchannel 7, Music_JohtoWildBattle_branch_f5fdb
note F#, 4
-rept 2
callchannel Music_JohtoWildBattle_branch_f6055
-endr
+ callchannel Music_JohtoWildBattle_branch_f6055
Music_JohtoWildBattle_branch_f5fe8: ; f5fe8
note D_, 2
note G_, 2
diff --git a/audio/music/kantotrainerbattle.asm b/audio/music/kantotrainerbattle.asm
index fa21746db..10c1e7c0e 100644
--- a/audio/music/kantotrainerbattle.asm
+++ b/audio/music/kantotrainerbattle.asm
@@ -9,7 +9,7 @@ Music_KantoTrainerBattle: ; ec9fa
Music_KantoTrainerBattle_Ch1: ; eca04
tempo 114
volume $77
- forceoctave $1b
+ pitchoffset 1, B_
notetype $c, $b3
vibrato $12, $24
dutycycle $1
@@ -467,7 +467,7 @@ Music_KantoTrainerBattle_branch_eca88: ; eca88
; ecbea
Music_KantoTrainerBattle_Ch2: ; ecbea
- forceoctave $1b
+ pitchoffset 1, B_
vibrato $6, $36
dutycycle $1
notetype $c, $d1
@@ -920,7 +920,7 @@ Music_KantoTrainerBattle_branch_ecc41: ; ecc41
; ecdd2
Music_KantoTrainerBattle_Ch3: ; ecdd2
- forceoctave $1b
+ pitchoffset 1, B_
vibrato $12, $23
notetype $c, $15
octave 2
diff --git a/audio/music/kantowildbattle.asm b/audio/music/kantowildbattle.asm
index f867e1273..7f4f6e174 100644
--- a/audio/music/kantowildbattle.asm
+++ b/audio/music/kantowildbattle.asm
@@ -325,25 +325,21 @@ Music_KantoWildBattle_branch_ed1c8: ; ed1c8
note F_, 1
note F#, 1
notetype $6, $b7
-rept 2
callchannel Music_KantoWildBattle_branch_ed307
-endr
- forceoctave $1
-rept 2
callchannel Music_KantoWildBattle_branch_ed307
-endr
- forceoctave $0
+ pitchoffset 0, C#
+ callchannel Music_KantoWildBattle_branch_ed307
+ callchannel Music_KantoWildBattle_branch_ed307
+ pitchoffset 0, C_
rept 4
callchannel Music_KantoWildBattle_branch_ed307
endr
- forceoctave $1
-rept 2
+ pitchoffset 0, C#
+ callchannel Music_KantoWildBattle_branch_ed307
+ callchannel Music_KantoWildBattle_branch_ed307
+ pitchoffset 0, C_
callchannel Music_KantoWildBattle_branch_ed307
-endr
- forceoctave $0
-rept 2
callchannel Music_KantoWildBattle_branch_ed307
-endr
note __, 16
octave 3
note A#, 16
@@ -388,9 +384,9 @@ endr
note G#, 1
notetype $6, $b7
callchannel Music_KantoWildBattle_branch_ed31b
- forceoctave $1
+ pitchoffset 0, C#
callchannel Music_KantoWildBattle_branch_ed31b
- forceoctave $0
+ pitchoffset 0, C_
callchannel Music_KantoWildBattle_branch_ed340
octave 2
note C_, 2
@@ -454,9 +450,9 @@ endr
callchannel Music_KantoWildBattle_branch_ed354
callchannel Music_KantoWildBattle_branch_ed340
callchannel Music_KantoWildBattle_branch_ed354
- forceoctave $1
+ pitchoffset 0, C#
callchannel Music_KantoWildBattle_branch_ed340
- forceoctave $0
+ pitchoffset 0, C_
note C#, 2
note __, 2
octave 3
diff --git a/audio/music/lookofficer.asm b/audio/music/lookofficer.asm
index f0eb3af1e..a8667afdb 100644
--- a/audio/music/lookofficer.asm
+++ b/audio/music/lookofficer.asm
@@ -73,9 +73,9 @@ Music_LookOfficer_branch_ed882: ; ed882
note E_, 2
note G#, 2
loopchannel 2, Music_LookOfficer_branch_ed882
- forceoctave $1
+ pitchoffset 0, C#
callchannel Music_LookOfficer_branch_ed89e
- forceoctave $0
+ pitchoffset 0, C_
callchannel Music_LookOfficer_branch_ed89e
loopchannel 0, Music_LookOfficer_branch_ed882
; ed89e
diff --git a/audio/music/lookrocket.asm b/audio/music/lookrocket.asm
index 3ee5f3a5c..518a9b7e0 100644
--- a/audio/music/lookrocket.asm
+++ b/audio/music/lookrocket.asm
@@ -8,7 +8,7 @@ Music_LookRocket: ; f74a2
Music_LookRocket_Ch1: ; f74ae
tempo 123
volume $77
- forceoctave $2
+ pitchoffset 0, D_
stereopanning $f
dutycycle $3
vibrato $5, $64
@@ -94,7 +94,7 @@ Music_RocketTheme_branch_f750c: ; f750c
; f7514
Music_LookRocket_Ch2: ; f7514
- forceoctave $2
+ pitchoffset 0, D_
vibrato $4, $64
dutycycle $3
notetype $c, $b7
@@ -216,7 +216,7 @@ Music_RocketTheme_branch_f758a: ; f758a
; f7597
Music_LookRocket_Ch3: ; f7597
- forceoctave $2
+ pitchoffset 0, D_
vibrato $4, $22
notetype $c, $14
stereopanning $f0
diff --git a/audio/music/postcredits.asm b/audio/music/postcredits.asm
index fe4893da9..d998d6212 100644
--- a/audio/music/postcredits.asm
+++ b/audio/music/postcredits.asm
@@ -8,7 +8,7 @@ Music_PostCredits: ; cfd9e
Music_PostCredits_Ch1: ; cfda5
tempo 271
volume $77
- forceoctave $3
+ pitchoffset 0, D#
dutycycle $2
notetype $c, $93
note __, 8
@@ -133,7 +133,7 @@ Music_PostCredits_branch_cfdb2: ; cfdb2
; cfe48
Music_PostCredits_Ch2: ; cfe48
- forceoctave $3
+ pitchoffset 0, D#
dutycycle $2
notetype $c, $a3
octave 5
diff --git a/audio/music/profoak.asm b/audio/music/profoak.asm
index f0cd32a26..c24592350 100644
--- a/audio/music/profoak.asm
+++ b/audio/music/profoak.asm
@@ -34,10 +34,10 @@ Music_ProfOak_branch_f4e22: ; f4e22
callchannel Music_ProfOak_branch_f4e58
callchannel Music_ProfOak_branch_f4e6c
callchannel Music_ProfOak_branch_f4e6c
- forceoctave $2
+ pitchoffset 0, D_
callchannel Music_ProfOak_branch_f4e58
callchannel Music_ProfOak_branch_f4e58
- forceoctave $0
+ pitchoffset 0, C_
callchannel Music_ProfOak_branch_f4e6c
callchannel Music_ProfOak_branch_f4e6c
loopchannel 0, Music_ProfOak_branch_f4e22
@@ -241,10 +241,10 @@ Music_ProfOak_branch_f4f1d: ; f4f1d
callchannel Music_ProfOak_branch_f4f5a
callchannel Music_ProfOak_branch_f4f69
callchannel Music_ProfOak_branch_f4f69
- forceoctave $2
+ pitchoffset 0, D_
callchannel Music_ProfOak_branch_f4f5a
callchannel Music_ProfOak_branch_f4f5a
- forceoctave $0
+ pitchoffset 0, C_
callchannel Music_ProfOak_branch_f4f69
callchannel Music_ProfOak_branch_f4f69
loopchannel 0, Music_ProfOak_branch_f4f1d
diff --git a/audio/music/ssaqua.asm b/audio/music/ssaqua.asm
index e8782efb7..94570eccf 100644
--- a/audio/music/ssaqua.asm
+++ b/audio/music/ssaqua.asm
@@ -276,9 +276,9 @@ Music_SSAqua_branch_eaed5: ; eaed5
octave 4
note C#, 1
note E_, 1
- forceoctave $c
+ pitchoffset 0, CC
callchannel Music_SSAqua_branch_eafe0
- forceoctave $0
+ pitchoffset 0, C_
octave 3
note B_, 1
note __, 1
diff --git a/audio/music/surf.asm b/audio/music/surf.asm
index 18f0cab9f..8a04945d9 100644
--- a/audio/music/surf.asm
+++ b/audio/music/surf.asm
@@ -425,7 +425,7 @@ Music_Surf_branch_f5333: ; f5333
note B_, 16
octave 4
note C#, 8
- forceoctave $c
+ pitchoffset 0, CC
dutycycle $3
callchannel Music_Surf_branch_f53d6
intensity $b8
@@ -436,7 +436,7 @@ Music_Surf_branch_f5333: ; f5333
intensity $b8
dutycycle $1
callchannel Music_Surf_branch_f5404
- forceoctave $0
+ pitchoffset 0, C_
notetype $c, $b8
octave 4
note B_, 12
diff --git a/audio/music/wildpokemonvictory.asm b/audio/music/wildpokemonvictory.asm
index fba1ed40d..fc95e111e 100644
--- a/audio/music/wildpokemonvictory.asm
+++ b/audio/music/wildpokemonvictory.asm
@@ -29,14 +29,14 @@ Music_WildPokemonVictory_branch_f4538: ; f4538
intensity $78
octave 3
note G_, 4
- forceoctave $1
+ pitchoffset 0, C#
callchannel Music_WildPokemonVictory_branch_f455c
note F#, 2
note F#, 2
note F#, 4
callchannel Music_WildPokemonVictory_branch_f455c
note G#, 4
- forceoctave $0
+ pitchoffset 0, C_
intensity $78
octave 3
note F#, 4
@@ -97,7 +97,7 @@ Music_WildPokemonVictory_branch_f4587: ; f4587
note E_, 1
note G_, 1
note A#, 1
- forceoctave $1
+ pitchoffset 0, C#
callchannel Music_WildPokemonVictory_branch_f45b5
octave 4
note B_, 2
@@ -106,7 +106,7 @@ Music_WildPokemonVictory_branch_f4587: ; f4587
callchannel Music_WildPokemonVictory_branch_f45b5
octave 4
note B_, 4
- forceoctave $0
+ pitchoffset 0, C_
intensity $81
octave 3
note B_, 1
@@ -156,7 +156,7 @@ Music_WildPokemonVictory_branch_f45cf: ; f45cf
note E_, 2
note __, 2
note C_, 4
- forceoctave $1
+ pitchoffset 0, C#
callchannel Music_WildPokemonVictory_branch_f45f4
note D#, 2
note C#, 2
@@ -166,7 +166,7 @@ Music_WildPokemonVictory_branch_f45cf: ; f45cf
callchannel Music_WildPokemonVictory_branch_f45f4
note E_, 2
note __, 2
- forceoctave $0
+ pitchoffset 0, C_
octave 2
note B_, 4
loopchannel 0, Music_WildPokemonVictory_branch_f45cf
diff --git a/audio/sfx.asm b/audio/sfx.asm
index 0c65ae5db..0a13717e2 100644
--- a/audio/sfx.asm
+++ b/audio/sfx.asm
@@ -1957,9 +1957,9 @@ Sfx_GetBadge_Ch5: ; f1189
note F_, 3
callchannel Sfx_GetBadge_branch_f11aa
note A#, 3
- forceoctave $2
+ pitchoffset 0, D_
callchannel Sfx_GetBadge_branch_f11aa
- forceoctave $0
+ pitchoffset 0, C_
intensity $a7
note A_, 16
note __, 6
@@ -2322,7 +2322,7 @@ Sfx_Aeroblast: ; f1334
; f133a
Sfx_Aeroblast_Ch5: ; f133a
- unknownmusic0xde $f2
+ sound_duty 2, 0, 3, 3
soundinput $f5
sound C_, 13, $f8, $0580
soundinput $8
@@ -4762,7 +4762,7 @@ Sfx_Supersonic_branch_f21ef: ; f21ef
; f21fc
Sfx_Supersonic_Ch6: ; f21fc
- unknownmusic0xde $b3
+ sound_duty 3, 0, 3, 2
sound __, 16, $2f, $07c8
Sfx_Supersonic_branch_f2202: ; f2202
sound __, 16, $cf, $07c7
@@ -4790,7 +4790,7 @@ Sfx_Leer_branch_f221a: ; f221a
Sfx_Leer_Ch6: ; f2229
Sfx_Leer_branch_f2229: ; f2229
- unknownmusic0xde $b3
+ sound_duty 3, 0, 3, 2
sound __, 1, $e1, $07c1
sound __, 1, $e1, $0701
loopchannel 12, Sfx_Leer_branch_f2229
@@ -4807,7 +4807,7 @@ Sfx_Leer_branch_f2238: ; f2238
Sfx_Ember_Ch5: ; f2243
Sfx_Ember_branch_f2243: ; f2243
- unknownmusic0xde $c9
+ sound_duty 1, 2, 0, 3
sound __, 12, $f3, $0120
sound __, 10, $d3, $0150
loopchannel 5, Sfx_Ember_branch_f2243
@@ -4829,7 +4829,7 @@ Sfx_Ember_branch_f225a: ; f225a
Sfx_Bubblebeam_Ch5: ; f226e
Sfx_Bubblebeam_branch_f226e: ; f226e
- unknownmusic0xde $39
+ sound_duty 1, 2, 3, 0
sound __, 5, $f4, $0600
sound __, 4, $c4, $0500
sound __, 6, $b5, $0600
@@ -4841,7 +4841,7 @@ Sfx_Bubblebeam_branch_f226e: ; f226e
Sfx_Bubblebeam_Ch6: ; f2289
Sfx_Bubblebeam_branch_f2289: ; f2289
- unknownmusic0xde $8d
+ sound_duty 1, 3, 0, 2
sound __, 6, $e4, $05e0
sound __, 5, $b4, $04e0
sound __, 7, $a5, $05e8
@@ -4862,7 +4862,7 @@ Sfx_Bubblebeam_branch_f22a0: ; f22a0
Sfx_HydroPump_Ch5: ; f22b1
Sfx_HydroPump_branch_f22b1: ; f22b1
- unknownmusic0xde $d2
+ sound_duty 2, 0, 1, 3
sound __, 4, $81, $0300
sound __, 4, $c1, $0400
sound __, 4, $f1, $0500
@@ -4887,7 +4887,7 @@ Sfx_HydroPump_branch_f22d0: ; f22d0
Sfx_Surf_Ch5: ; f22e7
Sfx_Surf_branch_f22e7: ; f22e7
- unknownmusic0xde $39
+ sound_duty 1, 2, 3, 0
sound __, 16, $f4, $0500
sound __, 16, $c4, $0400
sound __, 16, $e2, $05c0
@@ -4897,7 +4897,7 @@ Sfx_Surf_branch_f22e7: ; f22e7
Sfx_Surf_Ch6: ; f22fa
Sfx_Surf_branch_f22fa: ; f22fa
- unknownmusic0xde $8d
+ sound_duty 1, 3, 0, 2
sound __, 8, $e4, $0430
sound __, 16, $b4, $0330
sound __, 16, $a2, $0438
@@ -4917,7 +4917,7 @@ Sfx_Surf_branch_f230d: ; f230d
Sfx_Psybeam_Ch5: ; f231e
Sfx_Psybeam_branch_f231e: ; f231e
- unknownmusic0xde $a1
+ sound_duty 1, 0, 2, 2
sound __, 11, $f1, $0640
sound __, 11, $f3, $0680
sound __, 11, $f2, $0620
@@ -4928,7 +4928,7 @@ Sfx_Psybeam_branch_f231e: ; f231e
Sfx_Psybeam_Ch6: ; f2335
Sfx_Psybeam_branch_f2335: ; f2335
- unknownmusic0xde $b3
+ sound_duty 3, 0, 3, 2
sound __, 11, $f3, $0571
sound __, 8, $e3, $0531
sound __, 11, $f1, $0551
@@ -4958,7 +4958,7 @@ Sfx_Charge_branch_f2357: ; f2357
Sfx_Charge_Ch6: ; f236e
Sfx_Charge_branch_f236e: ; f236e
- unknownmusic0xde $b3
+ sound_duty 3, 0, 3, 2
sound __, 3, $e1, $0302
sound __, 4, $e1, $07f2
sound __, 5, $e1, $0602
@@ -4979,7 +4979,7 @@ Sfx_Charge_branch_f2385: ; f2385
Sfx_Thundershock_Ch5: ; f2396
Sfx_Thundershock_branch_f2396: ; f2396
- unknownmusic0xde $2b
+ sound_duty 3, 2, 2, 0
sound __, 4, $f1, $07f0
sound __, 5, $f2, $0200
loopchannel 8, Sfx_Thundershock_branch_f2396
@@ -4988,7 +4988,7 @@ Sfx_Thundershock_branch_f2396: ; f2396
Sfx_Thundershock_Ch6: ; f23a5
Sfx_Thundershock_branch_f23a5: ; f23a5
- unknownmusic0xde $b3
+ sound_duty 3, 0, 3, 2
sound __, 5, $e2, $0202
sound __, 5, $e1, $07e2
loopchannel 9, Sfx_Thundershock_branch_f23a5
@@ -5092,7 +5092,7 @@ Sfx_Sharpen_Ch6: ; f2463
; f247a
Sfx_EggBomb_Ch5: ; f247a
- unknownmusic0xde $ed
+ sound_duty 1, 3, 2, 3
sound __, 9, $ff, $03f8
sound __, 16, $ff, $0400
sound __, 16, $f3, $0400
@@ -5100,7 +5100,7 @@ Sfx_EggBomb_Ch5: ; f247a
; f2489
Sfx_EggBomb_Ch6: ; f2489
- unknownmusic0xde $b4
+ sound_duty 0, 1, 3, 2
sound __, 9, $ef, $03c0
sound __, 16, $ef, $03c0
sound __, 16, $e3, $03c0
@@ -5168,7 +5168,7 @@ Sfx_HyperBeam_branch_f24f8: ; f24f8
; f2509
Sfx_HyperBeam_Ch6: ; f2509
- unknownmusic0xde $b3
+ sound_duty 3, 0, 3, 2
sound __, 3, $f1, $0781
sound __, 3, $f1, $0701
sound __, 3, $f1, $0791
diff --git a/audio/sfx_crystal.asm b/audio/sfx_crystal.asm
index 2bcf91edd..178d4b560 100644
--- a/audio/sfx_crystal.asm
+++ b/audio/sfx_crystal.asm
@@ -169,7 +169,7 @@ Sfx_GameFreakPresents_Ch5: ; 179945
dutycycle $2
notetype $2, $b1
soundinput $ff
- forceoctave $1a
+ pitchoffset 1, A#
octave 5
note C_, 2
note E_, 2
@@ -194,7 +194,7 @@ Sfx_Tingle: ; 179961
Sfx_Tingle_Ch5: ; 179964
togglesfx
dutycycle $1
- forceoctave $b
+ pitchoffset 0, B_
notetype $1, $b1
Sfx_Tingle_branch_17996c: ; 17996c
octave 5
@@ -234,7 +234,7 @@ Sfx_4NoteDitty_Ch5: ; 17999b
togglesfx
dutycycle $2
notetype $2, $e8
- forceoctave $2
+ pitchoffset 0, D_
octave 4
note C_, 2
intensity $48
@@ -279,7 +279,7 @@ Sfx_Twinkle: ; 1799cb
Sfx_Twinkle_Ch5: ; 1799ce
togglesfx
dutycycle $0
- forceoctave $2
+ pitchoffset 0, D_
notetype $2, $e1
octave 3
note G_, 2