diff -cr sexypsf-0.4.7/Makefile sexypsf/Makefile
*** sexypsf-0.4.7/Makefile	Thu Dec 16 01:06:26 2004
--- sexypsf/Makefile	Wed Mar 16 18:16:43 2005
***************
*** 7,17 ****
  VERSION = 0.4.7
  # CPU.  ix86 or ppc, or LSBFIRST for non-x86 LSB-first platforms or MSBFIRST
  
! CPU = ix86
  CC = gcc 
  RM = rm -f
  
! LIBS = -shared -lz
  OPTIMIZE = -O2 -finline-functions -ffast-math
  FLAGS = -DPSS_STYLE=1 -DSPSFVERSION="\"${VERSION}\""
  
--- 7,18 ----
  VERSION = 0.4.7
  # CPU.  ix86 or ppc, or LSBFIRST for non-x86 LSB-first platforms or MSBFIRST
  
! CPU = ppc
  CC = gcc 
  RM = rm -f
  
! #LIBS = -shared -lz
! LIBS = -dynamiclib -flat_namespace -undefined suppress -lz
  OPTIMIZE = -O2 -finline-functions -ffast-math
  FLAGS = -DPSS_STYLE=1 -DSPSFVERSION="\"${VERSION}\""
  
***************
*** 33,39 ****
  	FLAGS+=-DMSB_FIRST
  endif
  
! CFLAGS = -Wall ${OPTIMIZE} -I. ${FLAGS}
  
  sexypsf: ${OBJS}
  	${CC} ${CFLAGS} ${OBJS} -o libsexypsf.so ${LIBS}
--- 34,40 ----
  	FLAGS+=-DMSB_FIRST
  endif
  
! CFLAGS = -Wall ${OPTIMIZE} -I. -I/sw/include ${FLAGS}
  
  sexypsf: ${OBJS}
  	${CC} ${CFLAGS} ${OBJS} -o libsexypsf.so ${LIBS}
diff -cr sexypsf-0.4.7/PsxBios.c sexypsf/PsxBios.c
*** sexypsf-0.4.7/PsxBios.c	Thu Sep  2 01:26:16 2004
--- sexypsf/PsxBios.c	Wed Mar 16 18:28:57 2005
***************
*** 987,995 ****
  	pc0 = ra; 
  }
  
! void (*biosA0[256])();
! void (*biosB0[256])();
! void (*biosC0[256])();
  
  void psxBiosInit() {
  	u32 base, size;
--- 987,995 ----
  	pc0 = ra; 
  }
  
! void (*biosA0[256])() = { 0 };
! void (*biosB0[256])() = { 0 }; 
! void (*biosC0[256])() = { 0 };
  
  void psxBiosInit() {
  	u32 base, size;
diff -cr sexypsf-0.4.7/PsxCounters.c sexypsf/PsxCounters.c
*** sexypsf-0.4.7/PsxCounters.c	Thu Sep  2 01:18:10 2004
--- sexypsf/PsxCounters.c	Wed Mar 16 18:30:14 2005
***************
*** 23,28 ****
--- 23,32 ----
  static int cnts = 4;
  static u32 last=0;
  
+ psxCounter psxCounters[5] = {{0}};
+ 
+ u32 psxNextCounter = 0, psxNextsCounter = 0;
+ 
  static void psxRcntUpd(u32 index) {
  	psxCounters[index].sCycle = psxRegs.cycle;
  	if (((!(psxCounters[index].mode & 1)) || (index!=2)) &&
diff -cr sexypsf-0.4.7/PsxCounters.h sexypsf/PsxCounters.h
*** sexypsf-0.4.7/PsxCounters.h	Thu Sep  2 01:15:20 2004
--- sexypsf/PsxCounters.h	Wed Mar 16 18:18:45 2005
***************
*** 24,32 ****
  	u32 sCycle, Cycle, rate, interrupt;
  } psxCounter;
  
! psxCounter psxCounters[5];
  
! u32 psxNextCounter, psxNextsCounter;
  
  void psxRcntInit();
  void psxRcntUpdate();
--- 24,32 ----
  	u32 sCycle, Cycle, rate, interrupt;
  } psxCounter;
  
! extern psxCounter psxCounters[5];
  
! extern u32 psxNextCounter, psxNextsCounter;
  
  void psxRcntInit();
  void psxRcntUpdate();
diff -cr sexypsf-0.4.7/PsxMem.c sexypsf/PsxMem.c
*** sexypsf-0.4.7/PsxMem.c	Thu Sep  2 01:18:10 2004
--- sexypsf/PsxMem.c	Wed Mar 16 18:18:14 2005
***************
*** 21,26 ****
--- 21,32 ----
  
  #include "PsxCommon.h"
  
+ s8 *psxM = NULL;
+ s8 *psxP = NULL;
+ s8 *psxR = NULL;
+ s8 *psxH = NULL;
+ u32 *psxMemLUT = NULL;
+ 
  void LoadPSXMem(u32 address, s32 length, char *data)
  {
   //printf("%08x %08x\n",address,length);
diff -cr sexypsf-0.4.7/PsxMem.h sexypsf/PsxMem.h
*** sexypsf-0.4.7/PsxMem.h	Sat Feb  7 01:36:57 2004
--- sexypsf/PsxMem.h	Wed Mar 16 18:18:25 2005
***************
*** 41,61 ****
  }
  #endif
  
! s8 *psxM;
  #define psxMu32(mem)	(*(u32*)&psxM[(mem) & 0x1fffff])
  
! s8 *psxP;
! s8 *psxR;
  #define psxRu32(mem)	(*(u32*)&psxR[(mem) & 0x7ffff])
  
! s8 *psxH;
  
  #define psxHu8(mem)	(*(u8*) &psxH[(mem) & 0xffff])
  
  #define psxHu16(mem)   	(*(u16*)&psxH[(mem) & 0xffff])
  #define psxHu32(mem)   	(*(u32*)&psxH[(mem) & 0xffff])
- 
- u32 *psxMemLUT;
  
  #define PSXM(mem)		(psxMemLUT[(mem) >> 16] == 0 ? NULL : (void*)(psxMemLUT[(mem) >> 16] + ((mem) & 0xffff)))
  
--- 41,64 ----
  }
  #endif
  
! extern s8 *psxM;
! extern s8 *psxP;
! extern s8 *psxR;
! extern s8 *psxH;
! extern u32 *psxMemLUT;
! 
! 
  #define psxMu32(mem)	(*(u32*)&psxM[(mem) & 0x1fffff])
  
! 
  #define psxRu32(mem)	(*(u32*)&psxR[(mem) & 0x7ffff])
  
! 
  
  #define psxHu8(mem)	(*(u8*) &psxH[(mem) & 0xffff])
  
  #define psxHu16(mem)   	(*(u16*)&psxH[(mem) & 0xffff])
  #define psxHu32(mem)   	(*(u32*)&psxH[(mem) & 0xffff])
  
  #define PSXM(mem)		(psxMemLUT[(mem) >> 16] == 0 ? NULL : (void*)(psxMemLUT[(mem) >> 16] + ((mem) & 0xffff)))
  
diff -cr sexypsf-0.4.7/R3000A.c sexypsf/R3000A.c
*** sexypsf-0.4.7/R3000A.c	Thu Sep  2 01:18:10 2004
--- sexypsf/R3000A.c	Wed Mar 16 18:31:14 2005
***************
*** 22,27 ****
--- 22,30 ----
  
  #include "PsxCommon.h"
  
+ R3000Acpu *psxCpu = NULL;
+ psxRegisters psxRegs = {{{0}}};
+ 
  int psxInit() {
  
  	psxCpu = &psxInt;
diff -cr sexypsf-0.4.7/R3000A.h sexypsf/R3000A.h
*** sexypsf-0.4.7/R3000A.h	Sat Feb  7 01:42:11 2004
--- sexypsf/R3000A.h	Wed Mar 16 18:19:27 2005
***************
*** 32,38 ****
  	void (*Shutdown)();
  } R3000Acpu;
  
! R3000Acpu *psxCpu;
  extern R3000Acpu psxInt;
  
  typedef union {
--- 32,38 ----
  	void (*Shutdown)();
  } R3000Acpu;
  
! extern R3000Acpu *psxCpu;
  extern R3000Acpu psxInt;
  
  typedef union {
***************
*** 68,74 ****
  	u32 interrupt;
  } psxRegisters;
  
! psxRegisters psxRegs;
  
  #define _i32(x) (s32)x
  #define _u32(x) (u32)x
--- 68,74 ----
  	u32 interrupt;
  } psxRegisters;
  
! extern psxRegisters psxRegs;
  
  #define _i32(x) (s32)x
  #define _u32(x) (u32)x
diff -cr sexypsf-0.4.7/spu/spu.c sexypsf/spu/spu.c
*** sexypsf-0.4.7/spu/spu.c	Thu Sep  2 01:17:13 2004
--- sexypsf/spu/spu.c	Wed Mar 16 18:22:02 2005
***************
*** 122,128 ****
                          {  115, -52 },
                          {   98, -55 },
                          {  122, -60 } };
! s16 * pS;
  
  ////////////////////////////////////////////////////////////////////////
  // CODE AREA
--- 122,128 ----
                          {  115, -52 },
                          {   98, -55 },
                          {  122, -60 } };
! s16 * pS = NULL;
  
  ////////////////////////////////////////////////////////////////////////
  // CODE AREA
