shithub: sms

Download patch

ref: 80af738289152b503fa3547a9e40b5b56cfb353b
parent: c577d6b9c1d345bd0cf4adf3a1c1b68d1baf88ae
author: Jean-André Santoni <jean.andre.santoni@gmail.com>
date: Tue Jan 13 14:46:33 EST 2026

Implement window scroll lock

--- a/vdp.c
+++ b/vdp.c
@@ -64,7 +64,8 @@
 	int ty = y >> 3;
 	int tyoff = y & 7;
 
-	u8int x = vdpx - scrollx;
+	u8int hscr = ((reg[MODE1] & 1 << 6) && vdpy < 16) ? 0 : scrollx;
+	u8int x = vdpx - hscr;
 	int tx = x >> 3;
 	int txoff = x & 7;
 
--