PS2SDK
PS2 Homebrew Libraries
sifinit.c
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright ps2dev - http://www.ps2dev.org
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
11 #include "irx_imports.h"
12 
13 #ifdef _IOP
14 IRX_ID("SifInit", 1, 1);
15 #endif
16 // Based on the module from SCE SDK 1.3.4.
17 
18 int _start(int ac, char **av)
19 {
20  const int *BootMode3;
21  const int *BootMode1;
22 
23  (void)ac;
24  (void)av;
25 
26  BootMode3 = QueryBootMode(3);
27  if ( BootMode3 && (BootMode3[1] & 1) )
28  {
29  printf(" Skip SIF init\n");
30  return MODULE_NO_RESIDENT_END;
31  }
32  BootMode1 = QueryBootMode(1);
33  if ( BootMode1 && *(const u16 *)BootMode1 == 1 )
34  {
35  printf(" Skip SIF init (it is DECI1)\n");
36  return MODULE_NO_RESIDENT_END;
37  }
38  sceSifInit();
39  return MODULE_NO_RESIDENT_END;
40 }