summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author Nigel Barnes <Pernod70@users.noreply.github.com>2020-03-03 19:27:56 +0000
committer Nigel Barnes <Pernod70@users.noreply.github.com>2020-03-03 19:40:23 +0000
commita1a70c4357c4ee87e7492a4cd2f62306f7965cd5 (patch)
treef545da0e0a8ba1b43e9cb00c2c22a415696969a1 /src/devices
parent89edcc3ea4de545fc385ab11f60d27eb450b5e98 (diff)
cms6502: Cleanups and promoted to working.
- Corrected M4 ROM ordering. - Added IEEE controller card.
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/bus/acorn/bus.cpp2
-rw-r--r--src/devices/bus/acorn/cms/4080term.cpp2
-rw-r--r--src/devices/bus/acorn/cms/fdc.cpp27
-rw-r--r--src/devices/bus/acorn/cms/fdc.h2
-rw-r--r--src/devices/bus/acorn/cms/ieee.cpp89
-rw-r--r--src/devices/bus/acorn/cms/ieee.h48
6 files changed, 146 insertions, 24 deletions
diff --git a/src/devices/bus/acorn/bus.cpp b/src/devices/bus/acorn/bus.cpp
index 9bbbf1e7fac..55f332e6581 100644
--- a/src/devices/bus/acorn/bus.cpp
+++ b/src/devices/bus/acorn/bus.cpp
@@ -159,6 +159,7 @@ void device_acorn_bus_interface::interface_pre_start()
#include "cms/4080term.h"
#include "cms/fdc.h"
#include "cms/hires.h"
+#include "cms/ieee.h"
void acorn_bus_devices(device_slot_interface &device)
{
@@ -187,4 +188,5 @@ void cms_bus_devices(device_slot_interface &device)
device.option_add("4080term", CMS_4080TERM); /* CMS 40/80 Video Terminal Card */
device.option_add("fdc", CMS_FDC); /* CMS Floppy Disc Controller */
device.option_add("hires", CMS_HIRES); /* CMS High Resolution Colour Graphics Card */
+ device.option_add("ieee", CMS_IEEE); /* CMS IEEE Interface */
}
diff --git a/src/devices/bus/acorn/cms/4080term.cpp b/src/devices/bus/acorn/cms/4080term.cpp
index f5ae26633e5..104f70bb60d 100644
--- a/src/devices/bus/acorn/cms/4080term.cpp
+++ b/src/devices/bus/acorn/cms/4080term.cpp
@@ -78,7 +78,7 @@ void cms_4080term_device::device_add_mconfig(machine_config &config)
m_screen->set_screen_update("ef9345", FUNC(ef9345_device::screen_update));
GFXDECODE(config, "gfxdecode", "palette", gfx_cms_4080term);
- PALETTE(config, "palette").set_entries(8);
+ PALETTE(config, "palette", palette_device::RGB_3BIT);
EF9345(config, m_ef9345, 0);
m_ef9345->set_screen("screen");
diff --git a/src/devices/bus/acorn/cms/fdc.cpp b/src/devices/bus/acorn/cms/fdc.cpp
index 1d2c81dabf5..16cabac444a 100644
--- a/src/devices/bus/acorn/cms/fdc.cpp
+++ b/src/devices/bus/acorn/cms/fdc.cpp
@@ -24,7 +24,8 @@ DEFINE_DEVICE_TYPE(CMS_FDC, cms_fdc_device, "cms_fdc", "CMS Floppy Disc Controll
//-------------------------------------------------
FLOPPY_FORMATS_MEMBER(cms_fdc_device::floppy_formats )
- FLOPPY_ACORN_SSD_FORMAT
+ FLOPPY_ACORN_SSD_FORMAT,
+ FLOPPY_ACORN_DSD_FORMAT
FLOPPY_FORMATS_END
static void cms_floppies(device_slot_interface &device)
@@ -39,14 +40,9 @@ static void cms_floppies(device_slot_interface &device)
void cms_fdc_device::device_add_mconfig(machine_config &config)
{
WD1770(config, m_fdc, 8_MHz_XTAL);
- //m_fdc->intrq_wr_callback().set(FUNC(cms_fdc_device::bus_irq_w));
- //m_fdc->drq_wr_callback().set(FUNC(cms_fdc_device::bus_nmi_w));
- FLOPPY_CONNECTOR(config, m_floppy[0], cms_floppies, "35dd", floppy_formats);
- m_floppy[0]->enable_sound(true);
- FLOPPY_CONNECTOR(config, m_floppy[1], cms_floppies, "35dd", floppy_formats);
- m_floppy[1]->enable_sound(true);
- FLOPPY_CONNECTOR(config, m_floppy[2], cms_floppies, nullptr, floppy_formats);
- m_floppy[2]->enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppy[0], cms_floppies, "35dd", floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppy[1], cms_floppies, "35dd", floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppy[2], cms_floppies, nullptr, floppy_formats).enable_sound(true);
}
@@ -90,14 +86,13 @@ READ8_MEMBER(cms_fdc_device::wd1770_state_r)
data |= m_fdc->intrq_r() << 6;
data |= m_fdc->drq_r() << 7;
- logerror("floppy state %02x\n", data);
+
return data;
}
WRITE8_MEMBER(cms_fdc_device::wd1770_control_w)
{
floppy_image_device *floppy = nullptr;
- logerror("floppy control %02x\n", data);
// bit 0, 1, 2: drive select
if (BIT(data, 0)) floppy = m_floppy[0]->get_device();
@@ -112,13 +107,3 @@ WRITE8_MEMBER(cms_fdc_device::wd1770_control_w)
// bit 7: density ??
m_fdc->dden_w(BIT(data, 7));
}
-
-WRITE_LINE_MEMBER(cms_fdc_device::bus_nmi_w)
-{
- m_bus->nmi_w(state);
-}
-
-WRITE_LINE_MEMBER(cms_fdc_device::bus_irq_w)
-{
- m_bus->irq_w(state);
-}
diff --git a/src/devices/bus/acorn/cms/fdc.h b/src/devices/bus/acorn/cms/fdc.h
index 4795eaab18a..64bb921bba7 100644
--- a/src/devices/bus/acorn/cms/fdc.h
+++ b/src/devices/bus/acorn/cms/fdc.h
@@ -41,8 +41,6 @@ protected:
private:
DECLARE_READ8_MEMBER(wd1770_state_r);
DECLARE_WRITE8_MEMBER(wd1770_control_w);
- DECLARE_WRITE_LINE_MEMBER(bus_irq_w);
- DECLARE_WRITE_LINE_MEMBER(bus_nmi_w);
required_device<wd_fdc_device_base> m_fdc;
required_device_array<floppy_connector, 3> m_floppy;
diff --git a/src/devices/bus/acorn/cms/ieee.cpp b/src/devices/bus/acorn/cms/ieee.cpp
new file mode 100644
index 00000000000..06d9b47f0dd
--- /dev/null
+++ b/src/devices/bus/acorn/cms/ieee.cpp
@@ -0,0 +1,89 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ CMS IEEE Controller Board
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "ieee.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(CMS_IEEE, cms_ieee_device, "cms_ieee", "CMS IEEE Controller Board");
+
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void cms_ieee_device::device_add_mconfig(machine_config &config)
+{
+ TMS9914(config, m_tms9914, 4_MHz_XTAL); // TODO: verify clock
+ m_tms9914->int_write_cb().set(FUNC(cms_ieee_device::bus_irq_w));
+ m_tms9914->dio_read_cb().set(IEEE488_TAG, FUNC(ieee488_device::dio_r));
+ m_tms9914->dio_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_dio_w));
+ m_tms9914->eoi_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_eoi_w));
+ m_tms9914->dav_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_dav_w));
+ m_tms9914->nrfd_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_nrfd_w));
+ m_tms9914->ndac_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_ndac_w));
+ m_tms9914->ifc_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_ifc_w));
+ m_tms9914->srq_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_srq_w));
+ m_tms9914->atn_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_atn_w));
+ m_tms9914->ren_write_cb().set(IEEE488_TAG, FUNC(ieee488_device::host_ren_w));
+
+ IEEE488(config, m_ieee);
+ m_ieee->eoi_callback().set(m_tms9914, FUNC(tms9914_device::eoi_w));
+ m_ieee->dav_callback().set(m_tms9914, FUNC(tms9914_device::dav_w));
+ m_ieee->nrfd_callback().set(m_tms9914, FUNC(tms9914_device::nrfd_w));
+ m_ieee->ndac_callback().set(m_tms9914, FUNC(tms9914_device::ndac_w));
+ m_ieee->ifc_callback().set(m_tms9914, FUNC(tms9914_device::ifc_w));
+ m_ieee->srq_callback().set(m_tms9914, FUNC(tms9914_device::srq_w));
+ m_ieee->atn_callback().set(m_tms9914, FUNC(tms9914_device::atn_w));
+ m_ieee->ren_callback().set(m_tms9914, FUNC(tms9914_device::ren_w));
+ IEEE488_SLOT(config, "ieee_dev", 0, cbm_ieee488_devices, nullptr);
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// cms_ieee_device - constructor
+//-------------------------------------------------
+
+cms_ieee_device::cms_ieee_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, CMS_IEEE, tag, owner, clock)
+ , device_acorn_bus_interface(mconfig, *this)
+ , m_ieee(*this, IEEE488_TAG)
+ , m_tms9914(*this, "hpib")
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void cms_ieee_device::device_start()
+{
+ address_space &space = m_bus->memspace();
+
+ space.install_readwrite_handler(0xfc60, 0xfc6f, read8sm_delegate(*m_tms9914, FUNC(tms9914_device::read)), write8sm_delegate(*m_tms9914, FUNC(tms9914_device::write)));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+WRITE_LINE_MEMBER(cms_ieee_device::bus_irq_w)
+{
+ m_bus->irq_w(state);
+}
diff --git a/src/devices/bus/acorn/cms/ieee.h b/src/devices/bus/acorn/cms/ieee.h
new file mode 100644
index 00000000000..48352d4a100
--- /dev/null
+++ b/src/devices/bus/acorn/cms/ieee.h
@@ -0,0 +1,48 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ CMS IEEE Controller Board
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_ACORN_CMS_IEEE_H
+#define MAME_BUS_ACORN_CMS_IEEE_H
+
+#include "bus/acorn/bus.h"
+#include "bus/ieee488/ieee488.h"
+#include "machine/tms9914.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class cms_ieee_device:
+ public device_t,
+ public device_acorn_bus_interface
+{
+public:
+ // construction/destruction
+ cms_ieee_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+
+private:
+ DECLARE_WRITE_LINE_MEMBER(bus_irq_w);
+
+ required_device<ieee488_device> m_ieee;
+ required_device<tms9914_device> m_tms9914;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(CMS_IEEE, cms_ieee_device);
+
+
+#endif /* MAME_BUS_ACORN_CMS_IEEE_H */