ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
osdsrc.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 
10 #include <syscallnr.h>
11 #include <osd_config.h>
12 
13 #include "osd.h"
14 #include "ExecPS2.h"
15 
17  unsigned int syscall;
18  void *function;
19 };
20 
21 static const struct SyscallPatchData SyscallPatchData[]={
26  { 0xFFFFC402, &ExecPS2Patch},
27 };
28 
30 
31 int _start(int syscall) __attribute__((section(".start")));
32 
33 int _start(int syscall){
34  unsigned int i;
35  int result;
36 
38 
39  for(i=0; i<5; i++){
41  if(syscall==0xFFFFC402){
42  result=((unsigned int)SyscallPatchData[i].function>>2&0x03FFFFFF)|0x0C000000; //Creates a JAL instruction to the function.
43  }
44  else result=(unsigned int)SyscallPatchData[i].function;
45 
46  return result;
47  }
48  }
49 
50  return 0;
51 }
void * ExecPS2Patch(void *EntryPoint, void *gp, int argc, char *argv[])
Definition: ExecPS2.c:83
void SetOsdConfigParam(void *addr)
void GetOsdConfigParam(void *addr)
void GetOsdConfigParam2(void *config, s32 size, s32 offset)
void SetOsdConfigParam2(void *config, s32 size, s32 offset)
void InitSystemConfig(SystemConfiguration_t *SysConf, int SysConfLen)
Definition: osd.c:17
int _start(int syscall)
Definition: osdsrc.c:33
SystemConfiguration_t SystemConfiguration
Definition: osdsrc.c:29
s32 result
Definition: rpc_client.c:23
unsigned int syscall
Definition: osdsrc.c:17
#define __NR_GetOsdConfigParam2
Definition: syscallnr.h:130
#define __NR_GetOsdConfigParam
Definition: syscallnr.h:90
#define __NR_SetOsdConfigParam
Definition: syscallnr.h:89
#define __NR_SetOsdConfigParam2
Definition: syscallnr.h:129