Tidied Capcom drivers and normalised the sound in some CPS-2 games
This commit is contained in:
parent
0b99bab0c8
commit
eda80b3025
|
@ -61,16 +61,13 @@ static INT32 LoadUp(UINT8** pRom, INT32* pnRomLen, INT32 nNum)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the rom
|
// Load the rom
|
||||||
Rom = (UINT8*)malloc(ri.nLen);
|
Rom = (UINT8*)BurnMalloc(ri.nLen);
|
||||||
if (Rom == NULL) {
|
if (Rom == NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BurnLoadRom(Rom,nNum,1)) {
|
if (BurnLoadRom(Rom,nNum,1)) {
|
||||||
if (Rom) {
|
BurnFree(Rom);
|
||||||
free(Rom);
|
|
||||||
Rom = NULL;
|
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,17 +92,14 @@ static INT32 LoadUpSplit(UINT8** pRom, INT32* pnRomLen, INT32 nNum)
|
||||||
nTotalRomSize = nRomSize[0] + nRomSize[1] + nRomSize[2] + nRomSize[3];
|
nTotalRomSize = nRomSize[0] + nRomSize[1] + nRomSize[2] + nRomSize[3];
|
||||||
if (!nTotalRomSize) return 1;
|
if (!nTotalRomSize) return 1;
|
||||||
|
|
||||||
Rom = (UINT8*)malloc(nTotalRomSize);
|
Rom = (UINT8*)BurnMalloc(nTotalRomSize);
|
||||||
if (Rom == NULL) return 1;
|
if (Rom == NULL) return 1;
|
||||||
|
|
||||||
INT32 Offset = 0;
|
INT32 Offset = 0;
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
if (i > 0) Offset += nRomSize[i - 1];
|
if (i > 0) Offset += nRomSize[i - 1];
|
||||||
if (BurnLoadRom(Rom + Offset, nNum + i, 1)) {
|
if (BurnLoadRom(Rom + Offset, nNum + i, 1)) {
|
||||||
if (Rom) {
|
BurnFree(Rom);
|
||||||
free(Rom);
|
|
||||||
Rom = NULL;
|
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,10 +141,7 @@ static INT32 CpsLoadOne(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift)
|
||||||
*((UINT32 *)pt) |= Pix;
|
*((UINT32 *)pt) |= Pix;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Rom) {
|
BurnFree(Rom);
|
||||||
free(Rom);
|
|
||||||
Rom = NULL;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,10 +170,7 @@ static INT32 CpsLoadOnePang(UINT8 *Tile,INT32 nNum,INT32 nWord,INT32 nShift)
|
||||||
*((UINT32 *)pt) |= Pix;
|
*((UINT32 *)pt) |= Pix;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Rom) {
|
BurnFree(Rom);
|
||||||
free(Rom);
|
|
||||||
Rom = NULL;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,14 +214,8 @@ static INT32 CpsLoadOneHack160(UINT8 *Tile, INT32 nNum, INT32 nWord, INT32 nOffs
|
||||||
*((UINT32 *)pt) |= Pix;
|
*((UINT32 *)pt) |= Pix;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Rom2) {
|
BurnFree(Rom2);
|
||||||
free(Rom2);
|
BurnFree(Rom1);
|
||||||
Rom2 = NULL;
|
|
||||||
}
|
|
||||||
if (Rom1) {
|
|
||||||
free(Rom1);
|
|
||||||
Rom1 = NULL;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,10 +255,7 @@ static INT32 CpsLoadOneBootleg(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShif
|
||||||
*((UINT32 *)pt) |= Pix;
|
*((UINT32 *)pt) |= Pix;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Rom) {
|
BurnFree(Rom);
|
||||||
free(Rom);
|
|
||||||
Rom = NULL;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,10 +319,7 @@ static INT32 CpsLoadOneBootlegType2(UINT8* Tile, INT32 nNum, INT32 nWord, INT32
|
||||||
*((UINT32 *)pt) |= Pix;
|
*((UINT32 *)pt) |= Pix;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Rom) {
|
BurnFree(Rom);
|
||||||
free(Rom);
|
|
||||||
Rom = NULL;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,10 +359,7 @@ static INT32 CpsLoadOneSf2ebbl(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShif
|
||||||
*((UINT32 *)pt) |= Pix;
|
*((UINT32 *)pt) |= Pix;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Rom) {
|
BurnFree(Rom);
|
||||||
free(Rom);
|
|
||||||
Rom = NULL;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,14 +503,8 @@ INT32 CpsLoadStars(UINT8* pStar, INT32 nStart)
|
||||||
|
|
||||||
for (INT32 i = 0; i < 2; i++) {
|
for (INT32 i = 0; i < 2; i++) {
|
||||||
if (LoadUp(&pTemp[i], &nLen, nStart + (i << 1))) {
|
if (LoadUp(&pTemp[i], &nLen, nStart + (i << 1))) {
|
||||||
if (pTemp[0]) {
|
BurnFree(pTemp[0]);
|
||||||
free(pTemp[0]);
|
BurnFree(pTemp[1]);
|
||||||
pTemp[0] = NULL;
|
|
||||||
}
|
|
||||||
if (pTemp[1]) {
|
|
||||||
free(pTemp[1]);
|
|
||||||
pTemp[1] = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -546,14 +513,8 @@ INT32 CpsLoadStars(UINT8* pStar, INT32 nStart)
|
||||||
pStar[0x01000 + i] = pTemp[1][i << 1];
|
pStar[0x01000 + i] = pTemp[1][i << 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pTemp[0]) {
|
BurnFree(pTemp[0]);
|
||||||
free(pTemp[0]);
|
BurnFree(pTemp[1]);
|
||||||
pTemp[0] = NULL;
|
|
||||||
}
|
|
||||||
if (pTemp[1]) {
|
|
||||||
free(pTemp[1]);
|
|
||||||
pTemp[1] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -565,14 +526,8 @@ INT32 CpsLoadStarsByte(UINT8* pStar, INT32 nStart)
|
||||||
|
|
||||||
for (INT32 i = 0; i < 2; i++) {
|
for (INT32 i = 0; i < 2; i++) {
|
||||||
if (LoadUp(&pTemp[i], &nLen, nStart + (i * 4))) {
|
if (LoadUp(&pTemp[i], &nLen, nStart + (i * 4))) {
|
||||||
if (pTemp[0]) {
|
BurnFree(pTemp[0]);
|
||||||
free(pTemp[0]);
|
BurnFree(pTemp[1]);
|
||||||
pTemp[0] = NULL;
|
|
||||||
}
|
|
||||||
if (pTemp[1]) {
|
|
||||||
free(pTemp[1]);
|
|
||||||
pTemp[1] = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -581,14 +536,8 @@ INT32 CpsLoadStarsByte(UINT8* pStar, INT32 nStart)
|
||||||
pStar[0x01000 + i] = pTemp[1][i];
|
pStar[0x01000 + i] = pTemp[1][i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pTemp[0]) {
|
BurnFree(pTemp[0]);
|
||||||
free(pTemp[0]);
|
BurnFree(pTemp[1]);
|
||||||
pTemp[0] = NULL;
|
|
||||||
}
|
|
||||||
if (pTemp[1]) {
|
|
||||||
free(pTemp[1]);
|
|
||||||
pTemp[1] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -600,14 +549,8 @@ INT32 CpsLoadStarsForgottnAlt(UINT8* pStar, INT32 nStart)
|
||||||
|
|
||||||
for (INT32 i = 0; i < 2; i++) {
|
for (INT32 i = 0; i < 2; i++) {
|
||||||
if (LoadUp(&pTemp[i], &nLen, nStart + (i * 3))) {
|
if (LoadUp(&pTemp[i], &nLen, nStart + (i * 3))) {
|
||||||
if (pTemp[0]) {
|
BurnFree(pTemp[0]);
|
||||||
free(pTemp[0]);
|
BurnFree(pTemp[1]);
|
||||||
pTemp[0] = NULL;
|
|
||||||
}
|
|
||||||
if (pTemp[1]) {
|
|
||||||
free(pTemp[1]);
|
|
||||||
pTemp[1] = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -616,14 +559,8 @@ INT32 CpsLoadStarsForgottnAlt(UINT8* pStar, INT32 nStart)
|
||||||
pStar[0x01000 + i] = pTemp[1][i << 1];
|
pStar[0x01000 + i] = pTemp[1][i << 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pTemp[0]) {
|
BurnFree(pTemp[0]);
|
||||||
free(pTemp[0]);
|
BurnFree(pTemp[1]);
|
||||||
pTemp[0] = NULL;
|
|
||||||
}
|
|
||||||
if (pTemp[1]) {
|
|
||||||
free(pTemp[1]);
|
|
||||||
pTemp[1] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -676,16 +613,10 @@ static INT32 Cps2LoadOne(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift)
|
||||||
}
|
}
|
||||||
|
|
||||||
nRomLen <<= 1;
|
nRomLen <<= 1;
|
||||||
Rom = (UINT8*)malloc(nRomLen);
|
Rom = (UINT8*)BurnMalloc(nRomLen);
|
||||||
if (Rom == NULL) {
|
if (Rom == NULL) {
|
||||||
if (Rom2) {
|
BurnFree(Rom2);
|
||||||
free(Rom2);
|
BurnFree(Rom3);
|
||||||
Rom2 = NULL;
|
|
||||||
}
|
|
||||||
if (Rom3) {
|
|
||||||
free(Rom3);
|
|
||||||
Rom3 = NULL;
|
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -694,14 +625,8 @@ static INT32 Cps2LoadOne(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift)
|
||||||
Rom[(i << 1) + 1] = Rom2[i];
|
Rom[(i << 1) + 1] = Rom2[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Rom2) {
|
BurnFree(Rom2);
|
||||||
free(Rom2);
|
BurnFree(Rom3);
|
||||||
Rom2 = NULL;
|
|
||||||
}
|
|
||||||
if (Rom3) {
|
|
||||||
free(Rom3);
|
|
||||||
Rom3 = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Go through each section
|
// Go through each section
|
||||||
|
@ -712,10 +637,7 @@ static INT32 Cps2LoadOne(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift)
|
||||||
pr += 0x80000;
|
pr += 0x80000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Rom) {
|
BurnFree(Rom);
|
||||||
free(Rom);
|
|
||||||
Rom = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -738,10 +660,7 @@ static INT32 Cps2LoadSplit(UINT8* Tile, INT32 nNum, INT32 nShift)
|
||||||
pr += 0x80000;
|
pr += 0x80000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Rom) {
|
BurnFree(Rom);
|
||||||
free(Rom);
|
|
||||||
Rom = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -994,7 +913,7 @@ INT32 CpsInit()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocate Gfx, Rom and Z80 Roms
|
// Allocate Gfx, Rom and Z80 Roms
|
||||||
CpsGfx = (UINT8*)malloc(nMemLen);
|
CpsGfx = (UINT8*)BurnMalloc(nMemLen);
|
||||||
if (CpsGfx == NULL) {
|
if (CpsGfx == NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -1078,14 +997,13 @@ INT32 CpsExit()
|
||||||
Scroll3TileMask = 0;
|
Scroll3TileMask = 0;
|
||||||
|
|
||||||
nCpsCodeLen = nCpsRomLen = nCpsGfxLen = nCpsZRomLen = nCpsQSamLen = nCpsAdLen = 0;
|
nCpsCodeLen = nCpsRomLen = nCpsGfxLen = nCpsZRomLen = nCpsQSamLen = nCpsAdLen = 0;
|
||||||
CpsCode = CpsRom = CpsZRom = CpsAd = CpsStar = NULL;
|
CpsRom = CpsZRom = CpsAd = CpsStar = NULL;
|
||||||
CpsQSam = NULL;
|
CpsQSam = NULL;
|
||||||
|
|
||||||
// All Memory is allocated to this (this is the only one we can free)
|
// All Memory is allocated to this (this is the only one we can free)
|
||||||
if (CpsGfx) {
|
BurnFree(CpsGfx);
|
||||||
free(CpsGfx);
|
|
||||||
CpsGfx = NULL;
|
BurnFree(CpsCode);
|
||||||
}
|
|
||||||
|
|
||||||
nCPS68KClockspeed = 0;
|
nCPS68KClockspeed = 0;
|
||||||
Cps = 0;
|
Cps = 0;
|
||||||
|
|
|
@ -650,7 +650,7 @@ static void cps2_decrypt(const UINT32 *master_key, UINT32 upper_limit)
|
||||||
#if 1
|
#if 1
|
||||||
UINT16 *rom = (UINT16 *)CpsRom;
|
UINT16 *rom = (UINT16 *)CpsRom;
|
||||||
UINT32 length = upper_limit;
|
UINT32 length = upper_limit;
|
||||||
CpsCode = (UINT8*)malloc(length);
|
CpsCode = (UINT8*)BurnMalloc(length);
|
||||||
UINT16 *dec = (UINT16*)CpsCode;
|
UINT16 *dec = (UINT16*)CpsCode;
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -68,7 +68,7 @@ static INT32 AllocateMemory()
|
||||||
CpsMemIndex();
|
CpsMemIndex();
|
||||||
nLen = CpsMemEnd - (UINT8*)0;
|
nLen = CpsMemEnd - (UINT8*)0;
|
||||||
|
|
||||||
if ((CpsMem = (UINT8*)malloc(nLen)) == NULL) {
|
if ((CpsMem = (UINT8*)BurnMalloc(nLen)) == NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,10 +333,7 @@ INT32 CpsMemExit()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Deallocate all used memory
|
// Deallocate all used memory
|
||||||
if (CpsMem) {
|
BurnFree(CpsMem);
|
||||||
free(CpsMem);
|
|
||||||
CpsMem = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ INT32 CpsObjInit()
|
||||||
nFrameCount = 2; // CPS2 sprites lagged by 1 frame and double buffered
|
nFrameCount = 2; // CPS2 sprites lagged by 1 frame and double buffered
|
||||||
// CPS1 sprites lagged by 1 frame
|
// CPS1 sprites lagged by 1 frame
|
||||||
|
|
||||||
ObjMem = (UINT8*)malloc((nMax << 3) * nFrameCount);
|
ObjMem = (UINT8*)BurnMalloc((nMax << 3) * nFrameCount);
|
||||||
if (ObjMem == NULL) {
|
if (ObjMem == NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -68,10 +68,7 @@ INT32 CpsObjExit()
|
||||||
of[i].nCount = 0;
|
of[i].nCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ObjMem) {
|
BurnFree(ObjMem);
|
||||||
free(ObjMem);
|
|
||||||
ObjMem = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
nFrameCount = 0;
|
nFrameCount = 0;
|
||||||
nMax = 0;
|
nMax = 0;
|
||||||
|
|
|
@ -102,7 +102,7 @@ INT32 CpsPalInit()
|
||||||
INT32 nLen = 0;
|
INT32 nLen = 0;
|
||||||
|
|
||||||
nLen = 0x1000 * sizeof(UINT16);
|
nLen = 0x1000 * sizeof(UINT16);
|
||||||
CpsPalSrc = (UINT8*)malloc(nLen);
|
CpsPalSrc = (UINT8*)BurnMalloc(nLen);
|
||||||
if (CpsPalSrc == NULL) {
|
if (CpsPalSrc == NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ INT32 CpsPalInit()
|
||||||
|
|
||||||
// The star layer palettes are at the end of the normal palette, so double the size
|
// The star layer palettes are at the end of the normal palette, so double the size
|
||||||
nLen = 0x1000 * sizeof(UINT32);
|
nLen = 0x1000 * sizeof(UINT32);
|
||||||
CpsPal = (UINT32*)malloc(nLen);
|
CpsPal = (UINT32*)BurnMalloc(nLen);
|
||||||
if (CpsPal == NULL) {
|
if (CpsPal == NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -133,14 +133,8 @@ INT32 CpsPalInit()
|
||||||
|
|
||||||
INT32 CpsPalExit()
|
INT32 CpsPalExit()
|
||||||
{
|
{
|
||||||
if (CpsPal) {
|
BurnFree(CpsPal);
|
||||||
free(CpsPal);
|
BurnFree(CpsPalSrc);
|
||||||
CpsPal = NULL;
|
|
||||||
}
|
|
||||||
if (CpsPalSrc) {
|
|
||||||
free(CpsPalSrc);
|
|
||||||
CpsPalSrc = NULL;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,9 @@ static INT32 DrvReset()
|
||||||
*((UINT16*)(CpsReg + 0x52)) = 0x0106;
|
*((UINT16*)(CpsReg + 0x52)) = 0x0106;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SekOpen(0);
|
||||||
CpsMapObjectBanks(0);
|
CpsMapObjectBanks(0);
|
||||||
|
SekClose();
|
||||||
|
|
||||||
nCpsCyclesExtra = 0;
|
nCpsCyclesExtra = 0;
|
||||||
|
|
||||||
|
@ -137,7 +139,7 @@ INT32 CpsRunExit()
|
||||||
|
|
||||||
// Sound exit
|
// Sound exit
|
||||||
if (Cps == 2 || Cps1Qs == 1) QsndExit();
|
if (Cps == 2 || Cps1Qs == 1) QsndExit();
|
||||||
if (Cps != 2 && Cps1Qs == 0) PsndExit();
|
if (Cps != 2 && Cps1Qs == 0 && !Cps1Pic) PsndExit();
|
||||||
|
|
||||||
// Graphics exit
|
// Graphics exit
|
||||||
CpsObjExit();
|
CpsObjExit();
|
||||||
|
@ -356,6 +358,7 @@ INT32 Cps2Frame()
|
||||||
QsndNewFrame();
|
QsndNewFrame();
|
||||||
|
|
||||||
nCpsCycles = (INT32)(((INT64)nCPS68KClockspeed * nBurnCPUSpeedAdjust) / 0x0100);
|
nCpsCycles = (INT32)(((INT64)nCPS68KClockspeed * nBurnCPUSpeedAdjust) / 0x0100);
|
||||||
|
SekOpen(0);
|
||||||
SekSetCyclesScanline(nCpsCycles / 262);
|
SekSetCyclesScanline(nCpsCycles / 262);
|
||||||
|
|
||||||
CpsRwGetInp(); // Update the input port values
|
CpsRwGetInp(); // Update the input port values
|
||||||
|
@ -384,7 +387,6 @@ INT32 Cps2Frame()
|
||||||
}
|
}
|
||||||
ScheduleIRQ();
|
ScheduleIRQ();
|
||||||
|
|
||||||
SekOpen(0);
|
|
||||||
SekIdle(nCpsCyclesExtra);
|
SekIdle(nCpsCyclesExtra);
|
||||||
|
|
||||||
if (nIrqCycles < nCpsCycles * nFirstLine / 0x0106) {
|
if (nIrqCycles < nCpsCycles * nFirstLine / 0x0106) {
|
||||||
|
|
|
@ -188,7 +188,11 @@ static UINT8 CpsReadPort(const UINT32 ia)
|
||||||
|
|
||||||
// CPS1 EEPROM read
|
// CPS1 EEPROM read
|
||||||
if (ia == 0xC007) {
|
if (ia == 0xC007) {
|
||||||
return EEPROMRead();
|
if (Cps1Qs) {
|
||||||
|
return EEPROMRead();
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pang3 EEPROM
|
// Pang3 EEPROM
|
||||||
|
|
|
@ -1450,7 +1450,7 @@ static struct BurnDIPInfo NTFODIPList[]=
|
||||||
{
|
{
|
||||||
// Defaults
|
// Defaults
|
||||||
{0x12, 0xff, 0xff, 0x00, NULL },
|
{0x12, 0xff, 0xff, 0x00, NULL },
|
||||||
{0x13, 0xff, 0xff, 0x03, NULL },
|
{0x13, 0xff, 0xff, 0x00, NULL },
|
||||||
{0x14, 0xff, 0xff, 0x60, NULL },
|
{0x14, 0xff, 0xff, 0x60, NULL },
|
||||||
|
|
||||||
// Dip A
|
// Dip A
|
||||||
|
@ -10285,6 +10285,7 @@ static INT32 CaptcommbInit()
|
||||||
CpsLayer1XOffs = -8;
|
CpsLayer1XOffs = -8;
|
||||||
CpsLayer2XOffs = -11;
|
CpsLayer2XOffs = -11;
|
||||||
CpsLayer3XOffs = -12;
|
CpsLayer3XOffs = -12;
|
||||||
|
CpsDrawSpritesInReverse = 1;
|
||||||
|
|
||||||
nRet = DrvInit();
|
nRet = DrvInit();
|
||||||
|
|
||||||
|
@ -10411,7 +10412,7 @@ static INT32 DinopicInit()
|
||||||
CpsLoadTilesBootleg(CpsGfx + 0x000000, 4);
|
CpsLoadTilesBootleg(CpsGfx + 0x000000, 4);
|
||||||
CpsLoadTilesBootleg(CpsGfx + 0x200000, 8);
|
CpsLoadTilesBootleg(CpsGfx + 0x200000, 8);
|
||||||
|
|
||||||
BootlegSpriteRam = (UINT8*)malloc(0x2000);
|
BootlegSpriteRam = (UINT8*)BurnMalloc(0x2000);
|
||||||
|
|
||||||
SekOpen(0);
|
SekOpen(0);
|
||||||
SekMapMemory(BootlegSpriteRam, 0x990000, 0x991FFF, SM_RAM);
|
SekMapMemory(BootlegSpriteRam, 0x990000, 0x991FFF, SM_RAM);
|
||||||
|
@ -10438,7 +10439,7 @@ static INT32 DinohInit()
|
||||||
|
|
||||||
static void DinohaCallback()
|
static void DinohaCallback()
|
||||||
{
|
{
|
||||||
UINT8 *TempRom = (UINT8*)malloc(0x200000);
|
UINT8 *TempRom = (UINT8*)BurnMalloc(0x200000);
|
||||||
if (TempRom) {
|
if (TempRom) {
|
||||||
memcpy(TempRom, CpsRom, 0x200000);
|
memcpy(TempRom, CpsRom, 0x200000);
|
||||||
memset(CpsRom, 0, 0x200000);
|
memset(CpsRom, 0, 0x200000);
|
||||||
|
@ -10446,8 +10447,7 @@ static void DinohaCallback()
|
||||||
memcpy(CpsRom + 0x000000, TempRom + 0x080000, 0x80000);
|
memcpy(CpsRom + 0x000000, TempRom + 0x080000, 0x80000);
|
||||||
memcpy(CpsRom + 0x180000, TempRom + 0x100000, 0x80000);
|
memcpy(CpsRom + 0x180000, TempRom + 0x100000, 0x80000);
|
||||||
memcpy(CpsRom + 0x100000, TempRom + 0x180000, 0x80000);
|
memcpy(CpsRom + 0x100000, TempRom + 0x180000, 0x80000);
|
||||||
free(TempRom);
|
BurnFree(TempRom);
|
||||||
TempRom = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Patch Q-Sound Test ???
|
// Patch Q-Sound Test ???
|
||||||
|
@ -10482,7 +10482,7 @@ static INT32 DinohbInit()
|
||||||
memset(CpsGfx, 0, nCpsGfxLen);
|
memset(CpsGfx, 0, nCpsGfxLen);
|
||||||
CpsLoadTilesHack160(CpsGfx, 2);
|
CpsLoadTilesHack160(CpsGfx, 2);
|
||||||
|
|
||||||
BootlegSpriteRam = (UINT8*)malloc(0x2000);
|
BootlegSpriteRam = (UINT8*)BurnMalloc(0x2000);
|
||||||
|
|
||||||
SekOpen(0);
|
SekOpen(0);
|
||||||
SekMapMemory(BootlegSpriteRam, 0x990000, 0x991FFF, SM_RAM);
|
SekMapMemory(BootlegSpriteRam, 0x990000, 0x991FFF, SM_RAM);
|
||||||
|
@ -10720,7 +10720,7 @@ static INT32 Sf2jcInit()
|
||||||
|
|
||||||
static void Sf2qp1Callback()
|
static void Sf2qp1Callback()
|
||||||
{
|
{
|
||||||
UINT8 *TempRom = (UINT8*)malloc(0x100000);
|
UINT8 *TempRom = (UINT8*)BurnMalloc(0x100000);
|
||||||
if (TempRom) {
|
if (TempRom) {
|
||||||
memcpy(TempRom, CpsRom, 0x100000);
|
memcpy(TempRom, CpsRom, 0x100000);
|
||||||
memset(CpsRom, 0, 0x100000);
|
memset(CpsRom, 0, 0x100000);
|
||||||
|
@ -10728,8 +10728,7 @@ static void Sf2qp1Callback()
|
||||||
memcpy(CpsRom + 0x0c0000, TempRom + 0x040000, 0x40000);
|
memcpy(CpsRom + 0x0c0000, TempRom + 0x040000, 0x40000);
|
||||||
memcpy(CpsRom + 0x080000, TempRom + 0x080000, 0x40000);
|
memcpy(CpsRom + 0x080000, TempRom + 0x080000, 0x40000);
|
||||||
memcpy(CpsRom + 0x040000, TempRom + 0x0c0000, 0x40000);
|
memcpy(CpsRom + 0x040000, TempRom + 0x0c0000, 0x40000);
|
||||||
free(TempRom);
|
BurnFree(TempRom);
|
||||||
TempRom = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11425,10 +11424,7 @@ static INT32 DrvExit()
|
||||||
|
|
||||||
Cps1CallbackFunction = NULL;
|
Cps1CallbackFunction = NULL;
|
||||||
|
|
||||||
if (BootlegSpriteRam) {
|
BurnFree(BootlegSpriteRam);
|
||||||
free(BootlegSpriteRam);
|
|
||||||
BootlegSpriteRam = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ INT32 PsmInit()
|
||||||
|
|
||||||
// Allocate a buffer for the intermediate sound (between YM2151 and pBurnSoundOut)
|
// Allocate a buffer for the intermediate sound (between YM2151 and pBurnSoundOut)
|
||||||
nMemLen = nBurnSoundLen * 2 * sizeof(INT16);
|
nMemLen = nBurnSoundLen * 2 * sizeof(INT16);
|
||||||
WaveBuf = (INT16*)malloc(nMemLen);
|
WaveBuf = (INT16*)BurnMalloc(nMemLen);
|
||||||
if (WaveBuf == NULL) {
|
if (WaveBuf == NULL) {
|
||||||
PsmExit();
|
PsmExit();
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -55,10 +55,7 @@ INT32 PsmExit()
|
||||||
|
|
||||||
MSM6295Exit(0);
|
MSM6295Exit(0);
|
||||||
|
|
||||||
if (WaveBuf) {
|
BurnFree(WaveBuf);
|
||||||
free(WaveBuf);
|
|
||||||
WaveBuf = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
BurnYM2151Exit(); // Exit FM sound chip
|
BurnYM2151Exit(); // Exit FM sound chip
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -134,7 +134,7 @@ INT32 PsndZInit()
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
PsndZRam = (UINT8 *)malloc(0x800);
|
PsndZRam = (UINT8 *)BurnMalloc(0x800);
|
||||||
if (PsndZRam == NULL) {
|
if (PsndZRam == NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -178,10 +178,7 @@ INT32 PsndZInit()
|
||||||
|
|
||||||
INT32 PsndZExit()
|
INT32 PsndZExit()
|
||||||
{
|
{
|
||||||
if (PsndZRam) {
|
BurnFree(PsndZRam);
|
||||||
free(PsndZRam);
|
|
||||||
PsndZRam = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZetExit();
|
ZetExit();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -39,28 +39,40 @@ INT32 QsndInit()
|
||||||
nVolumeShift = 0;
|
nVolumeShift = 0;
|
||||||
|
|
||||||
// These games are too soft at normal volumes
|
// These games are too soft at normal volumes
|
||||||
if (strncmp(BurnDrvGetTextA(DRV_NAME), "csclub", 6) == 0) {
|
if (strncmp(BurnDrvGetTextA(DRV_NAME), "csclub", 6) == 0) {
|
||||||
nVolumeShift = -1;
|
nVolumeShift = -1;
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
// These games are loud at normal volumes (no clipping)
|
// These games are loud at normal volumes (no clipping)
|
||||||
if (strncmp(BurnDrvGetTextA(DRV_NAME), "1944", 4) == 0 ||
|
if (strncmp(BurnDrvGetTextA(DRV_NAME), "1944", 4) == 0 ||
|
||||||
strcmp( BurnDrvGetTextA(DRV_NAME), "dimahoo" ) == 0 ||
|
strncmp(BurnDrvGetTextA(DRV_NAME), "dimaho", 6) == 0 ||
|
||||||
strcmp( BurnDrvGetTextA(DRV_NAME), "gmahoo" ) == 0)
|
strcmp( BurnDrvGetTextA(DRV_NAME), "gmahou" ) == 0)
|
||||||
{
|
{
|
||||||
nVolumeShift = 1;
|
nVolumeShift = 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
// These games are too loud at normal volumes (no clipping)
|
// These games are too loud at normal volumes (no clipping)
|
||||||
if (strncmp(BurnDrvGetTextA(DRV_NAME), "sgemf", 5) == 0 ||
|
if (strncmp(BurnDrvGetTextA(DRV_NAME), "sgemf", 5) == 0 ||
|
||||||
strncmp(BurnDrvGetTextA(DRV_NAME), "pfght", 5) == 0 ||
|
strncmp(BurnDrvGetTextA(DRV_NAME), "progear", 7) == 0 ||
|
||||||
strncmp(BurnDrvGetTextA(DRV_NAME), "mpang", 5) == 0 ||
|
strncmp(BurnDrvGetTextA(DRV_NAME), "pzloop2", 7) == 0 ||
|
||||||
strncmp(BurnDrvGetTextA(DRV_NAME), "spf2", 4) == 0 ||
|
strncmp(BurnDrvGetTextA(DRV_NAME), "ringdest", 8) == 0 ||
|
||||||
strncmp(BurnDrvGetTextA(DRV_NAME), "sfa2", 4) == 0 ||
|
strcmp( BurnDrvGetTextA(DRV_NAME), "ringdstd" ) == 0 ||
|
||||||
strncmp(BurnDrvGetTextA(DRV_NAME), "sfa2", 4) == 0)
|
strncmp(BurnDrvGetTextA(DRV_NAME), "smbomb", 6) == 0 ||
|
||||||
|
strncmp(BurnDrvGetTextA(DRV_NAME), "pfght", 5) == 0 ||
|
||||||
|
strncmp(BurnDrvGetTextA(DRV_NAME), "mpang", 5) == 0 ||
|
||||||
|
strncmp(BurnDrvGetTextA(DRV_NAME), "sfa2", 4) == 0 ||
|
||||||
|
strncmp(BurnDrvGetTextA(DRV_NAME), "sfz2", 4) == 0)
|
||||||
{
|
{
|
||||||
nVolumeShift = 1;
|
nVolumeShift = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// These games are too loud at normal volumes (no clipping)
|
||||||
|
if (strncmp(BurnDrvGetTextA(DRV_NAME), "gigawing", 8) == 0 ||
|
||||||
|
strncmp(BurnDrvGetTextA(DRV_NAME), "spf2", 4) == 0)
|
||||||
|
{
|
||||||
|
nVolumeShift = 2;
|
||||||
|
}
|
||||||
|
|
||||||
// These games are too loud at normal volumes (clipping)
|
// These games are too loud at normal volumes (clipping)
|
||||||
if (strncmp(BurnDrvGetTextA(DRV_NAME), "19xx", 4) == 0 ||
|
if (strncmp(BurnDrvGetTextA(DRV_NAME), "19xx", 4) == 0 ||
|
||||||
strncmp(BurnDrvGetTextA(DRV_NAME), "ddtod", 5) == 0)
|
strncmp(BurnDrvGetTextA(DRV_NAME), "ddtod", 5) == 0)
|
||||||
|
@ -75,8 +87,10 @@ INT32 QsndInit()
|
||||||
|
|
||||||
void QsndReset()
|
void QsndReset()
|
||||||
{
|
{
|
||||||
|
ZetOpen(0);
|
||||||
BurnTimerReset();
|
BurnTimerReset();
|
||||||
BurnTimerSetRetrig(0, 1.0 / 252.0);
|
BurnTimerSetRetrig(0, 1.0 / 252.0);
|
||||||
|
ZetClose();
|
||||||
|
|
||||||
nQsndCyclesExtra = 0;
|
nQsndCyclesExtra = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,10 +100,7 @@ void QscExit()
|
||||||
{
|
{
|
||||||
nQscRate = 0;
|
nQscRate = 0;
|
||||||
|
|
||||||
if (Qs_s) {
|
BurnFree(Qs_s);
|
||||||
free(Qs_s);
|
|
||||||
Qs_s = NULL;
|
|
||||||
}
|
|
||||||
Tams = -1;
|
Tams = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,12 +261,9 @@ INT32 QscUpdate(INT32 nEnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Tams < nLen) {
|
if (Tams < nLen) {
|
||||||
if (Qs_s) {
|
BurnFree(Qs_s);
|
||||||
free(Qs_s);
|
|
||||||
Qs_s = NULL;
|
|
||||||
}
|
|
||||||
Tams = nLen;
|
Tams = nLen;
|
||||||
Qs_s = (INT32*)malloc(sizeof(INT32) * 2 * Tams);
|
Qs_s = (INT32*)BurnMalloc(sizeof(INT32) * 2 * Tams);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(Qs_s, 0, nLen * 2 * sizeof(INT32));
|
memset(Qs_s, 0, nLen * 2 * sizeof(INT32));
|
||||||
|
|
Loading…
Reference in New Issue