X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fdfsound%2Fspu.c;h=fead03c0b3b7ee913762355fb58f14340d856b65;hb=3c7a8977ddbdbfb4a8840a487fadade29bd939d6;hp=f6730d64aa6a1c187b0e065568fe678c8dc30d4d;hpb=9165d434d935746da54484381ebbee754e899680;p=pcsx_rearmed.git diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index f6730d64..fead03c0 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -493,6 +493,8 @@ static void scan_for_irq(int ch, unsigned int *upd_samples) pos = s_chan->spos; sinc = s_chan->sinc; end = pos + *upd_samples * sinc; + if (s_chan->prevflags & 1) // 1: stop/loop + block = s_chan->pLoop; pos += (28 - s_chan->iSBPos) << 16; while (pos < end) @@ -814,6 +816,8 @@ static void do_channels(int ns_to) mix_chan(spu.SSumLR, ns_to, s_chan->iLeftVolume, s_chan->iRightVolume); } + MixXA(spu.SSumLR, RVB, ns_to, spu.decode_pos); + if (spu.rvb->StartAddr) { if (do_rvb) REVERBDo(spu.SSumLR, RVB, ns_to, spu.rvb->CurrAddr); @@ -1066,6 +1070,7 @@ static void sync_worker_thread(int force) work = &worker->i[worker->i_reaped & WORK_I_MASK]; thread_work_wait_sync(work, force); + MixXA(work->SSumLR, RVB, work->ns_to, work->decode_pos); do_samples_finish(work->SSumLR, work->ns_to, work->channels_silent, work->decode_pos); @@ -1149,7 +1154,10 @@ void do_samples(unsigned int cycles_to, int do_direct) do_irq(); } } - check_irq_io(spu.spuAddr); + if (!spu.cycles_dma_end || (int)(spu.cycles_dma_end - cycles_to) < 0) { + spu.cycles_dma_end = 0; + check_irq_io(spu.spuAddr); + } if (unlikely(spu.rvb->dirty)) REVERBPrep(); @@ -1192,12 +1200,10 @@ static void do_samples_finish(int *SSumLR, int ns_to, spu.decode_dirty_ch &= ~(1<<3); } - MixXA(SSumLR, ns_to, decode_pos); - vol_l = vol_l * spu_config.iVolume >> 10; vol_r = vol_r * spu_config.iVolume >> 10; - if (!(spu.spuCtrl & 0x4000) || !(vol_l | vol_r)) + if (!(spu.spuCtrl & CTRL_MUTE) || !(vol_l | vol_r)) { // muted? (rare) memset(spu.pS, 0, ns_to * 2 * sizeof(spu.pS[0])); @@ -1481,6 +1487,7 @@ long CALLBACK SPUinit(void) { int i; + memset(&spu, 0, sizeof(spu)); spu.spuMemC = calloc(1, 512 * 1024); InitADSR(); @@ -1559,33 +1566,6 @@ long CALLBACK SPUshutdown(void) return 0; } -// SPUTEST: we don't test, we are always fine ;) -long CALLBACK SPUtest(void) -{ - return 0; -} - -// SPUCONFIGURE: call config dialog -long CALLBACK SPUconfigure(void) -{ -#ifdef _MACOSX - DoConfiguration(); -#else -// StartCfgTool("CFG"); -#endif - return 0; -} - -// SPUABOUT: show about window -void CALLBACK SPUabout(void) -{ -#ifdef _MACOSX - DoAbout(); -#else -// StartCfgTool("ABOUT"); -#endif -} - // SETUP CALLBACKS // this functions will be called once, // passes a callback that should be called on SPU-IRQ/cdda volume change