Example #1
0
        public void Restart()
        {
            if (Global.Emulator is Gameboy)
            {
                _gb   = Global.Emulator as Gameboy;
                _cgb  = _gb.IsCGBMode();
                _lcdc = 0;
                if (!_gb.GetGPUMemoryAreas(out _vram, out _bgpal, out _sppal, out _oam))
                {
                    _gb = null;
                    if (Visible)
                    {
                        Close();
                    }
                }
                tilespal = _bgpal;

                if (_cgb)
                {
                    label4.Enabled = true;
                }
                else
                {
                    label4.Enabled = false;
                }
                bmpViewBG.Clear();
                bmpViewWin.Clear();
                bmpViewTiles1.Clear();
                bmpViewTiles2.Clear();
                bmpViewBGPal.Clear();
                bmpViewSPPal.Clear();
                bmpViewOAM.Clear();
                bmpViewDetails.Clear();
                bmpViewMemory.Clear();
                cbscanline_emu = -4;                 // force refresh
            }
            else
            {
                _gb = null;
                if (Visible)
                {
                    Close();
                }
            }
        }