mirror of
https://github.com/imjasonh/nescript
synced 2026-07-08 17:06:04 +00:00
runtime: reset PPU scroll after VRAM buffer drain
Each $2006 write inside __vram_buf_drain updates the PPU's `t` (scroll) register, so leaving it pointing at the last buffer entry's address shifted the next frame's rendering up/right by however many cells we wrote past $2000. Reset by writing $00 to $2006 twice (clears `t` and resets the write-toggle to high) followed by $00 to $2005 twice (zero X/Y scroll). The HUD demo golden flips from "smileys offset by ~16px" to the intended red bar with white hearts and a yellow score digit. https://claude.ai/code/session_01F7dHsgh7UX7SAK3wZ7JiKc
This commit is contained in:
parent
a806bfd3bd
commit
1c00d20121
5 changed files with 16 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue