summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-08 01:16:38 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-08 01:16:38 +0000
commit4d39defcb59600513ff65a688c54f3d6b13ca63a (patch)
treec1b89b128f8c7f53a277a8cac28979d02357d083 /libpcsxcore
parentaaaf3199b1afd1e5f88f23ce40305a5df5455599 (diff)
downloadpcsxr-4d39defcb59600513ff65a688c54f3d6b13ca63a.tar.gz
more cleanups.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@47580 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/cdriso.h7
-rw-r--r--libpcsxcore/cdrom.h7
-rw-r--r--libpcsxcore/cheat.h7
-rw-r--r--libpcsxcore/coff.h2
-rw-r--r--libpcsxcore/debug.h7
-rw-r--r--libpcsxcore/decode_xa.h7
-rw-r--r--libpcsxcore/gte.h7
-rw-r--r--libpcsxcore/ix86/iGte.h7
-rw-r--r--libpcsxcore/ix86/ix86.c4
-rw-r--r--libpcsxcore/ix86/ix86.h15
-rw-r--r--libpcsxcore/ix86_64/iGte.h7
-rw-r--r--libpcsxcore/mdec.h7
-rw-r--r--libpcsxcore/misc.c21
-rw-r--r--libpcsxcore/misc.h9
-rw-r--r--libpcsxcore/plugins.h9
-rw-r--r--libpcsxcore/ppc/pGte.h12
-rw-r--r--libpcsxcore/ppc/ppc.h30
-rw-r--r--libpcsxcore/ppc/reguse.h10
-rw-r--r--libpcsxcore/ppf.h7
-rw-r--r--libpcsxcore/psemu_plugin_defs.h8
-rw-r--r--libpcsxcore/psxbios.h9
-rw-r--r--libpcsxcore/psxcommon.c46
-rw-r--r--libpcsxcore/psxcommon.h14
-rw-r--r--libpcsxcore/psxcounters.c4
-rw-r--r--libpcsxcore/psxcounters.h7
-rw-r--r--libpcsxcore/psxdma.h7
-rw-r--r--libpcsxcore/psxhle.h7
-rw-r--r--libpcsxcore/psxhw.h7
-rw-r--r--libpcsxcore/psxmem.h7
-rw-r--r--libpcsxcore/r3000a.c9
-rw-r--r--libpcsxcore/r3000a.h11
-rw-r--r--libpcsxcore/sio.h7
-rw-r--r--libpcsxcore/socket.h7
-rw-r--r--libpcsxcore/spu.h7
-rw-r--r--libpcsxcore/system.h7
35 files changed, 279 insertions, 67 deletions
diff --git a/libpcsxcore/cdriso.h b/libpcsxcore/cdriso.h
index 85ecaa11..27d1ecd0 100644
--- a/libpcsxcore/cdriso.h
+++ b/libpcsxcore/cdriso.h
@@ -21,7 +21,14 @@
#ifndef CDRISO_H
#define CDRISO_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void cdrIsoInit(void);
int cdrIsoActive(void);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/cdrom.h b/libpcsxcore/cdrom.h
index f2ea29b1..3116cde8 100644
--- a/libpcsxcore/cdrom.h
+++ b/libpcsxcore/cdrom.h
@@ -20,6 +20,10 @@
#ifndef __CDROM_H__
#define __CDROM_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
#include "decode_xa.h"
#include "r3000a.h"
@@ -102,4 +106,7 @@ void cdrWrite2(unsigned char rt);
void cdrWrite3(unsigned char rt);
int cdrFreeze(gzFile f, int Mode);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/cheat.h b/libpcsxcore/cheat.h
index 7306f70c..d54f22c3 100644
--- a/libpcsxcore/cheat.h
+++ b/libpcsxcore/cheat.h
@@ -19,6 +19,10 @@
#ifndef CHEAT_H
#define CHEAT_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
uint32_t Addr;
uint16_t Val;
@@ -107,4 +111,7 @@ extern int NumSearchResults;
#define CHEAT_LESSTHAN16 0xD2 /* 16-bit Less Than */
#define CHEAT_GREATERTHAN16 0xD3 /* 16-bit Greater Than */
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/coff.h b/libpcsxcore/coff.h
index e7a98ab8..1d084d28 100644
--- a/libpcsxcore/coff.h
+++ b/libpcsxcore/coff.h
@@ -35,4 +35,4 @@ struct external_filehdr {
#define FILHDR struct external_filehdr
#define FILHSZ sizeof(FILHDR)
-#endif /* __COFF_H__ */
+#endif
diff --git a/libpcsxcore/debug.h b/libpcsxcore/debug.h
index 808c8de0..5c5336d4 100644
--- a/libpcsxcore/debug.h
+++ b/libpcsxcore/debug.h
@@ -20,6 +20,10 @@
#ifndef __DEBUG_H__
#define __DEBUG_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum breakpoint_types {
E, R1, R2, R4, W1, W2, W4
};
@@ -62,4 +66,7 @@ char* disR3000AF(u32 code, u32 pc);
#define EMU_LOG __Log
#endif
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/decode_xa.h b/libpcsxcore/decode_xa.h
index bdf1f843..a5994e12 100644
--- a/libpcsxcore/decode_xa.h
+++ b/libpcsxcore/decode_xa.h
@@ -20,6 +20,10 @@
#ifndef __DECODE_XA_H__
#define __DECODE_XA_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
typedef struct {
@@ -39,4 +43,7 @@ s32 xa_decode_sector( xa_decode_t *xdp,
unsigned char *sectorp,
int is_first_sector );
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/gte.h b/libpcsxcore/gte.h
index 28a36355..2cea0264 100644
--- a/libpcsxcore/gte.h
+++ b/libpcsxcore/gte.h
@@ -22,6 +22,10 @@
#ifndef __GTE_H__
#define __GTE_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
#include "r3000a.h"
@@ -55,4 +59,7 @@ void gteGPF();
void gteGPL();
void gteNCCT();
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/ix86/iGte.h b/libpcsxcore/ix86/iGte.h
index 0847e368..d03705ec 100644
--- a/libpcsxcore/ix86/iGte.h
+++ b/libpcsxcore/ix86/iGte.h
@@ -20,6 +20,10 @@
#ifndef __IGTE_H__
#define __IGTE_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "../r3000a.h"
#include "../psxmem.h"
@@ -69,4 +73,7 @@ CP2_FUNC(GPF);
CP2_FUNC(GPL);
CP2_FUNCNC(NCCT);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/ix86/ix86.c b/libpcsxcore/ix86/ix86.c
index 763552e8..d701e899 100644
--- a/libpcsxcore/ix86/ix86.c
+++ b/libpcsxcore/ix86/ix86.c
@@ -25,6 +25,10 @@
#include "ix86.h"
+s8 *x86Ptr;
+u8 *j8Ptr[32];
+u32 *j32Ptr[32];
+
void x86Init() {
}
diff --git a/libpcsxcore/ix86/ix86.h b/libpcsxcore/ix86/ix86.h
index 3ace6122..2b60dfff 100644
--- a/libpcsxcore/ix86/ix86.h
+++ b/libpcsxcore/ix86/ix86.h
@@ -26,6 +26,10 @@
#ifndef __IX86_H__
#define __IX86_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// include basic types
#include "../psxcommon.h"
#include "../r3000a.h"
@@ -93,9 +97,9 @@
#define XMM6 6
#define XMM7 7
-s8 *x86Ptr;
-u8 *j8Ptr[32];
-u32 *j32Ptr[32];
+extern s8 *x86Ptr;
+extern u8 *j8Ptr[32];
+extern u32 *j32Ptr[32];
void x86Init();
void x86SetPtr(char *ptr);
@@ -663,4 +667,7 @@ void XORPSRtoR(int to,int from);
void ANDPSMtoR(int to,int from);
void ANDPSRtoR(int to,int from);
-#endif /* __IX86_H__ */
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/libpcsxcore/ix86_64/iGte.h b/libpcsxcore/ix86_64/iGte.h
index af20bfc9..bcb2f4be 100644
--- a/libpcsxcore/ix86_64/iGte.h
+++ b/libpcsxcore/ix86_64/iGte.h
@@ -20,6 +20,10 @@
#ifndef __IGTE_H__
#define __IGTE_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "../r3000a.h"
#include "../psxmem.h"
@@ -69,4 +73,7 @@ CP2_FUNC(GPF);
CP2_FUNC(GPL);
CP2_FUNCNC(NCCT);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/mdec.h b/libpcsxcore/mdec.h
index efb0a9ca..e191b4e5 100644
--- a/libpcsxcore/mdec.h
+++ b/libpcsxcore/mdec.h
@@ -20,6 +20,10 @@
#ifndef __MDEC_H__
#define __MDEC_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
#include "r3000a.h"
#include "psxhw.h"
@@ -35,4 +39,7 @@ void psxDma1(u32 madr, u32 bcr, u32 chcr);
void mdec1Interrupt();
int mdecFreeze(gzFile f, int Mode);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c
index 6d4b9e92..0d801f7b 100644
--- a/libpcsxcore/misc.c
+++ b/libpcsxcore/misc.c
@@ -18,7 +18,7 @@
***************************************************************************/
/*
-* Miscellaneous functions, including savesates and CD-ROM loading.
+* Miscellaneous functions, including savestates and CD-ROM loading.
*/
#include "misc.h"
@@ -26,9 +26,6 @@
#include "mdec.h"
#include "ppf.h"
-int Log = 0;
-FILE *emuLog = NULL;
-
char CdromId[10] = "";
char CdromLabel[33] = "";
@@ -638,22 +635,6 @@ int RecvPcsxInfo() {
return 0;
}
-void __Log(char *fmt, ...) {
- va_list list;
-#ifdef LOG_STDOUT
- char tmp[1024];
-#endif
-
- va_start(list, fmt);
-#ifndef LOG_STDOUT
- vfprintf(emuLog, fmt, list);
-#else
- vsprintf(tmp, fmt, list);
- SysPrintf(tmp);
-#endif
- va_end(list);
-}
-
// remove the leading and trailing spaces in a string
void trim(char *str) {
int pos = 0;
diff --git a/libpcsxcore/misc.h b/libpcsxcore/misc.h
index 73da9457..f589ec6c 100644
--- a/libpcsxcore/misc.h
+++ b/libpcsxcore/misc.h
@@ -20,6 +20,10 @@
#ifndef __MISC_H__
#define __MISC_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
#include "coff.h"
#include "plugins.h"
@@ -52,8 +56,6 @@ typedef struct {
extern char CdromId[10];
extern char CdromLabel[33];
-extern FILE *emuLog;
-
int LoadCdrom();
int LoadCdromFile(char *filename, EXE_HEADER *head);
int CheckCdrom();
@@ -68,4 +70,7 @@ int RecvPcsxInfo();
void trim(char *str);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/plugins.h b/libpcsxcore/plugins.h
index 949dea0c..d3c64f91 100644
--- a/libpcsxcore/plugins.h
+++ b/libpcsxcore/plugins.h
@@ -19,6 +19,10 @@
#ifndef __PLUGINS_H__
#define __PLUGINS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "psxcommon.h"
@@ -329,5 +333,8 @@ extern NETkeypressed NET_keypressed;
void CALLBACK clearDynarec(void);
extern char cdrfilename[MAXPATHLEN]; // FIXME: cleanup
-
+
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/ppc/pGte.h b/libpcsxcore/ppc/pGte.h
index 3f109fef..a968460b 100644
--- a/libpcsxcore/ppc/pGte.h
+++ b/libpcsxcore/ppc/pGte.h
@@ -16,6 +16,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA
*/
+#ifndef PGET_H
+#define PGET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int psxCP2time[64] = {
2, 16 , 1 , 1, 1, 1 , 8, 1, // 00
1 , 1 , 1 , 1, 6 , 1 , 1 , 1, // 08
@@ -77,3 +84,8 @@ CP2_FUNCNC(RTPT);
CP2_FUNC(GPF);
CP2_FUNC(GPL);
CP2_FUNCNC(NCCT);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/libpcsxcore/ppc/ppc.h b/libpcsxcore/ppc/ppc.h
index 8385da5b..a6134d4f 100644
--- a/libpcsxcore/ppc/ppc.h
+++ b/libpcsxcore/ppc/ppc.h
@@ -7,6 +7,10 @@
#ifndef __PPC_H__
#define __PPC_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// include basic types
#include "../psxcommon.h"
#include "ppc_mnemonics.h"
@@ -50,25 +54,7 @@ u16 dynMemRead16(u32 mem);
u32 dynMemRead32(u32 mem);
void dynMemWrite32(u32 mem, u32 val);
-#endif /* __PPC_H__ */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/libpcsxcore/ppc/reguse.h b/libpcsxcore/ppc/reguse.h
index 69001ef3..de42dece 100644
--- a/libpcsxcore/ppc/reguse.h
+++ b/libpcsxcore/ppc/reguse.h
@@ -1,7 +1,10 @@
-
#ifndef __REGUSE_H__
#define __REGUSE_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// include basic types
#include "../psxcommon.h"
@@ -74,4 +77,7 @@ int useOfPsxReg(u32 code, int use, int psxreg) __attribute__ ((__pure__));;
int nextPsxRegUse(u32 pc, int psxreg) __attribute__ ((__pure__));;
int isPsxRegUsed(u32 pc, int psxreg) __attribute__ ((__pure__));;
-#endif /* __REGUSE_H__ */
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/libpcsxcore/ppf.h b/libpcsxcore/ppf.h
index d57a9301..f578028b 100644
--- a/libpcsxcore/ppf.h
+++ b/libpcsxcore/ppf.h
@@ -19,8 +19,15 @@
#ifndef __PPF_H__
#define __PPF_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void BuildPPFCache();
void FreePPFCache();
void CheckPPFCache(unsigned char *pB, unsigned char m, unsigned char s, unsigned char f);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/psemu_plugin_defs.h b/libpcsxcore/psemu_plugin_defs.h
index 1b16fd42..d1b05ac3 100644
--- a/libpcsxcore/psemu_plugin_defs.h
+++ b/libpcsxcore/psemu_plugin_defs.h
@@ -1,6 +1,10 @@
#ifndef _PSEMU_PLUGIN_DEFS_H
#define _PSEMU_PLUGIN_DEFS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// header version
#define _PPDK_HEADER_VERSION 3
@@ -275,5 +279,7 @@ typedef struct {
key is a XK_?? (X11) keycode.
*/
-
+#ifdef __cplusplus
+}
+#endif
#endif // _PSEMU_PLUGIN_DEFS_H
diff --git a/libpcsxcore/psxbios.h b/libpcsxcore/psxbios.h
index 6f29d351..80881a39 100644
--- a/libpcsxcore/psxbios.h
+++ b/libpcsxcore/psxbios.h
@@ -20,6 +20,10 @@
#ifndef __PSXBIOS_H__
#define __PSXBIOS_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
#include "r3000a.h"
#include "psxmem.h"
@@ -39,4 +43,7 @@ extern void (*biosA0[256])();
extern void (*biosB0[256])();
extern void (*biosC0[256])();
-#endif /* __PSXBIOS_H__ */
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/libpcsxcore/psxcommon.c b/libpcsxcore/psxcommon.c
index a97f3dc2..28953a19 100644
--- a/libpcsxcore/psxcommon.c
+++ b/libpcsxcore/psxcommon.c
@@ -18,5 +18,51 @@
***************************************************************************/
#include "psxcommon.h"
+#include "r3000a.h"
+
+#include "cheat.h"
PcsxConfig Config;
+
+int Log = 0;
+FILE *emuLog = NULL;
+
+int EmuInit() {
+ return psxInit();
+}
+
+void EmuReset() {
+ FreeCheatSearchResults();
+ FreeCheatSearchMem();
+
+ psxReset();
+}
+
+void EmuShutdown() {
+ ClearAllCheats();
+ FreeCheatSearchResults();
+ FreeCheatSearchMem();
+
+ psxShutdown();
+}
+
+void EmuUpdate() {
+ SysUpdate();
+ ApplyCheats();
+}
+
+void __Log(char *fmt, ...) {
+ va_list list;
+#ifdef LOG_STDOUT
+ char tmp[1024];
+#endif
+
+ va_start(list, fmt);
+#ifndef LOG_STDOUT
+ vfprintf(emuLog, fmt, list);
+#else
+ vsprintf(tmp, fmt, list);
+ SysPrintf(tmp);
+#endif
+ va_end(list);
+}
diff --git a/libpcsxcore/psxcommon.h b/libpcsxcore/psxcommon.h
index a154a388..1b89d63d 100644
--- a/libpcsxcore/psxcommon.h
+++ b/libpcsxcore/psxcommon.h
@@ -25,6 +25,10 @@
#ifndef __PSXCOMMON_H__
#define __PSXCOMMON_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "config.h"
// System includes
@@ -92,7 +96,9 @@ typedef uint8_t boolean;
#endif
+extern FILE *emuLog;
extern int Log;
+
void __Log(char *fmt, ...);
typedef struct {
@@ -152,4 +158,12 @@ enum {
PSX_TYPE_PAL
}; // PSX Type
+int EmuInit();
+void EmuReset();
+void EmuShutdown();
+void EmuUpdate();
+
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c
index dd68427d..e66b6ff5 100644
--- a/libpcsxcore/psxcounters.c
+++ b/libpcsxcore/psxcounters.c
@@ -22,7 +22,6 @@
*/
#include "psxcounters.h"
-#include "cheat.h"
/******************************************************************************/
@@ -300,8 +299,7 @@ void psxRcntUpdate()
setIrq( 0x01 );
GPU_updateLace();
- SysUpdate();
- ApplyCheats();
+ EmuUpdate();
}
}
diff --git a/libpcsxcore/psxcounters.h b/libpcsxcore/psxcounters.h
index 137d13ef..bccb2e4d 100644
--- a/libpcsxcore/psxcounters.h
+++ b/libpcsxcore/psxcounters.h
@@ -20,6 +20,10 @@
#ifndef __PSXCOUNTERS_H__
#define __PSXCOUNTERS_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
#include "r3000a.h"
#include "psxmem.h"
@@ -40,4 +44,7 @@ u32 psxRcntRtarget(u32 index);
s32 psxRcntFreeze(gzFile f, s32 Mode);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/psxdma.h b/libpcsxcore/psxdma.h
index 636a4bdb..f4d11623 100644
--- a/libpcsxcore/psxdma.h
+++ b/libpcsxcore/psxdma.h
@@ -20,6 +20,10 @@
#ifndef __PSXDMA_H__
#define __PSXDMA_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
#include "r3000a.h"
#include "psxhw.h"
@@ -43,4 +47,7 @@ void psxDma4(u32 madr, u32 bcr, u32 chcr);
void psxDma6(u32 madr, u32 bcr, u32 chcr);
void gpuInterrupt();
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/psxhle.h b/libpcsxcore/psxhle.h
index 70d58397..eef78e80 100644
--- a/libpcsxcore/psxhle.h
+++ b/libpcsxcore/psxhle.h
@@ -20,10 +20,17 @@
#ifndef __PSXHLE_H__
#define __PSXHLE_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
#include "r3000a.h"
#include "plugins.h"
extern void (*psxHLEt[256])();
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/psxhw.h b/libpcsxcore/psxhw.h
index eb3bad7a..f6a0a1de 100644
--- a/libpcsxcore/psxhw.h
+++ b/libpcsxcore/psxhw.h
@@ -20,6 +20,10 @@
#ifndef __PSXHW_H__
#define __PSXHW_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
#include "r3000a.h"
#include "psxmem.h"
@@ -69,4 +73,7 @@ void psxHwWrite16(u32 add, u16 value);
void psxHwWrite32(u32 add, u32 value);
int psxHwFreeze(gzFile f, int Mode);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/psxmem.h b/libpcsxcore/psxmem.h
index 535addba..d9fee002 100644
--- a/libpcsxcore/psxmem.h
+++ b/libpcsxcore/psxmem.h
@@ -20,6 +20,10 @@
#ifndef __PSXMEMORY_H__
#define __PSXMEMORY_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
#if defined(__BIGENDIAN__)
@@ -134,4 +138,7 @@ void psxMemWrite16(u32 mem, u16 value);
void psxMemWrite32(u32 mem, u32 value);
void *psxMemPointer(u32 mem);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c
index 5942f843..724089bb 100644
--- a/libpcsxcore/r3000a.c
+++ b/libpcsxcore/r3000a.c
@@ -25,9 +25,9 @@
#include "cdrom.h"
#include "mdec.h"
#include "gte.h"
-#include "cheat.h"
#include "ppf.h"
+R3000Acpu *psxCpu = NULL;
psxRegisters psxRegs;
int psxInit() {
@@ -49,9 +49,6 @@ int psxInit() {
}
void psxReset() {
- FreeCheatSearchResults(); // FIXME: cleanup
- FreeCheatSearchMem(); // FIXME: cleanup
-
psxCpu->Reset();
psxMemReset();
@@ -81,10 +78,6 @@ void psxShutdown() {
psxCpu->Shutdown();
- ClearAllCheats(); // FIXME: cleanup
- FreeCheatSearchResults(); // FIXME: cleanup
- FreeCheatSearchMem(); // FIXME: cleanup
-
FreePPFCache();
}
diff --git a/libpcsxcore/r3000a.h b/libpcsxcore/r3000a.h
index 5e9849aa..3ae1179c 100644
--- a/libpcsxcore/r3000a.h
+++ b/libpcsxcore/r3000a.h
@@ -20,6 +20,10 @@
#ifndef __R3000A_H__
#define __R3000A_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
#include "psxmem.h"
#include "psxcounters.h"
@@ -34,7 +38,7 @@ typedef struct {
void (*Shutdown)();
} R3000Acpu;
-R3000Acpu *psxCpu;
+extern R3000Acpu *psxCpu;
extern R3000Acpu psxInt;
#if (defined(__x86_64__) || defined(__i386__) || defined(__sh__) || defined(__ppc__)) && !defined(NOPSXREC)
extern R3000Acpu psxRec;
@@ -237,4 +241,7 @@ void psxTestSWInts();
void psxTestHWInts();
void psxJumpTest();
-#endif /* __R3000A_H__ */
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/libpcsxcore/sio.h b/libpcsxcore/sio.h
index df6ddda3..56e71d7e 100644
--- a/libpcsxcore/sio.h
+++ b/libpcsxcore/sio.h
@@ -21,6 +21,10 @@
#ifndef _SIO_H_
#define _SIO_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
#include "r3000a.h"
#include "psxmem.h"
@@ -81,4 +85,7 @@ typedef struct {
void GetMcdBlockInfo(int mcd, int block, McdBlock *info);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/socket.h b/libpcsxcore/socket.h
index bb0a978d..7ee0deb4 100644
--- a/libpcsxcore/socket.h
+++ b/libpcsxcore/socket.h
@@ -18,6 +18,10 @@
#ifndef __SOCKET_H__
#define __SOCKET_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int StartServer();
void StopServer();
@@ -33,4 +37,7 @@ void WriteSocket(char * buffer, int len);
void SetsBlock();
void SetsNonblock();
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/spu.h b/libpcsxcore/spu.h
index 1adb7148..85010cbd 100644
--- a/libpcsxcore/spu.h
+++ b/libpcsxcore/spu.h
@@ -20,6 +20,10 @@
#ifndef __SPU_H__
#define __SPU_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "psxcommon.h"
#include "plugins.h"
#include "r3000a.h"
@@ -37,4 +41,7 @@
void CALLBACK SPUirq(void);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/libpcsxcore/system.h b/libpcsxcore/system.h
index 9f7159e1..c869fdf1 100644
--- a/libpcsxcore/system.h
+++ b/libpcsxcore/system.h
@@ -20,6 +20,10 @@
#ifndef __SYSTEM_H__
#define __SYSTEM_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int SysInit(); // Init mem and plugins
void SysReset(); // Resets mem
void SysPrintf(const char *fmt, ...); // Printf used by bios syscalls
@@ -32,4 +36,7 @@ void SysUpdate(); // Called on VBlank (to update i.e. pads)
void SysRunGui(); // Returns to the Gui
void SysClose(); // Close mem and plugins
+#ifdef __cplusplus
+}
+#endif
#endif