From c0f366c61374775f8f8b7661e84705b568134dea Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 7 Apr 2016 18:59:38 -0400 Subject: Devfind revision phase 1, cleaning out some legacy stuff - Eliminate the cached device_t::m_region pointer and its region() getter method. Devices that need to bind to a region with the same tag should use optional/required_memory_region or optional/required_region_ptr with DEVICE_SELF as the subtag; this improves error checking. (DEVICE_SELF has been moved to device.h for greater visibility in the source.) - Allow required/optional_region_ptr to specify a specific length which must match that of the region found. - Implement finder_base::finder_tag() getter for diagnostic purposes. - Perform some (not very efficient) validity checks on memory region finders instead of allowing them to automatically pass. - Privatize device_memory_interface::m_addrspace. --- src/devices/sound/tms5110.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/devices/sound/tms5110.h') diff --git a/src/devices/sound/tms5110.h b/src/devices/sound/tms5110.h index 8eb5306eaf9..8cba11e64f3 100644 --- a/src/devices/sound/tms5110.h +++ b/src/devices/sound/tms5110.h @@ -298,7 +298,7 @@ class tmsprom_device : public device_t public: tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - static void set_region(device_t &device, const char *region) { downcast(device).m_prom_region = region; } + static void set_region(device_t &device, const char *region) { downcast(device).m_prom.set_tag(region); } static void set_rom_size(device_t &device, UINT32 rom_size) { downcast(device).m_rom_size = rom_size; } static void set_pdc_bit(device_t &device, UINT8 pdc_bit) { downcast(device).m_pdc_bit = pdc_bit; } static void set_ctl1_bit(device_t &device, UINT8 ctl1_bit) { downcast(device).m_ctl1_bit = ctl1_bit; } @@ -339,7 +339,8 @@ private: int m_prom_cnt; - const char *m_prom_region; /* prom memory region - sound region is automatically assigned */ + required_region_ptr m_rom; + required_region_ptr m_prom; UINT32 m_rom_size; /* individual rom_size */ UINT8 m_pdc_bit; /* bit # of pdc line */ /* virtual bit 8: constant 0, virtual bit 9:constant 1 */ @@ -353,14 +354,12 @@ private: devcb_write8 m_ctl_cb; /* tms ctl func */ emu_timer *m_romclk_timer; - const UINT8 *m_rom; - const UINT8 *m_prom; }; extern const device_type TMSPROM; #define MCFG_TMSPROM_REGION(_region) \ - tmsprom_device::set_region(*device, _region); + tmsprom_device::set_region(*device, "^" _region); #define MCFG_TMSPROM_ROM_SIZE(_size) \ tmsprom_device::set_rom_size(*device, _size); -- cgit v1.2.3