changeset 1136:52f25c41abdd

Fix horizontal scrolling in Mode 4
author Michael Pavone <pavone@retrodev.com>
date Sun, 01 Jan 2017 22:47:23 -0800
parents 8506b305e0e8
children 9e0f2ea4a0fc
files vdp.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/vdp.c	Sun Jan 01 21:06:32 2017 -0800
+++ b/vdp.c	Sun Jan 01 22:47:23 2017 -0800
@@ -983,7 +983,7 @@
 	}
 	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];