示例#1
0
        private void CmDissassembly_MouseClick(object sender, MouseEventArgs e)
        {
            int pc = LineToAddress[mouseOnLine];

            executeing = true;

            while (pc != GameState.CPU.PC && executeing)
            {
                cycles += GameState.CPU.Execute();

                if (cycles >= PPU.CyclesPerLine)
                {
                    PPU.RenderLine();
                    if (PPU.Scanline == 241 && PPU.VblankNMIEnabled)
                    {
                        GameState.CPU.NMI();
                    }
                    cycles = 0;
                }
            }

            executeing = false;

            Step();
        }
示例#2
0
        private void BtnReset_Click(object sender, EventArgs e)
        {
            GameState.CPU.Reset();
            PPU.Reset();

            Step();
        }
示例#3
0
        private void RunOneLine()
        {
            while (cycles < PPU.CyclesPerLine)
            {
                cycles += GameState.CPU.Execute();
            }
            if (PPU.Scanline == 241 && PPU.VblankNMIEnabled)
            {
                GameState.CPU.NMI();
            }

            cycles = 0;

            PPU.RenderLine();
        }
示例#4
0
        private void BtnStep_Click(object sender, EventArgs e)
        {
            cycles += GameState.CPU.Execute();

            if (cycles >= PPU.CyclesPerLine)
            {
                PPU.RenderLine();
                if (PPU.Scanline == 241 && PPU.VblankNMIEnabled)
                {
                    GameState.CPU.NMI();
                }
                cycles = 0;
            }

            Step();
        }
示例#5
0
 public void CPUWrite(byte d, int address)
 {
     if (address >= 0x8000)
     {
         CPUWriteExt(d, address);
     }
     else if (address >= 0x6000)
     {
         address        &= 0x3FFF;
         PRGRam[address] = d;
     }
     else if (address < 0x800)
     {
         CPURam[address & 0x7FF] = d;
     }
     else if (address >= 0x2000 && address <= 0x2007 || address == 0x4014)
     {
         PPU.Write(address, d);
     }
 }
示例#6
0
 public byte CPURead(int address)
 {
     if (address >= 0x8000)
     {
         return(CPUReadExt(address));
     }
     else if (address >= 0x6000)
     {
         address &= 0x1FFF;
         return(PRGRam[address]);
     }
     else if (address < 0x800)
     {
         return(CPURam[address & 0x7FF]);
     }
     else if (address >= 0x2000 && address <= 0x2007)
     {
         return(PPU.Read(address));
     }
     return(0xFF);
 }