Skip to content

Commit

Permalink
drc: adjust timing hacks
Browse files Browse the repository at this point in the history
also drop the difference from other cpu cores
#858
notaz#349
  • Loading branch information
notaz committed Jan 11, 2025
1 parent 5231b38 commit 9d701f8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions libpcsxcore/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 4 additions & 2 deletions libpcsxcore/database.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
15 changes: 11 additions & 4 deletions libpcsxcore/new_dynarec/new_dynarec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9d701f8

Please sign in to comment.