Sprite DMA & MMC interrupt wierdness

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
CrashTest
Posts: 32
Joined: Tue Sep 02, 2008 12:43 pm

Sprite DMA & MMC interrupt wierdness

Post by CrashTest »

OK, I've got my scrolling up and working, but I have an odd issue where my sprite DMA is causing my status bar to be 16 lines too large, but only on Nintenulator and Nestopia, not Jnes or FCEUX.

If comment out my sprite DMA lines, then the scrolling and top status bar are correct under all 4 emulators.

Is there anything special I have to do before I sprite DMA. I've tried doing the DMA right after vsync, and even inside the NMI interrupt, but still no luck.

Any ideas?
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

Maybe set up the IRQ only after you have written the scroll/vram address registers for your frame?

Also double check that you don't have frame IRQs on.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
CrashTest
Posts: 32
Joined: Tue Sep 02, 2008 12:43 pm

Post by CrashTest »

Thanks for the advice dw, I figured out what the issue is:

So it seems like I was breaking the MMC3 rule of using 8x16 sprites from character set 0 instead of solely character set 1! Wierdly enough, it seems to have the of delaying when the IRQ gets set by around 16 lines in some emulators (wonder if the real HW does this too?)

By setting all the index values of all the sprites to an odd number, it fixed the issue!
Post Reply