summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/mtx/exp.cpp
diff options
context:
space:
mode:
author Nigel Barnes <Pernod70@users.noreply.github.com>2019-03-10 17:23:39 +0000
committer Nigel Barnes <Pernod70@users.noreply.github.com>2019-03-10 17:23:39 +0000
commit5511ce41e2b5a23394c75b0e743c3bcafdb87b15 (patch)
tree5d2cb4dc1642094abb6816f9da86509fd07530d0 /src/devices/bus/mtx/exp.cpp
parentf9ae1fd4080bad4870247c4fc21fee3ba8b7af1f (diff)
mtx: Added expansion bus with SDX floppy controller.
- 80 column card with SDX in CP/M mode. - ROM/RAM banking fixed for CP/M, and MTX500 now correctly detected. - Support for Type 03 and Type 07 .mfloppy images. - Added alternate MTX2 romset (German). - Keyboard ROM now selected in Configuration. - Quickload .RUN files.
Diffstat (limited to 'src/devices/bus/mtx/exp.cpp')
-rw-r--r--src/devices/bus/mtx/exp.cpp126
1 files changed, 126 insertions, 0 deletions
diff --git a/src/devices/bus/mtx/exp.cpp b/src/devices/bus/mtx/exp.cpp
new file mode 100644
index 00000000000..d08827f8caa
--- /dev/null
+++ b/src/devices/bus/mtx/exp.cpp
@@ -0,0 +1,126 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ MTX expansion emulation
+
+**********************************************************************/
+
+#include "emu.h"
+#include "exp.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(MTX_EXP_SLOT, mtx_exp_slot_device, "mtx_exp_slot", "MTX expansion slot")
+
+
+//**************************************************************************
+// DEVICE MTX_BUS PORT INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// device_mtx_exp_interface - constructor
+//-------------------------------------------------
+
+device_mtx_exp_interface::device_mtx_exp_interface(const machine_config &mconfig, device_t &device)
+ : device_slot_card_interface(mconfig, device)
+{
+ m_slot = dynamic_cast<mtx_exp_slot_device *>(device.owner());
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// mtx_exp_slot_device - constructor
+//-------------------------------------------------
+
+mtx_exp_slot_device::mtx_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, MTX_EXP_SLOT, tag, owner, clock)
+ , device_slot_interface(mconfig, *this)
+ , m_io(nullptr)
+ , m_card(nullptr)
+ , m_busreq_handler(*this)
+ , m_int_handler(*this)
+ , m_nmi_handler(*this)
+{
+}
+
+
+//-------------------------------------------------
+// device_validity_check -
+//-------------------------------------------------
+
+void mtx_exp_slot_device::device_validity_check(validity_checker &valid) const
+{
+ device_t *const carddev = get_card_device();
+ if (carddev && !dynamic_cast<device_mtx_exp_interface *>(carddev))
+ osd_printf_error("Card device %s (%s) does not implement device_mtx_exp_interface\n", carddev->tag(), carddev->name());
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void mtx_exp_slot_device::device_start()
+{
+ device_t *const carddev = get_card_device();
+ if (carddev && !dynamic_cast<device_mtx_exp_interface *>(carddev))
+ osd_printf_error("Card device %s (%s) does not implement device_mtx_exp_interface\n", carddev->tag(), carddev->name());
+
+ // resolve callbacks
+ m_busreq_handler.resolve_safe();
+ m_int_handler.resolve_safe();
+ m_nmi_handler.resolve_safe();
+}
+
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void mtx_exp_slot_device::device_reset()
+{
+}
+
+
+//-------------------------------------------------
+// set_program_space - set address space we are attached to
+//-------------------------------------------------
+
+void mtx_exp_slot_device::set_program_space(address_space *program)
+{
+ m_program = program;
+}
+
+//-------------------------------------------------
+// set_io_space - set address space we are attached to
+//-------------------------------------------------
+
+void mtx_exp_slot_device::set_io_space(address_space *io)
+{
+ m_io = io;
+}
+
+//-------------------------------------------------
+// SLOT_INTERFACE( mtx_exp_devices )
+//-------------------------------------------------
+
+
+// slot devices
+//#include "fdx.h"
+#include "sdx.h"
+
+
+void mtx_expansion_devices(device_slot_interface &device)
+{
+ //device.option_add("fdx", MTX_FDX); /* FDX Floppy Disc System */
+ device.option_add("sdxbas", MTX_SDXBAS); /* SDX Floppy Disc System (SDX ROM)*/
+ device.option_add("sdxcpm", MTX_SDXCPM); /* SDX Floppy Disc System (CP/M ROM and 80 column card) */
+}