flamewing / flamedriver

Upgraded S3&K sound driver
https://github.com/flamewing/flamedriver-skdisasm
Other
14 stars 5 forks source link

Tempo and Continuous SFX bug #25

Open TheBlad768 opened 4 months ago

TheBlad768 commented 4 months ago

There are two problems here that I've noticed

  1. The tempo is reset if other music starts playing (Speedup lose).

https://youtu.be/qMOh0JcW97w

  1. If another SFX with the same channel is playing during a Continuous SFX, the Continuous flag will never be reset and the Continuous SFX will not play again.

https://youtu.be/xm5QhsBn-bY https://youtu.be/OsxBIM740qk

I know Continuous SFX has been fixed in AMPS and this kind of bug is absent there...

The object I made for my project:

; ---------------------------------------------------------------------------
; Object 49 - waterfall sound effect (GHZ)
; ---------------------------------------------------------------------------

; =============== S U B R O U T I N E =======================================

Obj_WaterSound:
        moveq   #signextendB(sfx_Waterfall),d0
        moveq   #$F,d1                          ; play water sound
        jsr (Play_SFX_Continuous).w
        jmp (Delete_Sprite_If_Not_In_Range).w

; =============== S U B R O U T I N E =======================================

Play_SFX_Continuous:
        and.b   (V_int_run_count+3).w,d1
        bne.s   StartNewLevel.return
        bra.w   Play_SFX                                        ; play sfx

I added this code for the pause. And it solved the problem of Continuous SFX for pause

.unpause:
        xor    a                                ; a = 0
        ld    (hl), a                            ; Clear pause flag
        ld    (zContinuousSFX), a                ; Clear continuous SFX ID
        ld    (zContinuousSFXFlag), a            ; Clear continuous SFX flag
        ld    (zContSFXLoopCnt), a                ; Clear continuous SFX counter
        ld    a, (zFadeOutTimeout)                ; Get fade timeout
        ...