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

SB: Fix Tyrian and Dig-It! by implementing DSP_DAC_PAUSE_DURATION #63

Merged
merged 2 commits into from
Nov 23, 2024

Conversation

ianhan
Copy link
Contributor

@ianhan ianhan commented Oct 26, 2024

This change fixes Sound Blaster mode support for Tyrian and "Dig-It!"

I disassembled Tyran's sound setup program - as part of autodetection for SB, after the DMA port is specified, they:

  1. Set up interrupt handlers for IRQs 2, 5, and 7.
  2. Start communicating with SB (initially on 210h)
  3. Send the DSP a DSP_DAC_PAUSE_DURATION (80h) command. It is expected that while this timeout is pending, no audio will be output by the DAC and once the timeout happens, the SB interrupt will be signaled. NB: It is not a DMA pause, but a DAC pause.
  4. Loop checking DSP_WRITE_STATUS to check that the DSP has executed the command.
  5. Check a global set by their interrupt handlers.
  6. If it's zero, increment SB port by 10h, goto 2 if < 280h and try again.

The interrupt signaling wasn't implemented, so it looped through this and failed to get the interrupt resulting in "error 253".

I was able to fix Tyrian/Tyrian2k by implementing this. I then tested Dig-It! - both FM and SB sound work with this change applied. I haven't disassembled Dig-It! but noticed it was also using this DSP command during early debugging.

@polpo polpo merged commit 0fa4d05 into polpo:main Nov 23, 2024
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.

2 participants