BizHawk/BizHawk.Emulation.Cores/Consoles/Intellivision/PSG.cs

45 lines
809 B
C#
Raw Normal View History

using System;
using BizHawk.Common;
namespace BizHawk.Emulation.Cores.Intellivision
{
public sealed class PSG
{
public ushort[] Register = new ushort[16];
public int TotalExecutedCycles;
public int PendingCycles;
public Func<ushort, ushort> ReadMemory;
public Func<ushort, ushort, bool> WriteMemory;
public void SyncState(Serializer ser)
{
ser.BeginSection("PSG");
// TODO
ser.EndSection();
}
public ushort? ReadPSG(ushort addr)
{
if (addr >= 0x01F0 && addr <= 0x01FF)
{
return Register[addr - 0x01F0];
}
return null;
}
public bool WritePSG(ushort addr, ushort value)
{
if (addr >= 0x01F0 && addr <= 0x01FF)
{
Register[addr - 0x01F0] = value;
return true;
}
return false;
}
}
}