Debugger: GB - Fixed memory mappings display when boot rom is active

This commit is contained in:
Sour 2020-07-03 16:41:44 -04:00
parent 7a6b600d34
commit 1047860be7
3 changed files with 11 additions and 2 deletions

View file

@ -125,7 +125,11 @@ void GbMemoryManager::Map(uint16_t start, uint16_t end, GbMemoryType type, uint3
if(src) {
src += 0x100;
offset = (offset + 0x100) & (size - 1);
offset = (offset + 0x100);
if(offset >= size) {
offset = 0;
src = _gameboy->DebugGetMemory((SnesMemoryType)type);
}
}
}
} else {

View file

@ -62,6 +62,8 @@ namespace Mesen.GUI.Debugger.Controls
Action<int, int, Color> addPrgRom = (int page, int size, Color color) => { regions.Add(new MemoryRegionInfo() { Name = "$" + page.ToString("X2"), Size = size, Color = color }); };
Action<int> addBootRom = (int size) => { regions.Add(new MemoryRegionInfo() { Name = "", Size = size, Color = Color.IndianRed }); };
GbMemoryType memoryType = GbMemoryType.None;
RegisterAccess accessType = RegisterAccess.None;
int currentSize = 0;
@ -89,6 +91,8 @@ namespace Mesen.GUI.Debugger.Controls
} else {
addCartRam((int)(state.MemoryOffset[startIndex] / otherBankSize), currentSize, accessType);
}
} else if(memoryType == GbMemoryType.BootRom) {
addBootRom(currentSize);
}
currentSize = 0;
startIndex = i;

View file

@ -612,7 +612,8 @@ namespace Mesen.GUI
None = 0,
PrgRom = (int)SnesMemoryType.GbPrgRom,
WorkRam = (int)SnesMemoryType.GbWorkRam,
CartRam = (int)SnesMemoryType.GbCartRam
CartRam = (int)SnesMemoryType.GbCartRam,
BootRom = (int)SnesMemoryType.GbBootRom,
}
public enum RegisterAccess