fix(switch): unhide fused save-dir generated cache on Play

PhysFS does not merge archive data/ with save-dir data/generated, so
fused NX Play crashed after import. Prepend-mount generated trees,
fall back to CacheFs.read in Data:load, keep multiline lua-error logs,
and skip Boot.run when network is unvalidated. T24 stays open.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Andrew Quenehen
2026-08-01 04:55:08 -03:00
parent 6fb5602cb0
commit b1ad7c7254
6 changed files with 101 additions and 5 deletions
+13 -1
View File
@@ -196,7 +196,19 @@ local function loadModule(dir, name)
if not chunk then return false, err end
return pcall(chunk)
end
return pcall(require, "data.generated." .. name)
local ok, mod = pcall(require, "data.generated." .. name)
if ok then return true, mod end
-- Fused PhysFS may hide save-dir data/generated behind the archive's
-- data/ tree even after mountVersion; load bytes explicitly as fallback.
local CacheFs = require("src.import.CacheFs")
local path = "data/generated/" .. name .. ".lua"
local bytes = CacheFs.read(path)
if type(bytes) == "string" then
local chunk, err = loadstring(bytes, "@" .. path)
if not chunk then return false, err or mod end
return pcall(chunk)
end
return false, mod
end
function Data:load()