specpdq: Start fixing blitting ops [O. Galibert]

This commit is contained in:
Olivier Galibert 2019-01-03 21:58:08 +01:00
parent 6065a0f980
commit b0b23cb386
2 changed files with 35 additions and 21 deletions

View File

@ -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];
// logerror("Copy rectangle, width %d height %d src %x dst %x\n", m_width, m_height, m_vram_addr, m_vram_src);
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);
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;
}
}

View File

@ -594,6 +594,10 @@ READ8_MEMBER(wd33c9x_base_device::indir_reg_r)
logerror("reg %02x = %02x\n", m_addr, ret);
if(m_addr == 1) {
ret |= 8;
machine().debug_break();
}
// No address increment on accesses to Command, Data, and Auxiliary Status Registers
if (m_addr != COMMAND && m_addr != AUXILIARY_STATUS) {
m_addr = (m_addr + 1) & REGS_MASK;
@ -662,6 +666,8 @@ WRITE8_MEMBER(wd33c9x_base_device::indir_reg_w)
else {
m_regs[m_addr] = data;
}
if(m_addr == 1)
machine().debug_break();
m_addr = (m_addr + 1) & REGS_MASK;
break;
}