diff options
author | 2019-03-26 11:13:37 +1100 | |
---|---|---|
committer | 2019-03-26 11:13:37 +1100 | |
commit | 97b67170277437131adf6ed4d60139c172529e4f (patch) | |
tree | 7a5cbf608f191075f1612b1af15832c206a3fe2d /src/devices/bus/cgenie | |
parent | b380514764cf857469bae61c11143a19f79a74c5 (diff) |
(nw) Clean up the mess on master
This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and
c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at
598cd5227223c3b04ca31f0dbc1981256d9ea3ff.
Before pushing, please check that what you're about to push is sane.
Check your local commit log and ensure there isn't anything out-of-place
before pushing to mainline. When things like this happen, it wastes
everyone's time. I really don't need this in a week when real work⢠is
busting my balls and I'm behind where I want to be with preparing for
MAME release.
Diffstat (limited to 'src/devices/bus/cgenie')
-rw-r--r-- | src/devices/bus/cgenie/expansion/expansion.cpp | 22 | ||||
-rw-r--r-- | src/devices/bus/cgenie/expansion/expansion.h | 45 | ||||
-rw-r--r-- | src/devices/bus/cgenie/expansion/floppy.cpp | 16 | ||||
-rw-r--r-- | src/devices/bus/cgenie/parallel/parallel.h | 23 | ||||
-rw-r--r-- | src/devices/bus/cgenie/parallel/printer.cpp | 19 |
5 files changed, 48 insertions, 77 deletions
diff --git a/src/devices/bus/cgenie/expansion/expansion.cpp b/src/devices/bus/cgenie/expansion/expansion.cpp index 366b1513aca..3a7665f7c2b 100644 --- a/src/devices/bus/cgenie/expansion/expansion.cpp +++ b/src/devices/bus/cgenie/expansion/expansion.cpp @@ -30,8 +30,8 @@ DEFINE_DEVICE_TYPE(CG_EXP_SLOT, cg_exp_slot_device, "cg_exp_slot", "Colour Genie cg_exp_slot_device::cg_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CG_EXP_SLOT, tag, owner, clock), device_slot_interface(mconfig, *this), - m_program(nullptr), - m_io(nullptr), + m_program(*this, finder_base::DUMMY_TAG, -1), + m_io(*this, finder_base::DUMMY_TAG, -1), m_cart(nullptr), m_int_handler(*this), m_nmi_handler(*this), @@ -67,24 +67,6 @@ void cg_exp_slot_device::device_reset() { } -//------------------------------------------------- -// set_program_space - set address space we are attached to -//------------------------------------------------- - -void cg_exp_slot_device::set_program_space(address_space *program) -{ - m_program = program; -} - -//------------------------------------------------- -// set_io_space - set address space we are attached to -//------------------------------------------------- - -void cg_exp_slot_device::set_io_space(address_space *io) -{ - m_io = io; -} - //************************************************************************** // CARTRIDGE INTERFACE diff --git a/src/devices/bus/cgenie/expansion/expansion.h b/src/devices/bus/cgenie/expansion/expansion.h index 2dd6f659f5e..3f61b275c19 100644 --- a/src/devices/bus/cgenie/expansion/expansion.h +++ b/src/devices/bus/cgenie/expansion/expansion.h @@ -39,24 +39,8 @@ #pragma once - - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_CG_EXP_SLOT_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, CG_EXP_SLOT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(cg_exp_slot_carts, nullptr, false) - -#define MCFG_CG_EXP_SLOT_INT_HANDLER(_devcb) \ - downcast<cg_exp_slot_device &>(*device).set_int_handler(DEVCB_##_devcb); - -#define MCFG_CG_EXP_SLOT_NMI_HANDLER(_devcb) \ - downcast<cg_exp_slot_device &>(*device).set_nmi_handler(DEVCB_##_devcb); - -#define MCFG_CG_EXP_SLOT_RESET_HANDLER(_devcb) \ - downcast<cg_exp_slot_device &>(*device).set_reset_handler(DEVCB_##_devcb); +// include here so drivers don't need to +#include "carts.h" //************************************************************************** @@ -69,24 +53,32 @@ class cg_exp_slot_device : public device_t, public device_slot_interface { public: // construction/destruction + cg_exp_slot_device(machine_config const &mconfig, char const *tag, device_t *owner) + : cg_exp_slot_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + cg_exp_slot_carts(*this); + set_default_option(nullptr); + set_fixed(false); + } cg_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~cg_exp_slot_device(); - void set_program_space(address_space *program); - void set_io_space(address_space *io); + template <typename T> void set_program_space(T &&tag, int spacenum) { m_program.set_tag(std::forward<T>(tag), spacenum); } + template <typename T> void set_io_space(T &&tag, int spacenum) { m_io.set_tag(std::forward<T>(tag), spacenum); } // callbacks - template <class Object> devcb_base &set_int_handler(Object &&cb) { return m_int_handler.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_nmi_handler(Object &&cb) { return m_nmi_handler.set_callback(std::forward<Object>(cb)); } - template <class Object> devcb_base &set_reset_handler(Object &&cb) { return m_reset_handler.set_callback(std::forward<Object>(cb)); } + auto int_handler() { return m_int_handler.bind(); } + auto nmi_handler() { return m_nmi_handler.bind(); } + auto reset_handler() { return m_reset_handler.bind(); } // called from cart device DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); } DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_handler(state); } DECLARE_WRITE_LINE_MEMBER( reset_w ) { m_reset_handler(state); } - address_space *m_program; - address_space *m_io; + required_address_space m_program; + required_address_space m_io; protected: // device-level overrides @@ -117,7 +109,4 @@ protected: // device type definition DECLARE_DEVICE_TYPE(CG_EXP_SLOT, cg_exp_slot_device) -// include here so drivers don't need to -#include "carts.h" - #endif // MAME_BUS_CGENIE_EXPANSION_EXPANSION_H diff --git a/src/devices/bus/cgenie/expansion/floppy.cpp b/src/devices/bus/cgenie/expansion/floppy.cpp index 021f00e9f8d..331fdfd207e 100644 --- a/src/devices/bus/cgenie/expansion/floppy.cpp +++ b/src/devices/bus/cgenie/expansion/floppy.cpp @@ -72,23 +72,23 @@ const tiny_rom_entry *cgenie_fdc_device::device_rom_region() const //------------------------------------------------- MACHINE_CONFIG_START(cgenie_fdc_device::device_add_mconfig) - MCFG_TIMER_DRIVER_ADD_PERIODIC("timer", cgenie_fdc_device, timer_callback, attotime::from_msec(25)) + TIMER(config, "timer").configure_periodic(FUNC(cgenie_fdc_device::timer_callback), attotime::from_msec(25)); FD1793(config, m_fdc, 1_MHz_XTAL); m_fdc->intrq_wr_callback().set(FUNC(cgenie_fdc_device::intrq_w)); - MCFG_FLOPPY_DRIVE_ADD("fd1793:0", cgenie_floppies, "ssdd", cgenie_fdc_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("fd1793:1", cgenie_floppies, "ssdd", cgenie_fdc_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("fd1793:2", cgenie_floppies, nullptr, cgenie_fdc_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("fd1793:3", cgenie_floppies, nullptr, cgenie_fdc_device::floppy_formats) + FLOPPY_CONNECTOR(config, "fd1793:0", cgenie_floppies, "ssdd", cgenie_fdc_device::floppy_formats); + FLOPPY_CONNECTOR(config, "fd1793:1", cgenie_floppies, "ssdd", cgenie_fdc_device::floppy_formats); + FLOPPY_CONNECTOR(config, "fd1793:2", cgenie_floppies, nullptr, cgenie_fdc_device::floppy_formats); + FLOPPY_CONNECTOR(config, "fd1793:3", cgenie_floppies, nullptr, cgenie_fdc_device::floppy_formats); -// MCFG_SOFTWARE_LIST_ADD("floppy_list", "cgenie_flop") +// SOFTWARE_LIST(config, "floppy_list").set_original("cgenie_flop"); MCFG_GENERIC_SOCKET_ADD("socket", generic_plain_slot, "cgenie_flop_rom") MCFG_GENERIC_EXTENSIONS("bin,rom") MCFG_GENERIC_LOAD(cgenie_fdc_device, socket_load) - MCFG_SOFTWARE_LIST_ADD("rom_list", "cgenie_flop_rom") + SOFTWARE_LIST(config, "rom_list").set_original("cgenie_flop_rom"); MACHINE_CONFIG_END @@ -137,7 +137,7 @@ void cgenie_fdc_device::device_reset() // map extra socket if (m_socket->exists()) { - m_slot->m_program->install_read_handler(0xe000, 0xefff, read8_delegate(FUNC(generic_slot_device::read_rom), (generic_slot_device *) m_socket)); + m_slot->m_program->install_read_handler(0xe000, 0xefff, read8sm_delegate(FUNC(generic_slot_device::read_rom), (generic_slot_device *) m_socket)); } } diff --git a/src/devices/bus/cgenie/parallel/parallel.h b/src/devices/bus/cgenie/parallel/parallel.h index 9bc8d5665c4..b31f8c749f4 100644 --- a/src/devices/bus/cgenie/parallel/parallel.h +++ b/src/devices/bus/cgenie/parallel/parallel.h @@ -24,16 +24,8 @@ #pragma once - - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_CG_PARALLEL_SLOT_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, CG_PARALLEL_SLOT, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(cg_parallel_slot_carts, nullptr, false) - +// include here so drivers don't need to +#include "carts.h" //************************************************************************** // TYPE DEFINITIONS @@ -45,6 +37,14 @@ class cg_parallel_slot_device : public device_t, public device_slot_interface { public: // construction/destruction + cg_parallel_slot_device(machine_config const &mconfig, char const *tag, device_t *owner) + : cg_parallel_slot_device(mconfig, tag, owner, (uint32_t)0) + { + option_reset(); + cg_parallel_slot_carts(*this); + set_default_option(nullptr); + set_fixed(false); + } cg_parallel_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~cg_parallel_slot_device(); @@ -86,7 +86,4 @@ protected: // device type definition DECLARE_DEVICE_TYPE(CG_PARALLEL_SLOT, cg_parallel_slot_device) -// include here so drivers don't need to -#include "carts.h" - #endif // MAME_BUS_CGENIE_PARALLEL_PARALLEL_H diff --git a/src/devices/bus/cgenie/parallel/printer.cpp b/src/devices/bus/cgenie/parallel/printer.cpp index bce52a61c97..9a3e9df5dc4 100644 --- a/src/devices/bus/cgenie/parallel/printer.cpp +++ b/src/devices/bus/cgenie/parallel/printer.cpp @@ -27,14 +27,17 @@ DEFINE_DEVICE_TYPE(CGENIE_PRINTER, cgenie_printer_device, "cgenie_printer", "Pri // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(cgenie_printer_device::device_add_mconfig) - MCFG_DEVICE_ADD(m_centronics, CENTRONICS, centronics_devices, "printer") - MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, cgenie_printer_device, busy_w)) - MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(*this, cgenie_printer_device, perror_w)) - MCFG_CENTRONICS_SELECT_HANDLER(WRITELINE(*this, cgenie_printer_device, select_w)) - MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(*this, cgenie_printer_device, fault_w)) - MCFG_CENTRONICS_OUTPUT_LATCH_ADD("latch", "centronics") -MACHINE_CONFIG_END +void cgenie_printer_device::device_add_mconfig(machine_config &config) +{ + CENTRONICS(config, m_centronics, centronics_devices, "printer"); + m_centronics->busy_handler().set(FUNC(cgenie_printer_device::busy_w)); + m_centronics->perror_handler().set(FUNC(cgenie_printer_device::perror_w)); + m_centronics->select_handler().set(FUNC(cgenie_printer_device::select_w)); + m_centronics->fault_handler().set(FUNC(cgenie_printer_device::fault_w)); + + OUTPUT_LATCH(config, m_latch); + m_centronics->set_output_latch(*m_latch); +} //************************************************************************** |