Open danielholmes opened 1 year ago
Thanks for the issue report - I agree with your diagnosis! I also think that you're correct about this:
I read a mention of using a "catch up" method of working with a cpu where the cpu does a full operation then other components run their catch up. If this is a very common way of doing things then it may be difficult to do a per cycle log file, making this project less accessible.
I'd be happy to have Gameboy Doctor support both modes (per cycle and per-op), although it would require someone with a very reliable per-cycle emulator to create the per-cycle logfiles. This could/should probably be done using one of the known-good exemplar references. I don't think this is something that I personally would take on, but I'm interested in PRs!
Wdyt?
I'm interested in pursuing it, but it will depend how difficult it is for me to get one of the exemplar references to generate a per cycle log.
Do you have any suggestions for what you'd consider exemplar references? Gambatte and Sameboy are the first ones I think of, but I have no C++ and little C experience so that might be a time sink. I've seen some videos from Gekkio about the Game Boy and his emulator and it seemed impressive, not sure how complete his emulator implementation mooneye got though.
I think I'd start with Sameboy unless you have an alternate suggestion.
I'm not super familiar with the landscape, but Sameboy is the first one that comes to my mind!
If you do do this then feel free to refactor whatever you like. The code is starting to creak a little and I'm not emotionally attached to any of it :)
Hi,
Thanks for this wonderful project! It's great to get some earlier validation rather than having to wait for implementing the LCD.
In my first attempt (using
06-ld r,r.gb
) I was disheartened that my log failed on 2nd line. Then I noticed that the log timings were different.Reference log:
My log (observe the
PC
values to see the pattern):I figured out that the reference log is showing one line per operation whereas I was outputting one line per cpu cycle.
I'm still only part way through my game boy emulator journey and this is my first emulator so I'm probably misunderstanding several things, but this seems like a missed opportunity. i.e. if we take one of the first operations executed in this test rom:
JP a16
/JP nn
/0xC3
, the timings I can find for it ATM are:CPU cycle 1: fetch operation CPU cycle 2: read 16 bit operand lower CPU cycle 2: read 16 bit operand upper CPU cycle 3: internal delay
Having one log entry per cpu cycle would be able to catch emulators that don't match these timings, whereas one log entry per operation allows any combination or merging of cycles 2-4.
I have a couple of thoughts on why it mightn't be desirable to do one entry per cpu cycle:
I read a mention of using a "catch up" method of working with a cpu where the cpu does a full operation then other components run their catch up. If this is a very common way of doing things then it may be difficult to do a per cycle log file, making this project less accessible.
I'd be interested to hear people's thoughts on this.