Skip to content

Commit

Permalink
Merge r7739 into branches/release. Hopefully 1.8.1 will be better.
Browse files Browse the repository at this point in the history
  • Loading branch information
hegyak committed Aug 28, 2014
1 parent f3cd2dc commit eb5ae58
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 109 deletions.
2 changes: 1 addition & 1 deletion BizHawk.Client.EmuHawk/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

211 changes: 108 additions & 103 deletions BizHawk.Client.EmuHawk/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1439,104 +1439,108 @@ private void RewireSound()
}

private void HandlePlatformMenus()
{
var system = string.Empty;

if (!Global.Game.IsNullInstance)
{
system = Global.Game.System;
}
{
var system = string.Empty;
if (!Global.Game.IsNullInstance)
{
//New Code
//We use SystemID as that has the system we are playing on.
system = Global.Emulator.SystemId;
//Old Code below.
//system = Global.Game.System;

TI83SubMenu.Visible = false;
NESSubMenu.Visible = false;
PCESubMenu.Visible = false;
SMSSubMenu.Visible = false;
GBSubMenu.Visible = false;
GBASubMenu.Visible = false;
AtariSubMenu.Visible = false;
SNESSubMenu.Visible = false;
ColecoSubMenu.Visible = false;
N64SubMenu.Visible = false;
SaturnSubMenu.Visible = false;
DGBSubMenu.Visible = false;
GenesisSubMenu.Visible = false;
wonderSwanToolStripMenuItem.Visible = false;
}

switch (system)
{
case "GEN":
GenesisSubMenu.Visible = true;
break;
case "TI83":
TI83SubMenu.Visible = true;
break;
case "NES":
NESSubMenu.Visible = true;
break;
case "PCE":
case "PCECD":
case "SGX":
PCESubMenu.Visible = true;
break;
case "SMS":
SMSSubMenu.Text = "&SMS";
SMSSubMenu.Visible = true;
break;
case "SG":
SMSSubMenu.Text = "&SG";
SMSSubMenu.Visible = true;
break;
case "GG":
SMSSubMenu.Text = "&GG";
SMSSubMenu.Visible = true;
break;
case "GB":
case "GBC":
GBSubMenu.Visible = true;
break;
case "GBA":
GBASubMenu.Visible = true;
break;
case "A26":
AtariSubMenu.Visible = true;
break;
case "SNES":
case "SGB":
// TODO: fix SNES9x here
if (Global.Emulator is LibsnesCore)
{
if ((Global.Emulator as LibsnesCore).IsSGB)
{
SNESSubMenu.Text = "&SGB";
}
else
{
SNESSubMenu.Text = "&SNES";
}
SNESSubMenu.Visible = true;
}
else
{
SNESSubMenu.Visible = false;
}
break;
case "Coleco":
ColecoSubMenu.Visible = true;
break;
case "N64":
N64SubMenu.Visible = true;
break;
case "SAT":
SaturnSubMenu.Visible = true;
break;
case "DGB":
DGBSubMenu.Visible = true;
break;
case "WSWAN":
wonderSwanToolStripMenuItem.Visible = true;
break;
}
}
TI83SubMenu.Visible = false;
NESSubMenu.Visible = false;
PCESubMenu.Visible = false;
SMSSubMenu.Visible = false;
GBSubMenu.Visible = false;
GBASubMenu.Visible = false;
AtariSubMenu.Visible = false;
SNESSubMenu.Visible = false;
ColecoSubMenu.Visible = false;
N64SubMenu.Visible = false;
SaturnSubMenu.Visible = false;
DGBSubMenu.Visible = false;
GenesisSubMenu.Visible = false;
wonderSwanToolStripMenuItem.Visible = false;

switch (system)
{
case "GEN":
GenesisSubMenu.Visible = true;
break;
case "TI83":
TI83SubMenu.Visible = true;
break;
case "NES":
NESSubMenu.Visible = true;
break;
case "PCE":
case "PCECD":
case "SGX":
PCESubMenu.Visible = true;
break;
case "SMS":
SMSSubMenu.Text = "&SMS";
SMSSubMenu.Visible = true;
break;
case "SG":
SMSSubMenu.Text = "&SG";
SMSSubMenu.Visible = true;
break;
case "GG":
SMSSubMenu.Text = "&GG";
SMSSubMenu.Visible = true;
break;
case "GB":
case "GBC":
GBSubMenu.Visible = true;
break;
case "GBA":
GBASubMenu.Visible = true;
break;
case "A26":
AtariSubMenu.Visible = true;
break;
case "SNES":
case "SGB":
// TODO: fix SNES9x here
if (Global.Emulator is LibsnesCore)
{
if ((Global.Emulator as LibsnesCore).IsSGB)
{
SNESSubMenu.Text = "&SGB";
}
else
{
SNESSubMenu.Text = "&SNES";
}
SNESSubMenu.Visible = true;
}
else
{
SNESSubMenu.Visible = false;
}
break;
case "Coleco":
ColecoSubMenu.Visible = true;
break;
case "N64":
N64SubMenu.Visible = true;
break;
case "SAT":
SaturnSubMenu.Visible = true;
break;
case "DGB":
DGBSubMenu.Visible = true;
break;
case "WSWAN":
wonderSwanToolStripMenuItem.Visible = true;
break;
}
}

private static void InitControls()
{
Expand Down Expand Up @@ -3090,7 +3094,8 @@ public bool LoadRom(string path, bool? deterministicemulation = null)
// If deterministic emulation is passed in, respect that value regardless, else determine a good value (currently that simply means movies require deterministic emulaton)
bool deterministic = deterministicemulation.HasValue ?
deterministicemulation.Value :
Global.MovieSession.Movie.IsActive;
Global.MovieSession.QueuedMovie != null;
//Global.MovieSession.Movie.IsActive;

if (!GlobalWin.Tools.AskSave())
{
Expand All @@ -3114,10 +3119,9 @@ public bool LoadRom(string path, bool? deterministicemulation = null)
// the new settings objects
CommitCoreSettingsToConfig(); // adelikat: I Think by reordering things, this isn't necessary anymore
CloseGame();

var nextComm = CreateCoreComm();
CoreFileProvider.SyncCoreCommInputSignals(nextComm);

var result = loader.LoadRom(path, nextComm);

if (result)
Expand Down Expand Up @@ -3222,6 +3226,7 @@ public bool LoadRom(string path, bool? deterministicemulation = null)
}
else
{
//This shows up if there's a problem
// TODO: put all these in a single method or something
HandlePlatformMenus();
_stateSlots.Clear();
Expand Down Expand Up @@ -3287,6 +3292,8 @@ private static void CommitCoreSettingsToConfig()

// whats the difference between these two methods??
// its very tricky. rename to be more clear or combine them.
// This gets called whenever a core related thing is changed.
// Like reboot core.
private void CloseGame(bool clearSram = false)
{
if (clearSram)
Expand All @@ -3310,21 +3317,20 @@ private void CloseGame(bool clearSram = false)
{
StopMovie(true);
}


Global.Emulator.Dispose();
Global.CoreComm = CreateCoreComm();
CoreFileProvider.SyncCoreCommInputSignals();
Global.Emulator = new NullEmulator(Global.CoreComm);
Global.ActiveController = Global.NullControls;
Global.AutoFireController = Global.AutofireNullControls;

RewireSound();
RebootStatusBarIcon.Visible = false;
}

public void CloseRom(bool clearSram = false)
{
//This gets called after Close Game gets called.
//Tested with NESHawk and SMB3 (U)
if (GlobalWin.Tools.AskSave())
{
CloseGame(clearSram);
Expand All @@ -3334,7 +3340,6 @@ public void CloseRom(bool clearSram = false)
Global.Game = GameInfo.NullInstance;

GlobalWin.Tools.Restart();

RewireSound();
Global.Rewinder.ResetRewindBuffer();
Text = "BizHawk" + (VersionInfo.DeveloperBuild ? " (interim) " : string.Empty);
Expand Down
18 changes: 16 additions & 2 deletions BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,17 +356,23 @@ public int ScrollPosition
{
if (NeedsHScrollbar)
{
_programmaticallyUpdatingScrollBarValues = true;
HBar.Value = value;
_programmaticallyUpdatingScrollBarValues = false;
}
}

if (NeedsVScrollbar)
{
_programmaticallyUpdatingScrollBarValues = true;
VBar.Value = value;
_programmaticallyUpdatingScrollBarValues = false;
}
}
}

private bool _programmaticallyUpdatingScrollBarValues = false;

public int LastVisibleIndex
{
get
Expand Down Expand Up @@ -919,12 +925,18 @@ private void DoRightMouseScroll(object sender, MouseEventArgs e)

private void VerticalBar_ValueChanged(object sender, EventArgs e)
{
Refresh();
if (!_programmaticallyUpdatingScrollBarValues)
{
Refresh();
}
}

private void HorizontalBar_ValueChanged(object sender, EventArgs e)
{
Refresh();
if (!_programmaticallyUpdatingScrollBarValues)
{
Refresh();
}
}

private void ColumnChangedCallback()
Expand All @@ -950,7 +962,9 @@ private void RecalculateScrollBars()

if (VBar.Value > max)
{
_programmaticallyUpdatingScrollBarValues = true;
VBar.Value = max;
_programmaticallyUpdatingScrollBarValues = false;
}

VBar.Maximum = max + VBar.LargeChange; // TODO: why can't it be 1?
Expand Down
4 changes: 2 additions & 2 deletions BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/VBANext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public VBANext(byte[] rom, CoreComm comm, GameInfo game, bool deterministic, obj
FES.RTCsec = _SyncSettings.RTCInitialTime.Second;
if (DeterministicEmulation)
{
FES.skipBios = false;
// FES.skipBios = false; // this is OK; it is deterministic and probably accurate
FES.RTCUseRealTime = false;
}

Expand Down Expand Up @@ -423,7 +423,7 @@ public bool PutSyncSettings(object o)
public class SyncSettings
{
[DisplayName("Skip BIOS")]
[Description("Skips the BIOS intro. A BIOS file is still required. Forced to false for movie recording.")]
[Description("Skips the BIOS intro. A BIOS file is still required.")]
[DefaultValue(true)]
public bool SkipBios { get; set; }
[DisplayName("RTC Use Real Time")]
Expand Down
2 changes: 1 addition & 1 deletion VersionInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
static class VersionInfo
{
public const string MAINVERSION = "1.8.0";
public const string MAINVERSION = "1.8.1";
public static string RELEASEDATE = "August 30, 2014";
public static bool DeveloperBuild = false;

Expand Down

0 comments on commit eb5ae58

Please sign in to comment.