diff --git a/Desktop/Desktop.csproj b/Desktop/Desktop.csproj index d1c6a1a..14a71fd 100644 --- a/Desktop/Desktop.csproj +++ b/Desktop/Desktop.csproj @@ -6,6 +6,17 @@ enable true enable + Desktop.Program + MPSpeccy.ico + Parsons ZX Spectrum Emulator + 0.9.1 + Marc Parsons + Copyright: © 2026 Marc Parsons + A Sinclair ZX Spectrum Emulator (48K and +3) written in C#. + Fully working as standard. TZX support is not fully implemented. + ParsonsZXSpectrum + Parsons Speccy + ParsonsZXSpectrum @@ -32,69 +43,73 @@ + + + + - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never - Always + Never diff --git a/Desktop/MPSpeccy.ico b/Desktop/MPSpeccy.ico new file mode 100644 index 0000000..300bddd Binary files /dev/null and b/Desktop/MPSpeccy.ico differ diff --git a/Desktop/Properties/PublishProfiles/FolderProfile.pubxml b/Desktop/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000..d2add8c --- /dev/null +++ b/Desktop/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,16 @@ + + + + + Release + Any CPU + C:\Parsons\Local Code Projects\Published + FileSystem + <_TargetId>Folder + net8.0-windows + true + win-x86 + true + true + + \ No newline at end of file diff --git a/Desktop/RomLoader.cs b/Desktop/RomLoader.cs index b8a0ecc..7d5cb5d 100644 --- a/Desktop/RomLoader.cs +++ b/Desktop/RomLoader.cs @@ -1,26 +1,33 @@ using System; using System.IO; +using System.Reflection; -namespace Desktop +public static class RomLoader { - public static class RomLoader + public static byte[] Load(string filename) { - public static byte[] Load(string filePath) + // Construct the embedded resource path. + // Assuming your project's default namespace is "Desktop" and the folder is "ROMS" + string resourceName = $"Desktop.{filename}"; + + var assembly = Assembly.GetExecutingAssembly(); + + using (Stream stream = assembly.GetManifestResourceStream(resourceName)) { - if (!File.Exists(filePath)) + if (stream == null) { - throw new FileNotFoundException($"Could not find the ROM file at: {filePath}"); + // BULLETPROOFING: If the string is slightly wrong, this will print out + // exactly what the compiler actually named your embedded files! + string[] availableResources = assembly.GetManifestResourceNames(); + string list = string.Join("\n", availableResources); + throw new FileNotFoundException($"Could not find embedded ROM: {resourceName}\n\nAvailable embedded files are:\n{list}"); } - byte[] romData = File.ReadAllBytes(filePath); - - // The standard ZX Spectrum 48k ROM is exactly 16384 bytes (16KB) - if (romData.Length != 16384) + using (MemoryStream memoryStream = new MemoryStream()) { - throw new InvalidDataException($"Invalid ROM size. Expected 16384 bytes, got {romData.Length} bytes."); + stream.CopyTo(memoryStream); + return memoryStream.ToArray(); } - - return romData; } } } \ No newline at end of file diff --git a/Logo_Parsons.jpg b/Logo_Parsons.jpg new file mode 100644 index 0000000..0cf17e5 Binary files /dev/null and b/Logo_Parsons.jpg differ diff --git a/MPSpeccy.ico b/MPSpeccy.ico new file mode 100644 index 0000000..300bddd Binary files /dev/null and b/MPSpeccy.ico differ diff --git a/logo_Original.jpg b/logo_Original.jpg new file mode 100644 index 0000000..2d32db7 Binary files /dev/null and b/logo_Original.jpg differ