There is some problems with my emulator. The character's position in some game is incorrect. It's a little lower than the normal one.
This is my emulator's screenshot:
And the normal one should be:
Can anyone tell me what the problem?
And the strange thing is the character's position in Super Mario bros is correct. I'm really confused.
I think you should be more specific. Are all sprites in certain games correct while all the sprites in other games aren't? Are they all off by the same amount?
First Double check that your scrolling is correct.
No clue about the game title... BUT I have a few tidbits...
1. Check your PPU timing, specially how you render the screen and the NMI triggering time.
2. Check your sprite Y position (vertical). Perhaps you should re-read it or... try +1 for the Y coordinate.
3. The PPU scrolling might be related with the MMC3 IRQs, if this mapper is actually a MMC3. Well, by considerating some variations of it, we cannot assign it as "iNES mapper 4" anymore...
4. Check $2004 reads.
Perhaps you should look at how games that don't work in your emulator draw sprites. Compare some games that use DMA and some that use direct writes to $2004. You may find that the DMA ones act a certain way while the ones that directly store writes to $2004 act differently.
I'll repeat my post. The sprites are clearly being drawn correctly. The background is drawn too high.
Dwedit wrote:
I'll repeat my post. The sprites are clearly being drawn correctly. The background is drawn too high.
There is an alignment problem that MIGHT BE the +1 thing for the Y-coord.
The sprites are being drawn correctly, but it appears that the position is transposed about 8 pixels.
As Dwedit said twice, there is nothing wrong with the sprites, it is the background that is wrong. The distance from top of pict to top of sprites is the same in both pictures. The distance form the top of pict to the top of the ground is different. Visibly you can see more brown under the grass on the incorrect screenshot. Sprite position is correct, background position (likely scrolling) is wrong.
Right... and which mapper does this game use?
Fx3 wrote:
Right... and which mapper does this game use?
Mickey Mousecapade uses CNROM. So I'm guessing the problem has nothing to do with the mapper - since all CNROM does is CHR bank-switching, and it looks like the pattern tables are correct.
kyuusaku wrote:
Could it be sprite 0?
Nope - the game doesn't even read $2002 for anything during the level-intros.
Maybe it has something to do with writing a certain value to the Y scroll, because SMB1 works, and it doesn't use vertical scrolling. Do the games that don't work use vertical scrolling?
bunnyboy wrote:
As Dwedit said twice, there is nothing wrong with the sprites, it is the background that is wrong.
Twice? It seems that in the two posts that Dwedit made, only one of them actually states that the poster does not believe something is wrong with the sprites, but something is wrong with the backgrounds.
What is being written to $2005 and $2006 when the screen is set up?
Thanks for all your suggestions. However, i have not solved this problem yet. It appears that there is something wrong with background rendering and its y coordinate is 8 pixels higher, but in game <Ice Climber> it's 8 pixels lower.
So is there something different on background setup between these games?
Maybe i should put more information on my implementation:
First, i have a 256*240 byte array for screen buffer, then i fetch background colors to fill it.
second, after i finish filling background buffer, i setup sprite images and merge it to corresponding positions of screen buffer.
And the result is the background & sprite position is right in SMB, and background is 8 pixels higher in Mikey Mouse, and background is 8 pixels lower in Ice climber.
How are you handling scrolling and PPU address changes?