dual gameboy recording mnemonic |P|UDLRsSBA|P|UDLRsSBA|

This commit is contained in:
goyuken 2013-04-27 15:10:39 +00:00
parent 7830ec7384
commit 84b271684b
2 changed files with 64 additions and 3 deletions

View File

@ -1,4 +1,5 @@
using BizHawk.DiscSystem;
using System;
using BizHawk.DiscSystem;
using System.Collections.Generic;
#if WINDOWS
using SlimDX.Direct3D9;
@ -192,6 +193,35 @@ namespace BizHawk.MultiClient
{"ColecoVision Basic Controller", 2}, {"Commodore 64 Controller", 2}
};
// just experimenting with different possibly more painful ways to handle mnemonics
// |P|UDLRsSBA|
public static Tuple<string, char>[] DGBMnemonic = new Tuple<string, char>[]
{
new Tuple<string, char>(null, '|'),
new Tuple<string, char>("P1 Power", 'P'),
new Tuple<string, char>(null, '|'),
new Tuple<string, char>("P1 Up", 'U'),
new Tuple<string, char>("P1 Down", 'D'),
new Tuple<string, char>("P1 Left", 'L'),
new Tuple<string, char>("P1 Right", 'R'),
new Tuple<string, char>("P1 Select", 's'),
new Tuple<string, char>("P1 Start", 'S'),
new Tuple<string, char>("P1 B", 'B'),
new Tuple<string, char>("P1 A", 'A'),
new Tuple<string, char>(null, '|'),
new Tuple<string, char>("P2 Power", 'P'),
new Tuple<string, char>(null, '|'),
new Tuple<string, char>("P2 Up", 'U'),
new Tuple<string, char>("P2 Down", 'D'),
new Tuple<string, char>("P2 Left", 'L'),
new Tuple<string, char>("P2 Right", 'R'),
new Tuple<string, char>("P2 Select", 's'),
new Tuple<string, char>("P2 Start", 'S'),
new Tuple<string, char>("P2 B", 'B'),
new Tuple<string, char>("P2 A", 'A'),
new Tuple<string, char>(null, '|')
};
/// <summary>
/// whether throttling is force-disabled by use of fast forward
/// </summary>

View File

@ -433,6 +433,8 @@ namespace BizHawk.MultiClient
return "|.|........|........|";
case "GB":
return "|.|........|";
case "DGB":
return "|.|........|.|........|";
case "PCE":
case "PCECD":
case "SGX":
@ -521,6 +523,22 @@ namespace BizHawk.MultiClient
return input.ToString();
}
private string GetDualGameBoyControllerAsMnemonic()
{
// |.|........|.|........|
StringBuilder input = new StringBuilder();
foreach (var t in Global.DGBMnemonic)
{
if (t.Item1 != null)
input.Append(IsBasePressed(t.Item1) ? t.Item2 : '.');
else
input.Append(t.Item2); // seperator
}
return input.ToString();
}
private string GetA78ControllersAsMnemonic()
{
StringBuilder input = new StringBuilder("|");
@ -565,7 +583,7 @@ namespace BizHawk.MultiClient
}
else if (ControlType == "Dual Gameboy Controller")
{
return "|.|"; // TODO
return GetDualGameBoyControllerAsMnemonic();
}
StringBuilder input = new StringBuilder("|");
@ -924,6 +942,18 @@ namespace BizHawk.MultiClient
}
}
private void SetDualGameBoyControllerAsMnemonic(string mnemonic)
{
MnemonicChecker c = new MnemonicChecker(mnemonic);
MyBoolButtons.Clear();
for (int i = 0; i < Global.DGBMnemonic.Length; i++)
{
var t = Global.DGBMnemonic[i];
if (t.Item1 != null)
Force(t.Item1, c[i]);
}
}
private void SetC64ControllersAsMnemonic(string mnemonic)
{
MnemonicChecker c = new MnemonicChecker(mnemonic);
@ -984,7 +1014,8 @@ namespace BizHawk.MultiClient
}
else if (ControlType == "Dual Gameboy Controller")
{
return; // TODO
SetDualGameBoyControllerAsMnemonic(mnemonic);
return;
}
MnemonicChecker c = new MnemonicChecker(mnemonic);