mirror of
https://github.com/N64Recomp/N64ModernRuntime.git
synced 2025-10-30 08:02:29 +00:00
Provide missing pfs stub functions (#50)
* `osPiRawStartDma_recomp` and `osEPiRawStartDma` * `osPfsNumFiles` and `osPfsRepairId` * whoops, wrong name * Fix missing new line on message box * Use actual pointers in osPfsNumFiles_recomp
This commit is contained in:
parent
27282afa2b
commit
93fab7ecc4
3 changed files with 50 additions and 4 deletions
|
|
@ -1,6 +1,8 @@
|
|||
#include "ultramodern/ultra64.h"
|
||||
#include "ultramodern/ultramodern.hpp"
|
||||
|
||||
#include "recomp.h"
|
||||
#include <ultramodern/ultra64.h>
|
||||
#include <ultramodern/ultramodern.hpp>
|
||||
#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) {
|
||||
s32* max_files = _arg<1, s32*>(rdram, ctx);
|
||||
s32* files_used = _arg<2, s32*>(rdram, ctx);
|
||||
|
||||
*max_files = 0;
|
||||
*files_used = 0;
|
||||
|
||||
_return<s32>(ctx, 1); // PFS_ERR_NOPACK
|
||||
}
|
||||
|
||||
extern "C" void osPfsRepairId_recomp(uint8_t * rdram, recomp_context * ctx) {
|
||||
_return<s32>(ctx, 1); // PFS_ERR_NOPACK
|
||||
}
|
||||
|
|
|
|||
|
|
@ -300,5 +300,35 @@ extern "C" void osPiGetStatus_recomp(RDRAM_ARG recomp_context * ctx) {
|
|||
}
|
||||
|
||||
extern "C" void osPiRawStartDma_recomp(RDRAM_ARG recomp_context * ctx) {
|
||||
ctx->r2 = 0;
|
||||
ultramodern::error_handling::message_box(
|
||||
"Stub `osPiRawStartDma_recomp` function called!\n"
|
||||
"Most games do not call this function directly, which means the libultra function\n"
|
||||
"that uses this function was not properly named.\n"
|
||||
"\n"
|
||||
"If you triggered this message, please make sure you have properly identified\n"
|
||||
"every libultra function on your recompiled game. If you are sure every libultra\n"
|
||||
"function has been identified and you still get this problem then open an issue on\n"
|
||||
"the N64ModernRuntime Github repository mentioning the game you are trying to\n"
|
||||
"recompile and steps to reproduce the issue.\n"
|
||||
"\n"
|
||||
"The application will close now, bye and good luck!"
|
||||
);
|
||||
ULTRAMODERN_QUICK_EXIT();
|
||||
}
|
||||
|
||||
extern "C" void osEPiRawStartDma_recomp(RDRAM_ARG recomp_context * ctx) {
|
||||
ultramodern::error_handling::message_box(
|
||||
"Stub `osEPiRawStartDma_recomp` function called!\n"
|
||||
"Most games do not call this function directly, which means the libultra function\n"
|
||||
"that uses this function was not properly named.\n"
|
||||
"\n"
|
||||
"If you triggered this message, please make sure you have properly identified\n"
|
||||
"every libultra function on your recompiled game. If you are sure every libultra\n"
|
||||
"function has been identified and you still get this problem then open an issue on\n"
|
||||
"the N64ModernRuntime Github repository mentioning the game you are trying to\n"
|
||||
"recompile and steps to reproduce the issue.\n"
|
||||
"\n"
|
||||
"The application will close now, bye and good luck!"
|
||||
);
|
||||
ULTRAMODERN_QUICK_EXIT();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ void ultramodern::error_handling::message_box(const char* msg) {
|
|||
}
|
||||
|
||||
void ultramodern::error_handling::quick_exit(const char* filename, int line, const char *func, int exit_status) {
|
||||
fprintf(stderr, "Exiting with exit status '%i'. Function %s, at file %s:%i, ", exit_status, func, filename, line);
|
||||
fprintf(stderr, "Exiting with exit status '%i'. Function %s, at file %s:%i\n", exit_status, func, filename, line);
|
||||
|
||||
#ifdef __APPLE__
|
||||
std::_Exit(exit_status);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue