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

Last OPL music note keeps playing forever on core reboot #174

Open
vanfanel opened this issue Dec 20, 2024 · 5 comments
Open

Last OPL music note keeps playing forever on core reboot #174

vanfanel opened this issue Dec 20, 2024 · 5 comments

Comments

@vanfanel
Copy link

Hello there,

I noticed that, as the tittle says, if a program is playing an OPL music note an the core is reboot, that last note keeps sounding forever, until a new program resets the OPL.

@humply Can you see this bug too?

@vanfanel vanfanel changed the title Last OPL music note remains static on core reboot Last OPL music note keeps playing forever on core reboot Dec 20, 2024
@humply
Copy link
Contributor

humply commented Dec 20, 2024

The OPL3 implementation improved a lot recently, but it's probably not perfect yet. I haven't looked into any OPL stuff, so I'm sorry to say that I don't think I can help with this currently. I mainly focused on fixing VGA and CPU bugs.

@vanfanel
Copy link
Author

@humply I see! What you are doing is awesome enough, the core has me totally hooked since I discovered your improvements yesterday.. I can't stop trying games and demos on it!

@gtaylormb Maybe you know what's going on with the hanging OPL note on reboot?

@humply
Copy link
Contributor

humply commented Dec 20, 2024

Yes, it's a great core, I know the feeling you're describing! I also noticed some music issues with Cute Demo, but I'm not sure if the issues are with the code or with the AO486 core. You might want to try it out (if you run it with an older version of the AO486 core you can see some of the VGA scrolling issues that should now be fixed).

@gtaylormb
Copy link
Contributor

gtaylormb commented Dec 22, 2024

What version of the core are you using? The stable build is older; you may want to try an unstable nightly build after July.

In reducing the core logic, all state is now stored in memory, which does not get reset like registers do. At one point I added a state machine around the envelope state memory that forces all envelopes into the RELEASE state, so any notes playing on reset normally gracefully decay at their programmed release rate RR. However, in rare cases, an operator may have been programmed with no RR. I'm slightly reluctant to fix this as it it adds an additional state machine and logic around the envelope value memory itself, and I've really tried to shrink the core down as much as possible. It's a pretty easy fix but pretty rare I believe. As soon as you enter the next game it would normally fix itself as most games will zero out the register map on startup and overwrite the values.

@vanfanel
Copy link
Author

vanfanel commented Dec 22, 2024

What version of the core are you using? The stable build is older; you may want to try an unstable nightly build after July.

In reducing the core logic, all state is now stored in memory, which does not get reset like registers do. At one point I added a state machine around the envelope state memory that forces all envelopes into the RELEASE state, so any notes playing on reset normally gracefully decay at their programmed release rate RR. However, in rare cases, an operator may have been programmed with no RR. I'm slightly reluctant to fix this as it it adds an additional state machine and logic around the envelope value memory itself, and I've really tried to shrink the core down as much as possible. It's a pretty easy fix but pretty rare I believe. As soon as you enter the next game it would normally fix itself as most games will zero out the register map on startup and overwrite the values.

Thanks for the detailed answer, it was very clear and has interesting information on the issue.

I am using this build, which I did from the latest sources on the repository, which were recently updated with many awesome fixes by @humply:
https://github.com/user-attachments/files/18210063/ao486.rbf.zip

I understand the OPL notes should "decay" on reset, and I would say it happened at some previous version of the core, but it doesn't seem to happen anymore. Maybe related to those recent changes?

All OPL-sounding games are affected, try Prince of Persia for example, but any game will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants