diff options
author | 2020-05-25 16:42:42 +0200 | |
---|---|---|
committer | 2020-05-25 16:42:57 +0200 | |
commit | 22513fb6fe281f5ccb75aaddb6417a12a66c313d (patch) | |
tree | 3cf84032cc6482d685a8dbb57e015bd17c7f7fdc /src/devices/sound/rf5c68.cpp | |
parent | e42c2d2874cf9c1092c01ab5ce9ef997d465ce25 (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/rf5c68.cpp')
-rw-r--r-- | src/devices/sound/rf5c68.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/devices/sound/rf5c68.cpp b/src/devices/sound/rf5c68.cpp index 56661d9a6d4..1f1159b0afa 100644 --- a/src/devices/sound/rf5c68.cpp +++ b/src/devices/sound/rf5c68.cpp @@ -59,9 +59,8 @@ rf5c164_device::rf5c164_device(const machine_config &mconfig, const char *tag, d void rf5c68_device::device_start() { - m_data = &space(0); // Find our direct access - m_cache = space().cache<0, 0, ENDIANNESS_LITTLE>(); + space(0).cache(m_cache); m_sample_end_cb.resolve(); /* allocate the stream */ @@ -140,11 +139,11 @@ void rf5c68_device::sound_stream_update(sound_stream &stream, stream_sample_t ** } /* fetch the sample and handle looping */ - sample = m_cache->read_byte((chan.addr >> 11) & 0xffff); + sample = m_cache.read_byte((chan.addr >> 11) & 0xffff); if (sample == 0xff) { chan.addr = chan.loopst << 11; - sample = m_cache->read_byte((chan.addr >> 11) & 0xffff); + sample = m_cache.read_byte((chan.addr >> 11) & 0xffff); /* if we loop to a loop point, we're effectively dead */ if (sample == 0xff) @@ -269,7 +268,7 @@ void rf5c68_device::rf5c68_w(offs_t offset, u8 data) u8 rf5c68_device::rf5c68_mem_r(offs_t offset) { - return m_cache->read_byte(m_wbank | offset); + return m_cache.read_byte(m_wbank | offset); } @@ -279,5 +278,5 @@ u8 rf5c68_device::rf5c68_mem_r(offs_t offset) void rf5c68_device::rf5c68_mem_w(offs_t offset, u8 data) { - m_data->write_byte(m_wbank | offset, data); + m_cache.write_byte(m_wbank | offset, data); } |