From fb792dbfe1fbc1b85620bd5b7487e0c76ee1c825 Mon Sep 17 00:00:00 2001 From: Ian C Date: Tue, 21 Feb 2012 23:41:37 +0000 Subject: Updates to some pages and initial work on game page contemplated. --- wpspec/wpspec/GamePage.xaml.cs | 52 ++++++++++---- wpspec/wpspec/MainPage.xaml | 78 ++++++++++----------- wpspec/wpspec/MainPage.xaml.cs | 15 +++++ wpspec/wpspec/OpenLocalTapePage.xaml | 55 +++++++++++++++ wpspec/wpspec/OpenLocalTapePage.xaml.cs | 23 +++++++ wpspec/wpspec/OpenRemoteTapePage.xaml | 55 +++++++++++++++ wpspec/wpspec/OpenRemoteTapePage.xaml.cs | 23 +++++++ wpspec/wpspec/Resources/Strings.Designer.cs | 101 +++++++++++++++++++++++++++- wpspec/wpspec/Resources/Strings.resx | 35 +++++++++- wpspec/wpspec/SaveLocalTapePage.xaml | 55 +++++++++++++++ wpspec/wpspec/SaveLocalTapePage.xaml.cs | 23 +++++++ wpspec/wpspec/Spectrum/Emulation.cs | 12 ++-- wpspec/wpspec/wpspec.csproj | 23 ++++++- 13 files changed, 491 insertions(+), 59 deletions(-) create mode 100644 wpspec/wpspec/OpenLocalTapePage.xaml create mode 100644 wpspec/wpspec/OpenLocalTapePage.xaml.cs create mode 100644 wpspec/wpspec/OpenRemoteTapePage.xaml create mode 100644 wpspec/wpspec/OpenRemoteTapePage.xaml.cs create mode 100644 wpspec/wpspec/SaveLocalTapePage.xaml create mode 100644 wpspec/wpspec/SaveLocalTapePage.xaml.cs 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 + + /// + /// Default constructor + /// 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 + /// - /// Allows the page to run logic such as updating the world, - /// checking for collisions, gathering input, and playing audio. + /// Run the emulation. /// private void OnUpdate(object sender, GameTimerEventArgs e) { - // TODO: Add your update logic here } /// - /// Allows the page to draw itself. + /// Updates the display. /// 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 @@ - - - - - - - - - - - - - - - - @@ -78,23 +43,60 @@ + + + + +