Ejemplo n.º 1
0
 public Memory(CPU cpu, ROM rom)
 {
     this.cpu  = cpu;
     this.mbc  = rom.MBC;
     this.rom  = rom;
     hdma      = new HDMA(this);
     wram      = new byte[8, 0x1000];
     wrambank  = 1;
     hram      = new byte[0x7F];
     Audio     = new Audio.Audio(SoundOutMode.NAudio);
     serial    = new SerialConsole();
     Interrupt = new Interrupt(cpu);
     Video     = new Video(Interrupt, hdma, rom);
     Joypad    = new Joypad(Interrupt);
     Timer     = new Timer(Interrupt);
 }
Ejemplo n.º 2
0
 public Video(Interrupt interrupt, HDMA hdma, ROM rom)
 {
     this.rom          = rom;
     this.interrupt    = interrupt;
     this.hdma         = hdma;
     vram              = new byte[2, 0x2000];
     oam               = new byte[0xA0];
     pram1             = new byte[0x40];
     pram2             = new byte[0x40];
     clock             = 0;
     monochromepalette = new Color[] {
         Color.WhiteSmoke,
         Color.FromArgb(102, 102, 102),
         Color.FromArgb(68, 68, 68),
         Color.Black
     };
     frame    = new uint[160 * 144];
     ModeFlag = 2;
     VRAMBank = 0;
 }