mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-13 13:10:53 +00:00
endian fix for save games (including code for backward compatibility so that old BE games will still load)
svn-id: r4571
This commit is contained in:
parent
b019de6872
commit
8951ea0cd1
@ -62,7 +62,7 @@ bool Scumm::saveState(int slot, bool compat)
|
||||
|
||||
hdr.type = MKID('SCVM');
|
||||
hdr.size = 0;
|
||||
hdr.ver = _current_version;
|
||||
hdr.ver = TO_LE_32(_current_version);
|
||||
|
||||
out.fwrite(&hdr, sizeof(hdr), 1);
|
||||
|
||||
@ -95,7 +95,10 @@ bool Scumm::loadState(int slot, bool compat)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hdr.ver < VER_V7 || hdr.ver > _current_version) {
|
||||
if (hdr.ver < VER_V7 || hdr.ver > _current_version)
|
||||
hdr.ver = TO_LE_32(hdr.ver);
|
||||
if (hdr.ver < VER_V7 || hdr.ver > _current_version)
|
||||
{
|
||||
warning("Invalid version of '%s'", filename);
|
||||
out.fclose();
|
||||
return false;
|
||||
@ -210,6 +213,8 @@ bool Scumm::getSavegameName(int slot, char *desc)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hdr.ver < VER_V7 || hdr.ver > _current_version)
|
||||
hdr.ver = TO_LE_32(hdr.ver);
|
||||
if (hdr.ver < VER_V7 || hdr.ver > _current_version) {
|
||||
strcpy(desc, "Invalid version");
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user