summaryrefslogtreecommitdiff
path: root/vdp.c
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2020-06-28 21:31:09 -0700
committerMike Pavone <pavone@retrodev.com>2020-06-28 21:31:09 -0700
commitdd998469827d866ee88505d5527abd6db4ae8832 (patch)
tree66e24edd7d26c8ce52b27f84b5dc261d56a11c41 /vdp.c
parented0cc3b27b4079170975bd85bc6a1a29fa7f6f4c (diff)
Fix regressions from most recent address/cd latch change. Need to do more research still, but probably good enough for now
Diffstat (limited to 'vdp.c')
-rw-r--r--vdp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/vdp.c b/vdp.c
index 52aaa1c..0ffc1a2 100644
--- a/vdp.c
+++ b/vdp.c
@@ -3755,6 +3755,10 @@ int vdp_control_port_write(vdp_context * context, uint16_t value)
if ((value & 0xC000) == 0x8000) {
//Register write
uint8_t reg = (value >> 8) & 0x1F;
+ // The fact that this is needed seems to pour some cold water on my theory
+ // about how the address latch actually works. Needs more search to definitively confirm
+ context->address = (context->address & 0x1C000) | (value & 0x3FFF);
+ context->cd = (context->cd & 0x3C) | (value >> 14);
if (reg < (mode_5 ? VDP_REGS : 0xB)) {
//printf("register %d set to %X\n", reg, value & 0xFF);
if (reg == REG_MODE_1 && (value & BIT_HVC_LATCH) && !(context->regs[reg] & BIT_HVC_LATCH)) {
@@ -3779,11 +3783,6 @@ int vdp_control_port_write(vdp_context * context, uint16_t value)
update_video_params(context);
}
}
- // The fact that this is needed seems to pour some cold water on my theory
- // about how the address latch actually works. Needs more search to definitively confirm
- clear_pending(context);
- context->flags &= ~FLAG_READ_FETCHED;
- context->flags2 &= ~FLAG2_READ_PENDING;
} else if (mode_5) {
context->flags |= FLAG_PENDING;
//Should these be taken care of here or after the second write?