You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FCEUX and latest Gens have this, and it's super useful for quickly determining subroutines (and skipping over them as needed). A core can determine indentation based on stack size, and pass the number to the tracer, which would then pad each line by that size.
Example code for gpgx (to show how it'd look):
protectedoverridevoidTraceFromCallback(uintaddr,uintvalue,uintflags){varregs= DebuggableCore.GetCpuFlagsAndRegisters();uintpc=(uint)regs["M68K PC"].Value &0xFFFFFF;vardisasm= Disassembler.Disassemble(MemoryDomains.SystemBus, pc,out _);varstackBase= MemoryDomains.SystemBus.PeekUint(0,true);varstackPointer= regs["M68K A7"].Value;varstackSize=(int)((stackBase-stackPointer)/4)&63;varsb=new StringBuilder();foreach(var r in regs){if(r.Key.StartsWith("M68K"))// drop Z80 regs until it has its own debugger/tracer{if(r.Key !="M68K SP"&& r.Key !="M68K ISP"&&// copies of a7
r.Key !="M68K PC"&&// already present in every line start
r.Key !="M68K IR")// copy of last opcode, already shown in raw bytes{
sb.Append($"{r.Key.Replace("M68K","").Trim()}:{r.Value.Value.ToHexString(r.Value.BitSize /4)}");}}}varsr= regs["M68K SR"].Value;
sb.Append(string.Concat((sr&16)>0?"X":"x",(sr&8)>0?"N":"n",(sr&4)>0?"Z":"z",(sr&2)>0?"V":"v",(sr&1)>0?"C":"c"));this.Put(new(disassembly:$"{newstring(' ', stackSize)}{pc:X6}: {disasm}".PadRight(50+stackSize), registerInfo: sb.ToString().Trim()));}
The text was updated successfully, but these errors were encountered:
If implemented, it might be worth making it optional. Column-aligned is easier to read sometimes. To be fair it's not that important because unindenting is probably a pretty easy operation with a simple regex replace like '^ +' to ' ' (in a text editor or otherwise).
How well does it handle say the stack pointer going off the rails due to some crash, or possibly tricks manipulating the stack pointer (e.g. on the NES and GB (and probably other systems) a "popslide" technique can be used to quickly copy video memory, typically setting the stack pointer to ROM and popping off the ""stack"" to read memory as fast as possible, then writing the results to VRAM; setting the stack pointer to ROM might also be used in some ACE exploits as a way to redirect execution to more controllable memory).
If implemented, it might be worth making it optional.
Forgot to mention, yeah.
Column-aligned is easier to read sometimes. To be fair it's not that important because unindenting is probably a pretty easy operation with a simple regex replace like '^ +' to ' ' (in a text editor or otherwise).
I'd expect many text editors to be able to remove leading spaces.
How well does it handle say the stack pointer going off the rails due to some crash
My initial code for a Gens mod didn't handle this in any way, but r57shell's version simply does &63 with the indent size, I think it's a fair solution.
FCEUX and latest Gens have this, and it's super useful for quickly determining subroutines (and skipping over them as needed). A core can determine indentation based on stack size, and pass the number to the tracer, which would then pad each line by that size.
Example code for gpgx (to show how it'd look):
The text was updated successfully, but these errors were encountered: