Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show index and memory mode in debugger tooltip #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 13 additions & 2 deletions UI/Debugger/Utilities/CodeTooltipHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,25 @@ private static DynamicTooltip GetMarginAddressTooltip(CpuType cpuType, CodeSegme
items.AddEntry("Address", addressField, true);

bool isCode = false;
bool indexMode8 = false;
bool memoryMode8 = false;
if(address >= 0) {
isCode = DebugApi.GetCdlData((uint)address, 1, memType)[0].HasFlag(CdlFlags.Code);
var cdl = DebugApi.GetCdlData((uint)address, 1, memType)[0];
isCode = cdl.HasFlag(CdlFlags.Code);
indexMode8 = cdl.HasFlag(CdlFlags.IndexMode8);
memoryMode8 = cdl.HasFlag(CdlFlags.MemoryMode8);
} else if(seg.Data.AbsoluteAddress.Address >= 0) {
isCode = DebugApi.GetCdlData((uint)seg.Data.AbsoluteAddress.Address, 1, seg.Data.AbsoluteAddress.Type)[0].HasFlag(CdlFlags.Code);
var cdl = DebugApi.GetCdlData((uint)seg.Data.AbsoluteAddress.Address, 1, seg.Data.AbsoluteAddress.Type)[0];
isCode = cdl.HasFlag(CdlFlags.Code);
indexMode8 = cdl.HasFlag(CdlFlags.IndexMode8);
memoryMode8 = cdl.HasFlag(CdlFlags.MemoryMode8);

}

if(isCode) {
items.AddEntry("Byte code", seg.Data.ByteCodeStr, true);
items.AddEntry("Index Mode", indexMode8 ? "8-bit" : "16-bit", true);
items.AddEntry("Memory Mode", memoryMode8 ? "8-bit" : "16-bit", true);
}

return new DynamicTooltip() { Items = items };
Expand Down