From 3fbb64711f6172ca431f997974718f3c86cc4b58 Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 9 Jan 2025 21:23:39 +0200 Subject: [PATCH 1/3] lightrec: update to match libretro branch --- .gitmodules | 2 +- deps/lightning | 2 +- deps/lightrec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index e96248d92..97221aa3f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,7 @@ url = https://github.com/pcercuei/lightrec.git [submodule "deps/lightning"] path = deps/lightning - url = https://github.com/pcercuei/gnu_lightning.git + url = https://git.savannah.gnu.org/git/lightning.git [submodule "deps/libretro-common"] path = deps/libretro-common url = https://github.com/libretro/libretro-common.git diff --git a/deps/lightning b/deps/lightning index de026794c..a6bb2b5a7 160000 --- a/deps/lightning +++ b/deps/lightning @@ -1 +1 @@ -Subproject commit de026794c71386983034461bce2df3c63ccd5827 +Subproject commit a6bb2b5a7cf36e074e12ccaed32990b437deb784 diff --git a/deps/lightrec b/deps/lightrec index ea20362c9..05f7e09e9 160000 --- a/deps/lightrec +++ b/deps/lightrec @@ -1 +1 @@ -Subproject commit ea20362c9542f12fb6a0f27aa7df66b2af06b84d +Subproject commit 05f7e09e919327677454099664656e681f755ee5 From 5231b38ca46f1d433b2ce3e29a99401321bc7992 Mon Sep 17 00:00:00 2001 From: Benjamin FRANCOIS Date: Fri, 10 Jan 2025 11:56:50 -0800 Subject: [PATCH 2/3] restore Haiku build --- Makefile.libretro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.libretro b/Makefile.libretro index 18b4deeb8..40d635bb2 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -124,6 +124,8 @@ endif LIBPTHREAD := -lpthread ifneq ($(findstring Haiku,$(shell uname -s)),) LIBDL := -lroot -lnetwork +# easiest way to prevent libretro-common from breaking on Haiku +HAVE_PHYSICAL_CDROM := 0 else LIBDL := -ldl endif From 9d701f80d1efd007c385ff197b37944989b01c33 Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 12 Jan 2025 00:28:09 +0200 Subject: [PATCH 3/3] drc: adjust timing hacks also drop the difference from other cpu cores libretro/pcsx_rearmed#858 notaz/pcsx_rearmed#349 --- libpcsxcore/cdrom.c | 1 + libpcsxcore/database.c | 6 ++++-- libpcsxcore/new_dynarec/new_dynarec.c | 15 +++++++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 9e201eb97..0856e154f 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -1322,6 +1322,7 @@ static void cdrReadInterruptSetResult(unsigned char result) cdr.CmdInProgress, cdr.IrqStat); cdr.Irq1Pending = result; // F1 2000 timing hack :( + // compensate for some csum func @80014380 taking too long psxRegs.intCycle[PSXINT_CDREAD].sCycle += cdReadTime / 10; return; } diff --git a/libpcsxcore/database.c b/libpcsxcore/database.c index 35d004145..33acc07cf 100644 --- a/libpcsxcore/database.c +++ b/libpcsxcore/database.c @@ -139,9 +139,11 @@ cycle_multiplier_overrides[] = { 310, { "SLUS01114", "SLES03286" } }, /* Syphon Filter - reportedly hangs under unknown conditions */ { 169, { "SCUS94240" } }, +#ifndef DRC_DISABLE /* Psychic Detective - some weird race condition in the game's cdrom code */ - { 200, { "SLUS00165", "SLUS00166", "SLUS00167" } }, - { 200, { "SLES00070", "SLES10070", "SLES20070" } }, + { 181, { "SLUS00165", "SLUS00166", "SLUS00167" } }, + { 181, { "SLES00070", "SLES10070", "SLES20070" } }, +#endif /* Vib-Ribbon - cd timing issues (PAL+ari64drc only?) */ { 200, { "SCES02873" } }, /* Zero Divide - sometimes too fast */ diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index cc72e7a8f..4052f7486 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -6446,10 +6446,11 @@ static u_int *get_source_start(u_int addr, u_int *limit) /* (0x9fc00000 <= addr && addr < 0x9fc80000) ||*/ (0xbfc00000 <= addr && addr < 0xbfc80000)) { - // BIOS. The multiplier should be much higher as it's uncached 8bit mem, - // but timings in PCSX are too tied to the interpreter's 2-per-insn assumption - if (!HACK_ENABLED(NDHACK_OVERRIDE_CYCLE_M)) - cycle_multiplier_active = 200; + // BIOS. The multiplier should be much higher as it's uncached 8bit mem + // XXX: disabled as this introduces differences from the interpreter + // and lightrec multipliers making emu variations act inconsistently + //if (!HACK_ENABLED(NDHACK_OVERRIDE_CYCLE_M)) + // cycle_multiplier_active = 200; *limit = (addr & 0xfff00000) | 0x80000; return (u_int *)((u_char *)psxR + (addr&0x7ffff)); @@ -6616,6 +6617,12 @@ static int apply_hacks(void) dops[i + 3].itype = NOP; } } + if (source[0] == 0x3c05edb8 && source[1] == 0x34a58320) + { + // lui a1, 0xEDB8; ori a1, 0x8320 + SysPrintf("F1 2000 hack @%08x\n", start); + cycle_multiplier_active = 100; + } i = slen; if (i > 10 && source[i-1] == 0 && source[i-2] == 0x03e00008 && source[i-4] == 0x8fbf0018 && source[i-6] == 0x00c0f809