Author Topic: Fix for a longstanding CPS-2 bug  (Read 5542 times)

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Fix for a longstanding CPS-2 bug
« 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. ^^


Offline CaptainCPS

  • FBNeo Dev
  • ******
  • Posts: 1513
  • Karma: +127/-0
  • FB Alpha Team
    • CaptainCPS's Home
Re: Fix for a longstanding CPS-2 bug
« Reply #1 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:

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: Fix for a longstanding CPS-2 bug
« Reply #2 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:


Offline Leaf

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +9/-4
Re: Fix for a longstanding CPS-2 bug
« Reply #3 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 . :>

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: Fix for a longstanding CPS-2 bug
« Reply #4 on: February 14, 2007, 03:16:39 PM »
pBurnSoundOut is the preferred fix btw.
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.