summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-01-01 22:47:23 -0800
committerMichael Pavone <pavone@retrodev.com>2017-01-01 22:47:23 -0800
commit36a169a1c807db81bdf38243c14e74e00f2e54be (patch)
treefa1162d00e1f90c383de1993b043600ff636af32
parent6009e226f703e3c2c1c1c29839fc74736be4a646 (diff)
Fix horizontal scrolling in Mode 4
-rw-r--r--vdp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vdp.c b/vdp.c
index b86dab2..f6fc948 100644
--- a/vdp.c
+++ b/vdp.c
@@ -983,7 +983,7 @@ static void read_map_mode4(uint16_t column, uint32_t line, vdp_context * context
}
address += (vscroll >> 3) * 2 * 32;
//add column
- address += (((column << 3) + context->hscroll_a) >> 3) * 2;
+ address += ((column - (context->hscroll_a >> 3)) & 31) * 2;
//adjust for weird VRAM mapping in Mode 4
address = mode4_address_map[address];
context->col_1 = (context->vdpmem[address] << 8) | context->vdpmem[address+1];