From 9b813f2a0eb8626f84489de0f55dc6da2ed22420 Mon Sep 17 00:00:00 2001 From: user Date: Sat, 18 Jul 2026 21:50:22 +0200 Subject: term: SCY ring-scroll - scroll writes ONE map row; OSK toggle is 212 cycles The BG map's 32 rows become a ring: logical row L always lives at map row (wMapTop + L) & 31, and SCY = (wMapTop + wViewTop)*8 places the view. Scrolling bumps wMapTop, rebuilds the one new bottom line and writes its single map row (map_row_one); the other 17 rows move for free. The whole OSK view dance - shift the cursor above the keys, restore the backlog on hide - is now term_view_update: one SCY write, no map rewrite at all. OSK safety: the keyboard lives on the WINDOW layer, which SCY never moves. Stale ring rows can only appear under it: wViewTop = max(0, wCurRow-14) <= 3 is nonzero only while the OSK is visible, and the window covers exactly those bottom 3 rows (WX=7, WY=120). Verified: scroll + view shift + scroll-while-OSK-up + backlog restore all pixel-correct via VRAM screenshots; full README demo passes. term_scroll: 78.5k -> 35.6k T-cycles (857k pre-optimization: 24x). OSK toggle: 45k tilemap rewrite -> 212 cycles. Regenerated demo/gbos-demo.gif on the new renderer. --- demo/gbos-demo.gif | Bin 511818 -> 350160 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'demo/gbos-demo.gif') diff --git a/demo/gbos-demo.gif b/demo/gbos-demo.gif index 0e000a2..754477d 100644 Binary files a/demo/gbos-demo.gif and b/demo/gbos-demo.gif differ -- cgit v1.3.1-sl0p