*/
#include <stddef.h>
+#include <errno.h>
#include <assert.h>
#include "misc.h"
#include "cdrom.h"
buf = strstr(buf, key);
if (buf)
buf = strchr(buf, '=');
- if (buf)
- *val = strtol(buf + 1, NULL, 16);
+ if (buf) {
+ unsigned long v;
+ errno = 0;
+ v = strtoul(buf + 1, NULL, 16);
+ if (errno == 0)
+ *val = v;
+ }
}
int LoadCdrom() {
//psxCpu->Reset();
if (Config.HLE)
- psxBiosCheckExe(tmpHead.h.t_addr, tmpHead.h.t_size);
+ psxBiosCheckExe(tmpHead.h.t_addr, tmpHead.h.t_size, 0);
return 0;
}
psxRcntFreeze(f, 1);
mdecFreeze(f, 1);
new_dyna_freeze(f, 1);
+ padFreeze(f, 1);
result = 0;
cleanup:
SaveFuncs.read(f, &psxRegs, offsetof(psxRegisters, gteBusyCycle));
psxRegs.gteBusyCycle = psxRegs.cycle;
psxRegs.biosBranchCheck = ~0;
+ psxRegs.gpuIdleAfter = psxRegs.cycle - 1;
+ HW_GPU_STATUS &= SWAP32(~PSXGPU_nBUSY);
psxCpu->Notify(R3000ACPU_NOTIFY_AFTER_LOAD, NULL);
SaveFuncs.read(f, gpufP, sizeof(GPUFreeze_t));
GPU_freeze(0, gpufP);
free(gpufP);
- if (HW_GPU_STATUS == 0)
- HW_GPU_STATUS = SWAP32(GPU_readStatus());
+ gpuSyncPluginSR();
// spu
SaveFuncs.read(f, &Size, 4);
psxRcntFreeze(f, 0);
mdecFreeze(f, 0);
new_dyna_freeze(f, 0);
+ padFreeze(f, 0);
+ events_restore();
if (Config.HLE)
- psxBiosCheckExe(biosBranchCheckOld, 0x60);
+ psxBiosCheckExe(biosBranchCheckOld, 0x60, 1);
result = 0;
cleanup: