First post, by MrFlibble
- Rank
- Oldbie
@starlord succeeded in liberating the shareware shmup Baller! And Forget, but the game does not play sound effects properly in DOSBox even with the correct hard-coded IRQ:
starlord wrote on Yesterday, 15:41:```I found the cause. BALLER!S.EXE has a complete Sound Blaster engine: it mixes 16 channels into a 1 KB buffer and plays it by […]
```I found the cause. BALLER!S.EXE has a complete Sound Blaster engine: it mixes 16 channels into a 1 KB buffer and plays it by DMA, refilling the buffer from the card's interrupt (IRQ). The credits saying "Keiner" is just out of date. Two bugs in that engine explain why DOSBox stays silent.
1. IRQ 5 is hard-coded. The game reads the base, IRQ and DMA from the BLASTER variable and attaches its handler to that IRQ. But the code that switches the IRQ on at the interrupt controller always enables IRQ 5: it computes 1 shl 5 instead of using the IRQ it just read. eXoDOS/DOSBox defaults to IRQ 7, so the game listens on IRQ 7 while only IRQ 5 is switched on. Playback starts with a 1-byte transfer meant to trigger the first interrupt, and with IRQ 7 that interrupt never arrives. That gives exactly "no sound at all".
2. It never turns the speaker on. The game never sends the DSP command that enables output (D1). A real SB16 ignores that command and is always on, and so is DOSBox's SB16, but an SB 1.x/2.0/Pro stays muted. So it can only work as an SB16.```
```The first round showed I'd missed something: the IRQ and speaker bugs are real, but there's a third problem that silences the game in every setup.
What I missed: the game doesn't put its sound buffer in normal memory. It writes the sound into segment B000h, the old monochrome video memory, and points the Sound Blaster's DMA there. The code first allocates a proper buffer, then throws it away and uses B000h. The author probably did this because the proper buffer didn't work for him.
On a VGA card in the 320×200 256-colour mode (mode 13h) the game uses, that memory area doesn't exist. The game mixes the sound into nothing, and the card plays back an empty buffer, so you hear silence. That explains all five silent tests. It probably worked for the author because he played it in a Windows 95 DOS box (the PIF files point that way), which may well make that area behave like normal memory.```
Is there any way to circumvent this via a TSR or something? @ripsaw8080, any ideas?