diff options
-rw-r--r-- | WPZX81/WPZX81/GamePage.xaml.cs | 2 | ||||
-rw-r--r-- | WPZX81/WPZX81/Settings.cs | 6 | ||||
-rw-r--r-- | WPZX81/WPZX81/SplashScreenImage.jpg | bin | 64334 -> 171227 bytes | |||
-rw-r--r-- | WPZX81/WPZX81/ZX81/Emulation.cs | 33 |
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 Binary files differindex 5cdc466..860b321 100644 --- a/WPZX81/WPZX81/SplashScreenImage.jpg +++ b/WPZX81/WPZX81/SplashScreenImage.jpg 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)
|