From 33f56da1468195445ef123e0c306303d77892a3c Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 14 Jan 2011 12:31:23 +0200 Subject: [PATCH] remove hle savestate restriction we have enough data to load any savestate --- frontend/menu.c | 10 +++++++++- libpcsxcore/misc.c | 8 ++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/frontend/menu.c b/frontend/menu.c index b14f195c..05f54818 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -123,8 +123,16 @@ static int emu_save_load_game(int load, int sram) if (ret != 0) return 0; - if (load) + if (load) { ret = LoadState(fname); + + // reflect hle/bios mode from savestate + if (Config.HLE) + bios_sel = 0; + else if (bios_sel == 0 && bioses[1] != NULL) + // XXX: maybe find the right bios instead + bios_sel = 1; + } else ret = SaveState(fname); diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index 4a70b2f3..1fa763f1 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -534,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); @@ -590,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; -- 2.39.5