summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/cat.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
committer Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
commit97b67170277437131adf6ed4d60139c172529e4f (patch)
tree7a5cbf608f191075f1612b1af15832c206a3fe2d /src/mame/drivers/cat.cpp
parentb380514764cf857469bae61c11143a19f79a74c5 (diff)
(nw) Clean up the mess on master
This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
Diffstat (limited to 'src/mame/drivers/cat.cpp')
-rw-r--r--src/mame/drivers/cat.cpp42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/mame/drivers/cat.cpp b/src/mame/drivers/cat.cpp
index f56118d5591..8fb88335a64 100644
--- a/src/mame/drivers/cat.cpp
+++ b/src/mame/drivers/cat.cpp
@@ -773,7 +773,7 @@ void cat_state::cat_mem(address_map &map)
map(0x80000c, 0x80000d).r(FUNC(cat_state::cat_0080_r)).mirror(0x18FFE0); // Open bus?
map(0x80000e, 0x80000f).rw(FUNC(cat_state::cat_battery_r), FUNC(cat_state::cat_printer_control_w)).mirror(0x18FFE0); // Centronics Printer Control, keyboard led and country code enable
map(0x800010, 0x80001f).r(FUNC(cat_state::cat_0080_r)).mirror(0x18FFE0); // Open bus?
- map(0x810000, 0x81001f).rw("duartn68681", FUNC(mc68681_device::read), FUNC(mc68681_device::write)).umask16(0x00ff).mirror(0x18FFE0);
+ map(0x810000, 0x81001f).rw(m_duart, FUNC(mc68681_device::read), FUNC(mc68681_device::write)).umask16(0x00ff).mirror(0x18FFE0);
map(0x820000, 0x82003f).rw(FUNC(cat_state::cat_modem_r), FUNC(cat_state::cat_modem_w)).mirror(0x18FFC0); // AMI S35213 Modem Chip, all access is on bit 7
map(0x830000, 0x830001).r(FUNC(cat_state::cat_6ms_counter_r)).mirror(0x18FFFE); // 16bit 6ms counter clocked by output of another 16bit counter clocked at 10mhz
map(0x840000, 0x840001).rw(FUNC(cat_state::cat_2e80_r), FUNC(cat_state::cat_opr_w)).mirror(0x18FFFE); // GA2 Output port register (video enable, invert, watchdog reset, phone relays)
@@ -1054,42 +1054,44 @@ WRITE_LINE_MEMBER(cat_state::prn_ack_ff) // switch the flipflop state on the ris
#endif
}
-MACHINE_CONFIG_START(cat_state::cat)
-
+void cat_state::cat(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",M68000, XTAL(19'968'000)/4)
- MCFG_DEVICE_PROGRAM_MAP(cat_mem)
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(cat_state,cat_int_ack)
+ M68000(config, m_maincpu, XTAL(19'968'000)/4);
+ m_maincpu->set_addrmap(AS_PROGRAM, &cat_state::cat_mem);
+ m_maincpu->set_irq_acknowledge_callback(FUNC(cat_state::cat_int_ack));
MCFG_MACHINE_START_OVERRIDE(cat_state,cat)
MCFG_MACHINE_RESET_OVERRIDE(cat_state,cat)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_SIZE(672, 344)
- MCFG_SCREEN_VISIBLE_AREA(0, 672-1, 0, 344-1)
- MCFG_SCREEN_UPDATE_DRIVER(cat_state, screen_update_cat)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(50);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ screen.set_size(672, 344);
+ screen.set_visarea_full();
+ screen.set_screen_update(FUNC(cat_state::screen_update_cat));
MCFG_VIDEO_START_OVERRIDE(cat_state,cat)
- MCFG_DEVICE_ADD( "duartn68681", MC68681, (XTAL(19'968'000)*2)/11 ) // duart is normally clocked by 3.6864mhz xtal, but cat seemingly uses a divider from the main xtal instead which probably yields 3.63054545Mhz. There is a trace to cut and a mounting area to allow using an actual 3.6864mhz xtal if you so desire
- MCFG_MC68681_IRQ_CALLBACK(WRITELINE(*this, cat_state, cat_duart_irq_handler))
- MCFG_MC68681_A_TX_CALLBACK(WRITELINE(*this, cat_state, cat_duart_txa))
- MCFG_MC68681_B_TX_CALLBACK(WRITELINE(*this, cat_state, cat_duart_txb))
- MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(*this, cat_state, cat_duart_output))
+ MC68681(config, m_duart, (XTAL(19'968'000)*2)/11); // duart is normally clocked by 3.6864mhz xtal, but cat seemingly uses a divider from the main xtal instead which probably yields 3.63054545Mhz. There is a trace to cut and a mounting area to allow using an actual 3.6864mhz xtal if you so desire
+ m_duart->irq_cb().set(FUNC(cat_state::cat_duart_irq_handler));
+ m_duart->a_tx_cb().set(FUNC(cat_state::cat_duart_txa));
+ m_duart->b_tx_cb().set(FUNC(cat_state::cat_duart_txb));
+ m_duart->outport_cb().set(FUNC(cat_state::cat_duart_output));;
CENTRONICS(config, m_ctx, centronics_devices, "printer");
m_ctx->ack_handler().set(FUNC(cat_state::prn_ack_ff));
- m_ctx->busy_handler().set("duartn68681", FUNC(mc68681_device::ip4_w)).invert();
- MCFG_CENTRONICS_OUTPUT_LATCH_ADD("ctx_data_out", "ctx")
+ m_ctx->busy_handler().set(m_duart, FUNC(mc68681_device::ip4_w)).invert();
+
+ OUTPUT_LATCH(config, m_ctx_data_out);
+ m_ctx->set_output_latch(*m_ctx_data_out);
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 1.00);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
-MACHINE_CONFIG_END
+}
ROM_START( cat )
ROM_REGION( 0x40000, "maincpu", ROMREGION_ERASEFF )