Suggestion: Include last address and value written to by the CPU
Hello,
first of all, thank you for your amazing tool. It has truly saved me a lot of time! However, I am currently stuck because my emulator fails test 1 in line 16484, in instruction 0xF1 POP AF in the flags. Now, the POP instruction, as with many others, reads data from the memory, or bus. But if a previous instruction wrote an incorrect value to the memory, then it's not possible to know where it went wrong.
Therefore, I think it would be valuable to keep track the state of the memory that the CPU writes to. My idea is to extend the current log format with fields "LA", and "LV", which indicate if the last instruction executed wrote to memory, and what value was written. In case no value was written, the character '-' can be used.
That does sound useful! It sounds a bit harder to instrument to me, and the example logs would have to be regenerated. I think we'd want a flag or some kind of other syntax for specifying which fields should be checked, in case someone didn't want to instrument LA and LV.
This said, if you were interested in adding it then I'd love to take a look!
I have almost the same issue, and thus the same request :D Facing an issue where (HL) is XOR'd with A, giving different results. struggling to understand where things went wrong
I also encountered the POP AF problem. I tried to print n values in the stack to check manually, but I still couldn't find the problem.
I also encountered the POP AF problem. I tried to print n values in the stack to check manually, but I still couldn't find the problem.
Not related to this project, but for those who search for POP AF and come here, I debugged it for a day and finally figured it out. The lower 4 bits of F are always 0, so if you write 0x9B, it should be 0x90 when reading.