2 Copyright 2009-2010, Ifcaro, jimmikaelkael & Polo
3 Copyright 2006-2008 Polo
4 Licenced under Academic Free License version 3.0
5 Review OpenUsbLd README & LICENSE files for further details.
7 Some parts of the code are taken from HD Project by Polo
15 static char ElfPath
[255]; // it should be here to avoid it to be wiped by the clear user mem
17 int main(int argc
, char **argv
){
20 DPRINTF("OPL EE core start!\n");
24 #ifdef LOAD_EECORE_DOWN
25 g_buf
= (u8
*)0x01700000;
27 g_buf
= (u8
*)0x00088000;
29 DPRINTF("g_buf at 0x%08x\n", (int)g_buf
);
31 argv
[1][11]=0x00; // fix for 8+3 filename.
33 _strcpy(ElfPath
, "cdrom0:\\");
34 _strcat(ElfPath
, argv
[1]);
35 _strcat(ElfPath
, ";1");
36 _strcpy(GameID
, argv
[1]);
37 DPRINTF("Elf path = '%s'\n", ElfPath
);
38 DPRINTF("Game ID = '%s'\n", GameID
);
40 if (!_strncmp(argv
[0], "USB_MODE", 8))
42 else if (!_strncmp(argv
[0], "ETH_MODE", 8))
44 else if (!_strncmp(argv
[0], "HDD_MODE", 8))
46 DPRINTF("Game Mode = %d\n", GameMode
);
49 if (!_strncmp(&argv
[0][9], "1", 1)) {
51 DPRINTF("Debug color screens enabled\n");
54 char *p
= _strtok(&argv
[0][11], " ");
55 if (!_strncmp(p
, "Browser", 7))
59 DPRINTF("Exit Path = (%s)\n", ExitPath
);
61 p
= _strtok(NULL
, " ");
62 USBDelay
= _strtoui(p
);
63 DPRINTF("USB Delay = %d\n", USBDelay
);
65 p
= _strtok(NULL
, " ");
66 HDDSpindown
= _strtoui(p
);
67 DPRINTF("HDD Spindown = %d\n", HDDSpindown
);
69 p
= _strtok(NULL
, " ");
71 p
= _strtok(NULL
, " ");
72 _strcpy(g_ps2_netmask
, p
);
73 p
= _strtok(NULL
, " ");
74 _strcpy(g_ps2_gateway
, p
);
75 DPRINTF("IP=%s NM=%s GW=%s\n", g_ps2_ip
, g_ps2_netmask
, g_ps2_gateway
);
77 // bitmask of the compat. settings
78 g_compat_mask
= _strtoui(argv
[2]);
79 DPRINTF("Compat Mask = 0x%02x\n", g_compat_mask
);
83 DPRINTF("Get back IOP modules from Kernel RAM...\n");
86 /* installing kernel hooks */
87 DPRINTF("Installing Kernel Hooks...\n");
88 Install_Kernel_Hooks();
91 GS_BGCOLOUR
= 0xff0000;
93 DPRINTF("Executing '%s'...\n", ElfPath
);
94 LoadExecPS2(ElfPath
, 0, NULL
);
97 GS_BGCOLOUR
= 0x0000ff;
98 DPRINTF("LoadExecPS2 failed!\n");