sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
main.c
1#include <stdio.h>
2#include <string.h>
3#include <kernel.h>
4
5#include <kernel.h>
6#include <loadfile.h>
7#include <sbv_patches.h>
8#include <sifrpc.h>
9
10extern int kputs(char *s);
11
12/* A program must never return from main on the rig: that reboots the console. */
13static int rig_failed;
14static int rig_kputs(char *s) {
15 if (strstr(s, ": FAIL")) rig_failed = 1;
16 return kputs(s);
17}
18#define kputs rig_kputs
19extern unsigned char probe_irx[];
20extern unsigned int size_probe_irx;
21
22static int test_main(void) {
23 int result = -1;
24 SifInitRpc(0);
26 int id = SifExecModuleBuffer(probe_irx, size_probe_irx, 0, NULL, &result);
27 /* The module returns 100 + b + c: 113 when the shared-lui style code is relocated right. */
28 kputs(id > 0 && result == 113 ? "iop-module: PASS\n" : "iop-module: FAIL\n");
29 return 0;
30}
31
32int main(void) {
33 int result = test_main();
34 printf("[ps2rig] exit=%d\n", (result || rig_failed) ? 1 : 0);
35 SleepThread();
36 return 0;
37}
int SifExecModuleBuffer(void *ptr, u32 size, u32 arg_len, const char *args, int *mod_res)
Definition loadfile.c:314
int sbv_patch_enable_lmb(void)