Show the actual value of the flags registers if there is a mismatch in the lower nybble
Ahh do you mean show the full 2-digit hex, rather than just the 4 flags? In case there's a mismatch in the bits in the F register outside those used for the flags?
Yup. Only show it if there is a mismatch in the lower four bits.
👍 makes sense, I'll do that at some point!
This sent me for a loop, I had to manually look at the logs to figure out what was going on. F register was getting bit 0 set, gb dr said the line was wrong, but the diff it displayed me was identical. Specifically happened for the 01-special.gb test.
Thanks for the vote, I'll keep this in mind. If you're interested in submitting a patch then that would be awesome, although the code is a little gnarly so might be tricky XD.
I think the lower nybble of F is always 0.
ld b, 0xff
ld c, 0xff
push bc
pop af
push af
pop bc
If you check c after all this in an emulator like BGB, the lower nybble will be zeroed out because when the values were pushed back onto the stack the lower f nybble is zeroed. The cpu_instrs does something goofy like this to feed state to the CRC checker and I found the lower nybble was zeroed out. Also this reference shows the lower nybble as zeroed out.
I'm not an expert though. If I'm wrong, please don't neglect your duty.
Heh you're probably right. Do you think we should change anything about gameboy doctor or is this just interesting trivia?
I just commented to be helpful since it sounded like a fellow GB emulator developer was on the wrong path, and people from the future finding for this issue might benefit.
I think the ideal output from gameboy-doctor would be to check the lower F nybble and when it is non-zero explain that it should never be zero.