From 26bd3dadfd724f73242ab317fce3a50af8135db6 Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 24 Nov 2021 22:52:53 +0200 Subject: [PATCH] drc: only override default cycle_multiplier To let the user tune if they want. Also iS multiplier in db was still too small for HLE mode. --- frontend/menu.c | 2 +- libpcsxcore/database.c | 2 +- libpcsxcore/new_dynarec/new_dynarec.c | 4 ++-- libpcsxcore/new_dynarec/new_dynarec.h | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/menu.c b/frontend/menu.c index fbcda2d8..f5d035a0 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -102,7 +102,7 @@ int soft_scaling, analog_deadzone; // for Caanoo int soft_filter; #ifndef HAVE_PRE_ARMV7 -#define DEFAULT_PSX_CLOCK 57 +#define DEFAULT_PSX_CLOCK (10000 / CYCLE_MULT_DEFAULT) #define DEFAULT_PSX_CLOCK_S "57" #else #define DEFAULT_PSX_CLOCK 50 diff --git a/libpcsxcore/database.c b/libpcsxcore/database.c index 108ccc69..4d4439ad 100644 --- a/libpcsxcore/database.c +++ b/libpcsxcore/database.c @@ -40,7 +40,7 @@ void Apply_Hacks_Cdrom() /* Internal Section is fussy about timings */ if (strcmp(CdromId, "SLPS01868") == 0) { - cycle_multiplier_override = 200; + cycle_multiplier_override = 202; new_dynarec_hacks_pergame |= NDHACK_OVERRIDE_CYCLE_M; } } diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index a8fdf477..f6ea2996 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -465,13 +465,13 @@ static void do_clear_cache(void) #define NO_CYCLE_PENALTY_THR 12 -int cycle_multiplier; // 100 for 1.0 +int cycle_multiplier = CYCLE_MULT_DEFAULT; // 100 for 1.0 int cycle_multiplier_override; int cycle_multiplier_old; static int CLOCK_ADJUST(int x) { - int m = cycle_multiplier_override + int m = cycle_multiplier_override && cycle_multiplier == CYCLE_MULT_DEFAULT ? cycle_multiplier_override : cycle_multiplier; int s=(x>>31)|1; return (x * m + s * 50) / 100; diff --git a/libpcsxcore/new_dynarec/new_dynarec.h b/libpcsxcore/new_dynarec/new_dynarec.h index b9a3c67c..f1464696 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.h +++ b/libpcsxcore/new_dynarec/new_dynarec.h @@ -4,6 +4,8 @@ extern int pcaddr; extern int pending_exception; extern int stop; extern int new_dynarec_did_compile; + +#define CYCLE_MULT_DEFAULT 175 extern int cycle_multiplier; // 100 for 1.0 extern int cycle_multiplier_override; extern int cycle_multiplier_old; -- 2.39.5