Expand description
The PS1 GPU: a driver that owns it, the packets it draws, and safe frame building over its linked-list DMA.
§Layers
Gpuowns GP0, GP1 and DMA channel 2 through theGpuDmatoken. Every port write is a method, so the borrow checker keeps immediate drawing out of a running walk.primholds the packets:repr(C)structs whose words are the GP0 wire format.Gpu::drawsends one now; anot::OrderingTableframe links many for one DMA walk.framebuilds frames with lifetimes instead ofunsafe: a packet added to anframe::OtFramestays borrowed until the walk that reads it has finished.orderedstreams packets in painter order over static storage.displaydescribes what the GPU shows;materialdescribes how textured packets sample and blend.- The raw layer,
chain::submit_async_rawand the*_uncheckedadds onframe::OtFrame, isunsafe: it hands the DMA controller addresses the type system cannot follow.
Register addresses and command-word encoders live in psx-hw, shared
with the emulator’s GPU, so the two cannot disagree on a layout.
Re-exports§
pub use chain::DrawDoneNode;pub use chain::StaticChain;pub use chain::StaticPacket;pub use chain::DRAW_DONE_NODE;pub use chain::MAX_NODE_WORDS;
Modules§
- chain
- The raw linked-list layer: DMA channel 2 walking a chain of GP0 nodes.
- display
- What the GPU shows: video standard, resolution, and where the picture sits in the TV signal.
- frame
- Borrow-checked frame building over an ordering table.
- framebuf
- The pre-
Gpudouble buffer, kept for one stage: usecrate::display::DoubleBuffer, whose methods take thecrate::Gputhey write to. - material
- PS1 texture material state.
- ordered
- Painter-order command streaming with bounded GPU DMA nodes.
- ot
- Ordering Table: depth-sorted linked-list of GPU primitives.
- prim
- Primitive packet types for DMA-based GPU submission.
Structs§
- Gpu
- The PS1 GPU: its command port (GP0), its control port (GP1) and DMA channel 2, which feeds GP0.
- Mask
Mode - GP0(E6h) mask-bit state.
- Recovery
Stats - How often the SDK recovered a hung GPU since boot, for a debug overlay or a test log. Every GPU wait is bounded and recovers by resetting the GPU; these counts make the recoveries visible.
Functions§
- arm_
draw_ done Deprecated - Clear GPUSTAT bit 24 with GP1(02h).
- draw_
line_ mono Deprecated - Draw a monochrome line.
- draw_
quad_ flat Deprecated - Draw a flat-shaded quad.
- draw_
quad_ textured Deprecated - Draw a textured quad with a single tint.
- draw_
quad_ textured_ gouraud_ material Deprecated - Draw a Gouraud-shaded textured quad using a
TextureMaterial. - draw_
quad_ textured_ material Deprecated - Draw a textured quad using a
TextureMaterial. - draw_
rect_ flat Deprecated - Fill an axis-aligned rectangle with a flat color, as a polygon.
- draw_
sprite_ material Deprecated - Draw a variable-size textured sprite using a
TextureMaterial. - draw_
sync Deprecated - Renamed to
Gpu::wait_idle. - draw_
tri_ flat Deprecated - Draw a flat-shaded triangle.
- draw_
tri_ flat_ blended Deprecated - Draw a semi-transparent flat-shaded triangle.
- draw_
tri_ gouraud Deprecated - Draw a Gouraud-shaded triangle.
- fill_
rect Deprecated - Fill a VRAM rectangle with a solid color.
- init
Deprecated - Initialise the GPU: reset, display mode, display window, DMA direction, display on.
- is_
draw_ done - True once the GPU has executed the GP0(1Fh) that closes the work kicked
after the last
Gpu::arm_draw_done, so everything before it is drawn. - recovery_
stats - The recovery counts since boot. Reads only, so it needs no
Gpu. - set_
draw_ area Deprecated - Set the drawing-area rectangle.
- set_
draw_ offset Deprecated - Set the drawing offset.
- signal_
draw_ done Deprecated - Send GP0(1Fh) through the command port.
- submit_
linked_ ⚠list_ async Deprecated - Old name of
submit_linked_list_async_raw. - submit_
linked_ ⚠list_ async_ raw Deprecated - Kick a linked-list chain without waiting for the walk.
- submit_
linked_ ⚠list_ raw Deprecated - Kick a linked-list chain and wait for the walk.
- submit_
linked_ ⚠list_ raw_ async Deprecated - Renamed to
submit_linked_list_async_raw. - submit_
linked_ list_ wait Deprecated - Wait until the linked-list walk kicked last has finished.
- vsync
Deprecated - Wait 242 HBlank periods (~15.4ms) from the moment of the call.
- wait_
idle Deprecated - Block until the GPU has finished drawing everything sent to it.
Type Aliases§
- Resolution
Deprecated - Moved to
display::Resolution. - Video
Mode Deprecated - Moved to
display::VideoMode.