From 10de07aec2a141de9846fffcb573bfcd9e46e050 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Tue, 30 May 2017 18:24:30 -0400 Subject: [PATCH 01/13] Update PPU.run.cs --- BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs index e3d6575865..db120d9c03 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs @@ -226,7 +226,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES // "If PPUADDR is not less then 8 when rendering starts, the first 8 fights in OAM and written to from // the current location off PPUADDR" - if (sl == 0 && PPUON && reg_2003 >= 8) + if (sl == 0 && PPUON && reg_2003 >= 8 && region==Region.NTSC) { for (int i = 0; i < 8; i++) { From be7d271bd1cfea1bff099fde033ecbcb059dbbda Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Tue, 30 May 2017 18:25:34 -0400 Subject: [PATCH 02/13] Update NES.Core.cs --- BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs index 89aa4d02c2..f35b89ae37 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs @@ -286,6 +286,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { ram[0x701] = 0xFF; } + + if (cart.DB_GameInfo.Hash == "68ABE1E49C9E9CCEA978A48232432C252E5912C0") // Dancing Blocks + { + ram[0xEC] = 0; + ram[0xED] = 0; + } } } From fd93e1bb65e54a21e68cebdcee158ec95b2fbf0a Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Tue, 30 May 2017 18:26:27 -0400 Subject: [PATCH 03/13] Update gamedb.txt --- Assets/gamedb/gamedb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Assets/gamedb/gamedb.txt b/Assets/gamedb/gamedb.txt index bf04bf6bd9..b285a03763 100644 --- a/Assets/gamedb/gamedb.txt +++ b/Assets/gamedb/gamedb.txt @@ -274,6 +274,7 @@ sha1:CAAC1E829133851648BA7C7CD6EAA7D26A464999 Metal Fighter (Asia) (Unl) (Sache sha1:B9902886D1739983B315B67B02133E44620E4381 Challenge of the Dragon (Asia) (PAL) (Unl) NES board=MAPPER147;PAD_V=0;PAD_H=1;system=NES-PAL sha1:0CDE48DB89896946F0C2E78936EA290348994ED5 Pipemania (Australia) (HES) (Unl) NES board=MAPPER113;PRG=32;CHR=16;WRAM=0;VRAM=0 sha1:E843AB3D779D4F0BB1F933D6EE99DAA526EFBCF1 Gaiapolis (Asia) (Unl) NES board=UNIF_NES-TLROM;PRG=128;CHR=256;WRAM=0;VRAM=0 +sha1:68ABE1E49C9E9CCEA978A48232432C252E5912C0 Dancing Blocks (Asia) (PAL) (Unl) NES board=MAPPER143;PAD_V=1;PAD_H=0;system=NES-PAL ;;;;;;;;;;;;;;;;;;;----------------------------------------------------------------------- ;;;;;;;;;;;;;;;;;;;----------------------------------------------------------------------- From e926c4159e41d1a588a1db7ce0a41df32585952d Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Tue, 30 May 2017 18:46:08 -0400 Subject: [PATCH 04/13] Update gamedb.txt --- Assets/gamedb/gamedb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Assets/gamedb/gamedb.txt b/Assets/gamedb/gamedb.txt index b285a03763..6aa7b05004 100644 --- a/Assets/gamedb/gamedb.txt +++ b/Assets/gamedb/gamedb.txt @@ -275,6 +275,7 @@ sha1:B9902886D1739983B315B67B02133E44620E4381 Challenge of the Dragon (Asia) (P sha1:0CDE48DB89896946F0C2E78936EA290348994ED5 Pipemania (Australia) (HES) (Unl) NES board=MAPPER113;PRG=32;CHR=16;WRAM=0;VRAM=0 sha1:E843AB3D779D4F0BB1F933D6EE99DAA526EFBCF1 Gaiapolis (Asia) (Unl) NES board=UNIF_NES-TLROM;PRG=128;CHR=256;WRAM=0;VRAM=0 sha1:68ABE1E49C9E9CCEA978A48232432C252E5912C0 Dancing Blocks (Asia) (PAL) (Unl) NES board=MAPPER143;PAD_V=1;PAD_H=0;system=NES-PAL +sha1:B21CFE30197727C1C8E8DB6D28AD696A708F8FF5 Pyramid II (Asia) (PAL) (Unl) NES board=MAPPER146 ;;;;;;;;;;;;;;;;;;;----------------------------------------------------------------------- ;;;;;;;;;;;;;;;;;;;----------------------------------------------------------------------- From 52f3dc5bca46dc706186372af21fbefbd64b8035 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Tue, 30 May 2017 19:03:36 -0400 Subject: [PATCH 05/13] Update gamedb.txt --- Assets/gamedb/gamedb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Assets/gamedb/gamedb.txt b/Assets/gamedb/gamedb.txt index 6aa7b05004..9f263d8bf6 100644 --- a/Assets/gamedb/gamedb.txt +++ b/Assets/gamedb/gamedb.txt @@ -276,6 +276,7 @@ sha1:0CDE48DB89896946F0C2E78936EA290348994ED5 Pipemania (Australia) (HES) (Unl) sha1:E843AB3D779D4F0BB1F933D6EE99DAA526EFBCF1 Gaiapolis (Asia) (Unl) NES board=UNIF_NES-TLROM;PRG=128;CHR=256;WRAM=0;VRAM=0 sha1:68ABE1E49C9E9CCEA978A48232432C252E5912C0 Dancing Blocks (Asia) (PAL) (Unl) NES board=MAPPER143;PAD_V=1;PAD_H=0;system=NES-PAL sha1:B21CFE30197727C1C8E8DB6D28AD696A708F8FF5 Pyramid II (Asia) (PAL) (Unl) NES board=MAPPER146 +sha1:7117413766ABC02F3BB767C2CE96065B6F3CBA85 Silent Assault (Asia) (PAL) (Unl) NES board=MAPPER146;PAD_V=0;PAD_H=1;system=NES-PAL ;;;;;;;;;;;;;;;;;;;----------------------------------------------------------------------- ;;;;;;;;;;;;;;;;;;;----------------------------------------------------------------------- From f84065a45adc6415b0dd5d948b1b09e599dff482 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 31 May 2017 08:10:09 -0500 Subject: [PATCH 06/13] cleanup controller config user control classes --- .../config/ControllerConfig.cs | 3 +- .../AnalogBindControl.Designer.cs | 10 +- .../ControllerConfig/AnalogBindControl.cs | 64 +++++---- .../ControllerConfig/AnalogBindPanel.cs | 35 +++-- .../ControllerConfigPanel.Designer.cs | 2 +- .../ControllerConfig/ControllerConfigPanel.cs | 127 +++++++++--------- 6 files changed, 119 insertions(+), 122 deletions(-) diff --git a/BizHawk.Client.EmuHawk/config/ControllerConfig.cs b/BizHawk.Client.EmuHawk/config/ControllerConfig.cs index 0c78e0720e..9ac2bb2e01 100644 --- a/BizHawk.Client.EmuHawk/config/ControllerConfig.cs +++ b/BizHawk.Client.EmuHawk/config/ControllerConfig.cs @@ -73,8 +73,7 @@ namespace BizHawk.Client.EmuHawk private Control CreateNormalPanel(Dictionary settings, List buttons, Size size) { - var cp = new ControllerConfigPanel { Dock = DockStyle.Fill, AutoScroll = true }; - cp.Tooltip = toolTip1; + var cp = new ControllerConfigPanel { Dock = DockStyle.Fill, AutoScroll = true, Tooltip = toolTip1 }; cp.LoadSettings(settings, checkBoxAutoTab.Checked, buttons, size.Width, size.Height); return cp; } diff --git a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs index efb3f91f95..e385ec92aa 100644 --- a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs @@ -71,7 +71,7 @@ this.trackBarSensitivity.SmallChange = 10; this.trackBarSensitivity.TabIndex = 2; this.trackBarSensitivity.TickFrequency = 10; - this.trackBarSensitivity.ValueChanged += new System.EventHandler(this.trackBarSensitivity_ValueChanged); + this.trackBarSensitivity.ValueChanged += new System.EventHandler(this.TrackBarSensitivity_ValueChanged); // // labelSensitivity // @@ -84,7 +84,7 @@ // // timer1 // - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + this.timer1.Tick += new System.EventHandler(this.Timer1_Tick); // // buttonBind // @@ -94,7 +94,7 @@ this.buttonBind.TabIndex = 4; this.buttonBind.Text = "Bind!"; this.buttonBind.UseVisualStyleBackColor = true; - this.buttonBind.Click += new System.EventHandler(this.buttonBind_Click); + this.buttonBind.Click += new System.EventHandler(this.ButtonBind_Click); // // trackBarDeadzone // @@ -103,7 +103,7 @@ this.trackBarDeadzone.Size = new System.Drawing.Size(104, 45); this.trackBarDeadzone.TabIndex = 5; this.trackBarDeadzone.TickFrequency = 2; - this.trackBarDeadzone.ValueChanged += new System.EventHandler(this.trackBarDeadzone_ValueChanged); + this.trackBarDeadzone.ValueChanged += new System.EventHandler(this.TrackBarDeadzone_ValueChanged); // // labelDeadzone // @@ -122,7 +122,7 @@ this.buttonFlip.TabIndex = 7; this.buttonFlip.Text = "Flip Axis"; this.buttonFlip.UseVisualStyleBackColor = true; - this.buttonFlip.Click += new System.EventHandler(this.buttonFlip_Click); + this.buttonFlip.Click += new System.EventHandler(this.ButtonFlip_Click); // // buttonUnbind // diff --git a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs index adfa4f6597..19de6e3bb8 100644 --- a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs +++ b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs @@ -1,10 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; using System.Windows.Forms; using BizHawk.Client.Common; @@ -18,75 +12,77 @@ namespace BizHawk.Client.EmuHawk InitializeComponent(); } - public string ButtonName; - public Config.AnalogBind Bind; - bool listening = false; - - public AnalogBindControl(string ButtonName, Config.AnalogBind Bind) + public AnalogBindControl(string buttonName, Config.AnalogBind bind) : this() { - this.Bind = Bind; - this.ButtonName = ButtonName; - labelButtonName.Text = ButtonName; - trackBarSensitivity.Value = (int)(Bind.Mult * 10.0f); - trackBarDeadzone.Value = (int)(Bind.Deadzone * 20.0f); - trackBarSensitivity_ValueChanged(null, null); - trackBarDeadzone_ValueChanged(null, null); - textBox1.Text = Bind.Value; + _bind = bind; + ButtonName = buttonName; + labelButtonName.Text = buttonName; + trackBarSensitivity.Value = (int)(bind.Mult * 10.0f); + trackBarDeadzone.Value = (int)(bind.Deadzone * 20.0f); + TrackBarSensitivity_ValueChanged(null, null); + TrackBarDeadzone_ValueChanged(null, null); + textBox1.Text = bind.Value; } - private void timer1_Tick(object sender, EventArgs e) + public string ButtonName { get; private set; } + public Config.AnalogBind Bind => _bind; + + private Config.AnalogBind _bind; + private bool _listening; + + private void Timer1_Tick(object sender, EventArgs e) { string bindval = Input.Instance.GetNextFloatEvent(); if (bindval != null) { timer1.Stop(); - listening = false; - Bind.Value = bindval; + _listening = false; + _bind.Value = bindval; textBox1.Text = Bind.Value; buttonBind.Text = "Bind!"; Input.Instance.StopListeningForFloatEvents(); } } - private void buttonBind_Click(object sender, EventArgs e) + private void ButtonBind_Click(object sender, EventArgs e) { - if (listening) + if (_listening) { timer1.Stop(); - listening = false; + _listening = false; buttonBind.Text = "Bind!"; Input.Instance.StopListeningForFloatEvents(); } else { Input.Instance.StartListeningForFloatEvents(); - listening = true; + _listening = true; buttonBind.Text = "Cancel!"; timer1.Start(); } } - private void trackBarSensitivity_ValueChanged(object sender, EventArgs e) + private void TrackBarSensitivity_ValueChanged(object sender, EventArgs e) { - Bind.Mult = trackBarSensitivity.Value / 10.0f; - labelSensitivity.Text = String.Format("Sensitivity: {0}", (Bind.Mult*100)) + "%"; + _bind.Mult = trackBarSensitivity.Value / 10.0f; + labelSensitivity.Text = $"Sensitivity: {(Bind.Mult * 100)}" + "%"; } - private void trackBarDeadzone_ValueChanged(object sender, EventArgs e) + private void TrackBarDeadzone_ValueChanged(object sender, EventArgs e) { - Bind.Deadzone = trackBarDeadzone.Value / 20.0f; - labelDeadzone.Text = String.Format("Deadzone: {0}", (Bind.Deadzone*100)) + "%"; + _bind.Deadzone = trackBarDeadzone.Value / 20.0f; + labelDeadzone.Text = $"Deadzone: {(Bind.Deadzone * 100)}" + "%"; } - private void buttonFlip_Click(object sender, EventArgs e) + private void ButtonFlip_Click(object sender, EventArgs e) { trackBarSensitivity.Value *= -1; } public void Unbind_Click(object sender, EventArgs e) { - Bind.Value = ""; + _bind.Value = ""; textBox1.Text = ""; } } diff --git a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindPanel.cs b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindPanel.cs index cec4756595..b00f38adc7 100644 --- a/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindPanel.cs +++ b/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindPanel.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; using System.Windows.Forms; using System.Drawing; @@ -9,40 +6,42 @@ using BizHawk.Client.Common; namespace BizHawk.Client.EmuHawk { - class AnalogBindPanel : UserControl + public class AnalogBindPanel : UserControl { - Dictionary RealConfigObject; + private readonly Dictionary _realConfigObject; - public AnalogBindPanel(Dictionary RealConfigObject, List RealConfigButtons = null) - :base() + public AnalogBindPanel(Dictionary realConfigObject, List realConfigButtons = null) { - this.RealConfigObject = RealConfigObject; - - LoadSettings(RealConfigButtons ?? (IEnumerable)RealConfigObject.Keys); + _realConfigObject = realConfigObject; + LoadSettings(realConfigButtons ?? (IEnumerable)realConfigObject.Keys); } - void LoadSettings(IEnumerable ButtonList) + private void LoadSettings(IEnumerable buttonList) { SuspendLayout(); int x = 4; int y = 4; - foreach (string ButtonName in ButtonList) + foreach (string buttonName in buttonList) { - var ctrl = new AnalogBindControl(ButtonName, RealConfigObject[ButtonName]); - ctrl.Location = new Point(x, y); + var ctrl = new AnalogBindControl(buttonName, _realConfigObject[buttonName]) + { + Location = new Point(x, y) + }; + y += ctrl.Height + 4; Controls.Add(ctrl); } + ResumeLayout(); } /// /// save to config /// - /// if non-null, save to possibly different config object than originally initialized from - public void Save(Dictionary SaveConfigObject = null) + /// if non-null, save to possibly different config object than originally initialized from + public void Save(Dictionary saveConfigObject = null) { - var saveto = SaveConfigObject ?? RealConfigObject; + var saveto = saveConfigObject ?? _realConfigObject; foreach (Control c in Controls) { var abc = (AnalogBindControl)c; diff --git a/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.Designer.cs b/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.Designer.cs index 1e38e366f2..b54256100f 100644 --- a/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.Designer.cs @@ -46,7 +46,7 @@ this.clearToolStripMenuItem.Name = "clearToolStripMenuItem"; this.clearToolStripMenuItem.Size = new System.Drawing.Size(99, 22); this.clearToolStripMenuItem.Text = "&Clear"; - this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click); + this.clearToolStripMenuItem.Click += new System.EventHandler(this.ClearToolStripMenuItem_Click); // // ControllerConfigPanel // diff --git a/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.cs b/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.cs index 70d1a5655a..9837eddbe4 100644 --- a/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.cs +++ b/BizHawk.Client.EmuHawk/config/ControllerConfig/ControllerConfigPanel.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Linq; using System.Windows.Forms; using BizHawk.Client.Common; @@ -12,29 +11,29 @@ namespace BizHawk.Client.EmuHawk public partial class ControllerConfigPanel : UserControl { // the dictionary that results are saved to - Dictionary RealConfigObject; + private Dictionary _realConfigObject; + // if nonnull, the list of keys to use. used to have the config panel operate on a smaller list than the whole dictionary; // for instance, to show only a single player - List RealConfigButtons; + private List _realConfigButtons; - public List buttons = new List(); + private readonly List _buttons = new List(); - public int InputMarginLeft = UIHelper.ScaleX(0); - public int LabelPadding = UIHelper.ScaleX(5); + private readonly int _inputMarginLeft = UIHelper.ScaleX(0); + private readonly int _labelPadding = UIHelper.ScaleX(5); + private readonly int _marginTop = UIHelper.ScaleY(0); + private readonly int _spacing = UIHelper.ScaleY(24); + private readonly int _inputSize = UIHelper.ScaleX(170); + private readonly int _columnWidth = UIHelper.ScaleX(280); - public int MarginTop = UIHelper.ScaleY(0); - public int Spacing = UIHelper.ScaleY(24); - public int InputSize = UIHelper.ScaleX(170); - public int ColumnWidth = UIHelper.ScaleX(280); - public int LabelWidth = UIHelper.ScaleX(60); + public ToolTip Tooltip { get; set; } - public ToolTip Tooltip; - - protected List Inputs = new List(); - protected List