diff --git a/README.md b/README.md index 6c21c96..39a60fc 100644 --- a/README.md +++ b/README.md @@ -42,14 +42,18 @@ start Main ## Features - **Game-aware syntax** -- states, sprites, palettes, and input are first-class constructs -- **Full type system** -- `u8`, `i8`, `u16`, `bool`, fixed-size arrays (`u8[N]`) +- **Full type system** -- `u8`, `i8`, `u16`, `bool`, fixed-size arrays (`u8[N]`), `enum`, `struct` +- **Rich control flow** -- `if`/`else`, `while`, `for i in 0..N`, `loop`, `match` - **Functions** -- with parameters, return types, `inline` hint, recursion detection -- **State machines** -- `state` with `on enter`, `on exit`, `on frame` handlers -- **Compile-time safety** -- call depth limits, recursion detection, type checking -- **Optimizer** -- constant folding, dead code elimination, strength reduction -- **Multiple mappers** -- NROM, MMC1, UxROM, MMC3 +- **State machines** -- `state` with `on enter`, `on exit`, `on frame`, `on scanline(N)` handlers +- **Compile-time safety** -- call depth limits, recursion detection, type checking, unused-var warnings +- **IR-based optimizer** -- constant folding, dead code elimination, strength reduction, copy propagation, peephole passes +- **Multiple mappers** -- NROM, MMC1, UxROM, MMC3 (including scanline IRQ dispatch) - **Asset pipeline** -- PNG-to-CHR conversion, palette definitions, inline tile data -- **Debug support** -- `--debug` flag, source maps, Mesen-compatible symbol export +- **Inline assembly** -- `asm { ... }` with `{var}` substitution, plus `raw asm { ... }` for verbatim blocks +- **Hardware intrinsics** -- `poke(addr, value)` / `peek(addr)` for direct register access +- **Debug support** -- `--debug` flag, source maps, Mesen-compatible symbol export, `debug.log` / `debug.assert` +- **Compile-time diagnostics** -- `--dump-ir`, `--memory-map`, `--call-graph` flags - **Single binary** -- no dependencies on ca65, Python, or any external tools ## Documentation @@ -70,6 +74,8 @@ start Main | [`state_machine.ne`](examples/state_machine.ne) | State transitions, on enter/exit, timers | | [`sprites_and_palettes.ne`](examples/sprites_and_palettes.ne) | Inline CHR data, palettes, scroll, type casting | | [`mmc1_banked.ne`](examples/mmc1_banked.ne) | MMC1 mapper, bank declarations, multiply | +| [`structs_enums_for.ne`](examples/structs_enums_for.ne) | Structs, enums, `for` loops, struct literals | +| [`inline_asm_demo.ne`](examples/inline_asm_demo.ne) | Inline asm with `{var}` substitution, `poke`/`peek` | ## Compiler Commands