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

60 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 System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
{
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>
/// <param name="spectrum"></param>
/// <param name="cpu"></param>
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;
ULADevice = new ULA48(this);
2017-11-29 21:31:53 +00:00
BuzzerDevice = new Buzzer(this);
BuzzerDevice.Init(44100, ULADevice.FrameLength);
2017-11-29 21:31:53 +00:00
TapeBuzzer = new Buzzer(this);
TapeBuzzer.Init(44100, ULADevice.FrameLength);
KeyboardDevice = new StandardKeyboard(this);
InitJoysticks(joysticks);
TapeDevice = new DatacorderDevice();
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
}
}