mirror of
https://github.com/holub/mame
synced 2025-05-25 15:25:33 +03:00
k051316: clean up/simplify inline configs, add tile bank dirty method for ultraman (nw)
This commit is contained in:
parent
fa70337319
commit
b5c404e9ef
@ -361,7 +361,6 @@ static MACHINE_CONFIG_START( 88games, _88games_state )
|
||||
|
||||
MCFG_DEVICE_ADD("k051316", K051316, 0)
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K051316_BPP(4)
|
||||
MCFG_K051316_CB(_88games_state, zoom_callback)
|
||||
|
||||
/* sound hardware */
|
||||
|
@ -342,7 +342,6 @@ static MACHINE_CONFIG_START( bottom9, bottom9_state )
|
||||
|
||||
MCFG_DEVICE_ADD("k051316", K051316, 0)
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K051316_BPP(4)
|
||||
MCFG_K051316_CB(bottom9_state, zoom_callback)
|
||||
|
||||
/* sound hardware */
|
||||
|
@ -336,14 +336,13 @@ static MACHINE_CONFIG_START( chqflag, chqflag_state )
|
||||
|
||||
MCFG_DEVICE_ADD("k051316_1", K051316, 0)
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K051316_BPP(4)
|
||||
MCFG_K051316_OFFSETS(7, 0)
|
||||
MCFG_K051316_CB(chqflag_state, zoom_callback_1)
|
||||
|
||||
MCFG_DEVICE_ADD("k051316_2", K051316, 0)
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K051316_BPP(8)
|
||||
MCFG_K051316_SETUP_PENS(true, 0xc0)
|
||||
MCFG_K051316_LAYER_MASK(0xc0)
|
||||
MCFG_K051316_WRAP(1)
|
||||
MCFG_K051316_CB(chqflag_state, zoom_callback_2)
|
||||
|
||||
|
@ -335,15 +335,12 @@ static MACHINE_CONFIG_START( overdriv, overdriv_state )
|
||||
|
||||
MCFG_DEVICE_ADD("k051316_1", K051316, 0)
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K051316_BPP(4)
|
||||
MCFG_K051316_OFFSETS(14, -1)
|
||||
MCFG_K051316_WRAP(1)
|
||||
MCFG_K051316_SETUP_PENS(true, 0)
|
||||
MCFG_K051316_CB(overdriv_state, zoom_callback_1)
|
||||
|
||||
MCFG_DEVICE_ADD("k051316_2", K051316, 0)
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K051316_BPP(4)
|
||||
MCFG_K051316_OFFSETS(15, 1)
|
||||
MCFG_K051316_CB(overdriv_state, zoom_callback_2)
|
||||
|
||||
|
@ -271,7 +271,6 @@ static MACHINE_CONFIG_START( rollerg, rollerg_state )
|
||||
|
||||
MCFG_DEVICE_ADD("k051316", K051316, 0)
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K051316_BPP(4)
|
||||
MCFG_K051316_OFFSETS(22, 1)
|
||||
MCFG_K051316_CB(rollerg_state, zoom_callback)
|
||||
|
||||
|
@ -228,7 +228,6 @@ static MACHINE_CONFIG_START( tail2nos, tail2nos_state )
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K051316_BPP(-4)
|
||||
MCFG_K051316_OFFSETS(-89, -14)
|
||||
MCFG_K051316_SETUP_PENS(true, 0)
|
||||
MCFG_K051316_WRAP(1)
|
||||
MCFG_K051316_CB(tail2nos_state, zoom_callback)
|
||||
|
||||
|
@ -213,20 +213,16 @@ static MACHINE_CONFIG_START( ultraman, ultraman_state )
|
||||
|
||||
MCFG_DEVICE_ADD("k051316_1", K051316, 0)
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K051316_BPP(4)
|
||||
MCFG_K051316_OFFSETS(8, 0)
|
||||
MCFG_K051316_CB(ultraman_state, zoom_callback_1)
|
||||
|
||||
MCFG_DEVICE_ADD("k051316_2", K051316, 0)
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K051316_BPP(4)
|
||||
MCFG_K051316_OFFSETS(8, 0)
|
||||
MCFG_K051316_CB(ultraman_state, zoom_callback_2)
|
||||
|
||||
MCFG_DEVICE_ADD("k051316_3", K051316, 0)
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K051316_BPP(4)
|
||||
MCFG_K051316_SETUP_PENS(true, 0)
|
||||
MCFG_K051316_OFFSETS(8, 0)
|
||||
MCFG_K051316_CB(ultraman_state, zoom_callback_3)
|
||||
|
||||
|
@ -1140,14 +1140,12 @@ static MACHINE_CONFIG_START( hotchase, wecleman_state )
|
||||
|
||||
MCFG_DEVICE_ADD("k051316_1", K051316, 0)
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K051316_BPP(4)
|
||||
MCFG_K051316_OFFSETS(-0xb0 / 2, -16)
|
||||
MCFG_K051316_WRAP(1)
|
||||
MCFG_K051316_CB(wecleman_state, hotchase_zoom_callback_1)
|
||||
|
||||
MCFG_DEVICE_ADD("k051316_2", K051316, 0)
|
||||
MCFG_GFX_PALETTE("palette")
|
||||
MCFG_K051316_BPP(4)
|
||||
MCFG_K051316_OFFSETS(-0xb0 / 2, -16)
|
||||
MCFG_K051316_CB(wecleman_state, hotchase_zoom_callback_2)
|
||||
|
||||
|
@ -109,9 +109,8 @@ k051316_device::k051316_device(const machine_config &mconfig, const char *tag, d
|
||||
m_dx(0),
|
||||
m_dy(0),
|
||||
m_wrap(0),
|
||||
m_pen_is_mask(false),
|
||||
m_pixels_per_byte(2), // 4bpp layout is default
|
||||
m_transparent_pen(0)
|
||||
m_layermask(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -163,13 +162,13 @@ void k051316_device::device_start()
|
||||
m_tmap = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k051316_device::get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_ram.resize_and_clear(0x800);
|
||||
|
||||
if (!m_pen_is_mask)
|
||||
m_tmap->set_transparent_pen(m_transparent_pen);
|
||||
else
|
||||
if (m_layermask)
|
||||
{
|
||||
m_tmap->map_pens_to_layer(0, 0, 0, TILEMAP_PIXEL_LAYER1);
|
||||
m_tmap->map_pens_to_layer(0, m_transparent_pen, m_transparent_pen, TILEMAP_PIXEL_LAYER0);
|
||||
m_tmap->map_pens_to_layer(0, m_layermask, m_layermask, TILEMAP_PIXEL_LAYER0);
|
||||
}
|
||||
else
|
||||
m_tmap->set_transparent_pen(0);
|
||||
|
||||
// bind callbacks
|
||||
m_k051316_cb.bind_relative_to(*owner());
|
||||
|
@ -15,8 +15,8 @@ typedef device_delegate<void (int *code, int *color, int *flags)> k051316_cb_del
|
||||
#define MCFG_K051316_BPP(_bpp) \
|
||||
k051316_device::set_bpp(*device, _bpp);
|
||||
|
||||
#define MCFG_K051316_SETUP_PENS(_mask, _pen) \
|
||||
k051316_device::set_pens(*device, _mask, _pen);
|
||||
#define MCFG_K051316_LAYER_MASK(_mask) \
|
||||
k051316_device::set_layermask(*device, _mask);
|
||||
|
||||
#define MCFG_K051316_WRAP(_wrap) \
|
||||
k051316_device::set_wrap(*device, _wrap);
|
||||
@ -41,12 +41,7 @@ public:
|
||||
static void set_k051316_callback(device_t &device, k051316_cb_delegate callback) { downcast<k051316_device &>(device).m_k051316_cb = callback; }
|
||||
static void set_wrap(device_t &device, int wrap) { downcast<k051316_device &>(device).m_wrap = wrap; }
|
||||
static void set_bpp(device_t &device, int bpp);
|
||||
static void set_pens(device_t &device, bool mask, int transp)
|
||||
{
|
||||
k051316_device &dev = downcast<k051316_device &>(device);
|
||||
dev.m_pen_is_mask = mask;
|
||||
dev.m_transparent_pen = transp;
|
||||
}
|
||||
static void set_layermask(device_t &device, int mask) { downcast<k051316_device &>(device).m_layermask = mask; }
|
||||
static void set_offsets(device_t &device, int x_offset, int y_offset)
|
||||
{
|
||||
k051316_device &dev = downcast<k051316_device &>(device);
|
||||
@ -74,6 +69,7 @@ public:
|
||||
void wraparound_enable(int status);
|
||||
|
||||
void mark_gfx_dirty(offs_t byteoffset) { gfx(0)->mark_dirty(byteoffset * m_pixels_per_byte / (16 * 16)); }
|
||||
void mark_tmap_dirty() { m_tmap->mark_all_dirty(); }
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
@ -91,9 +87,8 @@ private:
|
||||
|
||||
int m_dx, m_dy;
|
||||
int m_wrap;
|
||||
bool m_pen_is_mask;
|
||||
int m_pixels_per_byte;
|
||||
int m_transparent_pen;
|
||||
int m_layermask;
|
||||
k051316_cb_delegate m_k051316_cb;
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_tile_info);
|
||||
|
@ -57,7 +57,7 @@ UINT32 overdriv_state::screen_update_overdriv(screen_device &screen, bitmap_ind1
|
||||
|
||||
screen.priority().fill(0, cliprect);
|
||||
|
||||
m_k051316_1->zoom_draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_k051316_1->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
m_k051316_2->zoom_draw(screen, bitmap, cliprect, 0, 1);
|
||||
|
||||
m_k053246->k053247_sprites_draw( bitmap,cliprect);
|
||||
|
@ -155,7 +155,7 @@ UINT32 tail2nos_state::screen_update_tail2nos(screen_device &screen, bitmap_ind1
|
||||
{
|
||||
if (m_video_enable)
|
||||
{
|
||||
m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_k051316->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
draw_sprites(bitmap, cliprect);
|
||||
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ WRITE16_MEMBER(ultraman_state::ultraman_gfxctrl_w)
|
||||
if (m_bank0 != ((data & 0x02) >> 1))
|
||||
{
|
||||
m_bank0 = (data & 0x02) >> 1;
|
||||
machine().tilemap().mark_all_dirty(); /* should mark only zoom0 */
|
||||
m_k051316_1->mark_tmap_dirty();
|
||||
}
|
||||
|
||||
m_k051316_2->wraparound_enable(data & 0x04);
|
||||
@ -91,7 +91,7 @@ WRITE16_MEMBER(ultraman_state::ultraman_gfxctrl_w)
|
||||
if (m_bank1 != ((data & 0x08) >> 3))
|
||||
{
|
||||
m_bank1 = (data & 0x08) >> 3;
|
||||
machine().tilemap().mark_all_dirty(); /* should mark only zoom1 */
|
||||
m_k051316_2->mark_tmap_dirty();
|
||||
}
|
||||
|
||||
m_k051316_3->wraparound_enable(data & 0x10);
|
||||
@ -99,7 +99,7 @@ WRITE16_MEMBER(ultraman_state::ultraman_gfxctrl_w)
|
||||
if (m_bank2 != ((data & 0x20) >> 5))
|
||||
{
|
||||
m_bank2 = (data & 0x20) >> 5;
|
||||
machine().tilemap().mark_all_dirty(); /* should mark only zoom2 */
|
||||
m_k051316_3->mark_tmap_dirty();
|
||||
}
|
||||
|
||||
coin_counter_w(machine(), 0, data & 0x40);
|
||||
@ -117,7 +117,7 @@ WRITE16_MEMBER(ultraman_state::ultraman_gfxctrl_w)
|
||||
|
||||
UINT32 ultraman_state::screen_update_ultraman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
m_k051316_3->zoom_draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_k051316_3->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
m_k051316_2->zoom_draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 0, 0);
|
||||
m_k051316_1->zoom_draw(screen, bitmap, cliprect, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user