Add "escape clears mapping" message on controller config dialog

This commit is contained in:
adelikat 2012-03-05 14:22:49 +00:00
parent f450246098
commit 204c025af2
2 changed files with 37 additions and 23 deletions

View File

@ -45,20 +45,20 @@ PRG Setup:
class TAITO_X1_005 : NES.NESBoardBase class TAITO_X1_005 : NES.NESBoardBase
{ {
int prg_bank_mask, chr_bank_mask; int prg_bank_mask, chr_bank_mask;
ByteBuffer chr_regs_2k = new ByteBuffer(6); ByteBuffer chr_regs_1k = new ByteBuffer(8);
ByteBuffer prg_regs_8k = new ByteBuffer(4); ByteBuffer prg_regs_8k = new ByteBuffer(4);
public override void SyncState(Serializer ser) public override void SyncState(Serializer ser)
{ {
base.SyncState(ser); base.SyncState(ser);
ser.Sync("chr_regs_2k", ref chr_regs_2k); ser.Sync("chr_regs_1k", ref chr_regs_1k);
ser.Sync("prg_regs_8k", ref prg_regs_8k); ser.Sync("prg_regs_8k", ref prg_regs_8k);
} }
public override void Dispose() public override void Dispose()
{ {
base.Dispose(); base.Dispose();
chr_regs_2k.Dispose(); chr_regs_1k.Dispose();
prg_regs_8k.Dispose(); prg_regs_8k.Dispose();
} }
@ -92,22 +92,23 @@ PRG Setup:
break; break;
case 0x1EF0: case 0x1EF0:
chr_regs_2k[0] = value; chr_regs_1k[0] = value;
break; break;
case 0x1EF1: case 0x1EF1:
chr_regs_2k[1] = value; chr_regs_1k[1] = value;
break; break;
case 0x1EF2: case 0x1EF2:
chr_regs_2k[2] = value; chr_regs_1k[2] = value;
break; break;
case 0x1EF3: case 0x1EF3:
chr_regs_2k[3] = value; chr_regs_1k[3] = value;
break; break;
case 0x1EF4: case 0x1EF4:
chr_regs_2k[4] = value; chr_regs_1k[4] = value;
break; break;
case 0X1EF5: case 0X1EF5:
chr_regs_2k[5] = value; chr_regs_1k[5] = value;
break; break;
case 0x1EFA: //PRG Reg 0 case 0x1EFA: //PRG Reg 0
@ -139,7 +140,7 @@ PRG Setup:
{ {
int bank_2k = addr >> 11; int bank_2k = addr >> 11;
int ofs = addr & ((1 << 11) - 1); int ofs = addr & ((1 << 11) - 1);
bank_2k = chr_regs_2k[bank_2k]; bank_2k = chr_regs_1k[bank_2k];
bank_2k &= chr_bank_mask; bank_2k &= chr_bank_mask;
addr = (bank_2k << 11) | ofs; addr = (bank_2k << 11) | ofs;
return VROM[addr]; return VROM[addr];

View File

@ -40,6 +40,7 @@
this.SystemComboBox = new System.Windows.Forms.ComboBox(); this.SystemComboBox = new System.Windows.Forms.ComboBox();
this.AllowLR = new System.Windows.Forms.CheckBox(); this.AllowLR = new System.Windows.Forms.CheckBox();
this.AutoTab = new System.Windows.Forms.CheckBox(); this.AutoTab = new System.Windows.Forms.CheckBox();
this.label38 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.ControllerImage)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ControllerImage)).BeginInit();
this.ControllerSelectGroupBox.SuspendLayout(); this.ControllerSelectGroupBox.SuspendLayout();
this.SystemGroupBox.SuspendLayout(); this.SystemGroupBox.SuspendLayout();
@ -48,7 +49,7 @@
// OK // OK
// //
this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OK.Location = new System.Drawing.Point(261, 320); this.OK.Location = new System.Drawing.Point(259, 329);
this.OK.Name = "OK"; this.OK.Name = "OK";
this.OK.Size = new System.Drawing.Size(75, 23); this.OK.Size = new System.Drawing.Size(75, 23);
this.OK.TabIndex = 0; this.OK.TabIndex = 0;
@ -60,7 +61,7 @@
// //
this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Cancel.Location = new System.Drawing.Point(351, 320); this.Cancel.Location = new System.Drawing.Point(342, 329);
this.Cancel.Name = "Cancel"; this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(75, 23); this.Cancel.Size = new System.Drawing.Size(75, 23);
this.Cancel.TabIndex = 1; this.Cancel.TabIndex = 1;
@ -70,32 +71,32 @@
// //
// ButtonsGroupBox // ButtonsGroupBox
// //
this.ButtonsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.ButtonsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.ButtonsGroupBox.Location = new System.Drawing.Point(12, 84); this.ButtonsGroupBox.Location = new System.Drawing.Point(12, 84);
this.ButtonsGroupBox.Name = "ButtonsGroupBox"; this.ButtonsGroupBox.Name = "ButtonsGroupBox";
this.ButtonsGroupBox.Size = new System.Drawing.Size(241, 259); this.ButtonsGroupBox.Size = new System.Drawing.Size(241, 268);
this.ButtonsGroupBox.TabIndex = 2; this.ButtonsGroupBox.TabIndex = 2;
this.ButtonsGroupBox.TabStop = false; this.ButtonsGroupBox.TabStop = false;
this.ButtonsGroupBox.Text = "Buttons"; this.ButtonsGroupBox.Text = "Buttons";
// //
// ControllerImage // ControllerImage
// //
this.ControllerImage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.ControllerImage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.ControllerImage.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.ControllerImage.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.ControllerImage.Location = new System.Drawing.Point(259, 84); this.ControllerImage.Location = new System.Drawing.Point(259, 84);
this.ControllerImage.Name = "ControllerImage"; this.ControllerImage.Name = "ControllerImage";
this.ControllerImage.Size = new System.Drawing.Size(169, 202); this.ControllerImage.Size = new System.Drawing.Size(169, 214);
this.ControllerImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; this.ControllerImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.ControllerImage.TabIndex = 3; this.ControllerImage.TabIndex = 3;
this.ControllerImage.TabStop = false; this.ControllerImage.TabStop = false;
// //
// ControllerSelectGroupBox // ControllerSelectGroupBox
// //
this.ControllerSelectGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.ControllerSelectGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.ControllerSelectGroupBox.Controls.Add(this.IDX_CONTROLLERENABLED); this.ControllerSelectGroupBox.Controls.Add(this.IDX_CONTROLLERENABLED);
this.ControllerSelectGroupBox.Controls.Add(this.ControllComboBox); this.ControllerSelectGroupBox.Controls.Add(this.ControllComboBox);
this.ControllerSelectGroupBox.Location = new System.Drawing.Point(13, 28); this.ControllerSelectGroupBox.Location = new System.Drawing.Point(13, 28);
@ -159,7 +160,7 @@
// //
this.AllowLR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.AllowLR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.AllowLR.AutoSize = true; this.AllowLR.AutoSize = true;
this.AllowLR.Location = new System.Drawing.Point(261, 297); this.AllowLR.Location = new System.Drawing.Point(259, 304);
this.AllowLR.Name = "AllowLR"; this.AllowLR.Name = "AllowLR";
this.AllowLR.Size = new System.Drawing.Size(107, 17); this.AllowLR.Size = new System.Drawing.Size(107, 17);
this.AllowLR.TabIndex = 7; this.AllowLR.TabIndex = 7;
@ -177,13 +178,24 @@
this.AutoTab.UseVisualStyleBackColor = true; this.AutoTab.UseVisualStyleBackColor = true;
this.AutoTab.CheckedChanged += new System.EventHandler(this.AutoTab_CheckedChanged); this.AutoTab.CheckedChanged += new System.EventHandler(this.AutoTab_CheckedChanged);
// //
// label38
//
this.label38.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label38.AutoSize = true;
this.label38.Location = new System.Drawing.Point(9, 356);
this.label38.Name = "label38";
this.label38.Size = new System.Drawing.Size(153, 13);
this.label38.TabIndex = 9;
this.label38.Text = "* Escape clears a key mapping";
//
// InputConfig // InputConfig
// //
this.AcceptButton = this.OK; this.AcceptButton = this.OK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel; this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(440, 355); this.ClientSize = new System.Drawing.Size(440, 378);
this.Controls.Add(this.label38);
this.Controls.Add(this.AutoTab); this.Controls.Add(this.AutoTab);
this.Controls.Add(this.AllowLR); this.Controls.Add(this.AllowLR);
this.Controls.Add(this.SystemGroupBox); this.Controls.Add(this.SystemGroupBox);
@ -222,5 +234,6 @@
private System.Windows.Forms.ComboBox SystemComboBox; private System.Windows.Forms.ComboBox SystemComboBox;
private System.Windows.Forms.CheckBox AllowLR; private System.Windows.Forms.CheckBox AllowLR;
private System.Windows.Forms.CheckBox AutoTab; private System.Windows.Forms.CheckBox AutoTab;
private System.Windows.Forms.Label label38;
} }
} }