@tmustier/pi-nes 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +6 -2
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -23,7 +23,8 @@ pi-nes/
|
|
|
23
23
|
├── saves.ts # SRAM persistence
|
|
24
24
|
└── native/
|
|
25
25
|
├── nes-core/ # Rust NES emulator addon (required)
|
|
26
|
-
│ ├── Cargo.toml # Dependencies: nes_rust, napi
|
|
26
|
+
│ ├── Cargo.toml # Dependencies: vendored nes_rust, napi
|
|
27
|
+
│ ├── vendor/nes_rust/ # Patched nes_rust crate (SRAM helpers)
|
|
27
28
|
│ ├── src/lib.rs # Exposes NativeNes class via napi-rs
|
|
28
29
|
│ └── index.node # Compiled binary
|
|
29
30
|
└── kitty-shm/ # Rust shared memory addon (optional)
|
|
@@ -33,7 +34,7 @@ pi-nes/
|
|
|
33
34
|
|
|
34
35
|
### Native Core
|
|
35
36
|
|
|
36
|
-
The emulator uses the [`nes_rust`](https://crates.io/crates/nes_rust) crate with [napi-rs](https://napi.rs) bindings.
|
|
37
|
+
The emulator uses the [`nes_rust`](https://crates.io/crates/nes_rust) crate (vendored + patched in `native/nes-core/vendor/nes_rust` for SRAM helpers) with [napi-rs](https://napi.rs) bindings.
|
|
37
38
|
|
|
38
39
|
**API exposed to JavaScript:**
|
|
39
40
|
- `new NativeNes()` - Create emulator instance
|
|
@@ -41,6 +42,9 @@ The emulator uses the [`nes_rust`](https://crates.io/crates/nes_rust) crate with
|
|
|
41
42
|
- `bootup()` / `reset()` - Start/restart emulation
|
|
42
43
|
- `stepFrame()` - Advance one frame (~60fps)
|
|
43
44
|
- `pressButton(n)` / `releaseButton(n)` - Controller input (0=select, 1=start, 2=A, 3=B, 4-7=dpad)
|
|
45
|
+
- `hasBatteryBackedRam()` - Whether the ROM supports battery SRAM
|
|
46
|
+
- `getSram()` / `setSram(Uint8Array)` - Read/write SRAM
|
|
47
|
+
- `isSramDirty()` / `markSramSaved()` - Dirty tracking for SRAM persistence
|
|
44
48
|
- `getFramebuffer()` - Returns RGB pixel data (256×240×3 bytes, zero-copy via external buffer)
|
|
45
49
|
|
|
46
50
|
### Rendering Pipeline
|