From 7ba2f79bf98b40ffb1c182bbef01defd55a22374 Mon Sep 17 00:00:00 2001 From: Gabryel-lima Date: Wed, 20 May 2026 15:11:06 -0300 Subject: [PATCH] Implement osPfsInit and osPfsIsPlug functions with error handling --- librecomp/src/pak.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/librecomp/src/pak.cpp b/librecomp/src/pak.cpp index 0be1513..be3afe7 100644 --- a/librecomp/src/pak.cpp +++ b/librecomp/src/pak.cpp @@ -8,6 +8,16 @@ extern "C" void osPfsInitPak_recomp(uint8_t * rdram, recomp_context* ctx) { ctx->r2 = 1; // PFS_ERR_NOPACK } +extern "C" void osPfsInit_recomp(uint8_t * rdram, recomp_context * ctx) { + ctx->r2 = 1; // PFS_ERR_NOPACK +} + +extern "C" void osPfsIsPlug_recomp(uint8_t * rdram, recomp_context * ctx) { + u8* pattern = _arg<1, u8*>(rdram, ctx); + *pattern = 0; // No controller pak plugged in + ctx->r2 = 0; +} + extern "C" void osPfsFreeBlocks_recomp(uint8_t * rdram, recomp_context * ctx) { ctx->r2 = 1; // PFS_ERR_NOPACK }