Page 2 of 8
Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Sat Jun 28, 2014 2:20 pm
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
Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Sun Jun 29, 2014 6:16 am
by zxbdragon
in nemu...
fixed is
if(address & 0x1000)
irq.address =4;===>irq.address =8;
?
Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Sun Jun 29, 2014 7:07 am
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...)
Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Sun Jun 29, 2014 7:13 am
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?
Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Sun Jun 29, 2014 7:19 am
by James
zxbdragon wrote:you update ppu or mmc3 irq?
PPU
Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Sun Jun 29, 2014 7:43 am
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 ?
Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Sun Jun 29, 2014 7:47 am
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!

Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Sun Jun 29, 2014 7:51 am
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.
Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Sun Jun 29, 2014 8:17 am
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!

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!

thank you james and *Spitfire_NES*
I have been concerned burai fighter,
Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Sun Jun 29, 2014 8:45 am
by *Spitfire_NES*
yes, the mickeys issue and the burai fighter issue seem to be related.
Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Sun Jun 29, 2014 3:54 pm
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?
Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Mon Jun 30, 2014 9:24 am
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).
Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Mon Jun 30, 2014 10:37 am
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.

Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Mon Jun 30, 2014 11:04 am
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.

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).
Re: Nestopia and Ninja Gaiden/Burai Fighter
Posted: Wed Jul 02, 2014 7:51 pm
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!
