aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/script_v5.cpp
diff options
context:
space:
mode:
authorMax Horn2009-03-16 04:45:12 +0000
committerMax Horn2009-03-16 04:45:12 +0000
commite44f07f988ee6a2a7574a42169d08b3d7a112eba (patch)
tree56ba5688d855def4850a890029ef1805db9cc576 /engines/scumm/script_v5.cpp
parentffa97e6626e43adf9c94de9a7322138e46436af4 (diff)
downloadscummvm-rg350-e44f07f988ee6a2a7574a42169d08b3d7a112eba.tar.gz
scummvm-rg350-e44f07f988ee6a2a7574a42169d08b3d7a112eba.tar.bz2
scummvm-rg350-e44f07f988ee6a2a7574a42169d08b3d7a112eba.zip
SCUMM: Modified version of patch #1687041 (Scumm: Load-/Save-support for the original save-dialog)
svn-id: r39438
Diffstat (limited to 'engines/scumm/script_v5.cpp')
-rw-r--r--engines/scumm/script_v5.cpp40
1 files changed, 31 insertions, 9 deletions
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index b984f56ab0..a6c8df2031 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -869,7 +869,12 @@ enum StringIds {
// which matches the original Indy3 save/load code. See also the notes
// on Feature Request #1666521.
STRINGID_IQ_EPISODE = 7,
- STRINGID_IQ_SERIES = 9
+ STRINGID_IQ_SERIES = 9,
+ // The string IDs of the first savegame name, used as an offset to determine
+ // the IDs of all savenames.
+ // Loom is the only game whose savenames start with a different ID.
+ STRINGID_SAVENAME1 = 10,
+ STRINGID_SAVENAME1_LOOM = 9
};
void ScummEngine_v5::o5_saveLoadVars() {
@@ -1235,26 +1240,43 @@ void ScummEngine_v5::o5_saveLoadGame() {
result = 100;
break;
case 0x20: // drive
- if (_game.id == GID_INDY3) {
- // 0 = hard drive
- // 1 = disk drive
- result = 0;
+ if (_game.version <= 3) {
+ // 0 = ???
+ // [1,2] = disk drive [A:,B:]
+ // 3 = hard drive
+ result = 3;
} else {
// set current drive
result = 1;
}
break;
case 0x40: // load
- if (loadState(slot, _saveTemporaryState))
+ if (loadState(slot, false))
result = 3; // sucess
else
result = 5; // failed to load
break;
case 0x80: // save
- //if (saveState(slot, _saveTemporaryState))
- // result = 0; // sucess
- //else
+ if (_game.version <= 3) {
+ char name[32];
+ if (_game.version <= 2) {
+ // use generic name
+ sprintf(name, "Game %c", 'A'+slot-1);
+ } else {
+ // use name entered by the user
+ char* ptr;
+ int firstSlot = (_game.id == GID_LOOM) ? STRINGID_SAVENAME1_LOOM : STRINGID_SAVENAME1;
+ ptr = (char*)getStringAddress(slot + firstSlot - 1);
+ strncpy(name, ptr, sizeof(name));
+ }
+
+ if (((ScummEngine_v3 *)this)->savePreparedSavegame(slot, name))
+ result = 0;
+ else
+ result = 2;
+ } else {
result = 2; // failed to save
+ }
break;
case 0xC0: // test if save exists
{