summaryrefslogtreecommitdiffstats
path: root/src/devices/bus/x68k
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/x68k')
-rw-r--r--src/devices/bus/x68k/x68k_midi.cpp18
-rw-r--r--src/devices/bus/x68k/x68k_neptunex.cpp17
-rw-r--r--src/devices/bus/x68k/x68k_scsiext.cpp20
-rw-r--r--src/devices/bus/x68k/x68kexp.cpp1
-rw-r--r--src/devices/bus/x68k/x68kexp.h40
5 files changed, 50 insertions, 46 deletions
diff --git a/src/devices/bus/x68k/x68k_midi.cpp b/src/devices/bus/x68k/x68k_midi.cpp
index abcc0b34955..b4f27554b70 100644
--- a/src/devices/bus/x68k/x68k_midi.cpp
+++ b/src/devices/bus/x68k/x68k_midi.cpp
@@ -1,7 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Barry Rodewald
/*
- * x68k_midi.cpp
+ * x68k_midi.c
*
* X68000 MIDI interface - YM3802
*
@@ -17,16 +17,16 @@
DEFINE_DEVICE_TYPE(X68K_MIDI, x68k_midi_device, "x68k_midi", "X68000 MIDI Interface")
-void x68k_midi_device::device_add_mconfig(machine_config &config)
-{
+MACHINE_CONFIG_START(x68k_midi_device::device_add_mconfig)
YM3802(config, m_midi, XTAL(1'000'000)); // clock is unknown
m_midi->txd_handler().set("mdout", FUNC(midi_port_device::write_txd));
m_midi->irq_handler().set(FUNC(x68k_midi_device::irq_w));
- MIDI_PORT(config, "mdin", midiin_slot, "midiin");
- MIDI_PORT(config, "mdout", midiout_slot, "midiout");
-// MIDI_PORT(config, "mdthru", midiout_slot, "midiout");
+ MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin")
+ MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout")
+// MCFG_MIDI_PORT_ADD("mdthru", midiout_slot, "midiout")
// TODO: Add serial data handlers
-}
+
+MACHINE_CONFIG_END
x68k_midi_device::x68k_midi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
@@ -39,8 +39,10 @@ x68k_midi_device::x68k_midi_device(const machine_config &mconfig, const char *ta
void x68k_midi_device::device_start()
{
+ device_t* cpu = machine().device("maincpu");
+ address_space& space = cpu->memory().space(AS_PROGRAM);
m_slot = dynamic_cast<x68k_expansion_slot_device *>(owner());
- m_slot->space().install_readwrite_handler(0xeafa00,0xeafa0f,read8_delegate(FUNC(x68k_midi_device::x68k_midi_reg_r),this),write8_delegate(FUNC(x68k_midi_device::x68k_midi_reg_w),this),0x00ff00ff);
+ space.install_readwrite_handler(0xeafa00,0xeafa0f,read8_delegate(FUNC(x68k_midi_device::x68k_midi_reg_r),this),write8_delegate(FUNC(x68k_midi_device::x68k_midi_reg_w),this),0x00ff00ff);
}
void x68k_midi_device::device_reset()
diff --git a/src/devices/bus/x68k/x68k_neptunex.cpp b/src/devices/bus/x68k/x68k_neptunex.cpp
index 7a7b7c3aaab..4c77c32061c 100644
--- a/src/devices/bus/x68k/x68k_neptunex.cpp
+++ b/src/devices/bus/x68k/x68k_neptunex.cpp
@@ -17,13 +17,12 @@
DEFINE_DEVICE_TYPE(X68K_NEPTUNEX, x68k_neptune_device, "x68k_neptunex", "Neptune-X")
// device machine config
-void x68k_neptune_device::device_add_mconfig(machine_config &config)
-{
- DP8390D(config, m_dp8390, 0);
- m_dp8390->irq_callback().set(FUNC(x68k_neptune_device::x68k_neptune_irq_w));
- m_dp8390->mem_read_callback().set(FUNC(x68k_neptune_device::x68k_neptune_mem_read));
- m_dp8390->mem_write_callback().set(FUNC(x68k_neptune_device::x68k_neptune_mem_write));
-}
+MACHINE_CONFIG_START(x68k_neptune_device::device_add_mconfig)
+ MCFG_DEVICE_ADD("dp8390d", DP8390D, 0)
+ MCFG_DP8390D_IRQ_CB(WRITELINE(*this, x68k_neptune_device, x68k_neptune_irq_w))
+ MCFG_DP8390D_MEM_READ_CB(READ8(*this, x68k_neptune_device, x68k_neptune_mem_read))
+ MCFG_DP8390D_MEM_WRITE_CB(WRITE8(*this, x68k_neptune_device, x68k_neptune_mem_write))
+MACHINE_CONFIG_END
x68k_neptune_device::x68k_neptune_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, X68K_NEPTUNEX, tag, owner, clock)
@@ -39,15 +38,17 @@ x68k_neptune_device::x68k_neptune_device(const machine_config &mconfig, const ch
void x68k_neptune_device::device_start()
{
+ device_t* cpu = machine().device("maincpu");
char mac[7];
uint32_t num = machine().rand();
+ address_space& space = cpu->memory().space(AS_PROGRAM);
m_slot = dynamic_cast<x68k_expansion_slot_device *>(owner());
memset(m_prom, 0x57, 16);
sprintf(mac+2, "\x1b%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff);
mac[0] = 0; mac[1] = 0; // avoid gcc warning
memcpy(m_prom, mac, 6);
m_dp8390->set_mac(mac);
- m_slot->space().install_readwrite_handler(0xece000,0xece3ff,read16_delegate(FUNC(x68k_neptune_device::x68k_neptune_port_r),this),write16_delegate(FUNC(x68k_neptune_device::x68k_neptune_port_w),this),0xffffffff);
+ space.install_readwrite_handler(0xece000,0xece3ff,read16_delegate(FUNC(x68k_neptune_device::x68k_neptune_port_r),this),write16_delegate(FUNC(x68k_neptune_device::x68k_neptune_port_w),this),0xffffffff);
}
void x68k_neptune_device::device_reset() {
diff --git a/src/devices/bus/x68k/x68k_scsiext.cpp b/src/devices/bus/x68k/x68k_scsiext.cpp
index 3cf18f9d2ee..557d70d3f36 100644
--- a/src/devices/bus/x68k/x68k_scsiext.cpp
+++ b/src/devices/bus/x68k/x68k_scsiext.cpp
@@ -37,8 +37,7 @@ const tiny_rom_entry *x68k_scsiext_device::device_rom_region() const
}
// device machine config
-void x68k_scsiext_device::device_add_mconfig(machine_config &config)
-{
+MACHINE_CONFIG_START(x68k_scsiext_device::device_add_mconfig)
SCSI_PORT(config, m_scsibus);
m_scsibus->set_slot_device(1, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_0));
m_scsibus->set_slot_device(2, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_1));
@@ -49,10 +48,10 @@ void x68k_scsiext_device::device_add_mconfig(machine_config &config)
m_scsibus->set_slot_device(7, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_6));
MB89352A(config, m_spc);
- m_spc->set_scsi_port(m_scsibus);
+ m_spc->set_scsi_port("scsi");
m_spc->irq_cb().set(FUNC(x68k_scsiext_device::irq_w));
m_spc->drq_cb().set(FUNC(x68k_scsiext_device::drq_w));
-}
+MACHINE_CONFIG_END
x68k_scsiext_device::x68k_scsiext_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, X68K_SCSIEXT, tag, owner, clock)
@@ -65,14 +64,15 @@ x68k_scsiext_device::x68k_scsiext_device(const machine_config &mconfig, const ch
void x68k_scsiext_device::device_start()
{
+ device_t* cpu = machine().device("maincpu");
+ uint8_t* ROM;
+ address_space& space = cpu->memory().space(AS_PROGRAM);
m_slot = dynamic_cast<x68k_expansion_slot_device *>(owner());
- m_slot->space().install_read_bank(0xea0020,0xea1fff,"scsi_ext");
- m_slot->space().unmap_write(0xea0020,0xea1fff);
-
- uint8_t *ROM = machine().root_device().memregion(subtag("scsiexrom").c_str())->base();
+ space.install_read_bank(0xea0020,0xea1fff,"scsi_ext");
+ space.unmap_write(0xea0020,0xea1fff);
+ ROM = machine().root_device().memregion(subtag("scsiexrom").c_str())->base();
machine().root_device().membank("scsi_ext")->set_base(ROM);
-
-m_slot->space().install_readwrite_handler(0xea0000,0xea001f,read8_delegate(FUNC(x68k_scsiext_device::register_r),this),write8_delegate(FUNC(x68k_scsiext_device::register_w),this),0x00ff00ff);
+ space.install_readwrite_handler(0xea0000,0xea001f,read8_delegate(FUNC(x68k_scsiext_device::register_r),this),write8_delegate(FUNC(x68k_scsiext_device::register_w),this),0x00ff00ff);
}
void x68k_scsiext_device::device_reset()
diff --git a/src/devices/bus/x68k/x68kexp.cpp b/src/devices/bus/x68k/x68kexp.cpp
index dc51559d632..9d9cded5bd8 100644
--- a/src/devices/bus/x68k/x68kexp.cpp
+++ b/src/devices/bus/x68k/x68kexp.cpp
@@ -36,7 +36,6 @@ device_x68k_expansion_card_interface::~device_x68k_expansion_card_interface()
x68k_expansion_slot_device::x68k_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, X68K_EXPANSION_SLOT, tag, owner, clock),
device_slot_interface(mconfig, *this),
- m_space(*this, finder_base::DUMMY_TAG, -1),
m_out_irq2_cb(*this),
m_out_irq4_cb(*this),
m_out_nmi_cb(*this),
diff --git a/src/devices/bus/x68k/x68kexp.h b/src/devices/bus/x68k/x68kexp.h
index 26b3ba06ad6..56f9feea8a5 100644
--- a/src/devices/bus/x68k/x68kexp.h
+++ b/src/devices/bus/x68k/x68kexp.h
@@ -73,6 +73,22 @@
#define X68K_EXP_SLOT_TAG "x68kexp"
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_X68K_EXPANSION_SLOT_OUT_IRQ2_CB(_devcb) \
+ downcast<x68k_expansion_slot_device &>(*device).set_out_irq2_callback(DEVCB_##_devcb);
+
+#define MCFG_X68K_EXPANSION_SLOT_OUT_IRQ4_CB(_devcb) \
+ downcast<x68k_expansion_slot_device &>(*device).set_out_irq4_callback(DEVCB_##_devcb);
+
+#define MCFG_X68K_EXPANSION_SLOT_OUT_NMI_CB(_devcb) \
+ downcast<x68k_expansion_slot_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb);
+
+#define MCFG_X68K_EXPANSION_SLOT_OUT_RESET_CB(_devcb) \
+ downcast<x68k_expansion_slot_device &>(*device).set_out_reset_callback(DEVCB_##_devcb);
+
//**************************************************************************
// TYPE DEFINITIONS
@@ -107,26 +123,14 @@ class x68k_expansion_slot_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
- template <typename T>
- x68k_expansion_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
- : x68k_expansion_slot_device(mconfig, tag, owner, 0)
- {
- option_reset();
- opts(*this);
- set_default_option(dflt);
- set_fixed(false);
- }
- x68k_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+ x68k_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~x68k_expansion_slot_device();
- template <typename T> void set_space(T &&tag, int spacenum) { m_space.set_tag(std::forward<T>(tag), spacenum); }
+ template <class Object> devcb_base &set_out_irq2_callback(Object &&cb) { return m_out_irq2_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_irq4_callback(Object &&cb) { return m_out_irq4_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_nmi_callback(Object &&cb) { return m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_reset_callback(Object &&cb) { return m_out_reset_cb.set_callback(std::forward<Object>(cb)); }
- auto out_irq2_callback() { return m_out_irq2_cb.bind(); }
- auto out_irq4_callback() { return m_out_irq4_cb.bind(); }
- auto out_nmi_callback() { return m_out_nmi_cb.bind(); }
- auto out_reset_callback() { return m_out_reset_cb.bind(); }
-
- address_space &space() { return *m_space; }
DECLARE_WRITE_LINE_MEMBER( irq2_w );
DECLARE_WRITE_LINE_MEMBER( irq4_w );
@@ -140,8 +144,6 @@ protected:
virtual void device_start() override;
virtual void device_reset() override;
- required_address_space m_space;
-
devcb_write_line m_out_irq2_cb;
devcb_write_line m_out_irq4_cb;
devcb_write_line m_out_nmi_cb;