Fix crashes for pre-90s hardware games. This is happening because of a value too high being passed to BurnHighCol(..), it should only be 0-ff. I'm guessing this is something that was changed recently, or is due to the mingw version I'm using to compile (mingwmame).

This commit is contained in:
iq_132 2014-10-21 02:37:40 +00:00
parent fe1fba0ef2
commit 9bbbc81c52
27 changed files with 175 additions and 315 deletions

View File

@ -17,7 +17,7 @@ static UINT8 *DrvGfxROM;
static UINT8 *DrvZ80RAM;
static UINT8 *DrvNVRAM;
static UINT8 *DrvVidRAM;
static UINT32 *Palette;
static UINT32 *DrvPalette;
static INT16 *pAY8910Buffer[3];
@ -228,7 +228,6 @@ static INT32 MemIndex()
DrvGfxROM = Next; Next += 0x010000;
Palette = (UINT32*)Next; Next += 0x0008 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x0008 * sizeof(UINT32);
DrvNVRAM = Next; Next += 0x001000;

View File

@ -23,7 +23,6 @@ static UINT8 *DrvColRAM;
static UINT8 *DrvScrRAM;
static INT16 *pAY8910Buffer[6];
static UINT32 *DrvPalette;
static UINT32 *Palette;
static UINT8 DrvRecalc;
@ -201,7 +200,7 @@ static void DrvPaletteInit()
bit2 = (DrvColPROM[i] >> 7) & 0x01;
b = 0x47 * bit1 + 0x97 * bit2;
Palette[i] = (r << 16) | (g << 8) | b;
DrvPalette[i] = BurnHighCol(r,g,b,0);
}
}
@ -237,7 +236,6 @@ static INT32 MemIndex()
DrvColPROM = Next; Next += 0x000100;
DrvPalette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32);
Palette = (UINT32*)Next; Next += 0x0100 * sizeof(UINT32);
AllRam = Next;
@ -450,10 +448,8 @@ static void draw_sprites()
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x100; i++) {
INT32 p = Palette[i];
DrvPalette[i] = BurnHighCol(p >> 16, (p >> 8) & 0xff, p & 0xff, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}
BurnTransferClear();

View File

@ -18,7 +18,7 @@ static UINT8 *DrvZ80RAM;
static UINT8 *DrvVidRAM;
static UINT8 *DrvBlitRAM;
static UINT8 *DrvTempBmp;
static UINT32 *Palette;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc;
@ -379,7 +379,6 @@ static INT32 MemIndex()
DrvGfxROM = Next; Next += 0x010000;
Palette = (UINT32*)Next; Next += 0x2000 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x2000 * sizeof(UINT32);
pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16);
@ -413,7 +412,7 @@ static void DrvPaletteInit()
r = ((i >> 5) & 1) * (153*192/255) + ((i >> 4) & 1) * (102*192/255) + ((i & 0x30) ? 63 : 0);
g = ((i >> 3) & 1) * (156*192/255) + ((i >> 2) & 1) * (99*192/255) + ((i & 0x0c) ? 63 : 0);
b = ((i >> 1) & 1) * 192 + ((i >> 0) & 1) * 63;
tpal[i] = (r << 16) | (g << 8) | b;
tpal[i] = BurnHighCol(r,g,b,0);
}
for (INT32 i = 0; i < (1 << 13); i++)
@ -445,7 +444,7 @@ static void DrvPaletteInit()
INT32 t = (rhi << 5) | (rlo << 4) | (ghi << 3) | (glo << 2) | (bhi << 1) | bbase;
Palette[i] = tpal[t];
DrvPalette[i] = tpal[t];
}
}
@ -536,10 +535,8 @@ static inline void update_flip_state()
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x2000; i++) {
INT32 d = Palette[i];
DrvPalette[i] = BurnHighCol(d >> 16, (d >> 8) & 0xff, d & 0xff, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}
update_flip_state();

View File

@ -24,7 +24,6 @@ static UINT8 *DrvVidRAM;
static UINT8 *DrvTxtRAM;
static UINT8 *DrvSprRAM;
static UINT32 *Palette;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc;
@ -345,7 +344,6 @@ static INT32 MemIndex()
DrvColPROM = Next; Next += 0x001000;
Palette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x0800 * sizeof(UINT32);
AllRam = Next;
@ -396,9 +394,8 @@ static void DrvPaletteInit()
bit3 = (DrvColPROM[0x000 + i] >> 7) & 0x01;
INT32 b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
Palette[i] = (r << 16) | (g << 8) | b;
DrvPalette[i] = BurnHighCol(r,g,b,0);
}
DrvRecalc = 1;
}
static void DrvGfxExpand()
@ -671,10 +668,7 @@ static void draw_sprites(INT32 prio)
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x800; i++) {
INT32 p = Palette[i];
DrvPalette[i] = BurnHighCol(p >> 16, p >> 8, p, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}

View File

@ -31,7 +31,6 @@ static UINT8 *DrvZ80RAM;
static UINT8 *DrvSprBuf;
static UINT32 *DrvPalette;
static UINT32 *Palette;
static UINT8 DrvRecalc;
@ -156,7 +155,6 @@ static void bionicc_palette_write(INT32 offset)
b = b * (0x07 + bright) / 0x0e;
}
Palette[offset] = (r << 16) | (g << 8) | b;
DrvPalette[offset] = BurnHighCol(r, g, b, 0);
}
@ -164,11 +162,8 @@ void __fastcall bionicc_write_byte(UINT32 address, UINT8 data)
{
if ((address & 0xfffff800) == 0xff8000) {
address &= 0x7ff;
DrvPalRAM[address ^ 1] = data;
bionicc_palette_write(address);
return;
}
@ -311,8 +306,6 @@ static INT32 MemIndex()
DrvZ80RAM = Next; Next += 0x0000800;
Palette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32);
RamEnd = Next;
MemEnd = Next;
@ -522,10 +515,10 @@ static void draw_foreground(INT32 priority)
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x400; i++) {
INT32 rgb = Palette[i];
DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0);
for (INT32 i = 0; i < 0x800; i+=2) {
bionicc_palette_write(i);
}
DrvRecalc = 0;
}
memset (pTransDraw, 0, nScreenHeight * nScreenWidth * 2);

View File

@ -18,7 +18,7 @@ static UINT8 *DrvZ80ROM;
static UINT8 *DrvColPROM;
static UINT8 *DrvZ80RAM;
static UINT8 *DrvVidRAM;
static UINT32 *Palette;
static UINT32 *DrvPalette;
static INT16* pAY8910Buffer[3];
@ -404,7 +404,7 @@ static INT32 DrvDoReset(INT32 full_reset)
return 0;
}
static void DrvPaletteInit(INT32 num)
static void DrvColPromInit(INT32 num)
{
UINT8 prom[32] = { // in case the set lacks a prom dump
0x00, 0xE1, 0xC3, 0xFC, 0xEC, 0xF8, 0x34, 0xFF,
@ -416,9 +416,13 @@ static void DrvPaletteInit(INT32 num)
memcpy (DrvColPROM, prom, 32);
BurnLoadRom(DrvColPROM, num, 1);
}
static void DrvPaletteInit()
{
for (INT32 i = 0; i < 0x20; i++) {
Palette[i] = BITSWAP24(DrvColPROM[i], 7,6,5,7,6,6,7,5,4,3,2,4,3,3,4,2,1,0,1,0,1,1,0,1);
UINT32 p = BITSWAP24(DrvColPROM[i], 7,6,5,7,6,6,7,5,4,3,2,4,3,3,4,2,1,0,1,0,1,1,0,1);
DrvPalette[i] = BurnHighCol((p >> 16) & 0xff, (p >> 8) & 0xff, p & 0xff, 0);
}
}
@ -445,7 +449,6 @@ static INT32 MemIndex()
DrvColPROM = Next; Next += 0x000020;
Palette = (UINT32*)Next; Next += 0x0020 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x0020 * sizeof(UINT32);
pAY8910Buffer[0] = (INT16 *)Next; Next += nBurnSoundLen * sizeof(INT16);
@ -487,7 +490,8 @@ static INT32 DrvInit()
if (BurnLoadRom(DrvZ80ROM + 0x6000, 6, 1)) return 1;
if (BurnLoadRom(DrvZ80ROM + 0x7000, 7, 1)) return 1;
DrvPaletteInit(8);
DrvColPromInit(8);
DrvPaletteInit();
}
ZetInit(0);
@ -529,7 +533,8 @@ static INT32 DealerInit()
if (BurnLoadRom(DrvZ80ROM + 0x4000, 2, 1)) return 1;
if (BurnLoadRom(DrvZ80ROM + 0x6000, 3, 1)) return 1;
DrvPaletteInit(4);
DrvColPromInit(4);
DrvPaletteInit();
DealerDecode();
}
@ -580,16 +585,7 @@ static INT32 DrvExit()
static INT32 DrvDraw()
{
if (DrvRecalc) {
UINT8 r,g,b;
for (INT32 i = 0; i < 0x20; i++) {
INT32 rgb = Palette[i];
r = (rgb >> 16) & 0xff;
g = (rgb >> 8) & 0xff;
b = (rgb >> 0) & 0xff;
DrvPalette[i] = BurnHighCol(r, g, b, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}

View File

@ -12,7 +12,7 @@ extern "C" {
static UINT8 *Mem, *MemEnd;
static UINT8 *Rom0, *Rom1, *Gfx0, *Gfx1, *Gfx2, *Gfx3, *Gfx4, *Prom;
static INT16 *pAY8910Buffer[3], *pFMBuffer = NULL;
static UINT32 *Palette, *DrvPalette;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc;
static UINT8 *fg_tile_transp;
@ -273,7 +273,6 @@ static INT32 MemIndex()
fg_tile_transp = Next; Next += 0x00100;
Palette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x00400 * sizeof(UINT32);
pFMBuffer = (INT16*)Next; Next += (nBurnSoundLen * 3 * sizeof(INT16));
@ -283,43 +282,27 @@ static INT32 MemIndex()
return 0;
}
static INT32 PaletteInit()
static INT32 DrvPaletteInit()
{
UINT32 *tmp = (UINT32*)BurnMalloc(0x100 * sizeof(UINT32));
if (tmp == NULL) {
return 1;
UINT32 tmp[0x100];
for (INT32 i = 0; i < 0x100; i++)
{
int r = Prom[i + 0x000] & 0xf;
int g = Prom[i + 0x100] & 0xf;
int b = Prom[i + 0x200] & 0xf;
tmp[i] = BurnHighCol((r*16)+r,(g*16)+g,(b*16)+b, 0);
}
for (INT32 i = 0; i < 0x100; i++)
{
INT32 r = Prom[i + 0x000];
INT32 g = Prom[i + 0x100];
INT32 b = Prom[i + 0x200];
tmp[i] = (r << 20) | (r << 16) | (g << 12) | (g << 8) | (b << 4) | b;
DrvPalette[i + 0x000] = tmp[Prom[i + 0x300] | 0xc0];
DrvPalette[i + 0x100] = tmp[Prom[i + 0x400]];
DrvPalette[i + 0x200] = tmp[Prom[i + 0x500] | 0x40];
DrvPalette[i + 0x300] = tmp[Prom[i + 0x600] | (Prom[i + 0x700] << 4) | 0x80];
}
Prom += 0x300;
for (INT32 i = 0; i < 0x100; i++) {
Palette[i] = tmp[Prom[i] | 0xc0];
}
for (INT32 i = 0x100; i < 0x200; i++) {
Palette[i] = tmp[Prom[i] | 0x00];
}
for (INT32 i = 0x200; i < 0x300; i++) {
Palette[i] = tmp[Prom[i] | 0x40];
}
for (INT32 i = 0x300; i < 0x400; i++) {
INT32 entry = Prom[i] | (Prom[i + 0x100] << 4) | 0x80;
Palette[i] = tmp[entry];
}
BurnFree (tmp);
return 0;
}
@ -403,7 +386,7 @@ static INT32 DrvInit()
}
if (GraphicsDecode()) return 1;
if (PaletteInit()) return 1;
if (DrvPaletteInit()) return 1;
}
ZetInit(0);
@ -459,7 +442,7 @@ static INT32 DrvExit()
Mem = MemEnd = Rom0 = Rom1 = NULL;
Gfx0 = Gfx1 = Gfx2 = Gfx3 = Gfx4 = Prom = NULL;
for (INT32 i = 0; i < 3; i++) pAY8910Buffer[i] = NULL;
Palette = DrvPalette = NULL;
DrvPalette = NULL;
fg_tile_transp = NULL;
pFMBuffer = NULL;
DrvRecalc = 0;
@ -510,7 +493,7 @@ static inline void draw_8x8(INT32 sx, INT32 sy, INT32 code, INT32 color)
if (y < 0 || x < 0 || y >= nScreenHeight || x >= nScreenWidth) continue;
INT32 pxl = color | *src;
if (Prom[pxl] == 0x0f) continue;
if (Prom[pxl+0x300] == 0x0f) continue;
pTransDraw[(y * nScreenWidth) + x] = pxl;
}
@ -520,10 +503,8 @@ static inline void draw_8x8(INT32 sx, INT32 sy, INT32 code, INT32 color)
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x400; i++) {
INT32 col = Palette[i];
DrvPalette[i] = BurnHighCol(col >> 16, col >> 8, col, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}
if (exedexes_bg_enable)

View File

@ -8,7 +8,7 @@
static UINT8 *Mem, *MemEnd, *Rom0, *Rom1, *Ram;
static UINT8 *Gfx0, *Gfx1, *Gfx2, *Gfx3, *Prom;
static UINT8 DrvJoy1[8], DrvJoy2[8], DrvJoy3[8], DrvDips[2], DrvReset;
static UINT32 *Palette, *DrvPal;
static UINT32 *DrvPalette;
static UINT8 DrvCalcPal;
static UINT8 *SprTrnsp;
@ -20,7 +20,6 @@ static UINT8 sprite3bank;
static UINT8 chon, bgon, objon;
static UINT8 gunsmoke_scrollx[2], gunsmoke_scrolly;
static struct BurnInputInfo DrvInputList[] = {
{"P1 Coin" , BIT_DIGITAL , DrvJoy1 + 6, "p1 coin" },
{"P1 start" , BIT_DIGITAL , DrvJoy1 + 0, "p1 start" },
@ -293,35 +292,24 @@ static INT32 DrvDoReset()
return 0;
}
static INT32 gunsmoke_palette_init()
static INT32 DrvPaletteInit()
{
INT32 i, ctabentry;
UINT32 tmp[0x100];
for (i = 0; i < 0x100; i++)
for (INT32 i = 0; i < 0x100; i++)
{
UINT8 r, g, b;
UINT8 r = Prom[i + 0x000] & 0x0f;
UINT8 g = Prom[i + 0x100] & 0x0f;
UINT8 b = Prom[i + 0x200] & 0x0f;
r = Prom[i + 0x000] & 0x0f;
r |= r << 4;
g = Prom[i + 0x100] & 0x0f;
g |= g << 4;
b = Prom[i + 0x200] & 0x0f;
b |= b << 4;
tmp[i] = (r << 16) | (g << 8) | b;
tmp[i] = BurnHighCol((r*16)+r,(g*16)+g,(b*16)+b,0);
}
for (i = 0; i < 0x100; i++)
for (INT32 i = 0; i < 0x100; i++)
{
ctabentry = Prom[0x300 + i] | 0x40;
Palette[0x000 + i] = tmp[ctabentry];
ctabentry = Prom[0x400 + i] | ((Prom[0x500 + i] & 0x03) << 4);
Palette[0x100 + i] = tmp[ctabentry];
ctabentry = Prom[0x600 + i] | ((Prom[0x700 + i] & 0x07) << 4) | 0x80;
Palette[0x200 + i] = tmp[ctabentry];
DrvPalette[0x000 + i] = tmp[Prom[0x300 + i] | 0x40];
DrvPalette[0x100 + i] = tmp[Prom[0x400 + i] | ((Prom[0x500 + i] & 0x03) << 4)];
DrvPalette[0x200 + i] = tmp[Prom[0x600 + i] | ((Prom[0x700 + i] & 0x07) << 4) | 0x80];
}
return 0;
@ -381,7 +369,6 @@ static double gunsmokeGetTime()
return (double)ZetTotalCycles() / 3000000;
}
static INT32 MemIndex()
{
UINT8 *Next; Next = Mem;
@ -397,10 +384,9 @@ static INT32 MemIndex()
SprTrnsp = Next; Next += 0x00800;
Palette = (UINT32*)Next; Next += 0x00300 * sizeof(UINT32);
DrvPal = (UINT32*)Next; Next += 0x00300 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x00300 * sizeof(UINT32);
MemEnd = Next;
MemEnd = Next;
return 0;
}
@ -434,7 +420,7 @@ static INT32 DrvInit()
}
gunsmoke_gfx_decode();
gunsmoke_palette_init();
DrvPaletteInit();
}
ZetInit(0);
@ -495,7 +481,7 @@ static INT32 DrvExit()
Mem = MemEnd = Rom0 = Rom1 = Ram = NULL;
Gfx0 = Gfx1 = Gfx2 = Gfx3 = Prom = NULL;
SprTrnsp = NULL;
Palette = DrvPal = NULL;
DrvPalette = NULL;
soundlatch = flipscreen = nGunsmokeBank = 0;
@ -581,7 +567,7 @@ static void draw_fg_layer()
for (INT32 x = sx + 7; x >= sx; x--, src++)
{
if (y < 0 || x < 0 || y > 223 || x > 255) continue;
if (!Palette[color|*src]) continue;
if (!DrvPalette[color|*src]) continue;
pTransDraw[(y << 8) | x] = color | *src;
}
@ -594,7 +580,7 @@ static void draw_fg_layer()
for (INT32 x = sx; x < sx + 8; x++, src++)
{
if (y < 0 || x < 0 || y > 223 || x > 255) continue;
if (!Palette[color|*src]) continue;
if (!DrvPalette[color|*src]) continue;
pTransDraw[(y << 8) | x] = color | *src;
}
@ -651,12 +637,8 @@ static void draw_sprites()
static INT32 DrvDraw()
{
// Recalculate palette
if (DrvCalcPal) {
for (INT32 i = 0; i < 0x300; i++) {
UINT32 col = Palette[i];
DrvPal[i] = BurnHighCol(col >> 16, col >> 8, col, 0);
}
DrvPaletteInit();
DrvCalcPal = 0;
}
@ -666,7 +648,7 @@ static INT32 DrvDraw()
if (objon) draw_sprites();
if (chon) draw_fg_layer();
BurnTransferCopy(DrvPal);
BurnTransferCopy(DrvPalette);
return 0;
}

View File

@ -10,7 +10,7 @@ extern "C" {
static UINT8 *Mem, *MemEnd, *Rom, *Gfx0, *Gfx1, *Prom;
static INT16 *pAY8910Buffer[6], *pFMBuffer = NULL;
static UINT32 *DrvPalette, *Palette;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc = 0;
static UINT8 DrvJoy1[8], DrvJoy2[8], DrvJoy3[8], DrvDips[3], DrvReset;
@ -189,7 +189,6 @@ static INT32 MemIndex()
Gfx1 = Next; Next += 0x08000;
Prom = Next; Next += 0x00300;
Palette = (UINT32*)Next; Next += 0x00180 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x00180 * sizeof(UINT32);
pFMBuffer = (INT16*)Next; Next += (nBurnSoundLen * 6 * sizeof(INT16));
@ -237,17 +236,15 @@ static void DrvPaletteInit()
bit2 = (Prom[i] >> 7) & 1;
INT32 b = 0x47 * bit1 + 0x97 * bit2;
tmp[i] = (r << 16) | (g << 8) | b;
tmp[i] = BurnHighCol(r,g,b,0);
}
Prom += 0x100;
for (INT32 i = 0; i < 0x80; i++) {
Palette[i] = tmp[Prom[i] & 0x0f];
DrvPalette[i] = tmp[Prom[i+0x100] & 0x0f];
}
for (INT32 i = 0x80; i < 0x180; i++) {
Palette[i] = tmp[(Prom[i + 0x80] & 0x0f) | 0x10];
DrvPalette[i] = tmp[(Prom[i + 0x180] & 0x0f) | 0x10];
}
}
@ -344,7 +341,7 @@ static INT32 DrvExit()
BurnFree (Mem);
Mem = MemEnd = Rom = Gfx0 = Gfx1 = Prom = NULL;
DrvPalette = Palette = NULL;
DrvPalette = NULL;
pFMBuffer = NULL;
for (INT32 i = 0; i < 6; i++) {
@ -361,10 +358,8 @@ static INT32 DrvExit()
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x100; i++) {
INT32 color = Palette[i];
DrvPalette[i] = BurnHighCol(color >> 16, color >> 8, color, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}
for (INT32 offs = 0x40; offs < 0x3c0; offs++)

View File

@ -19,9 +19,10 @@ static UINT8 *DrvZ80RAM0;
static UINT8 *DrvShareRAM;
static UINT8 *DrvSprRAM;
static UINT8 *DrvVidRAM;
static UINT32 *DrvPalette;
static UINT32 *Palette;
static UINT8 *DrvTransMask;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc;
static UINT8 DrvReset;
@ -193,38 +194,29 @@ static INT32 DrvDoReset()
static void DrvPaletteInit()
{
UINT32 *tmp = (UINT32*)BurnMalloc(0x100 * sizeof(UINT32));
UINT32 tmp[0x100];
for (INT32 i = 0; i < 0x100; i++)
{
UINT8 r, g, b;
UINT8 r = DrvColPROM[i + 0x000] & 0x0f;
UINT8 g = DrvColPROM[i + 0x100] & 0x0f;
UINT8 b = DrvColPROM[i + 0x200] & 0x0f;
r = DrvColPROM[i + 0x000] & 0x0f;
g = DrvColPROM[i + 0x100] & 0x0f;
b = DrvColPROM[i + 0x200] & 0x0f;
tmp[i] = (r << 20) | (r << 16) | (g << 12) | (g << 8) | (b << 4) | b;
tmp[i] = BurnHighCol((r*16)+r, (g*16)+g, (b*16)+b, 0);
}
DrvColPROM += 0x300;
memset (DrvTransMask, 1, 0x200);
for (INT32 i = 0; i < 0x200; i++)
{
UINT16 ctabentry = DrvColPROM[i] ^ 0xff;
UINT16 ctabentry = DrvColPROM[i+0x300] ^ 0xff;
if ((i & 0x07) == 0x07 && ctabentry == 0) DrvTransMask[i] = 0;
if ((i & 0x07) == 0x00) DrvTransMask[i] = 0; // Seems to work...
Palette[i] = tmp[ctabentry];
DrvPalette[i+0x000] = tmp[ctabentry];
DrvPalette[i+0x200] = tmp[DrvColPROM[i+0x500]];
}
for (INT32 i = 0x200; i < 0x400; i++) {
Palette[i] = tmp[DrvColPROM[i]];
}
BurnFree(tmp);
}
static INT32 DrvGfxDecode()
@ -265,7 +257,6 @@ static INT32 MemIndex()
DrvVidAttr = Next; Next += 0x000100;
DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32);
Palette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32);
DrvGfxROM0 = Next; Next += 0x020000;
DrvGfxROM1 = Next; Next += 0x020000;
@ -480,10 +471,8 @@ static void draw_bg_layer(INT32 prio)
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x400; i++) {
INT32 rgb = Palette[i];
DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}
draw_bg_layer(0);

View File

@ -1073,7 +1073,7 @@ static INT32 DrvDraw()
{
for (INT32 i = 0; i < 0x100; i++) {
UINT32 col = Palette[i];
DrvPal[i] = BurnHighCol(col >> 16, col >> 8, col, 0);
DrvPal[i] = BurnHighCol((col >> 16) & 0xff, (col >> 8) & 0xff, col & 0xff, 0);
}
DrvCalcPal = 0;
}
@ -1901,6 +1901,9 @@ struct BurnDriver BurnDrvstriv = {
224, 256, 3, 4
};
// Super Triv (set 2)
static struct BurnRomInfo striv2RomDesc[] = {
{ "s.triv_p1.2f", 0x1000, 0xdcf5da6e, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 #0 Code
{ "s.triv_p2.3f", 0x1000, 0x921610ba, 1 | BRF_PRG | BRF_ESS }, // 1

View File

@ -13,7 +13,6 @@ static UINT8 *DrvZ80RAM0;
static UINT8 *DrvZ80RAM1;
static UINT8 *DrvGfxROM;
static UINT32 *DrvPalette;
static UINT32 *Palette;
static UINT8 DrvRecalc;
static UINT32 *DrvVidRAM32;
@ -112,7 +111,6 @@ static struct BurnDIPInfo DrvDIPList[]=
STDDIPINFO(Drv)
static void videoram_write(UINT16 offset, UINT8 data, UINT8 mask)
{
UINT32 expdata, layermask;
@ -211,13 +209,7 @@ void __fastcall kangaroo_main_write(UINT16 address, UINT8 data)
case 0xed00:
// coin counter
return;
}
if (address > 0x5fff) bprintf (PRINT_NORMAL, _T("%4.4x, %2.2x wm\n"), address, data);
return;
}
}
UINT8 __fastcall kangaroo_main_read(UINT16 address)
@ -268,8 +260,6 @@ UINT8 __fastcall kangaroo_main_read(UINT16 address)
case 0xef00:
return ++kangaroo_clock & 0x0f;
}
bprintf (PRINT_NORMAL, _T("%4.4x, rm\n"), address);
return 0;
}
@ -282,8 +272,6 @@ UINT8 __fastcall kangaroo_sound_read(UINT16 address)
return soundlatch;
}
bprintf (PRINT_NORMAL, _T("%4.4x, rs\n"), address);
return 0;
}
@ -299,10 +287,6 @@ void __fastcall kangaroo_sound_write(UINT16 address, UINT8 data)
AY8910Write(0, 0, data);
return;
}
bprintf (PRINT_NORMAL, _T("%4.4x, %2.2x ws\n"), address, data);
return;
}
static INT32 MemIndex()
@ -315,7 +299,6 @@ static INT32 MemIndex()
DrvZ80ROM1 = Next; Next += 0x01000;
DrvGfxROM = Next; Next += 0x04000;
Palette = (UINT32*)Next; Next += 0x00008 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x00008 * sizeof(UINT32);
AllRAM = Next;
@ -336,6 +319,13 @@ static INT32 MemIndex()
return 0;
}
static void DrvPaletteInit()
{
for (INT32 i = 0; i < 8; i++) {
DrvPalette[i] = BurnHighCol((i & 4) ? 0xff : 0, (i & 2) ? 0xff : 0, (i & 1) ? 0xff : 0, 0);
}
}
static INT32 DrvDoReset()
{
DrvReset = 0;
@ -395,9 +385,7 @@ static INT32 DrvInit()
if (BurnLoadRom(DrvZ80ROM1, 4, 0)) return 1;
}
for (INT32 i = 0; i < 8; i++)
Palette[i] = ((i & 4 ? 0xff : 0) << 16) | ((i & 2 ? 0xff : 0) << 8) | (i & 1 ? 0xff : 0);
DrvPaletteInit();
ZetInit(0);
ZetOpen(0);
@ -467,10 +455,8 @@ static INT32 DrvDraw()
INT32 x, y;
if (DrvRecalc) {
for (x = 0; x < 8; x++) {
UINT32 col = Palette[x];
DrvPalette[x] = BurnHighCol(col >> 16, col >> 8, col, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}
// iterate over pixels

View File

@ -25,7 +25,6 @@ static UINT8 *DrvVidRAM;
static UINT8 *DrvSprRAM;
static UINT8 *DrvGridRAM;
static UINT32 *Palette;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc;
@ -546,7 +545,6 @@ static INT32 MemIndex()
DrvColPROM = Next; Next += 0x000040;
Palette = (UINT32*)Next; Next += 0x0082 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x0082 * sizeof(UINT32);
AllRam = Next;
@ -608,6 +606,8 @@ static INT32 DrvGfxDecode()
static void DrvPaletteInit(INT32 sh0, INT32 sh1, INT32 sh2, INT32 sh3, INT32 sh4, INT32 sh5)
{
UINT32 tmp[0x20];
for (INT32 i = 0; i < 0x20; i++)
{
INT32 bit0 = (~DrvColPROM[i] >> sh0) & 0x01;
@ -622,14 +622,14 @@ static void DrvPaletteInit(INT32 sh0, INT32 sh1, INT32 sh2, INT32 sh3, INT32 sh4
bit1 = (~DrvColPROM[i] >> sh5) & 0x01;
INT32 b = bit0 * 82 + bit1 * 173;
DrvPalette[i] = (r << 16) | (g << 8) | b;
tmp[i] = BurnHighCol(r,g,b,0);
}
for (INT32 i = 0; i < 0x20; i++)
{
Palette[i + 0x00] = DrvPalette[((i << 3) & 0x18) | ((i >> 2) & 0x07)];
Palette[i + 0x20] = DrvPalette[BITSWAP08(DrvColPROM[i + 0x20] & 0x0f, 7,6,5,4,0,1,2,3)];
Palette[i + 0x40] = DrvPalette[BITSWAP08(DrvColPROM[i + 0x20] >> 4, 7,6,5,4,0,1,2,3)];
DrvPalette[i + 0x00] = tmp[((i << 3) & 0x18) | ((i >> 2) & 0x07)];
DrvPalette[i + 0x20] = tmp[BITSWAP08(DrvColPROM[i + 0x20] & 0x0f, 7,6,5,4,0,1,2,3)];
DrvPalette[i + 0x40] = tmp[BITSWAP08(DrvColPROM[i + 0x20] >> 4, 7,6,5,4,0,1,2,3)];
}
DrvRecalc = 1;
@ -652,7 +652,7 @@ static void SraiderPaletteInit()
bit0 = (i >> 0) & 0x01;
INT32 r = 0x47 * bit0;
Palette[i + 0x60] = (r << 16) | (g << 8) | b;
DrvPalette[i + 0x60] = BurnHighCol(r,g,b,0);
}
}
@ -1070,10 +1070,7 @@ static void redclash_draw_stars(INT32 palette_offset, INT32 sraider, INT32 first
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x60; i++) {
INT32 d = Palette[i];
DrvPalette[i] = BurnHighCol(d >> 16, d >> 8, d, 0);
}
DrvPaletteInit(0, 5, 2, 6, 4, 7);
DrvRecalc = 0;
}
@ -1091,10 +1088,7 @@ static INT32 DrvDraw()
static INT32 SraiderDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x80; i++) {
INT32 d = Palette[i];
DrvPalette[i] = BurnHighCol(d >> 16, d >> 8, d, 0);
}
SraiderPaletteInit();
DrvRecalc = 0;
}

View File

@ -19,7 +19,6 @@ static UINT8 *DrvVidRAM;
static UINT8 *DrvSprRAM;
static UINT8 *DrvShareRAM;
static UINT32 *Palette;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc;
@ -207,7 +206,6 @@ static INT32 MemIndex()
DrvColPROM = Next; Next += 0x000700;
Palette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x0400 * sizeof(UINT32);
AllRam = Next;
@ -251,20 +249,20 @@ static INT32 DrvGfxDecode()
static void DrvPaletteInit()
{
UINT32 tmp[0x100];
for (INT32 i = 0; i < 0x100; i++)
{
INT32 r = DrvColPROM[i + 0x000] & 0x0f;
INT32 g = DrvColPROM[i + 0x100] & 0x0f;
INT32 b = DrvColPROM[i + 0x200] & 0x0f;
DrvPalette[i] = (r << 20) | (r << 16) | (g << 12) | (g << 8) | (b << 4) | (b << 0);
tmp[i] = BurnHighCol((r*16)+r, (g*16)+g, (b*16)+b, 0);
}
for (INT32 i = 0; i < 0x400; i++) {
Palette[i] = DrvPalette[DrvColPROM[0x300 + i]];
DrvPalette[i] = tmp[DrvColPROM[0x300 + i]];
}
DrvRecalc = 1;
}
static INT32 DrvInit()
@ -406,10 +404,7 @@ static void draw_sprites()
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x400; i++) {
INT32 d = Palette[i];
DrvPalette[i] = BurnHighCol(d >> 16, (d >> 8) & 0xff, d & 0xff, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}

View File

@ -376,7 +376,7 @@ static INT32 DrvDraw()
else
pos = y * 320 + x;
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0));
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0));
}
}
}

View File

@ -219,7 +219,7 @@ static void mrdo_palette_init()
bits2 = (Prom[a2] >> 4) & 0x03;
b = weight[bits0 + (bits2 << 2)];
Palette[i] = (r << 16) | (g << 8) | b;
Palette[i] = BurnHighCol(r,g,b,0);
}
for (INT32 i = 0; i < 0x40; i++)
@ -361,7 +361,7 @@ static void draw_sprites()
INT32 pxl = Palette[color | *src];
PutPix(pBurnDraw + ((y * 240) + x) * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0));
PutPix(pBurnDraw + ((y * 240) + x) * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0));
}
} else {
for (INT32 x = sx; x < sx + 16; x++, src++)
@ -371,7 +371,7 @@ static void draw_sprites()
INT32 pxl = Palette[color | *src];
PutPix(pBurnDraw + ((y * 240) + x) * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0));
PutPix(pBurnDraw + ((y * 240) + x) * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0));
}
}
}
@ -387,7 +387,7 @@ static void draw_sprites()
INT32 pxl = Palette[color | *src];
PutPix(pBurnDraw + ((y * 240) + x) * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0));
PutPix(pBurnDraw + ((y * 240) + x) * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0));
}
} else {
for (INT32 x = sx; x < sx + 16; x++, src++)
@ -397,7 +397,7 @@ static void draw_sprites()
INT32 pxl = Palette[color | *src];
PutPix(pBurnDraw + ((y * 240) + x) * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0));
PutPix(pBurnDraw + ((y * 240) + x) * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0));
}
}
}
@ -437,7 +437,7 @@ static void draw_8x8_tiles(UINT8 *vram, UINT8 *gfx_base, INT32 scrollx, INT32 sc
INT32 pos = y * 240 + x;
if (flipscreen) pos = (192 - y) * 240 + (240 - x);
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0));
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0));
}
}
}

View File

@ -420,7 +420,7 @@ static INT32 DrvDraw()
{
INT32 pxl = Palette[*src];
PutPix(pBurnDraw + ((y << 8) | x) * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0));
PutPix(pBurnDraw + ((y << 8) | x) * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0));
}
}
}
@ -442,7 +442,7 @@ static INT32 DrvDraw()
INT32 pxl = Palette[0x10|*src];
PutPix(pBurnDraw + ((y << 8) | x) * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0));
PutPix(pBurnDraw + ((y << 8) | x) * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0));
}
}
}

View File

@ -373,7 +373,7 @@ static INT32 DrawChars(INT32 priority)
else
pos = (y << 8) | (x & 0xff);
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0));
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, (pxl)&0xff, 0));
}
}
}
@ -423,7 +423,7 @@ static INT32 DrvDraw()
else
pos = (y << 8) | (x & 0xff);
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0));
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0));
}
} else {
for (INT32 x = sx; x < sx + 16; x++, src++)
@ -437,7 +437,7 @@ static INT32 DrvDraw()
else
pos = (y << 8) | (x & 0xff);
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0));
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0));
}
}
}
@ -457,7 +457,7 @@ static INT32 DrvDraw()
else
pos = (y << 8) | (x & 0xff);
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0));
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0));
}
} else {
for (INT32 x = sx; x < sx + 16; x++, src++)
@ -471,7 +471,7 @@ static INT32 DrvDraw()
else
pos = (y << 8) | (x & 0xff);
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol(pxl >> 16, pxl >> 8, pxl, 0));
PutPix(pBurnDraw + pos * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0));
}
}
}

View File

@ -117,7 +117,8 @@ static INT32 DrvDraw()
dirty = 0;
for (x = 0; x < 320 * 200; x++) {
PutPix(pBurnDraw + x * nBurnBpp, BurnHighCol(src[x]>>16, src[x]>>8, src[x], 0));
UINT32 pxl = src[x];
PutPix(pBurnDraw + x * nBurnBpp, BurnHighCol((pxl >> 16)&0xff, (pxl >> 8)&0xff, pxl&0xff, 0));
}
return 0;

View File

@ -551,9 +551,9 @@ static INT32 DrvDraw()
}
if (flipscreen)
PutPix(pBurnDraw + ((x << 8) | (y ^ 0xff)) * nBurnBpp, BurnHighCol(pen>>16, pen>>8, pen, 0));
PutPix(pBurnDraw + ((x << 8) | (y ^ 0xff)) * nBurnBpp, BurnHighCol((pen>>16)&0xff, (pen>>8)&0xff, (pen)&0xff, 0));
else
PutPix(pBurnDraw + (((x ^ 0xff) << 8) | y) * nBurnBpp, BurnHighCol(pen>>16, pen>>8, pen, 0));
PutPix(pBurnDraw + (((x ^ 0xff) << 8) | y) * nBurnBpp, BurnHighCol((pen>>16)&0xff, (pen>>8)&0xff, (pen)&0xff, 0));
x += 1;
d1 >>= 1;

View File

@ -22,7 +22,7 @@ static UINT8 *Gfx3;
static UINT8 *Gfx4;
static UINT8 *Gfx1Trans;
static UINT8 *Gfx3Trans;
static UINT32 *Palette;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc;
@ -410,18 +410,15 @@ static void protection_w()
}
}
static inline void write_palette(UINT16 data, INT32 offset)
static inline void palette_update(INT32 offset)
{
UINT16 data = *((UINT16*)(Drv68kPalRam + (offset & 0x7fe)));
INT32 r = (data >> 8) & 0x0f;
INT32 g = (data >> 4) & 0x0f;
INT32 b = (data >> 0) & 0x0f;
r |= r << 4;
g |= g << 4;
b |= b << 4;
Palette[offset] = (r << 16) | (g << 8) | b;
DrvPalette[offset] = BurnHighCol(r, g, b, 0);
DrvPalette[(offset & 0x7fe)/2] = BurnHighCol((r*16)+r, (g*16)+g, (b*16)+b, 0);
}
void __fastcall sf_write_word(UINT32 address, UINT16 data)
@ -431,7 +428,7 @@ void __fastcall sf_write_word(UINT32 address, UINT16 data)
*pal = data;
write_palette(*pal, (address >> 1) & 0x3ff);
palette_update(address);
return;
}
@ -736,8 +733,6 @@ static INT32 MemIndex()
DrvZ80Ram0 = Next; Next += 0x000800;
Palette = (UINT32*)Next; Next += 0x00401 * sizeof(UINT32);
RamEnd = Next;
MemEnd = Next;
@ -869,8 +864,6 @@ static INT32 DrvInit(INT32 initver)
version = initver;
Palette[0x400] = 0xff00ff;
return 0;
}
@ -1147,14 +1140,14 @@ static void draw_sprites()
}
}
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x401; i++) {
INT32 rgb = Palette[i];
DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0);
for (INT32 i = 0; i < 0x800; i+=2) {
palette_update(i);
}
DrvPalette[0x400] = BurnHighCol(0xff,0,0xff,0);
DrvRecalc = 0;
}
if (nBurnLayer & 8) {

View File

@ -18,9 +18,8 @@ static UINT8 *DrvSprRAM;
static UINT8 *DrvZ80RAM0;
static UINT8 *DrvZ80RAM1;
static UINT8 *DrvVidRegs;
static UINT32 *DrvPalette;
static UINT32 *Palette;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc;
static UINT8 DrvJoy1[8];
@ -178,7 +177,6 @@ static INT32 MemIndex()
DrvColPROM = Next; Next += 0x000300;
DrvPalette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32);
Palette = (UINT32*)Next; Next += 0x0200 * sizeof(UINT32);
AllRam = Next;
@ -236,12 +234,12 @@ static void DrvPaletteInit()
bit3 = (DrvColPROM[i + 2*256] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
Palette[i] = (r << 16) | (g << 8) | b;
DrvPalette[i] = BurnHighCol(r,g,b,0);
}
for (INT32 i = 0; i < 256; i++)
{
Palette[i | 0x100] = (i << 16) | (i << 8) | i;
DrvPalette[i | 0x100] = BurnHighCol(i,i,i,0);
}
}
@ -460,10 +458,8 @@ static void draw_background()
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x200; i++) {
INT32 p = Palette[i];
DrvPalette[i] = BurnHighCol(p >> 16, p >> 8, p, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}
for (INT32 offs = 0; offs < nScreenWidth * nScreenHeight; offs++) {

View File

@ -23,7 +23,6 @@ static UINT8 *DrvVidRAM;
static UINT8 *DrvTxtRAM;
static UINT8 *DrvSprRAM;
static UINT32 *Palette;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc;
@ -453,11 +452,11 @@ static void DrvPaletteInit()
INT32 g = DrvColPROM[i + 0x100] & 0x0f;
INT32 b = DrvColPROM[i + 0x200] & 0x0f;
Palette[i] = (r << 20) | (r << 16) | (g << 12) | (g << 8) | (b << 4) | (b << 0);
DrvPalette[i] = BurnHighCol((r*16)+r, (g*16)+g, (b*16)+b, 0);
}
for (INT32 i = 0; i < 0x400; i++) {
Palette[i + 0x100] = Palette[DrvColPROM[0x300 + i]];
DrvPalette[i + 0x100] = DrvPalette[DrvColPROM[0x300 + i]];
}
}
@ -536,7 +535,6 @@ static INT32 MemIndex()
DrvColPROM = Next; Next += 0x000700;
Palette = (UINT32*)Next; Next += 0x0500 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x0500 * sizeof(UINT32);
AllRam = Next;
@ -759,10 +757,7 @@ static void draw_sprites()
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x500; i++) {
INT32 p = Palette[i];
DrvPalette[i] = BurnHighCol(p >> 16, p >> 8, p, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}
@ -865,8 +860,6 @@ static INT32 DrvFrame()
static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
{
// return 1; // Broken :(
struct BurnArea ba;
if (pnMin) {

View File

@ -38,7 +38,6 @@ static UINT8 *DrvGfx0Trans;
static UINT8 *DrvGfx1;
static UINT8 *DrvSnd0;
static UINT32 *Palette;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc;
@ -507,7 +506,6 @@ void pow_paletteram16_word_w(UINT32 address)
g = (g << 3) | (g >> 2);
b = (b << 3) | (b >> 2);
Palette[(address >> 1) & 0x7ff] = (r << 16) | (g << 8) | b;
DrvPalette[(address >> 1) & 0x7ff] = BurnHighCol(r, g, b, 0);
}
@ -804,8 +802,6 @@ static INT32 MemIndex()
DrvZ80Ram = Next; Next += 0x000800;
Palette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32);
RamEnd = Next;
DrvPalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32);
@ -1204,10 +1200,10 @@ static void sar_foreground()
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x800; i++) {
INT32 rgb = Palette[i];
DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0);
for (INT32 i = 0; i < 0x1000; i+=2) {
pow_paletteram16_word_w(i);
}
DrvRecalc = 0;
}
for (INT32 offs = 0; offs < nScreenHeight * nScreenWidth; offs++) {

View File

@ -24,7 +24,6 @@ static UINT8 *DrvColRAM;
static UINT8 *DrvSprRAM;
static UINT8 *DrvScrollX;
static UINT32 *DrvPalette;
static UINT32 *Palette;
static UINT8 DrvRecalc;
static INT16 *pAY8910Buffer[6];
@ -71,7 +70,6 @@ STDINPUTINFO(Sonson)
static struct BurnDIPInfo SonsonDIPList[]=
{
// Default Values
{0x0f, 0xff, 0xff, 0xdf, NULL },
{0x10, 0xff, 0xff, 0xeb, NULL },
@ -280,11 +278,11 @@ static INT32 DrvPaletteInit()
bit3 = (DrvColPROM[i + 0x000] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
tmp[i] = (r << 16) | (g << 8) | b;
tmp[i] = BurnHighCol(r,g,b,0);
}
for (INT32 i = 0; i < 0x200; i++) {
Palette[i] = tmp[(DrvColPROM[0x200 + i] & 0x0f) | ((i >> 4) & 0x10)];
DrvPalette[i] = tmp[(DrvColPROM[0x200 + i] & 0x0f) | ((i >> 4) & 0x10)];
}
BurnFree (tmp);
@ -304,7 +302,6 @@ static INT32 MemIndex()
DrvColPROM = Next; Next += 0x000400;
Palette = (UINT32*)Next; Next += 0x00200 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x00200 * sizeof(UINT32);
AllRam = Next;
@ -351,7 +348,6 @@ static INT32 DrvDoReset()
return 0;
}
static INT32 DrvInit()
{
AllMem = NULL;
@ -524,14 +520,11 @@ static void draw_sprites()
}
}
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x200; i++) {
INT32 rgb = Palette[i];
DrvPalette[i] = BurnHighCol(rgb >> 16, rgb >> 8, rgb, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}
draw_background();

View File

@ -14,7 +14,7 @@ extern "C" {
static UINT8 *Mem, *MemEnd, *Rom0, *Rom1, *Gfx0, *Gfx1, *Gfx2, *Prom;
static UINT8 DrvJoy1[8], DrvJoy2[8], DrvJoy3[8], DrvDips[2], DrvReset;
static INT16 *pAY8910Buffer[6], *pFMBuffer = NULL;
static UINT32 *DrvPalette, *Palette;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc;
static INT32 vulgus_soundlatch;
@ -246,7 +246,6 @@ static INT32 MemIndex()
Gfx2 = Next; Next += 0x10000;
Prom = Next; Next += 0x00600;
Palette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x00800 * sizeof(UINT32);
pFMBuffer = (INT16*)Next; Next += (nBurnSoundLen * 6 * sizeof(INT16));
@ -258,10 +257,7 @@ static INT32 MemIndex()
static INT32 DrvPaletteInit()
{
UINT32 *tmp = (UINT32*)BurnMalloc(0x100 * sizeof(UINT32));
if (tmp == NULL) {
return 1;
}
UINT32 tmp[0x100];
for (INT32 i = 0; i < 256; i++)
{
@ -285,26 +281,24 @@ static INT32 DrvPaletteInit()
bit3 = (Prom[512 + i] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
tmp[i] = (r << 16) | (g << 8) | b;
tmp[i] = BurnHighCol(r,g,b,0);
}
for (INT32 i = 0; i < 0x100; i++) {
Palette[i] = tmp[32 + Prom[0x300 + i]];
DrvPalette[i] = tmp[32 + Prom[0x300 + i]];
}
for (INT32 i = 0; i < 0x100; i++) {
Palette[0x100 + i] = tmp[16 + Prom[0x400 + i]];
DrvPalette[0x100 + i] = tmp[16 + Prom[0x400 + i]];
}
for (INT32 i = 0; i < 0x100; i++) {
Palette[0x400 + i] = tmp[Prom[0x500 + i] + 0x00];
Palette[0x500 + i] = tmp[Prom[0x500 + i] + 0x40];
Palette[0x600 + i] = tmp[Prom[0x500 + i] + 0x80];
Palette[0x700 + i] = tmp[Prom[0x500 + i] + 0xc0];
DrvPalette[0x400 + i] = tmp[Prom[0x500 + i] + 0x00];
DrvPalette[0x500 + i] = tmp[Prom[0x500 + i] + 0x40];
DrvPalette[0x600 + i] = tmp[Prom[0x500 + i] + 0x80];
DrvPalette[0x700 + i] = tmp[Prom[0x500 + i] + 0xc0];
}
BurnFree (tmp);
return 0;
}
@ -438,7 +432,7 @@ static INT32 DrvExit()
pAY8910Buffer[i] = NULL;
}
DrvPalette = Palette = NULL;
DrvPalette = NULL;
DrvRecalc = 0;
@ -453,10 +447,8 @@ static INT32 DrvExit()
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 0x800; i++) {
INT32 color = Palette[i];
DrvPalette[i] = BurnHighCol(color >> 16, color >> 8, color, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}
for (INT32 offs = 0; offs < 0x400; offs++)

View File

@ -18,13 +18,12 @@ static UINT8 *DrvGfxROM;
static UINT8 *DrvColPROM;
static UINT8 *DrvZ80RAM;
static UINT8 *DrvVidRAM;
static UINT32 *Palette;
static UINT32 *DrvPalette;
static UINT8 DrvRecalc;
static INT16 *pAY8910Buffer[3];
static UINT8 DrvRecalc;
static UINT8 DrvJoy1[8];
static UINT8 DrvDips[2];
static UINT16 DrvAxis[1];
@ -193,7 +192,7 @@ static void DrvPaletteInit()
bit7 = (DrvColPROM[i] >> 7) & 0x01;
b = ((54 * bit7) + (84 * bit1) + (115 * bit0));
Palette[i-8] = (r << 16) | (g << 8) | b;
DrvPalette[i-8] = BurnHighCol(r,g,b,0);
}
}
@ -207,7 +206,6 @@ static INT32 MemIndex()
DrvColPROM = Next; Next += 0x000020;
Palette = (UINT32*)Next; Next += 0x0008 * sizeof(UINT32);
DrvPalette = (UINT32*)Next; Next += 0x0008 * sizeof(UINT32);
AllRam = Next;
@ -296,10 +294,8 @@ static INT32 DrvExit()
static INT32 DrvDraw()
{
if (DrvRecalc) {
for (INT32 i = 0; i < 8; i++) {
INT32 d = Palette[i];
DrvPalette[i] = BurnHighCol(d >> 16, (d >> 8) & 0xff, d & 0xff, 0);
}
DrvPaletteInit();
DrvRecalc = 0;
}
for (INT32 offs = 0; offs < 0x400; offs ++)