diff options
Diffstat (limited to 'sky')
-rw-r--r-- | sky/debug.cpp | 21 | ||||
-rw-r--r-- | sky/debug.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sky/debug.cpp b/sky/debug.cpp index 7b124b50c5..c1dd9cd016 100644 --- a/sky/debug.cpp +++ b/sky/debug.cpp @@ -1285,6 +1285,7 @@ Debugger::Debugger(Logic *logic, Mouse *mouse, Screen *screen) : _logic(logic), DCmd_Register("compact", &Debugger::Cmd_ShowCompact); DCmd_Register("logiccmd", &Debugger::Cmd_LogicCommand); DCmd_Register("scriptvar", &Debugger::Cmd_ScriptVar); + DCmd_Register("section", &Debugger::Cmd_Section); } void Debugger::preEnter() { @@ -1458,4 +1459,24 @@ bool Debugger::Cmd_ScriptVar(int argc, const char **argv) { return true; } +bool Debugger::Cmd_Section(int argc, const char **argv) { + if (argc < 2) { + DebugPrintf("Example: %s 4\n", argv[0]); + return true; + } + + const int baseId[] = { START_ONE, START_S6, START_29, START_SC31, START_SC66, START_SC90, START_SC81 }; + int section = atoi(argv[1]); + + if (section >= 0 && section <= 6) { + _logic->fnEnterSection(section % 6, 0, 0); + _logic->fnAssignBase(ID_FOSTER, baseId[section], 0); + SkyEngine::fetchCompact(ID_FOSTER)->extCompact->megaSet = 0; + } else { + DebugPrintf("Unknown section '%s'\n", argv[1]); + } + + return true; +} + } // End of namespace Sky diff --git a/sky/debug.h b/sky/debug.h index a6de197756..979f41559d 100644 --- a/sky/debug.h +++ b/sky/debug.h @@ -49,6 +49,7 @@ protected: bool Cmd_LogicCommand(int argc, const char **argv); bool Cmd_Info(int argc, const char **argv); bool Cmd_ScriptVar(int argc, const char **argv); + bool Cmd_Section(int argc, const char **argv); Logic *_logic; Mouse *_mouse; |