Skip to main content

Module gsu

Module gsu 

Source
Expand description

The GSU (Argonaut RISC) — the Super FX coprocessor core.

The GSU is a 16-bit RISC engine that runs a program out of the Game Pak ROM (or RAM) and plots into a bitmap held in the Game Pak RAM. It powers Star Fox, Stunt Race FX, Vortex (GSU-1, ~10.74 MHz) and Yoshi’s Island, Doom (GSU-2, ~21.47 MHz). Unlike the NEC DSP family there is no chip-ROM dump — the GSU’s program lives in the cartridge ROM the user already owns, so the core is functional the moment a Super FX cart loads (docs/cart.md).

This is a clean-room re-implementation of ares’ GSU + SuperFX components (ISC) in safe no_std Rust. The instruction encoding, the ALT-prefix mode machine, the pixel-plot pipeline, the 256-byte/32-line opcode cache, and the ROM/RAM buffer latency are hardware facts; the decode here mirrors the published Super FX instruction set, not ares’ source layout.

§Host-synchronization model (no free-running scheduler tick)

The GSU is started by the SNES CPU writing the high byte of R15 (the program counter) at $301F, which sets the Go flag and begins execution at (PBR:R15). The chip then runs autonomously until it executes STOP, which clears Go and (optionally) raises the cart IRQ. Software polls the status flag register (SFR, $3030/$3031) for Go to clear. Because Go is the only observable coupling between the two clocks — exactly the RQM role the DSP-1 uses — the board runs the GSU to completion the instant Go is set (Gsu::run_until_stopped), capped against a runaway program. This keeps the bus boundary byte-exact and fully deterministic (docs/adr/0004) without a per-master-clock core hook, mirroring the DSP-1 run_until_rqm pattern. While Go is set the GSU owns the shared ROM/RAM (the CPU sees the snooze vector / open bus — see crate::coproc::superfx); run-to-completion serialises that arbitration naturally.

Structs§

Gsu
The Super FX GSU core — registers, status, caches, and the ROM/RAM buffer latches.
GsuMem
The Game Pak ROM/RAM the GSU reads and plots into, with the GSU-internal 24-bit decode.