Пример #1
0
 public InterruptService(DMGCPU dmgcpu) : base(dmgcpu)
 {
     for (int i = 0; i <= 0x1F; i++)
     {
         if ((i & 0x10) == 0x10)
         {
             IRQLookup[i] = 4;
         }
         if ((i & 0x8) == 0x8)
         {
             IRQLookup[i] = 3;
         }
         if ((i & 0x4) == 0x4)
         {
             IRQLookup[i] = 2;
         }
         if ((i & 0x2) == 0x2)
         {
             IRQLookup[i] = 1;
         }
         if ((i & 0x1) == 0x1)
         {
             IRQLookup[i] = 0;
         }
         if (i == 0)
         {
             IRQLookup[i] = -1;
         }
     }
     Board     = dmgcpu.GetBoard();
     Memory    = Board.GetMemoryManagementUnit();
     Registers = dmgcpu.Registers;
 }
Пример #2
0
        public Registers(DMGCPU dmgcpu) : base(dmgcpu)
        {
            //Program Counter begins at 0x100
            PC = 0x100;

            //Stack pointer starts from FFFE
            SP = 0xFFFE;

            AF = new RegPair {
                Both = 0x0100
            };
            BC = new RegPair {
                Both = 0xFF13
            };
            DE = new RegPair {
                Both = 0x00C1
            };
            HL = new RegPair {
                Both = 0x8403
            };
        }
Пример #3
0
        public Debugger(DMGBoard b)
        {
            InitializeComponent();

            disassembler.RetrieveVirtualItem += Debug_RetrieveVirtualItem;
            disassembler.DoubleBuffered(true);

            StackView.RetrieveVirtualItem += Stack_RetrieveVirtualItem;

            Shown += Debugger_Shown;

            KeyPreview = true;
            KeyDown   += new KeyEventHandler(Debugger_KeyDown);


            hexBox1.ByteProvider = new DynamicMemoryByteProvider(b);
            hexBox1.Width        = hexBox1.RequiredWidth + 20;


            labels = new List <Symbol.Label>();
            Board  = b;
            Memory = b.GetMemoryManagementUnit();
            CPU    = (DMGCPU)b.CPU;
            PPU    = (DMGPPU)b.PPU;
            cart   = (Cartridge)b.GetComponents()[0];


            String symbolPath = Path.GetDirectoryName(cart.GetRomPath()) + '\\' + Path.GetFileNameWithoutExtension(cart.GetRomPath()) + ".sym";

            labels = symbol_loader(symbolPath);

            disasm     = new Disassembler(CPU);
            assemblies = disasm.Disassemble();
            disassembler.VirtualListSize = assemblies.Count + 0x8000;

            foreach (Components.Component c in Board.GetComponents())
            {
                componentList.Items.Add(c.GetType().Name);
            }
        }
 public ArithmeticLogicUnit(DMGCPU dmgcpu) : base(dmgcpu)
 {
     Registers = dmgcpu.Registers;
 }
Пример #5
0
 public Disassembler(DMGCPU dmg)
 {
     cpu    = dmg;
     Memory = dmg.GetBoard().GetMemoryManagementUnit();
 }
Пример #6
0
 public void SetCPU(DMGCPU cpu)
 {
     this.cpu = cpu;
 }
Пример #7
0
 public Unit(DMGCPU cpu)
 {
     this.cpu = cpu;
 }