summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/pc2000.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/pc2000.cpp')
-rw-r--r--src/mame/drivers/pc2000.cpp138
1 files changed, 68 insertions, 70 deletions
diff --git a/src/mame/drivers/pc2000.cpp b/src/mame/drivers/pc2000.cpp
index d93948e7fb8..1d690b99170 100644
--- a/src/mame/drivers/pc2000.cpp
+++ b/src/mame/drivers/pc2000.cpp
@@ -39,6 +39,7 @@ public:
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_lcdc(*this, "hd44780")
+ , m_screen(*this, "screen")
, m_beep(*this, "beeper")
, m_cart(*this, "cartslot")
, m_bank0(*this, "bank0")
@@ -69,6 +70,7 @@ protected:
required_device<cpu_device> m_maincpu;
optional_device<hd44780_device> m_lcdc;
+ required_device<screen_device> m_screen;
required_device<beep_device> m_beep;
required_device<generic_slot_device> m_cart;
optional_memory_bank m_bank0;
@@ -878,45 +880,45 @@ DEVICE_IMAGE_LOAD_MEMBER( pc2000_state, pc2000_cart )
return image_init_result::PASS;
}
-MACHINE_CONFIG_START(pc2000_state::pc2000)
+void pc2000_state::pc2000(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",Z80, XTAL(4'000'000)) /* probably not accurate */
- MCFG_DEVICE_PROGRAM_MAP(pc2000_mem)
- MCFG_DEVICE_IO_MAP(pc2000_io)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(pc2000_state, irq0_line_hold, 50)
+ Z80(config, m_maincpu, XTAL(4'000'000)); /* probably not accurate */
+ m_maincpu->set_addrmap(AS_PROGRAM, &pc2000_state::pc2000_mem);
+ m_maincpu->set_addrmap(AS_IO, &pc2000_state::pc2000_io);
+ m_maincpu->set_periodic_int(FUNC(pc2000_state::irq0_line_hold), attotime::from_hz(50));
/* video hardware */
- MCFG_SCREEN_ADD("screen", LCD)
- MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_UPDATE_DEVICE("hd44780", hd44780_device, screen_update)
- MCFG_SCREEN_SIZE(120, 18) //2x20 chars
- MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 18-1)
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_LCD);
+ m_screen->set_refresh_hz(50);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ m_screen->set_screen_update("hd44780", FUNC(hd44780_device::screen_update));
+ m_screen->set_size(120, 18); //2x20 chars
+ m_screen->set_visarea(0, 120-1, 0, 18-1);
+ m_screen->set_palette("palette");
- MCFG_PALETTE_ADD("palette", 2)
- MCFG_PALETTE_INIT_OWNER(pc2000_state, pc2000)
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_pc2000)
+ PALETTE(config, "palette", 2).set_init(FUNC(pc2000_state::palette_init_pc2000));
+ GFXDECODE(config, "gfxdecode", "palette", gfx_pc2000);
- MCFG_HD44780_ADD("hd44780")
- MCFG_HD44780_LCD_SIZE(2, 20)
+ HD44780(config, m_lcdc, 0);
+ m_lcdc->set_lcd_size(2, 20);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD( "beeper", BEEP, 3250 )
- MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 )
+ BEEP(config, m_beep, 3250).add_route(ALL_OUTPUTS, "mono", 1.00);
- MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "genius_cart")
- MCFG_GENERIC_LOAD(pc2000_state, pc2000_cart)
+ generic_cartslot_device &cartslot(GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "genius_cart"));
+ cartslot.set_device_load(device_image_load_delegate(&pc2000_state::device_image_load_pc2000_cart, this));
- MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("pc1000_cart", "pc1000")
-MACHINE_CONFIG_END
+ SOFTWARE_LIST(config, "pc1000_cart").set_compatible("pc1000");
+}
-MACHINE_CONFIG_START(pc2000_state::gl2000)
+void pc2000_state::gl2000(machine_config &config)
+{
pc2000(config);
- MCFG_SOFTWARE_LIST_ADD("cart_list", "gl2000")
- MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("misterx_cart", "misterx")
-MACHINE_CONFIG_END
+ SOFTWARE_LIST(config, "cart_list").set_original("gl2000");
+ SOFTWARE_LIST(config, "misterx_cart").set_compatible("misterx");
+}
HD44780_PIXEL_UPDATE(gl4004_state::gl4000_pixel_update)
{
@@ -935,70 +937,66 @@ HD44780_PIXEL_UPDATE(gl4004_state::gl4000_pixel_update)
}
}
-MACHINE_CONFIG_START(gl3000s_state::gl3000s)
+void gl3000s_state::gl3000s(machine_config &config)
+{
pc2000(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_IO_MAP(gl3000s_io)
+ m_maincpu->set_addrmap(AS_IO, &gl3000s_state::gl3000s_io);
- MCFG_DEVICE_REMOVE("hd44780")
- MCFG_SED1520_ADD("sed1520_l", UPDATE(gl3000s_state, screen_update_left)) // left panel is 59 pixels (0-58)
- MCFG_SED1520_ADD("sed1520_r", UPDATE(gl3000s_state, screen_update_right)) // right panel is 61 pixels (59-119)
+ config.device_remove("hd44780");
+ SED1520(config, "sed1520_l").set_screen_update_cb(FUNC(gl3000s_state::screen_update_left)); // left panel is 59 pixels (0-58)
+ SED1520(config, "sed1520_r").set_screen_update_cb(FUNC(gl3000s_state::screen_update_right)); // right panel is 61 pixels (59-119)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_SIZE(120, 24)
- MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 24-1)
- MCFG_SCREEN_UPDATE_DRIVER( gl3000s_state, screen_update )
+ m_screen->set_size(120, 24);
+ m_screen->set_visarea(0, 120-1, 0, 24-1);
+ m_screen->set_screen_update(FUNC(gl3000s_state::screen_update));
config.set_default_layout(layout_gl3000s);
+ config.device_remove("gfxdecode");
- MCFG_DEVICE_REMOVE("gfxdecode")
-
- MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("gl2000_cart", "gl2000")
- MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("misterx_cart", "misterx")
+ SOFTWARE_LIST(config, "gl2000_cart").set_compatible("gl2000");
+ SOFTWARE_LIST(config, "misterx_cart").set_compatible("misterx");
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(gl4004_state::gl4000)
+void gl4004_state::gl4000(machine_config &config)
+{
pc2000(config);
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_SIZE(120, 36) // 4x20 chars
- MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 36-1)
+ m_screen->set_size(120, 36); // 4x20 chars
+ m_screen->set_visarea(0, 120-1, 0, 36-1);
- MCFG_DEVICE_MODIFY("hd44780")
- MCFG_HD44780_LCD_SIZE(4, 20)
- MCFG_HD44780_PIXEL_UPDATE_CB(gl4004_state,gl4000_pixel_update)
+ m_lcdc->set_lcd_size(4, 20);
+ m_lcdc->set_pixel_update_cb(FUNC(gl4004_state::gl4000_pixel_update));
- MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("gl2000_cart", "gl2000")
- MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("misterx_cart", "misterx")
-MACHINE_CONFIG_END
+ SOFTWARE_LIST(config, "gl2000_cart").set_compatible("gl2000");
+ SOFTWARE_LIST(config, "misterx_cart").set_compatible("misterx");
+}
-MACHINE_CONFIG_START(pc1000_state::misterx)
+void pc1000_state::misterx(machine_config &config)
+{
pc2000(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(pc1000_mem)
- MCFG_DEVICE_IO_MAP(pc1000_io)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(pc1000_state, irq0_line_hold, 10)
+ m_maincpu->set_addrmap(AS_PROGRAM, &pc1000_state::pc1000_mem);
+ m_maincpu->set_addrmap(AS_IO, &pc1000_state::pc1000_io);
+ m_maincpu->set_periodic_int(FUNC(pc1000_state::irq0_line_hold), attotime::from_hz(10));
/* video hardware */
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_SIZE(120, 9) //1x20 chars
- MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 9-1)
+ m_screen->set_size(120, 9); //1x20 chars
+ m_screen->set_visarea(0, 120-1, 0, 9-1);
- MCFG_DEVICE_MODIFY("hd44780")
- MCFG_HD44780_LCD_SIZE(1, 20)
- MCFG_HD44780_PIXEL_UPDATE_CB(pc1000_state,pc1000_pixel_update)
+ m_lcdc->set_lcd_size(1, 20);
+ m_lcdc->set_pixel_update_cb(FUNC(pc1000_state::pc1000_pixel_update));
/* Software lists */
- MCFG_SOFTWARE_LIST_ADD("cart_list", "misterx")
-MACHINE_CONFIG_END
+ SOFTWARE_LIST(config, "cart_list").set_original("misterx");
+}
-MACHINE_CONFIG_START(pc1000_state::pc1000)
+void pc1000_state::pc1000(machine_config &config)
+{
misterx(config);
- MCFG_SOFTWARE_LIST_REMOVE("cart_list")
- MCFG_SOFTWARE_LIST_REMOVE("pc1000_cart")
- MCFG_SOFTWARE_LIST_ADD("cart_list", "pc1000")
- MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("misterx_cart", "misterx")
-MACHINE_CONFIG_END
+ config.device_remove("cart_list");
+ config.device_remove("pc1000_cart");
+ SOFTWARE_LIST(config, "cart_list").set_original("pc1000");
+ SOFTWARE_LIST(config, "misterx_cart").set_compatible("misterx");
+}
/* ROM definition */
ROM_START( pc2000 )