revert to pre-refactor state. its a WIP, dont judge

This commit is contained in:
zeromus 2013-10-25 00:34:01 +00:00
parent 28023e8882
commit 249ddea268
245 changed files with 6918 additions and 4057 deletions

View File

@ -1,140 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{24A0AA3C-B25F-4197-B23D-476D6462DBA0}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BizHawk.Client.Common</RootNamespace>
<AssemblyName>BizHawk.Client.Common</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;DEBUG;DOTNET20;UNMANAGED;COMPRESS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;DOTNET20;UNMANAGED;COMPRESS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>..\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="7z\ArchiveEmulationStreamProxy.cs" />
<Compile Include="7z\ArchiveExtractCallback.cs" />
<Compile Include="7z\ArchiveOpenCallback.cs" />
<Compile Include="7z\ArchiveUpdateCallback.cs" />
<Compile Include="7z\COM.cs" />
<Compile Include="7z\Common.cs" />
<Compile Include="7z\EventArgs.cs" />
<Compile Include="7z\Exceptions.cs" />
<Compile Include="7z\FileSignatureChecker.cs" />
<Compile Include="7z\Formats.cs" />
<Compile Include="7z\LibraryFeature.cs" />
<Compile Include="7z\LibraryManager.cs" />
<Compile Include="7z\LzmaDecodeStream.cs" />
<Compile Include="7z\LzmaEncodeStream.cs" />
<Compile Include="7z\LzmaProgressCallback.cs" />
<Compile Include="7z\NativeMethods.cs" />
<Compile Include="7z\sdk\Common\CRC.cs" />
<Compile Include="7z\sdk\Common\InBuffer.cs" />
<Compile Include="7z\sdk\Common\OutBuffer.cs" />
<Compile Include="7z\sdk\Compress\LZMA\LzmaBase.cs" />
<Compile Include="7z\sdk\Compress\LZMA\LzmaDecoder.cs" />
<Compile Include="7z\sdk\Compress\LZMA\LzmaEncoder.cs" />
<Compile Include="7z\sdk\Compress\LZ\IMatchFinder.cs" />
<Compile Include="7z\sdk\Compress\LZ\LzBinTree.cs" />
<Compile Include="7z\sdk\Compress\LZ\LzInWindow.cs" />
<Compile Include="7z\sdk\Compress\LZ\LzOutWindow.cs" />
<Compile Include="7z\sdk\Compress\RangeCoder\RangeCoder.cs" />
<Compile Include="7z\sdk\Compress\RangeCoder\RangeCoderBit.cs" />
<Compile Include="7z\sdk\Compress\RangeCoder\RangeCoderBitTree.cs" />
<Compile Include="7z\sdk\ICoder.cs" />
<Compile Include="7z\SevenZipCompressor.cs" />
<Compile Include="7z\SevenZipCompressorAsynchronous.cs" />
<Compile Include="7z\SevenZipExtractor.cs" />
<Compile Include="7z\SevenZipExtractorAsynchronous.cs" />
<Compile Include="7z\SevenZipSfx.cs" />
<Compile Include="7z\StreamWrappers.cs" />
<Compile Include="config\Binding.cs" />
<Compile Include="config\Config.cs" />
<Compile Include="config\ConfigService.cs" />
<Compile Include="CoreFileProvider.cs" />
<Compile Include="FirmwareManager.cs" />
<Compile Include="Global.cs" />
<Compile Include="HawkFile.cs" />
<Compile Include="helpers\InputValidate.cs" />
<Compile Include="KeyTurbo.cs" />
<Compile Include="movie\InputAdapters.cs" />
<Compile Include="movie\Movie.cs" />
<Compile Include="movie\MovieHeader.cs" />
<Compile Include="movie\MovieLog.cs" />
<Compile Include="movie\MovieMnemonics.cs" />
<Compile Include="movie\MovieSession.cs" />
<Compile Include="movie\MultitrackRecording.cs" />
<Compile Include="movie\Subtitle.cs" />
<Compile Include="movie\SubtitleList.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RecentFiles.cs" />
<Compile Include="helpers\StringHelpers.cs" />
<Compile Include="RomGame.cs" />
<Compile Include="tools\Cheat.cs" />
<Compile Include="tools\CheatList.cs" />
<Compile Include="tools\Watch.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BizHawk.Emulation\BizHawk.Emulation.csproj">
<Project>{197D4314-8A9F-49BA-977D-54ACEFAEB6BA}</Project>
<Name>BizHawk.Emulation</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="7z\arch\Test.bzip2.7z" />
<None Include="7z\arch\Test.lzma.7z" />
<None Include="7z\arch\Test.lzma2.7z" />
<None Include="7z\arch\Test.ppmd.7z" />
<None Include="7z\arch\Test.rar" />
<None Include="7z\arch\Test.tar" />
<None Include="7z\arch\Test.txt.bz2" />
<None Include="7z\arch\Test.txt.gz" />
<None Include="7z\arch\Test.txt.xz" />
<None Include="7z\arch\Test.zip" />
</ItemGroup>
<ItemGroup>
<Content Include="7z\arch\Test.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,18 +0,0 @@
namespace BizHawk.Client.Common
{
public static class Global
{
public static IEmulator Emulator;
public static Config Config;
public static GameInfo Game;
public static CheatList CheatList;
//Movie
/// <summary>
/// the global MovieSession can use this to deal with multitrack player remapping (should this be here? maybe it should be in MovieSession)
/// </summary>
public static MultitrackRewiringControllerAdapter MultitrackRewiringControllerAdapter = new MultitrackRewiringControllerAdapter();
public static MovieSession MovieSession = new MovieSession();
}
}

View File

@ -1,204 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace BizHawk.Client.Common
{
public class Binding
{
public string DisplayName;
public string Bindings;
public string DefaultBinding;
public string TabGroup;
public int Ordinal = 0;
}
public class BindingCollection : IEnumerable<Binding>
{
public List<Binding> Bindings { get; private set; }
public BindingCollection()
{
Bindings = new List<Binding>();
Bindings.AddRange(DefaultValues);
}
public void Add(Binding b)
{
Bindings.Add(b);
}
public IEnumerator<Binding> GetEnumerator()
{
return Bindings.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public Binding this[string index]
{
get
{
return Bindings.FirstOrDefault(x => x.DisplayName == index) ?? new Binding();
}
}
public void ResolveWithDefaults()
{
//Add missing entries
foreach (Binding default_binding in DefaultValues)
{
var binding = Bindings.FirstOrDefault(x => x.DisplayName == default_binding.DisplayName);
if (binding == null)
{
Bindings.Add(default_binding);
}
}
List<Binding> entriesToRemove = (from entry in Bindings let binding = DefaultValues.FirstOrDefault(x => x.DisplayName == entry.DisplayName) where binding == null select entry).ToList();
//Remove entries that no longer exist in defaults
foreach (Binding entry in entriesToRemove)
{
Bindings.Remove(entry);
}
}
public static List<Binding> DefaultValues
{
get
{
return new List<Binding>
{
//General
new Binding { DisplayName = "Frame Advance", Bindings = "F", TabGroup = "General", DefaultBinding = "F", Ordinal = 0 },
new Binding { DisplayName = "Rewind", Bindings = "Shift+R, J1 B7, X1 Left Trigger", TabGroup = "General", DefaultBinding = "Shift+R, J1 B7, X1 Left Trigger", Ordinal = 1 },
new Binding { DisplayName = "Pause", Bindings = "Pause", TabGroup = "General", DefaultBinding = "Pause", Ordinal = 2 },
new Binding { DisplayName = "Fast Forward", Bindings = "Tab, J1 B8, X1 Right Trigger", TabGroup = "General", DefaultBinding = "Tab, J1 B8, X1 Right Trigger", Ordinal = 3 },
new Binding { DisplayName = "Turbo", Bindings = "Shift+Tab", TabGroup = "General", DefaultBinding = "Shift+Tab", Ordinal = 4 },
new Binding { DisplayName = "Toggle Throttle", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 5 },
new Binding { DisplayName = "Soft Reset", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 6 },
new Binding { DisplayName = "Hard Reset", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 7 },
new Binding { DisplayName = "Quick Load", Bindings = "P", TabGroup = "General", DefaultBinding = "P", Ordinal = 8 },
new Binding { DisplayName = "Quick Save", Bindings = "I", TabGroup = "General", DefaultBinding = "I", Ordinal = 9 },
new Binding { DisplayName = "Autohold", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 10 },
new Binding { DisplayName = "Clear Autohold", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 11 },
new Binding { DisplayName = "Screenshot", Bindings = "F12", TabGroup = "General", DefaultBinding = "F12", Ordinal = 12 },
new Binding { DisplayName = "Full Screen", Bindings = "Alt+Return", TabGroup = "General", DefaultBinding = "Alt+Return", Ordinal = 13 },
new Binding { DisplayName = "Open ROM", Bindings = "Ctrl+O", TabGroup = "General", DefaultBinding = "Ctrl+O", Ordinal = 14 },
new Binding { DisplayName = "Close ROM", Bindings = "Ctrl+W", TabGroup = "General", DefaultBinding = "Ctrl+W", Ordinal = 15 },
new Binding { DisplayName = "Display FPS", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 16 },
new Binding { DisplayName = "Frame Counter", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 17 },
new Binding { DisplayName = "Lag Counter", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 18 },
new Binding { DisplayName = "Input Display", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 19 },
new Binding { DisplayName = "Toggle BG Input", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 20 },
new Binding { DisplayName = "Toggle Menu", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 21 },
new Binding { DisplayName = "Volume Up", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 22 },
new Binding { DisplayName = "Volume Down", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 23 },
new Binding { DisplayName = "Record A/V", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 24 },
new Binding { DisplayName = "Stop A/V", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 25 },
new Binding { DisplayName = "Larger Window", Bindings = "Alt+UpArrow", TabGroup = "General", DefaultBinding = "Alt+UpArrow", Ordinal = 26 },
new Binding { DisplayName = "Smaller Window", Bindings = "Alt+DownArrow", TabGroup = "General", DefaultBinding = "Alt+DownArrow", Ordinal = 27 },
new Binding { DisplayName = "Increase Speed", Bindings = "Equals", TabGroup = "General", DefaultBinding = "Equals", Ordinal = 28 },
new Binding { DisplayName = "Decrease Speed", Bindings = "Minus", TabGroup = "General", DefaultBinding = "Minus", Ordinal = 29 },
new Binding { DisplayName = "Reboot Core", Bindings = "Ctrl+R", TabGroup = "General", DefaultBinding = "Ctrl+R", Ordinal = 30 },
new Binding { DisplayName = "Autofire", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 31 },
//Save States
new Binding { DisplayName = "Save State 0", Bindings = "Shift+F10", TabGroup = "Save States", DefaultBinding = "Shift+F10", Ordinal = 1 },
new Binding { DisplayName = "Save State 1", Bindings = "Shift+F1", TabGroup = "Save States", DefaultBinding = "Shift+F1", Ordinal = 2 },
new Binding { DisplayName = "Save State 2", Bindings = "Shift+F2", TabGroup = "Save States", DefaultBinding = "Shift+F2", Ordinal = 3 },
new Binding { DisplayName = "Save State 3", Bindings = "Shift+F3", TabGroup = "Save States", DefaultBinding = "Shift+F3", Ordinal = 4 },
new Binding { DisplayName = "Save State 4", Bindings = "Shift+F4", TabGroup = "Save States", DefaultBinding = "Shift+F4", Ordinal = 5 },
new Binding { DisplayName = "Save State 5", Bindings = "Shift+F5", TabGroup = "Save States", DefaultBinding = "Shift+F5", Ordinal = 6 },
new Binding { DisplayName = "Save State 6", Bindings = "Shift+F6", TabGroup = "Save States", DefaultBinding = "Shift+F6", Ordinal = 7 },
new Binding { DisplayName = "Save State 7", Bindings = "Shift+F7", TabGroup = "Save States", DefaultBinding = "Shift+F7", Ordinal = 8 },
new Binding { DisplayName = "Save State 8", Bindings = "Shift+F8", TabGroup = "Save States", DefaultBinding = "Shift+F8", Ordinal = 9 },
new Binding { DisplayName = "Save State 9", Bindings = "Shift+F9", TabGroup = "Save States", DefaultBinding = "Shift+F9", Ordinal = 10 },
new Binding { DisplayName = "Load State 0", Bindings = "F10", TabGroup = "Save States", DefaultBinding = "F10", Ordinal = 11 },
new Binding { DisplayName = "Load State 1", Bindings = "F1", TabGroup = "Save States", DefaultBinding = "F1", Ordinal = 12 },
new Binding { DisplayName = "Load State 2", Bindings = "F2", TabGroup = "Save States", DefaultBinding = "F2", Ordinal = 13 },
new Binding { DisplayName = "Load State 3", Bindings = "F3", TabGroup = "Save States", DefaultBinding = "F3", Ordinal = 14 },
new Binding { DisplayName = "Load State 4", Bindings = "F4", TabGroup = "Save States", DefaultBinding = "F4", Ordinal = 15 },
new Binding { DisplayName = "Load State 5", Bindings = "F5", TabGroup = "Save States", DefaultBinding = "F5", Ordinal = 16 },
new Binding { DisplayName = "Load State 6", Bindings = "F6", TabGroup = "Save States", DefaultBinding = "F6", Ordinal = 17 },
new Binding { DisplayName = "Load State 7", Bindings = "F7", TabGroup = "Save States", DefaultBinding = "F7", Ordinal = 18 },
new Binding { DisplayName = "Load State 8", Bindings = "F8", TabGroup = "Save States", DefaultBinding = "F8", Ordinal = 19 },
new Binding { DisplayName = "Load State 9", Bindings = "F9", TabGroup = "Save States", DefaultBinding = "F9", Ordinal = 20 },
new Binding { DisplayName = "Select State 0", Bindings = "D0", TabGroup = "Save States", DefaultBinding = "D0", Ordinal = 21 },
new Binding { DisplayName = "Select State 1", Bindings = "D1", TabGroup = "Save States", DefaultBinding = "D1", Ordinal = 22 },
new Binding { DisplayName = "Select State 2", Bindings = "D2", TabGroup = "Save States", DefaultBinding = "D2", Ordinal = 23 },
new Binding { DisplayName = "Select State 3", Bindings = "D3", TabGroup = "Save States", DefaultBinding = "D3", Ordinal = 24 },
new Binding { DisplayName = "Select State 4", Bindings = "D4", TabGroup = "Save States", DefaultBinding = "D4", Ordinal = 25 },
new Binding { DisplayName = "Select State 5", Bindings = "D5", TabGroup = "Save States", DefaultBinding = "D5", Ordinal = 26 },
new Binding { DisplayName = "Select State 6", Bindings = "D6", TabGroup = "Save States", DefaultBinding = "D6", Ordinal = 27 },
new Binding { DisplayName = "Select State 7", Bindings = "D7", TabGroup = "Save States", DefaultBinding = "D7", Ordinal = 28 },
new Binding { DisplayName = "Select State 8", Bindings = "D8", TabGroup = "Save States", DefaultBinding = "D8", Ordinal = 29 },
new Binding { DisplayName = "Select State 9", Bindings = "D9", TabGroup = "Save States", DefaultBinding = "D9", Ordinal = 30 },
new Binding { DisplayName = "Save Named State", Bindings = "", TabGroup = "Save States", DefaultBinding = "", Ordinal = 31 },
new Binding { DisplayName = "Load Named State", Bindings = "", TabGroup = "Save States", DefaultBinding = "", Ordinal = 32 },
new Binding { DisplayName = "Previous Slot", Bindings = "", TabGroup = "Save States", DefaultBinding = "", Ordinal = 33 },
new Binding { DisplayName = "Next Slot", Bindings = "", TabGroup = "Save States", DefaultBinding = "", Ordinal = 34 },
//Movie
new Binding { DisplayName = "Toggle read-only", Bindings = "Q", TabGroup = "Movie", DefaultBinding = "Q", Ordinal = 0 },
new Binding { DisplayName = "Play Movie", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 1 },
new Binding { DisplayName = "Record Movie", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 2 },
new Binding { DisplayName = "Stop Movie", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 3 },
new Binding { DisplayName = "Play from beginning", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 4 },
new Binding { DisplayName = "Save Movie", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 5 },
new Binding { DisplayName = "Toggle MultiTrack", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 6 },
new Binding { DisplayName = "MT Select All", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 7 },
new Binding { DisplayName = "MT Select None", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 8 },
new Binding { DisplayName = "MT Increment Player", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 9 },
new Binding { DisplayName = "MT Decrement Player", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 10 },
new Binding { DisplayName = "Movie Poke", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 11 },
new Binding { DisplayName = "Scrub Input", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 12 },
//Tools
new Binding { DisplayName = "Ram Watch", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 0 },
new Binding { DisplayName = "Ram Search", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 1 },
new Binding { DisplayName = "Hex Editor", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 3 },
new Binding { DisplayName = "Trace Logger", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 4 },
new Binding { DisplayName = "Lua Console", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 5 },
new Binding { DisplayName = "Cheats", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 6 },
new Binding { DisplayName = "TAStudio", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 7 },
new Binding { DisplayName = "ToolBox", Bindings = "T", TabGroup = "Tools", DefaultBinding = "", Ordinal = 8 },
new Binding { DisplayName = "Virtual Pad", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 9 },
new Binding { DisplayName = "New Search", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "", Ordinal = 10 },
new Binding { DisplayName = "Do Search", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "", Ordinal = 11 },
new Binding { DisplayName = "Previous Compare To", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "", Ordinal = 12 },
new Binding { DisplayName = "Next Compare To", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "", Ordinal = 13 },
new Binding { DisplayName = "Previous Operator", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "", Ordinal = 14 },
new Binding { DisplayName = "Next Operator", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "", Ordinal = 15 },
//SNES
new Binding { DisplayName = "Toggle BG 1", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 0 },
new Binding { DisplayName = "Toggle BG 2", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 1 },
new Binding { DisplayName = "Toggle BG 3", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 2 },
new Binding { DisplayName = "Toggle BG 4", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 3 },
new Binding { DisplayName = "Toggle OBJ 1", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 4 },
new Binding { DisplayName = "Toggle OBJ 2", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 5 },
new Binding { DisplayName = "Toggle OBJ 3", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 6 },
new Binding { DisplayName = "Toggle OBJ 4", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 7 },
//Analog
new Binding { DisplayName = "Y Up Small", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 0 },
new Binding { DisplayName = "Y Up Large", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 1 },
new Binding { DisplayName = "Y Down Small", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 2 },
new Binding { DisplayName = "Y Down Large", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 3 },
new Binding { DisplayName = "X Up Small", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 4 },
new Binding { DisplayName = "X Up Large", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 5 },
new Binding { DisplayName = "X Down Small", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 6 },
new Binding { DisplayName = "X Down Large", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 7 },
};
}
}
}
}

View File

@ -1,49 +0,0 @@
using System;
using System.Text;
namespace BizHawk.Client.Common
{
public class Subtitle
{
public string Message { get; set; }
public int Frame { get; set; }
public int X { get; set; }
public int Y { get; set; }
public int Duration { get; set; }
public uint Color { get; set; }
public Subtitle()
{
Message = String.Empty;
X = 0;
Y = 0;
Duration = 120;
Frame = 0;
Color = 0xFFFFFFFF;
}
public Subtitle(Subtitle s)
{
Message = s.Message;
Frame = s.Frame;
X = s.X;
Y = s.Y;
Duration = s.Duration;
Color = s.Color;
}
public override string ToString()
{
StringBuilder sb = new StringBuilder("subtitle ");
sb
.Append(Frame.ToString()).Append(" ")
.Append(X.ToString()).Append(" ")
.Append(Y.ToString()).Append(" ")
.Append(Duration.ToString()).Append(" ")
.Append(String.Format("{0:X8}", Color)).Append(" ")
.Append(Message);
return sb.ToString();
}
}
}

View File

@ -0,0 +1,608 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{197D4314-8A9F-49BA-977D-54ACEFAEB6BA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BizHawk.Emulation</RootNamespace>
<AssemblyName>BizHawk.Emulation</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<UseVSHostingProcess>false</UseVSHostingProcess>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;VS2012</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<UseVSHostingProcess>false</UseVSHostingProcess>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="EMU7800, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\BizHawk.MultiClient\output\dll\EMU7800.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\VersionInfo.cs">
<Link>VersionInfo.cs</Link>
</Compile>
<Compile Include="Buffer.cs" />
<Compile Include="Computers\Commodore64\C64.Core.cs" />
<Compile Include="Computers\Commodore64\C64.cs" />
<Compile Include="Computers\Commodore64\C64.Motherboard.cs" />
<Compile Include="Computers\Commodore64\C64.MotherboardInterface.cs" />
<Compile Include="Computers\Commodore64\Cartridge\Mapper0000.cs" />
<Compile Include="Computers\Commodore64\C64.Input.cs" />
<Compile Include="Computers\Commodore64\Cartridge\Mapper0005.cs" />
<Compile Include="Computers\Commodore64\Cartridge\Mapper000B.cs" />
<Compile Include="Computers\Commodore64\Cartridge\Mapper000F.cs" />
<Compile Include="Computers\Commodore64\Cartridge\Mapper0011.cs" />
<Compile Include="Computers\Commodore64\Cartridge\Mapper0012.cs" />
<Compile Include="Computers\Commodore64\Cartridge\Mapper0013.cs" />
<Compile Include="Computers\Commodore64\Cartridge\Mapper0020.cs" />
<Compile Include="Computers\Commodore64\Disk\VIC1541.cs" />
<Compile Include="Computers\Commodore64\Disk\VIC1541.PLA.cs" />
<Compile Include="Computers\Commodore64\Experimental\C64.cs" />
<Compile Include="Computers\Commodore64\Experimental\C64.Glue.cs" />
<Compile Include="Computers\Commodore64\Experimental\C64Presets.NTSC.cs" />
<Compile Include="Computers\Commodore64\Experimental\C64Presets.PAL.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cassette.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cia.Interface.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cia.Internal.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cia.Registers.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cia.Settings.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cpu.Interface.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cpu.Internal.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cpu.State.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Expansion.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Joystick.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Keyboard.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Pla.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Ram.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Rom.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Serial.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Sid.Interface.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Sid.Internal.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Sid.Registers.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Sid.Settings.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Sid.SoundProvider.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Userport.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Graphics.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Interface.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Internal.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Registers.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Settings.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Sprite.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.State.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Synth.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Timing.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.VideoProvider.cs" />
<Compile Include="Computers\Commodore64\Experimental\Chips\Presets.cs" />
<Compile Include="Computers\Commodore64\Experimental\IMotherboard.cs" />
<Compile Include="Computers\Commodore64\InputFileInfo.cs" />
<Compile Include="Computers\Commodore64\Media\PRG.cs" />
<Compile Include="Computers\Commodore64\Cartridge\Cart.cs" />
<Compile Include="Computers\Commodore64\MOS\CartridgePort.cs" />
<Compile Include="Computers\Commodore64\MOS\CassettePort.cs" />
<Compile Include="Computers\Commodore64\MOS\Chip2114.cs" />
<Compile Include="Computers\Commodore64\MOS\Chip23XX.cs" />
<Compile Include="Computers\Commodore64\MOS\Chip4864.cs" />
<Compile Include="Computers\Commodore64\MOS\MOS6510.cs" />
<Compile Include="Computers\Commodore64\MOS\MOS6522.cs" />
<Compile Include="Computers\Commodore64\Media\D64.cs" />
<Compile Include="Computers\Commodore64\Media\Disk.cs" />
<Compile Include="Computers\Commodore64\Media\G64.cs" />
<Compile Include="Computers\Commodore64\MOS\MOS6526.cs" />
<Compile Include="Computers\Commodore64\MOS\MOS6567.cs" />
<Compile Include="Computers\Commodore64\MOS\MOS6581.cs" />
<Compile Include="Computers\Commodore64\MOS\MOS6569.cs" />
<Compile Include="Computers\Commodore64\C64.Savestate.cs" />
<Compile Include="Computers\Commodore64\MOS\MOSPLA.cs" />
<Compile Include="Computers\Commodore64\MOS\Port.cs" />
<Compile Include="Computers\Commodore64\MOS\SerialPort.cs" />
<Compile Include="Computers\Commodore64\MOS\Sid.cs" />
<Compile Include="Computers\Commodore64\MOS\Sid.Envelope.cs" />
<Compile Include="Computers\Commodore64\MOS\Sid.Voice.cs" />
<Compile Include="Computers\Commodore64\MOS\UserPort.cs" />
<Compile Include="Computers\Commodore64\MOS\Vic.cs" />
<Compile Include="Computers\Commodore64\MOS\Vic.GraphicsGenerator.cs" />
<Compile Include="Computers\Commodore64\MOS\Vic.Parse.cs" />
<Compile Include="Computers\Commodore64\MOS\Vic.Registers.cs" />
<Compile Include="Computers\Commodore64\MOS\Vic.Render.cs" />
<Compile Include="Computers\Commodore64\MOS\Vic.SpriteGenerator.cs" />
<Compile Include="Computers\Commodore64\MOS\Vic.State.cs" />
<Compile Include="Computers\Commodore64\MOS\Vic.TimingBuilder.cs" />
<Compile Include="Computers\Commodore64\MOS\Vic.VideoProvider.cs" />
<Compile Include="Computers\Commodore64\SaveState.cs" />
<Compile Include="Computers\Commodore64\Tape\VIC1530.cs" />
<Compile Include="Consoles\Atari\2600\Atari2600.cs" />
<Compile Include="Consoles\Atari\2600\Atari2600.Core.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\m3Fe.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\m0840.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\m3E.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\m3F.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\m4A50.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mDPC.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mE0.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mE7.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mEF.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mF0.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mF4.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mCV.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\m2K.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\m4K.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mF6.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mF8.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mFA.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mFE.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mMC.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mUA.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mX07.cs" />
<Compile Include="Consoles\Atari\2600\oldTIA.cs" />
<Compile Include="Consoles\Atari\2600\M6532.cs" />
<Compile Include="Consoles\Atari\2600\TIA.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Consoles\Atari\7800\Atari7800.Core.cs" />
<Compile Include="Consoles\Atari\7800\Atari7800.cs" />
<Compile Include="Consoles\Atari\7800\Atari7800Control.cs" />
<Compile Include="Consoles\Calculator\TI83.cs" />
<Compile Include="Consoles\Coleco\ColecoVision.cs" />
<Compile Include="Consoles\Coleco\Input.cs" />
<Compile Include="Consoles\Coleco\MemoryMap.cs" />
<Compile Include="Consoles\Coleco\TMS9918A.cs" />
<Compile Include="Consoles\Intellivision\Cartridge.cs" />
<Compile Include="Consoles\Intellivision\ICart.cs" />
<Compile Include="Consoles\Intellivision\Intellicart.cs" />
<Compile Include="Consoles\Intellivision\Intellivision.cs" />
<Compile Include="Consoles\Intellivision\MemoryMap.cs" />
<Compile Include="Consoles\Intellivision\PSG.cs" />
<Compile Include="Consoles\Intellivision\STIC.cs" />
<Compile Include="Consoles\Nintendo\Gameboy\Gambatte.cs" />
<Compile Include="Consoles\Nintendo\Gameboy\GambatteLink.cs" />
<Compile Include="Consoles\Nintendo\Gameboy\GBColors.cs" />
<Compile Include="Consoles\Nintendo\Gameboy\LibGambatte.cs" />
<Compile Include="Consoles\Nintendo\GBA\LibMeteor.cs" />
<Compile Include="Consoles\Nintendo\GBA\Meteor.cs" />
<Compile Include="Consoles\Nintendo\N64\mupen64plusApi.cs" />
<Compile Include="Consoles\Nintendo\N64\N64.cs" />
<Compile Include="Consoles\Nintendo\NES\APU.cs" />
<Compile Include="Consoles\Nintendo\NES\BoardSystem.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\AVE-NINA.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\AxROM.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Consoles\Nintendo\NES\Boards\BANDAI-FCG-1.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\BANDAI_74_161_02_74.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\BANDAI_74_161_161_32.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\BxROM.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Camerica.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper028.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\CNROM.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\CPROM.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Consoles\Nintendo\NES\Boards\ExROM.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\GxROM.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Consoles\Nintendo\NES\Boards\IC_74x377.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Consoles\Nintendo\NES\Boards\IREM-74_161_161_21_138.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Irem_G101.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Irem_H3001.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\IREM_TAM_S1.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Jaleco-JF_11_14.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\JALECO_JF_05_06_07.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\JALECO_JF_13.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\JALECO_JF_17.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\JALECO_JF_19.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\JALECO_SS8806.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper015.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper036.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper038.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper040.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper041.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper042.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper045.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper057.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper058.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper069.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper090.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper091.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper099.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper101.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper103.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper107.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper108.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper116.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper120.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper132.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper143.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper156.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper164.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper168.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper176.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper177.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper178.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper180.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper193.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper200.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper201.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper203.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper207.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper218.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper225.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper226.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper227.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper230.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper231.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper233.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper240.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper241.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper242.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper078.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper046.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper243.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper246.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper50.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper60.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper61.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper62.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MLT-ACTION52.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MLT-MAX15.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\HKROM.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper012.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper037.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper044.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper049.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper052.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper074.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper115.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper165.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper182.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper189.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper191.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper192.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper194.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper197.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper205.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper245.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper249.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper250.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\MMC3.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\NES-QJ.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\TQROM.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\TLSROM.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\TVROM.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\TxROM.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Namcot1xx\DRROM.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Namcot1xx\Mapper076.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Namcot1xx\Mapper088.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Namcot1xx\Mapper095.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Namcot1xx\Mapper112.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Namcot1xx\Mapper154.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Namcot1xx\Mapper206.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Namcot1xx\Namco163Audio.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Namcot1xx\Namcot1xx.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\NAMCOT_m19_m210.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Consoles\Nintendo\NES\Boards\NanJing.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\NES-EVENT.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\NovelDiamond.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\NROM.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Consoles\Nintendo\NES\Boards\NROM368.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\PxROM_FxROM.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\SachenSimple.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\SEEPROM.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Sunsoft1.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Sunsoft2_m89.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Sunsoft2_m93.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Sunsoft3.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Sunsoft4.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\SxROM.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Consoles\Nintendo\NES\Boards\TAITO_74_161_161_32.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Taito_TC0190FMC.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Taito_X1_005.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Taito_X1_017.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\TENGEN-800032.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\TENGEN_800008.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\UxROM.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Consoles\Nintendo\NES\Boards\VRC1.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\VRC2_4.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\VRC3.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\VRC6.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\VRC7.cs" />
<Compile Include="Consoles\Nintendo\NES\BisqAPU.cs" />
<Compile Include="Consoles\Nintendo\NES\Core.cs" />
<Compile Include="Consoles\Nintendo\NES\FDS\FDS.cs" />
<Compile Include="Consoles\Nintendo\NES\FDS\FDSAudio.cs" />
<Compile Include="Consoles\Nintendo\NES\FDS\RamAdapter.cs" />
<Compile Include="Consoles\Nintendo\NES\iNES.cs" />
<Compile Include="Consoles\Nintendo\NES\NES.cs" />
<Compile Include="Consoles\Nintendo\NES\Palettes.cs" />
<Compile Include="Consoles\Nintendo\NES\PPU.cs" />
<Compile Include="Consoles\Nintendo\NES\PPU.regs.cs" />
<Compile Include="Consoles\Nintendo\NES\PPU.run.cs" />
<Compile Include="Consoles\Nintendo\NES\Unif.cs" />
<Compile Include="Consoles\Nintendo\SNES\LibsnesApi.cs" />
<Compile Include="Consoles\Nintendo\SNES\LibsnesCore.cs" />
<Compile Include="Consoles\Nintendo\SNES\SnesColors.cs" />
<Compile Include="Consoles\Nintendo\SNES\SNESGraphicsDecoder.cs" />
<Compile Include="Consoles\PC Engine\ADPCM.cs" />
<Compile Include="Consoles\PC Engine\ArcadeCard.cs" />
<Compile Include="Consoles\PC Engine\MemoryMap.TurboCD.cs" />
<Compile Include="Consoles\PC Engine\MemoryMap.Populous.cs" />
<Compile Include="Consoles\PC Engine\ScsiCDBus.cs" />
<Compile Include="Consoles\PC Engine\TurboCD.cs" />
<Compile Include="Consoles\PSX\LibMednahawkDll.cs" />
<Compile Include="Consoles\PSX\Octoshock.cs" />
<Compile Include="Consoles\Sega\Genesis\Cart\EEPROM.cs" />
<Compile Include="Consoles\Sega\Genesis\Cart\RomHeader.cs" />
<Compile Include="Consoles\Sega\Genesis\Cart\SaveRAM.cs" />
<Compile Include="Consoles\Sega\Genesis\Input.cs" />
<Compile Include="Consoles\Sega\Saturn\FilePiping.cs" />
<Compile Include="Consoles\Sega\Saturn\LibYabause.cs" />
<Compile Include="Consoles\Sega\Saturn\Yabause.cs" />
<Compile Include="Consoles\Sega\SMS\MemoryMap.CodeMasters.cs" />
<Compile Include="Consoles\Sega\SMS\MemoryMap.Sega.cs" />
<Compile Include="Consoles\Sega\SMS\VDP.ModeTMS.cs" />
<Compile Include="Consoles\Sega\SMS\VDP.Mode4.cs" />
<Compile Include="Consoles\Sega\SMS\VDP.Tables.cs" />
<Compile Include="Consoles\Sony\PSP\PPSSPPDll.cs" />
<Compile Include="Consoles\Sony\PSP\PSP.cs" />
<Compile Include="CPUs\68000\Diassembler.cs" />
<Compile Include="CPUs\68000\Instructions\BitArithemetic.cs" />
<Compile Include="CPUs\68000\Instructions\DataMovement.cs" />
<Compile Include="CPUs\68000\Instructions\IntegerMath.cs" />
<Compile Include="CPUs\68000\Instructions\ProgramFlow.cs" />
<Compile Include="CPUs\68000\Instructions\Supervisor.cs" />
<Compile Include="CPUs\68000\MC68000.cs" />
<Compile Include="CPUs\68000\Memory.cs" />
<Compile Include="CPUs\68000\OpcodeTable.cs" />
<Compile Include="CPUs\68000\Tables.cs" />
<Compile Include="CPUs\CP1610\CP1610.cs" />
<Compile Include="CPUs\CP1610\Disassembler.cs" />
<Compile Include="CPUs\CP1610\Execute.cs" />
<Compile Include="CPUs\HuC6280\Disassembler.cs" />
<Compile Include="CPUs\HuC6280\Execute.cs" />
<Compile Include="CPUs\HuC6280\HuC6280.cs" />
<Compile Include="CPUs\MOS 6502X\Disassembler.cs" />
<Compile Include="CPUs\MOS 6502X\Execute.cs" />
<Compile Include="CPUs\MOS 6502X\MOS6502X.cs" />
<Compile Include="CPUs\MOS 6502X\MOS6502XDouble.cs" />
<Compile Include="CPUs\MOS 6502X\MOS6502XNative.cs" />
<Compile Include="CPUs\Native68000\Musashi.cs" />
<Compile Include="CPUs\x86\Disassembler.cs" />
<Compile Include="CPUs\x86\Execute.cs" />
<Compile Include="CPUs\x86\Timing.cs" />
<Compile Include="CPUs\x86\x86.cs" />
<Compile Include="CPUs\Z80-GB\Execute.cs" />
<Compile Include="CPUs\Z80-GB\Interrupts.cs" />
<Compile Include="CPUs\Z80-GB\NewDisassembler.cs" />
<Compile Include="CPUs\Z80-GB\Registers.cs" />
<Compile Include="CPUs\Z80-GB\Tables.cs" />
<Compile Include="CPUs\Z80-GB\Z80.cs" />
<Compile Include="CPUs\Z80\Disassembler.cs" />
<Compile Include="CPUs\Z80\Execute.cs" />
<Compile Include="CPUs\Z80\Interrupts.cs" />
<Compile Include="CPUs\Z80\Registers.cs" />
<Compile Include="CPUs\Z80\Tables.cs" />
<Compile Include="CPUs\Z80\Z80A.cs" />
<Compile Include="Database\CRC32.cs" />
<Compile Include="Database\Database.cs" />
<Compile Include="Database\FirmwareDatabase.cs" />
<Compile Include="Database\GameInfo.cs" />
<Compile Include="DiscSystem\Blobs\Blob_ECM.cs" />
<Compile Include="DiscSystem\Blobs\Blob_WaveFile.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DiscSystem\Blobs\RiffMaster.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DiscSystem\CCD_format.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DiscSystem\cdfs\EndianBitConverter.cs" />
<Compile Include="DiscSystem\cdfs\ISODirectoryNode.cs" />
<Compile Include="DiscSystem\cdfs\ISOFile.cs" />
<Compile Include="DiscSystem\cdfs\ISOFileNode.cs" />
<Compile Include="DiscSystem\cdfs\ISONode.cs" />
<Compile Include="DiscSystem\cdfs\ISONodeRecord.cs" />
<Compile Include="DiscSystem\cdfs\ISOVolumeDescriptor.cs" />
<Compile Include="DiscSystem\CUE_format.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DiscSystem\Decoding.cs" />
<Compile Include="DiscSystem\Disc.API.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DiscSystem\Disc.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DiscSystem\Disc.ID.cs" />
<Compile Include="DiscSystem\DiscTOC.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DiscSystem\ECM.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DiscSystem\GPL_ECM.cs" />
<Compile Include="DiscSystem\Subcode.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DiscSystem\TOC_format.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\Base Implementations\IPS.cs" />
<Compile Include="Interfaces\Base Implementations\Movies.cs" />
<Compile Include="Interfaces\Base Implementations\NullController.cs" />
<Compile Include="Interfaces\Base Implementations\NullEmulator.cs" />
<Compile Include="Interfaces\CoreComms.cs" />
<Compile Include="Interfaces\ICoreFileProvider.cs" />
<Compile Include="Interfaces\ISyncSoundProvider.cs" />
<Compile Include="Properties\svnrev.cs" />
<Compile Include="QuickCollections.cs" />
<Compile Include="Sound\CDAudio.cs" />
<Compile Include="Sound\MMC5Audio.cs" />
<Compile Include="Sound\Sunsoft5BAudio.cs" />
<Compile Include="Sound\Utilities\BlipBuffer.cs" />
<Compile Include="Sound\Utilities\DCFilter.cs" />
<Compile Include="Sound\Utilities\Equalizer.cs" />
<Compile Include="Sound\Utilities\SpeexResampler.cs" />
<Compile Include="Sound\Utilities\BufferedAsync.cs" />
<Compile Include="Sound\Utilities\Metaspu.cs" />
<Compile Include="Interfaces\IController.cs" />
<Compile Include="Interfaces\IEmulator.cs" />
<Compile Include="Interfaces\ISoundProvider.cs" />
<Compile Include="Interfaces\IVideoProvider.cs" />
<Compile Include="Log.cs" />
<Compile Include="Consoles\PC Engine\Input.cs" />
<Compile Include="Consoles\PC Engine\MemoryMap.cs" />
<Compile Include="Consoles\PC Engine\MemoryMap.SF2.cs" />
<Compile Include="Consoles\PC Engine\MemoryMap.SuperGrafx.cs" />
<Compile Include="Consoles\PC Engine\PCEngine.cs" />
<Compile Include="Sound\HuC6280PSG.cs" />
<Compile Include="Consoles\PC Engine\VCE.cs" />
<Compile Include="Consoles\PC Engine\VDC.cs" />
<Compile Include="Consoles\PC Engine\VDC.Render.cs" />
<Compile Include="Consoles\PC Engine\VPC.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Consoles\Sega\Genesis\Genesis.cs" />
<Compile Include="Consoles\Sega\Genesis\GenVDP.cs" />
<Compile Include="Consoles\Sega\Genesis\GenVDP.DMA.cs" />
<Compile Include="Consoles\Sega\Genesis\GenVDP.Render.cs" />
<Compile Include="Consoles\Sega\Genesis\IO.cs" />
<Compile Include="Consoles\Sega\Genesis\MemoryMap.68000.cs" />
<Compile Include="Consoles\Sega\Genesis\MemoryMap.Z80.cs" />
<Compile Include="Sound\VRC6Alt.cs" />
<Compile Include="Sound\YM2612.cs" />
<Compile Include="Consoles\Sega\SMS\BIOS.cs" />
<Compile Include="Sound\Utilities\SoundMixer.cs" />
<Compile Include="Consoles\Sega\SMS\Input.cs" />
<Compile Include="Sound\SN76489.cs" />
<Compile Include="Consoles\Sega\SMS\SMS.cs" />
<Compile Include="Consoles\Sega\SMS\VDP.cs" />
<Compile Include="Sound\YM2413.cs" />
<Compile Include="Util.cs" />
<Compile Include="Sound\Utilities\Waves.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Computers\Commodore64\docs\CRT.TXT" />
<Content Include="Consoles\Coleco\docs\CV-Sound.txt" />
<Content Include="Consoles\Coleco\docs\CV-Tech.txt" />
<Content Include="Consoles\Nintendo\NES\Docs\sunsoft.txt" />
<Content Include="Consoles\Nintendo\NES\Docs\sxrom_notes.txt" />
<Content Include="Consoles\PC Engine\Compat.txt" />
<Content Include="Consoles\Sega\Genesis\Compat.txt" />
<Content Include="Consoles\Sega\SMS\Compat.txt" />
<Content Include="Notes.txt" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Folder Include="Computers\Commodore64\Peripheral\" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="Consoles\Atari\docs\stella.pdf" />
<None Include="Consoles\Coleco\docs\colecovision tech1.pdf" />
<None Include="Consoles\Coleco\docs\colecovision tech2.pdf" />
<None Include="Consoles\Nintendo\NES\Docs\BoardTable.xlsx" />
<None Include="Consoles\Nintendo\NES\Docs\MapperCompatibilityList.url" />
<None Include="Consoles\Nintendo\NES\Docs\nesasm.pdf" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">"$(SolutionDir)subwcrev.bat" "$(ProjectDir)"</PreBuildEvent>
<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)subwcrev.sh" "$(ProjectDir)"</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -194,14 +194,9 @@ namespace BizHawk.Emulation.Consoles.GB
LibGambatte.gambatte_runfor(GambatteState, VideoBuffer, 160, soundbuff, ref nsamp); LibGambatte.gambatte_runfor(GambatteState, VideoBuffer, 160, soundbuff, ref nsamp);
if (rendersound) if (rendersound)
{
soundbuffcontains = (int)nsamp; soundbuffcontains = (int)nsamp;
ProcessSound();
}
else else
{
soundbuffcontains = 0; soundbuffcontains = 0;
}
FrameAdvancePost(); FrameAdvancePost();
} }
@ -782,7 +777,7 @@ namespace BizHawk.Emulation.Consoles.GB
#region ISoundProvider #region ISoundProvider
public ISoundProvider SoundProvider { get { return null; } } public ISoundProvider SoundProvider { get { return null; } }
public ISyncSoundProvider SyncSoundProvider { get { return this; } } public ISyncSoundProvider SyncSoundProvider { get { return dcfilter; } }
public bool StartAsyncSound() { return false; } public bool StartAsyncSound() { return false; }
public void EndAsyncSound() { } public void EndAsyncSound() { }
@ -795,58 +790,21 @@ namespace BizHawk.Emulation.Consoles.GB
/// </summary> /// </summary>
int soundbuffcontains = 0; int soundbuffcontains = 0;
int soundoutbuffcontains = 0; Sound.Utilities.SpeexResampler resampler;
Sound.Utilities.DCFilter dcfilter;
short[] soundoutbuff = new short[2048];
int latchaudio = 0;
//Sound.Utilities.SpeexResampler resampler;
//Sound.Utilities.DCFilter dcfilter;
Sound.Utilities.BlipBuffer blip;
void ProcessSound()
{
for (uint i = 0; i < soundbuffcontains; i++)
{
int curr = soundbuff[i * 2];
if (curr != latchaudio)
{
int diff = latchaudio - curr;
latchaudio = curr;
blip.AddDelta(i, diff);
}
}
blip.EndFrame((uint)soundbuffcontains);
soundoutbuffcontains = blip.SamplesAvailable();
blip.ReadSamples(soundoutbuff, soundoutbuffcontains, true);
for (int i = 0; i < soundoutbuffcontains * 2; i += 2)
soundoutbuff[i + 1] = soundoutbuff[i];
soundbuffcontains = 0;
}
void InitSound() void InitSound()
{ {
//resampler = new Sound.Utilities.SpeexResampler(2, 2097152, 44100, 2097152, 44100, null, this); resampler = new Sound.Utilities.SpeexResampler(2, 2097152, 44100, 2097152, 44100, null, this);
//dcfilter = Sound.Utilities.DCFilter.AsISyncSoundProvider(resampler, 65536); //dcfilter = Sound.Utilities.DCFilter.AsISyncSoundProvider(resampler, 65536);
// lowpass filtering on an actual GB was probably pretty aggressive? // lowpass filtering on an actual GB was probably pretty aggressive?
//dcfilter = Sound.Utilities.DCFilter.AsISyncSoundProvider(resampler, 2048); dcfilter = Sound.Utilities.DCFilter.AsISyncSoundProvider(resampler, 2048);
blip = new Sound.Utilities.BlipBuffer(1024);
blip.SetRates(2097152, 44100);
} }
void DisposeSound() void DisposeSound()
{ {
blip.Dispose(); resampler.Dispose();
blip = null; resampler = null;
//resampler.Dispose();
//resampler = null;
} }
public void DiscardSamples() public void DiscardSamples()
@ -856,8 +814,8 @@ namespace BizHawk.Emulation.Consoles.GB
public void GetSamples(out short[] samples, out int nsamp) public void GetSamples(out short[] samples, out int nsamp)
{ {
samples = soundoutbuff; samples = soundbuff;
nsamp = soundoutbuffcontains; nsamp = soundbuffcontains;
} }
#endregion #endregion

View File

@ -33,6 +33,7 @@ namespace BizHawk
FirmwareAndOption("300C20DF6731A33952DED8C436F7F186D25D3492", "GBA", "Bios", "gbabios.rom", "Bios"); FirmwareAndOption("300C20DF6731A33952DED8C436F7F186D25D3492", "GBA", "Bios", "gbabios.rom", "Bios");
//FirmwareAndOption("24F67BDEA115A2C847C8813A262502EE1607B7DF", "NDS", "Bios_Arm7", "biosnds7.rom", "ARM7 Bios"); //FirmwareAndOption("24F67BDEA115A2C847C8813A262502EE1607B7DF", "NDS", "Bios_Arm7", "biosnds7.rom", "ARM7 Bios");
//FirmwareAndOption("BFAAC75F101C135E32E2AAF541DE6B1BE4C8C62D", "NDS", "Bios_Arm9", "biosnds9.rom", "ARM9 Bios"); //FirmwareAndOption("BFAAC75F101C135E32E2AAF541DE6B1BE4C8C62D", "NDS", "Bios_Arm9", "biosnds9.rom", "ARM9 Bios");
FirmwareAndOption("EF66DAD3E7B2B6A86F326765E7DFD7D1A308AD8F", "TI83", "Rom", "ti83_1.rom", "TI-83 Rom");
FirmwareAndOption("5A65B922B562CB1F57DAB51B73151283F0E20C7A", "INTV", "EROM", "erom.bin", "Executive Rom"); FirmwareAndOption("5A65B922B562CB1F57DAB51B73151283F0E20C7A", "INTV", "EROM", "erom.bin", "Executive Rom");
FirmwareAndOption("F9608BB4AD1CFE3640D02844C7AD8E0BCD974917", "INTV", "GROM", "grom.bin", "Graphics Rom"); FirmwareAndOption("F9608BB4AD1CFE3640D02844C7AD8E0BCD974917", "INTV", "GROM", "grom.bin", "Graphics Rom");
FirmwareAndOption("1D503E56DF85A62FEE696E7618DC5B4E781DF1BB", "C64", "Kernal", "c64-kernal.bin", "Kernal Rom"); FirmwareAndOption("1D503E56DF85A62FEE696E7618DC5B4E781DF1BB", "C64", "Kernal", "c64-kernal.bin", "Kernal Rom");
@ -60,25 +61,6 @@ namespace BizHawk
Option("SAT", "E", ss_100a_ue); Option("SAT", "E", ss_100a_ue);
Option("SAT", "E", ss_100_j); Option("SAT", "E", ss_100_j);
Option("SAT", "E", ss_101_j); Option("SAT", "E", ss_101_j);
var ti83_102 = File("CE08F6A808701FC6672230A790167EE485157561", "ti83_102.rom", "TI-83 Rom v1.02");
var ti83_103 = File("8399E384804D8D29866CAA4C8763D7A61946A467", "ti83_103.rom", "TI-83 Rom v1.03");
var ti83_104 = File("33877FF637DC5F4C5388799FD7E2159B48E72893", "ti83_104.rom", "TI-83 Rom v1.04");
var ti83_106 = File("3D65C2A1B771CE8E5E5A0476EC1AA9C9CDC0E833", "ti83_106.rom", "TI-83 Rom v1.06");
var ti83_107 = File("EF66DAD3E7B2B6A86F326765E7DFD7D1A308AD8F", "ti83_107.rom", "TI-83 Rom v1.07"); //formerly the 1.?? recommended one
var ti83_108 = File("9C74F0B61655E9E160E92164DB472AD7EE02B0F8", "ti83_108.rom", "TI-83 Rom v1.08");
var ti83p_103 = File("37EAEEB9FB5C18FB494E322B75070E80CC4D858E", "ti83p_103b.rom", "TI-83 Plus Rom v1.03");
var ti83p_112 = File("6615DF5554076B6B81BD128BF847D2FF046E556B", "ti83p_112.rom", "TI-83 Plus Rom v1.12");
Firmware("TI83", "Rom", "TI-83 Rom");
Option("TI83", "Rom", ti83_102);
Option("TI83", "Rom", ti83_103);
Option("TI83", "Rom", ti83_104);
Option("TI83", "Rom", ti83_106);
Option("TI83", "Rom", ti83_107);
Option("TI83", "Rom", ti83_108);
Option("TI83", "Rom", ti83p_103);
Option("TI83", "Rom", ti83p_112);
} }
//adds a defined firmware ID to the database //adds a defined firmware ID to the database

View File

@ -3,8 +3,6 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using BizHawk.Client.Common;
//some helpful p/invoke from http://www.codeproject.com/KB/audio-video/Motion_Detection.aspx?msg=1142967 //some helpful p/invoke from http://www.codeproject.com/KB/audio-video/Motion_Detection.aspx?msg=1142967
namespace BizHawk.MultiClient namespace BizHawk.MultiClient

View File

@ -7,8 +7,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
/// <summary> /// <summary>

View File

@ -5,8 +5,6 @@ using System.Text;
using System.IO; using System.IO;
using System.Drawing; using System.Drawing;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient.AVOut namespace BizHawk.MultiClient.AVOut
{ {
public class GifWriter : IVideoWriter public class GifWriter : IVideoWriter

View File

@ -7,8 +7,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient.AVOut namespace BizHawk.MultiClient.AVOut
{ {
public partial class GifWriterForm : Form public partial class GifWriterForm : Form

View File

@ -7,8 +7,6 @@ using System.Text;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams; using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
using ICSharpCode.SharpZipLib.Zip.Compression; using ICSharpCode.SharpZipLib.Zip.Compression;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
/// <summary> /// <summary>

View File

@ -7,8 +7,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
/// <summary> /// <summary>

View File

@ -4,8 +4,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class ArchiveChooser : Form public partial class ArchiveChooser : Form

View File

@ -60,7 +60,6 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<UseVSHostingProcess>false</UseVSHostingProcess> <UseVSHostingProcess>false</UseVSHostingProcess>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<DefineConstants>WINDOWS</DefineConstants>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<NoWin32Manifest>true</NoWin32Manifest> <NoWin32Manifest>true</NoWin32Manifest>
@ -160,6 +159,8 @@
<Compile Include="BizBox.Designer.cs"> <Compile Include="BizBox.Designer.cs">
<DependentUpon>BizBox.cs</DependentUpon> <DependentUpon>BizBox.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Config.cs" />
<Compile Include="ConfigService.cs" />
<Compile Include="config\AutofireConfig.cs"> <Compile Include="config\AutofireConfig.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -193,12 +194,6 @@
<Compile Include="config\FirmwaresConfig.Designer.cs"> <Compile Include="config\FirmwaresConfig.Designer.cs">
<DependentUpon>FirmwaresConfig.cs</DependentUpon> <DependentUpon>FirmwaresConfig.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="config\FirmwaresConfigInfo.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="config\FirmwaresConfigInfo.Designer.cs">
<DependentUpon>FirmwaresConfigInfo.cs</DependentUpon>
</Compile>
<Compile Include="config\GifAnimator.cs"> <Compile Include="config\GifAnimator.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -245,44 +240,12 @@
<Compile Include="config\SoundConfig.Designer.cs"> <Compile Include="config\SoundConfig.Designer.cs">
<DependentUpon>SoundConfig.cs</DependentUpon> <DependentUpon>SoundConfig.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="CustomControls\FolderBrowserDialogEx.cs"> <Compile Include="CoreFileProvider.cs" />
<SubType>Component</SubType>
</Compile>
<Compile Include="CustomControls\HexTextBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CustomControls\InputConfigBase.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CustomControls\MiscControls.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CustomControls\QuickProgressPopup.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CustomControls\QuickProgressPopup.Designer.cs">
<DependentUpon>QuickProgressPopup.cs</DependentUpon>
</Compile>
<Compile Include="CustomControls\SmartTextBoxControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CustomControls\TextDebugView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CustomControls\ToolStripEx.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CustomControls\Util.cs" />
<Compile Include="CustomControls\ViewportPanel.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CustomControls\VirtualListView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CustomControls\Win32.cs" />
<Compile Include="DisplayManager\DisplayManager.cs" /> <Compile Include="DisplayManager\DisplayManager.cs" />
<Compile Include="DisplayManager\Filters\Hq2x.cs" /> <Compile Include="DisplayManager\Filters\Hq2x.cs" />
<Compile Include="GlobalWinF.cs" /> <Compile Include="FirmwareManager.cs" />
<Compile Include="Global.cs" />
<Compile Include="HawkFile.cs" />
<Compile Include="Input\ControllerBinding.cs" /> <Compile Include="Input\ControllerBinding.cs" />
<Compile Include="Input\GamePad.cs" Condition=" '$(OS)' == 'Windows_NT' " /> <Compile Include="Input\GamePad.cs" Condition=" '$(OS)' == 'Windows_NT' " />
<Compile Include="Input\GamePad360.cs" /> <Compile Include="Input\GamePad360.cs" />
@ -308,6 +271,7 @@
<Compile Include="movie\EditCommentsForm.Designer.cs"> <Compile Include="movie\EditCommentsForm.Designer.cs">
<DependentUpon>EditCommentsForm.cs</DependentUpon> <DependentUpon>EditCommentsForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="movie\InputAdapters.cs" />
<Compile Include="Input\Keyboard.cs" Condition=" '$(OS)' == 'Windows_NT' " /> <Compile Include="Input\Keyboard.cs" Condition=" '$(OS)' == 'Windows_NT' " />
<Compile Include="MainForm.cs"> <Compile Include="MainForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
@ -325,7 +289,13 @@
<Compile Include="movie\EditSubtitlesForm.Designer.cs"> <Compile Include="movie\EditSubtitlesForm.Designer.cs">
<DependentUpon>EditSubtitlesForm.cs</DependentUpon> <DependentUpon>EditSubtitlesForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="movie\Movie.cs" />
<Compile Include="movie\MovieHeader.cs" />
<Compile Include="movie\MovieImport.cs" /> <Compile Include="movie\MovieImport.cs" />
<Compile Include="movie\MovieLog.cs" />
<Compile Include="movie\MovieMnemonics.cs" />
<Compile Include="movie\MovieSession.cs" />
<Compile Include="movie\MultitrackRecording.cs" />
<Compile Include="movie\PlayMovie.cs"> <Compile Include="movie\PlayMovie.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -338,6 +308,8 @@
<Compile Include="movie\RecordMovie.Designer.cs"> <Compile Include="movie\RecordMovie.Designer.cs">
<DependentUpon>RecordMovie.cs</DependentUpon> <DependentUpon>RecordMovie.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="movie\Subtitle.cs" />
<Compile Include="movie\SubtitleList.cs" />
<Compile Include="movie\SubtitleMaker.cs"> <Compile Include="movie\SubtitleMaker.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -353,6 +325,7 @@
</Compile> </Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="tools\Cheats\Cheat.cs" />
<Compile Include="tools\Cheats\CheatEdit.cs"> <Compile Include="tools\Cheats\CheatEdit.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
@ -365,6 +338,7 @@
<Compile Include="tools\Cheats\CheatForm.Designer.cs"> <Compile Include="tools\Cheats\CheatForm.Designer.cs">
<DependentUpon>CheatForm.cs</DependentUpon> <DependentUpon>CheatForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="tools\Cheats\CheatList.cs" />
<Compile Include="tools\GBA\GBAGPUView.cs"> <Compile Include="tools\GBA\GBAGPUView.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -734,6 +708,7 @@
<Compile Include="tools\Watch\RamWatch.Designer.cs"> <Compile Include="tools\Watch\RamWatch.Designer.cs">
<DependentUpon>RamWatch.cs</DependentUpon> <DependentUpon>RamWatch.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="tools\Watch\Watch.cs" />
<Compile Include="tools\Watch\WatchEditor.cs"> <Compile Include="tools\Watch\WatchEditor.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -770,9 +745,6 @@
<EmbeddedResource Include="config\FirmwaresConfig.resx"> <EmbeddedResource Include="config\FirmwaresConfig.resx">
<DependentUpon>FirmwaresConfig.cs</DependentUpon> <DependentUpon>FirmwaresConfig.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="config\FirmwaresConfigInfo.resx">
<DependentUpon>FirmwaresConfigInfo.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="config\GifAnimator.resx"> <EmbeddedResource Include="config\GifAnimator.resx">
<DependentUpon>GifAnimator.cs</DependentUpon> <DependentUpon>GifAnimator.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -788,12 +760,6 @@
<EmbeddedResource Include="config\RewindConfig.resx"> <EmbeddedResource Include="config\RewindConfig.resx">
<DependentUpon>RewindConfig.cs</DependentUpon> <DependentUpon>RewindConfig.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="CustomControls\InputConfigBase.resx">
<DependentUpon>InputConfigBase.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CustomControls\QuickProgressPopup.resx">
<DependentUpon>QuickProgressPopup.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx"> <EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@ -989,7 +955,9 @@
<Compile Include="tools\InputPrompt.Designer.cs"> <Compile Include="tools\InputPrompt.Designer.cs">
<DependentUpon>InputPrompt.cs</DependentUpon> <DependentUpon>InputPrompt.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="RecentFiles.cs" />
<Compile Include="RenderPanel.cs" /> <Compile Include="RenderPanel.cs" />
<Compile Include="RomGame.cs" />
<Compile Include="ScreenSaver.cs" /> <Compile Include="ScreenSaver.cs" />
<Compile Include="Sound.cs" /> <Compile Include="Sound.cs" />
<Compile Include="tools\TAStudio.cs"> <Compile Include="tools\TAStudio.cs">
@ -1006,14 +974,14 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\BizHawk.Client.Common\BizHawk.Client.Common.csproj">
<Project>{24A0AA3C-B25F-4197-B23D-476D6462DBA0}</Project>
<Name>BizHawk.Client.Common</Name>
</ProjectReference>
<ProjectReference Include="..\BizHawk.Emulation\BizHawk.Emulation.csproj"> <ProjectReference Include="..\BizHawk.Emulation\BizHawk.Emulation.csproj">
<Project>{197D4314-8A9F-49BA-977D-54ACEFAEB6BA}</Project> <Project>{197D4314-8A9F-49BA-977D-54ACEFAEB6BA}</Project>
<Name>BizHawk.Emulation</Name> <Name>BizHawk.Emulation</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\BizHawk.Util\BizHawk.Util.csproj">
<Project>{EE135301-08B3-4EFC-A61C-1C53E1C65CB9}</Project>
<Name>BizHawk.Util</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="AboutBox.resx"> <EmbeddedResource Include="AboutBox.resx">

File diff suppressed because it is too large Load Diff

View File

@ -4,13 +4,13 @@ using System.Drawing;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections; using System.Collections;
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
public class Config public class Config
{ {
public Config() public Config()
{ {
/*ControllerConfig.ConfigCheckAllControlDefaults(this); TODO*/ ControllerConfig.ConfigCheckAllControlDefaults(this);
} }
public void ResolveDefaults() public void ResolveDefaults()
@ -184,7 +184,7 @@ namespace BizHawk.Client.Common
public bool RamWatchShowDiffColumn = false; public bool RamWatchShowDiffColumn = false;
public bool RamWatchShowDomainColumn = true; public bool RamWatchShowDomainColumn = true;
public Dictionary<string, int> RamWatchColumnWidths = new Dictionary<string, int> public Dictionary<string, int> RamWatchColumnWidths = new Dictionary<string, int>()
{ {
{ "AddressColumn", -1 }, { "AddressColumn", -1 },
{ "ValueColumn", -1 }, { "ValueColumn", -1 },
@ -195,7 +195,7 @@ namespace BizHawk.Client.Common
{ "NotesColumn",-1 }, { "NotesColumn",-1 },
}; };
public Dictionary<string, int> RamWatchColumnIndexes = new Dictionary<string, int> public Dictionary<string, int> RamWatchColumnIndexes = new Dictionary<string, int>()
{ {
{ "AddressColumn", 0 }, { "AddressColumn", 0 },
{ "ValueColumn", 1 }, { "ValueColumn", 1 },
@ -230,7 +230,7 @@ namespace BizHawk.Client.Common
public bool RamSearchFastMode = false; public bool RamSearchFastMode = false;
public bool RamSearchAlwaysOnTop = false; public bool RamSearchAlwaysOnTop = false;
public Dictionary<string, int> RamSearchColumnWidths = new Dictionary<string, int> public Dictionary<string, int> RamSearchColumnWidths = new Dictionary<string, int>()
{ {
{ "AddressColumn", -1 }, { "AddressColumn", -1 },
{ "ValueColumn", -1 }, { "ValueColumn", -1 },
@ -239,7 +239,7 @@ namespace BizHawk.Client.Common
{ "DiffColumn", -1 }, { "DiffColumn", -1 },
}; };
public Dictionary<string, int> RamSearchColumnIndexes = new Dictionary<string, int> public Dictionary<string, int> RamSearchColumnIndexes = new Dictionary<string, int>()
{ {
{ "AddressColumn", 0 }, { "AddressColumn", 0 },
{ "ValueColumn", 1 }, { "ValueColumn", 1 },
@ -414,7 +414,7 @@ namespace BizHawk.Client.Common
public int CheatsDomainIndex = 5; public int CheatsDomainIndex = 5;
public bool CheatsAlwaysOnTop = false; public bool CheatsAlwaysOnTop = false;
public Dictionary<string, int> CheatsColumnWidths = new Dictionary<string, int> public Dictionary<string, int> CheatsColumnWidths = new Dictionary<string, int>()
{ {
{ "NamesColumn", -1 }, { "NamesColumn", -1 },
{ "AddressColumn", -1 }, { "AddressColumn", -1 },
@ -427,7 +427,7 @@ namespace BizHawk.Client.Common
{ "DisplayTypeColumn", -1 }, { "DisplayTypeColumn", -1 },
}; };
public Dictionary<string, int> CheatsColumnIndices = new Dictionary<string, int> public Dictionary<string, int> CheatsColumnIndices = new Dictionary<string, int>()
{ {
{ "NamesColumn", 0 }, { "NamesColumn", 0 },
{ "AddressColumn", 1 }, { "AddressColumn", 1 },
@ -440,7 +440,7 @@ namespace BizHawk.Client.Common
{ "DisplayTypeColumn", 8 }, { "DisplayTypeColumn", 8 },
}; };
public Dictionary<string, bool> CheatsColumnShow = new Dictionary<string, bool> public Dictionary<string, bool> CheatsColumnShow = new Dictionary<string, bool>()
{ {
{ "NamesColumn", true }, { "NamesColumn", true },
{ "AddressColumn", true }, { "AddressColumn", true },
@ -649,6 +649,214 @@ namespace BizHawk.Client.Common
#region Sub-classes TODO - it is about time to port these to separate files #region Sub-classes TODO - it is about time to port these to separate files
public class BindingCollection : IEnumerable<Binding>
{
public List<Binding> Bindings { get; private set; }
public BindingCollection()
{
Bindings = new List<Binding>();
Bindings.AddRange(DefaultValues);
}
public void Add(Binding b)
{
Bindings.Add(b);
}
public IEnumerator<Binding> GetEnumerator()
{
return Bindings.GetEnumerator();
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public Binding this[string index]
{
get
{
return Bindings.FirstOrDefault(x => x.DisplayName == index) ?? new Binding();
}
}
public void ResolveWithDefaults()
{
//Add missing entries
foreach (Binding default_binding in DefaultValues)
{
var binding = Bindings.FirstOrDefault(x => x.DisplayName == default_binding.DisplayName);
if (binding == null)
{
Bindings.Add(default_binding);
}
}
List<Binding> entriesToRemove = new List<Binding>();
//Remove entries that no longer exist in defaults
foreach (Binding entry in Bindings)
{
var binding = DefaultValues.FirstOrDefault(x => x.DisplayName == entry.DisplayName);
if (binding == null)
{
entriesToRemove.Add(entry);
}
}
foreach (Binding entry in entriesToRemove)
{
Bindings.Remove(entry);
}
}
public static List<Binding> DefaultValues
{
get
{
return new List<Binding>()
{
//General
new Binding() { DisplayName = "Frame Advance", Bindings = "F", TabGroup = "General", DefaultBinding = "F", Ordinal = 0 },
new Binding() { DisplayName = "Rewind", Bindings = "Shift+R, J1 B7, X1 Left Trigger", TabGroup = "General", DefaultBinding = "Shift+R, J1 B7, X1 Left Trigger", Ordinal = 1 },
new Binding() { DisplayName = "Pause", Bindings = "Pause", TabGroup = "General", DefaultBinding = "Pause", Ordinal = 2 },
new Binding() { DisplayName = "Fast Forward", Bindings = "Tab, J1 B8, X1 Right Trigger", TabGroup = "General", DefaultBinding = "Tab, J1 B8, X1 Right Trigger", Ordinal = 3 },
new Binding() { DisplayName = "Turbo", Bindings = "Shift+Tab", TabGroup = "General", DefaultBinding = "Shift+Tab", Ordinal = 4 },
new Binding() { DisplayName = "Toggle Throttle", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 5 },
new Binding() { DisplayName = "Soft Reset", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 6 },
new Binding() { DisplayName = "Hard Reset", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 7 },
new Binding() { DisplayName = "Quick Load", Bindings = "P", TabGroup = "General", DefaultBinding = "P", Ordinal = 8 },
new Binding() { DisplayName = "Quick Save", Bindings = "I", TabGroup = "General", DefaultBinding = "I", Ordinal = 9 },
new Binding() { DisplayName = "Autohold", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 10 },
new Binding() { DisplayName = "Clear Autohold", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 11 },
new Binding() { DisplayName = "Screenshot", Bindings = "F12", TabGroup = "General", DefaultBinding = "F12", Ordinal = 12 },
new Binding() { DisplayName = "Full Screen", Bindings = "Alt+Return", TabGroup = "General", DefaultBinding = "Alt+Return", Ordinal = 13 },
new Binding() { DisplayName = "Open ROM", Bindings = "Ctrl+O", TabGroup = "General", DefaultBinding = "Ctrl+O", Ordinal = 14 },
new Binding() { DisplayName = "Close ROM", Bindings = "Ctrl+W", TabGroup = "General", DefaultBinding = "Ctrl+W", Ordinal = 15 },
new Binding() { DisplayName = "Display FPS", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 16 },
new Binding() { DisplayName = "Frame Counter", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 17 },
new Binding() { DisplayName = "Lag Counter", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 18 },
new Binding() { DisplayName = "Input Display", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 19 },
new Binding() { DisplayName = "Toggle BG Input", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 20 },
new Binding() { DisplayName = "Toggle Menu", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 21 },
new Binding() { DisplayName = "Volume Up", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 22 },
new Binding() { DisplayName = "Volume Down", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 23 },
new Binding() { DisplayName = "Record A/V", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 24 },
new Binding() { DisplayName = "Stop A/V", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 25 },
new Binding() { DisplayName = "Larger Window", Bindings = "Alt+UpArrow", TabGroup = "General", DefaultBinding = "Alt+UpArrow", Ordinal = 26 },
new Binding() { DisplayName = "Smaller Window", Bindings = "Alt+DownArrow", TabGroup = "General", DefaultBinding = "Alt+DownArrow", Ordinal = 27 },
new Binding() { DisplayName = "Increase Speed", Bindings = "Equals", TabGroup = "General", DefaultBinding = "Equals", Ordinal = 28 },
new Binding() { DisplayName = "Decrease Speed", Bindings = "Minus", TabGroup = "General", DefaultBinding = "Minus", Ordinal = 29 },
new Binding() { DisplayName = "Reboot Core", Bindings = "Ctrl+R", TabGroup = "General", DefaultBinding = "Ctrl+R", Ordinal = 30 },
new Binding() { DisplayName = "Autofire", Bindings = "", TabGroup = "General", DefaultBinding = "", Ordinal = 31 },
//Save States
new Binding() { DisplayName = "Save State 0", Bindings = "Shift+F10", TabGroup = "Save States", DefaultBinding = "Shift+F10", Ordinal = 1 },
new Binding() { DisplayName = "Save State 1", Bindings = "Shift+F1", TabGroup = "Save States", DefaultBinding = "Shift+F1", Ordinal = 2 },
new Binding() { DisplayName = "Save State 2", Bindings = "Shift+F2", TabGroup = "Save States", DefaultBinding = "Shift+F2", Ordinal = 3 },
new Binding() { DisplayName = "Save State 3", Bindings = "Shift+F3", TabGroup = "Save States", DefaultBinding = "Shift+F3", Ordinal = 4 },
new Binding() { DisplayName = "Save State 4", Bindings = "Shift+F4", TabGroup = "Save States", DefaultBinding = "Shift+F4", Ordinal = 5 },
new Binding() { DisplayName = "Save State 5", Bindings = "Shift+F5", TabGroup = "Save States", DefaultBinding = "Shift+F5", Ordinal = 6 },
new Binding() { DisplayName = "Save State 6", Bindings = "Shift+F6", TabGroup = "Save States", DefaultBinding = "Shift+F6", Ordinal = 7 },
new Binding() { DisplayName = "Save State 7", Bindings = "Shift+F7", TabGroup = "Save States", DefaultBinding = "Shift+F7", Ordinal = 8 },
new Binding() { DisplayName = "Save State 8", Bindings = "Shift+F8", TabGroup = "Save States", DefaultBinding = "Shift+F8", Ordinal = 9 },
new Binding() { DisplayName = "Save State 9", Bindings = "Shift+F9", TabGroup = "Save States", DefaultBinding = "Shift+F9", Ordinal = 10 },
new Binding() { DisplayName = "Load State 0", Bindings = "F10", TabGroup = "Save States", DefaultBinding = "F10", Ordinal = 11 },
new Binding() { DisplayName = "Load State 1", Bindings = "F1", TabGroup = "Save States", DefaultBinding = "F1", Ordinal = 12 },
new Binding() { DisplayName = "Load State 2", Bindings = "F2", TabGroup = "Save States", DefaultBinding = "F2", Ordinal = 13 },
new Binding() { DisplayName = "Load State 3", Bindings = "F3", TabGroup = "Save States", DefaultBinding = "F3", Ordinal = 14 },
new Binding() { DisplayName = "Load State 4", Bindings = "F4", TabGroup = "Save States", DefaultBinding = "F4", Ordinal = 15 },
new Binding() { DisplayName = "Load State 5", Bindings = "F5", TabGroup = "Save States", DefaultBinding = "F5", Ordinal = 16 },
new Binding() { DisplayName = "Load State 6", Bindings = "F6", TabGroup = "Save States", DefaultBinding = "F6", Ordinal = 17 },
new Binding() { DisplayName = "Load State 7", Bindings = "F7", TabGroup = "Save States", DefaultBinding = "F7", Ordinal = 18 },
new Binding() { DisplayName = "Load State 8", Bindings = "F8", TabGroup = "Save States", DefaultBinding = "F8", Ordinal = 19 },
new Binding() { DisplayName = "Load State 9", Bindings = "F9", TabGroup = "Save States", DefaultBinding = "F9", Ordinal = 20 },
new Binding() { DisplayName = "Select State 0", Bindings = "D0", TabGroup = "Save States", DefaultBinding = "D0", Ordinal = 21 },
new Binding() { DisplayName = "Select State 1", Bindings = "D1", TabGroup = "Save States", DefaultBinding = "D1", Ordinal = 22 },
new Binding() { DisplayName = "Select State 2", Bindings = "D2", TabGroup = "Save States", DefaultBinding = "D2", Ordinal = 23 },
new Binding() { DisplayName = "Select State 3", Bindings = "D3", TabGroup = "Save States", DefaultBinding = "D3", Ordinal = 24 },
new Binding() { DisplayName = "Select State 4", Bindings = "D4", TabGroup = "Save States", DefaultBinding = "D4", Ordinal = 25 },
new Binding() { DisplayName = "Select State 5", Bindings = "D5", TabGroup = "Save States", DefaultBinding = "D5", Ordinal = 26 },
new Binding() { DisplayName = "Select State 6", Bindings = "D6", TabGroup = "Save States", DefaultBinding = "D6", Ordinal = 27 },
new Binding() { DisplayName = "Select State 7", Bindings = "D7", TabGroup = "Save States", DefaultBinding = "D7", Ordinal = 28 },
new Binding() { DisplayName = "Select State 8", Bindings = "D8", TabGroup = "Save States", DefaultBinding = "D8", Ordinal = 29 },
new Binding() { DisplayName = "Select State 9", Bindings = "D9", TabGroup = "Save States", DefaultBinding = "D9", Ordinal = 30 },
new Binding() { DisplayName = "Save Named State", Bindings = "", TabGroup = "Save States", DefaultBinding = "", Ordinal = 31 },
new Binding() { DisplayName = "Load Named State", Bindings = "", TabGroup = "Save States", DefaultBinding = "", Ordinal = 32 },
new Binding() { DisplayName = "Previous Slot", Bindings = "", TabGroup = "Save States", DefaultBinding = "", Ordinal = 33 },
new Binding() { DisplayName = "Next Slot", Bindings = "", TabGroup = "Save States", DefaultBinding = "", Ordinal = 34 },
//Movie
new Binding() { DisplayName = "Toggle read-only", Bindings = "Q", TabGroup = "Movie", DefaultBinding = "Q", Ordinal = 0 },
new Binding() { DisplayName = "Play Movie", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 1 },
new Binding() { DisplayName = "Record Movie", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 2 },
new Binding() { DisplayName = "Stop Movie", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 3 },
new Binding() { DisplayName = "Play from beginning", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 4 },
new Binding() { DisplayName = "Save Movie", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 5 },
new Binding() { DisplayName = "Toggle MultiTrack", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 6 },
new Binding() { DisplayName = "MT Select All", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 7 },
new Binding() { DisplayName = "MT Select None", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 8 },
new Binding() { DisplayName = "MT Increment Player", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 9 },
new Binding() { DisplayName = "MT Decrement Player", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 10 },
new Binding() { DisplayName = "Movie Poke", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 11 },
new Binding() { DisplayName = "Scrub Input", Bindings = "", TabGroup = "Movie", DefaultBinding = "", Ordinal = 12 },
//Tools
new Binding() { DisplayName = "Ram Watch", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 0 },
new Binding() { DisplayName = "Ram Search", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 1 },
new Binding() { DisplayName = "Hex Editor", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 3 },
new Binding() { DisplayName = "Trace Logger", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 4 },
new Binding() { DisplayName = "Lua Console", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 5 },
new Binding() { DisplayName = "Cheats", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 6 },
new Binding() { DisplayName = "TAStudio", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 7 },
new Binding() { DisplayName = "ToolBox", Bindings = "T", TabGroup = "Tools", DefaultBinding = "", Ordinal = 8 },
new Binding() { DisplayName = "Virtual Pad", Bindings = "", TabGroup = "Tools", DefaultBinding = "", Ordinal = 9 },
new Binding() { DisplayName = "New Search", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "", Ordinal = 10 },
new Binding() { DisplayName = "Do Search", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "", Ordinal = 11 },
new Binding() { DisplayName = "Previous Compare To", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "", Ordinal = 12 },
new Binding() { DisplayName = "Next Compare To", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "", Ordinal = 13 },
new Binding() { DisplayName = "Previous Operator", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "", Ordinal = 14 },
new Binding() { DisplayName = "Next Operator", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "", Ordinal = 15 },
//SNES
new Binding() { DisplayName = "Toggle BG 1", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 0 },
new Binding() { DisplayName = "Toggle BG 2", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 1 },
new Binding() { DisplayName = "Toggle BG 3", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 2 },
new Binding() { DisplayName = "Toggle BG 4", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 3 },
new Binding() { DisplayName = "Toggle OBJ 1", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 4 },
new Binding() { DisplayName = "Toggle OBJ 2", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 5 },
new Binding() { DisplayName = "Toggle OBJ 3", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 6 },
new Binding() { DisplayName = "Toggle OBJ 4", Bindings = "", TabGroup = "SNES", DefaultBinding = "", Ordinal = 7 },
//Analog
new Binding() { DisplayName = "Y Up Small", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 0 },
new Binding() { DisplayName = "Y Up Large", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 1 },
new Binding() { DisplayName = "Y Down Small", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 2 },
new Binding() { DisplayName = "Y Down Large", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 3 },
new Binding() { DisplayName = "X Up Small", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 4 },
new Binding() { DisplayName = "X Up Large", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 5 },
new Binding() { DisplayName = "X Down Small", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 6 },
new Binding() { DisplayName = "X Down Large", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 7 },
};
}
}
}
public class Binding
{
//TODO: how about a delegate, that would be called by the mainform? Thereby putting all the action logic in one place
public string DisplayName;
public string Bindings;
public string DefaultBinding;
public string TabGroup;
public int Ordinal = 0;
public Binding() { }
}
public class PathEntryCollection : IEnumerable<PathEntry> public class PathEntryCollection : IEnumerable<PathEntry>
{ {
public List<PathEntry> Paths { get; private set; } public List<PathEntry> Paths { get; private set; }
@ -669,7 +877,7 @@ namespace BizHawk.Client.Common
return Paths.GetEnumerator(); return Paths.GetEnumerator();
} }
IEnumerator IEnumerable.GetEnumerator() System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{ {
return GetEnumerator(); return GetEnumerator();
} }
@ -733,151 +941,151 @@ namespace BizHawk.Client.Common
{ {
get get
{ {
return new List<PathEntry> return new List<PathEntry>()
{ {
new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Movies", Path = Path.Combine(".", "Movies"), Ordinal = 0 }, new PathEntry() { System = "Global_NULL", SystemDisplayName="Global", Type = "Movies", Path = Path.Combine(".", "Movies"), Ordinal = 0 },
new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Movie backups", Path = Path.Combine(".", "Movies", "backup"), Ordinal = 1 }, new PathEntry() { System = "Global_NULL", SystemDisplayName="Global", Type = "Movie backups", Path = Path.Combine(".", "Movies", "backup"), Ordinal = 1 },
new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Lua", Path = Path.Combine(".", "Lua"), Ordinal = 2 }, new PathEntry() { System = "Global_NULL", SystemDisplayName="Global", Type = "Lua", Path = Path.Combine(".", "Lua"), Ordinal = 2 },
new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Watch (.wch)", Path = ".", Ordinal = 3 }, new PathEntry() { System = "Global_NULL", SystemDisplayName="Global", Type = "Watch (.wch)", Path = ".", Ordinal = 3 },
new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "A/V Dumps", Path = ".", Ordinal = 4 }, new PathEntry() { System = "Global_NULL", SystemDisplayName="Global", Type = "A/V Dumps", Path = ".", Ordinal = 4 },
new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Debug Logs", Path = ".", Ordinal = 5 }, new PathEntry() { System = "Global_NULL", SystemDisplayName="Global", Type = "Debug Logs", Path = ".", Ordinal = 5 },
new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Firmware", Path = Path.Combine(".", "Firmware"), Ordinal = 6 }, new PathEntry() { System = "Global_NULL", SystemDisplayName="Global", Type = "Firmware", Path = Path.Combine(".", "Firmware"), Ordinal = 6 },
new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Base ROM", Path = ".", Ordinal = 6 }, new PathEntry() { System = "Global_NULL", SystemDisplayName="Global", Type = "Base ROM", Path = ".", Ordinal = 6 },
new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Base", Path = ".", Ordinal = 6 }, new PathEntry() { System = "Global_NULL", SystemDisplayName="Global", Type = "Base", Path = ".", Ordinal = 6 },
new PathEntry { System = "INTV", SystemDisplayName="Intellivision", Type = "Base", Path = Path.Combine(".", "Intellivision"), Ordinal = 0 }, new PathEntry() { System = "INTV", SystemDisplayName="Intellivision", Type = "Base", Path = Path.Combine(".", "Intellivision"), Ordinal = 0 },
new PathEntry { System = "INTV", SystemDisplayName="Intellivision", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "INTV", SystemDisplayName="Intellivision", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "INTV", SystemDisplayName="Intellivision", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "INTV", SystemDisplayName="Intellivision", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "INTV", SystemDisplayName="Intellivision", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "INTV", SystemDisplayName="Intellivision", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "INTV", SystemDisplayName="Intellivision", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "INTV", SystemDisplayName="Intellivision", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "INTV", SystemDisplayName="Intellivision", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "INTV", SystemDisplayName="Intellivision", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "INTV", SystemDisplayName="Intellivision", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 }, new PathEntry() { System = "INTV", SystemDisplayName="Intellivision", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 },
new PathEntry { System = "NES", SystemDisplayName="NES", Type = "Base", Path = Path.Combine(".", "NES"), Ordinal = 0 }, new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "Base", Path = Path.Combine(".", "NES"), Ordinal = 0 },
new PathEntry { System = "NES", SystemDisplayName="NES", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "NES", SystemDisplayName="NES", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "NES", SystemDisplayName="NES", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "NES", SystemDisplayName="NES", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "NES", SystemDisplayName="NES", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "NES", SystemDisplayName="NES", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 }, new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 },
new PathEntry { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Base", Path= Path.Combine(".", "SNES"), Ordinal = 0 }, new PathEntry() { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Base", Path= Path.Combine(".", "SNES"), Ordinal = 0 },
new PathEntry { System = "SNES_SGB", SystemDisplayName="SNES", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "SNES_SGB", SystemDisplayName="SNES", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "GBA", SystemDisplayName="GBA", Type = "Base", Path= Path.Combine(".", "GBA"), Ordinal = 0 }, new PathEntry() { System = "GBA", SystemDisplayName="GBA", Type = "Base", Path= Path.Combine(".", "GBA"), Ordinal = 0 },
new PathEntry { System = "GBA", SystemDisplayName="GBA", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "GBA", SystemDisplayName="GBA", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "GBA", SystemDisplayName="GBA", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "GBA", SystemDisplayName="GBA", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "GBA", SystemDisplayName="GBA", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "GBA", SystemDisplayName="GBA", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "GBA", SystemDisplayName="GBA", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "GBA", SystemDisplayName="GBA", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "GBA", SystemDisplayName="GBA", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "GBA", SystemDisplayName="GBA", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "SMS", SystemDisplayName="SMS", Type = "Base", Path= Path.Combine(".", "SMS"), Ordinal = 0 }, new PathEntry() { System = "SMS", SystemDisplayName="SMS", Type = "Base", Path= Path.Combine(".", "SMS"), Ordinal = 0 },
new PathEntry { System = "SMS", SystemDisplayName="SMS", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "SMS", SystemDisplayName="SMS", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "SMS", SystemDisplayName="SMS", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "SMS", SystemDisplayName="SMS", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "SMS", SystemDisplayName="SMS", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "SMS", SystemDisplayName="SMS", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "SMS", SystemDisplayName="SMS", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "SMS", SystemDisplayName="SMS", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "SMS", SystemDisplayName="SMS", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "SMS", SystemDisplayName="SMS", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "GG", SystemDisplayName="GG", Type = "Base", Path= Path.Combine(".", "Game Gear"), Ordinal = 0 }, new PathEntry() { System = "GG", SystemDisplayName="GG", Type = "Base", Path= Path.Combine(".", "Game Gear"), Ordinal = 0 },
new PathEntry { System = "GG", SystemDisplayName="GG", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "GG", SystemDisplayName="GG", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "GG", SystemDisplayName="GG", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "GG", SystemDisplayName="GG", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "GG", SystemDisplayName="GG", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "GG", SystemDisplayName="GG", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "GG", SystemDisplayName="GG", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "GG", SystemDisplayName="GG", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "GG", SystemDisplayName="GG", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "GG", SystemDisplayName="GG", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "SG", SystemDisplayName="SG", Type = "Base", Path= Path.Combine(".", "SG-1000"), Ordinal = 0 }, new PathEntry() { System = "SG", SystemDisplayName="SG", Type = "Base", Path= Path.Combine(".", "SG-1000"), Ordinal = 0 },
new PathEntry { System = "SG", SystemDisplayName="SG", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "SG", SystemDisplayName="SG", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "SG", SystemDisplayName="SG", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "SG", SystemDisplayName="SG", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "SG", SystemDisplayName="SG", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "SG", SystemDisplayName="SG", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "SG", SystemDisplayName="SG", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "SG", SystemDisplayName="SG", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "SG", SystemDisplayName="SG", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "SG", SystemDisplayName="SG", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "GEN", SystemDisplayName="Genesis", Type = "Base", Path= Path.Combine(".", "Genesis"), Ordinal = 0 }, new PathEntry() { System = "GEN", SystemDisplayName="Genesis", Type = "Base", Path= Path.Combine(".", "Genesis"), Ordinal = 0 },
new PathEntry { System = "GEN", SystemDisplayName="Genesis", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "GEN", SystemDisplayName="Genesis", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "GEN", SystemDisplayName="Genesis", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "GEN", SystemDisplayName="Genesis", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "GEN", SystemDisplayName="Genesis", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "GEN", SystemDisplayName="Genesis", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "GEN", SystemDisplayName="Genesis", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "GEN", SystemDisplayName="Genesis", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "GEN", SystemDisplayName="Genesis", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "GEN", SystemDisplayName="Genesis", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Base", Path= Path.Combine(".", "PC Engine"), Ordinal = 0 }, new PathEntry() { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Base", Path= Path.Combine(".", "PC Engine"), Ordinal = 0 },
new PathEntry { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Base", Path= Path.Combine(".", "Gameboy"), Ordinal = 0 }, new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Base", Path= Path.Combine(".", "Gameboy"), Ordinal = 0 },
new PathEntry { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 }, new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 },
new PathEntry { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "Base", Path= Path.Combine(".", "Dual Gameboy"), Ordinal = 0 }, new PathEntry() { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "Base", Path= Path.Combine(".", "Dual Gameboy"), Ordinal = 0 },
new PathEntry { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 }, new PathEntry() { System = "DGB", SystemDisplayName="Dual Gameboy", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 },
new PathEntry { System = "TI83", SystemDisplayName="TI83", Type = "Base", Path= Path.Combine(".", "TI83"), Ordinal = 0 }, new PathEntry() { System = "TI83", SystemDisplayName="TI83", Type = "Base", Path= Path.Combine(".", "TI83"), Ordinal = 0 },
new PathEntry { System = "TI83", SystemDisplayName="TI83", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "TI83", SystemDisplayName="TI83", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "TI83", SystemDisplayName="TI83", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "TI83", SystemDisplayName="TI83", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "TI83", SystemDisplayName="TI83", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "TI83", SystemDisplayName="TI83", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "TI83", SystemDisplayName="TI83", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "TI83", SystemDisplayName="TI83", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "TI83", SystemDisplayName="TI83", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "TI83", SystemDisplayName="TI83", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "A26", SystemDisplayName="Atari 2600", Type = "Base", Path= Path.Combine(".", "Atari 2600"), Ordinal = 0 }, new PathEntry() { System = "A26", SystemDisplayName="Atari 2600", Type = "Base", Path= Path.Combine(".", "Atari 2600"), Ordinal = 0 },
new PathEntry { System = "A26", SystemDisplayName="Atari 2600", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "A26", SystemDisplayName="Atari 2600", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "A26", SystemDisplayName="Atari 2600", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "A26", SystemDisplayName="Atari 2600", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "A26", SystemDisplayName="Atari 2600", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "A26", SystemDisplayName="Atari 2600", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "A26", SystemDisplayName="Atari 2600", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "A26", SystemDisplayName="Atari 2600", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "A78", SystemDisplayName="Atari 7800", Type = "Base", Path= Path.Combine(".", "Atari 7800"), Ordinal = 0 }, new PathEntry() { System = "A78", SystemDisplayName="Atari 7800", Type = "Base", Path= Path.Combine(".", "Atari 7800"), Ordinal = 0 },
new PathEntry { System = "A78", SystemDisplayName="Atari 7800", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "A78", SystemDisplayName="Atari 7800", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "A78", SystemDisplayName="Atari 7800", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "A78", SystemDisplayName="Atari 7800", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "A78", SystemDisplayName="Atari 7800", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "A78", SystemDisplayName="Atari 7800", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "A78", SystemDisplayName="Atari 7800", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "A78", SystemDisplayName="Atari 7800", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "A78", SystemDisplayName="Atari 7800", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "A78", SystemDisplayName="Atari 7800", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "C64", SystemDisplayName="Commodore 64", Type = "Base", Path= Path.Combine(".", "C64"), Ordinal = 0 }, new PathEntry() { System = "C64", SystemDisplayName="Commodore 64", Type = "Base", Path= Path.Combine(".", "C64"), Ordinal = 0 },
new PathEntry { System = "C64", SystemDisplayName="Commodore 64", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "C64", SystemDisplayName="Commodore 64", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "C64", SystemDisplayName="Commodore 64", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "C64", SystemDisplayName="Commodore 64", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "C64", SystemDisplayName="Commodore 64", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "C64", SystemDisplayName="Commodore 64", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "C64", SystemDisplayName="Commodore 64", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "C64", SystemDisplayName="Commodore 64", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "PSX", SystemDisplayName="Playstation", Type = "Base", Path= Path.Combine(".", "PSX"), Ordinal = 0 }, new PathEntry() { System = "PSX", SystemDisplayName="Playstation", Type = "Base", Path= Path.Combine(".", "PSX"), Ordinal = 0 },
new PathEntry { System = "PSX", SystemDisplayName="Playstation", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "PSX", SystemDisplayName="Playstation", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "PSX", SystemDisplayName="Playstation", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "PSX", SystemDisplayName="Playstation", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "PSX", SystemDisplayName="Playstation", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "PSX", SystemDisplayName="Playstation", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "PSX", SystemDisplayName="Playstation", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "PSX", SystemDisplayName="Playstation", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "PSX", SystemDisplayName="Playstation", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "PSX", SystemDisplayName="Playstation", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "Coleco", SystemDisplayName = "Coleco", Type = "Base", Path= Path.Combine(".", "Coleco"), Ordinal = 0 }, new PathEntry() { System = "Coleco", SystemDisplayName = "Coleco", Type = "Base", Path= Path.Combine(".", "Coleco"), Ordinal = 0 },
new PathEntry { System = "Coleco", SystemDisplayName = "Coleco", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "Coleco", SystemDisplayName = "Coleco", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "Coleco", SystemDisplayName = "Coleco", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "Coleco", SystemDisplayName = "Coleco", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "Coleco", SystemDisplayName = "Coleco", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "Coleco", SystemDisplayName = "Coleco", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "Coleco", SystemDisplayName = "Coleco", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "Coleco", SystemDisplayName = "Coleco", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "N64", SystemDisplayName = "N64", Type = "Base", Path= Path.Combine(".", "N64"), Ordinal = 0 }, new PathEntry() { System = "N64", SystemDisplayName = "N64", Type = "Base", Path= Path.Combine(".", "N64"), Ordinal = 0 },
new PathEntry { System = "N64", SystemDisplayName = "N64", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "N64", SystemDisplayName = "N64", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "N64", SystemDisplayName = "N64", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "N64", SystemDisplayName = "N64", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "N64", SystemDisplayName = "N64", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "N64", SystemDisplayName = "N64", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "N64", SystemDisplayName = "N64", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "N64", SystemDisplayName = "N64", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "N64", SystemDisplayName = "N64", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "N64", SystemDisplayName = "N64", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "SAT", SystemDisplayName = "Saturn", Type = "Base", Path= Path.Combine(".", "Saturn"), Ordinal = 0 }, new PathEntry() { System = "SAT", SystemDisplayName = "Saturn", Type = "Base", Path= Path.Combine(".", "Saturn"), Ordinal = 0 },
new PathEntry { System = "SAT", SystemDisplayName = "Saturn", Type = "ROM", Path = ".", Ordinal = 1 }, new PathEntry() { System = "SAT", SystemDisplayName = "Saturn", Type = "ROM", Path = ".", Ordinal = 1 },
new PathEntry { System = "SAT", SystemDisplayName = "Saturn", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, new PathEntry() { System = "SAT", SystemDisplayName = "Saturn", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "SAT", SystemDisplayName = "Saturn", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, new PathEntry() { System = "SAT", SystemDisplayName = "Saturn", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "SAT", SystemDisplayName = "Saturn", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, new PathEntry() { System = "SAT", SystemDisplayName = "Saturn", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "SAT", SystemDisplayName = "Saturn", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, new PathEntry() { System = "SAT", SystemDisplayName = "Saturn", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
}; };
} }
} }

View File

@ -1,9 +1,10 @@
using System; using System;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Windows.Forms;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
public static class ConfigService public static class ConfigService
{ {
@ -22,7 +23,7 @@ namespace BizHawk.Client.Common
config = (T)s.Deserialize(r, typeof(T)); config = (T)s.Deserialize(r, typeof(T));
} }
} }
catch (Exception e) { /*TODO MessageBox.Show(e.ToString(), "Config Error"); */ } catch (Exception e) { MessageBox.Show(e.ToString(), "Config Error"); }
if (config == null) return new T(); if (config == null) return new T();
//patch up arrays in the config with the minimum number of things //patch up arrays in the config with the minimum number of things

View File

@ -2,9 +2,9 @@
using System.IO; using System.IO;
using System.Collections.Generic; using System.Collections.Generic;
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
public class CoreFileProvider : ICoreFileProvider class CoreFileProvider : ICoreFileProvider
{ {
public string SubfileDirectory; public string SubfileDirectory;
public FirmwareManager FirmwareManager; public FirmwareManager FirmwareManager;

View File

@ -11,8 +11,6 @@ using System.Drawing.Imaging;
//using dx=SlimDX; //using dx=SlimDX;
//using d3d=SlimDX.Direct3D9; //using d3d=SlimDX.Direct3D9;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
/// <summary> /// <summary>
@ -393,19 +391,19 @@ namespace BizHawk.MultiClient
public void AddMessage(string message) public void AddMessage(string message)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
messages.Add(new UIMessage { Message = message, ExpireAt = DateTime.Now + TimeSpan.FromSeconds(2) }); messages.Add(new UIMessage { Message = message, ExpireAt = DateTime.Now + TimeSpan.FromSeconds(2) });
} }
public void AddGUIText(string message, int x, int y, bool alert, Color BackGround, Color ForeColor, int anchor) public void AddGUIText(string message, int x, int y, bool alert, Color BackGround, Color ForeColor, int anchor)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
GUITextList.Add(new UIDisplay { Message = message, X = x, Y = y, BackGround = BackGround, ForeColor = ForeColor, Alert = alert, Anchor = anchor }); GUITextList.Add(new UIDisplay { Message = message, X = x, Y = y, BackGround = BackGround, ForeColor = ForeColor, Alert = alert, Anchor = anchor });
} }
public void ClearGUIText() public void ClearGUIText()
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
GUITextList.Clear(); GUITextList.Clear();
} }
@ -413,7 +411,7 @@ namespace BizHawk.MultiClient
public void DrawMessages(IBlitter g) public void DrawMessages(IBlitter g)
{ {
if (!GlobalWinF.ClientControls["MaxTurbo"]) if (!Global.ClientControls["MaxTurbo"])
{ {
messages.RemoveAll(m => DateTime.Now > m.ExpireAt); messages.RemoveAll(m => DateTime.Now > m.ExpireAt);
int line = 1; int line = 1;
@ -485,7 +483,7 @@ namespace BizHawk.MultiClient
StringBuilder s; StringBuilder s;
if (!Global.MovieSession.Movie.IsActive || Global.MovieSession.Movie.IsFinished) if (!Global.MovieSession.Movie.IsActive || Global.MovieSession.Movie.IsFinished)
{ {
s = new StringBuilder(GlobalWinF.GetOutputControllersAsMnemonic()); s = new StringBuilder(Global.GetOutputControllersAsMnemonic());
} }
else else
{ {
@ -586,17 +584,17 @@ namespace BizHawk.MultiClient
g.DrawString(rerec, MessageFont, FixedMessagesColor, x, y); g.DrawString(rerec, MessageFont, FixedMessagesColor, x, y);
} }
if (GlobalWinF.ClientControls["Autohold"] || GlobalWinF.ClientControls["Autofire"]) if (Global.ClientControls["Autohold"] || Global.ClientControls["Autofire"])
{ {
StringBuilder disp = new StringBuilder("Held: "); StringBuilder disp = new StringBuilder("Held: ");
foreach (string s in GlobalWinF.StickyXORAdapter.CurrentStickies) foreach (string s in Global.StickyXORAdapter.CurrentStickies)
{ {
disp.Append(s); disp.Append(s);
disp.Append(' '); disp.Append(' ');
} }
foreach (string s in GlobalWinF.AutofireStickyXORAdapter.CurrentStickies) foreach (string s in Global.AutofireStickyXORAdapter.CurrentStickies)
{ {
disp.Append("Auto-"); disp.Append("Auto-");
disp.Append(s); disp.Append(s);
@ -662,7 +660,7 @@ namespace BizHawk.MultiClient
/// <summary>update Global.RenderPanel from the passed IVideoProvider</summary> /// <summary>update Global.RenderPanel from the passed IVideoProvider</summary>
public void UpdateSource(IVideoProvider videoProvider) public void UpdateSource(IVideoProvider videoProvider)
{ {
UpdateSourceEx(videoProvider, GlobalWinF.RenderPanel); UpdateSourceEx(videoProvider, Global.RenderPanel);
} }
/// <summary> /// <summary>
@ -775,10 +773,10 @@ namespace BizHawk.MultiClient
void RenderOSD(IBlitter renderPanel) void RenderOSD(IBlitter renderPanel)
{ {
GlobalWinF.OSD.Begin(renderPanel); Global.OSD.Begin(renderPanel);
renderPanel.Open(); renderPanel.Open();
GlobalWinF.OSD.DrawScreenInfo(renderPanel); Global.OSD.DrawScreenInfo(renderPanel);
GlobalWinF.OSD.DrawMessages(renderPanel); Global.OSD.DrawMessages(renderPanel);
renderPanel.Close(); renderPanel.Close();
} }

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
//IDEA: put filesizes in DB too. then scans can go real quick by only scanning filesizes that match (and then scanning filesizes that dont match, in case of an emergency) //IDEA: put filesizes in DB too. then scans can go real quick by only scanning filesizes that match (and then scanning filesizes that dont match, in case of an emergency)
//this would be adviseable if we end up with a very large firmware file //this would be adviseable if we end up with a very large firmware file
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
public class FirmwareManager public class FirmwareManager
{ {
@ -186,4 +186,5 @@ namespace BizHawk.Client.Common
} }
} }
} }

View File

@ -1,12 +1,13 @@
using BizHawk.DiscSystem; using BizHawk.DiscSystem;
using SlimDX.Direct3D9; using SlimDX.Direct3D9;
using SlimDX.DirectSound; using SlimDX.DirectSound;
#if WINDOWS
using BizHawk.Client.Common; #endif
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public static class GlobalWinF public static class Global
{ {
public static MainForm MainForm; public static MainForm MainForm;
#if WINDOWS #if WINDOWS
@ -17,7 +18,11 @@ namespace BizHawk.MultiClient
public static IRenderer RenderPanel; public static IRenderer RenderPanel;
public static OSDManager OSD = new OSDManager(); public static OSDManager OSD = new OSDManager();
public static DisplayManager DisplayManager = new DisplayManager(); public static DisplayManager DisplayManager = new DisplayManager();
public static Config Config;
public static IEmulator Emulator;
public static CoreComm CoreComm; public static CoreComm CoreComm;
public static GameInfo Game;
public static CheatList CheatList;
public static Controller NullControls; public static Controller NullControls;
public static AutofireController AutofireNullControls; public static AutofireController AutofireNullControls;
@ -31,6 +36,13 @@ namespace BizHawk.MultiClient
public static CopyControllerAdapter MovieInputSourceAdapter = new CopyControllerAdapter(); public static CopyControllerAdapter MovieInputSourceAdapter = new CopyControllerAdapter();
public static CopyControllerAdapter MovieOutputHardpoint = new CopyControllerAdapter(); public static CopyControllerAdapter MovieOutputHardpoint = new CopyControllerAdapter();
/// <summary>
/// the global MovieSession can use this to deal with multitrack player remapping (should this be here? maybe it should be in MovieSession)
/// </summary>
public static MultitrackRewiringControllerAdapter MultitrackRewiringControllerAdapter = new MultitrackRewiringControllerAdapter();
public static MovieSession MovieSession = new MovieSession();
//dont take my word for it, since the final word is actually in RewireInputChain, but here is a guide... //dont take my word for it, since the final word is actually in RewireInputChain, but here is a guide...
//user -> Input -> ActiveController -> UDLR -> StickyXORPlayerInputAdapter -> TurboAdapter(TBD) -> Lua(?TBD?) -> .. //user -> Input -> ActiveController -> UDLR -> StickyXORPlayerInputAdapter -> TurboAdapter(TBD) -> Lua(?TBD?) -> ..
//.. -> MultitrackRewiringControllerAdapter -> MovieInputSourceAdapter -> (MovieSession) -> MovieOutputAdapter -> ControllerOutput(1) -> Game //.. -> MultitrackRewiringControllerAdapter -> MovieInputSourceAdapter -> (MovieSession) -> MovieOutputAdapter -> ControllerOutput(1) -> Game

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
//todo: //todo:
//split into "bind" and "open (the bound thing)" //split into "bind" and "open (the bound thing)"

View File

@ -2,8 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public class Controller : IController public class Controller : IController
@ -16,7 +14,7 @@ namespace BizHawk.MultiClient
private readonly Dictionary<string, ControllerDefinition.FloatRange> FloatRanges = new WorkingDictionary<string, ControllerDefinition.FloatRange>(); private readonly Dictionary<string, ControllerDefinition.FloatRange> FloatRanges = new WorkingDictionary<string, ControllerDefinition.FloatRange>();
private readonly Dictionary<string, BizHawk.Client.Common.Config.AnalogBind> FloatBinds = new Dictionary<string, Config.AnalogBind>(); private readonly Dictionary<string, Config.AnalogBind> FloatBinds = new Dictionary<string, Config.AnalogBind>();
public Controller(ControllerDefinition definition) public Controller(ControllerDefinition definition)
{ {
@ -155,7 +153,7 @@ namespace BizHawk.MultiClient
bindings[button].Add(control.Trim()); bindings[button].Add(control.Trim());
} }
public void BindFloat(string button, BizHawk.Client.Common.Config.AnalogBind bind) public void BindFloat(string button, Config.AnalogBind bind)
{ {
FloatBinds[button] = bind; FloatBinds[button] = bind;
} }

View File

@ -27,7 +27,7 @@ namespace BizHawk.MultiClient
continue; // Don't input XBOX 360 controllers into here; we'll process them via XInput (there are limitations in some trigger axes when xbox pads go over xinput) continue; // Don't input XBOX 360 controllers into here; we'll process them via XInput (there are limitations in some trigger axes when xbox pads go over xinput)
var joystick = new Joystick(dinput, device.InstanceGuid); var joystick = new Joystick(dinput, device.InstanceGuid);
joystick.SetCooperativeLevel(GlobalWinF.MainForm.Handle, CooperativeLevel.Background | CooperativeLevel.Nonexclusive); joystick.SetCooperativeLevel(Global.MainForm.Handle, CooperativeLevel.Background | CooperativeLevel.Nonexclusive);
foreach (DeviceObjectInstance deviceObject in joystick.GetObjects()) foreach (DeviceObjectInstance deviceObject in joystick.GetObjects())
{ {
if ((deviceObject.ObjectType & ObjectDeviceType.Axis) != 0) if ((deviceObject.ObjectType & ObjectDeviceType.Axis) != 0)

View File

@ -6,8 +6,6 @@ using System.Threading;
using SlimDX.DirectInput; using SlimDX.DirectInput;
#endif #endif
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
//coalesces events back into instantaneous states //coalesces events back into instantaneous states
@ -339,7 +337,7 @@ namespace BizHawk.MultiClient
} }
bool swallow = !GlobalWinF.MainForm.AllowInput; bool swallow = !Global.MainForm.AllowInput;
foreach (var ie in _NewEvents) foreach (var ie in _NewEvents)
{ {
@ -401,7 +399,7 @@ namespace BizHawk.MultiClient
lock (this) lock (this)
{ {
if (InputEvents.Count == 0) return null; if (InputEvents.Count == 0) return null;
if (!GlobalWinF.MainForm.AllowInput) return null; if (!Global.MainForm.AllowInput) return null;
//we only listen to releases for input binding, because we need to distinguish releases of pure modifierkeys from modified keys //we only listen to releases for input binding, because we need to distinguish releases of pure modifierkeys from modified keys
//if you just pressed ctrl, wanting to bind ctrl, we'd see: pressed:ctrl, unpressed:ctrl //if you just pressed ctrl, wanting to bind ctrl, we'd see: pressed:ctrl, unpressed:ctrl

View File

@ -16,7 +16,7 @@ namespace BizHawk.MultiClient
if (keyboard == null || keyboard.Disposed) if (keyboard == null || keyboard.Disposed)
keyboard = new Keyboard(dinput); keyboard = new Keyboard(dinput);
keyboard.SetCooperativeLevel(GlobalWinF.MainForm.Handle, CooperativeLevel.Background | CooperativeLevel.Nonexclusive); keyboard.SetCooperativeLevel(Global.MainForm.Handle, CooperativeLevel.Background | CooperativeLevel.Nonexclusive);
} }
public static void Update() public static void Update()

View File

@ -3,8 +3,6 @@ using System.Text;
using System.IO; using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using BizHawk.Client.Common;
#pragma warning disable 162 #pragma warning disable 162
//thanks! - http://sharp-developer.net/ru/CodeBank/WinForms/GuiConsole.aspx //thanks! - http://sharp-developer.net/ru/CodeBank/WinForms/GuiConsole.aspx

View File

@ -4,8 +4,6 @@ using System.Drawing;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
//todo - perks - pause, copy to clipboard, backlog length limiting //todo - perks - pause, copy to clipboard, backlog length limiting
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
@ -20,7 +18,7 @@ namespace BizHawk.MultiClient
Closing += (o, e) => Closing += (o, e) =>
{ {
Global.Config.ShowLogWindow = false; Global.Config.ShowLogWindow = false;
GlobalWinF.MainForm.notifyLogWindowClosing(); Global.MainForm.notifyLogWindowClosing();
LogConsole.notifyLogWindowClosing(); LogConsole.notifyLogWindowClosing();
SaveConfigSettings(); SaveConfigSettings();
}; };

View File

@ -7,8 +7,6 @@ using BizHawk.Emulation.Consoles.Calculator;
using BizHawk.Emulation.Consoles.GB; using BizHawk.Emulation.Consoles.GB;
using BizHawk.Emulation.Consoles.Nintendo.SNES; using BizHawk.Emulation.Consoles.Nintendo.SNES;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
partial class MainForm partial class MainForm
@ -32,9 +30,9 @@ namespace BizHawk.MultiClient
{ {
string details = Global.Emulator.CoreComm.RomStatusDetails; string details = Global.Emulator.CoreComm.RomStatusDetails;
if (string.IsNullOrEmpty(details)) return; if (string.IsNullOrEmpty(details)) return;
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
LogWindow.ShowReport("Dump Status Report", details, this); LogWindow.ShowReport("Dump Status Report", details, this);
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
} }
private void saveWindowPositionToolStripMenuItem_Click(object sender, EventArgs e) private void saveWindowPositionToolStripMenuItem_Click(object sender, EventArgs e)
@ -64,7 +62,7 @@ namespace BizHawk.MultiClient
old = Global.Config.VSyncThrottle; old = Global.Config.VSyncThrottle;
Global.Config.VSyncThrottle = false; Global.Config.VSyncThrottle = false;
if (old) if (old)
GlobalWinF.RenderPanel.Resized = true; Global.RenderPanel.Resized = true;
} }
LimitFrameRateMessage(); LimitFrameRateMessage();
} }
@ -79,7 +77,7 @@ namespace BizHawk.MultiClient
bool old = Global.Config.VSyncThrottle; bool old = Global.Config.VSyncThrottle;
Global.Config.VSyncThrottle = false; Global.Config.VSyncThrottle = false;
if (old) if (old)
GlobalWinF.RenderPanel.Resized = true; Global.RenderPanel.Resized = true;
} }
} }
@ -87,7 +85,7 @@ namespace BizHawk.MultiClient
private void miDisplayVsync_Click(object sender, EventArgs e) private void miDisplayVsync_Click(object sender, EventArgs e)
{ {
Global.Config.VSyncThrottle ^= true; Global.Config.VSyncThrottle ^= true;
GlobalWinF.RenderPanel.Resized = true; Global.RenderPanel.Resized = true;
if (Global.Config.VSyncThrottle) if (Global.Config.VSyncThrottle)
{ {
Global.Config.ClockThrottle = false; Global.Config.ClockThrottle = false;
@ -103,18 +101,18 @@ namespace BizHawk.MultiClient
{ {
Global.Config.VSync ^= true; Global.Config.VSync ^= true;
if (!Global.Config.VSyncThrottle) // when vsync throttle is on, vsync is forced to on, so no change to make here if (!Global.Config.VSyncThrottle) // when vsync throttle is on, vsync is forced to on, so no change to make here
GlobalWinF.RenderPanel.Resized = true; Global.RenderPanel.Resized = true;
} }
public void LimitFrameRateMessage() public void LimitFrameRateMessage()
{ {
if (Global.Config.ClockThrottle) if (Global.Config.ClockThrottle)
{ {
GlobalWinF.OSD.AddMessage("Framerate limiting on"); Global.OSD.AddMessage("Framerate limiting on");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("Framerate limiting off"); Global.OSD.AddMessage("Framerate limiting off");
} }
} }
@ -123,11 +121,11 @@ namespace BizHawk.MultiClient
{ {
if (Global.Config.VSyncThrottle) if (Global.Config.VSyncThrottle)
{ {
GlobalWinF.OSD.AddMessage("Display Vsync is set to on"); Global.OSD.AddMessage("Display Vsync is set to on");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("Display Vsync is set to off"); Global.OSD.AddMessage("Display Vsync is set to off");
} }
} }
@ -140,11 +138,11 @@ namespace BizHawk.MultiClient
{ {
if (Global.Config.AutoMinimizeSkipping) if (Global.Config.AutoMinimizeSkipping)
{ {
GlobalWinF.OSD.AddMessage("Autominimizing set to on"); Global.OSD.AddMessage("Autominimizing set to on");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("Autominimizing set to off"); Global.OSD.AddMessage("Autominimizing set to off");
} }
} }
@ -161,7 +159,7 @@ namespace BizHawk.MultiClient
public void FrameSkipMessage() public void FrameSkipMessage()
{ {
GlobalWinF.OSD.AddMessage("Frameskipping set to " + Global.Config.FrameSkip.ToString()); Global.OSD.AddMessage("Frameskipping set to " + Global.Config.FrameSkip.ToString());
} }
public void ClickSpeedItem(int num) public void ClickSpeedItem(int num)
@ -468,25 +466,25 @@ namespace BizHawk.MultiClient
private void displayFPSToolStripMenuItem_Click(object sender, EventArgs e) private void displayFPSToolStripMenuItem_Click(object sender, EventArgs e)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
ToggleFPS(); ToggleFPS();
} }
private void displayFrameCounterToolStripMenuItem_Click(object sender, EventArgs e) private void displayFrameCounterToolStripMenuItem_Click(object sender, EventArgs e)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
ToggleFrameCounter(); ToggleFrameCounter();
} }
private void displayInputToolStripMenuItem_Click(object sender, EventArgs e) private void displayInputToolStripMenuItem_Click(object sender, EventArgs e)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
ToggleInputDisplay(); ToggleInputDisplay();
} }
private void displayLagCounterToolStripMenuItem_Click(object sender, EventArgs e) private void displayLagCounterToolStripMenuItem_Click(object sender, EventArgs e)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
ToggleLagCounter(); ToggleLagCounter();
} }
@ -698,7 +696,7 @@ namespace BizHawk.MultiClient
private void displayRerecordCountToolStripMenuItem_Click(object sender, EventArgs e) private void displayRerecordCountToolStripMenuItem_Click(object sender, EventArgs e)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
Global.Config.DisplayRerecordCount ^= true; Global.Config.DisplayRerecordCount ^= true;
} }
@ -735,9 +733,9 @@ namespace BizHawk.MultiClient
Filter = "PNG File (*.png)|*.png" Filter = "PNG File (*.png)|*.png"
}; };
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
var result = sfd.ShowDialog(); var result = sfd.ShowDialog();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (result != DialogResult.OK) if (result != DialogResult.OK)
return; return;
TakeScreenshot(sfd.FileName); TakeScreenshot(sfd.FileName);
@ -763,11 +761,11 @@ namespace BizHawk.MultiClient
Global.Config.AcceptBackgroundInput ^= true; Global.Config.AcceptBackgroundInput ^= true;
if (Global.Config.AcceptBackgroundInput) if (Global.Config.AcceptBackgroundInput)
{ {
GlobalWinF.OSD.AddMessage("Background Input enabled"); Global.OSD.AddMessage("Background Input enabled");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("Background Input disabled"); Global.OSD.AddMessage("Background Input disabled");
} }
} }
@ -829,11 +827,11 @@ namespace BizHawk.MultiClient
Global.Config.ShowContextMenu ^= true; Global.Config.ShowContextMenu ^= true;
if (Global.Config.ShowContextMenu) if (Global.Config.ShowContextMenu)
{ {
GlobalWinF.OSD.AddMessage("Context menu enabled"); Global.OSD.AddMessage("Context menu enabled");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("Context menu disabled"); Global.OSD.AddMessage("Context menu disabled");
} }
} }
@ -860,7 +858,7 @@ namespace BizHawk.MultiClient
Subtitle sub = new Subtitle(); Subtitle sub = new Subtitle();
for (int x = 0; x < Global.MovieSession.Movie.Subtitles.Count; x++) for (int x = 0; x < Global.MovieSession.Movie.Subtitles.Count; x++)
{ {
sub = Global.MovieSession.Movie.Subtitles[x]; sub = Global.MovieSession.Movie.Subtitles.GetSubtitleByIndex(x);
if (Global.Emulator.Frame == sub.Frame) if (Global.Emulator.Frame == sub.Frame)
{ {
index = x; index = x;
@ -876,7 +874,7 @@ namespace BizHawk.MultiClient
if (s.ShowDialog() == DialogResult.OK) if (s.ShowDialog() == DialogResult.OK)
{ {
if (index >= 0) if (index >= 0)
Global.MovieSession.Movie.Subtitles.RemoveAt(index); Global.MovieSession.Movie.Subtitles.Remove(index);
Global.MovieSession.Movie.Subtitles.AddSubtitle(s.sub); Global.MovieSession.Movie.Subtitles.AddSubtitle(s.sub);
} }
} }
@ -1044,7 +1042,6 @@ namespace BizHawk.MultiClient
private void makeMovieBackupToolStripMenuItem_Click(object sender, EventArgs e) private void makeMovieBackupToolStripMenuItem_Click(object sender, EventArgs e)
{ {
GlobalWinF.OSD.AddMessage("Backup movie saved.");
Global.MovieSession.Movie.WriteBackup(); Global.MovieSession.Movie.WriteBackup();
} }
@ -1075,7 +1072,7 @@ namespace BizHawk.MultiClient
private void displaySubtitlesToolStripMenuItem_Click(object sender, EventArgs e) private void displaySubtitlesToolStripMenuItem_Click(object sender, EventArgs e)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
Global.Config.DisplaySubtitles ^= true; Global.Config.DisplaySubtitles ^= true;
} }
@ -1184,14 +1181,14 @@ namespace BizHawk.MultiClient
private void saveConfigToolStripMenuItem_Click(object sender, EventArgs e) private void saveConfigToolStripMenuItem_Click(object sender, EventArgs e)
{ {
SaveConfig(); SaveConfig();
GlobalWinF.OSD.AddMessage("Saved settings"); Global.OSD.AddMessage("Saved settings");
} }
private void loadConfigToolStripMenuItem_Click(object sender, EventArgs e) private void loadConfigToolStripMenuItem_Click(object sender, EventArgs e)
{ {
Global.Config = ConfigService.Load(PathManager.DefaultIniPath, Global.Config); Global.Config = ConfigService.Load(PathManager.DefaultIniPath, Global.Config);
Global.Config.ResolveDefaults(); Global.Config.ResolveDefaults();
GlobalWinF.OSD.AddMessage("Config file loaded"); Global.OSD.AddMessage("Config file loaded");
} }
private void frameSkipToolStripMenuItem_DropDownOpened(object sender, EventArgs e) private void frameSkipToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
@ -1276,7 +1273,7 @@ namespace BizHawk.MultiClient
private void menuStrip1_MenuDeactivate(object sender, EventArgs e) private void menuStrip1_MenuDeactivate(object sender, EventArgs e)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
if (!wasPaused) if (!wasPaused)
{ {
UnpauseEmulator(); UnpauseEmulator();
@ -1503,11 +1500,11 @@ namespace BizHawk.MultiClient
Global.Config.BackupSavestates ^= true; Global.Config.BackupSavestates ^= true;
if (Global.Config.BackupSavestates) if (Global.Config.BackupSavestates)
{ {
GlobalWinF.OSD.AddMessage("Backup savestates enabled"); Global.OSD.AddMessage("Backup savestates enabled");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("Backup savestates disabled"); Global.OSD.AddMessage("Backup savestates disabled");
} }
} }
@ -1516,11 +1513,11 @@ namespace BizHawk.MultiClient
Global.Config.AutoSavestates ^= true; Global.Config.AutoSavestates ^= true;
if (Global.Config.AutoSavestates) if (Global.Config.AutoSavestates)
{ {
GlobalWinF.OSD.AddMessage("AutoSavestates enabled"); Global.OSD.AddMessage("AutoSavestates enabled");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("AutoSavestates disabled"); Global.OSD.AddMessage("AutoSavestates disabled");
} }
} }
@ -1529,11 +1526,11 @@ namespace BizHawk.MultiClient
Global.Config.SaveScreenshotWithStates ^= true; Global.Config.SaveScreenshotWithStates ^= true;
if (Global.Config.SaveScreenshotWithStates) if (Global.Config.SaveScreenshotWithStates)
{ {
GlobalWinF.OSD.AddMessage("Screenshots will be saved in savestates"); Global.OSD.AddMessage("Screenshots will be saved in savestates");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("Screenshots will not be saved in savestates"); Global.OSD.AddMessage("Screenshots will not be saved in savestates");
} }
} }
@ -1541,7 +1538,7 @@ namespace BizHawk.MultiClient
{ {
string path = PathManager.SaveStatePrefix(Global.Game) + "." + "QuickSave" + Global.Config.SaveSlot + ".State"; string path = PathManager.SaveStatePrefix(Global.Game) + "." + "QuickSave" + Global.Config.SaveSlot + ".State";
SwapBackupSavestate(path); SwapBackupSavestate(path);
GlobalWinF.OSD.AddMessage("Save slot " + Global.Config.SaveSlot.ToString() + " restored."); Global.OSD.AddMessage("Save slot " + Global.Config.SaveSlot.ToString() + " restored.");
} }
private void FreezeStatus_Click(object sender, EventArgs e) private void FreezeStatus_Click(object sender, EventArgs e)
@ -1605,9 +1602,9 @@ namespace BizHawk.MultiClient
Global.Config.Atari2600_BW ^= true; Global.Config.Atari2600_BW ^= true;
((Atari2600)Global.Emulator).SetBw(Global.Config.Atari2600_BW); ((Atari2600)Global.Emulator).SetBw(Global.Config.Atari2600_BW);
if (Global.Config.Atari2600_BW) if (Global.Config.Atari2600_BW)
GlobalWinF.OSD.AddMessage("Setting to Black and White Switch to On"); Global.OSD.AddMessage("Setting to Black and White Switch to On");
else else
GlobalWinF.OSD.AddMessage("Setting to Black and White Switch to Off"); Global.OSD.AddMessage("Setting to Black and White Switch to Off");
} }
} }
@ -1618,9 +1615,9 @@ namespace BizHawk.MultiClient
Global.Config.Atari2600_LeftDifficulty ^= true; Global.Config.Atari2600_LeftDifficulty ^= true;
((Atari2600)Global.Emulator).SetP0Diff(Global.Config.Atari2600_BW); ((Atari2600)Global.Emulator).SetP0Diff(Global.Config.Atari2600_BW);
if (Global.Config.Atari2600_LeftDifficulty) if (Global.Config.Atari2600_LeftDifficulty)
GlobalWinF.OSD.AddMessage("Setting Left Difficulty to B"); Global.OSD.AddMessage("Setting Left Difficulty to B");
else else
GlobalWinF.OSD.AddMessage("Setting Left Difficulty to A"); Global.OSD.AddMessage("Setting Left Difficulty to A");
} }
} }
@ -1631,9 +1628,9 @@ namespace BizHawk.MultiClient
Global.Config.Atari2600_RightDifficulty ^= true; Global.Config.Atari2600_RightDifficulty ^= true;
((Atari2600)Global.Emulator).SetP1Diff(Global.Config.Atari2600_BW); ((Atari2600)Global.Emulator).SetP1Diff(Global.Config.Atari2600_BW);
if (Global.Config.Atari2600_RightDifficulty) if (Global.Config.Atari2600_RightDifficulty)
GlobalWinF.OSD.AddMessage("Setting Right Difficulty to B"); Global.OSD.AddMessage("Setting Right Difficulty to B");
else else
GlobalWinF.OSD.AddMessage("Setting Right Difficulty to A"); Global.OSD.AddMessage("Setting Right Difficulty to A");
} }
} }
@ -1701,11 +1698,11 @@ namespace BizHawk.MultiClient
SyncCoreCommInputSignals(); SyncCoreCommInputSignals();
if (Global.Config.SNES_ShowBG1_1) if (Global.Config.SNES_ShowBG1_1)
{ {
GlobalWinF.OSD.AddMessage("BG 1 Layer On"); Global.OSD.AddMessage("BG 1 Layer On");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("BG 1 Layer Off"); Global.OSD.AddMessage("BG 1 Layer Off");
} }
} }
} }
@ -1725,11 +1722,11 @@ namespace BizHawk.MultiClient
SyncCoreCommInputSignals(); SyncCoreCommInputSignals();
if (Global.Config.SNES_ShowBG2_1) if (Global.Config.SNES_ShowBG2_1)
{ {
GlobalWinF.OSD.AddMessage("BG 2 Layer On"); Global.OSD.AddMessage("BG 2 Layer On");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("BG 2 Layer Off"); Global.OSD.AddMessage("BG 2 Layer Off");
} }
} }
} }
@ -1749,11 +1746,11 @@ namespace BizHawk.MultiClient
SyncCoreCommInputSignals(); SyncCoreCommInputSignals();
if (Global.Config.SNES_ShowBG3_1) if (Global.Config.SNES_ShowBG3_1)
{ {
GlobalWinF.OSD.AddMessage("BG 3 Layer On"); Global.OSD.AddMessage("BG 3 Layer On");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("BG 3 Layer Off"); Global.OSD.AddMessage("BG 3 Layer Off");
} }
} }
} }
@ -1773,11 +1770,11 @@ namespace BizHawk.MultiClient
SyncCoreCommInputSignals(); SyncCoreCommInputSignals();
if (Global.Config.SNES_ShowBG4_1) if (Global.Config.SNES_ShowBG4_1)
{ {
GlobalWinF.OSD.AddMessage("BG 4 Layer On"); Global.OSD.AddMessage("BG 4 Layer On");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("BG 4 Layer Off"); Global.OSD.AddMessage("BG 4 Layer Off");
} }
} }
} }
@ -1797,11 +1794,11 @@ namespace BizHawk.MultiClient
SyncCoreCommInputSignals(); SyncCoreCommInputSignals();
if (Global.Config.SNES_ShowOBJ1) if (Global.Config.SNES_ShowOBJ1)
{ {
GlobalWinF.OSD.AddMessage("OBJ 1 Layer On"); Global.OSD.AddMessage("OBJ 1 Layer On");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("OBJ 1 Layer Off"); Global.OSD.AddMessage("OBJ 1 Layer Off");
} }
} }
} }
@ -1821,11 +1818,11 @@ namespace BizHawk.MultiClient
SyncCoreCommInputSignals(); SyncCoreCommInputSignals();
if (Global.Config.SNES_ShowOBJ2) if (Global.Config.SNES_ShowOBJ2)
{ {
GlobalWinF.OSD.AddMessage("OBJ 2 Layer On"); Global.OSD.AddMessage("OBJ 2 Layer On");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("OBJ 2 Layer Off"); Global.OSD.AddMessage("OBJ 2 Layer Off");
} }
} }
} }
@ -1845,11 +1842,11 @@ namespace BizHawk.MultiClient
SyncCoreCommInputSignals(); SyncCoreCommInputSignals();
if (Global.Config.SNES_ShowOBJ3) if (Global.Config.SNES_ShowOBJ3)
{ {
GlobalWinF.OSD.AddMessage("OBJ 3 Layer On"); Global.OSD.AddMessage("OBJ 3 Layer On");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("OBJ 3 Layer Off"); Global.OSD.AddMessage("OBJ 3 Layer Off");
} }
} }
} }
@ -1869,11 +1866,11 @@ namespace BizHawk.MultiClient
SyncCoreCommInputSignals(); SyncCoreCommInputSignals();
if (Global.Config.SNES_ShowOBJ4) if (Global.Config.SNES_ShowOBJ4)
{ {
GlobalWinF.OSD.AddMessage("OBJ 4 Layer On"); Global.OSD.AddMessage("OBJ 4 Layer On");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("OBJ 4 Layer Off"); Global.OSD.AddMessage("OBJ 4 Layer Off");
} }
} }
} }
@ -2143,9 +2140,9 @@ namespace BizHawk.MultiClient
RestoreDirectory = false RestoreDirectory = false
}; };
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
var result = ofd.ShowDialog(); var result = ofd.ShowDialog();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (result != DialogResult.OK) if (result != DialogResult.OK)
return; return;
@ -2180,7 +2177,7 @@ namespace BizHawk.MultiClient
} }
else if (IsValidMovieExtension(ext)) else if (IsValidMovieExtension(ext))
{ {
Movie m = new Movie(filePaths[0], GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(filePaths[0]);
StartNewMovie(m, false); StartNewMovie(m, false);
} }
@ -2192,7 +2189,6 @@ namespace BizHawk.MultiClient
{ {
Global.CheatList.Load(filePaths[0], false); Global.CheatList.Load(filePaths[0], false);
LoadCheatsWindow(); LoadCheatsWindow();
ToolHelpers.UpdateCheatRelatedTools();
} }
else if (ext.ToUpper() == ".WCH") else if (ext.ToUpper() == ".WCH")
{ {
@ -2215,7 +2211,7 @@ namespace BizHawk.MultiClient
string errorMsg; string errorMsg;
string warningMsg; string warningMsg;
Movie m = MovieImport.ImportFile(filePaths[0], GlobalWinF.MainForm.GetEmuVersion(), out errorMsg, out warningMsg); Movie m = MovieImport.ImportFile(filePaths[0], out errorMsg, out warningMsg);
if (errorMsg.Length > 0) if (errorMsg.Length > 0)
{ {
MessageBox.Show(errorMsg, "Conversion error", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(errorMsg, "Conversion error", MessageBoxButtons.OK, MessageBoxIcon.Error);
@ -2229,7 +2225,7 @@ namespace BizHawk.MultiClient
m.WriteMovie(); m.WriteMovie();
StartNewMovie(m, false); StartNewMovie(m, false);
} }
GlobalWinF.OSD.AddMessage(warningMsg); Global.OSD.AddMessage(warningMsg);
} }
else else
LoadRom(filePaths[0]); LoadRom(filePaths[0]);
@ -2262,12 +2258,12 @@ namespace BizHawk.MultiClient
private void createDualGBXMLToolStripMenuItem_Click(object sender, EventArgs e) private void createDualGBXMLToolStripMenuItem_Click(object sender, EventArgs e)
{ {
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
using (var dlg = new GBtools.DualGBXMLCreator()) using (var dlg = new GBtools.DualGBXMLCreator())
{ {
dlg.ShowDialog(this); dlg.ShowDialog(this);
} }
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
} }
private void tempN64PluginControlToolStripMenuItem_Click(object sender, EventArgs e) private void tempN64PluginControlToolStripMenuItem_Click(object sender, EventArgs e)
@ -2275,11 +2271,11 @@ namespace BizHawk.MultiClient
var result = new N64VideoPluginconfig().ShowDialog(); var result = new N64VideoPluginconfig().ShowDialog();
if (result == DialogResult.OK) if (result == DialogResult.OK)
{ {
GlobalWinF.OSD.AddMessage("Plugin settings saved"); Global.OSD.AddMessage("Plugin settings saved");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("Plugin settings aborted"); Global.OSD.AddMessage("Plugin settings aborted");
} }
} }
@ -2313,7 +2309,7 @@ namespace BizHawk.MultiClient
private void preferencesToolStripMenuItem_Click(object sender, EventArgs e) private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
{ {
using (var dlg = new SaturnPrefs()) using (var dlg = new SATTools.SaturnPrefs())
{ {
var result = dlg.ShowDialog(this); var result = dlg.ShowDialog(this);
if (result == DialogResult.OK) if (result == DialogResult.OK)
@ -2416,7 +2412,7 @@ namespace BizHawk.MultiClient
private void MainForm_Resize(object sender, EventArgs e) private void MainForm_Resize(object sender, EventArgs e)
{ {
GlobalWinF.RenderPanel.Resized = true; Global.RenderPanel.Resized = true;
} }
private void backupSaveramToolStripMenuItem_Click(object sender, EventArgs e) private void backupSaveramToolStripMenuItem_Click(object sender, EventArgs e)
@ -2424,11 +2420,11 @@ namespace BizHawk.MultiClient
Global.Config.BackupSaveram ^= true; Global.Config.BackupSaveram ^= true;
if (Global.Config.BackupSaveram) if (Global.Config.BackupSaveram)
{ {
GlobalWinF.OSD.AddMessage("Backup saveram enabled"); Global.OSD.AddMessage("Backup saveram enabled");
} }
else else
{ {
GlobalWinF.OSD.AddMessage("Backup saveram disabled"); Global.OSD.AddMessage("Backup saveram disabled");
} }
} }
@ -2451,13 +2447,13 @@ namespace BizHawk.MultiClient
private void showClippedRegionsToolStripMenuItem_Click(object sender, EventArgs e) private void showClippedRegionsToolStripMenuItem_Click(object sender, EventArgs e)
{ {
Global.Config.GGShowClippedRegions ^= true; Global.Config.GGShowClippedRegions ^= true;
GlobalWinF.CoreComm.GG_ShowClippedRegions = Global.Config.GGShowClippedRegions; Global.CoreComm.GG_ShowClippedRegions = Global.Config.GGShowClippedRegions;
} }
private void highlightActiveDisplayRegionToolStripMenuItem_Click(object sender, EventArgs e) private void highlightActiveDisplayRegionToolStripMenuItem_Click(object sender, EventArgs e)
{ {
Global.Config.GGHighlightActiveDisplayRegion ^= true; Global.Config.GGHighlightActiveDisplayRegion ^= true;
GlobalWinF.CoreComm.GG_HighlightActiveDisplayRegion = Global.Config.GGHighlightActiveDisplayRegion; Global.CoreComm.GG_HighlightActiveDisplayRegion = Global.Config.GGHighlightActiveDisplayRegion;
} }
private void saveMovieToolStripMenuItem_Click(object sender, EventArgs e) private void saveMovieToolStripMenuItem_Click(object sender, EventArgs e)

View File

@ -2,8 +2,6 @@
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
partial class MainForm partial class MainForm
@ -15,7 +13,7 @@ namespace BizHawk.MultiClient
if (Global.MovieSession.Movie.IsPlaying) if (Global.MovieSession.Movie.IsPlaying)
{ {
Global.MovieSession.Movie.ClearFrame(Global.Emulator.Frame); Global.MovieSession.Movie.ClearFrame(Global.Emulator.Frame);
GlobalWinF.OSD.AddMessage("Scrubbed input at frame " + Global.Emulator.Frame.ToString()); Global.OSD.AddMessage("Scrubbed input at frame " + Global.Emulator.Frame.ToString());
} }
} }
@ -36,7 +34,7 @@ namespace BizHawk.MultiClient
SetSyncDependentSettings(); SetSyncDependentSettings();
} }
LoadRom(GlobalWinF.MainForm.CurrentlyOpenRom, true, !record); LoadRom(Global.MainForm.CurrentlyOpenRom, true, !record);
Global.Config.RecentMovies.Add(m.Filename); Global.Config.RecentMovies.Add(m.Filename);
if (Global.MovieSession.Movie.StartsFromSavestate) if (Global.MovieSession.Movie.StartsFromSavestate)
@ -46,19 +44,17 @@ namespace BizHawk.MultiClient
} }
if (record) if (record)
{ {
GlobalWinF.MainForm.ClearSaveRAM();
Global.MovieSession.Movie.StartRecording(); Global.MovieSession.Movie.StartRecording();
ReadOnly = false; ReadOnly = false;
} }
else else
{ {
GlobalWinF.MainForm.ClearSaveRAM();
Global.MovieSession.Movie.StartPlayback(); Global.MovieSession.Movie.StartPlayback();
} }
SetMainformMovieInfo(); SetMainformMovieInfo();
TAStudio1.Restart(); TAStudio1.Restart();
VirtualPadForm1.Restart(); VirtualPadForm1.Restart();
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
} }
public void SetMainformMovieInfo() public void SetMainformMovieInfo()
@ -120,11 +116,10 @@ namespace BizHawk.MultiClient
LoadStateFile(Global.MovieSession.Movie.Filename, Path.GetFileName(Global.MovieSession.Movie.Filename)); LoadStateFile(Global.MovieSession.Movie.Filename, Path.GetFileName(Global.MovieSession.Movie.Filename));
Global.Emulator.ResetFrameCounter(); Global.Emulator.ResetFrameCounter();
} }
GlobalWinF.MainForm.ClearSaveRAM();
Global.MovieSession.Movie.StartPlayback(); Global.MovieSession.Movie.StartPlayback();
SetMainformMovieInfo(); SetMainformMovieInfo();
GlobalWinF.OSD.AddMessage("Replaying movie file in read-only mode"); Global.OSD.AddMessage("Replaying movie file in read-only mode");
GlobalWinF.MainForm.ReadOnly = true; Global.MainForm.ReadOnly = true;
} }
} }
@ -147,22 +142,14 @@ namespace BizHawk.MultiClient
Global.MovieSession.Movie.Stop(abortchanges); Global.MovieSession.Movie.Stop(abortchanges);
if (!abortchanges) if (!abortchanges)
{ {
GlobalWinF.OSD.AddMessage(Path.GetFileName(Global.MovieSession.Movie.Filename) + " written to disk."); Global.OSD.AddMessage(Path.GetFileName(Global.MovieSession.Movie.Filename) + " written to disk.");
} }
GlobalWinF.OSD.AddMessage(message); Global.OSD.AddMessage(message);
GlobalWinF.MainForm.ReadOnly = true; Global.MainForm.ReadOnly = true;
SetMainformMovieInfo(); SetMainformMovieInfo();
} }
} }
private void ShowError(string error)
{
if (!String.IsNullOrWhiteSpace(error))
{
MessageBox.Show(error, "Loadstate Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private bool HandleMovieLoadState(string path) private bool HandleMovieLoadState(string path)
{ {
using (var sr = new StreamReader(path)) using (var sr = new StreamReader(path))
@ -171,10 +158,8 @@ namespace BizHawk.MultiClient
} }
} }
//OMG this needs to be refactored!
private bool HandleMovieLoadState(StreamReader reader) private bool HandleMovieLoadState(StreamReader reader)
{ {
string ErrorMSG = String.Empty;
//Note, some of the situations in these IF's may be identical and could be combined but I intentionally separated it out for clarity //Note, some of the situations in these IF's may be identical and could be combined but I intentionally separated it out for clarity
if (!Global.MovieSession.Movie.IsActive) if (!Global.MovieSession.Movie.IsActive)
{ {
@ -183,94 +168,29 @@ namespace BizHawk.MultiClient
else if (Global.MovieSession.Movie.IsRecording) else if (Global.MovieSession.Movie.IsRecording)
{ {
if (ReadOnly) if (ReadOnly)
{ {
var result = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: false, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG); if (!Global.MovieSession.Movie.CheckTimeLines(reader, false))
if (result == Movie.LoadStateResult.Pass) {
return false; //Timeline/GUID error
}
else
{ {
Global.MovieSession.Movie.WriteMovie(); Global.MovieSession.Movie.WriteMovie();
Global.MovieSession.Movie.SwitchToPlay(); Global.MovieSession.Movie.SwitchToPlay();
SetMainformMovieInfo(); SetMainformMovieInfo();
return true;
}
else
{
if (result == Movie.LoadStateResult.GuidMismatch)
{
var dresult = MessageBox.Show("The savestate GUID does not match the current movie. Proceed anyway?",
"GUID Mismatch error",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dresult == DialogResult.Yes)
{
var newresult = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: false, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG);
if (newresult == Movie.LoadStateResult.Pass)
{
Global.MovieSession.Movie.WriteMovie();
Global.MovieSession.Movie.SwitchToPlay();
SetMainformMovieInfo();
return true;
}
else
{
ShowError(ErrorMSG);
return false;
} }
} }
else else
{ {
return false; if (!Global.MovieSession.Movie.CheckTimeLines(reader, true))
}
}
else
{ {
ShowError(ErrorMSG); return false; //GUID Error
return false;
} }
}
}
else
{
var result = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: true, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG);
if (result == Movie.LoadStateResult.Pass)
{
reader.BaseStream.Position = 0; reader.BaseStream.Position = 0;
reader.DiscardBufferedData(); reader.DiscardBufferedData();
Global.MovieSession.Movie.LoadLogFromSavestateText(reader, Global.MovieSession.MultiTrack.IsActive); Global.MovieSession.Movie.LoadLogFromSavestateText(reader);
}
else
{
if (result == Movie.LoadStateResult.GuidMismatch)
{
var dresult = MessageBox.Show("The savestate GUID does not match the current movie. Proceed anyway?",
"GUID Mismatch error",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dresult == DialogResult.Yes)
{
var newresult = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: false, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG);
if (newresult == Movie.LoadStateResult.Pass)
{
reader.BaseStream.Position = 0;
reader.DiscardBufferedData();
Global.MovieSession.Movie.LoadLogFromSavestateText(reader, Global.MovieSession.MultiTrack.IsActive);
return true;
}
else
{
ShowError(ErrorMSG);
return false;
}
}
else
{
return false;
}
}
else
{
ShowError(ErrorMSG);
return false;
}
}
} }
} }
@ -278,135 +198,37 @@ namespace BizHawk.MultiClient
{ {
if (ReadOnly) if (ReadOnly)
{ {
var result = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG); if (!Global.MovieSession.Movie.CheckTimeLines(reader, false))
if (result == Movie.LoadStateResult.Pass)
{ {
return false; //Timeline/GUID error
}
//Frame loop automatically handles the rewinding effect based on Global.Emulator.Frame so nothing else is needed here //Frame loop automatically handles the rewinding effect based on Global.Emulator.Frame so nothing else is needed here
return true;
} }
else else
{ {
if (result == Movie.LoadStateResult.GuidMismatch) if (!Global.MovieSession.Movie.CheckTimeLines(reader, true))
{ {
var dresult = MessageBox.Show("The savestate GUID does not match the current movie. Proceed anyway?", return false; //GUID Error
"GUID Mismatch error",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dresult == DialogResult.Yes)
{
var newresult = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG);
if (newresult == Movie.LoadStateResult.Pass)
{
return true;
} }
else
{
ShowError(ErrorMSG);
return false;
}
}
else
{
return false;
}
}
else
{
ShowError(ErrorMSG);
return false;
}
}
}
else
{
var result = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG);
if (result == Movie.LoadStateResult.Pass)
{
Global.MovieSession.Movie.SwitchToRecord(); Global.MovieSession.Movie.SwitchToRecord();
SetMainformMovieInfo(); SetMainformMovieInfo();
reader.BaseStream.Position = 0; reader.BaseStream.Position = 0;
reader.DiscardBufferedData(); reader.DiscardBufferedData();
Global.MovieSession.Movie.LoadLogFromSavestateText(reader, Global.MovieSession.MultiTrack.IsActive); Global.MovieSession.Movie.LoadLogFromSavestateText(reader);
return true;
}
else
{
if (result == Movie.LoadStateResult.GuidMismatch)
{
var dresult = MessageBox.Show("The savestate GUID does not match the current movie. Proceed anyway?",
"GUID Mismatch error",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dresult == DialogResult.Yes)
{
var newresult = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG);
if (newresult == Movie.LoadStateResult.Pass)
{
Global.MovieSession.Movie.SwitchToRecord();
SetMainformMovieInfo();
reader.BaseStream.Position = 0;
reader.DiscardBufferedData();
Global.MovieSession.Movie.LoadLogFromSavestateText(reader, Global.MovieSession.MultiTrack.IsActive);
return true;
}
else
{
ShowError(ErrorMSG);
return false;
}
}
else
{
return false;
}
}
else
{
ShowError(ErrorMSG);
return false;
}
}
} }
} }
else if (Global.MovieSession.Movie.IsFinished) else if (Global.MovieSession.Movie.IsFinished)
{ {
if (ReadOnly) if (ReadOnly)
{ {
var result = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG);
if (result != Movie.LoadStateResult.Pass)
{ {
if (result == Movie.LoadStateResult.GuidMismatch) if (!Global.MovieSession.Movie.CheckTimeLines(reader, false))
{ {
var dresult = MessageBox.Show("The savestate GUID does not match the current movie. Proceed anyway?", return false; //Timeline/GUID error
"GUID Mismatch error",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dresult == DialogResult.Yes)
{
var newresult = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG);
if (newresult == Movie.LoadStateResult.Pass)
{
Global.MovieSession.Movie.SwitchToPlay();
SetMainformMovieInfo();
return true;
}
else
{
ShowError(ErrorMSG);
return false;
}
}
else
{
return false;
}
}
else
{
ShowError(ErrorMSG);
return false;
}
} }
else if (Global.MovieSession.Movie.IsFinished) //TimeLine check can change a movie to finished, hence the check here (not a good design) else if (Global.MovieSession.Movie.IsFinished) //TimeLine check can change a movie to finished, hence the check here (not a good design)
{ {
Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter);
} }
else else
{ {
@ -414,59 +236,25 @@ namespace BizHawk.MultiClient
SetMainformMovieInfo(); SetMainformMovieInfo();
} }
} }
}
else else
{ {
var result = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG);
if (result == Movie.LoadStateResult.Pass)
{ {
GlobalWinF.MainForm.ClearSaveRAM(); if (!Global.MovieSession.Movie.CheckTimeLines(reader, true))
{
return false; //GUID Error
}
else
{
Global.MovieSession.Movie.StartRecording(); Global.MovieSession.Movie.StartRecording();
SetMainformMovieInfo(); SetMainformMovieInfo();
reader.BaseStream.Position = 0; reader.BaseStream.Position = 0;
reader.DiscardBufferedData(); reader.DiscardBufferedData();
Global.MovieSession.Movie.LoadLogFromSavestateText(reader, Global.MovieSession.MultiTrack.IsActive); Global.MovieSession.Movie.LoadLogFromSavestateText(reader);
return true;
}
else
{
if (result == Movie.LoadStateResult.GuidMismatch)
{
var dresult = MessageBox.Show("The savestate GUID does not match the current movie. Proceed anyway?",
"GUID Mismatch error",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dresult == DialogResult.Yes)
{
var newresult = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG);
if (newresult == Movie.LoadStateResult.Pass)
{
GlobalWinF.MainForm.ClearSaveRAM();
Global.MovieSession.Movie.StartRecording();
SetMainformMovieInfo();
reader.BaseStream.Position = 0;
reader.DiscardBufferedData();
Global.MovieSession.Movie.LoadLogFromSavestateText(reader, Global.MovieSession.MultiTrack.IsActive);
return true;
}
else
{
ShowError(ErrorMSG);
return false;
}
}
else
{
return false;
}
}
else
{
ShowError(ErrorMSG);
return false;
} }
} }
} }
} }
return true; return true;
} }
@ -482,7 +270,7 @@ namespace BizHawk.MultiClient
{ {
if (!Global.MovieSession.Movie.IsActive) if (!Global.MovieSession.Movie.IsActive)
{ {
Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter);
} }
else if (Global.MovieSession.Movie.IsFinished) else if (Global.MovieSession.Movie.IsFinished)
@ -494,7 +282,7 @@ namespace BizHawk.MultiClient
} }
else else
{ {
Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter);
} }
} }
@ -506,7 +294,7 @@ namespace BizHawk.MultiClient
{ {
Global.MovieSession.Movie.CaptureState(); Global.MovieSession.Movie.CaptureState();
Global.MovieSession.LatchInputFromLog(); Global.MovieSession.LatchInputFromLog();
Global.MovieSession.Movie.CommitFrame(Global.Emulator.Frame, GlobalWinF.MovieOutputHardpoint); Global.MovieSession.Movie.CommitFrame(Global.Emulator.Frame, Global.MovieOutputHardpoint);
} }
else else
{ {
@ -517,19 +305,19 @@ namespace BizHawk.MultiClient
{ {
Global.MovieSession.Movie.CaptureState(); Global.MovieSession.Movie.CaptureState();
Global.MovieSession.LatchInputFromLog(); Global.MovieSession.LatchInputFromLog();
if (GlobalWinF.ClientControls["ClearFrame"]) if (Global.ClientControls["ClearFrame"])
{ {
Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter);
ClearFrame(); ClearFrame();
} }
else if (TAStudio1.IsHandleCreated && !TAStudio1.IsDisposed || Global.Config.MoviePlaybackPokeMode) else if (TAStudio1.IsHandleCreated && !TAStudio1.IsDisposed || Global.Config.MoviePlaybackPokeMode)
{ {
Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter);
MnemonicsGenerator mg = new MnemonicsGenerator(); MnemonicsGenerator mg = new MnemonicsGenerator();
mg.SetSource( GlobalWinF.MovieOutputHardpoint); mg.SetSource( Global.MovieOutputHardpoint);
if (!mg.IsEmpty) if (!mg.IsEmpty)
{ {
Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter);
Global.MovieSession.Movie.PokeFrame(Global.Emulator.Frame, mg.GetControllersAsMnemonic()); Global.MovieSession.Movie.PokeFrame(Global.Emulator.Frame, mg.GetControllersAsMnemonic());
} }
else else
@ -545,15 +333,15 @@ namespace BizHawk.MultiClient
Global.MovieSession.Movie.CaptureState(); Global.MovieSession.Movie.CaptureState();
if (Global.MovieSession.MultiTrack.IsActive) if (Global.MovieSession.MultiTrack.IsActive)
{ {
Global.MovieSession.LatchMultitrackPlayerInput(GlobalWinF.MovieInputSourceAdapter, Global.MultitrackRewiringControllerAdapter); Global.MovieSession.LatchMultitrackPlayerInput(Global.MovieInputSourceAdapter, Global.MultitrackRewiringControllerAdapter);
} }
else else
{ {
Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(Global.MovieInputSourceAdapter);
} }
//the movie session makes sure that the correct input has been read and merged to its MovieControllerAdapter; //the movie session makes sure that the correct input has been read and merged to its MovieControllerAdapter;
//this has been wired to Global.MovieOutputHardpoint in RewireInputChain //this has been wired to Global.MovieOutputHardpoint in RewireInputChain
Global.MovieSession.Movie.CommitFrame(Global.Emulator.Frame, GlobalWinF.MovieOutputHardpoint); Global.MovieSession.Movie.CommitFrame(Global.Emulator.Frame, Global.MovieOutputHardpoint);
} }
} }

View File

@ -4,8 +4,6 @@ using System.Threading;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class MainForm public partial class MainForm
@ -401,12 +399,12 @@ namespace BizHawk.MultiClient
{ {
if (RewindActive != enabled) if (RewindActive != enabled)
{ {
GlobalWinF.OSD.AddMessage("Rewind " + (enabled ? "Enabled" : "Disabled")); Global.OSD.AddMessage("Rewind " + (enabled ? "Enabled" : "Disabled"));
} }
if (RewindFrequency != frequency && enabled) if (RewindFrequency != frequency && enabled)
{ {
GlobalWinF.OSD.AddMessage("Rewind frequency set to " + frequency); Global.OSD.AddMessage("Rewind frequency set to " + frequency);
} }
RewindActive = enabled; RewindActive = enabled;

File diff suppressed because it is too large Load Diff

View File

@ -12,8 +12,6 @@ using Microsoft.VisualBasic.ApplicationServices;
#pragma warning disable 618 #pragma warning disable 618
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
static class Program static class Program
@ -69,13 +67,13 @@ namespace BizHawk.MultiClient
Global.Config.ResolveDefaults(); Global.Config.ResolveDefaults();
#if WINDOWS #if WINDOWS
try { GlobalWinF.DSound = SoundEnumeration.Create(); } try { Global.DSound = SoundEnumeration.Create(); }
catch catch
{ {
MessageBox.Show("Couldn't initialize DirectSound! Things may go poorly for you. Try changing your sound driver to 41khz instead of 48khz in mmsys.cpl.", "Initialization Error", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Couldn't initialize DirectSound! Things may go poorly for you. Try changing your sound driver to 41khz instead of 48khz in mmsys.cpl.", "Initialization Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
try { GlobalWinF.Direct3D = new Direct3D(); } try { Global.Direct3D = new Direct3D(); }
catch catch
{ {
//fallback to GDI rendering //fallback to GDI rendering
@ -124,10 +122,10 @@ namespace BizHawk.MultiClient
#if WINDOWS #if WINDOWS
finally finally
{ {
if (GlobalWinF.DSound != null && GlobalWinF.DSound.Disposed == false) if (Global.DSound != null && Global.DSound.Disposed == false)
GlobalWinF.DSound.Dispose(); Global.DSound.Dispose();
if (GlobalWinF.Direct3D != null && GlobalWinF.Direct3D.Disposed == false) if (Global.Direct3D != null && Global.Direct3D.Disposed == false)
GlobalWinF.Direct3D.Dispose(); Global.Direct3D.Dispose();
GamePad.CloseAll(); GamePad.CloseAll();
} }
#endif #endif

View File

@ -1,8 +1,9 @@
using System.Collections; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
public class RecentFiles : IEnumerable public class RecentFiles : IEnumerable
{ {
@ -23,7 +24,7 @@ namespace BizHawk.Client.Common
return recentlist.GetEnumerator(); return recentlist.GetEnumerator();
} }
IEnumerator IEnumerable.GetEnumerator() System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{ {
return GetEnumerator(); return GetEnumerator();
} }

View File

@ -10,8 +10,6 @@ using SlimDX;
using SlimDX.Direct3D9; using SlimDX.Direct3D9;
using d3d9font=SlimDX.Direct3D9.Font; using d3d9font=SlimDX.Direct3D9.Font;
#endif #endif
using BizHawk.Client.Common;
using BizHawk.Core; using BizHawk.Core;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
@ -348,13 +346,13 @@ namespace BizHawk.MultiClient
d3d = direct3D; d3d = direct3D;
backingControl = control; backingControl = control;
control.MouseDoubleClick += (o, e) => HandleFullscreenToggle(o, e); control.MouseDoubleClick += (o, e) => HandleFullscreenToggle(o, e);
control.MouseClick += (o, e) => GlobalWinF.MainForm.MainForm_MouseClick(o, e); control.MouseClick += (o, e) => Global.MainForm.MainForm_MouseClick(o, e);
} }
private void HandleFullscreenToggle(object sender, MouseEventArgs e) private void HandleFullscreenToggle(object sender, MouseEventArgs e)
{ {
if (e.Button == MouseButtons.Left) if (e.Button == MouseButtons.Left)
GlobalWinF.MainForm.ToggleFullscreen(); Global.MainForm.ToggleFullscreen();
} }
private void DestroyDevice() private void DestroyDevice()
@ -392,7 +390,7 @@ namespace BizHawk.MultiClient
{ {
get get
{ {
if (GlobalWinF.ForceNoThrottle) if (Global.ForceNoThrottle)
return false; return false;
return Global.Config.VSyncThrottle || Global.Config.VSync; return Global.Config.VSyncThrottle || Global.Config.VSync;
} }
@ -463,13 +461,13 @@ namespace BizHawk.MultiClient
// Wait until device is available or user gets annoyed and closes app // Wait until device is available or user gets annoyed and closes app
Result r; Result r;
// it can take a while for the device to be ready again, so avoid sound looping during the wait // it can take a while for the device to be ready again, so avoid sound looping during the wait
if (GlobalWinF.Sound != null) GlobalWinF.Sound.StopSound(); if (Global.Sound != null) Global.Sound.StopSound();
do do
{ {
r = _device.TestCooperativeLevel(); r = _device.TestCooperativeLevel();
Thread.Sleep(100); Thread.Sleep(100);
} while (r == ResultCode.DeviceLost); } while (r == ResultCode.DeviceLost);
if (GlobalWinF.Sound != null) GlobalWinF.Sound.StartSound(); if (Global.Sound != null) Global.Sound.StartSound();
// lets try recovery! // lets try recovery!
DestroyDevice(); DestroyDevice();

View File

@ -1,8 +1,6 @@
using System; using System;
using System.Globalization; using System.Globalization;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public class RomGame public class RomGame

View File

@ -1,7 +1,5 @@
using System.IO; using System.IO;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
class SavestateManager class SavestateManager

View File

@ -6,8 +6,6 @@ using SlimDX.DirectSound;
using SlimDX.Multimedia; using SlimDX.Multimedia;
#endif #endif
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
#if WINDOWS #if WINDOWS
@ -137,7 +135,7 @@ namespace BizHawk.MultiClient
syncsoundProvider = null; syncsoundProvider = null;
asyncsoundProvider = source; asyncsoundProvider = source;
semisync.BaseSoundProvider = source; semisync.BaseSoundProvider = source;
semisync.RecalculateMagic(GlobalWinF.CoreComm.VsyncRate); semisync.RecalculateMagic(Global.CoreComm.VsyncRate);
} }
static int circularDist(int from, int to, int size) static int circularDist(int from, int to, int size)
@ -208,7 +206,7 @@ namespace BizHawk.MultiClient
samplesProvided = 2 * nsampgot; samplesProvided = 2 * nsampgot;
if (!GlobalWinF.ForceNoThrottle) if (!Global.ForceNoThrottle)
while (samplesNeeded < samplesProvided) while (samplesNeeded < samplesProvided)
{ {
System.Threading.Thread.Sleep((samplesProvided - samplesNeeded) / 88); // let audio clock control sleep time System.Threading.Thread.Sleep((samplesProvided - samplesNeeded) / 88); // let audio clock control sleep time

View File

@ -2,8 +2,6 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using BizHawk.Client.Common;
//this throttle is nitsuja's fine-tuned techniques from desmume //this throttle is nitsuja's fine-tuned techniques from desmume
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
@ -25,7 +23,7 @@ namespace BizHawk.MultiClient
{ {
get get
{ {
if (GlobalWinF.ClientControls["MaxTurbo"]) if (Global.ClientControls["MaxTurbo"])
{ {
return 20; return 20;
} }
@ -39,7 +37,7 @@ namespace BizHawk.MultiClient
{ {
get get
{ {
if (GlobalWinF.ClientControls["MaxTurbo"]) if (Global.ClientControls["MaxTurbo"])
{ {
return false; return false;
} }
@ -54,7 +52,7 @@ namespace BizHawk.MultiClient
{ {
get get
{ {
if (GlobalWinF.ClientControls["MaxTurbo"]) if (Global.ClientControls["MaxTurbo"])
{ {
return false; return false;
} }

View File

@ -5,8 +5,6 @@ using System.Text;
using System.IO; using System.IO;
using System.Xml; using System.Xml;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public class XmlGame public class XmlGame

View File

@ -7,8 +7,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class AutofireConfig : Form public partial class AutofireConfig : Form
@ -39,18 +37,18 @@ namespace BizHawk.MultiClient
private void Ok_Click(object sender, EventArgs e) private void Ok_Click(object sender, EventArgs e)
{ {
GlobalWinF.AutoFireController.On = Global.Config.AutofireOn = (int)OnNumeric.Value; Global.AutoFireController.On = Global.Config.AutofireOn = (int)OnNumeric.Value;
GlobalWinF.AutoFireController.Off = Global.Config.AutofireOff = (int)OffNumeric.Value; Global.AutoFireController.Off = Global.Config.AutofireOff = (int)OffNumeric.Value;
Global.Config.AutofireLagFrames = LagFrameCheck.Checked; Global.Config.AutofireLagFrames = LagFrameCheck.Checked;
GlobalWinF.AutofireStickyXORAdapter.SetOnOffPatternFromConfig(); Global.AutofireStickyXORAdapter.SetOnOffPatternFromConfig();
GlobalWinF.OSD.AddMessage("Autofire settings saved"); Global.OSD.AddMessage("Autofire settings saved");
this.Close(); this.Close();
} }
private void Cancel_Click(object sender, EventArgs e) private void Cancel_Click(object sender, EventArgs e)
{ {
GlobalWinF.OSD.AddMessage("Autofire config aborted"); Global.OSD.AddMessage("Autofire config aborted");
this.Close(); this.Close();
} }
} }

View File

@ -4,8 +4,6 @@ using System.Drawing;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class ControllerConfig : Form public partial class ControllerConfig : Form
@ -53,7 +51,7 @@ namespace BizHawk.MultiClient
return cp; return cp;
} }
Control CreateAnalogPanel(Dictionary<string, BizHawk.Client.Common.Config.AnalogBind> settings, List<string> buttons, Size size) Control CreateAnalogPanel(Dictionary<string, Config.AnalogBind> settings, List<string> buttons, Size size)
{ {
var acp = new AnalogBindPanel(settings, buttons) { Dock = DockStyle.Fill }; var acp = new AnalogBindPanel(settings, buttons) { Dock = DockStyle.Fill };
return acp; return acp;
@ -155,7 +153,7 @@ namespace BizHawk.MultiClient
private void LoadPanels(Dictionary<string, Dictionary<string, string>> normal, private void LoadPanels(Dictionary<string, Dictionary<string, string>> normal,
Dictionary<string, Dictionary<string, string>> autofire, Dictionary<string, Dictionary<string, string>> autofire,
Dictionary<string, Dictionary<string, BizHawk.Client.Common.Config.AnalogBind>> analog) Dictionary<string, Dictionary<string, Config.AnalogBind>> analog)
{ {
LoadToPanel(tabPage1, the_definition.Name, the_definition.BoolButtons, normal, "", CreateNormalPanel); LoadToPanel(tabPage1, the_definition.Name, the_definition.BoolButtons, normal, "", CreateNormalPanel);
LoadToPanel(tabPage2, the_definition.Name, the_definition.BoolButtons, autofire, "", CreateNormalPanel); LoadToPanel(tabPage2, the_definition.Name, the_definition.BoolButtons, autofire, "", CreateNormalPanel);
@ -172,7 +170,7 @@ namespace BizHawk.MultiClient
LoadPanels(cd.AllTrollers, cd.AllTrollersAutoFire, cd.AllTrollersAnalog); LoadPanels(cd.AllTrollers, cd.AllTrollersAutoFire, cd.AllTrollersAnalog);
} }
private void LoadPanels(BizHawk.Client.Common.Config c) private void LoadPanels(Config c)
{ {
LoadPanels(c.AllTrollers, c.AllTrollersAutoFire, c.AllTrollersAnalog); LoadPanels(c.AllTrollers, c.AllTrollersAutoFire, c.AllTrollersAnalog);
} }
@ -259,14 +257,14 @@ namespace BizHawk.MultiClient
Save(); Save();
GlobalWinF.OSD.AddMessage("Controller settings saved"); Global.OSD.AddMessage("Controller settings saved");
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
Close(); Close();
} }
private void buttonCancel_Click(object sender, EventArgs e) private void buttonCancel_Click(object sender, EventArgs e)
{ {
GlobalWinF.OSD.AddMessage("Controller config aborted"); Global.OSD.AddMessage("Controller config aborted");
Close(); Close();
} }
@ -358,10 +356,10 @@ namespace BizHawk.MultiClient
{ {
public Dictionary<string, Dictionary<string, string>> AllTrollers = new Dictionary<string, Dictionary<string, string>>(); public Dictionary<string, Dictionary<string, string>> AllTrollers = new Dictionary<string, Dictionary<string, string>>();
public Dictionary<string, Dictionary<string, string>> AllTrollersAutoFire = new Dictionary<string, Dictionary<string, string>>(); public Dictionary<string, Dictionary<string, string>> AllTrollersAutoFire = new Dictionary<string, Dictionary<string, string>>();
public Dictionary<string, Dictionary<string, BizHawk.Client.Common.Config.AnalogBind>> AllTrollersAnalog = new Dictionary<string, Dictionary<string, BizHawk.Client.Common.Config.AnalogBind>>(); public Dictionary<string, Dictionary<string, Config.AnalogBind>> AllTrollersAnalog = new Dictionary<string, Dictionary<string, Config.AnalogBind>>();
} }
public static void ConfigCheckAllControlDefaults(BizHawk.Client.Common.Config c) public static void ConfigCheckAllControlDefaults(Config c)
{ {
if (c.AllTrollers.Count == 0 && c.AllTrollersAutoFire.Count == 0 && c.AllTrollersAnalog.Count == 0) if (c.AllTrollers.Count == 0 && c.AllTrollersAutoFire.Count == 0 && c.AllTrollersAnalog.Count == 0)
{ {
@ -382,7 +380,7 @@ namespace BizHawk.MultiClient
cd = ConfigService.Load(ControlDefaultPath, cd); cd = ConfigService.Load(ControlDefaultPath, cd);
cd.AllTrollers[the_definition.Name] = new Dictionary<string, string>(); cd.AllTrollers[the_definition.Name] = new Dictionary<string, string>();
cd.AllTrollersAutoFire[the_definition.Name] = new Dictionary<string, string>(); cd.AllTrollersAutoFire[the_definition.Name] = new Dictionary<string, string>();
cd.AllTrollersAnalog[the_definition.Name] = new Dictionary<string, BizHawk.Client.Common.Config.AnalogBind>(); cd.AllTrollersAnalog[the_definition.Name] = new Dictionary<string, Config.AnalogBind>();
SaveToDefaults(cd); SaveToDefaults(cd);

View File

@ -7,8 +7,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class AnalogBindControl : UserControl public partial class AnalogBindControl : UserControl
@ -19,10 +17,10 @@ namespace BizHawk.MultiClient
} }
public string ButtonName; public string ButtonName;
public BizHawk.Client.Common.Config.AnalogBind Bind; public Config.AnalogBind Bind;
bool listening = false; bool listening = false;
public AnalogBindControl(string ButtonName, BizHawk.Client.Common.Config.AnalogBind Bind) public AnalogBindControl(string ButtonName, Config.AnalogBind Bind)
: this() : this()
{ {
this.Bind = Bind; this.Bind = Bind;

View File

@ -5,15 +5,13 @@ using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Drawing; using System.Drawing;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
class AnalogBindPanel : UserControl class AnalogBindPanel : UserControl
{ {
Dictionary<string, BizHawk.Client.Common.Config.AnalogBind> RealConfigObject; Dictionary<string, Config.AnalogBind> RealConfigObject;
public AnalogBindPanel(Dictionary<string, BizHawk.Client.Common.Config.AnalogBind> RealConfigObject, List<string> RealConfigButtons = null) public AnalogBindPanel(Dictionary<string, Config.AnalogBind> RealConfigObject, List<string> RealConfigButtons = null)
:base() :base()
{ {
this.RealConfigObject = RealConfigObject; this.RealConfigObject = RealConfigObject;
@ -40,7 +38,7 @@ namespace BizHawk.MultiClient
/// save to config /// save to config
/// </summary> /// </summary>
/// <param name="SaveConfigObject">if non-null, save to possibly different config object than originally initialized from</param> /// <param name="SaveConfigObject">if non-null, save to possibly different config object than originally initialized from</param>
public void Save(Dictionary<string, BizHawk.Client.Common.Config.AnalogBind> SaveConfigObject = null) public void Save(Dictionary<string, Config.AnalogBind> SaveConfigObject = null)
{ {
var saveto = SaveConfigObject ?? RealConfigObject; var saveto = SaveConfigObject ?? RealConfigObject;
foreach (Control c in Controls) foreach (Control c in Controls)

View File

@ -34,28 +34,26 @@
this.lvFirmwares = new System.Windows.Forms.ListView(); this.lvFirmwares = new System.Windows.Forms.ListView();
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.lvFirmwaresContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.tsmiSetCustomization = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiClearCustomization = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiInfo = new System.Windows.Forms.ToolStripMenuItem();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.toolStrip1 = new ToolStripEx(); this.toolStrip1 = new ToolStripEx();
this.tbbGroup = new System.Windows.Forms.ToolStripButton(); this.tbbGroup = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.tbbScan = new System.Windows.Forms.ToolStripButton(); this.tbbScan = new System.Windows.Forms.ToolStripButton();
this.tbbOrganize = new System.Windows.Forms.ToolStripButton(); this.tbbOrganize = new System.Windows.Forms.ToolStripButton();
this.tsmiCopy = new System.Windows.Forms.ToolStripMenuItem(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.lvFirmwaresContextMenuStrip.SuspendLayout(); this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.lvFirmwaresContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.tsmiClearCustomization = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiSetCustomization = new System.Windows.Forms.ToolStripMenuItem();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.toolStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.lvFirmwaresContextMenuStrip.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// imageList1 // imageList1
@ -98,62 +96,11 @@
// //
this.columnHeader1.Text = "System"; this.columnHeader1.Text = "System";
// //
// columnHeader6
//
this.columnHeader6.Text = "Id";
//
// columnHeader4 // columnHeader4
// //
this.columnHeader4.Text = "Description"; this.columnHeader4.Text = "Description";
this.columnHeader4.Width = 165; this.columnHeader4.Width = 165;
// //
// columnHeader2
//
this.columnHeader2.Text = "Resolved With";
this.columnHeader2.Width = 116;
//
// columnHeader3
//
this.columnHeader3.Text = "Location";
this.columnHeader3.Width = 252;
//
// columnHeader7
//
this.columnHeader7.Text = "Hash";
this.columnHeader7.Width = 340;
//
// lvFirmwaresContextMenuStrip
//
this.lvFirmwaresContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsmiSetCustomization,
this.tsmiClearCustomization,
this.tsmiInfo,
this.tsmiCopy});
this.lvFirmwaresContextMenuStrip.Name = "lvFirmwaresContextMenuStrip";
this.lvFirmwaresContextMenuStrip.Size = new System.Drawing.Size(170, 114);
this.lvFirmwaresContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.lvFirmwaresContextMenuStrip_Opening);
//
// tsmiSetCustomization
//
this.tsmiSetCustomization.Name = "tsmiSetCustomization";
this.tsmiSetCustomization.Size = new System.Drawing.Size(169, 22);
this.tsmiSetCustomization.Text = "&Set Customization";
this.tsmiSetCustomization.Click += new System.EventHandler(this.tsmiClearCustomization_Click);
//
// tsmiClearCustomization
//
this.tsmiClearCustomization.Name = "tsmiClearCustomization";
this.tsmiClearCustomization.Size = new System.Drawing.Size(169, 22);
this.tsmiClearCustomization.Text = "C&lear Customization";
this.tsmiClearCustomization.Click += new System.EventHandler(this.tsmiClearCustomization_Click);
//
// tsmiInfo
//
this.tsmiInfo.Name = "tsmiInfo";
this.tsmiInfo.Size = new System.Drawing.Size(169, 22);
this.tsmiInfo.Text = "&Info";
this.tsmiInfo.Click += new System.EventHandler(this.tsmiInfo_Click);
//
// panel1 // panel1
// //
this.tableLayoutPanel1.SetColumnSpan(this.panel1, 2); this.tableLayoutPanel1.SetColumnSpan(this.panel1, 2);
@ -165,24 +112,8 @@
this.panel1.Size = new System.Drawing.Size(773, 472); this.panel1.Size = new System.Drawing.Size(773, 472);
this.panel1.TabIndex = 24; this.panel1.TabIndex = 24;
// //
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(779, 478);
this.tableLayoutPanel1.TabIndex = 25;
//
// toolStrip1 // toolStrip1
// //
this.toolStrip1.ClickThrough = true;
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tbbGroup, this.tbbGroup,
this.toolStripSeparator2, this.toolStripSeparator2,
@ -232,12 +163,61 @@
this.tbbOrganize.Text = "Organize"; this.tbbOrganize.Text = "Organize";
this.tbbOrganize.Click += new System.EventHandler(this.tbbOrganize_Click); this.tbbOrganize.Click += new System.EventHandler(this.tbbOrganize_Click);
// //
// tsmiCopy // tableLayoutPanel1
// //
this.tsmiCopy.Name = "tsmiCopy"; this.tableLayoutPanel1.ColumnCount = 2;
this.tsmiCopy.Size = new System.Drawing.Size(169, 22); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tsmiCopy.Text = "&Copy"; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tsmiCopy.Click += new System.EventHandler(this.tsmiCopy_Click); this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(779, 478);
this.tableLayoutPanel1.TabIndex = 25;
//
// columnHeader6
//
this.columnHeader6.Text = "Id";
//
// columnHeader2
//
this.columnHeader2.Text = "Resolved With";
this.columnHeader2.Width = 116;
//
// columnHeader7
//
this.columnHeader7.Text = "Hash";
this.columnHeader7.Width = 340;
//
// columnHeader3
//
this.columnHeader3.Text = "Location";
this.columnHeader3.Width = 252;
//
// lvFirmwaresContextMenuStrip
//
this.lvFirmwaresContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsmiSetCustomization,
this.tsmiClearCustomization});
this.lvFirmwaresContextMenuStrip.Name = "lvFirmwaresContextMenuStrip";
this.lvFirmwaresContextMenuStrip.Size = new System.Drawing.Size(170, 48);
//
// tsmiClearCustomization
//
this.tsmiClearCustomization.Name = "tsmiClearCustomization";
this.tsmiClearCustomization.Size = new System.Drawing.Size(169, 22);
this.tsmiClearCustomization.Text = "&Clear Customization";
this.tsmiClearCustomization.Click += new System.EventHandler(this.tsmiClearCustomization_Click);
//
// tsmiSetCustomization
//
this.tsmiSetCustomization.Name = "tsmiSetCustomization";
this.tsmiSetCustomization.Size = new System.Drawing.Size(169, 22);
this.tsmiSetCustomization.Text = "&Set Customization";
this.tsmiSetCustomization.Click += new System.EventHandler(this.tsmiSetCustomization_Click);
// //
// FirmwaresConfig // FirmwaresConfig
// //
@ -250,12 +230,12 @@
this.Text = "Firmwares"; this.Text = "Firmwares";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FirmwaresConfig_FormClosed); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FirmwaresConfig_FormClosed);
this.Load += new System.EventHandler(this.FirmwaresConfig_Load); this.Load += new System.EventHandler(this.FirmwaresConfig_Load);
this.lvFirmwaresContextMenuStrip.ResumeLayout(false);
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.panel1.PerformLayout(); this.panel1.PerformLayout();
this.tableLayoutPanel1.ResumeLayout(false);
this.toolStrip1.ResumeLayout(false); this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout(); this.toolStrip1.PerformLayout();
this.tableLayoutPanel1.ResumeLayout(false);
this.lvFirmwaresContextMenuStrip.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -282,7 +262,5 @@
private System.Windows.Forms.ContextMenuStrip lvFirmwaresContextMenuStrip; private System.Windows.Forms.ContextMenuStrip lvFirmwaresContextMenuStrip;
private System.Windows.Forms.ToolStripMenuItem tsmiSetCustomization; private System.Windows.Forms.ToolStripMenuItem tsmiSetCustomization;
private System.Windows.Forms.ToolStripMenuItem tsmiClearCustomization; private System.Windows.Forms.ToolStripMenuItem tsmiClearCustomization;
private System.Windows.Forms.ToolStripMenuItem tsmiInfo;
private System.Windows.Forms.ToolStripMenuItem tsmiCopy;
} }
} }

View File

@ -9,8 +9,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
//notes: eventually, we intend to have a "firmware acquisition interface" exposed to the emulator cores. //notes: eventually, we intend to have a "firmware acquisition interface" exposed to the emulator cores.
//it will be implemented by the multiclient, and use firmware keys to fetch the firmware content. //it will be implemented by the multiclient, and use firmware keys to fetch the firmware content.
//however, for now, the cores are using strings from the config class. so we have the `configMember` which is //however, for now, the cores are using strings from the config class. so we have the `configMember` which is
@ -177,7 +175,7 @@ namespace BizHawk.MultiClient
DoScan(); DoScan();
} }
FirmwareManager Manager { get { return GlobalWinF.MainForm.FirmwareManager; } } FirmwareManager Manager { get { return Global.MainForm.FirmwareManager; } }
private void DoScan() private void DoScan()
{ {
@ -280,16 +278,11 @@ namespace BizHawk.MultiClient
private void lvFirmwares_KeyDown(object sender, KeyEventArgs e) private void lvFirmwares_KeyDown(object sender, KeyEventArgs e)
{ {
if (e.KeyCode == Keys.C && e.Control && !e.Alt && !e.Shift) if (e.KeyCode == Keys.C && e.Control && !e.Alt && !e.Shift)
{
PerformListCopy();
}
}
void PerformListCopy()
{ {
var str = lvFirmwares.CopyItemsAsText(); var str = lvFirmwares.CopyItemsAsText();
if (str.Length > 0) Clipboard.SetDataObject(str); if (str.Length > 0) Clipboard.SetDataObject(str);
} }
}
private void lvFirmwares_MouseClick(object sender, MouseEventArgs e) private void lvFirmwares_MouseClick(object sender, MouseEventArgs e)
{ {
@ -309,7 +302,7 @@ namespace BizHawk.MultiClient
//remember the location we selected this firmware from, maybe there are others //remember the location we selected this firmware from, maybe there are others
currSelectorDir = Path.GetDirectoryName(ofd.FileName); currSelectorDir = Path.GetDirectoryName(ofd.FileName);
//for each selected item, set the user choice (even though multiple selection for this operation is no longer allowed) //for each selected item, set the user choice (hey, thats the expected semantic
foreach (ListViewItem lvi in lvFirmwares.SelectedItems) foreach (ListViewItem lvi in lvFirmwares.SelectedItems)
{ {
var fr = lvi.Tag as FirmwareDatabase.FirmwareRecord; var fr = lvi.Tag as FirmwareDatabase.FirmwareRecord;
@ -333,52 +326,5 @@ namespace BizHawk.MultiClient
DoScan(); DoScan();
} }
private void tsmiInfo_Click(object sender, EventArgs e)
{
var lvi = lvFirmwares.SelectedItems[0];
var fr = lvi.Tag as FirmwareDatabase.FirmwareRecord;
//get all options for this firmware (in order)
var options =
from fo in FirmwareDatabase.FirmwareOptions
where fo.systemId == fr.systemId && fo.firmwareId == fr.firmwareId
select fo;
FirmwaresConfigInfo fciDialog = new FirmwaresConfigInfo();
fciDialog.lblFirmware.Text = string.Format("{0} : {1} ({2})", fr.systemId, fr.firmwareId, fr.descr);
foreach (var o in options)
{
ListViewItem olvi = new ListViewItem();
olvi.SubItems.Add(new ListViewItem.ListViewSubItem());
olvi.SubItems.Add(new ListViewItem.ListViewSubItem());
var ff = FirmwareDatabase.FirmwareFilesByHash[o.hash];
olvi.SubItems[0].Text = o.hash;
olvi.SubItems[0].Font = fixedFont;
olvi.SubItems[1].Text = ff.recommendedName;
olvi.SubItems[1].Font = this.Font; //why doesnt this work?
olvi.SubItems[2].Text = ff.descr;
olvi.SubItems[2].Font = this.Font; //why doesnt this work?
fciDialog.lvOptions.Items.Add(olvi);
}
fciDialog.lvOptions.AutoResizeColumn(0, ColumnHeaderAutoResizeStyle.ColumnContent);
fciDialog.lvOptions.AutoResizeColumn(1, ColumnHeaderAutoResizeStyle.ColumnContent);
fciDialog.lvOptions.AutoResizeColumn(2, ColumnHeaderAutoResizeStyle.ColumnContent);
fciDialog.ShowDialog();
}
private void lvFirmwaresContextMenuStrip_Opening(object sender, CancelEventArgs e)
{
//hide menu items that arent appropriate for multi-select
tsmiSetCustomization.Visible = lvFirmwares.SelectedItems.Count == 1;
tsmiInfo.Visible = lvFirmwares.SelectedItems.Count == 1;
}
private void tsmiCopy_Click(object sender, EventArgs e)
{
PerformListCopy();
}
} //class FirmwaresConfig } //class FirmwaresConfig
} }

View File

@ -126,9 +126,6 @@
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>122, 17</value> <value>122, 17</value>
</metadata> </metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>221, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="tbbGroup.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="tbbGroup.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
@ -175,4 +172,7 @@
TgDQASA1MVpwzwAAAABJRU5ErkJggg== TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>221, 17</value>
</metadata>
</root> </root>

View File

@ -1,201 +0,0 @@
namespace BizHawk.MultiClient
{
partial class FirmwaresConfigInfo
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.lvOptions = new System.Windows.Forms.ListView();
this.colHash = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colStandardFilename = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colDescription = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.btnClose = new System.Windows.Forms.Button();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.label2 = new System.Windows.Forms.Label();
this.lblFirmware = new System.Windows.Forms.Label();
this.lvmiOptionsContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.tsmiOptionsCopy = new System.Windows.Forms.ToolStripMenuItem();
this.tableLayoutPanel1.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.lvmiOptionsContextMenuStrip.SuspendLayout();
this.SuspendLayout();
//
// lvOptions
//
this.lvOptions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colHash,
this.colStandardFilename,
this.colDescription});
this.lvOptions.Dock = System.Windows.Forms.DockStyle.Fill;
this.lvOptions.FullRowSelect = true;
this.lvOptions.GridLines = true;
this.lvOptions.Location = new System.Drawing.Point(3, 29);
this.lvOptions.Name = "lvOptions";
this.lvOptions.Size = new System.Drawing.Size(648, 402);
this.lvOptions.TabIndex = 0;
this.lvOptions.UseCompatibleStateImageBehavior = false;
this.lvOptions.View = System.Windows.Forms.View.Details;
this.lvOptions.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvOptions_KeyDown);
this.lvOptions.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvOptions_MouseClick);
//
// colHash
//
this.colHash.Text = "Hash";
this.colHash.Width = 251;
//
// colStandardFilename
//
this.colStandardFilename.Text = "Standard Filename";
this.colStandardFilename.Width = 175;
//
// colDescription
//
this.colDescription.Text = "Description";
this.colDescription.Width = 214;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.lvOptions, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.btnClose, 0, 3);
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 4;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(654, 469);
this.tableLayoutPanel1.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(3, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(122, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Options for this firmware:";
//
// btnClose
//
this.btnClose.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.btnClose.AutoSize = true;
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnClose.Location = new System.Drawing.Point(595, 440);
this.btnClose.Margin = new System.Windows.Forms.Padding(6);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(53, 23);
this.btnClose.TabIndex = 2;
this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true;
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.AutoSize = true;
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel1.Controls.Add(this.label2);
this.flowLayoutPanel1.Controls.Add(this.lblFirmware);
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(99, 13);
this.flowLayoutPanel1.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(3, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(52, 13);
this.label2.TabIndex = 0;
this.label2.Text = "Firmware:";
//
// lblFirmware
//
this.lblFirmware.AutoSize = true;
this.lblFirmware.Location = new System.Drawing.Point(61, 0);
this.lblFirmware.Name = "lblFirmware";
this.lblFirmware.Size = new System.Drawing.Size(35, 13);
this.lblFirmware.TabIndex = 1;
this.lblFirmware.Text = "label3";
//
// lvmiOptionsContextMenuStrip
//
this.lvmiOptionsContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsmiOptionsCopy});
this.lvmiOptionsContextMenuStrip.Name = "lvmiOptionsContextMenuStrip";
this.lvmiOptionsContextMenuStrip.Size = new System.Drawing.Size(100, 26);
//
// tsmiOptionsCopy
//
this.tsmiOptionsCopy.Name = "tsmiOptionsCopy";
this.tsmiOptionsCopy.Size = new System.Drawing.Size(152, 22);
this.tsmiOptionsCopy.Text = "&Copy";
this.tsmiOptionsCopy.Click += new System.EventHandler(this.tsmiOptionsCopy_Click);
//
// FirmwaresConfigInfo
//
this.AcceptButton = this.btnClose;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnClose;
this.ClientSize = new System.Drawing.Size(654, 469);
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "FirmwaresConfigInfo";
this.Text = "Firmware Info";
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
this.lvmiOptionsContextMenuStrip.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ColumnHeader colHash;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.ColumnHeader colStandardFilename;
private System.Windows.Forms.ColumnHeader colDescription;
public System.Windows.Forms.ListView lvOptions;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.Label label2;
public System.Windows.Forms.Label lblFirmware;
private System.Windows.Forms.ContextMenuStrip lvmiOptionsContextMenuStrip;
private System.Windows.Forms.ToolStripMenuItem tsmiOptionsCopy;
}
}

View File

@ -1,48 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
//todo - display details on the current resolution status
//todo - check(mark) the one thats selected
//todo - turn top info into textboxes i guess, labels suck
namespace BizHawk.MultiClient
{
public partial class FirmwaresConfigInfo : Form
{
public FirmwaresConfigInfo()
{
InitializeComponent();
}
private void lvOptions_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.C && e.Control && !e.Alt && !e.Shift)
{
PerformListCopy();
}
}
void PerformListCopy()
{
var str = lvOptions.CopyItemsAsText();
if (str.Length > 0) Clipboard.SetDataObject(str);
}
private void tsmiOptionsCopy_Click(object sender, EventArgs e)
{
PerformListCopy();
}
private void lvOptions_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right && lvOptions.GetItemAt(e.X, e.Y) != null)
lvmiOptionsContextMenuStrip.Show(lvOptions, e.Location);
}
}
}

View File

@ -7,8 +7,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class GifAnimator : Form public partial class GifAnimator : Form

View File

@ -7,8 +7,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class HotkeyConfig : Form public partial class HotkeyConfig : Form
@ -33,14 +31,14 @@ namespace BizHawk.MultiClient
private void IDB_CANCEL_Click(object sender, EventArgs e) private void IDB_CANCEL_Click(object sender, EventArgs e)
{ {
GlobalWinF.OSD.AddMessage("Hotkey config aborted"); Global.OSD.AddMessage("Hotkey config aborted");
Close(); Close();
} }
private void IDB_SAVE_Click(object sender, EventArgs e) private void IDB_SAVE_Click(object sender, EventArgs e)
{ {
Save(); Save();
GlobalWinF.OSD.AddMessage("Hotkey settings saved"); Global.OSD.AddMessage("Hotkey settings saved");
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
Close(); Close();
} }
@ -61,7 +59,7 @@ namespace BizHawk.MultiClient
foreach (InputWidget w in _inputWidgets) foreach (InputWidget w in _inputWidgets)
{ {
var b = Global.Config.HotkeyBindings.FirstOrDefault(x => x.DisplayName == w.WidgetName); Binding b = Global.Config.HotkeyBindings.FirstOrDefault(x => x.DisplayName == w.WidgetName);
b.Bindings = w.Text; b.Bindings = w.Text;
} }
} }
@ -97,14 +95,14 @@ namespace BizHawk.MultiClient
tb.Name = tab; tb.Name = tab;
tb.Text = tab; tb.Text = tab;
var bindings = Global.Config.HotkeyBindings.Where(x => x.TabGroup == tab).OrderBy(x => x.Ordinal).ThenBy(x => x.DisplayName).ToList(); List<Binding> bindings = Global.Config.HotkeyBindings.Where(x => x.TabGroup == tab).OrderBy(x => x.Ordinal).ThenBy(x => x.DisplayName).ToList();
int _x = 6; int _x = 6;
int _y = 14; int _y = 14;
int iw_offset_x = 110; int iw_offset_x = 110;
int iw_offset_y = -4; int iw_offset_y = -4;
int iw_width = 120; int iw_width = 120;
foreach (var b in bindings) foreach (Binding b in bindings)
{ {
Label l = new Label() Label l = new Label()
{ {
@ -141,7 +139,7 @@ namespace BizHawk.MultiClient
{ {
foreach (InputWidget w in _inputWidgets) foreach (InputWidget w in _inputWidgets)
{ {
var b = Global.Config.HotkeyBindings.FirstOrDefault(x => x.DisplayName == w.WidgetName); Binding b = Global.Config.HotkeyBindings.FirstOrDefault(x => x.DisplayName == w.WidgetName);
w.Text = b.DefaultBinding; w.Text = b.DefaultBinding;
} }
} }
@ -182,7 +180,7 @@ namespace BizHawk.MultiClient
{ {
string user_selection = SearchBox.Text; string user_selection = SearchBox.Text;
var b = Global.Config.HotkeyBindings.FirstOrDefault(x => x.DisplayName == SearchBox.Text); Binding b = Global.Config.HotkeyBindings.FirstOrDefault(x => x.DisplayName == SearchBox.Text);
//Found //Found
if (b != null) if (b != null)

View File

@ -7,8 +7,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class MessageConfig : Form public partial class MessageConfig : Form
@ -229,7 +227,7 @@ namespace BizHawk.MultiClient
private void OK_Click(object sender, EventArgs e) private void OK_Click(object sender, EventArgs e)
{ {
SaveSettings(); SaveSettings();
GlobalWinF.OSD.AddMessage("Message settings saved"); Global.OSD.AddMessage("Message settings saved");
this.Close(); this.Close();
} }
@ -289,7 +287,7 @@ namespace BizHawk.MultiClient
private void Cancel_Click(object sender, EventArgs e) private void Cancel_Click(object sender, EventArgs e)
{ {
GlobalWinF.OSD.AddMessage("Message config aborted"); Global.OSD.AddMessage("Message config aborted");
this.Close(); this.Close();
} }

View File

@ -7,8 +7,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class PathConfig : Form public partial class PathConfig : Form
@ -58,13 +56,13 @@ namespace BizHawk.MultiClient
private void OK_Click(object sender, EventArgs e) private void OK_Click(object sender, EventArgs e)
{ {
SaveSettings(); SaveSettings();
GlobalWinF.OSD.AddMessage("Path settings saved"); Global.OSD.AddMessage("Path settings saved");
Close(); Close();
} }
private void Cancel_Click(object sender, EventArgs e) private void Cancel_Click(object sender, EventArgs e)
{ {
GlobalWinF.OSD.AddMessage("Path config aborted"); Global.OSD.AddMessage("Path config aborted");
Close(); Close();
} }

View File

@ -3,8 +3,6 @@ using System.Linq;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public static class PathManager public static class PathManager

View File

@ -2,8 +2,6 @@
using System.Windows.Forms; using System.Windows.Forms;
using System.Drawing; using System.Drawing;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class RewindConfig : Form public partial class RewindConfig : Form
@ -19,10 +17,10 @@ namespace BizHawk.MultiClient
private void RewindConfig_Load(object sender, EventArgs e) private void RewindConfig_Load(object sender, EventArgs e)
{ {
if (GlobalWinF.MainForm.RewindBuf != null) if (Global.MainForm.RewindBuf != null)
{ {
FullnessLabel.Text = String.Format("{0:0.00}", GlobalWinF.MainForm.Rewind_FullnessRatio * 100) + "%"; FullnessLabel.Text = String.Format("{0:0.00}", Global.MainForm.Rewind_FullnessRatio * 100) + "%";
RewindFramesUsedLabel.Text = GlobalWinF.MainForm.Rewind_Count.ToString(); RewindFramesUsedLabel.Text = Global.MainForm.Rewind_Count.ToString();
} }
else else
{ {
@ -111,13 +109,13 @@ namespace BizHawk.MultiClient
private void Cancel_Click(object sender, EventArgs e) private void Cancel_Click(object sender, EventArgs e)
{ {
GlobalWinF.OSD.AddMessage("Rewind config aborted"); Global.OSD.AddMessage("Rewind config aborted");
Close(); Close();
} }
private void OK_Click(object sender, EventArgs e) private void OK_Click(object sender, EventArgs e)
{ {
GlobalWinF.OSD.AddMessage("Rewind settings saved"); Global.OSD.AddMessage("Rewind settings saved");
Global.Config.RewindFrequencySmall = (int)SmallSavestateNumeric.Value; Global.Config.RewindFrequencySmall = (int)SmallSavestateNumeric.Value;
Global.Config.RewindFrequencyMedium = (int)MediumSavestateNumeric.Value; Global.Config.RewindFrequencyMedium = (int)MediumSavestateNumeric.Value;
@ -127,7 +125,7 @@ namespace BizHawk.MultiClient
Global.Config.RewindEnabledMedium = MediumStateEnabledBox.Checked; Global.Config.RewindEnabledMedium = MediumStateEnabledBox.Checked;
Global.Config.RewindEnabledLarge = LargeStateEnabledBox.Checked; Global.Config.RewindEnabledLarge = LargeStateEnabledBox.Checked;
GlobalWinF.MainForm.DoRewindSettings(); Global.MainForm.DoRewindSettings();
Global.Config.Rewind_UseDelta = UseDeltaCompression.Checked; Global.Config.Rewind_UseDelta = UseDeltaCompression.Checked;
@ -137,7 +135,7 @@ namespace BizHawk.MultiClient
Global.Config.Rewind_BufferSize = (int)BufferSizeUpDown.Value; Global.Config.Rewind_BufferSize = (int)BufferSizeUpDown.Value;
if (Global.Config.Rewind_IsThreaded != RewindIsThreadedCheckbox.Checked) if (Global.Config.Rewind_IsThreaded != RewindIsThreadedCheckbox.Checked)
{ {
GlobalWinF.MainForm.FlagNeedsReboot(); Global.MainForm.FlagNeedsReboot();
Global.Config.Rewind_IsThreaded = RewindIsThreadedCheckbox.Checked; Global.Config.Rewind_IsThreaded = RewindIsThreadedCheckbox.Checked;
} }
@ -260,9 +258,9 @@ namespace BizHawk.MultiClient
if (UseDeltaCompression.Checked || StateSize == 0) if (UseDeltaCompression.Checked || StateSize == 0)
{ {
if (GlobalWinF.MainForm.Rewind_Count > 0) if (Global.MainForm.Rewind_Count > 0)
{ {
avg_state_size = (long)(GlobalWinF.MainForm.Rewind_Size / GlobalWinF.MainForm.Rewind_Count); avg_state_size = (long)(Global.MainForm.Rewind_Size / Global.MainForm.Rewind_Count);
} }
else else
{ {

View File

@ -7,8 +7,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class SoundConfig : Form public partial class SoundConfig : Form
@ -49,16 +47,16 @@ namespace BizHawk.MultiClient
Global.Config.SoundVolume = SoundVolBar.Value; Global.Config.SoundVolume = SoundVolBar.Value;
Global.Config.SoundThrottle = ThrottlecheckBox.Checked; Global.Config.SoundThrottle = ThrottlecheckBox.Checked;
Global.Config.SoundDevice = (string)listBoxSoundDevices.SelectedItem ?? "<default>"; Global.Config.SoundDevice = (string)listBoxSoundDevices.SelectedItem ?? "<default>";
GlobalWinF.Sound.ChangeVolume(Global.Config.SoundVolume); Global.Sound.ChangeVolume(Global.Config.SoundVolume);
GlobalWinF.Sound.UpdateSoundSettings(); Global.Sound.UpdateSoundSettings();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
GlobalWinF.OSD.AddMessage("Sound settings saved"); Global.OSD.AddMessage("Sound settings saved");
this.Close(); this.Close();
} }
private void Cancel_Click(object sender, EventArgs e) private void Cancel_Click(object sender, EventArgs e)
{ {
GlobalWinF.OSD.AddMessage("Sound config aborted"); Global.OSD.AddMessage("Sound config aborted");
this.Close(); this.Close();
} }

View File

@ -1,14 +1,12 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class EditCommentsForm : Form public partial class EditCommentsForm : Form
{ {
public bool ReadOnly; public bool ReadOnly;
private Movie selectedMovie; private Movie selectedMovie = new Movie();
public EditCommentsForm() public EditCommentsForm()
{ {

View File

@ -3,14 +3,13 @@ using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using System.Globalization; using System.Globalization;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class EditSubtitlesForm : Form public partial class EditSubtitlesForm : Form
{ {
public bool ReadOnly; public bool ReadOnly;
private Movie selectedMovie; private Movie selectedMovie = new Movie();
public EditSubtitlesForm() public EditSubtitlesForm()
{ {
@ -54,7 +53,7 @@ namespace BizHawk.MultiClient
{ {
if (!ReadOnly) if (!ReadOnly)
{ {
selectedMovie.Subtitles.Clear(); selectedMovie.Subtitles.ClearSubtitles();
for (int x = 0; x < SubGrid.Rows.Count - 1; x++) for (int x = 0; x < SubGrid.Rows.Count - 1; x++)
{ {
Subtitle s = new Subtitle(); Subtitle s = new Subtitle();
@ -87,12 +86,12 @@ namespace BizHawk.MultiClient
public void GetMovie(Movie m) public void GetMovie(Movie m)
{ {
selectedMovie = m; selectedMovie = m;
SubtitleList subs = new SubtitleList(m.Subtitles); SubtitleList subs = new SubtitleList(m);
if (subs.Count == 0) return; if (subs.Count == 0) return;
for (int x = 0; x < subs.Count; x++) for (int x = 0; x < subs.Count; x++)
{ {
Subtitle s = subs[x]; Subtitle s = subs.GetSubtitleByIndex(x);
SubGrid.Rows.Add(); SubGrid.Rows.Add();
DataGridViewCell c = SubGrid.Rows[x].Cells[0]; DataGridViewCell c = SubGrid.Rows[x].Cells[0];
c.Value = s.Frame; c.Value = s.Frame;

View File

@ -2,7 +2,7 @@
using System.Text; using System.Text;
using System.Collections.Generic; using System.Collections.Generic;
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
/// <summary> /// <summary>
/// will hold buttons for 1 frame and then release them. (Calling Click() from your button click is what you want to do) /// will hold buttons for 1 frame and then release them. (Calling Click() from your button click is what you want to do)

View File

@ -1,36 +1,42 @@
using System; using System;
using System.IO; using System.IO;
using System.Windows.Forms;
using System.Globalization; using System.Globalization;
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
public class Movie public class Movie
{ {
#region Constructors #region Constructors
public Movie(string filename, string version) public Movie(string filename)
: this(version)
{ {
Mode = MOVIEMODE.INACTIVE;
Rerecords = 0; Rerecords = 0;
Filename = filename; Filename = filename;
Loaded = filename.Length > 0; IsText = true;
preload_framecount = 0;
IsCountingRerecords = true;
StartsFromSavestate = false;
if (filename.Length > 0)
Loaded = true;
} }
public Movie(string version) public Movie()
{ {
Header = new MovieHeader(version); Filename = "";
Filename = String.Empty;
preload_framecount = 0;
StartsFromSavestate = false;
IsCountingRerecords = true;
Mode = MOVIEMODE.INACTIVE; Mode = MOVIEMODE.INACTIVE;
IsText = true; IsText = true;
preload_framecount = 0;
StartsFromSavestate = false;
Loaded = false;
IsCountingRerecords = true;
} }
#endregion #endregion
#region Properties #region Properties
public MovieHeader Header; public MovieHeader Header = new MovieHeader();
public SubtitleList Subtitles = new SubtitleList(); public SubtitleList Subtitles = new SubtitleList();
public bool MakeBackup = true; //make backup before altering movie public bool MakeBackup = true; //make backup before altering movie
@ -134,7 +140,6 @@ namespace BizHawk.Client.Common
} }
} }
//TODO: these are getting too lengthy perhaps the log should just be exposed?
public int StateFirstIndex public int StateFirstIndex
{ {
get { return Log.StateFirstIndex; } get { return Log.StateFirstIndex; }
@ -159,16 +164,6 @@ namespace BizHawk.Client.Common
} }
} }
public byte[] GetState(int frame)
{
return Log.GetState(frame);
}
public byte[] InitState
{
get { return Log.InitState; }
}
#endregion #endregion
#region Public Mode Methods #region Public Mode Methods
@ -244,6 +239,7 @@ namespace BizHawk.Client.Common
/// <param name="truncate"></param> /// <param name="truncate"></param>
public void StartRecording(bool truncate = true) public void StartRecording(bool truncate = true)
{ {
Global.MainForm.ClearSaveRAM();
Mode = MOVIEMODE.RECORD; Mode = MOVIEMODE.RECORD;
if (Global.Config.EnableBackupMovies && MakeBackup && Log.Length > 0) if (Global.Config.EnableBackupMovies && MakeBackup && Log.Length > 0)
{ {
@ -258,6 +254,7 @@ namespace BizHawk.Client.Common
public void StartPlayback() public void StartPlayback()
{ {
Global.MainForm.ClearSaveRAM();
Mode = MOVIEMODE.PLAY; Mode = MOVIEMODE.PLAY;
} }
@ -375,6 +372,7 @@ namespace BizHawk.Client.Common
var directory_info = new FileInfo(BackupName).Directory; var directory_info = new FileInfo(BackupName).Directory;
if (directory_info != null) Directory.CreateDirectory(directory_info.FullName); if (directory_info != null) Directory.CreateDirectory(directory_info.FullName);
Global.OSD.AddMessage("Backup movie saved to " + BackupName);
if (IsText) if (IsText)
{ {
WriteText(BackupName); WriteText(BackupName);
@ -522,6 +520,17 @@ namespace BizHawk.Client.Common
public void DeleteFrame(int frame) public void DeleteFrame(int frame)
{ {
if (frame <= StateLastIndex)
{
if (frame <= StateFirstIndex)
{
RewindToFrame(0);
}
else
{
RewindToFrame(frame);
}
}
Log.DeleteFrame(frame); Log.DeleteFrame(frame);
changes = true; changes = true;
} }
@ -560,6 +569,52 @@ namespace BizHawk.Client.Common
} }
} }
public void RewindToFrame(int frame)
{
if (Mode == MOVIEMODE.INACTIVE || Mode == MOVIEMODE.FINISHED)
{
return;
}
if (frame <= Global.Emulator.Frame)
{
if (frame <= Log.StateFirstIndex)
{
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(Log.InitState)));
if (Global.MainForm.EmulatorPaused && frame > 0)
{
Global.MainForm.UnpauseEmulator();
}
if (MOVIEMODE.RECORD == Mode)
{
Mode = MOVIEMODE.PLAY;
Global.MainForm.RestoreReadWriteOnStop = true;
}
}
else
{
if (frame == 0)
{
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(Log.InitState)));
}
else
{
//frame-1 because we need to go back an extra frame and then run a frame, otherwise the display doesn't get updated.
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(Log.GetState(frame - 1))));
Global.MainForm.UpdateFrame = true;
}
}
}
else if (frame <= Log.StateLastIndex)
{
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(Log.GetState(frame - 1))));
Global.MainForm.UpdateFrame = true;
}
else
{
Global.MainForm.UnpauseEmulator();
}
}
public void PokeFrame(int frameNum, string input) public void PokeFrame(int frameNum, string input)
{ {
changes = true; changes = true;
@ -597,11 +652,19 @@ namespace BizHawk.Client.Common
writer.WriteLine("[/Input]"); writer.WriteLine("[/Input]");
} }
public void LoadLogFromSavestateText(TextReader reader, bool isMultitracking) public void LoadLogFromSavestateText(string path)
{
using (var reader = new StreamReader(path))
{
LoadLogFromSavestateText(reader);
}
}
public void LoadLogFromSavestateText(TextReader reader)
{ {
int? stateFrame = null; int? stateFrame = null;
//We are in record mode so replace the movie log with the one from the savestate //We are in record mode so replace the movie log with the one from the savestate
if (!isMultitracking) if (!Global.MovieSession.MultiTrack.IsActive)
{ {
if (Global.Config.EnableBackupMovies && MakeBackup && Log.Length > 0) if (Global.Config.EnableBackupMovies && MakeBackup && Log.Length > 0)
{ {
@ -623,7 +686,7 @@ namespace BizHawk.Client.Common
{ {
stateFrame = int.Parse(strs[1], NumberStyles.HexNumber); stateFrame = int.Parse(strs[1], NumberStyles.HexNumber);
} }
catch { } //TODO: message? catch { Global.OSD.AddMessage("Savestate Frame failed to parse"); } //TODO: message?
} }
else if (line.Contains("Frame ")) else if (line.Contains("Frame "))
{ {
@ -632,7 +695,7 @@ namespace BizHawk.Client.Common
{ {
stateFrame = int.Parse(strs[1]); stateFrame = int.Parse(strs[1]);
} }
catch { } //TODO: message? catch { Global.OSD.AddMessage("Savestate Frame failed to parse"); } //TODO: message?
} }
if (line[0] == '|') if (line[0] == '|')
{ {
@ -657,7 +720,7 @@ namespace BizHawk.Client.Common
{ {
stateFrame = int.Parse(strs[1], NumberStyles.HexNumber); stateFrame = int.Parse(strs[1], NumberStyles.HexNumber);
} }
catch { } //TODO: message? catch { Global.OSD.AddMessage("Savestate Frame failed to parse"); } //TODO: message?
} }
else if (line.Contains("Frame ")) else if (line.Contains("Frame "))
{ {
@ -734,20 +797,18 @@ namespace BizHawk.Client.Common
return time; return time;
} }
public enum LoadStateResult { Pass, GuidMismatch, TimeLineError, FutureEventError, NotInRecording, EmptyLog, MissingFrameNumber } public bool CheckTimeLines(TextReader reader, bool OnlyGUID)
public LoadStateResult CheckTimeLines(TextReader reader, bool OnlyGUID, bool IgnoreGuidMismatch, out string ErrorMessage)
{ {
//This function will compare the movie data to the savestate movie data to see if they match //This function will compare the movie data to the savestate movie data to see if they match
ErrorMessage = String.Empty;
var log = new MovieLog(); MovieLog l = new MovieLog();
int stateFrame = 0; int stateFrame = 0;
while (true) while (true)
{ {
string line = reader.ReadLine(); string line = reader.ReadLine();
if (line == null) if (line == null)
{ {
return LoadStateResult.EmptyLog; return false;
} }
else if (line.Trim() == "") else if (line.Trim() == "")
{ {
@ -758,11 +819,22 @@ namespace BizHawk.Client.Common
string guid = ParseHeader(line, MovieHeader.GUID); string guid = ParseHeader(line, MovieHeader.GUID);
if (Header.GetHeaderLine(MovieHeader.GUID) != guid) if (Header.GetHeaderLine(MovieHeader.GUID) != guid)
{ {
if (!IgnoreGuidMismatch) //GUID Mismatch error
var result = MessageBox.Show(guid + " : " + Header.GetHeaderLine(MovieHeader.GUID) + "\n" +
"The savestate GUID does not match the current movie. Proceed anyway?", "GUID Mismatch error",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.No)
{ {
return LoadStateResult.GuidMismatch; //reader.Close();
return false;
} }
} }
else if (OnlyGUID)
{
//reader.Close();
return true;
}
} }
else if (line.Contains("Frame 0x")) //NES stores frame count in hex, yay else if (line.Contains("Frame 0x")) //NES stores frame count in hex, yay
{ {
@ -771,11 +843,7 @@ namespace BizHawk.Client.Common
{ {
stateFrame = int.Parse(strs[1], NumberStyles.HexNumber); stateFrame = int.Parse(strs[1], NumberStyles.HexNumber);
} }
catch catch { Global.OSD.AddMessage("Savestate Frame number failed to parse"); }
{
ErrorMessage = "Savestate Frame number failed to parse";
return LoadStateResult.MissingFrameNumber;
}
} }
else if (line.Contains("Frame ")) else if (line.Contains("Frame "))
{ {
@ -784,68 +852,69 @@ namespace BizHawk.Client.Common
{ {
stateFrame = int.Parse(strs[1]); stateFrame = int.Parse(strs[1]);
} }
catch catch { Global.OSD.AddMessage("Savestate Frame number failed to parse"); }
{
ErrorMessage = "Savestate Frame number failed to parse";
return LoadStateResult.MissingFrameNumber;
}
} }
else if (line == "[Input]") continue; else if (line == "[Input]") continue;
else if (line == "[/Input]") break; else if (line == "[/Input]") break;
else if (line[0] == '|') else if (line[0] == '|')
{ l.AppendFrame(line);
log.AppendFrame(line);
}
} }
//reader.BaseStream.Position = 0; //Reset position because this stream may be read again by other code
if (OnlyGUID) if (OnlyGUID)
{ {
return LoadStateResult.Pass; //reader.Close();
return true;
} }
if (stateFrame == 0) if (stateFrame == 0)
{ {
stateFrame = log.Length; //In case the frame count failed to parse, revert to using the entire state input log stateFrame = l.Length; //In case the frame count failed to parse, revert to using the entire state input log
} }
if (Log.Length < stateFrame) if (Log.Length < stateFrame)
{ {
ErrorMessage = "The savestate is from frame " //Future event error
+ log.Length.ToString() MessageBox.Show("The savestate is from frame " + l.Length.ToString() + " which is greater than the current movie length of " +
+ " which is greater than the current movie length of " Log.Length.ToString() + ".\nCan not load this savestate.", "Future event Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ Log.Length.ToString(); //reader.Close();
return LoadStateResult.FutureEventError; return false;
} }
for (int i = 0; i < stateFrame; i++) for (int x = 0; x < stateFrame; x++)
{ {
string xs = Log.GetFrame(i); string xs = Log.GetFrame(x);
string ys = log.GetFrame(i); //TODO: huh?? string ys = l.GetFrame(x);
if (xs != ys) if (xs != ys)
{ {
ErrorMessage = "The savestate input does not match the movie input at frame " //TimeLine Error
+ (i + 1).ToString() MessageBox.Show("The savestate input does not match the movie input at frame " + (x + 1).ToString() + ".",
+ "."; "Timeline Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return LoadStateResult.TimeLineError; //reader.Close();
return false;
} }
} }
if (stateFrame > log.Length) //stateFrame is greater than state input log, so movie finished mode
if (stateFrame > l.Length) //stateFrame is greater than state input log, so movie finished mode
{ {
if (Mode == MOVIEMODE.PLAY || Mode == MOVIEMODE.FINISHED) if (Mode == MOVIEMODE.PLAY || Mode == MOVIEMODE.FINISHED)
{ {
Mode = MOVIEMODE.FINISHED; Mode = MOVIEMODE.FINISHED;
return LoadStateResult.Pass; return true;
} }
else else
{ return false; //For now throw an error if recording, ideally what should happen is that the state gets loaded, and the movie set to movie finished, the movie at its current state is preserved and the state is loaded just fine. This should probably also only happen if checktimelines passes
return LoadStateResult.NotInRecording; //TODO: For now throw an error if recording, ideally what should happen is that the state gets loaded, and the movie set to movie finished, the movie at its current state is preserved and the state is loaded just fine. This should probably also only happen if checktimelines passes
}
} }
else if (Mode == MOVIEMODE.FINISHED) else if (Mode == MOVIEMODE.FINISHED)
{ {
Mode = MOVIEMODE.PLAY; Mode = MOVIEMODE.PLAY;
} }
return LoadStateResult.Pass; //reader.Close();
return true;
} }
#endregion #endregion

View File

@ -1,7 +1,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
public class MovieHeader public class MovieHeader
{ {
@ -52,10 +53,16 @@ namespace BizHawk.Client.Common
return System.Guid.NewGuid().ToString(); return System.Guid.NewGuid().ToString();
} }
public MovieHeader(string version) //All required fields will be set to default values public MovieHeader() //All required fields will be set to default values
{ {
if (Global.MainForm != null)
HeaderParams.Add(EMULATIONVERSION, version); {
HeaderParams.Add(EMULATIONVERSION, Global.MainForm.GetEmuVersion());
}
else
{
HeaderParams.Add(EMULATIONVERSION, MainForm.EMUVERSION);
}
HeaderParams.Add(MOVIEVERSION, MovieVersion); HeaderParams.Add(MOVIEVERSION, MovieVersion);
HeaderParams.Add(PLATFORM, ""); HeaderParams.Add(PLATFORM, "");
HeaderParams.Add(GAMENAME, ""); HeaderParams.Add(GAMENAME, "");
@ -275,6 +282,8 @@ namespace BizHawk.Client.Common
} }
public void ReadHeader(StreamReader reader) public void ReadHeader(StreamReader reader)
{
using (reader)
{ {
string str; string str;
while ((str = reader.ReadLine()) != null) while ((str = reader.ReadLine()) != null)
@ -285,3 +294,4 @@ namespace BizHawk.Client.Common
} }
} }
} }
}

View File

@ -4,8 +4,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.IO; using System.IO;
using BizHawk.Client.Common;
#pragma warning disable 219 #pragma warning disable 219
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
@ -33,11 +31,11 @@ namespace BizHawk.MultiClient
public const string UNITCODE = "UnitCode"; public const string UNITCODE = "UnitCode";
// Attempt to import another type of movie file into a movie object. // Attempt to import another type of movie file into a movie object.
public static Movie ImportFile(string path, string bizVersion, out string errorMsg, out string warningMsg) public static Movie ImportFile(string path, out string errorMsg, out string warningMsg)
{ {
Movie m = new Movie(bizVersion); Movie m = new Movie();
errorMsg = String.Empty; errorMsg = "";
warningMsg = String.Empty; warningMsg = "";
string ext = path != null ? Path.GetExtension(path).ToUpper() : ""; string ext = path != null ? Path.GetExtension(path).ToUpper() : "";
try try
@ -84,7 +82,7 @@ namespace BizHawk.MultiClient
m = ImportZMV(path, out errorMsg, out warningMsg); m = ImportZMV(path, out errorMsg, out warningMsg);
break; break;
} }
if (errorMsg == String.Empty) if (errorMsg == "")
{ {
m.Header.SetHeaderLine(MovieHeader.MOVIEVERSION, MovieHeader.MovieVersion); m.Header.SetHeaderLine(MovieHeader.MOVIEVERSION, MovieHeader.MovieVersion);
} }
@ -290,7 +288,7 @@ namespace BizHawk.MultiClient
{ {
errorMsg = ""; errorMsg = "";
warningMsg = ""; warningMsg = "";
Movie m = new Movie(path + "." + Global.Config.MovieExtension, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(path + "." + Global.Config.MovieExtension);
FileInfo file = new FileInfo(path); FileInfo file = new FileInfo(path);
StreamReader sr = file.OpenText(); StreamReader sr = file.OpenText();
string emulator = ""; string emulator = "";
@ -472,7 +470,7 @@ namespace BizHawk.MultiClient
{ {
errorMsg = ""; errorMsg = "";
warningMsg = ""; warningMsg = "";
Movie m = new Movie(path + "." + Global.Config.MovieExtension, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(path + "." + Global.Config.MovieExtension);
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs); BinaryReader r = new BinaryReader(fs);
// 000 4-byte signature: 46 43 4D 1A "FCM\x1A" // 000 4-byte signature: 46 43 4D 1A "FCM\x1A"
@ -729,7 +727,7 @@ namespace BizHawk.MultiClient
{ {
errorMsg = ""; errorMsg = "";
warningMsg = ""; warningMsg = "";
Movie m = new Movie(path + "." + Global.Config.MovieExtension, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(path + "." + Global.Config.MovieExtension);
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs); BinaryReader r = new BinaryReader(fs);
// 000 4-byte signature: 46 4D 56 1A "FMV\x1A" // 000 4-byte signature: 46 4D 56 1A "FMV\x1A"
@ -872,7 +870,7 @@ namespace BizHawk.MultiClient
{ {
errorMsg = ""; errorMsg = "";
warningMsg = ""; warningMsg = "";
Movie m = new Movie(path + "." + Global.Config.MovieExtension, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(path + "." + Global.Config.MovieExtension);
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs); BinaryReader r = new BinaryReader(fs);
// 000 16-byte signature and format version: "Gens Movie TEST9" // 000 16-byte signature and format version: "Gens Movie TEST9"
@ -998,7 +996,7 @@ namespace BizHawk.MultiClient
{ {
errorMsg = ""; errorMsg = "";
warningMsg = ""; warningMsg = "";
Movie m = new Movie(path + "." + Global.Config.MovieExtension, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(path + "." + Global.Config.MovieExtension);
HawkFile hf = new HawkFile(path); HawkFile hf = new HawkFile(path);
// .LSMV movies are .zip files containing data files. // .LSMV movies are .zip files containing data files.
if (!hf.IsArchive) if (!hf.IsArchive)
@ -1231,7 +1229,7 @@ namespace BizHawk.MultiClient
{ {
errorMsg = ""; errorMsg = "";
warningMsg = ""; warningMsg = "";
Movie m = new Movie(path + "." + Global.Config.MovieExtension, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(path + "." + Global.Config.MovieExtension);
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs); BinaryReader r = new BinaryReader(fs);
// 000 8-byte "MDFNMOVI" signature // 000 8-byte "MDFNMOVI" signature
@ -1355,7 +1353,7 @@ namespace BizHawk.MultiClient
{ {
errorMsg = ""; errorMsg = "";
warningMsg = ""; warningMsg = "";
Movie m = new Movie(path + "." + Global.Config.MovieExtension, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(path + "." + Global.Config.MovieExtension);
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs); BinaryReader r = new BinaryReader(fs);
// 0000: 4-byte signature: "MMV\0" // 0000: 4-byte signature: "MMV\0"
@ -1472,7 +1470,7 @@ namespace BizHawk.MultiClient
{ {
errorMsg = ""; errorMsg = "";
warningMsg = ""; warningMsg = "";
Movie m = new Movie(path + "." + Global.Config.MovieExtension, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(path + "." + Global.Config.MovieExtension);
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs); BinaryReader r = new BinaryReader(fs);
// 000 4-byte signature: 4E 53 53 1A "NSS\x1A" // 000 4-byte signature: 4E 53 53 1A "NSS\x1A"
@ -1702,7 +1700,7 @@ namespace BizHawk.MultiClient
{ {
errorMsg = ""; errorMsg = "";
warningMsg = ""; warningMsg = "";
Movie m = new Movie(path + "." + Global.Config.MovieExtension, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(path + "." + Global.Config.MovieExtension);
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs); BinaryReader r = new BinaryReader(fs);
// 000 4-byte signature: 53 4D 56 1A "SMV\x1A" // 000 4-byte signature: 53 4D 56 1A "SMV\x1A"
@ -1976,7 +1974,7 @@ namespace BizHawk.MultiClient
{ {
errorMsg = ""; errorMsg = "";
warningMsg = ""; warningMsg = "";
Movie m = new Movie(path + "." + Global.Config.MovieExtension, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(path + "." + Global.Config.MovieExtension);
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs); BinaryReader r = new BinaryReader(fs);
// 000 4-byte signature: 56 42 4D 1A "VBM\x1A" // 000 4-byte signature: 56 42 4D 1A "VBM\x1A"
@ -2249,7 +2247,7 @@ namespace BizHawk.MultiClient
{ {
errorMsg = ""; errorMsg = "";
warningMsg = ""; warningMsg = "";
Movie m = new Movie(path + "." + Global.Config.MovieExtension, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(path + "." + Global.Config.MovieExtension);
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs); BinaryReader r = new BinaryReader(fs);
// 000 12-byte signature: "VirtuaNES MV" // 000 12-byte signature: "VirtuaNES MV"
@ -2470,7 +2468,7 @@ namespace BizHawk.MultiClient
{ {
errorMsg = ""; errorMsg = "";
warningMsg = ""; warningMsg = "";
Movie m = new Movie(path + "." + Global.Config.MovieExtension, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(path + "." + Global.Config.MovieExtension);
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs); BinaryReader r = new BinaryReader(fs);
// 000 3-byte signature: 5A 4D 56 "ZMV" // 000 3-byte signature: 5A 4D 56 "ZMV"

View File

@ -1,10 +1,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
//TODO: what is this object really trying to accomplish? COnsider making it a collection (ICollection, IEnumerable perhaps)
/// <summary> /// <summary>
/// Represents the controller key presses of a movie /// Represents the controller key presses of a movie
/// </summary> /// </summary>
@ -129,12 +127,12 @@ namespace BizHawk.Client.Common
if (frame <= StateFirstIndex) if (frame <= StateFirstIndex)
{ {
_state_records.Clear(); _state_records.Clear();
//Global.MovieSession.Movie.RewindToFrame(0); //TODO: unbreak this, also don't do it this way Global.MovieSession.Movie.RewindToFrame(0);
} }
else else
{ {
_state_records.RemoveRange(frame - StateFirstIndex, StateLastIndex - frame + 1); _state_records.RemoveRange(frame - StateFirstIndex, StateLastIndex - frame + 1);
//Global.MovieSession.Movie.RewindToFrame(frame); //TODO: unbreak this, also don't do it this way Global.MovieSession.Movie.RewindToFrame(frame);
} }
} }
} }

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
public static class MnemonicConstants public static class MnemonicConstants
{ {

View File

@ -1,4 +1,4 @@
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
public class MovieSession public class MovieSession
{ {

View File

@ -1,4 +1,4 @@
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
public class MultitrackRecording public class MultitrackRecording
{ {

View File

@ -5,8 +5,6 @@ using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.IO; using System.IO;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class PlayMovie : Form public partial class PlayMovie : Form
@ -67,12 +65,12 @@ namespace BizHawk.MultiClient
//Import file if necessary //Import file if necessary
GlobalWinF.MainForm.StartNewMovie(MovieList[MovieView.SelectedIndices[0]], false); Global.MainForm.StartNewMovie(MovieList[MovieView.SelectedIndices[0]], false);
} }
private void OK_Click(object sender, EventArgs e) private void OK_Click(object sender, EventArgs e)
{ {
GlobalWinF.MainForm.ReadOnly = ReadOnlyCheckBox.Checked; Global.MainForm.ReadOnly = ReadOnlyCheckBox.Checked;
Run(); Run();
Close(); Close();
} }
@ -83,9 +81,9 @@ namespace BizHawk.MultiClient
string filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*"; string filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*";
ofd.Filter = filter; ofd.Filter = filter;
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
var result = ofd.ShowDialog(); var result = ofd.ShowDialog();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (result == DialogResult.OK) if (result == DialogResult.OK)
{ {
var file = new FileInfo(ofd.FileName); var file = new FileInfo(ofd.FileName);
@ -95,7 +93,7 @@ namespace BizHawk.MultiClient
{ {
if (file.Extension.ToUpper() == "STATE") if (file.Extension.ToUpper() == "STATE")
{ {
Movie m = new Movie(file.FullName, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(file.FullName);
m.LoadMovie(); //State files will have to load everything unfortunately m.LoadMovie(); //State files will have to load everything unfortunately
if (m.Frames == 0) if (m.Frames == 0)
{ {
@ -124,7 +122,7 @@ namespace BizHawk.MultiClient
int x = IsDuplicate(filename); int x = IsDuplicate(filename);
if (x == 0) if (x == 0)
{ {
Movie m = new Movie(file.CanonicalFullPath, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(file.CanonicalFullPath);
m.LoadMovie(); //State files will have to load everything unfortunately m.LoadMovie(); //State files will have to load everything unfortunately
if (m.Frames > 0) if (m.Frames > 0)
{ {
@ -176,7 +174,7 @@ namespace BizHawk.MultiClient
private void PreLoadMovieFile(HawkFile path, bool force) private void PreLoadMovieFile(HawkFile path, bool force)
{ {
Movie m = new Movie(path.CanonicalFullPath, GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(path.CanonicalFullPath);
m.PreLoadText(); m.PreLoadText();
if (path.Extension == ".FM2") if (path.Extension == ".FM2")
{ {
@ -389,7 +387,7 @@ namespace BizHawk.MultiClient
} }
break; break;
case MovieHeader.EMULATIONVERSION: case MovieHeader.EMULATIONVERSION:
if (kvp.Value != GlobalWinF.MainForm.GetEmuVersion()) if (kvp.Value != Global.MainForm.GetEmuVersion())
{ {
item.BackColor = Color.Yellow; item.BackColor = Color.Yellow;
} }

View File

@ -1,8 +1,6 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using System.IO; using System.IO;
using BizHawk.Client.Common;
using BizHawk.Emulation.Consoles.GB; using BizHawk.Emulation.Consoles.GB;
using BizHawk.Emulation.Consoles.Nintendo.SNES; using BizHawk.Emulation.Consoles.Nintendo.SNES;
using BizHawk.Emulation.Consoles.Sega; using BizHawk.Emulation.Consoles.Sega;
@ -58,11 +56,11 @@ namespace BizHawk.MultiClient
} }
MovieToRecord = new Movie(path, GlobalWinF.MainForm.GetEmuVersion()); MovieToRecord = new Movie(path);
//Header //Header
MovieToRecord.Header.SetHeaderLine(MovieHeader.AUTHOR, AuthorBox.Text); MovieToRecord.Header.SetHeaderLine(MovieHeader.AUTHOR, AuthorBox.Text);
MovieToRecord.Header.SetHeaderLine(MovieHeader.EMULATIONVERSION, GlobalWinF.MainForm.GetEmuVersion()); MovieToRecord.Header.SetHeaderLine(MovieHeader.EMULATIONVERSION, Global.MainForm.GetEmuVersion());
MovieToRecord.Header.SetHeaderLine(MovieHeader.MOVIEVERSION, MovieHeader.MovieVersion); MovieToRecord.Header.SetHeaderLine(MovieHeader.MOVIEVERSION, MovieHeader.MovieVersion);
MovieToRecord.Header.SetHeaderLine(MovieHeader.GUID, MovieHeader.MakeGUID()); MovieToRecord.Header.SetHeaderLine(MovieHeader.GUID, MovieHeader.MakeGUID());
MovieToRecord.Header.SetHeaderLine(MovieHeader.PLATFORM, Global.Game.System); MovieToRecord.Header.SetHeaderLine(MovieHeader.PLATFORM, Global.Game.System);
@ -162,7 +160,7 @@ namespace BizHawk.MultiClient
} }
} }
} }
GlobalWinF.MainForm.StartNewMovie(MovieToRecord, true); Global.MainForm.StartNewMovie(MovieToRecord, true);
Global.Config.UseDefaultAuthor = DefaultAuthorCheckBox.Checked; Global.Config.UseDefaultAuthor = DefaultAuthorCheckBox.Checked;
if (DefaultAuthorCheckBox.Checked) if (DefaultAuthorCheckBox.Checked)
@ -196,9 +194,9 @@ namespace BizHawk.MultiClient
string filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*"; string filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*";
sfd.Filter = filter; sfd.Filter = filter;
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
var result = sfd.ShowDialog(); var result = sfd.ShowDialog();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (result == DialogResult.OK) if (result == DialogResult.OK)
{ {
filename = sfd.FileName; filename = sfd.FileName;

View File

@ -0,0 +1,44 @@
using System;
namespace BizHawk.MultiClient
{
public class Subtitle
{
public string Message;
public int Frame;
public int X;
public int Y;
public int Duration;
public uint Color;
public Subtitle()
{
Message = "";
X = 0;
Y = 0;
Duration = 120;
Frame = 0;
Color = 0xFFFFFFFF;
}
public Subtitle(string message, int x, int y, int dur, int frame, UInt32 color)
{
Message = message;
Frame = frame;
X = x;
Y = y;
Duration = dur;
Color = color;
}
public Subtitle(Subtitle s)
{
Message = s.Message;
Frame = s.Frame;
X = s.X;
Y = s.Y;
Duration = s.Duration;
Color = s.Color;
}
}
}

View File

@ -1,44 +1,62 @@
using System; using System.Collections.Generic;
using System.Collections;
using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
public class SubtitleList : IEnumerable<Subtitle> public class SubtitleList
{ {
private readonly List<Subtitle> _subtitles = new List<Subtitle>(); private readonly List<Subtitle> subs = new List<Subtitle>();
public SubtitleList() { } public SubtitleList()
{
public SubtitleList(SubtitleList subtitles) }
public SubtitleList(Movie m)
{ {
foreach (var subtitle in subtitles) if (m != null && m.Subtitles.Count == 0)
{ {
_subtitles.Add(new Subtitle(subtitle)); //TODO: Multiclient.EditSubtitlesForm needs a deep copy here, refactor it so that it doesn't return;
}
for (int x = 0; x < m.Subtitles.Count; x++)
{
Subtitle s = new Subtitle(m.Subtitles.GetSubtitleByIndex(x));
subs.Add(s);
} }
} }
public IEnumerator<Subtitle> GetEnumerator() public Subtitle GetSubtitleByIndex(int index)
{ {
return _subtitles.GetEnumerator(); if (index >= subs.Count || index < 0) return new Subtitle();
return subs[index];
} }
IEnumerator IEnumerable.GetEnumerator() public string GetSubtitleText(int index)
{ {
return GetEnumerator(); if (index >= subs.Count || index < 0)
{
return "";
} }
public Subtitle this[int index] StringBuilder sb = new StringBuilder("subtitle ");
{ sb.Append(subs[index].Frame.ToString());
get sb.Append(" ");
{ sb.Append(subs[index].X.ToString());
return _subtitles[index]; sb.Append(" ");
} sb.Append(subs[index].Y.ToString());
sb.Append(" ");
sb.Append(subs[index].Duration.ToString());
sb.Append(" ");
sb.Append(string.Format("{0:X8}", subs[index].Color));
sb.Append(" ");
sb.Append(subs[index].Message);
return sb.ToString();
} }
/// <summary> /// <summary>
@ -48,42 +66,45 @@ namespace BizHawk.Client.Common
/// <returns></returns> /// <returns></returns>
public string GetSubtitleMessage(int frame) public string GetSubtitleMessage(int frame)
{ {
if (_subtitles.Count == 0) return ""; if (subs.Count == 0) return "";
foreach (Subtitle t in _subtitles) foreach (Subtitle t in subs)
{ {
if (frame >= t.Frame && frame <= t.Frame + t.Duration) if (frame >= t.Frame && frame <= t.Frame + t.Duration)
{ {
return t.Message; return t.Message;
} }
} }
return String.Empty; return "";
} }
public Subtitle GetSubtitle(int frame) public Subtitle GetSubtitle(int frame)
{ {
if (_subtitles.Any()) if (subs.Count == 0) return new Subtitle();
{
foreach (Subtitle t in _subtitles) foreach (Subtitle t in subs)
{ {
if (frame >= t.Frame && frame <= t.Frame + t.Duration) if (frame >= t.Frame && frame <= t.Frame + t.Duration)
{ {
return t; return t;
} }
} }
}
return new Subtitle(); return new Subtitle();
} }
public List<Subtitle> GetSubtitles(int frame) public List<Subtitle> GetSubtitles(int frame)
{ {
return _subtitles.Where(t => frame >= t.Frame && frame <= t.Frame + t.Duration).ToList(); if (subs.Count == 0)
{
return null;
}
return subs.Where(t => frame >= t.Frame && frame <= t.Frame + t.Duration).ToList();
} }
public int Count public int Count
{ {
get { return _subtitles.Count; } get { return subs.Count; }
} }
//TODO //TODO
@ -98,12 +119,9 @@ namespace BizHawk.Client.Common
/// </summary> /// </summary>
/// <param name="subtitleStr"></param> /// <param name="subtitleStr"></param>
/// <returns></returns> /// <returns></returns>
public bool AddSubtitle(string subtitleStr) //TODO: refactor with String.Split public bool AddSubtitle(string subtitleStr)
{ {
if (!String.IsNullOrWhiteSpace(subtitleStr)) if (subtitleStr.Length == 0) return false;
{
return false;
}
Subtitle s = new Subtitle(); Subtitle s = new Subtitle();
@ -181,33 +199,34 @@ namespace BizHawk.Client.Common
} }
s.Message = str; s.Message = str;
_subtitles.Add(s); subs.Add(s);
return true; return true;
} }
public void AddSubtitle(Subtitle s) public void AddSubtitle(Subtitle s)
{ {
_subtitles.Add(s); subs.Add(s);
} }
public void Clear() public void ClearSubtitles()
{ {
_subtitles.Clear(); subs.Clear();
} }
public void RemoveAt(int index) public void Remove(int index)
{ {
if (index >= _subtitles.Count) return; if (index >= subs.Count) return;
_subtitles.RemoveAt(index); subs.RemoveAt(index);
} }
public void WriteText(StreamWriter sw) public void WriteText(StreamWriter sw)
{ {
foreach(var subtitle in _subtitles) int length = subs.Count;
for (int x = 0; x < length; x++)
{ {
sw.WriteLine(subtitle.ToString()); sw.WriteLine(GetSubtitleText(x));
} }
} }
} }

View File

@ -2,8 +2,6 @@
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class SubtitleMaker : Form public partial class SubtitleMaker : Form

View File

@ -1,6 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
public class Cheat public class Cheat
{ {
@ -28,14 +31,14 @@ namespace BizHawk.Client.Common
{ {
_enabled = cheat.Enabled; _enabled = cheat.Enabled;
_watch = Watch.GenerateWatch(cheat.Domain, _watch = Watch.GenerateWatch(cheat.Domain,
cheat.Address ?? 0, cheat.Address.Value,
cheat.Size, cheat.Size,
cheat.Type, cheat.Type,
cheat.Name, cheat.Name,
cheat.BigEndian ?? false cheat.BigEndian.Value
); );
_compare = cheat.Compare; _compare = cheat.Compare;
_val = cheat.Value ?? 0; _val = cheat.Value.Value;
Pulse(); Pulse();
} }
@ -200,12 +203,12 @@ namespace BizHawk.Client.Common
case Watch.WatchSize.Separator: case Watch.WatchSize.Separator:
return false; return false;
case Watch.WatchSize.Byte: case Watch.WatchSize.Byte:
return (_watch.Address ?? 0) == addr; return _watch.Address.Value == addr;
case Watch.WatchSize.Word: case Watch.WatchSize.Word:
return (addr == (_watch.Address ?? 0)) || (addr == (_watch.Address ?? 0) + 1); return (addr == _watch.Address.Value) || (addr == _watch.Address + 1);
case Watch.WatchSize.DWord: case Watch.WatchSize.DWord:
return (addr == (_watch.Address ?? 0)) || (addr == (_watch.Address ?? 0) + 1) || return (addr == _watch.Address.Value) || (addr == _watch.Address + 1) ||
(addr == (_watch.Address ?? 0) + 2) || (addr == (_watch.Address ?? 0) + 3); (addr == _watch.Address.Value + 2) || (addr == _watch.Address + 3);
} }
} }
@ -239,7 +242,7 @@ namespace BizHawk.Client.Common
#region private parts #region private parts
private readonly Watch _watch; private Watch _watch;
private int? _compare; private int? _compare;
private int _val; private int _val;
private bool _enabled; private bool _enabled;

View File

@ -231,7 +231,7 @@
// //
// CompareBox // CompareBox
// //
this.CompareBox.ByteSize = BizHawk.Client.Common.Watch.WatchSize.Byte; this.CompareBox.ByteSize = BizHawk.MultiClient.Watch.WatchSize.Byte;
this.CompareBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; this.CompareBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.CompareBox.Location = new System.Drawing.Point(113, 91); this.CompareBox.Location = new System.Drawing.Point(113, 91);
this.CompareBox.MaxLength = 2; this.CompareBox.MaxLength = 2;
@ -240,11 +240,11 @@
this.CompareBox.Size = new System.Drawing.Size(65, 20); this.CompareBox.Size = new System.Drawing.Size(65, 20);
this.CompareBox.TabIndex = 15; this.CompareBox.TabIndex = 15;
this.CompareBox.Text = "00"; this.CompareBox.Text = "00";
this.CompareBox.Type = BizHawk.Client.Common.Watch.DisplayType.Hex; this.CompareBox.Type = BizHawk.MultiClient.Watch.DisplayType.Hex;
// //
// ValueBox // ValueBox
// //
this.ValueBox.ByteSize = BizHawk.Client.Common.Watch.WatchSize.Byte; this.ValueBox.ByteSize = BizHawk.MultiClient.Watch.WatchSize.Byte;
this.ValueBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; this.ValueBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.ValueBox.Location = new System.Drawing.Point(113, 65); this.ValueBox.Location = new System.Drawing.Point(113, 65);
this.ValueBox.MaxLength = 2; this.ValueBox.MaxLength = 2;
@ -253,7 +253,7 @@
this.ValueBox.Size = new System.Drawing.Size(65, 20); this.ValueBox.Size = new System.Drawing.Size(65, 20);
this.ValueBox.TabIndex = 12; this.ValueBox.TabIndex = 12;
this.ValueBox.Text = "00"; this.ValueBox.Text = "00";
this.ValueBox.Type = BizHawk.Client.Common.Watch.DisplayType.Hex; this.ValueBox.Type = BizHawk.MultiClient.Watch.DisplayType.Hex;
// //
// CheatEdit // CheatEdit
// //

View File

@ -8,8 +8,6 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class CheatEdit : UserControl public partial class CheatEdit : UserControl

View File

@ -9,7 +9,6 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
using BizHawk.Emulation.Consoles.Nintendo.SNES; using BizHawk.Emulation.Consoles.Nintendo.SNES;
using BizHawk.Emulation.Consoles.Nintendo; using BizHawk.Emulation.Consoles.Nintendo;
using BizHawk.Emulation.Consoles.Sega; using BizHawk.Emulation.Consoles.Sega;
@ -112,7 +111,6 @@ namespace BizHawk.MultiClient
Global.Config.RecentWatches.Add(path); Global.Config.RecentWatches.Add(path);
UpdateListView(); UpdateListView();
UpdateMessageLabel(); UpdateMessageLabel();
ToolHelpers.UpdateCheatRelatedTools();
} }
} }
} }
@ -142,9 +140,9 @@ namespace BizHawk.MultiClient
if (Global.CheatList.Changes) if (Global.CheatList.Changes)
{ {
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
DialogResult result = MessageBox.Show("Save Changes?", "Cheats", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3); DialogResult result = MessageBox.Show("Save Changes?", "Cheats", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (result == DialogResult.Yes) if (result == DialogResult.Yes)
{ {
Global.CheatList.Save(); Global.CheatList.Save();
@ -178,24 +176,10 @@ namespace BizHawk.MultiClient
UpdateListView(); UpdateListView();
UpdateMessageLabel(); UpdateMessageLabel();
Global.Config.RecentCheats.Add(Global.CheatList.CurrentFileName); Global.Config.RecentCheats.Add(Global.CheatList.CurrentFileName);
ToolHelpers.UpdateCheatRelatedTools();
} }
} }
} }
private bool SaveAs()
{
var file = ToolHelpers.GetCheatSaveFileFromUser(Global.CheatList.CurrentFileName);
if (file != null)
{
return Global.CheatList.SaveFile(file.FullName);
}
else
{
return false;
}
}
private void NewCheatForm_Load(object sender, EventArgs e) private void NewCheatForm_Load(object sender, EventArgs e)
{ {
LoadConfigSettings(); LoadConfigSettings();
@ -231,7 +215,6 @@ namespace BizHawk.MultiClient
Global.CheatList.Add(CheatEditor.Cheat); Global.CheatList.Add(CheatEditor.Cheat);
UpdateListView(); UpdateListView();
UpdateMessageLabel(); UpdateMessageLabel();
ToolHelpers.UpdateCheatRelatedTools();
} }
private void EditCheat() private void EditCheat()
@ -420,7 +403,6 @@ namespace BizHawk.MultiClient
} }
UpdateListView(); UpdateListView();
ToolHelpers.UpdateCheatRelatedTools();
} }
private void MoveDown() private void MoveDown()
@ -457,7 +439,6 @@ namespace BizHawk.MultiClient
} }
UpdateListView(); UpdateListView();
ToolHelpers.UpdateCheatRelatedTools();
} }
private void Remove() private void Remove()
@ -570,10 +551,9 @@ namespace BizHawk.MultiClient
if (result) if (result)
{ {
Global.CheatList.NewList(GlobalWinF.MainForm.GenerateDefaultCheatFilename()); Global.CheatList.NewList();
UpdateListView(); UpdateListView();
UpdateMessageLabel(); UpdateMessageLabel();
ToolHelpers.UpdateCheatRelatedTools();
} }
} }
@ -602,7 +582,7 @@ namespace BizHawk.MultiClient
private void OpenMenuItem_Click(object sender, EventArgs e) private void OpenMenuItem_Click(object sender, EventArgs e)
{ {
bool append = sender == AppendMenuItem; bool append = sender == AppendMenuItem;
LoadFile(ToolHelpers.GetCheatFileFromUser(Global.CheatList.CurrentFileName), append); LoadFile(CheatList.GetFileFromUser(Global.CheatList.CurrentFileName), append);
} }
private void SaveMenuItem_Click(object sender, EventArgs e) private void SaveMenuItem_Click(object sender, EventArgs e)
@ -622,7 +602,7 @@ namespace BizHawk.MultiClient
private void SaveAsMenuItem_Click(object sender, EventArgs e) private void SaveAsMenuItem_Click(object sender, EventArgs e)
{ {
if (SaveAs()) if (Global.CheatList.SaveAs())
{ {
UpdateMessageLabel(saved: true); UpdateMessageLabel(saved: true);
} }
@ -674,7 +654,6 @@ namespace BizHawk.MultiClient
UpdateListView(); UpdateListView();
UpdateMessageLabel(); UpdateMessageLabel();
ToolHelpers.UpdateCheatRelatedTools();
} }
private void InsertSeparatorMenuItem_Click(object sender, EventArgs e) private void InsertSeparatorMenuItem_Click(object sender, EventArgs e)
@ -690,7 +669,6 @@ namespace BizHawk.MultiClient
UpdateListView(); UpdateListView();
UpdateMessageLabel(); UpdateMessageLabel();
ToolHelpers.UpdateCheatRelatedTools();
} }
private void MoveUpMenuItem_Click(object sender, EventArgs e) private void MoveUpMenuItem_Click(object sender, EventArgs e)
@ -719,12 +697,11 @@ namespace BizHawk.MultiClient
private void DisableAllCheatsMenuItem_Click(object sender, EventArgs e) private void DisableAllCheatsMenuItem_Click(object sender, EventArgs e)
{ {
Global.CheatList.DisableAll(); Global.CheatList.DisableAll();
ToolHelpers.UpdateCheatRelatedTools();
} }
private void OpenGameGenieEncoderDecoderMenuItem_Click(object sender, EventArgs e) private void OpenGameGenieEncoderDecoderMenuItem_Click(object sender, EventArgs e)
{ {
GlobalWinF.MainForm.LoadGameGenieEC(); Global.MainForm.LoadGameGenieEC();
} }
#endregion #endregion

View File

@ -4,15 +4,17 @@ using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms;
namespace BizHawk.Client.Common namespace BizHawk.MultiClient
{ {
public class CheatList : IEnumerable<Cheat> public class CheatList : IEnumerable<Cheat>
{ {
private List<Cheat> _cheatList = new List<Cheat>(); private List<Cheat> _cheatList = new List<Cheat>();
private string _currentFileName = String.Empty; private string _currentFileName = String.Empty;
private bool _changes; private bool _changes = false;
private string _defaultFileName = String.Empty;
public CheatList() { }
public IEnumerator<Cheat> GetEnumerator() public IEnumerator<Cheat> GetEnumerator()
{ {
@ -43,7 +45,7 @@ namespace BizHawk.Client.Common
/// <returns></returns> /// <returns></returns>
public bool AttemptToLoadCheatFile() public bool AttemptToLoadCheatFile()
{ {
var file = new FileInfo(_defaultFileName); var file = new FileInfo(GenerateDefaultFilename());
if (file.Exists) if (file.Exists)
{ {
@ -75,12 +77,12 @@ namespace BizHawk.Client.Common
get { return _cheatList.Count(x => x.Enabled); } get { return _cheatList.Count(x => x.Enabled); }
} }
public void NewList(string defaultFileName) public void NewList()
{ {
_defaultFileName = defaultFileName;
_cheatList.Clear(); _cheatList.Clear();
_currentFileName = String.Empty; _currentFileName = String.Empty;
_changes = false; _changes = false;
ToolHelpers.UpdateCheatRelatedTools();
} }
public void Update() public void Update()
@ -100,6 +102,7 @@ namespace BizHawk.Client.Common
} }
_changes = true; _changes = true;
ToolHelpers.UpdateCheatRelatedTools();
} }
public void Insert(int index, Cheat c) public void Insert(int index, Cheat c)
@ -114,12 +117,14 @@ namespace BizHawk.Client.Common
} }
_changes = true; _changes = true;
ToolHelpers.UpdateCheatRelatedTools();
} }
public void Remove(Cheat c) public void Remove(Cheat c)
{ {
_changes = true; _changes = true;
_cheatList.Remove(c); _cheatList.Remove(c);
ToolHelpers.UpdateCheatRelatedTools();
} }
public void Remove(Watch w) public void Remove(Watch w)
@ -130,6 +135,7 @@ namespace BizHawk.Client.Common
{ {
_changes = true; _changes = true;
_cheatList.Remove(cheat); _cheatList.Remove(cheat);
ToolHelpers.UpdateCheatRelatedTools();
} }
} }
@ -140,6 +146,7 @@ namespace BizHawk.Client.Common
{ {
_cheatList.Remove(cheat); _cheatList.Remove(cheat);
} }
ToolHelpers.UpdateCheatRelatedTools();
} }
public bool Changes public bool Changes
@ -151,18 +158,21 @@ namespace BizHawk.Client.Common
{ {
_changes = true; _changes = true;
_cheatList.Clear(); _cheatList.Clear();
ToolHelpers.UpdateCheatRelatedTools();
} }
public void DisableAll() public void DisableAll()
{ {
_changes = true; _changes = true;
_cheatList.ForEach(x => x.Disable()); _cheatList.ForEach(x => x.Disable());
ToolHelpers.UpdateCheatRelatedTools();
} }
public void EnableAll() public void EnableAll()
{ {
_changes = true; _changes = true;
_cheatList.ForEach(x => x.Enable()); _cheatList.ForEach(x => x.Enable());
ToolHelpers.UpdateCheatRelatedTools();
} }
public bool IsActive(MemoryDomain domain, int address) public bool IsActive(MemoryDomain domain, int address)
@ -190,7 +200,7 @@ namespace BizHawk.Client.Common
{ {
if (String.IsNullOrWhiteSpace(_currentFileName)) if (String.IsNullOrWhiteSpace(_currentFileName))
{ {
_currentFileName = _defaultFileName; _currentFileName = GenerateDefaultFilename();
} }
SaveFile(_currentFileName); SaveFile(_currentFileName);
@ -206,60 +216,20 @@ namespace BizHawk.Client.Common
{ {
if (String.IsNullOrWhiteSpace(_currentFileName)) if (String.IsNullOrWhiteSpace(_currentFileName))
{ {
_currentFileName = _defaultFileName; _currentFileName = GenerateDefaultFilename();
} }
return SaveFile(_currentFileName); return SaveFile(_currentFileName);
} }
public bool SaveFile(string path) public bool SaveAs()
{ {
try var file = GetSaveFileFromUser();
if (file != null)
{ {
FileInfo file = new FileInfo(path); return SaveFile(file.FullName);
if (file.Directory != null && !file.Directory.Exists)
{
file.Directory.Create();
}
using (StreamWriter sw = new StreamWriter(path))
{
StringBuilder sb = new StringBuilder();
foreach (var cheat in _cheatList)
{
if (cheat.IsSeparator)
{
sb.AppendLine("----");
} }
else else
{
//Set to hex for saving
cheat.SetType(Watch.DisplayType.Hex);
sb
.Append(cheat.AddressStr).Append('\t')
.Append(cheat.ValueStr).Append('\t')
.Append(cheat.Compare.HasValue ? cheat.Compare.Value.ToString() : "N").Append('\t')
.Append(cheat.Domain != null ? cheat.Domain.Name : String.Empty).Append('\t')
.Append(cheat.Enabled ? '1' : '0').Append('\t')
.Append(cheat.Name).Append('\t')
.Append(cheat.SizeAsChar).Append('\t')
.Append(cheat.TypeAsChar).Append('\t')
.Append((cheat.BigEndian ?? false) ? '1' : '0').Append('\t')
.AppendLine();
}
}
sw.WriteLine(sb.ToString());
}
_changes = false;
_currentFileName = path;
Global.Config.RecentCheats.Add(_currentFileName);
return true;
}
catch
{ {
return false; return false;
} }
@ -301,48 +271,52 @@ namespace BizHawk.Client.Common
} }
else else
{ {
int? compare; int ADDR, VALUE;
Watch.WatchSize size = Watch.WatchSize.Byte; int? COMPARE;
Watch.DisplayType type = Watch.DisplayType.Hex; MemoryDomain DOMAIN;
bool ENABLED;
string NAME;
Watch.WatchSize SIZE = Watch.WatchSize.Byte;
Watch.DisplayType TYPE = Watch.DisplayType.Hex;
bool BIGENDIAN = false; bool BIGENDIAN = false;
if (s.Length < 6) continue; if (s.Length < 6) continue;
//NewCheat c = new NewCheat( //NewCheat c = new NewCheat(
string[] vals = s.Split('\t'); string[] vals = s.Split('\t');
int ADDR = Int32.Parse(vals[0], NumberStyles.HexNumber); ADDR = Int32.Parse(vals[0], NumberStyles.HexNumber);
int value = Int32.Parse(vals[1], NumberStyles.HexNumber); VALUE = Int32.Parse(vals[1], NumberStyles.HexNumber);
if (vals[2] == "N") if (vals[2] == "N")
{ {
compare = null; COMPARE = null;
} }
else else
{ {
compare = Int32.Parse(vals[2], NumberStyles.HexNumber); COMPARE = Int32.Parse(vals[2], NumberStyles.HexNumber);
} }
MemoryDomain domain = DomainByName(vals[3]); DOMAIN = ToolHelpers.DomainByName(vals[3]);
bool ENABLED = vals[4] == "1"; ENABLED = vals[4] == "1";
string name = vals[5]; NAME = vals[5];
//For backwards compatibility, don't assume these values exist //For backwards compatibility, don't assume these values exist
if (vals.Length > 6) if (vals.Length > 6)
{ {
size = Watch.SizeFromChar(vals[6][0]); SIZE = Watch.SizeFromChar(vals[6][0]);
type = Watch.DisplayTypeFromChar(vals[7][0]); TYPE = Watch.DisplayTypeFromChar(vals[7][0]);
BIGENDIAN = vals[8] == "1"; BIGENDIAN = vals[8] == "1";
} }
Watch w = Watch.GenerateWatch( Watch w = Watch.GenerateWatch(
domain, DOMAIN,
ADDR, ADDR,
size, SIZE,
type, TYPE,
name, NAME,
BIGENDIAN BIGENDIAN
); );
Cheat c = new Cheat(w, value, compare, !Global.Config.DisableCheatsOnLoad && ENABLED); Cheat c = new Cheat(w, VALUE, COMPARE, Global.Config.DisableCheatsOnLoad ? false : ENABLED);
_cheatList.Add(c); _cheatList.Add(c);
} }
} }
@ -353,6 +327,7 @@ namespace BizHawk.Client.Common
} }
} }
Global.MainForm.UpdateCheatStatus();
return true; return true;
} }
@ -365,7 +340,7 @@ namespace BizHawk.Client.Common
{ {
switch (column) switch (column)
{ {
case NAME: case Cheats.NAME:
if (reverse) if (reverse)
{ {
_cheatList = _cheatList _cheatList = _cheatList
@ -381,7 +356,7 @@ namespace BizHawk.Client.Common
.ToList(); .ToList();
} }
break; break;
case ADDRESS: case Cheats.ADDRESS:
if (reverse) if (reverse)
{ {
_cheatList = _cheatList _cheatList = _cheatList
@ -397,13 +372,13 @@ namespace BizHawk.Client.Common
.ToList(); .ToList();
} }
break; break;
case VALUE: case Cheats.VALUE:
if (reverse) if (reverse)
{ {
_cheatList = _cheatList _cheatList = _cheatList
.OrderByDescending(x => x.Value ?? 0) .OrderByDescending(x => x.Value ?? 0)
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
else else
@ -411,17 +386,17 @@ namespace BizHawk.Client.Common
_cheatList = _cheatList _cheatList = _cheatList
.OrderBy(x => x.Value ?? 0) .OrderBy(x => x.Value ?? 0)
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
break; break;
case COMPARE: case Cheats.COMPARE:
if (reverse) if (reverse)
{ {
_cheatList = _cheatList _cheatList = _cheatList
.OrderByDescending(x => x.Compare ?? 0) .OrderByDescending(x => x.Compare ?? 0)
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
else else
@ -429,17 +404,17 @@ namespace BizHawk.Client.Common
_cheatList = _cheatList _cheatList = _cheatList
.OrderBy(x => x.Compare ?? 0) .OrderBy(x => x.Compare ?? 0)
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
break; break;
case ON: case Cheats.ON:
if (reverse) if (reverse)
{ {
_cheatList = _cheatList _cheatList = _cheatList
.OrderByDescending(x => x.Enabled) .OrderByDescending(x => x.Enabled)
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
else else
@ -447,17 +422,17 @@ namespace BizHawk.Client.Common
_cheatList = _cheatList _cheatList = _cheatList
.OrderBy(x => x.Enabled) .OrderBy(x => x.Enabled)
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
break; break;
case DOMAIN: case Cheats.DOMAIN:
if (reverse) if (reverse)
{ {
_cheatList = _cheatList _cheatList = _cheatList
.OrderByDescending(x => x.Domain) .OrderByDescending(x => x.Domain)
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
else else
@ -465,17 +440,17 @@ namespace BizHawk.Client.Common
_cheatList = _cheatList _cheatList = _cheatList
.OrderBy(x => x.Domain) .OrderBy(x => x.Domain)
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
break; break;
case SIZE: case Cheats.SIZE:
if (reverse) if (reverse)
{ {
_cheatList = _cheatList _cheatList = _cheatList
.OrderByDescending(x => ((int)x.Size)) .OrderByDescending(x => ((int)x.Size))
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
else else
@ -483,17 +458,17 @@ namespace BizHawk.Client.Common
_cheatList = _cheatList _cheatList = _cheatList
.OrderBy(x => ((int)x.Size)) .OrderBy(x => ((int)x.Size))
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
break; break;
case ENDIAN: case Cheats.ENDIAN:
if (reverse) if (reverse)
{ {
_cheatList = _cheatList _cheatList = _cheatList
.OrderByDescending(x => x.BigEndian) .OrderByDescending(x => x.BigEndian)
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
else else
@ -501,17 +476,17 @@ namespace BizHawk.Client.Common
_cheatList = _cheatList _cheatList = _cheatList
.OrderBy(x => x.BigEndian) .OrderBy(x => x.BigEndian)
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
break; break;
case TYPE: case Cheats.TYPE:
if (reverse) if (reverse)
{ {
_cheatList = _cheatList _cheatList = _cheatList
.OrderByDescending(x => x.Type) .OrderByDescending(x => x.Type)
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
else else
@ -519,39 +494,138 @@ namespace BizHawk.Client.Common
_cheatList = _cheatList _cheatList = _cheatList
.OrderBy(x => x.Type) .OrderBy(x => x.Type)
.ThenBy(x => x.Name) .ThenBy(x => x.Name)
.ThenBy(x => x.Address ?? 0) .ThenBy(x => x.Address.Value)
.ToList(); .ToList();
} }
break; break;
} }
} }
#region Privates #region privates
private static MemoryDomain DomainByName(string name) private string GenerateDefaultFilename()
{ {
//Attempts to find the memory domain by name, if it fails, it defaults to index 0 PathEntry pathEntry = Global.Config.PathEntries[Global.Emulator.SystemId, "Cheats"];
foreach (MemoryDomain domain in Global.Emulator.MemoryDomains) if (pathEntry == null)
{ {
if (domain.Name == name) pathEntry = Global.Config.PathEntries[Global.Emulator.SystemId, "Base"];
}
string path = PathManager.MakeAbsolutePath(pathEntry.Path, Global.Emulator.SystemId);
var f = new FileInfo(path);
if (f.Directory != null && f.Directory.Exists == false)
{ {
return domain; f.Directory.Create();
}
return Path.Combine(path, PathManager.FilesystemSafeName(Global.Game) + ".cht");
}
private bool SaveFile(string path)
{
try
{
FileInfo file = new FileInfo(path);
if (file.Directory != null && !file.Directory.Exists)
{
file.Directory.Create();
}
using (StreamWriter sw = new StreamWriter(path))
{
StringBuilder sb = new StringBuilder();
foreach (var cheat in _cheatList)
{
if (cheat.IsSeparator)
{
sb.AppendLine("----");
}
else
{
//Set to hex for saving
Watch.DisplayType type = cheat.Type;
cheat.SetType(Watch.DisplayType.Hex);
sb
.Append(cheat.AddressStr).Append('\t')
.Append(cheat.ValueStr).Append('\t')
.Append(cheat.Compare.HasValue ? cheat.Compare.Value.ToString() : "N").Append('\t')
.Append(cheat.Domain != null ? cheat.Domain.Name : String.Empty).Append('\t')
.Append(cheat.Enabled ? '1' : '0').Append('\t')
.Append(cheat.Name).Append('\t')
.Append(cheat.SizeAsChar).Append('\t')
.Append(cheat.TypeAsChar).Append('\t')
.Append(cheat.BigEndian.Value ? '1' : '0').Append('\t')
.AppendLine();
} }
} }
return Global.Emulator.MainMemory; sw.WriteLine(sb.ToString());
}
_changes = false;
_currentFileName = path;
Global.Config.RecentCheats.Add(_currentFileName);
return true;
}
catch
{
return false;
}
} }
#endregion #endregion
public const string NAME = "NamesColumn"; #region File Handling
public const string ADDRESS = "AddressColumn";
public const string VALUE = "ValueColumn"; public static FileInfo GetFileFromUser(string currentFile)
public const string COMPARE = "CompareColumn"; {
public const string ON = "OnColumn"; var ofd = new OpenFileDialog();
public const string DOMAIN = "DomainColumn"; if (!String.IsNullOrWhiteSpace(currentFile))
public const string SIZE = "SizeColumn"; {
public const string ENDIAN = "EndianColumn"; ofd.FileName = Path.GetFileNameWithoutExtension(currentFile);
public const string TYPE = "DisplayTypeColumn"; }
ofd.InitialDirectory = PathManager.GetCheatsPath(Global.Game);
ofd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*";
ofd.RestoreDirectory = true;
Global.Sound.StopSound();
var result = ofd.ShowDialog();
Global.Sound.StartSound();
if (result != DialogResult.OK)
return null;
var file = new FileInfo(ofd.FileName);
return file;
}
private FileInfo GetSaveFileFromUser()
{
var sfd = new SaveFileDialog();
if (!String.IsNullOrWhiteSpace(_currentFileName))
{
sfd.FileName = Path.GetFileNameWithoutExtension(_currentFileName);
}
else if (!(Global.Emulator is NullEmulator))
{
sfd.FileName = PathManager.FilesystemSafeName(Global.Game);
}
sfd.InitialDirectory = PathManager.GetCheatsPath(Global.Game);
sfd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*";
sfd.RestoreDirectory = true;
Global.Sound.StopSound();
var result = sfd.ShowDialog();
Global.Sound.StartSound();
if (result != DialogResult.OK)
{
return null;
}
var file = new FileInfo(sfd.FileName);
Global.Config.LastRomPath = file.DirectoryName;
return file;
}
#endregion
} }
} }

View File

@ -3,8 +3,6 @@ using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Emulation.Consoles.GB; using BizHawk.Emulation.Consoles.GB;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient.GBtools namespace BizHawk.MultiClient.GBtools
{ {
public partial class CGBColorChooserForm : Form public partial class CGBColorChooserForm : Form

View File

@ -4,8 +4,6 @@ using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using System.IO; using System.IO;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient.GBtools namespace BizHawk.MultiClient.GBtools
{ {
public partial class ColorChooserForm : Form public partial class ColorChooserForm : Form

View File

@ -7,8 +7,6 @@ using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient.GBtools namespace BizHawk.MultiClient.GBtools
{ {
public partial class DualGBFileSelector : UserControl public partial class DualGBFileSelector : UserControl

View File

@ -3,8 +3,6 @@ using System.Drawing;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient.GBtools namespace BizHawk.MultiClient.GBtools
{ {
public partial class GBGPUView : Form public partial class GBGPUView : Form
@ -957,9 +955,9 @@ namespace BizHawk.MultiClient.GBtools
dlg.FullOpen = true; dlg.FullOpen = true;
dlg.Color = spriteback; dlg.Color = spriteback;
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
var result = dlg.ShowDialog(); var result = dlg.ShowDialog();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (result == DialogResult.OK) if (result == DialogResult.OK)
{ {
// force full opaque // force full opaque

View File

@ -5,8 +5,6 @@ using System.Windows.Forms;
using System.Globalization; using System.Globalization;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class GBGameGenie : Form public partial class GBGameGenie : Form
@ -413,8 +411,6 @@ namespace BizHawk.MultiClient
VALUE, VALUE,
COMPARE, COMPARE,
enabled: true)); enabled: true));
ToolHelpers.UpdateCheatRelatedTools();
} }
} }

View File

@ -3,8 +3,6 @@ using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.MultiClient.GBtools; using BizHawk.MultiClient.GBtools;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient.GBAtools namespace BizHawk.MultiClient.GBAtools
{ {
public partial class GBAGPUView : Form public partial class GBAGPUView : Form

View File

@ -4,8 +4,6 @@ using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using System.Globalization; using System.Globalization;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using BizHawk.Client.Common;
using BizHawk.Emulation.Consoles.Sega; using BizHawk.Emulation.Consoles.Sega;
#pragma warning disable 675 //TOOD: fix the potential problem this is masking #pragma warning disable 675 //TOOD: fix the potential problem this is masking
@ -278,8 +276,6 @@ namespace BizHawk.MultiClient
compare: null, compare: null,
enabled: true enabled: true
)); ));
ToolHelpers.UpdateCheatRelatedTools();
} }
} }

View File

@ -1,8 +1,6 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class HexColors_Form : Form public partial class HexColors_Form : Form
@ -27,8 +25,8 @@ namespace BizHawk.MultiClient
if (colorDialog1.ShowDialog() == DialogResult.OK) if (colorDialog1.ShowDialog() == DialogResult.OK)
{ {
Global.Config.HexBackgrndColor = colorDialog1.Color; Global.Config.HexBackgrndColor = colorDialog1.Color;
GlobalWinF.MainForm.HexEditor1.Header.BackColor = colorDialog1.Color; Global.MainForm.HexEditor1.Header.BackColor = colorDialog1.Color;
GlobalWinF.MainForm.HexEditor1.MemoryViewerBox.BackColor = Global.Config.HexBackgrndColor; Global.MainForm.HexEditor1.MemoryViewerBox.BackColor = Global.Config.HexBackgrndColor;
HexBackgrnd.BackColor = colorDialog1.Color; HexBackgrnd.BackColor = colorDialog1.Color;
} }
} }
@ -38,8 +36,8 @@ namespace BizHawk.MultiClient
if (colorDialog1.ShowDialog() == DialogResult.OK) if (colorDialog1.ShowDialog() == DialogResult.OK)
{ {
Global.Config.HexForegrndColor = colorDialog1.Color; Global.Config.HexForegrndColor = colorDialog1.Color;
GlobalWinF.MainForm.HexEditor1.Header.ForeColor = colorDialog1.Color; Global.MainForm.HexEditor1.Header.ForeColor = colorDialog1.Color;
GlobalWinF.MainForm.HexEditor1.MemoryViewerBox.ForeColor = Global.Config.HexForegrndColor; Global.MainForm.HexEditor1.MemoryViewerBox.ForeColor = Global.Config.HexForegrndColor;
HexForegrnd.BackColor = colorDialog1.Color; HexForegrnd.BackColor = colorDialog1.Color;
} }
@ -50,7 +48,7 @@ namespace BizHawk.MultiClient
if (colorDialog1.ShowDialog() == DialogResult.OK) if (colorDialog1.ShowDialog() == DialogResult.OK)
{ {
Global.Config.HexMenubarColor = colorDialog1.Color; Global.Config.HexMenubarColor = colorDialog1.Color;
GlobalWinF.MainForm.HexEditor1.menuStrip1.BackColor = Global.Config.HexMenubarColor; Global.MainForm.HexEditor1.menuStrip1.BackColor = Global.Config.HexMenubarColor;
HexMenubar.BackColor = colorDialog1.Color; HexMenubar.BackColor = colorDialog1.Color;
} }
} }

View File

@ -8,8 +8,6 @@ using System.Windows.Forms;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class HexEditor : Form public partial class HexEditor : Form
@ -386,7 +384,7 @@ namespace BizHawk.MultiClient
private bool CurrentROMIsArchive() private bool CurrentROMIsArchive()
{ {
string path = GlobalWinF.MainForm.CurrentlyOpenRom; string path = Global.MainForm.CurrentlyOpenRom;
if (path == null) if (path == null)
{ {
return false; return false;
@ -414,7 +412,7 @@ namespace BizHawk.MultiClient
private byte[] GetRomBytes() private byte[] GetRomBytes()
{ {
string path = GlobalWinF.MainForm.CurrentlyOpenRom; string path = Global.MainForm.CurrentlyOpenRom;
if (path == null) if (path == null)
{ {
return null; return null;
@ -536,9 +534,9 @@ namespace BizHawk.MultiClient
InputPrompt i = new InputPrompt { Text = "Go to Address" }; InputPrompt i = new InputPrompt { Text = "Go to Address" };
i._Location = GetPromptPoint(); i._Location = GetPromptPoint();
i.SetMessage("Enter a hexadecimal value"); i.SetMessage("Enter a hexadecimal value");
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
i.ShowDialog(); i.ShowDialog();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (i.UserOK) if (i.UserOK)
{ {
@ -706,16 +704,16 @@ namespace BizHawk.MultiClient
{ {
if (HighlightedAddress.HasValue || SecondaryHighlightedAddresses.Count > 0) if (HighlightedAddress.HasValue || SecondaryHighlightedAddresses.Count > 0)
{ {
GlobalWinF.MainForm.LoadRamWatch(true); Global.MainForm.LoadRamWatch(true);
} }
if (HighlightedAddress.HasValue) if (HighlightedAddress.HasValue)
{ {
GlobalWinF.MainForm.RamWatch1.AddWatch(MakeWatch(HighlightedAddress.Value)); Global.MainForm.RamWatch1.AddWatch(MakeWatch(HighlightedAddress.Value));
} }
foreach (int i in SecondaryHighlightedAddresses) foreach (int i in SecondaryHighlightedAddresses)
{ {
GlobalWinF.MainForm.RamWatch1.AddWatch(MakeWatch(i)); Global.MainForm.RamWatch1.AddWatch(MakeWatch(i));
} }
} }
@ -753,10 +751,10 @@ namespace BizHawk.MultiClient
poke.SetWatch(Watches); poke.SetWatch(Watches);
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
var result = poke.ShowDialog(); var result = poke.ShowDialog();
UpdateValues(); UpdateValues();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
} }
} }
@ -872,7 +870,6 @@ namespace BizHawk.MultiClient
Global.CheatList.RemoveRange(cheats); Global.CheatList.RemoveRange(cheats);
} }
MemoryViewerBox.Refresh(); MemoryViewerBox.Refresh();
ToolHelpers.UpdateCheatRelatedTools();
} }
private Watch.WatchSize WatchSize private Watch.WatchSize WatchSize
@ -894,10 +891,10 @@ namespace BizHawk.MultiClient
private void UpdateRelatedDialogs() private void UpdateRelatedDialogs()
{ {
GlobalWinF.MainForm.UpdateCheatStatus(); Global.MainForm.UpdateCheatStatus();
GlobalWinF.MainForm.RamSearch1.UpdateValues(); Global.MainForm.RamSearch1.UpdateValues();
GlobalWinF.MainForm.RamWatch1.UpdateValues(); Global.MainForm.RamWatch1.UpdateValues();
GlobalWinF.MainForm.Cheats_UpdateValues(); Global.MainForm.Cheats_UpdateValues();
UpdateValues(); UpdateValues();
} }
@ -1010,9 +1007,9 @@ namespace BizHawk.MultiClient
sfd.Filter = "Text (*.txt)|*.txt|All Files|*.*"; sfd.Filter = "Text (*.txt)|*.txt|All Files|*.*";
sfd.RestoreDirectory = true; sfd.RestoreDirectory = true;
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
var result = sfd.ShowDialog(); var result = sfd.ShowDialog();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (result != DialogResult.OK) if (result != DialogResult.OK)
return null; return null;
var file = new FileInfo(sfd.FileName); var file = new FileInfo(sfd.FileName);
@ -1023,7 +1020,7 @@ namespace BizHawk.MultiClient
{ {
if (Domain.Name == "ROM File") if (Domain.Name == "ROM File")
{ {
string extension = Path.GetExtension(GlobalWinF.MainForm.CurrentlyOpenRom); string extension = Path.GetExtension(Global.MainForm.CurrentlyOpenRom);
return "Binary (*" + extension + ")|*" + extension + "|All Files|*.*"; return "Binary (*" + extension + ")|*" + extension + "|All Files|*.*";
} }
@ -1047,9 +1044,9 @@ namespace BizHawk.MultiClient
sfd.Filter = GetSaveFileFilter(); sfd.Filter = GetSaveFileFilter();
sfd.RestoreDirectory = true; sfd.RestoreDirectory = true;
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
var result = sfd.ShowDialog(); var result = sfd.ShowDialog();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (result != DialogResult.OK) if (result != DialogResult.OK)
return null; return null;
var file = new FileInfo(sfd.FileName); var file = new FileInfo(sfd.FileName);
@ -2062,9 +2059,9 @@ namespace BizHawk.MultiClient
private void setColorsToolStripMenuItem1_Click(object sender, EventArgs e) private void setColorsToolStripMenuItem1_Click(object sender, EventArgs e)
{ {
HexColors_Form h = new HexColors_Form(); HexColors_Form h = new HexColors_Form();
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
h.ShowDialog(); h.ShowDialog();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
} }
private void resetToDefaultToolStripMenuItem1_Click(object sender, EventArgs e) private void resetToDefaultToolStripMenuItem1_Click(object sender, EventArgs e)
@ -2124,7 +2121,7 @@ namespace BizHawk.MultiClient
} }
else else
{ {
FileInfo file = new FileInfo(GlobalWinF.MainForm.CurrentlyOpenRom); FileInfo file = new FileInfo(Global.MainForm.CurrentlyOpenRom);
SaveFileBinary(file); SaveFileBinary(file);
} }
} }

View File

@ -60,12 +60,12 @@ namespace BizHawk.MultiClient
private void Find_Prev_Click(object sender, EventArgs e) private void Find_Prev_Click(object sender, EventArgs e)
{ {
GlobalWinF.MainForm.HexEditor1.FindPrev(GetFindBoxChars(), false); Global.MainForm.HexEditor1.FindPrev(GetFindBoxChars(), false);
} }
private void Find_Next_Click(object sender, EventArgs e) private void Find_Next_Click(object sender, EventArgs e)
{ {
GlobalWinF.MainForm.HexEditor1.FindNext(GetFindBoxChars(), false); Global.MainForm.HexEditor1.FindNext(GetFindBoxChars(), false);
} }
private void ChangeCasing() private void ChangeCasing()
@ -94,7 +94,7 @@ namespace BizHawk.MultiClient
{ {
if (e.KeyData == Keys.Enter) if (e.KeyData == Keys.Enter)
{ {
GlobalWinF.MainForm.HexEditor1.FindNext(GetFindBoxChars(), false); Global.MainForm.HexEditor1.FindNext(GetFindBoxChars(), false);
} }
} }
} }

View File

@ -4,7 +4,6 @@ using System.Windows.Forms;
using System.Text; using System.Text;
using System.Globalization; using System.Globalization;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
@ -518,9 +517,9 @@ namespace BizHawk.MultiClient
{ {
InputPrompt i = new InputPrompt {Text = "Go to Address"}; InputPrompt i = new InputPrompt {Text = "Go to Address"};
i.SetMessage("Enter a hexadecimal value"); i.SetMessage("Enter a hexadecimal value");
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
i.ShowDialog(); i.ShowDialog();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (i.UserOK) if (i.UserOK)
{ {

View File

@ -2,8 +2,6 @@
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
/// <summary> /// <summary>

View File

@ -6,8 +6,6 @@ using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using System.IO; using System.IO;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public partial class LuaConsole : Form public partial class LuaConsole : Form
@ -180,9 +178,9 @@ namespace BizHawk.MultiClient
if (!Directory.Exists(ofd.InitialDirectory)) if (!Directory.Exists(ofd.InitialDirectory))
Directory.CreateDirectory(ofd.InitialDirectory); Directory.CreateDirectory(ofd.InitialDirectory);
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
var result = ofd.ShowDialog(); var result = ofd.ShowDialog();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (result != DialogResult.OK) if (result != DialogResult.OK)
return null; return null;
var file = new FileInfo(ofd.FileName); var file = new FileInfo(ofd.FileName);
@ -710,9 +708,9 @@ namespace BizHawk.MultiClient
private void luaFunctionsListToolStripMenuItem_Click(object sender, EventArgs e) private void luaFunctionsListToolStripMenuItem_Click(object sender, EventArgs e)
{ {
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
new LuaFunctionList().Show(); new LuaFunctionList().Show();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
} }
public bool LoadLuaSession(string path) public bool LoadLuaSession(string path)
@ -922,9 +920,9 @@ namespace BizHawk.MultiClient
} }
sfd.Filter = "Lua Session Files (*.luases)|*.luases|All Files|*.*"; sfd.Filter = "Lua Session Files (*.luases)|*.luases|All Files|*.*";
sfd.RestoreDirectory = true; sfd.RestoreDirectory = true;
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
var result = sfd.ShowDialog(); var result = sfd.ShowDialog();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (result != DialogResult.OK) if (result != DialogResult.OK)
return null; return null;
var file = new FileInfo(sfd.FileName); var file = new FileInfo(sfd.FileName);
@ -1019,9 +1017,9 @@ namespace BizHawk.MultiClient
if (changes) if (changes)
{ {
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
DialogResult result = MessageBox.Show("Save changes to session?", "Lua Console", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3); DialogResult result = MessageBox.Show("Save changes to session?", "Lua Console", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (result == DialogResult.Yes) if (result == DialogResult.Yes)
{ {
if (string.Compare(currentSessionFile, "") == 0) if (string.Compare(currentSessionFile, "") == 0)
@ -1101,7 +1099,7 @@ namespace BizHawk.MultiClient
turnOffAllScriptsToolStripMenuItem.Enabled = luaRunning; turnOffAllScriptsToolStripMenuItem.Enabled = luaRunning;
showRegisteredFunctionsToolStripMenuItem.Enabled = GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.Any(); showRegisteredFunctionsToolStripMenuItem.Enabled = Global.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.Any();
} }
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
@ -1247,7 +1245,7 @@ namespace BizHawk.MultiClient
private void showRegisteredFunctionsToolStripMenuItem_Click(object sender, EventArgs e) private void showRegisteredFunctionsToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.Any()) if (Global.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.Any())
{ {
LuaRegisteredFunctionsList dialog = new LuaRegisteredFunctionsList(); LuaRegisteredFunctionsList dialog = new LuaRegisteredFunctionsList();
dialog.ShowDialog(); dialog.ShowDialog();
@ -1256,7 +1254,7 @@ namespace BizHawk.MultiClient
private void contextMenuStrip2_Opening(object sender, CancelEventArgs e) private void contextMenuStrip2_Opening(object sender, CancelEventArgs e)
{ {
registeredFunctionsToolStripMenuItem.Enabled = GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.Any(); registeredFunctionsToolStripMenuItem.Enabled = Global.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.Any();
} }
} }
} }

View File

@ -3,7 +3,7 @@ using System.Linq;
using System.Text; using System.Text;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient.tools
{ {
public class LuaDocumentation public class LuaDocumentation
{ {

View File

@ -23,7 +23,7 @@ namespace BizHawk.MultiClient
private void PopulateListView() private void PopulateListView()
{ {
FunctionView.Items.Clear(); FunctionView.Items.Clear();
foreach (LuaDocumentation.LibraryFunction l in GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList) foreach (LuaDocumentation.LibraryFunction l in Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList)
{ {
ListViewItem item = new ListViewItem {Text = l.ReturnType}; ListViewItem item = new ListViewItem {Text = l.ReturnType};
item.SubItems.Add(l.library + "."); item.SubItems.Add(l.library + ".");
@ -41,16 +41,16 @@ namespace BizHawk.MultiClient
switch (column) switch (column)
{ {
case 0: //Return case 0: //Return
GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderByDescending(x => x.ReturnType).ToList(); Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList = Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderByDescending(x => x.ReturnType).ToList();
break; break;
case 1: //Library case 1: //Library
GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderByDescending(x => x.library).ToList(); Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList = Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderByDescending(x => x.library).ToList();
break; break;
case 2: //Name case 2: //Name
GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderByDescending(x => x.name).ToList(); Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList = Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderByDescending(x => x.name).ToList();
break; break;
case 3: //Parameters case 3: //Parameters
GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderByDescending(x => x.ParameterList).ToList(); Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList = Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderByDescending(x => x.ParameterList).ToList();
break; break;
} }
} }
@ -59,16 +59,16 @@ namespace BizHawk.MultiClient
switch (column) switch (column)
{ {
case 0: //Return case 0: //Return
GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderBy(x => x.ReturnType).ToList(); Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList = Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderBy(x => x.ReturnType).ToList();
break; break;
case 1: //Library case 1: //Library
GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderBy(x => x.library).ToList(); Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList = Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderBy(x => x.library).ToList();
break; break;
case 2: //Name case 2: //Name
GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderBy(x => x.name).ToList(); Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList = Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderBy(x => x.name).ToList();
break; break;
case 3: //Parameters case 3: //Parameters
GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList = GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderBy(x => x.ParameterList).ToList(); Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList = Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList.OrderBy(x => x.ParameterList).ToList();
break; break;
} }
} }
@ -132,7 +132,7 @@ namespace BizHawk.MultiClient
foreach (int index in indexes) foreach (int index in indexes)
{ {
var library_function = GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList[index]; var library_function = Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList[index];
sb.Append(library_function.library).Append('.').Append(library_function.name).Append("()\n"); sb.Append(library_function.library).Append('.').Append(library_function.name).Append("()\n");
} }

View File

@ -8,12 +8,10 @@ using System.Drawing;
using System.Threading; using System.Threading;
using System.Globalization; using System.Globalization;
using BizHawk.Client.Common;
using BizHawk.Emulation.Consoles.Nintendo; using BizHawk.Emulation.Consoles.Nintendo;
using BizHawk.MultiClient.tools;
using System.Text; using System.Text;
using BizHawk.MultiClient.tools; //TODO: remove me, this is not an intended namespace
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
public class LuaImplementation public class LuaImplementation
@ -563,7 +561,7 @@ namespace BizHawk.MultiClient
public void client_closerom() public void client_closerom()
{ {
GlobalWinF.MainForm.CloseROM(); Global.MainForm.CloseROM();
} }
public int client_getwindowsize() public int client_getwindowsize()
@ -573,74 +571,74 @@ namespace BizHawk.MultiClient
public void client_opencheats() public void client_opencheats()
{ {
GlobalWinF.MainForm.LoadCheatsWindow(); Global.MainForm.LoadCheatsWindow();
} }
public void client_openhexeditor() public void client_openhexeditor()
{ {
GlobalWinF.MainForm.LoadHexEditor(); Global.MainForm.LoadHexEditor();
} }
public void client_openramwatch() public void client_openramwatch()
{ {
GlobalWinF.MainForm.LoadRamWatch(true); Global.MainForm.LoadRamWatch(true);
} }
public void client_openramsearch() public void client_openramsearch()
{ {
GlobalWinF.MainForm.LoadRamSearch(); Global.MainForm.LoadRamSearch();
} }
public void client_openrom(object lua_input) public void client_openrom(object lua_input)
{ {
GlobalWinF.MainForm.LoadRom(lua_input.ToString()); Global.MainForm.LoadRom(lua_input.ToString());
} }
public void client_opentasstudio() public void client_opentasstudio()
{ {
GlobalWinF.MainForm.LoadTAStudio(); Global.MainForm.LoadTAStudio();
} }
public void client_opentoolbox() public void client_opentoolbox()
{ {
GlobalWinF.MainForm.LoadToolBox(); Global.MainForm.LoadToolBox();
} }
public void client_opentracelogger() public void client_opentracelogger()
{ {
GlobalWinF.MainForm.LoadTraceLogger(); Global.MainForm.LoadTraceLogger();
} }
public void client_pause_av() public void client_pause_av()
{ {
GlobalWinF.MainForm.PauseAVI = true; Global.MainForm.PauseAVI = true;
} }
public void client_reboot_core() public void client_reboot_core()
{ {
GlobalWinF.MainForm.RebootCore(); Global.MainForm.RebootCore();
} }
public int client_screenheight() public int client_screenheight()
{ {
return GlobalWinF.RenderPanel.NativeSize.Height; return Global.RenderPanel.NativeSize.Height;
} }
public void client_screenshot(object path = null) public void client_screenshot(object path = null)
{ {
if (path == null) if (path == null)
{ {
GlobalWinF.MainForm.TakeScreenshot(); Global.MainForm.TakeScreenshot();
} }
else else
{ {
GlobalWinF.MainForm.TakeScreenshot(path.ToString()); Global.MainForm.TakeScreenshot(path.ToString());
} }
} }
public void client_screenshottoclipboard() public void client_screenshottoclipboard()
{ {
GlobalWinF.MainForm.TakeScreenshotToClipboard(); Global.MainForm.TakeScreenshotToClipboard();
} }
public void client_setscreenshotosd(bool value) public void client_setscreenshotosd(bool value)
@ -650,7 +648,7 @@ namespace BizHawk.MultiClient
public int client_screenwidth() public int client_screenwidth()
{ {
return GlobalWinF.RenderPanel.NativeSize.Width; return Global.RenderPanel.NativeSize.Width;
} }
public void client_setwindowsize(object window_size) public void client_setwindowsize(object window_size)
@ -662,8 +660,8 @@ namespace BizHawk.MultiClient
if (size == 1 || size == 2 || size == 3 || size == 4 || size == 5 || size == 10) if (size == 1 || size == 2 || size == 3 || size == 4 || size == 5 || size == 10)
{ {
Global.Config.TargetZoomFactor = size; Global.Config.TargetZoomFactor = size;
GlobalWinF.MainForm.FrameBufferResized(); Global.MainForm.FrameBufferResized();
GlobalWinF.OSD.AddMessage("Window size set to " + size.ToString() + "x"); Global.OSD.AddMessage("Window size set to " + size.ToString() + "x");
} }
else else
{ {
@ -679,17 +677,17 @@ namespace BizHawk.MultiClient
public void client_unpause_av() public void client_unpause_av()
{ {
GlobalWinF.MainForm.PauseAVI = false; Global.MainForm.PauseAVI = false;
} }
public int client_xpos() public int client_xpos()
{ {
return GlobalWinF.MainForm.DesktopLocation.X; return Global.MainForm.DesktopLocation.X;
} }
public int client_ypos() public int client_ypos()
{ {
return GlobalWinF.MainForm.DesktopLocation.Y; return Global.MainForm.DesktopLocation.Y;
} }
#endregion #endregion
@ -698,13 +696,13 @@ namespace BizHawk.MultiClient
public void console_clear() public void console_clear()
{ {
GlobalWinF.MainForm.LuaConsole1.ClearOutputWindow(); Global.MainForm.LuaConsole1.ClearOutputWindow();
} }
public string console_getluafunctionslist() public string console_getluafunctionslist()
{ {
string list = ""; string list = "";
foreach (LuaDocumentation.LibraryFunction l in GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.FunctionList) foreach (LuaDocumentation.LibraryFunction l in Global.MainForm.LuaConsole1.LuaImp.docs.FunctionList)
{ {
list += l.name + "\n"; list += l.name + "\n";
} }
@ -721,7 +719,7 @@ namespace BizHawk.MultiClient
{ {
if (lua_input == null) if (lua_input == null)
{ {
GlobalWinF.MainForm.LuaConsole1.WriteToOutputWindow("NULL"); Global.MainForm.LuaConsole1.WriteToOutputWindow("NULL");
} }
else else
{ {
@ -756,11 +754,11 @@ namespace BizHawk.MultiClient
.AppendLine(); .AppendLine();
} }
GlobalWinF.MainForm.LuaConsole1.WriteToOutputWindow(sb.ToString()); Global.MainForm.LuaConsole1.WriteToOutputWindow(sb.ToString());
} }
else else
{ {
GlobalWinF.MainForm.LuaConsole1.WriteToOutputWindow(lua_input.ToString()); Global.MainForm.LuaConsole1.WriteToOutputWindow(lua_input.ToString());
} }
} }
} }
@ -812,7 +810,7 @@ namespace BizHawk.MultiClient
public void gui_clearGraphics() public void gui_clearGraphics()
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
luaSurface.Clear(); luaSurface.Clear();
} }
@ -825,12 +823,12 @@ namespace BizHawk.MultiClient
/// </summary> /// </summary>
public void gui_drawNew() public void gui_drawNew()
{ {
luaSurface = GlobalWinF.DisplayManager.GetLuaSurfaceNative(); luaSurface = Global.DisplayManager.GetLuaSurfaceNative();
} }
public void gui_drawNewEmu() public void gui_drawNewEmu()
{ {
luaSurface = GlobalWinF.DisplayManager.GetLuaEmuSurfaceEmu(); luaSurface = Global.DisplayManager.GetLuaEmuSurfaceEmu();
} }
/// <summary> /// <summary>
@ -840,13 +838,13 @@ namespace BizHawk.MultiClient
/// </summary> /// </summary>
public void gui_drawFinish() public void gui_drawFinish()
{ {
GlobalWinF.DisplayManager.SetLuaSurfaceNativePreOSD(luaSurface); Global.DisplayManager.SetLuaSurfaceNativePreOSD(luaSurface);
luaSurface = null; luaSurface = null;
} }
public void gui_drawFinishEmu() public void gui_drawFinishEmu()
{ {
GlobalWinF.DisplayManager.SetLuaSurfaceEmu(luaSurface); Global.DisplayManager.SetLuaSurfaceEmu(luaSurface);
luaSurface = null; luaSurface = null;
} }
@ -907,14 +905,14 @@ namespace BizHawk.MultiClient
dx *= client_getwindowsize(); dx *= client_getwindowsize();
dy *= client_getwindowsize(); dy *= client_getwindowsize();
GlobalWinF.OSD.AddGUIText(luaStr.ToString(), dx, dy, alert, GetColor(background), GetColor(forecolor), a); Global.OSD.AddGUIText(luaStr.ToString(), dx, dy, alert, GetColor(background), GetColor(forecolor), a);
} }
#endregion #endregion
public void gui_addmessage(object luaStr) public void gui_addmessage(object luaStr)
{ {
GlobalWinF.OSD.AddMessage(luaStr.ToString()); Global.OSD.AddMessage(luaStr.ToString());
} }
public void gui_alert(object luaX, object luaY, object luaStr, object anchor = null) public void gui_alert(object luaX, object luaY, object luaStr, object anchor = null)
@ -924,12 +922,12 @@ namespace BizHawk.MultiClient
public void gui_cleartext() public void gui_cleartext()
{ {
GlobalWinF.OSD.ClearGUIText(); Global.OSD.ClearGUIText();
} }
public void gui_drawBezier(LuaTable points, object color) public void gui_drawBezier(LuaTable points, object color)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics()) using (var g = GetGraphics())
{ {
try try
@ -1000,7 +998,7 @@ namespace BizHawk.MultiClient
public void gui_drawEllipse(object X, object Y, object width, object height, object line, object background = null) public void gui_drawEllipse(object X, object Y, object width, object height, object line, object background = null)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics()) using (var g = GetGraphics())
{ {
try try
@ -1022,7 +1020,7 @@ namespace BizHawk.MultiClient
public void gui_drawIcon(object Path, object x, object y, object width = null, object height = null) public void gui_drawIcon(object Path, object x, object y, object width = null, object height = null)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics()) using (var g = GetGraphics())
{ {
try try
@ -1048,7 +1046,7 @@ namespace BizHawk.MultiClient
public void gui_drawImage(object Path, object x, object y, object width = null, object height = null) public void gui_drawImage(object Path, object x, object y, object width = null, object height = null)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics()) using (var g = GetGraphics())
{ {
try try
@ -1071,7 +1069,7 @@ namespace BizHawk.MultiClient
public void gui_drawLine(object x1, object y1, object x2, object y2, object color = null) public void gui_drawLine(object x1, object y1, object x2, object y2, object color = null)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics()) using (var g = GetGraphics())
{ {
try try
@ -1088,7 +1086,7 @@ namespace BizHawk.MultiClient
public void gui_drawPie(object X, object Y, object width, object height, object startangle, object sweepangle, public void gui_drawPie(object X, object Y, object width, object height, object startangle, object sweepangle,
object line, object background = null) object line, object background = null)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics()) using (var g = GetGraphics())
{ {
try try
@ -1111,7 +1109,7 @@ namespace BizHawk.MultiClient
public void gui_drawPixel(object X, object Y, object color = null) public void gui_drawPixel(object X, object Y, object color = null)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics()) using (var g = GetGraphics())
{ {
float x = LuaInt(X) + 0.1F; float x = LuaInt(X) + 0.1F;
@ -1128,7 +1126,7 @@ namespace BizHawk.MultiClient
public void gui_drawPolygon(LuaTable points, object line, object background = null) public void gui_drawPolygon(LuaTable points, object line, object background = null)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
//this is a test //this is a test
using (var g = GetGraphics()) using (var g = GetGraphics())
{ {
@ -1183,13 +1181,13 @@ namespace BizHawk.MultiClient
public void gui_drawString(object X, object Y, object message, object color = null, object fontsize = null, object fontfamily = null, object fontstyle = null) public void gui_drawString(object X, object Y, object message, object color = null, object fontsize = null, object fontfamily = null, object fontstyle = null)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
gui_drawText(X, Y, message, color, fontsize, fontfamily, fontstyle); gui_drawText(X, Y, message, color, fontsize, fontfamily, fontstyle);
} }
public void gui_drawText(object X, object Y, object message, object color = null, object fontsize = null, object fontfamily = null, object fontstyle = null) public void gui_drawText(object X, object Y, object message, object color = null, object fontsize = null, object fontfamily = null, object fontstyle = null)
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
using (var g = GetGraphics()) using (var g = GetGraphics())
{ {
try try
@ -1257,23 +1255,23 @@ namespace BizHawk.MultiClient
{ {
if (Global.Emulator is NES) if (Global.Emulator is NES)
{ {
GlobalWinF.CoreComm.NES_ShowOBJ = Global.Config.NESDispSprites = (bool)lua_p[0]; Global.CoreComm.NES_ShowOBJ = Global.Config.NESDispSprites = (bool)lua_p[0];
GlobalWinF.CoreComm.NES_ShowBG = Global.Config.NESDispBackground = (bool)lua_p[1]; Global.CoreComm.NES_ShowBG = Global.Config.NESDispBackground = (bool)lua_p[1];
} }
else if (Global.Emulator is Emulation.Consoles.TurboGrafx.PCEngine) else if (Global.Emulator is Emulation.Consoles.TurboGrafx.PCEngine)
{ {
GlobalWinF.CoreComm.PCE_ShowOBJ1 = Global.Config.PCEDispOBJ1 = (bool)lua_p[0]; Global.CoreComm.PCE_ShowOBJ1 = Global.Config.PCEDispOBJ1 = (bool)lua_p[0];
GlobalWinF.CoreComm.PCE_ShowBG1 = Global.Config.PCEDispBG1 = (bool)lua_p[1]; Global.CoreComm.PCE_ShowBG1 = Global.Config.PCEDispBG1 = (bool)lua_p[1];
if (lua_p.Length > 2) if (lua_p.Length > 2)
{ {
GlobalWinF.CoreComm.PCE_ShowOBJ2 = Global.Config.PCEDispOBJ2 = (bool)lua_p[2]; Global.CoreComm.PCE_ShowOBJ2 = Global.Config.PCEDispOBJ2 = (bool)lua_p[2];
GlobalWinF.CoreComm.PCE_ShowBG2 = Global.Config.PCEDispBG2 = (bool)lua_p[3]; Global.CoreComm.PCE_ShowBG2 = Global.Config.PCEDispBG2 = (bool)lua_p[3];
} }
} }
else if (Global.Emulator is Emulation.Consoles.Sega.SMS) else if (Global.Emulator is Emulation.Consoles.Sega.SMS)
{ {
GlobalWinF.CoreComm.SMS_ShowOBJ = Global.Config.SMSDispOBJ = (bool)lua_p[0]; Global.CoreComm.SMS_ShowOBJ = Global.Config.SMSDispOBJ = (bool)lua_p[0];
GlobalWinF.CoreComm.SMS_ShowBG = Global.Config.SMSDispBG = (bool)lua_p[1]; Global.CoreComm.SMS_ShowBG = Global.Config.SMSDispBG = (bool)lua_p[1];
} }
} }
@ -1292,7 +1290,7 @@ namespace BizHawk.MultiClient
{ {
Global.Config.VSyncThrottle = true; Global.Config.VSyncThrottle = true;
} }
GlobalWinF.MainForm.VsyncMessage(); Global.MainForm.VsyncMessage();
} }
} }
@ -1303,13 +1301,13 @@ namespace BizHawk.MultiClient
{ {
if (temp == "0" || temp.ToLower() == "false") if (temp == "0" || temp.ToLower() == "false")
{ {
GlobalWinF.MainForm.RewindActive = false; Global.MainForm.RewindActive = false;
GlobalWinF.OSD.AddMessage("Rewind suspended"); Global.OSD.AddMessage("Rewind suspended");
} }
else else
{ {
GlobalWinF.MainForm.RewindActive = true; Global.MainForm.RewindActive = true;
GlobalWinF.OSD.AddMessage("Rewind enabled"); Global.OSD.AddMessage("Rewind enabled");
} }
} }
} }
@ -1334,7 +1332,7 @@ namespace BizHawk.MultiClient
if (frames > 0) if (frames > 0)
{ {
Global.Config.FrameSkip = frames; Global.Config.FrameSkip = frames;
GlobalWinF.MainForm.FrameSkipMessage(); Global.MainForm.FrameSkipMessage();
} }
else else
{ {
@ -1359,7 +1357,7 @@ namespace BizHawk.MultiClient
public bool emu_ispaused() public bool emu_ispaused()
{ {
return GlobalWinF.MainForm.EmulatorPaused; return Global.MainForm.EmulatorPaused;
} }
public int emu_lagcount() public int emu_lagcount()
@ -1380,7 +1378,7 @@ namespace BizHawk.MultiClient
{ {
Global.Config.ClockThrottle = true; Global.Config.ClockThrottle = true;
} }
GlobalWinF.MainForm.LimitFrameRateMessage(); Global.MainForm.LimitFrameRateMessage();
} }
} }
@ -1397,7 +1395,7 @@ namespace BizHawk.MultiClient
{ {
Global.Config.AutoMinimizeSkipping = true; Global.Config.AutoMinimizeSkipping = true;
} }
GlobalWinF.MainForm.MinimizeFrameskipMessage(); Global.MainForm.MinimizeFrameskipMessage();
} }
} }
@ -1413,7 +1411,7 @@ namespace BizHawk.MultiClient
} }
catch (SystemException e) catch (SystemException e)
{ {
GlobalWinF.MainForm.LuaConsole1.WriteToOutputWindow( Global.MainForm.LuaConsole1.WriteToOutputWindow(
"error running function attached by lua function emu.on_snoop" + "error running function attached by lua function emu.on_snoop" +
"\nError message: " + e.Message); "\nError message: " + e.Message);
} }
@ -1425,7 +1423,7 @@ namespace BizHawk.MultiClient
public void emu_pause() public void emu_pause()
{ {
GlobalWinF.MainForm.PauseEmulator(); Global.MainForm.PauseEmulator();
} }
public void emu_setrenderplanes( // For now, it accepts arguments up to 5. public void emu_setrenderplanes( // For now, it accepts arguments up to 5.
@ -1443,7 +1441,7 @@ namespace BizHawk.MultiClient
int speed = Convert.ToInt32(temp); int speed = Convert.ToInt32(temp);
if (speed > 0 && speed < 1000) //arbituarily capping it at 1000% if (speed > 0 && speed < 1000) //arbituarily capping it at 1000%
{ {
GlobalWinF.MainForm.ClickSpeedItem(speed); Global.MainForm.ClickSpeedItem(speed);
} }
else else
{ {
@ -1458,17 +1456,17 @@ namespace BizHawk.MultiClient
public void emu_togglepause() public void emu_togglepause()
{ {
GlobalWinF.MainForm.TogglePause(); Global.MainForm.TogglePause();
} }
public void emu_unpause() public void emu_unpause()
{ {
GlobalWinF.MainForm.UnpauseEmulator(); Global.MainForm.UnpauseEmulator();
} }
public void emu_yield() public void emu_yield()
{ {
GlobalWinF.DisplayManager.NeedsToPaint = true; Global.DisplayManager.NeedsToPaint = true;
currThread.Yield(0); currThread.Yield(0);
} }
@ -1496,7 +1494,7 @@ namespace BizHawk.MultiClient
} }
catch (SystemException e) catch (SystemException e)
{ {
GlobalWinF.MainForm.LuaConsole1.WriteToOutputWindow( Global.MainForm.LuaConsole1.WriteToOutputWindow(
"error running function attached by lua function savestate.registersave" + "error running function attached by lua function savestate.registersave" +
"\nError message: " + e.Message); "\nError message: " + e.Message);
} }
@ -1517,7 +1515,7 @@ namespace BizHawk.MultiClient
} }
catch (SystemException e) catch (SystemException e)
{ {
GlobalWinF.MainForm.LuaConsole1.WriteToOutputWindow( Global.MainForm.LuaConsole1.WriteToOutputWindow(
"error running function attached by lua function savestate.registerload" + "error running function attached by lua function savestate.registerload" +
"\nError message: " + e.Message); "\nError message: " + e.Message);
} }
@ -1538,7 +1536,7 @@ namespace BizHawk.MultiClient
} }
catch (SystemException e) catch (SystemException e)
{ {
GlobalWinF.MainForm.LuaConsole1.WriteToOutputWindow( Global.MainForm.LuaConsole1.WriteToOutputWindow(
"error running function attached by lua function emu.registerbefore" + "error running function attached by lua function emu.registerbefore" +
"\nError message: " + e.Message); "\nError message: " + e.Message);
} }
@ -1559,7 +1557,7 @@ namespace BizHawk.MultiClient
} }
catch (SystemException e) catch (SystemException e)
{ {
GlobalWinF.MainForm.LuaConsole1.WriteToOutputWindow( Global.MainForm.LuaConsole1.WriteToOutputWindow(
"error running function attached by lua function emu.registerafter" + "error running function attached by lua function emu.registerafter" +
"\nError message: " + e.Message); "\nError message: " + e.Message);
} }
@ -1616,7 +1614,7 @@ namespace BizHawk.MultiClient
} }
catch (SystemException e) catch (SystemException e)
{ {
GlobalWinF.MainForm.LuaConsole1.WriteToOutputWindow( Global.MainForm.LuaConsole1.WriteToOutputWindow(
"error running function attached by lua function event.onmemoryread" + "error running function attached by lua function event.onmemoryread" +
"\nError message: " + e.Message); "\nError message: " + e.Message);
} }
@ -1653,7 +1651,7 @@ namespace BizHawk.MultiClient
} }
catch (SystemException e) catch (SystemException e)
{ {
GlobalWinF.MainForm.LuaConsole1.WriteToOutputWindow( Global.MainForm.LuaConsole1.WriteToOutputWindow(
"error running function attached by lua function event.onmemoryread" + "error running function attached by lua function event.onmemoryread" +
"\nError message: " + e.Message); "\nError message: " + e.Message);
} }
@ -2110,7 +2108,7 @@ namespace BizHawk.MultiClient
public LuaTable input_get() public LuaTable input_get()
{ {
LuaTable buttons = _lua.NewTable(); LuaTable buttons = _lua.NewTable();
foreach (var kvp in GlobalWinF.ControllerInputCoalescer.BoolButtons()) foreach (var kvp in Global.ControllerInputCoalescer.BoolButtons())
if (kvp.Value) if (kvp.Value)
buttons[kvp.Key] = true; buttons[kvp.Key] = true;
return buttons; return buttons;
@ -2119,7 +2117,7 @@ namespace BizHawk.MultiClient
public LuaTable input_getmouse() public LuaTable input_getmouse()
{ {
LuaTable buttons = _lua.NewTable(); LuaTable buttons = _lua.NewTable();
Point p = GlobalWinF.RenderPanel.ScreenToScreen(Control.MousePosition); Point p = Global.RenderPanel.ScreenToScreen(Control.MousePosition);
buttons["X"] = p.X; buttons["X"] = p.X;
buttons["Y"] = p.Y; buttons["Y"] = p.Y;
buttons[MouseButtons.Left.ToString()] = (Control.MouseButtons & MouseButtons.Left) != 0; buttons[MouseButtons.Left.ToString()] = (Control.MouseButtons & MouseButtons.Left) != 0;
@ -2138,27 +2136,27 @@ namespace BizHawk.MultiClient
public LuaTable joypad_get(object controller = null) public LuaTable joypad_get(object controller = null)
{ {
LuaTable buttons = _lua.NewTable(); LuaTable buttons = _lua.NewTable();
foreach (string button in GlobalWinF.ControllerOutput.Source.Type.BoolButtons) foreach (string button in Global.ControllerOutput.Source.Type.BoolButtons)
{ {
if (controller == null) if (controller == null)
{ {
buttons[button] = GlobalWinF.ControllerOutput[button]; buttons[button] = Global.ControllerOutput[button];
} }
else if (button.Length >= 3 && button.Substring(0, 2) == "P" + LuaInt(controller).ToString()) else if (button.Length >= 3 && button.Substring(0, 2) == "P" + LuaInt(controller).ToString())
{ {
buttons[button.Substring(3)] = GlobalWinF.ControllerOutput["P" + LuaInt(controller) + " " + button.Substring(3)]; buttons[button.Substring(3)] = Global.ControllerOutput["P" + LuaInt(controller) + " " + button.Substring(3)];
} }
} }
foreach (string button in GlobalWinF.ControllerOutput.Source.Type.FloatControls) foreach (string button in Global.ControllerOutput.Source.Type.FloatControls)
{ {
if (controller == null) if (controller == null)
{ {
buttons[button] = GlobalWinF.ControllerOutput.GetFloat(button); buttons[button] = Global.ControllerOutput.GetFloat(button);
} }
else if (button.Length >= 3 && button.Substring(0, 2) == "P" + LuaInt(controller).ToString()) else if (button.Length >= 3 && button.Substring(0, 2) == "P" + LuaInt(controller).ToString())
{ {
buttons[button.Substring(3)] = GlobalWinF.ControllerOutput.GetFloat("P" + LuaInt(controller) + " " + button.Substring(3)); buttons[button.Substring(3)] = Global.ControllerOutput.GetFloat("P" + LuaInt(controller) + " " + button.Substring(3));
} }
} }
@ -2172,8 +2170,8 @@ namespace BizHawk.MultiClient
public LuaTable joypad_getimmediate() public LuaTable joypad_getimmediate()
{ {
LuaTable buttons = _lua.NewTable(); LuaTable buttons = _lua.NewTable();
foreach (string button in GlobalWinF.ActiveController.Type.BoolButtons) foreach (string button in Global.ActiveController.Type.BoolButtons)
buttons[button] = GlobalWinF.ActiveController[button]; buttons[button] = Global.ActiveController[button];
return buttons; return buttons;
} }
@ -2215,24 +2213,24 @@ namespace BizHawk.MultiClient
{ {
if (controller == null) //Force On if (controller == null) //Force On
{ {
GlobalWinF.ClickyVirtualPadController.Click(button.ToString()); Global.ClickyVirtualPadController.Click(button.ToString());
GlobalWinF.ForceOffAdaptor.SetSticky(button.ToString(), false); Global.ForceOffAdaptor.SetSticky(button.ToString(), false);
} }
else else
{ {
GlobalWinF.ClickyVirtualPadController.Click("P" + controller + " " + button); Global.ClickyVirtualPadController.Click("P" + controller + " " + button);
GlobalWinF.ForceOffAdaptor.SetSticky("P" + controller + " " + button, false); Global.ForceOffAdaptor.SetSticky("P" + controller + " " + button, false);
} }
} }
else if (theValue == false) //Force off else if (theValue == false) //Force off
{ {
if (controller == null) if (controller == null)
{ {
GlobalWinF.ForceOffAdaptor.SetSticky(button.ToString(), true); Global.ForceOffAdaptor.SetSticky(button.ToString(), true);
} }
else else
{ {
GlobalWinF.ForceOffAdaptor.SetSticky("P" + controller + " " + button, true); Global.ForceOffAdaptor.SetSticky("P" + controller + " " + button, true);
} }
} }
else else
@ -2240,11 +2238,11 @@ namespace BizHawk.MultiClient
//Turn everything off //Turn everything off
if (controller == null) if (controller == null)
{ {
GlobalWinF.ForceOffAdaptor.SetSticky(button.ToString(), false); Global.ForceOffAdaptor.SetSticky(button.ToString(), false);
} }
else else
{ {
GlobalWinF.ForceOffAdaptor.SetSticky("P" + controller + " " + button, false); Global.ForceOffAdaptor.SetSticky("P" + controller + " " + button, false);
} }
} }
} }
@ -2252,13 +2250,13 @@ namespace BizHawk.MultiClient
{ {
if (controller == null) if (controller == null)
{ {
GlobalWinF.StickyXORAdapter.SetSticky(button.ToString(), true); Global.StickyXORAdapter.SetSticky(button.ToString(), true);
GlobalWinF.ForceOffAdaptor.SetSticky(button.ToString(), false); Global.ForceOffAdaptor.SetSticky(button.ToString(), false);
} }
else else
{ {
GlobalWinF.StickyXORAdapter.SetSticky("P" + controller + " " + button, true); Global.StickyXORAdapter.SetSticky("P" + controller + " " + button, true);
GlobalWinF.ForceOffAdaptor.SetSticky("P" + controller + " " + button, false); Global.ForceOffAdaptor.SetSticky("P" + controller + " " + button, false);
} }
} }
} }
@ -2281,11 +2279,11 @@ namespace BizHawk.MultiClient
float theValue = float.Parse(theValueStr); float theValue = float.Parse(theValueStr);
if (controller == null) if (controller == null)
{ {
GlobalWinF.StickyXORAdapter.SetFloat(name.ToString(), theValue); Global.StickyXORAdapter.SetFloat(name.ToString(), theValue);
} }
else else
{ {
GlobalWinF.StickyXORAdapter.SetFloat("P" + controller + " " + name, theValue); Global.StickyXORAdapter.SetFloat("P" + controller + " " + name, theValue);
} }
} }
catch { } catch { }
@ -2953,7 +2951,7 @@ namespace BizHawk.MultiClient
public bool movie_getreadonly() public bool movie_getreadonly()
{ {
return GlobalWinF.MainForm.ReadOnly; return Global.MainForm.ReadOnly;
} }
public bool movie_getrerecordcounting() public bool movie_getrerecordcounting()
@ -3013,9 +3011,9 @@ namespace BizHawk.MultiClient
public void movie_setreadonly(object lua_input) public void movie_setreadonly(object lua_input)
{ {
if (lua_input.ToString().ToUpper() == "TRUE" || lua_input.ToString() == "1") if (lua_input.ToString().ToUpper() == "TRUE" || lua_input.ToString() == "1")
GlobalWinF.MainForm.SetReadOnly(true); Global.MainForm.SetReadOnly(true);
else else
GlobalWinF.MainForm.SetReadOnly(false); Global.MainForm.SetReadOnly(false);
} }
public void movie_setrerecordcounting(object lua_input) public void movie_setrerecordcounting(object lua_input)
@ -3057,8 +3055,6 @@ namespace BizHawk.MultiClient
gg.Compare, gg.Compare,
enabled: true)); enabled: true));
} }
ToolHelpers.UpdateCheatRelatedTools();
} }
} }
@ -3117,8 +3113,6 @@ namespace BizHawk.MultiClient
var cheats = Global.CheatList.Where(x => x.Address == gg.Address); var cheats = Global.CheatList.Where(x => x.Address == gg.Address);
Global.CheatList.RemoveRange(cheats); Global.CheatList.RemoveRange(cheats);
} }
ToolHelpers.UpdateCheatRelatedTools();
} }
} }
@ -3143,13 +3137,13 @@ namespace BizHawk.MultiClient
public void nes_setdispbackground(bool show) public void nes_setdispbackground(bool show)
{ {
Global.Config.NESDispBackground = show; Global.Config.NESDispBackground = show;
GlobalWinF.MainForm.SyncCoreCommInputSignals(); Global.MainForm.SyncCoreCommInputSignals();
} }
public void nes_setdispsprites(bool show) public void nes_setdispsprites(bool show)
{ {
Global.Config.NESDispSprites = show; Global.Config.NESDispSprites = show;
GlobalWinF.MainForm.SyncCoreCommInputSignals(); Global.MainForm.SyncCoreCommInputSignals();
} }
public void nes_setscanlines(object top, object bottom, bool pal = false) public void nes_setscanlines(object top, object bottom, bool pal = false)
@ -3209,7 +3203,7 @@ namespace BizHawk.MultiClient
{ {
if (lua_input is string) if (lua_input is string)
{ {
GlobalWinF.MainForm.LoadStateFile(lua_input.ToString(), Path.GetFileName(lua_input.ToString()), true); Global.MainForm.LoadStateFile(lua_input.ToString(), Path.GetFileName(lua_input.ToString()), true);
} }
} }
@ -3229,7 +3223,7 @@ namespace BizHawk.MultiClient
if (x < 0 || x > 9) if (x < 0 || x > 9)
return; return;
GlobalWinF.MainForm.LoadState("QuickSave" + x.ToString(), true); Global.MainForm.LoadState("QuickSave" + x.ToString(), true);
} }
public string savestate_registerload(LuaFunction luaf, object name) public string savestate_registerload(LuaFunction luaf, object name)
@ -3251,7 +3245,7 @@ namespace BizHawk.MultiClient
if (lua_input is string) if (lua_input is string)
{ {
string path = lua_input.ToString(); string path = lua_input.ToString();
GlobalWinF.MainForm.SaveStateFile(path, path, true); Global.MainForm.SaveStateFile(path, path, true);
} }
} }
@ -3271,7 +3265,7 @@ namespace BizHawk.MultiClient
if (x < 0 || x > 9) if (x < 0 || x > 9)
return; return;
GlobalWinF.MainForm.SaveState("QuickSave" + x.ToString()); Global.MainForm.SaveState("QuickSave" + x.ToString());
} }
#endregion #endregion
@ -3320,42 +3314,42 @@ namespace BizHawk.MultiClient
public void snes_setlayer_bg_1(bool value) public void snes_setlayer_bg_1(bool value)
{ {
GlobalWinF.MainForm.SNES_ToggleBG1(value); Global.MainForm.SNES_ToggleBG1(value);
} }
public void snes_setlayer_bg_2(bool value) public void snes_setlayer_bg_2(bool value)
{ {
GlobalWinF.MainForm.SNES_ToggleBG2(value); Global.MainForm.SNES_ToggleBG2(value);
} }
public void snes_setlayer_bg_3(bool value) public void snes_setlayer_bg_3(bool value)
{ {
GlobalWinF.MainForm.SNES_ToggleBG3(value); Global.MainForm.SNES_ToggleBG3(value);
} }
public void snes_setlayer_bg_4(bool value) public void snes_setlayer_bg_4(bool value)
{ {
GlobalWinF.MainForm.SNES_ToggleBG4(value); Global.MainForm.SNES_ToggleBG4(value);
} }
public void snes_setlayer_obj_1(bool value) public void snes_setlayer_obj_1(bool value)
{ {
GlobalWinF.MainForm.SNES_ToggleOBJ1(value); Global.MainForm.SNES_ToggleOBJ1(value);
} }
public void snes_setlayer_obj_2(bool value) public void snes_setlayer_obj_2(bool value)
{ {
GlobalWinF.MainForm.SNES_ToggleOBJ2(value); Global.MainForm.SNES_ToggleOBJ2(value);
} }
public void snes_setlayer_obj_3(bool value) public void snes_setlayer_obj_3(bool value)
{ {
GlobalWinF.MainForm.SNES_ToggleOBJ3(value); Global.MainForm.SNES_ToggleOBJ3(value);
} }
public void snes_setlayer_obj_4(bool value) public void snes_setlayer_obj_4(bool value)
{ {
GlobalWinF.MainForm.SNES_ToggleOBJ4(value); Global.MainForm.SNES_ToggleOBJ4(value);
} }
#endregion #endregion

View File

@ -30,7 +30,7 @@ namespace BizHawk.MultiClient
{ {
FunctionView.Items.Clear(); FunctionView.Items.Clear();
List<NamedLuaFunction> nlfs = GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.OrderBy(x => x.Event).ThenBy(x => x.Name).ToList(); List<NamedLuaFunction> nlfs = Global.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.OrderBy(x => x.Event).ThenBy(x => x.Name).ToList();
foreach (NamedLuaFunction nlf in nlfs) foreach (NamedLuaFunction nlf in nlfs)
{ {
ListViewItem item = new ListViewItem { Text = nlf.Event }; ListViewItem item = new ListViewItem { Text = nlf.Event };
@ -55,7 +55,7 @@ namespace BizHawk.MultiClient
ListView.SelectedIndexCollection indexes = FunctionView.SelectedIndices; ListView.SelectedIndexCollection indexes = FunctionView.SelectedIndices;
if (indexes.Count > 0) if (indexes.Count > 0)
{ {
GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions[indexes[0]].Call(); Global.MainForm.LuaConsole1.LuaImp.RegisteredFunctions[indexes[0]].Call();
} }
} }
@ -64,8 +64,8 @@ namespace BizHawk.MultiClient
ListView.SelectedIndexCollection indexes = FunctionView.SelectedIndices; ListView.SelectedIndexCollection indexes = FunctionView.SelectedIndices;
if (indexes.Count > 0) if (indexes.Count > 0)
{ {
NamedLuaFunction nlf = GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions[indexes[0]]; NamedLuaFunction nlf = Global.MainForm.LuaConsole1.LuaImp.RegisteredFunctions[indexes[0]];
GlobalWinF.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.Remove(nlf); Global.MainForm.LuaConsole1.LuaImp.RegisteredFunctions.Remove(nlf);
PopulateListView(); PopulateListView();
} }
} }

View File

@ -1,7 +1,5 @@
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient.tools namespace BizHawk.MultiClient.tools
{ {
enum BoxType { ALL, SIGNED, UNSIGNED, HEX }; enum BoxType { ALL, SIGNED, UNSIGNED, HEX };

View File

@ -1,4 +1,4 @@
namespace BizHawk.MultiClient namespace BizHawk.MultiClient.tools
{ {
partial class LuaWinform partial class LuaWinform
{ {

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using LuaInterface; using LuaInterface;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient.tools
{ {
public partial class LuaWinform : Form public partial class LuaWinform : Form
{ {
@ -22,7 +22,7 @@ namespace BizHawk.MultiClient
public void CloseThis() public void CloseThis()
{ {
GlobalWinF.MainForm.LuaConsole1.LuaImp.WindowClosed(Handle); Global.MainForm.LuaConsole1.LuaImp.WindowClosed(Handle);
} }
public void DoLuaEvent(IntPtr handle) public void DoLuaEvent(IntPtr handle)

View File

@ -6,8 +6,7 @@ using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.IO; using System.IO;
using BizHawk.MultiClient.tools;
using BizHawk.Client.Common;
namespace BizHawk.MultiClient namespace BizHawk.MultiClient
{ {
@ -434,7 +433,7 @@ namespace BizHawk.MultiClient
private void GenerateLibraryRegex() private void GenerateLibraryRegex()
{ {
StringBuilder list = new StringBuilder(); StringBuilder list = new StringBuilder();
List<string> Libs = GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.GetLibraryList(); List<string> Libs = Global.MainForm.LuaConsole1.LuaImp.docs.GetLibraryList();
for (int i = 0; i < Libs.Count; i++) for (int i = 0; i < Libs.Count; i++)
{ {
list.Append(Libs[i]); list.Append(Libs[i]);
@ -577,9 +576,9 @@ namespace BizHawk.MultiClient
} }
sfd.Filter = "Watch Files (*.lua)|*.lua|All Files|*.*"; sfd.Filter = "Watch Files (*.lua)|*.lua|All Files|*.*";
sfd.RestoreDirectory = true; sfd.RestoreDirectory = true;
GlobalWinF.Sound.StopSound(); Global.Sound.StopSound();
var result = sfd.ShowDialog(); var result = sfd.ShowDialog();
GlobalWinF.Sound.StartSound(); Global.Sound.StartSound();
if (result != DialogResult.OK) if (result != DialogResult.OK)
return null; return null;
var file = new FileInfo(sfd.FileName); var file = new FileInfo(sfd.FileName);
@ -659,7 +658,7 @@ namespace BizHawk.MultiClient
string currentword = CurrentWord(); string currentword = CurrentWord();
if (IsLibraryWord(currentword)) if (IsLibraryWord(currentword))
{ {
List<string> libfunctions = GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.GetFunctionsByLibrary(currentword); List<string> libfunctions = Global.MainForm.LuaConsole1.LuaImp.docs.GetFunctionsByLibrary(currentword);
// Position autocomplete box near the cursor's current position // Position autocomplete box near the cursor's current position
int x = LuaText.GetPositionFromCharIndex(LuaText.SelectionStart).X + LuaText.Location.X + 5; int x = LuaText.GetPositionFromCharIndex(LuaText.SelectionStart).X + LuaText.Location.X + 5;
@ -783,7 +782,7 @@ namespace BizHawk.MultiClient
private bool IsLibraryWord(string word) private bool IsLibraryWord(string word)
{ {
List<string> Libs = GlobalWinF.MainForm.LuaConsole1.LuaImp.docs.GetLibraryList(); List<string> Libs = Global.MainForm.LuaConsole1.LuaImp.docs.GetLibraryList();
if (Libs.Contains(word)) if (Libs.Contains(word))
{ {
return true; return true;

View File

@ -1,4 +1,4 @@
namespace BizHawk.MultiClient namespace BizHawk.MultiClient.tools
{ {
partial class LuaWriterColorConfig partial class LuaWriterColorConfig
{ {

View File

@ -2,9 +2,7 @@
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Client.Common; namespace BizHawk.MultiClient.tools
namespace BizHawk.MultiClient
{ {
public partial class LuaWriterColorConfig : Form public partial class LuaWriterColorConfig : Form
{ {

Some files were not shown because too many files have changed in this diff Show More