Skip to content

Commit

Permalink
mdec: timing hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
notaz committed Dec 16, 2024
1 parent a5aec87 commit 9cbce41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions libpcsxcore/database.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,16 @@ cycle_multiplier_overrides[] =
/* Syphon Filter - reportedly hangs under unknown conditions */
{ 169, { "SCUS94240" } },
/* Psychic Detective - some weird race condition in the game's cdrom code */
{ 222, { "SLUS00165", "SLUS00166", "SLUS00167" } },
{ 222, { "SLES00070", "SLES10070", "SLES20070" } },
{ 200, { "SLUS00165", "SLUS00166", "SLUS00167" } },
{ 200, { "SLES00070", "SLES10070", "SLES20070" } },
/* Vib-Ribbon - cd timing issues (PAL+ari64drc only?) */
{ 200, { "SCES02873" } },
/* Zero Divide - sometimes too fast */
{ 200, { "SLUS00183", "SLES00159", "SLPS00083", "SLPM80008" } },
/* Eagle One: Harrier Attack - hangs (but not in standalone build?) */
{ 153, { "SLUS00943" } },
/* Sol Divide: FMV timing */
{ 200, { "SLUS01519", "SCPS45260", "SLPS01463" } },
};

/* Function for automatic patching according to GameID. */
Expand Down
10 changes: 6 additions & 4 deletions libpcsxcore/mdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
*/

/*
* >= 10 for Galerians
* >= 14 for Sol Divide
* <= 18 for "Disney's Treasure Planet"
* Psychic Detective may break on *any* change
*/
#define MDEC_BIAS 10
#define MDEC_BIAS 14
#define MDEC_DELAY 1024

#define DSIZE 8
#define DSIZE2 (DSIZE * DSIZE)
Expand Down Expand Up @@ -654,9 +656,9 @@ void psxDma1(u32 adr, u32 bcr, u32 chcr) {
log_unhandled("mdec: bork\n");

/* define the power of mdec */
set_event(PSXINT_MDECOUTDMA, words * MDEC_BIAS);
set_event(PSXINT_MDECOUTDMA, words * MDEC_BIAS + MDEC_DELAY);
/* some CPU stalling */
psxRegs.cycle += words;
psxRegs.cycle += words * MDEC_BIAS / 4;
}

void mdec1Interrupt() {
Expand Down

0 comments on commit 9cbce41

Please sign in to comment.