diff options
-rw-r--r-- | non-solution-items/joystick.pspimage | bin | 177807 -> 434055 bytes | |||
-rw-r--r-- | non-solution-items/keyboard.pspimage | bin | 179160 -> 283395 bytes | |||
-rw-r--r-- | non-solution-items/keypad.pspimage | bin | 177378 -> 475500 bytes | |||
-rw-r--r-- | wpspec/wpspec/GamePage.xaml.cs | 2 | ||||
-rw-r--r-- | wpspec/wpspec/Resources/Spectrum.keyboard | bin | 1032 -> 1032 bytes | |||
-rw-r--r-- | wpspec/wpspec/Spectrum/Emulation.cs | 34 | ||||
-rw-r--r-- | wpspec/wpspecLibContent/keyboard.png | bin | 46980 -> 27208 bytes |
7 files changed, 25 insertions, 11 deletions
diff --git a/non-solution-items/joystick.pspimage b/non-solution-items/joystick.pspimage Binary files differindex b19dc3c..6efe0c0 100644 --- a/non-solution-items/joystick.pspimage +++ b/non-solution-items/joystick.pspimage diff --git a/non-solution-items/keyboard.pspimage b/non-solution-items/keyboard.pspimage Binary files differindex 7bbadad..90cc1cc 100644 --- a/non-solution-items/keyboard.pspimage +++ b/non-solution-items/keyboard.pspimage diff --git a/non-solution-items/keypad.pspimage b/non-solution-items/keypad.pspimage Binary files differindex a9796fa..29a3003 100644 --- a/non-solution-items/keypad.pspimage +++ b/non-solution-items/keypad.pspimage diff --git a/wpspec/wpspec/GamePage.xaml.cs b/wpspec/wpspec/GamePage.xaml.cs index fef97d2..c20fde4 100644 --- a/wpspec/wpspec/GamePage.xaml.cs +++ b/wpspec/wpspec/GamePage.xaml.cs @@ -110,7 +110,7 @@ namespace wpspec keyboard = new KeyboardDriver<SpectrumKeySymbol>
(SharedGraphicsDeviceManager.Current.GraphicsDevice,
keyboardImage,
- new Vector2(0, 540),
+ new Vector2(0, 470),
Shared.SpectrumKeyboard);
keyboard.KeyEvent += HandleKeyboardEvent;
diff --git a/wpspec/wpspec/Resources/Spectrum.keyboard b/wpspec/wpspec/Resources/Spectrum.keyboard Binary files differindex 065b5b2..7dcd95a 100644 --- a/wpspec/wpspec/Resources/Spectrum.keyboard +++ b/wpspec/wpspec/Resources/Spectrum.keyboard diff --git a/wpspec/wpspec/Spectrum/Emulation.cs b/wpspec/wpspec/Spectrum/Emulation.cs index d832f53..b6fa03a 100644 --- a/wpspec/wpspec/Spectrum/Emulation.cs +++ b/wpspec/wpspec/Spectrum/Emulation.cs @@ -116,8 +116,10 @@ namespace wpspec.Spectrum // Sound buffer
//
- private byte[] soundBuffer = new byte[960 * 2]; // 48000kzh / 50 = 960hz
+ private byte[] soundBuffer = new byte[40 * 2]; // 48000kzh / 50 / 24 = 40hz
private const float samplesPerCycle = 960f / 69888f;
+ private bool soundPlayed = false;
+ private int soundLineCount = 0;
#endregion
@@ -150,6 +152,25 @@ namespace wpspec.Spectrum int p = clock.RasterLine * Width;
byte b;
+ // Check for sound
+ //
+ if (++soundLineCount >= 13)
+ {
+ if (soundPlayed)
+ {
+ if (Settings.Sound)
+ {
+ SoundManager.Play(soundBuffer);
+ }
+
+ soundBuffer = new byte[soundBuffer.Length];
+ soundPlayed = false;
+ }
+
+ soundLineCount = 0;
+ clock.CycleCount = 0;
+ }
+
// Just draw border for these lines
//
if (clock.RasterLine < 64 || clock.RasterLine > 255)
@@ -217,15 +238,6 @@ namespace wpspec.Spectrum flash = !flash;
}
-
- if (Settings.Sound)
- {
- SoundManager.Play(soundBuffer);
- }
-
- clock.CycleCount = 0;
- soundBuffer = new byte[soundBuffer.Length];
-
Z80.MaskableInterrupt(0xff);
}
@@ -435,6 +447,8 @@ namespace wpspec.Spectrum if ((value & 0x10) == 0x10)
{
+ soundPlayed = true;
+
int index = (int)(clock.CycleCount * samplesPerCycle * 2);
if (index >= soundBuffer.Length - 1)
diff --git a/wpspec/wpspecLibContent/keyboard.png b/wpspec/wpspecLibContent/keyboard.png Binary files differindex 73a29a7..7657f3d 100644 --- a/wpspec/wpspecLibContent/keyboard.png +++ b/wpspec/wpspecLibContent/keyboard.png |