SourMesen / Mesen

Mesen is a cross-platform (Windows & Linux) NES/Famicom emulator built in C++ and C#
https://www.mesen.ca
GNU General Public License v3.0
1.25k stars 318 forks source link

"Show Memory Values" option in trace logger not showing expected values #869

Open joeholley opened 3 years ago

joeholley commented 3 years ago

Hey there - first, great toolset. Really getting a lot of mileage out of it, having moved over from FCEUX. Running into one thing that makes Trace Logging a lot less useful for me, though.

When checking the Show Memory Values box, all memory values for a given address display its current value, instead of the value it had when it was executing. This makes it difficult when I try to read back through a Trace Log with memory values since I can't see how the instruction execution modified the memory values.

To clarify, here are trace logs of the same code from mesen & FCEUX: FCEUX

LDA ($F1),Y @ $0508 = #$26
PHA
  (inner function ellided...)
PLA
STA ($F1),Y @ $0508 = #$1A              

Here you can see that the produced Trace Log has the value of the given memory address, at the time of instruction execution - look at the value in $0508 reflecting the changes when it is written.

mesen

lda ($F1),Y @ $0508 = $26
pha
  (inner function ellided...)
pla
sta ($F1),Y @ $0508 = $26

Here in mesen we see that the trace log shows the value at $0508 to be $26 both times it is accessed (it is just showing the current execution state value of memory for that address from when I paused execution after the trace). Both FCEUX and mesen display this behavior in the debugger disassembly, but only mesen shows this behavior in the Trace Logger. Seems unintentional when tracing since the turning on the "Registers" log option displays the values in the registers at time of execution of each instruction?

Any chance we could get the FCEUX-style behaviour? Your UI is so superior that it is really painful to have to switch back to FCEUX to do trace logs when troubleshooting :) Also, bonus points if it is possible to get this functionality in the disassembly debugger! If that were possible, I'd probably be using it instead of the Trace Logger a lot of the time.

Thanks so much for all the hard work and the outstanding emulation tools. OTL