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/cpu/tms34010/34010gfx.hxx | |
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/cpu/tms34010/34010gfx.hxx')
-rw-r--r-- | src/devices/cpu/tms34010/34010gfx.hxx | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/src/devices/cpu/tms34010/34010gfx.hxx b/src/devices/cpu/tms34010/34010gfx.hxx index 80d9aa0669f..9e810704184 100644 --- a/src/devices/cpu/tms34010/34010gfx.hxx +++ b/src/devices/cpu/tms34010/34010gfx.hxx @@ -205,7 +205,7 @@ int tms340x0_device::compute_pixblt_b_cycles(int left_partials, int right_partia /* Shift register handling */ -void tms340x0_device::memory_w(address_space &space, offs_t offset,uint16_t data) +void tms340x0_device::memory_w(memory_access<32, 1, 3, ENDIANNESS_LITTLE>::specific &space, offs_t offset,uint16_t data) { //logerror("memory_w %08x %04x\n", offset << 3, data); if((offset << 3) == 0x02005010 && data == 0x0000) { @@ -215,12 +215,12 @@ void tms340x0_device::memory_w(address_space &space, offs_t offset,uint16_t data space.write_word(offset, data); } -uint16_t tms340x0_device::memory_r(address_space &space, offs_t offset) +uint16_t tms340x0_device::memory_r(memory_access<32, 1, 3, ENDIANNESS_LITTLE>::specific &space, offs_t offset) { return space.read_word(offset); } -void tms340x0_device::shiftreg_w(address_space &space, offs_t offset,uint16_t data) +void tms340x0_device::shiftreg_w(memory_access<32, 1, 3, ENDIANNESS_LITTLE>::specific &space, offs_t offset,uint16_t data) { //logerror("shiftreg_w %08x %04x\n", offset << 3, data); if (!m_from_shiftreg_cb.isnull()) @@ -229,7 +229,7 @@ void tms340x0_device::shiftreg_w(address_space &space, offs_t offset,uint16_t da logerror("From ShiftReg function not set. PC = %08X\n", m_pc); } -uint16_t tms340x0_device::shiftreg_r(address_space &space, offs_t offset) +uint16_t tms340x0_device::shiftreg_r(memory_access<32, 1, 3, ENDIANNESS_LITTLE>::specific &space, offs_t offset) { if (!m_to_shiftreg_cb.isnull()) m_to_shiftreg_cb(space, offset, &m_shiftreg[0]); @@ -238,7 +238,7 @@ uint16_t tms340x0_device::shiftreg_r(address_space &space, offs_t offset) return m_shiftreg[0]; } -uint16_t tms340x0_device::dummy_shiftreg_r(address_space &space, offs_t offset) +uint16_t tms340x0_device::dummy_shiftreg_r(memory_access<32, 1, 3, ENDIANNESS_LITTLE>::specific &space, offs_t offset) { return m_shiftreg[0]; } @@ -1034,13 +1034,13 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear uint32_t srcword, dstword = 0; /* fetch the initial source word */ - srcword = (this->*word_read)(*m_program, srcwordaddr++ << 4); + srcword = (this->*word_read)(m_program, srcwordaddr++ << 4); readwrites++; /* fetch the initial dest word */ if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY || (daddr & 0x0f) != 0) { - dstword = (this->*word_read)(*m_program, dstwordaddr << 4); + dstword = (this->*word_read)(m_program, dstwordaddr << 4); readwrites++; } @@ -1053,7 +1053,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear /* fetch more words if necessary */ if (srcbit + BITS_PER_PIXEL > 16) { - srcword |= (this->*word_read)(*m_program, srcwordaddr++ << 4) << 16; + srcword |= (this->*word_read)(m_program, srcwordaddr++ << 4) << 16; readwrites++; } @@ -1070,7 +1070,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY) if (dstbit + BITS_PER_PIXEL > 16) { - dstword |= (this->*word_read)(*m_program, (dstwordaddr + 1) << 4) << 16; + dstword |= (this->*word_read)(m_program, (dstwordaddr + 1) << 4) << 16; readwrites++; } @@ -1085,7 +1085,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear dstbit += BITS_PER_PIXEL; if (dstbit > 16) { - (this->*word_write)(*m_program, dstwordaddr++ << 4, dstword); + (this->*word_write)(m_program, dstwordaddr++ << 4, dstword); readwrites++; dstbit -= 16; dstword >>= 16; @@ -1098,13 +1098,13 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear /* if we're right-partial, read and mask the remaining bits */ if (dstbit != 16) { - uint16_t origdst = (this->*word_read)(*m_program, dstwordaddr << 4); + uint16_t origdst = (this->*word_read)(m_program, dstwordaddr << 4); uint16_t mask = 0xffff << dstbit; dstword = (dstword & ~mask) | (origdst & mask); readwrites++; } - (this->*word_write)(*m_program, dstwordaddr++ << 4, dstword); + (this->*word_write)(m_program, dstwordaddr++ << 4, dstword); readwrites++; } @@ -1136,14 +1136,14 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear dwordaddr = daddr >> 4; /* fetch the initial source word */ - srcword = (this->*word_read)(*m_program, swordaddr++ << 4); + srcword = (this->*word_read)(m_program, swordaddr++ << 4); srcmask = PIXEL_MASK << (saddr & 15); /* handle the left partial word */ if (left_partials != 0) { /* fetch the destination word */ - dstword = (this->*word_read)(*m_program, dwordaddr << 4); + dstword = (this->*word_read)(m_program, dwordaddr << 4); dstmask = PIXEL_MASK << (daddr & 15); /* loop over partials */ @@ -1152,7 +1152,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear /* fetch another word if necessary */ if (srcmask == 0) { - srcword = (this->*word_read)(*m_program, swordaddr++ << 4); + srcword = (this->*word_read)(m_program, swordaddr++ << 4); srcmask = PIXEL_MASK; } @@ -1174,7 +1174,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear } /* write the result */ - (this->*word_write)(*m_program, dwordaddr++ << 4, dstword); + (this->*word_write)(m_program, dwordaddr++ << 4, dstword); } /* loop over full words */ @@ -1182,7 +1182,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear { /* fetch the destination word (if necessary) */ if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY) - dstword = (this->*word_read)(*m_program, dwordaddr << 4); + dstword = (this->*word_read)(m_program, dwordaddr << 4); else dstword = 0; dstmask = PIXEL_MASK; @@ -1193,7 +1193,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear /* fetch another word if necessary */ if (srcmask == 0) { - srcword = (this->*word_read)(*m_program, swordaddr++ << 4); + srcword = (this->*word_read)(m_program, swordaddr++ << 4); srcmask = PIXEL_MASK; } @@ -1215,14 +1215,14 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear } /* write the result */ - (this->*word_write)(*m_program, dwordaddr++ << 4, dstword); + (this->*word_write)(m_program, dwordaddr++ << 4, dstword); } /* handle the right partial word */ if (right_partials != 0) { /* fetch the destination word */ - dstword = (this->*word_read)(*m_program, dwordaddr << 4); + dstword = (this->*word_read)(m_program, dwordaddr << 4); dstmask = PIXEL_MASK; /* loop over partials */ @@ -1232,7 +1232,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear if (srcmask == 0) { LOGGFX((" right fetch @ %08x\n", swordaddr)); - srcword = (this->*word_read)(*m_program, swordaddr++ << 4); + srcword = (this->*word_read)(m_program, swordaddr++ << 4); srcmask = PIXEL_MASK; } @@ -1254,7 +1254,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear } /* write the result */ - (this->*word_write)(*m_program, dwordaddr++ << 4, dstword); + (this->*word_write)(m_program, dwordaddr++ << 4, dstword); } #endif @@ -1405,14 +1405,14 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) osd_printf_debug("PIXBLT_R%d with odd d dwordaddr = (daddr + 15) >> 4; /* fetch the initial source word */ - srcword = (this->*word_read)(*m_program, --swordaddr << 4); + srcword = (this->*word_read)(m_program, --swordaddr << 4); srcmask = PIXEL_MASK << ((saddr - BITS_PER_PIXEL) & 15); /* handle the right partial word */ if (right_partials != 0) { /* fetch the destination word */ - dstword = (this->*word_read)(*m_program, --dwordaddr << 4); + dstword = (this->*word_read)(m_program, --dwordaddr << 4); dstmask = PIXEL_MASK << ((daddr - BITS_PER_PIXEL) & 15); /* loop over partials */ @@ -1421,7 +1421,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) osd_printf_debug("PIXBLT_R%d with odd d /* fetch source pixel if necessary */ if (srcmask == 0) { - srcword = (this->*word_read)(*m_program, --swordaddr << 4); + srcword = (this->*word_read)(m_program, --swordaddr << 4); srcmask = PIXEL_MASK << (16 - BITS_PER_PIXEL); } @@ -1448,7 +1448,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) osd_printf_debug("PIXBLT_R%d with odd d } /* write the result */ - (this->*word_write)(*m_program, dwordaddr << 4, dstword); + (this->*word_write)(m_program, dwordaddr << 4, dstword); } /* loop over full words */ @@ -1457,7 +1457,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) osd_printf_debug("PIXBLT_R%d with odd d /* fetch the destination word (if necessary) */ dwordaddr--; if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY) - dstword = (this->*word_read)(*m_program, dwordaddr << 4); + dstword = (this->*word_read)(m_program, dwordaddr << 4); else dstword = 0; dstmask = PIXEL_MASK << (16 - BITS_PER_PIXEL); @@ -1468,7 +1468,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) osd_printf_debug("PIXBLT_R%d with odd d /* fetch source pixel if necessary */ if (srcmask == 0) { - srcword = (this->*word_read)(*m_program, --swordaddr << 4); + srcword = (this->*word_read)(m_program, --swordaddr << 4); srcmask = PIXEL_MASK << (16 - BITS_PER_PIXEL); } @@ -1495,14 +1495,14 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) osd_printf_debug("PIXBLT_R%d with odd d } /* write the result */ - (this->*word_write)(*m_program, dwordaddr << 4, dstword); + (this->*word_write)(m_program, dwordaddr << 4, dstword); } /* handle the left partial word */ if (left_partials != 0) { /* fetch the destination word */ - dstword = (this->*word_read)(*m_program, --dwordaddr << 4); + dstword = (this->*word_read)(m_program, --dwordaddr << 4); dstmask = PIXEL_MASK << (16 - BITS_PER_PIXEL); /* loop over partials */ @@ -1511,7 +1511,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) osd_printf_debug("PIXBLT_R%d with odd d /* fetch the source pixel if necessary */ if (srcmask == 0) { - srcword = (this->*word_read)(*m_program, --swordaddr << 4); + srcword = (this->*word_read)(m_program, --swordaddr << 4); srcmask = PIXEL_MASK << (16 - BITS_PER_PIXEL); } @@ -1538,7 +1538,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) osd_printf_debug("PIXBLT_R%d with odd d } /* write the result */ - (this->*word_write)(*m_program, dwordaddr << 4, dstword); + (this->*word_write)(m_program, dwordaddr << 4, dstword); } /* update for next row */ @@ -1663,14 +1663,14 @@ void FUNCTION_NAME(tms340x0_device::pixblt_b)(int dst_is_linear) dwordaddr = daddr >> 4; /* fetch the initial source word */ - srcword = (this->*word_read)(*m_program, swordaddr++ << 4); + srcword = (this->*word_read)(m_program, swordaddr++ << 4); srcmask = 1 << (saddr & 15); /* handle the left partial word */ if (left_partials != 0) { /* fetch the destination word */ - dstword = (this->*word_read)(*m_program, dwordaddr << 4); + dstword = (this->*word_read)(m_program, dwordaddr << 4); dstmask = PIXEL_MASK << (daddr & 15); /* loop over partials */ @@ -1687,7 +1687,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt_b)(int dst_is_linear) srcmask <<= 1; if (srcmask == 0) { - srcword = (this->*word_read)(*m_program, swordaddr++ << 4); + srcword = (this->*word_read)(m_program, swordaddr++ << 4); srcmask = 0x0001; } @@ -1696,7 +1696,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt_b)(int dst_is_linear) } /* write the result */ - (this->*word_write)(*m_program, dwordaddr++ << 4, dstword); + (this->*word_write)(m_program, dwordaddr++ << 4, dstword); } /* loop over full words */ @@ -1704,7 +1704,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt_b)(int dst_is_linear) { /* fetch the destination word (if necessary) */ if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY) - dstword = (this->*word_read)(*m_program, dwordaddr << 4); + dstword = (this->*word_read)(m_program, dwordaddr << 4); else dstword = 0; dstmask = PIXEL_MASK; @@ -1723,7 +1723,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt_b)(int dst_is_linear) srcmask <<= 1; if (srcmask == 0) { - srcword = (this->*word_read)(*m_program, swordaddr++ << 4); + srcword = (this->*word_read)(m_program, swordaddr++ << 4); srcmask = 0x0001; } @@ -1732,14 +1732,14 @@ void FUNCTION_NAME(tms340x0_device::pixblt_b)(int dst_is_linear) } /* write the result */ - (this->*word_write)(*m_program, dwordaddr++ << 4, dstword); + (this->*word_write)(m_program, dwordaddr++ << 4, dstword); } /* handle the right partial word */ if (right_partials != 0) { /* fetch the destination word */ - dstword = (this->*word_read)(*m_program, dwordaddr << 4); + dstword = (this->*word_read)(m_program, dwordaddr << 4); dstmask = PIXEL_MASK; /* loop over partials */ @@ -1756,7 +1756,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt_b)(int dst_is_linear) srcmask <<= 1; if (srcmask == 0) { - srcword = (this->*word_read)(*m_program, swordaddr++ << 4); + srcword = (this->*word_read)(m_program, swordaddr++ << 4); srcmask = 0x0001; } @@ -1765,7 +1765,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt_b)(int dst_is_linear) } /* write the result */ - (this->*word_write)(*m_program, dwordaddr++ << 4, dstword); + (this->*word_write)(m_program, dwordaddr++ << 4, dstword); } /* update for next row */ @@ -1879,7 +1879,7 @@ void FUNCTION_NAME(tms340x0_device::fill)(int dst_is_linear) if (left_partials != 0) { /* fetch the destination word */ - dstword = (this->*word_read)(*m_program, dwordaddr << 4); + dstword = (this->*word_read)(m_program, dwordaddr << 4); dstmask = PIXEL_MASK << (daddr & 15); /* loop over partials */ @@ -1896,7 +1896,7 @@ void FUNCTION_NAME(tms340x0_device::fill)(int dst_is_linear) } /* write the result */ - (this->*word_write)(*m_program, dwordaddr++ << 4, dstword); + (this->*word_write)(m_program, dwordaddr++ << 4, dstword); } /* loop over full words */ @@ -1904,7 +1904,7 @@ void FUNCTION_NAME(tms340x0_device::fill)(int dst_is_linear) { /* fetch the destination word (if necessary) */ if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY) - dstword = (this->*word_read)(*m_program, dwordaddr << 4); + dstword = (this->*word_read)(m_program, dwordaddr << 4); else dstword = 0; dstmask = PIXEL_MASK; @@ -1923,14 +1923,14 @@ void FUNCTION_NAME(tms340x0_device::fill)(int dst_is_linear) } /* write the result */ - (this->*word_write)(*m_program, dwordaddr++ << 4, dstword); + (this->*word_write)(m_program, dwordaddr++ << 4, dstword); } /* handle the right partial word */ if (right_partials != 0) { /* fetch the destination word */ - dstword = (this->*word_read)(*m_program, dwordaddr << 4); + dstword = (this->*word_read)(m_program, dwordaddr << 4); dstmask = PIXEL_MASK; /* loop over partials */ @@ -1947,7 +1947,7 @@ void FUNCTION_NAME(tms340x0_device::fill)(int dst_is_linear) } /* write the result */ - (this->*word_write)(*m_program, dwordaddr++ << 4, dstword); + (this->*word_write)(m_program, dwordaddr++ << 4, dstword); } /* update for next row */ |