mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-27 02:32:02 -04:00
1f6713bfc0
The manual PSX_OVERLAY_CODEGEN_VER must be hand-bumped on every emitter change; when it isn't (e.g. between CPS emitter iterations), a stale-but-cgN DLL is reused -> the v0.3.0 black screen. Now hash_codegen.cmake hashes the recompiler codegen sources into a (gitignored) overlay_codegen_hash.h at build time; overlay_api.h exposes PSX_OVERLAY_CODEGEN_HASH and the cache path becomes gcc/<arch-abi>/cg<N>_<hash>/. The loader and compile_overlays.py read the same value, so any emitter change auto-invalidates the cache (old dirs coexist, no stale load). Falls back to hash 0 when the header is absent (fresh checkout) — identical to today's single-cgN path. Verified: build emits hash 0x347751c1; autocompile + loader both use cg4_347751c1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>