Пример #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);
 }