From bea52bc8f99ee6dbcc8154a366560fc18e7b24c8 Mon Sep 17 00:00:00 2001 From: user Date: Sat, 18 Jul 2026 21:56:21 +0200 Subject: term: latch SCY in VBlank - fix ring-scroll shear on live displays The ring-scroll wrote SCY mid-frame; SCY is sampled per scanline (on hardware and in sl0pboy's PPU), so a scroll landing mid-frame rendered the top of the frame at the old offset and the bottom at the new one - a one-frame shear, invisible in frame-sampled GIF captures but ugly on a live sixel view. term_view_update now writes hSCY (HRAM) and a transparent VBlank ISR (push af / apply / pop af / reti, same profile as TimerISR) copies it to rSCY, so the view only ever moves at frame boundaries. The scroll's tile+map writes stay immediate: the new map row is invisible at the old SCY by construction (it's the ring row one past the visible 18). --- include/gbos.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/gbos.inc b/include/gbos.inc index be6009f..cbd2670 100644 --- a/include/gbos.inc +++ b/include/gbos.inc @@ -13,7 +13,8 @@ DEF rIE EQU $FFFF ; interrupt enable DEF rTIMA EQU $FF05 ; timer counter DEF rTMA EQU $FF06 ; timer modulo (reload) DEF rTAC EQU $FF07 ; timer control (bit2 = enable, bits1-0 = clock) -DEF IEF_TIMER EQU %00000100 +DEF IEF_TIMER EQU %00000100 +DEF IEF_VBLANK EQU %00000001 DEF rDIV EQU $FF04 ; divider register: free-running 8-bit @ 16384 Hz DEF rSVBK EQU $FF70 ; CGB WRAM bank select ($D000-$DFFF): 1..7 DEF wCurMask EQU $D589 ; term/osk: cursor underline bits OR'd into a tile's last row -- cgit v1.3.1-sl0p