aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMatthew Hoops2010-02-01 03:59:48 +0000
committerMatthew Hoops2010-02-01 03:59:48 +0000
commitaf52e2caf0cfda303233440d2d1b6867006a1af1 (patch)
tree3300e397767cc4e447f076233bda477a881ee6db /engines/sci/engine
parentf24e0aad2b856befb84811b6fb8f6f661b605b1c (diff)
downloadscummvm-rg350-af52e2caf0cfda303233440d2d1b6867006a1af1.tar.gz
scummvm-rg350-af52e2caf0cfda303233440d2d1b6867006a1af1.tar.bz2
scummvm-rg350-af52e2caf0cfda303233440d2d1b6867006a1af1.zip
Torin calls K_FILEIO_OPEN without a file mode to open with. Assume that it's opening the file for reading as it appears that it is just testing if it exists. Torin (and the demo) progress a little farther now.
svn-id: r47790
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kfile.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 556fe800e9..7606141f71 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -712,7 +712,9 @@ reg_t kFileIO(EngineState *s, int argc, reg_t *argv) {
switch (func_nr) {
case K_FILEIO_OPEN : {
Common::String name = s->_segMan->getString(argv[1]);
- int mode = argv[2].toUint16();
+
+ // SCI32 can call K_FILEIO_OPEN with only two arguments. It seems to just be checking if it exists.
+ int mode = (argc < 3) ? (int)_K_FILE_MODE_OPEN_OR_FAIL : argv[2].toUint16();
// SQ4 floppy prepends /\ to the filenames
if (name.hasPrefix("/\\")) {