mirror of
https://github.com/holub/mame
synced 2025-04-25 09:50:04 +03:00
Fix lethalen sprite regression; adjust ROM loading so at least some of the mask ROM tests pass (nw)
This commit is contained in:
parent
06f43bd01c
commit
87420b42d6
@ -462,24 +462,6 @@ static INPUT_PORTS_START( lethalene ) /* European region does not have non-engli
|
||||
PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "DSW:4")
|
||||
INPUT_PORTS_END
|
||||
|
||||
static const gfx_layout lethal_6bpp =
|
||||
{
|
||||
16,16,
|
||||
RGN_FRAC(1,2),
|
||||
6,
|
||||
{ RGN_FRAC(1,2)+8,RGN_FRAC(1,2)+0, 8, 0, 24, 16 },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7,
|
||||
8*32+0, 8*32+1, 8*32+2, 8*32+3, 8*32+4, 8*32+5, 8*32+6, 8*32+7 },
|
||||
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
|
||||
16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 },
|
||||
128*8
|
||||
};
|
||||
|
||||
/* we use this decode instead of the one done by the sprite video start due to it being 6bpp */
|
||||
static GFXDECODE_START( lethal )
|
||||
GFXDECODE_ENTRY( "k053244", 0, lethal_6bpp, 0x000/*0x400*/, 256 ) /* sprites tiles */
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
/* sound */
|
||||
|
||||
@ -511,7 +493,7 @@ void lethal_state::machine_reset()
|
||||
|
||||
static const k056832_interface lethalen_k056832_intf =
|
||||
{
|
||||
"gfx1", 1,
|
||||
"gfx1", 0,
|
||||
K056832_BPP_8LE,
|
||||
1, 0,
|
||||
KONAMI_ROM_DEINTERLEAVE_NONE,
|
||||
@ -538,7 +520,7 @@ static MACHINE_CONFIG_START( lethalen, lethal_state )
|
||||
|
||||
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", lethal)
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
@ -559,6 +541,7 @@ static MACHINE_CONFIG_START( lethalen, lethal_state )
|
||||
|
||||
MCFG_DEVICE_ADD("k053244", K053244, 0)
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K05324X_BPP(6)
|
||||
MCFG_K05324X_OFFSETS(95, 0)
|
||||
MCFG_K05324X_CB(lethal_state, sprite_callback)
|
||||
|
||||
@ -596,8 +579,8 @@ ROM_START( lethalen ) // US version UAE
|
||||
ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
|
||||
|
||||
ROM_REGION( 0x400000, "k053244", ROMREGION_ERASE00 ) /* sprites */
|
||||
ROM_LOAD32_WORD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000002, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a04", 0x000002, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
|
||||
|
||||
ROM_REGION( 0x200000, "k054539", 0 ) /* K054539 samples */
|
||||
@ -621,8 +604,8 @@ ROM_START( lethalenub ) // US version UAB
|
||||
ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
|
||||
|
||||
ROM_REGION( 0x400000, "k053244", ROMREGION_ERASE00 ) /* sprites */
|
||||
ROM_LOAD32_WORD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000002, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a04", 0x000002, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
|
||||
|
||||
ROM_REGION( 0x200000, "k054539", 0 ) /* K054539 samples */
|
||||
@ -646,8 +629,8 @@ ROM_START( lethalenua ) // US version UAA
|
||||
ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
|
||||
|
||||
ROM_REGION( 0x400000, "k053244", ROMREGION_ERASE00 ) /* sprites */
|
||||
ROM_LOAD32_WORD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000002, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a04", 0x000002, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
|
||||
|
||||
ROM_REGION( 0x200000, "k054539", 0 ) /* K054539 samples */
|
||||
@ -671,8 +654,8 @@ ROM_START( lethalenux ) // US version ?, proto / hack?, very different to other
|
||||
ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
|
||||
|
||||
ROM_REGION( 0x400000, "k053244", ROMREGION_ERASE00 ) /* sprites */
|
||||
ROM_LOAD32_WORD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000002, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a04", 0x000002, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
|
||||
|
||||
ROM_REGION( 0x200000, "k054539", 0 ) /* K054539 samples */
|
||||
@ -696,8 +679,8 @@ ROM_START( lethaleneab ) // Euro ver. EAB
|
||||
ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
|
||||
|
||||
ROM_REGION( 0x400000, "k053244", ROMREGION_ERASE00 ) /* sprites */
|
||||
ROM_LOAD32_WORD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000002, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a04", 0x000002, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
|
||||
|
||||
ROM_REGION( 0x200000, "k054539", 0 ) /* K054539 samples */
|
||||
@ -721,8 +704,8 @@ ROM_START( lethaleneae ) // Euro ver. EAE
|
||||
ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
|
||||
|
||||
ROM_REGION( 0x400000, "k053244", ROMREGION_ERASE00 ) /* sprites */
|
||||
ROM_LOAD32_WORD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000002, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a04", 0x000002, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
|
||||
|
||||
ROM_REGION( 0x200000, "k054539", 0 ) /* K054539 samples */
|
||||
@ -746,8 +729,8 @@ ROM_START( lethalenj ) // Japan version JAD
|
||||
ROM_LOAD32_WORD( "191a09", 0x200000, 0x100000, CRC(e2028531) SHA1(63ccce7855d829763e9e248a6c3eb6ea89ab17ee) )
|
||||
|
||||
ROM_REGION( 0x400000, "k053244", ROMREGION_ERASE00 ) /* sprites */
|
||||
ROM_LOAD32_WORD( "191a04", 0x000000, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000002, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a05", 0x000000, 0x100000, CRC(f2e3b58b) SHA1(0bbc2fe87a4fd00b5073a884bcfebcf9c2c402ad) )
|
||||
ROM_LOAD32_WORD( "191a04", 0x000002, 0x100000, CRC(5c3eeb2b) SHA1(33ea8b3968b78806334b5a0aab3a2c24e45c604e) )
|
||||
ROM_LOAD32_WORD( "191a06", 0x200000, 0x100000, CRC(ee11fc08) SHA1(ec6dd684e8261b181d65b8bf1b9e97da5c4468f7) )
|
||||
|
||||
ROM_REGION( 0x200000, "k054539", 0 ) /* K054539 samples */
|
||||
|
@ -54,11 +54,30 @@ const gfx_layout k05324x_device::spritelayout =
|
||||
128*8
|
||||
};
|
||||
|
||||
// Lethal Enforcers has two k053244s hooked up to one k053245 to give 6bpp...
|
||||
// for now we just emulate it using an alternate gfx layout
|
||||
const gfx_layout k05324x_device::spritelayout_6bpp =
|
||||
{
|
||||
16,16,
|
||||
RGN_FRAC(1,2),
|
||||
6,
|
||||
{ RGN_FRAC(1,2)+8,RGN_FRAC(1,2)+0, 24, 16, 8, 0 },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7,
|
||||
8*32+0, 8*32+1, 8*32+2, 8*32+3, 8*32+4, 8*32+5, 8*32+6, 8*32+7 },
|
||||
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
|
||||
16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 },
|
||||
128*8
|
||||
};
|
||||
|
||||
|
||||
GFXDECODE_MEMBER( k05324x_device::gfxinfo )
|
||||
GFXDECODE_DEVICE(DEVICE_SELF, 0, spritelayout, 0, 1)
|
||||
GFXDECODE_END
|
||||
|
||||
GFXDECODE_MEMBER( k05324x_device::gfxinfo_6bpp )
|
||||
GFXDECODE_DEVICE(DEVICE_SELF, 0, spritelayout_6bpp, 0, 1)
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
k05324x_device::k05324x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, K053244, "K053244 & 053245 Sprite Generator", tag, owner, clock, "k05324x", __FILE__),
|
||||
@ -74,6 +93,22 @@ k05324x_device::k05324x_device(const machine_config &mconfig, const char *tag, d
|
||||
{
|
||||
}
|
||||
|
||||
void k05324x_device::set_bpp(device_t &device, int bpp)
|
||||
{
|
||||
k05324x_device &dev = downcast<k05324x_device &>(device);
|
||||
switch(bpp)
|
||||
{
|
||||
case 4:
|
||||
device_gfx_interface::static_set_info(dev, gfxinfo);
|
||||
break;
|
||||
case 6:
|
||||
device_gfx_interface::static_set_info(dev, gfxinfo_6bpp);
|
||||
break;
|
||||
default:
|
||||
fatalerror("Unsupported bpp\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
@ -521,255 +556,3 @@ if (machine().input().code_pressed(KEYCODE_D))
|
||||
#endif
|
||||
#undef NUM_SPRITES
|
||||
}
|
||||
|
||||
/* Lethal Enforcers has 2 of these chips hooked up in parallel to give 6bpp gfx.. let's cheat a
|
||||
bit and make emulating it a little less messy by using a custom function instead */
|
||||
void k05324x_device::sprites_draw_lethal( bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap )
|
||||
{
|
||||
#define NUM_SPRITES 128
|
||||
int offs, pri_code, i;
|
||||
int sortedlist[NUM_SPRITES];
|
||||
int flipscreenX, flipscreenY, spriteoffsX, spriteoffsY;
|
||||
UINT8 drawmode_table[256];
|
||||
|
||||
memset(drawmode_table, DRAWMODE_SOURCE, sizeof(drawmode_table));
|
||||
drawmode_table[0] = DRAWMODE_NONE;
|
||||
|
||||
flipscreenX = m_regs[5] & 0x01;
|
||||
flipscreenY = m_regs[5] & 0x02;
|
||||
spriteoffsX = (m_regs[0] << 8) | m_regs[1];
|
||||
spriteoffsY = (m_regs[2] << 8) | m_regs[3];
|
||||
|
||||
for (offs = 0; offs < NUM_SPRITES; offs++)
|
||||
sortedlist[offs] = -1;
|
||||
|
||||
/* prebuild a sorted table */
|
||||
for (i = m_ramsize / 2, offs = 0; offs < i; offs += 8)
|
||||
{
|
||||
pri_code = m_buffer[offs];
|
||||
if (pri_code & 0x8000)
|
||||
{
|
||||
pri_code &= 0x007f;
|
||||
|
||||
if (offs && pri_code == m_z_rejection)
|
||||
continue;
|
||||
|
||||
if (sortedlist[pri_code] == -1)
|
||||
sortedlist[pri_code] = offs;
|
||||
}
|
||||
}
|
||||
|
||||
for (pri_code = NUM_SPRITES - 1; pri_code >= 0; pri_code--)
|
||||
{
|
||||
int ox, oy, color, code, size, w, h, x, y, flipx, flipy, mirrorx, mirrory, shadow, zoomx, zoomy, pri;
|
||||
|
||||
offs = sortedlist[pri_code];
|
||||
if (offs == -1)
|
||||
continue;
|
||||
|
||||
/* the following changes the sprite draw order from
|
||||
0 1 4 5 16 17 20 21
|
||||
2 3 6 7 18 19 22 23
|
||||
8 9 12 13 24 25 28 29
|
||||
10 11 14 15 26 27 30 31
|
||||
32 33 36 37 48 49 52 53
|
||||
34 35 38 39 50 51 54 55
|
||||
40 41 44 45 56 57 60 61
|
||||
42 43 46 47 58 59 62 63
|
||||
|
||||
to
|
||||
|
||||
0 1 2 3 4 5 6 7
|
||||
8 9 10 11 12 13 14 15
|
||||
16 17 18 19 20 21 22 23
|
||||
24 25 26 27 28 29 30 31
|
||||
32 33 34 35 36 37 38 39
|
||||
40 41 42 43 44 45 46 47
|
||||
48 49 50 51 52 53 54 55
|
||||
56 57 58 59 60 61 62 63
|
||||
*/
|
||||
|
||||
/* NOTE: from the schematics, it looks like the top 2 bits should be ignored */
|
||||
/* (there are not output pins for them), and probably taken from the "color" */
|
||||
/* field to do bank switching. However this applies only to TMNT2, with its */
|
||||
/* protection mcu creating the sprite table, so we don't know where to fetch */
|
||||
/* the bits from. */
|
||||
code = m_buffer[offs + 1];
|
||||
code = ((code & 0xffe1) + ((code & 0x0010) >> 2) + ((code & 0x0008) << 1)
|
||||
+ ((code & 0x0004) >> 1) + ((code & 0x0002) << 2));
|
||||
color = m_buffer[offs + 6] & 0x00ff;
|
||||
pri = 0;
|
||||
|
||||
if (!m_k05324x_cb.isnull())
|
||||
m_k05324x_cb(&code, &color, &pri);
|
||||
|
||||
size = (m_buffer[offs] & 0x0f00) >> 8;
|
||||
|
||||
w = 1 << (size & 0x03);
|
||||
h = 1 << ((size >> 2) & 0x03);
|
||||
|
||||
/* zoom control:
|
||||
0x40 = normal scale
|
||||
<0x40 enlarge (0x20 = double size)
|
||||
>0x40 reduce (0x80 = half size)
|
||||
*/
|
||||
zoomy = m_buffer[offs + 4];
|
||||
if (zoomy > 0x2000)
|
||||
continue;
|
||||
if (zoomy)
|
||||
zoomy = (0x400000 + zoomy / 2) / zoomy;
|
||||
else
|
||||
zoomy = 2 * 0x400000;
|
||||
if ((m_buffer[offs] & 0x4000) == 0)
|
||||
{
|
||||
zoomx = m_buffer[offs + 5];
|
||||
if (zoomx > 0x2000)
|
||||
continue;
|
||||
if (zoomx)
|
||||
zoomx = (0x400000 + zoomx / 2) / zoomx;
|
||||
else
|
||||
zoomx = 2 * 0x400000;
|
||||
// else zoomx = zoomy; /* workaround for TMNT2 */
|
||||
}
|
||||
else
|
||||
zoomx = zoomy;
|
||||
|
||||
ox = m_buffer[offs + 3] + spriteoffsX;
|
||||
oy = m_buffer[offs + 2];
|
||||
|
||||
ox += m_dx;
|
||||
oy += m_dy;
|
||||
|
||||
flipx = m_buffer[offs] & 0x1000;
|
||||
flipy = m_buffer[offs] & 0x2000;
|
||||
mirrorx = m_buffer[offs + 6] & 0x0100;
|
||||
if (mirrorx)
|
||||
flipx = 0; // documented and confirmed
|
||||
mirrory = m_buffer[offs + 6] & 0x0200;
|
||||
shadow = m_buffer[offs + 6] & 0x0080;
|
||||
|
||||
if (flipscreenX)
|
||||
{
|
||||
ox = 512 - ox;
|
||||
if (!mirrorx) flipx = !flipx;
|
||||
}
|
||||
if (flipscreenY)
|
||||
{
|
||||
oy = -oy;
|
||||
if (!mirrory) flipy = !flipy;
|
||||
}
|
||||
|
||||
ox = (ox + 0x5d) & 0x3ff;
|
||||
if (ox >= 768) ox -= 1024;
|
||||
oy = (-(oy + spriteoffsY + 0x07)) & 0x3ff;
|
||||
if (oy >= 640) oy -= 1024;
|
||||
|
||||
/* the coordinates given are for the *center* of the sprite */
|
||||
ox -= (zoomx * w) >> 13;
|
||||
oy -= (zoomy * h) >> 13;
|
||||
|
||||
drawmode_table[gfx(0)->granularity() - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
|
||||
|
||||
for (y = 0; y < h; y++)
|
||||
{
|
||||
int sx, sy, zw, zh;
|
||||
|
||||
sy = oy + ((zoomy * y + (1<<11)) >> 12);
|
||||
zh = (oy + ((zoomy * (y+1) + (1<<11)) >> 12)) - sy;
|
||||
|
||||
for (x = 0; x < w; x++)
|
||||
{
|
||||
int c, fx, fy;
|
||||
|
||||
sx = ox + ((zoomx * x + (1 << 11)) >> 12);
|
||||
zw = (ox + ((zoomx * (x+1) + (1 << 11)) >> 12)) - sx;
|
||||
c = code;
|
||||
if (mirrorx)
|
||||
{
|
||||
if ((flipx == 0) ^ (2 * x < w))
|
||||
{
|
||||
/* mirror left/right */
|
||||
c += (w - x - 1);
|
||||
fx = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
c += x;
|
||||
fx = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (flipx) c += w-1-x;
|
||||
else c += x;
|
||||
fx = flipx;
|
||||
}
|
||||
if (mirrory)
|
||||
{
|
||||
if ((flipy == 0) ^ (2 * y >= h))
|
||||
{
|
||||
/* mirror top/bottom */
|
||||
c += 8 * (h - y - 1);
|
||||
fy = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
c += 8 * y;
|
||||
fy = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (flipy) c += 8 * (h - 1 - y);
|
||||
else c += 8 * y;
|
||||
fy = flipy;
|
||||
}
|
||||
|
||||
/* the sprite can start at any point in the 8x8 grid, but it must stay */
|
||||
/* in a 64 entries window, wrapping around at the edges. The animation */
|
||||
/* at the end of the saloon level in Sunset Riders breaks otherwise. */
|
||||
c = (c & 0x3f) | (code & ~0x3f);
|
||||
|
||||
if (zoomx == 0x10000 && zoomy == 0x10000)
|
||||
{
|
||||
gfx(0)->prio_transtable(bitmap,cliprect, /* hardcoded to 0 (decoded 6bpp gfx) for le */
|
||||
c,color,
|
||||
fx,fy,
|
||||
sx,sy,
|
||||
priority_bitmap,pri,
|
||||
drawmode_table);
|
||||
}
|
||||
else
|
||||
{
|
||||
gfx(0)->prio_zoom_transtable(bitmap,cliprect, /* hardcoded to 0 (decoded 6bpp gfx) for le */
|
||||
c,color,
|
||||
fx,fy,
|
||||
sx,sy,
|
||||
(zw << 16) / 16,(zh << 16) / 16,
|
||||
priority_bitmap,pri,
|
||||
drawmode_table);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
if (machine().input().code_pressed(KEYCODE_D))
|
||||
{
|
||||
FILE *fp;
|
||||
fp=fopen("SPRITE.DMP", "w+b");
|
||||
if (fp)
|
||||
{
|
||||
fwrite(m_buffer, 0x800, 1, fp);
|
||||
popmessage("saved");
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#undef NUM_SPRITES
|
||||
}
|
||||
|
||||
READ16_MEMBER( k05324x_device::k053244_reg_word_r )
|
||||
{
|
||||
return(m_regs[offset * 2] << 8 | m_regs[offset * 2 + 1]);
|
||||
}
|
||||
|
@ -7,6 +7,9 @@ typedef device_delegate<void (int *code, int *color, int *priority)> k05324x_cb_
|
||||
#define MCFG_K05324X_CB_MEMBER(_name) void _name(int *code, int *color, int *priority)
|
||||
|
||||
|
||||
#define MCFG_K05324X_BPP(_bpp) \
|
||||
k05324x_device::set_bpp(*device, _bpp);
|
||||
|
||||
#define MCFG_K05324X_CB(_class, _method) \
|
||||
k05324x_device::set_k05324x_callback(*device, k05324x_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
|
||||
|
||||
@ -17,14 +20,17 @@ typedef device_delegate<void (int *code, int *color, int *priority)> k05324x_cb_
|
||||
class k05324x_device : public device_t,
|
||||
public device_gfx_interface
|
||||
{
|
||||
static const gfx_layout spritelayout;
|
||||
static const gfx_layout spritelayout_6bpp;
|
||||
DECLARE_GFXDECODE_MEMBER(gfxinfo);
|
||||
DECLARE_GFXDECODE_MEMBER(gfxinfo_6bpp);
|
||||
|
||||
public:
|
||||
k05324x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
~k05324x_device() {}
|
||||
|
||||
static const gfx_layout spritelayout;
|
||||
DECLARE_GFXDECODE_MEMBER(gfxinfo);
|
||||
|
||||
// static configuration
|
||||
static void set_bpp(device_t &device, int bpp);
|
||||
static void set_k05324x_callback(device_t &device, k05324x_cb_delegate callback) { downcast<k05324x_device &>(device).m_k05324x_cb = callback; }
|
||||
static void set_offsets(device_t &device, int x_offset, int y_offset)
|
||||
{
|
||||
@ -45,7 +51,6 @@ public:
|
||||
DECLARE_WRITE16_MEMBER( k053244_word_w );
|
||||
void bankselect(int bank); /* used by TMNT2, Asterix and Premier Soccer for ROM testing */
|
||||
void sprites_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap);
|
||||
void sprites_draw_lethal(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap); /* for lethal enforcers */
|
||||
void clear_buffer();
|
||||
void update_buffer();
|
||||
void set_z_rejection(int zcode); // common to k053244/5
|
||||
@ -69,8 +74,6 @@ private:
|
||||
int m_rombank; // 053244
|
||||
int m_ramsize;
|
||||
int m_z_rejection;
|
||||
|
||||
DECLARE_READ16_MEMBER( k053244_reg_word_r ); // OBJSET0 debug handler
|
||||
};
|
||||
|
||||
|
||||
|
@ -106,7 +106,7 @@ UINT32 lethal_state::screen_update_lethalen(screen_device &screen, bitmap_ind16
|
||||
m_k056832->tilemap_draw(screen, bitmap, cliprect, 2, K056832_DRAW_FLAG_MIRROR, 2);
|
||||
m_k056832->tilemap_draw(screen, bitmap, cliprect, 1, K056832_DRAW_FLAG_MIRROR, 4);
|
||||
|
||||
m_k053244->sprites_draw_lethal(bitmap, cliprect, screen.priority());
|
||||
m_k053244->sprites_draw(bitmap, cliprect, screen.priority());
|
||||
|
||||
// force "A" layer over top of everything
|
||||
m_k056832->tilemap_draw(screen, bitmap, cliprect, 0, K056832_DRAW_FLAG_MIRROR, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user