From cb3ef54b4d465f10e57d36367dd55a7ea5c5cdee Mon Sep 17 00:00:00 2001 From: angie Date: Tue, 18 Jun 2024 12:39:30 -0400 Subject: [PATCH] `osPfsNumFiles` and `osPfsRepairId` --- librecomp/src/pak.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/librecomp/src/pak.cpp b/librecomp/src/pak.cpp index 92e0f10..0ea0b6f 100644 --- a/librecomp/src/pak.cpp +++ b/librecomp/src/pak.cpp @@ -1,6 +1,8 @@ +#include "ultramodern/ultra64.h" +#include "ultramodern/ultramodern.hpp" + #include "recomp.h" -#include -#include +#include "helpers.hpp" extern "C" void osPfsInitPak_recomp(uint8_t * rdram, recomp_context* ctx) { ctx->r2 = 1; // PFS_ERR_NOPACK @@ -33,3 +35,17 @@ extern "C" void osPfsReadWriteFile_recomp(uint8_t * rdram, recomp_context * ctx) extern "C" void osPfsChecker_recomp(uint8_t * rdram, recomp_context * ctx) { ctx->r2 = 1; // PFS_ERR_NOPACK } + +extern "C" void osPfsNumFiles_recomp(uint8_t * rdram, recomp_context * ctx) { + PTR(s32) max_files = _arg<1, PTR(s32)>(rdram, ctx); + PTR(s32) files_used = _arg<2, PTR(s32)>(rdram, ctx); + + MEM_W(0, max_files) = 0; + MEM_W(0, files_used) = 0; + + _return(ctx, 1); // PFS_ERR_NOPACK +} + +extern "C" void osPfsRepairId_recomp(uint8_t * rdram, recomp_context * ctx) { + _return(ctx, 1); // PFS_ERR_NOPACK +}