X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fdfsound%2Fspu.c;h=b087cdfd674dad32d151ebc8e791aa69cb62fe8a;hb=f8edb5bc279ba09aa7bc762da51236fd368827b0;hp=f5aab9f1f925bb6f6a8f45685d6f090a28003579;hpb=6d75977b13fede33db381324c610561c6e723a8b;p=pcsx_rearmed.git diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index f5aab9f1..b087cdfd 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -124,7 +124,6 @@ short * pS; int lastch=-1; // last channel processed on spu irq in timer mode static int lastns=0; // last ns pos -static int iSecureStart=0; // secure start counter #define CDDA_BUFFER_SIZE (16384 * sizeof(uint32_t)) // must be power of 2 @@ -682,15 +681,7 @@ static int do_samples(void) // until enuff free place is available/a new channel gets // started - if(dwNewChannel) // new channel should start immedately? - { // (at least one bit 0 ... MAXCHANNEL is set?) - iSecureStart++; // -> set iSecure - if(iSecureStart>5) iSecureStart=0; // (if it is set 5 times - that means on 5 tries a new samples has been started - in a row, we will reset it, to give the sound update a chance) - } - else iSecureStart=0; // 0: no new channel should start - - if(!iSecureStart && // no new start? - (SoundGetBytesBuffered()>TESTSIZE)) // and still enuff data in sound buffer? + if(!dwNewChannel && SoundGetBytesBuffered()) // still enuff data in sound buffer? { return 0; } @@ -872,6 +863,8 @@ static int do_samples(void) void CALLBACK SPUasync(unsigned long cycle) { + if(!bSpuInit) return; // -> no init, no call + if(iSpuAsyncWait) { iSpuAsyncWait++; @@ -879,14 +872,7 @@ void CALLBACK SPUasync(unsigned long cycle) iSpuAsyncWait=0; } - if(!bSpuInit) return; // -> no init, no call - do_samples(); - - // abuse iSpuAsyncWait mechanism to reduce calls to above function - // to make it do larger chunks - // note: doing it less often than once per frame causes skips - iSpuAsyncWait=1; } // SPU UPDATE... new epsxe func