* Fix <sys/mman.h> symlink
Using a symlink made it impossible to compile on Windows with MinGW.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
* lightrec: Fix crash on Windows and WiiU
Fix crash on platforms that don't use Lightrec's custom map.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
* lightrec: Fix has_interrupt() using PCSX' registers
It should use Lightrec's internal CP0 registers instead.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
* git subrepo pull --force deps/lightrec
subrepo:
subdir: "deps/lightrec"
merged: "
071973e3ac"
upstream:
origin: "https://github.com/pcercuei/lightrec.git"
branch: "master"
commit: "
071973e3ac"
git-subrepo:
version: "0.4.3"
origin: "https://github.com/ingydotnet/git-subrepo.git"
commit: "
2f68596"
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
deps/lightrec/reaper.o
libpcsxcore/lightrec/mem.o: CFLAGS += -D_GNU_SOURCE
ifeq ($(MMAP_WIN32),1)
-CFLAGS += -Iinclude/mman
+CFLAGS += -Iinclude/mman -I deps/mman
OBJS += deps/mman/mman.o
endif
else ifeq "$(DYNAREC)" "ari64"
[subrepo]
remote = https://github.com/pcercuei/lightrec.git
branch = master
- commit = e1222761836bb478dcec86cf441dcc5514565137
- parent = eeff1b0a26e4c7f7449640c0bf999e506f538694
+ commit = 071973e3ac26619cd3afbe339f020a2d4d61c28a
+ parent = cc8a5c0c654c18b3ad074e49f526cb6cae77f8b0
method = merge
cmdver = 0.4.3
if (!nor)
flags_rd = REG_ZEXT & flags_rs & flags_rt;
- /* E(rd) = (E(rs) & E(rt)) | (E(rt) & !Z(rt)) | (E(rs) & !Z(rs)) */
- if ((REG_EXT & flags_rs & flags_rt) ||
- ((flags_rt & (REG_EXT | REG_ZEXT)) == REG_EXT) ||
- ((flags_rs & (REG_EXT | REG_ZEXT)) == REG_EXT))
+ /* E(rd) = E(rs) & E(rt) */
+ if (REG_EXT & flags_rs & flags_rt)
flags_rd |= REG_EXT;
lightrec_set_reg_out_flags(reg_cache, rd, flags_rd);
return 0;
}
- if (unlikely(map->ops)) {
- if (flags && !LIGHTREC_FLAGS_GET_IO_MODE(*flags))
- *flags |= LIGHTREC_IO_MODE(LIGHTREC_IO_HW);
- ops = map->ops;
- } else {
+ if (likely(!map->ops)) {
if (flags && !LIGHTREC_FLAGS_GET_IO_MODE(*flags))
*flags |= LIGHTREC_IO_MODE(LIGHTREC_IO_DIRECT);
ops = &lightrec_default_ops;
+ } else if (flags &&
+ LIGHTREC_FLAGS_GET_IO_MODE(*flags) == LIGHTREC_IO_DIRECT_HW) {
+ ops = &lightrec_default_ops;
+ } else {
+ if (flags && !LIGHTREC_FLAGS_GET_IO_MODE(*flags))
+ *flags |= LIGHTREC_IO_MODE(LIGHTREC_IO_HW);
+
+ ops = map->ops;
}
switch (op.i.op) {
+++ /dev/null
-../../../deps/mman/mman.h
\ No newline at end of file
--- /dev/null
+#include <mman.h>
static bool has_interrupt(void)
{
+ struct lightrec_registers *regs = lightrec_get_registers(lightrec_state);
+
return ((psxHu32(0x1070) & psxHu32(0x1074)) &&
- (psxRegs.CP0.n.Status & 0x401) == 0x401) ||
- (psxRegs.CP0.n.Status & psxRegs.CP0.n.Cause & 0x0300);
+ (regs->cp0[12] & 0x401) == 0x401) ||
+ (regs->cp0[12] & regs->cp0[13] & 0x0300);
}
static void lightrec_restore_state(struct lightrec_state *state)
lightrec_map[PSX_MAP_KERNEL_USER_RAM].address = psxM;
lightrec_map[PSX_MAP_BIOS].address = psxR;
lightrec_map[PSX_MAP_SCRATCH_PAD].address = psxH;
+ lightrec_map[PSX_MAP_HW_REGISTERS].address = psxH + 0x1000;
lightrec_map[PSX_MAP_PARALLEL_PORT].address = psxP;
if (LIGHTREC_CUSTOM_MAP) {
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_HW_REGISTERS].address = psxH + 0x1000;
lightrec_map[PSX_MAP_CODE_BUFFER].address = code_buffer;
}