Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

is_draw_done

Function is_draw_done 

Source
pub fn is_draw_done() -> bool
Expand description

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.

This is the completion test psx-rt’s queued display flip (psx_rt::interrupts::queue_display_control_at_vblank) applies at each VBlank edge. GP0(1Fh) raises GPUSTAT bit 24 only when the GPU reaches it in its command stream, after the drawing before it; the flag stays set until GP1(02h). The v1.24 present-queue probe flipped on this flag with 120 of 120 frames complete on a console. End a DMA chain with it through ot::OrderingTable::end_with_draw_done or chain::DRAW_DONE_NODE, an ordered stream with push_packet([gp0::REQUEST_IRQ]), and immediate drawing with Gpu::signal_draw_done.

Arm the flag right before kicking a frame whose last command is GP0(1Fh), and only once the previous frame’s queued flip has been applied: acknowledging earlier hides the previous frame’s completion from psx-rt’s VBlank handler.

GP0(1Fh) also raises interrupt source 1 (GPU) in I_STAT; keep it masked in I_MASK, since psx-rt’s handler does not acknowledge it.

It only reads GPUSTAT, so it needs no Gpu.