From 3031fa3787c9d0faf53880f360084c4504dcff91 Mon Sep 17 00:00:00 2001 From: Ian C Date: Thu, 14 Jun 2012 22:49:53 +0000 Subject: Removed fuller stick and made kempston non-configurable. Joysticks work in emulator now. --- wpspec/wpspec/GamePage.xaml.cs | 79 ++++++++++++++++++++++++++- wpspec/wpspec/Resources/Strings.Designer.cs | 11 +--- wpspec/wpspec/Resources/Strings.resx | 5 +- wpspec/wpspec/Settings.cs | 20 ------- wpspec/wpspec/SettingsPage.xaml | 22 +------- wpspec/wpspec/SoundManager.cs | 14 +++-- wpspec/wpspec/Spectrum/Emulation.cs | 15 ----- wpspec/wpspec/ViewModels/SettingsViewModel.cs | 22 -------- 8 files changed, 91 insertions(+), 97 deletions(-) diff --git a/wpspec/wpspec/GamePage.xaml.cs b/wpspec/wpspec/GamePage.xaml.cs index 5ed296f..6932bdd 100644 --- a/wpspec/wpspec/GamePage.xaml.cs +++ b/wpspec/wpspec/GamePage.xaml.cs @@ -111,8 +111,8 @@ namespace wpspec // Initialise locations for normal and zoomed display // location = new Vector2(SharedGraphicsDeviceManager.Current.GraphicsDevice.DisplayMode.Width / 2 - Shared.Spectrum.Width / 2, 10); - locationZoomed = new Rectangle(SharedGraphicsDeviceManager.Current.GraphicsDevice.DisplayMode.Width / 2 - Shared.Spectrum.Width * 100 / 140, 10, - Shared.Spectrum.Height * 100 / 70, Shared.Spectrum.Width * 100 / 70); + locationZoomed = new Rectangle(SharedGraphicsDeviceManager.Current.GraphicsDevice.DisplayMode.Width / 2 - Shared.Spectrum.Width * 100 / 120, 10, + Shared.Spectrum.Height * 100 / 60, Shared.Spectrum.Width * 100 / 60); // Reset settings // @@ -306,7 +306,7 @@ namespace wpspec } else { - SoundManager.StopSoundManager(); + SoundManager.StartSoundManager(); } break; @@ -362,6 +362,79 @@ namespace wpspec private void HandleJoystickEvent(object sender, JoystickDriver.DigitalJoystickEventArgs e) { resetPressed = false; + + Shared.Spectrum.Joystick(e.State, e.Buttons); + + if (Settings.Instance.KeyboardJoystick) + { + if ((e.State & DigitalJoystickState.Up) == DigitalJoystickState.Up) + { + Shared.Spectrum.KeyPressed(Settings.Instance.JoystickKeyUp); + } + else + { + Shared.Spectrum.KeyReleased(Settings.Instance.JoystickKeyUp); + } + + if ((e.State & DigitalJoystickState.Down) == DigitalJoystickState.Down) + { + Shared.Spectrum.KeyPressed(Settings.Instance.JoystickKeyDown); + } + else + { + Shared.Spectrum.KeyReleased(Settings.Instance.JoystickKeyDown); + } + + if ((e.State & DigitalJoystickState.Left) == DigitalJoystickState.Left) + { + Shared.Spectrum.KeyPressed(Settings.Instance.JoystickKeyLeft); + } + else + { + Shared.Spectrum.KeyReleased(Settings.Instance.JoystickKeyLeft); + } + + if ((e.State & DigitalJoystickState.Right) == DigitalJoystickState.Right) + { + Shared.Spectrum.KeyPressed(Settings.Instance.JoystickKeyRight); + } + else + { + Shared.Spectrum.KeyReleased(Settings.Instance.JoystickKeyRight); + } + + if (Settings.Instance.JoystickKeyFire1 == Settings.Instance.JoystickKeyFire2) + { + if (e.Buttons[0] || e.Buttons[1]) + { + Shared.Spectrum.KeyPressed(Settings.Instance.JoystickKeyFire1); + } + else + { + Shared.Spectrum.KeyReleased(Settings.Instance.JoystickKeyFire1); + } + } + else + { + if (e.Buttons[0]) + { + Shared.Spectrum.KeyPressed(Settings.Instance.JoystickKeyFire1); + } + else + { + Shared.Spectrum.KeyReleased(Settings.Instance.JoystickKeyFire1); + } + + if (e.Buttons[1]) + { + Shared.Spectrum.KeyPressed(Settings.Instance.JoystickKeyFire2); + } + else + { + Shared.Spectrum.KeyReleased(Settings.Instance.JoystickKeyFire2); + } + } + } } #endregion diff --git a/wpspec/wpspec/Resources/Strings.Designer.cs b/wpspec/wpspec/Resources/Strings.Designer.cs index e0ff595..26f924b 100644 --- a/wpspec/wpspec/Resources/Strings.Designer.cs +++ b/wpspec/wpspec/Resources/Strings.Designer.cs @@ -380,7 +380,7 @@ namespace wpspec.Resources { } /// - /// Looks up a localized string similar to Cursor. + /// Looks up a localized string similar to Set to Cursor. /// public static string SettingsCursorJoystick { get { @@ -496,15 +496,6 @@ namespace wpspec.Resources { } } - /// - /// Looks up a localized string similar to Miner Willy. - /// - public static string SettingsManicJoystick { - get { - return ResourceManager.GetString("SettingsManicJoystick", resourceCulture); - } - } - /// /// Looks up a localized string similar to Joysticks. /// diff --git a/wpspec/wpspec/Resources/Strings.resx b/wpspec/wpspec/Resources/Strings.resx index 8dd4f93..3c5cbe0 100644 --- a/wpspec/wpspec/Resources/Strings.resx +++ b/wpspec/wpspec/Resources/Strings.resx @@ -251,7 +251,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY Tape Contents - Cursor + Set to Cursor Fuller @@ -259,9 +259,6 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY Joystick Lock - - Miner Willy - Kempston diff --git a/wpspec/wpspec/Settings.cs b/wpspec/wpspec/Settings.cs index 90be72d..6c6a06c 100644 --- a/wpspec/wpspec/Settings.cs +++ b/wpspec/wpspec/Settings.cs @@ -39,24 +39,6 @@ namespace wpspec set {tapeUrl.Setting = value;} } - /// - /// Get/set whether Kempston joystick emulation is enabled. - /// - public bool KempstonJoystick - { - get {return kempstonJoystick.Setting;} - set {kempstonJoystick.Setting = value;} - } - - /// - /// Get/set whether Fuller joystick emulation is enabled. - /// - public bool FullerJoystick - { - get {return fullerJoystick.Setting;} - set {fullerJoystick.Setting = value;} - } - /// /// Get/set whether a keyboard-based joystick emulation is enabled. /// @@ -144,8 +126,6 @@ namespace wpspec private Settings() { sound = new SettingValue("Sound", true); - kempstonJoystick = new SettingValue("KempstonJoystick", true); - fullerJoystick = new SettingValue("FullerJoystick", true); keyboardJoystick = new SettingValue("KeyboardJoystick", false); joystickKeyUp = new SettingValue("JoystickKeyUp", SpectrumKeySymbol.Key7); joystickKeyDown = new SettingValue("JoystickKeyDown", SpectrumKeySymbol.Key6); diff --git a/wpspec/wpspec/SettingsPage.xaml b/wpspec/wpspec/SettingsPage.xaml index a3857b1..9ad95cb 100644 --- a/wpspec/wpspec/SettingsPage.xaml +++ b/wpspec/wpspec/SettingsPage.xaml @@ -35,24 +35,15 @@ - - - - - - + Grid.Row="1" /> + @@ -90,16 +81,9 @@ - - - -