Atari - implement console switches (as menu items)
This commit is contained in:
parent
d322c3c00f
commit
3d10431a2b
|
@ -209,15 +209,20 @@ namespace BizHawk
|
|||
return value;
|
||||
}
|
||||
|
||||
private bool bw = false;
|
||||
private bool p0difficulty = true;
|
||||
private bool p1difficulty = true;
|
||||
|
||||
public void SetBw(bool setting) { bw = setting; }
|
||||
public void SetP0Diff(bool setting) { p0difficulty = setting; }
|
||||
public void SetP1Diff(bool setting) { p1difficulty = setting; }
|
||||
|
||||
public byte ReadConsoleSwitches()
|
||||
{
|
||||
byte value = 0xFF;
|
||||
|
||||
bool select = Controller["Select"];
|
||||
bool reset = Controller["Reset"];
|
||||
bool bw = false;
|
||||
bool p0difficulty = true;
|
||||
bool p1difficulty = true;
|
||||
|
||||
if (reset) value &= 0xFE;
|
||||
if (select) value &= 0xFD;
|
||||
|
|
|
@ -490,6 +490,9 @@ namespace BizHawk.MultiClient
|
|||
public Atari2600ControllerTemplate[] Atari2600Controller = new Atari2600ControllerTemplate[2];
|
||||
public Atari2600ControllerTemplate[] Atari2600AutoController = new Atari2600ControllerTemplate[2];
|
||||
public Atari2600ConsoleButtonsTemplate[] Atari2600ConsoleButtons = new Atari2600ConsoleButtonsTemplate[1];
|
||||
public bool Atari2600_BW = false;
|
||||
public bool Atari2600_LeftDifficulty = true;
|
||||
public bool Atari2600_RightDifficulty = true;
|
||||
|
||||
//GameBoy Settings
|
||||
public NESControllerTemplate GameBoyController = new NESControllerTemplate(true);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -933,52 +933,38 @@ namespace BizHawk.MultiClient
|
|||
string system = "";
|
||||
if (Global.Game != null)
|
||||
system = Global.Game.System;
|
||||
|
||||
tI83ToolStripMenuItem.Visible = false;
|
||||
NESToolStripMenuItem.Visible = false;
|
||||
pCEToolStripMenuItem.Visible = false;
|
||||
sMSToolStripMenuItem.Visible = false;
|
||||
gBToolStripMenuItem.Visible = false;
|
||||
atariToolStripMenuItem.Visible = false;
|
||||
switch (system)
|
||||
{
|
||||
|
||||
case "TI83":
|
||||
NESToolStripMenuItem.Visible = false;
|
||||
tI83ToolStripMenuItem.Visible = true;
|
||||
pCEToolStripMenuItem.Visible = false;
|
||||
sMSToolStripMenuItem.Visible = false;
|
||||
gBToolStripMenuItem.Visible = false;
|
||||
break;
|
||||
case "NES":
|
||||
NESToolStripMenuItem.Visible = true;
|
||||
tI83ToolStripMenuItem.Visible = false;
|
||||
pCEToolStripMenuItem.Visible = false;
|
||||
sMSToolStripMenuItem.Visible = false;
|
||||
gBToolStripMenuItem.Visible = false;
|
||||
break;
|
||||
case "PCE":
|
||||
case "PCECD":
|
||||
case "SGX":
|
||||
NESToolStripMenuItem.Visible = false;
|
||||
tI83ToolStripMenuItem.Visible = false;
|
||||
pCEToolStripMenuItem.Visible = true;
|
||||
sMSToolStripMenuItem.Visible = false;
|
||||
gBToolStripMenuItem.Visible = false;
|
||||
break;
|
||||
case "SMS":
|
||||
case "SG":
|
||||
tI83ToolStripMenuItem.Visible = false;
|
||||
NESToolStripMenuItem.Visible = false;
|
||||
pCEToolStripMenuItem.Visible = false;
|
||||
sMSToolStripMenuItem.Visible = true;
|
||||
gBToolStripMenuItem.Visible = false;
|
||||
break;
|
||||
case "GB":
|
||||
NESToolStripMenuItem.Visible = false;
|
||||
tI83ToolStripMenuItem.Visible = false;
|
||||
pCEToolStripMenuItem.Visible = false;
|
||||
sMSToolStripMenuItem.Visible = false;
|
||||
gBToolStripMenuItem.Visible = true;
|
||||
break;
|
||||
case "A26":
|
||||
atariToolStripMenuItem.Visible = true;
|
||||
break;
|
||||
default:
|
||||
tI83ToolStripMenuItem.Visible = false;
|
||||
NESToolStripMenuItem.Visible = false;
|
||||
pCEToolStripMenuItem.Visible = false;
|
||||
sMSToolStripMenuItem.Visible = false;
|
||||
gBToolStripMenuItem.Visible = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1197,6 +1183,9 @@ namespace BizHawk.MultiClient
|
|||
break;
|
||||
case "A26":
|
||||
nextEmulator = new Atari2600(game, rom.FileData);
|
||||
((Atari2600)nextEmulator).SetBw(Global.Config.Atari2600_BW);
|
||||
((Atari2600)nextEmulator).SetP0Diff(Global.Config.Atari2600_LeftDifficulty);
|
||||
((Atari2600)nextEmulator).SetP1Diff(Global.Config.Atari2600_RightDifficulty);
|
||||
break;
|
||||
case "PCE":
|
||||
case "PCECD":
|
||||
|
@ -3008,5 +2997,51 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
FrameBufferResized();
|
||||
}
|
||||
|
||||
private void bWToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Global.Emulator is Atari2600)
|
||||
{
|
||||
Global.Config.Atari2600_BW ^= true;
|
||||
((Atari2600)Global.Emulator).SetBw(Global.Config.Atari2600_BW);
|
||||
if (Global.Config.Atari2600_BW)
|
||||
Global.OSD.AddMessage("Setting to Black and White Switch to On");
|
||||
else
|
||||
Global.OSD.AddMessage("Setting to Black and White Switch to Off");
|
||||
}
|
||||
}
|
||||
|
||||
private void p0DifficultyToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Global.Emulator is Atari2600)
|
||||
{
|
||||
Global.Config.Atari2600_LeftDifficulty ^= true;
|
||||
((Atari2600)Global.Emulator).SetP0Diff(Global.Config.Atari2600_BW);
|
||||
if(Global.Config.Atari2600_LeftDifficulty)
|
||||
Global.OSD.AddMessage("Setting Left Difficulty to B");
|
||||
else
|
||||
Global.OSD.AddMessage("Setting Left Difficulty to A");
|
||||
}
|
||||
}
|
||||
|
||||
private void rightDifficultyToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Global.Emulator is Atari2600)
|
||||
{
|
||||
Global.Config.Atari2600_RightDifficulty ^= true;
|
||||
((Atari2600)Global.Emulator).SetP1Diff(Global.Config.Atari2600_BW);
|
||||
if (Global.Config.Atari2600_RightDifficulty)
|
||||
Global.OSD.AddMessage("Setting Right Difficulty to B");
|
||||
else
|
||||
Global.OSD.AddMessage("Setting Right Difficulty to A");
|
||||
}
|
||||
}
|
||||
|
||||
private void atariToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
bWToolStripMenuItem.Checked = Global.Config.Atari2600_BW;
|
||||
p0DifficultyToolStripMenuItem.Checked = Global.Config.Atari2600_LeftDifficulty;
|
||||
rightDifficultyToolStripMenuItem.Checked = Global.Config.Atari2600_RightDifficulty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue