# HG changeset patch # User Michael Pavone # Date 1673252126 28800 # Node ID 6f6f21d0c39658c93b5d23c2e2177d22a140eccf # Parent a6a68c33cce73f80f6a9f9dfc89560926cf0bcfc Fix missing address masks on some VRAM reads diff -r a6a68c33cce7 -r 6f6f21d0c396 vdp.c --- a/vdp.c Mon Jan 09 00:08:32 2023 -0800 +++ b/vdp.c Mon Jan 09 00:15:26 2023 -0800 @@ -1152,13 +1152,14 @@ { case VRAM_READ: if (context->flags2 & FLAG2_READ_PENDING) { - context->prefetch |= context->vdpmem[context->address | 1]; + //TODO: 128K VRAM support + context->prefetch |= context->vdpmem[(context->address & 0xFFFE) | 1]; context->flags |= FLAG_READ_FETCHED; context->flags2 &= ~FLAG2_READ_PENDING; //Should this happen after the prefetch or after the read? increment_address(context); } else { - //TODO: 128K VRAM Mode + //TODO: 128K VRAM support context->prefetch = context->vdpmem[context->address & 0xFFFE] << 8; context->flags2 |= FLAG2_READ_PENDING; } @@ -1168,7 +1169,8 @@ if (!(context->regs[REG_MODE_2] & BIT_MODE_5)) { address = mode4_address_map[address & 0x3FFF]; } - context->prefetch = context->vdpmem[address]; + //TODO: 128K VRAM support + context->prefetch = context->vdpmem[context->address & 0xFFFF]; context->prefetch |= context->fifo[context->fifo_write].value & 0xFF00; context->flags |= FLAG_READ_FETCHED; //Should this happen after the prefetch or after the read?