NESHawk: VRAM write timing glitch
This commit is contained in:
parent
0fad2495d1
commit
69fe1bdf97
|
@ -346,6 +346,7 @@ sha1:D89EE629F8F60613999EAD84A3C7B2F6B38C399F fme7ramtest_128k NES board=MAPPE
|
|||
sha1:78C4441E42C8F423EBF6558AA00AB6D0DBCC2B4B 34_test_1 NES board=AVE-NINA-01;PRG=64;CHR=64;WRAM=8;VRAM=0;PAD_V=1;PAD_H=0
|
||||
sha1:F2D5CB78D78831CB6A2A17CD418A753F3C99C7F4 34_test_2 NES board=NES-BNROM;PRG=256;CHR=0;WRAM=8;VRAM=8;PAD_V=1;PAD_H=0
|
||||
sha1:77C5C2473AF13003B7BD8273A5E23BE4964107A3 M34_P128K_H NES board=AVE-NINA-07;PRG=128;CHR=0;WRAM=0;VRAM=8;PAD_V=1;PAD_H=0
|
||||
sha1:B6721E1C1EC2E2F215180ED7BB31EDA80BCDE869 2nd2006_next_level NES board=MAPPER000;PRG=16;CHR=8;PAD_V=1;PAD_H=0
|
||||
|
||||
;other
|
||||
sha1:4180276C50DF9958DEDD6C6D19C9E7AEBB75A89F o Galaxian (Japan) NES board=NAMCOT-3301;PRG=16;CHR=8;WRAM=8;VRAM=0;PAD_V=1;PAD_H=0
|
||||
|
|
|
@ -185,6 +185,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502
|
|||
case 0xAE: bytesToAdvance = 3; return string.Format("LDX ${0:X4}", peeker_word(++pc, peeker));
|
||||
case 0xB0: bytesToAdvance = 2; return string.Format("BCS ${0:X4}", pc + 2 + (sbyte)peeker(++pc));
|
||||
case 0xB1: bytesToAdvance = 2; return string.Format("LDA (${0:X2}),Y *", peeker(++pc));
|
||||
case 0xB3: bytesToAdvance = 2; return string.Format("LAX (${0:X2}),Y *", peeker(++pc));
|
||||
case 0xB4: bytesToAdvance = 2; return string.Format("LDY ${0:X2},X", peeker(++pc));
|
||||
case 0xB5: bytesToAdvance = 2; return string.Format("LDA ${0:X2},X", peeker(++pc));
|
||||
case 0xB6: bytesToAdvance = 2; return string.Format("LDX ${0:X2},Y", peeker(++pc));
|
||||
|
@ -203,6 +204,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502
|
|||
case 0xC8: bytesToAdvance = 1; return "INY";
|
||||
case 0xC9: bytesToAdvance = 2; return string.Format("CMP #${0:X2}", peeker(++pc));
|
||||
case 0xCA: bytesToAdvance = 1; return "DEX";
|
||||
case 0xCB: bytesToAdvance = 2; return string.Format("AXS ${0:X2}", peeker(++pc));
|
||||
case 0xCC: bytesToAdvance = 3; return string.Format("CPY ${0:X4}", peeker_word(++pc, peeker));
|
||||
case 0xCD: bytesToAdvance = 3; return string.Format("CMP ${0:X4}", peeker_word(++pc, peeker));
|
||||
case 0xCE: bytesToAdvance = 3; return string.Format("DEC ${0:X4}", peeker_word(++pc, peeker));
|
||||
|
|
|
@ -600,6 +600,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Fetch1_Real();
|
||||
}
|
||||
|
||||
|
@ -2971,8 +2972,6 @@ namespace BizHawk.Emulation.Cores.Components.M6502
|
|||
TotalExecutedCycles++;
|
||||
if (!rdy_freeze)
|
||||
{
|
||||
|
||||
|
||||
interrupt_pending |= Interrupted;
|
||||
}
|
||||
rdy_freeze = false;
|
||||
|
|
|
@ -112,7 +112,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
break;
|
||||
|
||||
case 0xFF4F: // VBK
|
||||
if (is_GBC)
|
||||
if (GBC_compat)
|
||||
{
|
||||
ret = VRAM_Bank;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
case 0xFF69:
|
||||
case 0xFF6A:
|
||||
case 0xFF6B:
|
||||
if (is_GBC)
|
||||
if (GBC_compat)
|
||||
{
|
||||
ret = ppu.ReadReg(addr);
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
|
||||
// VBK
|
||||
case 0xFF4F:
|
||||
if (is_GBC && !ppu.HDMA_active)
|
||||
if (GBC_compat && !ppu.HDMA_active)
|
||||
{
|
||||
VRAM_Bank = (byte)(value & 1);
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
case 0xFF69:
|
||||
case 0xFF6A:
|
||||
case 0xFF6B:
|
||||
if (is_GBC)
|
||||
if (GBC_compat)
|
||||
{
|
||||
ppu.WriteReg(addr, value);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using BizHawk.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||
|
@ -131,7 +130,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
return sum >= 2000;
|
||||
}
|
||||
|
||||
|
||||
//when the ppu issues a write it goes through here and into the game board
|
||||
public void ppubus_write(int addr, byte value)
|
||||
{
|
||||
|
@ -236,6 +234,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
ser.Sync("spriteHeight", ref spriteHeight);
|
||||
ser.Sync("install_2006", ref install_2006);
|
||||
ser.Sync("race_2006", ref race_2006);
|
||||
ser.Sync("race_2006_2", ref race_2006_2);
|
||||
ser.Sync("install_2001", ref install_2001);
|
||||
ser.Sync("show_bg_new", ref show_bg_new);
|
||||
ser.Sync("show_obj_new", ref show_obj_new);
|
||||
|
@ -270,6 +269,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
ser.Sync("do_pre_vbl", ref do_pre_vbl);
|
||||
|
||||
ser.Sync("nmi_destiny", ref nmi_destiny);
|
||||
ser.Sync("evenOddDestiny", ref evenOddDestiny);
|
||||
ser.Sync("NMI_offset", ref NMI_offset);
|
||||
ser.Sync("yp_shift", ref yp_shift);
|
||||
ser.Sync("sprite_eval_cycle", ref sprite_eval_cycle);
|
||||
ser.Sync("xt", ref xt);
|
||||
|
@ -278,7 +279,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
ser.Sync("rasterpos", ref rasterpos);
|
||||
ser.Sync("renderspritenow", ref renderspritenow);
|
||||
ser.Sync("renderbgnow", ref renderbgnow);
|
||||
ser.Sync("hit_pending", ref hit_pending);
|
||||
ser.Sync("s", ref s);
|
||||
ser.Sync("ppu_aux_index", ref ppu_aux_index);
|
||||
ser.Sync("junksprite", ref junksprite);
|
||||
|
@ -332,13 +332,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
{
|
||||
//run one ppu cycle at a time so we can interact with the ppu and clockPPU at high granularity
|
||||
|
||||
race_2006 = false;
|
||||
|
||||
if (install_2006>0)
|
||||
{
|
||||
install_2006--;
|
||||
if (install_2006==0)
|
||||
{
|
||||
ppur.install_latches();
|
||||
if (!race_2006) { ppur.install_latches(); }
|
||||
else { race_2006_2 = true; }
|
||||
|
||||
//nes.LogLine("addr wrote vt = {0}, ht = {1}", ppur._vt, ppur._ht);
|
||||
//normally the address isnt observed by the board till it gets clocked by a read or write.
|
||||
|
@ -347,11 +348,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
//ONLY if the ppu is not rendering
|
||||
if (ppur.status.sl >= 241 || !PPUON)
|
||||
nes.Board.AddressPPU(ppur.get_2007access());
|
||||
|
||||
race_2006 = true;
|
||||
}
|
||||
}
|
||||
|
||||
race_2006 = false;
|
||||
|
||||
if (install_2001 > 0)
|
||||
{
|
||||
install_2001--;
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
using System;
|
||||
using BizHawk.Common;
|
||||
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||
{
|
||||
sealed partial class PPU
|
||||
|
@ -307,6 +306,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
public Reg_2000 reg_2000;
|
||||
public Reg_2001 reg_2001;
|
||||
byte reg_2003;
|
||||
public byte reg_2006_2;
|
||||
|
||||
void regs_reset()
|
||||
{
|
||||
|
@ -450,12 +450,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
{
|
||||
OAM[reg_2003] = value;
|
||||
reg_2003++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
byte read_2004()
|
||||
{
|
||||
byte ret;
|
||||
Console.WriteLine("read 2004");
|
||||
// behaviour depends on whether things are being rendered or not
|
||||
if (PPUON)
|
||||
{
|
||||
|
@ -526,6 +527,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
ppur._v = (value >> 3) & 1;
|
||||
ppur._fv = (value >> 4) & 3;
|
||||
//nes.LogLine("addr wrote fv = {0}", ppur._fv);
|
||||
reg_2006_2 = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -534,13 +536,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
ppur._ht = value & 31;
|
||||
|
||||
// testing indicates that this operation is delayed by 3 pixels
|
||||
// ppur.install_latches();
|
||||
|
||||
//ppur.install_latches();
|
||||
install_2006 = 3;
|
||||
}
|
||||
|
||||
vtoggle ^= true;
|
||||
|
||||
}
|
||||
byte read_2006() { return ppu_open_bus; }
|
||||
byte peek_2006() { return ppu_open_bus; }
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
//TODO - correctly emulate PPU OFF state
|
||||
|
||||
using System;
|
||||
using BizHawk.Common;
|
||||
using BizHawk.Common.NumberExtensions;
|
||||
using System;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
|
||||
// installing vram address is delayed after second write to 2006, set this up here
|
||||
public int install_2006;
|
||||
public bool race_2006;
|
||||
public bool race_2006, race_2006_2;
|
||||
public int install_2001;
|
||||
public bool show_bg_new; //Show background
|
||||
public bool show_obj_new; //Show sprites
|
||||
|
@ -62,20 +62,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
// attempt to emulate graphics pipeline behaviour
|
||||
// experimental
|
||||
int pixelcolor_latch_1;
|
||||
int pixelcolor_latch_2;
|
||||
|
||||
void pipeline(int pixelcolor, int row_check)
|
||||
{
|
||||
if (row_check > 1)
|
||||
if (row_check > 0)
|
||||
{
|
||||
if (reg_2001.color_disable)
|
||||
pixelcolor_latch_2 &= 0x30;
|
||||
pixelcolor_latch_1 &= 0x30;
|
||||
|
||||
//TODO - check flashing sirens in werewolf
|
||||
//tack on the deemph bits. THESE MAY BE ORDERED WRONG. PLEASE CHECK IN THE PALETTE CODE
|
||||
xbuf[(target - 2)] = (short)(pixelcolor_latch_2 | reg_2001.intensity_lsl_6);
|
||||
xbuf[(target - 1)] = (short)(pixelcolor_latch_1 | reg_2001.intensity_lsl_6);
|
||||
}
|
||||
|
||||
pixelcolor_latch_2 = pixelcolor_latch_1;
|
||||
|
||||
pixelcolor_latch_1 = pixelcolor;
|
||||
}
|
||||
|
||||
|
@ -125,6 +124,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
public bool do_pre_vbl;
|
||||
|
||||
bool nmi_destiny;
|
||||
bool evenOddDestiny;
|
||||
static int start_up_offset = 2;
|
||||
int NMI_offset;
|
||||
int yp_shift;
|
||||
int sprite_eval_cycle;
|
||||
int xt;
|
||||
|
@ -133,7 +135,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
int rasterpos;
|
||||
bool renderspritenow;
|
||||
bool renderbgnow;
|
||||
bool hit_pending;
|
||||
int s;
|
||||
int ppu_aux_index;
|
||||
bool junksprite;
|
||||
|
@ -148,24 +149,41 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
ppur.status.cycle = 0;
|
||||
|
||||
// These things happen at the start of every frame
|
||||
|
||||
Reg2002_vblank_active_pending = true;
|
||||
//Reg2002_vblank_active = true;
|
||||
//Reg2002_vblank_active_pending = true;
|
||||
ppuphase = PPUPHASE.VBL;
|
||||
bgdata = new BGDataRecord[34];
|
||||
}
|
||||
|
||||
public void TickPPU_VBL()
|
||||
{
|
||||
if (ppur.status.cycle == 3 && ppur.status.sl == 241 + preNMIlines)
|
||||
if (ppur.status.cycle == 0 && ppur.status.sl == 241 + preNMIlines)
|
||||
{
|
||||
nmi_destiny = reg_2000.vblank_nmi_gen && Reg2002_vblank_active;
|
||||
if (cpu_stepcounter == 2) { NMI_offset = 1; }
|
||||
else if (cpu_stepcounter == 1) { NMI_offset = 2; }
|
||||
else { NMI_offset = 0; }
|
||||
}
|
||||
else if (ppur.status.cycle == 6 && ppur.status.sl == 241 + preNMIlines)
|
||||
else if (ppur.status.cycle <= 2 && nmi_destiny)
|
||||
{
|
||||
nmi_destiny &= reg_2000.vblank_nmi_gen && Reg2002_vblank_active;
|
||||
}
|
||||
else if (ppur.status.cycle == (3 + NMI_offset) && ppur.status.sl == 241 + preNMIlines)
|
||||
{
|
||||
if (nmi_destiny) { nes.cpu.NMI = true; }
|
||||
nes.Board.AtVsyncNMI();
|
||||
}
|
||||
|
||||
if (ppur.status.cycle == 340)
|
||||
{
|
||||
if (ppur.status.sl == 241 + preNMIlines + postNMIlines - 1)
|
||||
{
|
||||
Reg2002_vblank_clear_pending = true;
|
||||
idleSynch ^= true;
|
||||
Reg2002_objhit = Reg2002_objoverflow = 0;
|
||||
}
|
||||
}
|
||||
|
||||
runppu(); // note cycle ticks inside runppu
|
||||
|
||||
if (ppur.status.cycle == 341)
|
||||
|
@ -174,10 +192,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
ppur.status.sl++;
|
||||
if (ppur.status.sl == 241 + preNMIlines + postNMIlines)
|
||||
{
|
||||
Reg2002_objhit = Reg2002_objoverflow = 0;
|
||||
Reg2002_vblank_clear_pending = true;
|
||||
idleSynch ^= true;
|
||||
|
||||
do_vbl = false;
|
||||
ppur.status.sl = 0;
|
||||
}
|
||||
|
@ -232,8 +246,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
|
||||
//check all the conditions that can cause things to render in these 8px
|
||||
renderspritenow = show_obj_new && (xt > 0 || reg_2001.show_obj_leftmost);
|
||||
hit_pending = false;
|
||||
|
||||
}
|
||||
|
||||
if (ppur.status.cycle < 256)
|
||||
|
@ -332,8 +344,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
{
|
||||
if (yp >= read_value && yp < read_value + spriteHeight && PPUON)
|
||||
{
|
||||
hit_pending = true;
|
||||
//Reg2002_objoverflow = true;
|
||||
Reg2002_objoverflow = true;
|
||||
}
|
||||
|
||||
if (yp >= read_value && yp < read_value + spriteHeight && spr_true_count == 0)
|
||||
|
@ -379,30 +390,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
// due to the cpu not running while the sprite renders below
|
||||
if (PPUON) { Read_bgdata(xp, ref bgdata[xt + 2]); }
|
||||
|
||||
runppu();
|
||||
|
||||
if (PPUON && xp == 6)
|
||||
{
|
||||
ppu_was_on = true;
|
||||
}
|
||||
|
||||
if (PPUON && xp == 7)
|
||||
{
|
||||
if (!race_2006)
|
||||
ppur.increment_hsc();
|
||||
|
||||
if (ppur.status.cycle == 256 && !race_2006)
|
||||
ppur.increment_vs();
|
||||
|
||||
ppu_was_on = false;
|
||||
}
|
||||
|
||||
if (hit_pending)
|
||||
{
|
||||
hit_pending = false;
|
||||
Reg2002_objoverflow = true;
|
||||
}
|
||||
|
||||
renderbgnow = show_bg_new && (xt > 0 || reg_2001.show_bg_leftmost);
|
||||
//bg pos is different from raster pos due to its offsetability.
|
||||
//so adjust for that here
|
||||
|
@ -467,14 +454,53 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
}
|
||||
} //oamcount loop
|
||||
|
||||
runppu();
|
||||
|
||||
if (PPUON && xp == 6)
|
||||
{
|
||||
ppu_was_on = true;
|
||||
if (ppur.status.cycle == 255) { race_2006 = true; }
|
||||
}
|
||||
|
||||
if (PPUON && xp == 7)
|
||||
{
|
||||
ppur.increment_hsc();
|
||||
|
||||
if (ppur.status.cycle == 256)
|
||||
{
|
||||
ppur.increment_vs();
|
||||
}
|
||||
|
||||
if (race_2006_2)
|
||||
{
|
||||
if (ppur.status.cycle == 256)
|
||||
{
|
||||
ppur.fv &= ppur._fv;
|
||||
ppur.v &= ppur._v;
|
||||
ppur.h &= ppur._h;
|
||||
ppur.vt &= ppur._vt;
|
||||
ppur.ht &= ppur._ht;
|
||||
}
|
||||
else
|
||||
{
|
||||
ppur.fv = ppur._fv;
|
||||
ppur.v = ppur._v;
|
||||
ppur.h &= ppur._h;
|
||||
ppur.vt = ppur._vt;
|
||||
ppur.ht &= ppur._ht;
|
||||
}
|
||||
}
|
||||
|
||||
ppu_was_on = false;
|
||||
}
|
||||
|
||||
race_2006_2 = false;
|
||||
|
||||
pipeline(pixelcolor, xt * 8 + xp);
|
||||
target++;
|
||||
|
||||
// clear out previous sprites from scanline buffer
|
||||
//sl_sprites[xt * 8 + xp] = 0;
|
||||
sl_sprites[256 + xt * 8 + xp] = 0;
|
||||
//sl_sprites[512 + xt * 8 + xp] = 0;
|
||||
|
||||
// end of visible part of the scanline
|
||||
sprite_eval_cycle++;
|
||||
|
@ -494,9 +520,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
|
||||
//check all the conditions that can cause things to render in these 8px
|
||||
renderspritenow = show_obj_new && (xt > 0 || reg_2001.show_obj_leftmost);
|
||||
hit_pending = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -508,19 +532,44 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
if (PPUON && xp == 6)
|
||||
{
|
||||
ppu_was_on = true;
|
||||
if (ppur.status.cycle == 255) { race_2006 = true; }
|
||||
|
||||
}
|
||||
|
||||
if (PPUON && xp == 7)
|
||||
{
|
||||
if (!race_2006)
|
||||
ppur.increment_hsc();
|
||||
ppur.increment_hsc();
|
||||
|
||||
if (ppur.status.cycle == 256 && !race_2006)
|
||||
if (ppur.status.cycle == 256)
|
||||
{
|
||||
ppur.increment_vs();
|
||||
}
|
||||
|
||||
if(race_2006_2)
|
||||
{
|
||||
if (ppur.status.cycle == 256)
|
||||
{
|
||||
ppur.fv &= ppur._fv;
|
||||
ppur.v &= ppur._v;
|
||||
ppur.h &= ppur._h;
|
||||
ppur.vt &= ppur._vt;
|
||||
ppur.ht &= ppur._ht;
|
||||
}
|
||||
else
|
||||
{
|
||||
ppur.fv = ppur._fv;
|
||||
ppur.v = ppur._v;
|
||||
ppur.h &= ppur._h;
|
||||
ppur.vt = ppur._vt;
|
||||
ppur.ht &= ppur._ht;
|
||||
}
|
||||
}
|
||||
|
||||
ppu_was_on = false;
|
||||
}
|
||||
|
||||
race_2006_2 = false;
|
||||
|
||||
xp++;
|
||||
|
||||
if (xp == 8)
|
||||
|
@ -625,35 +674,40 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
|
||||
if (target <= 61441 && target > 0 && s == 0)
|
||||
{
|
||||
pipeline(0, 256);
|
||||
pipeline(0, 256); // last pipeline call option 1 of 2
|
||||
target++;
|
||||
}
|
||||
|
||||
//at 257: 3d world runner is ugly if we do this at 256
|
||||
if (PPUON) ppur.install_h_latches();
|
||||
if (PPUON/* && !race_2006_2*/) { ppur.install_h_latches(); }
|
||||
race_2006_2 = false;
|
||||
read_value = t_oam[s].oam_ind;
|
||||
runppu();
|
||||
|
||||
/*
|
||||
if (target <= 61441 && target > 0 && s == 0)
|
||||
{
|
||||
pipeline(0, 257); // last pipeline call option 1 of 2
|
||||
//pipeline(0, 257);
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
if (target <= 61441 && target > 0 && s == 0)
|
||||
{
|
||||
pipeline(0, 256);
|
||||
pipeline(0, 256); // last pipeline call option 2 of 2
|
||||
target++;
|
||||
}
|
||||
|
||||
read_value = t_oam[s].oam_ind;
|
||||
runppu();
|
||||
|
||||
/*
|
||||
if (target <= 61441 && target > 0 && s == 0)
|
||||
{
|
||||
pipeline(0, 257); // last pipeline call option 2 of 2
|
||||
//pipeline(0, 257);
|
||||
}
|
||||
*/
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -910,12 +964,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
}
|
||||
else if (ppur.status.cycle < 340)
|
||||
{
|
||||
if (ppur.status.cycle == 339)
|
||||
{
|
||||
evenOddDestiny = PPUON;
|
||||
}
|
||||
|
||||
runppu();
|
||||
}
|
||||
else
|
||||
{
|
||||
bool evenOddDestiny = PPUON;
|
||||
|
||||
// After memory access 170, the PPU simply rests for 4 cycles (or the
|
||||
// equivelant of half a memory access cycle) before repeating the whole
|
||||
// pixel/scanline rendering process. If the scanline being rendered is the very
|
||||
|
@ -941,6 +998,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
|
||||
public void TickPPU_preVBL()
|
||||
{
|
||||
if (ppur.status.cycle == 340)
|
||||
{
|
||||
Reg2002_vblank_active_pending = true;
|
||||
}
|
||||
|
||||
runppu();
|
||||
|
||||
if (ppur.status.cycle == 341)
|
||||
|
@ -961,9 +1023,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
//to wait for vblank
|
||||
public void NewDeadPPU()
|
||||
{
|
||||
if (ppur.status.cycle == 241 * 341 - start_up_offset - 1)
|
||||
{
|
||||
Reg2002_vblank_active_pending = true;
|
||||
}
|
||||
|
||||
runppu();
|
||||
|
||||
if (ppur.status.cycle == 241 * 341 - 3)
|
||||
if (ppur.status.cycle == 241 * 341 - start_up_offset)
|
||||
{
|
||||
ppudead--;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue