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

Module diag

Module diag 

Source
Expand description

Console stop-panel: what a program was doing when it stopped, on screen.

Built only with the console-diag feature, for diagnostic discs; a shipping image does not contain any of it. Three things bring the panel up:

  • a fault: the exception handler reached its halt (a BREAK from panic=immediate-abort, an instruction-side fault, a fault in a delay slot);
  • a panic with a message (builds without panic=immediate-abort);
  • a stall: the VBlank handler saw no sign of life for STALL_VBLANKS frames (no GP1 write, no GPU DMA kick, no CD sector or command), which is how a bounded or unbounded wait that never ends looks.

The panel takes over the display (it resets the GPU and shows its own 320x240 screen), then prints the program counter, return address and stack of the interrupted code, a guess at the call chain, the GPU, DMA and interrupt registers, the SDK’s wait and CD counters (psx_io::diag) and any panic message, and keeps refreshing the frame counters so a photo shows the machine is alive but the program is not.

Resolve the printed addresses against the link map of the same build.

Constants§

STALL_VBLANKS
VBlanks without progress before the stall panel appears (15 seconds at 60 Hz).

Functions§

menu_countdown
Draw AUTO START IN nn S on menu row row.
menu_entry
Draw a menu line of 53 columns on row row: marker, a space, letter, two spaces, then title. color 0 white, 1 yellow, 2 green, 3 red, 4 cyan. A letter of 0 draws title alone. Polled GP0 fills only, so it works before any driver is set up.
menu_screen
Boot-menu helper for diagnostic discs: reset the GPU (nothing may be in flight) and show a clear 320x240 screen for menu_entry and menu_countdown. Call it before the first entry, with no DMA running.
set_stall_limit
Change how many VBlanks without progress bring the stall panel up. A program with long steps that are legitimately silent (no GP1 write, GPU DMA kick or CD command for tens of seconds) raises it so the panel does not take the screen in the middle of a measurement; faults and panics are unaffected.