From 2ff6b327dd33456e1566c4f0008d3b2bd92f2d3e Mon Sep 17 00:00:00 2001 From: Ian C Date: Sun, 15 Apr 2012 22:54:30 +0000 Subject: Now got (c) screen on and responding to hard-coded 'A' key. --- wpspec/wpspec/DisassemblerPage.xaml | 25 ++++++++++++++--------- wpspec/wpspec/Resources/Strings.Designer.cs | 24 +++++++++++++++++++--- wpspec/wpspec/Resources/Strings.resx | 12 ++++++++--- wpspec/wpspec/Spectrum/Emulation.cs | 13 +++++++++++- wpspec/wpspec/ViewModels/DisassemblerViewModel.cs | 2 +- 5 files changed, 58 insertions(+), 18 deletions(-) diff --git a/wpspec/wpspec/DisassemblerPage.xaml b/wpspec/wpspec/DisassemblerPage.xaml index 95b149c..1881966 100644 --- a/wpspec/wpspec/DisassemblerPage.xaml +++ b/wpspec/wpspec/DisassemblerPage.xaml @@ -71,13 +71,14 @@ - + + Style="{StaticResource PhoneTextNormalStyle}"/> @@ -246,24 +247,28 @@ - - + + + - - + + - + HorizontalAlignment="Center" + VerticalAlignment="Center"/> - diff --git a/wpspec/wpspec/Resources/Strings.Designer.cs b/wpspec/wpspec/Resources/Strings.Designer.cs index dcee2cd..4a365f0 100644 --- a/wpspec/wpspec/Resources/Strings.Designer.cs +++ b/wpspec/wpspec/Resources/Strings.Designer.cs @@ -118,6 +118,24 @@ namespace wpspec.Resources { } } + /// + /// Looks up a localized string similar to Display Memory. + /// + public static string DisassemblerDisplayMemoryButtonText { + get { + return ResourceManager.GetString("DisassemblerDisplayMemoryButtonText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Display Screen. + /// + public static string DisassemblerDisplayScreenButtonText { + get { + return ResourceManager.GetString("DisassemblerDisplayScreenButtonText", resourceCulture); + } + } + /// /// Looks up a localized string similar to Disassembler. /// @@ -191,7 +209,7 @@ namespace wpspec.Resources { } /// - /// Looks up a localized string similar to Open Spectrum State. + /// Looks up a localized string similar to Open State. /// public static string OpenLocalTapePageTitle { get { @@ -209,7 +227,7 @@ namespace wpspec.Resources { } /// - /// Looks up a localized string similar to Open Remote Tape File. + /// Looks up a localized string similar to Open Tape. /// public static string OpenRemoteTapePageTitle { get { @@ -245,7 +263,7 @@ namespace wpspec.Resources { } /// - /// Looks up a localized string similar to Save Spectrum State. + /// Looks up a localized string similar to Save State. /// public static string SaveLocalTapePageTitle { get { diff --git a/wpspec/wpspec/Resources/Strings.resx b/wpspec/wpspec/Resources/Strings.resx index 2a0b059..46679e3 100644 --- a/wpspec/wpspec/Resources/Strings.resx +++ b/wpspec/wpspec/Resources/Strings.resx @@ -139,6 +139,12 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY Disassembler + + Display Memory + + + Display Screen + Disassembler @@ -164,13 +170,13 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY Open State - Open Spectrum State + Open State Open Remote Tape - Open Remote Tape File + Open Tape Copyright of the included Spectrum 48K ROM is held by Amstrad PLC, and the ROM image is included with their kind permission. @@ -182,7 +188,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY Save State - Save Spectrum State + Save State Select Game to open diff --git a/wpspec/wpspec/Spectrum/Emulation.cs b/wpspec/wpspec/Spectrum/Emulation.cs index 1b86a93..9360462 100644 --- a/wpspec/wpspec/Spectrum/Emulation.cs +++ b/wpspec/wpspec/Spectrum/Emulation.cs @@ -28,6 +28,7 @@ namespace wpspec.Spectrum private readonly byte[] matrix = new byte[9]; private readonly int[] screenAccel = new int[192]; + private readonly int[] attrAccel = new int[192]; //private readonly uint[] colours = new uint[16] //{ @@ -119,7 +120,7 @@ namespace wpspec.Spectrum for(int x = 0; x < 32; x++) { - attr = mem[0x5800 + x + clock.RasterLine / 8 * 32]; + attr = mem[attrAccel[clock.RasterLine - 64] + x]; ink = attr & 0x07; paper = (attr & 0x38) >> 3; @@ -322,8 +323,17 @@ namespace wpspec.Spectrum matrix[f] = 0x1f; } + matrix[1] ^= 1; + matrix[8] = 0; + Random rnd = new Random(); + + for(int f = 0x4000; f < 0x10000; f++) + { + mem[f] = (byte)rnd.Next(Byte.MaxValue); + } + // Initialise the Z80 // Z80.Reset(); @@ -379,6 +389,7 @@ namespace wpspec.Spectrum for(int f = 0; f < 192; f++) { + attrAccel[f] = 0x5800 + f / 8 * 32; screenAccel[f] = 0x4000 + (c * 8 * 32) + (r * 32); c++; diff --git a/wpspec/wpspec/ViewModels/DisassemblerViewModel.cs b/wpspec/wpspec/ViewModels/DisassemblerViewModel.cs index 2b10f98..367778e 100644 --- a/wpspec/wpspec/ViewModels/DisassemblerViewModel.cs +++ b/wpspec/wpspec/ViewModels/DisassemblerViewModel.cs @@ -196,7 +196,7 @@ namespace wpspec.ViewModels string opcode; string hexdump; - for(int f = 0 ; f < 15; f++) + for(int f = 0 ; f < 18; f++) { pc = Shared.Spectrum.Disassembler.Disassemble(pc, out address, out opcode, out hexdump); list.Add(new DisassemblerLine() {Address = address, Opcode = opcode, Hexdump = hexdump}); -- cgit v1.2.3