Files
psxrecomp/generated/indirect_jump_classes.json
T
Matthew Stanley fba58d76b3 Phase 4 interrupt fixes: RFE, GPR save/restore, DMA IRQ edge-trigger
Three interrupt delivery bugs fixed that were blocking shell progression:

1. RFE after handler exit: The exception handler's normal exit path
   (jmpbuf longjmp at 0xBFC10944) does not execute RFE. In our model
   the handler returns to psx_check_interrupts, not to the WaitEvent
   caller. Without RFE, IEc stays 0 forever after the first interrupt.
   Fix: apply RFE in psx_check_interrupts if IEc is still 0 after the
   handler returns.

2. GPR save/restore around handler dispatch: The handler's jmpbuf exit
   restores callee-saved registers from the kernel jmpbuf (intended for
   a non-local jump to WaitEvent's caller). In our model this corrupts
   the interrupted code's registers. Fix: save all GPRs before handler
   dispatch and restore them after, matching real hardware where the
   interrupted code's registers are preserved via TCB save/restore.

3. VBlank tick gated on !in_exception: The handler runs thousands of
   block leaders, each calling psx_check_interrupts. Without gating,
   dispatch_count advances inside the handler, firing new VBlanks that
   stack up and starve the main code. Fix: only increment dispatch_count
   and fire VBlank/timer ticks when not in exception handling.

4. DMA IRQ edge-triggered: update_master_irq() was level-triggered,
   re-asserting i_stat bit 3 on every call while master_flag=1. Combined
   with no BIOS callback to acknowledge DMA IRQs, this caused an
   interrupt storm. Fix: edge-detect master_flag 0->1 transition, and
   suppress DMA completion IRQs entirely since transfers are synchronous.

Also adds GPU debug diagnostics: GP0 command counters (nop/fill/draw/
env/copy), draw area/offset in gpu_state, vram_peek debug command.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:29:03 -07:00

23 lines
3.0 KiB
JSON

{
"schema": "psxrecomp-v4 phase1d indirect_jump_classes v1",
"total_sites": 196,
"classes": {
"a0_b0_c0_dispatch": {
"count": 77,
"sites": ["0xBFC0D884", "0xBFC0D894", "0xBFC0D8A4", "0xBFC0D8B4", "0xBFC0D8D4", "0xBFC0D954", "0xBFC0D974", "0xBFC0D984", "0xBFC0D994", "0xBFC0D9A4", "0xBFC0D9B4", "0xBFC0D9C4", "0xBFC0D9D4", "0xBFC0D9E4", "0xBFC0D9F4", "0xBFC0DA04", "0xBFC0DA14", "0xBFC0DA24", "0xBFC0DA34", "0xBFC0DA44", "0xBFC0DA54", "0xBFC0DA64", "0xBFC0DA74", "0xBFC0DA84", "0xBFC0DA94", "0xBFC0DAA4", "0xBFC0DAB4", "0xBFC0DAC4", "0xBFC0DAD4", "0xBFC0DAE4", "0xBFC0DAF4", "0xBFC0DB04", "0xBFC0DB14", "0xBFC0DB24", "0xBFC0DB34", "0xBFC0DB44", "0xBFC0DB54", "0xBFC0DB64", "0xBFC0DB74", "0xBFC0DB84", "0xBFC0DB94", "0xBFC0DBA4", "0xBFC0DBB4", "0xBFC0DBC4", "0xBFC0DBD4", "0xBFC0DBE4", "0xBFC0DBF4", "0xBFC0DC04", "0xBFC0DC14", "0xBFC0DC24", "0xBFC0DC34", "0xBFC0DC44", "0xBFC0DC54", "0xBFC16574", "0xBFC16584", "0xBFC16594", "0xBFC165A4", "0xBFC165B4", "0xBFC165C4", "0xBFC165D4", "0xBFC165E4", "0xBFC165F4", "0xBFC16604", "0xBFC16614", "0xBFC16624", "0xBFC16634", "0xBFC16644", "0xBFC16654", "0xBFC166A4", "0xBFC166B4", "0xBFC166C4", "0xBFC166D4", "0xBFC166E4", "0xBFC166F4", "0xBFC16704", "0xBFC16714", "0xBFC16724"]
},
"computed_call": {
"count": 87,
"sites": ["0xBFC02D5C", "0xBFC02E58", "0xBFC02E20", "0xBFC02FC8", "0xBFC0300C", "0xBFC03D58", "0xBFC07024", "0xBFC07130", "0xBFC0717C", "0xBFC09788", "0xBFC10908", "0xBFC10920", "0xBFC11718", "0xBFC12504", "0xBFC126A0", "0xBFC12748", "0xBFC1280C", "0xBFC128B4", "0xBFC12958", "0xBFC12A8C", "0xBFC1313C", "0xBFC13208", "0xBFC132D4", "0xBFC1339C", "0xBFC13468", "0xBFC13558", "0xBFC13594", "0xBFC136D8", "0xBFC137AC", "0xBFC13854", "0xBFC148D4", "0xBFC15F10", "0xBFC2D19C", "0xBFC2E73C", "0xBFC36D8C", "0xBFC36DBC", "0xBFC36E2C", "0xBFC36DE4", "0xBFC36E4C", "0xBFC36EA8", "0xBFC36F00", "0xBFC36F20", "0xBFC36F78", "0xBFC36FD0", "0xBFC37058", "0xBFC37088", "0xBFC370DC", "0xBFC37118", "0xBFC37154", "0xBFC371CC", "0xBFC37350", "0xBFC373A4", "0xBFC373C8", "0xBFC3741C", "0xBFC3748C", "0xBFC37568", "0xBFC376C0", "0xBFC376F8", "0xBFC37804", "0xBFC37880", "0xBFC38F5C", "0xBFC38F18", "0xBFC39738", "0xBFC39778", "0xBFC39D68", "0xBFC39D84", "0xBFC39DAC", "0xBFC39DC4", "0xBFC39DDC", "0xBFC39E28", "0xBFC39E6C", "0xBFC39EB4", "0xBFC39EDC", "0xBFC39EF4", "0xBFC39F0C", "0xBFC3A0C0", "0xBFC3A208", "0xBFC3A190", "0xBFC3A148", "0xBFC3A29C", "0xBFC42078", "0xBFC420A8", "0xBFC420D8", "0xBFC42108", "0xBFC42138", "0xBFC422B0", "0xBFC427A8"]
},
"computed_tail_call": {
"count": 7,
"sites": ["0xBFC00454", "0xBFC01938", "0xBFC10008", "0xBFC10018", "0xBFC10028", "0xBFC10038", "0xBFC10174"]
},
"jump_table": {
"count": 25,
"sites": ["0xBFC04F40", "0xBFC0B6B4", "0xBFC100D8", "0xBFC100F8", "0xBFC10118", "0xBFC10B10", "0xBFC11558", "0xBFC14D3C", "0xBFC151E0", "0xBFC1569C", "0xBFC160CC", "0xBFC161BC", "0xBFC1A664", "0xBFC1ACB4", "0xBFC1BE0C", "0xBFC1CE50", "0xBFC1E200", "0xBFC1E424", "0xBFC27EE8", "0xBFC2AD1C", "0xBFC30454", "0xBFC3054C", "0xBFC34D94", "0xBFC36D40", "0xBFC4052C"]
}
}
}