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

sound: Add busy wait to write port status on DSP #88

Merged
merged 3 commits into from
Jan 24, 2022

Conversation

user7182
Copy link
Contributor

This change addresses some games that freeze because the DSP and game are deadlocked waiting on each other. The focus was to fix the freezing seen in The Secret of Monkey Island, but the change is not specific to it. It will probably improve other games as well.

…eiving DMA commands. Allowed new sounds to play immediately if DMA is paused.

Games, such as The Secret to Monkey Island, have a compiled in CT-VOICE driver
that communicates to the DSP. When the driver knows a sound is currently playing,
it adds an additional step before starting to play the new sound. The driver will poll
the write status port (2xCh) until it sees a busy flag, and if it sees it then it sends
the pause command first. If the driver never sees a busy status it will eventually
timeout polling and skip sending the pause command.

Without setting the busy flag a pause command is not sent, the game becomes out
of sync with the number of bytes it expects to transfer and locks up.

This change was confirmed to fix freezes during The Secret of Monkey Island,
Monkey Island 2, and Jill of the Jungle.
@sorgelig sorgelig merged commit edbab9d into MiSTer-devel:master Jan 24, 2022
theypsilon pushed a commit to MiSTer-unstable-nightlies/ao486_MiSTer that referenced this pull request Jan 24, 2022
* Updated project settings OPTIMIZATION_MODE and FITTER_AGGRESSIVE_ROUTABILITY_OPTIMIZATION so the design fits.

* Updated the Sound DSP module to look busy while playing sound and receiving DMA commands. Allowed new sounds to play immediately if DMA is paused.

Games, such as The Secret to Monkey Island, have a compiled in CT-VOICE driver
that communicates to the DSP. When the driver knows a sound is currently playing,
it adds an additional step before starting to play the new sound. The driver will poll
the write status port (2xCh) until it sees a busy flag, and if it sees it then it sends
the pause command first. If the driver never sees a busy status it will eventually
timeout polling and skip sending the pause command.

Without setting the busy flag a pause command is not sent, the game becomes out
of sync with the number of bytes it expects to transfer and locks up.

This change was confirmed to fix freezes during The Secret of Monkey Island,
Monkey Island 2, and Jill of the Jungle.

* Fixed spacing.

(cherry picked from commit edbab9d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants