.globl _PLW_PlaySoundEffect .globl _PLW_IsSoundEffectOn .globl _PLW_PlaySoundEffectP .globl plw_current_efx PLY_LW_PLAY_SOUND_EFFECT = 0x0b06 + 0xc _PLW_PlaySoundEffect:: ld hl,#2 add hl,sp ld a, (hl) inc hl ld c, (hl) inc hl ld b, (hl) jp PLY_LW_PLAY_SOUND_EFFECT _PLW_PlaySoundEffectP:: ; check if current is over ; de is not used ld e, l ; fixed channel 2 ld l, #2 call _PLW_IsSoundEffectOn ld a, l or a jr z, play_efx ld a, (plw_current_efx) cp e ret nc play_efx: ; all good, play the effect ld a, e ld (plw_current_efx), a ; fixed channel 2, full volume ld bc, #0x0002 jp PLY_LW_PLAY_SOUND_EFFECT .area _DATA plw_current_efx: .ds 1