2017-11-29 21:31:53 +00:00
|
|
|
|
using BizHawk.Emulation.Cores.Components.Z80A;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2019-04-03 16:01:35 +00:00
|
|
|
|
using BizHawk.Emulation.Cores.Sound;
|
2017-11-29 21:31:53 +00:00
|
|
|
|
|
|
|
|
|
namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|
|
|
|
{
|
2019-12-06 23:47:59 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 48K construction
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class ZX48 : SpectrumBase
|
|
|
|
|
{
|
|
|
|
|
#region Construction
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Main constructor
|
|
|
|
|
/// </summary>
|
|
|
|
|
public ZX48(ZXSpectrum spectrum, Z80A cpu, ZXSpectrum.BorderType borderType, List<byte[]> files, List<JoystickType> joysticks)
|
|
|
|
|
{
|
|
|
|
|
Spectrum = spectrum;
|
|
|
|
|
CPU = cpu;
|
|
|
|
|
|
|
|
|
|
CPUMon = new CPUMonitor(this);
|
|
|
|
|
ULADevice = new Screen48(this);
|
2017-12-11 12:54:48 +00:00
|
|
|
|
|
2019-04-03 16:01:35 +00:00
|
|
|
|
BuzzerDevice = new OneBitBeeper(44100, ULADevice.FrameLength, 50, "SystemBuzzer");
|
2017-11-29 21:31:53 +00:00
|
|
|
|
|
2019-04-03 16:01:35 +00:00
|
|
|
|
TapeBuzzer = new OneBitBeeper(44100, ULADevice.FrameLength, 50, "TapeBuzzer");
|
2018-03-27 13:12:51 +00:00
|
|
|
|
|
2019-04-03 16:01:35 +00:00
|
|
|
|
KeyboardDevice = new StandardKeyboard(this);
|
2018-03-06 15:47:14 +00:00
|
|
|
|
|
2019-12-06 23:47:59 +00:00
|
|
|
|
InitJoysticks(joysticks);
|
2018-03-06 15:47:14 +00:00
|
|
|
|
|
2019-12-06 23:47:59 +00:00
|
|
|
|
TapeDevice = new DatacorderDevice(spectrum.SyncSettings.AutoLoadTape);
|
|
|
|
|
TapeDevice.Init(this);
|
2018-03-05 11:17:22 +00:00
|
|
|
|
|
2019-12-06 23:47:59 +00:00
|
|
|
|
InitializeMedia(files);
|
|
|
|
|
}
|
2017-11-29 21:31:53 +00:00
|
|
|
|
|
2019-12-06 23:47:59 +00:00
|
|
|
|
#endregion
|
2018-03-20 15:28:23 +00:00
|
|
|
|
|
2019-12-06 23:47:59 +00:00
|
|
|
|
#region Reset
|
2018-03-20 15:28:23 +00:00
|
|
|
|
|
2019-12-06 23:47:59 +00:00
|
|
|
|
public override void HardReset()
|
|
|
|
|
{
|
|
|
|
|
base.HardReset();
|
2018-03-20 15:28:23 +00:00
|
|
|
|
|
2019-12-06 23:47:59 +00:00
|
|
|
|
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
|
|
|
|
}
|