PS2SDK
PS2 Homebrew Libraries
main.c
1 #include <bdm.h>
2 #include <irx.h>
3 #include <loadcore.h>
4 #include <stdio.h>
5 
6 // #define DEBUG //comment out this line when not debugging
7 #include "module_debug.h"
8 
9 #define MAJOR_VER 1
10 #define MINOR_VER 1
11 
12 IRX_ID("bdm", MAJOR_VER, MINOR_VER);
13 
14 extern struct irx_export_table _exp_bdm;
15 extern int bdm_init();
16 extern void part_init();
17 
18 int _start(int argc, char *argv[])
19 {
20  (void)argc;
21  (void)argv;
22 
23  printf("Block Device Manager (BDM) v%d.%d\n", MAJOR_VER, MINOR_VER);
24 
25  if (RegisterLibraryEntries(&_exp_bdm) != 0) {
26  M_PRINTF("ERROR: Already registered!\n");
27  return MODULE_NO_RESIDENT_END;
28  }
29 
30  // initialize the block device manager
31  if (bdm_init() < 0) {
32  M_PRINTF("ERROR: BDM init failed!\n");
33  return MODULE_NO_RESIDENT_END;
34  }
35 
36  // initialize the partition driver
37  part_init();
38 
39  // return resident
40  return MODULE_RESIDENT_END;
41 }
bdm.h
_start
int _start(int argc, char *argv[])
Definition: main.c:46
loadcore.h
irx.h
irx_export_table
Definition: irx.h:90
stdio.h