Closed suzukiplan closed 3 years ago
Thanks for reporting. Could you share the method you used to confirm this? Is the last corrupted line in the girl's image what you're talking about?
I'm also making GameGear emulator (*for test my Z80 emulator), and faced the same problem.
This problem can see in the opening of Madou Monogatari 1 (JP):
I can see this issue in Genesis Plus GX too, it also shows a glitch but is different.
I have tested it on a real GG and you are completely right, my version of Genesis Plus looks like it's doing it badly too. Are you using this https://www.smspower.org/Homebrew/SMSVDPTest-SMS in your emulator?
My GG emulator not has SMS compatible mode, so cannot use SMSVDPTest-SMS yet now...
Just to be sure, I have checked the code for Genesis Plus GX and it seems that the similar issue will occurs, because the v counter and draw scanline values are the same: https://github.com/ekeeke/Genesis-Plus-GX/blob/15722b16ab5a539b14dba024bb008b5c6f22c202/core/vdp_ctrl.c#L2887-L2891
FYI: I ported my GG emulator for SMS and tested with SMSVDPTest-SMS
data test | misc test | sprite test | XScroll timing |
---|---|---|---|
My HCounter emulation is not perfect, but others may be okay.
Thanks for all the feedback, I'm going to decouple the sprite rendering code from sprite processing in my emulator, in order to achieve this off by one issue and other colision and flag issues with sprites.
Also note that these sms tests fail in a real gg because hcount timing is quite different between sms and gg, so if you are emulating both machines you have to take into account these differences.
As a result, the execution timing of the H interrupt will shifted by 1 line, I confirmed: