I've been working through Wilbert Pol's tests (which are variants of gekkio's with more variations) and so far for regular gameboy I am able to pass them all.
But once I started working on GBC variants things started to not add up. The tests that didn't require a halt seem to work ok (except for edge case LY ones) but basically all the ones using halt were failing.
For GB, when I do halt, I do the check for IRQs on the first cycle of each 4 cycle HALT loop. This works for GB and seems to be correct.
But for GBC, it seems like I need to do the check on the third cycle. Then all the tests magically pass for it too. Also doing this doesn't seem to negatively effect anything that I can measure.
For reference, all normal instructions check on the third cycle. I'm pretty sure this was mentioned by Gekkio somewhere.
Does anyone have any insight into this? It certainly seems correct, but I don't have any other point of reference besides these tests.
But once I started working on GBC variants things started to not add up. The tests that didn't require a halt seem to work ok (except for edge case LY ones) but basically all the ones using halt were failing.
For GB, when I do halt, I do the check for IRQs on the first cycle of each 4 cycle HALT loop. This works for GB and seems to be correct.
But for GBC, it seems like I need to do the check on the third cycle. Then all the tests magically pass for it too. Also doing this doesn't seem to negatively effect anything that I can measure.
For reference, all normal instructions check on the third cycle. I'm pretty sure this was mentioned by Gekkio somewhere.
Does anyone have any insight into this? It certainly seems correct, but I don't have any other point of reference besides these tests.