summaryrefslogtreecommitdiff
path: root/includes/mips.h
diff options
context:
space:
mode:
Diffstat (limited to 'includes/mips.h')
-rw-r--r--includes/mips.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/includes/mips.h b/includes/mips.h
new file mode 100644
index 0000000..b0409ea
--- /dev/null
+++ b/includes/mips.h
@@ -0,0 +1,39 @@
+#ifndef __MIPS_H__
+#define __MIPS_H__
+#include <Exceptions.h>
+#include <generic.h>
+#include <Handle.h>
+
+class mips : public Base {
+ public:
+ Uint8 Read8(Uint32);
+ Uint16 Read16(Uint32);
+ Uint32 Read32(Uint32);
+ void Write8(Uint32, Uint8);
+ void Write16(Uint32, Uint16);
+ void Write32(Uint32, Uint32);
+ void unpatch8(Uint32);
+ void unpatch16(Uint32);
+ void unpatch32(Uint32);
+ bool IsPatched(Uint32);
+ void LoadEXE(Handle *);
+ void SaveEXE(Handle *);
+ Uint32 GetPC();
+ private:
+ void patch(Uint32, int);
+ void unpatch(Uint32, int);
+ Uint8 psyqhead[0x800];
+ Uint8 plainmemory[0x200000];
+ Uint8 patches[0x200000];
+ Uint8 patchesmap[0x200000 / 8];
+ Uint32 paddr, psize, startpc;
+
+ struct psyq {
+ Uint8 id[8];
+ Uint32 text, data, pc0, gp0, t_addr, t_size;
+ Uint32 d_addr, d_size, b_addr, b_size, s_addr, s_size;
+ Uint32 sp, fp, gp, ra, s0;
+ };
+};
+
+#endif