// Scan the current state of the CPS1/2 machine INT32 CpsAreaScan(INT32 nAction, INT32 *pnMin) { struct BurnArea ba; if (CpsMem == NULL) return 1; if (pnMin) // Return minimum compatible version *pnMin = 0x029521; if (nAction & ACB_MEMORY_ROM) { memset(&ba, 0, sizeof(ba)); ba.Data = CpsRom; ba.nLen = nCpsRomLen; ba.szName = "CpsRom"; BurnAcb(&ba); if (nCpsZRomLen) { ba.Data = CpsZRom; ba.nLen = nCpsZRomLen; ba.szName = "CpsZRom"; BurnAcb(&ba); } } EEPROMScan(nAction, pnMin); if (nAction & ACB_MEMORY_RAM) { ScanRam(); memset(&ba, 0, sizeof(ba)); ba.Data = CpsRam660; ba.nLen = 0x004000; ba.szName = "CpsRam660"; BurnAcb(&ba); } if (nAction & ACB_DRIVER_DATA) { // Scan volatile variables/registers/RAM SekScan(nAction); // Scan 68000 state if (nAction & ACB_WRITE) { // Palette could have changed CpsRecalcPal = 1; } } if (!Cps2DisableQSnd) { // Scan QSound chips QsndScan(nAction); } if (CpsMemScanCallbackFunction) { CpsMemScanCallbackFunction(nAction, pnMin); } return 0; }
// Scan the current state of the CPS1/2 machine INT32 CpsAreaScan(INT32 nAction, INT32 *pnMin) { struct BurnArea ba; if (CpsMem == NULL) { return 1; } if (pnMin) { // Return minimum compatible version *pnMin = 0x029521; } if (nAction & ACB_MEMORY_ROM) { memset(&ba, 0, sizeof(ba)); ba.Data = CpsRom; ba.nLen = nCpsRomLen; ba.szName = "CpsRom"; BurnAcb(&ba); if (nCpsZRomLen) { ba.Data = CpsZRom; ba.nLen = nCpsZRomLen; ba.szName = "CpsZRom"; BurnAcb(&ba); } } if (Cps == 2 || Cps1Qs == 1 || PangEEP == 1 || CpsBootlegEEPROM == 1) { // Scan EEPROM EEPROMScan(nAction, pnMin); } if (nAction & ACB_MEMORY_RAM) { ScanRam(); if (Cps == 2) { memset(&ba, 0, sizeof(ba)); ba.Data = CpsRam660; ba.nLen = 0x004000; ba.szName = "CpsRam660"; BurnAcb(&ba); } } if (nAction & ACB_DRIVER_DATA) { // Scan volatile variables/registers/RAM SekScan(nAction); // Scan 68000 state if (Cps1OverrideLayers) { SCAN_VAR(nCps1Layers); SCAN_VAR(nCps1LayerOffs); } if (nAction & ACB_WRITE) { // Palette could have changed CpsRecalcPal = 1; } } if (((Cps == 2) && !Cps2DisableQSnd) || Cps1Qs == 1) { // Scan QSound chips QsndScan(nAction); } else { // Scan PSound chips if ((Cps & 1) && !Cps1DisablePSnd) PsndScan(nAction); } if (CpsMemScanCallbackFunction) { CpsMemScanCallbackFunction(nAction, pnMin); } return 0; }