diff --git a/Core/ExpressionEvaluator.cpp b/Core/ExpressionEvaluator.cpp index 05e5f434..d55e1849 100644 --- a/Core/ExpressionEvaluator.cpp +++ b/Core/ExpressionEvaluator.cpp @@ -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 *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; diff --git a/Core/ExpressionEvaluator.h b/Core/ExpressionEvaluator.h index 0470fdee..f043cc89 100644 --- a/Core/ExpressionEvaluator.h +++ b/Core/ExpressionEvaluator.h @@ -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 diff --git a/GUI.NET/Debugger/frmBreakpoint.cs b/GUI.NET/Debugger/frmBreakpoint.cs index 9cba584a..c5bfd31e 100644 --- a/GUI.NET/Debugger/frmBreakpoint.cs +++ b/GUI.NET/Debugger/frmBreakpoint.cs @@ -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 + diff --git a/GUI.NET/Debugger/frmDebugger.cs b/GUI.NET/Debugger/frmDebugger.cs index d8e762a7..26b1c2be 100644 --- a/GUI.NET/Debugger/frmDebugger.cs +++ b/GUI.NET/Debugger/frmDebugger.cs @@ -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 + "[
]: (Byte) Memory value at
(CPU)" + Environment.NewLine + "{
}: (Word) Memory value at
(CPU)" + Environment.NewLine + Environment.NewLine +