From f7286b34732d62ee53796e7a624924859d3bfb36 Mon Sep 17 00:00:00 2001 From: AJR Date: Fri, 21 Jul 2023 07:21:14 -0400 Subject: a2bus: Add Fourth Dimension Parallel Printer Interface [AJR, Apple II Documentation Project] --- src/devices/bus/a2bus/a2parprn.cpp | 57 ++++++++++++++++++++++++++++++++++++-- src/devices/bus/a2bus/a2parprn.h | 5 ++++ src/devices/bus/a2bus/cards.cpp | 3 ++ 3 files changed, 62 insertions(+), 3 deletions(-) diff --git a/src/devices/bus/a2bus/a2parprn.cpp b/src/devices/bus/a2bus/a2parprn.cpp index ceb4f166bee..3068cad625f 100644 --- a/src/devices/bus/a2bus/a2parprn.cpp +++ b/src/devices/bus/a2bus/a2parprn.cpp @@ -22,6 +22,8 @@ public: virtual u8 read_cnxx(u8 offset) override; protected: + a2bus_parprn_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock); + // device_t implementation virtual tiny_rom_entry const *device_rom_region() const override; virtual void device_add_mconfig(machine_config &config) override; @@ -39,7 +41,11 @@ private: required_device m_printer_conn; required_device m_printer_out; required_ioport m_input_config; + +protected: required_region_ptr m_prom; + +private: emu_timer * m_strobe_timer; u8 m_next_strobe; // B3 pin 13 @@ -48,6 +54,18 @@ private: }; +class a2bus_4dparprn_device : public a2bus_parprn_device +{ +public: + a2bus_4dparprn_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); + +protected: + // device_t implementation + virtual tiny_rom_entry const *device_rom_region() const override; + virtual void device_start() override; +}; + + // FIXME: get proper PROM dumps. /* @@ -83,6 +101,12 @@ ROM_START(parprn) ROM_LOAD( "prom.b4", 0x0000, 0x0100, BAD_DUMP CRC(00b742ca) SHA1(c67888354aa013f9cb882eeeed924e292734e717) ) ROM_END +ROM_START(4dparprn) + ROM_REGION(0x100, "prom", 0) + ROM_LOAD( "rom.bin", 0x0000, 0x0100, CRC(189262c9) SHA1(d6179664d6860df5ed26fce72f253e28f933b01a) ) + ROM_IGNORE(0x700) // same data is repeated 8 times +ROM_END + INPUT_PORTS_START(parprn) PORT_START("CFG") @@ -104,8 +128,8 @@ INPUT_PORTS_END -a2bus_parprn_device::a2bus_parprn_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : - device_t(mconfig, A2BUS_PARPRN, tag, owner, clock), +a2bus_parprn_device::a2bus_parprn_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock) : + device_t(mconfig, type, tag, owner, clock), device_a2bus_card_interface(mconfig, *this), m_printer_conn(*this, "prn"), m_printer_out(*this, "prn_out"), @@ -119,6 +143,17 @@ a2bus_parprn_device::a2bus_parprn_device(machine_config const &mconfig, char con } +a2bus_parprn_device::a2bus_parprn_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : + a2bus_parprn_device(mconfig, A2BUS_PARPRN, tag, owner, clock) +{ +} + + +a2bus_4dparprn_device::a2bus_4dparprn_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : + a2bus_parprn_device(mconfig, A2BUS_4DPARPRN, tag, owner, clock) +{ +} + //---------------------------------------------- // device_a2bus_card_interface implementation @@ -149,7 +184,7 @@ void a2bus_parprn_device::write_c0nx(u8 offset, u8 data) ioport_value const cfg(m_input_config->read()); - m_printer_out->write(data & (BIT(cfg, 8) ? 0xffU : 0x7fU)); + m_printer_out->write(data & (BIT(cfg, 4) ? 0xffU : 0x7fU)); m_printer_conn->write_strobe(BIT(~cfg, 3)); m_next_strobe = BIT(cfg, 3); m_ack_latch = 0U; @@ -195,6 +230,12 @@ tiny_rom_entry const *a2bus_parprn_device::device_rom_region() const } +tiny_rom_entry const *a2bus_4dparprn_device::device_rom_region() const +{ + return ROM_NAME(4dparprn); +} + + void a2bus_parprn_device::device_add_mconfig(machine_config &config) { CENTRONICS(config, m_printer_conn, centronics_devices, "printer"); @@ -221,6 +262,15 @@ void a2bus_parprn_device::device_start() } +void a2bus_4dparprn_device::device_start() +{ + for (unsigned i = 0U; 0x100 > i; ++i) + m_prom[i] = (m_prom[i] << 4) | (m_prom[i] >> 4); + + a2bus_parprn_device::device_start(); +} + + void a2bus_parprn_device::device_reset() { m_ack_latch = 1U; @@ -271,3 +321,4 @@ TIMER_CALLBACK_MEMBER(a2bus_parprn_device::update_strobe) DEFINE_DEVICE_TYPE_PRIVATE(A2BUS_PARPRN, device_a2bus_card_interface, a2bus_parprn_device, "a2parprn", "Apple II Parallel Printer Interface Card") +DEFINE_DEVICE_TYPE_PRIVATE(A2BUS_4DPARPRN, device_a2bus_card_interface, a2bus_4dparprn_device, "4dparprn", "Fourth Dimension Parallel Printer Interface") diff --git a/src/devices/bus/a2bus/a2parprn.h b/src/devices/bus/a2bus/a2parprn.h index 668f0c89ca4..66681a3c395 100644 --- a/src/devices/bus/a2bus/a2parprn.h +++ b/src/devices/bus/a2bus/a2parprn.h @@ -46,6 +46,10 @@ packages. Common modifications included stretching strobe and/or acknowledge pulses to improve reliability. + The Fourth Dimension board uses a larger EPROM, but still only + 256 bytes are used. Instead of the 20-pin header, it has a 16-pin + DIP socket, and no jumper block. + ***********************************************************************/ #ifndef MAME_BUS_A2BUS_A2PARPRN_H #define MAME_BUS_A2BUS_A2PARPRN_H @@ -55,5 +59,6 @@ #include "a2bus.h" DECLARE_DEVICE_TYPE(A2BUS_PARPRN, device_a2bus_card_interface) +DECLARE_DEVICE_TYPE(A2BUS_4DPARPRN, device_a2bus_card_interface) #endif // MAME_BUS_A2BUS_A2PARPRN_H diff --git a/src/devices/bus/a2bus/cards.cpp b/src/devices/bus/a2bus/cards.cpp index f00e1a8c267..9594a7093c8 100644 --- a/src/devices/bus/a2bus/cards.cpp +++ b/src/devices/bus/a2bus/cards.cpp @@ -117,6 +117,7 @@ void apple2_cards(device_slot_interface &device) device.option_add("ultratermenh", A2BUS_ULTRATERMENH); // Videx UltraTerm (enhanced //e) device.option_add("aevm80", A2BUS_AEVIEWMASTER80); // Applied Engineering ViewMaster 80 device.option_add("parprn", A2BUS_PARPRN); // Apple II Parallel Printer Interface Card + device.option_add("4dparprn", A2BUS_4DPARPRN); // Fourth Dimension Parallel Printer Interface device.option_add("parallel", A2BUS_PIC); // Apple II Parallel Interface Card device.option_add("grappler", A2BUS_GRAPPLER); // Orange Micro Grappler Printer Interface card device.option_add("grapplus", A2BUS_GRAPPLERPLUS); // Orange Micro Grappler+ Printer Interface card @@ -187,6 +188,7 @@ void apple2e_cards(device_slot_interface &device) device.option_add("ultratermenh", A2BUS_ULTRATERMENH); // Videx UltraTerm (enhanced //e) device.option_add("aevm80", A2BUS_AEVIEWMASTER80); // Applied Engineering ViewMaster 80 device.option_add("parprn", A2BUS_PARPRN); // Apple II Parallel Printer Interface Card + device.option_add("4dparprn", A2BUS_4DPARPRN); // Fourth Dimension Parallel Printer Interface device.option_add("parallel", A2BUS_PIC); // Apple II Parallel Interface Card device.option_add("grappler", A2BUS_GRAPPLER); // Orange Micro Grappler Printer Interface card device.option_add("grapplus", A2BUS_GRAPPLERPLUS); // Orange Micro Grappler+ Printer Interface card @@ -263,6 +265,7 @@ void apple2gs_cards(device_slot_interface &device) device.option_add("ultratermenh", A2BUS_ULTRATERMENH); // Videx UltraTerm (enhanced //e) device.option_add("aevm80", A2BUS_AEVIEWMASTER80); // Applied Engineering ViewMaster 80 device.option_add("parprn", A2BUS_PARPRN); // Apple II Parallel Printer Interface Card + device.option_add("4dparprn", A2BUS_4DPARPRN); // Fourth Dimension Parallel Printer Interface device.option_add("parallel", A2BUS_PIC); // Apple Parallel Interface Card device.option_add("grappler", A2BUS_GRAPPLER); // Orange Micro Grappler Printer Interface card device.option_add("grapplus", A2BUS_GRAPPLERPLUS); // Orange Micro Grappler+ Printer Interface card -- cgit v1.2.3