runtime: overlay_region_floor game.toml key (follow-up to #160) - #242
runtime: overlay_region_floor game.toml key (follow-up to #160)#242Alexbeav wants to merge 2 commits into
Conversation
… drives gcc when available Two shipping gaps left Gran Turismo's gameplay and FMV code on the interpreter (0.55-0.64x real time) even though the recompiled boot EXE was fine: 1. The overlay region floor defaults to the boot EXE text end. GT's secondary EXEs (GTOS/GTMENU/GTMAIN/GTEND) all load at 0x80010000, inside that range, so they were never overlay-cache eligible. The only way to lower the floor was the PSX_OVERLAY_REGION_FLOOR env var, which a shipped package cannot carry. Add `[runtime] overlay_region_floor` (hex string or integer), applied before the env override with the same kernel-window clamp. 2. The bundled overlay_toolchain/ was only used to build the tcc command. A dev/production box with gcc on PATH but no game.toml autocompile command got no compiler at all. Treat the bundle as a gcc toolchain provider too: gcc counts as available when the bundle is present and a gcc/cc/clang is on PATH, and the same bundle then drives compile_overlays.py with --compiler gcc. One package yields gcc shards on a dev box and tcc shards on a toolchain-less player box. Measured on GT1 (SCUS-94194), headless boot -> intro FMV -> attract, with the floor at 0x10000 and gcc autocompile: 1.27-1.38x real time vs 0.55-0.64x; SPU production 27 kHz -> 59 kHz (the FMV audio distortion was starvation). (cherry picked from commit 0d226e5)
|
Small config robustness concern.
I think we should reject integer values outside the intended PSX physical/kernel-safe range at parse time, matching the fail-loud style used by nearby config fields. Do you agree? The string hex path already goes through |
Raw TOML integers were cast straight to uint32_t and left to the runtime clamp/mask, so a negative or >32-bit value could wrap or be masked into a different physical address silently. Reject those at parse time, and require the (KSEG-stripped) value to name main RAM above the kernel window (0x10000..0x1FFFFF), matching the fail-loud style of the nearby fields. The hex-string path already goes through parse_hex and now shares the range check.
|
Agreed. Pushed 699022e: raw TOML integers are now validated at parse time — negative or >32-bit values are rejected, and the KSEG-stripped value must name main RAM above the kernel window (0x10000..0x1FFFFF physical), failing loud in the same style as |
Summary
#160 added the PSX_OVERLAY_REGION_FLOOR environment override for titles whose secondary EXEs load below the boot text end. This exposes the same floor as a [runtime] overlay_region_floor key in game.toml so a title can declare it without an environment variable (Gran Turismo: GTOS/GTMENU/GTMAIN load at 0x80010000). The commit also lets a bundled overlay toolchain use gcc when it is on PATH; that half can be split out if preferred.
Commits
Scope
6 files changed, 107 insertions(+), 31 deletions(-)
Validation
Cherry-picked from the Alexbeav/psxrecomp
mainline, where the same changes pass the recompiler/runtime/runtime-ui ctest gates with only the pre-existing failures (aot_overlay_discovery,release_zip,gte_register_access_testlink). This branch was also built onmstan/masteras of 01c647e with the same result.