Esempio n. 1
0
        public Gpu(IDisplay display, InterruptManager interruptManager, Dma dma, Ram oamRam, bool gbc)
        {
            _r                = new MemoryRegisters(GpuRegister.Values().ToArray());
            _lcdc             = new Lcdc();
            _interruptManager = interruptManager;
            _gbc              = gbc;
            _videoRam0        = new Ram(0x8000, 0x2000);
            _videoRam1        = gbc ? new Ram(0x8000, 0x2000) : null;
            _oamRam           = oamRam;
            _dma              = dma;

            _bgPalette  = new ColorPalette(0xff68);
            _oamPalette = new ColorPalette(0xff6a);
            _oamPalette.FillWithFf();

            _oamSearchPhase     = new OamSearch(oamRam, _lcdc, _r);
            _pixelTransferPhase = new PixelTransfer(_videoRam0, _videoRam1, oamRam, display, _lcdc, _r, gbc, _bgPalette,
                                                    _oamPalette);
            _hBlankPhase = new HBlankPhase();
            _vBlankPhase = new VBlankPhase();

            _mode  = Mode.OamSearch;
            _phase = _oamSearchPhase.Start();

            _display = display;
        }
Esempio n. 2
0
 public Fetcher(IPixelFifo fifo, IAddressSpace videoRam0, IAddressSpace videoRam1, IAddressSpace oemRam, Lcdc lcdc,
                MemoryRegisters registers, bool gbc)
 {
     _gbc       = gbc;
     _fifo      = fifo;
     _videoRam0 = videoRam0;
     _videoRam1 = videoRam1;
     _oemRam    = oemRam;
     _r         = registers;
     _lcdc      = lcdc;
 }