Use psx-gpu to initialize the display, send drawing commands and manage framebuffers. A minimal frame clears the back buffer, emits primitives, waits for drawing and VBlank, then swaps buffers.
How the crate is organized
Gpu is the handle for the GPU: it takes the GPU's DMA token from psx_rt::Peripherals, so one owner at a time drives GP0, and the drawing, draw-area and synchronization methods hang off it. display holds DisplayConfig, the video mode and resolution, and DoubleBuffer, whose methods take the Gpu to clear and swap the two framebuffers. prim describes primitive packets, ot builds depth-ordered DMA lists and frame wraps one frame of them (OtFrame, PrimitiveArena, FrameStorage) so the borrow checker tracks packet lifetimes. ordered preserves the caller's command order in a bounded command stream, and chain builds static DMA chains. material groups texture page, CLUT, tint and blend state. The older free functions and framebuf::FrameBuffer remain only as deprecated forwarders.
Integration notes
Choose how to submit commands. An ordering table is useful when geometry needs depth ordering; an ordered stream suits commands already in painter order. DMA reads the command storage asynchronously, so keep it alive until completion. OrderedCommandStream uses caller-provided static storage and an explicit fence before reuse or separate VRAM work. Drawing completion and VBlank are different events: queued presentation waits for the frame's closing draw-done command.
Complete examples: triangle, ordering table, queued presentation and the VBlank-kicked present queue.
API, dependencies and source structure
SDK revision f2fec1c301f1. Structure, dependencies and features below come from this revision.
The PS1 reference includes all Cargo features. The manifest below shows which features are enabled by default.
Dependencies
bitflags(shared repository crate): all targetspsx-hw(shared repository crate): all targetspsx-io: all targets
Cargo features
This crate declares no Cargo features.
Read the complete manifest and feature comments.
Source layout
The list includes internal implementation and test files. Public modules, types, functions and their signatures are indexed in the API reference above.
14 source and manifest files
Cargo.tomlsrc/chain.rs: The raw linked-list layer: DMA channel 2 walking a chain of GP0 nodes.src/compat.rs: Free functions from beforecrate::Gpu, kept for one stage so gamessrc/display.rs: What the GPU shows: video standard, resolution, and where the picturesrc/frame.rs: Borrow-checked frame building over an ordering table.src/framebuf.rs: The pre-Gpudouble buffer, kept for one stage: usesrc/gpu.rs: The GPU driver.src/lib.rs: The PS1 GPU: a driver that owns it, the packets it draws, and safesrc/material.rs: PS1 texture material state.src/ordered.rs: Painter-order command streaming with bounded GPU DMA nodes.src/ot.rs: Ordering Table: depth-sorted linked-list of GPU primitives.src/prim.rs: Primitive packet types for DMA-based GPU submission.tests/fixtures/ordered_frame.rstests/ordered.rs: Behavioral ordered-stream tests with delayed fake DMA consumption.