frontend: pandora: work around r20a vs r21 versioning
[pcsx_rearmed.git] / libpcsxcore / cdrom.c
index 7b5cdf2..3a2eb1f 100644 (file)
@@ -126,7 +126,7 @@ unsigned char Test23[] = { 0x43, 0x58, 0x44, 0x32, 0x39 ,0x34, 0x30, 0x51 };
 #define STATUS_ERROR     (1<<0) // 0x01
 
 /* Errors */
-#define ERROR_NOT_READY  (1<<7) // 0x80
+#define ERROR_NOTREADY   (1<<7) // 0x80
 #define ERROR_INVALIDCMD (1<<6) // 0x40
 #define ERROR_INVALIDARG (1<<5) // 0x20
 
@@ -205,7 +205,7 @@ static void sec2msf(unsigned int s, u8 *msf) {
                cdr.Reading = 0; \
                psxRegs.interrupt &= ~(1 << PSXINT_CDREAD); \
        } \
-       cdr.StatP &= ~STATUS_READ;\
+       cdr.StatP &= ~(STATUS_READ|STATUS_SEEK);\
 }
 
 #define StopCdda() { \
@@ -984,7 +984,7 @@ void cdrInterrupt() {
                case DRIVESTATE_PREPARE_CD:
                        SetResultSize(2);
                        cdr.Result[0] = cdr.StatP | STATUS_ERROR;
-                       cdr.Result[1] = ERROR_NOT_READY;
+                       cdr.Result[1] = ERROR_NOTREADY;
                        cdr.Stat = DiskError;
                        break;
                }
@@ -1514,6 +1514,12 @@ int cdrFreeze(void *f, int Mode) {
                                SysPrintf("cdrom: fixing up old savestate\n");
                                cdr.Reg2 = 7;
                        }
+                       // also did not save Attenuator..
+                       if ((cdr.AttenuatorLeftToLeft | cdr.AttenuatorLeftToRight
+                            | cdr.AttenuatorRightToLeft | cdr.AttenuatorRightToRight) == 0)
+                       {
+                               cdr.AttenuatorLeftToLeft = cdr.AttenuatorRightToRight = 0x80;
+                       }
                }
        }