There's a couple of too fast VRAM writes that are easy to fix, but..
Your main problem is expecting sprite collision detection to work flawlessly. There's a quirk (described in the VDP datasheets too) with the statusregister if you read it at the same time the VDP sets one of its bits, it will return the wrong value. So, if you read $99 at the same time bit 5 (collision) is set, it will return 0, and reset bit 5 at the same time, making you miss the collision.
By Google
@hap. Ok. Thanks for check the code.
So there are 2 problems in my side...
Do you think it is possible to fix both and make it works?
...and one problem in emulation, because the program runs ok in all emus. O_o!
If you rely on determining the screen position *accurately* by sprite collision, then it's impossible to fix.
Yes, emulators don't emulate those quirks, exact timing is not known yet.
About the too fast VRAM writes, it's because you're setting the address in read-mode and access $98 right after, so basically you should do ld hl,$5xxx+1 instead of ld hl,$1xxx (+1 because read-mode pre-increments the address)
I suspect that calculating T-states is the other "manual" way.
Don't you have an account yet? Become an MSX-friend and register an account!

By [WYZ]
Master (213)
29-08-2010, 14:55