Readded the previously incorrectly removed Load and Store SCRIPTS Instructions to the NCR 53C810.

This commit is contained in:
OBattler
2017-12-12 04:17:23 +01:00
parent d111aef475
commit 83f7d458db

View File

@@ -1340,23 +1340,41 @@ again:
case 3: case 3:
ncr53c810_log("00: Memory move\n"); ncr53c810_log("00: Memory move\n");
if ((insn & 0x3E000000) == 0) { if ((insn & (1 << 29)) == 0) {
/* Memory move. */ /* Memory move. */
uint32_t dest; uint32_t dest;
/* ??? The docs imply the destination address is loaded into /* ??? The docs imply the destination address is loaded into
the TEMP register. However the Linux drivers rely on the TEMP register. However the Linux drivers rely on
the value being presrved. */ the value being presrved. */
dest = read_dword(s, s->dsp); dest = read_dword(s, s->dsp);
s->dsp += 4; s->dsp += 4;
s->regop = 0; lsi_memcpy(s, dest, addr, insn & 0xffffff);
if (dest) } else {
lsi_memcpy(s, dest, addr, insn & 0xffffff); uint8_t data[7];
} int reg;
else { int n;
DPRINTF("Illegal memory move: %02X\n", insn >> 24); int i;
lsi_script_dma_interrupt(s, LSI_DSTAT_IID);
break; if (insn & (1 << 28)) {
} addr = s->dsa + sextract32(addr, 0, 24);
}
n = (insn & 7);
reg = (insn >> 16) & 0xff;
if (insn & (1 << 24)) {
DMAPageRead(addr, (char *) data, n);
DPRINTF("Load reg 0x%x size %d addr 0x%08x = %08x\n", reg, n,
addr, *(int *)data);
for (i = 0; i < n; i++) {
lsi_reg_writeb(s, reg + i, data[i]);
}
} else {
DPRINTF("Store reg 0x%x size %d addr 0x%08x\n", reg, n, addr);
for (i = 0; i < n; i++) {
data[i] = lsi_reg_readb(s, reg + i);
}
DMAPageWrite(addr, (char *) data, n);
}
}
break; break;
default: default: