diff options
-rw-r--r-- | engines/sci/engine/guest_additions.cpp | 11 | ||||
-rw-r--r-- | engines/sci/engine/guest_additions.h | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/engines/sci/engine/guest_additions.cpp b/engines/sci/engine/guest_additions.cpp index 8cf8c0505a..cf70608acc 100644 --- a/engines/sci/engine/guest_additions.cpp +++ b/engines/sci/engine/guest_additions.cpp @@ -527,6 +527,10 @@ reg_t GuestAdditions::kScummVMSaveLoad(EngineState *s, int argc, reg_t *argv) co return promptSaveRestoreRama(s, argc, argv); } + if (g_sci->getGameId() == GID_HOYLE5) { + return promptSaveRestoreHoyle5(s, argc, argv); + } + return promptSaveRestoreDefault(s, argc, argv); } @@ -715,6 +719,13 @@ int GuestAdditions::runSaveRestore(const bool isSave, reg_t outDescription, cons return saveNo; } +reg_t GuestAdditions::promptSaveRestoreHoyle5(EngineState *s, int argc, reg_t *argv) const { + assert(argc == 2); + Common::String callerName = s->_segMan->getObjectName(s->r_acc); + const bool isSave = (callerName == "Save"); + return make_reg(0, runSaveRestore(isSave, argc > 0 ? argv[0] : NULL_REG, s->_delayedRestoreGameId)); +} + #endif #pragma mark - diff --git a/engines/sci/engine/guest_additions.h b/engines/sci/engine/guest_additions.h index b49fe9d283..b889c49ff1 100644 --- a/engines/sci/engine/guest_additions.h +++ b/engines/sci/engine/guest_additions.h @@ -257,6 +257,12 @@ private: reg_t promptSaveRestoreRama(EngineState *s, int argc, reg_t *argv) const; /** + * Prompts for a save game and returns it to game scripts using Hoyle 5's + * custom SRDialog class semantics. + */ + reg_t promptSaveRestoreHoyle5(EngineState *s, int argc, reg_t *argv) const; + + /** * Prompts the user to save or load a game. * * @param isSave If true, the prompt is for saving. |