Started 128K model

This commit is contained in:
2026-04-29 22:07:49 +01:00
parent 952db4767b
commit f628848127
4 changed files with 78 additions and 31 deletions

View File

@@ -9,8 +9,14 @@ using System.Threading.Tasks;
namespace Core
{
public enum MachineModel
{
Spectrum48K,
SpectrumPlus2A
}
public class SpectrumMachine
{
public MachineModel CurrentModel { get; private set; } = MachineModel.Spectrum48K;
// The Hardware
public Z80 Cpu { get; private set; }
public MemoryBus Memory { get; private set; }
@@ -43,6 +49,15 @@ namespace Core
public event Action<double, bool>? OnStatsUpdated; // Passes FPS and TapeLoaded status
public event Action<string>? OnMachineCrashed;
public void SetMachineModel(MachineModel newModel)
{
if (CurrentModel == newModel) return; // Do nothing if it's the same
CurrentModel = newModel;
// Flag the main loop to perform a hard reset on the next frame
_pendingReset = true;
}
public SpectrumMachine(IAudioDevice beeperDevice)
{
_beeper = beeperDevice;