summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/cdutils.h6
-rw-r--r--includes/mips.h39
2 files changed, 45 insertions, 0 deletions
diff --git a/includes/cdutils.h b/includes/cdutils.h
index 91bb54c..86779ba 100644
--- a/includes/cdutils.h
+++ b/includes/cdutils.h
@@ -25,6 +25,12 @@
#include "Handle.h"
+#define MODE0 0
+#define MODE1 1
+#define MODE2 2
+#define MODE2_FORM1 3
+#define MODE2_FORM2 4
+#define MODE_RAW 5
#define GUESS 6
extern const long sec_sizes[];
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