add script hex dumping option to debugger

svn-id: r7024
This commit is contained in:
Jonathan Gray 2003-04-20 06:55:09 +00:00
parent 1d01a68cac
commit c597d0d4d6
5 changed files with 38 additions and 1 deletions

View File

@ -87,6 +87,9 @@ void ScummDebugger::attach(Scumm *s) {
DCmd_Register("level", &ScummDebugger::Cmd_DebugLevel);
DCmd_Register("help", &ScummDebugger::Cmd_Help);
DCmd_Register("show", &ScummDebugger::Cmd_Show);
DCmd_Register("hide", &ScummDebugger::Cmd_Hide);
}
}
@ -321,6 +324,34 @@ bool ScummDebugger::Cmd_SaveGame(int argc, const char **argv) {
return true;
}
bool ScummDebugger::Cmd_Show(int argc, const char **argv) {
if (argc != 2) {
Debug_Printf("Syntax: show <parameter>\n");
return true;
}
if (!strcmp(argv[1], "hex")) {
_s->_hexdumpScripts = true;
Debug_Printf("Script hex dumping on\n");
}
return true;
}
bool ScummDebugger::Cmd_Hide(int argc, const char **argv) {
if (argc != 2) {
Debug_Printf("Syntax: hide <parameter>\n");
return true;
}
if (!strcmp(argv[1], "hex")) {
_s->_hexdumpScripts = false;
Debug_Printf("Script hex dumping off\n");
}
return true;
}
bool ScummDebugger::Cmd_Actor(int argc, const char **argv) {
Actor *a;
int actnum;

View File

@ -81,6 +81,9 @@ protected:
bool Cmd_DebugLevel(int argc, const char **argv);
bool Cmd_Help(int argc, const char **argv);
bool Cmd_Show(int argc, const char **argv);
bool Cmd_Hide(int argc, const char **argv);
void printBox(int box);

View File

@ -285,6 +285,8 @@ void Scumm::executeScript() {
_scriptPointer - _scriptOrgPointer,
_opcode,
getOpcodeDesc(_opcode));
if (_hexdumpScripts == true)
hexdump(_scriptPointer - 1, 8);
executeOpcode(_opcode);
}
CHECK_HEAP;

View File

@ -420,7 +420,7 @@ protected:
int16 _virtual_mouse_x, _virtual_mouse_y;
int _bootParam;
bool _dumpScripts;
bool _dumpScripts, _hexdumpScripts;
uint16 _debugMode, _soundCardType;
/* Not sure where this stuff goes */

View File

@ -202,6 +202,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst)
_expire_counter = 0;
_dynamicRoomOffsets = 0;
_shakeEnabled = 0;
_hexdumpScripts = 0;
if (_gameId == GID_ZAK256) { // FmTowns is 320x240
_realWidth = 320;