aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2009-12-23 21:12:15 +0000
committerEugene Sandulenko2009-12-23 21:12:15 +0000
commit544a92a468d2a93fc26c42f6b323dadf3a7154c4 (patch)
treecbbc41b62da1bf2ebb3a1a93da33c937c461bc56 /engines
parent1adf1cbb167c873d1f43798f6df299049c229399 (diff)
downloadscummvm-rg350-544a92a468d2a93fc26c42f6b323dadf3a7154c4.tar.gz
scummvm-rg350-544a92a468d2a93fc26c42f6b323dadf3a7154c4.tar.bz2
scummvm-rg350-544a92a468d2a93fc26c42f6b323dadf3a7154c4.zip
Patch #2895458: "SCUMM: Add support for SEGA-CD MI Passcodes"
svn-id: r46516
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/debugger.cpp27
-rw-r--r--engines/scumm/debugger.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp
index cc3cec6e85..cc3614805b 100644
--- a/engines/scumm/debugger.cpp
+++ b/engines/scumm/debugger.cpp
@@ -89,6 +89,9 @@ ScummDebugger::ScummDebugger(ScummEngine *s)
if (_vm->_game.id == GID_LOOM)
DCmd_Register("drafts", WRAP_METHOD(ScummDebugger, Cmd_PrintDraft));
+ if (_vm->_game.id == GID_MONKEY && Common::kPlatformSegaCD)
+ DCmd_Register("passcode", WRAP_METHOD(ScummDebugger, Cmd_Passcode));
+
DCmd_Register("loadgame", WRAP_METHOD(ScummDebugger, Cmd_LoadGame));
DCmd_Register("savegame", WRAP_METHOD(ScummDebugger, Cmd_SaveGame));
@@ -849,6 +852,30 @@ bool ScummDebugger::Cmd_PrintDraft(int argc, const char **argv) {
return true;
}
+bool ScummDebugger::Cmd_Passcode(int argc, const char **argv) {
+ if (argc > 1) {
+ _vm->_bootParam = atoi(argv[1]);
+ int args[16];
+ memset(args, 0, sizeof(args));
+ args[0] = _vm->_bootParam;
+
+ _vm->runScript(61, 0, 0, args);
+
+ if (_vm->_bootParam != _vm->_scummVars[411]){
+ DebugPrintf("Invalid Passcode\n");
+ return true;
+ }
+
+ _vm->_bootParam = 0;
+ _detach_now = true;
+
+ } else {
+ DebugPrintf("Use 'passcode <SEGA CD Passcode>'\n");
+ return true;
+ }
+ return false;
+}
+
bool ScummDebugger::Cmd_ResetCursors(int argc, const char **argv) {
_vm->resetCursors();
diff --git a/engines/scumm/debugger.h b/engines/scumm/debugger.h
index 8046bf03aa..61d5ac480a 100644
--- a/engines/scumm/debugger.h
+++ b/engines/scumm/debugger.h
@@ -61,6 +61,7 @@ protected:
bool Cmd_ImportRes(int argc, const char **argv);
bool Cmd_PrintDraft(int argc, const char **argv);
+ bool Cmd_Passcode(int argc, const char **argv);
bool Cmd_Debug(int argc, const char **argv);
bool Cmd_DebugLevel(int argc, const char **argv);