summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/tms34010/34010gfx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/cpu/tms34010/34010gfx.c')
-rw-r--r--src/emu/cpu/tms34010/34010gfx.c130
1 files changed, 65 insertions, 65 deletions
diff --git a/src/emu/cpu/tms34010/34010gfx.c b/src/emu/cpu/tms34010/34010gfx.c
index 3a451bccf37..0d7ade5ae39 100644
--- a/src/emu/cpu/tms34010/34010gfx.c
+++ b/src/emu/cpu/tms34010/34010gfx.c
@@ -202,18 +202,18 @@ static int compute_pixblt_b_cycles(int left_partials, int right_partials, int fu
/* Shift register handling */
-static void shiftreg_w(offs_t offset,UINT16 data)
+static void shiftreg_w(const address_space *space, offs_t offset,UINT16 data)
{
- tms34010_state *tms = Machine->activecpu->token;
+ tms34010_state *tms = space->cpu->token;
if (tms->config->from_shiftreg)
(*tms->config->from_shiftreg)((UINT32)(offset << 3) & ~15, &tms->shiftreg[0]);
else
logerror("From ShiftReg function not set. PC = %08X\n", tms->pc);
}
-static UINT16 shiftreg_r(offs_t offset)
+static UINT16 shiftreg_r(const address_space *space, offs_t offset)
{
- tms34010_state *tms = Machine->activecpu->token;
+ tms34010_state *tms = space->cpu->token;
if (tms->config->to_shiftreg)
(*tms->config->to_shiftreg)((UINT32)(offset << 3) & ~15, &tms->shiftreg[0]);
else
@@ -221,9 +221,9 @@ static UINT16 shiftreg_r(offs_t offset)
return tms->shiftreg[0];
}
-static UINT16 dummy_shiftreg_r(offs_t offset)
+static UINT16 dummy_shiftreg_r(const address_space *space, offs_t offset)
{
- tms34010_state *tms = Machine->activecpu->token;
+ tms34010_state *tms = space->cpu->token;
return tms->shiftreg[0];
}
@@ -1029,8 +1029,8 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
if (!P_FLAG(tms))
{
int dx, dy, x, y, /*words,*/ yreverse;
- void (*word_write)(offs_t address,UINT16 data);
- UINT16 (*word_read)(offs_t address);
+ void (*word_write)(const address_space *space,offs_t address,UINT16 data);
+ UINT16 (*word_read)(const address_space *space,offs_t address);
UINT32 readwrites = 0;
UINT32 saddr, daddr;
XY dstxy = { 0 };
@@ -1043,8 +1043,8 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
}
else
{
- word_write = program_write_word_16le;
- word_read = program_read_word_16le;
+ word_write = memory_write_word_16le;
+ word_read = memory_read_word_16le;
}
/* compute the starting addresses */
@@ -1104,13 +1104,13 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
UINT32 srcword, dstword = 0;
/* fetch the initial source word */
- srcword = (*word_read)(srcwordaddr++ << 1);
+ srcword = (*word_read)(tms->program, srcwordaddr++ << 1);
readwrites++;
/* fetch the initial dest word */
if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY || (daddr & 0x0f) != 0)
{
- dstword = (*word_read)(dstwordaddr << 1);
+ dstword = (*word_read)(tms->program, dstwordaddr << 1);
readwrites++;
}
@@ -1123,7 +1123,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
/* fetch more words if necessary */
if (srcbit + BITS_PER_PIXEL > 16)
{
- srcword |= (*word_read)(srcwordaddr++ << 1) << 16;
+ srcword |= (*word_read)(tms->program, srcwordaddr++ << 1) << 16;
readwrites++;
}
@@ -1140,7 +1140,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY)
if (dstbit + BITS_PER_PIXEL > 16)
{
- dstword |= (*word_read)((dstwordaddr + 1) << 1) << 16;
+ dstword |= (*word_read)(tms->program, (dstwordaddr + 1) << 1) << 16;
readwrites++;
}
@@ -1155,7 +1155,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
dstbit += BITS_PER_PIXEL;
if (dstbit > 16)
{
- (*word_write)(dstwordaddr++ << 1, dstword);
+ (*word_write)(tms->program, dstwordaddr++ << 1, dstword);
readwrites++;
dstbit -= 16;
dstword >>= 16;
@@ -1168,13 +1168,13 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
/* if we're right-partial, read and mask the remaining bits */
if (dstbit != 16)
{
- UINT16 origdst = (*word_read)(dstwordaddr << 1);
+ UINT16 origdst = (*word_read)(tms->program, dstwordaddr << 1);
UINT16 mask = 0xffff << dstbit;
dstword = (dstword & ~mask) | (origdst & mask);
readwrites++;
}
- (*word_write)(dstwordaddr++ << 1, dstword);
+ (*word_write)(tms->program, dstwordaddr++ << 1, dstword);
readwrites++;
}
@@ -1206,14 +1206,14 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
dwordaddr = daddr >> 4;
/* fetch the initial source word */
- srcword = (*word_read)(swordaddr++ << 1);
+ srcword = (*word_read)(tms->program, swordaddr++ << 1);
srcmask = PIXEL_MASK << (saddr & 15);
/* handle the left partial word */
if (left_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(dwordaddr << 1);
+ dstword = (*word_read)(tms->program, dwordaddr << 1);
dstmask = PIXEL_MASK << (daddr & 15);
/* loop over partials */
@@ -1222,7 +1222,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
/* fetch another word if necessary */
if (srcmask == 0)
{
- srcword = (*word_read)(swordaddr++ << 1);
+ srcword = (*word_read)(tms->program, swordaddr++ << 1);
srcmask = PIXEL_MASK;
}
@@ -1244,7 +1244,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
}
/* write the result */
- (*word_write)(dwordaddr++ << 1, dstword);
+ (*word_write)(tms->program, dwordaddr++ << 1, dstword);
}
/* loop over full words */
@@ -1252,7 +1252,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
{
/* fetch the destination word (if necessary) */
if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY)
- dstword = (*word_read)(dwordaddr << 1);
+ dstword = (*word_read)(tms->program, dwordaddr << 1);
else
dstword = 0;
dstmask = PIXEL_MASK;
@@ -1263,7 +1263,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
/* fetch another word if necessary */
if (srcmask == 0)
{
- srcword = (*word_read)(swordaddr++ << 1);
+ srcword = (*word_read)(tms->program, swordaddr++ << 1);
srcmask = PIXEL_MASK;
}
@@ -1285,14 +1285,14 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
}
/* write the result */
- (*word_write)(dwordaddr++ << 1, dstword);
+ (*word_write)(tms->program, dwordaddr++ << 1, dstword);
}
/* handle the right partial word */
if (right_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(dwordaddr << 1);
+ dstword = (*word_read)(tms->program, dwordaddr << 1);
dstmask = PIXEL_MASK;
/* loop over partials */
@@ -1302,7 +1302,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
if (srcmask == 0)
{
LOGGFX((" right fetch @ %08x\n", swordaddr));
- srcword = (*word_read)(swordaddr++ << 1);
+ srcword = (*word_read)(tms->program, swordaddr++ << 1);
srcmask = PIXEL_MASK;
}
@@ -1324,7 +1324,7 @@ static void FUNCTION_NAME(pixblt)(tms34010_state *tms, int src_is_linear, int ds
}
/* write the result */
- (*word_write)(dwordaddr++ << 1, dstword);
+ (*word_write)(tms->program, dwordaddr++ << 1, dstword);
}
#endif
@@ -1376,8 +1376,8 @@ static void FUNCTION_NAME(pixblt_r)(tms34010_state *tms, int src_is_linear, int
if (!P_FLAG(tms))
{
int dx, dy, x, y, words, yreverse;
- void (*word_write)(offs_t address,UINT16 data);
- UINT16 (*word_read)(offs_t address);
+ void (*word_write)(const address_space *space,offs_t address,UINT16 data);
+ UINT16 (*word_read)(const address_space *space,offs_t address);
UINT32 saddr, daddr;
XY dstxy = { 0 };
@@ -1389,8 +1389,8 @@ static void FUNCTION_NAME(pixblt_r)(tms34010_state *tms, int src_is_linear, int
}
else
{
- word_write = program_write_word_16le;
- word_read = program_read_word_16le;
+ word_write = memory_write_word_16le;
+ word_read = memory_read_word_16le;
}
/* compute the starting addresses */
@@ -1475,14 +1475,14 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
dwordaddr = (daddr + 15) >> 4;
/* fetch the initial source word */
- srcword = (*word_read)(--swordaddr << 1);
+ srcword = (*word_read)(tms->program, --swordaddr << 1);
srcmask = PIXEL_MASK << ((saddr - BITS_PER_PIXEL) & 15);
/* handle the right partial word */
if (right_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(--dwordaddr << 1);
+ dstword = (*word_read)(tms->program, --dwordaddr << 1);
dstmask = PIXEL_MASK << ((daddr - BITS_PER_PIXEL) & 15);
/* loop over partials */
@@ -1491,7 +1491,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
/* fetch source pixel if necessary */
if (srcmask == 0)
{
- srcword = (*word_read)(--swordaddr << 1);
+ srcword = (*word_read)(tms->program, --swordaddr << 1);
srcmask = PIXEL_MASK << (16 - BITS_PER_PIXEL);
}
@@ -1513,7 +1513,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
}
/* write the result */
- (*word_write)(dwordaddr << 1, dstword);
+ (*word_write)(tms->program, dwordaddr << 1, dstword);
}
/* loop over full words */
@@ -1522,7 +1522,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
/* fetch the destination word (if necessary) */
dwordaddr--;
if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY)
- dstword = (*word_read)(dwordaddr << 1);
+ dstword = (*word_read)(tms->program, dwordaddr << 1);
else
dstword = 0;
dstmask = PIXEL_MASK << (16 - BITS_PER_PIXEL);
@@ -1533,7 +1533,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
/* fetch source pixel if necessary */
if (srcmask == 0)
{
- srcword = (*word_read)(--swordaddr << 1);
+ srcword = (*word_read)(tms->program, --swordaddr << 1);
srcmask = PIXEL_MASK << (16 - BITS_PER_PIXEL);
}
@@ -1555,14 +1555,14 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
}
/* write the result */
- (*word_write)(dwordaddr << 1, dstword);
+ (*word_write)(tms->program, dwordaddr << 1, dstword);
}
/* handle the left partial word */
if (left_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(--dwordaddr << 1);
+ dstword = (*word_read)(tms->program, --dwordaddr << 1);
dstmask = PIXEL_MASK << (16 - BITS_PER_PIXEL);
/* loop over partials */
@@ -1571,7 +1571,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
/* fetch the source pixel if necessary */
if (srcmask == 0)
{
- srcword = (*word_read)(--swordaddr << 1);
+ srcword = (*word_read)(tms->program, --swordaddr << 1);
srcmask = PIXEL_MASK << (16 - BITS_PER_PIXEL);
}
@@ -1593,7 +1593,7 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) mame_printf_debug("PIXBLT_R%d with odd
}
/* write the result */
- (*word_write)(dwordaddr << 1, dstword);
+ (*word_write)(tms->program, dwordaddr << 1, dstword);
}
/* update for next row */
@@ -1641,8 +1641,8 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
if (!P_FLAG(tms))
{
int dx, dy, x, y, words, left_partials, right_partials, full_words;
- void (*word_write)(offs_t address,UINT16 data);
- UINT16 (*word_read)(offs_t address);
+ void (*word_write)(const address_space *space,offs_t address,UINT16 data);
+ UINT16 (*word_read)(const address_space *space,offs_t address);
UINT32 saddr, daddr;
XY dstxy = { 0 };
@@ -1654,8 +1654,8 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
}
else
{
- word_write = program_write_word_16le;
- word_read = program_read_word_16le;
+ word_write = memory_write_word_16le;
+ word_read = memory_read_word_16le;
}
/* compute the starting addresses */
@@ -1718,14 +1718,14 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
dwordaddr = daddr >> 4;
/* fetch the initial source word */
- srcword = (*word_read)(swordaddr++ << 1);
+ srcword = (*word_read)(tms->program, swordaddr++ << 1);
srcmask = 1 << (saddr & 15);
/* handle the left partial word */
if (left_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(dwordaddr << 1);
+ dstword = (*word_read)(tms->program, dwordaddr << 1);
dstmask = PIXEL_MASK << (daddr & 15);
/* loop over partials */
@@ -1742,7 +1742,7 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
srcmask <<= 1;
if (srcmask == 0)
{
- srcword = (*word_read)(swordaddr++ << 1);
+ srcword = (*word_read)(tms->program, swordaddr++ << 1);
srcmask = 0x0001;
}
@@ -1751,7 +1751,7 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
}
/* write the result */
- (*word_write)(dwordaddr++ << 1, dstword);
+ (*word_write)(tms->program, dwordaddr++ << 1, dstword);
}
/* loop over full words */
@@ -1759,7 +1759,7 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
{
/* fetch the destination word (if necessary) */
if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY)
- dstword = (*word_read)(dwordaddr << 1);
+ dstword = (*word_read)(tms->program, dwordaddr << 1);
else
dstword = 0;
dstmask = PIXEL_MASK;
@@ -1778,7 +1778,7 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
srcmask <<= 1;
if (srcmask == 0)
{
- srcword = (*word_read)(swordaddr++ << 1);
+ srcword = (*word_read)(tms->program, swordaddr++ << 1);
srcmask = 0x0001;
}
@@ -1787,14 +1787,14 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
}
/* write the result */
- (*word_write)(dwordaddr++ << 1, dstword);
+ (*word_write)(tms->program, dwordaddr++ << 1, dstword);
}
/* handle the right partial word */
if (right_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(dwordaddr << 1);
+ dstword = (*word_read)(tms->program, dwordaddr << 1);
dstmask = PIXEL_MASK;
/* loop over partials */
@@ -1811,7 +1811,7 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
srcmask <<= 1;
if (srcmask == 0)
{
- srcword = (*word_read)(swordaddr++ << 1);
+ srcword = (*word_read)(tms->program, swordaddr++ << 1);
srcmask = 0x0001;
}
@@ -1820,7 +1820,7 @@ static void FUNCTION_NAME(pixblt_b)(tms34010_state *tms, int dst_is_linear)
}
/* write the result */
- (*word_write)(dwordaddr++ << 1, dstword);
+ (*word_write)(tms->program, dwordaddr++ << 1, dstword);
}
/* update for next row */
@@ -1855,8 +1855,8 @@ static void FUNCTION_NAME(fill)(tms34010_state *tms, int dst_is_linear)
if (!P_FLAG(tms))
{
int dx, dy, x, y, words, left_partials, right_partials, full_words;
- void (*word_write)(offs_t address,UINT16 data);
- UINT16 (*word_read)(offs_t address);
+ void (*word_write)(const address_space *space,offs_t address,UINT16 data);
+ UINT16 (*word_read)(const address_space *space,offs_t address);
UINT32 daddr;
XY dstxy = { 0 };
@@ -1868,8 +1868,8 @@ static void FUNCTION_NAME(fill)(tms34010_state *tms, int dst_is_linear)
}
else
{
- word_write = program_write_word_16le;
- word_read = program_read_word_16le;
+ word_write = memory_write_word_16le;
+ word_read = memory_read_word_16le;
}
/* compute the bounds of the operation */
@@ -1934,7 +1934,7 @@ static void FUNCTION_NAME(fill)(tms34010_state *tms, int dst_is_linear)
if (left_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(dwordaddr << 1);
+ dstword = (*word_read)(tms->program, dwordaddr << 1);
dstmask = PIXEL_MASK << (daddr & 15);
/* loop over partials */
@@ -1951,7 +1951,7 @@ static void FUNCTION_NAME(fill)(tms34010_state *tms, int dst_is_linear)
}
/* write the result */
- (*word_write)(dwordaddr++ << 1, dstword);
+ (*word_write)(tms->program, dwordaddr++ << 1, dstword);
}
/* loop over full words */
@@ -1959,7 +1959,7 @@ static void FUNCTION_NAME(fill)(tms34010_state *tms, int dst_is_linear)
{
/* fetch the destination word (if necessary) */
if (PIXEL_OP_REQUIRES_SOURCE || TRANSPARENCY)
- dstword = (*word_read)(dwordaddr << 1);
+ dstword = (*word_read)(tms->program, dwordaddr << 1);
else
dstword = 0;
dstmask = PIXEL_MASK;
@@ -1978,14 +1978,14 @@ static void FUNCTION_NAME(fill)(tms34010_state *tms, int dst_is_linear)
}
/* write the result */
- (*word_write)(dwordaddr++ << 1, dstword);
+ (*word_write)(tms->program, dwordaddr++ << 1, dstword);
}
/* handle the right partial word */
if (right_partials != 0)
{
/* fetch the destination word */
- dstword = (*word_read)(dwordaddr << 1);
+ dstword = (*word_read)(tms->program, dwordaddr << 1);
dstmask = PIXEL_MASK;
/* loop over partials */
@@ -2002,7 +2002,7 @@ static void FUNCTION_NAME(fill)(tms34010_state *tms, int dst_is_linear)
}
/* write the result */
- (*word_write)(dwordaddr++ << 1, dstword);
+ (*word_write)(tms->program, dwordaddr++ << 1, dstword);
}
/* update for next row */