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_curandBlock::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::magicby 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_sectorfailed;wordis 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;
infois the reader’s snapshot word. - dma_
kick - A
dma::starton channelch(0 to 6). - flush_
enter - An instruction-cache flush has the bus quiet and is about to change the cache: record what it
found.
chcrare 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
pcis 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
jtarget ispc(top four bits ofpctaken from the jump’s own address region):0x08000000 | pc >> 2in its 26-bit field. A CPU that jumped to a wildpcfetched 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:
idand up to 24 ASCII bytes oftext. - step_
hex stepwith 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.
auxis a small extra id (a channel, an expected flag). - wait_
end - The wait that
wait_beginopened ended normally. - wait_
timeout - The wait that
wait_beginopened spun out afterspinspolls.