summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/etc/template_driver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/etc/template_driver.cpp')
-rw-r--r--src/mame/etc/template_driver.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/mame/etc/template_driver.cpp b/src/mame/etc/template_driver.cpp
index d1128b02942..967bdb33314 100644
--- a/src/mame/etc/template_driver.cpp
+++ b/src/mame/etc/template_driver.cpp
@@ -25,14 +25,8 @@ public:
{
}
- // screen updates
- uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- DECLARE_PALETTE_INIT(xxx);
-
void xxx(machine_config &config);
- void xxx_io(address_map &map);
- void xxx_map(address_map &map);
protected:
// driver_device overrides
virtual void machine_start() override;
@@ -40,8 +34,16 @@ protected:
virtual void video_start() override;
+private:
// devices
required_device<cpu_device> m_maincpu;
+
+ void xxx_io(address_map &map);
+ void xxx_map(address_map &map);
+
+ // screen updates
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_PALETTE_INIT(xxx);
};
void xxx_state::video_start()
@@ -148,34 +150,32 @@ PALETTE_INIT_MEMBER(xxx_state, xxx)
{
}
-MACHINE_CONFIG_START(xxx_state::xxx)
-
+void xxx_state::xxx(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",Z80,MAIN_CLOCK/2)
- MCFG_DEVICE_PROGRAM_MAP(xxx_map)
- MCFG_DEVICE_IO_MAP(xxx_io)
+ Z80(config, m_maincpu, MAIN_CLOCK/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &xxx_state::xxx_map);
+ m_maincpu->set_addrmap(AS_IO, &xxx_state::xxx_io);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
-// MCFG_SCREEN_REFRESH_RATE(60)
-// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
- MCFG_SCREEN_UPDATE_DRIVER(xxx_state, screen_update)
-// MCFG_SCREEN_SIZE(32*8, 32*8)
-// MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
- MCFG_SCREEN_RAW_PARAMS(MAIN_CLOCK/2, 442, 0, 320, 264, 0, 240) /* generic NTSC video timing at 320x240 */
- //MCFG_SCREEN_RAW_PARAMS(XTAL(12'000'000)/2, 384, 0, 256, 264, 16, 240) /* generic NTSC video timing at 256x224 */
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+// screen.set_refresh_hz(60);
+// screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500));
+ screen.set_screen_update(FUNC(xxx_state::screen_update));
+// screen.set_size(32*8, 32*8);
+// screen.set_visarea(0*8, 32*8-1, 0*8, 32*8-1);
+ screen.set_raw(MAIN_CLOCK/2, 442, 0, 320, 264, 0, 240); /* generic NTSC video timing at 320x240 */
+// screen.set_raw(XTAL(12'000'000)/2, 384, 0, 256, 264, 16, 240); /* generic NTSC video timing at 256x224 */
+ screen.set_palette("palette");
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_xxx)
+ GFXDECODE(config, "gfxdecode", "palette", gfx_xxx);
- MCFG_PALETTE_ADD("palette", 8)
- MCFG_PALETTE_INIT_OWNER(xxx_state, xxx)
+ PALETTE(config, "palette", 8).set_init(palette_init_delegate(FUNC(xxx_state::xxx), this));
/* sound hardware */
SPEAKER(config, "mono").front_center();
-// MCFG_DEVICE_ADD("aysnd", AY8910, MAIN_CLOCK/4)
-// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
-MACHINE_CONFIG_END
+// AY8910(config, "aysnd", MAIN_CLOCK/4).add_route(ALL_OUTPUTS, "mono", 0.30);
+}
/***************************************************************************