18extern char **_kExecArg;
19const char *SetArg(
const char *filename,
int argc,
char *argv[]);
21#ifdef F__exit_internals
36#define SETARG_MAX_ARGS 15
38const char *SetArg(
const char *filename,
int argc,
char *argv[])
40 const char *filenameOut;
44 ptr = (
char *)(_kExecArg + 16);
46 setup(SysEntry.syscall, SysEntry.function);
47 argc = (argc > SETARG_MAX_ARGS) ? SETARG_MAX_ARGS : argc;
48 Copy(&_kExecArg[0], &ptr, 4);
49 len = strlen(filename) + 1;
50 Copy(ptr, filename, len);
53 for (i = 0; i < argc; i++) {
54 Copy(&_kExecArg[1 + i], &ptr, 4);
55 len = strlen(argv[i]) + 1;
56 Copy(ptr, argv[i], len);
66void Exit(s32 exit_code)
75s32 ExecPS2(
void *entry,
void *gp,
int num_args,
char *args[])
77 SetArg(
"", num_args, args);
79 return _ExecPS2(entry, gp, num_args, &_kExecArg[1]);
85void LoadExecPS2(
const char *filename, s32 num_args,
char *args[])
87 const char *pFilename;
89 pFilename = SetArg(filename, num_args, args);
91 _LoadExecPS2(pFilename, num_args, &_kExecArg[1]);
97void ExecOSD(
int num_args,
char *args[])
99 SetArg(
"", num_args, args);
101 _ExecOSD(num_args, &_kExecArg[1]);