Skip to content

Commit

Permalink
Sound Blaster: Fix force autoinit option bug that prevented audio pla…
Browse files Browse the repository at this point in the history
…yback from working at all
  • Loading branch information
joncampbell123 committed Apr 15, 2024
1 parent 32664f3 commit d5743d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Next:
- Sound Blaster: Fix bug where "force autoinit" prevented Sound Blaster
playback from working at all, fix for "Jump" by Public NMI (joncampbell123).
- Debugger UI now shows PIC_FullIndex() and whether or not the CPU is
in the HLT state. Single stepping does not do anything when the CPU is
in the HLT state, so at least let the user know (joncampbell123).
Expand Down
4 changes: 3 additions & 1 deletion src/hardware/sblaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1300,10 +1300,12 @@ static unsigned int DSP_RateLimitedFinalSB16Freq_New(unsigned int freq) {
}

static void DSP_PrepareDMA_Old(DMA_MODES mode,bool autoinit,bool sign,bool hispeed) {
/* this must be processed BEFORE forcing auto-init because the non-autoinit case provides the DSP transfer block size (fix for "Jump" by Public NMI) */
if (!autoinit) sb.dma.total=1u+(unsigned int)sb.dsp.in.data[0]+(unsigned int)(sb.dsp.in.data[1] << 8u);

if (sb.dma.force_autoinit)
autoinit = true;

if (!autoinit) sb.dma.total=1u+(unsigned int)sb.dsp.in.data[0]+(unsigned int)(sb.dsp.in.data[1] << 8u);
sb.dma.autoinit=autoinit;
sb.dsp.highspeed=hispeed;
sb.dma.sign=sign;
Expand Down

0 comments on commit d5743d4

Please sign in to comment.