diff options
Diffstat (limited to 'src/devices/bus/pofo/hpc101.cpp')
-rw-r--r-- | src/devices/bus/pofo/hpc101.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/devices/bus/pofo/hpc101.cpp b/src/devices/bus/pofo/hpc101.cpp index 93268e95bb6..d62f1002f7d 100644 --- a/src/devices/bus/pofo/hpc101.cpp +++ b/src/devices/bus/pofo/hpc101.cpp @@ -33,28 +33,31 @@ DEFINE_DEVICE_TYPE(POFO_HPC101, pofo_hpc101_device, "pofo_hpc101", "Atari Portfo // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(pofo_hpc101_device::device_add_mconfig) +void pofo_hpc101_device::device_add_mconfig(machine_config &config) +{ I8255A(config, m_ppi); m_ppi->out_pa_callback().set("cent_data_out", FUNC(output_latch_device::bus_w)); m_ppi->out_pb_callback().set("cent_ctrl_out", FUNC(output_latch_device::bus_w)); m_ppi->in_pc_callback().set("cent_status_in", FUNC(input_buffer_device::bus_r)); - MCFG_DEVICE_ADD(CENTRONICS_TAG, CENTRONICS, centronics_devices, "printer") - MCFG_CENTRONICS_ACK_HANDLER(WRITELINE("cent_status_in", input_buffer_device, write_bit5)) - MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE("cent_status_in", input_buffer_device, write_bit4)) - MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE("cent_status_in", input_buffer_device, write_bit3)) - MCFG_CENTRONICS_SELECT_HANDLER(WRITELINE("cent_status_in", input_buffer_device, write_bit1)) - MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE("cent_status_in", input_buffer_device, write_bit0)) + centronics_device ¢ronics(CENTRONICS(config, CENTRONICS_TAG, centronics_devices, "printer")); + centronics.ack_handler().set("cent_status_in", FUNC(input_buffer_device::write_bit5)); + centronics.busy_handler().set("cent_status_in", FUNC(input_buffer_device::write_bit4)); + centronics.fault_handler().set("cent_status_in", FUNC(input_buffer_device::write_bit3)); + centronics.select_handler().set("cent_status_in", FUNC(input_buffer_device::write_bit1)); + centronics.perror_handler().set("cent_status_in", FUNC(input_buffer_device::write_bit0)); + + output_latch_device ¢_data_out(OUTPUT_LATCH(config, "cent_data_out")); + centronics.set_output_latch(cent_data_out); - MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) - MCFG_DEVICE_ADD("cent_status_in", INPUT_BUFFER, 0) + INPUT_BUFFER(config, "cent_status_in"); - MCFG_DEVICE_ADD("cent_ctrl_out", OUTPUT_LATCH, 0) - MCFG_OUTPUT_LATCH_BIT0_HANDLER(WRITELINE(CENTRONICS_TAG, centronics_device, write_strobe)) - MCFG_OUTPUT_LATCH_BIT1_HANDLER(WRITELINE(CENTRONICS_TAG, centronics_device, write_autofd)) - MCFG_OUTPUT_LATCH_BIT2_HANDLER(WRITELINE(CENTRONICS_TAG, centronics_device, write_init)) - MCFG_OUTPUT_LATCH_BIT3_HANDLER(WRITELINE(CENTRONICS_TAG, centronics_device, write_select_in)) -MACHINE_CONFIG_END + output_latch_device ¢_ctrl_out(OUTPUT_LATCH(config, "cent_ctrl_out")); + cent_ctrl_out.bit_handler<0>().set(CENTRONICS_TAG, FUNC(centronics_device::write_strobe)); + cent_ctrl_out.bit_handler<1>().set(CENTRONICS_TAG, FUNC(centronics_device::write_autofd)); + cent_ctrl_out.bit_handler<2>().set(CENTRONICS_TAG, FUNC(centronics_device::write_init)); + cent_ctrl_out.bit_handler<3>().set(CENTRONICS_TAG, FUNC(centronics_device::write_select_in)); +} //************************************************************************** @@ -96,7 +99,7 @@ void pofo_hpc101_device::device_reset() // nrdi_r - read //------------------------------------------------- -uint8_t pofo_hpc101_device::nrdi_r(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) +uint8_t pofo_hpc101_device::nrdi_r(offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { if (!bcom) { @@ -119,7 +122,7 @@ uint8_t pofo_hpc101_device::nrdi_r(address_space &space, offs_t offset, uint8_t // nwri_w - write //------------------------------------------------- -void pofo_hpc101_device::nwri_w(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) +void pofo_hpc101_device::nwri_w(offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { if (!bcom) { |