notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cdrom: should use the last Setloc loc and SeekL
[pcsx_rearmed.git]
/
libpcsxcore
/
lightrec
/
plugin.c
diff --git
a/libpcsxcore/lightrec/plugin.c
b/libpcsxcore/lightrec/plugin.c
index
4b28c56
..
52d37f0
100644
(file)
--- a/
libpcsxcore/lightrec/plugin.c
+++ b/
libpcsxcore/lightrec/plugin.c
@@
-15,6
+15,9
@@
#include "../frontend/main.h"
#include "../frontend/main.h"
+#include "mem.h"
+#include "plugin.h"
+
#if (defined(__arm__) || defined(__aarch64__)) && !defined(ALLOW_LIGHTREC_ON_ARM)
#error "Lightrec should not be used on ARM (please specify DYNAREC=ari64 to make)"
#endif
#if (defined(__arm__) || defined(__aarch64__)) && !defined(ALLOW_LIGHTREC_ON_ARM)
#error "Lightrec should not be used on ARM (please specify DYNAREC=ari64 to make)"
#endif
@@
-289,6
+292,9
@@
static struct lightrec_mem_map lightrec_map[] = {
.length = 0x200000,
.mirror_of = &lightrec_map[PSX_MAP_KERNEL_USER_RAM],
},
.length = 0x200000,
.mirror_of = &lightrec_map[PSX_MAP_KERNEL_USER_RAM],
},
+ [PSX_MAP_CODE_BUFFER] = {
+ .length = CODE_BUFFER_SIZE,
+ },
};
static void lightrec_enable_ram(struct lightrec_state *state, bool enable)
};
static void lightrec_enable_ram(struct lightrec_state *state, bool enable)
@@
-315,6
+321,7
@@
static int lightrec_plugin_init(void)
lightrec_map[PSX_MAP_MIRROR1].address = psxM + 0x200000;
lightrec_map[PSX_MAP_MIRROR2].address = psxM + 0x400000;
lightrec_map[PSX_MAP_MIRROR3].address = psxM + 0x600000;
lightrec_map[PSX_MAP_MIRROR1].address = psxM + 0x200000;
lightrec_map[PSX_MAP_MIRROR2].address = psxM + 0x400000;
lightrec_map[PSX_MAP_MIRROR3].address = psxM + 0x600000;
+ lightrec_map[PSX_MAP_CODE_BUFFER].address = code_buffer;
}
lightrec_debug = !!getenv("LIGHTREC_DEBUG");
}
lightrec_debug = !!getenv("LIGHTREC_DEBUG");
@@
-549,11
+556,14
@@
static void lightrec_plugin_reset(void)
{
struct lightrec_registers *regs;
{
struct lightrec_registers *regs;
- lightrec_plugin_shutdown();
- lightrec_plugin_init();
-
regs = lightrec_get_registers(lightrec_state);
regs = lightrec_get_registers(lightrec_state);
+ /* Invalidate all blocks */
+ lightrec_invalidate_all(lightrec_state);
+
+ /* Reset registers */
+ memset(regs, 0, sizeof(*regs));
+
regs->cp0[12] = 0x10900000; // COP0 enabled | BEV = 1 | TS = 1
regs->cp0[15] = 0x00000002; // PRevID = Revision ID, same as R3000A
regs->cp0[12] = 0x10900000; // COP0 enabled | BEV = 1 | TS = 1
regs->cp0[15] = 0x00000002; // PRevID = Revision ID, same as R3000A