Changed some assembly settings
This commit is contained in:
@@ -6,6 +6,17 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<StartupObject>Desktop.Program</StartupObject>
|
||||
<ApplicationIcon>MPSpeccy.ico</ApplicationIcon>
|
||||
<Title>Parsons ZX Spectrum Emulator</Title>
|
||||
<Version>0.9.1</Version>
|
||||
<Authors>Marc Parsons</Authors>
|
||||
<Copyright>Copyright: © 2026 Marc Parsons</Copyright>
|
||||
<Description>A Sinclair ZX Spectrum Emulator (48K and +3) written in C#.</Description>
|
||||
<PackageReleaseNotes>Fully working as standard. TZX support is not fully implemented.</PackageReleaseNotes>
|
||||
<PackageId>ParsonsZXSpectrum</PackageId>
|
||||
<Product>Parsons Speccy</Product>
|
||||
<AssemblyName>ParsonsZXSpectrum</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -32,69 +43,73 @@
|
||||
<None Remove="ROMS\TZX\Split Personalities2.tzx" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="MPSpeccy.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="48.rom">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="plus3-0.rom">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="plus3-1.rom">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="plus3-2.rom">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="plus3-3.rom">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\Snapshot\ChuckieEgg.sna">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\Snapshot\Dizzy - Trasure Island.sna">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\Snapshot\GHILL48K.sna">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\Snapshot\manic.sna">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\Snapshot\tristam.sna">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\TAP\Chuckie Egg.tap">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\TAP\Grange Hill.TAP">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\TAP\Grange Hill128.TAP">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\TAP\Manic Miner.TAP">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\TAP\Treasure Island - Dizzy.tap">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\TAP\zexall.tap">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\TZX\Batman - Release 1.tzx">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\TZX\Renegade 2 - Target Renegade - Side 1.tzx">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\TZX\Renegade 2 - Target Renegade - Side 2.tzx">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\TZX\Split Personalities1.tzx">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ROMS\TZX\Split Personalities2.tzx">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
BIN
Desktop/MPSpeccy.ico
Normal file
BIN
Desktop/MPSpeccy.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
16
Desktop/Properties/PublishProfiles/FolderProfile.pubxml
Normal file
16
Desktop/Properties/PublishProfiles/FolderProfile.pubxml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- https://go.microsoft.com/fwlink/?LinkID=208121. -->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Any CPU</Platform>
|
||||
<PublishDir>C:\Parsons\Local Code Projects\Published</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<_TargetId>Folder</_TargetId>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<SelfContained>true</SelfContained>
|
||||
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishReadyToRun>true</PublishReadyToRun>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,26 +1,33 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Desktop
|
||||
{
|
||||
public static class RomLoader
|
||||
{
|
||||
public static byte[] Load(string filePath)
|
||||
public static byte[] Load(string filename)
|
||||
{
|
||||
if (!File.Exists(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))
|
||||
{
|
||||
throw new FileNotFoundException($"Could not find the ROM file at: {filePath}");
|
||||
if (stream == null)
|
||||
{
|
||||
// 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.");
|
||||
}
|
||||
|
||||
return romData;
|
||||
stream.CopyTo(memoryStream);
|
||||
return memoryStream.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Logo_Parsons.jpg
Normal file
BIN
Logo_Parsons.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
MPSpeccy.ico
Normal file
BIN
MPSpeccy.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
logo_Original.jpg
Normal file
BIN
logo_Original.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
Reference in New Issue
Block a user