diff options
-rw-r--r-- | home/audio.asm | 127 | ||||
-rw-r--r-- | home/talk_to_npc.asm | 20 | ||||
-rw-r--r-- | shim.sym | 16 |
3 files changed, 145 insertions, 18 deletions
diff --git a/home/audio.asm b/home/audio.asm index 03a0990..e50abc1 100644 --- a/home/audio.asm +++ b/home/audio.asm @@ -140,3 +140,130 @@ PlaySFX:: ; 3d63 ret WaitPlaySFX:: ; 3d7f + call WaitSFX + call PlaySFX + ret + +WaitSFX:: ; 3d86 + push hl +.loop + ld hl, wChannel5Flags1 + bit 0, [hl] + jr nz, .loop + ld hl, wChannel6Flags1 + bit 0, [hl] + jr nz, .loop + ld hl, wChannel7Flags1 + bit 0, [hl] + jr nz, .loop + ld hl, wChannel8Flags1 + bit 0, [hl] + jr nz, .loop + pop hl + ret + +MaxVolume:: ; 3DA5 + ld a, $77 + ld [wVolume], a + ret + +LowVolume:: ; 3DAB + ld a, $33 + ld [wVolume], a + ret + +VolumeOff:: ; 3DB1 + xor a + ld [wVolume], a + ret + +UpdateSoundNTimes:: ; 3DB6 +.loop + and a + ret z + dec a + call UpdateSound + jr .loop + +FadeToMapMusic:: ; 3DBE + push hl + push de + push bc + push af + call GetMapMusic + ld a, [wMapMusic] + cp e + jr z, .jump + ld a, $08 + ld [wMusicFade], a + ld a, e + ld [wMusicFadeID], a + ld a, d + ld [wMusicFadeID+1], a + ld a, e + ld [wMapMusic], a +.jump + pop af + pop bc + pop de + pop hl + ret + +PlayMapMusic:: ; 3DE1 + push hl + push de + push bc + push af + call GetMapMusic + ld a, [wMapMusic] + cp e + jr z, .jump + push de + ld de, $0000 + call PlayMusic + call DelayFrame + pop de + ld a, e + ld [wMapMusic], a + call PlayMusic +.jump + pop af + pop bc + pop de + pop hl + ret + +SpecialMapMusic:: ; 3E05 + ld a, [wPlayerBikeSurfState] + and a + jr z, .normal + cp $02 + jr z, .state2 + ld de, $0009 + scf + ret + +.state2 ; 3E14 + ld de, $0000 + scf + ret + +.normal ; 3E19 + and a + ret + +GetMapMusic:: ; 3E1B + call SpecialMapMusic + ret c + ld a, [wMapPermissions] + cp $01 + jr z, .jump + cp $03 + jr z, .jump + ld de, $0002 + ret +.jump ; 3E2E + ld de, $0007 + ret + +; 3E32, this is likely not a function.
\ No newline at end of file diff --git a/home/talk_to_npc.asm b/home/talk_to_npc.asm index 1820692..3371b3c 100644 --- a/home/talk_to_npc.asm +++ b/home/talk_to_npc.asm @@ -260,7 +260,7 @@ CheckInlineTrainer:: ; 00:31C4 add hl, de ld a, [hl] call GetObjectStruct ; de is the address of the number of object we want - call $31EB + call GetInlineMapObject jr nc, .escape ; if c flag isn't set, leave ld hl, $000B ; map_object script add hl, de @@ -354,4 +354,20 @@ SetFFInAccumulator:: ; 3240 dec a ret -; 3243
\ No newline at end of file +Function3243:: ; 3243 + ldh a, [hROMBank] + push af + ld a, $03 + call Bankswitch + push hl + push de + push bc + call _TossItem + pop bc + pop de + pop hl + pop af + call Bankswitch + ret + +;3259
\ No newline at end of file @@ -1,21 +1,5 @@ ; ROM0 00:3CA8 InitSpriteAnimStruct -00:3D86 WaitSFX -00:3D87 WaitSFX.wait -00:3DA5 MaxVolume -00:3DAB LowVolume -00:3DB1 VolumeOff -00:3DB6 UpdateSoundNTimes -00:3DBE FadeToMapMusic -00:3DDC FadeToMapMusic.dontfade -00:3DE1 PlayMapMusic -00:3E00 PlayMapMusic.dontplay -00:3E05 SpecialMapMusic -00:3E14 SpecialMapMusic.state2 -00:3E19 SpecialMapMusic.normal -00:3E1B GetMapMusic -00:3E2E GetMapMusic.unk_3E2E -00:3E32 Unk_3E32 01:4031 Function4031 01:4031 DebugMenu |