aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorColin Snover2017-09-24 01:49:27 -0500
committerColin Snover2017-09-24 22:56:58 -0500
commit817887216da95d8065eb187bd887cb08f7618736 (patch)
tree8ba81730e859fb6efc2939bb40bfc971fa6fd0db /engines/sci
parent21337e4cf63fa1c4248bbb2b6173f121a126fed8 (diff)
downloadscummvm-rg350-817887216da95d8065eb187bd887cb08f7618736.tar.gz
scummvm-rg350-817887216da95d8065eb187bd887cb08f7618736.tar.bz2
scummvm-rg350-817887216da95d8065eb187bd887cb08f7618736.zip
SCI32: Fix RAMA auto-save game
Despite what game script disassembly lead me to believe, the game seems to create only one auto-save, which ends up being saved as 911.sg (not autorama.sg). This save file is created just before entering the underground Avian Lair in New York, and seems to be designed as some emergency backup since entering the Avian Lair is a one-way trip.
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kfile.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index db7bbce640..d87013f01c 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -444,7 +444,7 @@ reg_t kFileIOOpen(EngineState *s, int argc, reg_t *argv) {
return SIGNAL_REG;
} else if (g_sci->getGameId() == GID_RAMA) {
int saveNo = -1;
- if (name == "autorama.sg") {
+ if (name == "911.sg") {
saveNo = kAutoSaveId;
} else if (sscanf(name.c_str(), "ramasg.%i", &saveNo) == 1) {
saveNo += kSaveIdShift;
@@ -470,7 +470,9 @@ reg_t kFileIOOpen(EngineState *s, int argc, reg_t *argv) {
out = saveFileMan->openForSaving(fileName);
if (out) {
Common::String saveName;
- if (saveNo != kAutoSaveId) {
+ if (saveNo == kAutoSaveId) {
+ saveName = _("(Autosave)");
+ } else {
saveName = getRamaSaveName(s, saveNo - kSaveIdShift);
}
Common::ScopedPtr<Common::SeekableReadStream> versionFile(SearchMan.createReadStreamForMember("VERSION"));
@@ -936,13 +938,12 @@ reg_t kFileIOWriteByte(EngineState *s, int argc, reg_t *argv) {
}
reg_t kFileIOReadWord(EngineState *s, int argc, reg_t *argv) {
- const uint16 handle = argv[0].toUint16();
- FileHandle *f = getFileFromHandle(s, handle);
+ FileHandle *f = getFileFromHandle(s, argv[0].toUint16());
if (!f)
return s->r_acc;
reg_t value;
- if (s->_fileHandles[handle]._name == "-scummvm-save-") {
+ if (f->_name == "-scummvm-save-") {
value._segment = f->_in->readUint16LE();
value._offset = f->_in->readUint16LE();
} else {
@@ -968,12 +969,12 @@ reg_t kFileIOWriteWord(EngineState *s, int argc, reg_t *argv) {
return s->r_acc;
}
- if (s->_fileHandles[handle]._name == "-scummvm-save-") {
+ if (f->_name == "-scummvm-save-") {
f->_out->writeUint16LE(argv[1]._segment);
f->_out->writeUint16LE(argv[1]._offset);
} else {
if (argv[1].isPointer()) {
- error("Attempt to write non-number %04x:%04x", PRINT_REG(argv[1]));
+ error("kFileIO(WriteWord): Attempt to write non-number %04x:%04x to non-save file", PRINT_REG(argv[1]));
}
f->_out->writeUint16LE(argv[1].toUint16());
}