Exemple #1
0
 public static void ApplyDebuggerConfig()
 {
     SnesConfigApi.SetDebuggerFlag(SnesDebuggerFlags.BreakOnBrk, true);
     //ConfigApi.SetDebuggerFlag(SnesDebuggerFlags.BreakOnCop, BreakOnCop);
     //ConfigApi.SetDebuggerFlag(SnesDebuggerFlags.BreakOnWdm, BreakOnWdm);
     //ConfigApi.SetDebuggerFlag(SnesDebuggerFlags.BreakOnStp, BreakOnStp);
     //ConfigApi.SetDebuggerFlag(SnesDebuggerFlags.BreakOnUninitRead, BreakOnUninitRead);
 }
Exemple #2
0
        public void UpdateSettings(EmulatorSettings settings)
        {
            EmulationConfig.RamPowerOnState          = settings.RandomPowerOnState ? RamState.Random : RamState.AllZeros;
            EmulationConfig.EnableRandomPowerOnState = settings.RandomPowerOnState;
            VideoConfig.HideBgLayer0 = !settings.ShowBgLayer1;
            VideoConfig.HideBgLayer1 = !settings.ShowBgLayer2;
            VideoConfig.HideBgLayer2 = !settings.ShowBgLayer3;
            VideoConfig.HideBgLayer3 = !settings.ShowBgLayer4;
            VideoConfig.HideSprites  = !settings.ShowSpriteLayer;

            SnesConfigApi.SetAudioConfig(new AudioConfig {
                EnableAudio = settings.PlayAudio
            });
            ApplyEmulationConfig();
            ApplyVideoConfig();
        }
Exemple #3
0
        public static void ApplyPreferenceConfig()
        {
            var shortcutKeys = new ShortcutKeyInfo[0];

            SnesConfigApi.SetShortcutKeys(shortcutKeys, (UInt32)shortcutKeys.Length);
            SnesConfigApi.SetPreferences(new InteropPreferencesConfig()
            {
                DisableGameSelectionScreen = true,
                ShowFps                  = false,
                ShowFrameCounter         = false,
                ShowGameTimer            = false,
                ShowDebugInfo            = false,
                DisableOsd               = true,
                AllowBackgroundInput     = false,
                SaveFolderOverride       = Path.Combine(Program.EmulatorDirectory, "Saves"),
                SaveStateFolderOverride  = Path.Combine(Program.EmulatorDirectory, "SaveStates"),
                ScreenshotFolderOverride = Path.Combine(Program.EmulatorDirectory, "Screenshots"),
                //RewindBufferSize = RewindBufferSize
            });
        }
Exemple #4
0
        public void UpdateControllerMappings(Dictionary <ControllerButtons, int> mappings)
        {
            var p1Mapping = new KeyMapping
            {
                Up     = GetMapping(mappings, ControllerButtons.Up),
                Down   = GetMapping(mappings, ControllerButtons.Down),
                Left   = GetMapping(mappings, ControllerButtons.Left),
                Right  = GetMapping(mappings, ControllerButtons.Right),
                X      = GetMapping(mappings, ControllerButtons.X),
                Y      = GetMapping(mappings, ControllerButtons.Y),
                A      = GetMapping(mappings, ControllerButtons.A),
                B      = GetMapping(mappings, ControllerButtons.B),
                Select = GetMapping(mappings, ControllerButtons.Select),
                Start  = GetMapping(mappings, ControllerButtons.Start),
                L      = GetMapping(mappings, ControllerButtons.L),
                R      = GetMapping(mappings, ControllerButtons.R)
            };
            var config = new InputConfig();

            config.Controllers[0].Keys.TurboSpeed = 2;
            config.Controllers[0].Type            = ControllerType.SnesController;
            config.Controllers[0].Keys.Mapping1   = p1Mapping;
            SnesConfigApi.SetInputConfig(config);
        }
Exemple #5
0
 private static void ApplyVideoConfig()
 {
     SnesConfigApi.SetVideoConfig(VideoConfig);
 }
Exemple #6
0
 public static void ApplyAudioConfig()
 {
     SnesConfigApi.SetAudioConfig(new AudioConfig());
 }
Exemple #7
0
 public static void ApplyEmulationConfig()
 {
     SnesConfigApi.SetEmulationConfig(EmulationConfig);
 }
Exemple #8
0
 public void EnableDebugger()
 {
     SnesConfigApi.SetDebuggerFlag(SnesDebuggerFlags.CpuDebuggerEnabled, true);
     //SnesApi.DebugRun();
     RefreshBreakpoints();
 }
Exemple #9
0
 public static List <string> GetAudioDevices()
 {
     return(new List <string>(Utf8Marshaler.PtrToStringUtf8(ConfigApi.GetAudioDevicesWrapper()).Split(new string[1] {
         "||"
     }, StringSplitOptions.RemoveEmptyEntries)));
 }