Nestopia and Ninja Gaiden/Burai Fighter

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

zxbdragon
Posts: 492
Joined: Mon Dec 12, 2011 8:15 pm

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by zxbdragon »

I was a dumper, Modify nestopia ,Is to verify the DUMP's ROM.
nestopia I can not afford injuries . There are many problems to be solved
Modify fceux
User avatar
*Spitfire_NES*
Posts: 306
Joined: Fri May 21, 2010 4:10 pm

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by *Spitfire_NES* »

thanks zxbdragon. I was just wondering if this will break other games? Do you know? I added this fix in and see no issues with the 2 games or others, i presume you merged the 2 patches together?
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by thefox »

perilsensitive wrote:The glitch in Ninja Gaiden's intro is caused by extra $2007 reads due to DPCM DMA. I had this exact same glitch in my emulator, and disabling the extra reads for $2007 "fixed" it. I got the same results in Nestopia with a similar change to Apu::Dmc::DoDMA() in NstApu.cpp. I haven't dug any further into this one yet.
I just want to add that I independently verified that this is the cause of the glitch in Nintendulator. For some strange reason, the game reads a byte from the attribute table ($2007), then resets the PPU address and does ORA $2007. This should be a no-op since it should OR the same value that was read before. If the DPCM read glitch occurs during ORA, the PPU address will be incremented, causing it to OR in a wrong value.

I'm not sure if this bug ever manifests itself on real hardware, I only found one gameplay video from real hardware on YouTube, and the bug didn't show up there. The bug might be masked by the way game does the attribute updates in cutscenes. It first clears the whole attribute table to 0. It then updates the lower nibble for the first 8 bytes. Then it updates the higher nibble for the first 8 bytes. This is then repeated 8 times to cover the full attribute table. Thus it's fairly likely that the glitched read would be 0, or some other benign value, not changing the value when ORed in.

This is conjecture, but the LDA $2007/ORA $2007 wackiness may have been a flawed attempt at fixing the DPCM glitch problem.

The game doesn't do attribute readback ingame (only in cutscenes), so no problems there.

The problem is definitely timing related, since merely enabling Game Genie in Nintendulator (it uses the original Game Genie ROM) is enough to push the timing enough so that the bug doesn't show up.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Post Reply