From 22513fb6fe281f5ccb75aaddb6417a12a66c313d Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Mon, 25 May 2020 16:42:42 +0200 Subject: 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). --- src/devices/machine/s3c44b0.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/devices/machine/s3c44b0.cpp') diff --git a/src/devices/machine/s3c44b0.cpp b/src/devices/machine/s3c44b0.cpp index 8478f54bc58..009b400210e 100644 --- a/src/devices/machine/s3c44b0.cpp +++ b/src/devices/machine/s3c44b0.cpp @@ -264,7 +264,7 @@ void s3c44b0_device::device_start() m_data_r_cb.resolve_safe(0); m_data_w_cb.resolve(); - m_cache = m_cpu->space(AS_PROGRAM).cache<2, 0, ENDIANNESS_LITTLE>(); + m_cpu->space(AS_PROGRAM).cache(m_cache); for (int i = 0; i < 6; i++) m_pwm.timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::pwm_timer_exp),this)); for (auto & elem : m_uart) elem.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::uart_timer_exp),this)); @@ -543,19 +543,19 @@ void s3c44b0_device::lcd_dma_read(int count, uint8_t *data) { if ((m_lcd.vramaddr_cur & 2) == 0) { - data[0] = m_cache->read_byte(m_lcd.vramaddr_cur + 3); - data[1] = m_cache->read_byte(m_lcd.vramaddr_cur + 2); + data[0] = m_cache.read_byte(m_lcd.vramaddr_cur + 3); + data[1] = m_cache.read_byte(m_lcd.vramaddr_cur + 2); } else { - data[0] = m_cache->read_byte(m_lcd.vramaddr_cur - 1); - data[1] = m_cache->read_byte(m_lcd.vramaddr_cur - 2); + data[0] = m_cache.read_byte(m_lcd.vramaddr_cur - 1); + data[1] = m_cache.read_byte(m_lcd.vramaddr_cur - 2); } } else { - data[0] = m_cache->read_byte(m_lcd.vramaddr_cur + 0); - data[1] = m_cache->read_byte(m_lcd.vramaddr_cur + 1); + data[0] = m_cache.read_byte(m_lcd.vramaddr_cur + 0); + data[1] = m_cache.read_byte(m_lcd.vramaddr_cur + 1); } m_lcd.vramaddr_cur += 2; m_lcd.pagewidth_cur++; -- cgit v1.2.3-70-g09d2