Post subject: Help with Trace Logger
cheeze42
He/Him
Joined: 6/5/2015
Posts: 15
I've been trying to use Trace Logger recently, but I can't understand the output. I know the first part is the address being used, then the instruction, then finally any remaining parameters, but it also outputs ~17 other addresses/values (not sure which). What do those other addresses/values mean?
Games of Interest: -Pokemon Rumble (Wii) -Kingdom Hearts: Chain of Memories (GBA) -Kingdom Hearts: re:Coded (NDS)
Masterjun
He/Him
Site Developer, Skilled player (1986)
Joined: 10/12/2010
Posts: 1185
Location: Germany
You are probably seeing different processor registers, such as the accumulator (usually a simple A) or general-purpose registers.
Without a register like an accumulator, it would be necessary to write the result of each calculation (addition, multiplication, shift, etc.) to main memory, perhaps only to be read right back again for use in the next operation.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Editor, Skilled player (1438)
Joined: 3/31/2010
Posts: 2107
The output of the Trace Logger depends on the system you're on, as different systems have different CPUs with different assembly languages. To make sense of what the Trace Logger puts out, you need to know the ISA of the CPU you're working with and understand ASM in general. On the example of NES, here's your average Trace Logger line and what it means.
C5C3  8D STA $2007            A:00 X:04 Y:E1 P:B5 SP:FD Cy:212836   NTBIC

C5C3: The location of the instruction that is currently being executed.
8D: The opcode, in this case (STA, absolute).
STA $2007: The current instruction.
A:00 X:04 Y:E1 P:B5 SP:FD: The current state of the NES CPU registers in Hex BEFORE the instruction was executed.
Cy: The total amount of CPU clock cycles that have passed so far.
NTBIC: The NES CPU flags that are set before the instruction was executed.
On Bizhawk, different cores put different things in the trace logger, depending on the system. Some of the above applies to other cores, some of it doesn't. To get more specific help, post the system you're using and if there's any specific section about it that's giving you trouble.
cheeze42
He/Him
Joined: 6/5/2015
Posts: 15
I've been working on the GBA, and there's no indicator of what the values are (no A, X, Y, P, etc.). Here's a sample line:
e0809bc9 ADD r9, r0, r9, ASR #23        0000001F FFFFFFFE 00000CD8 09D92327 006B82B0 C203CCA4 020604FD 020604FD 00000004 FFB6BA60 002E0000 002D0000 05000000 03007DE0 0024A2D0 03000304 2000001F
I wanted to know where a certain address came from (I'm 99% sure it's from a table somewhere), but upon Trace Logging for the one frame when the address changed I logged 79194 instructions, so I've been trying to search through it. So any relevant data is nice.[/code]
Games of Interest: -Pokemon Rumble (Wii) -Kingdom Hearts: Chain of Memories (GBA) -Kingdom Hearts: re:Coded (NDS)
Masterjun
He/Him
Site Developer, Skilled player (1986)
Joined: 10/12/2010
Posts: 1185
Location: Germany
Well, there is obviously a problem with the formatting of the log. There should be an indication of what register you are looking at. My guess is that the 17 values are R0, R1, R2... R14, R15 and the last one is maybe CPSR (Current Program Status Register). However, the problem with the formatting still remains and should be fixed. The PC should be at the start (looking at R15 for that isn't good) and the registers should be indicated, even if that makes lines really long.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Editor, Expert player (2072)
Joined: 6/15/2005
Posts: 3282
I'd generally use a debugger if possible (actual breakpoints and step-by-step advancing through each instruction). For GBA, I used VBA-SDL-H. The only other ones I used are Geiger's Snes9x for SNES and BGB for Game Boy and Game Boy Color. BizHawk has a "Debugger" in its menu, but it appears to be mostly non-functional right now.