N64Recomp/RSPRecomp
Matthew Stanley 4d594da0b9 RSPRecomp: pre-task hook + richer watchdog state dump
Two related changes for diagnosing hung RSP ucodes:

1. Per-ucode pre-task hook. The legacy wrapper now calls
   recomp::rsp::run_pre_task_hook(rdram, &persistent_ctx,
   ucode_name, ucode_addr) before invoking impl. Lets games
   register hook callbacks keyed by ucode name to replicate
   parts of rspboot's setup that the static recompilation can't
   infer (initial GPRs, DMA-engine residue, pre-loaded command
   data in DMEM). No-op when no hook is registered (one branch).

   Used this session to unstick Stadium's aspMain dispatch by
   pre-loading audio commands at DMEM[0x2B0] and seeding $29 =
   0x2B0, $30 = chunk_size. Confirmed via watchdog trail: the
   dispatch now lands on real handlers (r26 = first audio cmd
   word 0x020004E0, r28/r27/r30 advance through one command)
   instead of looping on dispatch-table residue.

2. Watchdog trip dump now includes r1, r2, r3, r25, r26, r27,
   r28, r29, r30, r31, jump_target, dma_mem_address,
   dma_dram_address. Earlier dump (r1/r28/r29/r31 only) was too
   sparse to localize the next blocker — Stadium's hang now
   occurs at L_11B4 ↔ L_10EC because r3 is uninit going into
   the dispatched handler (handler does `r3 -= 1` then DMAs,
   but no upstream path set r3 for the first command). Richer
   state lets future hangs in any consumer game be diagnosed
   without recompiling the recompiler each time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 21:21:19 -07:00
..
src RSPRecomp: pre-task hook + richer watchdog state dump 2026-05-05 21:21:19 -07:00