diff options
author | yenatch <yenatch@gmail.com> | 2013-02-23 16:47:39 -0500 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2013-02-23 16:57:25 -0500 |
commit | 8bbfa54059a3d4a242ff530e87c034ec48f5f4eb (patch) | |
tree | b3f0d07fb017e89b47bdd5e35802921e7ee32bf9 /main.asm | |
parent | f56f340ce115d049374678bffc7509e89a6d31ca (diff) |
PlayCryHeader and related wram
Diffstat (limited to 'main.asm')
-rw-r--r-- | main.asm | 66 |
1 files changed, 65 insertions, 1 deletions
@@ -3392,7 +3392,71 @@ StartMusic: ; 3b97 ret ; 3bbc -INCBIN "baserom.gbc",$3bbc,$3c23 - $3bbc +INCBIN "baserom.gbc",$3bbc,$3be3 - $3bbc + +PlayCryHeader: ; 3be3 +; Play a cry given parameters in header de + + push hl + push de + push bc + push af + +; Save current bank + ld a, [$ff9d] + push af + +; Cry headers are stuck in one bank. + ld a, BANK(CryHeaders) + ld [$ff9d], a + ld [$2000], a + +; Each header is 6 bytes long: + ld hl, CryHeaders + add hl, de + add hl, de + add hl, de + add hl, de + add hl, de + add hl, de + +; Header struct: + +; id + ld e, [hl] + inc hl + ld d, [hl] + inc hl +; pitch + ld a, [hli] + ld [CryPitch], a +; echo + ld a, [hli] + ld [CryEcho], a +; length + ld a, [hli] + ld [CryLength], a + ld a, [hl] + ld [CryLength+1], a + +; That's it for the header + ld a, BANK(PlayCry) + ld [$ff9d], a + ld [$2000], a + call PlayCry + +; Restore bank + pop af + ld [$ff9d], a + ld [$2000], a + + pop af + pop bc + pop de + pop hl + ret +; 3c23 + StartSFX: ; 3c23 ; sfx id order is by priority (highest to lowest) |