summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2012-12-26 17:34:59 -0800
committerMike Pavone <pavone@retrodev.com>2012-12-26 17:34:59 -0800
commitcce801dfb2df84293b42c2a73ef1e894ac437333 (patch)
treefb84cd0b053c11fd0c6717bb55549efc419b1d33
parente47a5743357fe9d026a62cb4c1c01f044215adde (diff)
Fix long reads from IO ports or long reads that trigger sync cycles by saving rdi. Possibly fix word wide IO reads.
-rw-r--r--runtime.S4
-rw-r--r--vdp.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/runtime.S b/runtime.S
index c5618f8..7d7b7a3 100644
--- a/runtime.S
+++ b/runtime.S
@@ -154,7 +154,7 @@ do_io_read_w:
call io_read_w
mov %rax, %rsi
call m68k_load_context
- mov 136(%rsi), %cl
+ mov 136(%rsi), %cx
ret
bad_access_msg:
@@ -333,7 +333,9 @@ m68k_read_long_scratch1:
mov %cx, %di
pop %rcx
add $2, %ecx
+ push %rdi
call m68k_read_word_scratch1
+ pop %rdi
and $0xFFFF, %ecx
shl $16, %edi
or %edi, %ecx
diff --git a/vdp.c b/vdp.c
index 621c314..a852830 100644
--- a/vdp.c
+++ b/vdp.c
@@ -313,7 +313,7 @@ void external_slot(vdp_context * context)
}
break;
case CRAM_WRITE:
- //printf("CRAM Write: %X to %X\n", start->value, context->address);
+ printf("CRAM Write: %X to %X, autoinc: %d\n", start->value, context->address, context->regs[REG_AUTOINC]);
context->cram[(context->address/2) & (CRAM_SIZE-1)] = start->value;
break;
case VSRAM_WRITE:
@@ -1029,7 +1029,7 @@ int vdp_control_port_write(vdp_context * context, uint16_t value)
context->address = (context->address & 0x3FFF) | (value << 14);
context->cd = (context->cd & 0x3) | ((value >> 2) & 0x3C);
context->flags &= ~FLAG_PENDING;
- //printf("New Address: %X, New CD: %X\n", context->address, context->cd);
+ printf("New Address: %X, New CD: %X\n", context->address, context->cd);
if (context->cd & 0x20) {
if((context->regs[REG_DMASRC_H] & 0xC0) != 0x80) {
//DMA copy or 68K -> VDP, transfer starts immediately