X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fmisc.c;h=7353c3b66eee16b7d0b3332462c3c9144854c3ac;hp=ef4924407991e6f24ef74e4632e764d928d5a53c;hb=ad418c19cd4ca9a80820593609b786c6993b2eda;hpb=ef79bbde537d6b9c745a7d86cb9df1d04c35590d diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index ef492440..7353c3b6 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -54,7 +54,9 @@ struct iso_directory_record { void mmssdd( char *b, char *p ) { int m, s, d; -#if defined(__BIGENDIAN__) +#if defined(__arm__) + int block = (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0]; +#elif defined(__BIGENDIAN__) int block = (b[0] & 0xff) | ((b[1] & 0xff) << 8) | ((b[2] & 0xff) << 16) | (b[3] << 24); #else int block = *((int*)b); @@ -331,7 +333,7 @@ int CheckCdrom() { } if (Config.PsxAuto) { // autodetect system (pal or ntsc) - if (strstr(exename, "ES") != NULL) + if (CdromId[2] == 'e' || CdromId[2] == 'E') Config.PsxType = PSX_TYPE_PAL; // pal else Config.PsxType = PSX_TYPE_NTSC; // ntsc } @@ -456,7 +458,7 @@ static const char PcsxHeader[32] = "STv4 PCSX v" PACKAGE_VERSION; // Savestate Versioning! // If you make changes to the savestate version, please increment the value below. -static const u32 SaveVersion = 0x8b410004; +static const u32 SaveVersion = 0x8b410006; int SaveState(const char *file) { gzFile f; @@ -468,6 +470,8 @@ int SaveState(const char *file) { f = gzopen(file, "wb"); if (f == NULL) return -1; + new_dyna_save(); + gzwrite(f, (void *)PcsxHeader, 32); gzwrite(f, (void *)&SaveVersion, sizeof(u32)); gzwrite(f, (void *)&Config.HLE, sizeof(boolean)); @@ -530,10 +534,14 @@ int LoadState(const char *file) { gzread(f, &version, sizeof(u32)); gzread(f, &hle, sizeof(boolean)); - if (strncmp("STv4 PCSX", header, 9) != 0 || version != SaveVersion || hle != Config.HLE) { + if (strncmp("STv4 PCSX", header, 9) != 0 || version != SaveVersion) { gzclose(f); return -1; } + Config.HLE = hle; + + if (Config.HLE) + psxBiosInit(); psxCpu->Reset(); gzseek(f, 128 * 96 * 3, SEEK_CUR); @@ -566,6 +574,7 @@ int LoadState(const char *file) { mdecFreeze(f, 0); gzclose(f); + new_dyna_restore(); return 0; } @@ -585,7 +594,7 @@ int CheckState(const char *file) { gzclose(f); - if (strncmp("STv4 PCSX", header, 9) != 0 || version != SaveVersion || hle != Config.HLE) + if (strncmp("STv4 PCSX", header, 9) != 0 || version != SaveVersion) return -1; return 0;