summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2012-04-03 22:51:16 +0000
committerIan C <ianc@noddybox.co.uk>2012-04-03 22:51:16 +0000
commit98eadd12718239bc4ed5e3c2c746372877e9deda (patch)
treee4b1012249c3cd622f2039a48725554ab2c52fa3
parent64f0d01906c4534a58f30dd8f6175252687db74b (diff)
Updates
-rw-r--r--WPZX81/WPZX81/GamePage.xaml.cs2
-rw-r--r--WPZX81/WPZX81/Settings.cs6
-rw-r--r--WPZX81/WPZX81/SplashScreenImage.jpgbin64334 -> 171227 bytes
-rw-r--r--WPZX81/WPZX81/ZX81/Emulation.cs33
4 files changed, 25 insertions, 16 deletions
diff --git a/WPZX81/WPZX81/GamePage.xaml.cs b/WPZX81/WPZX81/GamePage.xaml.cs
index 26b0324..6d19bbc 100644
--- a/WPZX81/WPZX81/GamePage.xaml.cs
+++ b/WPZX81/WPZX81/GamePage.xaml.cs
@@ -31,7 +31,7 @@ namespace WPZX81
// Create a timer for this page
timer = new GameTimer();
- timer.UpdateInterval = TimeSpan.FromMilliseconds(40); // Updates at 25 fps
+ timer.UpdateInterval = TimeSpan.FromMilliseconds(20 * Settings.FramesPerUpdate);
timer.Update += OnUpdate;
timer.Draw += OnDraw;
}
diff --git a/WPZX81/WPZX81/Settings.cs b/WPZX81/WPZX81/Settings.cs
index 7243bc3..f9ca28b 100644
--- a/WPZX81/WPZX81/Settings.cs
+++ b/WPZX81/WPZX81/Settings.cs
@@ -8,6 +8,12 @@ namespace WPZX81
/// </summary>
public static class Settings
{
+
+ /// <summary>
+ /// Get the number of ZX81 50 frames per second and done for each update on our display.
+ /// </summary>
+ public static int FramesPerUpdate {get {return 2;}}
+
/// <summary>
/// Get/set whether there is a sticky shift key.
/// </summary>
diff --git a/WPZX81/WPZX81/SplashScreenImage.jpg b/WPZX81/WPZX81/SplashScreenImage.jpg
index 5cdc466..860b321 100644
--- a/WPZX81/WPZX81/SplashScreenImage.jpg
+++ b/WPZX81/WPZX81/SplashScreenImage.jpg
Binary files differ
diff --git a/WPZX81/WPZX81/ZX81/Emulation.cs b/WPZX81/WPZX81/ZX81/Emulation.cs
index 0f56e4b..78a2726 100644
--- a/WPZX81/WPZX81/ZX81/Emulation.cs
+++ b/WPZX81/WPZX81/ZX81/Emulation.cs
@@ -345,23 +345,26 @@ namespace WPZX81.ZX81
{
Stopwatch s = Stopwatch.StartNew();
- if (fast)
+ for(int f = 1; f <= Settings.FramesPerUpdate; f++)
{
+ if (fast)
+ {
+ clock.StartFrame();
+ Z80.Run();
+ clock.StartFrame();
+ Z80.Run();
+ clock.StartFrame();
+ Z80.Run();
+ }
+
clock.StartFrame();
Z80.Run();
- clock.StartFrame();
- Z80.Run();
- clock.StartFrame();
- Z80.Run();
- }
-
- clock.StartFrame();
- Z80.Run();
- Z80.MaskableInterrupt(0);
+ Z80.MaskableInterrupt(0);
- if (Z80.StackPointer < 0x8000)
- {
- Housekeeping();
+ if (Z80.StackPointer < 0x8000)
+ {
+ Housekeeping();
+ }
}
s.Stop();
@@ -503,7 +506,7 @@ namespace WPZX81.ZX81
font = new Texture2D[256];
matrix = new byte[8];
mem = new byte[0x10000];
- clock = new Clock(16000 * 2, 50);
+ clock = new Clock(16000, 50);
Z80 = new Z80Cpu();
Z80.Initialise(this, this, clock);
Z80.EDNopEvent += EDCallback;
@@ -518,7 +521,7 @@ namespace WPZX81.ZX81
byte IMemory.Read(ushort address)
{
- return mem[address];
+ return mem[address & 0x7fff];
}
void IMemory.Write(ushort address, byte value)