mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-20 17:03:05 +00:00
GOB: Add a console command to dump the whole variable space
This commit is contained in:
parent
21fd6a2e90
commit
5bcb89852f
@ -29,6 +29,7 @@ namespace Gob {
|
||||
|
||||
GobConsole::GobConsole(GobEngine *vm) : GUI::Debugger(), _vm(vm) {
|
||||
DCmd_Register("varSize", WRAP_METHOD(GobConsole, cmd_varSize));
|
||||
DCmd_Register("dumpVars", WRAP_METHOD(GobConsole, cmd_dumpVars));
|
||||
DCmd_Register("var8", WRAP_METHOD(GobConsole, cmd_var8));
|
||||
DCmd_Register("var16", WRAP_METHOD(GobConsole, cmd_var16));
|
||||
DCmd_Register("var32", WRAP_METHOD(GobConsole, cmd_var32));
|
||||
@ -44,6 +45,23 @@ bool GobConsole::cmd_varSize(int argc, const char **argv) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GobConsole::cmd_dumpVars(int argc, const char **argv) {
|
||||
if (!_vm->_inter->_variables)
|
||||
return true;
|
||||
|
||||
Common::DumpFile file;
|
||||
|
||||
if (!file.open("variables.dmp"))
|
||||
return true;
|
||||
|
||||
file.write(_vm->_inter->_variables->getAddressOff8(0), _vm->_inter->_variables->getSize());
|
||||
|
||||
file.flush();
|
||||
file.close();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GobConsole::cmd_var8(int argc, const char **argv) {
|
||||
if (argc == 1) {
|
||||
DebugPrintf("Usage: var8 <var offset> (<value>)\n");
|
||||
|
@ -38,6 +38,7 @@ private:
|
||||
GobEngine *_vm;
|
||||
|
||||
bool cmd_varSize(int argc, const char **argv);
|
||||
bool cmd_dumpVars(int argc, const char **argv);
|
||||
bool cmd_var8(int argc, const char **argv);
|
||||
bool cmd_var16(int argc, const char **argv);
|
||||
bool cmd_var32(int argc, const char **argv);
|
||||
|
Loading…
x
Reference in New Issue
Block a user