X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fcdrom.c;h=d9a3bb37cd05372f3f2369557b55c0acf3495051;hp=839e89e924c2788010d03b8301194200bfeb96f3;hb=42f3c5125fcb99e1445dfb7ca3d1b21330cde414;hpb=056d67598872b0bac092878972633d6c10aa0ad6 diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 839e89e9..d9a3bb37 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -1225,6 +1225,7 @@ void cdrInterrupt() { /* Duke Nukem: Land of the Babes - seek then delay read for one frame - fixes cutscenes + C-12 - Final Resistance - doesn't like seek */ if (!cdr.Seeked) { @@ -1473,6 +1474,7 @@ unsigned char cdrRead1(void) { } void cdrWrite1(unsigned char rt) { + char set_loc[3]; int i; #ifdef CDR_LOG @@ -1521,9 +1523,12 @@ void cdrWrite1(unsigned char rt) { case CdlSetloc: StopReading(); - cdr.Seeked = FALSE; for (i = 0; i < 3; i++) - cdr.SetSector[i] = btoi(cdr.Param[i]); + set_loc[i] = btoi(cdr.Param[i]); + i = abs(msf2sec(cdr.SetSector) - msf2sec(set_loc)); + if (i > 16) + cdr.Seeked = FALSE; + memcpy(cdr.SetSector, set_loc, 3); cdr.SetSector[3] = 0; /* @@ -2068,9 +2073,13 @@ int cdrFreeze(gzFile f, int Mode) { gzfreeze(&tmp, sizeof(tmp)); - if (Mode == 0) + if (Mode == 0) { cdr.pTransfer = cdr.Transfer + tmp; + if (cdr.Play && !Config.Cdda) + CDR_play(cdr.SetSectorPlay); + } + return 0; }