aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/kfile.cpp')
-rw-r--r--engines/sci/engine/kfile.cpp29
1 files changed, 22 insertions, 7 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 1bd6754ca5..9e9441847d 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -365,9 +365,12 @@ reg_t kDeviceInfo(EngineState *s, int argc, reg_t *argv) {
reg_t kGetSaveDir(EngineState *s, int argc, reg_t *argv) {
#ifdef ENABLE_SCI32
- // TODO: SCI32 uses a parameter here.
- if (argc > 0)
- warning("kGetSaveDir called with %d parameter(s): %04x:%04x", argc, PRINT_REG(argv[0]));
+ // SCI32 uses a parameter here. It is used to modify a string, stored in a
+ // global variable, so that game scripts store the save directory. We
+ // don't really set a save game directory, thus not setting the string to
+ // anything is the correct thing to do here.
+ //if (argc > 0)
+ // warning("kGetSaveDir called with %d parameter(s): %04x:%04x", argc, PRINT_REG(argv[0]));
#endif
return s->_segMan->getSaveDirPtr();
}
@@ -578,11 +581,15 @@ reg_t kSaveGame(EngineState *s, int argc, reg_t *argv) {
game_description = dialog->getResultString();
if (game_description.empty()) {
// create our own description for the saved game, the user didnt enter it
+ #if defined(USE_SAVEGAME_TIMESTAMP)
TimeDate curTime;
g_system->getTimeAndDate(curTime);
curTime.tm_year += 1900; // fixup year
curTime.tm_mon++; // fixup month
- game_description = Common::String::format("%02d.%02d.%04d / %02d:%02d:%02d", curTime.tm_mday, curTime.tm_mon, curTime.tm_year, curTime.tm_hour, curTime.tm_min, curTime.tm_sec);
+ game_description = Common::String::format("%04d.%02d.%02d / %02d:%02d:%02d", curTime.tm_year, curTime.tm_mon, curTime.tm_mday, curTime.tm_hour, curTime.tm_min, curTime.tm_sec);
+ #else
+ game_description = Common::String::format("Save %d", savegameId + 1);
+ #endif
}
delete dialog;
g_sci->_soundCmd->pauseAll(false); // unpause music ( we can't have it paused during save)
@@ -1160,8 +1167,17 @@ reg_t kSave(EngineState *s, int argc, reg_t *argv) {
return kRestoreGame(s, argc - 1,argv + 1);
case 2:
return kGetSaveDir(s, argc - 1, argv + 1);
+ case 3:
+ return kCheckSaveGame(s, argc - 1, argv + 1);
case 5:
return kGetSaveFiles(s, argc - 1, argv + 1);
+ case 6:
+ // This is used in Shivers to delete saved games, however it
+ // always passes the same file name (SHIVER), so it doesn't
+ // actually delete anything...
+ // TODO: Check why this happens
+ // argv[1] is a string (most likely the save game directory)
+ return kFileIOUnlink(s, argc - 2, argv + 2);
case 8:
// TODO
// This is a timer callback, with 1 parameter: the timer object
@@ -1172,10 +1188,9 @@ reg_t kSave(EngineState *s, int argc, reg_t *argv) {
// This function has to return something other than 0 to proceed
return s->r_acc;
default:
- warning("Unknown/unhandled kSave subop %d", argv[0].toUint16());
+ kStub(s, argc, argv);
+ return NULL_REG;
}
-
- return NULL_REG;
}
#endif