Testing my new MMC1 implementation, I found some problems with "Dusty Diamond's All-Star Softball (U) [!]. nes". After the initial choices the rom hangs in an infinite loop. Tested with other emulators I noticed that there are the same problem. I understood what was the problem and now I know what you think. The rom does something like this:
1) writes 0x00 in $2003
2) writes 4 bytes in the OAM through the $2004 (setting sprite 0)
3) in the next video frame update the entire OAM using $4014 starting to write, however, from the the sprite 1 instead of 0.
In this way, the sprite 0 will always have a Y coordinate "0xFF" and then never gets hit and the game goes into an infinite loop waiting that bit 6 of $2002 is set.
It seems that before the writing of the $4014, the $2003 should be cleaned.
Following this logic, I tried to reset the $2003 at scanline 238 after the last evaluated sprite and the games started to work.
They also started to run even the chinese MMC3 rom that not working properly such as:
Aladdin 2 (Unl). Nes
Bing Kuang Ji Dan Zi - flighty Chicken (Ch). Nes
and many others
1) writes 0x00 in $2003
2) writes 4 bytes in the OAM through the $2004 (setting sprite 0)
3) in the next video frame update the entire OAM using $4014 starting to write, however, from the the sprite 1 instead of 0.
In this way, the sprite 0 will always have a Y coordinate "0xFF" and then never gets hit and the game goes into an infinite loop waiting that bit 6 of $2002 is set.
It seems that before the writing of the $4014, the $2003 should be cleaned.
Following this logic, I tried to reset the $2003 at scanline 238 after the last evaluated sprite and the games started to work.
They also started to run even the chinese MMC3 rom that not working properly such as:
Aladdin 2 (Unl). Nes
Bing Kuang Ji Dan Zi - flighty Chicken (Ch). Nes
and many others