Files
psxrecomp/tools/dump_jtable.py
T
Matthew Stanley 101fd2e1a9 feat: 46 GTE library seeds + DuckStation oracle SW readback + debug tooling
Add 46 seeds for the libgte helper functions at BFC34E00-BFC36D00.
These wrap individual GTE operations (RTPS, RTPT, NCLIP, MVMVA, etc.)
and were never discovered because they're called via JALR function
pointers, not direct JAL. Coverage: 52→114 gte_execute, 166→429
LWC2/SWC2. Emitted functions: 1178→1214. Seeds: 960→1006.

Fix DuckStation oracle VRAM readback by setting
UseSoftwareRendererForReadbacks=true in settings.ini.

Add debug/analysis tools: GTE audit, VRAM stitching, rapid polling,
GPU info, divergence comparison, jump table dumps.

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

24 lines
805 B
Python

#!/usr/bin/env python3
"""Dump a jump table from PSX RAM via debug server."""
import socket, json, struct, sys
port = int(sys.argv[1]) if len(sys.argv) > 1 else 4370
addr = int(sys.argv[2], 16) if len(sys.argv) > 2 else 0x8005AD0C
count = int(sys.argv[3]) if len(sys.argv) > 3 else 24
base_state = int(sys.argv[4]) if len(sys.argv) > 4 else 2
s = socket.create_connection(('localhost', port), timeout=5)
cmd = f'{{"cmd":"read_ram","addr":"0x{addr:08X}","len":{count*4}}}\n'
s.sendall(cmd.encode())
data = b''
while b'\n' not in data:
data += s.recv(65536)
s.close()
resp = json.loads(data.split(b'\n')[0])
raw = bytes.fromhex(resp['hex'])
for i in range(count):
val = struct.unpack_from('<I', raw, i * 4)[0]
state = base_state + i
print(f' state {state:2d} (idx {i:2d}): 0x{val:08X}')