ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
patch_disable_prefix_check.c
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
16 #include <tamtypes.h>
17 #include <kernel.h>
18 #include <string.h>
19 
20 #include "slib.h"
21 
23 
25 {
26  union {
27  u8 buf[256];
28  slib_exp_lib_t exp_lib;
29  } buf;
30  static u32 patch[2] ALIGNED(16)={
31  0x03e00008, /* jr $ra */
32  0x00001021 /* addiu $v0, $0, 0 */
33  };
34  SifDmaTransfer_t dmat;
35  slib_exp_lib_t *modload_lib = &buf.exp_lib;
36 
37  memset(&_slib_cur_exp_lib_list, 0, sizeof(slib_exp_lib_list_t));
38 
39  if (!slib_get_exp_lib("modload", modload_lib))
40  return -1;
41 
42  dmat.src=patch;
43  dmat.size=sizeof(patch); //16-bytes will be written to IOP RAM, but the function on the IOP side is longer than 16 bytes in length.
44  dmat.dest=modload_lib->exports[15];
45  dmat.attr=0;
46 
47  SifSetDma(&dmat, 1);
48 
49  return 0;
50 }
u32 SifSetDma(SifDmaTransfer_t *sdd, s32 len)
#define ALIGNED(x)
Definition: kernel.h:50
slib_exp_lib_list_t _slib_cur_exp_lib_list
Definition: slib.c:26
int sbv_patch_disable_prefix_check(void)
int slib_get_exp_lib(const char *name, slib_exp_lib_t *library)
Definition: slib.c:101
void * dest
Definition: sifdma.h:55
void * src
Definition: sifdma.h:54
void * exports[0]
Definition: slib.h:38
unsigned int u32
Definition: tamtypes.h:30
unsigned char u8
Definition: tamtypes.h:23