Wire up B&W/colo(u)r switch in Stella (resolves #3203)
unmanaged side was done in 3af38050f
(#4178)
This commit is contained in:
parent
15d920550a
commit
b5e13206cf
|
@ -11,6 +11,8 @@ namespace BizHawk.Emulation.Cores.Atari.Stella
|
||||||
private bool _leftDifficultyToggled;
|
private bool _leftDifficultyToggled;
|
||||||
private bool _rightDifficultyToggled;
|
private bool _rightDifficultyToggled;
|
||||||
|
|
||||||
|
private bool _colorVideoToggled = true;
|
||||||
|
|
||||||
public bool FrameAdvance(IController controller, bool render, bool renderSound)
|
public bool FrameAdvance(IController controller, bool render, bool renderSound)
|
||||||
{
|
{
|
||||||
byte port1 = _controllerDeck.ReadPort1(controller);
|
byte port1 = _controllerDeck.ReadPort1(controller);
|
||||||
|
@ -19,12 +21,13 @@ namespace BizHawk.Emulation.Cores.Atari.Stella
|
||||||
// Handle all the console switches here
|
// Handle all the console switches here
|
||||||
if (controller.IsPressed("Toggle Right Difficulty")) _rightDifficultyToggled = !_rightDifficultyToggled;
|
if (controller.IsPressed("Toggle Right Difficulty")) _rightDifficultyToggled = !_rightDifficultyToggled;
|
||||||
if (controller.IsPressed("Toggle Left Difficulty")) _leftDifficultyToggled = !_leftDifficultyToggled;
|
if (controller.IsPressed("Toggle Left Difficulty")) _leftDifficultyToggled = !_leftDifficultyToggled;
|
||||||
|
if (controller.IsPressed("Toggle TV Type")) _colorVideoToggled = !_colorVideoToggled;
|
||||||
|
|
||||||
// select and reset switches default to an unpressed state
|
// select and reset switches default to an unpressed state
|
||||||
// unknown whether TV color switch matters for TASing, so default to Color for now
|
byte switchPort = 0b0000_0011;
|
||||||
byte switchPort = 0b00001011;
|
|
||||||
if (_rightDifficultyToggled) switchPort |= 0b10000000;
|
if (_rightDifficultyToggled) switchPort |= 0b10000000;
|
||||||
if (_leftDifficultyToggled) switchPort |= 0b01000000;
|
if (_leftDifficultyToggled) switchPort |= 0b01000000;
|
||||||
|
if (_colorVideoToggled) switchPort |= 0b0000_1000;
|
||||||
if (controller.IsPressed("Select")) switchPort &= 0b11111101; // 0 = Pressed
|
if (controller.IsPressed("Select")) switchPort &= 0b11111101; // 0 = Pressed
|
||||||
if (controller.IsPressed("Reset")) switchPort &= 0b11111110; // 0 = Pressed
|
if (controller.IsPressed("Reset")) switchPort &= 0b11111110; // 0 = Pressed
|
||||||
|
|
||||||
|
|
|
@ -16,11 +16,15 @@ namespace BizHawk.Emulation.Cores.Atari.Stella
|
||||||
{
|
{
|
||||||
BoolButtons = Port1.Definition.BoolButtons
|
BoolButtons = Port1.Definition.BoolButtons
|
||||||
.Concat(Port2.Definition.BoolButtons)
|
.Concat(Port2.Definition.BoolButtons)
|
||||||
.Concat(
|
.Concat([
|
||||||
[
|
"Reset",
|
||||||
"Reset", "Select", "Power", "Toggle Left Difficulty", "Toggle Right Difficulty"
|
"Select",
|
||||||
|
"Power",
|
||||||
|
"Toggle Left Difficulty",
|
||||||
|
"Toggle Right Difficulty",
|
||||||
|
"Toggle TV Type",
|
||||||
])
|
])
|
||||||
.ToList()
|
.ToList(),
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var kvp in Port1.Definition.Axes) Definition.Axes.Add(kvp);
|
foreach (var kvp in Port1.Definition.Axes) Definition.Axes.Add(kvp);
|
||||||
|
|
|
@ -201,7 +201,7 @@ namespace BizHawk.Emulation.Cores
|
||||||
{
|
{
|
||||||
return new ConsoleSchema
|
return new ConsoleSchema
|
||||||
{
|
{
|
||||||
Size = new Size(185, 75),
|
Size = new(185, 90),
|
||||||
Buttons = new[]
|
Buttons = new[]
|
||||||
{
|
{
|
||||||
new ButtonSchema(10, 15, "Select"),
|
new ButtonSchema(10, 15, "Select"),
|
||||||
|
@ -214,8 +214,9 @@ namespace BizHawk.Emulation.Cores
|
||||||
new ButtonSchema(92, 40, "Toggle Right Difficulty")
|
new ButtonSchema(92, 40, "Toggle Right Difficulty")
|
||||||
{
|
{
|
||||||
DisplayName = "Right Difficulty"
|
DisplayName = "Right Difficulty"
|
||||||
}
|
},
|
||||||
}
|
new ButtonSchema(10, 65, "Toggle TV Type") { DisplayName = "B&W / Color" },
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue