From 9b470ab7ede4edfa4d933a434f45a563302d7de7 Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 11 Jul 2012 02:37:25 +0300 Subject: [PATCH] cdrom: adjust report mode return based on mednafen which likely had this tested on the real thing. Also remove rearmed hack, the report shouldn't be that bad on performance. --- libpcsxcore/cdrom.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index d9a3bb37..fa0e6a9f 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -539,6 +539,7 @@ static void Create_Fake_Subq() static void cdrPlayInterrupt_Autopause() { struct SubQ *subq = (struct SubQ *)CDR_getBufferSub(); + int track_changed = 0; if (subq != NULL ) { #ifdef CDR_LOG CDR_LOG( "CDDA SUB - %X:%X:%X\n", @@ -552,8 +553,8 @@ static void cdrPlayInterrupt_Autopause() Tomb Raider 1 ($7) */ - if( cdr.CurTrack >= btoi( subq->TrackNumber ) ) - return; + if( cdr.CurTrack < btoi( subq->TrackNumber ) ) + track_changed = 1; } else { Create_Fake_Subq(); #ifdef CDR_LOG___0 @@ -561,13 +562,11 @@ static void cdrPlayInterrupt_Autopause() fake_subq_real[0], fake_subq_real[1], fake_subq_real[2] ); #endif - if( !fake_subq_change ) - return; - + track_changed = fake_subq_change; fake_subq_change = 0; } - if (cdr.Mode & MODE_AUTOPAUSE) { + if ((cdr.Mode & MODE_AUTOPAUSE) && track_changed) { #ifdef CDR_LOG CDR_LOG( "CDDA STOP\n" ); #endif @@ -584,11 +583,6 @@ static void cdrPlayInterrupt_Autopause() StopCdda(); } if (cdr.Mode & MODE_REPORT) { - // rearmed note: PCSX-Reloaded does this for every sector, - // but we try to get away with only track change here. - memset( cdr.Result, 0, 8 ); - cdr.Result[0] |= 0x10; - if (subq != NULL) { #ifdef CDR_LOG CDR_LOG( "REPPLAY SUB - %X:%X:%X\n", @@ -596,6 +590,10 @@ static void cdrPlayInterrupt_Autopause() #endif cdr.CurTrack = btoi( subq->TrackNumber ); + if (subq->AbsoluteAddress[2] & 0xf) + return; + + cdr.Result[0] = cdr.StatP; // BIOS CD Player: data already BCD format cdr.Result[1] = subq->TrackNumber; cdr.Result[2] = subq->IndexNumber; @@ -609,6 +607,10 @@ static void cdrPlayInterrupt_Autopause() fake_subq_real[0], fake_subq_real[1], fake_subq_real[2] ); #endif + if (fake_subq_real[2] & 0xf) + return; + + cdr.Result[0] = cdr.StatP; // track # / index # cdr.Result[1] = itob(cdr.CurTrack); cdr.Result[2] = itob(fake_subq_index); -- 2.39.5