summaryrefslogtreecommitdiff
path: root/psp/mips_emit.h
diff options
context:
space:
mode:
authorAutechre2021-03-23 20:13:44 +0100
committerGitHub2021-03-23 20:13:44 +0100
commite5c685583ed8808580ca33c5a59d554bfbb989ad (patch)
tree11399685ea3766006b09d33f983cfae5b98c4f20 /psp/mips_emit.h
parentf31fa6a57be67619ce10279152d7c9dbf6c2307b (diff)
parentff510e7f7a0c04c7862e598e8bfc75747f3bf7d1 (diff)
downloadpicogpsp-e5c685583ed8808580ca33c5a59d554bfbb989ad.tar.gz
picogpsp-e5c685583ed8808580ca33c5a59d554bfbb989ad.tar.bz2
picogpsp-e5c685583ed8808580ca33c5a59d554bfbb989ad.zip
Merge pull request #118 from davidgfnet/master
Diffstat (limited to 'psp/mips_emit.h')
-rw-r--r--psp/mips_emit.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/psp/mips_emit.h b/psp/mips_emit.h
index b75f7f5..b996f2b 100644
--- a/psp/mips_emit.h
+++ b/psp/mips_emit.h
@@ -2618,11 +2618,7 @@ static void emit_mem_access_loadop(
#define genccall(fn) mips_emit_jal(((u32)fn) >> 2);
#endif
-// Stub memory map:
-// 0 .. 63 First patch handler [#0]
-// 448 .. 511 Last patch handler [#7]
-// 512+ smc_write handler
-#define SMC_WRITE_OFF32 160
+#define SMC_WRITE_OFF32 (10*16) /* 10 handlers (16 insts) */
// Describes a "plain" memory are, that is, an area that is just accessed
// as normal memory (with some caveats tho).
@@ -2862,8 +2858,7 @@ static void emit_pmemst_stub(
}
// If the data is non zero, we just wrote over code
// Local-jump to the smc_write (which lives at offset:0)
- unsigned instoffset = (&stub_arena[SMC_WRITE_OFF32] - (((u32*)translation_ptr) + 1));
- mips_emit_b(bne, reg_zero, reg_temp, instoffset);
+ mips_emit_b(bne, reg_zero, reg_temp, branch_offset(&stub_arena[SMC_WRITE_OFF32]));
}
// Store the data (delay slot from the SMC branch)