|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +## Cursor Cloud specific instructions |
| 4 | + |
| 5 | +### Project Overview |
| 6 | + |
| 7 | +SRES is a SNES emulator in Rust. See `CLAUDE.md` for full architecture and command reference. |
| 8 | + |
| 9 | +### Services |
| 10 | + |
| 11 | +| Component | Description | How to run | |
| 12 | +|---|---|---| |
| 13 | +| **sres_emulator** | Core emulation library | Library crate, no standalone process | |
| 14 | +| **sres_egui (native)** | Desktop GUI (eframe/egui) | `cargo run` (or `cargo run -- rom.sfc`) | |
| 15 | +| **sres_egui (WASM)** | Web build via Trunk | `cd sres_egui && trunk serve` (port 8080) | |
| 16 | + |
| 17 | +No external services (databases, Docker, etc.) are required. |
| 18 | + |
| 19 | +### Common commands |
| 20 | + |
| 21 | +All standard build/test/lint commands are documented in `CLAUDE.md`. Key ones: |
| 22 | + |
| 23 | +- **Build**: `cargo build` |
| 24 | +- **Run**: `DISPLAY=:1 cargo run` (headless VM needs `DISPLAY=:1`) |
| 25 | +- **Lint**: `cargo clippy --workspace` |
| 26 | +- **Format check**: `cargo fmt --check` |
| 27 | +- **Tests**: `cargo nextest run --workspace` (or `cargo test`) |
| 28 | +- **Full check**: `./check-all.sh` |
| 29 | +- **Auto-fix**: `./fix-all.sh` |
| 30 | + |
| 31 | +### Non-obvious caveats |
| 32 | + |
| 33 | +- **Nightly toolchain required**: The project uses `build-std` (rebuilds stdlib from source), which requires the nightly channel specified in `rust-toolchain.toml`. The `rust-src` component must be installed. |
| 34 | +- **`DISPLAY=:1`**: When running the GUI in a headless Cloud Agent VM, set `DISPLAY=:1` so eframe can connect to the X11 server. |
| 35 | +- **`libxkbcommon-x11`**: The eframe/egui native build requires `libxkbcommon-x11-0` at runtime. If the emulator panics with "Library libxkbcommon-x11.so could not be loaded", install it: `sudo apt-get install -y libxkbcommon-x11-0`. |
| 36 | +- **Git LFS**: Test ROMs (`.sfc`), trace logs (`.xz`), and reference images (`.png`) are stored in Git LFS. If LFS objects are unavailable (404 on the server), ROM-based integration tests will still pass using assembled test ROMs (via `xa65`), but some tests may be skipped. |
| 37 | +- **`xa65` assembler**: Required by some test ROM assembly. Installed via `sudo apt-get install -y xa65`. |
| 38 | +- **`cargo-nextest`**: The preferred test runner. Install via `curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-$HOME/.cargo}/bin`. |
0 commit comments