summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nubus
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2019-01-03 21:58:08 +0100
committer Olivier Galibert <galibert@pobox.com>2019-01-03 21:58:25 +0100
commitb0b23cb3867261c3bfd16b46c7a8ed72e36ca34f (patch)
treeebb08a4a260f8c1d75fd73004fbb16e99fe78db1 /src/devices/bus/nubus
parent6065a0f980492816eef1256099fded13bee31895 (diff)
specpdq: Start fixing blitting ops [O. Galibert]
Diffstat (limited to 'src/devices/bus/nubus')
-rw-r--r--src/devices/bus/nubus/nubus_specpdq.cpp50
1 files changed, 29 insertions, 21 deletions
diff --git a/src/devices/bus/nubus/nubus_specpdq.cpp b/src/devices/bus/nubus/nubus_specpdq.cpp
index d9e463e7fbf..f0d2d03042b 100644
--- a/src/devices/bus/nubus/nubus_specpdq.cpp
+++ b/src/devices/bus/nubus/nubus_specpdq.cpp
@@ -242,7 +242,7 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w )
switch (offset)
{
case 0xc0054: // mode 1
-// logerror("%x to mode1\n", data);
+ logerror("%x to mode1\n", data);
break;
case 0xc005c: // interrupt control
@@ -261,7 +261,7 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w )
break;
case 0xc007a:
-// logerror("%x to mode2\n", data);
+ logerror("%x to mode2\n", data);
switch (data)
{
@@ -278,11 +278,11 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w )
break;
}
-// logerror("m_mode = %d\n", m_mode);
+ logerror("m_mode = %d\n", m_mode);
break;
case 0x120000: // DAC address
-// logerror("%08x to DAC control %s\n", data,machine().describe_context());
+ logerror("%08x to DAC control %s\n", data,machine().describe_context());
m_clutoffs = ((data>>8)&0xff)^0xff;
break;
@@ -291,7 +291,7 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w )
if (m_count == 3)
{
-// logerror("RAMDAC: color %d = %02x %02x %02x %s\n", m_clutoffs, m_colors[0], m_colors[1], m_colors[2], machine().describe_context());
+ logerror("RAMDAC: color %d = %02x %02x %02x %s\n", m_clutoffs, m_colors[0], m_colors[1], m_colors[2], machine().describe_context());
m_palette->set_pen_color(m_clutoffs, rgb_t(m_colors[0], m_colors[1], m_colors[2]));
m_palette_val[m_clutoffs] = rgb_t(m_colors[0], m_colors[1], m_colors[2]);
m_clutoffs++;
@@ -368,7 +368,8 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w )
case 0x18103d:
case 0x18103e:
case 0x18103f:
-// logerror("Pattern %08x @ %x\n", data ^ 0xffffffff, offset);
+ if(offset == 0x181000)
+ logerror("Pattern %08x @ %x\n", data ^ 0xffffffff, offset);
m_fillbytes[((offset&0x3f)*4)] = ((data>>24) & 0xff) ^ 0xff;
m_fillbytes[((offset&0x3f)*4)+1] = ((data>>16) & 0xff) ^ 0xff;
m_fillbytes[((offset&0x3f)*4)+2] = ((data>>8) & 0xff) ^ 0xff;
@@ -377,72 +378,79 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w )
// blitter control
case 0x182006:
-// logerror("%08x (%d) to blitter ctrl 1 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context());
+ logerror("%08x (%d) to blitter ctrl 1 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context());
break;
case 0x182008:
-// logerror("%08x (%d) to blitter ctrl 2 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context());
+ logerror("%08x (%d) to blitter ctrl 2 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context());
m_patofsx = (data ^ 0xffffffff) & 7;
m_patofsy = ((data ^ 0xffffffff)>>3) & 7;
break;
case 0x18200e:
-// logerror("%08x (%d) to blitter ctrl 3 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context());
+ logerror("%08x (%d) to blitter ctrl 3 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context());
m_width = data ^ 0xffffffff;
break;
case 0x18200b:
-// logerror("%08x (%d) to blitter ctrl 4 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context());
+ logerror("%08x (%d) to blitter ctrl 4 %s\n", data^0xffffffff, data^0xffffffff, machine().describe_context());
m_height = (data ^ 0xffffffff) & 0xffff;
break;
case 0x18200a:
data ^= 0xffffffff;
-// logerror("%08x to blitter ctrl 5 %s\n", data, machine().describe_context());
+ logerror("%08x to blitter ctrl 5 %s\n", data, machine().describe_context());
m_vram_src = data>>2;
break;
case 0x182009:
data ^= 0xffffffff;
-// logerror("%08x to blitter ctrl 6 %s\n", data, machine().describe_context());
+ logerror("%08x to blitter ctrl 6 %s\n", data, machine().describe_context());
m_vram_addr = data>>2;
break;
case 0x182007:
data ^= 0xffffffff;
-// logerror("%08x to blitter ctrl 7 %s\n", data, machine().describe_context());
+ logerror("%08x to blitter ctrl 7 %s\n", data, machine().describe_context());
// fill rectangle
if (data == 2)
{
int x, y;
- uint8_t *vram = &m_vram[m_vram_addr + m_patofsx]; // m_vram_addr is missing the low 2 bits, we add them back here
+ uint8_t *vram = &m_vram[(m_vram_addr + m_patofsx) & ~3]; // m_vram_addr is missing the low 2 bits, we add them back here
-// logerror("Fill rectangle with %02x %02x %02x %02x, width %d height %d\n", m_fillbytes[0], m_fillbytes[1], m_fillbytes[2], m_fillbytes[3], m_width, m_height);
+ int ddx = (m_vram_addr + m_patofsx) & 3;
+
+ logerror("Fill rectangle with %02x %02x %02x %02x, width %d height %d\n", m_fillbytes[0], m_fillbytes[1], m_fillbytes[2], m_fillbytes[3], m_width, m_height);
for (y = 0; y < m_height; y++)
{
for (x = 0; x < m_width; x++)
{
- vram[(y * 1152)+x] = m_fillbytes[((m_patofsx + x) & 0x1f)+(((m_patofsy + y) & 0x7)*32)];
+ vram[(y * 1152)+BYTE4_XOR_BE(x + ddx)] = m_fillbytes[((m_patofsx + x) & 0x1f)+(((m_patofsy + y) & 0x7)*32)];
}
}
}
else if ((data == 0x101) || (data == 0x100))
{
int x, y;
- uint8_t *vram = &m_vram[m_vram_addr];
- uint8_t *vramsrc = &m_vram[m_vram_src];
+ uint8_t *vram = &m_vram[m_vram_addr & ~3];
+ uint8_t *vramsrc = &m_vram[m_vram_src & ~3];
+
+ int sdx = m_vram_addr & 3;
+ int ddx = m_vram_src & 3;
-// logerror("Copy rectangle, width %d height %d src %x dst %x\n", m_width, m_height, m_vram_addr, m_vram_src);
+ logerror("Copy rectangle, width %d height %d src %x dst %x\n", m_width, m_height, m_vram_addr, m_vram_src);
for (y = 0; y < m_height; y++)
{
for (x = 0; x < m_width; x++)
{
- vram[(y * 1152)+x] = vramsrc[(y * 1152)+x];
+ vram[(y * 1152)+BYTE4_XOR_BE(x + ddx)] = vramsrc[(y * 1152)+BYTE4_XOR_BE(x + sdx)];
}
}
+ (void)vramsrc;
+ (void)sdx;
}
else
{
@@ -451,7 +459,7 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w )
break;
default:
-// logerror("specpdq_w: %08x @ %x (mask %08x %s)\n", data^0xffffffff, offset, mem_mask, machine().describe_context());
+ logerror("specpdq_w: %08x @ %x (mask %08x %s)\n", data^0xffffffff, offset, mem_mask, machine().describe_context());
break;
}
}