From 36a169a1c807db81bdf38243c14e74e00f2e54be Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sun, 1 Jan 2017 22:47:23 -0800 Subject: Fix horizontal scrolling in Mode 4 --- vdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vdp.c') 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]; -- cgit v1.2.3