mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-27 18:52:11 -04:00
38ec2e7426
Hooks CD DMA channel 3 completion to log code overlay loads to logs/<game_id>/overlay_map.jsonl for build-time pre-compilation. Hot path cost: two integer comparisons (address + size filters) and return. CRC32 is NOT computed inline — too expensive for FMV-heavy scenes that stream many small DMA transfers through channel 3. Filters: - phys_addr < 0x80000: skip (main EXE, kernel, data) - size_bytes < 4096: skip (streaming data, not code) Deduplicates on (addr, size) in a 128-entry table; appends new entries to an open file handle (no fopen/fclose per transfer). overlay_log_init is called from main.cpp with the game_id and game.toml directory. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>