From eec3cf44f279210ed783b2ecd915b4bdfe4cc7f8 Mon Sep 17 00:00:00 2001 From: feos Date: Wed, 29 Apr 2020 23:00:07 +0300 Subject: [PATCH 01/13] fix #1837 while the project is open, the menu still doesn't update to account for this, but at least it can be saved properly now --- BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index 830cc06403..3076438f4c 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -1317,7 +1317,7 @@ namespace BizHawk.Client.EmuHawk var item = new ToolStripMenuItem($"Show Player {i}") { CheckOnClick = true, - Checked = true + Checked = playerMenus[i].DropDownItems.OfType().Any(mi => mi.Checked) }; ToolStripMenuItem dummyObject = playerMenus[i]; From e09bc14a584bba863ab5d0a2287ea0bcddcf1be5 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 29 Apr 2020 15:52:07 -0500 Subject: [PATCH 02/13] remove NamespaceAliasHacks.targets, it is no longer needed --- BizHawk.Client.Common/BizHawk.Client.Common.csproj | 1 - .../BizHawk.Emulation.Cores.csproj | 1 - NamespaceAliasHack.targets | 11 ----------- 3 files changed, 13 deletions(-) delete mode 100644 NamespaceAliasHack.targets diff --git a/BizHawk.Client.Common/BizHawk.Client.Common.csproj b/BizHawk.Client.Common/BizHawk.Client.Common.csproj index e311024d7e..61dd25d302 100644 --- a/BizHawk.Client.Common/BizHawk.Client.Common.csproj +++ b/BizHawk.Client.Common/BizHawk.Client.Common.csproj @@ -45,5 +45,4 @@ - diff --git a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj index 4d39813197..63f847103a 100644 --- a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj +++ b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj @@ -68,5 +68,4 @@ - diff --git a/NamespaceAliasHack.targets b/NamespaceAliasHack.targets deleted file mode 100644 index 953a19ab4c..0000000000 --- a/NamespaceAliasHack.targets +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - linqbridge - - - - From 2d413fca1e85f96925b905224de78abbb5303bdb Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 29 Apr 2020 17:16:40 -0400 Subject: [PATCH 03/13] fix "melonDS doesn't work at all anymore #1963" --- .../Consoles/Nintendo/NDS/MelonDS_Settable.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS_Settable.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS_Settable.cs index 19d98f2db2..6265a98da7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS_Settable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS_Settable.cs @@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS public PutSettingsDirtyBits PutSettings(MelonSettings o) { bool screenChanged = false; - if (_settings != null) + if (o != null) { screenChanged |= _settings.ScaleFactor != o.ScaleFactor; screenChanged |= _settings.ScreenGap != o.ScreenGap; From 948a2341a252a24749cf894f604df0d7920c5c93 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 29 Apr 2020 16:34:19 -0500 Subject: [PATCH 04/13] a2600 - add aggressive inline on ReadControls methods, that were just above the 32il threshold, a noticeable speedup --- BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Core.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Core.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Core.cs index c5ac7038d5..394f2eca35 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Core.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Core.cs @@ -329,6 +329,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 } } + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal byte ReadControls1(bool peek) { InputCallbacks.Call(); @@ -343,6 +344,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 return value; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal byte ReadControls2(bool peek) { InputCallbacks.Call(); From bee7f4f059a7d3e661c5850ec8beb87ee6013b75 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 29 Apr 2020 17:08:16 -0500 Subject: [PATCH 05/13] a2600 - remove some unused methods --- .../Consoles/Atari/2600/M6532.cs | 2 +- .../Consoles/Atari/2600/Tia/Tia.BallData.cs | 11 -------- .../Consoles/Atari/2600/Tia/Tia.MissleData.cs | 25 ------------------- 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/M6532.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/M6532.cs index 19204e8fcf..9ac4131376 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/M6532.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/M6532.cs @@ -208,7 +208,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { PrescalerCount--; - if ((PrescalerCount == 0) || Overflowed) + if (PrescalerCount == 0 || Overflowed) { Value--; diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.BallData.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.BallData.cs index 1c4c5b6904..843e3b37f5 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.BallData.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.BallData.cs @@ -74,17 +74,6 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 return result; } - public void Resp_check() - { - if (_draw_signaled) - { - if (_startSignal < 161) - { - _startSignal -= _startSignal - 156; - } - } - } - public void SyncState(Serializer ser) { ser.BeginSection("Ball"); diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.MissleData.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.MissleData.cs index 38c579712b..2c9234be7f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.MissleData.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.MissleData.cs @@ -93,31 +93,6 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 return result; } - public void Resp_check() - { - if (_draw_signaled) - { - if (_startSignal < 17) - { - _startSignal -= _startSignal - 12; - } - - else if (_startSignal < 33) - { - _startSignal -= _startSignal - 28; - } - - else if (_startSignal < 65) - { - _startSignal -= _startSignal - 60; - } - else if (_startSignal < 161) - { - _startSignal -= _startSignal - 156; - } - } - } - public void SyncState(Serializer ser) { ser.BeginSection("Missile"); From 96a85d444270f652e72f05c9206c08418f6be971 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 29 Apr 2020 17:21:26 -0500 Subject: [PATCH 06/13] Z80 Interrupts - remove unnecessary public property --- BizHawk.Emulation.Cores/CPUs/Z80A/Interrupts.cs | 9 ++------- BizHawk.Emulation.Cores/Consoles/Coleco/TMS9918A.cs | 4 ++-- BizHawk.sln.DotSettings | 1 + 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/BizHawk.Emulation.Cores/CPUs/Z80A/Interrupts.cs b/BizHawk.Emulation.Cores/CPUs/Z80A/Interrupts.cs index 92fe223e6d..a5a2b26c81 100644 --- a/BizHawk.Emulation.Cores/CPUs/Z80A/Interrupts.cs +++ b/BizHawk.Emulation.Cores/CPUs/Z80A/Interrupts.cs @@ -22,15 +22,10 @@ namespace BizHawk.Emulation.Cores.Components.Z80A public bool NonMaskableInterrupt { get => nonMaskableInterrupt; - set { if (value && !nonMaskableInterrupt) NonMaskableInterruptPending = true; nonMaskableInterrupt = value; } + set { if (value && !nonMaskableInterrupt) nonMaskableInterruptPending = true; nonMaskableInterrupt = value; } } private bool nonMaskableInterruptPending; - public bool NonMaskableInterruptPending - { - get => nonMaskableInterruptPending; - set => nonMaskableInterruptPending = value; - } private int interruptMode; public int InterruptMode @@ -144,7 +139,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A IFF1 = false; IFF2 = false; NonMaskableInterrupt = false; - NonMaskableInterruptPending = false; + nonMaskableInterruptPending = false; FlagI = false; InterruptMode = 1; } diff --git a/BizHawk.Emulation.Cores/Consoles/Coleco/TMS9918A.cs b/BizHawk.Emulation.Cores/Consoles/Coleco/TMS9918A.cs index b58a04aaa0..fe9a56d56a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Coleco/TMS9918A.cs +++ b/BizHawk.Emulation.Cores/Consoles/Coleco/TMS9918A.cs @@ -80,7 +80,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision VdpAddress &= 0x3FFF; } - void WriteRegister(int reg, byte data) + private void WriteRegister(int reg, byte data) { if (reg >= 8) return; @@ -106,7 +106,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision case 5: // Sprite Attribute Table Base Address TmsSpriteAttributeBase = (Registers[5] << 7) & 0x3F80; break; - case 6: // Sprite Pattern Generator Base Adderss + case 6: // Sprite Pattern Generator Base Address SpritePatternGeneratorBase = (Registers[6] << 11) & 0x3800; break; } diff --git a/BizHawk.sln.DotSettings b/BizHawk.sln.DotSettings index 41c1b010f7..903737f6e3 100644 --- a/BizHawk.sln.DotSettings +++ b/BizHawk.sln.DotSettings @@ -396,6 +396,7 @@ True True True + True True True True From 941bdb7daaf1f4e27aa2d61b392ed59a085b9eac Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 29 Apr 2020 17:25:37 -0500 Subject: [PATCH 07/13] remove unused code in MOS6502X --- .../CPUs/MOS 6502X/Disassembler.cs | 7 ---- .../CPUs/MOS 6502X/MOS6502X.cs | 39 ------------------- 2 files changed, 46 deletions(-) diff --git a/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Disassembler.cs b/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Disassembler.cs index 929c2a6108..481e663637 100644 --- a/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Disassembler.cs +++ b/BizHawk.Emulation.Cores/CPUs/MOS 6502X/Disassembler.cs @@ -6,13 +6,6 @@ namespace BizHawk.Emulation.Cores.Components.M6502 { public partial class MOS6502X : IDisassemblable { - private static ushort peeker_word(ushort address, Func peeker) - { - byte l = peeker(address); - byte h = peeker(++address); - return (ushort)((h << 8) | l); - } - public string Disassemble(ushort pc, out int bytesToAdvance) { return MOS6502X.Disassemble(pc, out bytesToAdvance, _link.PeekMemory); diff --git a/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs b/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs index f6cefb42de..7f26cc1f35 100644 --- a/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs +++ b/BizHawk.Emulation.Cores/CPUs/MOS 6502X/MOS6502X.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.IO; using BizHawk.Common; using BizHawk.Emulation.Common; @@ -20,7 +19,6 @@ namespace BizHawk.Emulation.Cores.Components.M6502 public bool BCD_Enabled = true; public bool debug = false; - public bool throw_unhandled; public void Reset() { @@ -150,12 +148,6 @@ namespace BizHawk.Emulation.Cores.Components.M6502 public const ushort BRKVector = 0xFFFE; public const ushort IRQVector = 0xFFFE; - enum ExceptionType - { - BRK, NMI, IRQ - } - - // ==== CPU State ==== public byte A; @@ -199,9 +191,6 @@ namespace BizHawk.Emulation.Cores.Components.M6502 ser.EndSection(); } - public void SaveStateBinary(BinaryWriter writer) { SyncState(Serializer.CreateBinaryWriter(writer)); } - public void LoadStateBinary(BinaryReader reader) { SyncState(Serializer.CreateBinaryReader(reader)); } - // ==== End State ==== /// Carry Flag @@ -262,34 +251,6 @@ namespace BizHawk.Emulation.Cores.Components.M6502 public long TotalExecutedCycles; - public ushort ReadWord(ushort address) - { - byte l = _link.ReadMemory(address); - byte h = _link.ReadMemory(++address); - return (ushort)((h << 8) | l); - } - - public ushort PeekWord(ushort address) - { - byte l = _link.PeekMemory(address); - byte h = _link.PeekMemory(++address); - return (ushort)((h << 8) | l); - } - - private void WriteWord(ushort address, ushort value) - { - byte l = (byte)(value & 0xFF); - byte h = (byte)(value >> 8); - _link.WriteMemory(address, l); - _link.WriteMemory(++address, h); - } - - private ushort ReadWordPageWrap(ushort address) - { - ushort highAddress = (ushort)((address & 0xFF00) + ((address + 1) & 0xFF)); - return (ushort)(_link.ReadMemory(address) | (_link.ReadMemory(highAddress) << 8)); - } - // SO pin public void SetOverflow() { From fdcbe6924b240b418c7da14c201b3ad6c0fe64d5 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 29 Apr 2020 17:43:46 -0500 Subject: [PATCH 08/13] use inline out insome places --- BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs | 4 +--- BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs | 4 +--- BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs | 4 +--- BizHawk.Emulation.Cores/CPUs/LR35902/LR35902.cs | 4 +--- BizHawk.Emulation.Cores/CPUs/MC6800/MC6800.cs | 4 +--- BizHawk.Emulation.Cores/CPUs/MC6809/MC6809.cs | 4 +--- 6 files changed, 6 insertions(+), 18 deletions(-) diff --git a/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs b/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs index bd110c66a2..51621374cd 100644 --- a/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs +++ b/BizHawk.Emulation.Cores/CPUs/CP1610/CP1610.Execute.cs @@ -20,11 +20,9 @@ namespace BizHawk.Emulation.Cores.Components.CP1610 public TraceInfo CP1610State(bool disassemble = true) { - int notused; - return new TraceInfo { - Disassembly = $"{RegisterPC - 1:X4}: {opcode:X2} {(disassemble ? Disassemble((ushort)(RegisterPC - 1), out notused) : "---")} ".PadRight(26), + Disassembly = $"{RegisterPC - 1:X4}: {opcode:X2} {(disassemble ? Disassemble((ushort)(RegisterPC - 1), out _) : "---")} ".PadRight(26), RegisterInfo = string.Join(" ", new[] { diff --git a/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs b/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs index 155b1ce839..4f211585b4 100644 --- a/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs +++ b/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs @@ -372,11 +372,9 @@ namespace BizHawk.Emulation.Cores.Components.H6280 public TraceInfo State() { - int notused; - return new TraceInfo { - Disassembly = $"{MPR[PC >> 13]:X2}:{PC:X4}: {ReadMemory(PC):X2} {Disassemble(PC, out notused)} ".PadRight(30), + Disassembly = $"{MPR[PC >> 13]:X2}:{PC:X4}: {ReadMemory(PC):X2} {Disassemble(PC, out _)} ".PadRight(30), RegisterInfo = string.Join(" ", $"A:{A:X2}", $"X:{X:X2}", diff --git a/BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs b/BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs index 041b35ca00..60d520b362 100644 --- a/BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs +++ b/BizHawk.Emulation.Cores/CPUs/Intel8048/I8048.cs @@ -522,11 +522,9 @@ namespace BizHawk.Emulation.Cores.Components.I8048 public TraceInfo State(bool disassemble = true) { - ushort notused; - return new TraceInfo { - Disassembly = $"{(disassemble ? Disassemble(Regs[PC], ReadMemory, out notused) : "---")} ".PadRight(50), + Disassembly = $"{(disassemble ? Disassemble(Regs[PC], ReadMemory, out _) : "---")} ".PadRight(50), RegisterInfo = string.Format( "A:{0:X2} R0:{1:X2} R1:{2:X2} R2:{3:X2} R3:{4:X2} R4:{5:X2} R5:{6:X2} R6:{7:X2} R7:{8:X2} PSW:{9:X4} Cy:{10} LY:{11} {12}{13}{14}{15}{16}{17}{18}{19}{20}{21}{22}", Regs[A], diff --git a/BizHawk.Emulation.Cores/CPUs/LR35902/LR35902.cs b/BizHawk.Emulation.Cores/CPUs/LR35902/LR35902.cs index 80d6091a26..08b1e6c82e 100644 --- a/BizHawk.Emulation.Cores/CPUs/LR35902/LR35902.cs +++ b/BizHawk.Emulation.Cores/CPUs/LR35902/LR35902.cs @@ -637,11 +637,9 @@ namespace BizHawk.Emulation.Cores.Components.LR35902 public TraceInfo State(bool disassemble = true) { - ushort notused; - return new TraceInfo { - Disassembly = $"{(disassemble ? Disassemble(RegPC, ReadMemory, out notused) : "---")} ".PadRight(40), + Disassembly = $"{(disassemble ? Disassemble(RegPC, ReadMemory, out _) : "---")} ".PadRight(40), RegisterInfo = string.Join(" ", $"A:{Regs[A]:X2}", $"F:{Regs[F]:X2}", diff --git a/BizHawk.Emulation.Cores/CPUs/MC6800/MC6800.cs b/BizHawk.Emulation.Cores/CPUs/MC6800/MC6800.cs index 03ca30dce3..25140a1f59 100644 --- a/BizHawk.Emulation.Cores/CPUs/MC6800/MC6800.cs +++ b/BizHawk.Emulation.Cores/CPUs/MC6800/MC6800.cs @@ -502,11 +502,9 @@ namespace BizHawk.Emulation.Cores.Components.MC6800 public TraceInfo State(bool disassemble = true) { - ushort notused; - return new TraceInfo { - Disassembly = $"{(disassemble ? Disassemble(Regs[PC], ReadMemory, out notused) : "---")} ".PadRight(50), + Disassembly = $"{(disassemble ? Disassemble(Regs[PC], ReadMemory, out _) : "---")} ".PadRight(50), RegisterInfo = string.Format( "A:{0:X2} B:{1:X2} X:{2:X4} SP:{3:X4} CC:{4:X2} Cy:{5} {6}{7}{8}{9}{10}{11}", Regs[A], diff --git a/BizHawk.Emulation.Cores/CPUs/MC6809/MC6809.cs b/BizHawk.Emulation.Cores/CPUs/MC6809/MC6809.cs index 29cc653441..e7c9b46484 100644 --- a/BizHawk.Emulation.Cores/CPUs/MC6809/MC6809.cs +++ b/BizHawk.Emulation.Cores/CPUs/MC6809/MC6809.cs @@ -640,11 +640,9 @@ namespace BizHawk.Emulation.Cores.Components.MC6809 public TraceInfo State(bool disassemble = true) { - ushort notused; - return new TraceInfo { - Disassembly = $"{(disassemble ? Disassemble(Regs[PC], ReadMemory, out notused) : "---")} ".PadRight(50), + Disassembly = $"{(disassemble ? Disassemble(Regs[PC], ReadMemory, out _) : "---")} ".PadRight(50), RegisterInfo = string.Format( "A:{0:X2} B:{1:X2} X:{2:X4} Y:{3:X4} US:{4:X4} SP:{5:X4} DP:{6:X2} CC:{7:X2} Cy:{8} {9}{10}{11}{12}{13}{14}{15}{16}", Regs[A], From 5252598aeff49916859eb49c826fa17626a925ba Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 29 Apr 2020 19:10:57 -0500 Subject: [PATCH 09/13] tastudio - remove unnecessary setting of DialogResult --- BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index d4c460ca91..a8edaa2575 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -151,7 +151,6 @@ namespace BizHawk.Client.EmuHawk if (!Engage()) { Close(); - DialogResult = DialogResult.Cancel; return; } From 9203f56eca45ea36bdea47cb3ea8ad19053e2ec7 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 29 Apr 2020 19:17:44 -0500 Subject: [PATCH 10/13] tastudio - consolidate logic and always draw column emphasis (to show sticky state) when setting up columns, rather than only on load --- .../tools/TAStudio/TAStudio.cs | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index a8edaa2575..c8329d4e2a 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -154,8 +154,6 @@ namespace BizHawk.Client.EmuHawk return; } - SetColumnsFromCurrentStickies(); - if (TasView.Rotatable) { RightClickMenu.Items.AddRange(TasView.GenerateContextMenuItems() @@ -426,7 +424,7 @@ namespace BizHawk.Client.EmuHawk int digits; if (ControllerType.AxisControls.Contains(kvp.Key)) { - ControllerDefinition.AxisRange range = ControllerType.AxisRanges + var range = ControllerType.AxisRanges [ControllerType.AxisControls.IndexOf(kvp.Key)]; type = ColumnType.Float; digits = Math.Max(kvp.Value.Length, range.MaxDigits); @@ -473,8 +471,15 @@ namespace BizHawk.Client.EmuHawk column.Visible = false; } - TasView.AllColumns.ColumnsChanged(); + foreach (var column in TasView.VisibleColumns) + { + if (Global.InputManager.StickyXorAdapter.IsSticky(column.Name)) + { + column.Emphasis = true; + } + } + TasView.AllColumns.ColumnsChanged(); SetupBoolPatterns(); } @@ -775,17 +780,6 @@ namespace BizHawk.Client.EmuHawk loadZone.PlaceZone(CurrentTasMovie); } - private void SetColumnsFromCurrentStickies() - { - foreach (var column in TasView.VisibleColumns) - { - if (Global.InputManager.StickyXorAdapter.IsSticky(column.Name)) - { - column.Emphasis = true; - } - } - } - #endregion private void TastudioPlayMode() From 92db6b8b6430af42fe3b64d542c305e88b99cbc5 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 29 Apr 2020 19:39:18 -0500 Subject: [PATCH 11/13] Tastudio - try to sort out when to fully redraw tastudio vs update row count --- .../tools/TAStudio/TAStudio.IToolForm.cs | 2 +- .../tools/TAStudio/TAStudio.ListView.cs | 12 +++++------ .../tools/TAStudio/TAStudio.MenuItems.cs | 20 +++++++++---------- .../tools/TAStudio/TAStudio.cs | 4 ++-- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs index 09637ddda5..024c0743be 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs @@ -87,7 +87,7 @@ namespace BizHawk.Client.EmuHawk TasView.AllColumns.Clear(); StartNewTasMovie(); SetUpColumns(); - RefreshTasView(); + TasView.Refresh(); } else { diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs index 843f8038a3..f7979f4633 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs @@ -424,10 +424,8 @@ namespace BizHawk.Client.EmuHawk private void TasView_ColumnRightClick(object sender, InputRoll.ColumnClickEventArgs e) { e.Column.Emphasis ^= true; - UpdateAutoFire(e.Column.Name, e.Column.Emphasis); - - RefreshTasView(); + TasView.Refresh(); } private void UpdateAutoFire() @@ -565,7 +563,7 @@ namespace BizHawk.Client.EmuHawk { _extraAxisRows.Clear(); AxisEditRow = -1; - RefreshTasView(); + SetTasViewRowCount(); } else { @@ -573,7 +571,7 @@ namespace BizHawk.Client.EmuHawk { _extraAxisRows.Clear(); AxisEditRow = frame; - RefreshTasView(); + SetTasViewRowCount(); } _axisEditYPos = e.Y; @@ -820,7 +818,7 @@ namespace BizHawk.Client.EmuHawk // if a loaded branch log is shorter than selection, keep selection until you attempt to call context menu // you might need it when you load again the branch where this frame exists TasView.DeselectAll(); - RefreshTasView(); + SetTasViewRowCount(); } else { @@ -1176,7 +1174,7 @@ namespace BizHawk.Client.EmuHawk TasView.MakeIndexVisible(TasView.CurrentCell.RowIndex.Value); // todo: limit scrolling speed } - RefreshTasView(); + SetTasViewRowCount(); } private void TasView_MouseMove(object sender, MouseEventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index 3076438f4c..55d95812c2 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -388,13 +388,13 @@ namespace BizHawk.Client.EmuHawk private void DeselectMenuItem_Click(object sender, EventArgs e) { TasView.DeselectAll(); - RefreshTasView(); + TasView.Refresh(); } private void SelectAllMenuItem_Click(object sender, EventArgs e) { TasView.SelectAll(); - RefreshTasView(); + TasView.Refresh(); } private void SelectBetweenMarkersMenuItem_Click(object sender, EventArgs e) @@ -413,7 +413,7 @@ namespace BizHawk.Client.EmuHawk } SetSplicer(); - RefreshTasView(); + TasView.Refresh(); } } @@ -426,7 +426,7 @@ namespace BizHawk.Client.EmuHawk } SetSplicer(); - RefreshTasView(); + TasView.Refresh(); } private void CopyMenuItem_Click(object sender, EventArgs e) @@ -1303,7 +1303,7 @@ namespace BizHawk.Client.EmuHawk CurrentTasMovie.FlagChanges(); TasView.AllColumns.ColumnsChanged(); - RefreshTasView(); + TasView.Refresh(); }; ColumnsSubMenu.DropDownItems.Add(item); @@ -1330,7 +1330,7 @@ namespace BizHawk.Client.EmuHawk CurrentTasMovie.FlagChanges(); TasView.AllColumns.ColumnsChanged(); - RefreshTasView(); + TasView.Refresh(); }; ColumnsSubMenu.DropDownItems.Add(item); @@ -1345,9 +1345,9 @@ namespace BizHawk.Client.EmuHawk private void RestoreDefaults() { TasView.AllColumns.Clear(); - SetUpColumns(); - RefreshTasView(); - CurrentTasMovie.FlagChanges(); + SetUpColumns(); + TasView.Refresh(); + CurrentTasMovie.FlagChanges(); MainVertialSplit.SplitterDistance = _defaultMainSplitDistance; BranchesMarkersSplit.SplitterDistance = _defaultBranchMarkerSplitDistance; @@ -1402,7 +1402,7 @@ namespace BizHawk.Client.EmuHawk private void CancelSeekContextMenuItem_Click(object sender, EventArgs e) { MainForm.PauseOnFrame = null; - RefreshTasView(); + TasView.Refresh(); } private void BranchContextMenuItem_Click(object sender, EventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index c8329d4e2a..845ffe83a3 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -921,7 +921,7 @@ namespace BizHawk.Client.EmuHawk if (refreshTasView) { - RefreshTasView(); + SetTasViewRowCount(); } MarkerControl?.UpdateValues(); @@ -937,7 +937,7 @@ namespace BizHawk.Client.EmuHawk } } - private void RefreshTasView() + private void SetTasViewRowCount() { TasView.RowCount = CurrentTasMovie.InputLogLength + 1; _lastRefresh = Emulator.Frame; From a1c8c4ed3a676954358cb493efc878436bd43a4e Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 29 Apr 2020 19:46:11 -0500 Subject: [PATCH 12/13] Tastudio - create a FullRefresh() method that guarantees RowCount will be updated and all drawing will occur, but is slower, and use it in non-perormance situations such as copy/paste methods. Fixes #1956 --- .../tools/TAStudio/TAStudio.MenuItems.cs | 18 +++++++++--------- .../tools/TAStudio/TAStudio.cs | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index 55d95812c2..15b0487cf5 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -492,7 +492,7 @@ namespace BizHawk.Client.EmuHawk } else { - RefreshDialog(); + FullRefresh(); } } } @@ -535,7 +535,7 @@ namespace BizHawk.Client.EmuHawk } else { - RefreshDialog(); + FullRefresh(); } } } @@ -578,7 +578,7 @@ namespace BizHawk.Client.EmuHawk } else { - RefreshDialog(); + FullRefresh(); } } } @@ -606,7 +606,7 @@ namespace BizHawk.Client.EmuHawk } else { - RefreshDialog(); + FullRefresh(); } } } @@ -620,7 +620,7 @@ namespace BizHawk.Client.EmuHawk if (rollBackFrame >= CurrentTasMovie.InputLogLength) { // Cannot delete non-existent frames - RefreshDialog(); + FullRefresh(); return; } @@ -634,7 +634,7 @@ namespace BizHawk.Client.EmuHawk } else { - RefreshDialog(); + FullRefresh(); } } } @@ -660,7 +660,7 @@ namespace BizHawk.Client.EmuHawk } else { - RefreshDialog(); + FullRefresh(); } } } @@ -681,7 +681,7 @@ namespace BizHawk.Client.EmuHawk } else { - RefreshDialog(); + FullRefresh(); } } } @@ -716,7 +716,7 @@ namespace BizHawk.Client.EmuHawk } else { - RefreshDialog(); + FullRefresh(); } } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 845ffe83a3..b087361686 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -912,6 +912,20 @@ namespace BizHawk.Client.EmuHawk public IEnumerable GetSelection() => TasView.SelectedRows; + // Slow but guarantees the entire dialog refreshes + private void FullRefresh() + { + SetTasViewRowCount(); + TasView.Refresh(); // An extra refresh potentially but we need to guarantee + MarkerControl.UpdateValues(); + BookMarkControl.UpdateValues(); + + if (_undoForm != null && !_undoForm.IsDisposed) + { + _undoForm.UpdateValues(); + } + } + public void RefreshDialog(bool refreshTasView = true, bool refreshBranches = true) { if (_exiting) From 364247d6474703bf4b2fb1e9af1a8d2399026265 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Thu, 30 Apr 2020 11:50:27 +1000 Subject: [PATCH 13/13] Add config.yml for GitHub issue template selection --- .github/ISSUE_TEMPLATE/config.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..e73a91c88b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: true +contact_links: + - name: "BEFORE OPENING AN ISSUE: Search for duplicates" + url: "https://github.com/TASVideos/BizHawk/issues?q=is:issue+" + about: "Opens the issue tracker here on GitHub. Use `is:issue ` to find open or closed issues that might be similar to your problem." + - name: "Report issues with the Linux port" + url: "https://github.com/TASVideos/BizHawk/issues/1430" + about: "Linux users: please comment here on #1430 instead of opening a new issue." + - name: "Chat with us on IRC" + url: "https://webchat.freenode.net/#bizhawk" + about: "Joins #bizhawk on freenode with your browser. Please be patient as there isn't always somebody online."