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
3extern int kputs(char *s);
4extern int SleepThread(void);
5
6extern char sym1[] __asm__("AHX_Init");
7extern char sym2[] __asm__("sceCdCallback");
8extern char sym3[] __asm__("init_scr");
9extern char sym4[] __asm__("dma_channel_fast_waits");
10extern char sym5[] __asm__("draw_clear");
11extern char sym6[] __asm__("ee_dbg_clr_bpda");
12extern char sym7[] __asm__("LoadELFFromFile");
13extern char sym8[] __asm__("elf_loader_exec_elf");
14extern char sym9[] __asm__("erl_add_global_symbol");
15extern char sym10[] __asm__("fileXioChdir");
16extern char sym11[] __asm__("draw_fontx_char");
17extern char sym12[] __asm__("graph_add_vsync_handler");
18extern char sym13[] __asm__("init_imgdrv_offsets");
19extern char sym14[] __asm__("ioprpgen_setup_membuf");
20extern char sym15[] __asm__("PS2KbdClose");
21extern char sym16[] __asm__("AddDmacHandler");
22extern char sym17[] __asm__("calculate_colours");
23extern char sym18[] __asm__("mcChangeThreadPriority");
24extern char sym19[] __asm__("PS2MouseEnum");
25extern char sym20[] __asm__("MPEG_Destroy");
26extern char sym21[] __asm__("mtapGetConnection");
27extern char sym22[] __asm__("NetManDeinit");
28extern char sym23[] __asm__("packet2_add");
29extern char sym24[] __asm__("packet_free");
30extern char sym25[] __asm__("padEnd");
31extern char sym26[] __asm__("poweroffChangeThreadPriority");
32extern char sym27[] __asm__("PS2CamCloseDevice");
33extern char sym28[] __asm__("ps2ip_getconfig");
34extern char sym29[] __asm__("ps2ip_deinit");
35extern char sym30[] __asm__("sceSdBlockTrans");
36extern char sym31[] __asm__("RMMan_Close");
37extern char sym32[] __asm__("SecrDeinit");
38extern char sym33[] __asm__("SIOR_Init");
39
40struct lib {
41 const char *name;
42 void *symbol;
43};
44
45static const struct lib libs[] = {
46 {"ahx", sym1},
47 {"cdvd", sym2},
48 {"debug", sym3},
49 {"dma", sym4},
50 {"draw", sym5},
51 {"eedebug", sym6},
52 {"elf-loader-nocolour", sym7},
53 {"elf-loader2", sym8},
54 {"erl", sym9},
55 {"filexio", sym10},
56 {"font", sym11},
57 {"graph", sym12},
58 {"iopreboot", sym13},
59 {"ioprpgen", sym14},
60 {"kbd", sym15},
61 {"kernel", sym16},
62 {"math3d", sym17},
63 {"mc", sym18},
64 {"mouse", sym19},
65 {"mpeg", sym20},
66 {"mtap", sym21},
67 {"netman", sym22},
68 {"packet2", sym23},
69 {"packet", sym24},
70 {"pad", sym25},
71 {"poweroff", sym26},
72 {"ps2cam", sym27},
73 {"ps2ip", sym28},
74 {"ps2snd", sym30},
75 {"rm", sym31},
76 {"secr", sym32},
77 {"sior", sym33},
78};
79
80/* Taking each symbol's address makes the linker pull that library in, so the test builds only if every library links. */
81int main(void) {
82 int found = 0;
83 char line[64];
84 for (unsigned i = 0; i < sizeof(libs) / sizeof(libs[0]); i++)
85 if (libs[i].symbol) found++;
86 snprintf(line, sizeof(line), "ee-libs: %d libraries linked\n", found);
87 kputs(line);
88 kputs(found == (int)(sizeof(libs) / sizeof(libs[0])) ? "ee-libs: PASS\n" : "ee-libs: FAIL\n");
89 printf("[ps2rig] exit=0\n");
90 SleepThread();
91 return 0;
92}
Definition main.c:40