Nestopia and Ninja Gaiden/Burai Fighter

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by tepples »

Where exactly in the NES hardware does this mirroring from $3000 to $2000 takes place? I thought $3000 had PA12 high, just like $1000, likewise clocking the counter. Is it inside the PPU? Inside the MMC3? Or, as I thought, only on the CHR ROM part of the board?

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

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by zxbdragon »

in nemu...
fixed is
if(address & 0x1000)
irq.address =4;===>irq.address =8;
?
User avatar
James
Posts: 429
Joined: Sat Jan 22, 2005 8:51 am
Location: Chicago, IL
Contact:

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by James »

tepples wrote:I thought $3000 had PA12 high, just like $2000
You mean like $1000, right? I'm not sure what you mean by "the CHR ROM part of the board".

Check out this post: viewtopic.php?t=3657&view=next#p27891. In my emulator, palette writes were already not being put on the bus, so this seems to be the same issue (I may have been thinking about Mickey's Adventure in Numberland, not Safari in Letterland, when I mentioned it needing precise IRQ timing...)
get nemulator
http://nemulator.com
zxbdragon
Posts: 492
Joined: Mon Dec 12, 2011 8:15 pm

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by zxbdragon »

James wrote:
tepples wrote:I thought $3000 had PA12 high, just like $2000
You mean like $1000, right? I'm not sure what you mean by "the CHR ROM part of the board".

Check out this post: viewtopic.php?t=3657&view=next#p27891. In my emulator, palette writes were already not being put on the bus, so this seems to be the same issue (I may have been thinking about Mickey's Adventure in Numberland, not Safari in Letterland, when I mentioned it needing precise IRQ timing...)
you update ppu or mmc3 irq?
User avatar
James
Posts: 429
Joined: Sat Jan 22, 2005 8:51 am
Location: Chicago, IL
Contact:

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by James »

zxbdragon wrote:you update ppu or mmc3 irq?
PPU
get nemulator
http://nemulator.com
zxbdragon
Posts: 492
Joined: Mon Dec 12, 2011 8:15 pm

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by zxbdragon »

James wrote:
zxbdragon wrote:you update ppu or mmc3 irq?
PPU
I see Nintendulator is fixed mmc3 irq
Can you share your fix part ?
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* »

Hey zxbdragon here is one thing that james helped me with that DID fix mickey's safari in letterland but not burai fighter, maybe you can help us zxbdragon get burai fighter fixed.

in NstPPU.cpp

change:

NST_FORCE_INLINE void Ppu::UpdateScrollAddressLine()
{
if (io.line)
io.line.Toggle( scroll.address & 0x3FFF, cpu.GetCycles() );
}


to


NST_FORCE_INLINE void Ppu::UpdateScrollAddressLine()
{
if (io.line)
{
int a12_mask = ~((scroll.address & 0x2000) >> 1);
io.line.Toggle( (scroll.address & a12_mask) & 0x3FFF, cpu.GetCycles() );
}
}



this will fix mickeys safari in letterland, now we need to figure out burai fighter. Thanks for this code james as well james and allowing me to share! :beer:
Last edited by *Spitfire_NES* on Sun Jun 29, 2014 7:57 am, edited 1 time in total.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by tepples »

James wrote:
tepples wrote:I thought $3000 had PA12 high, just like $2000
You mean like $1000, right?
My bad.
I'm not sure what you mean by "the CHR ROM part of the board".
I might have said things wrong. Let me try again:

Some chips see accesses to $3000-$3EFF as accesses to $2000-$2EFF. Examples of this include CIRAM (the nametable memory) because PA12 isn't connected. Others see accesses to $3000-$3EFF as accesses to $1000-$1EFF (the second pattern table). Examples of this include the MMC3 itself because the TLSROM hack depends on it ignoring PA13.
In my emulator, palette writes were already not being put on the bus
If that's the issue, that would explain it. A test ROM for whether the MMC3's PIT is clocked by writes to $3000-$3EFF but not $3F00-$3FFF might help.
zxbdragon
Posts: 492
Joined: Mon Dec 12, 2011 8:15 pm

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by zxbdragon »

*Spitfire_NES* wrote:Hey zxbdragon here is one thing that james helped me with that DID fix mickey's safari in letterland but not burai fighter, maybe you can help us zxbdragon get burai fighter fixed.

in NstPPU.cpp

change:

NST_FORCE_INLINE void Ppu::UpdateScrollAddressLine()
{
if (io.line)
io.line.Toggle( scroll.address & 0x3FFF, cpu.GetCycles() );
}


to


NST_FORCE_INLINE void Ppu::UpdateScrollAddressLine()
{
if (io.line)
{
int a12_mask = ~((scroll.address & 0x2000) >> 1);
io.line.Toggle( (scroll.address & a12_mask) & 0x3FFF, cpu.GetCycles() );
}
}



this will fix mickeys safari in letterland, now we need to figure out burai fighter. Thanks for this code james as well james and allowing me to share! :beer:
thank you james and *Spitfire_NES*
*Spitfire_NES* wrote:Hey zxbdragon here is one thing that james helped me with that DID fix mickey's safari in letterland but not burai fighter, maybe you can help us zxbdragon get burai fighter fixed.

in NstPPU.cpp

change:

NST_FORCE_INLINE void Ppu::UpdateScrollAddressLine()
{
if (io.line)
io.line.Toggle( scroll.address & 0x3FFF, cpu.GetCycles() );
}


to


NST_FORCE_INLINE void Ppu::UpdateScrollAddressLine()
{
if (io.line)
{
int a12_mask = ~((scroll.address & 0x2000) >> 1);
io.line.Toggle( (scroll.address & a12_mask) & 0x3FFF, cpu.GetCycles() );
}
}



this will fix mickeys safari in letterland, now we need to figure out burai fighter. Thanks for this code james as well james and allowing me to share! :beer:
thank you james and *Spitfire_NES*
I have been concerned burai fighter,
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* »

yes, the mickeys issue and the burai fighter issue seem to be related.
User avatar
James
Posts: 429
Joined: Sat Jan 22, 2005 8:51 am
Location: Chicago, IL
Contact:

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by James »

tepples wrote:Others see accesses to $3000-$3EFF as accesses to $1000-$1EFF (the second pattern table). Examples of this include the MMC3 itself because the TLSROM hack depends on it ignoring PA13.
I still might not be following what you're saying, but all of the TLSROM (and other MMC3) games I tested seem to work fine with this fix. Do you know of any game that's dependent on this behavior?
get nemulator
http://nemulator.com
User avatar
James
Posts: 429
Joined: Sat Jan 22, 2005 8:51 am
Location: Chicago, IL
Contact:

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by James »

Was just thinking about this a bit more. I've only implemented this fix on $2006/$2007 access, not on normal accesses during rendering. So maybe this behavior only applies then...

edit: It must only apply then. The PPU doesn't access $3xxx during rendering (see Brad Taylor's 2C02 reference).
Last edited by James on Thu Jul 03, 2014 7:11 am, edited 1 time in total.
get nemulator
http://nemulator.com
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* »

James wrote:Was just thinking about this a bit more. I've only implemented this fix on $2006/$2007 access, not on normal accesses during rendering. So maybe this behavior only applies then...
is this something i need to check for on nestopia's end for james? Trying to figure out anything i can to have accurate emulation. :beer:
User avatar
James
Posts: 429
Joined: Sat Jan 22, 2005 8:51 am
Location: Chicago, IL
Contact:

Re: Nestopia and Ninja Gaiden/Burai Fighter

Post by James »

*Spitfire_NES* wrote:is this something i need to check for on nestopia's end for james? Trying to figure out anything i can to have accurate emulation. :beer:
I don't know. You should probably hold off until there is a definitive answer to how this works (which will likely involve tests on real hardware).
get nemulator
http://nemulator.com
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* »

ok will do. In the meantime i will mess around with what i have so far and see if anything turns up. Maybe someone can come along who might understand nestopia better than i and at least lend a hand to maybe help me figure out burai fighter.

thanks james! :mrgreen: :beer:
Post Reply