ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
alarm.c
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Licenced under Academic Free License version 2.0
7 # Review ps2sdk README & LICENSE files for further details.
8 */
9 
18 #include <kernel.h>
19 #include <stdio.h>
20 
21 struct SyscallData{
22  int syscall;
23  void *function;
24 };
25 
26 static const struct SyscallData SysEntry[]={
27  {0x5A, &kCopy},
28  {0x5B, (void*)0x80076000},
29  {0xFC, NULL}, //SetAlarm
30  {0xFD, NULL}, //iSetAlarm
31  {0xFE, NULL}, //ReleaseAlarm
32  {0xFF, NULL}, //iReleaseAlarm
33  {0x12C, NULL}, //Intc12Handler (overwrites INTC 12 handler entry)
34  {0x08, NULL}, //ResumeIntrDispatch (Syscall #8)
35 };
36 
37 extern unsigned char srcfile[];
38 extern unsigned int size_srcfile;
39 
40 extern unsigned char eenull[];
41 extern unsigned int size_eenull;
42 
43 void InitAlarm(void)
44 {
45  int i;
46 
47  setup(SysEntry[0].syscall, SysEntry[0].function);
48  Copy((void*)0x80076000, srcfile, size_srcfile);
49  Copy((void*)0x00082000, eenull, size_eenull);
50  FlushCache(0);
51  FlushCache(2);
52  setup(SysEntry[1].syscall, SysEntry[1].function);
53 
54  for(i=2; i<8; i++)
56 }
void InitAlarm(void)
Definition: alarm.c:43
unsigned char srcfile[]
unsigned int size_srcfile
unsigned int size_eenull
static const struct SyscallData SysEntry[]
Definition: alarm.c:26
unsigned char eenull[]
void * GetEntryAddress(int syscall)
int Copy(void *dest, const void *src, int size)
void FlushCache(s32 operation)
int kCopy(void *dest, const void *src, int size)
void setup(int syscall_num, void *handler)
int syscall
Definition: alarm.c:22
#define NULL
Definition: tamtypes.h:91