Now is the following a bug in the original game, or MAME's video emulation?
In the below screenshot you can see a large shadow bottom left. What is it? Where has it come from? Who knows!
Can someone try reproducing this on hardware? You probably want to give it a go on MAME first to get the hang of where to drive without using the debugger!
I suspect this is an issue with MAME's video emulation code, which I've used as a basis for my port, but would be nice to get verification.
Incidentally, I can't reproduce this issue on the Sega Saturn port. (Interestingly, the Saturn port also fixes some of the other bugs I found that can be reproduced on hardware).
Update: Thanks to Magic Knight for reproducing this on hardware. Surprisingly, it's a bug in the original game code. It only took 5 minutes to find and fix in my C++ translation. Here's the offending code:
// Hide Sprite if off screen
if (sprite_y2 < 256 || sprite_y > 479 ||
sprite_x + width < 192 || sprite_x > 512)
{
hide_hwsprite(input, output);
return;
}
The fix is to change the highlighted > symbol to >=. Easy! I'm going to wait before patching the original game, just in case this has caused any side effects.
The bug is caused by the shadow on the right hand side, wrapping to the left as it goes off-screen.
In the below screenshot you can see a large shadow bottom left. What is it? Where has it come from? Who knows!
- You can reproduce this by manually setting the car x position to 0x1E2 in the mame debugger (offset 0x260050 in memory).
- Drive forward from the start line, and you'll see this shadow flicker on and off.
- Setting the car position to 0x1E1 or 0x1E3 sees the shadow disappear as below.
I suspect this is an issue with MAME's video emulation code, which I've used as a basis for my port, but would be nice to get verification.
Incidentally, I can't reproduce this issue on the Sega Saturn port. (Interestingly, the Saturn port also fixes some of the other bugs I found that can be reproduced on hardware).
Update: Thanks to Magic Knight for reproducing this on hardware. Surprisingly, it's a bug in the original game code. It only took 5 minutes to find and fix in my C++ translation. Here's the offending code:
// Hide Sprite if off screen
if (sprite_y2 < 256 || sprite_y > 479 ||
sprite_x + width < 192 || sprite_x > 512)
{
hide_hwsprite(input, output);
return;
}
The fix is to change the highlighted > symbol to >=. Easy! I'm going to wait before patching the original game, just in case this has caused any side effects.
The bug is caused by the shadow on the right hand side, wrapping to the left as it goes off-screen.