mirror of
https://github.com/imjasonh/nescript
synced 2026-07-08 00:45:38 +00:00
Parser extensions:
- sprite declarations with chr: @chr("file.png"), @binary("file.bin"), or inline [hex]
- palette declarations with colors: [0x0F, 0x00, 0x10, 0x20]
- background declarations with chr: asset source
- @chr/@binary asset source parsing
- load_background and set_palette statements
- --debug CLI flag (plumbed through, not yet wired to codegen)
Asset pipeline (new module):
- PNG → CHR tile conversion using image crate (8x8 tiles, 2-bitplane encoding)
- NES color palette table (all 64 standard NES colors as RGB)
- Nearest-color matching (Euclidean distance in RGB space)
Debug module (new):
- Source map (ROM address → source Span mapping)
- Debug symbols with variable address table
- Mesen-compatible .mlb label export
- .sym symbol table export
192 tests total (13 new: 5 parser + 3 asset + 5 debug)
https://claude.ai/code/session_01W6eQFStA66EuMKHUFo2rx3
7 lines
122 B
Rust
7 lines
122 B
Rust
mod chr;
|
|
mod palette;
|
|
#[cfg(test)]
|
|
mod tests;
|
|
|
|
pub use chr::png_to_chr;
|
|
pub use palette::{nearest_nes_color, NES_COLORS};
|