Skip to content

Port five small fixes from other WiiCompiled forks - #9

Merged
mitch030504 merged 5 commits into
openxr-workfrom
claude/project-thread-lokepv
Oct 5, 2026
Merged

mitch030504 merged 5 commits into
openxr-workfrom
claude/project-thread-lokepv

Conversation

@mitch030504

Copy link
Copy Markdown
Owner

Requested by Mitch · project thread

Before: changing a setting in game could leave Config.toml empty or cut short if the save was interrupted. Full-screen darkening quads (Stormship's lightning, for one) wiped out depth, so later effects vanished. Game audio was mixed with scalar loops on the Frame. A WC24 file that had been emptied stayed empty forever. Every translated guest memory access on the Frame also loaded and tested a global page-size flag.

After: settings are saved through a temporary file and a rename. Draws with the Z compare off no longer write depth, matching the hardware and Dolphin. The AX mix uses NEON on arm64. Empty WC24 bootstrap files are refilled from the payload. The Steam Frame build treats 4 KiB pages as a compile-time fact and refuses to start if the kernel ever reports a different size.

These are the five picks from the group 3 fork review, one commit each:

Commit Source
Save Config.toml through a temporary file and rename BlackAndBlue95/Strikers-WiiCompiled 435daf3 (runtime_config.h part only)
Don't write depth while the Z compare is off BlackAndBlue95/Strikers-WiiCompiled 369ec99
Add NEON forms of the AX mix kernels rooklz 4346362 (header only), plus a new scalar-vs-vector test
Refill WC24 bootstrap files that were left empty nx-mod/wiicompiled-nx d0149e6, fixed to overwrite (the original's copy_options::none fails on the existing empty file)
Fix the guest page size at compile time for the Steam Frame build Finding from nx-mod 18ef16f, done as a compile-time constant gated on MKW_HEADSET_STEAM_FRAME (native SteamOS only, not Android)

How: each change is small and local. Checks run so far:

  • The new mkw_ax_mix_kernels_tests passes under qemu-aarch64 (NEON), with -mavx2 and with neither. A deliberately broken NEON kernel makes it fail.
  • A scratch test of CopyBootstrapFile passes on this branch and fails on openxr-work for the emptied-file case.
  • guest_flat_memory.cpp compiles for aarch64 with and without the Frame define. A FlatRead32 loop built with -O2 -fPIE drops both flag loads and the checked fallback.
  • The pipeline cache key hashes the whole PipelineConfig, so the depth change needs no cache version bump.

None of this has been built or raced on the headset yet.

🤖 Generated with Claude Code

https://claude.ai/code/session_018NKSMYZU43wUfYtm1sxGsC


Generated by Claude Code

claude added 5 commits October 5, 2026 15:16
The in-game settings bar rewrote Config.toml in place with a truncating
open, so a crash or a full SD card mid-save could leave it empty or cut
short. Settings are now written beside the file and renamed over it, and
a file that exists but can't be read is no longer rewritten from nothing.

Ported from BlackAndBlue95/Strikers-WiiCompiled 435daf3 (the
runtime_config.h part only).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018NKSMYZU43wUfYtm1sxGsC
On the hardware (and in Dolphin) GXSetZMode with the compare disabled
leaves the Z buffer alone even when the update bit is set. Aurora still
wrote depth, so a full-screen quad drawn that way (the darkening during
Stormship's lightning, for one) marked the whole screen nearest and
every depth-tested draw after it failed until it faded.

Ported from BlackAndBlue95/Strikers-WiiCompiled 369ec99. The pipeline
cache key already includes depthUpdate, so no cache version bump.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018NKSMYZU43wUfYtm1sxGsC
On arm64 the AXWii mix (ramped mix-add, volume envelope, aux returns
and the big-endian bus marshalling) ran the scalar loops, since only an
AVX2 form existed. The Neon forms do eight 16-bit samples per step as
two int32x4 halves and keep the scalar loops for the tail.

The header part of rooklz's 4346362; its other changes are left out.
A new test checks every vector form against the scalar loops at every
tail length and at the ramp and clamp extremes; it passes under
qemu-aarch64 (NEON), with -mavx2 and with neither.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018NKSMYZU43wUfYtm1sxGsC
Bootstrap seeding only created missing files, so a WC24 file that had
been emptied (nwc24dl.bin, nwc24fl.bin, misc.bin) stayed at zero bytes
on every boot. WC24 rejects a zero-length download or friend list and
MKW reports that as a save error, which matters now that #7 lets KD
open while offline. A file is re-copied only when it is empty and the
payload's copy is not, so player data is never replaced.

Adapted from nx-mod/wiicompiled-nx d0149e6. That version falls through
to copy_file with copy_options::none, which fails on the existing empty
file; this one overwrites in that case only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018NKSMYZU43wUfYtm1sxGsC
Every translated guest load and store tests RequiresCheckedAccess(). On
x86-64 and Windows that is a compile-time false, but on AArch64 it read
a global flag, which under PIE is a GOT load plus a byte load and a
branch on every access, re-read after every guest store. The flag is
only true on kernels with pages larger than 4 KiB.

The Steam Frame's SteamOS kernel uses 4 KiB pages (getconf PAGESIZE on
the headset reports 4096), so the native --headset steam_frame build now
folds the test away like x86-64 does. GuestFlat::Initialize checks the
page size at startup in that build and refuses to start with a clear
message if it is ever anything else. Android and other AArch64 builds
still probe at runtime.

Checked with clang --target=aarch64-linux-gnu -O2 -fPIE: a FlatRead32
loop loses both flag loads and the checked Memory::Read32 fallback.

Follows the finding from nx-mod/wiicompiled-nx 18ef16f, which made the
flag hidden instead; a compile-time constant removes it entirely.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018NKSMYZU43wUfYtm1sxGsC
@mitch030504 mitch030504 self-assigned this Oct 5, 2026
@mitch030504
mitch030504 marked this pull request as ready for review October 5, 2026 15:52
@mitch030504
mitch030504 merged commit cfd434f into openxr-work Oct 5, 2026
2 checks passed
@mitch030504
mitch030504 deleted the claude/project-thread-lokepv branch October 5, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants