Debugger: Fixed UI crash when trying to put breakpoint on GSU memory

This commit is contained in:
Sour 2019-08-06 21:22:59 -04:00
parent a861a0af7c
commit 937b61f975
2 changed files with 14 additions and 1 deletions

View file

@ -79,7 +79,7 @@ namespace Mesen.GUI.Debugger
BreakpointManager.RefreshBreakpoints(this);
}
public bool IsAbsoluteAddress { get { return MemoryType != SnesMemoryType.CpuMemory && MemoryType != SnesMemoryType.SpcMemory; } }
public bool IsAbsoluteAddress { get { return !MemoryType.IsRelativeMemory(); } }
public bool IsCpuBreakpoint { get { return this._isCpuBreakpoint; } }
private BreakpointTypeFlags Type

View file

@ -195,6 +195,18 @@ namespace Mesen.GUI
}
}
public static bool IsRelativeMemory(this SnesMemoryType memType)
{
switch(memType) {
case SnesMemoryType.CpuMemory:
case SnesMemoryType.SpcMemory:
case SnesMemoryType.Sa1Memory:
case SnesMemoryType.GsuMemory:
return true;
}
return false;
}
public static bool SupportsLabels(this SnesMemoryType memType)
{
switch(memType) {
@ -217,6 +229,7 @@ namespace Mesen.GUI
case SnesMemoryType.CpuMemory:
case SnesMemoryType.SpcMemory:
case SnesMemoryType.Sa1Memory:
case SnesMemoryType.GsuMemory:
return true;
}