2013-11-04 01:39:19 +00:00
|
|
|
|
using BizHawk.Emulation.Common;
|
2017-02-12 00:40:57 +00:00
|
|
|
|
using System;
|
2013-11-04 01:39:19 +00:00
|
|
|
|
|
2013-11-13 03:32:25 +00:00
|
|
|
|
namespace BizHawk.Emulation.Cores.ColecoVision
|
2012-11-17 17:39:33 +00:00
|
|
|
|
{
|
2013-11-04 01:39:19 +00:00
|
|
|
|
public partial class ColecoVision
|
|
|
|
|
{
|
2017-03-01 02:44:05 +00:00
|
|
|
|
/* public static readonly ControllerDefinition ColecoVisionControllerDefinition = new ControllerDefinition
|
2013-11-04 01:39:19 +00:00
|
|
|
|
{
|
|
|
|
|
Name = "ColecoVision Basic Controller",
|
|
|
|
|
BoolButtons =
|
2012-11-17 17:39:33 +00:00
|
|
|
|
{
|
|
|
|
|
"P1 Up", "P1 Down", "P1 Left", "P1 Right",
|
2012-11-18 02:32:07 +00:00
|
|
|
|
"P1 L", "P1 R",
|
2014-06-29 12:32:36 +00:00
|
|
|
|
"P1 Key 0", "P1 Key 1", "P1 Key 2", "P1 Key 3", "P1 Key 4", "P1 Key 5",
|
|
|
|
|
"P1 Key 6", "P1 Key 7", "P1 Key 8", "P1 Key 9", "P1 Star", "P1 Pound",
|
2012-11-17 17:39:33 +00:00
|
|
|
|
|
2012-11-17 21:38:21 +00:00
|
|
|
|
"P2 Up", "P2 Down", "P2 Left", "P2 Right",
|
2012-11-18 02:32:07 +00:00
|
|
|
|
"P2 L", "P2 R",
|
2014-06-29 12:32:36 +00:00
|
|
|
|
"P2 Key 0", "P2 Key 1", "P2 Key 2", "P2 Key 3", "P2 Key 4", "P2 Key 5",
|
|
|
|
|
"P2 Key 6", "P2 Key 7", "P2 Key 8", "P2 Key 9", "P2 Star", "P2 Pound"
|
2012-11-17 17:39:33 +00:00
|
|
|
|
}
|
2013-11-04 01:39:19 +00:00
|
|
|
|
};
|
2017-03-01 02:44:05 +00:00
|
|
|
|
*/
|
|
|
|
|
public enum InputPortMode { Left, Right }
|
2013-11-04 01:39:19 +00:00
|
|
|
|
InputPortMode InputPortSelection;
|
|
|
|
|
|
|
|
|
|
byte ReadController1()
|
|
|
|
|
{
|
2014-12-05 03:16:08 +00:00
|
|
|
|
_isLag = false;
|
2017-03-01 02:44:05 +00:00
|
|
|
|
byte retval;
|
2013-11-04 01:39:19 +00:00
|
|
|
|
if (InputPortSelection == InputPortMode.Left)
|
|
|
|
|
{
|
2017-03-23 14:40:32 +00:00
|
|
|
|
retval = ControllerDeck.ReadPort1(Controller, true, false);
|
2013-11-04 01:39:19 +00:00
|
|
|
|
return retval;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (InputPortSelection == InputPortMode.Right)
|
|
|
|
|
{
|
2017-03-23 01:26:51 +00:00
|
|
|
|
retval = ControllerDeck.ReadPort1(Controller, false, false);
|
2013-11-04 01:39:19 +00:00
|
|
|
|
return retval;
|
|
|
|
|
}
|
|
|
|
|
return 0x7F;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
byte ReadController2()
|
|
|
|
|
{
|
2014-12-05 03:16:08 +00:00
|
|
|
|
_isLag = false;
|
2017-03-01 02:44:05 +00:00
|
|
|
|
byte retval;
|
2013-11-04 01:39:19 +00:00
|
|
|
|
if (InputPortSelection == InputPortMode.Left)
|
|
|
|
|
{
|
2017-03-23 14:40:32 +00:00
|
|
|
|
retval = ControllerDeck.ReadPort2(Controller, true, false);
|
2013-11-04 01:39:19 +00:00
|
|
|
|
return retval;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (InputPortSelection == InputPortMode.Right)
|
|
|
|
|
{
|
2017-03-23 01:26:51 +00:00
|
|
|
|
retval = ControllerDeck.ReadPort2(Controller, false, false);
|
2013-11-04 01:39:19 +00:00
|
|
|
|
return retval;
|
|
|
|
|
}
|
|
|
|
|
return 0x7F;
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-22 04:46:01 +00:00
|
|
|
|
public int Frame { get { return frame; } set { frame = value; } }
|
|
|
|
|
int frame;
|
2013-11-04 01:39:19 +00:00
|
|
|
|
}
|
2012-11-17 17:39:33 +00:00
|
|
|
|
}
|