Files
mitch030504--Wiicompiled_VR…/projects/mkwii/recomp.yml
T
iChris4andClaude Opus 5 c8eaa52727 Merge upstream/main into openxr-work (reverse-Z fix adapted for VR)
Brings in patchzyy/Wiicompiled main: os_sleep parked-thread fix (#195),
HTTPS Retro WFC payload (#198), macOS build guide (#177), and the
reverse-Z depth fix (#134).

Conflicts were in aurora-main/lib/gfx/common.cpp and lib/gx/shader.cpp,
both from #134, which lands squarely on the VR stereo replay path.

#134 makes UseReversedZ genuinely reversed: the near/far correction now
applies exactly once, inside effective_projection(), instead of being
applied there AND per-vertex in the shader (the double application had
been cancelling out, so "reversed" Z silently behaved like forward Z).
Three pieces of the VR path were built against that old behaviour and
would have broken silently, so they are adapted here:

- shader.cpp exact-screen-depth parked the virtual screen at -0.5*w
  specifically so the shader's following negation would land it at
  +0.5*w. With that negation gone it now writes +0.5*w directly; keeping
  the minus sign would park the screen at NDC -0.5, outside the clip
  volume, discarding every 2D/HUD draw.

- stereo_replay.hpp backend_ndc_depth_row re-applied the correction to
  the projection it was handed. That projection is effective_projection()
  output, which now already carries it, so the function is a pass-through
  of the Z row and no longer depends on the reversed-Z setting; the dead
  bool parameter is dropped. Re-applying it would invert the virtual
  screen's depth ordering, so 2D layers meant to sit on top would lose
  the depth test to the ones behind them.

- shader_info.cpp stages the host depth window for that exact-depth path.
  It now uses the same reversed-Z remap as upstream's new SetViewport
  code, since frag_depth is written directly and has to reproduce the
  window the fixed viewport transform would have applied. Restricted
  depth windows (how the game forces an element in front of everything)
  are exactly the 2D draws the virtual screen carries.

The SetViewport resolution keeps upstream's remap but retains the
ordering/clamp guard our version had: for any ordered guest range the
result is identical to upstream, and it avoids handing WebGPU
minDepth > maxDepth for the swapped pair MKW is known to emit. The VR eye
replay reuses these recorded values, so the guard covers that path too.

Test updates:
- stereo_replay_test now asserts the composed Z row against the staged
  projection's own Z row rather than against the helper's output, so it
  actually catches a re-introduced double correction (verified: it fails
  when the old negation is put back; the previous self-consistent form
  passed).
- gx_fifo_test's clearDepthValue expectation followed #134's deliberate
  clear_depth_value() inversion, expressed through UseReversedZ rather
  than hardcoded. Upstream changed the behaviour without updating this
  test, so it fails on upstream/main as-is.

Verified: aurora suite 247 passed with the same 2 failures that already
fail on the pre-merge branch (IndexedPaletteHistoryKeepsAbsoluteVertexSlots,
PacksOneUniformWhenBothHalvesNeedInitialValue - both pre-existing, unrelated
to depth); shader.cpp and common.cpp compile clean; translator suite 577
passed. Not yet validated on-device in VR.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 04:19:51 +02:00

82 lines
2.3 KiB
YAML

schema_version: 1
workspace_root: ../..
project:
id: mkwii-rmcp01
display_name: Mario Kart Wii PAL
game_id: RMCP01
region: P
base_manifest_format: mkwii-recomp-base-manifest
base_manifest_stem: mkwii_base
memory:
base: 0x80000000
size: 0x01A00000
sda_base: 0x8038CC00
sda2_base: 0x8038EFA0
inputs:
dol:
path: Assets/main.dol
sha256: 80d18895b39c63bd80f457398bfcbb91b7d16ac116a41a88967e954080155b05
rel:
path: Assets/StaticR.rel
load_address: 0x805102E0
sha256: 16d9d146112541fefea701ecb5bc1a496f9d50e4a752fbb5b6778e7c6399f67d
translation:
entry_points:
- 0x800060A4
function_map:
path: projects/mkwii/MAP.txt
#just a precaution, but this should never be needed for MKWii
allow_unsupported_instructions: false
# PAL RMCP01 entry observers used by the OpenXR presentation policy. Keeping
# these in the game manifest prevents the generic translator from acquiring a
# Mario Kart runtime dependency merely because another title shares an address.
# The callback contract is read-only: (uint32_t, const CpuContext*).
entry_observer:
header: vr/mkw_vr_instrumentation.h
symbol: MkwVRObserveTranslatedFunctionEntry
entry_points:
- 0x80553C50 # RaceScene::OnEnter
- 0x805549B0 # RaceScene::OnExit
- 0x805A21D0 # RaceCamera::Update
- 0x805B1CD8 # ScnMgrRace::Draw
runtime:
native_registration_root: runtime/src
native_abi_directories:
- runtime/src/hle/gx
output:
root: generated
functions: functions
runtime_config: RuntimeConfig.h
data_initializer: data_sections_init.cpp
base_manifest: ../build/base/mkwii_base_manifest.json
profiles:
retro-rewind:
enabled: true
requires_game_id: RMCP01
requires_dol_sha256: 80d18895b39c63bd80f457398bfcbb91b7d16ac116a41a88967e954080155b05
code_pul: PulsarPacks/completed/RetroRewind/RetroRewind6/Binaries/Code.pul
mod_root: PulsarPacks/completed/RetroRewind/RetroRewind6
region: P
module_guest_base: 0x81800000
module_link_base: 0x803992E0
output: build/mods/retro_rewind_full_cpp
enable_retro_wfc: true
retro_wfc_payload: https://rwfc.net/api/wfc/payload?g=RMCPD00
retro_wfc_legacy_bootstrap_hook: 0x800ED6E8
riivolution:
xml: xml/RetroRewind6.xml
options:
- section: Retro Rewind
option: Pack
choice: 1