aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorTravis Howell2006-12-11 06:12:12 +0000
committerTravis Howell2006-12-11 06:12:12 +0000
commit5424198c825bddd5f7410b8649c8d2b8aa38509b (patch)
treef7b426d4933e54e0e6af55b2a37673d2755a8612 /engines/scumm
parentd8cb3dc42dac35e93a32c9e7afbf37694850927a (diff)
downloadscummvm-rg350-5424198c825bddd5f7410b8649c8d2b8aa38509b.tar.gz
scummvm-rg350-5424198c825bddd5f7410b8649c8d2b8aa38509b.tar.bz2
scummvm-rg350-5424198c825bddd5f7410b8649c8d2b8aa38509b.zip
Allow load of saved game from original COMI load/save screens
svn-id: r24835
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/script_v8.cpp39
1 files changed, 21 insertions, 18 deletions
diff --git a/engines/scumm/script_v8.cpp b/engines/scumm/script_v8.cpp
index 4dd24ca785..2b9729faa4 100644
--- a/engines/scumm/script_v8.cpp
+++ b/engines/scumm/script_v8.cpp
@@ -856,14 +856,18 @@ void ScummEngine_v8::o8_roomOps() {
setCurrentPalette(a);
break;
case 0x5D: // SO_ROOM_SAVE_GAME Save game
+ _saveSound = 0;
_saveTemporaryState = true;
_saveLoadSlot = 1;
_saveLoadFlag = 1;
break;
case 0x5E: // SO_ROOM_LOAD_GAME Load game
- _saveTemporaryState = true;
- _saveLoadSlot = 1;
- _saveLoadFlag = 2;
+ _saveSound = pop();
+ if (!_saveLoadFlag) {
+ _saveTemporaryState = true;
+ _saveLoadSlot = 1;
+ _saveLoadFlag = 2;
+ }
break;
case 0x5F: // SO_ROOM_SATURATION Set saturation of room colors
e = pop();
@@ -1230,32 +1234,31 @@ void ScummEngine_v8::o8_kernelSetFunctions() {
removeBlastTexts();
break;
case 25: { // saveGameReadName
- char *address = (char*)getStringAddress(args[2]);
char name[30];
+ if (getSavegameName(args[1], name)) {
+ int size = resStrLen((const byte *)name) + 1;
+ _res->nukeResource(rtString, args[2]);
- if (!address) {
- error("o8_kernelSetFunctions: saveGameReadName failed finding slot string %d", args[2]);
- break;
+ ArrayHeader *ah = (ArrayHeader *)_res->createResource(rtString, args[2], size + sizeof(ArrayHeader));
+ ah->type = TO_LE_16(kStringArray);
+ ah->dim1 = TO_LE_16(size + 1);
+ ah->dim2 = TO_LE_16(1);
+
+ memcpy(getStringAddress(args[2]), name, size);
}
- getSavegameName(args[1] - 1, name);
- if (strlen(name) > 0 && strlen(name) < 30)
- strcpy(address, name);
break;
}
- case 26: { // saveGame?
- //char *address = (char*)getStringAddress(args[2]);
- char address[30];
- debug(0, "o8_kernelSetFunctions: saveGame?(%d, %s)", args[1], address);
+ case 26: { // saveGameWrite
+ // FIXME: This doesn't work
+ char *address = (char*)getStringAddress(args[2]);
+ debug(0, "o8_kernelSetFunctions: saveGame(%d, %s)", args[1], address);
break;
}
- case 27: { // FIXME: This doesn't work
- // saveGameRead
+ case 27: // saveGameRead
_saveLoadSlot = args[1];
_saveLoadFlag = 2;
_saveTemporaryState = false;
- debug(0, "Sgl: %d", args[1]);
break;
- }
case 28: // saveGameStampScreenshot
debug(0, "o8_kernelSetFunctions: saveGameStampScreenshot(%d, %d, %d, %d, %d, %d)", args[1], args[2], args[3], args[4], args[5], args[6]);
break;