add load exec

Co-authored-by: thenotsoquietninja44-collab <thenotsoquietninja44@gmail.com>
This commit is contained in:
nmzik
2026-10-11 09:04:29 +02:00
parent 6f3bebcb50
commit cb375ec35a
9 changed files with 99 additions and 22 deletions
+2 -8
View File
@@ -54,11 +54,7 @@ struct CContext {
std::list<atexit_func_t> atexit;
};
struct InitEnvParams {
int argc;
uint32_t pad;
const char* argv[3];
};
using InitEnvParams = Loader::EntryParams;
static int g_argc = 0;
static const char* const* g_argv = nullptr;
@@ -271,9 +267,7 @@ static KYTY_SYSV_ABI void init_env(const InitEnvParams* params) {
return;
}
constexpr int argv_capacity = static_cast<int>(sizeof(params->argv) / sizeof(params->argv[0]));
EXIT_NOT_IMPLEMENTED(params->argc < 0 || params->argc >= argv_capacity);
EXIT_NOT_IMPLEMENTED(params->argc < 0);
g_argc = params->argc;
g_argv = params->argv;
+7
View File
@@ -4,6 +4,7 @@
#include "common/emulatorConfig.h"
#include "common/logging/log.h"
#include "common/stringUtils.h"
#include "emulator.h"
#include "graphics/presentation/systemOverlay.h"
#include "libs/dialog.h"
#include "libs/errno.h"
@@ -99,6 +100,11 @@ static int KYTY_SYSV_ABI SystemServiceHideSplashScreen() {
return OK;
}
int KYTY_SYSV_ABI SystemServiceLoadExec(const char* path, const char* const argv[]) {
PRINT_NAME();
return Emulator::LoadExec(path, argv);
}
static int KYTY_SYSV_ABI SystemServiceParamGetInt(int param_id, int* value) {
PRINT_NAME();
@@ -559,6 +565,7 @@ LIB_DEFINE(InitSystemGesture_1) {
} // namespace SystemGesture
LIB_DEFINE(InitSystemService_1) {
LIB_FUNC("JoBqSQt1yyA", SystemService::SystemServiceLoadExec);
LIB_FUNC("Vo5V8KAwCmk", SystemService::SystemServiceHideSplashScreen);
LIB_FUNC("fZo48un7LK4", SystemService::SystemServiceParamGetInt);
LIB_FUNC("SsC-m-S9JTA", SystemService::SystemServiceParamGetString);