diff --git a/Core/CmdLine.cpp b/Core/CmdLine.cpp index 692be4b3c3..e2e896bd95 100644 --- a/Core/CmdLine.cpp +++ b/Core/CmdLine.cpp @@ -232,6 +232,7 @@ static const CommandLineParam g_autoParams[] = { {POFF(autoSaveLoadSymbols), CmdParamType::Bool, "auto-save-load-symbols", '\0', "Auto save/load per-module and per-game symbol files (see bAutoSaveLoadSymbols)", CmdLineMode::Both}, {POFF(bootVSH), CmdParamType::Bool, "vsh", '\0', "Boot the VSH (requires files dumped from a PSP in the flash0 directory)"}, {POFF(disableHLE), CmdParamType::Int, "disable-hle", '\0', "Bitmask of libraries to run the real firmware module for instead of our HLE", CmdLineMode::Both}, + {POFF(forceHLE), CmdParamType::Int, "force-hle", '\0', "Bitmask of libraries to run our HLE for, even where the real module is the default", CmdLineMode::Both}, {POFF(memReadAction), CmdParamType::Enum, "memread", '\0', "Set the action for memory read exceptions", CmdLineMode::Both, g_ExceptionActionValues, ARRAY_SIZE(g_ExceptionActionValues)}, {POFF(memWriteAction), CmdParamType::Enum, "memwrite", '\0', "Set the action for memory write exceptions", CmdLineMode::Both, g_ExceptionActionValues, ARRAY_SIZE(g_ExceptionActionValues)}, {POFF(breakAction), CmdParamType::Enum, "break", '\0', "Set the action for break exceptions", CmdLineMode::Both, g_ExceptionActionValues, ARRAY_SIZE(g_ExceptionActionValues)}, @@ -565,6 +566,11 @@ void CommandLineOptions::ApplyToConfig() const { g_Config.DoNotSaveSetting(&g_Config.iDisableHLE); } + if (forceHLE.has_value()) { + g_Config.iForceEnableHLE = forceHLE.value(); + g_Config.DoNotSaveSetting(&g_Config.iForceEnableHLE); + } + if (logLevel.has_value()) { g_logManager.SetAllLogLevels(logLevel.value()); } diff --git a/Core/CmdLine.h b/Core/CmdLine.h index 0ae02fe088..61040e9b60 100644 --- a/Core/CmdLine.h +++ b/Core/CmdLine.h @@ -96,6 +96,10 @@ struct CommandLineOptions { // libraries. Needs a firmware dump under the NAND directory. std::optional disableHLE; + // The opposite: put our HLE back for libraries that now run the real module by default. The + // way to compare the two without editing a config, and the way out if the real one breaks a game. + std::optional forceHLE; + // Headless: install the game update in a .pkg (given as the boot filename) into this // directory, then exit without booting anything. The directory is the game folder itself - // the app puts that under PSP/GAME/, but here the caller picks. See diff --git a/Core/HLE/sceAudiocodec.cpp b/Core/HLE/sceAudiocodec.cpp index acb235ce87..ff84c26412 100644 --- a/Core/HLE/sceAudiocodec.cpp +++ b/Core/HLE/sceAudiocodec.cpp @@ -229,8 +229,12 @@ static int __AudioCodecInitCommon(u32 ctxPtr, int codec, bool mono) { return hleLogError(Log::ME, SCE_KERNEL_ERROR_OUT_OF_RANGE, "Invalid codec"); } + // Re-initialising a context that still has a decoder is normal, not a report-worthy + // surprise: mpeg.prx sizes the allocation through a scratch context of its own and only ever + // releases that one, so the context it actually decodes through still holds a decoder when the + // next movie starts. Once per video, on every game running the real module. if (removeDecoder(ctxPtr)) { - WARN_LOG_REPORT(Log::HLE, "sceAudiocodecInit(%08x, %d): replacing existing context", ctxPtr, codec); + INFO_LOG(Log::HLE, "sceAudiocodecInit(%08x, %d): replacing existing context", ctxPtr, codec); } // Initialize the codec memory. diff --git a/docs/debugging.md b/docs/debugging.md index 5593578ffc..ccdae10d8c 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -178,6 +178,13 @@ it looked in (usually enough to spot that it's the one beside the exe), and exit machine with no firmware would fail. So when a measurement depends on the real module, pass the flag explicitly even though it's on by default, and the run will tell you if it didn't get it. +`--force-hle=` is the other direction, and the one to reach for when deciding whether something is +our fault: it puts our HLE back for libraries that now run the real module by default, so the same +repro can be run both ways and the logs diffed. That is how the leftover warnings in Tekken 6 were +sorted - three appeared identically with `--force-hle=16`, which made them the game's own, and the +fourth only under the real module, which made it ours. Neither `--nand=` pointing somewhere empty +nor `--appendconfig` does this job: the firmware gets found anyway and the setting is per-game. + ## Debugging and breakpoint considerations It might be worth trying the interpreter - all types of breakpoints are the most reliable with this CPU backend.