PS2SDK
PS2 Homebrew Libraries
addrom2.c
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright 2001-2004, 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 <intrman.h>
12 #include <romdrv.h>
13 #include <ssbusc.h>
14 #include <sysmem.h>
15 #include <loadcore.h>
16 
17 IRX_ID("Additional_ROM_Driver_2", 1, 1);
18 // Mainly based on the module from ROM 1.8.0cd.
19 
20 int _start(int argc, char **argv)
21 {
22  int BaseAddress;
23  int Delay;
24  int state;
25 
26  (void)argc;
27  (void)argv;
28  CpuSuspendIntr(&state);
29  BaseAddress = GetBaseAddress(1);
30  Delay = GetDelay(1);
31  SetBaseAddress(1, 0xBE000000);
32  SetDelay(1, 0x183444);
33  if (romAddDevice(2, (void *)0xBE400000) != 0) {
34  Kprintf("ROM directory not found\n");
35  SetDelay(1, Delay);
36  SetBaseAddress(1, BaseAddress);
37  }
38  CpuResumeIntr(state);
39  return MODULE_NO_RESIDENT_END;
40 }
ssbusc.h
romdrv.h
CpuSuspendIntr
int CpuSuspendIntr(int *state)
Definition: intrman.c:195
loadcore.h
CpuResumeIntr
int CpuResumeIntr(int state)
Definition: intrman.c:217
sysmem.h
intrman.h