mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
Add bit2 and bit3 options to debugger.
svn-id: r40231
This commit is contained in:
parent
50ddc0daf0
commit
a287eae15d
@ -42,6 +42,8 @@ Debugger::Debugger(AGOSEngine *vm)
|
||||
DCmd_Register("sound", WRAP_METHOD(Debugger, Cmd_PlaySound));
|
||||
DCmd_Register("voice", WRAP_METHOD(Debugger, Cmd_PlayVoice));
|
||||
DCmd_Register("bit", WRAP_METHOD(Debugger, Cmd_SetBit));
|
||||
DCmd_Register("bit2", WRAP_METHOD(Debugger, Cmd_SetBit2));
|
||||
DCmd_Register("bit3", WRAP_METHOD(Debugger, Cmd_SetBit2));
|
||||
DCmd_Register("var", WRAP_METHOD(Debugger, Cmd_SetVar));
|
||||
DCmd_Register("obj", WRAP_METHOD(Debugger, Cmd_SetObjectFlag));
|
||||
DCmd_Register("sub", WRAP_METHOD(Debugger, Cmd_StartSubroutine));
|
||||
@ -146,6 +148,52 @@ bool Debugger::Cmd_SetBit(int argc, const char **argv) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Debugger::Cmd_SetBit2(int argc, const char **argv) {
|
||||
uint bit, value;
|
||||
if (argc > 2) {
|
||||
bit = atoi(argv[1]);
|
||||
value = atoi(argv[2]);
|
||||
if (value == 0) {
|
||||
_vm->_bitArrayTwo[bit / 16] &= ~(1 << (bit & 15));
|
||||
DebugPrintf("Set bit2 %d to %d\n", bit, value);
|
||||
} else if (value == 1) {
|
||||
_vm->_bitArrayTwo[bit / 16] |= (1 << (bit & 15));
|
||||
DebugPrintf("Set bit2 %d to %d\n", bit, value);
|
||||
} else
|
||||
DebugPrintf("Bit2 value out of range (0 - 1)\n");
|
||||
} else if (argc > 1) {
|
||||
bit = atoi(argv[1]);
|
||||
value = (_vm->_bitArrayTwo[bit / 16] & (1 << (bit & 15))) != 0;
|
||||
DebugPrintf("Bit2 %d is %d\n", bit, value);
|
||||
} else
|
||||
DebugPrintf("Syntax: bit2 <bitnum> <value>\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Debugger::Cmd_SetBit3(int argc, const char **argv) {
|
||||
uint bit, value;
|
||||
if (argc > 2) {
|
||||
bit = atoi(argv[1]);
|
||||
value = atoi(argv[2]);
|
||||
if (value == 0) {
|
||||
_vm->_bitArrayThree[bit / 16] &= ~(1 << (bit & 15));
|
||||
DebugPrintf("Set bit3 %d to %d\n", bit, value);
|
||||
} else if (value == 1) {
|
||||
_vm->_bitArrayThree[bit / 16] |= (1 << (bit & 15));
|
||||
DebugPrintf("Set bit3 %d to %d\n", bit, value);
|
||||
} else
|
||||
DebugPrintf("Bit3 value out of range (0 - 1)\n");
|
||||
} else if (argc > 1) {
|
||||
bit = atoi(argv[1]);
|
||||
value = (_vm->_bitArrayThree[bit / 16] & (1 << (bit & 15))) != 0;
|
||||
DebugPrintf("Bit3 %d is %d\n", bit, value);
|
||||
} else
|
||||
DebugPrintf("Syntax: bit3 <bitnum> <value>\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Debugger::Cmd_SetVar(int argc, const char **argv) {
|
||||
uint var, value;
|
||||
if (argc > 1) {
|
||||
|
@ -48,6 +48,8 @@ protected:
|
||||
bool Cmd_PlaySound(int argc, const char **argv);
|
||||
bool Cmd_PlayVoice(int argc, const char **argv);
|
||||
bool Cmd_SetBit(int argc, const char **argv);
|
||||
bool Cmd_SetBit2(int argc, const char **argv);
|
||||
bool Cmd_SetBit3(int argc, const char **argv);
|
||||
bool Cmd_SetVar(int argc, const char **argv);
|
||||
bool Cmd_SetObjectFlag(int argc, const char **argv);
|
||||
bool Cmd_StartSubroutine(int argc, const char **argv);
|
||||
|
Loading…
Reference in New Issue
Block a user