mirror of
https://github.com/imjasonh/nescript
synced 2026-07-15 04:35:37 +00:00
Add example builds to CI, document sprite name behavior
- CI: new "Build Examples" job compiles all .ne files and validates the output ROMs have correct iNES headers - Examples: add notes explaining that sprite names (Smiley, Ball) are parsed but not yet resolved — all draws use the built-in CHR tile 0. Custom sprite declarations come in M3. - Codegen: explicit `let _ = &draw.sprite_name` to document the intentional skip, with comment about M2/M3 scope https://claude.ai/code/session_01W6eQFStA66EuMKHUFo2rx3
This commit is contained in:
parent
a20ddcbbab
commit
fd5a940c89
5 changed files with 51 additions and 4 deletions
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
|
|
@ -49,3 +49,31 @@ jobs:
|
|||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo test --all-targets
|
||||
|
||||
examples:
|
||||
name: Build Examples
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo build --release
|
||||
- name: Compile all .ne examples
|
||||
run: |
|
||||
for f in examples/*.ne; do
|
||||
echo "==> Compiling $f"
|
||||
cargo run --release -- build "$f"
|
||||
done
|
||||
- name: Verify ROMs are valid iNES
|
||||
run: |
|
||||
for f in examples/*.nes; do
|
||||
echo "==> Checking $f"
|
||||
# iNES magic: first 4 bytes must be "NES\x1a"
|
||||
header=$(od -A n -t x1 -N 4 "$f" | tr -d ' ')
|
||||
if [ "$header" != "4e45531a" ]; then
|
||||
echo "FAIL: $f is not a valid iNES ROM (header: $header)"
|
||||
exit 1
|
||||
fi
|
||||
size=$(stat -c%s "$f")
|
||||
echo " OK: $size bytes"
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue