mirror of
https://github.com/holub/mame
synced 2025-04-25 09:50:04 +03:00
cps1.c: eliminate pointless planar-to-chunky conversion of gfx ROMs, just decode them as-is [Alex Jackson]
This commit is contained in:
parent
ff210e330b
commit
f2838d9332
@ -3095,9 +3095,9 @@ static const gfx_layout cps1_layout8x8 =
|
||||
8,8,
|
||||
RGN_FRAC(1,1),
|
||||
4,
|
||||
{ 0, 1, 2, 3 },
|
||||
{ 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4 },
|
||||
{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64 },
|
||||
{ 24, 16, 8, 0 },
|
||||
{ STEP8(0, 1) },
|
||||
{ STEP8(0, 4*16) },
|
||||
64*8
|
||||
};
|
||||
|
||||
@ -3106,9 +3106,9 @@ static const gfx_layout cps1_layout8x8_2 =
|
||||
8,8,
|
||||
RGN_FRAC(1,1),
|
||||
4,
|
||||
{ 0, 1, 2, 3 },
|
||||
{ 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4 },
|
||||
{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64 },
|
||||
{ 24, 16, 8, 0 },
|
||||
{ STEP8(32, 1) },
|
||||
{ STEP8(0, 4*16) },
|
||||
64*8
|
||||
};
|
||||
|
||||
@ -3117,9 +3117,9 @@ static const gfx_layout cps1_layout16x16 =
|
||||
16,16,
|
||||
RGN_FRAC(1,1),
|
||||
4,
|
||||
{ STEP4(0,1) },
|
||||
{ 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4, 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4 },
|
||||
{ STEP16(0,4*16) },
|
||||
{ 24, 16, 8, 0 },
|
||||
{ STEP8(0, 1), STEP8(32, 1) },
|
||||
{ STEP16(0, 4*16) },
|
||||
4*16*16
|
||||
};
|
||||
|
||||
@ -3128,10 +3128,9 @@ static const gfx_layout cps1_layout32x32 =
|
||||
32,32,
|
||||
RGN_FRAC(1,1),
|
||||
4,
|
||||
{ STEP4(0,1) },
|
||||
{ 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4, 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4,
|
||||
17*4, 16*4, 19*4, 18*4, 21*4, 20*4, 23*4, 22*4, 25*4, 24*4, 27*4, 26*4, 29*4, 28*4, 31*4, 30*4 },
|
||||
{ STEP32(0,4*32) },
|
||||
{ 24, 16, 8, 0 },
|
||||
{ STEP8(0, 1), STEP8(32, 1), STEP8(64, 1), STEP8(96, 1) },
|
||||
{ STEP32(0, 4*32) },
|
||||
4*32*32
|
||||
};
|
||||
|
||||
|
@ -1164,65 +1164,6 @@ static INPUT_PORTS_START( choko )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Graphics layouts
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static const gfx_layout cps1_layout8x8 =
|
||||
{
|
||||
8,8,
|
||||
RGN_FRAC(1,1),
|
||||
4,
|
||||
{ 0, 1, 2, 3 },
|
||||
{ 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4 },
|
||||
{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64 },
|
||||
64*8
|
||||
};
|
||||
|
||||
static const gfx_layout cps1_layout8x8_2 =
|
||||
{
|
||||
8,8,
|
||||
RGN_FRAC(1,1),
|
||||
4,
|
||||
{ 0, 1, 2, 3 },
|
||||
{ 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4 },
|
||||
{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64 },
|
||||
64*8
|
||||
};
|
||||
|
||||
static const gfx_layout layout16x16 =
|
||||
{
|
||||
16,16,
|
||||
RGN_FRAC(1,1),
|
||||
4,
|
||||
{ STEP4(0,1) },
|
||||
{ 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4, 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4 },
|
||||
{ STEP16(0,4*16) },
|
||||
4*16*16
|
||||
};
|
||||
|
||||
static const gfx_layout layout32x32 =
|
||||
{
|
||||
32,32,
|
||||
RGN_FRAC(1,1),
|
||||
4,
|
||||
{ STEP4(0,1) },
|
||||
{ 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4, 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4,
|
||||
17*4, 16*4, 19*4, 18*4, 21*4, 20*4, 23*4, 22*4, 25*4, 24*4, 27*4, 26*4, 29*4, 28*4, 31*4, 30*4 },
|
||||
{ STEP32(0,4*32) },
|
||||
4*32*32
|
||||
};
|
||||
|
||||
static GFXDECODE_START( cps2 )
|
||||
GFXDECODE_ENTRY( "gfx", 0, cps1_layout8x8, 0, 0x100 )
|
||||
GFXDECODE_ENTRY( "gfx", 0, cps1_layout8x8_2, 0, 0x100 )
|
||||
GFXDECODE_ENTRY( "gfx", 0, layout16x16, 0, 0x100 )
|
||||
GFXDECODE_ENTRY( "gfx", 0, layout32x32, 0, 0x100 )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Machine driver
|
||||
@ -1269,7 +1210,7 @@ static MACHINE_CONFIG_START( cps2, cps_state )
|
||||
8MHz / 15.4445kHz = 517.983 ~ 518 -> likely
|
||||
16MHz -> same as 8 but with a /2 divider; also a possibility
|
||||
*/
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", cps2)
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", cps1)
|
||||
MCFG_PALETTE_ADD("palette", 0xc00)
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(cps_state, cps2)
|
||||
|
@ -317,7 +317,6 @@ public:
|
||||
|
||||
/* cps video */
|
||||
void cps1_get_video_base();
|
||||
void cps1_gfx_decode();
|
||||
void unshuffle(UINT64 *buf, int len);
|
||||
void cps2_gfx_decode();
|
||||
int gfxrom_bank_mapper(int type, int code);
|
||||
|
@ -1719,39 +1719,6 @@ WRITE16_MEMBER(cps_state::cps1_cps_b_w)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void cps_state::cps1_gfx_decode()
|
||||
{
|
||||
int size = memregion("gfx")->bytes();
|
||||
int i, j, gfxsize;
|
||||
UINT8 *cps1_gfx = memregion("gfx")->base();
|
||||
|
||||
gfxsize = size / 4;
|
||||
|
||||
for (i = 0; i < gfxsize; i++)
|
||||
{
|
||||
UINT32 src = cps1_gfx[4 * i] + (cps1_gfx[4 * i + 1] << 8) + (cps1_gfx[4 * i + 2] << 16) + (cps1_gfx[4 * i + 3] << 24);
|
||||
UINT32 dwval = 0;
|
||||
|
||||
for (j = 0; j < 8; j++)
|
||||
{
|
||||
int n = 0;
|
||||
UINT32 mask = (0x80808080 >> j) & src;
|
||||
|
||||
if (mask & 0x000000ff) n |= 1;
|
||||
if (mask & 0x0000ff00) n |= 2;
|
||||
if (mask & 0x00ff0000) n |= 4;
|
||||
if (mask & 0xff000000) n |= 8;
|
||||
|
||||
dwval |= n << (j * 4);
|
||||
}
|
||||
cps1_gfx[4 *i ] = dwval >> 0;
|
||||
cps1_gfx[4 *i + 1] = dwval >> 8;
|
||||
cps1_gfx[4 *i + 2] = dwval >> 16;
|
||||
cps1_gfx[4 *i + 3] = dwval >> 24;
|
||||
}
|
||||
}
|
||||
|
||||
void cps_state::unshuffle( UINT64 *buf, int len )
|
||||
{
|
||||
int i;
|
||||
@ -1775,6 +1742,7 @@ void cps_state::unshuffle( UINT64 *buf, int len )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void cps_state::cps2_gfx_decode()
|
||||
{
|
||||
const int banksize = 0x200000;
|
||||
@ -1783,15 +1751,11 @@ void cps_state::cps2_gfx_decode()
|
||||
|
||||
for (i = 0; i < size; i += banksize)
|
||||
unshuffle((UINT64 *)(memregion("gfx")->base() + i), banksize / 8);
|
||||
|
||||
cps1_gfx_decode();
|
||||
}
|
||||
|
||||
|
||||
DRIVER_INIT_MEMBER(cps_state,cps1)
|
||||
{
|
||||
cps1_gfx_decode();
|
||||
|
||||
m_scanline1 = 0;
|
||||
m_scanline2 = 0;
|
||||
m_scancalls = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user