diff options
author | 2023-02-04 18:40:59 +1100 | |
---|---|---|
committer | 2023-02-04 18:40:59 +1100 | |
commit | 0b67aa20c703ae7602ade2c0c12790d2eafe167c (patch) | |
tree | fb88bbfd9ca82e8011e7ff2e53c860a91f788045 /src | |
parent | 74b6c17f18dc4b95cbe5db29872da3561ed840c5 (diff) |
Miscellaneous fixup:
* video/i82730.cpp: Fixed misguided "fix" that broke category-based
logging.
* bus/macpds, bus/nubus: Eliminated use of simple_list.
* konami/k053246_k053247_k055673.cpp: Moved assert to work around
Konami GX games failing to start - the code is still dodgy.
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/bus/macpds/macpds.cpp | 19 | ||||
-rw-r--r-- | src/devices/bus/macpds/macpds.h | 16 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus.cpp | 19 | ||||
-rw-r--r-- | src/devices/bus/nubus/nubus.h | 14 | ||||
-rw-r--r-- | src/devices/video/i82730.cpp | 43 | ||||
-rw-r--r-- | src/mame/konami/k053246_k053247_k055673.cpp | 12 |
6 files changed, 65 insertions, 58 deletions
diff --git a/src/devices/bus/macpds/macpds.cpp b/src/devices/bus/macpds/macpds.cpp index 036cb51bf1f..4fa3eae6d6e 100644 --- a/src/devices/bus/macpds/macpds.cpp +++ b/src/devices/bus/macpds/macpds.cpp @@ -72,6 +72,12 @@ macpds_device::macpds_device(const machine_config &mconfig, device_type type, co m_maincpu(*this, finder_base::DUMMY_TAG) { } + +macpds_device::~macpds_device() +{ +} + + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -88,9 +94,9 @@ void macpds_device::device_reset() { } -void macpds_device::add_macpds_card(device_macpds_card_interface *card) +void macpds_device::add_macpds_card(device_macpds_card_interface &card) { - m_device_list.append(*card); + m_device_list.emplace_back(card); } template<typename R, typename W> void macpds_device::install_device(offs_t start, offs_t end, R rhandler, W whandler, uint32_t mask) @@ -132,9 +138,10 @@ void macpds_device::set_irq_line(int line, int state) // device_macpds_card_interface - constructor //------------------------------------------------- -device_macpds_card_interface::device_macpds_card_interface(const machine_config &mconfig, device_t &device) - : device_interface(device, "macpds"), - m_macpds(nullptr), m_macpds_slot(nullptr), m_next(nullptr) +device_macpds_card_interface::device_macpds_card_interface(const machine_config &mconfig, device_t &device) : + device_interface(device, "macpds"), + m_macpds(nullptr), + m_macpds_slot(nullptr) { } @@ -149,7 +156,7 @@ device_macpds_card_interface::~device_macpds_card_interface() void device_macpds_card_interface::set_macpds_device() { - m_macpds->add_macpds_card(this); + m_macpds->add_macpds_card(*this); } void device_macpds_card_interface::install_bank(offs_t start, offs_t end, uint8_t *data) diff --git a/src/devices/bus/macpds/macpds.h b/src/devices/bus/macpds/macpds.h index ad0ce6a2416..aeb860af7e7 100644 --- a/src/devices/bus/macpds/macpds.h +++ b/src/devices/bus/macpds/macpds.h @@ -13,6 +13,10 @@ #pragma once +#include <functional> +#include <utility> +#include <vector> + //************************************************************************** // TYPE DEFINITIONS @@ -68,14 +72,14 @@ public: } macpds_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ~macpds_device(); - ~macpds_device() { m_device_list.detach_all(); } // inline configuration template <typename T> void set_cputag(T &&tag) { m_maincpu.set_tag(std::forward<T>(tag)); } - void add_macpds_card(device_macpds_card_interface *card); + void add_macpds_card(device_macpds_card_interface &card); template<typename R, typename W> void install_device(offs_t start, offs_t end, R rhandler, W whandler, uint32_t mask=0xffffffff); void install_bank(offs_t start, offs_t end, uint8_t *data); void set_irq_line(int line, int state); @@ -90,7 +94,7 @@ protected: // internal state required_device<cpu_device> m_maincpu; - simple_list<device_macpds_card_interface> m_device_list; + std::vector<std::reference_wrapper<device_macpds_card_interface> > m_device_list; }; @@ -103,13 +107,10 @@ DECLARE_DEVICE_TYPE(MACPDS, macpds_device) class device_macpds_card_interface : public device_interface { friend class macpds_device; - template <class ElememtType> friend class simple_list; public: // construction/destruction virtual ~device_macpds_card_interface(); - device_macpds_card_interface *next() const { return m_next; } - void set_macpds_device(); // helper functions for card devices @@ -124,9 +125,6 @@ protected: macpds_device *m_macpds; macpds_slot_device *m_macpds_slot; - -private: - device_macpds_card_interface *m_next; }; #endif // MAME_BUS_MACPDS_MACPDS_H diff --git a/src/devices/bus/nubus/nubus.cpp b/src/devices/bus/nubus/nubus.cpp index 8ac4ea719b9..82e9b00f3c2 100644 --- a/src/devices/bus/nubus/nubus.cpp +++ b/src/devices/bus/nubus/nubus.cpp @@ -53,7 +53,7 @@ void nubus_slot_device::device_resolve_objects() if (dev) { dev->set_nubus_tag(m_nubus.target(), m_nubus_slottag); - m_nubus->add_nubus_card(dev); + m_nubus->add_nubus_card(*dev); } } @@ -96,6 +96,10 @@ nubus_device::nubus_device(const machine_config &mconfig, device_type type, cons { } +nubus_device::~nubus_device() +{ +} + //------------------------------------------------- // device_resolve_objects - resolve objects that // may be needed for other devices to set @@ -121,9 +125,9 @@ void nubus_device::device_start() { } -void nubus_device::add_nubus_card(device_nubus_card_interface *card) +void nubus_device::add_nubus_card(device_nubus_card_interface &card) { - m_device_list.append(*card); + m_device_list.emplace_back(card); } template <typename R, typename W> @@ -262,10 +266,11 @@ WRITE_LINE_MEMBER( nubus_device::irqe_w ) { m_out_irqe_cb(state); } // device_nubus_card_interface - constructor //------------------------------------------------- -device_nubus_card_interface::device_nubus_card_interface(const machine_config &mconfig, device_t &device) - : device_interface(device, "nubus"), - m_nubus(nullptr), - m_nubus_slottag(nullptr), m_slot(0), m_next(nullptr) +device_nubus_card_interface::device_nubus_card_interface(const machine_config &mconfig, device_t &device) : + device_interface(device, "nubus"), + m_nubus(nullptr), + m_nubus_slottag(nullptr), + m_slot(0) { } diff --git a/src/devices/bus/nubus/nubus.h b/src/devices/bus/nubus/nubus.h index c99f25b33d6..99521ec619e 100644 --- a/src/devices/bus/nubus/nubus.h +++ b/src/devices/bus/nubus/nubus.h @@ -13,6 +13,10 @@ #pragma once +#include <functional> +#include <utility> +#include <vector> + //************************************************************************** // TYPE DEFINITIONS @@ -26,13 +30,10 @@ class nubus_device; class device_nubus_card_interface : public device_interface { friend class nubus_device; - template <class ElementType> friend class simple_list; public: // construction/destruction virtual ~device_nubus_card_interface(); - device_nubus_card_interface *next() const { return m_next; } - void set_nubus_device(); // helper functions for card devices @@ -61,7 +62,6 @@ private: const char *m_nubus_slottag; int m_slot; std::vector<uint8_t> m_declaration_rom; - device_nubus_card_interface *m_next; }; class nubus_slot_device : public device_t, public device_single_card_slot_interface<device_nubus_card_interface> @@ -111,7 +111,7 @@ class nubus_device : public device_t public: // construction/destruction nubus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - ~nubus_device() { m_device_list.detach_all(); } + ~nubus_device(); // inline configuration template <typename T> void set_space(T &&tag, int spacenum) { m_space.set_tag(std::forward<T>(tag), spacenum); } @@ -122,7 +122,7 @@ public: auto out_irqd_callback() { return m_out_irqd_cb.bind(); } auto out_irqe_callback() { return m_out_irqe_cb.bind(); } - void add_nubus_card(device_nubus_card_interface *card); + void add_nubus_card(device_nubus_card_interface &card); template <typename R, typename W> void install_device(offs_t start, offs_t end, R rhandler, W whandler, uint32_t mask=0xffffffff); template <typename R> void install_readonly_device(offs_t start, offs_t end, R rhandler, uint32_t mask=0xffffffff); template <typename W> void install_writeonly_device(offs_t start, offs_t end, W whandler, uint32_t mask=0xffffffff); @@ -154,7 +154,7 @@ protected: devcb_write_line m_out_irqd_cb; devcb_write_line m_out_irqe_cb; - simple_list<device_nubus_card_interface> m_device_list; + std::vector<std::reference_wrapper<device_nubus_card_interface> > m_device_list; }; inline void device_nubus_card_interface::raise_slot_irq() diff --git a/src/devices/video/i82730.cpp b/src/devices/video/i82730.cpp index 298ab31e64d..342d8830178 100644 --- a/src/devices/video/i82730.cpp +++ b/src/devices/video/i82730.cpp @@ -13,11 +13,10 @@ #include "screen.h" -#define LOG_GENERAL (1U << 0) #define LOG_COMMANDS (1U << 1) #define LOG_DATASTREAM (1U << 2) //#define VERBOSE (LOG_GENERAL | LOG_COMMANDS | LOG_DATASTREAM) -#define VERBOSE (0 != (LOG_GENERAL)) +#define VERBOSE (LOG_GENERAL) #include "logmacro.h" @@ -269,16 +268,17 @@ void i82730_device::mode_set() m_mode_set = true; // output some debug info - if (VERBOSE) - { - logerror("%s('%s'): ---- modeset ----\n", shortname(), basetag()); - logerror("%s('%s'): dma burst length %02x, space %02x\n", shortname(), basetag(), m_mb.burst_length, m_mb.burst_space); - logerror("%s('%s'): margin %02x, lpr %02x\n", shortname(), basetag(), m_mb.scroll_margin, m_mb.lpr); - logerror("%s('%s'): hsyncstp: %02x, line_length: %02x, hfldstrt: %02x, hbrdstart: %02x, hfldstop: %02x, hbrdstop: %02x\n", - shortname(), basetag(), m_mb.hsyncstp, m_mb.line_length, m_mb.hfldstrt, m_mb.hbrdstrt, m_mb.hfldstp, m_mb.hbrdstp); - logerror("%s('%s'): frame_length %04x, vsyncstp: %04x, vfldstrt: %04x, vfldstp: %04x\n", - shortname(), basetag(), m_mb.frame_length, m_mb.vsyncstp, m_mb.vfldstrt, m_mb.vfldstp); - } + LOG( + "%s: ---- modeset ----\n" + " dma burst length %02x, space %02x\n" + " margin %02x, lpr %02x\n" + " hsyncstp: %02x, line_length: %02x, hfldstrt: %02x, hbrdstart: %02x, hfldstop: %02x, hbrdstop: %02x\n" + " frame_length %04x, vsyncstp: %04x, vfldstrt: %04x, vfldstp: %04x\n", + shortname(), + m_mb.burst_length, m_mb.burst_space, + m_mb.scroll_margin, m_mb.lpr, + m_mb.hsyncstp, m_mb.line_length, m_mb.hfldstrt, m_mb.hbrdstrt, m_mb.hfldstp, m_mb.hbrdstp, + m_mb.frame_length, m_mb.vsyncstp, m_mb.vfldstrt, m_mb.vfldstp); } void i82730_device::execute_command() @@ -814,15 +814,16 @@ WRITE_LINE_MEMBER( i82730_device::ca_w ) m_initialized = true; // output some debug info - if (VERBOSE) - { - logerror("%s('%s'): ---- initializing ----\n", shortname(), basetag()); - logerror("%s('%s'): %s system bus\n", shortname(), basetag(), sysbus_16bit() ? "16-bit" : "8-bit"); - logerror("%s('%s'): intermediate block pointer: %08x\n", shortname(), basetag(), m_ibp); - logerror("%s('%s'): addrbus: %s, clno: %d, clpos: %d, mode: %s, dtw16: %s, srdy: %s\n", shortname(), basetag(), - BIT(scb, 0) ? "32-bit" : "16-bit", (scb >> 1) & 0x03, (scb >> 3) & 0x03, - BIT(scb, 5) ? "master" : "slave", BIT(scb, 6) ? "16-bit" : "8-bit", BIT(scb, 7) ? "synchronous" : "asynchronous"); - } + LOG( + "%s: ---- initializing ----\n" + " %s-bit system bus\n" + " intermediate block pointer: %08x\n" + " addrbus: %s-bit, clno: %d, clpos: %d, mode: %s, dtw16: %s-bit, srdy: %s\n", + shortname(), + sysbus_16bit() ? "16" : "8", + m_ibp, + BIT(scb, 0) ? "32" : "16", BIT(scb, 1, 2), BIT(scb, 3, 2), + BIT(scb, 5) ? "master" : "slave", BIT(scb, 6) ? "16" : "8", BIT(scb, 7) ? "synchronous" : "asynchronous"); } attention(); diff --git a/src/mame/konami/k053246_k053247_k055673.cpp b/src/mame/konami/k053246_k053247_k055673.cpp index a6f0d92748e..d5151b77823 100644 --- a/src/mame/konami/k053246_k053247_k055673.cpp +++ b/src/mame/konami/k053246_k053247_k055673.cpp @@ -201,10 +201,12 @@ u8 k053247_device::k053246_r(offs_t offset) { if (m_objcha_line == ASSERT_LINE) { - int addr; + int addr = (m_kx46_regs[6] << 17) | (m_kx46_regs[7] << 9) | (m_kx46_regs[4] << 1) | ((offset & 1) ^ 1); - addr = (m_kx46_regs[6] << 17) | (m_kx46_regs[7] << 9) | (m_kx46_regs[4] << 1) | ((offset & 1) ^ 1); + // assumes it can make an address mask with m_gfxrom.length() - 1 + assert(!(m_gfxrom.length() & (m_gfxrom.length() - 1))); addr &= m_gfxrom.length() - 1; + return m_gfxrom[addr]; } else @@ -899,9 +901,6 @@ k055673_device::k055673_device(const machine_config &mconfig, const char *tag, d void k055673_device::device_start() { - // assumes it can make an address mask with m_gfxrom.length() - 1 - assert(!(m_gfxrom.length() & (m_gfxrom.length() - 1))); - if (!palette().device().started()) throw device_missing_dependencies(); @@ -1068,9 +1067,6 @@ k053247_device::k053247_device(const machine_config &mconfig, device_type type, void k053247_device::device_start() { - // assumes it can make an address mask with m_gfxrom.length() - 1 - assert(!(m_gfxrom.length() & (m_gfxrom.length() - 1))); - if (!palette().device().started()) throw device_missing_dependencies(); |