summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2012-02-21 23:41:37 +0000
committerIan C <ianc@noddybox.co.uk>2012-02-21 23:41:37 +0000
commitfb792dbfe1fbc1b85620bd5b7487e0c76ee1c825 (patch)
treed557ef5f016cb31a47542726fadaf867357ed667
parentc135afd8051d9dd5a9d9782d06daf237559a59d9 (diff)
Updates to some pages and initial work on game page contemplated.
-rw-r--r--wpspec/wpspec/GamePage.xaml.cs52
-rw-r--r--wpspec/wpspec/MainPage.xaml78
-rw-r--r--wpspec/wpspec/MainPage.xaml.cs15
-rw-r--r--wpspec/wpspec/OpenLocalTapePage.xaml55
-rw-r--r--wpspec/wpspec/OpenLocalTapePage.xaml.cs23
-rw-r--r--wpspec/wpspec/OpenRemoteTapePage.xaml55
-rw-r--r--wpspec/wpspec/OpenRemoteTapePage.xaml.cs23
-rw-r--r--wpspec/wpspec/Resources/Strings.Designer.cs101
-rw-r--r--wpspec/wpspec/Resources/Strings.resx35
-rw-r--r--wpspec/wpspec/SaveLocalTapePage.xaml55
-rw-r--r--wpspec/wpspec/SaveLocalTapePage.xaml.cs23
-rw-r--r--wpspec/wpspec/Spectrum/Emulation.cs12
-rw-r--r--wpspec/wpspec/wpspec.csproj23
13 files changed, 491 insertions, 59 deletions
diff --git a/wpspec/wpspec/GamePage.xaml.cs b/wpspec/wpspec/GamePage.xaml.cs
index 97f4c92..4d8ff1a 100644
--- a/wpspec/wpspec/GamePage.xaml.cs
+++ b/wpspec/wpspec/GamePage.xaml.cs
@@ -12,40 +12,64 @@ using Microsoft.Phone.Controls;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
+using wpspec.Spectrum;
namespace wpspec
{
public partial class GamePage : PhoneApplicationPage
{
- ContentManager contentManager;
- GameTimer timer;
- SpriteBatch spriteBatch;
+ #region Private Data
+ private ContentManager contentManager;
+ private GameTimer timer;
+ private SpriteBatch spriteBatch;
+ private Emulation spectrum;
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Default constructor
+ /// </summary>
public GamePage()
{
InitializeComponent();
// Get the content manager from the application
+ //
contentManager = (Application.Current as App).Content;
- // Create a timer for this page
+ // Create a timer for this page. Updates at 50 frames a second (PAL).
+ //
timer = new GameTimer();
- timer.UpdateInterval = TimeSpan.FromTicks(333333);
+ timer.UpdateInterval = TimeSpan.FromMilliseconds(20);
timer.Update += OnUpdate;
timer.Draw += OnDraw;
+
+ // Create the emulation
+ //
+ spectrum = new Emulation();
}
+ #endregion
+
+ #region Overrides
+
protected override void OnNavigatedTo(NavigationEventArgs e)
{
// Set the sharing mode of the graphics device to turn on XNA rendering
+ //
SharedGraphicsDeviceManager.Current.GraphicsDevice.SetSharingMode(true);
// Create a new SpriteBatch, which can be used to draw textures.
+ //
spriteBatch = new SpriteBatch(SharedGraphicsDeviceManager.Current.GraphicsDevice);
// TODO: use this.content to load your game content here
// Start the timer
+ //
timer.Start();
base.OnNavigatedTo(e);
@@ -54,31 +78,35 @@ namespace wpspec
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
// Stop the timer
+ //
timer.Stop();
// Set the sharing mode of the graphics device to turn off XNA rendering
+ //
SharedGraphicsDeviceManager.Current.GraphicsDevice.SetSharingMode(false);
base.OnNavigatedFrom(e);
}
+ #endregion
+
+ #region Private members
+
/// <summary>
- /// Allows the page to run logic such as updating the world,
- /// checking for collisions, gathering input, and playing audio.
+ /// Run the emulation.
/// </summary>
private void OnUpdate(object sender, GameTimerEventArgs e)
{
- // TODO: Add your update logic here
}
/// <summary>
- /// Allows the page to draw itself.
+ /// Updates the display.
/// </summary>
private void OnDraw(object sender, GameTimerEventArgs e)
{
- SharedGraphicsDeviceManager.Current.GraphicsDevice.Clear(Color.CornflowerBlue);
-
- // TODO: Add your drawing code here
+ SharedGraphicsDeviceManager.Current.GraphicsDevice.Clear(Color.Black);
}
+
+ #endregion
}
} \ No newline at end of file
diff --git a/wpspec/wpspec/MainPage.xaml b/wpspec/wpspec/MainPage.xaml
index 2020676..87073a3 100644
--- a/wpspec/wpspec/MainPage.xaml
+++ b/wpspec/wpspec/MainPage.xaml
@@ -25,41 +25,6 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
- <Rectangle Grid.RowSpan="2">
- <Rectangle.Fill>
- <LinearGradientBrush StartPoint="0,0"
- EndPoint="1.0,1.0"
- Opacity="0.4">
- <GradientStop Color="Red" Offset="0" />
- <GradientStop Color="Red" Offset="0.24" />
- <GradientStop Color="Yellow" Offset="0.25" />
- <GradientStop Color="Yellow" Offset="0.49" />
- <GradientStop Color="Green" Offset="0.50" />
- <GradientStop Color="Green" Offset="0.74" />
- <GradientStop Color="Cyan" Offset="0.75" />
- <GradientStop Color="Cyan" Offset="1" />
- </LinearGradientBrush>
- </Rectangle.Fill>
- </Rectangle>
-
- <!--<Rectangle Grid.RowSpan="2">
- <Rectangle.Fill>
- <RadialGradientBrush Center="0.5,1"
- GradientOrigin="0.5,1"
- RadiusX="1.0"
- RadiusY="1"
- Opacity="0.5">
- <GradientStop Color="Red" Offset="0" />
- <GradientStop Color="Red" Offset="0.24" />
- <GradientStop Color="Yellow" Offset="0.25" />
- <GradientStop Color="Yellow" Offset="0.49" />
- <GradientStop Color="Green" Offset="0.50" />
- <GradientStop Color="Green" Offset="0.74" />
- <GradientStop Color="Cyan" Offset="0.75" />
- <GradientStop Color="Cyan" Offset="1" />
- </RadialGradientBrush>
- </Rectangle.Fill>
- </Rectangle>-->
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
@@ -78,23 +43,60 @@
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
+ <RowDefinition Height="auto" />
+ <RowDefinition Height="auto" />
+ <RowDefinition Height="auto" />
</Grid.RowDefinitions>
<!-- Run the emulator -->
<Button Height="100"
Content="{Binding RunEmulationButtonText, Source={StaticResource Strings}}"
Grid.Row="0"
+ Click="RunEmulationClick">
+ <Button.Background>
+ <LinearGradientBrush StartPoint="0.5,0"
+ EndPoint="1.0,1.0">
+ <GradientStop Color="Black" Offset="0" />
+ <GradientStop Color="Black" Offset="0.74" />
+ <GradientStop Color="Red" Offset="0.75" />
+ <GradientStop Color="Red" Offset="0.79" />
+ <GradientStop Color="Yellow" Offset="0.80" />
+ <GradientStop Color="Yellow" Offset="0.84" />
+ <GradientStop Color="Green" Offset="0.85" />
+ <GradientStop Color="Green" Offset="0.89" />
+ <GradientStop Color="Cyan" Offset="0.90" />
+ <GradientStop Color="Cyan" Offset="0.94" />
+ <GradientStop Color="Black" Offset="0.95" />
+ </LinearGradientBrush>
+ </Button.Background>
+ </Button>
+ <!-- Open Remote Tape -->
+ <Button Height="100"
+ Content="{Binding OpenRemoteTapeButtonText, Source={StaticResource Strings}}"
+ Grid.Row="1"
Background="Black"
- Click="RunEmulationClick" />
+ Click="OpenRemoteTapeClick" />
+ <!-- Open Local Tape -->
+ <Button Height="100"
+ Content="{Binding OpenLocalTapeButtonText, Source={StaticResource Strings}}"
+ Grid.Row="2"
+ Background="Black"
+ Click="OpenLocalTapeClick" />
+ <!-- Save Local Tape -->
+ <Button Height="100"
+ Content="{Binding SaveLocalTapeButtonText, Source={StaticResource Strings}}"
+ Grid.Row="3"
+ Background="Black"
+ Click="SaveLocalTapeClick" />
<!-- Configure the emulator -->
<Button Height="100"
Content="{Binding SettingsButtonText, Source={StaticResource Strings}}"
- Grid.Row="1"
+ Grid.Row="4"
Background="Black"
Click="SettingsClick" />
<!-- About -->
<Button Height="100"
Content="{Binding AboutButtonText, Source={StaticResource Strings}}"
- Grid.Row="2"
+ Grid.Row="5"
Background="Black"
Click="AboutClick" />
diff --git a/wpspec/wpspec/MainPage.xaml.cs b/wpspec/wpspec/MainPage.xaml.cs
index 26230f2..02b279d 100644
--- a/wpspec/wpspec/MainPage.xaml.cs
+++ b/wpspec/wpspec/MainPage.xaml.cs
@@ -35,5 +35,20 @@ namespace wpspec
{
NavigationService.Navigate(new Uri("/AboutPage.xaml", UriKind.Relative));
}
+
+ private void OpenRemoteTapeClick(object sender, RoutedEventArgs e)
+ {
+ NavigationService.Navigate(new Uri("/OpenRemoteTapePage.xaml", UriKind.Relative));
+ }
+
+ private void OpenLocalTapeClick(object sender, RoutedEventArgs e)
+ {
+ NavigationService.Navigate(new Uri("/OpenLocalTapePage.xaml", UriKind.Relative));
+ }
+
+ private void SaveLocalTapeClick(object sender, RoutedEventArgs e)
+ {
+ NavigationService.Navigate(new Uri("/SaveLocalTapePage.xaml", UriKind.Relative));
+ }
}
} \ No newline at end of file
diff --git a/wpspec/wpspec/OpenLocalTapePage.xaml b/wpspec/wpspec/OpenLocalTapePage.xaml
new file mode 100644
index 0000000..e13456a
--- /dev/null
+++ b/wpspec/wpspec/OpenLocalTapePage.xaml
@@ -0,0 +1,55 @@
+<phone:PhoneApplicationPage
+ x:Class="wpspec.OpenLocalTapePage"
+ 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"
+ 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">
+
+ <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 OpenLocalTapePageTitle, 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"></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
new file mode 100644
index 0000000..661100f
--- /dev/null
+++ b/wpspec/wpspec/OpenLocalTapePage.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 OpenLocalTapePage : PhoneApplicationPage
+ {
+ public OpenLocalTapePage()
+ {
+ InitializeComponent();
+ }
+ }
+} \ No newline at end of file
diff --git a/wpspec/wpspec/OpenRemoteTapePage.xaml b/wpspec/wpspec/OpenRemoteTapePage.xaml
new file mode 100644
index 0000000..3016094
--- /dev/null
+++ b/wpspec/wpspec/OpenRemoteTapePage.xaml
@@ -0,0 +1,55 @@
+<phone:PhoneApplicationPage
+ x:Class="wpspec.OpenRemoteTapePage"
+ 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"
+ 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">
+
+ <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 OpenRemoteTapePageTitle, 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"></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/OpenRemoteTapePage.xaml.cs b/wpspec/wpspec/OpenRemoteTapePage.xaml.cs
new file mode 100644
index 0000000..997411b
--- /dev/null
+++ b/wpspec/wpspec/OpenRemoteTapePage.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 OpenRemoteTapePage : PhoneApplicationPage
+ {
+ public OpenRemoteTapePage()
+ {
+ InitializeComponent();
+ }
+ }
+} \ No newline at end of file
diff --git a/wpspec/wpspec/Resources/Strings.Designer.cs b/wpspec/wpspec/Resources/Strings.Designer.cs
index 0e21ff8..e5cf7d5 100644
--- a/wpspec/wpspec/Resources/Strings.Designer.cs
+++ b/wpspec/wpspec/Resources/Strings.Designer.cs
@@ -88,6 +88,15 @@ namespace wpspec.Resources {
}
/// <summary>
+ /// Looks up a localized string similar to Cancel.
+ /// </summary>
+ public static string CancelText {
+ get {
+ return ResourceManager.GetString("CancelText", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to wpspec is Copyright © 2012 noddybox
///
///This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
@@ -128,6 +137,51 @@ namespace wpspec.Resources {
}
/// <summary>
+ /// Looks up a localized string similar to OK.
+ /// </summary>
+ public static string OkText {
+ get {
+ return ResourceManager.GetString("OkText", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Open Game State.
+ /// </summary>
+ public static string OpenLocalTapeButtonText {
+ get {
+ return ResourceManager.GetString("OpenLocalTapeButtonText", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Open Game.
+ /// </summary>
+ public static string OpenLocalTapePageTitle {
+ get {
+ return ResourceManager.GetString("OpenLocalTapePageTitle", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Open Remote Tape.
+ /// </summary>
+ public static string OpenRemoteTapeButtonText {
+ get {
+ return ResourceManager.GetString("OpenRemoteTapeButtonText", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Open Remote.
+ /// </summary>
+ public static string OpenRemoteTapePageTitle {
+ get {
+ return ResourceManager.GetString("OpenRemoteTapePageTitle", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Copyright of the included Spectrum 48K ROM is held by Amstrad PLC, and the ROM image is included with their kind permission..
/// </summary>
public static string ROMCopyrightText {
@@ -146,6 +200,51 @@ namespace wpspec.Resources {
}
/// <summary>
+ /// Looks up a localized string similar to Save Game State.
+ /// </summary>
+ public static string SaveLocalTapeButtonText {
+ get {
+ return ResourceManager.GetString("SaveLocalTapeButtonText", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Save Game.
+ /// </summary>
+ public static string SaveLocalTapePageTitle {
+ get {
+ return ResourceManager.GetString("SaveLocalTapePageTitle", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Select Game to open.
+ /// </summary>
+ public static string SelectLocalTapeText {
+ get {
+ return ResourceManager.GetString("SelectLocalTapeText", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Select Tape to open.
+ /// </summary>
+ public static string SelectRemoteTapeText {
+ get {
+ return ResourceManager.GetString("SelectRemoteTapeText", resourceCulture);
+ }
+ }
+
+ /// <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 {
@@ -173,7 +272,7 @@ namespace wpspec.Resources {
}
/// <summary>
- /// Looks up a localized string similar to Base URL for loading tapes.
+ /// Looks up a localized string similar to Base URL for loading remote tapes.
/// </summary>
public static string SettingsTapeUrlText {
get {
diff --git a/wpspec/wpspec/Resources/Strings.resx b/wpspec/wpspec/Resources/Strings.resx
index 6752428..2b22545 100644
--- a/wpspec/wpspec/Resources/Strings.resx
+++ b/wpspec/wpspec/Resources/Strings.resx
@@ -126,6 +126,9 @@
<data name="AppTitle" xml:space="preserve">
<value>wpspec</value>
</data>
+ <data name="CancelText" xml:space="preserve">
+ <value>Cancel</value>
+ </data>
<data name="CopyrightText" xml:space="preserve">
<value>wpspec is Copyright © 2012 noddybox
@@ -142,12 +145,42 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
<data name="MainPageTitle" xml:space="preserve">
<value>Main Menu</value>
</data>
+ <data name="OkText" xml:space="preserve">
+ <value>OK</value>
+ </data>
+ <data name="OpenLocalTapeButtonText" xml:space="preserve">
+ <value>Open Game State</value>
+ </data>
+ <data name="OpenLocalTapePageTitle" xml:space="preserve">
+ <value>Open Game</value>
+ </data>
+ <data name="OpenRemoteTapeButtonText" xml:space="preserve">
+ <value>Open Remote Tape</value>
+ </data>
+ <data name="OpenRemoteTapePageTitle" xml:space="preserve">
+ <value>Open Remote</value>
+ </data>
<data name="ROMCopyrightText" xml:space="preserve">
<value>Copyright of the included Spectrum 48K ROM is held by Amstrad PLC, and the ROM image is included with their kind permission.</value>
</data>
<data name="RunEmulationButtonText" xml:space="preserve">
<value>Run Spectrum 48K</value>
</data>
+ <data name="SaveLocalTapeButtonText" xml:space="preserve">
+ <value>Save Game State</value>
+ </data>
+ <data name="SaveLocalTapePageTitle" xml:space="preserve">
+ <value>Save Game</value>
+ </data>
+ <data name="SelectLocalTapeText" xml:space="preserve">
+ <value>Select Game to open</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>
@@ -158,7 +191,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
<value>Sound</value>
</data>
<data name="SettingsTapeUrlText" xml:space="preserve">
- <value>Base URL for loading tapes</value>
+ <value>Base URL for loading remote tapes</value>
</data>
<data name="SourceHyperlinkText" xml:space="preserve">
<value>See Source Code Online</value>
diff --git a/wpspec/wpspec/SaveLocalTapePage.xaml b/wpspec/wpspec/SaveLocalTapePage.xaml
new file mode 100644
index 0000000..13f173c
--- /dev/null
+++ b/wpspec/wpspec/SaveLocalTapePage.xaml
@@ -0,0 +1,55 @@
+<phone:PhoneApplicationPage
+ x:Class="wpspec.SaveLocalTapePage"
+ 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"
+ 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">
+
+ <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 SaveLocalTapePageTitle, 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"></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
new file mode 100644
index 0000000..ca4828d
--- /dev/null
+++ b/wpspec/wpspec/SaveLocalTapePage.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 SaveLocalTapePage : PhoneApplicationPage
+ {
+ public SaveLocalTapePage()
+ {
+ InitializeComponent();
+ }
+ }
+} \ No newline at end of file
diff --git a/wpspec/wpspec/Spectrum/Emulation.cs b/wpspec/wpspec/Spectrum/Emulation.cs
index dd47a07..58fdb83 100644
--- a/wpspec/wpspec/Spectrum/Emulation.cs
+++ b/wpspec/wpspec/Spectrum/Emulation.cs
@@ -12,6 +12,8 @@ using Noddybox.Emulation;
using Noddybox.Emulation.EightBit;
using Noddybox.Emulation.EightBit.Z80;
using System.Reflection;
+using System.Windows.Resources;
+using System.IO;
namespace wpspec.Spectrum
{
@@ -91,14 +93,12 @@ namespace wpspec.Spectrum
{
// Load the spectrum ROM
//
- var file = Assembly.GetExecutingAssembly().GetManifestResourceStream("Resources.48.rom");
+ Uri uri = new Uri("Resources/48.rom", UriKind.Relative);
+ StreamResourceInfo file = App.GetResourceStream(uri);
- if (file == null || file.Length != 0x4000)
- {
- throw new Exception("Failed to load spectrum ROM");
- }
+ file.Stream.Read(mem, 0, 0x4000);
- file.Read(mem, 0, 0x4000);
+ file.Stream.Close();
// Initialise the CPU
//
diff --git a/wpspec/wpspec/wpspec.csproj b/wpspec/wpspec/wpspec.csproj
index 9ab9c42..8b4dc6f 100644
--- a/wpspec/wpspec/wpspec.csproj
+++ b/wpspec/wpspec/wpspec.csproj
@@ -75,6 +75,12 @@
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
+ <Compile Include="OpenLocalTapePage.xaml.cs">
+ <DependentUpon>OpenLocalTapePage.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="OpenRemoteTapePage.xaml.cs">
+ <DependentUpon>OpenRemoteTapePage.xaml</DependentUpon>
+ </Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="GamePage.xaml.cs">
<DependentUpon>GamePage.xaml</DependentUpon>
@@ -84,6 +90,9 @@
<DesignTime>True</DesignTime>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
+ <Compile Include="SaveLocalTapePage.xaml.cs">
+ <DependentUpon>SaveLocalTapePage.xaml</DependentUpon>
+ </Compile>
<Compile Include="Settings.cs" />
<Compile Include="SettingsPage.xaml.cs">
<DependentUpon>SettingsPage.xaml</DependentUpon>
@@ -107,6 +116,18 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="OpenLocalTapePage.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="OpenRemoteTapePage.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="SaveLocalTapePage.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="SettingsPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -117,7 +138,7 @@
<None Include="Properties\WMAppManifest.xml">
<SubType>Designer</SubType>
</None>
- <EmbeddedResource Include="Resources\48.rom" />
+ <Content Include="Resources\48.rom" />
</ItemGroup>
<ItemGroup>
<Content Include="ApplicationIcon.png">