#include "misc.h"
-#include "../plugins/dfsound/spu_config.h"
#include "sio.h"
+#include "new_dynarec/new_dynarec.h"
/* It's duplicated from emu_if.c */
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
McdDisable[1] = 1;
}
}
+
+ /* Dynarec game-specific hacks */
+ new_dynarec_hacks &= ~NDHACK_OVERRIDE_CYCLE_M;
+
+ /* Internal Section is fussy about timings */
+ if (strcmp(CdromId, "SLPS01868") == 0)
+ {
+ cycle_multiplier_override = 200;
+ new_dynarec_hacks |= NDHACK_OVERRIDE_CYCLE_M;
+ }
}
#define NO_CYCLE_PENALTY_THR 12
int cycle_multiplier; // 100 for 1.0
+int cycle_multiplier_override;
static int CLOCK_ADJUST(int x)
{
+ int m = cycle_multiplier_override
+ ? cycle_multiplier_override : cycle_multiplier;
int s=(x>>31)|1;
- return (x * cycle_multiplier + s * 50) / 100;
+ return (x * m + s * 50) / 100;
}
static u_int get_page(u_int vaddr)
static u_int *get_source_start(u_int addr, u_int *limit)
{
+ if (!(new_dynarec_hacks & NDHACK_OVERRIDE_CYCLE_M))
+ cycle_multiplier_override = 0;
+
if (addr < 0x00200000 ||
- (0xa0000000 <= addr && addr < 0xa0200000)) {
+ (0xa0000000 <= addr && addr < 0xa0200000))
+ {
// used for BIOS calls mostly?
*limit = (addr&0xa0000000)|0x00200000;
return (u_int *)(rdram + (addr&0x1fffff));
}
else if (!Config.HLE && (
/* (0x9fc00000 <= addr && addr < 0x9fc80000) ||*/
- (0xbfc00000 <= addr && addr < 0xbfc80000))) {
- // BIOS
+ (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 BIAS
+ if (!(new_dynarec_hacks & NDHACK_OVERRIDE_CYCLE_M))
+ cycle_multiplier_override = 200;
+
*limit = (addr & 0xfff00000) | 0x80000;
return (u_int *)((u_char *)psxR + (addr&0x7ffff));
}
extern int stop;
extern int new_dynarec_did_compile;
extern int cycle_multiplier; // 100 for 1.0
+extern int cycle_multiplier_override;
#define NDHACK_NO_SMC_CHECK (1<<0)
#define NDHACK_GTE_UNNEEDED (1<<1)
#define NDHACK_GTE_NO_FLAGS (1<<2)
+#define NDHACK_OVERRIDE_CYCLE_M (1<<3)
extern int new_dynarec_hacks;
void new_dynarec_init(void);