feat(cartridge): add bounded terminal ROM loading

Load read-only raw ROM files with bounded size checks and original BIOS boot. Require a machine-step budget and report CPU state, STOP, and explicit diagnostics without opening a window. Keep file access in the desktop crate.

Cover argument parsing, Darwin paths, file boundaries, ARM/Thumb execution, DMA/IRQ budgets, HALT/STOP, and error reports. Document limits and usage. Verified on native Darwin arm64: debug/release workspace tests, core-only tests, Clippy, rustdoc, all ten window smoke tests, and a release raw-ROM run.
This commit is contained in:
0xrsydn 2026-10-05 18:57:16 +07:00
commit c256bf8ccd
13 changed files with 837 additions and 13 deletions

View file

@ -3,9 +3,10 @@
Game Boy family emulation in Rust, written from scratch.
The Game Boy Advance (GBA) is the first and currently only system.
**This cannot run Pokémon Emerald or other games yet.**
**This cannot run Pokémon Emerald or other commercial games yet.**
It is an emulator foundation: an ARM7TDMI interpreter, memory bus, timers, DMA, Mode 0–5 video, and an original BIOS replacement.
The included demos run original ARM test programs through the emulated hardware. ROM loading, audio, and saves are not implemented.
The included demos run original ARM test programs through the emulated hardware.
Raw ROM files can run in bounded terminal sessions. ROM windows, audio, and saves are not implemented.
## Layout
@ -26,7 +27,9 @@ direnv exec . cargo test --locked
```
Arrows scroll, Q rotates, W zooms, Z flips, X changes priority, Enter resets, and Escape exits.
Run `direnv exec . cargo run --locked -- --help` to list every demo and smoke test.
Run `direnv exec . cargo run --locked -- --help` to list all modes.
For original ROM files, use `--rom path/to/original.gba --steps 100000`.
See [cartridge loading](docs/hardware/cartridge.md) for limits and report meanings.
## Documentation
@ -38,6 +41,7 @@ Run `direnv exec . cargo run --locked -- --help` to list every demo and smoke te
| [docs/testing.md](docs/testing.md) | Validation commands and what the test suites cover |
| [docs/architecture.md](docs/architecture.md) | Crate boundaries and a file-by-file map |
| [docs/hardware/cpu.md](docs/hardware/cpu.md) | ARM/Thumb execution rules, modes, exceptions, and timing |
| [docs/hardware/cartridge.md](docs/hardware/cartridge.md) | Raw ROM loading, bounded terminal execution, and diagnostics |
| [docs/hardware/bios.md](docs/hardware/bios.md) | The original BIOS replacement and each supported service |
| [docs/hardware/timers-irq.md](docs/hardware/timers-irq.md) | Timers, interrupt registers, HALT/STOP, and power control |
| [docs/hardware/dma.md](docs/hardware/dma.md) | DMA channels, triggers, and timing |