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

take_queued_display_control

Function take_queued_display_control 

Source
pub fn take_queued_display_control() -> u32
Expand description

Empty the queue and hand back the word the handler has not applied, so the caller can write it to GP1 itself. Returns 0 when nothing was queued.

The handler only applies its word at a blank edge on which GPUSTAT bit 24 is set (see queue_display_control_at_vblank), so a long enough frame, or one that never sends GP0(1Fh), leaves it queued indefinitely. A caller that has given up waiting must take the word rather than leave it: the next queue_display_control_at_vblank overwrites the slot, and a display start that never reaches the GPU desynchronises the display side from the draw side for the rest of the session.

Racing the handler is harmless. If the IRQ lands between the read and the clear, the handler applies the word and the caller writes the same value again; GP1(05h) is idempotent.