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). --- src/hram.asm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/hram.asm') diff --git a/src/hram.asm b/src/hram.asm index 9e65982..facccd0 100644 --- a/src/hram.asm +++ b/src/hram.asm @@ -17,6 +17,10 @@ SECTION "hram_vars", HRAM hCurBankRAM: DS 1 ; shadow of active cart-RAM bank hCurBankWRAM: DS 1 ; shadow of active SVBK bank hSwitchTgt: DS 2 ; &incoming PCB (set before the pushes clobber DE) +hSCY:: DS 1 ; VBlank-latched SCY: term_view_update writes this, + ; the VBlank ISR applies it - a mid-frame SCY write + ; would shear the picture (SCY is sampled per + ; scanline), so ring-scrolls land at frame boundaries ; ----------------------------------------------------------------------------- ; Source image (lives in ROM0); CopyHramCode blits it to HRAM at boot. -- cgit v1.3.1-sl0p