Hex editor: disable 0-length domains (b/c mGBA SaveRAM)

This commit is contained in:
RetroEdit 2020-07-10 11:20:06 +00:00
parent 1bf8f80510
commit 9f68a9c325
No known key found for this signature in database
GPG Key ID: CE9E2A36E1EFA76F
3 changed files with 12 additions and 4 deletions

View File

@ -242,7 +242,10 @@ namespace BizHawk.Client.EmuHawk.ToolExtensions
var item = new ToolStripMenuItem
{
Text = name,
Enabled = !(maxSize.HasValue && domain.Size > maxSize.Value),
// 0-length domains cause several problems, so they're disabled.
// Specifically, scrolling, arrow keys, and PgUp/PgDn all crash.
// Also, they're useless for RAM searches.
Enabled = !(maxSize.HasValue && domain.Size > maxSize.Value) && domain.Size != 0,
Checked = name == selected
};
item.Click += (o, ev) => setCallback(name);

View File

@ -190,7 +190,7 @@ namespace BizHawk.Client.EmuHawk
}
}
if (MemoryDomains.Any(x => x.Name == _domain.Name))
if (MemoryDomains.Any(x => x.Name == _domain.Name && x.Size != 0))
{
_domain = MemoryDomains[_domain.Name];
}
@ -634,7 +634,12 @@ namespace BizHawk.Client.EmuHawk
}
else
{
_domain = MemoryDomains[name];
var domainCandidate = MemoryDomains[name];
if (domainCandidate.Size == 0)
{
return;
}
_domain = domainCandidate;
}
BigEndian = _domain.EndianType == MemoryDomain.Endian.Big;

View File

@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
mm.Add(_vram = new MemoryDomainIntPtr("VRAM", le, IntPtr.Zero, 96 * 1024, true, 4));
mm.Add(_oam = new MemoryDomainIntPtr("OAM", le, IntPtr.Zero, 1024, true, 4));
mm.Add(_rom = new MemoryDomainIntPtr("ROM", le, IntPtr.Zero, romsize, true, 4));
mm.Add(_sram = new MemoryDomainIntPtr("SRAM", le, IntPtr.Zero, 0, true, 4)); // size will be fixed in wireup
mm.Add(_sram = new MemoryDomainIntPtr("SaveRAM", le, IntPtr.Zero, 0, true, 4)); // size will be fixed in wireup
mm.Add(_cwram = new MemoryDomainDelegate("Combined WRAM", (256 + 32) * 1024, le, null, null, 4));
mm.Add(new MemoryDomainDelegate("System Bus", 0x10000000, le,