aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotaz2011-06-26 22:56:05 +0300
committernotaz2011-07-08 00:15:08 +0300
commit4955e9d068cd7cbb2bc8755d7bab09b78b92a981 (patch)
tree7381847395b43e468fa7c9786bea16ed25e1a0d6
parent618ee30b058fe23028dbd963aab3bf7a8062036f (diff)
downloadpcsx_rearmed-4955e9d068cd7cbb2bc8755d7bab09b78b92a981.tar.gz
pcsx_rearmed-4955e9d068cd7cbb2bc8755d7bab09b78b92a981.tar.bz2
pcsx_rearmed-4955e9d068cd7cbb2bc8755d7bab09b78b92a981.zip
cdrom: replace resched hack with another one
almost certainly wrong but hopefully better.
-rw-r--r--libpcsxcore/cdrom.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c
index c667ac4..87a7c19 100644
--- a/libpcsxcore/cdrom.c
+++ b/libpcsxcore/cdrom.c
@@ -1902,9 +1902,13 @@ void cdrWrite3(unsigned char rt) {
// - Final Fantasy Tactics
// - various other games
- if (cdr.Irq) // rearmed guesswork hack
if (cdr.Reading && !cdr.ResultReady) {
- CDREAD_INT((cdr.Mode & MODE_SPEED) ? (cdReadTime / 2) : cdReadTime);
+ int left = psxRegs.intCycle[PSXINT_CDREAD].sCycle + psxRegs.intCycle[PSXINT_CDREAD].cycle - psxRegs.cycle;
+ int time = (cdr.Mode & MODE_SPEED) ? (cdReadTime / 2) : cdReadTime;
+ if (left < time / 2) { // rearmed guesswork hack
+ //printf("-- resched %d -> %d\n", left, time / 2);
+ CDREAD_INT(time / 2);
+ }
}
return;