Different controller definition for Game Gear than SMS, since game gear is 1 player and has a start button and no pause button

This commit is contained in:
adelikat 2014-06-27 02:09:17 +00:00
parent f3cac5deff
commit 179a5c3bb4
1 changed files with 34 additions and 2 deletions

View File

@ -15,7 +15,29 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
}
};
public ControllerDefinition ControllerDefinition { get { return SmsController; } }
public static readonly ControllerDefinition GGController = new ControllerDefinition
{
Name = "GG Controller",
BoolButtons =
{
"Reset",
"P1 Up", "P1 Down", "P1 Left", "P1 Right", "P1 B1", "P1 B2", "P1 Start"
}
};
public ControllerDefinition ControllerDefinition
{
get
{
if (IsGameGear)
{
return GGController;
}
return SmsController;
}
}
public IController Controller { get; set; }
byte ReadControls1()
@ -71,12 +93,22 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
byte ReadPort0()
{
if (IsGameGear == false)
{
return 0xFF;
}
byte value = 0xFF;
if (Controller["Pause"])
if ((Controller["Pause"] && !IsGameGear) ||
(Controller["Start"] && IsGameGear))
{
value ^= 0x80;
}
if (Region == "Japan")
{
value ^= 0x40;
}
return value;
}
}