Skip to content

Add music data variable to fix sound queue glitches - #298

Merged
idlechild merged 1 commit into
tewtal:masterfrom
idlechild:master
Oct 17, 2026
Merged

idlechild merged 1 commit into
tewtal:masterfrom
idlechild:master

Conversation

@idlechild

Copy link
Copy Markdown
Collaborator

Recently I fixed a sound glitch/crash, but I traded it for a worse issue. The worse issue is, during door transition when game checks if we need a music change, it trusts 07F3 and assumes there will not be another music change in the queue. This is a reasonable assumption by the vanilla game, but it breaks with savestates.

The way it worked before, 07F3 ended up the same as the queued music, so vanilla logic worked (vanilla believed it would need to change the music again) but loading state a second time could crash because load state would trust 07F3, even though in this corner case (back-to-back loads) 07F3 would be the same as the queued music instead of the real music data.

To fix both issues, we need a new value 07F1 which is always the actual music data. 07F3 can go back to working as it did before, and 07F1 is what we can use during loadstate so we always know what data the APU actually has loaded.

@idlechild
idlechild merged commit e67f52f into tewtal:master Oct 17, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant