Tidied Konami drivers, fixed sound in some where ym irqs weren't being triggered frequently enough

This commit is contained in:
Barry Harris 2011-12-22 13:10:31 +00:00
parent 896b4e1089
commit 0b99bab0c8
30 changed files with 208 additions and 272 deletions

View File

@ -402,7 +402,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -511,10 +511,7 @@ static INT32 DrvExit()
BurnYM2151Exit();
UPD7759Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -588,7 +585,7 @@ static INT32 DrvFrame()
nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]);
if (pBurnSoundOut) {
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
INT32 nSegmentLength = nBurnSoundLen / nInterleave;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
BurnYM2151Render(pSoundBuf, nSegmentLength);
UPD7759Update(0, pSoundBuf, nSegmentLength);

View File

@ -484,7 +484,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -630,10 +630,7 @@ static INT32 DrvExit()
K007232Exit();
BurnYM2151Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -715,7 +712,7 @@ static INT32 DrvFrame()
nCyclesDone[2] += ZetRun(nSegment - nCyclesDone[2]);
if (pBurnSoundOut) {
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
INT32 nSegmentLength = nBurnSoundLen / nInterleave;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
BurnYM2151Render(pSoundBuf, nSegmentLength);
K007232Update(0, pSoundBuf, nSegmentLength);

View File

@ -369,7 +369,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -451,10 +451,7 @@ static INT32 DrvExit()
K007232Exit();
BurnYM2151Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -530,7 +527,7 @@ static INT32 DrvFrame()
nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]);
if (pBurnSoundOut) {
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
INT32 nSegmentLength = nBurnSoundLen / nInterleave;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
BurnYM2151Render(pSoundBuf, nSegmentLength);
K007232Update(0, pSoundBuf, nSegmentLength);

View File

@ -317,7 +317,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -390,10 +390,7 @@ static INT32 DrvExit()
BurnYM2151Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -460,7 +457,7 @@ static INT32 DrvFrame()
nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]);
if (pBurnSoundOut) {
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
INT32 nSegmentLength = nBurnSoundLen / nInterleave;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
BurnYM2151Render(pSoundBuf, nSegmentLength);
nSoundBufferPos += nSegmentLength;

View File

@ -500,7 +500,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -610,10 +610,7 @@ static INT32 DrvExit()
K007232Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}

View File

@ -379,7 +379,7 @@ static INT32 DrvGfxDecode(UINT8 *src)
INT32 XOffs[8] = { 0, 4, 8, 12, 16, 20, 24, 28 };
INT32 YOffs[8] = { 0, 32, 64, 96, 128, 160, 192, 224 };
UINT8 *tmp = (UINT8*)malloc(0x80000);
UINT8 *tmp = (UINT8*)BurnMalloc(0x80000);
if (tmp == NULL) {
return 1;
}
@ -388,10 +388,7 @@ static INT32 DrvGfxDecode(UINT8 *src)
GfxDecode(0x4000, 4, 8, 8, Plane, XOffs, YOffs, 0x100, tmp, src);
if (tmp) {
free (tmp);
tmp = NULL;
}
BurnFree (tmp);
return 0;
}
@ -459,7 +456,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -540,10 +537,7 @@ static INT32 DrvExit()
M6809Exit();
BurnYM2151Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}

View File

@ -482,7 +482,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -560,10 +560,7 @@ static INT32 DrvExit()
K007232Exit();
BurnYM2151Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -637,7 +634,7 @@ static INT32 DrvFrame()
nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]);
if (pBurnSoundOut) {
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
INT32 nSegmentLength = nBurnSoundLen / nInterleave;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
BurnYM2151Render(pSoundBuf, nSegmentLength);
K007232Update(0, pSoundBuf, nSegmentLength);

View File

@ -453,10 +453,7 @@ static INT32 DrvExit()
K007232Exit();
BurnYM2151Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -534,7 +531,7 @@ static INT32 DrvFrame()
nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]);
if (pBurnSoundOut) {
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
INT32 nSegmentLength = nBurnSoundLen / nInterleave;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
BurnYM2151Render(pSoundBuf, nSegmentLength);
K007232Update(0, pSoundBuf, nSegmentLength);

View File

@ -513,7 +513,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -620,10 +620,7 @@ static INT32 DrvExit()
K007232Exit();
BurnYM2151Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -712,7 +709,7 @@ static INT32 DrvFrame()
}
{
memset (DrvInputs, 0xff, 3 * sizeof(short));
memset (DrvInputs, 0xff, 3 * sizeof(INT16));
for (INT32 i = 0; i < 8; i++) {
DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;
@ -760,7 +757,7 @@ static INT32 DrvFrame()
nCyclesDone[2] += ZetRun(nCycleSegment - nCyclesDone[2]);
if (pBurnSoundOut) {
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
INT32 nSegmentLength = nBurnSoundLen / nInterleave;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
BurnYM2151Render(pSoundBuf, nSegmentLength);
K007232Update(0, pSoundBuf, nSegmentLength);

View File

@ -4,7 +4,7 @@
#include "tiles_generic.h"
#include "konami_intf.h"
#include "burn_ym3812.h"
#include "K051649.h"
#include "k051649.h"
#include "k007232.h"
static UINT8 *AllMem;
@ -410,7 +410,7 @@ static INT32 DrvGfxDecode()
INT32 XOffs[8] = { 0x008, 0x00c, 0x000, 0x004, 0x018, 0x01c, 0x010, 0x014 };
INT32 YOffs[8] = { 0x000, 0x020, 0x040, 0x060, 0x080, 0x0a0, 0x0c0, 0x0e0 };
UINT8 *tmp = (UINT8*)malloc(0x100000);
UINT8 *tmp = (UINT8*)BurnMalloc(0x100000);
if (tmp == NULL) {
return 1;
}
@ -423,10 +423,7 @@ static INT32 DrvGfxDecode()
GfxDecode(0x8000, 4, 8, 8, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM1);
if (tmp) {
free (tmp);
tmp = NULL;
}
BurnFree (tmp);
return 0;
}
@ -459,7 +456,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -535,12 +532,10 @@ static INT32 DrvExit()
ZetExit();
K007232Exit();
K051649Exit();
BurnYM3812Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -769,7 +764,7 @@ static INT32 DrvFrame()
konamiRun(nCyclesTotal[0]);
konamiSetIrqLine(KONAMI_IRQ_LINE, KONAMI_HOLD_LINE);
BurnTimerEndFrameYM3812(nCyclesTotal[1] - ZetTotalCycles());
BurnTimerEndFrameYM3812(nCyclesTotal[1]);
if (pBurnSoundOut) {
BurnYM3812Update(pBurnSoundOut, nBurnSoundLen);

View File

@ -317,7 +317,7 @@ static INT32 DrvGfxDecode()
INT32 XOffs[8] = { 0x200000, 0x200004, 0x000000, 0x000004, 0x200008, 0x20000c, 0x000008, 0x00000c };
INT32 YOffs[8] = { 0x000000, 0x000010, 0x000020, 0x000030, 0x000040, 0x000050, 0x000060, 0x000070 };
UINT8 *tmp = (UINT8*)malloc(0x80000);
UINT8 *tmp = (UINT8*)BurnMalloc(0x80000);
if (tmp == NULL) {
return 1;
}
@ -326,10 +326,7 @@ static INT32 DrvGfxDecode()
GfxDecode(0x4000, 4, 8, 8, Plane, XOffs, YOffs, 0x080, tmp, DrvGfxROMExp);
if (tmp) {
free (tmp);
tmp = NULL;
}
BurnFree (tmp);
return 0;
}
@ -367,7 +364,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -415,13 +412,11 @@ static INT32 DrvExit()
GenericTilesExit();
MSM6295Exit(0);
K051649Exit();
ZetExit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
MSM6295ROM = NULL;

View File

@ -695,7 +695,7 @@ static INT32 DrvInit(INT32 type)
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -781,10 +781,7 @@ static INT32 DrvExit()
UPD7759Exit();
BurnYM2151Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -885,7 +882,7 @@ static INT32 DrvFrame()
}
if (pBurnSoundOut) {
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
INT32 nSegmentLength = nBurnSoundLen / nInterleave;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
BurnYM2151Render(pSoundBuf, nSegmentLength);
UPD7759Update(0, pSoundBuf, nSegmentLength);

View File

@ -406,7 +406,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -480,10 +480,7 @@ static INT32 DrvExit()
BurnYM2151Exit();
K053260Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}

View File

@ -361,7 +361,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -437,10 +437,7 @@ static INT32 DrvExit()
BurnYM3812Exit();
K053260Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}

View File

@ -442,7 +442,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -527,10 +527,7 @@ static INT32 DrvExit()
BurnYM2151Exit();
K053260Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}

View File

@ -524,7 +524,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -606,10 +606,7 @@ static INT32 DrvExit()
K007232Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -681,9 +678,10 @@ static INT32 DrvFrame()
}
if (K052109_irq_enabled) M6809SetIRQ(0, M6809_IRQSTATUS_AUTO);
BurnTimerEndFrameYM3812(nCyclesTotal[1]);
if (pBurnSoundOut) {
BurnTimerEndFrameYM3812(nCyclesTotal[1]);
if (pBurnSoundOut) {
BurnYM3812Update(pBurnSoundOut, nBurnSoundLen);
K007232Update(0, pBurnSoundOut, nBurnSoundLen);
K007232Update(1, pBurnSoundOut, nBurnSoundLen);

View File

@ -341,7 +341,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
int nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -397,10 +397,7 @@ static INT32 DrvExit()
BurnYM2151Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -504,14 +501,35 @@ static INT32 DrvFrame()
if ((DrvInputs[1] & 0x18) == 0) DrvInputs[1] |= 0x18;
if ((DrvInputs[1] & 0x06) == 0) DrvInputs[1] |= 0x06;
}
INT32 nSoundBufferPos = 0;
INT32 nInterleave = 10;
INT32 nCyclesTotal = (((3000000 / 60) * 133) / 100); // 33% overclock
INT32 nCyclesDone = 0;
konamiOpen(0);
konamiRun((((3000000 / 60) * 133) / 100) /* 33% overclock */);
for (INT32 i = 0; i < nInterleave; i++) {
INT32 nSegment = (nCyclesTotal / nInterleave) * (i + 1);
nCyclesDone += konamiRun(nSegment - nCyclesDone);
if (pBurnSoundOut) {
INT32 nSegmentLength = nBurnSoundLen / nInterleave;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
BurnYM2151Render(pSoundBuf, nSegmentLength);
nSoundBufferPos += nSegmentLength;
}
}
if (K052109_irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, KONAMI_HOLD_LINE);
if (pBurnSoundOut) {
BurnYM2151Render(pBurnSoundOut, nBurnSoundLen);
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
if (nSegmentLength) {
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
BurnYM2151Render(pSoundBuf, nSegmentLength);
}
}
konamiClose();

View File

@ -578,7 +578,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -716,10 +716,7 @@ static INT32 DrvExit()
K007232Exit();
BurnYM2151Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -783,7 +780,7 @@ static INT32 DrvFrame()
ZetNewFrame();
INT32 nSoundBufferPos = 0;
INT32 nInterleave = 1000;
INT32 nInterleave = 100;
INT32 nCyclesTotal[2] = { 3000000 / 60, 3579545 / 60 };
INT32 nCyclesDone[2] = { 0, 0 };
@ -801,7 +798,7 @@ static INT32 DrvFrame()
nCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]);
if (pBurnSoundOut) {
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
INT32 nSegmentLength = nBurnSoundLen / nInterleave;
INT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
BurnYM2151Render(pSoundBuf, nSegmentLength);
K007232Update(0, pSoundBuf, nSegmentLength);

View File

@ -4322,7 +4322,7 @@ static INT32 TmntInit()
Mem = NULL;
TmntMemIndex();
nLen = MemEnd - (UINT8 *)0;
if ((Mem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(Mem, 0, nLen);
TmntMemIndex();
@ -4348,7 +4348,7 @@ static INT32 TmntInit()
GfxDecode(0x100000 / 32, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTileRom, DrvTiles);
// Load the sprites
DrvTempRom = (UINT8 *)malloc(0x200100);
DrvTempRom = (UINT8 *)BurnMalloc(0x200100);
nRet = BurnLoadRom(DrvSpriteRom + 0x000000, 7, 1); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvSpriteRom + 0x080000, 8, 1); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvSpriteRom + 0x100000, 9, 1); if (nRet != 0) return 1;
@ -4371,10 +4371,7 @@ static INT32 TmntInit()
nRet = BurnLoadRom(DrvTempRom + 0x00000, 15, 1); if (nRet != 0) return 1;
TmntDecodeTitleSample();
if (DrvTempRom) {
free(DrvTempRom);
DrvTempRom = NULL;
}
BurnFree(DrvTempRom);
// Setup the 68000 emulation
SekInit(0, 0x68000);
@ -4430,7 +4427,7 @@ static INT32 MiaInit()
Mem = NULL;
MiaMemIndex();
nLen = MemEnd - (UINT8 *)0;
if ((Mem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(Mem, 0, nLen);
MiaMemIndex();
@ -4456,7 +4453,7 @@ static INT32 MiaInit()
GfxDecode(0x2000, 4, 8, 8, TilePlaneOffsets, TileXOffsets, TileYOffsets, 0x100, DrvTileRom, DrvTiles);
// Load the sprites
DrvTempRom = (UINT8 *)malloc(0x100000);
DrvTempRom = (UINT8 *)BurnMalloc(0x100000);
nRet = BurnLoadRom(DrvSpriteRom + 0x000000, 7, 1); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvSpriteRom + 0x080000, 8, 1); if (nRet != 0) return 1;
shuffle((UINT16*)DrvSpriteRom, 0x080000);
@ -4469,10 +4466,7 @@ static INT32 MiaInit()
// Load K007232 Sample Roms
nRet = BurnLoadRom(DrvSoundRom + 0x00000, 10, 1); if (nRet != 0) return 1;
if (DrvTempRom) {
free(DrvTempRom);
DrvTempRom = NULL;
}
BurnFree(DrvTempRom);
// Setup the 68000 emulation
SekInit(0, 0x68000);
@ -4527,7 +4521,7 @@ static INT32 CuebrickInit()
Mem = NULL;
CuebrickMemIndex();
nLen = MemEnd - (UINT8 *)0;
if ((Mem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(Mem, 0, nLen);
CuebrickMemIndex();
@ -4594,7 +4588,7 @@ static INT32 BlswhstlInit()
Mem = NULL;
BlswhstlMemIndex();
nLen = MemEnd - (UINT8 *)0;
if ((Mem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(Mem, 0, nLen);
BlswhstlMemIndex();
@ -4679,7 +4673,7 @@ static INT32 SsridersInit()
Mem = NULL;
SsridersMemIndex();
nLen = MemEnd - (UINT8 *)0;
if ((Mem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(Mem, 0, nLen);
SsridersMemIndex();
@ -4763,7 +4757,7 @@ static INT32 Thndrx2Init()
Mem = NULL;
Thndrx2MemIndex();
nLen = MemEnd - (UINT8 *)0;
if ((Mem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(Mem, 0, nLen);
Thndrx2MemIndex();
@ -4844,7 +4838,7 @@ static INT32 LgtnfghtInit()
Mem = NULL;
LgtnfghtMemIndex();
nLen = MemEnd - (UINT8 *)0;
if ((Mem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(Mem, 0, nLen);
LgtnfghtMemIndex();
@ -4926,7 +4920,7 @@ static INT32 Tmnt2Init()
Mem = NULL;
Tmnt2MemIndex();
nLen = MemEnd - (UINT8 *)0;
if ((Mem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(Mem, 0, nLen);
Tmnt2MemIndex();
@ -5016,7 +5010,7 @@ static INT32 QgakumonInit()
Mem = NULL;
Tmnt2MemIndex();
nLen = MemEnd - (UINT8 *)0;
if ((Mem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(Mem, 0, nLen);
Tmnt2MemIndex();
@ -5104,7 +5098,7 @@ static INT32 PunkshotInit()
Mem = NULL;
PunkshotMemIndex();
nLen = MemEnd - (UINT8 *)0;
if ((Mem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(Mem, 0, nLen);
PunkshotMemIndex();
@ -5177,23 +5171,17 @@ static INT32 PunkshotInit()
return 0;
}
static INT32 DrvExit()
static INT32 CommonExit()
{
SekExit();
ZetExit();
BurnYM2151Exit();
UPD7759Exit();
K007232Exit();
GenericTilesExit();
KonamiICExit();
if (Mem) {
free(Mem);
Mem = NULL;
}
BurnFree(Mem);
bIrqEnable = 0;
DrvSoundLatch = 0;
@ -5214,11 +5202,41 @@ static INT32 DrvExit()
return 0;
}
static INT32 DrvEEPROMExit()
static INT32 CommonZ80Exit()
{
ZetExit();
return CommonExit();
}
static INT32 TmntExit()
{
UPD7759Exit();
K007232Exit();
return CommonZ80Exit();
}
static INT32 MiaExit()
{
K007232Exit();
return CommonZ80Exit();
}
static INT32 BlswhstlExit()
{
K053260Exit();
EEPROMExit();
return DrvExit();
return CommonZ80Exit();
}
static INT32 PunkshotExit()
{
K053260Exit();
return CommonZ80Exit();
}
static inline UINT8 pal5bit(UINT8 bits)
@ -6147,7 +6165,7 @@ struct BurnDriver BurnDrvTmnt = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, TmntRomInfo, TmntRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo,
TmntInit, DrvExit, TmntFrame, NULL, TmntScan,
TmntInit, TmntExit, TmntFrame, NULL, TmntScan,
NULL, 0x400, 304, 224, 4, 3
};
@ -6157,7 +6175,7 @@ struct BurnDriver BurnDrvTmntu = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, TmntuRomInfo, TmntuRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo,
TmntInit, DrvExit, TmntFrame, NULL, TmntScan,
TmntInit, TmntExit, TmntFrame, NULL, TmntScan,
NULL, 0x400, 304, 224, 4, 3
};
@ -6167,7 +6185,7 @@ struct BurnDriver BurnDrvTmntua = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, TmntuaRomInfo, TmntuaRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo,
TmntInit, DrvExit, TmntFrame, NULL, TmntScan,
TmntInit, TmntExit, TmntFrame, NULL, TmntScan,
NULL, 0x400, 304, 224, 4, 3
};
@ -6177,7 +6195,7 @@ struct BurnDriver BurnDrvTmht = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, TmhtRomInfo, TmhtRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo,
TmntInit, DrvExit, TmntFrame, NULL, TmntScan,
TmntInit, TmntExit, TmntFrame, NULL, TmntScan,
NULL, 0x400, 304, 224, 4, 3
};
@ -6187,7 +6205,7 @@ struct BurnDriver BurnDrvTmhta = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, TmhtaRomInfo, TmhtaRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo,
TmntInit, DrvExit, TmntFrame, NULL, TmntScan,
TmntInit, TmntExit, TmntFrame, NULL, TmntScan,
NULL, 0x400, 304, 224, 4, 3
};
@ -6197,7 +6215,7 @@ struct BurnDriver BurnDrvTmntj = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, TmntjRomInfo, TmntjRomName, NULL, NULL, TmntInputInfo, TmntDIPInfo,
TmntInit, DrvExit, TmntFrame, NULL, TmntScan,
TmntInit, TmntExit, TmntFrame, NULL, TmntScan,
NULL, 0x400, 304, 224, 4, 3
};
@ -6207,7 +6225,7 @@ struct BurnDriver BurnDrvTmht2p = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, Tmht2pRomInfo, Tmht2pRomName, NULL, NULL, Tmnt2pInputInfo, Tmnt2pDIPInfo,
TmntInit, DrvExit, TmntFrame, NULL, TmntScan,
TmntInit, TmntExit, TmntFrame, NULL, TmntScan,
NULL, 0x400, 304, 224, 4, 3
};
@ -6217,7 +6235,7 @@ struct BurnDriver BurnDrvTmht2pa = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, Tmht2paRomInfo, Tmht2paRomName, NULL, NULL, Tmnt2pInputInfo, Tmnt2pDIPInfo,
TmntInit, DrvExit, TmntFrame, NULL, TmntScan,
TmntInit, TmntExit, TmntFrame, NULL, TmntScan,
NULL, 0x400, 304, 224, 4, 3
};
@ -6227,7 +6245,7 @@ struct BurnDriver BurnDrvTmht2pj = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, Tmnt2pjRomInfo, Tmnt2pjRomName, NULL, NULL, Tmnt2pInputInfo, Tmnt2pDIPInfo,
TmntInit, DrvExit, TmntFrame, NULL, TmntScan,
TmntInit, TmntExit, TmntFrame, NULL, TmntScan,
NULL, 0x400, 304, 224, 4, 3
};
@ -6237,7 +6255,7 @@ struct BurnDriver BurnDrvTmht2po = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, Tmnt2poRomInfo, Tmnt2poRomName, NULL, NULL, Tmnt2pInputInfo, Tmnt2pDIPInfo,
TmntInit, DrvExit, TmntFrame, NULL, TmntScan,
TmntInit, TmntExit, TmntFrame, NULL, TmntScan,
NULL, 0x400, 304, 224, 4, 3
};
@ -6247,7 +6265,7 @@ struct BurnDriver BurnDrvMia = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0,
NULL, MiaRomInfo, MiaRomName, NULL, NULL, MiaInputInfo, MiaDIPInfo,
MiaInit, DrvExit, MiaFrame, NULL, MiaScan,
MiaInit, MiaExit, MiaFrame, NULL, MiaScan,
NULL, 0x400, 304, 224, 4, 3
};
@ -6257,7 +6275,7 @@ struct BurnDriver BurnDrvMia2 = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0,
NULL, Mia2RomInfo, Mia2RomName, NULL, NULL, MiaInputInfo, MiaDIPInfo,
MiaInit, DrvExit, MiaFrame, NULL, MiaScan,
MiaInit, MiaExit, MiaFrame, NULL, MiaScan,
NULL, 0x400, 304, 224, 4, 3
};
@ -6267,7 +6285,7 @@ struct BurnDriver BurnDrvCuebrick = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_PUZZLE, 0,
NULL, CuebrickRomInfo, CuebrickRomName, NULL, NULL, MiaInputInfo, MiaDIPInfo,
CuebrickInit, DrvExit, CuebrickFrame, NULL, CuebrickScan,
CuebrickInit, CommonExit, CuebrickFrame, NULL, CuebrickScan,
NULL, 0x400, 304, 224, 4, 3
};
@ -6277,7 +6295,7 @@ struct BurnDriver BurnDrvBlswhstl = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0,
NULL, BlswhstlRomInfo, BlswhstlRomName, NULL, NULL, BlswhstlInputInfo, NULL,
BlswhstlInit, DrvEEPROMExit, BlswhstlFrame, NULL, BlswhstlScan,
BlswhstlInit, BlswhstlExit, BlswhstlFrame, NULL, BlswhstlScan,
NULL, 0x810, 224, 280, 3, 4
};
@ -6287,7 +6305,7 @@ struct BurnDriver BurnDrvDetatwin = {
L"\u51FA\u305F\u306A!! Twin Bee \u30C4\u30A4\u30F3\u30D3\u30FC (Japan ver. J)\0", NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0,
NULL, DetatwinRomInfo, DetatwinRomName, NULL, NULL, BlswhstlInputInfo, NULL,
BlswhstlInit, DrvEEPROMExit, BlswhstlFrame, NULL, BlswhstlScan,
BlswhstlInit, BlswhstlExit, BlswhstlFrame, NULL, BlswhstlScan,
NULL, 0x810, 224, 280, 3, 4
};
@ -6297,7 +6315,7 @@ struct BurnDriver BurnDrvSsriders = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 4, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0,
NULL, SsridersRomInfo, SsridersRomName, NULL, NULL, Ssriders4pInputInfo, NULL,
SsridersInit, DrvEEPROMExit, SsridersFrame, NULL, SsridersScan,
SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan,
NULL, 0x810, 288, 224, 4, 3
};
@ -6307,7 +6325,7 @@ struct BurnDriver BurnDrvSsridersebd = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0,
NULL, SsridersebdRomInfo, SsridersebdRomName, NULL, NULL, SsridersInputInfo, NULL,
SsridersInit, DrvEEPROMExit, SsridersFrame, NULL, SsridersScan,
SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan,
NULL, 0x810, 288, 224, 4, 3
};
@ -6317,7 +6335,7 @@ struct BurnDriver BurnDrvSsridersebc = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0,
NULL, SsridersebcRomInfo, SsridersebcRomName, NULL, NULL, SsridersInputInfo, NULL,
SsridersInit, DrvEEPROMExit, SsridersFrame, NULL, SsridersScan,
SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan,
NULL, 0x810, 288, 224, 4, 3
};
@ -6327,7 +6345,7 @@ struct BurnDriver BurnDrvSsridersuda = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0,
NULL, SsridersudaRomInfo, SsridersudaRomName, NULL, NULL, Ssriders4psInputInfo, NULL,
SsridersInit, DrvEEPROMExit, SsridersFrame, NULL, SsridersScan,
SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan,
NULL, 0x810, 288, 224, 4, 3
};
@ -6337,7 +6355,7 @@ struct BurnDriver BurnDrvSsriderseaa = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0,
NULL, SsriderseaaRomInfo, SsriderseaaRomName, NULL, NULL, Ssriders4psInputInfo, NULL,
SsridersInit, DrvEEPROMExit, SsridersFrame, NULL, SsridersScan,
SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan,
NULL, 0x810, 288, 224, 4, 3
};
@ -6347,7 +6365,7 @@ struct BurnDriver BurnDrvSsridersuac = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0,
NULL, SsridersuacRomInfo, SsridersuacRomName, NULL, NULL, Ssriders4pInputInfo, NULL,
SsridersInit, DrvEEPROMExit, SsridersFrame, NULL, SsridersScan,
SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan,
NULL, 0x810, 288, 224, 4, 3
};
@ -6357,7 +6375,7 @@ struct BurnDriver BurnDrvSsridersubc = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0,
NULL, SsridersubcRomInfo, SsridersubcRomName, NULL, NULL, SsridersInputInfo, NULL,
SsridersInit, DrvEEPROMExit, SsridersFrame, NULL, SsridersScan,
SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan,
NULL, 0x810, 288, 224, 4, 3
};
@ -6367,7 +6385,7 @@ struct BurnDriver BurnDrvSsridersabd = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0,
NULL, SsridersabdRomInfo, SsridersabdRomName, NULL, NULL, SsridersInputInfo, NULL,
SsridersInit, DrvEEPROMExit, SsridersFrame, NULL, SsridersScan,
SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan,
NULL, 0x810, 288, 224, 4, 3
};
@ -6377,7 +6395,7 @@ struct BurnDriver BurnDrvSsridersadd = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0,
NULL, SsridersaddRomInfo, SsridersaddRomName, NULL, NULL, Ssriders4psInputInfo, NULL,
SsridersInit, DrvEEPROMExit, SsridersFrame, NULL, SsridersScan,
SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan,
NULL, 0x810, 288, 224, 4, 3
};
@ -6387,11 +6405,11 @@ struct BurnDriver BurnDrvSsridersjbd = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0,
NULL, SsridersjbdRomInfo, SsridersjbdRomName, NULL, NULL, SsridersInputInfo, NULL,
SsridersInit, DrvEEPROMExit, SsridersFrame, NULL, SsridersScan,
SsridersInit, BlswhstlExit, SsridersFrame, NULL, SsridersScan,
NULL, 0x810, 288, 224, 4, 3
};
static int SsridersbInit()
static INT32 SsridersbInit()
{
return 1;
}
@ -6402,7 +6420,7 @@ struct BurnDriverD BurnDrvSsridersb = {
NULL, NULL, NULL, NULL,
BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_KONAMI_68K_Z80, GBF_PLATFORM, 0,
NULL, ssridersbRomInfo, ssridersbRomName, NULL, NULL, Ssriders4psInputInfo, NULL,
SsridersbInit, DrvEEPROMExit, SsridersFrame, NULL, SsridersScan,
SsridersbInit, CommonExit, SsridersFrame, NULL, SsridersScan,
NULL, 0x810, 288, 224, 4, 3
};
@ -6412,7 +6430,7 @@ struct BurnDriver BurnDrvThndrx2 = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_HORSHOOT, 0,
NULL, thndrx2RomInfo, thndrx2RomName, NULL, NULL, Thndrx2InputInfo, NULL,
Thndrx2Init, DrvEEPROMExit, Thndrx2Frame, NULL, Thndrx2aScan,
Thndrx2Init, BlswhstlExit, Thndrx2Frame, NULL, Thndrx2aScan,
NULL, 0x800, 288, 224, 4, 3
};
@ -6422,7 +6440,7 @@ struct BurnDriver BurnDrvThndrx2a = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_HORSHOOT, 0,
NULL, thndrx2aRomInfo, thndrx2aRomName, NULL, NULL, Thndrx2InputInfo, NULL,
Thndrx2Init, DrvEEPROMExit, Thndrx2Frame, NULL, Thndrx2aScan,
Thndrx2Init, BlswhstlExit, Thndrx2Frame, NULL, Thndrx2aScan,
NULL, 0x800, 288, 224, 4, 3
};
@ -6432,7 +6450,7 @@ struct BurnDriver BurnDrvThndrx2j = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_HORSHOOT, 0,
NULL, thndrx2jRomInfo, thndrx2jRomName, NULL, NULL, Thndrx2InputInfo, NULL,
Thndrx2Init, DrvEEPROMExit, Thndrx2Frame, NULL, Thndrx2aScan,
Thndrx2Init, BlswhstlExit, Thndrx2Frame, NULL, Thndrx2aScan,
NULL, 0x800, 288, 224, 4, 3
};
@ -6442,7 +6460,7 @@ struct BurnDriver BurnDrvLgtnfght = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0,
NULL, lgtnfghtRomInfo, lgtnfghtRomName, NULL, NULL, LgtnfghtInputInfo, LgtnfghtDIPInfo,
LgtnfghtInit, DrvExit, LgtnfghtFrame, NULL, Thndrx2aScan,
LgtnfghtInit, BlswhstlExit, LgtnfghtFrame, NULL, Thndrx2aScan,
NULL, 0x800, 224, 288, 3, 4
};
@ -6452,7 +6470,7 @@ struct BurnDriver BurnDrvLgtnfghtu = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0,
NULL, lgtnfghtuRomInfo, lgtnfghtuRomName, NULL, NULL, LgtnfghtInputInfo, LgtnfghtDIPInfo,
LgtnfghtInit, DrvExit, LgtnfghtFrame, NULL, Thndrx2aScan,
LgtnfghtInit, BlswhstlExit, LgtnfghtFrame, NULL, Thndrx2aScan,
NULL, 0x800, 224, 288, 3, 4
};
@ -6462,7 +6480,7 @@ struct BurnDriver BurnDrvLgtnfghta = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0,
NULL, lgtnfghtaRomInfo, lgtnfghtaRomName, NULL, NULL, LgtnfghtInputInfo, LgtnfghtDIPInfo,
LgtnfghtInit, DrvExit, LgtnfghtFrame, NULL, Thndrx2aScan,
LgtnfghtInit, BlswhstlExit, LgtnfghtFrame, NULL, Thndrx2aScan,
NULL, 0x800, 224, 288, 3, 4
};
@ -6472,7 +6490,7 @@ struct BurnDriver BurnDrvTrigon = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_KONAMI_68K_Z80, GBF_VERSHOOT, 0,
NULL, trigonRomInfo, trigonRomName, NULL, NULL, LgtnfghtInputInfo, LgtnfghtDIPInfo,
LgtnfghtInit, DrvExit, LgtnfghtFrame, NULL, Thndrx2aScan,
LgtnfghtInit, BlswhstlExit, LgtnfghtFrame, NULL, Thndrx2aScan,
NULL, 0x800, 224, 288, 3, 4
};
@ -6482,7 +6500,7 @@ struct BurnDriver BurnDrvTmnt2 = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, tmnt2RomInfo, tmnt2RomName, NULL, NULL, Ssriders4pInputInfo, NULL,
Tmnt2Init, DrvEEPROMExit, Tmnt2Frame, NULL, SsridersScan,
Tmnt2Init, BlswhstlExit, Tmnt2Frame, NULL, SsridersScan,
NULL, 0x800, 288, 224, 4, 3
};
@ -6492,7 +6510,7 @@ struct BurnDriver BurnDrvTmnt22pu = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, tmnt22puRomInfo, tmnt22puRomName, NULL, NULL, SsridersInputInfo, NULL,
Tmnt2Init, DrvEEPROMExit, Tmnt2Frame, NULL, SsridersScan,
Tmnt2Init, BlswhstlExit, Tmnt2Frame, NULL, SsridersScan,
NULL, 0x800, 288, 224, 4, 3
};
@ -6502,7 +6520,7 @@ struct BurnDriver BurnDrvTmht22pe = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, tmht22peRomInfo, tmht22peRomName, NULL, NULL, SsridersInputInfo, NULL,
Tmnt2Init, DrvEEPROMExit, Tmnt2Frame, NULL, SsridersScan,
Tmnt2Init, BlswhstlExit, Tmnt2Frame, NULL, SsridersScan,
NULL, 0x800, 288, 224, 4, 3
};
@ -6512,7 +6530,7 @@ struct BurnDriver BurnDrvTmnt2a = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_KONAMI_68K_Z80, GBF_SCRFIGHT, 0,
NULL, tmnt2aRomInfo, tmnt2aRomName, NULL, NULL, Ssriders4psInputInfo, NULL,
Tmnt2Init, DrvEEPROMExit, Tmnt2Frame, NULL, SsridersScan,
Tmnt2Init, BlswhstlExit, Tmnt2Frame, NULL, SsridersScan,
NULL, 0x800, 288, 224, 4, 3
};
@ -6522,7 +6540,7 @@ struct BurnDriver BurnDrvQgakumon = {
L"\u30AF\u30A4\u30BA \u5B66\u554F\u30CE\u30B9\u30B9\u30E1 Gakumon no Susume (Japan ver. JA1 Type H)\0", NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_KONAMI_68K_Z80, GBF_QUIZ, 0,
NULL, qgakumonRomInfo, qgakumonRomName, NULL, NULL, QgakumonInputInfo, NULL,
QgakumonInit, DrvEEPROMExit, Tmnt2Frame, NULL, SsridersScan,
QgakumonInit, BlswhstlExit, Tmnt2Frame, NULL, SsridersScan,
NULL, 0x800, 304, 224, 4, 3
};
@ -6532,7 +6550,7 @@ struct BurnDriver BurnDrvPunkshot = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 4, HARDWARE_KONAMI_68K_Z80, GBF_SPORTSMISC, 0,
NULL, punkshotRomInfo, punkshotRomName, NULL, NULL, PunkshotInputInfo, PunkshotDIPInfo,
PunkshotInit, DrvExit, PunkshotFrame, NULL, Thndrx2aScan,
PunkshotInit, PunkshotExit, PunkshotFrame, NULL, Thndrx2aScan,
NULL, 0x800, 288, 224, 4, 3
};
@ -6542,7 +6560,7 @@ struct BurnDriver BurnDrvPunkshot2 = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SPORTSMISC, 0,
NULL, punkshot2RomInfo, punkshot2RomName, NULL, NULL, Punkshot2InputInfo, Punkshot2DIPInfo,
PunkshotInit, DrvExit, PunkshotFrame, NULL, Thndrx2aScan,
PunkshotInit, PunkshotExit, PunkshotFrame, NULL, Thndrx2aScan,
NULL, 0x800, 288, 224, 4, 3
};
@ -6552,6 +6570,6 @@ struct BurnDriver BurnDrvPunkshotj = {
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_KONAMI_68K_Z80, GBF_SPORTSMISC, 0,
NULL, punkshotjRomInfo, punkshotjRomName, NULL, NULL, Punkshot2InputInfo, PunkshotjDIPInfo,
PunkshotInit, DrvExit, PunkshotFrame, NULL, Thndrx2aScan,
PunkshotInit, PunkshotExit, PunkshotFrame, NULL, Thndrx2aScan,
NULL, 0x800, 288, 224, 4, 3
};

View File

@ -926,12 +926,13 @@ static void expand4bpp(UINT8 *src, UINT8 *dst, INT32 len)
static void gfxdecode()
{
UINT16 *src = (UINT16*)DrvGfxROM1;
UINT16 *dst = (UINT16*)malloc(0x200000);
UINT16 *dst = (UINT16*)BurnMalloc(0x200000);
for (INT32 i = 0; i < 0x80000; i++)
{
dst[i * 2 + 0] = src[i + 0x80000];
dst[i * 2 + 1] = src[i + 0x00000];
}
BurnFree(dst);
memcpy (src, dst, 0x200000);
}
@ -951,7 +952,7 @@ static INT32 DrvInit(INT32 (pLoadCallback)())
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -1041,10 +1042,7 @@ static INT32 DrvExit()
UPD7759Exit();
BurnYM2151Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
is_vulcan = 0;
twin16_custom_video = 0;
@ -1384,7 +1382,7 @@ static INT32 DrvFrame()
}
{
memset (DrvInputs, 0xff, 5 * sizeof(short));
memset (DrvInputs, 0xff, 5);
for (INT32 i = 0; i < 16; i++) {
DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;

View File

@ -412,7 +412,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -502,10 +502,7 @@ static INT32 DrvExit()
BurnYM2151Exit();
MSM6295Exit(0);
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -688,7 +685,7 @@ struct BurnDriver BurnDrvUltraman = {
"ultraman", NULL, NULL, NULL, "1991",
"Ultraman (Japan)\0", NULL, "Banpresto / Bandai", "GX910",
L"\uFEFF\u30A6\u30EB\u30c8\u30E9\u30DE\u30f3 \u7A7A\u60F3\u7279\u64AE\u30B7\u30EA\u30FC\u30BA (Japan)\0Ultraman\0", NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VSFIGHT, 0,
BDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_VSFIGHT, 0,
NULL, ultramanRomInfo, ultramanRomName, NULL, NULL, UltramanInputInfo, UltramanDIPInfo,
DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
288, 224, 4, 3

View File

@ -630,7 +630,7 @@ static INT32 DrvInit(INT32 nGame)
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -736,10 +736,7 @@ static INT32 DrvExit()
BurnYM2151Exit();
K053260Exit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}

View File

@ -414,7 +414,7 @@ static INT32 DrvInit()
AllMem = NULL;
MemIndex();
INT32 nLen = MemEnd - (UINT8 *)0;
if ((AllMem = (UINT8 *)malloc(nLen)) == NULL) return 1;
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
memset(AllMem, 0, nLen);
MemIndex();
@ -499,10 +499,7 @@ static INT32 DrvExit()
EEPROMExit();
if (AllMem) {
free (AllMem);
AllMem = NULL;
}
BurnFree (AllMem);
return 0;
}
@ -597,7 +594,7 @@ static INT32 DrvFrame()
}
{
memset (DrvInputs, 0xff, 3 * sizeof(short));
memset (DrvInputs, 0xff, 3 * sizeof(INT16));
for (INT32 i = 0; i < 16; i++) {
DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;

View File

@ -26,8 +26,8 @@ static void K051316GfxExpand(UINT8 *src, UINT8 *dst, INT32 len)
void K051316Init(INT32 chip, UINT8 *gfx, UINT8 *gfxexp, INT32 mask, void (*callback)(INT32 *code,INT32 *color,INT32 *flags), INT32 bpp, INT32 transp)
{
K051316Ram[chip] = (UINT8*)malloc(0x800);
K051316TileMap[chip] = (UINT16*)malloc(((32 * 16) * (32 * 16)) * sizeof(UINT16));
K051316Ram[chip] = (UINT8*)BurnMalloc(0x800);
K051316TileMap[chip] = (UINT16*)BurnMalloc(((32 * 16) * (32 * 16)) * sizeof(UINT16));
K051316Callback[chip] = callback;
@ -61,7 +61,7 @@ void K051316Reset()
K051316Wrap[i] = 0;
if (K051316TileMap[i]) {
memset (K051316TileMap[i], 0, (32 * 16) * (32 * 16) * sizeof(short));
memset (K051316TileMap[i], 0, (32 * 16) * (32 * 16) * sizeof(INT16));
}
}
}
@ -70,16 +70,8 @@ void K051316Exit()
{
for (INT32 i = 0; i < 3; i++)
{
if (K051316Ram[i]) {
free (K051316Ram[i]);
}
K051316Ram[i] = NULL;
if (K051316TileMap[i]) {
free (K051316TileMap[i]);
}
K051316TileMap[i] = NULL;
BurnFree (K051316Ram[i]);
BurnFree (K051316TileMap[i]);
K051316Callback[i] = NULL;
}
}

View File

@ -202,7 +202,7 @@ void K051960Init(UINT8* pRomSrc, UINT32 RomMask)
{
nSpriteXOffset = nSpriteYOffset = 0;
K051960Ram = (UINT8*)malloc(0x400);
K051960Ram = (UINT8*)BurnMalloc(0x400);
K051960RomMask = RomMask;
@ -217,10 +217,7 @@ void K051960Init(UINT8* pRomSrc, UINT32 RomMask)
void K051960Exit()
{
if (K051960Ram) {
free(K051960Ram);
K051960Ram = NULL;
}
BurnFree(K051960Ram);
K051960Callback = NULL;
K051960RomMask = 0;

View File

@ -477,7 +477,7 @@ void K052109Reset()
void K052109Init(UINT8 *pRomSrc, UINT32 RomMask)
{
K052109Ram = (UINT8*)malloc(0x6000);
K052109Ram = (UINT8*)BurnMalloc(0x6000);
K052109RomMask = RomMask;
@ -495,10 +495,7 @@ void K052109Init(UINT8 *pRomSrc, UINT32 RomMask)
void K052109Exit()
{
if (K052109Ram) {
free(K052109Ram);
K052109Ram = NULL;
}
BurnFree(K052109Ram);
K052109Callback = NULL;
K052109RomMask = 0;

View File

@ -43,8 +43,8 @@ void K053245GfxDecode(UINT8 *src, UINT8 *dst, INT32 len)
void K053245Init(INT32 chip, UINT8 *gfx, INT32 mask, void (*callback)(INT32 *code,INT32 *color,INT32 *priority))
{
K053245Ram[chip] = (UINT8*)malloc(0x800); // enough
K053245Buf[chip] = (UINT8*)malloc(0x800); // enough
K053245Ram[chip] = (UINT8*)BurnMalloc(0x800); // enough
K053245Buf[chip] = (UINT8*)BurnMalloc(0x800); // enough
K053245Mask[chip] = mask;
@ -59,7 +59,7 @@ void K053245Init(INT32 chip, UINT8 *gfx, INT32 mask, void (*callback)(INT32 *cod
if (konami_temp_screen == NULL) {
INT32 width, height;
BurnDrvGetVisibleSize(&width, &height);
konami_temp_screen = (UINT16*)malloc(width * height * 2);
konami_temp_screen = (UINT16*)BurnMalloc(width * height * 2);
}
K053245Temp = konami_temp_screen;
@ -72,14 +72,8 @@ void K053245Exit()
K053245Temp = NULL;
for (INT32 i = 0; i < K053245Active; i++) {
if (K053245Ram[i]) {
free (K053245Ram[i]);
K053245Ram[i] = NULL;
}
if (K053245Buf[i]) {
free (K053245Buf[i]);
K053245Buf[i] = NULL;
}
BurnFree (K053245Ram[i]);
BurnFree (K053245Buf[i]);
K053245_dx[i] = 0;
K053245_dy[i] = 0;

View File

@ -59,7 +59,7 @@ void K053247Scan(INT32 nAction)
void K053247Init(UINT8 *gfxrom, INT32 gfxlen, void (*Callback)(INT32 *code, INT32 *color, INT32 *priority), INT32 flags)
{
K053247Ram = (UINT8*)malloc(0x1000);
K053247Ram = (UINT8*)BurnMalloc(0x1000);
K053246Gfx = gfxrom;
K053246Mask = gfxlen;
@ -73,7 +73,7 @@ void K053247Init(UINT8 *gfxrom, INT32 gfxlen, void (*Callback)(INT32 *code, INT3
if (konami_temp_screen == NULL) {
INT32 width, height;
BurnDrvGetVisibleSize(&width, &height);
konami_temp_screen = (UINT16*)malloc(width * height * 2);
konami_temp_screen = (UINT16*)BurnMalloc(width * height * 2);
}
K053247Temp = konami_temp_screen;
@ -87,10 +87,7 @@ void K053247Exit()
{
K053247Temp = NULL;
if (K053247Ram) {
free (K053247Ram);
K053247Ram = NULL;
}
BurnFree (K053247Ram);
K053247Flags = 0;

View File

@ -32,14 +32,14 @@ void K053936Init(INT32 chip, UINT8 *ram, INT32 len, INT32 w, INT32 h, void (*pCa
nRamLen[chip] = len;
if (rambuf[chip] == NULL) {
rambuf[chip] = (UINT8*)malloc(len);
rambuf[chip] = (UINT8*)BurnMalloc(len);
}
nWidth[chip] = w;
nHeight[chip] = h;
if (tscreen[chip] == NULL) {
tscreen[chip] = (UINT16*)malloc(w * h * 2);
tscreen[chip] = (UINT16*)BurnMalloc(w * h * 2);
}
if (chip == 0) {
@ -58,15 +58,9 @@ void K053936Exit()
nRamLen[i] = 0;
nWidth[i] = 0;
nHeight[i] = 0;
if (tscreen[i] != NULL) {
free (tscreen[i]);
tscreen[i] = NULL;
}
BurnFree (tscreen[i]);
ramptr[i] = NULL;
if (rambuf[i] != NULL) {
free (rambuf[i]);
rambuf[i] = NULL;
}
BurnFree (rambuf[i]);
K053936Wrap[i] = 0;
K053936Offset[i][0] = K053936Offset[i][1] = 0;
}

View File

@ -105,10 +105,7 @@ void KonamiICReset()
void KonamiICExit()
{
if (konami_temp_screen) {
free (konami_temp_screen);
konami_temp_screen = NULL;
}
BurnFree (konami_temp_screen);
if (KonamiIC_K051960InUse) K051960Exit();
if (KonamiIC_K052109InUse) K052109Exit();