Welcome!

Final Burn Neo => FBN Development => Topic started by: iq_132 on February 11, 2007, 02:02:46 PM

Title: Fix for a longstanding CPS-2 bug
Post by: iq_132 on February 11, 2007, 02:02:46 PM
Here's a bug that's been in FBA for quite some time now (since 0.2.95.21 IIRC).  Basically, if you run a game, click "Sound disabled", and then run a CPS game with Q-Sound (every cps2 game & some cps1), FBA crashes. ^^. I don't remember if anyone's come up with a fix for it, so here's mine.

src/burn/capcom/qs_c.cpp

After:

Code: [Select]
#include "burn_sound.h"

Add this:

Code: [Select]
extern int nAudSampleRate;

After:

Code: [Select]
int QscUpdate(int nEnd)
{
int nLen;

if (nEnd > nBurnSoundLen) {
nEnd = nBurnSoundLen;
}

nLen = nEnd - nPos;

if (nLen <= 0) {
return 0;
}

Add this:

Code: [Select]
if (nAudSampleRate <= 0) // Fix "Sound disabled" crash on CPS-2
return 0;

That's it. ^^
Title: Re: Fix for a longstanding CPS-2 bug
Post by: CaptainCPS on February 11, 2007, 02:59:48 PM
ThanX IQ!  :biggrin: I didnt notice that bug until now, I updated my personal build and its doing fine now ^^

Take Care! SeeYaa!!
 :biggrin:
Title: Re: Fix for a longstanding CPS-2 bug
Post by: iq_132 on February 13, 2007, 05:28:49 PM
Absolutely one of the things I love about open-source software -- I really enjoy seeing the different ways of going about doing the same thing people come up with.  :smilie:
Title: Re: Fix for a longstanding CPS-2 bug
Post by: Leaf on February 14, 2007, 07:13:47 AM
src/burn/capcom/qs.cpp
find:replace with:
src/burn/capcom/qs_c.cpp
find:replace with:
Yes, emufan has fixed this before . :>
Title: Re: Fix for a longstanding CPS-2 bug
Post by: Barry Harris on February 14, 2007, 03:16:39 PM
pBurnSoundOut is the preferred fix btw.