notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix build
[pcsx_rearmed.git]
/
libpcsxcore
/
cdrom.c
diff --git
a/libpcsxcore/cdrom.c
b/libpcsxcore/cdrom.c
index
047172c
..
bc973e9
100644
(file)
--- a/
libpcsxcore/cdrom.c
+++ b/
libpcsxcore/cdrom.c
@@
-106,7
+106,7
@@
static struct {
u16 CmdInProgress;
u8 Irq1Pending;
u8 unused5;
u16 CmdInProgress;
u8 Irq1Pending;
u8 unused5;
- u32 LastReadCycles;
+ u32 LastRead
Seek
Cycles;
u8 unused7;
u8 unused7;
@@
-462,12
+462,13
@@
static int ReadTrack(const u8 *time)
static void UpdateSubq(const u8 *time)
{
const struct SubQ *subq;
static void UpdateSubq(const u8 *time)
{
const struct SubQ *subq;
+ int s = MSF2SECT(time[0], time[1], time[2]);
u16 crc;
u16 crc;
- if (CheckSBI(
time
))
+ if (CheckSBI(
s
))
return;
return;
- subq = (struct SubQ *)CDR_getBufferSub(
MSF2SECT(time[0], time[1], time[2])
);
+ subq = (struct SubQ *)CDR_getBufferSub(
s
);
if (subq != NULL && cdr.CurTrack == 1) {
crc = calcCrc((u8 *)subq + 12, 10);
if (crc == (((u16)subq->CRC[0] << 8) | subq->CRC[1])) {
if (subq != NULL && cdr.CurTrack == 1) {
crc = calcCrc((u8 *)subq + 12, 10);
if (crc == (((u16)subq->CRC[0] << 8) | subq->CRC[1])) {
@@
-555,16
+556,15
@@
static void cdrPlayInterrupt_Autopause()
cdr.ReportDelay--;
}
cdr.ReportDelay--;
}
-// LastReadCycles
static int cdrSeekTime(unsigned char *target)
{
int diff = msf2sec(cdr.SetSectorPlay) - msf2sec(target);
static int cdrSeekTime(unsigned char *target)
{
int diff = msf2sec(cdr.SetSectorPlay) - msf2sec(target);
- int
pausePenalty,
seekTime = abs(diff) * (cdReadTime / 2000);
+ int seekTime = abs(diff) * (cdReadTime / 2000);
seekTime = MAX_VALUE(seekTime, 20000);
// need this stupidly long penalty or else Spyro2 intro desyncs
seekTime = MAX_VALUE(seekTime, 20000);
// need this stupidly long penalty or else Spyro2 intro desyncs
- pausePenalty = (s32)(psxRegs.cycle - cdr.LastReadCycles) > cdReadTime * 8 ? cdReadTime * 25 : 0;
-
seekTime += pausePenalty
;
+ if ((s32)(psxRegs.cycle - cdr.LastReadSeekCycles) > cdReadTime * 8)
+
seekTime += cdReadTime * 25
;
seekTime = MIN_VALUE(seekTime, PSXCLK * 2 / 3);
CDR_LOG("seek: %.2f %.2f\n", (float)seekTime / PSXCLK, (float)seekTime / cdReadTime);
seekTime = MIN_VALUE(seekTime, PSXCLK * 2 / 3);
CDR_LOG("seek: %.2f %.2f\n", (float)seekTime / PSXCLK, (float)seekTime / cdReadTime);
@@
-633,7
+633,7
@@
static void msfiSub(u8 *msfi, u32 count)
void cdrPlayReadInterrupt(void)
{
void cdrPlayReadInterrupt(void)
{
- cdr.LastReadCycles = psxRegs.cycle;
+ cdr.LastRead
Seek
Cycles = psxRegs.cycle;
if (cdr.Reading) {
cdrReadInterrupt();
if (cdr.Reading) {
cdrReadInterrupt();
@@
-1071,6
+1071,7
@@
void cdrInterrupt(void) {
memcpy(cdr.LocL, buf, 8);
UpdateSubq(cdr.SetSectorPlay);
cdr.TrackChanged = FALSE;
memcpy(cdr.LocL, buf, 8);
UpdateSubq(cdr.SetSectorPlay);
cdr.TrackChanged = FALSE;
+ cdr.LastReadSeekCycles = psxRegs.cycle;
break;
case CdlTest:
break;
case CdlTest: