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 diagnostics: the counters a stop-panel prints.

Built only with the console-diag feature. Without it every function here is an empty inline and the block does not exist, so a shipping image is byte-for-byte what it was. With it, the SDK’s own bounded waits, CD command writes, sector pops and DMA kicks leave their last state in one static block, [BLOCK], that psx_rt::diag reads when a program stops (a fault, a panic, or no progress for many frames) and paints on screen, so one photo of a console shows where it stopped.

Nothing here touches hardware; every store is a plain volatile word store to a private static, safe from the foreground and from the VBlank handler.

Modules§

site
Wait sites recorded in Block::wait_cur and Block::wait_last.

Structs§

Block
The diagnostics block. Every field is a plain word; the panel reads them with volatile loads.

Constants§

MAGIC
Written to Block::magic by the first hook.

Statics§

PSX_DIAG
The block. Read it with volatile loads.

Functions§

cd_command
A CD command byte was written.
cd_error
The drive answered a command with INT5.
cd_irq_acked
CD IRQ bits were acknowledged.
cd_irq_seen
A non-zero CD IRQ flag was read.
cd_read_failed
read_sector failed; word is the reader’s snapshot.
cd_sector
One sector was popped from the data FIFO.
cd_start
A read was started at absolute lba.
cd_timeout
A CD wait spun out; info is the reader’s snapshot word.
dma_kick
A dma::start on channel ch (0 to 6).
flush_enter
An instruction-cache flush has the bus quiet and is about to change the cache: record what it found. chcr are the seven DMA control registers, in channel order.
flush_exit
An instruction-cache flush’s gate has finished: whether a channel was busy on entry, how many times it backed out, the busy polls it made, and whether its bound ran out.
get⚠
A raw read of one word of the block, for the panel.
gp1_write
A write to GP1.
is_wild_pc
True when pc is not an address code can run from: main RAM through KSEG0 or KSEG1 (the kernel area included), or the BIOS ROM. A jump into anything else went somewhere wild.
jump_word_for
The instruction word whose j target is pc (top four bits of pc taken from the jump’s own address region): 0x08000000 | pc >> 2 in its 26-bit field. A CPU that jumped to a wild pc fetched such a word from somewhere; if the word reads as a GPU list header, the fetch got DMA traffic.
ll_scan
Walk the GPU linked list that starts at head (a physical or KSEG address) and record every node over 16 payload words. The walk is bounded and stays inside main RAM.
step
Name the step the program has reached, for the panel: id and up to 24 ASCII bytes of text.
step_hex
step with a tag and two numbers printed as hex: "<tag> <a:8 hex> <b:8 hex>", the tag cut to 6 bytes, so a failure site can say which file/chunk and which result in 24 bytes.
stop
Stop here on purpose: execute BREAK so the console-diag exception handler takes the screen and shows the panel (with the last step) instead of the program going on.
wait_begin
A wait begins. aux is a small extra id (a channel, an expected flag).
wait_end
The wait that wait_begin opened ended normally.
wait_timeout
The wait that wait_begin opened spun out after spins polls.