BizHawk/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.cs

58 lines
1.5 KiB
C#
Raw Normal View History

2017-11-29 21:31:53 +00:00
using BizHawk.Emulation.Cores.Components.Z80A;
using System;
using System.Collections.Generic;
using BizHawk.Emulation.Cores.Sound;
2017-11-29 21:31:53 +00:00
namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
{
2018-06-14 10:31:09 +00:00
/// <summary>
/// 48K construction
/// </summary>
2017-12-05 10:02:57 +00:00
public partial class ZX48 : SpectrumBase
2017-11-29 21:31:53 +00:00
{
#region Construction
/// <summary>
/// Main constructor
/// </summary>
public ZX48(ZXSpectrum spectrum, Z80A cpu, ZXSpectrum.BorderType borderType, List<byte[]> files, List<JoystickType> joysticks)
2017-11-29 21:31:53 +00:00
{
Spectrum = spectrum;
CPU = cpu;
2018-05-31 16:54:57 +00:00
CPUMon = new CPUMonitor(this);
ULADevice = new Screen48(this);
BuzzerDevice = new OneBitBeeper(44100, ULADevice.FrameLength, 50, "SystemBuzzer");
2017-11-29 21:31:53 +00:00
TapeBuzzer = new OneBitBeeper(44100, ULADevice.FrameLength, 50, "TapeBuzzer");
KeyboardDevice = new StandardKeyboard(this);
InitJoysticks(joysticks);
TapeDevice = new DatacorderDevice(spectrum.SyncSettings.AutoLoadTape);
2017-11-29 21:31:53 +00:00
TapeDevice.Init(this);
InitializeMedia(files);
2017-11-29 21:31:53 +00:00
}
#endregion
2018-03-20 15:28:23 +00:00
#region Reset
public override void HardReset()
{
base.HardReset();
Random rn = new Random();
for (int d = 0; d < 6912; d++)
{
RAM0[d] = (byte)rn.Next(255);
}
}
#endregion
2017-11-29 21:31:53 +00:00
}
}