Play Movie dialog - Match Game Name option, checked by default.

This commit is contained in:
andres.delikat 2011-12-27 00:15:48 +00:00
parent 37619ba147
commit f1da3bfa08
4 changed files with 80 additions and 57 deletions

View File

@ -1,12 +1,12 @@
namespace BizHawk.Emulation.Consoles.TurboGrafx
{
public partial class PCEngine
{
public static readonly ControllerDefinition PCEngineController =
new ControllerDefinition
{
Name = "PC Engine Controller",
BoolButtons =
public partial class PCEngine
{
public static readonly ControllerDefinition PCEngineController =
new ControllerDefinition
{
Name = "PC Engine Controller",
BoolButtons =
{
"P1 Up", "P1 Down", "P1 Left", "P1 Right", "P1 B2", "P1 B1", "P1 Select", "P1 Run",
"P2 Up", "P2 Down", "P2 Left", "P2 Right", "P2 B2", "P2 B1", "P2 Select", "P2 Run",
@ -14,60 +14,60 @@
"P4 Up", "P4 Down", "P4 Left", "P4 Right", "P4 B2", "P4 B1", "P4 Select", "P4 Run",
"P5 Up", "P5 Down", "P5 Left", "P5 Right", "P5 B2", "P5 B1", "P5 Select", "P5 Run"
}
};
};
public ControllerDefinition ControllerDefinition { get { return PCEngineController; } }
public IController Controller { get; set; }
public ControllerDefinition ControllerDefinition { get { return PCEngineController; } }
public IController Controller { get; set; }
int SelectedController;
byte InputByte;
int SelectedController;
byte InputByte;
public bool SEL { get { return ((InputByte & 1) != 0) ;} }
public bool CLR { get { return ((InputByte & 2) != 0); } }
void WriteInput(byte value)
{
bool prevSEL = SEL;
InputByte = value;
public bool SEL { get { return ((InputByte & 1) != 0); } }
public bool CLR { get { return ((InputByte & 2) != 0); } }
if (SEL && CLR)
SelectedController = 0;
void WriteInput(byte value)
{
bool prevSEL = SEL;
InputByte = value;
if (CLR == false && prevSEL == false && SEL == true)
SelectedController = (SelectedController + 1);
}
byte ReadInput()
{
byte value = 0x3F;
int player = SelectedController + 1;
if (player < 6)
{
lagged = false;
if (SEL == false) // return buttons
{
if (Controller["P" + player + " B1"]) value &= 0xFE;
if (Controller["P" + player + " B2"]) value &= 0xFD;
if (Controller["P" + player + " Select"]) value &= 0xFB;
if (Controller["P" + player + " Run"]) value &= 0xF7;
}
else
{
//return directions
if (Controller["P" + player + " Up"]) value &= 0xFE;
if (Controller["P" + player + " Right"]) value &= 0xFD;
if (Controller["P" + player + " Down"]) value &= 0xFB;
if (Controller["P" + player + " Left"]) value &= 0xF7;
}
}
if (SEL && CLR)
SelectedController = 0;
if (Region == "Japan") value |= 0x40;
if (CLR == false && prevSEL == false && SEL == true)
SelectedController = (SelectedController + 1);
}
if (Type != NecSystemType.TurboCD && BramEnabled == false)
value |= 0x80;
byte ReadInput()
{
byte value = 0x3F;
return value;
}
}
int player = SelectedController + 1;
if (player < 6)
{
lagged = false;
if (SEL == false) // return buttons
{
if (Controller["P" + player + " B1"]) value &= 0xFE;
if (Controller["P" + player + " B2"]) value &= 0xFD;
if (Controller["P" + player + " Select"]) value &= 0xFB;
if (Controller["P" + player + " Run"]) value &= 0xF7;
}
else
{
//return directions
if (Controller["P" + player + " Up"]) value &= 0xFE;
if (Controller["P" + player + " Right"]) value &= 0xFD;
if (Controller["P" + player + " Down"]) value &= 0xFB;
if (Controller["P" + player + " Left"]) value &= 0xF7;
}
}
if (Region == "Japan") value |= 0x40;
if (Type != NecSystemType.TurboCD && BramEnabled == false)
value |= 0x80;
return value;
}
}
}

View File

@ -344,6 +344,7 @@
//Play Movie Dialog
public bool PlayMovie_IncludeSubdir = true;
public bool PlayMovie_ShowStateFiles = false;
public bool PlayMovie_MatchGameName = true;
//TI83
public bool TI83autoloadKeyPad = true;

View File

@ -50,6 +50,7 @@
this.ShowStateFiles = new System.Windows.Forms.CheckBox();
this.Scan = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.MatchGameNameCheckBox = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
@ -262,6 +263,17 @@
this.Scan.UseVisualStyleBackColor = true;
this.Scan.Click += new System.EventHandler(this.Scan_Click);
//
// MatchGameNameCheckBox
//
this.MatchGameNameCheckBox.AutoSize = true;
this.MatchGameNameCheckBox.Location = new System.Drawing.Point(260, 337);
this.MatchGameNameCheckBox.Name = "MatchGameNameCheckBox";
this.MatchGameNameCheckBox.Size = new System.Drawing.Size(150, 17);
this.MatchGameNameCheckBox.TabIndex = 56;
this.MatchGameNameCheckBox.Text = "Match current game name";
this.MatchGameNameCheckBox.UseVisualStyleBackColor = true;
this.MatchGameNameCheckBox.CheckedChanged += new System.EventHandler(this.MatchGameNameCheckBox_CheckedChanged);
//
// PlayMovie
//
this.AcceptButton = this.OK;
@ -269,6 +281,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(765, 387);
this.Controls.Add(this.MatchGameNameCheckBox);
this.Controls.Add(this.Scan);
this.Controls.Add(this.ShowStateFiles);
this.Controls.Add(this.IncludeSubDirectories);
@ -314,5 +327,6 @@
private System.Windows.Forms.CheckBox ShowStateFiles;
private System.Windows.Forms.Button Scan;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.CheckBox MatchGameNameCheckBox;
}
}

View File

@ -167,7 +167,10 @@ namespace BizHawk.MultiClient
m.Header.SetHeaderLine(MovieHeader.PLATFORM, "NES");
else if (path.Extension == ".MC2")
m.Header.SetHeaderLine(MovieHeader.PLATFORM, "PCE");
MovieList.Add(m);
if (m.Header.GetHeaderLine(MovieHeader.GAMENAME) == Global.Game.Name ||
Global.Config.PlayMovie_MatchGameName == false)
MovieList.Add(m);
}
private void UpdateList()
@ -296,7 +299,7 @@ namespace BizHawk.MultiClient
{
IncludeSubDirectories.Checked = Global.Config.PlayMovie_IncludeSubdir;
ShowStateFiles.Checked = Global.Config.PlayMovie_ShowStateFiles;
MatchGameNameCheckBox.Checked = Global.Config.PlayMovie_MatchGameName;
ScanFiles();
PreHighlightMovie();
}
@ -407,5 +410,10 @@ namespace BizHawk.MultiClient
PreHighlightMovie();
}
private void MatchGameNameCheckBox_CheckedChanged(object sender, EventArgs e)
{
Global.Config.PlayMovie_MatchGameName = MatchGameNameCheckBox.Checked;
}
}
}