# HG changeset patch # User Michael Pavone # Date 1483339643 28800 # Node ID 52f25c41abddda8e878bbf3a7b8fccac23f222c1 # Parent 8506b305e0e83ddbdae3cbf8d9c2c42d22ca533d Fix horizontal scrolling in Mode 4 diff -r 8506b305e0e8 -r 52f25c41abdd vdp.c --- 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];