mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
2ba74f3b4b
The G1.2/G1.3 mechanism: per-word RAM/scratchpad + per-GPR + per-GTE-reg shadows carrying sub-pixel projections BY PROVENANCE, validated against the actual guest word on every read (never guessed from rounded position - the measured 93.1%-ambiguous G1.4 dead end). Clean-room from psx-spx + public design docs; vendored duckstation (CC BY-NC-ND) and beetle-psx (GPL) trees remain black-box oracles only - no code ported. - runtime/src/pgxp.cpp + pgxp.h: engine, per-vertex GetPreciseVertex (dataflow -> ambiguity-gated position cache -> native) with truncation agreement + tolerance safeguards; stats; test accessors. - pgxp_hooks.h: 5-entry hook funnel; PGXP_*() macros no-op unless -DPSX_PGXP=1 (codegen-time gate over ONE generated tree); appended PGXPHooks* table member in OverlayCallbacks (ABI bump ships with the Phase-2 emitter change). - Both interpreters wired: loads/stores/COP2 + precision-carrying arithmetic (moves, add/sub, or-merge, 16-bit shifts, LUI, HI/LO). - gte.cpp: RTPS feeds the GTE reg shadows; retired s_precise_sxy FIFO, hashed s_precision_store, and plain-store invalidation (redundant under validate-on-read; store hot path gets 3 calls back). - gpu.c: prepare_precise_triangle rewritten per-vertex; perspective UVs share the same provenance and compose per triangle. - [video] pgxp_cpu_mode / pgxp_tolerance keys; TCP pgxp verb live- toggles geometry/texture/cpu_mode/tolerance; geom_correction census grew the pgxp dataflow counters (G1.9 gate metric). - tests: new pgxp_test (registered); gte_register_access_test updated to precise invalidation contract. 33/33 enabled tests green. Also fixed while landing (both broke a fresh master tree): - runtime.cmake: once-only psx_game_version.txt stamp (multi-target file(GENERATE) collision broke every fresh single-config configure). - test_overlay_capture_retry: SDL3 rot (SDL_SetMainReady gone, inverted SDL_Init check) -> psx_sdl_init. Tracked as beads-eio.3.48; postmortem + this landing: ENHANCEMENTS.md G1-G1.10. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
51 lines
3.2 KiB
CMake
51 lines
3.2 KiB
CMake
# codegen_hash_sources.cmake — the CANONICAL list of recompiler codegen sources
|
|
# folded into the overlay cache tag hash (hash_codegen.cmake).
|
|
#
|
|
# Included from BOTH:
|
|
# - runtime/runtime.cmake (bakes the hash into the runtime's cg tag)
|
|
# - recompiler/CMakeLists.txt (bakes the SAME hash into psxrecomp-game,
|
|
# exposed via `--codegen-hash`)
|
|
# so the two hash computations can never drift by list divergence. Any file
|
|
# added to the emitter pipeline must be added HERE, once.
|
|
#
|
|
# Input: PSXRECOMP_CODEGEN_HASH_ROOT — the psxrecomp repo root.
|
|
# Output: PSXRECOMP_CODEGEN_HASH_SRCS — absolute paths to hash.
|
|
|
|
# NOTE: include the emitter .cpp translation units, not just their headers. A
|
|
# change confined to full_function_emitter.cpp (e.g. the 2026-07-03 Class-A
|
|
# shell-window overlay-dispatch fix) alters both generated dispatch and overlay
|
|
# code but left the hash unchanged when only the .h files were listed — a stale
|
|
# overlay-cache hazard (same class as the "ws emission not in cg hash" gap).
|
|
set(PSXRECOMP_CODEGEN_HASH_SRCS
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/src/code_generator.cpp
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/src/mips_decoder.cpp
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/src/control_flow.cpp
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/src/basic_block.cpp
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/src/function_analysis.cpp
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/src/recompiler_patch.cpp
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/src/recompiler_patch.h
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/src/full_function_emitter.cpp
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/src/full_function_emitter.h
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/src/strict_translator.cpp
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/src/strict_translator.h
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/src/function_discovery.cpp
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/src/function_discovery.h
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/recompiler/include/gte_register_classification.h
|
|
|
|
# --- Shard COMPILE surface -------------------------------------------------
|
|
# The cg tag must invalidate on anything a shard compiles/links against, not
|
|
# just what the emitter WRITES. A change to the overlay ABI header, the
|
|
# CPUState layout, or the dispatch-shim link contract leaves the emitter
|
|
# sources untouched — so without these the tag stayed put, existing DLLs kept
|
|
# loading, and every NEW shard silently failed to compile against the moved-on
|
|
# runtime (the recurring "header change broke the shards" class). Folding the
|
|
# compile surface in makes such a change reshard SAME-TREE instead of breaking
|
|
# silently. overlay_api.h pulls cpu_state.h and its cycle-helper headers; the
|
|
# .inc is the shim every shard links against.
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/runtime/include/overlay_api.h
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/runtime/include/cpu_state.h
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/runtime/include/pgxp_hooks.h
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/runtime/include/psx_cyc.h
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/runtime/include/psx_cycles.h
|
|
${PSXRECOMP_CODEGEN_HASH_ROOT}/runtime/include/overlay_dispatch_preamble.c.inc)
|