un-Revert "neshawk - change ppu poweron process (fixes time lord, breaks ? ? ?)""

This reverts commit a31492a57f.
This commit is contained in:
zeromus 2015-10-11 21:30:44 -05:00
parent 4b8c7d77ac
commit a53200d98e
2 changed files with 30 additions and 13 deletions

View File

@ -376,6 +376,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
{
Reg2002_objhit = Reg2002_objoverflow = 0;
Reg2002_vblank_clear_pending = true;
//TODO - unfreeze ppu registers after poweron
}
//OAM ADDRESS (write)

View File

@ -102,8 +102,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
{
BGDataRecord *bgdata = stackalloc BGDataRecord[34]; //one at the end is junk, it can never be rendered
//262 scanlines
if (ppudead != 0)
if(ppudead != 0)
{
FrameAdvance_ppudead();
return;
@ -128,6 +127,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
runppu(postNMIlines * kLineTime - delay);
//this seems to run just before the dummy scanline begins
//ACTUALLY. it should run 3 cycles later
clear_2002();
TempOAM* oams = stackalloc TempOAM[128];
@ -448,17 +448,33 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
void FrameAdvance_ppudead()
{
//not quite emulating all the NES power up behavior
//since it is known that the NES ignores writes to some
//register before around a full frame, but no games
//should write to those regs during that time, it needs
//to wait for vblank
ppur.status.sl = 241;
runppu(postNMIlines * kLineTime);
ppur.status.sl = 0;
runppu(241 * kLineTime);
runppu(preNMIlines * kLineTime);
--ppudead;
if (ppudead == 2)
{
//"dead frame 0:"
//run scanlines 0 through 239.
runppu(240 * kLineTime);
//ok, that was a long time. let's call it a frame
}
if (ppudead == 1)
{
//"dead frame 1:"
//run pre-nmi idle (normally 1 scanline, sometimes longer)
runppu(preNMIlines * kLineTime);
//we're at the line where NMI is triggered. it happens 1 cycle in, but we're not worrying about that now.
//well, look at that. its time to begin the next frame in the normal FrameAdvance method
//this frame wasn't very long compared to the other one. oh well
//we need to keep 2 dead frames to keep from ruining old movies..
//i hope the basic timing changes doesnt wreck anything's logic.
}
ppudead--;
}
}
}