fix(switch): extend NX-only asset prefix to audio and title/intro art

The previous NX gate only rewrote image paths that go through Assets.resolve.
Pokemon Yellow still had no sound and a blank title screen because:

- ChipSynth reads programs.bin directly via love.filesystem.read, bypassing
  Assets. On NX the unprefixed path is missing when the mount overlay fails,
  so the engine never built and every song/SFX was silent.
- Sound.playPikaCry loads pika_cries WAVs with love.audio.newSource, also
  bypassing Assets.resolve.
- TitleState, YellowIntro, and IntroMovie call love.graphics.newImage
  directly on unprefixed assets/generated paths, so the Pikachu title and
  intro atlases failed to load.

Fix: apply the same NX-only prefix rewrite in those four places.
Desktop/Android keep the existing mountVersion overlay behavior.

Also add ChipSynth._loadBanksForTest and tests covering the new paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Andrew Quenehen
2026-08-03 15:19:15 -03:00
parent f099593136
commit e4ce1063a1
6 changed files with 88 additions and 4 deletions
+1 -1
View File
@@ -136,7 +136,7 @@ local FIGHT_SCRIPT = {
local function tryImage(path)
if not path then return nil end
local ok, img = pcall(love.graphics.newImage, path)
local ok, img = pcall(love.graphics.newImage, require("src.render.Assets").resolve(path))
return ok and img or nil
end
+1 -1
View File
@@ -100,7 +100,7 @@ local CYCLE_FRAMES = 240 -- the original waits ~4s between picks
local function tryImage(path)
if not path then return nil end
local ok, img = pcall(love.graphics.newImage, path)
local ok, img = pcall(love.graphics.newImage, require("src.render.Assets").resolve(path))
return ok and img or nil
end
+1 -1
View File
@@ -220,7 +220,7 @@ local function bobOffset(phase)
end
local function tryImage(path)
local ok, img = pcall(love.graphics.newImage, path)
local ok, img = pcall(love.graphics.newImage, require("src.render.Assets").resolve(path))
return ok and img or nil
end