ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
libosd.c File Reference
#include <kernel.h>
#include <syscallnr.h>
#include <osd_config.h>
+ Include dependency graph for libosd.c:

Go to the source code of this file.

Data Structures

struct  SyscallData
 

Functions

void InitExecPS2 (void)
 

Variables

unsigned char osdsrc []
 
unsigned int size_osdsrc
 
static struct SyscallData SyscallPatchEntries []
 

Detailed Description

libosd - ExecPS2 update.

Applicable to only the SCPH-10000 and SCPH-15000. Both contain either boot ROM v1.00 or v1.01. This is the "lite" libosd update will replace only ExecPS2, as done by games.

Definition in file libosd.c.

Function Documentation

◆ InitExecPS2()

void InitExecPS2 ( void  )

Definition at line 47 of file libosd.c.

47  {
48  unsigned int i;
49 
50  if(PatchIsNeeded()){
51  setup(SyscallPatchEntries[0].syscall_num, SyscallPatchEntries[0].function);
52  Copy((unsigned int*)0x80074000, (unsigned int*)osdsrc, size_osdsrc);
53 
54  FlushCache(0);
55  FlushCache(2);
56  setup(SyscallPatchEntries[1].syscall_num, SyscallPatchEntries[1].function);
57 
58  for(i=2; i<3; i++){
59  setup(SyscallPatchEntries[i].syscall_num, GetEntryAddress(SyscallPatchEntries[i].syscall_num));
60  }
61  }
62 }
int PatchIsNeeded(void)
Definition: libosd_common.c:20
void * GetEntryAddress(int syscall)
int Copy(void *dest, const void *src, int size)
void FlushCache(s32 operation)
void setup(int syscall_num, void *handler)
unsigned char osdsrc[]
unsigned int size_osdsrc
static struct SyscallData SyscallPatchEntries[]
Definition: libosd.c:31

References Copy(), FlushCache(), GetEntryAddress(), osdsrc, PatchIsNeeded(), setup(), size_osdsrc, SyscallData::syscall_num, and SyscallPatchEntries.

Variable Documentation

◆ osdsrc

unsigned char osdsrc[]
extern

Referenced by InitExecPS2().

◆ size_osdsrc

unsigned int size_osdsrc
extern

Referenced by InitExecPS2().

◆ SyscallPatchEntries

struct SyscallData SyscallPatchEntries[]
static
Initial value:
={
{
0x5A,
},
{
0x5B,
(void*)0x80074000
},
{
0xFFFFC402,
},
}
int kCopy(void *dest, const void *src, int size)
#define NULL
Definition: tamtypes.h:91

Definition at line 24 of file libosd.c.

Referenced by InitExecPS2().