de-staticify initializations for src/mame/video (nw) (#3246)

This commit is contained in:
wilbertpol 2018-02-20 08:29:34 +01:00 committed by Olivier Galibert
parent 0d9494480a
commit 9b3008b0ae
148 changed files with 973 additions and 1055 deletions

View File

@ -920,13 +920,13 @@ MACHINE_CONFIG_START(expro02_state::expro02)
MCFG_PALETTE_INIT_OWNER(expro02_state, expro02)
MCFG_DEVICE_ADD("view2_0", KANEKO_TMAP, 0)
kaneko_view2_tilemap_device::set_gfx_region(*device, 1);
kaneko_view2_tilemap_device::set_offset(*device, 0x5b, 0x8, 256, 224);
MCFG_KANEKO_TMAP_GFX_REGION(1)
MCFG_KANEKO_TMAP_OFFSET(0x5b, 0x8, 256, 224)
MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
MCFG_DEVICE_ADD_VU002_SPRITES
kaneko16_sprite_device::set_priorities(*device, 8,8,8,8); // above all (not verified)
kaneko16_sprite_device::set_offsets(*device, 0, -0x40);
MCFG_KANEKO16_SPRITE_PRIORITIES(8,8,8,8) // above all (not verified)
MCFG_KANEKO16_SPRITE_OFFSETS(0, -0x40)
MCFG_KANEKO16_SPRITE_GFXDECODE("gfxdecode")
MCFG_DEVICE_ADD("calc1_mcu", KANEKO_HIT, 0)
@ -958,8 +958,8 @@ MACHINE_CONFIG_START(expro02_state::comad)
MCFG_DEVICE_MODIFY("view2_0")
// these values might not be correct, behavior differs from original boards
kaneko_view2_tilemap_device::set_invert_flip(*device, 1);
kaneko_view2_tilemap_device::set_offset(*device, -256, -216, 256, 224);
MCFG_KANEKO_TMAP_INVERT_FLIP(1)
MCFG_KANEKO_TMAP_OFFSET(-256, -216, 256, 224)
MCFG_WATCHDOG_MODIFY("watchdog")
MCFG_WATCHDOG_TIME_INIT(attotime::from_seconds(0)) /* a guess, and certainly wrong */

View File

@ -653,7 +653,7 @@ MACHINE_CONFIG_START(galpani2_state::galpani2)
MCFG_PALETTE_INIT_OWNER(galpani2_state,galpani2)
MCFG_DEVICE_ADD_KC002_SPRITES
kaneko16_sprite_device::set_offsets(*device, 0x10000 - 0x16c0 + 0xc00, 0);
MCFG_KANEKO16_SPRITE_OFFSETS(0x10000 - 0x16c0 + 0xc00, 0)
MCFG_KANEKO16_SPRITE_GFXDECODE("gfxdecode")

View File

@ -529,15 +529,15 @@ MACHINE_CONFIG_START(galpani3_state::galpani3)
MCFG_DEVICE_ADD("spritegen", SKNS_SPRITE, 0)
MCFG_DEVICE_ADD("grap2_0", KANEKO_GRAP2, 0)
kaneko_grap2_device::set_chipnum(*device, 0);
MCFG_KANEKO_GRAP2_CHIPNUM(0)
MCFG_KANEKO_GRAP2_PALETTE("palette")
MCFG_DEVICE_ADD("grap2_1", KANEKO_GRAP2, 0)
kaneko_grap2_device::set_chipnum(*device, 1);
MCFG_KANEKO_GRAP2_CHIPNUM(1)
MCFG_KANEKO_GRAP2_PALETTE("palette")
MCFG_DEVICE_ADD("grap2_2", KANEKO_GRAP2, 0)
kaneko_grap2_device::set_chipnum(*device, 2);
MCFG_KANEKO_GRAP2_CHIPNUM(2)
MCFG_KANEKO_GRAP2_PALETTE("palette")

View File

@ -356,8 +356,8 @@ MACHINE_CONFIG_START(inufuku_state::inufuku)
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("vsystem_spr", VSYSTEM_SPR, 0)
vsystem_spr_device::set_offsets(*device, 0,1); // reference videos confirm at least the +1 against tilemaps in 3on3dunk (the highscore header text and black box are meant to be 1 pixel misaligned, although there is currently a priority bug there too)
vsystem_spr_device::set_pdraw(*device, true);
MCFG_VSYSTEM_SPR_SET_OFFSETS(0,1) // reference videos confirm at least the +1 against tilemaps in 3on3dunk (the highscore header text and black box are meant to be 1 pixel misaligned, although there is currently a priority bug there too)
MCFG_VSYSTEM_SPR_SET_PDRAW(true)
MCFG_VSYSTEM_SPR_SET_TILE_INDIRECT( inufuku_state, inufuku_tile_callback )
MCFG_VSYSTEM_SPR_SET_GFXREGION(2)
MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode")

View File

@ -606,8 +606,8 @@ MACHINE_CONFIG_START(jchan_state::jchan)
MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
MCFG_DEVICE_ADD("view2_0", KANEKO_TMAP, 0)
kaneko_view2_tilemap_device::set_gfx_region(*device, 1);
kaneko_view2_tilemap_device::set_offset(*device, 25, 11, 320, 240);
MCFG_KANEKO_TMAP_GFX_REGION(1)
MCFG_KANEKO_TMAP_OFFSET(25, 11, 320, 240)
MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")

View File

@ -1155,7 +1155,7 @@ MACHINE_CONFIG_START(jclub2o_state::jclub2o)
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
MCFG_DEVICE_ADD("st0020", ST0020_SPRITES, 0)
st0020_device::static_set_is_jclub2(*device, 1);
MCFG_ST0020_IS_JCLUB2(1)
MCFG_ST0020_SPRITES_PALETTE("palette")
// layout
@ -1190,8 +1190,8 @@ MACHINE_CONFIG_START(jclub2_state::jclub2)
// NOT an ST0020 but instead ST0032, ram format isn't compatible at least
MCFG_DEVICE_ADD("st0020", ST0020_SPRITES, 0)
st0020_device::static_set_is_st0032(*device, 1);
st0020_device::static_set_is_jclub2(*device, 1); // offsets
MCFG_ST0020_IS_ST0032(1)
MCFG_ST0020_IS_JCLUB2(1) // offsets
MCFG_ST0020_SPRITES_PALETTE("palette")
// layout

View File

@ -1895,12 +1895,12 @@ MACHINE_CONFIG_START(kaneko16_berlwall_state::berlwall)
MCFG_PALETTE_INIT_OWNER(kaneko16_berlwall_state,berlwall)
MCFG_DEVICE_ADD("view2_0", KANEKO_TMAP, 0)
kaneko_view2_tilemap_device::set_gfx_region(*device, 1);
kaneko_view2_tilemap_device::set_offset(*device, 0x5b, -0x8, 256, 240+16);
MCFG_KANEKO_TMAP_GFX_REGION(1)
MCFG_KANEKO_TMAP_OFFSET(0x5b, -0x8, 256, 240+16)
MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
MCFG_DEVICE_ADD_VU002_SPRITES
kaneko16_sprite_device::set_offsets(*device, 0, -1*64);
MCFG_KANEKO16_SPRITE_OFFSETS(0, -1*64)
MCFG_KANEKO16_SPRITE_GFXDECODE("gfxdecode")
MCFG_VIDEO_START_OVERRIDE(kaneko16_berlwall_state,berlwall)
@ -1953,17 +1953,17 @@ MACHINE_CONFIG_START(kaneko16_state::bakubrkr)
MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
MCFG_DEVICE_ADD("view2_0", KANEKO_TMAP, 0)
kaneko_view2_tilemap_device::set_gfx_region(*device, 1);
kaneko_view2_tilemap_device::set_offset(*device, 0x5b, -0x8, 256, 240);
MCFG_KANEKO_TMAP_GFX_REGION(1)
MCFG_KANEKO_TMAP_OFFSET(0x5b, -0x8, 256, 240)
MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
MCFG_DEVICE_ADD("view2_1", KANEKO_TMAP, 0)
kaneko_view2_tilemap_device::set_gfx_region(*device, 2);
kaneko_view2_tilemap_device::set_offset(*device, 0x5b, -0x8, 256, 240);
MCFG_KANEKO_TMAP_GFX_REGION(2)
MCFG_KANEKO_TMAP_OFFSET(0x5b, -0x8, 256, 240)
MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
MCFG_DEVICE_ADD_VU002_SPRITES
kaneko16_sprite_device::set_priorities(*device, 8,8,8,8); // above all
MCFG_KANEKO16_SPRITE_PRIORITIES(8,8,8,8) // above all
MCFG_KANEKO16_SPRITE_GFXDECODE("gfxdecode")
@ -2027,13 +2027,13 @@ MACHINE_CONFIG_START(kaneko16_state::blazeon)
MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
MCFG_DEVICE_ADD("view2_0", KANEKO_TMAP, 0)
kaneko_view2_tilemap_device::set_gfx_region(*device, 1);
kaneko_view2_tilemap_device::set_offset(*device, 0x33, 0x8, 320, 240);
MCFG_KANEKO_TMAP_GFX_REGION(1)
MCFG_KANEKO_TMAP_OFFSET(0x33, 0x8, 320, 240)
MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
MCFG_DEVICE_ADD_VU002_SPRITES
kaneko16_sprite_device::set_priorities(*device, 1 /* "above tile[0], below the others" */ ,2 /* "above tile[0-1], below the others" */ ,8 /* above all */,8 /* above all */);
kaneko16_sprite_device::set_offsets(*device, 0x10000 - 0x680, 0x000);
MCFG_KANEKO16_SPRITE_PRIORITIES(1 /* "above tile[0], below the others" */ ,2 /* "above tile[0-1], below the others" */ ,8 /* above all */,8 /* above all */)
MCFG_KANEKO16_SPRITE_OFFSETS(0x10000 - 0x680, 0x000)
MCFG_KANEKO16_SPRITE_GFXDECODE("gfxdecode")
// there is actually a 2nd sprite chip! looks like our device emulation handles both at once
@ -2081,13 +2081,13 @@ MACHINE_CONFIG_START(kaneko16_state::wingforc)
MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
MCFG_DEVICE_ADD("view2_0", KANEKO_TMAP, 0)
kaneko_view2_tilemap_device::set_gfx_region(*device, 1);
kaneko_view2_tilemap_device::set_offset(*device, 0x33, 0x8+1, 320, 240);
MCFG_KANEKO_TMAP_GFX_REGION(1)
MCFG_KANEKO_TMAP_OFFSET(0x33, 0x8+1, 320, 240)
MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
MCFG_DEVICE_ADD_VU002_SPRITES
kaneko16_sprite_device::set_priorities(*device, 1 /* "above tile[0], below the others" */ ,2 /* "above tile[0-1], below the others" */ ,8 /* above all */,8 /* above all */);
kaneko16_sprite_device::set_offsets(*device, 0x10000 - 0x680, 0x000);
MCFG_KANEKO16_SPRITE_PRIORITIES(1 /* "above tile[0], below the others" */ ,2 /* "above tile[0-1], below the others" */ ,8 /* above all */,8 /* above all */)
MCFG_KANEKO16_SPRITE_OFFSETS(0x10000 - 0x680, 0x000)
MCFG_KANEKO16_SPRITE_GFXDECODE("gfxdecode")
// there is actually a 2nd sprite chip! looks like our device emulation handles both at once
@ -2149,13 +2149,13 @@ MACHINE_CONFIG_START(kaneko16_gtmr_state::gtmr)
MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
MCFG_DEVICE_ADD("view2_0", KANEKO_TMAP, 0)
kaneko_view2_tilemap_device::set_gfx_region(*device, 1);
kaneko_view2_tilemap_device::set_offset(*device, 0x33, 0x0, 320, 240);
MCFG_KANEKO_TMAP_GFX_REGION(1)
MCFG_KANEKO_TMAP_OFFSET(0x33, 0x0, 320, 240)
MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
MCFG_DEVICE_ADD("view2_1", KANEKO_TMAP, 0)
kaneko_view2_tilemap_device::set_gfx_region(*device, 2);
kaneko_view2_tilemap_device::set_offset(*device, 0x33, 0x0, 320, 240);
MCFG_KANEKO_TMAP_GFX_REGION(2)
MCFG_KANEKO_TMAP_OFFSET(0x33, 0x0, 320, 240)
MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
MCFG_DEVICE_ADD_KC002_SPRITES
@ -2211,7 +2211,7 @@ MACHINE_CONFIG_START(kaneko16_gtmr_state::bloodwar)
MCFG_MACHINE_RESET_OVERRIDE(kaneko16_gtmr_state, gtmr )
MCFG_DEVICE_MODIFY("kan_spr")
kaneko16_sprite_device::set_priorities(*device, 2 /* never used? */ ,3 /* character selection / vs. portraits */ ,5 /* winning portrait*/ ,7 /* ? */);
MCFG_KANEKO16_SPRITE_PRIORITIES(2 /* never used? */ ,3 /* character selection / vs. portraits */ ,5 /* winning portrait*/ ,7 /* ? */)
@ -2233,7 +2233,7 @@ MACHINE_CONFIG_START(kaneko16_gtmr_state::bonkadv)
MCFG_MACHINE_RESET_OVERRIDE(kaneko16_gtmr_state, gtmr )
MCFG_DEVICE_MODIFY("kan_spr")
kaneko16_sprite_device::set_priorities(*device, 2 /* never used? */ ,3 /* volcano lava on level 2 */ ,5 /* in-game player */ ,7 /* demostration text */);
MCFG_KANEKO16_SPRITE_PRIORITIES(2 /* never used? */ ,3 /* volcano lava on level 2 */ ,5 /* in-game player */ ,7 /* demostration text */)
MCFG_DEVICE_MODIFY("toybox")
@ -2275,17 +2275,17 @@ MACHINE_CONFIG_START(kaneko16_state::mgcrystl)
MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
MCFG_DEVICE_ADD("view2_0", KANEKO_TMAP, 0)
kaneko_view2_tilemap_device::set_gfx_region(*device, 1);
kaneko_view2_tilemap_device::set_offset(*device, 0x5b, -0x8, 256, 240);
MCFG_KANEKO_TMAP_GFX_REGION(1)
MCFG_KANEKO_TMAP_OFFSET(0x5b, -0x8, 256, 240)
MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
MCFG_DEVICE_ADD("view2_1", KANEKO_TMAP, 0)
kaneko_view2_tilemap_device::set_gfx_region(*device, 2);
kaneko_view2_tilemap_device::set_offset(*device, 0x5b, -0x8, 256, 240);
MCFG_KANEKO_TMAP_GFX_REGION(2)
MCFG_KANEKO_TMAP_OFFSET(0x5b, -0x8, 256, 240)
MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
MCFG_DEVICE_ADD_VU002_SPRITES
kaneko16_sprite_device::set_priorities(*device, 2 /* below all */ ,3 /* above tile[0], below the other */ ,5 /* above all */ ,7 /* above all */);
MCFG_KANEKO16_SPRITE_PRIORITIES(2 /* below all */ ,3 /* above tile[0], below the other */ ,5 /* above all */ ,7 /* above all */)
MCFG_KANEKO16_SPRITE_GFXDECODE("gfxdecode")
@ -2406,16 +2406,16 @@ MACHINE_CONFIG_START(kaneko16_shogwarr_state::shogwarr)
MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
MCFG_DEVICE_ADD("view2_0", KANEKO_TMAP, 0)
kaneko_view2_tilemap_device::set_gfx_region(*device, 1);
kaneko_view2_tilemap_device::set_offset(*device, 0x33, -0x8, 320, 240);
MCFG_KANEKO_TMAP_GFX_REGION(1)
MCFG_KANEKO_TMAP_OFFSET(0x33, -0x8, 320, 240)
MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
MCFG_VIDEO_START_OVERRIDE(kaneko16_shogwarr_state,kaneko16)
MCFG_DEVICE_ADD_VU002_SPRITES
kaneko16_sprite_device::set_priorities(*device, 1 /* below all */ ,3 /* above tile[0], below the others */ ,5 /* above all */ ,7 /* above all */);
kaneko16_sprite_device::set_offsets(*device, 0xa00, -0x40);
kaneko16_sprite_device::set_fliptype(*device, 1);
MCFG_KANEKO16_SPRITE_PRIORITIES(1 /* below all */ ,3 /* above tile[0], below the others */ ,5 /* above all */ ,7 /* above all */)
MCFG_KANEKO16_SPRITE_OFFSETS(0xa00, -0x40)
MCFG_KANEKO16_SPRITE_FLIPTYPE(1)
MCFG_KANEKO16_SPRITE_GFXDECODE("gfxdecode")
MCFG_DEVICE_ADD("kan_hit", KANEKO_HIT, 0)

View File

@ -503,8 +503,8 @@ MACHINE_CONFIG_START(sandscrp_state::sandscrp)
MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
MCFG_DEVICE_ADD("view2_0", KANEKO_TMAP, 0)
kaneko_view2_tilemap_device::set_gfx_region(*device, 1);
kaneko_view2_tilemap_device::set_offset(*device, 0x5b, 0, 256, 224);
MCFG_KANEKO_TMAP_GFX_REGION(1)
MCFG_KANEKO_TMAP_OFFSET(0x5b, 0, 256, 224)
MCFG_KANEKO_TMAP_GFXDECODE("gfxdecode")
MCFG_DEVICE_ADD("calc1_mcu", KANEKO_HIT, 0)

View File

@ -730,7 +730,7 @@ MACHINE_CONFIG_START(twincobr_state::fshark)
MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(twincobr_state, dsp_int_w))
MCFG_DEVICE_MODIFY("scu")
toaplan_scu_device::static_set_xoffsets(*device, 32, 14);
MCFG_TOAPLAN_SCU_SET_XOFFSETS(32, 14)
MACHINE_CONFIG_END

View File

@ -22,13 +22,13 @@ public:
DECLARE_READ8_MEMBER(cru_r);
DECLARE_WRITE8_MEMBER(cru_w);
template <class Object> static devcb_base &static_set_keyint_callback(device_t &device, Object &&cb)
template <class Object> devcb_base &set_keyint_callback(Object &&cb)
{
return downcast<asr733_device &>(device).m_keyint_line.set_callback(std::forward<Object>(cb));
return m_keyint_line.set_callback(std::forward<Object>(cb));
}
template <class Object> static devcb_base &static_set_lineint_callback(device_t &device, Object &&cb)
template <class Object> devcb_base &set_lineint_callback(Object &&cb)
{
return downcast<asr733_device &>(device).m_lineint_line.set_callback(std::forward<Object>(cb));
return m_lineint_line.set_callback(std::forward<Object>(cb));
}
protected:
@ -83,9 +83,9 @@ private:
DECLARE_DEVICE_TYPE(ASR733, asr733_device)
#define MCFG_ASR733_KEYINT_HANDLER( _intcallb ) \
devcb = &asr733_device::static_set_keyint_callback( *device, DEVCB_##_intcallb );
devcb = &downcast<asr733_device &>(*device).set_keyint_callback(DEVCB_##_intcallb);
#define MCFG_ASR733_LINEINT_HANDLER( _intcallb ) \
devcb = &asr733_device::static_set_lineint_callback( *device, DEVCB_##_intcallb );
devcb = &downcast<asr733_device &>(*device).set_lineint_callback(DEVCB_##_intcallb);
#endif // MAME_VIDEO_733_ASR

View File

@ -48,14 +48,14 @@ public:
DECLARE_READ8_MEMBER(cru_r);
DECLARE_WRITE8_MEMBER(cru_w);
template <class Object> static devcb_base &static_set_keyint_callback(device_t &device, Object &&cb)
template <class Object> devcb_base &set_keyint_callback(Object &&cb)
{
return downcast<vdt911_device &>(device).m_keyint_line.set_callback(std::forward<Object>(cb));
return m_keyint_line.set_callback(std::forward<Object>(cb));
}
template <class Object> static devcb_base &static_set_lineint_callback(device_t &device, Object &&cb)
template <class Object> devcb_base &set_lineint_callback(Object &&cb)
{
return downcast<vdt911_device &>(device).m_lineint_line.set_callback(std::forward<Object>(cb));
return m_lineint_line.set_callback(std::forward<Object>(cb));
}
protected:
@ -114,9 +114,9 @@ private:
DECLARE_DEVICE_TYPE(VDT911, vdt911_device)
#define MCFG_VDT911_KEYINT_HANDLER( _intcallb ) \
devcb = &vdt911_device::static_set_keyint_callback( *device, DEVCB_##_intcallb );
devcb = &downcast<vdt911_device &>(*device).set_keyint_callback(DEVCB_##_intcallb);
#define MCFG_VDT911_LINEINT_HANDLER( _intcallb ) \
devcb = &vdt911_device::static_set_lineint_callback( *device, DEVCB_##_intcallb );
devcb = &downcast<vdt911_device &>(*device).set_lineint_callback(DEVCB_##_intcallb);
#endif // MAME_VIDEO_911_VDT_H

View File

@ -50,7 +50,7 @@ public:
virtual void device_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
static void set_gtia_tag(device_t &device, const char *tag) { downcast<antic_device &>(device).m_gtia_tag = tag; }
void set_gtia_tag(const char *tag) { m_gtia_tag = tag; }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@ -212,7 +212,7 @@ DECLARE_DEVICE_TYPE(ATARI_ANTIC, antic_device)
#define MCFG_ANTIC_GTIA(_tag) \
antic_device::set_gtia_tag(*device, _tag);
downcast<antic_device &>(*device).set_gtia_tag(_tag);
#define MCFG_SCREEN_VISIBLE_AREA_ANTIC() \
MCFG_SCREEN_VISIBLE_AREA(antic_device::MIN_X, antic_device::MAX_X, antic_device::MIN_Y, antic_device::MAX_Y)

View File

@ -154,24 +154,23 @@ atari_motion_objects_device::atari_motion_objects_device(const machine_config &m
}
//-------------------------------------------------
// static_set_gfxdecode_tag: Set the tag of the
// set_gfxdecode_tag: Set the tag of the
// gfx decoder
//-------------------------------------------------
void atari_motion_objects_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void atari_motion_objects_device::set_gfxdecode_tag(const char *tag)
{
downcast<atari_motion_objects_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}
//-------------------------------------------------
// static_set_config: Set the tag of the
// set_config: Set the tag of the
// sound CPU
//-------------------------------------------------
void atari_motion_objects_device::static_set_config(device_t &device, const atari_motion_objects_config &config)
void atari_motion_objects_device::set_config(const atari_motion_objects_config &config)
{
atari_motion_objects_device &target = downcast<atari_motion_objects_device &>(device);
static_cast<atari_motion_objects_config &>(target) = config;
static_cast<atari_motion_objects_config &>(*this) = config;
}

View File

@ -21,10 +21,10 @@
#define MCFG_ATARI_MOTION_OBJECTS_ADD(_tag, _screen, _config) \
MCFG_DEVICE_ADD(_tag, ATARI_MOTION_OBJECTS, 0) \
MCFG_VIDEO_SET_SCREEN(_screen) \
atari_motion_objects_device::static_set_config(*device, _config);
downcast<atari_motion_objects_device &>(*device).set_config(_config);
#define MCFG_ATARI_MOTION_OBJECTS_GFXDECODE(_gfxtag) \
atari_motion_objects_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<atari_motion_objects_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
//**************************************************************************
@ -85,9 +85,9 @@ public:
// construction/destruction
atari_motion_objects_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
static void static_set_config(device_t &device, const atari_motion_objects_config &config);
// configuration
void set_gfxdecode_tag(const char *tag);
void set_config(const atari_motion_objects_config &config);
// getters
int bank() const { return m_bank; }

View File

@ -76,14 +76,13 @@ atari_rle_objects_device::atari_rle_objects_device(const machine_config &mconfig
//-------------------------------------------------
// static_set_config: Set the tag of the
// set_config: Set the tag of the
// sound CPU
//-------------------------------------------------
void atari_rle_objects_device::static_set_config(device_t &device, const atari_rle_objects_config &config)
void atari_rle_objects_device::set_config(const atari_rle_objects_config &config)
{
atari_rle_objects_device &target = downcast<atari_rle_objects_device &>(device);
static_cast<atari_rle_objects_config &>(target) = config;
static_cast<atari_rle_objects_config &>(*this) = config;
}

View File

@ -19,7 +19,7 @@
#define MCFG_ATARIRLE_ADD(_tag, _interface) \
MCFG_DEVICE_ADD(_tag, ATARI_RLE_OBJECTS, 0) \
atari_rle_objects_device::static_set_config(*device, _interface);
downcast<atari_rle_objects_device &>(*device).set_config(_interface);
@ -80,8 +80,8 @@ public:
// construction/destruction
atari_rle_objects_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration helpers
static void static_set_config(device_t &device, const atari_rle_objects_config &config);
// configuration helpers
void set_config(const atari_rle_objects_config &config);
// control handlers
DECLARE_WRITE8_MEMBER(control_write);

View File

@ -1462,9 +1462,9 @@ void dvg_device::device_start()
register_state();
}
void avgdvg_device::static_set_vector_tag(device_t &device, const char *tag)
void avgdvg_device::set_vector_tag(const char *tag)
{
downcast<avgdvg_device &>(device).m_vector.set_tag(tag);
m_vector.set_tag(tag);
}
avgdvg_device::avgdvg_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)

View File

@ -9,14 +9,14 @@
#include "video/vector.h"
#define MCFG_AVGDVG_VECTOR(_tag) \
avgdvg_device::static_set_vector_tag(*device, "^" _tag);
downcast<avgdvg_device &>(*device).set_vector_tag("^" _tag);
// ======================> avgdvg_device
class avgdvg_device : public device_t
{
public:
static void static_set_vector_tag(device_t &device, const char *tag);
void set_vector_tag(const char *tag);
DECLARE_CUSTOM_INPUT_MEMBER(done_r);
DECLARE_WRITE8_MEMBER(go_w);

View File

@ -13,7 +13,7 @@
#include "screen.h"
#define MCFG_BFM_DM01_BUSY_CB(_devcb) \
devcb = &bfm_dm01_device::set_busy_callback(*device, DEVCB_##_devcb);
devcb = &downcast<bfm_dm01_device &>(*device).set_busy_callback(DEVCB_##_devcb);
class bfm_dm01_device : public device_t
{
@ -21,7 +21,7 @@ public:
bfm_dm01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~bfm_dm01_device() {}
template <class Object> static devcb_base &set_busy_callback(device_t &device, Object &&cb) { return downcast<bfm_dm01_device &>(device).m_busy_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_busy_callback(Object &&cb) { return m_busy_cb.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( control_r );
DECLARE_WRITE8_MEMBER( control_w );

View File

@ -19,13 +19,13 @@
//**************************************************************************
#define MCFG_CRT_NUM_LEVELS(_lev) \
crt_device::set_num_levels(*device, _lev);
downcast<crt_device &>(*device).set_num_levels(_lev);
#define MCFG_CRT_OFFSETS(_xoffs, _yoffs) \
crt_device::set_offsets(*device, _xoffs, _yoffs);
downcast<crt_device &>(*device).set_offsets(_xoffs, _yoffs);
#define MCFG_CRT_SIZE(_width, _height) \
crt_device::set_size(*device, _width, _height);
downcast<crt_device &>(*device).set_size(_width, _height);
//**************************************************************************
@ -39,18 +39,16 @@ class crt_device : public device_t
public:
crt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
static void set_num_levels(device_t &device, int levels) { downcast<crt_device &>(device).m_num_intensity_levels = levels; }
static void set_offsets(device_t &device, int x_offset, int y_offset)
void set_num_levels(int levels) { m_num_intensity_levels = levels; }
void set_offsets(int x_offset, int y_offset)
{
crt_device &dev = downcast<crt_device &>(device);
dev.m_window_offset_x = x_offset;
dev.m_window_offset_y = y_offset;
m_window_offset_x = x_offset;
m_window_offset_y = y_offset;
}
static void set_size(device_t &device, int width, int height)
void set_size(int width, int height)
{
crt_device &dev = downcast<crt_device &>(device);
dev.m_window_width = width;
dev.m_window_height = height;
m_window_width = width;
m_window_height = height;
}
void plot(int x, int y);

View File

@ -94,13 +94,13 @@ deco_bac06_device::deco_bac06_device(const machine_config &mconfig, const char *
}
//-------------------------------------------------
// static_set_gfxdecode_tag: Set the tag of the
// set_gfxdecode_tag: Set the tag of the
// gfx decoder
//-------------------------------------------------
void deco_bac06_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void deco_bac06_device::set_gfxdecode_tag(const char *tag)
{
downcast<deco_bac06_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}
void deco_bac06_device::device_start()
@ -134,12 +134,11 @@ void deco_bac06_device::device_reset()
{
}
void deco_bac06_device::set_gfx_region_wide(device_t &device, int region8x8, int region16x16, int wide)
void deco_bac06_device::set_gfx_region_wide(int region8x8, int region16x16, int wide)
{
deco_bac06_device &dev = downcast<deco_bac06_device &>(device);
dev.m_gfxregion8x8 = region8x8;
dev.m_gfxregion16x16 = region16x16;
dev.m_wide = wide;
m_gfxregion8x8 = region8x8;
m_gfxregion16x16 = region16x16;
m_wide = wide;
}
void deco_bac06_device::set_flip_screen(bool flip)

View File

@ -8,13 +8,13 @@
#include <memory>
#define MCFG_BAC06_BOOTLEG_DISABLE_8x8 \
deco_bac06_device::disable_8x8(*device);
downcast<deco_bac06_device &>(*device).disable_8x8();
#define MCFG_BAC06_BOOTLEG_DISABLE_16x16 \
deco_bac06_device::disable_16x16(*device);
downcast<deco_bac06_device &>(*device).disable_16x16();
#define MCFG_BAC06_BOOTLEG_DISABLE_RC_SCROLL \
deco_bac06_device::disable_rc_scroll(*device);
downcast<deco_bac06_device &>(*device).disable_rc_scroll();
class deco_bac06_device : public device_t
@ -22,9 +22,12 @@ class deco_bac06_device : public device_t
public:
deco_bac06_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
static void set_gfx_region_wide(device_t &device, int region8x8, int region16x16, int wide);
// configuration
void set_gfxdecode_tag(const char *tag);
void set_gfx_region_wide(int region8x8, int region16x16, int wide);
void disable_8x8() { m_supports_8x8 = false; }
void disable_16x16() { m_supports_16x16 = false; }
void disable_rc_scroll() { m_supports_rc_scroll = false; }
std::unique_ptr<uint16_t[]> m_pf_data;
std::unique_ptr<uint16_t[]> m_pf_rowscroll;
@ -40,24 +43,6 @@ public:
bool m_supports_16x16;
bool m_supports_rc_scroll;
static void disable_8x8(device_t &device)
{
deco_bac06_device &dev = downcast<deco_bac06_device &>(device);
dev.m_supports_8x8 = false;
}
static void disable_16x16(device_t &device)
{
deco_bac06_device &dev = downcast<deco_bac06_device &>(device);
dev.m_supports_16x16 = false;
}
static void disable_rc_scroll(device_t &device)
{
deco_bac06_device &dev = downcast<deco_bac06_device &>(device);
dev.m_supports_rc_scroll = false;
}
void create_tilemaps(int region8x8,int region16x16);
uint16_t m_pf_control_0[8];
uint16_t m_pf_control_1[8];
@ -159,9 +144,9 @@ private:
DECLARE_DEVICE_TYPE(DECO_BAC06, deco_bac06_device)
#define MCFG_DECO_BAC06_GFXDECODE(_gfxtag) \
deco_bac06_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<deco_bac06_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
#define MCFG_DECO_BAC06_GFX_REGION_WIDE(_8x8, _16x16, _wide) \
deco_bac06_device::set_gfx_region_wide(*device, _8x8, _16x16, _wide);
downcast<deco_bac06_device &>(*device).set_gfx_region_wide(_8x8, _16x16, _wide);
#endif // MAME_VIDEO_DECOBAC06_H

View File

@ -6,10 +6,9 @@
#include "emu.h"
#include "deckarn.h"
void deco_karnovsprites_device::set_gfx_region(device_t &device, int region)
void deco_karnovsprites_device::set_gfx_region(int region)
{
deco_karnovsprites_device &dev = downcast<deco_karnovsprites_device &>(device);
dev.m_gfxregion = region;
m_gfxregion = region;
}
DEFINE_DEVICE_TYPE(DECO_KARNOVSPRITES, deco_karnovsprites_device, "deco_karnovsprites", "DECO Karnov Sprites")
@ -22,13 +21,13 @@ deco_karnovsprites_device::deco_karnovsprites_device(const machine_config &mconf
}
//-------------------------------------------------
// static_set_gfxdecode_tag: Set the tag of the
// set_gfxdecode_tag: Set the tag of the
// gfx decoder
//-------------------------------------------------
void deco_karnovsprites_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void deco_karnovsprites_device::set_gfxdecode_tag(const char *tag)
{
downcast<deco_karnovsprites_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}
void deco_karnovsprites_device::device_start()

View File

@ -14,9 +14,9 @@ public:
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int size, int priority);
void set_flip_screen(bool flip) { m_flip_screen = flip; }
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
static void set_gfx_region(device_t &device, int region);
// configuration
void set_gfxdecode_tag(const char *tag);
void set_gfx_region(int region);
protected:
virtual void device_start() override;
@ -31,9 +31,9 @@ private:
DECLARE_DEVICE_TYPE(DECO_KARNOVSPRITES, deco_karnovsprites_device)
#define MCFG_DECO_KARNOVSPRITES_GFXDECODE(_gfxtag) \
deco_karnovsprites_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<deco_karnovsprites_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
#define MCFG_DECO_KARNOVSPRITES_GFX_REGION(_region) \
deco_karnovsprites_device::set_gfx_region(*device, _region);
downcast<deco_karnovsprites_device &>(*device).set_gfx_region(_region);
#endif // MAME_VIDEO_DECKARN_H

View File

@ -41,10 +41,9 @@ todo:
#include "decmxc06.h"
#include "screen.h"
void deco_mxc06_device::set_gfx_region(device_t &device, int region)
void deco_mxc06_device::set_gfx_region(int region)
{
deco_mxc06_device &dev = downcast<deco_mxc06_device &>(device);
dev.m_gfxregion = region;
m_gfxregion = region;
}
@ -60,13 +59,13 @@ deco_mxc06_device::deco_mxc06_device(const machine_config &mconfig, const char *
}
//-------------------------------------------------
// static_set_gfxdecode_tag: Set the tag of the
// set_gfxdecode_tag: Set the tag of the
// gfx decoder
//-------------------------------------------------
void deco_mxc06_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void deco_mxc06_device::set_gfxdecode_tag(const char *tag)
{
downcast<deco_mxc06_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}

View File

@ -11,15 +11,10 @@ class deco_mxc06_device : public device_t, public device_video_interface
public:
deco_mxc06_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
static void set_gfx_region(device_t &device, int region);
static void set_ram_size(device_t &device, int size)
{
deco_mxc06_device &dev = downcast<deco_mxc06_device &>(device);
dev.m_ramsize = size;
}
// configuration
void set_gfxdecode_tag(const char *tag);
void set_gfx_region(int region);
void set_ram_size(int size) { m_ramsize = size; }
void set_gfxregion(int region) { m_gfxregion = region; };
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram16, int pri_mask, int pri_val, int col_mask);
@ -43,12 +38,12 @@ private:
DECLARE_DEVICE_TYPE(DECO_MXC06, deco_mxc06_device)
#define MCFG_DECO_MXC06_GFXDECODE(_gfxtag) \
deco_mxc06_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<deco_mxc06_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
#define MCFG_DECO_MXC06_GFX_REGION(_region) \
deco_mxc06_device::set_gfx_region(*device, _region);
downcast<deco_mxc06_device &>(*device).set_gfx_region(_region);
#define MCFG_DECO_MXC06_RAMSIZE(_size) \
deco_mxc06_device::set_ram_size(*device, _size);
downcast<deco_mxc06_device &>(*device).set_ram_size(_size);
#endif // MAME_VIDEO_DECMXC06_H

View File

@ -207,13 +207,13 @@ deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag,
}
//-------------------------------------------------
// static_set_gfxdecode_tag: Set the tag of the
// set_gfxdecode_tag: Set the tag of the
// gfx decoder
//-------------------------------------------------
void deco16ic_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void deco16ic_device::set_gfxdecode_tag(const char *tag)
{
downcast<deco16ic_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}
//-------------------------------------------------

View File

@ -32,22 +32,22 @@ public:
deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~deco16ic_device() {}
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
static void static_set_palette_tag(device_t &device, const char *tag);
static void set_bank1_callback(device_t &device, deco16_bank_cb_delegate callback) { downcast<deco16ic_device &>(device).m_bank1_cb = callback; }
static void set_bank2_callback(device_t &device, deco16_bank_cb_delegate callback) { downcast<deco16ic_device &>(device).m_bank2_cb = callback; }
static void set_split(device_t &device, int split) { downcast<deco16ic_device &>(device).m_split = split; }
static void set_pf1_size(device_t &device, int size) { downcast<deco16ic_device &>(device).m_pf1_size = size; }
static void set_pf2_size(device_t &device, int size) { downcast<deco16ic_device &>(device).m_pf2_size = size; }
static void set_pf1_trans_mask(device_t &device, int mask) { downcast<deco16ic_device &>(device).m_pf1_trans_mask = mask; }
static void set_pf2_trans_mask(device_t &device, int mask) { downcast<deco16ic_device &>(device).m_pf2_trans_mask = mask; }
static void set_pf1_col_mask(device_t &device, int mask) { downcast<deco16ic_device &>(device).m_pf1_colourmask = mask; }
static void set_pf2_col_mask(device_t &device, int mask) { downcast<deco16ic_device &>(device).m_pf2_colourmask = mask; }
static void set_pf1_col_bank(device_t &device, int bank) { downcast<deco16ic_device &>(device).m_pf1_colour_bank = bank; }
static void set_pf2_col_bank(device_t &device, int bank) { downcast<deco16ic_device &>(device).m_pf2_colour_bank = bank; }
static void set_pf12_8x8_bank(device_t &device, int bank) { downcast<deco16ic_device &>(device).m_pf12_8x8_gfx_bank = bank; }
static void set_pf12_16x16_bank(device_t &device, int bank) { downcast<deco16ic_device &>(device).m_pf12_16x16_gfx_bank = bank; }
// configuration
void set_gfxdecode_tag(const char *tag);
void set_palette_tag(const char *tag);
void set_bank1_callback(deco16_bank_cb_delegate callback) { m_bank1_cb = callback; }
void set_bank2_callback(deco16_bank_cb_delegate callback) { m_bank2_cb = callback; }
void set_split(int split) { m_split = split; }
void set_pf1_size(int size) { m_pf1_size = size; }
void set_pf2_size(int size) { m_pf2_size = size; }
void set_pf1_trans_mask(int mask) { m_pf1_trans_mask = mask; }
void set_pf2_trans_mask(int mask) { m_pf2_trans_mask = mask; }
void set_pf1_col_mask(int mask) { m_pf1_colourmask = mask; }
void set_pf2_col_mask(int mask) { m_pf2_colourmask = mask; }
void set_pf1_col_bank(int bank) { m_pf1_colour_bank = bank; }
void set_pf2_col_bank(int bank) { m_pf2_colour_bank = bank; }
void set_pf12_8x8_bank(int bank) { m_pf12_8x8_gfx_bank = bank; }
void set_pf12_16x16_bank(int bank) { m_pf12_16x16_gfx_bank = bank; }
DECLARE_WRITE16_MEMBER( pf1_data_w );
@ -173,46 +173,46 @@ DECLARE_DEVICE_TYPE(DECO16IC, deco16ic_device)
#define MCFG_DECO16IC_SET_SCREEN MCFG_VIDEO_SET_SCREEN
#define MCFG_DECO16IC_BANK1_CB(_class, _method) \
deco16ic_device::set_bank1_callback(*device, deco16_bank_cb_delegate(&_class::_method, #_class "::" #_method, this));
downcast<deco16ic_device &>(*device).set_bank1_callback(deco16_bank_cb_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_DECO16IC_BANK2_CB(_class, _method) \
deco16ic_device::set_bank2_callback(*device, deco16_bank_cb_delegate(&_class::_method, #_class "::" #_method, this));
downcast<deco16ic_device &>(*device).set_bank2_callback(deco16_bank_cb_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_DECO16IC_SPLIT(_split) \
deco16ic_device::set_split(*device, _split);
downcast<deco16ic_device &>(*device).set_split(_split);
#define MCFG_DECO16IC_PF1_SIZE(_size) \
deco16ic_device::set_pf1_size(*device, _size);
downcast<deco16ic_device &>(*device).set_pf1_size(_size);
#define MCFG_DECO16IC_PF2_SIZE(_size) \
deco16ic_device::set_pf2_size(*device, _size);
downcast<deco16ic_device &>(*device).set_pf2_size(_size);
#define MCFG_DECO16IC_PF1_TRANS_MASK(_mask) \
deco16ic_device::set_pf1_trans_mask(*device, _mask);
downcast<deco16ic_device &>(*device).set_pf1_trans_mask(_mask);
#define MCFG_DECO16IC_PF2_TRANS_MASK(_mask) \
deco16ic_device::set_pf2_trans_mask(*device, _mask);
downcast<deco16ic_device &>(*device).set_pf2_trans_mask(_mask);
#define MCFG_DECO16IC_PF1_COL_MASK(_mask) \
deco16ic_device::set_pf1_col_mask(*device, _mask);
downcast<deco16ic_device &>(*device).set_pf1_col_mask(_mask);
#define MCFG_DECO16IC_PF2_COL_MASK(_mask) \
deco16ic_device::set_pf2_col_mask(*device, _mask);
downcast<deco16ic_device &>(*device).set_pf2_col_mask(_mask);
#define MCFG_DECO16IC_PF1_COL_BANK(_bank) \
deco16ic_device::set_pf1_col_bank(*device, _bank);
downcast<deco16ic_device &>(*device).set_pf1_col_bank(_bank);
#define MCFG_DECO16IC_PF2_COL_BANK(_bank) \
deco16ic_device::set_pf2_col_bank(*device, _bank);
downcast<deco16ic_device &>(*device).set_pf2_col_bank(_bank);
#define MCFG_DECO16IC_PF12_8X8_BANK(_bank) \
deco16ic_device::set_pf12_8x8_bank(*device, _bank);
downcast<deco16ic_device &>(*device).set_pf12_8x8_bank(_bank);
#define MCFG_DECO16IC_PF12_16X16_BANK(_bank) \
deco16ic_device::set_pf12_16x16_bank(*device, _bank);
downcast<deco16ic_device &>(*device).set_pf12_16x16_bank(_bank);
#define MCFG_DECO16IC_GFXDECODE(_gfxtag) \
deco16ic_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<deco16ic_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
// function definition for a callback
#define DECO16IC_BANK_CB_MEMBER(_name) int _name(int bank)

View File

@ -74,13 +74,13 @@ deco_ace_device::deco_ace_device(const machine_config &mconfig, const char *tag,
}
//-------------------------------------------------
// static_set_palette_tag: Set the tag of the
// set_palette_tag: Set the tag of the
// palette device
//-------------------------------------------------
void deco_ace_device::static_set_palette_tag(device_t &device, const char *tag)
void deco_ace_device::set_palette_tag(const char *tag)
{
downcast<deco_ace_device &>(device).m_palette.set_tag(tag);
m_palette.set_tag(tag);
}
//-------------------------------------------------

View File

@ -26,8 +26,8 @@ class deco_ace_device : public device_t,
public:
deco_ace_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void static_set_palette_tag(device_t &device, const char *tag);
// configuration
void set_palette_tag(const char *tag);
DECLARE_READ32_MEMBER( buffered_palette_r );
DECLARE_READ16_MEMBER( buffered_palette16_r );
@ -69,6 +69,6 @@ DECLARE_DEVICE_TYPE(DECO_ACE, deco_ace_device)
MCFG_DEVICE_ADD(_tag, DECO_ACE, 0)
#define MCFG_DECO_ACE_PALETTE(_palette_tag) \
deco_ace_device::static_set_palette_tag(*device, "^" _palette_tag);
downcast<deco_ace_device &>(*device).set_palette_tag("^" _palette_tag);
#endif // MAME_VIDEO_DECO_ACE_H

View File

@ -22,13 +22,13 @@ deco_zoomspr_device::deco_zoomspr_device(const machine_config &mconfig, const ch
}
//-------------------------------------------------
// static_set_gfxdecode_tag: Set the tag of the
// set_gfxdecode_tag: Set the tag of the
// gfx decoder
//-------------------------------------------------
void deco_zoomspr_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void deco_zoomspr_device::set_gfxdecode_tag(const char *tag)
{
downcast<deco_zoomspr_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}

View File

@ -11,7 +11,7 @@ class deco_zoomspr_device : public device_t
public:
deco_zoomspr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
void set_gfxdecode_tag(const char *tag);
void dragngun_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, const uint32_t *spritedata, uint32_t* dragngun_sprite_layout_0_ram, uint32_t* dragngun_sprite_layout_1_ram, uint32_t* dragngun_sprite_lookup_0_ram, uint32_t* dragngun_sprite_lookup_1_ram, uint32_t dragngun_sprite_ctrl, bitmap_ind8 &pri_bitmap, bitmap_rgb32 &temp_bitmap);
@ -36,6 +36,6 @@ private:
DECLARE_DEVICE_TYPE(DECO_ZOOMSPR, deco_zoomspr_device)
#define MCFG_DECO_ZOOMSPR_GFXDECODE(_gfxtag) \
deco_zoomspr_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<deco_zoomspr_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
#endif // MAME_VIDEO_DECO_ZOOMSPR_H

View File

@ -23,13 +23,13 @@ decocomn_device::decocomn_device(const machine_config &mconfig, const char *tag,
}
//-------------------------------------------------
// static_set_palette_tag: Set the tag of the
// set_palette_tag: Set the tag of the
// palette device
//-------------------------------------------------
void decocomn_device::static_set_palette_tag(device_t &device, const char *tag)
void decocomn_device::set_palette_tag(const char *tag)
{
downcast<decocomn_device &>(device).m_palette.set_tag(tag);
m_palette.set_tag(tag);
}
//-------------------------------------------------

View File

@ -22,8 +22,8 @@ class decocomn_device : public device_t,
public:
decocomn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void static_set_palette_tag(device_t &device, const char *tag);
// configuration
void set_palette_tag(const char *tag);
DECLARE_WRITE16_MEMBER( buffered_palette_w );
DECLARE_WRITE16_MEMBER( palette_dma_w );
@ -56,6 +56,6 @@ DECLARE_DEVICE_TYPE(DECOCOMN, decocomn_device)
MCFG_DEVICE_ADD(_tag, DECOCOMN, 0)
#define MCFG_DECOCOMN_PALETTE(_palette_tag) \
decocomn_device::static_set_palette_tag(*device, "^" _palette_tag);
downcast<decocomn_device &>(*device).set_palette_tag("^" _palette_tag);
#endif // MAME_VIDEO_DECOCOMN_H

View File

@ -266,10 +266,9 @@ void decodmd_type1_device::device_reset()
m_frameswap = false;
}
void decodmd_type1_device::static_set_gfxregion(device_t &device, const char *tag)
void decodmd_type1_device::set_gfxregion(const char *tag)
{
decodmd_type1_device &cpuboard = downcast<decodmd_type1_device &>(device);
cpuboard.m_gfxtag = tag;
m_gfxtag = tag;
}
uint32_t decodmd_type1_device::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )

View File

@ -16,7 +16,7 @@
#define MCFG_DECODMD_TYPE1_ADD(_tag, _region) \
MCFG_DEVICE_ADD(_tag, DECODMD1, 0) \
decodmd_type1_device::static_set_gfxregion(*device, _region);
downcast<decodmd_type1_device &>(*device).set_gfxregion(_region);
class decodmd_type1_device : public device_t
{
@ -45,7 +45,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(rowclock_w);
DECLARE_WRITE_LINE_MEMBER(test_w);
static void static_set_gfxregion(device_t &device, const char *tag);
void set_gfxregion(const char *tag);
void decodmd1_io_map(address_map &map);
void decodmd1_map(address_map &map);

View File

@ -188,8 +188,7 @@ void decodmd_type2_device::device_reset()
m_busy = false;
}
void decodmd_type2_device::static_set_gfxregion(device_t &device, const char *tag)
void decodmd_type2_device::set_gfxregion(const char *tag)
{
decodmd_type2_device &cpuboard = downcast<decodmd_type2_device &>(device);
cpuboard.m_gfxtag = tag;
m_gfxtag = tag;
}

View File

@ -16,7 +16,7 @@
#define MCFG_DECODMD_TYPE2_ADD(_tag, _region) \
MCFG_DEVICE_ADD(_tag, DECODMD2, 0) \
decodmd_type2_device::static_set_gfxregion(*device, _region);
downcast<decodmd_type2_device &>(*device).set_gfxregion(_region);
class decodmd_type2_device : public device_t
{
@ -35,7 +35,7 @@ public:
DECLARE_READ8_MEMBER(status_r);
DECLARE_WRITE8_MEMBER(status_w);
static void static_set_gfxregion(device_t &device, const char *tag);
void set_gfxregion(const char *tag);
void decodmd2_map(address_map &map);
protected:

View File

@ -184,8 +184,7 @@ void decodmd_type3_device::device_reset()
m_rombank->set_entry(0);
}
void decodmd_type3_device::static_set_gfxregion(device_t &device, const char *tag)
void decodmd_type3_device::set_gfxregion(const char *tag)
{
decodmd_type3_device &cpuboard = downcast<decodmd_type3_device &>(device);
cpuboard.m_gfxtag = tag;
m_gfxtag = tag;
}

View File

@ -16,7 +16,7 @@
#define MCFG_DECODMD_TYPE3_ADD(_tag, _region) \
MCFG_DEVICE_ADD(_tag, DECODMD3, 0) \
decodmd_type3_device::static_set_gfxregion(*device, _region);
downcast<decodmd_type3_device &>(*device).set_gfxregion(_region);
class decodmd_type3_device : public device_t
{
@ -33,7 +33,7 @@ public:
DECLARE_WRITE16_MEMBER(crtc_register_w);
DECLARE_READ16_MEMBER(crtc_status_r);
static void static_set_gfxregion(device_t &device, const char *tag);
void set_gfxregion(const char *tag);
void decodmd3_map(address_map &map);
protected:

View File

@ -139,10 +139,9 @@ DECOSPR_COLOUR_CB_MEMBER(decospr_device::default_col_cb)
return (col >> 9) & 0x1f;
}
void decospr_device::set_gfx_region(device_t &device, int gfxregion)
void decospr_device::set_gfx_region(int gfxregion)
{
decospr_device &dev = downcast<decospr_device &>(device);
dev.m_gfxregion = gfxregion;
m_gfxregion = gfxregion;
// printf("decospr_device::set_gfx_region()\n");
}
@ -165,13 +164,13 @@ decospr_device::decospr_device(const machine_config &mconfig, const char *tag, d
}
//-------------------------------------------------
// static_set_gfxdecode_tag: Set the tag of the
// set_gfxdecode_tag: Set the tag of the
// gfx decoder
//-------------------------------------------------
void decospr_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void decospr_device::set_gfxdecode_tag(const char *tag)
{
downcast<decospr_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}
void decospr_device::device_start()

View File

@ -19,20 +19,19 @@ class decospr_device : public device_t, public device_video_interface
public:
decospr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
static void set_gfx_region(device_t &device, int gfxregion);
static void set_pri_callback(device_t &device, decospr_pri_cb_delegate callback) { downcast<decospr_device &>(device).m_pri_cb = callback; }
static void set_col_callback(device_t &device, decospr_col_cb_delegate callback) { downcast<decospr_device &>(device).m_col_cb = callback; }
static void set_is_bootleg(device_t &device, bool is_bootleg) { downcast<decospr_device &>(device).m_is_bootleg = is_bootleg; }
static void set_bootleg_type(device_t &device, int bootleg_type) { downcast<decospr_device &>(device).m_bootleg_type = bootleg_type; }
static void set_flipallx(device_t &device, int flipallx) { downcast<decospr_device &>(device).m_flipallx = flipallx; }
static void set_transpen(device_t &device, int transpen) { downcast<decospr_device &>(device).m_transpen = transpen; }
static void set_offsets(device_t &device, int x_offset, int y_offset)
// configuration
void set_gfxdecode_tag(const char *tag);
void set_gfx_region(int gfxregion);
void set_pri_callback(decospr_pri_cb_delegate callback) { m_pri_cb = callback; }
void set_col_callback(decospr_col_cb_delegate callback) { m_col_cb = callback; }
void set_is_bootleg(bool is_bootleg) { m_is_bootleg = is_bootleg; }
void set_bootleg_type(int bootleg_type) { m_bootleg_type = bootleg_type; }
void set_flipallx(int flipallx) { m_flipallx = flipallx; }
void set_transpen(int transpen) { m_transpen = transpen; }
void set_offsets(int x_offset, int y_offset)
{
decospr_device &dev = downcast<decospr_device &>(device);
dev.m_x_offset = x_offset;
dev.m_y_offset = y_offset;
m_x_offset = x_offset;
m_y_offset = y_offset;
}
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords);
@ -76,30 +75,30 @@ private:
DECLARE_DEVICE_TYPE(DECO_SPRITE, decospr_device)
#define MCFG_DECO_SPRITE_GFX_REGION(_region) \
decospr_device::set_gfx_region(*device, _region);
downcast<decospr_device &>(*device).set_gfx_region(_region);
#define MCFG_DECO_SPRITE_PRIORITY_CB(_class, _method) \
decospr_device::set_pri_callback(*device, decospr_pri_cb_delegate(&_class::_method, #_class "::" #_method, this));
downcast<decospr_device &>(*device).set_pri_callback(decospr_pri_cb_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_DECO_SPRITE_COLOUR_CB(_class, _method) \
decospr_device::set_col_callback(*device, decospr_col_cb_delegate(&_class::_method, #_class "::" #_method, this));
downcast<decospr_device &>(*device).set_col_callback(decospr_col_cb_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_DECO_SPRITE_ISBOOTLEG(_boot) \
decospr_device::set_is_bootleg(*device, _boot);
downcast<decospr_device &>(*device).set_is_bootleg(_boot);
#define MCFG_DECO_SPRITE_BOOTLEG_TYPE(_bootleg_type) \
decospr_device::set_bootleg_type(*device, _bootleg_type);
downcast<decospr_device &>(*device).set_bootleg_type(_bootleg_type);
#define MCFG_DECO_SPRITE_FLIPALLX(_flip) \
decospr_device::set_flipallx(*device, _flip);
downcast<decospr_device &>(*device).set_flipallx(_flip);
#define MCFG_DECO_SPRITE_TRANSPEN(_pen) \
decospr_device::set_transpen(*device, _pen);
downcast<decospr_device &>(*device).set_transpen(_pen);
#define MCFG_DECO_SPRITE_OFFSETS(_xoffs, _yoffs) \
decospr_device::set_offsets(*device, _xoffs, _yoffs);
downcast<decospr_device &>(*device).set_offsets(_xoffs, _yoffs);
#define MCFG_DECO_SPRITE_GFXDECODE(_gfxtag) \
decospr_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<decospr_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
#endif // MAME_VIDEO_DECOSPR_H

View File

@ -33,26 +33,26 @@ deco_rmc3_device::deco_rmc3_device(const machine_config &mconfig, const char *ta
// INITIALIZATION AND CONFIGURATION
//**************************************************************************
void deco_rmc3_device::static_set_init(device_t &device, deco_rmc3_palette_init_delegate init)
void deco_rmc3_device::set_init(deco_rmc3_palette_init_delegate init)
{
downcast<deco_rmc3_device &>(device).m_init = init;
m_init = init;
}
void deco_rmc3_device::static_set_entries(device_t &device, u32 entries)
void deco_rmc3_device::set_entries(u32 entries)
{
downcast<deco_rmc3_device &>(device).m_entries = entries;
m_entries = entries;
}
void deco_rmc3_device::static_set_indirect_entries(device_t &device, u32 entries)
void deco_rmc3_device::set_indirect_entries(u32 entries)
{
downcast<deco_rmc3_device &>(device).m_indirect_entries = entries;
m_indirect_entries = entries;
}
void deco_rmc3_device::static_set_prom_region(device_t &device, const char *region)
void deco_rmc3_device::set_prom_region(const char *region)
{
downcast<deco_rmc3_device &>(device).m_prom_region.set_tag(region);
m_prom_region.set_tag(region);
}

View File

@ -32,19 +32,19 @@
#define MCFG_DECO_RMC3_MODIFY MCFG_DEVICE_MODIFY
#define MCFG_DECO_RMC3_SET_PALETTE_SIZE(_entries) \
deco_rmc3_device::static_set_entries(*device, _entries);
downcast<deco_rmc3_device &>(*device).set_entries(_entries);
#define MCFG_DECO_RMC3_INDIRECT_ENTRIES(_entries) \
deco_rmc3_device::static_set_indirect_entries(*device, _entries);
downcast<deco_rmc3_device &>(*device).set_indirect_entries( _entries);
// other standard palettes
#define MCFG_DECO_RMC3_ADD_PROMS(_tag, _region, _entries) \
MCFG_DECO_RMC3_ADD(_tag, _entries) \
deco_rmc3_device::static_set_prom_region(*device, "^" _region); \
deco_rmc3_device::static_set_init(*device, deco_rmc3_palette_init_delegate(FUNC(deco_rmc3_device::palette_init_proms), downcast<deco_rmc3_device *>(device)));
downcast<deco_rmc3_device &>(*device).set_prom_region("^" _region); \
downcast<deco_rmc3_device &>(*device).set_init(deco_rmc3_palette_init_delegate(FUNC(deco_rmc3_device::palette_init_proms), downcast<deco_rmc3_device *>(device)));
//#define MCFG_DECO_RMC3_INIT_OWNER(_class, _method)
// deco_rmc3_device::static_set_init(*device, deco_rmc3_palette_init_delegate(&_class::PALETTE_INIT_NAME(_method), #_class "::palette_init_" #_method, this));
// downcast<deco_rmc3_device &>(*device).set_init(deco_rmc3_palette_init_delegate(&_class::PALETTE_INIT_NAME(_method), #_class "::palette_init_" #_method, this));
//**************************************************************************
// TYPE DEFINITIONS
@ -61,13 +61,13 @@ public:
// construction/destruction
deco_rmc3_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
// static configuration
static void static_set_init(device_t &device, deco_rmc3_palette_init_delegate init);
static void static_set_membits(device_t &device, int membits);
static void static_set_endianness(device_t &device, endianness_t endianness);
static void static_set_entries(device_t &device, u32 entries);
static void static_set_indirect_entries(device_t &device, u32 entries);
static void static_set_prom_region(device_t &device, const char *region);
// configuration
void set_init(deco_rmc3_palette_init_delegate init);
void set_membits(int membits);
void set_endianness(endianness_t endianness);
void set_entries(u32 entries);
void set_indirect_entries(u32 entries);
void set_prom_region(const char *region);
// palette RAM accessors
memory_array &basemem() { return m_paletteram; }

View File

@ -35,14 +35,14 @@ dooyong_tilemap_device_base::dooyong_tilemap_device_base(
{
}
void dooyong_tilemap_device_base::static_set_gfxdecode_tag(device_t &device, char const *tag)
void dooyong_tilemap_device_base::set_gfxdecode_tag(char const *tag)
{
downcast<dooyong_tilemap_device_base &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}
void dooyong_tilemap_device_base::static_set_gfxnum(device_t &device, int gfxnum)
void dooyong_tilemap_device_base::set_gfxnum(int gfxnum)
{
downcast<dooyong_tilemap_device_base &>(device).m_gfxnum = gfxnum;
m_gfxnum = gfxnum;
}
void dooyong_tilemap_device_base::draw(screen_device &screen, bitmap_ind16 &dest, rectangle const &cliprect, uint32_t flags, uint8_t priority)
@ -83,27 +83,26 @@ dooyong_rom_tilemap_device::dooyong_rom_tilemap_device(
{
}
void dooyong_rom_tilemap_device::static_set_tilerom_tag(device_t &device, char const *tag)
void dooyong_rom_tilemap_device::set_tilerom_tag(char const *tag)
{
downcast<dooyong_rom_tilemap_device &>(device).m_tilerom.set_tag(tag);
m_tilerom.set_tag(tag);
}
void dooyong_rom_tilemap_device::static_set_tilerom_offset(device_t &device, int offset)
void dooyong_rom_tilemap_device::set_tilerom_offset(int offset)
{
downcast<dooyong_rom_tilemap_device &>(device).m_tilerom_offset = offset;
m_tilerom_offset = offset;
}
void dooyong_rom_tilemap_device::static_set_transparent_pen(device_t &device, unsigned pen)
void dooyong_rom_tilemap_device::set_transparent_pen(unsigned pen)
{
downcast<dooyong_rom_tilemap_device &>(device).m_transparent_pen = pen;
m_transparent_pen = pen;
}
void dooyong_rom_tilemap_device::static_set_primella_code_bits(device_t &device, unsigned bits)
void dooyong_rom_tilemap_device::set_primella_code_bits(unsigned bits)
{
dooyong_rom_tilemap_device &tilemap_device(downcast<dooyong_rom_tilemap_device &>(device));
tilemap_device.m_primella_code_mask = (1U << bits) - 1U;
tilemap_device.m_primella_color_mask = ((1U << 14) - 1) & ~tilemap_device.m_primella_code_mask;
tilemap_device.m_primella_color_shift = bits;
m_primella_code_mask = (1U << bits) - 1U;
m_primella_color_mask = ((1U << 14) - 1) & ~m_primella_code_mask;
m_primella_color_shift = bits;
}
WRITE8_MEMBER(dooyong_rom_tilemap_device::ctrl_w)
@ -211,14 +210,14 @@ rshark_rom_tilemap_device::rshark_rom_tilemap_device(machine_config const &mconf
m_rows = 32;
}
void rshark_rom_tilemap_device::static_set_colorrom_tag(device_t &device, char const *tag)
void rshark_rom_tilemap_device::set_colorrom_tag(char const *tag)
{
downcast<rshark_rom_tilemap_device &>(device).m_colorrom.set_tag(tag);
m_colorrom.set_tag(tag);
}
void rshark_rom_tilemap_device::static_set_colorrom_offset(device_t &device, int offset)
void rshark_rom_tilemap_device::set_colorrom_offset(int offset)
{
downcast<rshark_rom_tilemap_device &>(device).m_colorrom_offset = offset;
m_colorrom_offset = offset;
}
void rshark_rom_tilemap_device::device_start()

View File

@ -9,29 +9,29 @@
#define MCFG_DOOYONG_ROM_TILEMAP_ADD(tag, gfx, num, rom, offset) \
MCFG_DEVICE_ADD(tag, DOOYONG_ROM_TILEMAP, 0) \
dooyong_rom_tilemap_device::static_set_gfxdecode_tag(*device, "^" gfx); \
dooyong_rom_tilemap_device::static_set_tilerom_tag(*device, "^" rom); \
dooyong_rom_tilemap_device::static_set_gfxnum(*device, (num)); \
dooyong_rom_tilemap_device::static_set_tilerom_offset(*device, (offset));
downcast<dooyong_rom_tilemap_device &>(*device).set_gfxdecode_tag("^" gfx); \
downcast<dooyong_rom_tilemap_device &>(*device).set_tilerom_tag("^" rom); \
downcast<dooyong_rom_tilemap_device &>(*device).set_gfxnum((num)); \
downcast<dooyong_rom_tilemap_device &>(*device).set_tilerom_offset((offset));
#define MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(pen) \
dooyong_rom_tilemap_device::static_set_transparent_pen(*device, (pen));
downcast<dooyong_rom_tilemap_device &>(*device).set_transparent_pen((pen));
#define MCFG_DOOYONG_ROM_TILEMAP_PRIMELLA_CODE_BITS(bits) \
dooyong_rom_tilemap_device::static_set_primella_code_bits(*device, (bits));
downcast<dooyong_rom_tilemap_device &>(*device).set_primella_code_bits((bits));
#define MCFG_RSHARK_ROM_TILEMAP_ADD(tag, gfx, num, rom, offset, rom2, offset2) \
MCFG_DEVICE_ADD(tag, RSHARK_ROM_TILEMAP, 0) \
dooyong_rom_tilemap_device::static_set_gfxdecode_tag(*device, "^" gfx); \
dooyong_rom_tilemap_device::static_set_tilerom_tag(*device, "^" rom); \
dooyong_rom_tilemap_device::static_set_gfxnum(*device, (num)); \
dooyong_rom_tilemap_device::static_set_tilerom_offset(*device, (offset)); \
dooyong_rom_tilemap_device::static_set_primella_code_bits(*device, 13); \
rshark_rom_tilemap_device::static_set_colorrom_tag(*device, "^" rom2); \
rshark_rom_tilemap_device::static_set_colorrom_offset(*device, (offset2));
downcast<rshark_rom_tilemap_device &>(*device).set_gfxdecode_tag("^" gfx); \
downcast<rshark_rom_tilemap_device &>(*device).set_tilerom_tag("^" rom); \
downcast<rshark_rom_tilemap_device &>(*device).set_gfxnum((num)); \
downcast<rshark_rom_tilemap_device &>(*device).set_tilerom_offset((offset)); \
downcast<rshark_rom_tilemap_device &>(*device).set_primella_code_bits(13); \
downcast<rshark_rom_tilemap_device &>(*device).set_colorrom_tag("^" rom2); \
downcast<rshark_rom_tilemap_device &>(*device).set_colorrom_offset((offset2));
#define MCFG_DOOYONG_RAM_TILEMAP_ADD(tag, gfx, num) \
MCFG_DEVICE_ADD(tag, DOOYONG_RAM_TILEMAP, 0) \
dooyong_rom_tilemap_device::static_set_gfxdecode_tag(*device, "^" gfx); \
dooyong_rom_tilemap_device::static_set_gfxnum(*device, (num));
downcast<dooyong_ram_tilemap_device &>(*device).set_gfxdecode_tag("^" gfx); \
downcast<dooyong_ram_tilemap_device &>(*device).set_gfxnum((num));
DECLARE_DEVICE_TYPE(DOOYONG_ROM_TILEMAP, dooyong_rom_tilemap_device)
@ -42,8 +42,8 @@ DECLARE_DEVICE_TYPE(DOOYONG_RAM_TILEMAP, dooyong_ram_tilemap_device)
class dooyong_tilemap_device_base : public device_t
{
public:
static void static_set_gfxdecode_tag(device_t &device, char const *tag);
static void static_set_gfxnum(device_t &device, int gfxnum);
void set_gfxdecode_tag(char const *tag);
void set_gfxnum(int gfxnum);
void draw(screen_device &screen, bitmap_ind16 &dest, rectangle const &cliprect, uint32_t flags, uint8_t priority);
@ -71,10 +71,10 @@ class dooyong_rom_tilemap_device : public dooyong_tilemap_device_base
public:
dooyong_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock);
static void static_set_tilerom_tag(device_t &device, char const *tag);
static void static_set_tilerom_offset(device_t &device, int offset);
static void static_set_transparent_pen(device_t &device, unsigned pen);
static void static_set_primella_code_bits(device_t &device, unsigned bits);
void set_tilerom_tag(char const *tag);
void set_tilerom_offset(int offset);
void set_transparent_pen(unsigned pen);
void set_primella_code_bits(unsigned bits);
DECLARE_WRITE8_MEMBER(ctrl_w);
@ -111,8 +111,8 @@ class rshark_rom_tilemap_device : public dooyong_rom_tilemap_device
public:
rshark_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock);
static void static_set_colorrom_tag(device_t &device, char const *tag);
static void static_set_colorrom_offset(device_t &device, int offset);
void set_colorrom_tag(char const *tag);
void set_colorrom_offset(int offset);
protected:
virtual void device_start() override;

View File

@ -16,9 +16,9 @@ fuukivid_device::fuukivid_device(const machine_config &mconfig, const char *tag,
{
}
void fuukivid_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void fuukivid_device::set_gfxdecode_tag(const char *tag)
{
downcast<fuukivid_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}

View File

@ -12,8 +12,8 @@ class fuukivid_device : public device_t,
public:
fuukivid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
// configuration
void set_gfxdecode_tag(const char *tag);
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flip_screen, uint32_t* tilebank);
std::unique_ptr<uint16_t[]> m_sprram;
@ -44,6 +44,6 @@ private:
DECLARE_DEVICE_TYPE(FUUKI_VIDEO, fuukivid_device)
#define MCFG_FUUKI_VIDEO_GFXDECODE(_gfxtag) \
fuukivid_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<fuukivid_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
#endif // MAME_VIDEO_FUUKIFH_H

View File

@ -25,7 +25,7 @@
#define MCFG_GIC_ADD(tag, clock, screen_tag, ram_cb) \
MCFG_DEVICE_ADD(tag, GIC, clock) \
MCFG_VIDEO_SET_SCREEN(screen_tag) \
gic_device::set_ram(*device, DEVCB_##ram_cb);
downcast<gic_device &>(*device).set_ram(DEVCB_##ram_cb);
/***************************************************************************
TYPE DEFINITIONS
@ -56,8 +56,8 @@ public:
// construction/destruction
gic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration helpers
template <typename Obj> static void set_ram(device_t &device, Obj &&cb) { downcast<gic_device &>(device).m_ram.set_callback(std::forward<Obj>(cb)); }
// configuration helpers
template <typename Obj> void set_ram(Obj &&cb) { m_ram.set_callback(std::forward<Obj>(cb)); }
DECLARE_PALETTE_INIT(gic);

View File

@ -28,22 +28,22 @@
#define MCFG_GIME_FSYNC_CALLBACK MCFG_MC6847_FSYNC_CALLBACK
#define MCFG_GIME_IRQ_CALLBACK(_write) \
devcb = &gime_device::set_irq_wr_callback(*device, DEVCB_##_write);
devcb = &downcast<gime_device &>(*device).set_irq_wr_callback(DEVCB_##_write);
#define MCFG_GIME_FIRQ_CALLBACK(_write) \
devcb = &gime_device::set_firq_wr_callback(*device, DEVCB_##_write);
devcb = &downcast<gime_device &>(*device).set_firq_wr_callback(DEVCB_##_write);
#define MCFG_GIME_FLOATING_BUS_CALLBACK(_read) \
devcb = &gime_device::set_floating_bus_rd_callback(*device, DEVCB_##_read);
devcb = &downcast<gime_device &>(*device).set_floating_bus_rd_callback(DEVCB_##_read);
#define MCFG_GIME_MAINCPU(_tag) \
gime_device::set_maincpu_tag(*device, _tag);
downcast<gime_device &>(*device).set_maincpu_tag(_tag);
#define MCFG_GIME_RAM(_tag) \
gime_device::set_ram_tag(*device, _tag);
downcast<gime_device &>(*device).set_ram_tag(_tag);
#define MCFG_GIME_EXT(_tag) \
gime_device::set_ext_tag(*device, _tag);
downcast<gime_device &>(*device).set_ext_tag(_tag);
//**************************************************************************
@ -55,12 +55,12 @@ class cococart_slot_device;
class gime_device : public mc6847_friend_device, public sam6883_friend_device_interface
{
public:
template <class Object> static devcb_base &set_irq_wr_callback(device_t &device, Object &&cb) { return downcast<gime_device &>(device).m_write_irq.set_callback(std::forward<Object>(cb)); }
template <class Object> static devcb_base &set_firq_wr_callback(device_t &device, Object &&cb) { return downcast<gime_device &>(device).m_write_firq.set_callback(std::forward<Object>(cb)); }
template <class Object> static devcb_base &set_floating_bus_rd_callback(device_t &device, Object &&cb) { return downcast<gime_device &>(device).m_read_floating_bus.set_callback(std::forward<Object>(cb)); }
static void set_maincpu_tag(device_t &device, const char *tag) { downcast<gime_device &>(device).m_maincpu_tag = tag; }
static void set_ram_tag(device_t &device, const char *tag) { downcast<gime_device &>(device).m_ram_tag = tag; }
static void set_ext_tag(device_t &device, const char *tag) { downcast<gime_device &>(device).m_ext_tag = tag; }
template <class Object> devcb_base &set_irq_wr_callback(Object &&cb) { return m_write_irq.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_firq_wr_callback(Object &&cb) { return m_write_firq.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_floating_bus_rd_callback(Object &&cb) { return m_read_floating_bus.set_callback(std::forward<Object>(cb)); }
void set_maincpu_tag(const char *tag) { m_maincpu_tag = tag; }
void set_ram_tag(const char *tag) { m_ram_tag = tag; }
void set_ext_tag(const char *tag) { m_ext_tag = tag; }
// read/write
DECLARE_READ8_MEMBER( read ) { return read(offset); }

View File

@ -7,7 +7,7 @@
#pragma once
#define MCFG_GP9001_VINT_CALLBACK(_devcb) \
devcb = &gp9001vdp_device::set_vint_out_cb(*device, DEVCB_##_devcb);
devcb = &downcast<gp9001vdp_device &>(*device).set_vint_out_cb(DEVCB_##_devcb);
class gp9001vdp_device : public device_t,
public device_gfx_interface,
@ -22,7 +22,7 @@ class gp9001vdp_device : public device_t,
public:
gp9001vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template<class Object> static devcb_base &set_vint_out_cb(device_t &device, Object &&obj) { return downcast<gp9001vdp_device &>(device).m_vint_out_cb.set_callback(std::forward<Object>(obj)); }
template<class Object> devcb_base &set_vint_out_cb(Object &&obj) { return m_vint_out_cb.set_callback(std::forward<Object>(obj)); }
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, const uint8_t* primap );
void gp9001_draw_custom_tilemap( bitmap_ind16 &bitmap, tilemap_t* tilemap, const uint8_t* priremap, const uint8_t* pri_enable );

View File

@ -17,10 +17,10 @@
#define MCFG_GTIA_READ_CB(_devcb) \
devcb = &gtia_device::set_read_callback(*device, DEVCB_##_devcb);
devcb = &downcast<gtia_device &>(*device).set_read_callback(DEVCB_##_devcb);
#define MCFG_GTIA_WRITE_CB(_devcb) \
devcb = &gtia_device::set_write_callback(*device, DEVCB_##_devcb);
devcb = &downcast<gtia_device &>(*device).set_write_callback(DEVCB_##_devcb);
// ======================> gtia_device
@ -31,8 +31,8 @@ public:
// construction/destruction
gtia_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <class Object> static devcb_base &set_read_callback(device_t &device, Object &&cb) { return downcast<gtia_device &>(device).m_read_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> static devcb_base &set_write_callback(device_t &device, Object &&cb) { return downcast<gtia_device &>(device).m_write_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_read_callback(Object &&cb) { return m_read_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_write_callback(Object &&cb) { return m_write_cb.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );

View File

@ -105,11 +105,9 @@ uint16_t igs017_igs031_device::palette_callback_straight(uint16_t bgr)
}
// static
void igs017_igs031_device::set_palette_scramble_cb(device_t &device,igs017_igs031_palette_scramble_delegate newtilecb)
void igs017_igs031_device::set_palette_scramble_cb(igs017_igs031_palette_scramble_delegate newtilecb)
{
igs017_igs031_device &dev = downcast<igs017_igs031_device &>(device);
dev.m_palette_scramble_cb = newtilecb;
m_palette_scramble_cb = newtilecb;
}

View File

@ -10,10 +10,10 @@
typedef device_delegate<uint16_t (uint16_t)> igs017_igs031_palette_scramble_delegate;
#define MCFG_PALETTE_SCRAMBLE_CB( _class, _method) \
igs017_igs031_device::set_palette_scramble_cb(*device, igs017_igs031_palette_scramble_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
downcast<igs017_igs031_device &>(*device).set_palette_scramble_cb(igs017_igs031_palette_scramble_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
#define MCFG_REVERSE_TEXT_BITS \
igs017_igs031_device::static_set_text_reverse_bits(*device);
downcast<igs017_igs031_device &>(*device).set_text_reverse_bits();
class igs017_igs031_device : public device_t,
public device_gfx_interface,
@ -24,12 +24,11 @@ public:
igs017_igs031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
static void set_palette_scramble_cb(device_t &device,igs017_igs031_palette_scramble_delegate newtilecb);
void set_palette_scramble_cb(igs017_igs031_palette_scramble_delegate newtilecb);
static void static_set_text_reverse_bits(device_t &device)
void set_text_reverse_bits()
{
igs017_igs031_device &dev = downcast<igs017_igs031_device &>(device);
dev.m_revbits = 1;
m_revbits = 1;
}
uint16_t palette_callback_straight(uint16_t bgr);

View File

@ -1462,7 +1462,7 @@ void k001005_device::draw( bitmap_rgb32 &bitmap, const rectangle &cliprect )
m_renderer->draw(bitmap, cliprect);
}
void k001005_device::set_texel_chip(device_t &device, const char *tag)
void k001005_device::set_texel_chip(const char *tag)
{
downcast<k001005_device &>(device).m_k001006_tag = tag;
m_k001006_tag = tag;
}

View File

@ -104,7 +104,7 @@ class k001005_device : public device_t, public device_video_interface
public:
k001005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
static void set_texel_chip(device_t &device, const char *tag);
void set_texel_chip(const char *tag);
void draw(bitmap_rgb32 &bitmap, const rectangle &cliprect);
void swap_buffers();
@ -140,6 +140,6 @@ DECLARE_DEVICE_TYPE(K001005, k001005_device)
#define MCFG_K001005_TEXEL_CHIP(_tag) \
k001005_device::set_texel_chip(*device, _tag);
downcast<k001005_device &>(*device).set_texel_chip(_tag);
#endif // MAME_VIDEO_K001005_H

View File

@ -13,9 +13,9 @@ public:
k001006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~k001006_device() {}
// static configuration
static void set_gfx_region(device_t &device, const char *tag) { downcast<k001006_device &>(device).m_gfx_region = tag; }
static void set_tex_layout(device_t &device, int layout) { downcast<k001006_device &>(device).m_tex_layout = layout; }
// configuration
void set_gfx_region(const char *tag) { m_gfx_region = tag; }
void set_tex_layout(int layout) { m_tex_layout = layout; }
uint32_t fetch_texel(int page, int pal_index, int u, int v);
void preprocess_texture_data(uint8_t *dst, uint8_t *src, int length, int gticlub);
@ -53,9 +53,9 @@ DECLARE_DEVICE_TYPE(K001006, k001006_device)
#define MCFG_K001006_GFX_REGION(_tag) \
k001006_device::set_gfx_region(*device, _tag);
downcast<k001006_device &>(*device).set_gfx_region(_tag);
#define MCFG_K001006_TEX_LAYOUT(x) \
k001006_device::set_tex_layout(*device, x);
downcast<k001006_device &>(*device).set_tex_layout(x);
#endif // MAME_VIDEO_K001006_H

View File

@ -11,11 +11,11 @@ class k001604_device : public device_t, public device_gfx_interface
public:
k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void set_layer_size(device_t &device, int size) { downcast<k001604_device &>(device).m_layer_size = size; }
static void set_roz_size(device_t &device, int size) { downcast<k001604_device &>(device).m_roz_size = size; }
static void set_txt_mem_offset(device_t &device, int offs) { downcast<k001604_device &>(device).m_txt_mem_offset = offs; }
static void set_roz_mem_offset(device_t &device, int offs) { downcast<k001604_device &>(device).m_roz_mem_offset = offs; }
// configuration
void set_layer_size(int size) { m_layer_size = size; }
void set_roz_size(int size) { m_roz_size = size; }
void set_txt_mem_offset(int offs) { m_txt_mem_offset = offs; }
void set_roz_mem_offset(int offs) { m_roz_mem_offset = offs; }
void draw_back_layer( bitmap_rgb32 &bitmap, const rectangle &cliprect );
void draw_front_layer( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect );
@ -58,16 +58,16 @@ DECLARE_DEVICE_TYPE(K001604, k001604_device)
#define MCFG_K001604_LAYER_SIZE(_size) \
k001604_device::set_layer_size(*device, _size);
downcast<k001604_device &>(*device).set_layer_size(_size);
#define MCFG_K001604_ROZ_SIZE(_size) \
k001604_device::set_roz_size(*device, _size);
downcast<k001604_device &>(*device).set_roz_size(_size);
#define MCFG_K001604_TXT_OFFSET(_offs) \
k001604_device::set_txt_mem_offset(*device, _offs);
downcast<k001604_device &>(*device).set_txt_mem_offset(_offs);
#define MCFG_K001604_ROZ_OFFSET(_offs) \
k001604_device::set_roz_mem_offset(*device, _offs);
downcast<k001604_device &>(*device).set_roz_mem_offset(_offs);
#define MCFG_K001604_PALETTE(_palette_tag) \
MCFG_GFX_PALETTE(_palette_tag)

View File

@ -349,11 +349,11 @@ void k007121_device::sprites_draw( bitmap_ind16 &bitmap, const rectangle &clipre
}
//-------------------------------------------------
// static_set_palette_tag: Set the tag of the
// set_palette_tag: Set the tag of the
// palette device
//-------------------------------------------------
void k007121_device::static_set_palette_tag(device_t &device, const char *tag)
void k007121_device::set_palette_tag(const char *tag)
{
downcast<k007121_device &>(device).m_palette.set_tag(tag);
m_palette.set_tag(tag);
}

View File

@ -11,7 +11,7 @@ class k007121_device : public device_t
public:
k007121_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
static void static_set_palette_tag(device_t &device, const char *tag);
void set_palette_tag(const char *tag);
uint8_t ctrlram_r(int offset);
DECLARE_WRITE8_MEMBER( ctrl_w );
@ -38,6 +38,6 @@ DECLARE_DEVICE_TYPE(K007121, k007121_device)
MCFG_DEVICE_ADD(_tag, K007121, 0)
#define MCFG_K007121_PALETTE(_palette_tag) \
k007121_device::static_set_palette_tag(*device, "^" _palette_tag);
downcast<k007121_device &>(*device).set_palette_tag("^" _palette_tag);
#endif // MAME_VIDEO_K007121_H

View File

@ -57,13 +57,13 @@ k007342_device::k007342_device(const machine_config &mconfig, const char *tag, d
}
//-------------------------------------------------
// static_set_gfxdecode_tag: Set the tag of the
// set_gfxdecode_tag: Set the tag of the
// gfx decoder
//-------------------------------------------------
void k007342_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void k007342_device::set_gfxdecode_tag(const char *tag)
{
downcast<k007342_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}
//-------------------------------------------------

View File

@ -13,10 +13,10 @@ class k007342_device : public device_t
public:
k007342_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
static void static_set_gfxnum(device_t &device, int gfxnum) { downcast<k007342_device &>(device).m_gfxnum = gfxnum; }
static void static_set_callback(device_t &device, k007342_delegate callback) { downcast<k007342_device &>(device).m_callback = callback; }
// configuration
void set_gfxdecode_tag(const char *tag);
void set_gfxnum(int gfxnum) { m_gfxnum = gfxnum; }
void set_callback(k007342_delegate callback) { m_callback = callback; }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@ -61,16 +61,16 @@ DECLARE_DEVICE_TYPE(K007342, k007342_device)
#define MCFG_K007342_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, K007342, 0)
#define MCFG_K007342_GFXDECODE(_gfxtag) \
k007342_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<k007342_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
#define MCFG_K007342_GFXNUM(_gfxnum) \
k007342_device::static_set_gfxnum(*device, _gfxnum);
downcast<k007342_device &>(*device).set_gfxnum(_gfxnum);
#define MCFG_K007342_CALLBACK_OWNER(_class, _method) \
k007342_device::static_set_callback(*device, k007342_delegate(&_class::_method, #_class "::" #_method, this));
downcast<k007342_device &>(*device).set_callback(k007342_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_K007342_CALLBACK_DEVICE(_tag, _class, _method) \
k007342_device::static_set_callback(*device, k007342_delegate(&_class::_method, #_class "::" #_method, _tag));
downcast<k007342_device &>(*device).set_callback(k007342_delegate(&_class::_method, #_class "::" #_method, _tag));
// function definition for a callback
#define K007342_CALLBACK_MEMBER(_name) void _name(int layer, int bank, int *code, int *color, int *flags)

View File

@ -250,11 +250,11 @@ void k007420_device::sprites_draw( bitmap_ind16 &bitmap, const rectangle &clipre
}
//-------------------------------------------------
// static_set_palette_tag: Set the tag of the
// set_palette_tag: Set the tag of the
// palette device
//-------------------------------------------------
void k007420_device::static_set_palette_tag(device_t &device, const char *tag)
void k007420_device::set_palette_tag(const char *tag)
{
downcast<k007420_device &>(device).m_palette.set_tag(tag);
m_palette.set_tag(tag);
}

View File

@ -13,9 +13,9 @@ class k007420_device : public device_t
public:
k007420_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
static void static_set_palette_tag(device_t &device, const char *tag);
static void static_set_bank_limit(device_t &device, int limit) { downcast<k007420_device &>(device).m_banklimit = limit; }
static void static_set_callback(device_t &device, k007420_delegate callback) { downcast<k007420_device &>(device).m_callback = callback; }
void set_palette_tag(const char *tag);
void set_bank_limit(int limit) { m_banklimit = limit; }
void set_callback(k007420_delegate callback) { m_callback = callback; }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@ -42,13 +42,13 @@ DECLARE_DEVICE_TYPE(K007420, k007420_device)
MCFG_DEVICE_ADD(_tag, K007420, 0)
#define MCFG_K007420_PALETTE(_palette_tag) \
k007420_device::static_set_palette_tag(*device, "^" _palette_tag);
downcast<k007420_device &>(*device).set_palette_tag("^" _palette_tag);
#define MCFG_K007420_BANK_LIMIT(_limit) \
k007420_device::static_set_bank_limit(*device, _limit);
downcast<k007420_device &>(*device).set_bank_limit(_limit);
#define MCFG_K007420_CALLBACK_OWNER(_class, _method) \
k007420_device::static_set_callback(*device, k007420_delegate(&_class::_method, #_class "::" #_method, this));
downcast<k007420_device &>(*device).set_callback(k007420_delegate(&_class::_method, #_class "::" #_method, this));
// function definition for a callback
#define K007420_CALLBACK_MEMBER(_name) void _name(int *code, int *color)

View File

@ -11,8 +11,8 @@ class k037122_device : public device_t,
public:
k037122_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void static_set_gfx_index(device_t &device, int index) { downcast<k037122_device &>(device).m_gfx_index = index; }
// configuration
void set_gfx_index(int index) { m_gfx_index = index; }
void tile_draw( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect );
DECLARE_READ32_MEMBER( sram_r );

View File

@ -116,27 +116,25 @@ k051316_device::k051316_device(const machine_config &mconfig, const char *tag, d
{
}
void k051316_device::set_bpp(device_t &device, int bpp)
void k051316_device::set_bpp(int bpp)
{
k051316_device &dev = downcast<k051316_device &>(device);
switch(bpp)
{
case 4:
device_gfx_interface::static_set_info(dev, gfxinfo);
dev.m_pixels_per_byte = 2;
device_gfx_interface::static_set_info(*this, gfxinfo);
m_pixels_per_byte = 2;
break;
case 7:
device_gfx_interface::static_set_info(dev, gfxinfo7);
dev.m_pixels_per_byte = 1;
device_gfx_interface::static_set_info(*this, gfxinfo7);
m_pixels_per_byte = 1;
break;
case 8:
device_gfx_interface::static_set_info(dev, gfxinfo8);
dev.m_pixels_per_byte = 1;
device_gfx_interface::static_set_info(*this, gfxinfo8);
m_pixels_per_byte = 1;
break;
case -4:
device_gfx_interface::static_set_info(dev, gfxinfo4_ram);
dev.m_pixels_per_byte = 2;
device_gfx_interface::static_set_info(*this, gfxinfo4_ram);
m_pixels_per_byte = 2;
break;
default:
fatalerror("Unsupported bpp\n");

View File

@ -11,19 +11,19 @@ typedef device_delegate<void (int *code, int *color, int *flags)> k051316_cb_del
#define MCFG_K051316_CB(_class, _method) \
k051316_device::set_k051316_callback(*device, k051316_cb_delegate(&_class::_method, #_class "::" #_method, this));
downcast<k051316_device &>(*device).set_k051316_callback(k051316_cb_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_K051316_OFFSETS(_xoffs, _yoffs) \
k051316_device::set_offsets(*device, _xoffs, _yoffs);
downcast<k051316_device &>(*device).set_offsets(_xoffs, _yoffs);
#define MCFG_K051316_BPP(_bpp) \
k051316_device::set_bpp(*device, _bpp);
downcast<k051316_device &>(*device).set_bpp(_bpp);
#define MCFG_K051316_LAYER_MASK(_mask) \
k051316_device::set_layermask(*device, _mask);
downcast<k051316_device &>(*device).set_layermask(_mask);
#define MCFG_K051316_WRAP(_wrap) \
k051316_device::set_wrap(*device, _wrap);
downcast<k051316_device &>(*device).set_wrap(_wrap);
class k051316_device : public device_t, public device_gfx_interface
@ -39,16 +39,15 @@ public:
DECLARE_GFXDECODE_MEMBER(gfxinfo8);
DECLARE_GFXDECODE_MEMBER(gfxinfo4_ram);
// static configuration
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_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)
// configuration
void set_k051316_callback(k051316_cb_delegate callback) { m_k051316_cb = callback; }
void set_wrap(int wrap) { m_wrap = wrap; }
void set_bpp(int bpp);
void set_layermask(int mask) { m_layermask = mask; }
void set_offsets(int x_offset, int y_offset)
{
k051316_device &dev = downcast<k051316_device &>(device);
dev.m_dx = x_offset;
dev.m_dy = y_offset;
m_dx = x_offset;
m_dy = y_offset;
}
/*

View File

@ -145,22 +145,20 @@ k051960_device::k051960_device(const machine_config &mconfig, const char *tag, d
{
}
void k051960_device::set_plane_order(device_t &device, int order)
void k051960_device::set_plane_order(int order)
{
k051960_device &dev = downcast<k051960_device &>(device);
switch (order)
{
case K051960_PLANEORDER_BASE:
device_gfx_interface::static_set_info(dev, gfxinfo);
device_gfx_interface::static_set_info(*this, gfxinfo);
break;
case K051960_PLANEORDER_MIA:
device_gfx_interface::static_set_info(dev, gfxinfo_reverse);
device_gfx_interface::static_set_info(*this, gfxinfo_reverse);
break;
case K051960_PLANEORDER_GRADIUS3:
device_gfx_interface::static_set_info(dev, gfxinfo_gradius3);
device_gfx_interface::static_set_info(*this, gfxinfo_gradius3);
break;
default:
@ -172,10 +170,9 @@ void k051960_device::set_plane_order(device_t &device, int order)
// set_screen_tag - set screen we are attached to
//-------------------------------------------------
void k051960_device::set_screen_tag(device_t &device, const char *tag)
void k051960_device::set_screen_tag(const char *tag)
{
k051960_device &dev = dynamic_cast<k051960_device &>(device);
dev.m_screen.set_tag(tag);
m_screen.set_tag(tag);
}
//-------------------------------------------------

View File

@ -19,22 +19,22 @@ typedef device_delegate<void (int *code, int *color, int *priority, int *shadow)
#define K051960_CB_MEMBER(_name) void _name(int *code, int *color, int *priority, int *shadow)
#define MCFG_K051960_CB(_class, _method) \
k051960_device::set_k051960_callback(*device, k051960_cb_delegate(&_class::_method, #_class "::" #_method, this));
downcast<k051960_device &>(*device).set_k051960_callback(k051960_cb_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_K051960_PLANEORDER(_order) \
k051960_device::set_plane_order(*device, _order);
downcast<k051960_device &>(*device).set_plane_order(_order);
#define MCFG_K051960_SCREEN_TAG(_tag) \
k051960_device::set_screen_tag(*device, "^" _tag);
downcast<k051960_device &>(*device).set_screen_tag("^" _tag);
#define MCFG_K051960_IRQ_HANDLER(_devcb) \
devcb = &k051960_device::set_irq_handler(*device, DEVCB_##_devcb);
devcb = &downcast<k051960_device &>(*device).set_irq_handler(DEVCB_##_devcb);
#define MCFG_K051960_NMI_HANDLER(_devcb) \
devcb = &k051960_device::set_nmi_handler(*device, DEVCB_##_devcb);
devcb = &downcast<k051960_device &>(*device).set_nmi_handler(DEVCB_##_devcb);
#define MCFG_K051960_VREG_CONTRAST_HANDLER(_devcb) \
devcb = &k051960_device::set_vreg_contrast_handler(*device, DEVCB_##_devcb);
devcb = &downcast<k051960_device &>(*device).set_vreg_contrast_handler(DEVCB_##_devcb);
class k051960_device : public device_t, public device_gfx_interface
@ -49,20 +49,20 @@ class k051960_device : public device_t, public device_gfx_interface
public:
k051960_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb)
{ return downcast<k051960_device &>(device).m_irq_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_irq_handler(Object &&cb)
{ return m_irq_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> static devcb_base &set_nmi_handler(device_t &device, Object &&cb)
{ return downcast<k051960_device &>(device).m_nmi_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_nmi_handler(Object &&cb)
{ return m_nmi_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> static devcb_base &set_vreg_contrast_handler(device_t &device, Object &&cb)
{ return downcast<k051960_device &>(device).m_vreg_contrast_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_vreg_contrast_handler(Object &&cb)
{ return m_vreg_contrast_handler.set_callback(std::forward<Object>(cb)); }
// static configuration
static void set_k051960_callback(device_t &device, k051960_cb_delegate callback) { downcast<k051960_device &>(device).m_k051960_cb = callback; }
static void set_plane_order(device_t &device, int order);
static void set_screen_tag(device_t &device, const char *tag);
void set_k051960_callback(k051960_cb_delegate callback) { m_k051960_cb = callback; }
void set_plane_order(int order);
void set_screen_tag(const char *tag);
/*
The callback is passed:

View File

@ -188,14 +188,12 @@ k052109_device::k052109_device(const machine_config &mconfig, const char *tag, d
}
void k052109_device::set_ram(device_t &device, bool ram)
void k052109_device::set_ram(bool ram)
{
k052109_device &dev = downcast<k052109_device &>(device);
if (ram)
device_gfx_interface::static_set_info(dev, gfxinfo_ram);
device_gfx_interface::static_set_info(*this, gfxinfo_ram);
else
device_gfx_interface::static_set_info(dev, gfxinfo);
device_gfx_interface::static_set_info(*this, gfxinfo);
}
@ -281,10 +279,9 @@ void k052109_device::device_reset()
// set_screen_tag - set screen we are attached to
//-------------------------------------------------
void k052109_device::set_screen_tag(device_t &device, const char *tag)
void k052109_device::set_screen_tag(const char *tag)
{
k052109_device &dev = dynamic_cast<k052109_device &>(device);
dev.m_screen.set_tag(tag);
m_screen.set_tag(tag);
}

View File

@ -11,16 +11,16 @@ typedef device_delegate<void (int layer, int bank, int *code, int *color, int *f
#define K052109_CB_MEMBER(_name) void _name(int layer, int bank, int *code, int *color, int *flags, int *priority)
#define MCFG_K052109_CB(_class, _method) \
k052109_device::set_k052109_callback(*device, k052109_cb_delegate(&_class::_method, #_class "::" #_method, this));
downcast<k052109_device &>(*device).set_k052109_callback(k052109_cb_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_K052109_CHARRAM(_ram) \
k052109_device::set_ram(*device, _ram);
downcast<k052109_device &>(*device).set_ram(_ram);
#define MCFG_K052109_SCREEN_TAG(_tag) \
k052109_device::set_screen_tag(*device, "^" _tag);
downcast<k052109_device &>(*device).set_screen_tag("^" _tag);
#define MCFG_K052109_IRQ_HANDLER(_devcb) \
devcb = &k052109_device::set_irq_handler(*device, DEVCB_##_devcb);
devcb = &downcast<k052109_device &>(*device).set_irq_handler(DEVCB_##_devcb);
class k052109_device : public device_t, public device_gfx_interface
@ -34,12 +34,12 @@ public:
k052109_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~k052109_device() {}
template <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb)
{ return downcast<k052109_device &>(device).m_irq_handler.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_irq_handler(Object &&cb)
{ return m_irq_handler.set_callback(std::forward<Object>(cb)); }
static void set_k052109_callback(device_t &device, k052109_cb_delegate callback) { downcast<k052109_device &>(device).m_k052109_cb = callback; }
static void set_ram(device_t &device, bool ram);
static void set_screen_tag(device_t &device, const char *tag);
void set_k052109_callback(k052109_cb_delegate callback) { m_k052109_cb = callback; }
void set_ram(bool ram);
void set_screen_tag(const char *tag);
/*
The callback is passed:

View File

@ -96,16 +96,15 @@ k05324x_device::k05324x_device(const machine_config &mconfig, const char *tag, d
{
}
void k05324x_device::set_bpp(device_t &device, int bpp)
void k05324x_device::set_bpp(int bpp)
{
k05324x_device &dev = downcast<k05324x_device &>(device);
switch(bpp)
{
case 4:
device_gfx_interface::static_set_info(dev, gfxinfo);
device_gfx_interface::static_set_info(*this, gfxinfo);
break;
case 6:
device_gfx_interface::static_set_info(dev, gfxinfo_6bpp);
device_gfx_interface::static_set_info(*this, gfxinfo_6bpp);
break;
default:
fatalerror("Unsupported bpp\n");

View File

@ -11,13 +11,13 @@ typedef device_delegate<void (int *code, int *color, int *priority)> k05324x_cb_
#define MCFG_K05324X_BPP(_bpp) \
k05324x_device::set_bpp(*device, _bpp);
downcast<k05324x_device &>(*device).set_bpp(_bpp);
#define MCFG_K05324X_CB(_class, _method) \
k05324x_device::set_k05324x_callback(*device, k05324x_cb_delegate(&_class::_method, #_class "::" #_method, this));
downcast<k05324x_device &>(*device).set_k05324x_callback(k05324x_cb_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_K05324X_OFFSETS(_xoffs, _yoffs) \
k05324x_device::set_offsets(*device, _xoffs, _yoffs);
downcast<k05324x_device &>(*device).set_offsets(_xoffs, _yoffs);
class k05324x_device : public device_t, public device_gfx_interface
@ -30,14 +30,13 @@ class k05324x_device : public device_t, public device_gfx_interface
public:
k05324x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// 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)
// configuration
void set_bpp(int bpp);
void set_k05324x_callback(k05324x_cb_delegate callback) { m_k05324x_cb = callback; }
void set_offsets(int x_offset, int y_offset)
{
k05324x_device &dev = downcast<k05324x_device &>(device);
dev.m_dx = x_offset;
dev.m_dy = y_offset;
m_dx = x_offset;
m_dy = y_offset;
}
DECLARE_READ16_MEMBER( k053245_word_r );

View File

@ -17,16 +17,16 @@ typedef device_delegate<void (int *code, int *color, int *priority_mask)> k05324
#define K055673_CB_MEMBER(_name) void _name(int *code, int *color, int *priority_mask)
#define MCFG_K053246_CB(_class, _method) \
k053247_device::set_k053247_callback(*device, k053247_cb_delegate(&_class::_method, #_class "::" #_method, this));
downcast<k053247_device &>(*device).set_k053247_callback(k053247_cb_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_K053246_CONFIG(_gfx_reg, _order, _dx, _dy) \
k053247_device::set_config(*device, _gfx_reg, _order, _dx, _dy);
downcast<k053247_device &>(*device).set_config(_gfx_reg, _order, _dx, _dy);
#define MCFG_K055673_CB(_class, _method) \
k053247_device::set_k053247_callback(*device, k053247_cb_delegate(&_class::_method, #_class "::" #_method, this));
downcast<k053247_device &>(*device).set_k053247_callback(k053247_cb_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_K055673_CONFIG(_gfx_reg, _order, _dx, _dy) \
k053247_device::set_config(*device, _gfx_reg, _order, _dx, _dy);
downcast<k053247_device &>(*device).set_config(_gfx_reg, _order, _dx, _dy);
/** Konami 053246 / 053247 / 055673 **/
@ -66,15 +66,14 @@ class k053247_device : public device_t,
public:
k053247_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void set_k053247_callback(device_t &device, k053247_cb_delegate callback) { downcast<k053247_device &>(device).m_k053247_cb = callback; }
static void set_config(device_t &device, const char *gfx_reg, int bpp, int dx, int dy)
// configuration
void set_k053247_callback(k053247_cb_delegate callback) { m_k053247_cb = callback; }
void set_config(const char *gfx_reg, int bpp, int dx, int dy)
{
k053247_device &dev = downcast<k053247_device &>(device);
dev.m_memory_region = gfx_reg;
dev.m_bpp = bpp;
dev.m_dx = dx;
dev.m_dy = dy;
m_memory_region = gfx_reg;
m_bpp = bpp;
m_dx = dx;
m_dy = dy;
}
void clear_all();

View File

@ -15,11 +15,10 @@ k053250_device::k053250_device(const machine_config &mconfig, const char *tag, d
{
}
void k053250_device::static_set_offsets(device_t &device, int offx, int offy)
void k053250_device::set_offsets(int offx, int offy)
{
k053250_device &dev = downcast<k053250_device &>(device);
dev.m_offx = offx;
dev.m_offy = offy;
m_offx = offx;
m_offy = offy;
}
void k053250_device::unpack_nibbles()

View File

@ -14,7 +14,7 @@
MCFG_DEVICE_ADD(_tag, K053250, 0) \
MCFG_GFX_PALETTE(_palette_tag) \
MCFG_VIDEO_SET_SCREEN(_screen_tag) \
k053250_device::static_set_offsets(*device, offx, offy);
downcast<k053250_device &>(*device).set_offsets(offx, offy);
class k053250_device : public device_t,
public device_gfx_interface,
@ -23,7 +23,7 @@ class k053250_device : public device_t,
public:
k053250_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
static void static_set_offsets(device_t &device, int offx, int offy);
void set_offsets(int offx, int offy);
DECLARE_READ16_MEMBER(reg_r);
DECLARE_WRITE16_MEMBER(reg_w);

View File

@ -49,11 +49,10 @@ k053250ps_device::k053250ps_device(const machine_config &mconfig, const char *ta
{
}
void k053250ps_device::static_set_offsets(device_t &device, int offx, int offy)
void k053250ps_device::set_offsets(int offx, int offy)
{
k053250ps_device &dev = downcast<k053250ps_device &>(device);
dev.m_offx = offx;
dev.m_offy = offy;
m_offx = offx;
m_offy = offy;
}
void k053250ps_device::unpack_nibbles()

View File

@ -14,10 +14,10 @@
MCFG_DEVICE_ADD(_tag, K053250PS, 12000000) \
MCFG_GFX_PALETTE(_palette_tag) \
MCFG_VIDEO_SET_SCREEN(_screen_tag) \
k053250ps_device::static_set_offsets(*device, offx, offy);
downcast<k053250ps_device &>(*device).set_offsets(offx, offy);
#define MCFG_K053250PS_DMAIRQ_CB(_cb) \
devcb = &k053250ps_device::set_dmairq_cb(*device, DEVCB_##_cb);
devcb = &downcast<k053250ps_device &>(*device).set_dmairq_cb(DEVCB_##_cb);
class k053250ps_device : public device_t,
public device_gfx_interface,
@ -26,8 +26,8 @@ class k053250ps_device : public device_t,
public:
k053250ps_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
static void static_set_offsets(device_t &device, int offx, int offy);
template<class _cb> static devcb_base &set_dmairq_cb(device_t &device, _cb cb) { return downcast<k053250ps_device &>(device).m_dmairq_cb.set_callback(cb); }
void set_offsets(int offx, int offy);
template<class _cb> devcb_base &set_dmairq_cb(_cb cb) { return m_dmairq_cb.set_callback(cb); }
DECLARE_READ16_MEMBER(reg_r);
DECLARE_WRITE16_MEMBER(reg_w);

View File

@ -23,13 +23,12 @@ public:
k053936_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~k053936_device() {}
// static configuration
static void set_wrap(device_t &device, int wrap) { downcast<k053936_device &>(device).m_wrap = wrap; }
static void set_offsets(device_t &device, int x_offset, int y_offset)
// configuration
void set_wrap(int wrap) { m_wrap = wrap; }
void set_offsets(int x_offset, int y_offset)
{
k053936_device &dev = downcast<k053936_device &>(device);
dev.m_xoff = x_offset;
dev.m_yoff = y_offset;
m_xoff = x_offset;
m_yoff = y_offset;
}
DECLARE_WRITE16_MEMBER( ctrl_w );
@ -55,9 +54,9 @@ private:
DECLARE_DEVICE_TYPE(K053936, k053936_device)
#define MCFG_K053936_WRAP(_wrap) \
k053936_device::set_wrap(*device, _wrap);
downcast<k053936_device &>(*device).set_wrap(_wrap);
#define MCFG_K053936_OFFSETS(_xoffs, _yoffs) \
k053936_device::set_offsets(*device, _xoffs, _yoffs);
downcast<k053936_device &>(*device).set_offsets(_xoffs, _yoffs);
#endif // MAME_VIDEO_K053936_H

View File

@ -10,10 +10,10 @@ typedef device_delegate<void (int layer, int *code, int *color, int *flags)> k05
#define K056832_CB_MEMBER(_name) void _name(int layer, int *code, int *color, int *flags)
#define MCFG_K056832_CB(_class, _method) \
k056832_device::set_k056832_callback(*device, k056832_cb_delegate(&_class::_method, #_class "::" #_method, this));
downcast<k056832_device &>(*device).set_k056832_callback(k056832_cb_delegate(&_class::_method, #_class "::" #_method, this));
#define MCFG_K056832_CONFIG(_gfx_reg, _bpp, _big, _djmain_hack, _k055555) \
k056832_device::set_config(*device, "^" _gfx_reg, _bpp, _big, _djmain_hack, _k055555);
downcast<k056832_device &>(*device).set_config("^" _gfx_reg, _bpp, _big, _djmain_hack, _k055555);
#define K056832_PAGE_COUNT 16
@ -39,15 +39,14 @@ class k056832_device : public device_t, public device_gfx_interface
public:
k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
static void set_k056832_callback(device_t &device, k056832_cb_delegate callback) { downcast<k056832_device &>(device).m_k056832_cb = callback; }
static void set_config(device_t &device, const char *gfx_reg, int bpp, int big, int djmain_hack, const char *k055555)
void set_k056832_callback(k056832_cb_delegate callback) { m_k056832_cb = callback; }
void set_config(const char *gfx_reg, int bpp, int big, int djmain_hack, const char *k055555)
{
k056832_device &dev = downcast<k056832_device &>(device);
dev.m_rombase.set_tag(gfx_reg);
dev.m_bpp = bpp;
dev.m_big = big;
dev.m_djmain_hack = djmain_hack;
dev.m_k055555_tag = k055555;
m_rombase.set_tag(gfx_reg);
m_bpp = bpp;
m_big = big;
m_djmain_hack = djmain_hack;
m_k055555_tag = k055555;
}
void SetExtLinescroll(); /* Lethal Enforcers */

View File

@ -28,9 +28,9 @@ class k054338_device : public device_t,
public:
k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void set_mixer_tag(device_t &device, const char *tag) { downcast<k054338_device &>(device).m_k055555_tag = tag; }
static void set_alpha_invert(device_t &device, int alpha_inv) { downcast<k054338_device &>(device).m_alpha_inv = alpha_inv; }
// configuration
void set_mixer_tag(const char *tag) { m_k055555_tag = tag; }
void set_alpha_invert(int alpha_inv) { m_alpha_inv = alpha_inv; }
DECLARE_WRITE16_MEMBER( word_w ); // "CLCT" registers
DECLARE_WRITE32_MEMBER( long_w );
@ -64,10 +64,10 @@ DECLARE_DEVICE_TYPE(K054338, k054338_device)
#define MCFG_K054338_MIXER(_tag) \
k054338_device::set_mixer_tag(*device, _tag);
downcast<k054338_device &>(*device).set_mixer_tag(_tag);
#define MCFG_K054338_ALPHAINV(_alphainv) \
k054338_device::set_alpha_invert(*device, _alphainv);
downcast<k054338_device &>(*device).set_alpha_invert(_alphainv);
#define MCFG_K054338_SET_SCREEN MCFG_VIDEO_SET_SCREEN

View File

@ -10,7 +10,7 @@ class k057714_device : public device_t
{
public:
k057714_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <class Object> static devcb_base &static_set_irq_callback(device_t &device, Object &&cb) { return downcast<k057714_device &>(device).m_irq.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_irq_callback(Object &&cb) { return m_irq.set_callback(std::forward<Object>(cb)); }
int draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@ -64,7 +64,7 @@ private:
DECLARE_DEVICE_TYPE(K057714, k057714_device)
#define MCFG_K057714_IRQ_CALLBACK(_devcb) \
devcb = &k057714_device::static_set_irq_callback(*device, DEVCB_##_devcb);
devcb = &downcast<k057714_device &>(*device).set_irq_callback(DEVCB_##_devcb);
#endif // MAME_MACHINE_K057714_H

View File

@ -15,14 +15,14 @@
#define MCFG_K1GE_ADD(_tag, _clock, _screen, _vblank, _hblank ) \
MCFG_DEVICE_ADD( _tag, K1GE, _clock ) \
MCFG_VIDEO_SET_SCREEN( _screen ) \
devcb = &k1ge_device::static_set_vblank_callback( *device, DEVCB_##_vblank ); \
devcb = &k1ge_device::static_set_hblank_callback( *device, DEVCB_##_hblank );
devcb = &downcast<k1ge_device &>(*device).set_vblank_callback(DEVCB_##_vblank ); \
devcb = &downcast<k1ge_device &>(*device).set_hblank_callback(DEVCB_##_hblank );
#define MCFG_K2GE_ADD(_tag, _clock, _screen, _vblank, _hblank ) \
MCFG_DEVICE_ADD( _tag, K2GE, _clock ) \
MCFG_VIDEO_SET_SCREEN( _screen ) \
devcb = &k1ge_device::static_set_vblank_callback( *device, DEVCB_##_vblank ); \
devcb = &k1ge_device::static_set_hblank_callback( *device, DEVCB_##_hblank );
devcb = &downcast<k1ge_device &>(*device).set_vblank_callback(DEVCB_##_vblank ); \
devcb = &downcast<k1ge_device &>(*device).set_hblank_callback(DEVCB_##_hblank );
class k1ge_device : public device_t, public device_video_interface
@ -36,8 +36,8 @@ public:
void update( bitmap_ind16 &bitmap, const rectangle &cliprect );
// Static methods
template <class Object> static devcb_base &static_set_vblank_callback(device_t &device, Object &&cb) { return downcast<k1ge_device &>(device).m_vblank_pin_w.set_callback(std::forward<Object>(cb)); }
template <class Object> static devcb_base &static_set_hblank_callback(device_t &device, Object &&cb) { return downcast<k1ge_device &>(device).m_hblank_pin_w.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_vblank_callback(Object &&cb) { return m_vblank_pin_w.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_hblank_callback(Object &&cb) { return m_hblank_pin_w.set_callback(std::forward<Object>(cb)); }
static const int K1GE_SCREEN_HEIGHT = 199;

View File

@ -66,13 +66,13 @@ kaneko_pandora_device::kaneko_pandora_device(const machine_config &mconfig, cons
}
//-------------------------------------------------
// static_set_gfxdecode_tag: Set the tag of the
// set_gfxdecode_tag: Set the tag of the
// gfx decoder
//-------------------------------------------------
void kaneko_pandora_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void kaneko_pandora_device::set_gfxdecode_tag(const char *tag)
{
downcast<kaneko_pandora_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}
//-------------------------------------------------

View File

@ -23,14 +23,13 @@ class kaneko_pandora_device : public device_t,
public:
kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
static void set_gfx_region(device_t &device, int gfxregion) { downcast<kaneko_pandora_device &>(device).m_gfx_region = gfxregion; }
static void set_offsets(device_t &device, int x_offset, int y_offset)
// configuration
void set_gfxdecode_tag(const char *tag);
void set_gfx_region(int gfxregion) { m_gfx_region = gfxregion; }
void set_offsets(int x_offset, int y_offset)
{
kaneko_pandora_device &dev = downcast<kaneko_pandora_device &>(device);
dev.m_xoffset = x_offset;
dev.m_yoffset = y_offset;
m_xoffset = x_offset;
m_yoffset = y_offset;
}
DECLARE_WRITE8_MEMBER ( spriteram_w );
@ -71,12 +70,12 @@ DECLARE_DEVICE_TYPE(KANEKO_PANDORA, kaneko_pandora_device)
***************************************************************************/
#define MCFG_KANEKO_PANDORA_GFX_REGION(_region) \
kaneko_pandora_device::set_gfx_region(*device, _region);
downcast<kaneko_pandora_device &>(*device).set_gfx_region(_region);
#define MCFG_KANEKO_PANDORA_OFFSETS(_xoffs, _yoffs) \
kaneko_pandora_device::set_offsets(*device, _xoffs, _yoffs);
downcast<kaneko_pandora_device &>(*device).set_offsets(_xoffs, _yoffs);
#define MCFG_KANEKO_PANDORA_GFXDECODE(_gfxtag) \
kaneko_pandora_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<kaneko_pandora_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
#endif // MAME_VIDEO_KAN_PAND_H

View File

@ -24,20 +24,19 @@ kaneko_grap2_device::kaneko_grap2_device(const machine_config &mconfig, const ch
}
void kaneko_grap2_device::set_chipnum(device_t &device, int chipnum)
void kaneko_grap2_device::set_chipnum(int chipnum)
{
kaneko_grap2_device &dev = downcast<kaneko_grap2_device &>(device);
dev.m_chipnum = chipnum;
m_chipnum = chipnum;
}
//-------------------------------------------------
// static_set_palette_tag: Set the tag of the
// set_palette_tag: Set the tag of the
// palette device
//-------------------------------------------------
void kaneko_grap2_device::static_set_palette_tag(device_t &device, const char *tag)
void kaneko_grap2_device::set_palette_tag(const char *tag)
{
downcast<kaneko_grap2_device &>(device).m_palette.set_tag(tag);
m_palette.set_tag(tag);
}

View File

@ -30,8 +30,8 @@ public:
int m_chipnum; // used to decide where we write the palette
static void set_chipnum(device_t &device, int chipnum);
static void static_set_palette_tag(device_t &device, const char *tag);
void set_chipnum(int chipnum);
void set_palette_tag(const char *tag);
DECLARE_READ16_MEMBER(galpani3_regs1_r);
DECLARE_WRITE16_MEMBER(galpani3_regs1_go_w);
@ -97,7 +97,9 @@ private:
DECLARE_DEVICE_TYPE(KANEKO_GRAP2, kaneko_grap2_device)
#define MCFG_KANEKO_GRAP2_PALETTE(_palette_tag) \
kaneko_grap2_device::static_set_palette_tag(*device, "^" _palette_tag);
downcast<kaneko_grap2_device &>(*device).set_palette_tag("^" _palette_tag);
#define MCFG_KANEKO_GRAP2_CHIPNUM(_chipnum) \
downcast<kaneko_grap2_device &>(*device).set_chipnum(_chipnum);
#endif // MAME_VIDEO_KANEKO_GRAP2_H

View File

@ -68,9 +68,9 @@ kaneko16_sprite_device::kaneko16_sprite_device(
// gfx decoder
//-------------------------------------------------
void kaneko16_sprite_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void kaneko16_sprite_device::set_gfxdecode_tag(const char *tag)
{
downcast<kaneko16_sprite_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}
void kaneko16_sprite_device::device_start()
@ -94,29 +94,24 @@ void kaneko16_sprite_device::device_reset()
m_sprite_flipy = 0;
}
void kaneko16_sprite_device::set_priorities(device_t &device, int pri0, int pri1, int pri2, int pri3)
void kaneko16_sprite_device::set_priorities(int pri0, int pri1, int pri2, int pri3)
{
kaneko16_sprite_device &dev = downcast<kaneko16_sprite_device &>(device);
dev.m_priority.sprite[0] = pri0;
dev.m_priority.sprite[1] = pri1;
dev.m_priority.sprite[2] = pri2;
dev.m_priority.sprite[3] = pri3;
m_priority.sprite[0] = pri0;
m_priority.sprite[1] = pri1;
m_priority.sprite[2] = pri2;
m_priority.sprite[3] = pri3;
}
void kaneko16_sprite_device::set_fliptype(device_t &device, int fliptype)
void kaneko16_sprite_device::set_fliptype(int fliptype)
{
kaneko16_sprite_device &dev = downcast<kaneko16_sprite_device &>(device);
dev.m_sprite_fliptype = fliptype;
m_sprite_fliptype = fliptype;
}
void kaneko16_sprite_device::set_offsets(device_t &device, int xoffs, int yoffs)
void kaneko16_sprite_device::set_offsets(int xoffs, int yoffs)
{
kaneko16_sprite_device &dev = downcast<kaneko16_sprite_device &>(device);
dev.m_sprite_xoffs = xoffs;
dev.m_sprite_yoffs = yoffs;
m_sprite_xoffs = xoffs;
m_sprite_yoffs = yoffs;
}

View File

@ -34,11 +34,11 @@ struct kan_tempsprite
class kaneko16_sprite_device : public device_t, public device_video_interface
{
public:
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
static void set_fliptype(device_t &device, int fliptype);
static void set_offsets(device_t &device, int xoffs, int yoffs);
static void set_priorities(device_t &device, int pri0, int pri1, int pri2, int pri3);
// configuration
void set_gfxdecode_tag(const char *tag);
void set_fliptype(int fliptype);
void set_offsets(int xoffs, int yoffs);
void set_priorities(int pri0, int pri1, int pri2, int pri3);
// (legacy) used in the bitmap clear functions
virtual int get_sprite_type(void) =0;
@ -115,7 +115,13 @@ private:
//extern const device_type KANEKO16_SPRITE;
#define MCFG_KANEKO16_SPRITE_GFXDECODE(_gfxtag) \
kaneko16_sprite_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<kaneko16_sprite_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
#define MCFG_KANEKO16_SPRITE_PRIORITIES(_pri0, _pri1, _pri2, _pri3) \
downcast<kaneko16_sprite_device &>(*device).set_priorities(_pri0, _pri1, _pri2, _pri3);
#define MCFG_KANEKO16_SPRITE_OFFSETS(_xoffs, _yoffs) \
downcast<kaneko16_sprite_device &>(*device).set_offsets(_xoffs, _yoffs);
#define MCFG_KANEKO16_SPRITE_FLIPTYPE(_fliptype) \
downcast<kaneko16_sprite_device &>(*device).set_fliptype(_fliptype);
class kaneko_vu002_sprite_device : public kaneko16_sprite_device

View File

@ -104,34 +104,31 @@ kaneko_view2_tilemap_device::kaneko_view2_tilemap_device(const machine_config &m
}
//-------------------------------------------------
// static_set_gfxdecode_tag: Set the tag of the
// set_gfxdecode_tag: Set the tag of the
// gfx decoder
//-------------------------------------------------
void kaneko_view2_tilemap_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void kaneko_view2_tilemap_device::set_gfxdecode_tag(const char *tag)
{
downcast<kaneko_view2_tilemap_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}
void kaneko_view2_tilemap_device::set_gfx_region(device_t &device, int region)
void kaneko_view2_tilemap_device::set_gfx_region(int region)
{
kaneko_view2_tilemap_device &dev = downcast<kaneko_view2_tilemap_device &>(device);
dev.m_tilebase = region;
m_tilebase = region;
}
void kaneko_view2_tilemap_device::set_offset(device_t &device, int dx, int dy, int xdim, int ydim)
void kaneko_view2_tilemap_device::set_offset(int dx, int dy, int xdim, int ydim)
{
kaneko_view2_tilemap_device &dev = downcast<kaneko_view2_tilemap_device &>(device);
dev.m_dx = dx;
dev.m_dy = dy;
dev.m_xdim = xdim;
dev.m_ydim = ydim;
m_dx = dx;
m_dy = dy;
m_xdim = xdim;
m_ydim = ydim;
}
void kaneko_view2_tilemap_device::set_invert_flip(device_t &device, int invert_flip)
void kaneko_view2_tilemap_device::set_invert_flip(int invert_flip)
{
kaneko_view2_tilemap_device &dev = downcast<kaneko_view2_tilemap_device &>(device);
dev.m_invert_flip = invert_flip;
m_invert_flip = invert_flip;
}
void kaneko_view2_tilemap_device::get_tile_info(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_)

View File

@ -12,11 +12,11 @@ class kaneko_view2_tilemap_device : public device_t
public:
kaneko_view2_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
static void set_gfx_region(device_t &device, int region);
static void set_offset(device_t &device, int dx, int dy, int xdim, int ydim);
static void set_invert_flip(device_t &device, int invert_flip); // for fantasia (bootleg)
// configuration
void set_gfxdecode_tag(const char *tag);
void set_gfx_region(int region);
void set_offset(int dx, int dy, int xdim, int ydim);
void set_invert_flip(int invert_flip); // for fantasia (bootleg)
void get_tile_info(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_);
void kaneko16_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask, int _N_);
@ -86,6 +86,12 @@ private:
DECLARE_DEVICE_TYPE(KANEKO_TMAP, kaneko_view2_tilemap_device)
#define MCFG_KANEKO_TMAP_GFXDECODE(_gfxtag) \
kaneko_view2_tilemap_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<kaneko_view2_tilemap_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
#define MCFG_KANEKO_TMAP_GFX_REGION(_region) \
downcast<kaneko_view2_tilemap_device &>(*device).set_gfx_region(_region);
#define MCFG_KANEKO_TMAP_INVERT_FLIP(_invert) \
downcast<kaneko_view2_tilemap_device &>(*device).set_invert_flip(_invert);
#define MCFG_KANEKO_TMAP_OFFSET(_dx, _dy, _xdim, _ydim) \
downcast<kaneko_view2_tilemap_device &>(*device).set_offset(_dx, _dy, _xdim, _ydim);
#endif // MAME_VIDEO_KANEKO_TMAP_H

View File

@ -14,7 +14,7 @@ public:
// construction/destruction
atari_maria_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
static void set_cpu_tag(device_t &device, const char *tag) { downcast<atari_maria_device &>(device).m_cpu_tag = tag; }
void set_cpu_tag(const char *tag) { m_cpu_tag = tag; }
void interrupt(int lines);
void startdma(int lines);
@ -67,7 +67,7 @@ DECLARE_DEVICE_TYPE(ATARI_MARIA, atari_maria_device)
#define MCFG_MARIA_DMACPU(_tag) \
atari_maria_device::set_cpu_tag(*device, _tag);
downcast<atari_maria_device &>(*device).set_cpu_tag(_tag);
#endif // MAME_VIDEO_MARIA_H

View File

@ -57,15 +57,14 @@ void mb60553_zooming_tilemap_device::device_reset()
}
void mb60553_zooming_tilemap_device::set_gfx_region(device_t &device, int gfxregion)
void mb60553_zooming_tilemap_device::set_gfx_region(int gfxregion)
{
mb60553_zooming_tilemap_device &dev = downcast<mb60553_zooming_tilemap_device &>(device);
dev.m_gfx_region = gfxregion;
m_gfx_region = gfxregion;
}
void mb60553_zooming_tilemap_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void mb60553_zooming_tilemap_device::set_gfxdecode_tag(const char *tag)
{
downcast<mb60553_zooming_tilemap_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}

View File

@ -11,8 +11,8 @@
class mb60553_zooming_tilemap_device : public device_t
{
public:
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
static void set_gfx_region(device_t &device, int gfxregion);
void set_gfxdecode_tag(const char *tag);
void set_gfx_region(int gfxregion);
mb60553_zooming_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@ -60,9 +60,9 @@ DECLARE_DEVICE_TYPE(MB60553, mb60553_zooming_tilemap_device)
#define MCFG_MB60553_GFX_REGION(_region) \
mb60553_zooming_tilemap_device::set_gfx_region(*device, _region);
downcast<mb60553_zooming_tilemap_device &>(*device).set_gfx_region(_region);
#define MCFG_MB60553_GFXDECODE(_gfxtag) \
mb60553_zooming_tilemap_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<mb60553_zooming_tilemap_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
#endif // MAME_VIDEO_MB60533_H

View File

@ -56,24 +56,24 @@ megasys1_tilemap_device::megasys1_tilemap_device(const machine_config &mconfig,
{
}
void megasys1_tilemap_device::static_set_8x8_scroll_factor(device_t &device, int scroll_factor)
void megasys1_tilemap_device::set_8x8_scroll_factor(int scroll_factor)
{
downcast<megasys1_tilemap_device &>(device).m_8x8_scroll_factor = scroll_factor;
m_8x8_scroll_factor = scroll_factor;
}
void megasys1_tilemap_device::static_set_16x16_scroll_factor(device_t &device, int scroll_factor)
void megasys1_tilemap_device::set_16x16_scroll_factor(int scroll_factor)
{
downcast<megasys1_tilemap_device &>(device).m_16x16_scroll_factor = scroll_factor;
m_16x16_scroll_factor = scroll_factor;
}
void megasys1_tilemap_device::static_set_bits_per_color_code(device_t &device, int bits)
void megasys1_tilemap_device::set_bits_per_color_code(int bits)
{
downcast<megasys1_tilemap_device &>(device).m_bits_per_color_code = bits;
m_bits_per_color_code = bits;
}
void megasys1_tilemap_device::static_set_colorbase(device_t &device, uint16_t colorbase)
void megasys1_tilemap_device::set_colorbase(uint16_t colorbase)
{
downcast<megasys1_tilemap_device &>(device).m_colorbase = colorbase;
m_colorbase = colorbase;
}

View File

@ -24,16 +24,16 @@
MCFG_MEGASYS1_TILEMAP_COLORBASE(colorbase)
#define MCFG_MEGASYS1_TILEMAP_8X8_SCROLL_FACTOR(scroll_factor) \
megasys1_tilemap_device::static_set_8x8_scroll_factor(*device, scroll_factor);
downcast<megasys1_tilemap_device &>(*device).set_8x8_scroll_factor(scroll_factor);
#define MCFG_MEGASYS1_TILEMAP_16X16_SCROLL_FACTOR(scroll_factor) \
megasys1_tilemap_device::static_set_16x16_scroll_factor(*device, scroll_factor);
downcast<megasys1_tilemap_device &>(*device).set_16x16_scroll_factor(scroll_factor);
#define MCFG_MEGASYS1_TILEMAP_BITS_PER_COLOR_CODE(bits) \
megasys1_tilemap_device::static_set_bits_per_color_code(*device, bits);
downcast<megasys1_tilemap_device &>(*device).set_bits_per_color_code(bits);
#define MCFG_MEGASYS1_TILEMAP_COLORBASE(colorbase) \
megasys1_tilemap_device::static_set_colorbase(*device, colorbase);
downcast<megasys1_tilemap_device &>(*device).set_colorbase(colorbase);
//**************************************************************************
// TYPE DEFINITIONS
@ -47,11 +47,11 @@ public:
// construction/destruction
megasys1_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void static_set_8x8_scroll_factor(device_t &device, int scroll_factor);
static void static_set_16x16_scroll_factor(device_t &device, int scroll_factor);
static void static_set_bits_per_color_code(device_t &device, int bits);
static void static_set_colorbase(device_t &device, uint16_t colorbase);
// configuration
void set_8x8_scroll_factor(int scroll_factor);
void set_16x16_scroll_factor(int scroll_factor);
void set_bits_per_color_code(int bits);
void set_colorbase(uint16_t colorbase);
// memory handlers
DECLARE_WRITE16_MEMBER(write);

View File

@ -33,7 +33,7 @@
#define MCFG_NICK_VIRQ_CALLBACK(_write) \
devcb = &nick_device::set_virq_wr_callback(*device, DEVCB_##_write);
devcb = &downcast<nick_device &>(*device).set_virq_wr_callback(DEVCB_##_write);
/* there are 64us per line, although in reality
@ -75,7 +75,7 @@ public:
// construction/destruction
nick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template<class _Object> static devcb_base &set_virq_wr_callback(device_t &device, _Object object) { return downcast<nick_device &>(device).m_write_virq.set_callback(object); }
template<class _Object> devcb_base &set_virq_wr_callback(_Object object) { return m_write_virq.set_callback(object); }
virtual void vram_map(address_map &map);
virtual void vio_map(address_map &map);

View File

@ -74,13 +74,13 @@ pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, d
}
//-------------------------------------------------
// static_set_gfxdecode_tag: Set the tag of the
// set_gfxdecode_tag: Set the tag of the
// gfx decoder
//-------------------------------------------------
void pc080sn_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void pc080sn_device::set_gfxdecode_tag(const char *tag)
{
downcast<pc080sn_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}
//-------------------------------------------------

View File

@ -10,16 +10,15 @@ class pc080sn_device : public device_t
public:
pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
static void set_gfx_region(device_t &device, int gfxregion) { downcast<pc080sn_device &>(device).m_gfxnum = gfxregion; }
static void set_yinvert(device_t &device, int y_inv) { downcast<pc080sn_device &>(device).m_y_invert = y_inv; }
static void set_dblwidth(device_t &device, int dblwidth) { downcast<pc080sn_device &>(device).m_dblwidth = dblwidth; }
static void set_offsets(device_t &device, int x_offset, int y_offset)
// configuration
void set_gfxdecode_tag(const char *tag);
void set_gfx_region(int gfxregion) { m_gfxnum = gfxregion; }
void set_yinvert(int y_inv) { m_y_invert = y_inv; }
void set_dblwidth(int dblwidth) { m_dblwidth = dblwidth; }
void set_offsets(int x_offset, int y_offset)
{
pc080sn_device &dev = downcast<pc080sn_device &>(device);
dev.m_x_offset = x_offset;
dev.m_y_offset = y_offset;
m_x_offset = x_offset;
m_y_offset = y_offset;
}
DECLARE_READ16_MEMBER( word_r );
@ -74,18 +73,18 @@ DECLARE_DEVICE_TYPE(PC080SN, pc080sn_device)
#define MCFG_PC080SN_GFX_REGION(_region) \
pc080sn_device::set_gfx_region(*device, _region);
downcast<pc080sn_device &>(*device).set_gfx_region(_region);
#define MCFG_PC080SN_OFFSETS(_xoffs, _yoffs) \
pc080sn_device::set_offsets(*device, _xoffs, _yoffs);
downcast<pc080sn_device &>(*device).set_offsets(_xoffs, _yoffs);
#define MCFG_PC080SN_YINVERT(_yinv) \
pc080sn_device::set_yinvert(*device, _yinv);
downcast<pc080sn_device &>(*device).set_yinvert(_yinv);
#define MCFG_PC080SN_DBLWIDTH(_dbl) \
pc080sn_device::set_dblwidth(*device, _dbl);
downcast<pc080sn_device &>(*device).set_dblwidth(_dbl);
#define MCFG_PC080SN_GFXDECODE(_gfxtag) \
pc080sn_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
downcast<pc080sn_device &>(*device).set_gfxdecode_tag("^" _gfxtag);
#endif // MAME_VIDEO_PC080SN_H

View File

@ -90,23 +90,23 @@ pc090oj_device::pc090oj_device(const machine_config &mconfig, const char *tag, d
}
//-------------------------------------------------
// static_set_gfxdecode_tag: Set the tag of the
// set_gfxdecode_tag: Set the tag of the
// gfx decoder
//-------------------------------------------------
void pc090oj_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
void pc090oj_device::set_gfxdecode_tag(const char *tag)
{
downcast<pc090oj_device &>(device).m_gfxdecode.set_tag(tag);
m_gfxdecode.set_tag(tag);
}
//-------------------------------------------------
// static_set_palette_tag: Set the tag of the
// set_palette_tag: Set the tag of the
// palette device
//-------------------------------------------------
void pc090oj_device::static_set_palette_tag(device_t &device, const char *tag)
void pc090oj_device::set_palette_tag(const char *tag)
{
downcast<pc090oj_device &>(device).m_palette.set_tag(tag);
m_palette.set_tag(tag);
}
//-------------------------------------------------

Some files were not shown because too many files have changed in this diff Show More