summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/mtx/exp.h
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.h
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.h')
-rw-r--r--src/devices/bus/mtx/exp.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/src/devices/bus/mtx/exp.h b/src/devices/bus/mtx/exp.h
new file mode 100644
index 00000000000..21cb4e80c9d
--- /dev/null
+++ b/src/devices/bus/mtx/exp.h
@@ -0,0 +1,92 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ MTX expansion emulation
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_MTX_EXP_H
+#define MAME_BUS_MTX_EXP_H
+
+#pragma once
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> mtx_exp_slot_device
+
+class device_mtx_exp_interface;
+
+class mtx_exp_slot_device : public device_t, public device_slot_interface
+{
+public:
+ // construction/destruction
+ template <typename T>
+ mtx_exp_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&slot_options, const char *default_option)
+ : mtx_exp_slot_device(mconfig, tag, owner)
+ {
+ option_reset();
+ slot_options(*this);
+ set_default_option(default_option);
+ set_fixed(false);
+ }
+
+ mtx_exp_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock = 0);
+
+ void set_program_space(address_space *program);
+ void set_io_space(address_space *io);
+
+ // callbacks
+ auto busreq_handler() { return m_busreq_handler.bind(); }
+ auto int_handler() { return m_int_handler.bind(); }
+ auto nmi_handler() { return m_nmi_handler.bind(); }
+
+ DECLARE_WRITE_LINE_MEMBER( busreq_w ) { m_busreq_handler(state); }
+ DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); }
+ DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_handler(state); }
+
+ address_space *m_program;
+ address_space *m_io;
+
+protected:
+ // device-level overrides
+ virtual void device_validity_check(validity_checker &valid) const override;
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ device_mtx_exp_interface *m_card;
+
+private:
+ devcb_write_line m_busreq_handler;
+ devcb_write_line m_int_handler;
+ devcb_write_line m_nmi_handler;
+};
+
+
+// ======================> device_mtx_exp_interface
+
+class device_mtx_exp_interface : public device_slot_card_interface
+{
+public:
+ // construction/destruction
+ device_mtx_exp_interface(const machine_config &mconfig, device_t &device);
+
+protected:
+ address_space &program_space() { return *m_slot->m_program; }
+ address_space &io_space() { return *m_slot->m_io; }
+
+ mtx_exp_slot_device *m_slot;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(MTX_EXP_SLOT, mtx_exp_slot_device)
+
+void mtx_expansion_devices(device_slot_interface &device);
+
+
+#endif // MAME_BUS_MTX_EXP_H