summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wpspec.sln12
-rw-r--r--wpspec/wpspec/ManageSavedStatesPage.xaml45
-rw-r--r--wpspec/wpspec/ManageSavedStatesPage.xaml.cs23
-rw-r--r--wpspec/wpspec/OpenLocalTapePage.xaml24
-rw-r--r--wpspec/wpspec/OpenLocalTapePage.xaml.cs36
-rw-r--r--wpspec/wpspec/Resources/Strings.Designer.cs13
-rw-r--r--wpspec/wpspec/Resources/Strings.resx7
-rw-r--r--wpspec/wpspec/SaveLocalTapePage.xaml25
-rw-r--r--wpspec/wpspec/SaveLocalTapePage.xaml.cs44
-rw-r--r--wpspec/wpspec/Settings.cs1
-rw-r--r--wpspec/wpspec/SplashScreenImage.jpgbin47793 -> 92772 bytes
-rw-r--r--wpspec/wpspec/wpspec.csproj11
12 files changed, 193 insertions, 48 deletions
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 @@
+<phone:PhoneApplicationPage
+ x:Class="wpspec.ManageSavedStatesPage"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+ xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
+ 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="800" d:DesignWidth="480"
+ shell:SystemTray.IsVisible="False">
+
+ <phone:PhoneApplicationPage.Resources>
+ <res:Strings x:Key="Strings" />
+ </phone:PhoneApplicationPage.Resources>
+
+ <!--LayoutRoot is the root grid where all page content is placed-->
+ <Grid x:Name="LayoutRoot" Background="Transparent">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+
+ <!--TitlePanel contains the name of the application and page title-->
+ <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
+ <TextBlock x:Name="ApplicationTitle"
+ Text="{Binding AppTitle, Source={StaticResource Strings}}"
+ Style="{StaticResource PhoneTextNormalStyle}"/>
+ <TextBlock x:Name="PageTitle"
+ Text="{Binding ManageSavedStatesButtonText, Source={StaticResource Strings}}"
+ Margin="9,-7,0,0"
+ Style="{StaticResource PhoneTextTitle1Style}"/>
+ </StackPanel>
+
+ <!--ContentPanel - place additional content here-->
+ <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
+ <noddybox:DeleteDialog FileMask="*.state" />
+ </Grid>
+ </Grid>
+</phone:PhoneApplicationPage> \ 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">
<phone:PhoneApplicationPage.Resources>
<res:Strings x:Key="Strings" />
@@ -37,19 +38,10 @@
</StackPanel>
<!--ContentPanel - place additional content here-->
- <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"></Grid>
+ <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
+ <noddybox:LoadDialog OkButtonText="{Binding OpenLocalTapeButtonText, Source={StaticResource Strings}}"
+ FileMask="*.state"
+ OkPressed="LoadDialog_OkPressed"/>
+ </Grid>
</Grid>
-
- <!--Sample code showing usage of ApplicationBar-->
- <!--<phone:PhoneApplicationPage.ApplicationBar>
- <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
- <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
- <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
- <shell:ApplicationBar.MenuItems>
- <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
- <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
- </shell:ApplicationBar.MenuItems>
- </shell:ApplicationBar>
- </phone:PhoneApplicationPage.ApplicationBar>-->
-
</phone:PhoneApplicationPage>
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 {
}
/// <summary>
- /// Looks up a localized string similar to Save State.
+ /// Looks up a localized string similar to Select Game State File.
/// </summary>
public static string SaveLocalTapePageTitle {
get {
@@ -380,7 +380,7 @@ namespace wpspec.Resources {
}
/// <summary>
- /// Looks up a localized string similar to Select Game to open.
+ /// Looks up a localized string similar to Select Game State File.
/// </summary>
public static string SelectLocalTapeText {
get {
@@ -398,15 +398,6 @@ namespace wpspec.Resources {
}
/// <summary>
- /// Looks up a localized string similar to Enter Name for Saved Game.
- /// </summary>
- public static string SelectTapeNameText {
- get {
- return ResourceManager.GetString("SelectTapeNameText", resourceCulture);
- }
- }
-
- /// <summary>
/// Looks up a localized string similar to Settings.
/// </summary>
public static string SettingsButtonText {
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
<value>Save State</value>
</data>
<data name="SaveLocalTapePageTitle" xml:space="preserve">
- <value>Save State</value>
+ <value>Select Game State File</value>
</data>
<data name="SelectLocalTapeText" xml:space="preserve">
- <value>Select Game to open</value>
+ <value>Select Game State File</value>
</data>
<data name="SelectRemoteTapeText" xml:space="preserve">
<value>Select Tape to open</value>
</data>
- <data name="SelectTapeNameText" xml:space="preserve">
- <value>Enter Name for Saved Game</value>
- </data>
<data name="SettingsButtonText" xml:space="preserve">
<value>Settings</value>
</data>
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">
<phone:PhoneApplicationPage.Resources>
<res:Strings x:Key="Strings" />
@@ -37,19 +38,11 @@
</StackPanel>
<!--ContentPanel - place additional content here-->
- <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"></Grid>
+ <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
+ <noddybox:SaveDialog TitleText=""
+ FileMask="*.state"
+ OkButtonText="{Binding SaveLocalTapeButtonText, Source={StaticResource Strings}}"
+ OkPressed="SaveDialog_OkPressed" />
+ </Grid>
</Grid>
-
- <!--Sample code showing usage of ApplicationBar-->
- <!--<phone:PhoneApplicationPage.ApplicationBar>
- <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
- <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
- <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
- <shell:ApplicationBar.MenuItems>
- <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
- <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
- </shell:ApplicationBar.MenuItems>
- </shell:ApplicationBar>
- </phone:PhoneApplicationPage.ApplicationBar>-->
-
</phone:PhoneApplicationPage>
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
--- a/wpspec/wpspec/SplashScreenImage.jpg
+++ b/wpspec/wpspec/SplashScreenImage.jpg
Binary files 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 @@
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
+ <Compile Include="ManageSavedStatesPage.xaml.cs">
+ <DependentUpon>ManageSavedStatesPage.xaml</DependentUpon>
+ </Compile>
<Compile Include="OpenLocalTapePage.xaml.cs">
<DependentUpon>OpenLocalTapePage.xaml</DependentUpon>
</Compile>
@@ -163,6 +166,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="ManageSavedStatesPage.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="OpenLocalTapePage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -234,6 +241,10 @@
<Project>{A2478066-4DFD-4042-BF98-963922DC97F8}</Project>
<Name>Noddybox.Emulation</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\Noddybox.WindowsPhone\Noddybox.WindowsPhone.Silverlight\Noddybox.WindowsPhone.Silverlight.csproj">
+ <Project>{0462860F-FEE0-4E35-8CB8-36C2416B2DB3}</Project>
+ <Name>Noddybox.WindowsPhone.Silverlight</Name>
+ </ProjectReference>
<ProjectReference Include="..\wpspecLib\wpspecLib.csproj">
<Name>wpspecLib</Name>
</ProjectReference>