summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/spc1500.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/spc1500.cpp')
-rw-r--r--src/mame/drivers/spc1500.cpp64
1 files changed, 30 insertions, 34 deletions
diff --git a/src/mame/drivers/spc1500.cpp b/src/mame/drivers/spc1500.cpp
index bbbacb5a135..c7860f951c6 100644
--- a/src/mame/drivers/spc1500.cpp
+++ b/src/mame/drivers/spc1500.cpp
@@ -410,12 +410,12 @@ WRITE8_MEMBER( spc1500_state::crtc_w)
if((offset & 1) == 0)
{
m_crtc_index = data & 0x1f;
- m_vdg->address_w(data);
+ m_vdg->address_w(space, 0, data);
}
else
{
m_crtc_vreg[m_crtc_index] = data;
- m_vdg->register_w(data);
+ m_vdg->register_w(space, 0, data);
}
}
@@ -423,7 +423,7 @@ READ8_MEMBER( spc1500_state::crtc_r)
{
if (offset & 1)
{
- return m_vdg->register_r();
+ return m_vdg->register_r(space, 0);
}
return 0;
}
@@ -648,8 +648,8 @@ WRITE8_MEMBER( spc1500_state::double_w)
if (offset < 0x1900) { crtc_w(space, offset, data); } else
if (offset < 0x1a00) {} else
if (offset < 0x1b00) { m_pio->write(offset, data); } else
- if (offset < 0x1c00) { m_sound->data_w(data);} else
- if (offset < 0x1d00) { m_sound->address_w(data);} else
+ if (offset < 0x1c00) { m_sound->data_w(space, offset, data);} else
+ if (offset < 0x1d00) { m_sound->address_w(space, offset, data);} else
if (offset < 0x1e00) { romsel(space, offset, data);} else
if (offset < 0x1f00) { ramsel(space, offset, data);} else
if (offset < 0x2000) {} else
@@ -675,7 +675,7 @@ READ8_MEMBER( spc1500_state::io_r)
if (offset < 0x1900) { return crtc_r(space, offset); } else
if (offset < 0x1a00) { return keyboard_r(space, offset); } else
if (offset < 0x1b00) { return m_pio->read(offset); } else
- if (offset < 0x1c00) { return m_sound->data_r(); } else
+ if (offset < 0x1c00) { return m_sound->data_r(space, offset); } else
if (offset < 0x2000) {} else
if (offset < 0x10000){
if (offset < 0x4000)
@@ -877,23 +877,22 @@ READ8_MEMBER( spc1500_state::porta_r )
return data;
}
-void spc1500_state::spc1500(machine_config &config)
-{
+MACHINE_CONFIG_START(spc1500_state::spc1500)
/* basic machine hardware */
- Z80(config, m_maincpu, XTAL(4'000'000));
- m_maincpu->set_addrmap(AS_PROGRAM, &spc1500_state::spc1500_mem);
- //m_maincpu->set_addrmap(AS_IO, &spc1500_state::spc1500_io);
- m_maincpu->set_addrmap(AS_IO, &spc1500_state::spc1500_double_io);
- m_maincpu->set_periodic_int(FUNC(spc1500_state::irq0_line_hold), attotime::from_hz(60));
+ MCFG_DEVICE_ADD("maincpu",Z80, XTAL(4'000'000))
+ MCFG_DEVICE_PROGRAM_MAP(spc1500_mem)
+ //MCFG_DEVICE_IO_MAP(spc1500_io)
+ MCFG_DEVICE_IO_MAP(spc1500_double_io)
+ MCFG_DEVICE_PERIODIC_INT_DRIVER(spc1500_state, irq0_line_hold, 60)
/* video hardware */
- screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
- screen.set_refresh_hz(60);
- screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
- screen.set_size(640, 400);
- screen.set_visarea(0,640-1,0,400-1);
- screen.set_screen_update("mc6845", FUNC(mc6845_device::screen_update));
+ MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
+ MCFG_SCREEN_SIZE(640, 400)
+ MCFG_SCREEN_VISIBLE_AREA(0,640-1,0,400-1)
+ MCFG_SCREEN_UPDATE_DEVICE("mc6845", mc6845_device, screen_update )
PALETTE(config, m_palette, FUNC(spc1500_state::spc_palette), 8);
@@ -912,7 +911,7 @@ void spc1500_state::spc1500(machine_config &config)
m_pio->out_pb_callback().set(FUNC(spc1500_state::portb_w));
m_pio->out_pc_callback().set(FUNC(spc1500_state::portc_w));
- TIMER(config, "1hz").configure_periodic(FUNC(spc1500_state::timer), attotime::from_hz(1));
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("1hz", spc1500_state, timer, attotime::from_hz(1))
/* sound hardware */
SPEAKER(config, "mono").front_center();
@@ -920,26 +919,23 @@ void spc1500_state::spc1500(machine_config &config)
m_sound->port_a_read_callback().set(FUNC(spc1500_state::psga_r));
m_sound->port_b_write_callback().set(FUNC(spc1500_state::psgb_w));
m_sound->add_route(ALL_OUTPUTS, "mono", 1.00);
- WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.25);
-
- CENTRONICS(config, m_centronics, centronics_devices, "printer");
- m_centronics->busy_handler().set(FUNC(spc1500_state::centronics_busy_w));
+ WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25);
- output_latch_device &cent_data_out(OUTPUT_LATCH(config, "cent_data_out"));
- m_centronics->set_output_latch(cent_data_out);
+ MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer")
+ MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, spc1500_state, centronics_busy_w))
+ MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
+ MCFG_DEVICE_ADD("cent_status_in", INPUT_BUFFER, 0)
- INPUT_BUFFER(config, "cent_status_in");
+ MCFG_CASSETTE_ADD("cassette")
+ MCFG_CASSETTE_FORMATS(spc1000_cassette_formats)
+ MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_MUTED | CASSETTE_MOTOR_DISABLED)
+ MCFG_CASSETTE_INTERFACE("spc1500_cass")
- CASSETTE(config, m_cass);
- m_cass->set_formats(spc1000_cassette_formats);
- m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_MUTED | CASSETTE_MOTOR_DISABLED);
- m_cass->set_interface("spc1500_cass");
-
- SOFTWARE_LIST(config, "cass_list").set_original("spc1500_cass");
+ MCFG_SOFTWARE_LIST_ADD("cass_list", "spc1500_cass")
/* internal ram */
RAM(config, RAM_TAG).set_default_size("64K");
- }
+MACHINE_CONFIG_END
/* ROM definition */
ROM_START( spc1500 )