From 7361eba6e4cf9b603c77a2ecb390e8bc36f17146 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Mon, 21 Jul 2025 18:38:28 -0300 Subject: [PATCH] forgot this check --- librecomp/src/pak.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/librecomp/src/pak.cpp b/librecomp/src/pak.cpp index 626fa2b..9e74723 100644 --- a/librecomp/src/pak.cpp +++ b/librecomp/src/pak.cpp @@ -226,6 +226,13 @@ extern "C" void osPfsFileState_recomp(uint8_t* rdram, recomp_context* ctx) { // games call this function 16 times, once per file // fills the incoming state with the information inside the header of the pak. + char filename[100]; + sprintf(filename, "controllerPak_file_%d.sav", file_no); + if (!std::filesystem::exists(filename)) { + ctx->r2 = 5; // PFS_ERR_INVALID + return; + } + /* Read game info from pak */ ControllerPak pak;