summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/ieee488/softbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/ieee488/softbox.cpp')
-rw-r--r--src/devices/bus/ieee488/softbox.cpp84
1 files changed, 75 insertions, 9 deletions
diff --git a/src/devices/bus/ieee488/softbox.cpp b/src/devices/bus/ieee488/softbox.cpp
index 0a38d5ce9cf..093e9863d62 100644
--- a/src/devices/bus/ieee488/softbox.cpp
+++ b/src/devices/bus/ieee488/softbox.cpp
@@ -10,13 +10,23 @@
This is an emulation of the SoftBox as a PET/CBM peripheral, where
the PET is used as a terminal over IEEE-488. For the standalone
mode where an RS-232 terminal is used, and also information on
- how to set up the Corvus drive, see: src/mame/drivers/softbox.c.
+ how to set up the Corvus drive, see: src/mame/skeleton/softbox.cpp
*/
#include "emu.h"
#include "softbox.h"
+#include "bus/rs232/rs232.h"
+#include "cpu/z80/z80.h"
+#include "imagedev/harddriv.h"
+#include "machine/com8116.h"
+#include "machine/corvushd.h"
+#include "machine/i8251.h"
+#include "machine/i8255.h"
+
+
+namespace {
//**************************************************************************
// MACROS / CONSTANTS
@@ -30,13 +40,6 @@
-//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-DEFINE_DEVICE_TYPE(SOFTBOX, softbox_device, "pet_softbox", "SSE SoftBox")
-
-
//-------------------------------------------------
// ROM( softbox )
//-------------------------------------------------
@@ -56,6 +59,60 @@ ROM_START( softbox )
ROM_END
+//**************************************************************************
+// TYPE DECLARATIONS
+//**************************************************************************
+
+// ======================> softbox_device
+
+class softbox_device : public device_t,
+ public device_ieee488_interface
+{
+public:
+ // construction/destruction
+ softbox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device_t implementation
+ virtual void device_start() override ATTR_COLD;
+ virtual void device_reset_after_children() override;
+ virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
+ virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
+ virtual ioport_constructor device_input_ports() const override ATTR_COLD;
+
+ // device_ieee488_interface implementation
+ virtual void ieee488_ifc(int state) override;
+
+private:
+ enum
+ {
+ LED_A = 0,
+ LED_B,
+ LED_READY
+ };
+
+ uint8_t ppi0_pa_r();
+ void ppi0_pb_w(uint8_t data);
+
+ uint8_t ppi1_pa_r();
+ void ppi1_pb_w(uint8_t data);
+ uint8_t ppi1_pc_r();
+ void ppi1_pc_w(uint8_t data);
+
+ void dbrg_w(uint8_t data);
+
+ void softbox_io(address_map &map) ATTR_COLD;
+ void softbox_mem(address_map &map) ATTR_COLD;
+
+ required_device<cpu_device> m_maincpu;
+ required_device<com8116_device> m_dbrg;
+ required_device<corvus_hdc_device> m_hdc;
+ output_finder<3> m_leds;
+
+ int m_ifc; // Tracks previous state of IEEE-488 IFC line
+};
+
+
//-------------------------------------------------
// rom_region - device-specific ROM region
//-------------------------------------------------
@@ -313,7 +370,7 @@ ioport_constructor softbox_device::device_input_ports() const
//-------------------------------------------------
softbox_device::softbox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, SOFTBOX, tag, owner, clock)
+ : device_t(mconfig, GPIB_SOFTBOX, tag, owner, clock)
, device_ieee488_interface(mconfig, *this)
, m_maincpu(*this, Z80_TAG)
, m_dbrg(*this, "ic14")
@@ -380,3 +437,12 @@ void softbox_device::dbrg_w(uint8_t data)
m_dbrg->str_w(data & 0x0f);
m_dbrg->stt_w(data >> 4);
}
+
+} // anonymous namespace
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE_PRIVATE(GPIB_SOFTBOX, device_ieee488_interface, softbox_device, "gpib_softbox", "SSE SoftBox")