Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tempo and Continuous SFX bug #25

Open
TheBlad768 opened this issue Jun 18, 2024 · 0 comments
Open

Tempo and Continuous SFX bug #25

TheBlad768 opened this issue Jun 18, 2024 · 0 comments

Comments

@TheBlad768
Copy link

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
        ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant