From 99de7b943f1f5cab6640225912e36fecb9e1b409 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Sat, 7 Nov 2026 03:28:05 -0500 Subject: [PATCH] Give each file of copied code one license line. Each file that contains copied code names its copyright holder and license and points at THIRD_PARTY_NOTICES.md; zlib code keeps its full notice and the mark that it was altered. Comments and probe text only. Co-Authored-By: Claude Opus 5.5 --- runtime/audio_effects.c | 8 +++----- runtime/audio_effects.h | 4 ++-- runtime/audio_mixer.c | 8 ++++---- runtime/audio_reverb.c | 7 +++---- runtime/audio_reverb.h | 4 ++-- runtime/audren.c | 5 ++--- runtime/audren.h | 4 ++-- runtime/boot.c | 5 ++--- runtime/cpu.h | 2 +- runtime/fma.c | 4 ++-- runtime/frame_rate.c | 4 +--- runtime/fs.h | 3 +-- runtime/fs_host.c | 3 +-- runtime/gfx_present.c | 6 ++---- runtime/hostfn.c | 2 +- runtime/ipc.c | 4 ++-- runtime/ipc.h | 4 ++-- runtime/kernel.c | 14 ++++++-------- runtime/kernel_probe.c | 2 +- runtime/loader.c | 5 ++--- runtime/memory.c | 5 ++--- runtime/menu_cursor.c | 7 +++---- runtime/motion_fusion.c | 3 +-- runtime/movie.h | 3 +-- runtime/nvn_api.h | 4 ++-- runtime/nvn_api_cmd.c | 8 +++----- runtime/nvn_api_core.c | 7 +++---- runtime/nvn_api_obj.c | 6 ++---- runtime/nvn_ext.c | 5 ++--- runtime/nvn_hmap.h | 3 +-- runtime/nvn_obj.h | 8 ++++---- runtime/nvn_pool_index.h | 3 +-- runtime/nvn_probe.c | 5 ++--- runtime/nvn_tex.c | 4 ++-- runtime/nvn_tex.h | 2 +- runtime/nvn_tex_probe.c | 2 +- runtime/ov_gfx.c | 5 ++--- runtime/ov_input.c | 3 +-- runtime/ov_media.c | 3 +-- runtime/ov_movie.c | 3 +-- runtime/ov_system.c | 3 +-- runtime/perfmon.c | 12 ++++-------- runtime/perfmon.h | 5 ++--- runtime/platform/win32.c | 4 ++-- runtime/resolution.c | 7 +++---- runtime/romfs.c | 3 +-- runtime/romfs_path.h | 3 +-- runtime/shaders/astc_decode.comp | 4 ++-- runtime/simd.h | 2 +- runtime/simd_fp.h | 2 +- runtime/svc.c | 3 +-- runtime/swkbd.c | 6 ++---- runtime/tex_astc.c | 2 +- runtime/tex_deswizzle.c | 2 +- runtime/ui/menu.cpp | 14 +++++++------- runtime/ui/option_rows.cpp | 9 ++++----- runtime/vk_device.c | 5 ++--- runtime/vk_exec.c | 12 ++++-------- runtime/vk_exec.h | 3 +-- runtime/vk_exec_draw.c | 9 +++------ runtime/vk_exec_xfer.c | 6 +----- runtime/vk_formats.c | 4 ++-- runtime/vk_memory.c | 10 ++++------ runtime/vk_pipeline.c | 9 +++------ runtime/vk_sync.c | 9 +++------ runtime/vk_texture.c | 9 +++------ 66 files changed, 138 insertions(+), 206 deletions(-) diff --git a/runtime/audio_effects.c b/runtime/audio_effects.c index 56411303..53780a1c 100644 --- a/runtime/audio_effects.c +++ b/runtime/audio_effects.c @@ -1,8 +1,6 @@ -// Adapted from MacNativeGames games//runtime/audio_effects.c @ b75be8c (MIT, Copyright (c) 2026 MacNativeGames contributors). -// Algorithms from Ryujinx.Audio (MIT, Copyright (c) Ryujinx Team and Contributors). -/* Delay, standard reverb and compressor DSP, ported from Ryujinx.Audio. - Copyright (c) Ryujinx Team and Contributors. MIT license: - third_party/licenses/Ryujinx-Audio.txt. Runtime samples are normalized floats. */ +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). +/* Delay, standard reverb and compressor DSP. Contains code Copyright (c) Ryujinx Team and Contributors (MIT; see + third_party/licenses/Ryujinx-Audio.txt). Runtime samples are normalized floats. */ #include "audio_effects.h" #include "host.h" #include diff --git a/runtime/audio_effects.h b/runtime/audio_effects.h index aa6a3328..5ffc61fa 100644 --- a/runtime/audio_effects.h +++ b/runtime/audio_effects.h @@ -1,5 +1,5 @@ -/* Additional DSP effects. Wire layouts and algorithms follow Ryujinx.Audio - (MIT, third_party/licenses/Ryujinx-Audio.txt). No device or guest-memory access. */ +/* Additional DSP effects. Contains code Copyright (c) Ryujinx Team and Contributors (MIT; see + third_party/licenses/Ryujinx-Audio.txt). No device or guest-memory access. */ #pragma once #include #include diff --git a/runtime/audio_mixer.c b/runtime/audio_mixer.c index 66f33070..74b9a149 100644 --- a/runtime/audio_mixer.c +++ b/runtime/audio_mixer.c @@ -1,7 +1,7 @@ -// Adapted from MacNativeGames games//runtime/audio_mixer.c @ b75be8c (MIT, Copyright (c) 2026 MacNativeGames -// contributors): the mixing stage (voice decode and resampling, splitters, mixes, effects, sinks) and the IAudioDevice -// service. The CoreAudio output is replaced by SDL3 audio. Effect algorithms follow -// Ryujinx.Audio (MIT, Copyright (c) Ryujinx Team and Contributors). +// Contains code Copyright (c) 2026 MacNativeGames contributors, Copyright (c) Ryujinx Team and Contributors (MIT; see +// THIRD_PARTY_NOTICES.md). +// The mixing stage (voice decode and resampling, splitters, mixes, effects, sinks) and the IAudioDevice service, with +// SDL3 audio output. // // Per 5 ms frame the render thread (audren.c, renderer lock held) decodes every started voice (PCM8/16/24/32, float, // DSP-ADPCM) along the sample path the voice clock consumes, resamples it linearly, runs the voice biquads, scales it diff --git a/runtime/audio_reverb.c b/runtime/audio_reverb.c index 93b1c376..719da2d3 100644 --- a/runtime/audio_reverb.c +++ b/runtime/audio_reverb.c @@ -1,7 +1,6 @@ -// Adapted from MacNativeGames games//runtime/audio_reverb.c @ b75be8c (MIT, Copyright (c) 2026 MacNativeGames contributors). -/* Compatible 3D reverb network, based on Ryujinx.Audio's Reverb3dState/Command, - DelayLine3d and DecayDelay. Copyright (c) Ryujinx Team and Contributors. - MIT license: third_party/licenses/Ryujinx-Audio.txt. Samples are normalized floats. */ +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). +/* Compatible 3D reverb network. Contains code Copyright (c) Ryujinx Team and Contributors (MIT; see + third_party/licenses/Ryujinx-Audio.txt). Samples are normalized floats. */ #include "audio_reverb.h" #include "host.h" #include diff --git a/runtime/audio_reverb.h b/runtime/audio_reverb.h index 573fc6e3..51b23d42 100644 --- a/runtime/audio_reverb.h +++ b/runtime/audio_reverb.h @@ -1,5 +1,5 @@ -// Adapted from MacNativeGames games//runtime/audio_reverb.c @ b75be8c (MIT, Copyright (c) 2026 MacNativeGames -// contributors), based on Ryujinx.Audio (MIT, Copyright (c) Ryujinx Team and Contributors). +// Contains code Copyright (c) 2026 MacNativeGames contributors, Copyright (c) Ryujinx Team and Contributors (MIT; see +// THIRD_PARTY_NOTICES.md). #ifndef NX2NAVI_AUDIO_REVERB_H #define NX2NAVI_AUDIO_REVERB_H #include diff --git a/runtime/audren.c b/runtime/audren.c index 65feb3eb..680885d1 100644 --- a/runtime/audren.c +++ b/runtime/audren.c @@ -1,6 +1,5 @@ -// Adapted from MacNativeGames games//runtime/audio_renderer.c @ b75be8c (MIT, Copyright (c) 2026 -// MacNativeGames contributors). Its voice lifetime (play state, wave buffer release, flush) is ported from -// Ryujinx.Audio VoiceInfo / DataSourceHelper (MIT, Copyright (c) Ryujinx Team and Contributors). +// Contains code Copyright (c) 2026 MacNativeGames contributors, Copyright (c) Ryujinx Team and Contributors (MIT; see +// THIRD_PARTY_NOTICES.md). // audren:u. The SDK's nn::audio client builds RequestUpdate input unchanged; this // service validates every section against the header, keeps server-side voice state, advances it in real time (one // frame of sample_count / sample_rate seconds per render tick, signalling the renderer's event) and writes the output diff --git a/runtime/audren.h b/runtime/audren.h index ac7130a4..cf603648 100644 --- a/runtime/audren.h +++ b/runtime/audren.h @@ -1,5 +1,5 @@ -// Adapted from MacNativeGames games//runtime/audio_renderer.h and audio_mixer.h @ b75be8c (MIT, Copyright (c) -// 2026 MacNativeGames contributors). Wire layouts follow the public audren:u wire format. +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). +// Wire layouts follow the public audren:u wire format. // audren:u, the audio renderer service: RequestUpdate wire formats, the server-side // renderer state, and the mixer interface (audio_mixer.c: the real mixer with SDL3 output). #pragma once diff --git a/runtime/boot.c b/runtime/boot.c index b08f0507..fee60ed4 100644 --- a/runtime/boot.c +++ b/runtime/boot.c @@ -1,6 +1,5 @@ -// Adapted from MacNativeGames games//runtime/loader.c (lines 456-477) and services.c (lines 219-235) @ b75be8cf -// (MIT, Copyright (c) 2026 MacNativeGames contributors) and LAS Recomp runtime/main.c (lines 16-35, 141-159) @ -// da35b83 (MIT, Copyright (c) 2026 Peiikai). +// Contains code Copyright (c) 2026 MacNativeGames contributors, Copyright (c) 2026 Peiikai (MIT; see +// THIRD_PARTY_NOTICES.md). // The boot driver: the guest main thread runs the game's own nn::init::Start // with three host callbacks, the second of which runs DT_INIT of main, subsdk0 and sdk; Start then calls nnMain. // --boot checks two checkpoints on the way and ends at the first nvnBootstrapLoader call, at the return address of diff --git a/runtime/cpu.h b/runtime/cpu.h index 207f4901..3bc96256 100644 --- a/runtime/cpu.h +++ b/runtime/cpu.h @@ -1,4 +1,4 @@ -// Adapted from LAS Recomp runtime/cpu.h @ da35b83 (MIT, Copyright (c) 2026 Peiikai). +// Contains code Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). // Guest CPU state and helpers used by recompiled code. #pragma once #include diff --git a/runtime/fma.c b/runtime/fma.c index dbebdc12..2c24f20d 100644 --- a/runtime/fma.c +++ b/runtime/fma.c @@ -5,7 +5,7 @@ // without FMA3 the UCRT's software fallback is documented as rounding incorrectly by up to half an ulp, while the FP // lowering needs the single rounding the ARM instruction gives. This file supplies it. // -// Adapted from musl src/math/fma.c and src/math/fmaf.c (MIT, Copyright (c) 2005-2020 Rich Felker and contributors). +// Contains code Copyright (c) 2005-2020 Rich Felker and contributors (MIT; see THIRD_PARTY_NOTICES.md). // The result is rounded in the MXCSR rounding mode the caller set (simd.h simd_rm_enter), and MXCSR FTZ and DAZ are // honoured as the hardware FMA would, so runtime/simd.h's fast paths keep their assumptions: denormal inputs read as // zero and denormal results as zero under FPCR.FZ, without a trip through the slow path. @@ -95,7 +95,7 @@ static void fma_mul(uint64_t *hi, uint64_t *lo, uint64_t x, uint64_t y) { *hi = t3 + (t2 >> 32) + (t1 > *lo); } -// scalbn from musl src/math/scalbn.c (MIT): the fma's final scaling, kept here so the result does not depend on the +// scalbn: the fma's final scaling, kept here so the result does not depend on the // C runtime's version. Its multiplications honour MXCSR like any other host FP operation. static double fma_scalbn(double x, int n) { union { double f; uint64_t i; } u; diff --git a/runtime/frame_rate.c b/runtime/frame_rate.c index a4363f08..92cfe7ec 100644 --- a/runtime/frame_rate.c +++ b/runtime/frame_rate.c @@ -1,6 +1,4 @@ -// Adapted from MacNativeGames games//runtime/game_patches.c @ ebe621d (MIT, Copyright (c) 2026 MacNativeGames -// contributors): runtime_frame_step_update (2338bb0: no 1/120 s floor) and the speed survey's player chain -// (world_survey.c player_actor). +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). // Frame rate: the frame limit and the real-time frame step, the host half of the patch sets fps60, realtime and cloth // (build tables patches-v121.txt, patches-v143.txt). // diff --git a/runtime/fs.h b/runtime/fs.h index f25731a8..90903e61 100644 --- a/runtime/fs.h +++ b/runtime/fs.h @@ -1,5 +1,4 @@ -// Adapted from MacNativeGames games//runtime/fs_host.h @ b75be8cf (MIT, Copyright (c) 2026 MacNativeGames -// contributors). +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). // The nn::fs host layer: the read-only RomFS (romfs.c) and writable save, temporary and // cache storage under the profile directory (fs_host.c). Both register their nn::fs overrides with HOST_OVERRIDE; // this header is what the two files and the probe share. diff --git a/runtime/fs_host.c b/runtime/fs_host.c index 60475bb6..70feea09 100644 --- a/runtime/fs_host.c +++ b/runtime/fs_host.c @@ -1,5 +1,4 @@ -// Adapted from MacNativeGames games//runtime/fs_host.c @ b75be8cf (MIT, Copyright (c) 2026 MacNativeGames -// contributors). +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). // nn::fs host implementation of the functions main imports. RomFS paths and // handles go to the read-only backend (romfs.c); save, temporary and cache storage are host directories under the // profile directory (rt_config()->profile, default build/profile): diff --git a/runtime/gfx_present.c b/runtime/gfx_present.c index a132f1f1..a92f7e70 100644 --- a/runtime/gfx_present.c +++ b/runtime/gfx_present.c @@ -1,9 +1,7 @@ // Vulkan surface and swapchain, present blit, 60 Hz vsync thread, focus: the window-system-free half of the window // (the other half: gfx_window_win.c with Win32, gfx_window_sdl.c with SDL, through gfx_wsys.h). -// Swapchain set-up ported from LAS Recomp, runtime/nvn/vulkan/device.c:254-330 (https://github.com/peiikai/LASRecomp @ -// da35b83a9611d046a9a681aae668d7085954d37f, MIT, Copyright (c) 2026 Peiikai). Focus and vsync behaviour from -// MacNativeGames, games//runtime/frontend.m:88-97, 175-176, 350-352 (https://github.com/ly05010419/MacNativeGames @ -// b75be8cfa704df3701e86130c8ced268e79d6b11, MIT, Copyright (c) 2026 MacNativeGames contributors). +// Contains code Copyright (c) 2026 Peiikai, Copyright (c) 2026 MacNativeGames contributors (MIT; see +// THIRD_PARTY_NOTICES.md). // // Threads: the window thread (the back end's) owns the window and never runs guest code. The vsync thread signals the // bound system events. Presents come from any host thread (the back end's present worker) and take g_pl; every queue diff --git a/runtime/hostfn.c b/runtime/hostfn.c index d3d4bfea..d5ba2b22 100644 --- a/runtime/hostfn.c +++ b/runtime/hostfn.c @@ -1,4 +1,4 @@ -// Adapted from LAS Recomp runtime/hle.h and runtime/dispatch.c @ da35b83 (MIT, Copyright (c) 2026 Peiikai). +// Contains code Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). // Host functions at synthetic guest addresses: the HOST_OVERRIDE / HOST_OBSERVER // linker tables, the registry behind them, and the calls between host and guest (rt_call, rt_original). // diff --git a/runtime/ipc.c b/runtime/ipc.c index 70b19141..8ef5bb7c 100644 --- a/runtime/ipc.c +++ b/runtime/ipc.c @@ -1,5 +1,5 @@ -// Adapted from MacNativeGames games//runtime/ipc.c @ b75be8c (MIT, Copyright (c) 2026 MacNativeGames -// contributors). Message framing per the HIPC, CMIF and TIPC wire layouts. +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). +// Message framing per the HIPC, CMIF and TIPC wire layouts. // In-process Horizon IPC: SVCs 0x15, 0x1F, 0x21, 0x22, the sm: service manager // and the service table. The SDK client code runs unchanged: requests are read from the calling thread's message // buffer (TLR, or the user buffer of 0x22) and answered in place. Unknown ports, services and commands stop with their diff --git a/runtime/ipc.h b/runtime/ipc.h index c96878f3..58cb8f41 100644 --- a/runtime/ipc.h +++ b/runtime/ipc.h @@ -1,5 +1,5 @@ -// Adapted from MacNativeGames games//runtime/ipc.h @ b75be8c (MIT, Copyright (c) 2026 MacNativeGames -// contributors). Message framing per the HIPC, CMIF and TIPC wire layouts. +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). +// Message framing per the HIPC, CMIF and TIPC wire layouts. // In-process Horizon IPC: HIPC messages with CMIF or TIPC payloads, answered in // place in the caller's message buffer. Services are host implementations looked up by name through sm:. #pragma once diff --git a/runtime/kernel.c b/runtime/kernel.c index 3eaabfdd..5074eef3 100644 --- a/runtime/kernel.c +++ b/runtime/kernel.c @@ -1,7 +1,5 @@ -// Adapted from MacNativeGames games//runtime/threads.c @ b75be8c (MIT, Copyright (c) 2026 MacNativeGames -// contributors; itself from d2r-mobile dm/host/hle_thread.c), d2r-mobile dm/host/thread.c @ 53e7c5b (MIT, Copyright -// (c) 2026 jhaizhou) and LAS Recomp runtime/kernel.c @ da35b83 (MIT, Copyright (c) 2026 Peiikai); the preemption of -// virtual cores from MacNativeGames threads.c @ 33e8fa8 (MIT, as above). +// Contains code Copyright (c) 2026 MacNativeGames contributors, Copyright (c) 2026 jhaizhou, Copyright (c) 2026 Peiikai (MIT; +// see THIRD_PARTY_NOTICES.md). // Threads, synchronization, virtual cores and fibers of the Horizon kernel. // // One guest thread = one Windows thread with a 256 MiB reserved host stack (every guest BL is a host call) and its own @@ -350,8 +348,8 @@ static int core_allowed(const RtThread *t, int c) { } // ---- asynchronous preemption (NX2NAVI_ASYNC_PREEMPT, on unless 0) -// Adapted from MacNativeGames games//runtime/threads.c @ 33e8fa8 (8bf0893, PR #488; MIT, Copyright (c) 2026 -// MacNativeGames contributors): Horizon gives a core to a strictly better thread the moment that thread is ready. +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). +// Horizon gives a core to a strictly better thread the moment that thread is ready. // Here a better waiter only marks the owner, which gives the core up at its next SVC or indirect call; an owner in a // stretch of game code with neither keeps it (NX2NAVI_CORE_DIAG: 0.5-1.1 ms of thread-time per frame, waits to 16 ms and // more). With it on, three parts, all of them necessary: @@ -1073,8 +1071,8 @@ void kern_core_back(int *away) { } // ---- spin waits (recomp/patches.py `spin` lines, found by tools/spin_waits.py) -// Adapted from MacNativeGames games//runtime/threads.c runtime_spin_wait @ a038e6b and nxnative dm/host/hle_thread.c -// dm_spin_wait @ 6d34984 (MIT, Copyright (c) 2026 MacNativeGames contributors, Copyright (c) 2026 seedds). +// Contains code Copyright (c) 2026 MacNativeGames contributors, Copyright (c) 2026 seedds (MIT; see +// THIRD_PARTY_NOTICES.md). // A pass of a guest loop that polls memory until another thread changes it. On the Switch it fills only its own core, // where a better thread pinned there preempts it; here it holds a virtual core and a host core, and pollers that take a // lock on every pass hand its cache line between their host cores so the thread whose item it is rarely gets it diff --git a/runtime/kernel_probe.c b/runtime/kernel_probe.c index 9be2a9a8..62343235 100644 --- a/runtime/kernel_probe.c +++ b/runtime/kernel_probe.c @@ -241,7 +241,7 @@ static void test_cv_key_order(Cpu *c) { r = cv_order_case(c, 1); seen = g_seen_key; int lost = seen == 0 && r == KERN_R_TIMEOUT; - printf("condvar key order, negative control (MNG's old order, release then set the key): signaller saw key %d, " + printf("condvar key order, negative control (the old order, release then set the key): signaller saw key %d, " "waiter result %#x: %s\n", seen, r, lost ? "lost wakeup, fails as expected" : "FAIL (the control did not " "fail)"); CHECK(lost, "the old-order negative control did not lose the wakeup"); diff --git a/runtime/loader.c b/runtime/loader.c index 406d78be..fcc00653 100644 --- a/runtime/loader.c +++ b/runtime/loader.c @@ -1,6 +1,5 @@ -// Adapted from LAS Recomp runtime/loader.c @ da35b83 (MIT, Copyright (c) 2026 Peiikai) and MacNativeGames -// games//runtime/loader.c and scripts/prepare_runtime.py @ b75be8c (MIT, Copyright (c) 2026 MacNativeGames -// contributors). +// Contains code Copyright (c) 2026 Peiikai, Copyright (c) 2026 MacNativeGames contributors (MIT; see +// THIRD_PARTY_NOTICES.md). // NSO loading at the fixed layout bases, dynamic linking with host overrides, the nnMain identity check, sealing, // and --probe-loader. // diff --git a/runtime/memory.c b/runtime/memory.c index 8980de94..8e33530b 100644 --- a/runtime/memory.c +++ b/runtime/memory.c @@ -1,6 +1,5 @@ -// Adapted from MacNativeGames games//runtime/services.c and loader.c @ b75be8c (MIT, Copyright (c) 2026 -// MacNativeGames contributors), and LAS Recomp runtime/main.c and platform/windows.c @ da35b83 (MIT, Copyright (c) -// 2026 Peiikai). +// Contains code Copyright (c) 2026 MacNativeGames contributors, Copyright (c) 2026 Peiikai (MIT; see +// THIRD_PARTY_NOTICES.md). // Guest address space and the memory SVCs: heap, module data permissions, stack moves, // QueryMemory, physical memory in the alias region, GetInfo memory ids, and the kernel-region allocator. // diff --git a/runtime/menu_cursor.c b/runtime/menu_cursor.c index 020af63a..f9a5c39b 100644 --- a/runtime/menu_cursor.c +++ b/runtime/menu_cursor.c @@ -6,10 +6,9 @@ // screens are read and the focus is moved with the three writes eui::BoxCursorMgr::moveBoxCursor makes, so the game's // own BoxCursorControl moves the box at its next update. // -// Adapted from Weeping of the Empire's engine/runtime/nx2navi_menu_cursor.cpp @ df0586cdc5702ca19bbebfa59697e0b6980f6237 -// (https://github.com/daniel-madrid-07/weeping-of-the-empire), Copyright (c) 2026 daniel-madrid-07, MIT License: the -// focus read, the hit test, the stale-hit-pane fallback and the focus writes, which it does for 1.0.0. -// Placed in 1.4.3 by hand: +// Contains code Copyright (c) 2026 daniel-madrid-07 (MIT; see THIRD_PARTY_NOTICES.md). +// The focus read, the hit test, the stale-hit-pane fallback and the focus writes were written for 1.0.0. Placed in +// 1.4.3 by hand: // - eui::ScreenMgr::sInstance: 1.0.0 main+0x4640010, 1.4.3 main+0x3acf960 (its createInstance main+0xc613d4 and // constructor main+0xc61450 match 1.0.0's main+0x119c5cc / +0x119c648 instruction for instruction, the object // 0x450 bytes with the same field stores, so its layout is 1.0.0's); diff --git a/runtime/motion_fusion.c b/runtime/motion_fusion.c index bb5f8133..e7454443 100644 --- a/runtime/motion_fusion.c +++ b/runtime/motion_fusion.c @@ -1,5 +1,4 @@ -// Adapted from MacNativeGames games//runtime/motion_fusion.c @ b75be8cf (MIT, Copyright (c) 2026 MacNativeGames -// contributors). +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). // Six-axis sensor states (nn::hid::SixAxisSensorState) from gyro and accelerometer samples. Input per sample, in the // Switch controller frame (x to the right, y toward the top edge, z out of the face): acceleration in G including // gravity, as gravity reads (lying face up z = -1 G), and rotation rate in rad/s. Output per sample, as the Switch diff --git a/runtime/movie.h b/runtime/movie.h index f71afa4c..9b5ac8df 100644 --- a/runtime/movie.h +++ b/runtime/movie.h @@ -1,5 +1,4 @@ -// Adapted from MacNativeGames games//runtime/movie_host.h @ b75be8cf (MIT, Copyright (c) 2026 MacNativeGames -// contributors). +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). // What ov_movie.c (the host movie::Decoder) and movie_probe.c share. The game reaches the decoder through the // HOST_OVERRIDE entries named in movie_symbols; the probe calls the same entries with a Cpu of its own and stand-ins for // the guest functions the decoder calls. diff --git a/runtime/nvn_api.h b/runtime/nvn_api.h index a7094955..7626b8f9 100644 --- a/runtime/nvn_api.h +++ b/runtime/nvn_api.h @@ -1,6 +1,6 @@ // Internal header of the NVN front end, shared by nvn_api_core.c and the other -// slices (textures, samplers, programs, windows, state objects, command buffers). Adapted from MacNativeGames games//third_party/d2r_gfx/gfx/nvn/hle_nvn.c and nvn_impl.h @ b75be8cf -// (MIT, Copyright (c) 2026 jhaizhou; origin d2r-mobile). +// slices (textures, samplers, programs, windows, state objects, command buffers). +// Contains code Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). #pragma once #include diff --git a/runtime/nvn_api_cmd.c b/runtime/nvn_api_cmd.c index f53000c0..34ccf8a1 100644 --- a/runtime/nvn_api_cmd.c +++ b/runtime/nvn_api_cmd.c @@ -1,10 +1,8 @@ // NVN front end, command-buffer slice: command buffers, their memory, recording // as op records (nvn_obj.h), recording copies behind command handles, and the submit-time resolution of deferred binds -// (nvn_submit_prepare, called by nvnQueueSubmitCommands in nvn_api_core.c). Ported from MacNativeGames -// games//third_party/d2r_gfx/gfx/nvn/hle_nvn.c @ b75be8cf (MIT, Copyright (c) 2026 jhaizhou; origin d2r-mobile), -// lines 647-1062, 1261-1286, 1486-1760 and 1975-1990, and the *Deferred and memory-callback entry points of -// nx2navi_nvn_ext.c in the same directory. Metal, mach, the translation thread, Apple diagnostics, the per-frame -// statistics and the copy marks in control memory dropped; the texture pin sweep replaced by counting (texture pins). +// (nvn_submit_prepare, called by nvnQueueSubmitCommands in nvn_api_core.c), and the *Deferred and memory-callback entry +// points. Texture pins are counted (section "texture pins"). +// Contains code Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). // // Records are written into a growable host buffer per command buffer, never into the game's command memory: games hand // the same command memory to several command buffers recording at once (budgeted for real NVN encodings), and our diff --git a/runtime/nvn_api_core.c b/runtime/nvn_api_core.c index 8382e673..bf1b6119 100644 --- a/runtime/nvn_api_core.c +++ b/runtime/nvn_api_core.c @@ -1,8 +1,7 @@ // NVN front end, first slice: device, queue, memory pool, buffer, sync and -// event objects. Ported from MacNativeGames games//third_party/d2r_gfx/gfx/nvn/hle_nvn.c @ b75be8cf (MIT, -// Copyright (c) 2026 jhaizhou; origin d2r-mobile), lines 137-253, 534-645 and 1975-2001; Metal, mach, the translation -// thread and Apple diagnostics dropped. Calls that reached Metal go to gfx_backend() (gfx.h). nvnQueuePresentTexture -// belongs to the window slice; nvnDeviceGetProcAddress lives in nvn_procs.c. +// event objects. Back-end calls go to gfx_backend() (gfx.h). nvnQueuePresentTexture belongs to the window slice; +// nvnDeviceGetProcAddress lives in nvn_procs.c. +// Contains code Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). // // Objects are stored in place in the NVN object memory the game provides (nvn_obj.h); every argument is read from the // AAPCS64 registers (host.h arg_x / arg_p) and every result returned with ret_x. diff --git a/runtime/nvn_api_obj.c b/runtime/nvn_api_obj.c index a75fc085..df33d597 100644 --- a/runtime/nvn_api_obj.c +++ b/runtime/nvn_api_obj.c @@ -1,8 +1,6 @@ // NVN front end, second slice: descriptor pools, textures, samplers, programs, -// windows with present pacing, and the state objects. Ported from MacNativeGames -// games//third_party/d2r_gfx/gfx/nvn/hle_nvn.c @ b75be8cf (MIT, Copyright (c) 2026 jhaizhou; origin d2r-mobile), -// lines 254-535, 1775-1829, 2070-2215 and 2579-2727, and nvn_pace.h; Metal, mach, the translation thread, frame -// interpolation and Apple diagnostics dropped. Calls that reached Metal go to gfx_backend() (gfx.h). +// windows with present pacing, and the state objects. Back-end calls go to gfx_backend() (gfx.h). +// Contains code Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). // // Objects are stored in place in the NVN object memory the game provides (nvn_obj.h); every argument is read from the // AAPCS64 registers (host.h arg_x / arg_s / arg_p) and every result returned with ret_x. Command-buffer procs are in diff --git a/runtime/nvn_ext.c b/runtime/nvn_ext.c index d5b35705..a0ce8d60 100644 --- a/runtime/nvn_ext.c +++ b/runtime/nvn_ext.c @@ -1,8 +1,7 @@ // NVN entry points beyond the core implementation that only report stored object state, attach debugging metadata, // convert timestamps or take hardware hints. None of them changes rendering -// results. Ported from MacNativeGames games//third_party/d2r_gfx/gfx/nvn/nx2navi_nvn_ext.c @ b75be8cf (MIT, -// Copyright (c) 2026 jhaizhou; origin d2r-mobile); mach timing and Metal wording dropped. Its *Deferred binds and -// memory-callback switches live with the command buffer in nvn_api_cmd.c. +// results. The *Deferred binds and memory-callback switches live with the command buffer in nvn_api_cmd.c. +// Contains code Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). #include #include diff --git a/runtime/nvn_hmap.h b/runtime/nvn_hmap.h index f49a22cb..3c298888 100644 --- a/runtime/nvn_hmap.h +++ b/runtime/nvn_hmap.h @@ -1,5 +1,4 @@ -// Ported from MacNativeGames games//third_party/d2r_gfx/gfx/nvn/nvn_hmap.h @ b75be8cf (MIT, Copyright (c) 2026 -// jhaizhou; origin d2r-mobile); Chinese duplicate comments dropped, code unchanged. +// Contains code Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). // // Open-addressing hash table from fixed-length byte keys -> pointers (linear probing + backward shift on deletion, no // tombstones). The replay hot path uses it instead of a boxed dictionary: keys are not boxed, no allocation, a lookup diff --git a/runtime/nvn_obj.h b/runtime/nvn_obj.h index 4221e564..38c775d4 100644 --- a/runtime/nvn_obj.h +++ b/runtime/nvn_obj.h @@ -1,10 +1,10 @@ -// Ported from MacNativeGames games//third_party/d2r_gfx/gfx/nvn/nvn_obj.h and the two types of nvn_tex.h @ b75be8cf (MIT, Copyright (c) 2026 jhaizhou; origin d2r-mobile); Metal entry points dropped, layouts unchanged. -// NVN host-side object layout and command record format: shared by hle_nvn.c (interface layer, writes) and nvn_mtl.m (Metal replay layer, reads). +// Contains code Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). +// NVN host-side object layout and command record format: shared by the interface layer (writes) and the replay layers (reads). // Objects are stored in place in the NVN object memory allocated by the game, with size not exceeding the reserved size in nvn.h (FITS static assertion). // State objects (Blend / Color / ... 4–0x18 bytes) are small structs the game copies by value; their layout is packed in place with bit-fields. // -// In this port the interface layer is runtime/nvn_api_*.c and nvn_ext.c, and the replay layers are the back ends of -// gfx.h (GfxBackend). +// The interface layer is runtime/nvn_api_*.c and nvn_ext.c, and the replay layers are the back ends of gfx.h +// (GfxBackend). #pragma once #include #include diff --git a/runtime/nvn_pool_index.h b/runtime/nvn_pool_index.h index e39e5bc7..e9f1d4a6 100644 --- a/runtime/nvn_pool_index.h +++ b/runtime/nvn_pool_index.h @@ -1,5 +1,4 @@ -// Ported from MacNativeGames games//third_party/d2r_gfx/gfx/nvn/nvn_pool_index.h @ b75be8cf (MIT, Copyright (c) -// 2026 jhaizhou; origin d2r-mobile); code unchanged, the Metal residency note of `res` generalised. +// Contains code Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). #pragma once /* NX2NAVI: memory pools sorted by guest address. The world scene keeps about 3,200 pools alive, and the replay resolves several dozen buffer addresses per draw diff --git a/runtime/nvn_probe.c b/runtime/nvn_probe.c index a6bfad45..c74a0d73 100644 --- a/runtime/nvn_probe.c +++ b/runtime/nvn_probe.c @@ -10,8 +10,7 @@ // - the proc table: every name of nvn_procs.inc resolves to its own synthetic address, an unknown name to NULL; // - named fatal stubs stop with their name, each in a child process (this executable again, NX2NAVI_PROBE_NVN_CHILD). // The 40 layout goldens themselves are run by --probe-nvn-tex against nvn_tex.c; here four of them go through the procs. -// Ported in part from MacNativeGames games//tests/texture_auto_layout/probe.c @ b75be8cf (MIT, Copyright (c) 2026 -// jhaizhou; origin d2r-mobile): the golden metadata, which holds no game bytes. +// Contains code Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). The golden metadata holds no game bytes. #include #include #include @@ -157,7 +156,7 @@ static void probe_buffers(void) { CALL(nvnBufferBuilderSetStorage, U(&bufb), U(&pool), 0x100, 0x200); CHECK((uint8_t)CALL(nvnBufferInitialize, U(&buf), U(&bufb)) == 1, "BufferInitialize"); CHECK(CALL(nvnBufferGetAddress, U(&buf)) == U(pmem) + 0x100 && CALL(nvnBufferMap, U(&buf)) == U(pmem) + 0x100, - "buffer address and map are pool storage + offset (MNG hle_nvn.c:237, 248)"); + "buffer address and map are pool storage + offset"); CHECK(CALL(nvnBufferGetSize, U(&buf)) == 0x200 && CALL(nvnBufferGetMemoryOffset, U(&buf)) == 0x100 && CALL(nvnBufferGetMemoryPool, U(&buf)) == U(&pool), "buffer size, offset and pool"); CALL(nvnBufferFlushMappedRange, U(&buf), 0, 0x200); diff --git a/runtime/nvn_tex.c b/runtime/nvn_tex.c index 63d62a82..4c5c6242 100644 --- a/runtime/nvn_tex.c +++ b/runtime/nvn_tex.c @@ -1,5 +1,5 @@ // NVN texture storage size / alignment / per-level offsets (Tegra X1 block-linear layout). -// Based on deko3d source/dk_image.cpp (zlib license, Copyright (C) 2018-2020 fincs), reproduced below as in MNG's LICENSE.deko3d. +// Contains altered code Copyright (C) 2018-2020 fincs (zlib, license text below; see THIRD_PARTY_NOTICES.md). // // Copyright (C) 2018-2020 fincs // @@ -21,7 +21,7 @@ // distribution. // // Storage size / alignment / per-level offsets of NVN textures (Tegra X1 block-linear layout). -// Based on deko3d source/dk_image.cpp (zlib license, Copyright (C) 2018-2020 fincs), with NVN SDK integer rounding for automatic tile height: +// Automatic tile height uses NVN SDK integer rounding: // one GOB = 64 bytes × 8 rows = 512 bytes; the block height (tileH, in GOBs) is picked by 'height×1.5'; levels are accumulated with block alignment. // The game's packaged textures (SetPackagedTextureLayout) carry 8 bytes of layout parameters: byte 0 = log2 of the block height (derived by comparing 16 cases from the real game, // 4 of which differ from the automatic algorithm); when present it takes precedence. diff --git a/runtime/nvn_tex.h b/runtime/nvn_tex.h index 0d187191..844922ff 100644 --- a/runtime/nvn_tex.h +++ b/runtime/nvn_tex.h @@ -1,5 +1,5 @@ // NVN texture storage layout (Tegra X1 block-linear), see nvn_tex.c. -// Ported from MacNativeGames games//third_party/d2r_gfx/gfx/nvn/nvn_tex.h @ b75be8cf (zlib, deko3d-derived; see nvn_tex.c). +// Contains altered code Copyright (C) 2018-2020 fincs (zlib, license text in nvn_tex.c; see THIRD_PARTY_NOTICES.md). // nvn_texdesc and nvn_texlayout are defined in nvn_obj.h. #pragma once #include diff --git a/runtime/nvn_tex_probe.c b/runtime/nvn_tex_probe.c index ab80dfcb..841cca40 100644 --- a/runtime/nvn_tex_probe.c +++ b/runtime/nvn_tex_probe.c @@ -1,5 +1,5 @@ // nx2navi.exe --probe-nvn-tex: texture storage size, block height, alignment and mip offsets of nvn_tex.c. -// Ported from MacNativeGames games//tests/texture_auto_layout/probe.c @ b75be8cf (MIT, Copyright (c) 2026 jhaizhou). +// Contains code Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). // The 40 size and block-height goldens are original-SDK CPU queries for uncompressed and BC3-sRGB boundary cases; no game bytes. // The old rounded-up heuristic mismatches 16 of them, including the 160x160 case. Block-linear address checks // belong to the deswizzler and are not part of this probe. diff --git a/runtime/ov_gfx.c b/runtime/ov_gfx.c index 7fe6f6b1..7c6d78d3 100644 --- a/runtime/ov_gfx.c +++ b/runtime/ov_gfx.c @@ -1,6 +1,5 @@ -// Adapted from MacNativeGames games//runtime/frontend.m (nn::vi, lines 345-359) and gfx_bridge.c (nv, lines -// 74-86) @ b75be8cf (MIT, Copyright (c) 2026 MacNativeGames contributors). The nvnBootstrapLoader stop is the entry -// to the NVN layer. +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). +// The nvnBootstrapLoader stop is the entry to the NVN layer. // Graphics bring-up: // nv::* record the game's allocator callbacks and graphics work memory (guest addresses) for the NVN layer // nn::vi::* display, layer and native window identities; the vsync event is bound here diff --git a/runtime/ov_input.c b/runtime/ov_input.c index 07e37d1d..58f684e1 100644 --- a/runtime/ov_input.c +++ b/runtime/ov_input.c @@ -1,5 +1,4 @@ -// Adapted from MacNativeGames games//runtime/input.c and hid_feedback.c @ b75be8cf (MIT, Copyright (c) 2026 -// MacNativeGames contributors). +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). // nn::hid overrides: one connected controller fed by input_poll (gamepad and keyboard, // runtime/input_win.c; nothing pressed with NX2NAVI_INPUT=none). Docked (default) it is a full-key controller as player 1 (id 0, style bit 0); with // NX2NAVI_OPERATION_MODE=handheld it is the handheld controller (id 0x20, style bit 1) and player 1 is not connected, diff --git a/runtime/ov_media.c b/runtime/ov_media.c index cf9a7e33..446afb0a 100644 --- a/runtime/ov_media.c +++ b/runtime/ov_media.c @@ -1,5 +1,4 @@ -// Adapted from MacNativeGames games//runtime/opus_codec.c @ b75be8cf (MIT, Copyright (c) 2026 MacNativeGames -// contributors). +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). // The hardware Opus decoder (nn::codec), decoded with libopus on the host. The software keyboard (nn::swkbd) is // in swkbd_win.c. #include diff --git a/runtime/ov_movie.c b/runtime/ov_movie.c index ff785367..fde5bc5a 100644 --- a/runtime/ov_movie.c +++ b/runtime/ov_movie.c @@ -1,5 +1,4 @@ -// Adapted from MacNativeGames games//runtime/movie_host.c @ b75be8cf (MIT, Copyright (c) 2026 MacNativeGames -// contributors). +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). // movie::Decoder for VP9 on the host with libvpx (BSD-3-Clause, linked statically). // NX2navi's pre-rendered movies (Event/Movie/*.webm, 28 files: VP9 profile 0, 1920x1080, 30 fps, video only) play through // the SDK movie library in subsdk0, Android's MediaCodec over NVIDIA NvMM. Its decoder opens NVDEC through NvRm, whose diff --git a/runtime/ov_system.c b/runtime/ov_system.c index f27573cb..89a050c6 100644 --- a/runtime/ov_system.c +++ b/runtime/ov_system.c @@ -1,5 +1,4 @@ -// Adapted from MacNativeGames games//runtime/services.c (lines 208-302), applet_host.c, account.c, time_host.c and -// shared_font.c @ b75be8cf (MIT, Copyright (c) 2026 MacNativeGames contributors). +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). // System service overrides: nn::oe, applet, am, prepo, nfp, err, aoc, pctl, diag, // account, time and pl, and the six observers. Nothing here talks to a Horizon service; each call is answered by the // host. Stub rule: queries and initialisation succeed with neutral values, data paths stop with a named fatal. diff --git a/runtime/perfmon.c b/runtime/perfmon.c index f2f01beb..d320ebcd 100644 --- a/runtime/perfmon.c +++ b/runtime/perfmon.c @@ -5,16 +5,12 @@ // from the GPU vendor's driver library, loaded at run time: NVML on NVIDIA, ADL's PM log on AMD; on a machine without // either their numbers stay -1. // -// Adapted from SavageWindRecomp's runtime/perfmon.c (https://github.com/Revivedx/SavageWindRecomp @ -// 575ad88e02f9a89a9a885d90039d48af33c982f4, MIT, Copyright (c) 2026 Revivedx and the Savage Wind Recomp contributors, -// Copyright (c) 2026 Peiikai): the frame ring and its one-second summary, the NVML calls, the sampler loop. The -// Windows, Linux and macOS sampling moved behind platform.h, GPU load and video memory come from the system's counters -// for every vendor, and the sampler stops when the overlay leaves full. +// Contains code Copyright (c) 2026 Revivedx and the Savage Wind Recomp contributors, Copyright (c) 2026 Peiikai (MIT; see +// THIRD_PARTY_NOTICES.md). GPU load and video memory come from the system's counters for every vendor; the sampler +// stops when the overlay leaves full. // // The ADL declarations (AdapterInfo, ADLSingleSensorData, ADLPMLogDataOutput, the ADL_PMLOG_* sensor numbers and the -// ADL2_* signatures) are copied from AMD's display-library include/adl_structures.h, adl_defines.h and adl_sdk.h -// (https://github.com/GPUOpen-LibrariesAndSDKs/display-library @ 84c881cb2136f04287eb3af12de00a9e2867aa9e, MIT, -// Copyright (c) 2016 - 2022 Advanced Micro Devices, Inc.). +// ADL2_* signatures) contain code Copyright (c) 2016 - 2022 Advanced Micro Devices, Inc. (MIT; see THIRD_PARTY_NOTICES.md). #include #include #include diff --git a/runtime/perfmon.h b/runtime/perfmon.h index 16dd30f6..313dfef4 100644 --- a/runtime/perfmon.h +++ b/runtime/perfmon.h @@ -2,9 +2,8 @@ // from the perf counters, and the machine's CPU, memory and GPU load and temperatures. A value the machine does not give // is negative. // -// Adapted from SavageWindRecomp's runtime/perfmon.h (https://github.com/Revivedx/SavageWindRecomp @ -// 575ad88e02f9a89a9a885d90039d48af33c982f4, MIT, Copyright (c) 2026 Revivedx and the Savage Wind Recomp contributors, -// Copyright (c) 2026 Peiikai). +// Contains code Copyright (c) 2026 Revivedx and the Savage Wind Recomp contributors, Copyright (c) 2026 Peiikai (MIT; see +// THIRD_PARTY_NOTICES.md). #pragma once #include diff --git a/runtime/platform/win32.c b/runtime/platform/win32.c index c643ebcb..f9c64396 100644 --- a/runtime/platform/win32.c +++ b/runtime/platform/win32.c @@ -624,8 +624,8 @@ int plat_mem_state(uint64_t addr, uint64_t limit, uint64_t *end) { return p == PAGE_READWRITE ? PLAT_PROT_RW : p == PAGE_READONLY ? PLAT_PROT_READ : PLAT_PROT_NONE; } -// Adapted from LAS Recomp runtime/platform/windows.c:40-63 @ da35b83 (MIT, Copyright (c) 2026 Peiikai): GetWriteWatch -// with the reset flag. +// Contains code Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). +// GetWriteWatch with the reset flag. uint64_t plat_mem_written(uint64_t addr, uint64_t n, uint64_t *pages, uint64_t max, int reset) { if (!max || !n) return 0; ULONG_PTR got = (ULONG_PTR)max; diff --git a/runtime/resolution.c b/runtime/resolution.c index 23542f27..3dc1ee36 100644 --- a/runtime/resolution.c +++ b/runtime/resolution.c @@ -1,9 +1,8 @@ // Game resolution: the size the game composes its frame in (its output: canvas, UI and swapchain) and the size of its // 3D scene, above the shipped 1920x1080 and 1600x900. The game does the rendering itself, as with the community -// resolution mods: the patch sets output and scene (recomp/patches-v121.txt, -// patches-v143.txt; MacNativeGames games//runtime/game_patches.c and game_patches_v143.c, MIT, Copyright (c) 2026 -// MacNativeGames contributors) make the game read both sizes from the patch page, and the texture heap that holds the -// output- and scene-sized render targets grows with them. +// resolution mods: the patch sets output and scene (recomp/patches-v121.txt, patches-v143.txt) make the game read both +// sizes from the patch page, and the texture heap that holds the output- and scene-sized render targets grows with them. +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). // // Settings, read at start: NX2NAVI_OUTPUT_RES = x (default 1920x1080, the game's own), NX2NAVI_RENDER_SCALE = the // scene's size relative to the output: "game" (default, 5/6, the game's 1600x900 at 1080p) or a percentage; above 100 diff --git a/runtime/romfs.c b/runtime/romfs.c index 8170b66d..86db66b6 100644 --- a/runtime/romfs.c +++ b/runtime/romfs.c @@ -1,5 +1,4 @@ -// Adapted from MacNativeGames games//runtime/romfs.c @ b75be8cf (MIT, Copyright (c) 2026 MacNativeGames -// contributors). +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). // Read-only game RomFS backed by the player's extracted image. // // Input: /romfs.bin (rt_config()->romfs), whose six IVFC levels and SHA-256 tools/extract.py verified, and diff --git a/runtime/romfs_path.h b/runtime/romfs_path.h index 5f3edb0d..e2c54266 100644 --- a/runtime/romfs_path.h +++ b/runtime/romfs_path.h @@ -1,5 +1,4 @@ -// From MacNativeGames games//runtime/romfs_path.h @ b75be8cf (MIT, Copyright (c) 2026 MacNativeGames -// contributors). +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). // RomFS path validation shared by the runtime (romfs.c) and its probe (fs_host.c probe_fs). #pragma once #include diff --git a/runtime/shaders/astc_decode.comp b/runtime/shaders/astc_decode.comp index a6c96548..35e0b6a9 100644 --- a/runtime/shaders/astc_decode.comp +++ b/runtime/shaders/astc_decode.comp @@ -1,5 +1,5 @@ -// ASTC LDR 2D decode to RGBA8 on the GPU, one invocation per texel. Ported from runtime/tex_astc.c (itself from LAS -// Recomp runtime/nvn/astc.c @ da35b83a, MIT, Copyright (c) 2026 Peiikai), so the output is the same bytes as +// ASTC LDR 2D decode to RGBA8 on the GPU, one invocation per texel. Contains code Copyright (c) 2026 Peiikai (MIT; see +// THIRD_PARTY_NOTICES.md). Ported from runtime/tex_astc.c, so the output is the same bytes as // astc_decode_ldr and astcenc's 8-bit decode: endpoints expand to 16 bits (linear v * 257, sRGB v << 8 | 0x80), // texel = (e0 * (64 - w) + e1 * w + 32) >> 6, top 8 bits. Error blocks are magenta; HDR endpoint modes give magenta // endpoints for their partition. diff --git a/runtime/simd.h b/runtime/simd.h index d8fb45c8..aaeaa2ff 100644 --- a/runtime/simd.h +++ b/runtime/simd.h @@ -1,4 +1,4 @@ -// Adapted from LAS Recomp runtime/simd.h @ da35b83 (MIT, Copyright (c) 2026 Peiikai). +// Contains code Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). // Portable C lowering of AArch64 FP / AdvSIMD / crypto / CRC32 (tools/simd_c.py emits calls with constant // fields; everything is always_inline so the size/lane/op switches fold at -O1). // Semantics follow the ARM pseudocode, not the host: NaN propagation (first signalling NaN quietened, then diff --git a/runtime/simd_fp.h b/runtime/simd_fp.h index 5593bb5b..a82db6f5 100644 --- a/runtime/simd_fp.h +++ b/runtime/simd_fp.h @@ -1,4 +1,4 @@ -// Adapted from LAS Recomp runtime/simd_fp.h @ da35b83 (MIT, Copyright (c) 2026 Peiikai). +// Contains code Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). // FP helpers for one precision; included twice by simd.h (F = s/float, d/double). No include guard. // Scalar entry points take/return T, vector ones VT (all lanes; callers zero the unused half for Q=0). diff --git a/runtime/svc.c b/runtime/svc.c index f7d72584..ccc40c6a 100644 --- a/runtime/svc.c +++ b/runtime/svc.c @@ -1,5 +1,4 @@ -// Adapted from MacNativeGames games//runtime/services.c @ b75be8c (MIT, Copyright (c) 2026 MacNativeGames -// contributors), lines 304-382. +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). // The SVC entry of the lifted code: preemption checkpoint, trace, then the thread and // synchronization SVCs (kernel.c), IPC (ipc.c), memory (memory.c), Break, OutputDebugString, GetInfo and ExitProcess. The 21 SVCs // NX2navi has but never reaches on its boot path stop with a named fatal, the caller and the guest backtrace. diff --git a/runtime/swkbd.c b/runtime/swkbd.c index 9ca874b7..d6a3320f 100644 --- a/runtime/swkbd.c +++ b/runtime/swkbd.c @@ -1,7 +1,5 @@ -// Adapted from MacNativeGames games//runtime/swkbd_host.c @ b75be8cf (MIT, Copyright (c) 2026 MacNativeGames -// contributors): the ShowKeyboardArg offsets, the UTF-8/UTF-16 conversions, the disabled-key filter and the result codes. -// The macOS text bar is replaced by a window of the host (swkbd.h text_entry_run: swkbd_win.c with Win32, swkbd_sdl.c -// with SDL). +// Contains code Copyright (c) 2026 MacNativeGames contributors (MIT; see THIRD_PARTY_NOTICES.md). +// The text entry is a window of the host (swkbd.h text_entry_run: swkbd_win.c with Win32, swkbd_sdl.c with SDL). // // nn::swkbd::ShowKeyboard: text entry for the game. On the Switch the call starts the keyboard library applet, which // takes the screen until the player confirms or cancels. NX2navi calls it in one place, naming a horse at a stable diff --git a/runtime/tex_astc.c b/runtime/tex_astc.c index 0ce87e81..99074652 100644 --- a/runtime/tex_astc.c +++ b/runtime/tex_astc.c @@ -1,4 +1,4 @@ -// ASTC LDR decoder ported from LAS Recomp runtime/nvn/astc.c @ da35b83a (MIT, Copyright (c) 2026 Peiikai); only the include changed. +// Contains code Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). // ASTC LDR decoder, 2D only (Khronos Data Format spec, ASTC chapter). Matches ARM astcenc's 8-bit // decode bit for bit (the decode_unorm8 path its CLI uses for -dl / -ds into 8-bit images): // endpoints expand to 16 bits (linear: v * 257, sRGB: v << 8 | 0x80, all four channels), diff --git a/runtime/tex_deswizzle.c b/runtime/tex_deswizzle.c index eefcdbb8..cd78eb63 100644 --- a/runtime/tex_deswizzle.c +++ b/runtime/tex_deswizzle.c @@ -1,5 +1,5 @@ // Tegra X1 block-linear <-> linear copies. -// Ported from MacNativeGames games//third_party/d2r_gfx/gfx/tex/nvn_deswizzle.c @ b75be8cf (MIT, Copyright (c) 2026 jhaizhou); comments translated, the copy loop split out as tex_bl_copy. +// Contains code Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). // // Layout (from public descriptions): // GOB = 64 bytes x 8 rows = 512 bytes; offset of (x byte, y row) within a GOB = diff --git a/runtime/ui/menu.cpp b/runtime/ui/menu.cpp index 1bb02514..dcd4f6a3 100644 --- a/runtime/ui/menu.cpp +++ b/runtime/ui/menu.cpp @@ -2,14 +2,14 @@ // end on our device and the menu's pages. Free of any window system (menu.h). ImGui runs on the present path only, // under gfx_present.c's present lock; the event functions only queue. // -// The Vulkan set-up follows LAS Recomp's runtime/nvn/vulkan/imgui_glue.cpp (https://github.com/peiikai/LASRecomp @ -// da35b83a9611d046a9a681aae668d7085954d37f, MIT, Copyright (c) 2026 Peiikai): dynamic rendering into the swapchain -// image, an internal descriptor pool, vertex buffers rotated over more frames than are in flight. +// The Vulkan set-up: dynamic rendering into the swapchain image, an internal descriptor pool, vertex buffers rotated +// over more frames than are in flight. // -// The look (colours, rounding, the tab bar with L / R and Q / E, the window over a dimmed game) follows -// SavageWindRecomp's runtime/ui/menu.mm (https://github.com/Revivedx/SavageWindRecomp @ -// 575ad88e02f9a89a9a885d90039d48af33c982f4, MIT, Copyright (c) 2026 Revivedx and the Savage Wind Recomp contributors, -// Copyright (c) 2026 Peiikai); the pages are rows of option_rows.cpp. +// The look: colours, rounding, the tab bar with L / R and Q / E, the window over a dimmed game. The pages are rows of +// option_rows.cpp. +// +// Contains code Copyright (c) 2026 Peiikai, Copyright (c) 2026 Revivedx and the Savage Wind Recomp contributors (MIT; see +// THIRD_PARTY_NOTICES.md). #include #include #include diff --git a/runtime/ui/option_rows.cpp b/runtime/ui/option_rows.cpp index 1a6275f6..b8dfa8ec 100644 --- a/runtime/ui/option_rows.cpp +++ b/runtime/ui/option_rows.cpp @@ -1,10 +1,9 @@ // Two-pane settings pages (option_rows.h): rows on the left, the selected or hovered row's description on the right. // -// Adapted from SavageWindRecomp's runtime/ui/option_rows.mm (https://github.com/Revivedx/SavageWindRecomp @ -// 575ad88e02f9a89a9a885d90039d48af33c982f4, MIT, Copyright (c) 2026 Revivedx and the Savage Wind Recomp contributors, -// Copyright (c) 2026 Peiikai): the row look, the two panes, the left / right stepping and the hold speed-up. The rows -// read and write cfg keys instead of a settings struct, take their text from the menu catalog (menu_text), and show -// the default, "after restart" and environment notes; the text field, radio and on-screen keyboard rows are not ported. +// Contains code Copyright (c) 2026 Revivedx and the Savage Wind Recomp contributors, Copyright (c) 2026 Peiikai (MIT; see +// THIRD_PARTY_NOTICES.md). +// The rows read and write cfg keys, take their text from the menu catalog (menu_text), and show the default, "after +// restart" and environment notes. #include #include #include diff --git a/runtime/vk_device.c b/runtime/vk_device.c index 21fe2204..aa045f1c 100644 --- a/runtime/vk_device.c +++ b/runtime/vk_device.c @@ -1,7 +1,6 @@ // Vulkan instance, physical device choice, logical device, VMA, timeline semaphore and the validation messenger. -// Ported from LAS Recomp, runtime/nvn/vulkan/device.c:33-330 -// (https://github.com/peiikai/LASRecomp @ da35b83a9611d046a9a681aae668d7085954d37f, MIT, Copyright (c) 2026 Peiikai), -// without SDL. The VMA implementation is runtime/vk_vma.cpp (VMA is C++ only). +// Contains code Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). +// The VMA implementation is runtime/vk_vma.cpp (VMA is C++ only). #include #include #include diff --git a/runtime/vk_exec.c b/runtime/vk_exec.c index b84a4bd8..ff50339c 100644 --- a/runtime/vk_exec.c +++ b/runtime/vk_exec.c @@ -5,14 +5,10 @@ // stay in VK_IMAGE_LAYOUT_GENERAL (vk_texture.c); full memory barriers order passes, clears and whatever those two // record between them. // -// The op loop (END / BEGIN / JUMP / CALL, which ops are pure state, the state defaults, render targets kept until they -// change, clears skipped while rendering is disabled) follows MacNativeGames -// games//third_party/d2r_gfx/gfx/nvn/nvn_mtl.m:10588-10700, 7409-7460, 5449-5457 -// (https://github.com/ly05010419/MacNativeGames @ b75be8cfa704df3701e86130c8ced268e79d6b11, MIT, Copyright (c) 2026 -// jhaizhou). Pass begin and end (GENERAL-layout attachments, LOAD/STORE, render area from the smallest attachment, a -// full barrier before each pass), the scissor clip and attachment clears follow LAS Recomp -// runtime/nvn/vulkan/exec.c:855-1149, 3553-3778 (https://github.com/peiikai/LASRecomp @ -// da35b83a9611d046a9a681aae668d7085954d37f, MIT, Copyright (c) 2026 Peiikai). +// The op loop handles END / BEGIN / JUMP / CALL and the pure-state ops, applies the state defaults, keeps render targets +// until they change and skips clears while rendering is disabled. A pass has GENERAL-layout attachments, LOAD/STORE and +// a render area from the smallest attachment, with a full barrier before it. +// Contains code Copyright (c) 2026 jhaizhou, Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). #include #include #include diff --git a/runtime/vk_exec.h b/runtime/vk_exec.h index c371a801..7680d2d3 100644 --- a/runtime/vk_exec.h +++ b/runtime/vk_exec.h @@ -3,8 +3,7 @@ // (vk_exec_draw.c) and copies, counters, events and conditional rendering (vk_exec_xfer.c) plug in through the two // hooks at the bottom. // Runs on the submitting thread under vk_sync_submit's lock: no locking inside. -// The op loop follows MacNativeGames nvn_mtl.m (MIT, Copyright (c) 2026 jhaizhou) and the pass handling LAS Recomp -// (MIT, Copyright (c) 2026 Peiikai); vk_exec.c names the sources. +// Contains code Copyright (c) 2026 jhaizhou, Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). #pragma once #include diff --git a/runtime/vk_exec_draw.c b/runtime/vk_exec_draw.c index 71dd88e9..fd6b8abe 100644 --- a/runtime/vk_exec_draw.c +++ b/runtime/vk_exec_draw.c @@ -10,11 +10,8 @@ // reported with vk_gpu_written, from one completion callback once the submission's fence is done (the write watch // does not see GPU writes). Nothing here locks: it runs on the submitting thread under vk_sync_submit's lock. // -// Provenance: the op semantics (bind ops, program and slot conventions, draw and dispatch flow, vertex streams with a -// zeroed buffer for unbound ones) follow MacNativeGames games//third_party/d2r_gfx/gfx/nvn/nvn_mtl.m:7409-7460, -// 9365-9488, 9489-9921, 10013-10079 @ b75be8cf (MIT, Copyright (c) 2026 jhaizhou); the uniform-buffer spans, texture and -// sampler descriptor lookups and the dispatch flow follow LAS Recomp runtime/nvn/vulkan/exec.c:1851-1908, 2300-2516 -// @ da35b83a (MIT, Copyright (c) 2026 Peiikai). The support buffer layout is the translator's SupportBuffer. +// Unbound vertex streams read a zeroed buffer. The support buffer layout is the translator's SupportBuffer. +// Contains code Copyright (c) 2026 jhaizhou, Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). #include #include #include @@ -1113,7 +1110,7 @@ static VkDescriptorBufferInfo ubo_info(VkExec *ex, int st, int slot) { // (cbuf_slot 0, handle = word offset): 16-byte entries at byte 0x110 (vertex), 0x510 (fragment) and 0x310 (compute). // A compute address at c0 0x210..0x30f is uniform block (offset - 0x210) / 16 read as storage: *ubo is set. -1: the // address is not in c0 (the shader loads it from a user uniform block: ubo_ptr) or the stage has no known table. -// Mapping: MacNativeGames games//tools/nx2navi_xlate/Service.cs:206-222 @ b75be8cf (MIT, Copyright (c) 2026 jhaizhou). +// Contains code Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). static int ssbo_slot(const GfxShaderRes *r, int st, int *ubo) { *ubo = 0; if (r->cbuf_slot != 0) return -1; diff --git a/runtime/vk_exec_xfer.c b/runtime/vk_exec_xfer.c index ca85f672..644c17bb 100644 --- a/runtime/vk_exec_xfer.c +++ b/runtime/vk_exec_xfer.c @@ -28,11 +28,7 @@ // renders. // Copies and CLEAR_TEX are not conditional. // -// The copy semantics (region and layer arithmetic, row and image strides, whole-level clears, copy / blit / resolve -// choice) follow MacNativeGames games//third_party/d2r_gfx/gfx/nvn/nvn_mtl.m:10080-10368, 10618-10642, 1700-1725 -// (https://github.com/ly05010419/MacNativeGames @ b75be8cfa704df3701e86130c8ced268e79d6b11, MIT, Copyright (c) 2026 -// jhaizhou) and LAS Recomp runtime/nvn/vulkan/exec.c:3045-3235 (https://github.com/peiikai/LASRecomp @ -// da35b83a9611d046a9a681aae668d7085954d37f, MIT, Copyright (c) 2026 Peiikai). +// Contains code Copyright (c) 2026 jhaizhou, Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). #include #include #include diff --git a/runtime/vk_formats.c b/runtime/vk_formats.c index 561eab6b..f90ca290 100644 --- a/runtime/vk_formats.c +++ b/runtime/vk_formats.c @@ -1,6 +1,6 @@ // NVN format -> VkFormat for the textures of the graphics layer. -// Ported from the format table of LAS Recomp runtime/nvn/vulkan/textures.c @ da35b83a (MIT, Copyright (c) 2026 Peiikai). -// Differences from the original table: the table is indexed by the NVNformat values of nvn.h and covers all of them, ASTC decodes to +// Contains code Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). +// The table is indexed by the NVNformat values of nvn.h and covers all of them, ASTC decodes to // RGBA8 unless the device samples it (vk_astc.c, NX2NAVI_ASTC), D24S8 is always D32S8 (no probing: the RX 9070 lacks // it), 3-component formats expand to 4 components, and formats with no Vulkan equivalent are reported with a reason. #include diff --git a/runtime/vk_memory.c b/runtime/vk_memory.c index 75b39165..9df2a358 100644 --- a/runtime/vk_memory.c +++ b/runtime/vk_memory.c @@ -2,12 +2,10 @@ // buffers, the virtual-pool page table, GPU address resolution, page write generations for re-uploads, and the // upload batch (command buffer, staging buffers, deferred destruction) that vk_texture.c records into. // -// Behaviour ported from MacNativeGames games//third_party/d2r_gfx/gfx/nvn/nx2navi_vpool.c (request checks, unmap -// semantics, 64 KiB pages) and nvn_dirty.c (generation stamps: a texture is stale when a covered page carries a -// generation newer than its upload), @ b75be8cf (MIT, Copyright (c) 2026 jhaizhou; origin d2r-mobile); and from LAS -// Recomp runtime/nvn/vulkan/exec.c:2094-2131 (vk_pages_changed: every write-watch query resets the OS bits, so each -// query stamps the pages it saw with a new generation shared by all users) and textures.c:240-270 (deferred -// destruction) @ da35b83a (MIT, Copyright (c) 2026 Peiikai). Virtual pools are a GPU-side page table +// Contains code Copyright (c) 2026 jhaizhou, Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). +// Virtual pools have 64 KiB pages. A texture is stale when a covered page carries a generation newer than its upload; +// every write-watch query resets the OS bits, so each query stamps the pages it saw with a new generation shared by all +// users. Virtual pools are a GPU-side page table // over device-local memory and dirty pages come from GetWriteWatch (mem_written_pages), so neither host VM aliasing // nor page protection (a fault handler) is needed. #include diff --git a/runtime/vk_pipeline.c b/runtime/vk_pipeline.c index 1299fad7..c0efc67d 100644 --- a/runtime/vk_pipeline.c +++ b/runtime/vk_pipeline.c @@ -35,12 +35,9 @@ // class, depth clip mode, logic op and what is not dynamic on the GPU. The VkPipelineCache persists to // pipeline-cache.bin next to nx2navi.exe (NX2NAVI_PIPELINE_CACHE overrides the path). // -// Provenance: the NVN -> Vulkan enum mappings (blend factors and equations, compare functions, stencil ops), the vertex -// format table with its 3-component fallback and the pipeline cache file handling follow LAS Recomp -// runtime/nvn/vulkan/exec.c and device.c @ da35b83a (MIT, Copyright (c) 2026 Peiikai); the pipeline state the key holds -// (program, target formats, blend and write masks, vertex layout, sample count) and the varying fix-up follow -// MacNativeGames games//third_party/d2r_gfx/gfx/nvn/nvn_mtl.m pso_key_fill / pso_desc / msl_varyings and its vfmt -// table @ b75be8cf (MIT, Copyright (c) 2026 jhaizhou); the binding conventions are those of the shader translator. +// The vertex format table has a 3-component fallback. The pipeline key holds the program, target formats, blend and +// write masks, vertex layout and sample count. The binding conventions are those of the shader translator. +// Contains code Copyright (c) 2026 Peiikai, Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). #include #include #include diff --git a/runtime/vk_sync.c b/runtime/vk_sync.c index 091ddf29..98eccb12 100644 --- a/runtime/vk_sync.c +++ b/runtime/vk_sync.c @@ -5,12 +5,9 @@ // effects queued for each value (event writes, counter reports, sync state), then frees the memory and texture objects whose users // completed. A value counts as done only after its side effects ran, so a guest woken by fence_wait sees them. // -// The submission shape (one timeline value per submission, signalled at ALL_COMMANDS, vkWaitSemaphores for waits, a -// failed wait treated as a lost device) follows LAS Recomp runtime/nvn/vulkan/exec.c:39-110, 355-397 -// (https://github.com/peiikai/LASRecomp @ da35b83a9611d046a9a681aae668d7085954d37f, MIT, Copyright (c) 2026 Peiikai). -// Side effects written after GPU completion, as MacNativeGames does: games//third_party/d2r_gfx/gfx/nvn/hle_nvn.c:7-9 -// (https://github.com/ly05010419/MacNativeGames @ b75be8cfa704df3701e86130c8ced268e79d6b11, MIT, Copyright (c) 2026 -// jhaizhou; origin d2r-mobile). +// One timeline value per submission, signalled at ALL_COMMANDS; waits use vkWaitSemaphores, and a failed wait is +// treated as a lost device. +// Contains code Copyright (c) 2026 Peiikai, Copyright (c) 2026 jhaizhou (MIT; see THIRD_PARTY_NOTICES.md). #include #include diff --git a/runtime/vk_texture.c b/runtime/vk_texture.c index 679e3881..b44b0e13 100644 --- a/runtime/vk_texture.c +++ b/runtime/vk_texture.c @@ -3,12 +3,9 @@ // re-uploads when page write generations (vk_memory.c) show the storage written, ReadTexels / WriteTexels, the texture // and sampler descriptor slots, and VkSamplers. // -// Behaviour ported from MacNativeGames games//third_party/d2r_gfx/gfx/nvn @ b75be8cf (MIT, Copyright (c) 2026 -// jhaizhou; origin d2r-mobile): which textures mirror their pool memory (nvn_mtl.m tex_mirrored, 3347-3362), the -// "GPU-owned" rule that stops re-uploads once the GPU rendered into a mirrored texture (nvn_mtl.m tex_mtl, 3366-3372), -// the live texture at a storage address that a slot of a finalized texture follows (hle_nvn.c:373-393), and -// ReadTexels / WriteTexels (nvn_mtl.m:10105-10195). Image creation, upload regions and samplers are ported from LAS -// Recomp runtime/nvn/vulkan/textures.c:235-330, 778-844 @ da35b83a (MIT, Copyright (c) 2026 Peiikai). +// A texture that mirrors its pool memory (tex_mirrored) stops re-uploading once the GPU rendered into it (the +// "GPU-owned" rule); a slot of a finalized texture follows the live texture at its storage address. +// Contains code Copyright (c) 2026 jhaizhou, Copyright (c) 2026 Peiikai (MIT; see THIRD_PARTY_NOTICES.md). // // Every image lives in VK_IMAGE_LAYOUT_GENERAL. Uploads are recorded into the upload batch of vk_memory.c; the replay // submits it (vk_upload_flush) before a submission that samples the textures.