mirror of
https://github.com/imjasonh/nescript
synced 2026-07-08 08:55:38 +00:00
End-of-implementation polish for the War example after the compiler bugs were fixed: - Title state now calls draw_big_war_banner instead of inlining 12 draws — same pixel output, fewer lines. - P_WAR_BURY redraws the previous round's face-up cards while the noise thumps fire so the table doesn't look empty for 24 frames between the WAR banner and the new face-ups. - Drop draw_word_war from render.ne (orphaned by the BIG WAR metasprite). - Refresh comments in background.ne (now references the real felt tile) and deal_state.ne (drop the stale FRAMES_DEAL_STEP reference now that the deal pace is hard-coded at 2 frames). - README.md and examples/README.md gain a war row. - PLAN.md marks every implementation step complete and records the design revisions made along the way. - Refresh the war audio hash to match the new ROM (the title screen helper change shifts one frame of pulse-2 timing enough to flip the FNV-1a). The frame-180 PNG is unchanged. https://claude.ai/code/session_0143dTgh3UeRrtfHgQwzcv5z
54 lines
2.3 KiB
Text
54 lines
2.3 KiB
Text
// war/background.ne — the static 32×30 nametable loaded at reset.
|
||
//
|
||
// NEScript loads the *first* declared `background` into nametable 0
|
||
// before rendering is enabled, so whatever this file declares is
|
||
// visible on frame 0 of the ROM. We use a single felt-table
|
||
// background — every cell is the dedicated TILE_FELT_BG (tile 75
|
||
// in the Tileset sprite, a sparse cross-hatch authored to look
|
||
// like dk_green felt with mint flecks when rendered through bg
|
||
// sub-palette 0). All UI (title banner, "PRESS A", win banners,
|
||
// face-up cards, etc.) is drawn on top via sprites so we never
|
||
// pay the cost of a full mid-frame nametable swap.
|
||
//
|
||
// The `palette_map:` field is omitted on purpose: every attribute
|
||
// byte defaults to 0, which selects bg sub-palette 0 for every
|
||
// metatile. That's the felt palette declared in the top-level
|
||
// war.ne (forest / green / mint over a dk_green universal).
|
||
|
||
background Felt {
|
||
legend {
|
||
".": 75 // TILE_FELT_BG — sparse mint flecks on dk_green
|
||
}
|
||
map: [
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................",
|
||
"................................"
|
||
]
|
||
}
|