61 lines
1.0 KiB
C#
61 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
|
|
using BizHawk.Common;
|
|
using BizHawk.Emulation.Common;
|
|
|
|
namespace BizHawk.Emulation.Cores.Consoles.Vectrex
|
|
{
|
|
/// <summary>
|
|
/// Represents a Vectrex add on
|
|
/// </summary>
|
|
public interface IPort
|
|
{
|
|
byte Read(IController c);
|
|
|
|
ControllerDefinition Definition { get; }
|
|
|
|
void SyncState(Serializer ser);
|
|
|
|
int PortNum { get; }
|
|
}
|
|
|
|
[DisplayName("Vectrex Controller")]
|
|
public class StandardControls : IPort
|
|
{
|
|
public StandardControls(int portNum)
|
|
{
|
|
PortNum = portNum;
|
|
Definition = new ControllerDefinition
|
|
{
|
|
Name = "Vectrex Controller",
|
|
BoolButtons = BaseDefinition
|
|
.Select(b => "P" + PortNum + " " + b)
|
|
.ToList()
|
|
};
|
|
}
|
|
|
|
public int PortNum { get; }
|
|
|
|
public ControllerDefinition Definition { get; }
|
|
|
|
public byte Read(IController c)
|
|
{
|
|
byte result = 0xFF;
|
|
|
|
return result;
|
|
}
|
|
|
|
private static readonly string[] BaseDefinition =
|
|
{
|
|
|
|
};
|
|
|
|
public void SyncState(Serializer ser)
|
|
{
|
|
//nothing
|
|
}
|
|
}
|
|
} |