diff options
-rw-r--r-- | engines/illusions/duckman/illusions_duckman.cpp | 30 | ||||
-rw-r--r-- | engines/illusions/duckman/illusions_duckman.h | 3 | ||||
-rw-r--r-- | engines/illusions/duckman/scriptopcodes_duckman.cpp | 20 | ||||
-rw-r--r-- | engines/illusions/duckman/scriptopcodes_duckman.h | 2 |
4 files changed, 53 insertions, 2 deletions
diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp index 272a7d619b..f760441495 100644 --- a/engines/illusions/duckman/illusions_duckman.cpp +++ b/engines/illusions/duckman/illusions_duckman.cpp @@ -1107,4 +1107,34 @@ uint32 IllusionsEngine_Duckman::runTriggerCause(uint32 verbId, uint32 objectId2, return tempThreadId; } +bool IllusionsEngine_Duckman::loadSavegame(int16 slotNum, uint32 callingThreadId) { +#if 0 + // TODO + bool success = _gameStates->load(slotNum); + if (success) { + _vm->_screen->setDisplayOn(false); + uint32 currSceneId = getCurrentScene(); + if (currSceneId != 0x10003) + dumpCurrSceneFiles(currSceneId, callerThreadId); + reset(); + stopMidi(); + clearMidiPlayList(); + _gameStates->readStates(); + pushActiveScene(0x10000); + } + _gameStates->freeGameStateReadBuffer(); + return success; +#endif + return true; +} + +bool IllusionsEngine_Duckman::saveSavegame(int16 slotNum, uint32 callingThreadId) { +#if 0 + // TODO + bool success = _gameStates->save(slotNum); + return success; +#endif + return true; +} + } // End of namespace Illusions diff --git a/engines/illusions/duckman/illusions_duckman.h b/engines/illusions/duckman/illusions_duckman.h index c9467366f5..129069aaa0 100644 --- a/engines/illusions/duckman/illusions_duckman.h +++ b/engines/illusions/duckman/illusions_duckman.h @@ -185,6 +185,9 @@ public: void playSoundEffect(int index); bool getTriggerCause(uint32 verbId, uint32 objectId2, uint32 objectId, uint32 &outThreadId); uint32 runTriggerCause(uint32 verbId, uint32 objectId2, uint32 objectId); + + bool loadSavegame(int16 slotNum, uint32 callingThreadId); + bool saveSavegame(int16 slotNum, uint32 callingThreadId); }; diff --git a/engines/illusions/duckman/scriptopcodes_duckman.cpp b/engines/illusions/duckman/scriptopcodes_duckman.cpp index 24d923e875..f16998f8c0 100644 --- a/engines/illusions/duckman/scriptopcodes_duckman.cpp +++ b/engines/illusions/duckman/scriptopcodes_duckman.cpp @@ -130,8 +130,8 @@ void ScriptOpcodes_Duckman::initOpcodes() { OPCODE(82, opSwitchMenuChoice); OPCODE(83, opQuitGame); OPCODE(84, opResetGame); - // TODO OPCODE(85, ); - // TODO OPCODE(86, ); + OPCODE(85, opLoadGame); + OPCODE(86, opSaveGame); OPCODE(87, opDeactivateButton); OPCODE(88, opActivateButton); // 89-95 unused @@ -711,6 +711,22 @@ void ScriptOpcodes_Duckman::opResetGame(ScriptThread *scriptThread, OpCall &opCa // TODO _vm->_gameStates->clear(); } +void ScriptOpcodes_Duckman::opLoadGame(ScriptThread *scriptThread, OpCall &opCall) { + ARG_SKIP(2); + ARG_INT16(bankNum) + ARG_INT16(slotNum) + bool success = _vm->loadSavegame(slotNum, opCall._callerThreadId); + _vm->_stack->push(success ? 1 : 0); +} + +void ScriptOpcodes_Duckman::opSaveGame(ScriptThread *scriptThread, OpCall &opCall) { + ARG_SKIP(2); + ARG_INT16(bankNum) + ARG_INT16(slotNum) + bool success = _vm->saveSavegame(slotNum, opCall._callerThreadId); + _vm->_stack->push(success ? 1 : 0); +} + void ScriptOpcodes_Duckman::opDeactivateButton(ScriptThread *scriptThread, OpCall &opCall) { ARG_INT16(button) _vm->_input->deactivateButton(button); diff --git a/engines/illusions/duckman/scriptopcodes_duckman.h b/engines/illusions/duckman/scriptopcodes_duckman.h index f2a05e6b11..29728e3e0d 100644 --- a/engines/illusions/duckman/scriptopcodes_duckman.h +++ b/engines/illusions/duckman/scriptopcodes_duckman.h @@ -105,6 +105,8 @@ protected: void opSwitchMenuChoice(ScriptThread *scriptThread, OpCall &opCall); void opQuitGame(ScriptThread *scriptThread, OpCall &opCall); void opResetGame(ScriptThread *scriptThread, OpCall &opCall); + void opLoadGame(ScriptThread *scriptThread, OpCall &opCall); + void opSaveGame(ScriptThread *scriptThread, OpCall &opCall); void opDeactivateButton(ScriptThread *scriptThread, OpCall &opCall); void opActivateButton(ScriptThread *scriptThread, OpCall &opCall); void opIncBlockCounter(ScriptThread *scriptThread, OpCall &opCall); |