示例#1
0
        public static void SetGameSpecificOverscan(bool overrideOverscan, UInt32 top, UInt32 bottom, UInt32 left, UInt32 right)
        {
            RomInfo romInfo = InteropEmu.GetRomInfo();

            if (romInfo.PrgCrc32 == 0)
            {
                return;
            }

            GameSpecificInfo existingConfig = ConfigManager.Config.GameSpecificSettings.Find(gameConfig => gameConfig.GamePrgCrc32 == romInfo.GetPrgCrcString());

            if (overrideOverscan || existingConfig != null)
            {
                //Only add if the config already exists, or if override setting is turned on
                GameSpecificInfo info = existingConfig ?? new GameSpecificInfo();
                info.GameName         = romInfo.GetRomName();
                info.GamePrgCrc32     = romInfo.GetPrgCrcString();
                info.OverrideOverscan = overrideOverscan;
                info.OverscanTop      = top;
                info.OverscanBottom   = bottom;
                info.OverscanLeft     = left;
                info.OverscanRight    = right;

                if (existingConfig == null)
                {
                    ConfigManager.Config.GameSpecificSettings.Add(info);
                }
            }
        }
示例#2
0
 public static void AddGameSpecificConfig(GameSpecificInfo info)
 {
     if (!ConfigManager.Config.GameSpecificSettings.Contains(info))
     {
         ConfigManager.Config.GameSpecificSettings.Add(info);
     }
 }
示例#3
0
        public static GameSpecificInfo GetGameSpecificInfo()
        {
            RomInfo          romInfo        = InteropEmu.GetRomInfo();
            GameSpecificInfo existingConfig = ConfigManager.Config.GameSpecificSettings.Find(gameConfig => gameConfig.GamePrgCrc32 == romInfo.GetPrgCrcString());

            return(existingConfig);
        }
示例#4
0
        public static GameSpecificInfo CreateGameSpecificConfig()
        {
            RomInfo          romInfo = InteropEmu.GetRomInfo();
            GameSpecificInfo info    = new GameSpecificInfo();

            info.GameName     = romInfo.GetRomName();
            info.GamePrgCrc32 = romInfo.GetPrgCrcString();
            return(info);
        }
示例#5
0
        static public void ApplyOverscanConfig()
        {
            GameSpecificInfo gameSpecificInfo = GameSpecificInfo.GetGameSpecificInfo();

            if (gameSpecificInfo != null && gameSpecificInfo.OverrideOverscan)
            {
                InteropEmu.SetOverscanDimensions(gameSpecificInfo.OverscanLeft, gameSpecificInfo.OverscanRight, gameSpecificInfo.OverscanTop, gameSpecificInfo.OverscanBottom);
            }
            else
            {
                VideoInfo videoInfo = ConfigManager.Config.VideoInfo;
                InteropEmu.SetOverscanDimensions(videoInfo.OverscanLeft, videoInfo.OverscanRight, videoInfo.OverscanTop, videoInfo.OverscanBottom);
            }
        }
示例#6
0
        public static void SetDipswitches(UInt32 dipswitches)
        {
            GameSpecificInfo existingConfig = GetGameSpecificInfo();

            if (existingConfig != null)
            {
                existingConfig.DipSwitches = dipswitches;
            }
            else
            {
                GameSpecificInfo info = new GameSpecificInfo();
                info.DipSwitches = dipswitches;
                ConfigManager.Config.GameSpecificSettings.Add(info);
            }
            ApplyGameSpecificConfig();

            ConfigManager.ApplyChanges();
        }
示例#7
0
        public static void ApplyGameSpecificConfig()
        {
            GameSpecificInfo existingConfig = GetGameSpecificInfo();

            if (existingConfig != null)
            {
                InteropEmu.SetDipSwitches(existingConfig.DipSwitches);
            }
            else
            {
                GameDipswitchDefinition dipswitchDefinition = GameDipswitchDefinition.GetDipswitchDefinition();
                if (dipswitchDefinition != null)
                {
                    InteropEmu.SetDipSwitches(dipswitchDefinition.DefaultDipSwitches);
                }
                else
                {
                    InteropEmu.SetDipSwitches(0);
                }
            }
        }