Skip to content

Commit

Permalink
SCI: FileIO subop 19 checks for directory validity
Browse files Browse the repository at this point in the history
This is used in Torin's Passage and LSL7 when autosaving
  • Loading branch information
bluegr committed Jul 3, 2012
1 parent 72c59ba commit e0a3cfd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion engines/sci/engine/kernel_tables.h
Expand Up @@ -240,7 +240,7 @@ static const SciKernelMapSubEntry kFileIO_subops[] = {
{ SIG_SCI32, 16, MAP_CALL(FileIOWriteWord), "ii", NULL },
{ SIG_SCI32, 17, MAP_CALL(FileIOCreateSaveSlot), "ir", NULL },
{ SIG_SCI32, 18, MAP_EMPTY(FileIOChangeDirectory), "r", NULL }, // for SQ6, when changing the savegame directory in the save/load dialog
{ SIG_SCI32, 19, MAP_CALL(Stub), "r", NULL }, // for Torin / Torin demo
{ SIG_SCI32, 19, MAP_CALL(FileIOIsValidDirectory), "r", NULL }, // for Torin / Torin demo
#endif
SCI_SUBOPENTRY_TERMINATOR
};
Expand Down
9 changes: 8 additions & 1 deletion engines/sci/engine/kfile.cpp
Expand Up @@ -688,6 +688,13 @@ reg_t kFileIOCreateSaveSlot(EngineState *s, int argc, reg_t *argv) {
return TRUE_REG; // slot creation was successful
}

reg_t kFileIOIsValidDirectory(EngineState *s, int argc, reg_t *argv) {
// Used in Torin's Passage and LSL7 to determine if the directory passed as
// a parameter (usually the save directory) is valid. We always return true
// here.
return TRUE_REG;
}

#endif

// ---- Save operations -------------------------------------------------------
Expand Down Expand Up @@ -1002,7 +1009,7 @@ reg_t kAutoSave(EngineState *s, int argc, reg_t *argv) {
// the elapsed time from the timer object)

// This function has to return something other than 0 to proceed
return s->r_acc;
return TRUE_REG;
}

#endif
Expand Down

0 comments on commit e0a3cfd

Please sign in to comment.