summaryrefslogtreecommitdiff
path: root/libpcsxcore/ppc/ppc.h
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-11-23 02:38:31 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-11-23 02:38:31 +0000
commit6b375badafb8ddc0a1c1a0eeaa29a70fea86b0c6 (patch)
tree103860b5e72fff6699cde6b0e5c25950a0ed35ab /libpcsxcore/ppc/ppc.h
parent4953fde289c18efa91926fcf7e81cf979f4c6c3d (diff)
downloadpcsxr-6b375badafb8ddc0a1c1a0eeaa29a70fea86b0c6.tar.gz
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@60002 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore/ppc/ppc.h')
-rw-r--r--libpcsxcore/ppc/ppc.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/libpcsxcore/ppc/ppc.h b/libpcsxcore/ppc/ppc.h
new file mode 100644
index 00000000..a6134d4f
--- /dev/null
+++ b/libpcsxcore/ppc/ppc.h
@@ -0,0 +1,60 @@
+/*
+ * ppc definitions v0.5.1
+ * Authors: linuzappz <linuzappz@pcsx.net>
+ * alexey silinov
+ */
+
+#ifndef __PPC_H__
+#define __PPC_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// include basic types
+#include "../psxcommon.h"
+#include "ppc_mnemonics.h"
+
+#define NUM_HW_REGISTERS 29
+
+/* general defines */
+#define write8(val) *(u8 *)ppcPtr = val; ppcPtr++;
+#define write16(val) *(u16*)ppcPtr = val; ppcPtr+=2;
+#define write32(val) *(u32*)ppcPtr = val; ppcPtr+=4;
+#define write64(val) *(u64*)ppcPtr = val; ppcPtr+=8;
+
+#define CALLFunc(FUNC) \
+{ \
+ u32 _func = (FUNC); \
+ ReleaseArgs(); \
+ if ((_func & 0x1fffffc) == _func) { \
+ BLA(_func); \
+ } else { \
+ LIW(0, _func); \
+ MTCTR(0); \
+ BCTRL(); \
+ } \
+}
+
+extern int cpuHWRegisters[NUM_HW_REGISTERS];
+
+extern u32 *ppcPtr;
+extern u8 *j8Ptr[32];
+extern u32 *j32Ptr[32];
+
+void ppcInit();
+void ppcSetPtr(u32 *ptr);
+void ppcShutdown();
+
+void ppcAlign(int bytes);
+void returnPC();
+void recRun(void (*func)(), u32 hw1, u32 hw2);
+u8 dynMemRead8(u32 mem);
+u16 dynMemRead16(u32 mem);
+u32 dynMemRead32(u32 mem);
+void dynMemWrite32(u32 mem, u32 val);
+
+#ifdef __cplusplus
+}
+#endif
+#endif