mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 18:25:35 -04:00
1010c58c41
The overlay cache keys DLLs by guest-bytes CRC, which is flavor-blind — the same guest overlay yields the same filename whether compiled by the base recompiler or a variant (e.g. widescreen, which emits psx_ws_*/GTE-adjust symbols). Two flavors sharing a cache dir would collide: a base runtime could pick up a widescreen DLL (or vice versa) with no guard, since both report ABI v2. Fold a codegen-flavor id into overlay_abi() (high 16 bits) and check the combined tag in the loader's existing ABI gate. Base/master flavor is 0, so the tag stays == PSX_OVERLAY_ABI_VERSION — fully backward compatible with every existing base DLL (verified: an 8-DLL base cache loads with zero rejections). A variant build sets PSX_OVERLAY_FLAVOR (e.g. widescreen: -DPSX_OVERLAY_FLAVOR=1 for the runtime, --flavor 1 for compile_overlays.py); its overlays then report a distinct tag, so the base runtime rejects+regenerates them and vice versa. The caches stay separate automatically, even in a shared directory — no new paths. overlay_api.h: PSX_OVERLAY_FLAVOR (default 0) + PSX_OVERLAY_ABI_TAG. overlay_loader.c: both ABI gates check the tag. compile_overlays.py: --flavor arg -> -DPSX_OVERLAY_FLAVOR, baked into overlay_abi(). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>