From 9b27cc109e8427fb2f33f7430992b9e2613c9c9c Mon Sep 17 00:00:00 2001 From: Sour Date: Wed, 26 Feb 2020 19:26:14 -0500 Subject: [PATCH] Debugger: Fixed source view mode regressions --- Core/Debugger.cpp | 2 +- UI/Debugger/Integration/DbgImporter.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/Debugger.cpp b/Core/Debugger.cpp index 5f69a4c..f3ee0e5 100644 --- a/Core/Debugger.cpp +++ b/Core/Debugger.cpp @@ -483,7 +483,7 @@ AddressInfo Debugger::GetRelativeAddress(AddressInfo absAddress, CpuType cpuType if(absAddress.Type == SnesMemoryType::WorkRam) { startBank = 0x7E; } else { - startBank = (_cpu->GetState().K & 0xC0) << 4; + startBank = _cpu->GetState().K & 0xC0; } } else if(cpuType == CpuType::Sa1) { startBank = (_cart->GetSa1()->GetCpuState().K & 0xC0); diff --git a/UI/Debugger/Integration/DbgImporter.cs b/UI/Debugger/Integration/DbgImporter.cs index bd5f084..985e784 100644 --- a/UI/Debugger/Integration/DbgImporter.cs +++ b/UI/Debugger/Integration/DbgImporter.cs @@ -75,7 +75,7 @@ namespace Mesen.GUI.Debugger.Integration { int prgAddress; if(_prgAddressByLine.TryGetValue(fileID.ToString() + "_" + lineIndex.ToString(), out prgAddress)) { - return new AddressInfo() { Address = prgAddress, Type = SnesMemoryType.CpuMemory }; + return new AddressInfo() { Address = prgAddress, Type = SnesMemoryType.PrgRom }; } return null; } @@ -94,7 +94,7 @@ namespace Mesen.GUI.Debugger.Integration public SourceCodeLocation GetSourceCodeLineInfo(AddressInfo address) { SourceCodeLocation line; - if(address.Type == SnesMemoryType.CpuMemory && _linesByPrgAddress.TryGetValue(address.Address, out line)) { + if(address.Type == SnesMemoryType.PrgRom && _linesByPrgAddress.TryGetValue(address.Address, out line)) { return line; } return null;