changeset 31:25016576b5f3

Make horizontal scrolling closer to correct, Comix Zone looks good, Sonic 2 slightly off
author Mike Pavone <pavone@retrodev.com>
date Sat, 08 Dec 2012 20:25:56 -0800
parents 03f9bb57cc54
children 8602ad493794
files vdp.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/vdp.c	Sat Dec 08 20:02:10 2012 -0800
+++ b/vdp.c	Sat Dec 08 20:25:56 2012 -0800
@@ -180,7 +180,7 @@
 	}
 	uint16_t hscroll, offset;
 	for (int i = 0; i < 2; i++) {
-		hscroll = (hscroll_val + (column + i) * 8) & hscroll_mask;
+		hscroll = ((column - 2 + i) * 8 - hscroll_val) & hscroll_mask;
 		offset = address + ((vscroll * v_mul + hscroll/4) & 0x1FFF);
 		//printf("%s | line: %d, col: %d, x: %d, hs_mask %X, v_mul: %d, scr reg: %X, tbl addr: %X\n", (vsram_off ? "B" : "A"), line, (column-(2-i)), hscroll, hscroll_mask, v_mul, context->regs[REG_SCROLL], offset);
 		uint16_t col_val = (context->vdpmem[offset] << 8) | context->vdpmem[offset+1];