diff --git a/Core/CoreParameter.h b/Core/CoreParameter.h index dcc8e3093b..2e8e0c090b 100644 --- a/Core/CoreParameter.h +++ b/Core/CoreParameter.h @@ -58,6 +58,7 @@ struct CoreParameter { Path mountIso; // If non-empty, and fileToStart is an ELF or PBP, will mount this ISO in the background to umd1:. Path mountRoot; // If non-empty, and fileToStart is an ELF or PBP, mount this as host0: / umd0:. std::string errorString; + bool loadGameConfigs = true; bool startBreak = false; std::string *collectDebugOutput = nullptr; diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index d2ac9bdcde..f81ce2e220 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -339,7 +339,7 @@ static Path NormalizePath(const Path &path) { #endif } -bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string_view discId, std::string *error_string) { +bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string_view discId, bool loadGameConfigs, std::string *error_string) { // This is really just for headless, might need tweaking later. if (PSP_CoreParameter().mountIsoLoader != nullptr) { std::shared_ptr bd(ConstructBlockDevice(PSP_CoreParameter().mountIsoLoader, error_string)); @@ -441,7 +441,9 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string_view discId, std::stri File::Rename(oldNamePrefix.WithExtraExtension(".jpg"), newPrefix.WithExtraExtension(".jpg")); } - g_Config.LoadGameConfig(discID); + if (loadGameConfigs) { + g_Config.LoadGameConfig(discID); + } return __KernelLoadExec(finalName.c_str(), 0, error_string); } diff --git a/Core/PSPLoaders.h b/Core/PSPLoaders.h index 17e017e49f..e3b47f3a9a 100644 --- a/Core/PSPLoaders.h +++ b/Core/PSPLoaders.h @@ -24,7 +24,7 @@ class FileLoader; class BlockDevice; bool Load_PSP_ISO(FileLoader *fileLoader, std::string *error_string); -bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string_view discId, std::string *error_string); +bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string_view discId, bool loadGameConfigs, std::string *error_string); bool Load_PSP_GE_Dump(FileLoader *fileLoader, std::string *error_string); bool MountGameISO(FileLoader *fileLoader, std::string *errorString); diff --git a/Core/System.cpp b/Core/System.cpp index 0788926fb7..69d3dbfdcb 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -467,7 +467,7 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin dir = ResolvePBPDirectory(Path(dir)).ToString(); pspFileSystem.SetStartingDirectory("ms0:/" + dir.substr(pos)); } - if (!Load_PSP_ELF_PBP(fileLoader, discId, errorString)) { + if (!Load_PSP_ELF_PBP(fileLoader, discId, g_CoreParameter.loadGameConfigs, errorString)) { return false; } break; @@ -478,7 +478,7 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin case IdentifiedFileType::PSP_ELF: { INFO_LOG(Log::Loader, "File is an ELF or loose PBP %s", fileLoader->GetPath().c_str()); - if (!Load_PSP_ELF_PBP(fileLoader, discId, errorString)) { + if (!Load_PSP_ELF_PBP(fileLoader, discId, g_CoreParameter.loadGameConfigs, errorString)) { ERROR_LOG(Log::Loader, "Failed to load ELF or loose PBP: %s", errorString->c_str()); return false; } diff --git a/headless/Headless.cpp b/headless/Headless.cpp index ecb652749a..04e82ff4fd 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -7,6 +7,8 @@ // > --root pspautotests/tests/../ --compare --timeout=5 --graphics=software pspautotests/tests/cpu/cpu_alu/cpu_alu.prx // Example command line for taking screenshots from a frame dump: // > -l --graphics=vulkan --screenshot-save=vt_ref.bmp "D:\PSP ISO\dump\Depth\11578 Virtua Tennis pause menu ULES00126_0002.zip" --resolution-scale=2 +// Example command line for messing with the vsh: +// > -l --vsh --memread=break --memwrite=break --break=break // // NOTE: In MSVC, don't forget to set the working directory to $ProjectDir\.. in debug settings. @@ -251,7 +253,7 @@ struct AutoTestOptions { bool bench; }; -bool RunAutoTest(HeadlessHost *headlessHost, CoreParameter &coreParameter, const AutoTestOptions &opt) { +static bool RunAutoTest(HeadlessHost *headlessHost, CoreParameter &coreParameter, const AutoTestOptions &opt) { using namespace Draw; // Kinda ugly, trying to guesstimate the test name from filename... @@ -601,6 +603,7 @@ int main(int argc, const char* argv[]) { coreParameter.mountRoot = mountRoot.empty() ? Path() : Path(mountRoot); coreParameter.startBreak = false; coreParameter.headLess = true; + coreParameter.loadGameConfigs = false; coreParameter.renderScaleFactor = cmdLineOptions.resolutionScale.value_or(1); coreParameter.renderWidth = 480 * coreParameter.renderScaleFactor; coreParameter.renderHeight = 272 * coreParameter.renderScaleFactor; @@ -680,9 +683,15 @@ int main(int argc, const char* argv[]) { std::vector failedTests; std::vector passedTests; + std::vector missingTests; for (size_t i = 0; i < testFilenames.size(); ++i) { coreParameter.fileToStart = Path(testFilenames[i]); + if (!File::Exists(coreParameter.fileToStart)) { + fprintf(stderr, "File not found: %s\n", coreParameter.fileToStart.c_str()); + missingTests.push_back(testFilenames[i]); + continue; + } if (testOptions.compare) printf("%s:\n", coreParameter.fileToStart.c_str()); bool passed = RunAutoTest(headlessHost, coreParameter, testOptions); @@ -714,7 +723,7 @@ int main(int argc, const char* argv[]) { } if (testOptions.compare) { - printf("%d tests passed, %d tests failed.\n", (int)passedTests.size(), (int)failedTests.size()); + printf("%d tests passed, %d tests failed, %d tests missing.\n", (int)passedTests.size(), (int)failedTests.size(), (int)missingTests.size()); if (!failedTests.empty()) { printf("Failed tests:\n");