예제 #1
0
파일: CrispyEmu.cs 프로젝트: Monczak/Crispy
        private void LoadConfig()
        {
            try
            {
                Config config = ConfigReader.Read("Config.json");

                cyclesPerSecond       = config.CyclesPerSecond;
                timerUpdatesPerSecond = config.TimerUpdatesPerSecond;
                rewindBufferSize      = config.RewindBufferSize;
                rewindFrequency       = config.RewindFrequency;
                savestateSlots        = config.SavestateSlots;

                offColor = ColorTranslator.FromHexString(config.OffColor);
                onColor  = ColorTranslator.FromHexString(config.OnColor);
            }
            catch (Exception)
            {
                ConfigReader.Save("Config.json", new Config());

                onColor  = ColorTranslator.FromHexString("#414234");
                offColor = ColorTranslator.FromHexString("#bac2ac");
            }
        }