diff options
author | Mike Pavone <pavone@retrodev.com> | 2013-09-15 22:43:01 -0700 |
---|---|---|
committer | Mike Pavone <pavone@retrodev.com> | 2013-09-15 22:43:01 -0700 |
commit | 4437c3730dfbe7e038bc28da6531d140ddbfbcd4 (patch) | |
tree | 301305f42177f3cc08ec039da60c5e6046f7fde5 | |
parent | e154139fdaa57c8c805167641b9ac0c30bb9d115 (diff) |
Fix VSRAM reads
-rw-r--r-- | vdp.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1583,13 +1583,13 @@ uint16_t vdp_data_port_read(vdp_context * context) switch (context->cd & 0xF) { case VRAM_READ: - value = context->vdpmem[context->address] << 8; + value = context->vdpmem[context->address & 0xFFFE] << 8; context->flags &= ~FLAG_UNUSED_SLOT; context->flags2 |= FLAG2_READ_PENDING; while (!(context->flags & FLAG_UNUSED_SLOT)) { vdp_run_context(context, context->cycles + ((context->latched_mode & BIT_H40) ? 16 : 20)); } - value |= context->vdpmem[context->address ^ 1]; + value |= context->vdpmem[context->address | 1]; break; case CRAM_READ: value = context->cram[(context->address/2) & (CRAM_SIZE-1)] & CRAM_BITS; @@ -1597,7 +1597,7 @@ uint16_t vdp_data_port_read(vdp_context * context) break; case VSRAM_READ: if (((context->address / 2) & 63) < VSRAM_SIZE) { - value = context->vsram[context->address & 63] & VSRAM_BITS; + value = context->vsram[(context->address / 2) & 63] & VSRAM_BITS; value |= context->fifo[context->fifo_write].value & VSRAM_DIRTY_BITS; } break; |