diff options
Diffstat (limited to 'home/pikachu_cries.asm')
-rw-r--r-- | home/pikachu_cries.asm | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/home/pikachu_cries.asm b/home/pikachu_cries.asm new file mode 100644 index 00000000..84889ef9 --- /dev/null +++ b/home/pikachu_cries.asm @@ -0,0 +1,46 @@ +PlayPikachuPCM:: + ldh a, [hLoadedROMBank] + push af + ld a, b + call BankswitchCommon + ld a, [hli] + ld c, a + ld a, [hli] + ld b, a +.loop + ld a, [hli] + ld d, a + ld a, $3 +.playSingleSample + dec a + jr nz, .playSingleSample + +REPT 7 + call LoadNextSoundClipSample + call PlaySoundClipSample +ENDR + + call LoadNextSoundClipSample + dec bc + ld a, c + or b + jr nz, .loop + pop af + call BankswitchCommon + ret + +LoadNextSoundClipSample:: + ld a, d + and $80 + srl a + srl a + ldh [rNR32], a + sla d + ret + +PlaySoundClipSample:: + ld a, $3 +.loop + dec a + jr nz, .loop + ret |