From e6b79487f25730849ecc2c0ae139ee36d97e34f9 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sun, 1 Jul 2012 14:36:19 +0000 Subject: Updates --- wpspec.sln | 12 ++++++++ wpspec/wpspec/ManageSavedStatesPage.xaml | 45 ++++++++++++++++++++++++++++ wpspec/wpspec/ManageSavedStatesPage.xaml.cs | 23 ++++++++++++++ wpspec/wpspec/OpenLocalTapePage.xaml | 24 +++++---------- wpspec/wpspec/OpenLocalTapePage.xaml.cs | 36 ++++++++++++++++++++++ wpspec/wpspec/Resources/Strings.Designer.cs | 13 ++------ wpspec/wpspec/Resources/Strings.resx | 7 ++--- wpspec/wpspec/SaveLocalTapePage.xaml | 25 ++++++---------- wpspec/wpspec/SaveLocalTapePage.xaml.cs | 44 +++++++++++++++++++++++++++ wpspec/wpspec/Settings.cs | 1 + wpspec/wpspec/SplashScreenImage.jpg | Bin 47793 -> 92772 bytes wpspec/wpspec/wpspec.csproj | 11 +++++++ 12 files changed, 193 insertions(+), 48 deletions(-) create mode 100644 wpspec/wpspec/ManageSavedStatesPage.xaml create mode 100644 wpspec/wpspec/ManageSavedStatesPage.xaml.cs diff --git a/wpspec.sln b/wpspec.sln index 9bc05bf..dcfa79b 100644 --- a/wpspec.sln +++ b/wpspec.sln @@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Noddybox.Emulation.Keyboard EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Noddybox.Emulation.Xna.Input", "..\EmulationKeyboard\WindowsPhone\Noddybox.Emulation.Xna.Input\Noddybox.Emulation.Xna.Input.csproj", "{0F95CAB2-B79A-45B5-B5F2-14F4CED2EF20}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Noddybox.WindowsPhone.Silverlight", "..\Noddybox.WindowsPhone\Noddybox.WindowsPhone.Silverlight\Noddybox.WindowsPhone.Silverlight.csproj", "{0462860F-FEE0-4E35-8CB8-36C2416B2DB3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -119,6 +121,16 @@ Global {0F95CAB2-B79A-45B5-B5F2-14F4CED2EF20}.Release|Mixed Platforms.Build.0 = Release|Windows Phone {0F95CAB2-B79A-45B5-B5F2-14F4CED2EF20}.Release|Windows Phone.ActiveCfg = Release|Windows Phone {0F95CAB2-B79A-45B5-B5F2-14F4CED2EF20}.Release|Windows Phone.Build.0 = Release|Windows Phone + {0462860F-FEE0-4E35-8CB8-36C2416B2DB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0462860F-FEE0-4E35-8CB8-36C2416B2DB3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0462860F-FEE0-4E35-8CB8-36C2416B2DB3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {0462860F-FEE0-4E35-8CB8-36C2416B2DB3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {0462860F-FEE0-4E35-8CB8-36C2416B2DB3}.Debug|Windows Phone.ActiveCfg = Debug|Any CPU + {0462860F-FEE0-4E35-8CB8-36C2416B2DB3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0462860F-FEE0-4E35-8CB8-36C2416B2DB3}.Release|Any CPU.Build.0 = Release|Any CPU + {0462860F-FEE0-4E35-8CB8-36C2416B2DB3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {0462860F-FEE0-4E35-8CB8-36C2416B2DB3}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {0462860F-FEE0-4E35-8CB8-36C2416B2DB3}.Release|Windows Phone.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/wpspec/wpspec/ManageSavedStatesPage.xaml b/wpspec/wpspec/ManageSavedStatesPage.xaml new file mode 100644 index 0000000..22b0564 --- /dev/null +++ b/wpspec/wpspec/ManageSavedStatesPage.xaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wpspec/wpspec/ManageSavedStatesPage.xaml.cs b/wpspec/wpspec/ManageSavedStatesPage.xaml.cs new file mode 100644 index 0000000..7e91d14 --- /dev/null +++ b/wpspec/wpspec/ManageSavedStatesPage.xaml.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; +using Microsoft.Phone.Controls; + +namespace wpspec +{ + public partial class ManageSavedStatesPage : PhoneApplicationPage + { + public ManageSavedStatesPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/wpspec/wpspec/OpenLocalTapePage.xaml b/wpspec/wpspec/OpenLocalTapePage.xaml index e13456a..8491bf0 100644 --- a/wpspec/wpspec/OpenLocalTapePage.xaml +++ b/wpspec/wpspec/OpenLocalTapePage.xaml @@ -7,12 +7,13 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:res="clr-namespace:wpspec.Resources" + xmlns:noddybox="clr-namespace:Noddybox.WindowsPhone.Silverlight;assembly=Noddybox.WindowsPhone.Silverlight" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait" Orientation="Portrait" - mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480" - shell:SystemTray.IsVisible="True"> + mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480" + shell:SystemTray.IsVisible="False"> @@ -37,19 +38,10 @@ - + + + - - - - diff --git a/wpspec/wpspec/OpenLocalTapePage.xaml.cs b/wpspec/wpspec/OpenLocalTapePage.xaml.cs index 661100f..361c9fe 100644 --- a/wpspec/wpspec/OpenLocalTapePage.xaml.cs +++ b/wpspec/wpspec/OpenLocalTapePage.xaml.cs @@ -10,6 +10,9 @@ using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Microsoft.Phone.Controls; +using System.IO.IsolatedStorage; +using System.IO; +using Noddybox.Emulation; namespace wpspec { @@ -19,5 +22,38 @@ namespace wpspec { InitializeComponent(); } + + private void LoadDialog_OkPressed(object sender, Noddybox.WindowsPhone.Silverlight.FileDialogEvent e) + { + IsolatedStorageFile iso = IsolatedStorageFile.GetUserStoreForApplication(); + + try + { + using (IsolatedStorageFileStream stream = iso.OpenFile(e.Path, FileMode.Open)) + { + using (BinaryReader reader = new BinaryReader(stream)) + { + EmulationStateLoadManager.Load + (reader, + new IEmulationState[] + { + Settings.Instance, + Shared.Spectrum.Z80, + Shared.Spectrum + }); + } + } + + NavigationService.GoBack(); + } + catch (IsolatedStorageException ex) + { + MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK); + } + catch (EmulationStateException ex) + { + MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK); + } + } } } \ No newline at end of file diff --git a/wpspec/wpspec/Resources/Strings.Designer.cs b/wpspec/wpspec/Resources/Strings.Designer.cs index 2c02935..7e88852 100644 --- a/wpspec/wpspec/Resources/Strings.Designer.cs +++ b/wpspec/wpspec/Resources/Strings.Designer.cs @@ -371,7 +371,7 @@ namespace wpspec.Resources { } /// - /// Looks up a localized string similar to Save State. + /// Looks up a localized string similar to Select Game State File. /// public static string SaveLocalTapePageTitle { get { @@ -380,7 +380,7 @@ namespace wpspec.Resources { } /// - /// Looks up a localized string similar to Select Game to open. + /// Looks up a localized string similar to Select Game State File. /// public static string SelectLocalTapeText { get { @@ -397,15 +397,6 @@ namespace wpspec.Resources { } } - /// - /// Looks up a localized string similar to Enter Name for Saved Game. - /// - public static string SelectTapeNameText { - get { - return ResourceManager.GetString("SelectTapeNameText", resourceCulture); - } - } - /// /// Looks up a localized string similar to Settings. /// diff --git a/wpspec/wpspec/Resources/Strings.resx b/wpspec/wpspec/Resources/Strings.resx index 8e8e5aa..66cdd81 100644 --- a/wpspec/wpspec/Resources/Strings.resx +++ b/wpspec/wpspec/Resources/Strings.resx @@ -197,17 +197,14 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY Save State - Save State + Select Game State File - Select Game to open + Select Game State File Select Tape to open - - Enter Name for Saved Game - Settings diff --git a/wpspec/wpspec/SaveLocalTapePage.xaml b/wpspec/wpspec/SaveLocalTapePage.xaml index 13f173c..ef8ebe4 100644 --- a/wpspec/wpspec/SaveLocalTapePage.xaml +++ b/wpspec/wpspec/SaveLocalTapePage.xaml @@ -7,12 +7,13 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:res="clr-namespace:wpspec.Resources" + xmlns:noddybox="clr-namespace:Noddybox.WindowsPhone.Silverlight;assembly=Noddybox.WindowsPhone.Silverlight" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait" Orientation="Portrait" - mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480" - shell:SystemTray.IsVisible="True"> + mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480" + shell:SystemTray.IsVisible="False"> @@ -37,19 +38,11 @@ - + + + - - - - diff --git a/wpspec/wpspec/SaveLocalTapePage.xaml.cs b/wpspec/wpspec/SaveLocalTapePage.xaml.cs index ca4828d..1c4bd6f 100644 --- a/wpspec/wpspec/SaveLocalTapePage.xaml.cs +++ b/wpspec/wpspec/SaveLocalTapePage.xaml.cs @@ -10,6 +10,10 @@ using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Microsoft.Phone.Controls; +using Noddybox.WindowsPhone.Silverlight; +using System.IO; +using System.IO.IsolatedStorage; +using Noddybox.Emulation; namespace wpspec { @@ -19,5 +23,45 @@ namespace wpspec { InitializeComponent(); } + + private void SaveDialog_OkPressed(object sender, FileDialogEvent e) + { + string path = e.Path; + + if (!path.EndsWith(".state")) + { + path += ".state"; + } + + IsolatedStorageFile iso = IsolatedStorageFile.GetUserStoreForApplication(); + + try + { + using (IsolatedStorageFileStream stream = iso.CreateFile(path)) + { + using (BinaryWriter writer = new BinaryWriter(stream)) + { + EmulationStateSaveManager.Save + (writer, + new IEmulationState[] + { + Settings.Instance, + Shared.Spectrum.Z80, + Shared.Spectrum + }); + } + } + + NavigationService.GoBack(); + } + catch (IsolatedStorageException ex) + { + MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK); + } + catch (EmulationStateException ex) + { + MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK); + } + } } } \ No newline at end of file diff --git a/wpspec/wpspec/Settings.cs b/wpspec/wpspec/Settings.cs index 2b73b62..2e98370 100644 --- a/wpspec/wpspec/Settings.cs +++ b/wpspec/wpspec/Settings.cs @@ -255,6 +255,7 @@ namespace wpspec joystickKeyRight.Setting = (SpectrumKeySymbol)str.ReadInt32(); joystickKeyFire1.Setting = (SpectrumKeySymbol)str.ReadInt32(); joystickKeyFire2.Setting = (SpectrumKeySymbol)str.ReadInt32(); + joystickLock.Setting = (JoystickLock)str.ReadInt32(); joystickLeftHanded.Setting = str.ReadBoolean(); } diff --git a/wpspec/wpspec/SplashScreenImage.jpg b/wpspec/wpspec/SplashScreenImage.jpg index 565f7aa..c74d0a5 100644 Binary files a/wpspec/wpspec/SplashScreenImage.jpg and b/wpspec/wpspec/SplashScreenImage.jpg differ diff --git a/wpspec/wpspec/wpspec.csproj b/wpspec/wpspec/wpspec.csproj index 0e53113..402a5a3 100644 --- a/wpspec/wpspec/wpspec.csproj +++ b/wpspec/wpspec/wpspec.csproj @@ -94,6 +94,9 @@ MainPage.xaml + + ManageSavedStatesPage.xaml + OpenLocalTapePage.xaml @@ -163,6 +166,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -234,6 +241,10 @@ {A2478066-4DFD-4042-BF98-963922DC97F8} Noddybox.Emulation + + {0462860F-FEE0-4E35-8CB8-36C2416B2DB3} + Noddybox.WindowsPhone.Silverlight + wpspecLib -- cgit v1.2.3