enum seeked_state {
SEEK_PENDING = 0,
SEEK_DONE = 1,
- SEEK_DOING_CMD = 2,
};
static struct CdrStat stat;
struct SubQ *subq = (struct SubQ *)CDR_getBufferSub();
int track_changed = 0;
if (subq != NULL ) {
- // update subq
- ReadTrack( cdr.SetSectorPlay );
-
- CDR_LOG( "CDDA SUB - %X:%X:%X\n",
- subq->AbsoluteAddress[0], subq->AbsoluteAddress[1], subq->AbsoluteAddress[2] );
-
/*
CDDA Autopause
if( cdr.CurTrack + 1 == btoi( subq->TrackNumber ) )
track_changed = 1;
} else {
- Create_Fake_Subq();
- CDR_LOG( "CDDA FAKE SUB - %d:%d:%d\n",
- fake_subq_real[0], fake_subq_real[1], fake_subq_real[2] );
-
track_changed = fake_subq_change;
fake_subq_change = 0;
}
// also handles seek
void cdrPlayInterrupt()
{
- if (cdr.Seeked == SEEK_DOING_CMD) {
+ if (cdr.Seeked == SEEK_PENDING) {
if (cdr.Stat) {
CDR_LOG_I("cdrom: seek stat hack\n");
CDRMISC_INT(0x1000);
cdr.StatP |= STATUS_ROTATING;
cdr.StatP &= ~STATUS_SEEK;
cdr.Result[0] = cdr.StatP;
+ cdr.Seeked = SEEK_DONE;
if (cdr.Irq == 0) {
cdr.Stat = Complete;
setIrq();
}
- cdr.Seeked = SEEK_PENDING;
- CDRMISC_INT(cdReadTime * 20); // ???
- return;
- }
- else if (cdr.Seeked == SEEK_PENDING) {
- cdr.Seeked = SEEK_DONE;
- if (!cdr.Play && !cdr.Reading) {
- memcpy(cdr.SetSectorPlay, cdr.SetSector, 4);
- Find_CurTrack();
- ReadTrack(cdr.SetSector);
- }
+ memcpy(cdr.SetSectorPlay, cdr.SetSector, 4);
+ Find_CurTrack();
+ ReadTrack(cdr.SetSectorPlay);
}
+ // update for CdlGetlocP/autopause
+ struct SubQ *subq = (struct SubQ *)CDR_getBufferSub();
+ if (subq != NULL)
+ // update subq
+ ReadTrack(cdr.SetSectorPlay);
+ else
+ Create_Fake_Subq();
+
if (!cdr.Play) return;
CDR_LOG( "CDDA - %d:%d:%d\n",
CDRMISC_INT( cdReadTime );
- if (!cdr.Irq && !cdr.Stat && (cdr.Mode & MODE_CDDA) && (cdr.Mode & (MODE_AUTOPAUSE|MODE_REPORT)))
+ if (!cdr.Irq && !cdr.Stat && (cdr.Mode & (MODE_AUTOPAUSE|MODE_REPORT)))
cdrPlayInterrupt_Autopause();
cdr.SetSectorPlay[2]++;
subq = (struct SubQ *)CDR_getBufferSub();
if (subq != NULL) {
- if( cdr.Play && (cdr.Mode & MODE_CDDA) && !(cdr.Mode & (MODE_AUTOPAUSE|MODE_REPORT)) )
- // update subq
- ReadTrack( cdr.SetSectorPlay );
+ // update subq
+ ReadTrack( cdr.SetSector );
cdr.Result[0] = subq->TrackNumber;
cdr.Result[1] = subq->IndexNumber;
}
}
} else {
- if( cdr.Play == FALSE || !(cdr.Mode & MODE_CDDA) || !(cdr.Mode & (MODE_AUTOPAUSE|MODE_REPORT)) )
+ if (cdr.Play == FALSE)
Create_Fake_Subq();
-
// track # / index #
cdr.Result[0] = itob(cdr.CurTrack);
cdr.Result[1] = itob(fake_subq_index);
cdr.Result[7] = itob( fake_subq_real[2] );
}
+ if (!cdr.Play && !cdr.Reading)
+ cdr.Result[1] = 0; // HACK?
+
// redump.org - wipe time
if( !cdr.Play && CheckSBI(cdr.Result+5) ) {
memset( cdr.Result+2, 0, 6 );
- fix capcom logo
*/
CDRMISC_INT(cdr.Seeked == SEEK_DONE ? 0x800 : cdReadTime * 4);
- cdr.Seeked = SEEK_DOING_CMD;
+ cdr.Seeked = SEEK_PENDING;
break;
case CdlTest: