Beispiel #1
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);
            }
        }
Beispiel #2
0
 public DynamicMemoryByteProvider(DMGBoard b)
 {
     B   = b;
     mmu = b.GetMemoryManagementUnit();
 }