Example #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;
        }
Example #2
0
 public void PixelTransfer(PixelTransfer pname, int param)
 {
     gl.glPixelTransferi((int)pname, param);
     CheckException();
 }
Example #3
0
 public static void PixelTransfer(PixelTransfer pname, int param)
 {
     gl.glPixelTransferi((int)pname, param);
 }
Example #4
0
 public static void PixelTransfer(PixelTransfer pname, float param)
 {
     gl.glPixelTransferf((int)pname, param);
 }