Always look up verify_dirty literals from offsets by neonloop (#194)
[pcsx_rearmed.git] / libpcsxcore / misc.c
index 3ee9876..9b0b27f 100644 (file)
@@ -26,6 +26,7 @@
 #include "mdec.h"
 #include "gpu.h"
 #include "ppf.h"
+#include "database.h"
 #include <zlib.h>
 
 char CdromId[10] = "";
@@ -389,6 +390,8 @@ int CheckCdrom() {
        SysPrintf(_("CD-ROM Label: %.32s\n"), CdromLabel);
        SysPrintf(_("CD-ROM ID: %.9s\n"), CdromId);
        SysPrintf(_("CD-ROM EXE Name: %.255s\n"), exename);
+       
+       Apply_Hacks_Cdrom();
 
        BuildPPFCache();
 
@@ -573,7 +576,7 @@ int SaveState(const char *file) {
        f = SaveFuncs.open(file, "wb");
        if (f == NULL) return -1;
 
-       new_dyna_save();
+       new_dyna_before_save();
 
        SaveFuncs.write(f, (void *)PcsxHeader, 32);
        SaveFuncs.write(f, (void *)&SaveVersion, sizeof(u32));
@@ -615,6 +618,7 @@ int SaveState(const char *file) {
        psxHwFreeze(f, 1);
        psxRcntFreeze(f, 1);
        mdecFreeze(f, 1);
+       new_dyna_freeze(f, 1);
 
        SaveFuncs.close(f);
 
@@ -679,9 +683,9 @@ int LoadState(const char *file) {
        psxHwFreeze(f, 0);
        psxRcntFreeze(f, 0);
        mdecFreeze(f, 0);
+       new_dyna_freeze(f, 0);
 
        SaveFuncs.close(f);
-       new_dyna_restore();
 
        return 0;
 }