clean up sound code

This commit is contained in:
YamaArashi 2016-09-30 18:45:14 -07:00
parent 302e43fd91
commit 9b50e911c8
23 changed files with 1432 additions and 1414 deletions

View File

@ -5281,7 +5281,7 @@ _0800E148:
bl sub_800DC24
_0800E154:
movs r0, 0x78
bl audio_play
bl PlaySE
mov r0, r9
bl DestroyTask
ldr r4, _0800E224
@ -8825,7 +8825,7 @@ sub_800FE20: @ 800FE20
ldr r0, _0800FE3C
str r0, [r4, 0x1C]
movs r0, 0x68
bl audio_play
bl PlaySE
pop {r4}
pop {r0}
bx r0
@ -9358,7 +9358,7 @@ sub_8010278: @ 8010278
str r0, [r2, 0x1C]
ldrh r0, [r2, 0x32]
movs r1, 0x19
bl cry_related
bl PlayCry1
_080102A0:
pop {r0}
bx r0
@ -16312,24 +16312,24 @@ _08013A50:
.4byte _08013B24
_08013B18:
ldr r0, _08013B20
bl sub_8075474
bl PlayBGM
b _08013B48
.align 2, 0
_08013B20: .4byte 0x00000163
_08013B24:
movs r0, 0xD4
lsls r0, 1
bl sub_8075474
bl PlayBGM
b _08013B48
_08013B2E:
movs r0, 0xB1
lsls r0, 1
bl sub_8075474
bl PlayBGM
b _08013B48
_08013B38:
movs r0, 0xCE
lsls r0, 1
bl sub_8075474
bl PlayBGM
b _08013B48
_08013B42:
ldr r1, _08013B54
@ -16581,7 +16581,7 @@ _08013D4C:
movs r0, 0x3
bl BeginFastPaletteFade
movs r0, 0x5
bl sub_8074D28
bl FadeOutMapMusic
ldr r1, _08013D6C
ldr r0, _08013D70
str r0, [r1]
@ -18767,7 +18767,7 @@ bs8_exit_by_flight: @ 8014F80
ldrb r0, [r0]
strb r0, [r2]
movs r0, 0x11
bl audio_play
bl PlaySE
ldr r0, _08014FB4
ldrb r0, [r0]
strb r0, [r4]
@ -40618,7 +40618,7 @@ _080202E8:
bne _08020316
bl sub_80325B8
ldr r0, _08020358
bl sub_8075474
bl PlayBGM
ldrb r0, [r5]
adds r0, 0x1
strb r0, [r5]
@ -47663,7 +47663,7 @@ _08023B74:
cmp r0, 0
beq _08023B9A
movs r0, 0x5
bl audio_play
bl PlaySE
bl nullsub_6
movs r0, 0
strb r0, [r4, 0x1]
@ -47680,7 +47680,7 @@ _08023B9A:
cmp r0, 0
bne _08023BC0
movs r0, 0x5
bl audio_play
bl PlaySE
bl nullsub_6
movs r0, 0x1
strb r0, [r4, 0x1]
@ -47693,7 +47693,7 @@ _08023BC0:
cmp r0, 0
beq _08023C0C
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r0, _08023C00
ldrb r4, [r0, 0x1]
cmp r4, 0
@ -47725,7 +47725,7 @@ _08023C0C:
b _08023E5C
_08023C16:
movs r0, 0x5
bl audio_play
bl PlaySE
_08023C1C:
ldr r0, _08023C28
ldr r1, _08023C2C
@ -48037,7 +48037,7 @@ _08023EA8:
cmp r0, 0
beq _08023ECE
movs r0, 0x5
bl audio_play
bl PlaySE
bl nullsub_6
movs r0, 0
strb r0, [r4, 0x1]
@ -48054,7 +48054,7 @@ _08023ECE:
cmp r0, 0
bne _08023EF4
movs r0, 0x5
bl audio_play
bl PlaySE
bl nullsub_6
movs r0, 0x1
strb r0, [r4, 0x1]
@ -48067,7 +48067,7 @@ _08023EF4:
cmp r0, 0
beq _08023F4C
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r0, _08023F30
ldrb r0, [r0, 0x1]
cmp r0, 0
@ -48106,7 +48106,7 @@ _08023F4C:
cmp r0, 0
beq _08023F78
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r3, _08023F80
ldr r2, [r3]
ldrb r1, [r2, 0x1]
@ -48969,7 +48969,7 @@ _08024616:
cmp r0, 0
beq _0802463A
movs r0, 0x5
bl audio_play
bl PlaySE
bl nullsub_6
movs r0, 0
strb r0, [r5, 0x1]
@ -48986,7 +48986,7 @@ _0802463A:
cmp r0, 0
bne _08024660
movs r0, 0x5
bl audio_play
bl PlaySE
bl nullsub_6
movs r0, 0x1
strb r0, [r4, 0x1]
@ -49012,7 +49012,7 @@ _0802467C:
beq _08024696
_08024684:
movs r0, 0x5
bl audio_play
bl PlaySE
bl sub_8023AD8
ldr r1, _0802469C
ldr r0, [r1]
@ -49570,7 +49570,7 @@ _08024AF4:
b _08024C38
_08024AFE:
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r0, _08024B98
ldr r1, _08024B9C
bl StringCopy
@ -49693,7 +49693,7 @@ _08024C04:
cmp r0, 0
beq _08024C38
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0x1
str r0, [sp]
movs r0, 0xB
@ -63922,7 +63922,7 @@ _0802BCEC:
cmp r0, 0
beq _0802BD10
movs r0, 0x5
bl audio_play
bl PlaySE
bl nullsub_6
movs r0, 0
strb r0, [r4, 0x1]
@ -63939,7 +63939,7 @@ _0802BD10:
cmp r0, 0
bne _0802BD36
movs r0, 0x5
bl audio_play
bl PlaySE
bl nullsub_6
movs r0, 0x1
strb r0, [r4, 0x1]
@ -63952,7 +63952,7 @@ _0802BD36:
cmp r0, 0
beq _0802BD68
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r1, _0802BD64
ldrb r0, [r1, 0x1]
cmp r0, 0
@ -63974,7 +63974,7 @@ _0802BD68:
b _0802BEDA
_0802BD72:
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r1, _0802BD80
_0802BD7A:
movs r0, 0x4
@ -64406,7 +64406,7 @@ sub_802C098: @ 802C098
cmp r0, 0
beq _0802C13E
movs r0, 0x5
bl audio_play
bl PlaySE
bl sub_814A7FC
ldr r1, _0802C108
ldrb r0, [r4]
@ -64469,7 +64469,7 @@ _0802C13E:
b _0802C2AC
_0802C158:
movs r0, 0x5
bl audio_play
bl PlaySE
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
@ -64497,7 +64497,7 @@ _0802C178:
b _0802C2AC
_0802C192:
movs r0, 0x5
bl audio_play
bl PlaySE
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
@ -64541,7 +64541,7 @@ _0802C1D0:
bne _0802C2AC
_0802C1E8:
movs r0, 0x5
bl audio_play
bl PlaySE
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
@ -64609,7 +64609,7 @@ _0802C218:
bl sub_80A9424
_0802C278:
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0x1
movs r1, 0xC
movs r2, 0
@ -64703,7 +64703,7 @@ _0802C32E:
beq _0802C3A8
bl sub_814A7FC
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r2, _0802C394
ldr r1, _0802C398
ldr r4, _0802C388
@ -64749,7 +64749,7 @@ _0802C3A8:
cmp r0, 0
beq _0802C41C
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r2, _0802C400
ldr r1, _0802C404
ldr r5, _0802C408
@ -64800,7 +64800,7 @@ _0802C41C:
b _0802C540
_0802C426:
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r2, _0802C458
ldr r1, _0802C45C
ldr r3, _0802C460
@ -64941,7 +64941,7 @@ _0802C540:
b _0802C658
_0802C54A:
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r2, _0802C57C
ldr r1, _0802C580
ldr r3, _0802C584
@ -65119,7 +65119,7 @@ sub_802C68C: @ 802C68C
b _0802C864
_0802C6B2:
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r1, _0802C6F0
ldrb r0, [r7]
adds r0, r1
@ -65331,7 +65331,7 @@ _0802C864:
beq _0802C8A4
bl sub_814A7FC
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r0, _0802C898
strh r4, [r0]
ldr r1, _0802C89C
@ -65459,7 +65459,7 @@ _0802C944:
_0802C976:
strb r0, [r1]
movs r0, 0x5
bl audio_play
bl PlaySE
ldrb r0, [r7]
adds r0, r4
ldrb r0, [r0]
@ -65578,7 +65578,7 @@ sub_802CA60: @ 802CA60
b _0802CE78
_0802CA7A:
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r0, _0802CDF0
mov r10, r0
ldr r1, _0802CDF4
@ -66084,7 +66084,7 @@ _0802CE78:
cmp r0, 0
beq _0802CEF0
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r0, _0802CF34
ldrb r0, [r0]
bl nullsub_7
@ -66172,7 +66172,7 @@ _0802CF4E:
eors r0, r1
strb r0, [r4]
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r1, _0802CF7C
ldr r0, _0802CF80
ldrb r0, [r0]
@ -66239,7 +66239,7 @@ _0802CFE2:
eors r0, r1
strb r0, [r4]
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r1, _0802D010
ldr r0, _0802D014
ldrb r0, [r0]
@ -66299,7 +66299,7 @@ _0802D066:
eors r0, r1
strb r0, [r4]
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r1, _0802D094
ldr r0, _0802D098
ldrb r0, [r0]
@ -66366,7 +66366,7 @@ _0802D0FA:
eors r0, r1
strb r0, [r4]
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r1, _0802D128
ldr r0, _0802D12C
ldrb r0, [r0]
@ -66699,7 +66699,7 @@ _0802D374:
_0802D3A8:
movs r6, 0x1
_0802D3AA:
bl sub_80753C4
bl IsCryPlayingOrClearCrySongs
lsls r0, 24
cmp r0, 0
beq _0802D3B6
@ -66794,7 +66794,7 @@ _0802D468: .4byte SpriteCallbackDummy
_0802D46C: .4byte 0x02017810
_0802D470: .4byte 0x000027f9
_0802D474: .4byte gUnknown_020239F8
_0802D478: .4byte gUnknown_03007380
_0802D478: .4byte gMPlay_BGM
_0802D47C:
ldr r0, _0802D4E0
ldr r1, _0802D4E4
@ -66846,7 +66846,7 @@ _0802D4DA:
pop {r0}
bx r0
.align 2, 0
_0802D4E0: .4byte gUnknown_03007380
_0802D4E0: .4byte gMPlay_BGM
_0802D4E4: .4byte 0x0000ffff
_0802D4E8: .4byte gUnknown_02024A6A
_0802D4EC: .4byte gUnknown_02024A60
@ -67132,7 +67132,7 @@ sub_802D730: @ 802D730
ands r0, r1
cmp r0, 0
bne _0802D77A
bl sub_80753C4
bl IsCryPlayingOrClearCrySongs
lsls r0, 24
cmp r0, 0
bne _0802D77A
@ -67159,7 +67159,7 @@ _0802D77A:
.align 2, 0
_0802D780: .4byte gUnknown_02024A60
_0802D784: .4byte 0x02017810
_0802D788: .4byte gUnknown_03007380
_0802D788: .4byte gMPlay_BGM
_0802D78C: .4byte 0x0000ffff
_0802D790: .4byte gUnknown_02024A6A
_0802D794: .4byte gPlayerParty
@ -67266,7 +67266,7 @@ c3_0802FDF4: @ 802D86C
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
bl sub_80753C4
bl IsCryPlayingOrClearCrySongs
lsls r0, 24
cmp r0, 0
bne _0802D88E
@ -67282,7 +67282,7 @@ _0802D88E:
pop {r0}
bx r0
.align 2, 0
_0802D894: .4byte gUnknown_03007380
_0802D894: .4byte gMPlay_BGM
_0802D898: .4byte 0x0000ffff
thumb_func_end c3_0802FDF4
@ -67612,7 +67612,7 @@ sub_802DA9C: @ 802DA9C
mov r0, r10
bl sub_8043D84
movs r0, 0x21
bl audio_play
bl PlaySE
ldr r0, _0802DB68
mov r1, r8
str r0, [r1]
@ -71910,7 +71910,7 @@ _0802FEC8:
movs r1, 0x40
negs r1, r1
movs r0, 0x10
bl audio_play_and_stuff
bl PlaySE12WithPanning
ldr r2, _0802FF4C
ldr r3, _0802FF50
ldrb r0, [r5]
@ -73292,7 +73292,7 @@ sub_8030A3C: @ 8030A3C
ldrb r1, [r1]
lsls r1, 8
orrs r0, r1
bl sub_8075474
bl PlayBGM
bl dp01_tbl1_exec_completed
pop {r0}
bx r0
@ -73524,7 +73524,7 @@ _08030BEC:
orrs r0, r1
lsls r1, r3, 24
asrs r1, 24
bl audio_play_and_stuff
bl PlaySE12WithPanning
bl dp01_tbl1_exec_completed
pop {r4}
pop {r0}
@ -73549,7 +73549,7 @@ sub_8030C1C: @ 8030C1C
ldrb r1, [r1]
lsls r1, 8
orrs r0, r1
bl fanfare_play
bl PlayFanfare
bl dp01_tbl1_exec_completed
pop {r0}
bx r0
@ -73578,7 +73578,7 @@ sub_8030C4C: @ 8030C4C
movs r1, 0x19
negs r1, r1
movs r2, 0x5
bl sub_80750B4
bl PlayCry3
bl dp01_tbl1_exec_completed
pop {r0}
bx r0
@ -74351,7 +74351,7 @@ sub_80312A0: @ 80312A0
ldrb r0, [r0]
strb r0, [r2]
movs r0, 0x5
bl sub_8074D28
bl FadeOutMapMusic
movs r0, 0x3
bl BeginFastPaletteFade
bl dp01_tbl1_exec_completed
@ -74935,7 +74935,7 @@ mplay_80342A4: @ 8031724
lsls r0, 24
lsrs r4, r0, 24
movs r5, 0
bl mplay_has_finished_maybe
bl IsSEPlaying
lsls r0, 24
cmp r0, 0
beq _08031764
@ -74969,8 +74969,8 @@ _08031768:
.align 2, 0
_0803176C: .4byte 0x02017810
_08031770: .4byte gUnknown_02024A60
_08031774: .4byte gUnknown_030073C0
_08031778: .4byte gUnknown_03007400
_08031774: .4byte gMPlay_SE1
_08031778: .4byte gMPlay_SE2
_0803177C:
lsls r0, r4, 1
adds r0, r4
@ -76673,7 +76673,7 @@ sub_80324F8: @ 80324F8
cmp r0, 0
bne _0803255A
movs r0, 0x5A
bl audio_play
bl PlaySE
_0803255A:
ldrb r0, [r4]
orrs r0, r5
@ -77678,7 +77678,7 @@ _08032CE0:
_08032D14:
movs r6, 0x1
_08032D16:
bl sub_80753C4
bl IsCryPlayingOrClearCrySongs
lsls r0, 24
cmp r0, 0
beq _08032D22
@ -77769,7 +77769,7 @@ _08032DD0: .4byte SpriteCallbackDummy
_08032DD4: .4byte 0x02017810
_08032DD8: .4byte 0x000027f9
_08032DDC: .4byte gUnknown_020239F8
_08032DE0: .4byte gUnknown_03007380
_08032DE0: .4byte gMPlay_BGM
_08032DE4:
ldr r0, _08032E14
ldr r1, _08032E18
@ -77797,7 +77797,7 @@ _08032E0E:
pop {r0}
bx r0
.align 2, 0
_08032E14: .4byte gUnknown_03007380
_08032E14: .4byte gMPlay_BGM
_08032E18: .4byte 0x0000ffff
_08032E1C: .4byte gUnknown_02024A60
_08032E20: .4byte 0x02017810
@ -81924,7 +81924,7 @@ _0803507C:
strb r0, [r3, 0x4]
movs r0, 0x10
movs r1, 0x3F
bl audio_play_and_stuff
bl PlaySE12WithPanning
ldr r2, _080350C0
ldr r1, _080350C4
ldrb r0, [r5]
@ -83165,7 +83165,7 @@ _08035A34:
orrs r0, r1
lsls r1, r3, 24
asrs r1, 24
bl audio_play_and_stuff
bl PlaySE12WithPanning
bl sub_80334EC
pop {r4}
pop {r0}
@ -83190,7 +83190,7 @@ sub_8035A64: @ 8035A64
ldrb r1, [r1]
lsls r1, 8
orrs r0, r1
bl fanfare_play
bl PlayFanfare
bl sub_80334EC
pop {r0}
bx r0
@ -83218,7 +83218,7 @@ sub_8035A94: @ 8035A94
lsrs r0, 16
movs r1, 0x19
movs r2, 0x5
bl sub_80750B4
bl PlayCry3
bl sub_80334EC
pop {r0}
bx r0
@ -86793,7 +86793,7 @@ _080376D8:
_0803770C:
movs r6, 0x1
_0803770E:
bl sub_80753C4
bl IsCryPlayingOrClearCrySongs
lsls r0, 24
cmp r0, 0
beq _0803771A
@ -86898,7 +86898,7 @@ _080377E4: .4byte SpriteCallbackDummy
_080377E8: .4byte 0x02017810
_080377EC: .4byte 0x000027f9
_080377F0: .4byte gUnknown_020239F8
_080377F4: .4byte gUnknown_03007380
_080377F4: .4byte gMPlay_BGM
_080377F8:
ldr r0, _08037828
ldr r1, _0803782C
@ -86926,7 +86926,7 @@ _08037822:
pop {r0}
bx r0
.align 2, 0
_08037828: .4byte gUnknown_03007380
_08037828: .4byte gMPlay_BGM
_0803782C: .4byte 0x0000ffff
_08037830: .4byte gUnknown_02024A60
_08037834: .4byte 0x02017810
@ -90941,7 +90941,7 @@ _080399A8:
strb r0, [r3, 0x4]
movs r0, 0x10
movs r1, 0x3F
bl audio_play_and_stuff
bl PlaySE12WithPanning
ldr r2, _080399EC
ldr r1, _080399F0
ldrb r0, [r5]
@ -91889,7 +91889,7 @@ _0803A0E8:
orrs r0, r1
lsls r1, r3, 24
asrs r1, 24
bl audio_play_and_stuff
bl PlaySE12WithPanning
bl dp01_tbl4_exec_completed
pop {r4}
pop {r0}
@ -91914,7 +91914,7 @@ sub_803A118: @ 803A118
ldrb r1, [r1]
lsls r1, 8
orrs r0, r1
bl fanfare_play
bl PlayFanfare
bl dp01_tbl4_exec_completed
pop {r0}
bx r0
@ -91942,7 +91942,7 @@ sub_803A148: @ 803A148
lsrs r0, 16
movs r1, 0x19
movs r2, 0x5
bl sub_80750B4
bl PlayCry3
bl dp01_tbl4_exec_completed
pop {r0}
bx r0
@ -92583,7 +92583,7 @@ _0803A680:
strb r1, [r0]
_0803A688:
movs r0, 0x5
bl sub_8074D28
bl FadeOutMapMusic
movs r0, 0x3
bl BeginFastPaletteFade
bl dp01_tbl4_exec_completed

View File

@ -2044,7 +2044,7 @@ _08053E80:
thumb_func_start call_map_music_set_to_zero
call_map_music_set_to_zero: @ 8053E84
push {lr}
bl map_music_set_to_zero
bl ResetMapMusic
pop {r0}
bx r0
thumb_func_end call_map_music_set_to_zero
@ -2092,13 +2092,13 @@ _08053EC8:
beq _08053ED6
ldr r4, _08053EF0
_08053ED6:
bl current_map_music_get
bl GetCurrentMapMusic
lsls r0, 16
lsrs r0, 16
cmp r4, r0
beq _08053EE8
adds r0, r4, 0
bl current_map_music_set
bl PlayNewMapMusic
_08053EE8:
pop {r4}
pop {r0}
@ -2138,7 +2138,7 @@ sub_8053F0C: @ 8053F0C
bl warp1_target_get_music
lsls r0, 16
lsrs r5, r0, 16
bl current_map_music_get
bl GetCurrentMapMusic
lsls r0, 16
lsrs r4, r0, 16
.ifdef SAPPHIRE
@ -2176,7 +2176,7 @@ _08053F4E:
adds r0, r5, 0
movs r1, 0x4
movs r2, 0x4
bl sub_8074D94
bl FadeOutAndFadeInNewMapMusic
b _08053F7C
.align 2, 0
_08053F6C: .4byte 0x00004001
@ -2187,7 +2187,7 @@ _08053F70: .4byte 0x0000016d
_08053F74:
adds r0, r5, 0
movs r1, 0x8
bl sub_8074D60
bl FadeOutAndPlayNewMapMusic
_08053F7C:
pop {r4-r6}
pop {r0}
@ -2197,7 +2197,7 @@ _08053F7C:
thumb_func_start sub_8053F84
sub_8053F84: @ 8053F84
push {r4,lr}
bl current_map_music_get
bl GetCurrentMapMusic
adds r4, r0, 0
lsls r4, 16
lsrs r4, 16
@ -2210,7 +2210,7 @@ sub_8053F84: @ 8053F84
lsls r0, 16
lsrs r0, 16
movs r1, 0x8
bl sub_8074D60
bl FadeOutAndPlayNewMapMusic
_08053FAA:
pop {r4}
pop {r0}
@ -2222,7 +2222,7 @@ sub_8053FB0: @ 8053FB0
push {r4,lr}
lsls r0, 16
lsrs r4, r0, 16
bl current_map_music_get
bl GetCurrentMapMusic
lsls r0, 16
lsrs r1, r0, 16
cmp r1, r4
@ -2237,7 +2237,7 @@ sub_8053FB0: @ 8053FB0
beq _08053FD2
adds r0, r4, 0
movs r1, 0x8
bl sub_8074D60
bl FadeOutAndPlayNewMapMusic
_08053FD2:
pop {r4}
pop {r0}
@ -2279,7 +2279,7 @@ sub_8053FF8: @ 8053FF8
lsrs r0, 24
cmp r0, 0x1
beq _08054028
bl current_map_music_get
bl GetCurrentMapMusic
lsls r0, 16
lsrs r0, 16
cmp r4, r0
@ -2287,7 +2287,7 @@ sub_8053FF8: @ 8053FF8
bl is_warp1_light_level_8_or_9
lsls r0, 24
lsrs r0, 24
bl sub_8074D28
bl FadeOutMapMusic
_08054028:
pop {r4}
pop {r0}
@ -2299,7 +2299,7 @@ _08054030: .4byte 0x00004001
thumb_func_start sub_8054034
sub_8054034: @ 8054034
push {lr}
bl sub_8074E14
bl IsNotWaitingForBGMStop
lsls r0, 24
lsrs r0, 24
pop {r1}
@ -2310,7 +2310,7 @@ sub_8054034: @ 8054034
sub_8054044: @ 8054044
push {lr}
movs r0, 0x4
bl sub_8074D28
bl FadeOutMapMusic
pop {r0}
bx r0
thumb_func_end sub_8054044
@ -2365,7 +2365,7 @@ _08054084:
asrs r2, 24
adds r1, r4, 0
movs r3, 0x1
bl sub_8075090
bl PlayCry2
_080540C0:
add sp, 0x4
pop {r4}
@ -2853,7 +2853,7 @@ _0805440C: .4byte gUnknown_0300485C
CB2_NewGame: @ 8054410
push {lr}
bl FieldClearVBlankHBlankCallbacks
bl sub_8074D08
bl StopMapMusic
bl ResetSafariZoneFlag_
bl NewGameInitData
bl player_avatar_init_params_reset
@ -2895,7 +2895,7 @@ c2_whiteout: @ 8054468
cmp r0, 0x77
bls _080544BE
bl FieldClearVBlankHBlankCallbacks
bl sub_8074D08
bl StopMapMusic
bl ResetSafariZoneFlag_
bl sub_8052F5C
bl player_avatar_init_params_reset
@ -3107,7 +3107,7 @@ _08054658: .4byte c2_overworld
sub_805465C: @ 805465C
push {lr}
bl FieldClearVBlankHBlankCallbacks
bl sub_8074D08
bl StopMapMusic
bl sub_8054F70
ldr r0, _0805468C
bl set_callback1
@ -3213,7 +3213,7 @@ _08054730: .4byte gMapHeader
CB2_ContinueSavedGame: @ 8054734
push {lr}
bl FieldClearVBlankHBlankCallbacks
bl sub_8074D08
bl StopMapMusic
bl ResetSafariZoneFlag_
bl sub_805338C
bl sub_8053198
@ -5349,7 +5349,7 @@ sub_80557E8: @ 80557E8
sub_80557F4: @ 80557F4
push {lr}
movs r0, 0x6
bl audio_play
bl PlaySE
bl sub_8071310
bl ScriptContext2_Enable
pop {r0}
@ -5361,7 +5361,7 @@ sub_8055808: @ 8055808
push {r4,lr}
adds r4, r0, 0
movs r0, 0x5
bl audio_play
bl PlaySE
adds r0, r4, 0
bl ScriptContext1_SetupScript
bl ScriptContext2_Enable
@ -5374,7 +5374,7 @@ sub_8055808: @ 8055808
sub_8055824: @ 8055824
push {lr}
movs r0, 0x6
bl audio_play
bl PlaySE
ldr r0, _0805583C
bl ScriptContext1_SetupScript
bl ScriptContext2_Enable
@ -5389,7 +5389,7 @@ sub_8055840: @ 8055840
push {r4,lr}
adds r4, r0, 0
movs r0, 0x5
bl audio_play
bl PlaySE
adds r0, r4, 0
bl ScriptContext1_SetupScript
bl ScriptContext2_Enable
@ -14425,7 +14425,7 @@ PlayerJumpLedge: @ 805949C
lsls r4, 24
lsrs r4, 24
movs r0, 0xA
bl audio_play
bl PlaySE
adds r0, r4, 0
bl GetJumpLedgeAnimId
lsls r0, 24
@ -14522,7 +14522,7 @@ sub_805954C: @ 805954C
lsls r4, 24
lsrs r4, 24
movs r0, 0x22
bl audio_play
bl PlaySE
adds r0, r4, 0
bl sub_8060A5C
lsls r0, 24
@ -14541,7 +14541,7 @@ sub_8059570: @ 8059570
lsls r4, 24
lsrs r4, 24
movs r0, 0x22
bl audio_play
bl PlaySE
adds r0, r4, 0
bl sub_8060A88
lsls r0, 24
@ -14560,7 +14560,7 @@ sub_8059594: @ 8059594
lsls r4, 24
lsrs r4, 24
movs r0, 0x22
bl audio_play
bl PlaySE
adds r0, r4, 0
bl sub_8060AB4
lsls r0, 24
@ -14579,7 +14579,7 @@ sub_80595B8: @ 80595B8
lsls r4, 24
lsrs r4, 24
movs r0, 0x22
bl audio_play
bl PlaySE
adds r0, r4, 0
bl sub_8060878
lsls r0, 24
@ -14598,7 +14598,7 @@ sub_80595DC: @ 80595DC
lsls r4, 24
lsrs r4, 24
movs r0, 0x7
bl audio_play
bl PlaySE
adds r0, r4, 0
bl sub_8060AE0
lsls r0, 24
@ -14700,7 +14700,7 @@ PlayCollisionSoundIfNotFacingWarp: @ 8059648
bne _080596B0
_080596AA:
movs r0, 0x7
bl audio_play
bl PlaySE
_080596B0:
add sp, 0x4
pop {r4}
@ -15846,7 +15846,7 @@ sub_8059EA4: @ 8059EA4
movs r0, 0xA
bl FieldEffectStart
movs r0, 0xD6
bl audio_play
bl PlaySE
ldrh r0, [r6, 0x8]
adds r0, 0x1
strh r0, [r6, 0x8]
@ -15968,7 +15968,7 @@ sub_805A000: @ 805A000
cmp r0, 0
beq _0805A05C
movs r0, 0xA
bl audio_play
bl PlaySE
ldrb r0, [r4, 0x18]
lsls r0, 28
lsrs r0, 28
@ -16076,7 +16076,7 @@ sub_805A0D8: @ 805A0D8
strb r0, [r1, 0x6]
bl ScriptContext2_Enable
movs r0, 0x2D
bl audio_play
bl PlaySE
movs r0, 0x1
pop {r1}
bx r1

1482
asm/rom5.s

File diff suppressed because it is too large Load Diff

View File

@ -5137,12 +5137,12 @@ _080408B8: .4byte 0x000001c9
thumb_func_start sub_80408BC
sub_80408BC: @ 80408BC
push {lr}
bl map_music_set_to_zero
bl ResetMapMusic
bl m4aMPlayAllStop
bl sub_8040728
lsls r0, 16
lsrs r0, 16
bl sub_8075474
bl PlayBGM
pop {r0}
bx r0
thumb_func_end sub_80408BC
@ -5152,18 +5152,18 @@ current_map_music_set__default_for_battle: @ 80408D8
push {r4,lr}
lsls r0, 16
lsrs r4, r0, 16
bl map_music_set_to_zero
bl ResetMapMusic
bl m4aMPlayAllStop
cmp r4, 0
beq _080408F2
adds r0, r4, 0
bl current_map_music_set
bl PlayNewMapMusic
b _080408FE
_080408F2:
bl sub_8040728
lsls r0, 16
lsrs r0, 16
bl current_map_music_set
bl PlayNewMapMusic
_080408FE:
pop {r4}
pop {r0}

View File

@ -3327,7 +3327,7 @@ _08042768:
_0804278A:
bl MoveMenuCursor
movs r0, 0x5
bl audio_play
bl PlaySE
b _08042816
.align 2, 0
_08042798: .4byte gTasks
@ -3338,7 +3338,7 @@ _0804279C:
beq _080427E8
bl sub_8072DEC
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r3, _080427DC
ldr r2, _080427E0
ldr r1, _080427E4
@ -4025,7 +4025,7 @@ _08042D34:
ldrb r0, [r1]
adds r0, 0x1
strb r0, [r1]
bl current_map_music_get
bl GetCurrentMapMusic
ldr r1, _08042D8C
strh r0, [r1]
b _08042F6E
@ -4290,7 +4290,7 @@ c3_080472E4: @ 8042FB8
ldrsh r0, [r4, r1]
cmp r0, 0
bne _08042FD4
bl sub_8074D08
bl StopMapMusic
_08042FD4:
movs r1, 0x8
ldrsh r0, [r4, r1]
@ -4298,14 +4298,14 @@ _08042FD4:
bne _08042FE4
movs r0, 0xBC
lsls r0, 1
bl sub_8075474
bl PlayBGM
_08042FE4:
movs r1, 0x8
ldrsh r0, [r4, r1]
cmp r0, 0x3C
ble _08042FF8
ldr r0, _08043008
bl sub_8075474
bl PlayBGM
adds r0, r5, 0
bl DestroyTask
_08042FF8:
@ -4468,7 +4468,7 @@ _08043124:
adds r0, r4, 0
bl sub_80436FC
ldr r0, _08043160
bl fanfare_play
bl PlayFanfare
ldr r1, [r5]
b _0804329C
.align 2, 0
@ -4478,7 +4478,7 @@ _08043158: .4byte gStringVar4
_0804315C: .4byte gOtherText_HatchedFromEgg
_08043160: .4byte 0x00000173
_08043164:
bl task_is_not_running_overworld_fanfare
bl IsFanfareTaskInactive
lsls r0, 24
cmp r0, 0
bne _08043170
@ -4486,7 +4486,7 @@ _08043164:
_08043170:
b _08043298
_08043172:
bl task_is_not_running_overworld_fanfare
bl IsFanfareTaskInactive
lsls r0, 24
cmp r0, 0
bne _0804317E
@ -4687,7 +4687,7 @@ _08043304:
cmp r0, 0xF
bne _08043334
movs r0, 0x17
bl audio_play
bl PlaySE
adds r0, r4, 0
movs r1, 0x1
bl StartSpriteAnim
@ -4740,7 +4740,7 @@ _0804336C:
cmp r0, 0xF
bne _08043398
movs r0, 0x17
bl audio_play
bl PlaySE
adds r0, r4, 0
movs r1, 0x2
bl StartSpriteAnim
@ -4823,7 +4823,7 @@ _08043418:
cmp r0, 0xF
bne _0804344C
movs r0, 0x17
bl audio_play
bl PlaySE
adds r0, r4, 0
movs r1, 0x2
bl StartSpriteAnim
@ -4835,7 +4835,7 @@ _0804344C:
cmp r0, 0x1E
bne _0804345A
movs r0, 0x17
bl audio_play
bl PlaySE
_0804345A:
pop {r4-r6}
pop {r0}
@ -4909,7 +4909,7 @@ _080434C0:
cmp r4, 0
bne _080434EE
movs r0, 0x71
bl audio_play
bl PlaySE
adds r2, r5, 0
adds r2, 0x3E
ldrb r0, [r2]
@ -7932,7 +7932,7 @@ _08044C62:
strh r6, [r0, 0x1C]
movs r0, 0x72
movs r1, 0
bl audio_play_and_stuff
bl PlaySE12WithPanning
adds r0, r4, 0
add sp, 0x28
pop {r3-r5}
@ -8525,13 +8525,13 @@ _080450E4:
lsls r1, 24
asrs r1, 24
movs r0, 0x74
bl sub_807552C
bl PlaySE2WithPanning
b _08045102
_080450F8:
lsls r1, 24
asrs r1, 24
movs r0, 0x73
bl sub_80754F8
bl PlaySE1WithPanning
_08045102:
ldr r0, _0804510C
str r0, [r4, 0x1C]
@ -11188,7 +11188,7 @@ _080465CC:
ldr r1, _08046630
str r1, [r0]
movs r0, 0x3D
bl audio_play
bl PlaySE
_08046616:
add sp, 0x4
pop {r3-r5}
@ -11367,7 +11367,7 @@ sub_8046760: @ 8046760
cmp r0, 0xB
bne _08046778
movs r0, 0x3C
bl audio_play
bl PlaySE
_08046778:
ldr r6, _080467C4
ldr r5, _080467C8
@ -11536,19 +11536,19 @@ _080468B0:
b _080468CE
_080468B6:
movs r0, 0x38
bl audio_play
bl PlaySE
b _08046902
_080468BE:
movs r0, 0x39
bl audio_play
bl PlaySE
b _08046902
_080468C6:
movs r0, 0x3A
bl audio_play
bl PlaySE
b _08046902
_080468CE:
movs r0, 0x3B
bl audio_play
bl PlaySE
b _08046902
_080468D6:
movs r2, 0x38
@ -11633,7 +11633,7 @@ sub_8046944: @ 8046944
ldr r0, _08046980
str r0, [r4, 0x1C]
movs r0, 0x17
bl audio_play
bl PlaySE
_08046978:
pop {r4}
pop {r0}
@ -11807,7 +11807,7 @@ _08046ABC:
bl StartSpriteAffineAnim
_08046AC4:
movs r0, 0x17
bl audio_play
bl PlaySE
_08046ACA:
pop {r4}
pop {r0}
@ -11896,10 +11896,10 @@ _08046BA6:
lsls r1, r3, 24
asrs r1, 24
adds r0, r5, 0
bl cry_related
bl PlayCry1
b _08046BEE
_08046BB2:
bl sub_8075398
bl StopCryAndClearCrySongs
ldr r1, _08046BCC
lsls r0, r4, 2
adds r0, r4
@ -11926,7 +11926,7 @@ _08046BD0:
asrs r1, 24
adds r0, r5, 0
movs r2, 0x1
bl sub_8075114
bl PlayCry4
_08046BEE:
adds r0, r4, 0
bl DestroyTask
@ -11955,11 +11955,11 @@ _08046C08:
adds r0, 0x1
strh r0, [r1, 0x26]
_08046C20:
bl sub_80753C4
bl IsCryPlayingOrClearCrySongs
lsls r0, 24
cmp r0, 0
bne _08046C72
bl sub_8075398
bl StopCryAndClearCrySongs
ldr r0, _08046C44
lsls r1, r4, 2
adds r1, r4
@ -11992,7 +11992,7 @@ _08046C60:
asrs r1, 24
adds r0, r5, 0
movs r2, 0
bl sub_8075114
bl PlayCry4
adds r0, r4, 0
bl DestroyTask
_08046C72:
@ -12122,7 +12122,7 @@ _08046D5A:
ands r0, r1
cmp r0, 0
beq _08046DA4
bl sub_80755D4
bl IsBGMPlaying
lsls r0, 24
cmp r0, 0
beq _08046DAE
@ -12134,7 +12134,7 @@ _08046D90: .4byte gUnknown_02024A6A
_08046D94: .4byte gPlayerParty
_08046D98: .4byte 0x02017840
_08046D9C: .4byte gUnknown_020239F8
_08046DA0: .4byte gUnknown_03007380
_08046DA0: .4byte gMPlay_BGM
_08046DA4:
ldr r0, _08046DC8
ldr r1, _08046DCC
@ -12155,7 +12155,7 @@ _08046DC4:
movs r4, 0
b _08046DF6
.align 2, 0
_08046DC8: .4byte gUnknown_03007380
_08046DC8: .4byte gMPlay_BGM
_08046DCC: .4byte 0x0000ffff
_08046DD0: .4byte 0x02017840
_08046DD4:
@ -12426,7 +12426,7 @@ sub_8046FBC: @ 8046FBC
strb r1, [r0]
bl m4aMPlayAllStop
ldr r0, _08046FF0
bl audio_play
bl PlaySE
b _08047056
.align 2, 0
_08046FEC: .4byte gUnknown_02024E6D
@ -13336,7 +13336,7 @@ sub_80476E0: @ 80476E0
cmp r0, 0xB
bne _080476F8
movs r0, 0x3C
bl audio_play
bl PlaySE
_080476F8:
ldrh r1, [r5, 0x2E]
lsls r1, 24
@ -14970,7 +14970,7 @@ _080483B8:
movs r1, 0
bl nullsub_5
ldr r0, _080483FC
bl sub_8075474
bl PlayBGM
b _080484C6
.align 2, 0
_080483F0: .4byte gUnknown_03004824
@ -17166,7 +17166,7 @@ _08049600:
cmp r0, r6
beq _0804960C
movs r0, 0x5
bl audio_play
bl PlaySE
_0804960C:
strb r6, [r7]
pop {r4-r7}
@ -17288,7 +17288,7 @@ _080496F4:
cmp r0, 0
beq _080497B6
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r4, _08049750
ldr r0, [r4]
adds r1, r0, 0
@ -17462,7 +17462,7 @@ sub_8049860: @ 8049860
cmp r0, 0
beq _08049880
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0x1
negs r0, r0
b _08049890
@ -17474,7 +17474,7 @@ _08049880:
cmp r0, 0
beq _0804989C
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0x1
_08049890:
bl MoveMenuCursor
@ -17490,7 +17490,7 @@ _0804989C:
cmp r0, 0
beq _08049938
movs r0, 0x5
bl audio_play
bl PlaySE
bl GetMenuCursorPos
lsls r0, 24
lsrs r1, r0, 24
@ -17560,7 +17560,7 @@ _08049938:
cmp r0, 0
beq _0804994A
movs r0, 0x5
bl audio_play
bl PlaySE
bl sub_8049804
_0804994A:
add sp, 0x4
@ -17584,7 +17584,7 @@ sub_8049954: @ 8049954
beq _08049974
_0804996A:
movs r0, 0x5
bl audio_play
bl PlaySE
bl sub_8049804
_08049974:
pop {r0}
@ -17772,7 +17772,7 @@ sub_8049AC0: @ 8049AC0
cmp r0, 0
beq _08049AE0
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0x1
negs r0, r0
b _08049AF0
@ -17784,7 +17784,7 @@ _08049AE0:
cmp r0, 0
beq _08049AFC
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0x1
_08049AF0:
bl MoveMenuCursor
@ -17800,7 +17800,7 @@ _08049AFC:
cmp r0, 0
beq _08049B64
movs r0, 0x5
bl audio_play
bl PlaySE
bl GetMenuCursorPos
lsls r0, 24
cmp r0, 0
@ -17892,7 +17892,7 @@ sub_8049BC0: @ 8049BC0
cmp r0, 0
beq _08049BE0
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0x1
negs r0, r0
b _08049BF0
@ -17904,7 +17904,7 @@ _08049BE0:
cmp r0, 0
beq _08049BFC
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0x1
_08049BF0:
bl MoveMenuCursor
@ -17920,7 +17920,7 @@ _08049BFC:
cmp r0, 0
beq _08049C72
movs r0, 0x5
bl audio_play
bl PlaySE
bl GetMenuCursorPos
lsls r0, 24
lsrs r5, r0, 24
@ -17971,7 +17971,7 @@ _08049C72:
cmp r0, 0
beq _08049C84
movs r0, 0x5
bl audio_play
bl PlaySE
bl sub_8049804
_08049C84:
pop {r4,r5}
@ -18086,7 +18086,7 @@ sub_8049D44: @ 8049D44
cmp r0, 0
beq _08049D8A
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0
bl sub_804A840
movs r0, 0x1
@ -20533,7 +20533,7 @@ sub_804B058: @ 804B058
cmp r0, 0xA
bne _0804B074
movs r0, 0x17
bl audio_play
bl PlaySE
movs r0, 0
strh r0, [r4, 0x2E]
_0804B074:
@ -20632,7 +20632,7 @@ sub_804B104: @ 804B104
cmp r0, 0xF
bne _0804B120
movs r0, 0xCC
bl audio_play
bl PlaySE
movs r0, 0
strh r0, [r4, 0x2E]
_0804B120:
@ -22951,14 +22951,14 @@ _0804C5EC:
ldrh r0, [r1]
adds r0, 0x1
strh r0, [r1]
bl current_map_music_get
bl GetCurrentMapMusic
ldr r1, [r6]
movs r7, 0x92
lsls r7, 1
adds r1, r7
strh r0, [r1]
ldr r0, _0804C668
bl sub_8075474
bl PlayBGM
bl _0804D570
.align 2, 0
_0804C65C: .4byte gSprites
@ -23562,7 +23562,7 @@ _0804CB70:
cmp r0, 0
bne _0804CB8E
movs r0, 0x2E
bl audio_play
bl PlaySE
ldr r0, _0804CBC4
ldr r1, [r0]
adds r1, 0xC4
@ -23845,7 +23845,7 @@ _0804CD94:
cmp r0, 0x2
bhi _0804CDDC
movs r0, 0x2D
bl audio_play
bl PlaySE
_0804CDDC:
ldr r2, [r6]
adds r3, r2, 0
@ -24265,7 +24265,7 @@ _0804D11A:
adds r0, 0x1
strh r0, [r1]
movs r0, 0x9F
bl audio_play
bl PlaySE
b _0804D570
.align 2, 0
_0804D138: .4byte gSprites
@ -24632,7 +24632,7 @@ _0804D41C:
cmp r0, 0x4
bne _0804D430
ldr r0, _0804D480
bl fanfare_play
bl PlayFanfare
_0804D430:
ldr r2, [r6]
adds r0, r2, 0
@ -24783,7 +24783,7 @@ _0804D54C:
lsls r7, 1
adds r0, r7
ldrh r0, [r0]
bl sub_8075474
bl PlayBGM
ldr r0, _0804D584
bl SetMainCallback2
bl sub_804D8E4
@ -25038,7 +25038,7 @@ sub_804D738: @ 804D738
cmp r0, 0x16
bne _0804D760
movs r0, 0x38
bl audio_play
bl PlaySE
_0804D760:
ldrh r0, [r4, 0x2E]
adds r0, 0x1
@ -25048,7 +25048,7 @@ _0804D760:
cmp r0, 0x2C
bne _0804D796
movs r0, 0x8C
bl audio_play
bl PlaySE
ldr r0, _0804D7A4
str r0, [r4, 0x1C]
movs r0, 0
@ -25150,7 +25150,7 @@ sub_804D80C: @ 804D80C
movs r0, 0x16
strh r0, [r4, 0x2E]
movs r0, 0x38
bl audio_play
bl PlaySE
b _0804D88C
_0804D83C:
movs r1, 0x2E
@ -25158,21 +25158,21 @@ _0804D83C:
cmp r0, 0x42
bne _0804D84A
movs r0, 0x39
bl audio_play
bl PlaySE
_0804D84A:
movs r2, 0x2E
ldrsh r0, [r4, r2]
cmp r0, 0x5C
bne _0804D858
movs r0, 0x3A
bl audio_play
bl PlaySE
_0804D858:
movs r3, 0x2E
ldrsh r0, [r4, r3]
cmp r0, 0x6B
bne _0804D866
movs r0, 0x3B
bl audio_play
bl PlaySE
_0804D866:
ldr r1, _0804D894
movs r2, 0x2E
@ -26084,7 +26084,7 @@ _0804E0BC:
cmp r0, 0
bne _0804E11A
movs r0, 0x3
bl play_sound_effect
bl FadeOutBGM
ldr r1, _0804E0DC
ldr r0, _0804E0E0
adds r1, r0
@ -26094,7 +26094,7 @@ _0804E0D8: .4byte gPaletteFade
_0804E0DC: .4byte gMain
_0804E0E0: .4byte 0x0000043c
_0804E0E4:
bl sub_8075028
bl IsBGMStopped
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -26313,7 +26313,7 @@ sub_804E290: @ 804E290
pop {r0}
bx r0
.align 2, 0
_0804E2B0: .4byte gUnknown_03007400
_0804E2B0: .4byte gMPlay_SE2
_0804E2B4: .4byte 0x0000ffff
_0804E2B8: .4byte gUnknown_03004854
thumb_func_end sub_804E290
@ -26874,7 +26874,7 @@ sub_804E738: @ 804E738
b _0804E786
_0804E780:
movs r0, 0x74
bl audio_play
bl PlaySE
_0804E786:
ldrh r0, [r4, 0x30]
strh r0, [r4, 0x20]
@ -27886,13 +27886,13 @@ _0804F03A:
str r1, [r0]
ldr r0, _0804F07C
bl SetMainCallback2
bl current_map_music_get
bl GetCurrentMapMusic
lsls r0, 16
lsrs r0, 16
ldr r4, _0804F080
cmp r0, r4
beq _0804F074
bl current_map_music_get
bl GetCurrentMapMusic
mov r3, r8
ldr r1, [r3]
movs r2, 0xBC
@ -27901,7 +27901,7 @@ _0804F03A:
strh r0, [r1]
_0804F074:
adds r0, r4, 0
bl sub_8075474
bl PlayBGM
b _0804F0CE
.align 2, 0
_0804F07C: .4byte sub_80501FC
@ -28633,7 +28633,7 @@ _0804F636:
strb r1, [r0]
bl sub_804F238
movs r0, 0x2B
bl audio_play
bl PlaySE
mov r2, r8
ldr r0, [r2]
b _0804F710
@ -28701,7 +28701,7 @@ _0804F650:
movs r0, 0
str r0, [r1]
movs r0, 0x34
bl audio_play
bl PlaySE
bl BuyMenuDrawFieldObjects
_0804F6D6:
mov r1, r8
@ -28816,13 +28816,13 @@ _0804F792:
cmp r4, r0
blt _0804F792
_0804F7B8:
bl current_map_music_get
bl GetCurrentMapMusic
lsls r0, 16
lsrs r0, 16
ldr r4, _0804F818
cmp r0, r4
beq _0804F7D6
bl current_map_music_get
bl GetCurrentMapMusic
ldr r1, _0804F804
ldr r1, [r1]
movs r5, 0xBC
@ -28831,9 +28831,9 @@ _0804F7B8:
strh r0, [r1]
_0804F7D6:
adds r0, r4, 0
bl sub_8075474
bl PlayBGM
movs r0, 0x35
bl audio_play
bl PlaySE
bl sub_804E290
_0804F7E6:
bl RunTasks
@ -29442,7 +29442,7 @@ sub_804FC48: @ 804FC48
ldr r0, _0804FCD0
str r0, [r4]
movs r0, 0x28
bl audio_play
bl PlaySE
b _0804FD18
.align 2, 0
_0804FCBC: .4byte gSpriteTemplate_821645C
@ -29463,7 +29463,7 @@ _0804FCD4:
movs r1, 0
bl StartSpriteAnim
movs r0, 0x1F
bl audio_play
bl PlaySE
b _0804FD18
.align 2, 0
_0804FCF4: .4byte 0x00005432
@ -29480,7 +29480,7 @@ _0804FCFC:
movs r1, 0x1
bl StartSpriteAnim
movs r0, 0x20
bl audio_play
bl PlaySE
_0804FD18:
bl sub_805156C
pop {r3}
@ -29863,7 +29863,7 @@ _08050020: .4byte 0x00004523
_08050024: .4byte gUnknown_03004854
_08050028: .4byte 0x000005dc
_0805002C: .4byte 0xfffffd12
_08050030: .4byte gUnknown_03007380
_08050030: .4byte gMPlay_BGM
_08050034:
ldr r0, _08050098
movs r1, 0x80
@ -29919,7 +29919,7 @@ _08050088:
pop {r0}
bx r0
.align 2, 0
_08050098: .4byte gUnknown_03007380
_08050098: .4byte gMPlay_BGM
_0805009C: .4byte gUnknown_03004854
_080500A0: .4byte gUnknown_0202E8CC
_080500A4: .4byte gRecvCmds
@ -31139,7 +31139,7 @@ _080509B4:
movs r4, 0
b _080509E4
.align 2, 0
_080509C8: .4byte gUnknown_03007380
_080509C8: .4byte gMPlay_BGM
_080509CC:
ldr r0, _080509F0
ldr r0, [r0]
@ -31202,7 +31202,7 @@ _08050A40:
bl sub_804E290
b _08050CB6
.align 2, 0
_08050A48: .4byte gUnknown_03007400
_08050A48: .4byte gMPlay_SE2
_08050A4C:
bl GetMultiplayerId
lsls r0, 24
@ -31349,7 +31349,7 @@ _08050B58:
cmp r0, 0
beq _08050B76
movs r0, 0x5
bl audio_play
bl PlaySE
_08050B76:
movs r0, 0
bl sub_80508D4
@ -31369,7 +31369,7 @@ _08050B88:
cmp r0, 0x1
beq _08050BD4
movs r0, 0x5
bl audio_play
bl PlaySE
b _08050BD4
.align 2, 0
_08050BA4: .4byte gUnknown_03004854
@ -31379,7 +31379,7 @@ _08050BA8:
cmp r0, 0
beq _08050BB8
movs r0, 0x5
bl audio_play
bl PlaySE
b _08050C82
_08050BB8:
movs r0, 0x2
@ -31389,7 +31389,7 @@ _08050BB8:
b _08050CB6
_08050BC2:
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r0, _08050BDC
ldr r1, [r0]
adds r1, 0x6F
@ -31915,7 +31915,7 @@ _08051004:
cmp r0, 0
beq _080510C4
movs r0, 0x37
bl audio_play
bl PlaySE
ldr r0, _0805101C
ldr r1, [r0]
b _080510AC
@ -32970,7 +32970,7 @@ _08051838:
adds r0, 0x1
strh r0, [r4, 0x2E]
movs r0, 0x38
bl audio_play
bl PlaySE
b _080518BE
_08051858:
ldrh r0, [r4, 0x32]
@ -33063,7 +33063,7 @@ _080518E8:
adds r0, 0x1
strh r0, [r4, 0x2E]
movs r0, 0x15
bl audio_play
bl PlaySE
b _0805193C
_08051908:
ldrh r0, [r4, 0x32]
@ -34529,7 +34529,7 @@ _0805247E:
cmp r0, 0
beq _080524AE
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r0, _080524A0
ldr r1, [r0]
_08052494:
@ -35425,12 +35425,12 @@ sub_8052BD0: @ 8052BD0
cmp r0, 0
bne _08052BF6
ldr r0, _08052C20
bl fanfare_play
bl PlayFanfare
ldrh r0, [r4, 0x8]
adds r0, 0x1
strh r0, [r4, 0x8]
_08052BF6:
bl task_is_not_running_overworld_fanfare
bl IsFanfareTaskInactive
lsls r0, 24
cmp r0, 0
beq _08052C16
@ -35440,7 +35440,7 @@ _08052BF6:
lsls r1, 1
adds r0, r1
ldrh r0, [r0]
bl sub_8075474
bl PlayBGM
adds r0, r5, 0
bl DestroyTask
_08052C16:

View File

@ -318,7 +318,7 @@ _0806813C:
cmp r0, 0
beq _08068154
movs r0, 0x6
bl audio_play
bl PlaySE
bl sub_8071310
_08068150:
movs r0, 0x1
@ -437,7 +437,7 @@ _08068208:
cmp r4, r0
beq _0806822C
movs r0, 0x5
bl audio_play
bl PlaySE
_0806822C:
adds r0, r4, 0
bl ScriptContext1_SetupScript
@ -2121,7 +2121,7 @@ _08068EF8:
bl walkrun_find_lowest_active_bit_in_bitfield
bl sp13E_warp_to_last_warp
movs r0, 0xE9
bl audio_play
bl PlaySE
movs r0, 0x1
b _08068F12
_08068F10:
@ -3583,7 +3583,7 @@ _0806995E:
cmp r0, 0
beq _080699CE
movs r0, 0x46
bl audio_play
bl PlaySE
b _080699CE
_0806998C:
ldrh r0, [r4, 0xC]
@ -3866,7 +3866,7 @@ _08069BA4:
bne _08069BB8
_08069BB2:
movs r0, 0x47
bl audio_play
bl PlaySE
_08069BB8:
cmp r7, 0
beq _08069BF4
@ -4276,7 +4276,7 @@ _08069EB6:
ldrh r0, [r5, 0xA]
strh r0, [r4]
movs r0, 0x2A
bl audio_play
bl PlaySE
mov r0, sp
movs r1, 0
ldrsh r0, [r0, r1]
@ -4322,7 +4322,7 @@ _08069F20:
ldrh r0, [r5, 0xA]
strh r0, [r4]
movs r0, 0x29
bl audio_play
bl PlaySE
mov r0, sp
movs r1, 0
ldrsh r0, [r0, r1]
@ -5696,7 +5696,7 @@ _0806A9BA:
_0806A9CC:
strh r0, [r5, 0x4]
movs r0, 0x5
bl audio_play
bl PlaySE
b _0806AA58
_0806A9D6:
cmp r4, 0x5
@ -5718,7 +5718,7 @@ _0806A9D6:
ldrh r0, [r5, 0xC]
strb r0, [r1, 0x4]
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r1, _0806AA1C
lsls r0, r6, 2
adds r0, r6
@ -5748,7 +5748,7 @@ _0806AA24:
cmp r0, 0
beq _0806AA58
movs r0, 0x5
bl audio_play
bl PlaySE
ldrh r2, [r5, 0x6]
ldrb r3, [r5, 0x8]
ldrb r0, [r5, 0xA]
@ -6043,7 +6043,7 @@ _0806ACB0:
cmp r0, 0
beq _0806ACC4
movs r0, 0x5
bl audio_play
bl PlaySE
adds r0, r5, 0
bl DestroyTask
_0806ACC4:
@ -6243,7 +6243,7 @@ _0806AE5C:
ldr r0, _0806AE78
bl sub_806ABDC
movs r0, 0x49
bl audio_play
bl PlaySE
b _0806AE88
.align 2, 0
_0806AE78: .4byte gSystemText_SaveCompleted
@ -6251,7 +6251,7 @@ _0806AE7C:
ldr r0, _0806AECC
bl sub_806ABDC
movs r0, 0x16
bl audio_play
bl PlaySE
_0806AE88:
movs r0, 0x5
strh r0, [r5]
@ -8730,7 +8730,7 @@ _0806C1A4:
cmp r5, r0
beq _0806C1C8
movs r0, 0x5
bl audio_play
bl PlaySE
_0806C1C8:
pop {r3,r4}
mov r8, r3
@ -9615,7 +9615,7 @@ _0806C84A:
cmp r6, r0
beq _0806C878
movs r0, 0x5
bl audio_play
bl PlaySE
_0806C878:
pop {r3}
mov r8, r3
@ -9690,7 +9690,7 @@ _0806C8E2:
movs r1, 0x2
strb r1, [r0]
movs r0, 0x5
bl audio_play
bl PlaySE
_0806C914:
pop {r4-r6}
pop {r0}
@ -10064,7 +10064,7 @@ _0806CBDA:
cmp r0, 0
beq _0806CC10
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r1, _0806CC0C
lsls r0, r4, 2
adds r0, r4
@ -10086,7 +10086,7 @@ _0806CC10:
cmp r0, 0x2
bne _0806CC24
movs r0, 0x5
bl audio_play
bl PlaySE
adds r0, r4, 0
bl sub_806CD44
_0806CC24:
@ -14137,7 +14137,7 @@ _0806EB80:
cmp r1, r0
bne _0806EB8E
movs r0, 0x5
bl audio_play
bl PlaySE
_0806EB8E:
movs r0, 0x17
movs r1, 0x8
@ -14520,7 +14520,7 @@ _0806EEBC:
cmp r1, r0
bne _0806EECA
movs r0, 0x5
bl audio_play
bl PlaySE
_0806EECA:
movs r0, 0x17
movs r1, 0x8
@ -14638,7 +14638,7 @@ _0806EFA8:
cmp r1, r0
bne _0806EFB6
movs r0, 0x5
bl audio_play
bl PlaySE
_0806EFB6:
movs r0, 0x17
movs r1, 0x8
@ -14750,7 +14750,7 @@ sub_806F06C: @ 806F06C
lsls r5, 16
lsrs r5, 16
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r1, _0806F0A8
lsls r0, r4, 2
adds r0, r4
@ -14965,7 +14965,7 @@ sub_806F254: @ 806F254
cmp r0, 0
bne _0806F276
ldr r0, _0806F280
bl fanfare_play
bl PlayFanfare
ldr r1, _0806F284
lsls r0, r4, 2
adds r0, r4
@ -14990,7 +14990,7 @@ sub_806F28C: @ 806F28C
lsls r0, 24
lsrs r5, r0, 24
adds r6, r5, 0
bl task_is_not_running_overworld_fanfare
bl IsFanfareTaskInactive
lsls r0, 24
cmp r0, 0
beq _0806F2F2
@ -15161,7 +15161,7 @@ _0806F3E0:
cmp r1, r0
bne _0806F3EE
movs r0, 0x5
bl audio_play
bl PlaySE
_0806F3EE:
adds r0, r5, 0
bl sub_806F614
@ -15552,7 +15552,7 @@ _0806F73C:
cmp r1, r0
bne _0806F74A
movs r0, 0x5
bl audio_play
bl PlaySE
_0806F74A:
movs r0, 0x17
movs r1, 0x8
@ -15914,7 +15914,7 @@ sub_806FA18: @ 806FA18
cmp r0, r1
bne _0806FAE4
movs r0, 0x1
bl audio_play
bl PlaySE
movs r0, 0x80
lsls r0, 5
adds r4, r6, r0
@ -16473,7 +16473,7 @@ _0806FEE6:
movs r0, 0
strb r0, [r1]
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r0, _0806FF0C
movs r1, 0x1
bl sub_806E834
@ -16495,13 +16495,13 @@ _0806FF14:
cmp r0, 0
bne _0806FF34
movs r0, 0x1
bl audio_play
bl PlaySE
b _0806FF3A
.align 2, 0
_0806FF30: .4byte gUnknown_0202E8F4
_0806FF34:
movs r0, 0x75
bl audio_play
bl PlaySE
_0806FF3A:
ldr r4, _0806FF88
ldr r0, [r4]
@ -16755,7 +16755,7 @@ _08070134:
movs r3, 0x13
bl MenuZeroFillWindowRect
movs r0, 0x1
bl audio_play
bl PlaySE
ldr r0, [r4]
ldrb r1, [r4, 0x5]
bl sub_806FBB4
@ -17027,7 +17027,7 @@ sub_8070374: @ 8070374
cmp r0, 0
beq _0807039C
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0x1
negs r0, r0
bl MoveMenuCursor
@ -17040,7 +17040,7 @@ _0807039C:
cmp r0, 0
beq _080703B2
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0x1
bl MoveMenuCursor
b _080703E4
@ -17062,7 +17062,7 @@ _080703CC:
cmp r0, 0
beq _080703E4
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r0, _080703EC
ldr r1, [r0, 0x4]
adds r0, r4, 0
@ -17138,7 +17138,7 @@ _08070468: .4byte gTasks
_0807046C: .4byte TaskDummy
_08070470:
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0xA
movs r1, 0x3
bl sub_806D538
@ -17279,7 +17279,7 @@ ether_effect_related: @ 8070570
ldr r0, _080705B0
strb r5, [r0]
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r0, _080705B4
movs r1, 0x1
bl sub_806E834
@ -17294,7 +17294,7 @@ _080705B8:
movs r0, 0x1
strb r0, [r1]
movs r0, 0x1
bl audio_play
bl PlaySE
ldrh r0, [r6, 0x6]
movs r1, 0x1
bl sub_80A9538
@ -17352,7 +17352,7 @@ dp05_pp_up: @ 8070624
str r4, [r3]
bl sub_806E8D0
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0xB
movs r1, 0x3
bl sub_806D538
@ -17438,7 +17438,7 @@ _080706F6:
movs r0, 0
strb r0, [r1]
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r0, _0807071C
movs r1, 0x1
bl sub_806E834
@ -17455,7 +17455,7 @@ _08070724:
movs r0, 0x1
strb r0, [r1]
movs r0, 0
bl pause_music_for_sound_maybe
bl PlayFanfareByFanfareNum
ldr r4, _08070788
ldrb r0, [r4, 0x5]
ldr r1, [r4]
@ -17506,7 +17506,7 @@ sub_80707A0: @ 80707A0
lsls r0, 24
lsrs r4, r0, 24
movs r0, 0
bl ducking_tick
bl WaitFanfare
lsls r0, 24
cmp r0, 0
beq _080707E8
@ -17526,7 +17526,7 @@ sub_80707A0: @ 80707A0
beq _080707E8
_080707CE:
movs r0, 0x5
bl audio_play
bl PlaySE
adds r0, r4, 0
bl sub_8070848
ldr r0, _080707F8
@ -17564,7 +17564,7 @@ sub_8070800: @ 8070800
beq _08070834
_0807081A:
movs r0, 0x5
bl audio_play
bl PlaySE
adds r0, r4, 0
bl sub_8070968
ldr r0, _08070840
@ -17890,7 +17890,7 @@ sub_8070AC8: @ 8070AC8
lsls r0, 24
lsrs r6, r0, 24
movs r0, 0
bl ducking_tick
bl WaitFanfare
lsls r0, 24
cmp r0, 0
bne _08070ADC
@ -18231,7 +18231,7 @@ sub_8070DBC: @ 8070DBC
lsls r1, 16
lsrs r6, r1, 16
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r1, _08070E18
lsls r0, r4, 2
adds r0, r4
@ -18951,7 +18951,7 @@ sub_8071338: @ 8071338
cmp r0, 0
beq _08071358
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0x1
negs r0, r0
bl MoveMenuCursor
@ -18964,7 +18964,7 @@ _08071358:
cmp r0, 0
beq _08071372
movs r0, 0x5
bl audio_play
bl PlaySE
movs r0, 0x1
bl MoveMenuCursor
ldr r1, _080713E0
@ -18976,7 +18976,7 @@ _08071372:
cmp r0, 0
beq _08071400
movs r0, 0x5
bl audio_play
bl PlaySE
ldr r1, _080713E4
ldr r2, _080713E8
ldr r0, _080713E0
@ -19503,7 +19503,7 @@ _08071750: .4byte gUnknown_030006AC
_08071754: .4byte gMain
_08071758:
movs r0, 0x5
bl audio_play
bl PlaySE
_0807175E:
movs r0, 0x1
_08071760:
@ -19788,7 +19788,7 @@ sub_8071960: @ 8071960
cmp r0, 0
beq _08071978
movs r0, 0x37
bl audio_play
bl PlaySE
ldr r1, _08071980
ldr r0, _08071984
str r0, [r1]
@ -19804,7 +19804,7 @@ _08071984: .4byte sub_8071988
thumb_func_start sub_8071988
sub_8071988: @ 8071988
push {lr}
bl mplay_has_finished_maybe
bl IsSEPlaying
lsls r0, 24
cmp r0, 0
bne _080719A6
@ -19830,7 +19830,7 @@ sub_80719AC: @ 80719AC
cmp r0, 0
beq _080719C4
movs r0, 0x16
bl audio_play
bl PlaySE
ldr r1, _080719CC
ldr r0, _080719D0
str r0, [r1]
@ -20137,7 +20137,7 @@ _08071C1C: .4byte gMain
sub_8071C20: @ 8071C20
push {lr}
movs r0, 0x5
bl audio_play
bl PlaySE
bl MenuZeroFillScreen
bl sub_8064E2C
bl ScriptContext2_Disable

View File

@ -327,7 +327,7 @@ _080758AE:
bx r0
.align 2, 0
_080758D0: .4byte 0x0000ffff
_080758D4: .4byte gUnknown_03007380
_080758D4: .4byte gMPlay_BGM
_080758D8: .4byte gUnknown_030042C4
_080758DC: .4byte gUnknown_03004240
_080758E0: .4byte gUnknown_03004200
@ -879,7 +879,7 @@ _08075CE4: .4byte gUnknown_0202F7B3
_08075CE8: .4byte gUnknown_0202F7C2
_08075CEC: .4byte gUnknown_03004AF0
_08075CF0:
bl mplay_has_finished_maybe
bl IsSEPlaying
lsls r0, 24
cmp r0, 0
beq _08075D28
@ -960,13 +960,13 @@ _08075D8E:
pop {r0}
bx r0
.align 2, 0
_08075D98: .4byte gUnknown_030073C0
_08075D9C: .4byte gUnknown_03007400
_08075D98: .4byte gMPlay_SE1
_08075D9C: .4byte gMPlay_SE2
_08075DA0: .4byte gUnknown_03004AF0
_08075DA4: .4byte 0x0000ffff
_08075DA8: .4byte gBattleAnimPicTable
_08075DAC: .4byte gUnknown_03004B10
_08075DB0: .4byte gUnknown_03007380
_08075DB0: .4byte gMPlay_BGM
_08075DB4: .4byte gUnknown_0202F7B1
thumb_func_end sub_8075CB0
@ -981,7 +981,7 @@ ma09_play_sound: @ 8075DB8
ldrb r1, [r1, 0x1]
lsls r1, 8
orrs r0, r1
bl audio_play
bl PlaySE
ldr r0, [r4]
adds r0, 0x2
str r0, [r4]
@ -3546,7 +3546,7 @@ ma19_08073BC8: @ 807716C
lsls r1, 24
asrs r1, 24
adds r0, r4, 0
bl audio_play_and_stuff
bl PlaySE12WithPanning
ldr r0, [r5]
adds r0, 0x3
str r0, [r5]
@ -3569,7 +3569,7 @@ ma1A_8073C00: @ 80771A4
bl sub_8076F98
lsls r0, 24
asrs r0, 24
bl sub_8075560
bl SE12PanpotControl
ldr r0, [r4]
adds r0, 0x1
str r0, [r4]
@ -3649,7 +3649,7 @@ ma1B_8073C2C: @ 80771D0
strh r5, [r1, 0x10]
mov r0, r9
adds r1, r5, 0
bl audio_play_and_stuff
bl PlaySE12WithPanning
ldr r1, _0807728C
ldrb r0, [r1]
adds r0, 0x1
@ -3741,7 +3741,7 @@ _080772FC:
_0807730C:
lsls r0, r4, 24
asrs r0, 24
bl sub_8075560
bl SE12PanpotControl
_08077314:
pop {r4-r7}
pop {r0}
@ -3799,7 +3799,7 @@ sub_8077320: @ 8077320
strh r4, [r1, 0x10]
mov r0, r8
adds r1, r4, 0
bl audio_play_and_stuff
bl PlaySE12WithPanning
ldr r1, _080773B0
ldrb r0, [r1]
adds r0, 0x1
@ -3891,7 +3891,7 @@ sub_80773B4: @ 80773B4
strh r6, [r1, 0x10]
mov r0, r9
adds r1, r6, 0
bl audio_play_and_stuff
bl PlaySE12WithPanning
ldr r1, _08077470
ldrb r0, [r1]
adds r0, 0x1
@ -4010,7 +4010,7 @@ sub_80774FC: @ 80774FC
lsrs r4, 24
lsls r1, 24
asrs r1, 24
bl audio_play_and_stuff
bl PlaySE12WithPanning
cmp r4, 0
bne _0807754A
adds r0, r5, 0
@ -4103,7 +4103,7 @@ sub_80775CC: @ 80775CC
ldrh r0, [r2, 0x8]
movs r1, 0xA
ldrsb r1, [r2, r1]
bl audio_play_and_stuff
bl PlaySE12WithPanning
adds r0, r4, 0
bl DestroyTask
ldr r1, _0807760C
@ -4186,7 +4186,7 @@ ma20_wait_for_something: @ 8077684
ldrb r5, [r0]
cmp r5, 0
bne _080776CC
bl mplay_has_finished_maybe
bl IsSEPlaying
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0
@ -4208,8 +4208,8 @@ ma20_wait_for_something: @ 8077684
.align 2, 0
_080776BC: .4byte gUnknown_0202F7B3
_080776C0: .4byte gUnknown_03004AF0
_080776C4: .4byte gUnknown_030073C0
_080776C8: .4byte gUnknown_03007400
_080776C4: .4byte gMPlay_SE1
_080776C8: .4byte gMPlay_SE2
_080776CC:
ldr r1, _080776DC
movs r0, 0
@ -4721,8 +4721,8 @@ ma2F_stop_music: @ 8077A94
pop {r0}
bx r0
.align 2, 0
_08077AB0: .4byte gUnknown_030073C0
_08077AB4: .4byte gUnknown_03007400
_08077AB0: .4byte gMPlay_SE1
_08077AB4: .4byte gMPlay_SE2
_08077AB8: .4byte gUnknown_0202F7A4
thumb_func_end ma2F_stop_music

View File

@ -8580,8 +8580,20 @@ gTilesetAnimTable_BikeShop:: @ 837DEDC
gDummyPaletteStructTemplate:: @ 837DEE4
.incbin "baserom.gba", 0x0037dee4, 0x10
gUnknown_0837DEF4:: @ 837DEF4
.incbin "baserom.gba", 0x0037def4, 0x30
.align 2
gFanfares:: @ 837DEF4
.2byte BGM_FANFA1, 80
.2byte BGM_FANFA4, 160
.2byte BGM_FANFA5, 220
.2byte BGM_ME_WAZA, 220
.2byte BGM_ME_ASA, 160
.2byte BGM_ME_BACHI, 340
.2byte BGM_ME_WASURE, 180
.2byte BGM_ME_KINOMI, 120
.2byte BGM_ME_TAMA, 710
.2byte BGM_ME_B_BIG, 250
.2byte BGM_ME_B_SMALL, 150
.2byte BGM_ME_ZANNEN, 160
.align 2
gOamData_837DF24:: @ 837DF24

View File

@ -283,7 +283,7 @@ struct MusicPlayerTrack
#define MAX_MUSICPLAYER_TRACKS 16
#define STOP_AFTER_FADE 0x0001
#define TEMPORARY_FADE 0x0001
#define FADE_IN 0x0002
#define FADE_VOL_MAX 64
#define FADE_VOL_SHIFT 2
@ -409,17 +409,17 @@ void ClearModM(struct MusicPlayerTrack *track);
void m4aMPlayModDepthSet(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u8 modDepth);
void m4aMPlayLFOSpeedSet(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u8 lfoSpeed);
struct MusicPlayerInfo *sub_81DF43C(u32 tone);
void sub_81DF50C(u8 val);
void sub_81DF520(s8 val);
void sub_81DF538(s16 val);
void sub_81DF570(u16 val);
void sub_81DF57C(u8 val);
void sub_81DF588(u32 val);
int sub_81DF594(struct MusicPlayerInfo *mplayInfo);
void sub_81DF5AC(s8 val);
void sub_81DF5D8(u32 val);
void sub_81DF618(u8 val);
struct MusicPlayerInfo *SetPokemonCryTone(struct ToneData *tone);
void SetPokemonCryVolume(u8 val);
void SetPokemonCryPanpot(s8 val);
void SetPokemonCryPitch(s16 val);
void SetPokemonCryLength(u16 val);
void SetPokemonCryRelease(u8 val);
void SetPokemonCryProgress(u32 val);
int IsPokemonCryPlaying(struct MusicPlayerInfo *mplayInfo);
void SetPokemonCryChorus(s8 val);
void SetPokemonCryStereo(u32 val);
void SetPokemonCryPriority(u8 val);
// sound command handler functions
void ply_fine(struct MusicPlayerInfo *, struct MusicPlayerTrack *);

46
include/sound.h Normal file
View File

@ -0,0 +1,46 @@
#ifndef GUARD_SOUND_H
#define GUARD_SOUND_H
void InitMapMusic(void);
void MapMusicMain(void);
void ResetMapMusic(void);
u16 GetCurrentMapMusic(void);
void PlayNewMapMusic(u16 songNum);
void StopMapMusic(void);
void FadeOutMapMusic(u8 speed);
void FadeOutAndPlayNewMapMusic(u16 songNum, u8 speed);
void FadeOutAndFadeInNewMapMusic(u16 songNum, u8 fadeOutSpeed, u8 fadeInSpeed);
void FadeInNewMapMusic(u16 songNum, u8 speed);
bool8 IsNotWaitingForBGMStop(void);
void PlayFanfareByFanfareNum(u8 fanfareNum);
bool8 WaitFanfare(bool8 stop);
void StopFanfareByFanfareNum(u8 fanfareNum);
void PlayFanfare(u16 songNum);
bool8 IsFanfareTaskInactive(void);
void FadeInNewBGM(u16 songNum, u8 speed);
void FadeOutBGMTemporarily(u8 speed);
bool8 IsBGMPausedOrStopped(void);
void FadeInBGM(u8 speed);
void FadeOutBGM(u8 speed);
bool8 IsBGMStopped(void);
void PlayCry1(u16 species, s8 pan);
void PlayCry2(u16 species, s8 pan, s8 volume, u8 priority);
void PlayCry3(u16 species, s8 pan, u8 mode);
void PlayCry4(u16 species, s8 pan, u8 mode);
void PlayCry5(u16 species, u8 mode);
bool8 IsCryFinished(void);
void StopCryAndClearCrySongs(void);
void StopCry(void);
bool8 IsCryPlayingOrClearCrySongs(void);
bool8 IsCryPlaying(void);
void PlayBGM(u16 songNum);
void PlaySE(u16 songNum);
void PlaySE12WithPanning(u16 songNum, u8 pan);
void PlaySE1WithPanning(u16 songNum, u8 pan);
void PlaySE2WithPanning(u16 songNum, u8 pan);
void SE12PanpotControl(u8 pan);
bool8 IsSEPlaying(void);
bool8 IsBGMPlaying(void);
bool8 IsSpecialSEPlaying(void);
#endif // GUARD_SOUND_H

View File

@ -1,6 +1,6 @@
.align 2
gMPlayTable:: @ 845545C
music_player 0x3007380, 0x30007F8, 10, 0
music_player 0x30073C0, 0x3000B18, 3, 1
music_player 0x3007400, 0x3000C08, 9, 1
music_player 0x3007450, 0x3000ED8, 1, 0
music_player gMPlay_BGM, 0x30007F8, 10, 0
music_player gMPlay_SE1, 0x3000B18, 3, 1
music_player gMPlay_SE2, 0x3000C08, 9, 1
music_player gMPlay_SE3, 0x3000ED8, 1, 0

View File

@ -7,6 +7,8 @@
#include "link.h"
#include "palette.h"
#include "rng.h"
#include "menu.h"
#include "sound.h"
#define SIO_MULTI_CNT ((struct SioMultiCnt *)REG_ADDR_SIOCNT)
@ -27,7 +29,6 @@ struct LinkTestBGInfo
u32 dummy_C;
};
extern void InitMenuWindow(const struct WindowConfig *);
extern void sub_80516C4(u8, u16);
extern u8 unk_2000000[];
@ -230,7 +231,7 @@ static void LinkTestScreen(void)
ResetTasks();
SetVBlankCallback(VBlankCB_LinkTest);
SetUpWindowConfig(&gWindowConfig_81E6CE4);
InitMenuWindow(&gWindowConfig_81E6CE4);
InitMenuWindow((struct WindowConfig *)&gWindowConfig_81E6CE4);
ResetBlockSend();
gLinkType = 0x1111;
OpenLink();
@ -1217,7 +1218,7 @@ void CB2_LinkError(void)
ResetTasks();
SetVBlankCallback(VBlankCB_LinkTest);
SetUpWindowConfig(&gWindowConfig_81E7198);
InitMenuWindow(&gWindowConfig_81E7198);
InitMenuWindow((struct WindowConfig *)&gWindowConfig_81E7198);
MenuZeroFillScreen();
REG_BLDALPHA = 0;
REG_BG0VOFS = 0;
@ -1225,7 +1226,7 @@ void CB2_LinkError(void)
REG_DISPCNT = 320;
gUnknown_3001BB4 = 0;
CreateTask(Task_DestroySelf, 0);
sub_8074D08();
StopMapMusic();
RunTasks();
AnimateSprites();
BuildOamBuffer();
@ -1244,10 +1245,10 @@ static void CB2_PrintErrorMessage(void)
break;
case 30:
case 60:
audio_play(SE_BOO);
PlaySE(SE_BOO);
break;
case 90:
audio_play(SE_BOO);
PlaySE(SE_BOO);
break;
}

View File

@ -196,19 +196,19 @@ void m4aMPlayFadeOut(struct MusicPlayerInfo *mplayInfo, u16 speed)
MPlayFadeOut(mplayInfo, speed);
}
void sub_81DE0D0(struct MusicPlayerInfo *mplayInfo, u16 speed)
void m4aMPlayFadeOutTemporarily(struct MusicPlayerInfo *mplayInfo, u16 speed)
{
if (mplayInfo->ident == ID_NUMBER)
{
mplayInfo->ident++;
mplayInfo->fadeOC = speed;
mplayInfo->fadeOI = speed;
mplayInfo->fadeOV = (64 << FADE_VOL_SHIFT) | STOP_AFTER_FADE;
mplayInfo->fadeOV = (64 << FADE_VOL_SHIFT) | TEMPORARY_FADE;
mplayInfo->ident = ID_NUMBER;
}
}
void sub_81DE0F0(struct MusicPlayerInfo *mplayInfo, u16 speed)
void m4aMPlayFadeIn(struct MusicPlayerInfo *mplayInfo, u16 speed)
{
if (mplayInfo->ident == ID_NUMBER)
{
@ -701,22 +701,22 @@ void FadeOutBody(struct MusicPlayerInfo *mplayInfo)
while (i > 0)
{
register u32 fadeOV asm("r7");
register u32 val asm("r0");
u32 val;
TrackStop(mplayInfo, track);
val = STOP_AFTER_FADE;
val = TEMPORARY_FADE;
fadeOV = mplayInfo->fadeOV;
val &= fadeOV;
if (!val)
track->flags = val;
track->flags = 0;
i--;
track++;
}
if (mplayInfo->fadeOV & STOP_AFTER_FADE)
if (mplayInfo->fadeOV & TEMPORARY_FADE)
mplayInfo->status |= MUSICPLAYER_STATUS_PAUSE;
else
mplayInfo->status = MUSICPLAYER_STATUS_PAUSE;

View File

@ -415,7 +415,7 @@ void DummyFunc(void)
{
}
struct MusicPlayerInfo *sub_81DF43C(u32 tone)
struct MusicPlayerInfo *SetPokemonCryTone(struct ToneData *tone)
{
u32 maxClock = 0;
s32 maxClockIndex = 0;
@ -447,7 +447,7 @@ start_song:
memcpy((void *)CRY, &gPokemonCrySong, sizeof(struct PokemonCrySong));
*(u32 *)(CRY + CRY_OFS(tone)) = tone;
*(u32 *)(CRY + CRY_OFS(tone)) = (u32)tone;
*(u32 *)(CRY + CRY_OFS(part)) = CRY + CRY_OFS(part0);
*(u32 *)(CRY + CRY_OFS(part) + 4) = CRY + CRY_OFS(part1);
*(u32 *)(CRY + CRY_OFS(gotoTarget)) = CRY + CRY_OFS(cont);
@ -462,17 +462,17 @@ start_song:
return mplayInfo;
}
void sub_81DF50C(u8 val)
void SetPokemonCryVolume(u8 val)
{
gPokemonCrySong.volumeValue = val & 0x7F;
}
void sub_81DF520(s8 val)
void SetPokemonCryPanpot(s8 val)
{
gPokemonCrySong.panValue = (val + C_V) & 0x7F;
}
void sub_81DF538(s16 val)
void SetPokemonCryPitch(s16 val)
{
s16 b = val + 0x80;
u8 a = gPokemonCrySong.tuneValue2 - gPokemonCrySong.tuneValue;
@ -481,22 +481,22 @@ void sub_81DF538(s16 val)
gPokemonCrySong.tuneValue2 = (a + ((b >> 1) & 0x7F)) & 0x7F;
}
void sub_81DF570(u16 val)
void SetPokemonCryLength(u16 val)
{
gPokemonCrySong.unkCmd0CParam = val;
}
void sub_81DF57C(u8 val)
void SetPokemonCryRelease(u8 val)
{
gPokemonCrySong.releaseValue = val;
}
void sub_81DF588(u32 val)
void SetPokemonCryProgress(u32 val)
{
gPokemonCrySong.unkCmd0DParam = val;
}
int sub_81DF594(struct MusicPlayerInfo *mplayInfo)
int IsPokemonCryPlaying(struct MusicPlayerInfo *mplayInfo)
{
struct MusicPlayerTrack *track = mplayInfo->tracks;
@ -506,7 +506,7 @@ int sub_81DF594(struct MusicPlayerInfo *mplayInfo)
return 0;
}
void sub_81DF5AC(s8 val)
void SetPokemonCryChorus(s8 val)
{
if (val)
{
@ -519,7 +519,7 @@ void sub_81DF5AC(s8 val)
}
}
void sub_81DF5D8(u32 val)
void SetPokemonCryStereo(u32 val)
{
struct SoundInfo *soundInfo = SOUND_INFO_PTR;
@ -539,7 +539,7 @@ void sub_81DF5D8(u32 val)
}
}
void sub_81DF618(u8 val)
void SetPokemonCryPriority(u8 val)
{
gPokemonCrySong.priority = val;
}

View File

@ -6,6 +6,7 @@
#include "rtc.h"
#include "link.h"
#include "rng.h"
#include "sound.h"
extern struct SoundInfo gSoundInfo;
extern u32 gUnknown_3004820;
@ -68,9 +69,7 @@ extern void c2_copyright_1();
extern u32 sub_80558AC(void);
extern u32 sub_8055910(void);
extern u32 sub_8055940(void);
extern void sound_something(void);
extern void CheckForFlashMemory(void);
extern void sound_sources_off(void);
void UpdateLinkAndCallCallbacks(void);
void InitMainCallbacks(void);
@ -99,7 +98,7 @@ void AgbMain()
RtcInit();
CheckForFlashMemory();
InitMainCallbacks();
sound_sources_off();
InitMapMusic();
SeedRngWithRtc();
gUnknown_3001BB4 = 0;
@ -142,7 +141,7 @@ void AgbMain()
}
PlayTimeCounter_Update();
sound_something();
MapMusicMain();
WaitForVBlank();
}
}

View File

@ -10,6 +10,7 @@
#include "species.h"
#include "pokemon.h"
#include "menu.h"
#include "sound.h"
#define BirchSpeechUpdateWindowText() ((u8)MenuUpdateWindowText_OverrideLineLength(24))
@ -20,18 +21,9 @@ extern void CB2_InitTitleScreen(void);
extern void FormatPlayTime(u8 *str, u16 hours, u16 minutes, bool16 colon);
extern u16 GetPokedexSeenCount(void);
extern u8 GetBadgeCount(void);
extern void Task_Birch1(u8);
u8 sub_8075374(void);
void cry_related(u16, u8);
void audio_play(u8 a);
u8 GetMenuCursorPos(void);
void DoNamingScreen(u8 r0, struct SaveBlock2 *r1, u16 r2, u16 r3, u8 s0, MainCallback s4);
void DisplayYesNoMenu(u8 r0, u8 r1, u32 r2);
s8 ProcessMenuInputNoWrap_(void);
void CB2_NewGame(void);
void LZ77UnCompVram(const void *src, void *dest);
void CB2_MainMenu(void);
void VBlankCB_MainMenu(void);
void DecompressPicFromTable_2(const struct SpriteSheet *, u8, u8, void *, void *, u32);
void LoadCompressedObjectPalette(const struct SpritePalette *);
u8 AddNewGameBirchObject(u8, u8, u8);
@ -74,6 +66,7 @@ static void PrintPlayerName(void);
static void PrintPlayTime(void);
static void PrintPokedexCount(void);
static void PrintBadgeCount(void);
void Task_Birch1(u8);
extern u16 gMainMenuPalette[];
@ -349,13 +342,13 @@ bool8 MainMenuProcessKeyInput(u8 taskId)
{
if (gMain.newKeys & A_BUTTON)
{
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0x0000);
gTasks[taskId].func = MainMenuPressedA;
}
else if (gMain.newKeys & B_BUTTON)
{
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0xFFFF);
REG_WIN0H = WIN_RANGE(0, 240);
REG_WIN0V = WIN_RANGE(0, 160);
@ -738,7 +731,7 @@ void Task_Birch1(u8 taskId)
gTasks[taskId].data[3] = 0xFF;
gTasks[taskId].data[7] = 216;
sub_8075474(BGM_DOORO_X4);
PlayBGM(BGM_DOORO_X4);
}
void task_new_game_prof_birch_speech_2(u8 taskId)
@ -750,7 +743,7 @@ void task_new_game_prof_birch_speech_2(u8 taskId)
else
{
u8 spriteId = gTasks[taskId].data[8];
gSprites[spriteId].pos1.x = 136;
gSprites[spriteId].pos1.y = 60;
gSprites[spriteId].invisible = 0;
@ -798,7 +791,7 @@ void task_new_game_prof_birch_speech_5(u8 taskId)
void task_new_game_prof_birch_speech_6(u8 taskId)
{
u8 spriteId = gTasks[taskId].data[9];
gSprites[spriteId].pos1.x = 104;
gSprites[spriteId].pos1.y = 72;
gSprites[spriteId].invisible = 0;
@ -810,7 +803,7 @@ void task_new_game_prof_birch_speech_6(u8 taskId)
void task_new_game_prof_birch_speech_7(u8 taskId)
{
if (sub_8075374())
if (IsCryFinished())
{
if (gTasks[taskId].data[7] > 95)
{
@ -818,13 +811,13 @@ void task_new_game_prof_birch_speech_7(u8 taskId)
gTasks[taskId].func = task_new_game_prof_birch_speech_8;
}
}
if (gTasks[taskId].data[7] < 16384)
{
gTasks[taskId].data[7]++;
if (gTasks[taskId].data[7] == 32)
{
cry_related(SPECIES_AZURILL, 0);
PlayCry1(SPECIES_AZURILL, 0);
}
}
}
@ -936,14 +929,14 @@ void task_new_game_prof_birch_speech_16(u8 taskId)
{
case MALE:
sub_8072DEC();
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
gSaveBlock2.playerGender = MALE;
MenuZeroFillWindowRect(2, 4, 8, 9);
gTasks[taskId].func = sub_800A974;
break;
case FEMALE:
sub_8072DEC();
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
gSaveBlock2.playerGender = FEMALE;
MenuZeroFillWindowRect(2, 4, 8, 9);
gTasks[taskId].func = sub_800A974;
@ -1037,19 +1030,19 @@ void sub_800A9EC(u8 taskId)
case 3:
case 4:
sub_8072DEC();
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
MenuZeroFillWindowRect(2, 1, 22, 12);
set_default_player_name(n);
gTasks[taskId].func = task_new_game_prof_birch_speech_part2_1;
break;
case 0:
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
BeginNormalPaletteFade(-1, 0, 0, 16, 0);
gTasks[taskId].func = sub_800AAAC;
break;
case -1:
sub_8072DEC();
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
MenuZeroFillWindowRect(2, 1, 22, 12);
gTasks[taskId].func = task_new_game_prof_birch_speech_14;
break;
@ -1087,7 +1080,7 @@ void task_new_game_prof_birch_speech_part2_4(u8 taskId)
switch (ProcessMenuInputNoWrap_())
{
case 0:
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
MenuZeroFillWindowRect(2, 1, 8, 7);
gSprites[gTasks[taskId].data[2]].oam.objMode = ST_OAM_OBJ_BLEND;
sub_800B458(taskId, 2);
@ -1096,7 +1089,7 @@ void task_new_game_prof_birch_speech_part2_4(u8 taskId)
break;
case -1:
case 1:
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
MenuZeroFillWindowRect(2, 1, 8, 7);
gTasks[taskId].func = task_new_game_prof_birch_speech_14;
break;
@ -1237,7 +1230,7 @@ void task_new_game_prof_birch_speech_part2_9(u8 taskId)
StartSpriteAffineAnim(&gSprites[spriteId], 0);
gSprites[spriteId].callback = sub_800B240;
BeginNormalPaletteFade(0x0000FFFF, 0, 0, 0x10, 0);
play_sound_effect(4);
FadeOutBGM(4);
gTasks[taskId].func = task_new_game_prof_birch_speech_part2_10;
}
}

View File

@ -4,6 +4,7 @@
#include "text.h"
#include "songs.h"
#include "text_window.h"
#include "sound.h"
struct Menu
{
@ -250,7 +251,7 @@ s8 ProcessMenuInput(void)
{
if (gMain.newKeys & A_BUTTON)
{
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
if (gMenu.menu_field_7)
sub_8072DEC();
return gMenu.cursorPos;
@ -265,13 +266,13 @@ s8 ProcessMenuInput(void)
if (gMain.newKeys & DPAD_UP)
{
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
MoveMenuCursor(-1);
return -2;
}
else if (gMain.newKeys & DPAD_DOWN)
{
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
MoveMenuCursor(1);
return -2;
}
@ -285,7 +286,7 @@ s8 ProcessMenuInputNoWrap(void)
if (gMain.newKeys & A_BUTTON)
{
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
if (gMenu.menu_field_7)
sub_8072DEC();
return gMenu.cursorPos;
@ -301,13 +302,13 @@ s8 ProcessMenuInputNoWrap(void)
if (gMain.newKeys & DPAD_UP)
{
if (cursorPos != MoveMenuCursorNoWrap(-1))
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
return -2;
}
else if (gMain.newKeys & DPAD_DOWN)
{
if (cursorPos != MoveMenuCursorNoWrap(1))
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
return -2;
}
@ -500,7 +501,7 @@ s8 sub_80727CC(void)
{
if (gMenu.menu_field_7)
sub_8072DEC();
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
return GetMenuCursorPos();
}
@ -513,25 +514,25 @@ s8 sub_80727CC(void)
if (gMain.newKeys & DPAD_UP)
{
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
MoveMenuCursor4(-gMenu.width);
return -2;
}
else if (gMain.newKeys & DPAD_DOWN)
{
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
MoveMenuCursor4(gMenu.width);
return -2;
}
else if (gMain.newKeys & DPAD_LEFT)
{
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
MoveMenuCursor4(-1);
return -2;
}
else if (gMain.newKeys & DPAD_RIGHT)
{
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
MoveMenuCursor4(1);
return -2;
}

View File

@ -8,6 +8,7 @@
#include "main.h"
#include "decoration.h"
#include "field_message_box.h"
#include "sound.h"
extern void ClearRamScript(void);
extern u16 *GetVarPointer(u16);
@ -50,16 +51,9 @@ extern void saved_warp2_set_2(s8, s8, s8, s8, s8, s8);
extern void sub_8053690(s8, s8, s8, s8, s8);
extern void sub_80536E4(s8, s8, s8, s8, s8);
extern void sub_805363C(s8, s8, s8, s8, s8);
extern void audio_play(u16);
extern bool8 task_is_not_running_overworld_fanfare(void);
extern bool8 mplay_has_finished_maybe(void);
extern void fanfare_play(u16);
extern void sav1_set_battle_music_maybe(u16);
extern void sub_8053F84(void);
extern void sub_8053FB0(u16);
extern void sub_8074FB8(u8);
extern bool8 sub_8074FD0(void);
extern void sub_8074FF8(u8);
extern u8 exec_movement(u8, u8, u8, void *);
extern bool8 sub_80A212C(u8, u8, u8);
extern void RemoveFieldObjectByLocalIdAndMap(u8, u8, u8);
@ -128,8 +122,6 @@ extern void sub_80C4980(u8);
extern u32 FieldEffectStart(u8);
extern bool8 FieldEffectActiveListContains(u8);
extern void sub_8053588(u8);
extern void sub_8075178(u16, u8);
extern bool8 sub_8075374(void);
extern void MapGridSetMetatileIdAt(u32, u32, u16);
extern u16 sub_8058790(u32, u32);
extern bool8 task_overworld_door_add_if_role_69_for_opening_door_at(u32, u32);
@ -904,13 +896,13 @@ bool8 ScrCmd_countpokemon(struct ScriptContext *ctx)
bool8 ScrCmd_playsfx(struct ScriptContext *ctx)
{
audio_play(ScriptReadHalfword(ctx));
PlaySE(ScriptReadHalfword(ctx));
return FALSE;
}
bool8 s30_music_check_asm()
{
if (!mplay_has_finished_maybe())
if (!IsSEPlaying())
return TRUE;
else
return FALSE;
@ -924,13 +916,13 @@ bool8 ScrCmd_checksound(struct ScriptContext *ctx)
bool8 ScrCmd_fanfare(struct ScriptContext *ctx)
{
fanfare_play(ScriptReadHalfword(ctx));
PlayFanfare(ScriptReadHalfword(ctx));
return FALSE;
}
bool8 s32_fanfare_wait_asm()
{
return task_is_not_running_overworld_fanfare();
return IsFanfareTaskInactive();
}
bool8 ScrCmd_waitfanfare(struct ScriptContext *ctx)
@ -945,7 +937,7 @@ bool8 ScrCmd_playmusic(struct ScriptContext *ctx)
bool8 val = *(ctx->scriptPtr++);
if (val == TRUE)
sav1_set_battle_music_maybe(songId);
current_map_music_set(songId);
PlayNewMapMusic(songId);
return FALSE;
}
@ -971,10 +963,10 @@ bool8 ScrCmd_fadeout(struct ScriptContext *ctx)
{
u8 val = *(ctx->scriptPtr++);
if (val)
sub_8074FB8(4 * val);
FadeOutBGMTemporarily(4 * val);
else
sub_8074FB8(4);
SetupNativeScript(ctx, sub_8074FD0);
FadeOutBGMTemporarily(4);
SetupNativeScript(ctx, IsBGMPausedOrStopped);
return TRUE;
}
@ -982,9 +974,9 @@ bool8 ScrCmd_fadein(struct ScriptContext *ctx)
{
u8 val = *(ctx->scriptPtr++);
if (val)
sub_8074FF8(4 * val);
FadeInBGM(4 * val);
else
sub_8074FF8(4);
FadeInBGM(4);
return FALSE;
}
@ -1855,13 +1847,13 @@ bool8 ScrCmd_pokecry(struct ScriptContext *ctx)
{
u16 v3 = VarGet(ScriptReadHalfword(ctx));
u16 v5 = VarGet(ScriptReadHalfword(ctx));
sub_8075178(v3, v5);
PlayCry5(v3, v5);
return FALSE;
}
bool8 ScrCmd_waitpokecry(struct ScriptContext *ctx)
{
SetupNativeScript(ctx, sub_8075374);
SetupNativeScript(ctx, IsCryFinished);
return TRUE;
}
@ -1888,7 +1880,7 @@ bool8 ScrCmd_setdooropened(struct ScriptContext *ctx)
v3 += 7;
v4 += 7;
v7 = sub_8058790(v3, v4);
audio_play(v7);
PlaySE(v7);
task_overworld_door_add_if_role_69_for_opening_door_at(v3, v4);
return FALSE;
}

View File

@ -1,6 +1,8 @@
#include "global.h"
#include "gba/m4a_internal.h"
#include "task.h"
#include "sound.h"
#include "songs.h"
struct Fanfare
{
@ -10,27 +12,23 @@ struct Fanfare
extern u32 speciesid_conv(u32);
void sound_sources_off(void);
void map_music_set_to_zero(void);
extern u16 gUnknown_020239F8;
extern struct MusicPlayerInfo *gUnknown_0202F79C;
extern u8 gUnknown_0202F7A0;
extern struct MusicPlayerInfo *gMPlay_PokemonCry;
extern u8 gPokemonCryBGMDuckingCounter;
extern u16 gUnknown_030006D4;
extern u16 gUnknown_030006D6;
extern u8 gUnknown_030006D8;
extern u8 gUnknown_030006D9;
extern u16 gUnknown_030006DA;
static u16 sCurrentMapMusic;
static u16 sNextMapMusic;
static u8 sMapMusicState;
static u8 sMapMusicFadeInSpeed;
static u16 sFanfareCounter;
extern u8 gUnknown_03004AEC;
extern struct MusicPlayerInfo gUnknown_03007380;
extern struct MusicPlayerInfo gUnknown_030073C0;
extern struct MusicPlayerInfo gUnknown_03007400;
extern struct MusicPlayerInfo gUnknown_03007450;
extern bool8 gDisableMusic;
extern struct MusicPlayerInfo gMPlay_BGM;
extern struct MusicPlayerInfo gMPlay_SE1;
extern struct MusicPlayerInfo gMPlay_SE2;
extern struct MusicPlayerInfo gMPlay_SE3;
extern struct Fanfare gUnknown_0837DEF4[];
extern struct Fanfare gFanfares[];
extern struct ToneData voicegroup_8452590[];
extern struct ToneData voicegroup_8452B90[];
@ -42,333 +40,325 @@ extern struct ToneData voicegroup_8453DC0[];
extern struct ToneData voicegroup_84543C0[];
extern struct ToneData voicegroup_84549C0[];
u8 sub_8075028(void);
u8 task_is_not_running_overworld_fanfare(void);
u8 sub_8074E14(void);
void sub_8074F6C(u16, u8);
void task50_overworld_fanfare(u8);
void task_add_50_overworld_fanfare_if_not_running(void);
void play_sound_effect(u8);
void sub_80751C0(u16 species, s8 a2, s8 a3, u8 a4, u8 a5);
void sub_8075408(u8);
void sub_8075450(void);
void sub_8075474(u16);
static void Task_Fanfare(u8 taskId);
static void CreateFanfareTask(void);
static void PlayCryInternal(u16 species, s8 pan, s8 volume, u8 priority, u8 mode);
static void Task_DuckBGMForPokemonCry(u8 taskId);
static void RestoreBGMVolumeAfterPokemonCry(void);
void sound_sources_off(void)
void InitMapMusic(void)
{
gUnknown_03004AEC = 0;
map_music_set_to_zero();
gDisableMusic = FALSE;
ResetMapMusic();
}
void sound_something(void)
void MapMusicMain(void)
{
switch (gUnknown_030006D8)
switch (sMapMusicState)
{
case 0:
break;
case 1:
gUnknown_030006D8 = 2;
sub_8075474(gUnknown_030006D4);
sMapMusicState = 2;
PlayBGM(sCurrentMapMusic);
break;
case 2:
case 3:
case 4:
break;
case 5:
if (sub_8075028())
if (IsBGMStopped())
{
gUnknown_030006D6 = 0;
gUnknown_030006D8 = 0;
sNextMapMusic = 0;
sMapMusicState = 0;
}
break;
case 6:
if (sub_8075028() && task_is_not_running_overworld_fanfare())
if (IsBGMStopped() && IsFanfareTaskInactive())
{
gUnknown_030006D4 = gUnknown_030006D6;
gUnknown_030006D6 = 0;
gUnknown_030006D8 = 2;
sub_8075474(gUnknown_030006D4);
sCurrentMapMusic = sNextMapMusic;
sNextMapMusic = 0;
sMapMusicState = 2;
PlayBGM(sCurrentMapMusic);
}
break;
case 7:
if (sub_8075028() && task_is_not_running_overworld_fanfare())
if (IsBGMStopped() && IsFanfareTaskInactive())
{
sub_8074F6C(gUnknown_030006D6, gUnknown_030006D9);
gUnknown_030006D4 = gUnknown_030006D6;
gUnknown_030006D6 = 0;
gUnknown_030006D8 = 2;
gUnknown_030006D9 = 0;
FadeInNewBGM(sNextMapMusic, sMapMusicFadeInSpeed);
sCurrentMapMusic = sNextMapMusic;
sNextMapMusic = 0;
sMapMusicState = 2;
sMapMusicFadeInSpeed = 0;
}
break;
}
}
void map_music_set_to_zero(void)
void ResetMapMusic(void)
{
gUnknown_030006D4 = 0;
gUnknown_030006D6 = 0;
gUnknown_030006D8 = 0;
gUnknown_030006D9 = 0;
sCurrentMapMusic = 0;
sNextMapMusic = 0;
sMapMusicState = 0;
sMapMusicFadeInSpeed = 0;
}
u16 current_map_music_get(void)
u16 GetCurrentMapMusic(void)
{
return gUnknown_030006D4;
return sCurrentMapMusic;
}
void current_map_music_set(u16 a1)
void PlayNewMapMusic(u16 songNum)
{
gUnknown_030006D4 = a1;
gUnknown_030006D6 = 0;
gUnknown_030006D8 = 1;
sCurrentMapMusic = songNum;
sNextMapMusic = 0;
sMapMusicState = 1;
}
void sub_8074D08(void)
void StopMapMusic(void)
{
gUnknown_030006D4 = 0;
gUnknown_030006D6 = 0;
gUnknown_030006D8 = 1;
sCurrentMapMusic = 0;
sNextMapMusic = 0;
sMapMusicState = 1;
}
void sub_8074D28(u8 a1)
void FadeOutMapMusic(u8 speed)
{
if (sub_8074E14())
play_sound_effect(a1);
gUnknown_030006D4 = 0;
gUnknown_030006D6 = 0;
gUnknown_030006D8 = 5;
if (IsNotWaitingForBGMStop())
FadeOutBGM(speed);
sCurrentMapMusic = 0;
sNextMapMusic = 0;
sMapMusicState = 5;
}
void sub_8074D60(u16 a1, u8 a2)
void FadeOutAndPlayNewMapMusic(u16 songNum, u8 speed)
{
sub_8074D28(a2);
gUnknown_030006D4 = 0;
gUnknown_030006D6 = a1;
gUnknown_030006D8 = 6;
FadeOutMapMusic(speed);
sCurrentMapMusic = 0;
sNextMapMusic = songNum;
sMapMusicState = 6;
}
void sub_8074D94(u16 a1, u8 a2, u8 a3)
void FadeOutAndFadeInNewMapMusic(u16 songNum, u8 fadeOutSpeed, u8 fadeInSpeed)
{
sub_8074D28(a2);
gUnknown_030006D4 = 0;
gUnknown_030006D6 = a1;
gUnknown_030006D8 = 7;
gUnknown_030006D9 = a3;
FadeOutMapMusic(fadeOutSpeed);
sCurrentMapMusic = 0;
sNextMapMusic = songNum;
sMapMusicState = 7;
sMapMusicFadeInSpeed = fadeInSpeed;
}
void unref_sub_8074DD8(u16 a1, u8 a2)
void FadeInNewMapMusic(u16 songNum, u8 speed)
{
sub_8074F6C(a1, a2);
gUnknown_030006D4 = a1;
gUnknown_030006D6 = 0;
gUnknown_030006D8 = 2;
gUnknown_030006D9 = 0;
FadeInNewBGM(songNum, speed);
sCurrentMapMusic = songNum;
sNextMapMusic = 0;
sMapMusicState = 2;
sMapMusicFadeInSpeed = 0;
}
bool8 sub_8074E14(void)
bool8 IsNotWaitingForBGMStop(void)
{
if (gUnknown_030006D8 == 6)
if (sMapMusicState == 6)
return FALSE;
if (gUnknown_030006D8 == 5)
if (sMapMusicState == 5)
return FALSE;
if (gUnknown_030006D8 == 7)
if (sMapMusicState == 7)
return FALSE;
return TRUE;
}
void pause_music_for_sound_maybe(u8 a1)
void PlayFanfareByFanfareNum(u8 fanfareNum)
{
struct Fanfare *fanfares;
struct Fanfare *fanfare;
u16 songNum;
m4aMPlayStop(&gUnknown_03007380);
fanfares = gUnknown_0837DEF4;
fanfare = &fanfares[a1];
m4aMPlayStop(&gMPlay_BGM);
fanfares = gFanfares;
fanfare = &fanfares[fanfareNum];
songNum = fanfare->songNum;
gUnknown_030006DA = fanfare->duration;
sFanfareCounter = fanfare->duration;
m4aSongNumStart(songNum);
}
bool8 ducking_tick(u8 a1)
bool8 WaitFanfare(bool8 stop)
{
if (gUnknown_030006DA)
if (sFanfareCounter)
{
gUnknown_030006DA--;
sFanfareCounter--;
return FALSE;
}
else
{
if (!a1)
m4aMPlayContinue(&gUnknown_03007380);
if (!stop)
m4aMPlayContinue(&gMPlay_BGM);
else
m4aSongNumStart(0);
m4aSongNumStart(SE_STOP);
return TRUE;
}
}
void unref_sub_8074EA4(u8 a1)
void StopFanfareByFanfareNum(u8 fanfareNum)
{
m4aSongNumStop(gUnknown_0837DEF4[a1].songNum);
m4aSongNumStop(gFanfares[fanfareNum].songNum);
}
void fanfare_play(u16 a1)
void PlayFanfare(u16 songNum)
{
s32 i;
for (i = 0; (u32)i < 12; i++)
{
struct Fanfare *fanfare = &gUnknown_0837DEF4[i];
if (fanfare->songNum == a1)
struct Fanfare *fanfare = &gFanfares[i];
if (fanfare->songNum == songNum)
{
pause_music_for_sound_maybe(i);
task_add_50_overworld_fanfare_if_not_running();
PlayFanfareByFanfareNum(i);
CreateFanfareTask();
return;
}
}
pause_music_for_sound_maybe(0);
task_add_50_overworld_fanfare_if_not_running();
PlayFanfareByFanfareNum(0);
CreateFanfareTask();
}
bool8 task_is_not_running_overworld_fanfare(void)
bool8 IsFanfareTaskInactive(void)
{
if (FuncIsActiveTask(task50_overworld_fanfare) == TRUE)
if (FuncIsActiveTask(Task_Fanfare) == TRUE)
return FALSE;
return TRUE;
}
void task50_overworld_fanfare(u8 taskId)
static void Task_Fanfare(u8 taskId)
{
if (gUnknown_030006DA)
if (sFanfareCounter)
{
gUnknown_030006DA--;
sFanfareCounter--;
}
else
{
m4aMPlayContinue(&gUnknown_03007380);
m4aMPlayContinue(&gMPlay_BGM);
DestroyTask(taskId);
}
}
void task_add_50_overworld_fanfare_if_not_running(void)
static void CreateFanfareTask(void)
{
if (FuncIsActiveTask(task50_overworld_fanfare) != TRUE)
CreateTask(task50_overworld_fanfare, 80);
if (FuncIsActiveTask(Task_Fanfare) != TRUE)
CreateTask(Task_Fanfare, 80);
}
void sub_8074F6C(u16 a1, u8 a2)
void FadeInNewBGM(u16 songNum, u8 speed)
{
if (gUnknown_03004AEC)
a1 = 0;
m4aSongNumStart(a1);
m4aMPlayImmInit(&gUnknown_03007380);
m4aMPlayVolumeControl(&gUnknown_03007380, 0xFFFF, 0);
m4aSongNumStop(a1);
sub_81DE0F0(&gUnknown_03007380, a2);
if (gDisableMusic)
songNum = 0;
m4aSongNumStart(songNum);
m4aMPlayImmInit(&gMPlay_BGM);
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0);
m4aSongNumStop(songNum);
m4aMPlayFadeIn(&gMPlay_BGM, speed);
}
void sub_8074FB8(u8 a1)
void FadeOutBGMTemporarily(u8 speed)
{
sub_81DE0D0(&gUnknown_03007380, a1);
m4aMPlayFadeOutTemporarily(&gMPlay_BGM, speed);
}
bool8 sub_8074FD0(void)
bool8 IsBGMPausedOrStopped(void)
{
if (gUnknown_03007380.status & MUSICPLAYER_STATUS_PAUSE)
if (gMPlay_BGM.status & MUSICPLAYER_STATUS_PAUSE)
return TRUE;
if (!(gUnknown_03007380.status & MUSICPLAYER_STATUS_TRACK))
if (!(gMPlay_BGM.status & MUSICPLAYER_STATUS_TRACK))
return TRUE;
return FALSE;
}
void sub_8074FF8(u8 a1)
void FadeInBGM(u8 speed)
{
sub_81DE0F0(&gUnknown_03007380, a1);
m4aMPlayFadeIn(&gMPlay_BGM, speed);
}
void play_sound_effect(u8 a1)
void FadeOutBGM(u8 speed)
{
m4aMPlayFadeOut(&gUnknown_03007380, a1);
m4aMPlayFadeOut(&gMPlay_BGM, speed);
}
bool8 sub_8075028(void)
bool8 IsBGMStopped(void)
{
if (!(gUnknown_03007380.status & MUSICPLAYER_STATUS_TRACK))
if (!(gMPlay_BGM.status & MUSICPLAYER_STATUS_TRACK))
return TRUE;
return FALSE;
}
void cry_related(u16 a1, u8 a2)
void PlayCry1(u16 species, s8 pan)
{
m4aMPlayVolumeControl(&gUnknown_03007380, 0xFFFF, 85);
sub_80751C0(a1, a2, 0x7D, 0xA, 0);
gUnknown_0202F7A0 = 2;
sub_8075450();
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85);
PlayCryInternal(species, pan, 125, 10, 0);
gPokemonCryBGMDuckingCounter = 2;
RestoreBGMVolumeAfterPokemonCry();
}
void sub_8075090(u16 a1, s8 a2, s8 a3, u8 a4)
void PlayCry2(u16 species, s8 pan, s8 volume, u8 priority)
{
sub_80751C0(a1, a2, a3, a4, 0);
PlayCryInternal(species, pan, volume, priority, 0);
}
void sub_80750B4(u16 a1, s8 a2, u8 a3)
void PlayCry3(u16 species, s8 pan, u8 mode)
{
if (a3 == 1)
if (mode == 1)
{
sub_80751C0(a1, a2, 0x7D, 0xA, 1);
PlayCryInternal(species, pan, 125, 10, 1);
}
else
{
m4aMPlayVolumeControl(&gUnknown_03007380, 0xFFFF, 85);
sub_80751C0(a1, a2, 0x7D, 0xA, a3);
gUnknown_0202F7A0 = 2;
sub_8075450();
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85);
PlayCryInternal(species, pan, 125, 10, mode);
gPokemonCryBGMDuckingCounter = 2;
RestoreBGMVolumeAfterPokemonCry();
}
}
void sub_8075114(u16 a1, s8 a2, u8 a3)
void PlayCry4(u16 species, s8 pan, u8 mode)
{
if (a3 == 1)
if (mode == 1)
{
sub_80751C0(a1, a2, 0x7D, 0xA, 1);
PlayCryInternal(species, pan, 125, 10, 1);
}
else
{
if (!(gUnknown_020239F8 & 0x40))
m4aMPlayVolumeControl(&gUnknown_03007380, 0xFFFF, 85);
sub_80751C0(a1, a2, 0x7D, 0xA, a3);
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85);
PlayCryInternal(species, pan, 125, 10, mode);
}
}
void sub_8075178(u16 a1, u8 a2)
void PlayCry5(u16 species, u8 mode)
{
m4aMPlayVolumeControl(&gUnknown_03007380, 0xFFFF, 85);
sub_80751C0(a1, 0, 0x7D, 0xA, a2);
gUnknown_0202F7A0 = 2;
sub_8075450();
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85);
PlayCryInternal(species, 0, 125, 10, mode);
gPokemonCryBGMDuckingCounter = 2;
RestoreBGMVolumeAfterPokemonCry();
}
#define GET_CRY_PTR(a, b)\
{\
u32 ptr1;\
struct MusicPlayerInfo *ptr2;\
struct ToneData *tone;\
if (v0)\
ptr1 = (u32)&a[index];\
tone = &a[index];\
else\
ptr1 = (u32)&b[index];\
ptr2 = sub_81DF43C(ptr1);\
gUnknown_0202F79C = ptr2;\
tone = &b[index];\
gMPlay_PokemonCry = SetPokemonCryTone(tone);\
break;\
}
void sub_80751C0(u16 species, s8 a2, s8 a3, u8 a4, u8 a5)
static void PlayCryInternal(u16 species, s8 pan, s8 volume, u8 priority, u8 mode)
{
u32 cryId;
u32 v0;
u32 v1;
u32 v2;
u32 v3;
u32 v4;
u32 release;
u32 length;
u32 pitch;
u32 chorus;
u32 index;
u8 table;
@ -377,50 +367,50 @@ void sub_80751C0(u16 species, s8 a2, s8 a3, u8 a4, u8 a5)
cryId = species;
v0 = 0;
v1 = 0;
v2 = 140;
v3 = 15360;
v4 = 0;
release = 0;
length = 140;
pitch = 15360;
chorus = 0;
switch (a5)
switch (mode)
{
case 0:
break;
case 1:
v2 = 20;
v1 = 225;
length = 20;
release = 225;
break;
case 2:
v2 = 30;
v1 = 225;
v3 = 15600;
v4 = 20;
a3 = 80;
length = 30;
release = 225;
pitch = 15600;
chorus = 20;
volume = 80;
break;
case 3:
v2 = 50;
v1 = 200;
v3 = 14800;
length = 50;
release = 200;
pitch = 14800;
break;
case 4:
v2 = 20;
v1 = 220;
v3 = 15800;
length = 20;
release = 220;
pitch = 15800;
break;
case 5:
v1 = 200;
v3 = 14500;
release = 200;
pitch = 14500;
break;
}
sub_81DF50C(a3);
sub_81DF520(a2);
sub_81DF538(v3);
sub_81DF570(v2);
sub_81DF588(0);
sub_81DF57C(v1);
sub_81DF5AC(v4);
sub_81DF618(a4);
SetPokemonCryVolume(volume);
SetPokemonCryPanpot(pan);
SetPokemonCryPitch(pitch);
SetPokemonCryLength(length);
SetPokemonCryProgress(0);
SetPokemonCryRelease(release);
SetPokemonCryChorus(chorus);
SetPokemonCryPriority(priority);
asm("");
asm("");
@ -445,9 +435,9 @@ void sub_80751C0(u16 species, s8 a2, s8 a3, u8 a4, u8 a5)
}
}
bool8 sub_8075374(void)
bool8 IsCryFinished(void)
{
if (FuncIsActiveTask(sub_8075408) == TRUE)
if (FuncIsActiveTask(Task_DuckBGMForPokemonCry) == TRUE)
{
return FALSE;
}
@ -458,20 +448,20 @@ bool8 sub_8075374(void)
}
}
void sub_8075398(void)
void StopCryAndClearCrySongs(void)
{
m4aMPlayStop(gUnknown_0202F79C);
m4aMPlayStop(gMPlay_PokemonCry);
ClearPokemonCrySongs();
}
void sub_80753B0(void)
void StopCry(void)
{
m4aMPlayStop(gUnknown_0202F79C);
m4aMPlayStop(gMPlay_PokemonCry);
}
bool8 sub_80753C4(void)
bool8 IsCryPlayingOrClearCrySongs(void)
{
if (sub_81DF594(gUnknown_0202F79C))
if (IsPokemonCryPlaying(gMPlay_PokemonCry))
{
return TRUE;
}
@ -482,97 +472,97 @@ bool8 sub_80753C4(void)
}
}
bool8 sub_80753E8(void)
bool8 IsCryPlaying(void)
{
if (sub_81DF594(gUnknown_0202F79C))
if (IsPokemonCryPlaying(gMPlay_PokemonCry))
return TRUE;
else
return FALSE;
}
void sub_8075408(u8 taskId)
static void Task_DuckBGMForPokemonCry(u8 taskId)
{
if (gUnknown_0202F7A0)
if (gPokemonCryBGMDuckingCounter)
{
gUnknown_0202F7A0--;
gPokemonCryBGMDuckingCounter--;
}
else if (!sub_81DF594(gUnknown_0202F79C))
else if (!IsPokemonCryPlaying(gMPlay_PokemonCry))
{
m4aMPlayVolumeControl(&gUnknown_03007380, 0xFFFF, 256);
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 256);
DestroyTask(taskId);
}
}
void sub_8075450(void)
static void RestoreBGMVolumeAfterPokemonCry(void)
{
if (FuncIsActiveTask(sub_8075408) != TRUE)
CreateTask(sub_8075408, 80);
if (FuncIsActiveTask(Task_DuckBGMForPokemonCry) != TRUE)
CreateTask(Task_DuckBGMForPokemonCry, 80);
}
void sub_8075474(u16 a1)
void PlayBGM(u16 songNum)
{
if (gUnknown_03004AEC)
a1 = 0;
m4aSongNumStart(a1);
if (gDisableMusic)
songNum = 0;
m4aSongNumStart(songNum);
}
void audio_play(u16 songNum)
void PlaySE(u16 songNum)
{
m4aSongNumStart(songNum);
}
void audio_play_and_stuff(u16 a1, u8 a2)
void PlaySE12WithPanning(u16 songNum, u8 pan)
{
m4aSongNumStart(a1);
m4aMPlayImmInit(&gUnknown_030073C0);
m4aMPlayImmInit(&gUnknown_03007400);
m4aMPlayPanpotControl(&gUnknown_030073C0, 0xFFFF, a2);
m4aMPlayPanpotControl(&gUnknown_03007400, 0xFFFF, a2);
m4aSongNumStart(songNum);
m4aMPlayImmInit(&gMPlay_SE1);
m4aMPlayImmInit(&gMPlay_SE2);
m4aMPlayPanpotControl(&gMPlay_SE1, 0xFFFF, pan);
m4aMPlayPanpotControl(&gMPlay_SE2, 0xFFFF, pan);
}
void sub_80754F8(u16 a1, u8 a2)
void PlaySE1WithPanning(u16 songNum, u8 pan)
{
m4aSongNumStart(a1);
m4aMPlayImmInit(&gUnknown_030073C0);
m4aMPlayPanpotControl(&gUnknown_030073C0, 0xFFFF, a2);
m4aSongNumStart(songNum);
m4aMPlayImmInit(&gMPlay_SE1);
m4aMPlayPanpotControl(&gMPlay_SE1, 0xFFFF, pan);
}
void sub_807552C(u16 a1, u8 a2)
void PlaySE2WithPanning(u16 songNum, u8 pan)
{
m4aSongNumStart(a1);
m4aMPlayImmInit(&gUnknown_03007400);
m4aMPlayPanpotControl(&gUnknown_03007400, 0xFFFF, a2);
m4aSongNumStart(songNum);
m4aMPlayImmInit(&gMPlay_SE2);
m4aMPlayPanpotControl(&gMPlay_SE2, 0xFFFF, pan);
}
void sub_8075560(u8 a1)
void SE12PanpotControl(u8 pan)
{
m4aMPlayPanpotControl(&gUnknown_030073C0, 0xFFFF, a1);
m4aMPlayPanpotControl(&gUnknown_03007400, 0xFFFF, a1);
m4aMPlayPanpotControl(&gMPlay_SE1, 0xFFFF, pan);
m4aMPlayPanpotControl(&gMPlay_SE2, 0xFFFF, pan);
}
bool8 mplay_has_finished_maybe(void)
bool8 IsSEPlaying(void)
{
if ((gUnknown_030073C0.status & MUSICPLAYER_STATUS_PAUSE) && (gUnknown_03007400.status & MUSICPLAYER_STATUS_PAUSE))
if ((gMPlay_SE1.status & MUSICPLAYER_STATUS_PAUSE) && (gMPlay_SE2.status & MUSICPLAYER_STATUS_PAUSE))
return FALSE;
if (!(gUnknown_030073C0.status & MUSICPLAYER_STATUS_TRACK) && !(gUnknown_03007400.status & MUSICPLAYER_STATUS_TRACK))
if (!(gMPlay_SE1.status & MUSICPLAYER_STATUS_TRACK) && !(gMPlay_SE2.status & MUSICPLAYER_STATUS_TRACK))
return FALSE;
return TRUE;
}
bool8 sub_80755D4(void)
bool8 IsBGMPlaying(void)
{
if (gUnknown_03007380.status & MUSICPLAYER_STATUS_PAUSE)
if (gMPlay_BGM.status & MUSICPLAYER_STATUS_PAUSE)
return FALSE;
if (!(gUnknown_03007380.status & MUSICPLAYER_STATUS_TRACK))
if (!(gMPlay_BGM.status & MUSICPLAYER_STATUS_TRACK))
return FALSE;
return TRUE;
}
bool8 sub_80755FC(void)
bool8 IsSpecialSEPlaying(void)
{
if (gUnknown_03007450.status & MUSICPLAYER_STATUS_PAUSE)
if (gMPlay_SE3.status & MUSICPLAYER_STATUS_PAUSE)
return FALSE;
if (!(gUnknown_03007450.status & MUSICPLAYER_STATUS_TRACK))
if (!(gMPlay_SE3.status & MUSICPLAYER_STATUS_TRACK))
return FALSE;
return TRUE;
}

View File

@ -4,6 +4,7 @@
#include "string_util.h"
#include "songs.h"
#include "palette.h"
#include "sound.h"
enum
{
@ -63,10 +64,6 @@ struct ShiftAmount
u32 right;
};
extern void sub_8075474(u16);
extern void audio_play(u16);
extern u8 mplay_has_finished_maybe(void);
static u16 InitVariableWidthFontTileData(struct Window *, u16);
static u16 LoadFixedWidthFont(struct Window *, u16);
static u16 LoadFixedWidthFont_Font1Latin(struct Window *, u16);
@ -2178,7 +2175,7 @@ static u8 ExtCtrlCode_PlayBGM(struct Window *win)
{
u16 loByte = win->text[win->textIndex++];
u16 hiByte = win->text[win->textIndex++] << 8;
sub_8075474(loByte | hiByte);
PlayBGM(loByte | hiByte);
return 2;
}
@ -2210,7 +2207,7 @@ static u8 ExtCtrlCode_PlaySE(struct Window *win)
{
u16 loByte = win->text[win->textIndex++];
u16 hiByte = win->text[win->textIndex++] << 8;
audio_play(loByte | hiByte);
PlaySE(loByte | hiByte);
return 2;
}
@ -2386,7 +2383,7 @@ static u8 UpdateWindowText(struct Window *win)
{
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
}
else
{
@ -2445,7 +2442,7 @@ static u8 UpdateWindowText(struct Window *win)
ClearWindowTextLines(win);
break;
case WIN_STATE_WAIT_SOUND:
if (mplay_has_finished_maybe())
if (IsSEPlaying())
return 0;
win->state = WIN_STATE_NORMAL;
break;
@ -3192,7 +3189,7 @@ static u8 WaitWithDownArrow(struct Window *win)
{
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
audio_play(SE_SELECT);
PlaySE(SE_SELECT);
TryEraseDownArrow(win);
}
else

View File

@ -119,20 +119,7 @@ gUnknown_030006CC: @ 30006CC
gUnknown_030006D0: @ 30006D0
.space 0x4
gUnknown_030006D4: @ 30006D4
.space 0x2
gUnknown_030006D6: @ 30006D6
.space 0x2
gUnknown_030006D8: @ 30006D8
.space 0x1
gUnknown_030006D9: @ 30006D9
.space 0x1
gUnknown_030006DA: @ 30006DA
.space 0x2
.include "src/sound.o"
gUnknown_030006DC: @ 30006DC
.space 0x4

View File

@ -206,7 +206,7 @@ gUnknown_03004AE4: @ 3004AE4
gUnknown_03004AE8: @ 3004AE8
.space 0x4
gUnknown_03004AEC: @ 3004AEC
gDisableMusic: @ 3004AEC
.space 0x4
gUnknown_03004AF0: @ 3004AF0
@ -419,19 +419,19 @@ gUnknown_03005FA0: @ 3005FA0
.include "m4a_2.o"
.align 4
gUnknown_03007380: @ 3007380
gMPlay_BGM: @ 3007380
.space 0x40
gUnknown_030073C0: @ 30073C0
gMPlay_SE1: @ 30073C0
.space 0x40
gUnknown_03007400: @ 3007400
gMPlay_SE2: @ 3007400
.space 0x40
gMPlayMemAccArea: @ 3007440
.space 0x10
gUnknown_03007450: @ 3007450
gMPlay_SE3: @ 3007450
.space 0x40
.include "agb_flash.o"

View File

@ -484,10 +484,10 @@ gUnknown_0202E9D8: @ 202E9D8
.include "src/palette.o"
.align 2
gUnknown_0202F79C: @ 202F79C
gMPlay_PokemonCry: @ 202F79C
.space 0x4
gUnknown_0202F7A0: @ 202F7A0
gPokemonCryBGMDuckingCounter: @ 202F7A0
.space 0x4
gUnknown_0202F7A4: @ 202F7A4