summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/vrender0.cpp
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2020-05-25 16:42:42 +0200
committer Olivier Galibert <galibert@pobox.com>2020-05-25 16:42:57 +0200
commit22513fb6fe281f5ccb75aaddb6417a12a66c313d (patch)
tree3cf84032cc6482d685a8dbb57e015bd17c7f7fdc /src/devices/sound/vrender0.cpp
parente42c2d2874cf9c1092c01ab5ce9ef997d465ce25 (diff)
emumem: A little more speedup. cache and specific change syntax, and are not pointers anymore [O. Galibert]
The last(?) two changes are: - Add a template parameter to everything (theoretically the address space width, in practice a level derived from it to keep as much compatibility between widths as possible) so that the shift size becomes a constant. - Change the syntax of declaring and initializing the caches and specifics so that they're embedded in the owner device. Solves lifetime issues and also removes one indirection (looking up the base dispatch pointer through the cache/specific pointer).
Diffstat (limited to 'src/devices/sound/vrender0.cpp')
-rw-r--r--src/devices/sound/vrender0.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/devices/sound/vrender0.cpp b/src/devices/sound/vrender0.cpp
index 833acdc46bb..370bc2f44e0 100644
--- a/src/devices/sound/vrender0.cpp
+++ b/src/devices/sound/vrender0.cpp
@@ -142,11 +142,11 @@ void vr0sound_device::device_start()
m_irq_cb.resolve_safe();
// Find our direct access
- m_texcache = space(AS_TEXTURE).cache<1, 0, ENDIANNESS_LITTLE>();
- m_fbcache = space(AS_FRAME).cache<1, 0, ENDIANNESS_LITTLE>();
- m_texcache_ctrl = m_fbcache;
+ space(AS_TEXTURE).cache(m_texcache);
+ space(AS_FRAME).cache(m_fbcache);
+ m_texcache_ctrl = &m_fbcache;
for (auto &elem : m_channel)
- elem.Cache = m_fbcache;
+ elem.Cache = &m_fbcache;
m_stream = stream_alloc(0, 2, clock() / 972); // TODO : Correct source / divider?
@@ -229,7 +229,7 @@ void vr0sound_device::channel_w(offs_t offset, u16 data, u16 mem_mask)
m_channel[(offset >> 4) & 0x1f].write(offset & 0xf, data, mem_mask);
if ((old_mode ^ channel->Modes) & MODE_TEXTURE)
{
- channel->Cache = (channel->Modes & MODE_TEXTURE) ? m_texcache_ctrl : m_fbcache;
+ channel->Cache = (channel->Modes & MODE_TEXTURE) ? m_texcache_ctrl : &m_fbcache;
}
}
@@ -356,7 +356,7 @@ void vr0sound_device::ctrl_w(offs_t offset, u16 data, u16 mem_mask)
const u16 old_ctrl = m_Ctrl;
COMBINE_DATA(&m_Ctrl);
if ((old_ctrl ^ m_Ctrl) & CTRL_TM)
- m_texcache_ctrl = (m_Ctrl & CTRL_TM) ? m_texcache : m_fbcache;
+ m_texcache_ctrl = (m_Ctrl & CTRL_TM) ? &m_texcache : &m_fbcache;
}
/*