1
0
Fork 0
mirror of https://github.com/imjasonh/nescript synced 2026-07-08 08:55:38 +00:00
nescript/docs
Claude c5b04c2065
platformer: move HUD from sprite OAM slots to background + sprite-0 split
The status bar now paints into NT row 1 (coin + score digits on
the left, heart + lives digit on the right) using the `bg3`
sub-palette that matches `sp0` pixel-for-pixel. A single OAM
slot-0 anchor sprite sits over the coin tile; its one opaque
pixel lines up with the coin's bottom row so sprite-0 hit fires
at scanline 15, and a trailing `sprite_0_split(camera_x, 0)`
latches the playfield scroll starting at scanline 16. NT rows
0-1 stay pinned while scanlines 16+ scroll with the camera.

Score / lives updates are shadow-compared (`last_score`,
`last_lives`) so the VRAM ring sees an entry only when the
backing state actually changes — most frames append zero bytes.
OAM footprint drops from 5 sprites per frame down to 1.

Tile pipeline gains a 27th entry — a 7-transparent-row + 1-pixel
anchor — so the sprite-0 hit lands on scanline 15 instead of
scanline 8 (the latter would smear the HUD glyphs across the
split). `gen_platformer_tiles.rs` is updated in lockstep.

Ancillary changes: `bg3` retuned from `[yellow, orange,
dk_orange]` to `[red, orange, white]` (matching `sp0`);
`palette_map` row 0 flips from bg0 to bg3; legend gains `o`, `h`,
`0`, `3` so the initial map can preload the static HUD tiles and
the committed nametable already reads "coin 00 ... heart 3" on
frame 0.

`docs/future-work.md` loses the sprite-0 HUD follow-up section
(this commit lands it). Goldens + gif refreshed.
2026-04-20 17:21:20 +00:00
..
architecture.md linker: add ca65-compatible --dbg output for source-level debugging 2026-04-16 22:39:08 +00:00
future-work.md platformer: move HUD from sprite OAM slots to background + sprite-0 split 2026-04-20 17:21:20 +00:00
language-guide.md docs + example: HUD demo and language-guide VRAM buffer section 2026-04-18 21:34:44 +00:00
nes-reference.md compiler: i16 / SRAM saves / inline-asm dot labels / docs 2026-04-18 20:49:06 +00:00
platformer.gif platformer: move HUD from sprite OAM slots to background + sprite-0 split 2026-04-20 17:21:20 +00:00
pong.gif codegen: fuse compare-then-branch to drop boolean materialization 2026-04-16 17:10:02 +00:00
war.gif examples: regenerate ROMs, gifs, and goldens after codegen local fix 2026-04-16 16:12:46 +00:00