From c3b30b75a61a20b80c153eefcf72eb80f8331d73 Mon Sep 17 00:00:00 2001 From: Donovan Watteau Date: Mon, 13 Jun 2022 12:36:48 +0200 Subject: [PATCH] SCUMM: Add a `grail` command to the debugger This prints the number of the real Grail object when counting from the left in the final room with the knight in Indy3. May be useful since there are many Grails, choosing the wrong one kills you and makes you restart the 3 trials again, and the hints to find it require the original manual and taking notes during the game. --- engines/scumm/debugger.cpp | 25 ++++++++++++++++++++++++- engines/scumm/debugger.h | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp index 9e62652d2ca..7f41f83e6af 100644 --- a/engines/scumm/debugger.cpp +++ b/engines/scumm/debugger.cpp @@ -82,7 +82,8 @@ ScummDebugger::ScummDebugger(ScummEngine *s) if (_vm->_game.id == GID_LOOM) registerCmd("drafts", WRAP_METHOD(ScummDebugger, Cmd_PrintDraft)); - + if (_vm->_game.id == GID_INDY3) + registerCmd("grail", WRAP_METHOD(ScummDebugger, Cmd_PrintGrail)); if (_vm->_game.id == GID_MONKEY && _vm->_game.platform == Common::kPlatformSegaCD) registerCmd("passcode", WRAP_METHOD(ScummDebugger, Cmd_Passcode)); @@ -1004,6 +1005,28 @@ bool ScummDebugger::Cmd_PrintDraft(int argc, const char **argv) { return true; } +bool ScummDebugger::Cmd_PrintGrail(int argc, const char **argv) { + if (_vm->_game.id != GID_INDY3) { + debugPrintf("Command only works with Indy3\n"); + return true; + } + + if (_vm->_currentRoom != 86) { + debugPrintf("Command only works in room 86\n"); + return true; + } + + const int grailNumber = _vm->_scummVars[253]; + if (grailNumber < 1 || grailNumber > 10) { + debugPrintf("Couldn't find the Grail number\n"); + return true; + } + + debugPrintf("Real Grail is Grail #%d\n", grailNumber); + + return true; +} + bool ScummDebugger::Cmd_Passcode(int argc, const char **argv) { if (argc > 1) { _vm->_bootParam = atoi(argv[1]); diff --git a/engines/scumm/debugger.h b/engines/scumm/debugger.h index f81694f27bc..034575083f7 100644 --- a/engines/scumm/debugger.h +++ b/engines/scumm/debugger.h @@ -57,6 +57,7 @@ private: bool Cmd_ImportRes(int argc, const char **argv); bool Cmd_PrintDraft(int argc, const char **argv); + bool Cmd_PrintGrail(int argc, const char **argv); bool Cmd_Passcode(int argc, const char **argv); bool Cmd_Debug(int argc, const char **argv);