Debugger: Added a few aliases (PC, OpPC, Frame)

This commit is contained in:
Souryo 2017-04-30 20:40:09 -04:00
parent fe8f15b17b
commit 14a27bb18a
4 changed files with 25 additions and 7 deletions

View file

@ -80,6 +80,12 @@ bool ExpressionEvaluator::CheckSpecialTokens(string expression, size_t &pos, str
output += std::to_string(EvalValues::RegPS);
} else if(!token.compare("sp")) {
output += std::to_string(EvalValues::RegSP);
} else if(!token.compare("pc")) {
output += std::to_string(EvalValues::RegPC);
} else if(!token.compare("oppc")) {
output += std::to_string(EvalValues::RegOpPC);
} else if(!token.compare("frame")) {
output += std::to_string(EvalValues::PpuFrameCount);
} else if(!token.compare("cycle")) {
output += std::to_string(EvalValues::PpuCycle);
} else if(!token.compare("scanline")) {
@ -302,6 +308,9 @@ int32_t ExpressionEvaluator::Evaluate(vector<int> *rpnList, DebugState &state, E
case EvalValues::RegY: token = state.CPU.Y; break;
case EvalValues::RegSP: token = state.CPU.SP; break;
case EvalValues::RegPS: token = state.CPU.PS; break;
case EvalValues::RegPC: token = state.CPU.PC; break;
case EvalValues::RegOpPC: token = state.CPU.DebugPC; break;
case EvalValues::PpuFrameCount: token = state.PPU.FrameCount; break;
case EvalValues::PpuCycle: token = state.PPU.Cycle; break;
case EvalValues::PpuScanline: token = state.PPU.Scanline; break;
case EvalValues::Nmi: token = state.CPU.NMIFlag; break;

View file

@ -51,13 +51,16 @@ enum EvalValues
RegY = 2000000102,
RegSP = 2000000103,
RegPS = 2000000104,
PpuCycle = 2000000105,
PpuScanline = 2000000106,
Nmi = 2000000107,
Irq = 2000000108,
Value = 2000000109,
Address = 2000000110,
AbsoluteAddress = 2000000111,
RegPC = 2000000105,
RegOpPC = 2000000106,
PpuFrameCount = 2000000107,
PpuCycle = 2000000108,
PpuScanline = 2000000109,
Nmi = 2000000110,
Irq = 2000000111,
Value = 2000000112,
Address = 2000000113,
AbsoluteAddress = 2000000114,
};
enum EvalResultType

View file

@ -51,8 +51,11 @@ namespace Mesen.GUI.Debugger
"Note: Use the $ prefix to denote hexadecimal values." + Environment.NewLine +
"Note 2: Labels assigned to the code can be used (their value will match the label's address in CPU memory)." + Environment.NewLine + Environment.NewLine +
"A/X/Y/PS/SP: Value of registers" + Environment.NewLine +
"PC: Program Counter" + Environment.NewLine +
"OpPC: Address of the current instruction's first byte" + Environment.NewLine +
"Irq/Nmi: True if the Irq/Nmi flags are set" + Environment.NewLine +
"Cycle/Scanline: Current cycle (0-340)/scanline(-1 to 260) of the PPU" + Environment.NewLine +
"Frame: PPU frame number (since power on/reset)" + Environment.NewLine +
"Value: Current value being read/written from/to memory" + Environment.NewLine +
"Address: Current CPU memory address being read/written" + Environment.NewLine +
"RomAddress: Current ROM address being read/written" + Environment.NewLine +

View file

@ -103,8 +103,11 @@ namespace Mesen.GUI.Debugger
"Note: Use the $ prefix to denote hexadecimal values." + Environment.NewLine +
"Note 2: Labels assigned to the code can be used (their value will match the label's address in CPU memory)." + Environment.NewLine + Environment.NewLine +
"A/X/Y/PS/SP: Value of registers" + Environment.NewLine +
"PC: Program Counter" + Environment.NewLine +
"OpPC: Address of the current instruction's first byte" + Environment.NewLine +
"Irq/Nmi: True if the Irq/Nmi flags are set" + Environment.NewLine +
"Cycle/Scanline: Current cycle (0-340)/scanline(-1 to 260) of the PPU" + Environment.NewLine +
"Frame: PPU frame number (since power on/reset)" + Environment.NewLine +
"Value: Current value being read/written from/to memory" + Environment.NewLine +
"[<address>]: (Byte) Memory value at <address> (CPU)" + Environment.NewLine +
"{<address>}: (Word) Memory value at <address> (CPU)" + Environment.NewLine + Environment.NewLine +