DbMan begone!

This commit is contained in:
adelikat 2020-01-21 15:35:41 -06:00
parent 165c2a0e2e
commit d70afbb643
26 changed files with 9 additions and 11268 deletions

View File

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>BizHawk.Client.DBMan</AssemblyName>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<CodeAnalysisRuleSet Condition=" '$(OS)' == 'Windows_NT' ">MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<ErrorReport>prompt</ErrorReport>
<FileAlignment>512</FileAlignment>
<LangVersion>8.0</LangVersion>
<OutputPath>../output</OutputPath>
<OutputType>Exe</OutputType>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<PlatformTarget>AnyCPU</PlatformTarget>
<ProjectGuid>{2D2890A8-C338-4439-AD8B-CB9EE85A94F9}</ProjectGuid>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
<RootNamespace>BizHawk.Client.DBMan</RootNamespace>
<StartupObject/>
<TargetFrameworkProfile/>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>false</DebugSymbols>
<DebugType>pdbonly</DebugType>
<DefineConstants>TRACE;WINDOWS</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)/$(MSBuildToolsVersion)/Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)/$(MSBuildToolsVersion)/Microsoft.Common.props')" />
<Import Project="../CommonRefAssemblies.abs.props" Condition=" '$(OS)' != 'Windows_NT' " />
<ItemGroup>
<Reference Include="CSharp-SQLite"
HintPath="./CSharp-SQLite.dll"
Private="true" />
<Reference Include="System" />
<!--<Reference Include="System.Core" />-->
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../BizHawk.Common/BizHawk.Common.csproj"
Name="BizHawk.Common"
Project="{866f8d13-0678-4ff9-80a4-a3993fd4d8a3}" />
<ProjectReference Include="../BizHawk.Emulation.DiscSystem/BizHawk.Emulation.DiscSystem.csproj"
Name="BizHawk.Emulation.DiscSystem"
Project="{f51946ea-827f-4d82-b841-1f2f6d060312}" />
</ItemGroup>
<ItemGroup>
<Compile Include="**/*.cs" />
<EmbeddedResource Include="**/*.resx" />
<None Include="app.config" />
<None Include="Properties/Settings.settings" LastGenOutput="Settings.Designer.cs" />
</ItemGroup>
<ItemGroup>
<Compile Update="DATTools/DATConverter.cs" SubType="Form" />
<Compile Update="DATTools/DATConverter.Designer.cs" DependentUpon="DATConverter.cs" />
<EmbeddedResource Update="DATTools/DATConverter.resx" DependentUpon="DATConverter.cs" />
<Compile Update="DBMan_MainForm.cs" SubType="Form" />
<Compile Update="DBMan_MainForm.Designer.cs" DependentUpon="DBMan_MainForm.cs" />
<EmbeddedResource Update="DBMan_MainForm.resx" DependentUpon="DBMan_MainForm.cs" />
<Compile Update="Properties/Resources.Designer.cs" AutoGen="true" DependentUpon="Resources.resx" DesignTime="true" />
<EmbeddedResource Update="Properties/Resources.resx" LastGenOutput="Resources.Designer.cs" SubType="Designer" />
<Compile Update="Properties/Settings.Designer.cs" AutoGen="true" DependentUpon="Settings.settings" DesignTime="true" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)/Microsoft.CSharp.targets" />
<Import Project="../CommonResourceGen.rel.props" Condition="'$(MSBuildRuntimeType)' == 'Core'" />
</Project>

View File

@ -1,2 +0,0 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp80</s:String></wpf:ResourceDictionary>

View File

@ -1,215 +0,0 @@
namespace BizHawk.Client.DBMan
{
partial class DATConverter
{
/// <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.comboBoxSystemSelect = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.groupImportTypes = new System.Windows.Forms.GroupBox();
this.radioTOSEC = new System.Windows.Forms.RadioButton();
this.listBoxFiles = new System.Windows.Forms.ListBox();
this.buttonAddFiles = new System.Windows.Forms.Button();
this.buttonRemove = new System.Windows.Forms.Button();
this.buttonStartProcessing = new System.Windows.Forms.Button();
this.textBoxOutputFolder = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.button2 = new System.Windows.Forms.Button();
this.radioNOINTRO = new System.Windows.Forms.RadioButton();
this.groupImportTypes.SuspendLayout();
this.SuspendLayout();
//
// comboBoxSystemSelect
//
this.comboBoxSystemSelect.FormattingEnabled = true;
this.comboBoxSystemSelect.Location = new System.Drawing.Point(13, 13);
this.comboBoxSystemSelect.Name = "comboBoxSystemSelect";
this.comboBoxSystemSelect.Size = new System.Drawing.Size(121, 21);
this.comboBoxSystemSelect.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(141, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(74, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Select System";
//
// groupImportTypes
//
this.groupImportTypes.Controls.Add(this.radioNOINTRO);
this.groupImportTypes.Controls.Add(this.radioTOSEC);
this.groupImportTypes.Location = new System.Drawing.Point(13, 50);
this.groupImportTypes.Name = "groupImportTypes";
this.groupImportTypes.Size = new System.Drawing.Size(200, 100);
this.groupImportTypes.TabIndex = 2;
this.groupImportTypes.TabStop = false;
this.groupImportTypes.Text = "Import Type";
//
// radioTOSEC
//
this.radioTOSEC.AutoSize = true;
this.radioTOSEC.Location = new System.Drawing.Point(7, 20);
this.radioTOSEC.Name = "radioTOSEC";
this.radioTOSEC.Size = new System.Drawing.Size(61, 17);
this.radioTOSEC.TabIndex = 0;
this.radioTOSEC.TabStop = true;
this.radioTOSEC.Text = "TOSEC";
this.radioTOSEC.UseVisualStyleBackColor = true;
//
// listBoxFiles
//
this.listBoxFiles.FormattingEnabled = true;
this.listBoxFiles.HorizontalScrollbar = true;
this.listBoxFiles.Location = new System.Drawing.Point(13, 180);
this.listBoxFiles.Name = "listBoxFiles";
this.listBoxFiles.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
this.listBoxFiles.Size = new System.Drawing.Size(328, 121);
this.listBoxFiles.TabIndex = 3;
this.listBoxFiles.UseTabStops = false;
//
// buttonAddFiles
//
this.buttonAddFiles.Location = new System.Drawing.Point(348, 180);
this.buttonAddFiles.Name = "buttonAddFiles";
this.buttonAddFiles.Size = new System.Drawing.Size(107, 23);
this.buttonAddFiles.TabIndex = 4;
this.buttonAddFiles.Text = "Browse";
this.buttonAddFiles.UseVisualStyleBackColor = true;
this.buttonAddFiles.Click += new System.EventHandler(this.buttonAddFiles_Click);
//
// buttonRemove
//
this.buttonRemove.Location = new System.Drawing.Point(348, 210);
this.buttonRemove.Name = "buttonRemove";
this.buttonRemove.Size = new System.Drawing.Size(107, 23);
this.buttonRemove.TabIndex = 5;
this.buttonRemove.Text = "Remove";
this.buttonRemove.UseVisualStyleBackColor = true;
this.buttonRemove.Click += new System.EventHandler(this.buttonRemove_Click);
//
// buttonStartProcessing
//
this.buttonStartProcessing.Location = new System.Drawing.Point(13, 356);
this.buttonStartProcessing.Name = "buttonStartProcessing";
this.buttonStartProcessing.Size = new System.Drawing.Size(101, 23);
this.buttonStartProcessing.TabIndex = 6;
this.buttonStartProcessing.Text = "Start Processing";
this.buttonStartProcessing.UseVisualStyleBackColor = true;
this.buttonStartProcessing.Click += new System.EventHandler(this.buttonStartProcessing_Click);
//
// textBoxOutputFolder
//
this.textBoxOutputFolder.Location = new System.Drawing.Point(13, 330);
this.textBoxOutputFolder.Name = "textBoxOutputFolder";
this.textBoxOutputFolder.Size = new System.Drawing.Size(328, 20);
this.textBoxOutputFolder.TabIndex = 7;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 164);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(75, 13);
this.label2.TabIndex = 8;
this.label2.Text = "Files to Import:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 314);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(87, 13);
this.label3.TabIndex = 9;
this.label3.Text = "Output Directory:";
//
// button2
//
this.button2.Location = new System.Drawing.Point(348, 328);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(107, 23);
this.button2.TabIndex = 10;
this.button2.Text = "Select Output DIR";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// radioNOINTRO
//
this.radioNOINTRO.AutoSize = true;
this.radioNOINTRO.Location = new System.Drawing.Point(7, 44);
this.radioNOINTRO.Name = "radioNOINTRO";
this.radioNOINTRO.Size = new System.Drawing.Size(172, 17);
this.radioNOINTRO.TabIndex = 1;
this.radioNOINTRO.TabStop = true;
this.radioNOINTRO.Text = "NOINTRO (standard DAT only)";
this.radioNOINTRO.UseVisualStyleBackColor = true;
//
// DATConverter
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(469, 391);
this.Controls.Add(this.button2);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.textBoxOutputFolder);
this.Controls.Add(this.buttonStartProcessing);
this.Controls.Add(this.buttonRemove);
this.Controls.Add(this.buttonAddFiles);
this.Controls.Add(this.listBoxFiles);
this.Controls.Add(this.groupImportTypes);
this.Controls.Add(this.label1);
this.Controls.Add(this.comboBoxSystemSelect);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "DATConverter";
this.Text = "DATConverter";
this.groupImportTypes.ResumeLayout(false);
this.groupImportTypes.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ComboBox comboBoxSystemSelect;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.GroupBox groupImportTypes;
private System.Windows.Forms.RadioButton radioTOSEC;
private System.Windows.Forms.ListBox listBoxFiles;
private System.Windows.Forms.Button buttonAddFiles;
private System.Windows.Forms.Button buttonRemove;
private System.Windows.Forms.Button buttonStartProcessing;
private System.Windows.Forms.TextBox textBoxOutputFolder;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.RadioButton radioNOINTRO;
}
}

View File

@ -1,148 +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.Threading.Tasks;
using System.Windows.Forms;
using BizHawk.Common;
using System.IO;
namespace BizHawk.Client.DBMan
{
public partial class DATConverter : Form
{
public DATConverter()
{
InitializeComponent();
var systems = Enum.GetValues(typeof(SystemType)).Cast<SystemType>().OrderBy(a => a.ToString()).ToList();
comboBoxSystemSelect.DataSource = systems;
textBoxOutputFolder.Text = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
}
/// <summary>
/// Choose output directory
/// </summary>
private void button2_Click(object sender, EventArgs e)
{
var fbd = new FolderBrowserDialog();
fbd.ShowNewFolderButton = true;
fbd.Description = "Choose a new output folder";
if (fbd.ShowDialog() == DialogResult.OK)
{
textBoxOutputFolder.Text = fbd.SelectedPath;
}
}
/// <summary>
/// Add import files to the list box
/// </summary>
private void buttonAddFiles_Click(object sender, EventArgs e)
{
var ofd = new OpenFileDialog();
ofd.CheckFileExists = true;
ofd.CheckPathExists = true;
ofd.InitialDirectory = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
ofd.Multiselect = true;
if (ofd.ShowDialog() == DialogResult.OK)
{
foreach (var f in ofd.FileNames)
{
if (!listBoxFiles.Items.Contains((f)))
{
listBoxFiles.Items.Add(f);
}
}
}
}
/// <summary>
/// Removes selected input files from the listbox
/// </summary>
private void buttonRemove_Click(object sender, EventArgs e)
{
List<string> files = new List<string>();
foreach (var s in listBoxFiles.SelectedItems)
{
files.Add(s.ToString());
}
if (files.Count > 0)
{
foreach (var s in files)
listBoxFiles.Items.Remove(s);
}
}
/// <summary>
/// Attempt to process all selected files
/// </summary>
private void buttonStartProcessing_Click(object sender, EventArgs e)
{
// initial checks
var checkedBtn = groupImportTypes.Controls.OfType<RadioButton>().FirstOrDefault(r => r.Checked);
if (checkedBtn == null)
{
MessageBox.Show("You need to select an import type.");
return;
}
if (!Directory.Exists(textBoxOutputFolder.Text))
{
MessageBox.Show("Chosen output folder is not valid");
return;
}
if (listBoxFiles.Items.Count == 0)
{
MessageBox.Show("No files chosen for input");
return;
}
List<string> files = new List<string>();
foreach (var s in listBoxFiles.Items)
{
if (s.ToString().Trim() == "")
{
MessageBox.Show($"The selected file: {s}Cannot be found.\n\nSort this out and try again");
return;
}
files.Add((string)s);
}
string res = "";
if (radioTOSEC.Checked)
{
DATParser tp = new TOSECParser((SystemType)Enum.Parse(typeof(SystemType), comboBoxSystemSelect.SelectedValue.ToString()));
res = tp.ParseDAT(files.ToArray());
}
else if (radioNOINTRO.Checked)
{
DATParser dp = new NOINTROParser((SystemType)Enum.Parse(typeof(SystemType), comboBoxSystemSelect.SelectedValue.ToString()));
res = dp.ParseDAT(files.ToArray());
}
string fName = $"gamedb_{GameDB.GetSystemCode((SystemType)Enum.Parse(typeof(SystemType), comboBoxSystemSelect.SelectedValue.ToString()))}_DevExport_{DateTime.UtcNow:yyyy-MM-dd_HH_mm_ss}.txt";
try
{
File.WriteAllText(Path.Combine(textBoxOutputFolder.Text, fName), res);
}
catch (Exception ex)
{
MessageBox.Show($"Error writing file: {fName}\n\n{ex.Message}");
}
}
}
}

View File

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,225 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace BizHawk.Client.DBMan
{
public abstract class DATParser
{
/// <summary>
/// Required to generate a GameDB file
/// </summary>
public abstract SystemType SysType { get; set; }
/// <summary>
/// Parses multiple DAT files and returns a single GamesDB format csv string
/// </summary>
public abstract string ParseDAT(string[] filePath);
protected List<string> IncomingData = new List<string>();
protected List<GameDB> Data = new List<GameDB>();
protected StringBuilder sb = new StringBuilder();
protected void AddCommentBlock(string comment)
{
sb.AppendLine(";;;;;;;;;;--------------------------------------------------;;;;;;;;;;");
sb.AppendLine(";;; " + comment.Replace("\r\n", "\r\n;;; "));
sb.AppendLine(";;;;;;;;;;--------------------------------------------------;;;;;;;;;;");
}
protected void AddCommentBlock(string[] comment)
{
sb.AppendLine(";;;;;;;;;;--------------------------------------------------;;;;;;;;;;");
for (int i = 0; i < comment.Length; i++)
{
sb.AppendLine(";;; " + comment[i]);
}
sb.AppendLine(";;;;;;;;;;--------------------------------------------------;;;;;;;;;;");
}
protected void AppendCSVData(List<GameDB> data)
{
if (data == null || data.Count == 0)
{
sb.AppendLine(";");
return;
}
foreach (var d in data)
{
// hash
sb.Append(d.HASH);
sb.Append("\t");
// status
sb.Append(d.Status);
sb.Append("\t");
// name
sb.Append(d.Name);
sb.Append("\t");
// system
sb.Append(d.System);
// additional optional fields
bool[] populated = new bool[4];
if (d.Notes != null)
populated[0] = true;
if (d.MetaData != null)
populated[1] = true;
if (d.Region != null)
populated[2] = true;
if (d.ForcedCore != null)
populated[3] = true;
int last = 0;
for (int i = 3; i >= 0; i--)
{
if (populated[i])
{
last = i;
break;
}
}
int cnt = 0;
// notes
if (d.Notes != null)
{
sb.Append("\t");
sb.Append(d.Notes);
}
else if (cnt++ <= last)
{
sb.Append("\t");
}
// metadata
if (d.MetaData != null)
{
sb.Append("\t");
sb.Append(d.MetaData);
}
else if (cnt++ <= last)
{
sb.Append("\t");
}
// region
if (d.Region != null)
{
sb.Append("\t");
sb.Append(d.Region);
}
else if (cnt++ <= last)
{
sb.Append("\t");
}
// force core
if (d.ForcedCore != null)
{
sb.Append("\t");
sb.Append(d.ForcedCore);
}
sb.Append("\r\n");
}
}
}
/// <summary>
/// DAT data is parsed into this object
/// (every field is not always used)
/// </summary>
public class GameDB
{
// COL0: Hash
public string SHA1 { get; set; }
public string MD5 { get; set; }
// COL1: Status code indicator
public string Status { get; set; }
// COL2: Game title
public string Name { get; set; }
// COL3: System code (must match what bizhawk uses in Emulation.Common/Database/Database.cs
public string System { get; set; }
// COL4: Unknown - not currently parsed in database.cs, but some gamedb files use this for publisher/genre/etc
public string Notes { get; set; }
// COL5: Metadata
public string MetaData { get; set; }
// COL6: Region
public string Region { get; set; }
// COL7: Forced Fore
public string ForcedCore { get; set; }
// prefer MD5 if available
public string HASH
{
get
{
if (MD5.Trim() == "")
return "sha1:" + SHA1;
return MD5;
}
}
/// <summary>
/// Used to get the correct system code (that each gamedb csv needs)
/// </summary>
public static string GetSystemCode(SystemType type)
{
switch (type)
{
case SystemType.P83:
return "83P";
case SystemType.X32:
return "32X";
default:
return type.ToString();
}
}
}
public enum SystemType
{
SAT,
PSP,
PSX,
GEN,
PCFX,
PCECD,
GB,
DGB,
AppleII,
C64,
ZXSpectrum,
AmstradCPC,
SNES,
NES,
P83,
GBC,
A78,
GBA,
X32,
GG,
SG,
SGX,
A26,
Coleco,
INTV,
N64,
WSWAN,
Lynx,
VB,
UZE,
NGP,
ChannelF,
VEC,
GB3x,
GB4x,
O2,
MSX
}
}

View File

@ -1,320 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using System.Xml;
using System.Windows.Forms;
namespace BizHawk.Client.DBMan
{
public class NOINTROParser : DATParser
{
/// <summary>
/// Required to generate a GameDB file
/// </summary>
public override SystemType SysType { get; set; }
private List<XDocument> xmls = new List<XDocument>();
public NOINTROParser(SystemType type)
{
SysType = type;
}
/// <summary>
/// Parses multiple DAT files and returns a single GamesDB format csv string
/// </summary>
public override string ParseDAT(string[] filePath)
{
foreach (var s in filePath)
{
try
{
xmls.Add(XDocument.Load(s));
}
catch
{
var res = MessageBox.Show("Could not parse document as valid XML:\n\n" + s + "\n\nDo you wish to continue any other processing?", "Parsing Error", MessageBoxButtons.YesNo);
if (res != DialogResult.Yes)
return "";
}
}
int startIndex = 0;
// actual tosec parsing
foreach (var obj in xmls)
{
startIndex = Data.Count > 0 ? Data.Count - 1 : 0;
// get header info
var header = obj.Root.Descendants("header").First();
var name = header.Element("name").Value;
var version = header.Element("version").Value;
var description = header.Element("description").Value + " - " + version;
// start comment block
List<string> comments = new List<string>
{
"Type:\tNO-INTRO",
$"Source:\t{description}",
$"FileGen:\t{DateTime.UtcNow:yyyy-MM-dd HH:mm:ss} (UTC)",
};
AddCommentBlock(comments.ToArray());
// process each entry
var query = obj.Root.Descendants("game");
foreach (var g in query)
{
GameDB item = new GameDB();
item.Name = g.Value;
item.SHA1 = g.Elements("rom").First().Attribute("sha1").Value.ToUpper();
item.MD5 = g.Elements("rom").First().Attribute("md5").Value.ToUpper();
item.System = GameDB.GetSystemCode(SysType);
ParseNOINTROFlags(item);
Data.Add(item);
}
// add this file's data to the stringbuilder
// first we will sort into various ROMSTATUS groups
var working = Data.Skip(startIndex).ToList();
var baddump = working.Where(st => st.Status == "B").OrderBy(na => na.Name).ToList();
AddCommentBlock("Bad Dumps");
AppendCSVData(baddump);
var hack = working.Where(st => st.Status == "H").OrderBy(na => na.Name).ToList();
AddCommentBlock("Hacks");
AppendCSVData(hack);
var over = working.Where(st => st.Status == "O").OrderBy(na => na.Name).ToList();
AddCommentBlock("Over Dumps");
AppendCSVData(over);
var trans = working.Where(st => st.Status == "T").OrderBy(na => na.Name).ToList();
AddCommentBlock("Translated");
AppendCSVData(trans);
var good = working.Where(st => st.Status == "" || st.Status == null).OrderBy(na => na.Name).ToList();
AddCommentBlock("Believed Good");
AppendCSVData(good);
}
string result = sb.ToString();
return sb.ToString();
}
/// <summary>
/// Parses all the weird TOSEC flags within the game field
/// Detailed info here: https://www.tosecdev.org/tosec-naming-convention
/// Guts of this has been reused from here: https://github.com/Asnivor/MedLaunch/blob/master/MedLaunch/_Debug/DATDB/Platforms/TOSEC/StringConverterToSec.cs
/// </summary>
private void ParseNOINTROFlags(GameDB g)
{
string nameString = g.Name;
// remove uninteresting options
string a = RemoveUnneededOptions(nameString);
// process data contained in ()
string[] d = a.ToString().Split('(', ')');
if (d.Length > 0)
{
// name field
}
if (d.Length > 1)
{
if (d[1].Length >= 3)
{
// country
g.Region = d[1].Trim();
}
}
if (d.Length > 2)
{
// parse all other () fields
// because these are not mandatory this can be a confusing process
for (int i = 4; i < d.Length; i++)
{
string f = d[i].Trim();
// check for language
if (IsLanguageFlag(f) == true)
{
g.Notes = f;
continue;
}
// version - ignore
// check development status (not currently implemented)
if (IsDevelopmenttStatus(f) == true)
{
continue;
}
// check copyright status (not currently implemented)
if (IsCopyrightStatus(f) == true)
{
continue;
}
// country flag(s)
if (IsCountryFlag(f) == true)
{
g.Region = f;
continue;
}
// language - if present add to notes
if (IsLanguageFlag(f) == true)
{
g.Notes = f;
continue;
}
// Media Type - ignore for now
// Media Label - ignore for now
}
// process dump info flags and other info contained in []
if (nameString.Contains("[") && nameString.Contains("]"))
{
var e = nameString.Split('[', ']')
.Skip(1) // remove first entry (this is the bit before the [] entries start)
.Where(s => !string.IsNullOrWhiteSpace(s)) // remove empty entries
.Distinct()
.ToList();
if (e.Count > 0)
{
// bizhawk currently only has a few different RomStatus values (not as many as TOSEC anyway)
// Parsing priority will be:
// RomStatus.BadDump
// RomStatus.Hack
// RomStatus.Overdump
// RomStatus.GoodDump
// RomStatus.TranslatedRom
// everything else
// all tosec cr, h, t etc.. will fall under RomStatus.Hack
if (e.Where(str =>
// bad dump
str == "b" || str.StartsWith("b ")).ToList().Count > 0)
{
// RomStatus.BadDump
g.Status = "B";
}
else if (e.Where(str =>
// BIOS
str == "BIOS" || str.StartsWith("BIOS ")).ToList().Count > 0)
{
// RomStatus.BIOS
g.Status = "I";
}
else
{
g.Status = "";
}
}
}
}
}
public static bool IsDevelopmenttStatus(string s)
{
List<string> DS = new List<string>
{
"alpha", "beta", "preview", "pre-release", "proto"
};
bool b = DS.Any(s.Contains);
return b;
}
public static bool IsCopyrightStatus(string s)
{
List<string> CS = new List<string>
{
"CW", "CW-R", "FW", "GW", "GW-R", "LW", "PD", "SW", "SW-R"
};
bool b = CS.Any(s.Contains);
return b;
}
public static bool IsLanguageFlag(string s)
{
List<string> LC = new List<string>
{
"En", "Ja", "Fr", "De", "Es", "It", "Nl", "Pt", "Sv", "No", "Da", "Fi", "Zh", "Ko", "Pl"
};
bool b = false;
if (!s.Contains("[") && !s.Contains("]"))
{
foreach (var x in LC)
{
if (s == x || s.StartsWith(x + ",") || s.EndsWith("," + x))
{
b = true;
break;
}
}
//b = LC.Any(s.Contains);
}
return b;
}
public static bool IsCountryFlag(string s)
{
List<string> CC = new List<string>
{
"World", "Australia", "Brazil", "Canada", "China", "France", "Germany", "Hong Kong", "Italy",
"Japan", "Korea", "Netherlands", "Spain", "Sweden", "USA", "Europe", "Asia"
};
bool b = false;
if (!s.Contains("[") && !s.Contains("]"))
{
foreach (var x in CC)
{
if (s == x || s.StartsWith(x) || s.EndsWith(x))
{
b = true;
break;
}
}
//b = CC.Any(s.Contains);
}
return b;
}
public static string RemoveUnneededOptions(string nameString)
{
// Remove unneeded entries
string n = nameString
.Replace(" (demo) ", " ")
.Replace(" (demo-kiosk) ", " ")
.Replace(" (demo-playable) ", " ")
.Replace(" (demo-rolling) ", " ")
.Replace(" (demo-slideshow) ", " ");
return n;
}
}
}

View File

@ -1,376 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using System.Xml;
using System.Windows.Forms;
namespace BizHawk.Client.DBMan
{
public class TOSECParser : DATParser
{
/// <summary>
/// Required to generate a GameDB file
/// </summary>
public override SystemType SysType { get; set; }
private List<XDocument> xmls = new List<XDocument>();
public TOSECParser(SystemType type)
{
SysType = type;
}
/// <summary>
/// Parses multiple DAT files and returns a single GamesDB format csv string
/// </summary>
public override string ParseDAT(string[] filePath)
{
foreach (var s in filePath)
{
try
{
xmls.Add(XDocument.Load(s));
}
catch
{
var res = MessageBox.Show("Could not parse document as valid XML:\n\n" + s + "\n\nDo you wish to continue any other processing?", "Parsing Error", MessageBoxButtons.YesNo);
if (res != DialogResult.Yes)
return "";
}
}
int startIndex = 0;
// actual tosec parsing
foreach (var obj in xmls)
{
startIndex = Data.Count > 0 ? Data.Count - 1 : 0;
// get header info
var header = obj.Root.Descendants("header").First();
var category = header.Element("category").Value;
var name = header.Element("name").Value;
var version = header.Element("version").Value;
var description = header.Element("description").Value;
// start comment block
List<string> comments = new List<string>
{
$"Type:\t{category}",
$"Source:\t{description}",
$"FileGen:\t{DateTime.UtcNow:yyyy-MM-dd HH:mm:ss} (UTC)",
};
AddCommentBlock(comments.ToArray());
// process each entry
var query = obj.Root.Descendants("game");
foreach (var g in query)
{
GameDB item = new GameDB();
item.Name = g.Value;
item.SHA1 = g.Elements("rom").First().Attribute("sha1").Value.ToUpper();
item.MD5 = g.Elements("rom").First().Attribute("md5").Value.ToUpper();
item.System = GameDB.GetSystemCode(SysType);
ParseTOSECFlags(item);
Data.Add(item);
}
// add this file's data to the stringbuilder
// first we will sort into various ROMSTATUS groups
var working = Data.Skip(startIndex).ToList();
var baddump = working.Where(st => st.Status == "B").OrderBy(na => na.Name).ToList();
AddCommentBlock("Bad Dumps");
AppendCSVData(baddump);
var hack = working.Where(st => st.Status == "H").OrderBy(na => na.Name).ToList();
AddCommentBlock("Hacks");
AppendCSVData(hack);
var over = working.Where(st => st.Status == "O").OrderBy(na => na.Name).ToList();
AddCommentBlock("Over Dumps");
AppendCSVData(over);
var trans = working.Where(st => st.Status == "T").OrderBy(na => na.Name).ToList();
AddCommentBlock("Translated");
AppendCSVData(trans);
var pd = working.Where(st => st.Status == "D").OrderBy(na => na.Name).ToList();
AddCommentBlock("Home Brew");
AppendCSVData(pd);
var good = working.Where(st => st.Status == "" || st.Status == null).OrderBy(na => na.Name).ToList();
AddCommentBlock("Believed Good");
AppendCSVData(good);
}
string result = sb.ToString();
return sb.ToString();
}
/// <summary>
/// Parses all the weird TOSEC flags within the game field
/// Detailed info here: https://www.tosecdev.org/tosec-naming-convention
/// Guts of this has been reused from here: https://github.com/Asnivor/MedLaunch/blob/master/MedLaunch/_Debug/DATDB/Platforms/TOSEC/StringConverterToSec.cs
/// </summary>
private void ParseTOSECFlags(GameDB g)
{
string nameString = g.Name;
// remove uninteresting options
string a = RemoveUnneededOptions(nameString);
// process data contained in ()
string[] d = a.ToString().Split('(', ')');
if (d.Length > 0)
{
// name field
}
if (d.Length > 1)
{
if (d[1].Length > 3)
{
// year field
}
}
if (d.Length > 3)
{
// publisher field
}
// public domain
if (nameString.Contains("(PD)"))
{
g.Status = "D";
}
if (d.Length > 4)
{
// parse all other () fields
// because these are not mandatory this can be a confusing process
for (int i = 4; i < d.Length; i++)
{
string f = d[i];
// system field
if (f == "Aladdin Deck Enhancer" ||
f == "PlayChoice-10" ||
f == "VS DualSystem" ||
f == "VS UniSystem")
{
// ignore for now (not currently implemented)
continue;
}
// country flag(s)
if (IsCountryFlag(f) == true)
{
g.Region = f;
continue;
}
// language - if present add to notes
if (IsLanguageFlag(f) == true)
{
g.Notes = f;
continue;
}
// check copyright status (not currently implemented)
if (IsCopyrightStatus(f) == true)
{
continue;
}
// check development status (not currently implemented)
if (IsDevelopmenttStatus(f) == true)
{
continue;
}
// Media Type - ignore for now
// Media Label - ignore for now
}
// process dump info flags and other info contained in []
if (nameString.Contains("[") && nameString.Contains("]"))
{
var e = nameString.Split('[', ']')
.Skip(1) // remove first entry (this is the bit before the [] entries start)
.Where(s => !string.IsNullOrWhiteSpace(s)) // remove empty entries
.Distinct()
.ToList();
if (e.Count > 0)
{
// bizhawk currently only has a few different RomStatus values (not as many as TOSEC anyway)
// Parsing priority will be:
// RomStatus.BadDump
// RomStatus.Hack
// RomStatus.Overdump
// RomStatus.GoodDump
// RomStatus.TranslatedRom
// everything else
// all tosec cr, h, t etc.. will fall under RomStatus.Hack
if (e.Where(str =>
// bad dump
str == "b" || str.StartsWith("b ") ||
// virus
str == "v" || str.StartsWith("v ") ||
// under dump
str == "u" || str.StartsWith("u ")).ToList().Count > 0)
{
// RomStatus.BadDump
g.Status = "B";
}
else if (e.Where(str =>
// cracked
str == "cr" || str.StartsWith("cr ") ||
// fixed
str == "f" || str.StartsWith("f ") ||
// hack
str == "h" || str.StartsWith("h ") ||
// modified
str == "m" || str.StartsWith("m ") ||
// pirated
str == "p" || str.StartsWith("p ") ||
// trained
str == "t" || str.StartsWith("t ")
).ToList().Count > 0)
{
// RomStatus.Hack
g.Status = "H";
}
else if (e.Where(str =>
// over dump
str == "o" || str.StartsWith("o ")).ToList().Count > 0)
{
// RomStatus.Overdump
g.Status = "O";
}
else if (e.Where(str =>
// known verified dump
str == "!").ToList().Count > 0)
{
// RomStatus.GoodDump
g.Status = "";
}
else if (e.Where(str =>
// translated
str == "tr" || str.StartsWith("tr ")).ToList().Count > 0)
{
// RomStatus.TranslatedRom
g.Status = "T";
}
}
}
}
}
public static bool IsDevelopmenttStatus(string s)
{
List<string> DS = new List<string>
{
"alpha", "beta", "preview", "pre-release", "proto"
};
bool b = DS.Any(s.Contains);
return b;
}
public static bool IsCopyrightStatus(string s)
{
List<string> CS = new List<string>
{
"CW", "CW-R", "FW", "GW", "GW-R", "LW", "PD", "SW", "SW-R"
};
bool b = CS.Any(s.Contains);
return b;
}
public static bool IsLanguageFlag(string s)
{
List<string> LC = new List<string>
{
"ar", "bg", "bs", "cs", "cy", "da", "de", "el", "en", "eo", "es", "et", "fa", "fi", "fr", "ga",
"gu", "he", "hi", "hr", "hu", "is", "it", "ja", "ko", "lt", "lv", "ms", "nl", "no", "pl", "pt",
"ro", "ru", "sk", "sl", "sq", "sr", "sv", "th", "tr", "ur", "vi", "yi", "zh", "M1", "M2", "M3",
"M4", "M5", "M6", "M7", "M8", "M9"
};
bool b = false;
if (!s.Contains("[") && !s.Contains("]"))
{
foreach (var x in LC)
{
if (s == x || s.StartsWith(x) || s.EndsWith(x))
{
b = true;
break;
}
}
//b = LC.Any(s.Contains);
}
return b;
}
public static bool IsCountryFlag(string s)
{
List<string> CC = new List<string>
{
"AE", "AL", "AS", "AT", "AU", "BA", "BE", "BG", "BR", "CA", "CH", "CL", "CN", "CS", "CY", "CZ",
"DE", "DK", "EE", "EG", "EU", "ES", "FI", "FR", "GB", "GR", "HK", "HR", "HU", "ID", "IE", "IL",
"IN", "IR", "IS", "IT", "JO", "JP", "KR", "LT", "LU", "LV", "MN", "MX", "MY", "NL", "NO", "NP",
"NZ", "OM", "PE", "PH", "PL", "PT", "QA", "RO", "RU", "SE", "SG", "SI", "SK", "TH", "TR", "TW",
"US", "VN", "YU", "ZA"
};
bool b = false;
if (!s.Contains("[") && !s.Contains("]"))
{
foreach (var x in CC)
{
if (s == x || s.StartsWith(x) || s.EndsWith(x))
{
b = true;
break;
}
}
//b = CC.Any(s.Contains);
}
return b;
}
public static string RemoveUnneededOptions(string nameString)
{
// Remove unneeded entries
string n = nameString
.Replace(" (demo) ", " ")
.Replace(" (demo-kiosk) ", " ")
.Replace(" (demo-playable) ", " ")
.Replace(" (demo-rolling) ", " ")
.Replace(" (demo-slideshow) ", " ");
return n;
}
}
}

View File

@ -1,456 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Community.CsharpSqlite.SQLiteClient;
namespace BizHawk.Client.DBMan
{
public class Rom
{
public long RomId;
public string CRC32;
public string MD5;
public string SHA1;
public string System;
public string Name;
public string Region;
public string VersionTags;
public string RomMetadata;
public string RomStatus;
public string Catalog;
public long Size;
public DateTime Created;
public DateTime Modified;
public override string ToString() { return Name + " " + VersionTags; }
public Game Game;
public string CombinedMetaData
{
get
{
if (Game == null) return RomMetadata;
if (Game.GameMetadata == null) return RomMetadata;
if (RomMetadata == null) return Game.GameMetadata;
return Game.GameMetadata + ";" + RomMetadata;
}
}
public string SizeFriendly => $"{Size} bytes ({Size >> 10}k)";
public bool New { get { return (Created > Modified); } }
public string NameWithTheFlipped
{
get
{
if (!Name.EndsWith(", The")) return Name;
return "The "+Name.Substring(0, Name.Length-5);
}
}
public string SortString()
{
var ret = "";
if (Game.Classification == "Firmware") ret += "[BIOS] ";
if (Game.Classification == "Homebrew") ret += "[Homebrew] ";
if (Game.Classification == "Test Rom") ret += "[Test ROM] ";
ret += Name;
ret += "|" + RegionRank + "|" + VersionTags;
return ret;
}
public string DisplayName
{
get
{
var ret = "";
if (Game.Classification == "Firmware") ret += "[BIOS] ";
if (Game.Classification == "Homebrew") ret += "[Homebrew] ";
if (Game.Classification == "Test Rom") ret += "[Test ROM] ";
ret += Name;
return ret;
}
}
public int RegionRank
{
get
{
if (String.IsNullOrEmpty(Region)) return 99;
if (Region.Contains("World")) return 1;
if (Region.Contains("USA")) return 2;
if (Region.Contains("Europe")) return 3;
if (Region.Contains("Japan")) return 4;
return Region.GetHashCode();
}
}
}
public class Game
{
public long GameId;
public string System;
public string Name;
public string Developer;
public string Publisher;
public string Classification;
public string ReleaseDate;
public string Players;
public string GameMetadata;
public string Tags;
public string AltNames;
public string Notes;
public DateTime Created;
public DateTime Modified;
public override string ToString() { return Name; }
}
public static class DB
{
public static List<Rom> Roms = new List<Rom>();
public static List<Game> Games = new List<Game>();
public static Dictionary<string, Game> GameMap = new Dictionary<string, Game>();
public static SqliteConnection Con;
public static void LoadDbForSystem(string system)
{
Games.Clear();
Roms.Clear();
LoadGames(system);
LoadRoms(system);
}
static void LoadGames(string system)
{
var cmd = Con.CreateCommand();
cmd.CommandText =
"SELECT game_id, system, name, developer, publisher, classification, release_date, players, game_metadata, tags, alternate_names, notes "+
"FROM game "+
"WHERE system = @System";
cmd.Parameters.Add(new SqliteParameter("@System", system));
var reader = cmd.ExecuteReader();
while (reader.NextResult())
{
var game = new Game();
game.GameId = reader.GetInt64(0);
game.System = reader.GetString(1);
game.Name = reader.GetString(2);
game.Developer = reader.GetString(3);
game.Publisher = reader.GetString(4);
game.Classification = reader.GetString(5);
game.ReleaseDate = reader.GetString(6);
game.Players = reader.GetString(7);
game.GameMetadata = reader.GetString(8);
game.Tags = reader.GetString(9);
game.AltNames = reader.GetString(10);
game.Notes = reader.GetString(11);
Games.Add(game);
GameMap[game.Name] = game;
}
reader.Dispose();
cmd.Dispose();
}
static void LoadRoms(string system)
{
var cmd = Con.CreateCommand();
cmd.CommandText =
"SELECT rom_id, crc32, md5, sha1, system, name, region, version_tags, rom_metadata, rom_status, catalog, size, created_date, modified_date " +
"FROM rom " +
"WHERE system = @System";
cmd.Parameters.Add(new SqliteParameter("@System", system));
var reader = cmd.ExecuteReader();
while (reader.NextResult())
{
var rom = new Rom();
rom.RomId = reader.GetInt64(0);
rom.CRC32 = reader.GetString(1);
rom.MD5 = reader.GetString(2);
rom.SHA1 = reader.GetString(3);
rom.System = reader.GetString(4);
rom.Name = reader.GetString(5);
rom.Region = reader.GetString(6);
rom.VersionTags = reader.GetString(7);
rom.RomMetadata = reader.GetString(8);
rom.RomStatus = reader.GetString(9);
rom.Catalog = reader.GetString(10);
rom.Size = reader.GetInt64(11);
rom.Created = reader.GetDateTime(12);
rom.Modified = reader.GetDateTime(13);
rom.Game = GameMap[rom.Name];
Roms.Add(rom);
}
reader.Dispose();
cmd.Dispose();
Roms = Roms.OrderBy(x=>x.SortString()).ToList();
}
public static void SaveRom(Rom rom)
{
var cmd = Con.CreateCommand();
cmd.CommandText =
"UPDATE rom SET "+
"region=@Region, "+
"version_tags=@VersionTags, "+
"rom_metadata=@RomMetadata, "+
"rom_status=@RomStatus, "+
"catalog=@Catalog, " +
"modified_date=datetime('now','localtime') " +
"WHERE rom_id=@RomId";
cmd.Parameters.Add(new SqliteParameter("@Region", rom.Region));
cmd.Parameters.Add(new SqliteParameter("@VersionTags", rom.VersionTags));
cmd.Parameters.Add(new SqliteParameter("@RomMetadata", rom.RomMetadata));
cmd.Parameters.Add(new SqliteParameter("@RomStatus", rom.RomStatus));
cmd.Parameters.Add(new SqliteParameter("@Catalog", rom.Catalog));
cmd.Parameters.Add(new SqliteParameter("@RomId", rom.RomId));
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = Con.CreateCommand();
cmd.CommandText =
"UPDATE game SET "+
"developer=@Developer, "+
"publisher=@Publisher, "+
"classification=@Classification, "+
"release_date=@ReleaseDate, "+
"players=@Players, "+
"game_metadata=@GameMetadata, "+
"tags=@Tags, "+
"alternate_names=@AltNames, "+
"notes=@Notes, "+
"modified_date=datetime('now','localtime') " +
"WHERE game_id=@GameId";
cmd.Parameters.Add(new SqliteParameter("@Developer", rom.Game.Developer));
cmd.Parameters.Add(new SqliteParameter("@Publisher", rom.Game.Publisher));
cmd.Parameters.Add(new SqliteParameter("@Classification", rom.Game.Classification));
cmd.Parameters.Add(new SqliteParameter("@ReleaseDate", rom.Game.ReleaseDate));
cmd.Parameters.Add(new SqliteParameter("@Players", rom.Game.Players));
cmd.Parameters.Add(new SqliteParameter("@GameMetadata", rom.Game.GameMetadata));
cmd.Parameters.Add(new SqliteParameter("@Tags", rom.Game.Tags));
cmd.Parameters.Add(new SqliteParameter("@AltNames", rom.Game.AltNames));
cmd.Parameters.Add(new SqliteParameter("@Notes", rom.Game.Notes));
cmd.Parameters.Add(new SqliteParameter("@GameId", rom.Game.GameId));
cmd.ExecuteNonQuery();
cmd.Dispose();
}
public static void SaveRom1(Rom rom, string origSystem, string origName)
{
// Does this game already exist?
var game = GameExists(rom.System, rom.Name);
if (game != null) // existing game with this system/name already exists. we'll merge to it. (existing game wins)
{
DeleteGame(origSystem, origName);
rom.Game = game;
}
var cmd = Con.CreateCommand();
cmd.CommandText =
"UPDATE rom SET " +
"system=@System, " +
"name=@Name " +
"WHERE system=@OrigSystem and name=@OrigName";
cmd.Parameters.Add(new SqliteParameter("@System", rom.System));
cmd.Parameters.Add(new SqliteParameter("@Name", rom.Name));
cmd.Parameters.Add(new SqliteParameter("@OrigSystem", origSystem));
cmd.Parameters.Add(new SqliteParameter("@OrigName", origName));
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = Con.CreateCommand();
cmd.CommandText =
"UPDATE game SET " +
"system=@System, " +
"name=@Name " +
"WHERE system=@OrigSystem and name=@OrigName";
cmd.Parameters.Add(new SqliteParameter("@System", rom.System));
cmd.Parameters.Add(new SqliteParameter("@Name", rom.Name));
cmd.Parameters.Add(new SqliteParameter("@OrigSystem", origSystem));
cmd.Parameters.Add(new SqliteParameter("@OrigName", origName));
cmd.ExecuteNonQuery();
cmd.Dispose();
SaveRom(rom);
}
public static void SaveRom2(Rom rom)
{
var cmd = Con.CreateCommand();
cmd.CommandText =
"UPDATE rom SET " +
"system=@System, "+
"name=@Name, "+
"region=@Region, " +
"version_tags=@VersionTags, " +
"rom_metadata=@RomMetadata, " +
"rom_status=@RomStatus, " +
"catalog=@Catalog, " +
"modified_date=datetime('now','localtime') " +
"WHERE rom_id=@RomId";
cmd.Parameters.Add(new SqliteParameter("@System", rom.System));
cmd.Parameters.Add(new SqliteParameter("@Name", rom.Name));
cmd.Parameters.Add(new SqliteParameter("@Region", rom.Region));
cmd.Parameters.Add(new SqliteParameter("@VersionTags", rom.VersionTags));
cmd.Parameters.Add(new SqliteParameter("@RomMetadata", rom.RomMetadata));
cmd.Parameters.Add(new SqliteParameter("@RomStatus", rom.RomStatus));
cmd.Parameters.Add(new SqliteParameter("@Catalog", rom.Catalog));
cmd.Parameters.Add(new SqliteParameter("@RomId", rom.RomId));
cmd.ExecuteNonQuery();
cmd.Dispose();
bool gameAlreadyExists = false;
cmd = Con.CreateCommand();
cmd.CommandText = "SELECT game_id FROM game WHERE system=@System and name=@Name";
cmd.Parameters.Add(new SqliteParameter("@System", rom.System));
cmd.Parameters.Add(new SqliteParameter("@Name", rom.Name));
gameAlreadyExists = cmd.ExecuteScalar() != null;
cmd.Dispose();
if (!gameAlreadyExists)
{
cmd = Con.CreateCommand();
cmd.CommandText = "INSERT INTO game (system, name, created_date) values (@System, @Name, datetime('now','localtime'))";
cmd.Parameters.Add(new SqliteParameter("@System", rom.System));
cmd.Parameters.Add(new SqliteParameter("@Name", rom.Name));
cmd.ExecuteNonQuery();
cmd.Dispose();
}
cmd = Con.CreateCommand();
cmd.CommandText =
"UPDATE game SET " +
"developer=@Developer, " +
"publisher=@Publisher, " +
"classification=@Classification, " +
"release_date=@ReleaseDate, " +
"players=@Players, " +
"game_metadata=@GameMetadata, " +
"tags=@Tags, " +
"alternate_names=@AltNames, " +
"notes=@Notes, " +
"modified_date=datetime('now','localtime') " +
"WHERE system=@System and name=@Name";
cmd.Parameters.Add(new SqliteParameter("@Developer", rom.Game.Developer));
cmd.Parameters.Add(new SqliteParameter("@Publisher", rom.Game.Publisher));
cmd.Parameters.Add(new SqliteParameter("@Classification", rom.Game.Classification));
cmd.Parameters.Add(new SqliteParameter("@ReleaseDate", rom.Game.ReleaseDate));
cmd.Parameters.Add(new SqliteParameter("@Players", rom.Game.Players));
cmd.Parameters.Add(new SqliteParameter("@GameMetadata", rom.Game.GameMetadata));
cmd.Parameters.Add(new SqliteParameter("@Tags", rom.Game.Tags));
cmd.Parameters.Add(new SqliteParameter("@System", rom.System));
cmd.Parameters.Add(new SqliteParameter("@Name", rom.Name));
cmd.Parameters.Add(new SqliteParameter("@AltNames", rom.Game.AltNames));
cmd.Parameters.Add(new SqliteParameter("@Notes", rom.Game.Notes));
cmd.ExecuteNonQuery();
cmd.Dispose();
}
public static void Cleanup()
{
var orphanedGameList = new List<Tuple<string, string>>();
var cmd = Con.CreateCommand();
cmd.CommandText =
"SELECT system, name FROM game "+
"EXCEPT "+
"SELECT system, name FROM rom";
var reader = cmd.ExecuteReader();
while (reader.NextResult())
{
string system = reader.GetString(0);
string name = reader.GetString(1);
orphanedGameList.Add(new Tuple<string, string>(system, name));
}
reader.Dispose();
cmd.Dispose();
cmd = Con.CreateCommand();
cmd.CommandText = "DELETE FROM game WHERE system=@System and name=@Name";
foreach (var orphanedGame in orphanedGameList)
{
cmd.Parameters.Clear();
cmd.Parameters.Add(new SqliteParameter("@System", orphanedGame.Item1));
cmd.Parameters.Add(new SqliteParameter("@Name", orphanedGame.Item2));
cmd.ExecuteNonQuery();
}
cmd.Dispose();
cmd = Con.CreateCommand();
cmd.CommandText = "VACUUM";
cmd.ExecuteNonQuery();
cmd.Dispose();
}
public static List<string> GetDeveloperPublisherNames()
{
var names = new List<string>();
var cmd = Con.CreateCommand();
cmd.CommandText =
"SELECT DISTINCT developer FROM game WHERE developer is not null and classification not in ('Homebrew','Test Rom')" +
"UNION " +
"SELECT DISTINCT publisher FROM game WHERE publisher is not null and classification not in ('Homebrew','Test Rom')";
var reader = cmd.ExecuteReader();
while (reader.NextResult())
{
names.Add(reader.GetString(0));
}
reader.Dispose();
cmd.Dispose();
return names;
}
static Game GameExists(string system, string name)
{
var game = new Game();
var cmd = Con.CreateCommand();
cmd.CommandText = "SELECT game_id, system, name, developer, publisher, classification, release_date, players, game_metadata, tags, alternate_names, notes FROM game WHERE system = @System and name = @Name";
cmd.Parameters.Add(new SqliteParameter("@System", system));
cmd.Parameters.Add(new SqliteParameter("@Name", name));
var reader = cmd.ExecuteReader();
if (reader.NextResult())
{
game.GameId = reader.GetInt64(0);
game.System = reader.GetString(1);
game.Name = reader.GetString(2);
game.Developer = reader.GetString(3);
game.Publisher = reader.GetString(4);
game.Classification = reader.GetString(5);
game.ReleaseDate = reader.GetString(6);
game.Players = reader.GetString(7);
game.GameMetadata = reader.GetString(8);
game.Tags = reader.GetString(9);
game.AltNames = reader.GetString(10);
game.Notes = reader.GetString(11);
}
reader.Dispose();
cmd.Dispose();
if (game.GameId == 0) return null;
return game;
}
static void DeleteGame(string system, string name)
{
var cmd = Con.CreateCommand();
cmd.CommandText = "DELETE FROM game WHERE system=@System and name=@Name";
cmd.Parameters.Add(new SqliteParameter("@System", system));
cmd.Parameters.Add(new SqliteParameter("@Name", name));
cmd.ExecuteNonQuery();
cmd.Dispose();
}
public static void DeleteRom(Rom rom)
{
var cmd = Con.CreateCommand();
cmd.CommandText = "DELETE FROM rom WHERE md5 = @Md5";
cmd.Parameters.Add(new SqliteParameter("@Md5", rom.MD5));
cmd.ExecuteNonQuery();
cmd.Dispose();
}
}
}

View File

@ -1,793 +0,0 @@
namespace BizHawk.Client.DBMan
{
partial class DBMan_MainForm
{
/// <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.filterPanel = new System.Windows.Forms.Panel();
this.whereLabel = new System.Windows.Forms.Label();
this.systemBox = new System.Windows.Forms.ComboBox();
this.whereBox = new System.Windows.Forms.TextBox();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.romListView = new System.Windows.Forms.ListView();
this.romListColumnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.romListColumnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.romListColumnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.romListColumnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.romListColumnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.detailPanel = new System.Windows.Forms.Panel();
this.sizeLabel = new System.Windows.Forms.Label();
this.sizeBox = new System.Windows.Forms.TextBox();
this.notesLabel = new System.Windows.Forms.Label();
this.notesBox = new System.Windows.Forms.TextBox();
this.altNamesLabel = new System.Windows.Forms.Label();
this.altNamesBox = new System.Windows.Forms.TextBox();
this.cancelButton = new System.Windows.Forms.Button();
this.saveButton = new System.Windows.Forms.Button();
this.playersBox = new System.Windows.Forms.TextBox();
this.catalogLabel = new System.Windows.Forms.Label();
this.catalogBox = new System.Windows.Forms.TextBox();
this.playersLabel = new System.Windows.Forms.Label();
this.releaseDateLabel = new System.Windows.Forms.Label();
this.releaseDateBox = new System.Windows.Forms.TextBox();
this.classificationLabel = new System.Windows.Forms.Label();
this.classificationBox = new System.Windows.Forms.ComboBox();
this.publisherLabel = new System.Windows.Forms.Label();
this.publisherBox = new System.Windows.Forms.TextBox();
this.developerLabel = new System.Windows.Forms.Label();
this.developerBox = new System.Windows.Forms.TextBox();
this.romStatusLabel = new System.Windows.Forms.Label();
this.romStatusBox = new System.Windows.Forms.ComboBox();
this.tagsLabel = new System.Windows.Forms.Label();
this.tagsBox = new System.Windows.Forms.TextBox();
this.romMetaLabel = new System.Windows.Forms.Label();
this.romMetaBox = new System.Windows.Forms.TextBox();
this.gameMetaLabel = new System.Windows.Forms.Label();
this.gameMetaBox = new System.Windows.Forms.TextBox();
this.versionLabel = new System.Windows.Forms.Label();
this.versionBox = new System.Windows.Forms.TextBox();
this.regionLabel = new System.Windows.Forms.Label();
this.regionBox = new System.Windows.Forms.TextBox();
this.sha1Box = new System.Windows.Forms.TextBox();
this.md5Box = new System.Windows.Forms.TextBox();
this.crcBox = new System.Windows.Forms.TextBox();
this.sha1Label = new System.Windows.Forms.Label();
this.md5Label = new System.Windows.Forms.Label();
this.crcLabel = new System.Windows.Forms.Label();
this.gameSystemBox = new System.Windows.Forms.ComboBox();
this.systemLabel = new System.Windows.Forms.Label();
this.nameBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.mainMenuStrip = new System.Windows.Forms.MenuStrip();
this.databaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.directoryScanToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.cleanupDBToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportGameDBToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.deleteButton = new System.Windows.Forms.Button();
this.filterPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.detailPanel.SuspendLayout();
this.mainMenuStrip.SuspendLayout();
this.SuspendLayout();
//
// filterPanel
//
this.filterPanel.Controls.Add(this.whereLabel);
this.filterPanel.Controls.Add(this.systemBox);
this.filterPanel.Controls.Add(this.whereBox);
this.filterPanel.Controls.Add(this.menuStrip1);
this.filterPanel.Dock = System.Windows.Forms.DockStyle.Top;
this.filterPanel.Location = new System.Drawing.Point(0, 24);
this.filterPanel.Name = "filterPanel";
this.filterPanel.Size = new System.Drawing.Size(963, 30);
this.filterPanel.TabIndex = 0;
//
// whereLabel
//
this.whereLabel.AutoSize = true;
this.whereLabel.Location = new System.Drawing.Point(131, 9);
this.whereLabel.Name = "whereLabel";
this.whereLabel.Size = new System.Drawing.Size(42, 13);
this.whereLabel.TabIndex = 2;
this.whereLabel.Text = "Where:";
//
// systemBox
//
this.systemBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.systemBox.FormattingEnabled = true;
this.systemBox.Location = new System.Drawing.Point(4, 3);
this.systemBox.Name = "systemBox";
this.systemBox.Size = new System.Drawing.Size(121, 21);
this.systemBox.TabIndex = 1;
this.systemBox.SelectedIndexChanged += new System.EventHandler(this.systemBox_SelectedIndexChanged);
//
// whereBox
//
this.whereBox.Location = new System.Drawing.Point(179, 3);
this.whereBox.Name = "whereBox";
this.whereBox.Size = new System.Drawing.Size(334, 20);
this.whereBox.TabIndex = 2;
//
// menuStrip1
//
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(963, 24);
this.menuStrip1.TabIndex = 3;
this.menuStrip1.Text = "menuStrip1";
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 54);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.romListView);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.detailPanel);
this.splitContainer1.Size = new System.Drawing.Size(963, 624);
this.splitContainer1.SplitterDistance = 561;
this.splitContainer1.TabIndex = 0;
this.splitContainer1.TabStop = false;
//
// romListView
//
this.romListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.romListColumnHeader1,
this.romListColumnHeader2,
this.romListColumnHeader3,
this.romListColumnHeader4,
this.romListColumnHeader5});
this.romListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.romListView.FullRowSelect = true;
this.romListView.GridLines = true;
this.romListView.Location = new System.Drawing.Point(0, 0);
this.romListView.MultiSelect = false;
this.romListView.Name = "romListView";
this.romListView.Size = new System.Drawing.Size(561, 624);
this.romListView.TabIndex = 0;
this.romListView.TabStop = false;
this.romListView.UseCompatibleStateImageBehavior = false;
this.romListView.View = System.Windows.Forms.View.Details;
this.romListView.SelectedIndexChanged += new System.EventHandler(this.selectedRomChanged);
//
// romListColumnHeader1
//
this.romListColumnHeader1.Text = "Game";
this.romListColumnHeader1.Width = 86;
//
// romListColumnHeader2
//
this.romListColumnHeader2.Text = "Region";
this.romListColumnHeader2.Width = 80;
//
// romListColumnHeader3
//
this.romListColumnHeader3.Text = "Version";
this.romListColumnHeader3.Width = 80;
//
// romListColumnHeader4
//
this.romListColumnHeader4.Text = "Meta";
this.romListColumnHeader4.Width = 80;
//
// romListColumnHeader5
//
this.romListColumnHeader5.Text = "Tags";
//
// detailPanel
//
this.detailPanel.Controls.Add(this.deleteButton);
this.detailPanel.Controls.Add(this.sizeLabel);
this.detailPanel.Controls.Add(this.sizeBox);
this.detailPanel.Controls.Add(this.notesLabel);
this.detailPanel.Controls.Add(this.notesBox);
this.detailPanel.Controls.Add(this.altNamesLabel);
this.detailPanel.Controls.Add(this.altNamesBox);
this.detailPanel.Controls.Add(this.cancelButton);
this.detailPanel.Controls.Add(this.saveButton);
this.detailPanel.Controls.Add(this.playersBox);
this.detailPanel.Controls.Add(this.catalogLabel);
this.detailPanel.Controls.Add(this.catalogBox);
this.detailPanel.Controls.Add(this.playersLabel);
this.detailPanel.Controls.Add(this.releaseDateLabel);
this.detailPanel.Controls.Add(this.releaseDateBox);
this.detailPanel.Controls.Add(this.classificationLabel);
this.detailPanel.Controls.Add(this.classificationBox);
this.detailPanel.Controls.Add(this.publisherLabel);
this.detailPanel.Controls.Add(this.publisherBox);
this.detailPanel.Controls.Add(this.developerLabel);
this.detailPanel.Controls.Add(this.developerBox);
this.detailPanel.Controls.Add(this.romStatusLabel);
this.detailPanel.Controls.Add(this.romStatusBox);
this.detailPanel.Controls.Add(this.tagsLabel);
this.detailPanel.Controls.Add(this.tagsBox);
this.detailPanel.Controls.Add(this.romMetaLabel);
this.detailPanel.Controls.Add(this.romMetaBox);
this.detailPanel.Controls.Add(this.gameMetaLabel);
this.detailPanel.Controls.Add(this.gameMetaBox);
this.detailPanel.Controls.Add(this.versionLabel);
this.detailPanel.Controls.Add(this.versionBox);
this.detailPanel.Controls.Add(this.regionLabel);
this.detailPanel.Controls.Add(this.regionBox);
this.detailPanel.Controls.Add(this.sha1Box);
this.detailPanel.Controls.Add(this.md5Box);
this.detailPanel.Controls.Add(this.crcBox);
this.detailPanel.Controls.Add(this.sha1Label);
this.detailPanel.Controls.Add(this.md5Label);
this.detailPanel.Controls.Add(this.crcLabel);
this.detailPanel.Controls.Add(this.gameSystemBox);
this.detailPanel.Controls.Add(this.systemLabel);
this.detailPanel.Controls.Add(this.nameBox);
this.detailPanel.Controls.Add(this.nameLabel);
this.detailPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.detailPanel.Location = new System.Drawing.Point(0, 0);
this.detailPanel.Name = "detailPanel";
this.detailPanel.Size = new System.Drawing.Size(398, 624);
this.detailPanel.TabIndex = 0;
//
// sizeLabel
//
this.sizeLabel.AutoSize = true;
this.sizeLabel.Location = new System.Drawing.Point(6, 557);
this.sizeLabel.Name = "sizeLabel";
this.sizeLabel.Size = new System.Drawing.Size(27, 13);
this.sizeLabel.TabIndex = 50;
this.sizeLabel.Text = "Size";
//
// sizeBox
//
this.sizeBox.Location = new System.Drawing.Point(80, 557);
this.sizeBox.Name = "sizeBox";
this.sizeBox.ReadOnly = true;
this.sizeBox.Size = new System.Drawing.Size(255, 20);
this.sizeBox.TabIndex = 49;
//
// notesLabel
//
this.notesLabel.AutoSize = true;
this.notesLabel.Location = new System.Drawing.Point(3, 408);
this.notesLabel.Name = "notesLabel";
this.notesLabel.Size = new System.Drawing.Size(35, 13);
this.notesLabel.TabIndex = 48;
this.notesLabel.Text = "Notes";
//
// notesBox
//
this.notesBox.Location = new System.Drawing.Point(80, 408);
this.notesBox.Multiline = true;
this.notesBox.Name = "notesBox";
this.notesBox.Size = new System.Drawing.Size(296, 61);
this.notesBox.TabIndex = 44;
//
// altNamesLabel
//
this.altNamesLabel.AutoSize = true;
this.altNamesLabel.Location = new System.Drawing.Point(3, 381);
this.altNamesLabel.Name = "altNamesLabel";
this.altNamesLabel.Size = new System.Drawing.Size(55, 13);
this.altNamesLabel.TabIndex = 46;
this.altNamesLabel.Text = "Alt Names";
//
// altNamesBox
//
this.altNamesBox.Location = new System.Drawing.Point(80, 381);
this.altNamesBox.Name = "altNamesBox";
this.altNamesBox.Size = new System.Drawing.Size(296, 20);
this.altNamesBox.TabIndex = 42;
//
// cancelButton
//
this.cancelButton.Location = new System.Drawing.Point(125, 589);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 48;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// saveButton
//
this.saveButton.Location = new System.Drawing.Point(6, 589);
this.saveButton.Name = "saveButton";
this.saveButton.Size = new System.Drawing.Size(75, 23);
this.saveButton.TabIndex = 46;
this.saveButton.Text = "&Save";
this.saveButton.UseVisualStyleBackColor = true;
this.saveButton.Click += new System.EventHandler(this.saveButton_Click);
//
// playersBox
//
this.playersBox.AutoCompleteCustomSource.AddRange(new string[] {
"1 Player",
"2 Players Alternating",
"2 Players Cooperative",
"2 Players Versus"});
this.playersBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
this.playersBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
this.playersBox.Location = new System.Drawing.Point(80, 326);
this.playersBox.Name = "playersBox";
this.playersBox.Size = new System.Drawing.Size(194, 20);
this.playersBox.TabIndex = 38;
//
// catalogLabel
//
this.catalogLabel.AutoSize = true;
this.catalogLabel.Location = new System.Drawing.Point(3, 354);
this.catalogLabel.Name = "catalogLabel";
this.catalogLabel.Size = new System.Drawing.Size(43, 13);
this.catalogLabel.TabIndex = 41;
this.catalogLabel.Text = "Catalog";
//
// catalogBox
//
this.catalogBox.Location = new System.Drawing.Point(80, 354);
this.catalogBox.Name = "catalogBox";
this.catalogBox.Size = new System.Drawing.Size(194, 20);
this.catalogBox.TabIndex = 40;
//
// playersLabel
//
this.playersLabel.AutoSize = true;
this.playersLabel.Location = new System.Drawing.Point(3, 326);
this.playersLabel.Name = "playersLabel";
this.playersLabel.Size = new System.Drawing.Size(41, 13);
this.playersLabel.TabIndex = 39;
this.playersLabel.Text = "Players";
//
// releaseDateLabel
//
this.releaseDateLabel.AutoSize = true;
this.releaseDateLabel.Location = new System.Drawing.Point(3, 299);
this.releaseDateLabel.Name = "releaseDateLabel";
this.releaseDateLabel.Size = new System.Drawing.Size(48, 13);
this.releaseDateLabel.TabIndex = 37;
this.releaseDateLabel.Text = "Rls Date";
//
// releaseDateBox
//
this.releaseDateBox.Location = new System.Drawing.Point(80, 299);
this.releaseDateBox.Name = "releaseDateBox";
this.releaseDateBox.Size = new System.Drawing.Size(100, 20);
this.releaseDateBox.TabIndex = 36;
//
// classificationLabel
//
this.classificationLabel.AutoSize = true;
this.classificationLabel.Location = new System.Drawing.Point(3, 271);
this.classificationLabel.Name = "classificationLabel";
this.classificationLabel.Size = new System.Drawing.Size(32, 13);
this.classificationLabel.TabIndex = 35;
this.classificationLabel.Text = "Class";
//
// classificationBox
//
this.classificationBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.classificationBox.FormattingEnabled = true;
this.classificationBox.Items.AddRange(new object[] {
"Licensed",
"Unlicensed",
"Unreleased",
"Homebrew",
"Test Rom",
"Firmware"});
this.classificationBox.Location = new System.Drawing.Point(80, 271);
this.classificationBox.Name = "classificationBox";
this.classificationBox.Size = new System.Drawing.Size(121, 21);
this.classificationBox.TabIndex = 34;
//
// publisherLabel
//
this.publisherLabel.AutoSize = true;
this.publisherLabel.Location = new System.Drawing.Point(3, 244);
this.publisherLabel.Name = "publisherLabel";
this.publisherLabel.Size = new System.Drawing.Size(50, 13);
this.publisherLabel.TabIndex = 33;
this.publisherLabel.Text = "Publisher";
//
// publisherBox
//
this.publisherBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
this.publisherBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
this.publisherBox.Location = new System.Drawing.Point(80, 244);
this.publisherBox.Name = "publisherBox";
this.publisherBox.Size = new System.Drawing.Size(194, 20);
this.publisherBox.TabIndex = 32;
//
// developerLabel
//
this.developerLabel.AutoSize = true;
this.developerLabel.Location = new System.Drawing.Point(3, 217);
this.developerLabel.Name = "developerLabel";
this.developerLabel.Size = new System.Drawing.Size(56, 13);
this.developerLabel.TabIndex = 31;
this.developerLabel.Text = "Developer";
//
// developerBox
//
this.developerBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
this.developerBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
this.developerBox.Location = new System.Drawing.Point(80, 217);
this.developerBox.Name = "developerBox";
this.developerBox.Size = new System.Drawing.Size(194, 20);
this.developerBox.TabIndex = 30;
//
// romStatusLabel
//
this.romStatusLabel.AutoSize = true;
this.romStatusLabel.Location = new System.Drawing.Point(3, 189);
this.romStatusLabel.Name = "romStatusLabel";
this.romStatusLabel.Size = new System.Drawing.Size(62, 13);
this.romStatusLabel.TabIndex = 29;
this.romStatusLabel.Text = "Rom Status";
//
// romStatusBox
//
this.romStatusBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.romStatusBox.FormattingEnabled = true;
this.romStatusBox.Items.AddRange(new object[] {
"OK",
"Bad Dump",
"Hack",
"Translation",
"Overdump",
"Trained"});
this.romStatusBox.Location = new System.Drawing.Point(80, 189);
this.romStatusBox.Name = "romStatusBox";
this.romStatusBox.Size = new System.Drawing.Size(121, 21);
this.romStatusBox.TabIndex = 28;
//
// tagsLabel
//
this.tagsLabel.AutoSize = true;
this.tagsLabel.Location = new System.Drawing.Point(3, 162);
this.tagsLabel.Name = "tagsLabel";
this.tagsLabel.Size = new System.Drawing.Size(31, 13);
this.tagsLabel.TabIndex = 27;
this.tagsLabel.Text = "Tags";
//
// tagsBox
//
this.tagsBox.Location = new System.Drawing.Point(80, 162);
this.tagsBox.Name = "tagsBox";
this.tagsBox.Size = new System.Drawing.Size(296, 20);
this.tagsBox.TabIndex = 26;
//
// romMetaLabel
//
this.romMetaLabel.AutoSize = true;
this.romMetaLabel.Location = new System.Drawing.Point(3, 135);
this.romMetaLabel.Name = "romMetaLabel";
this.romMetaLabel.Size = new System.Drawing.Size(62, 13);
this.romMetaLabel.TabIndex = 25;
this.romMetaLabel.Text = "Meta (Rom)";
//
// romMetaBox
//
this.romMetaBox.Location = new System.Drawing.Point(80, 135);
this.romMetaBox.Name = "romMetaBox";
this.romMetaBox.Size = new System.Drawing.Size(296, 20);
this.romMetaBox.TabIndex = 24;
//
// gameMetaLabel
//
this.gameMetaLabel.AutoSize = true;
this.gameMetaLabel.Location = new System.Drawing.Point(3, 108);
this.gameMetaLabel.Name = "gameMetaLabel";
this.gameMetaLabel.Size = new System.Drawing.Size(68, 13);
this.gameMetaLabel.TabIndex = 23;
this.gameMetaLabel.Text = "Meta (Game)";
//
// gameMetaBox
//
this.gameMetaBox.Location = new System.Drawing.Point(80, 108);
this.gameMetaBox.Name = "gameMetaBox";
this.gameMetaBox.Size = new System.Drawing.Size(296, 20);
this.gameMetaBox.TabIndex = 22;
//
// versionLabel
//
this.versionLabel.AutoSize = true;
this.versionLabel.Location = new System.Drawing.Point(3, 81);
this.versionLabel.Name = "versionLabel";
this.versionLabel.Size = new System.Drawing.Size(42, 13);
this.versionLabel.TabIndex = 21;
this.versionLabel.Text = "Version";
//
// versionBox
//
this.versionBox.Location = new System.Drawing.Point(80, 81);
this.versionBox.Name = "versionBox";
this.versionBox.Size = new System.Drawing.Size(296, 20);
this.versionBox.TabIndex = 20;
//
// regionLabel
//
this.regionLabel.AutoSize = true;
this.regionLabel.Location = new System.Drawing.Point(3, 54);
this.regionLabel.Name = "regionLabel";
this.regionLabel.Size = new System.Drawing.Size(41, 13);
this.regionLabel.TabIndex = 19;
this.regionLabel.Text = "Region";
//
// regionBox
//
this.regionBox.AutoCompleteCustomSource.AddRange(new string[] {
"USA",
"Japan",
"Europe",
"Taiwan",
"Brazil",
"Korea"});
this.regionBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
this.regionBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
this.regionBox.Location = new System.Drawing.Point(80, 54);
this.regionBox.Name = "regionBox";
this.regionBox.Size = new System.Drawing.Size(194, 20);
this.regionBox.TabIndex = 18;
//
// sha1Box
//
this.sha1Box.Location = new System.Drawing.Point(80, 530);
this.sha1Box.Name = "sha1Box";
this.sha1Box.ReadOnly = true;
this.sha1Box.Size = new System.Drawing.Size(296, 20);
this.sha1Box.TabIndex = 17;
this.sha1Box.TabStop = false;
//
// md5Box
//
this.md5Box.Location = new System.Drawing.Point(80, 503);
this.md5Box.Name = "md5Box";
this.md5Box.ReadOnly = true;
this.md5Box.Size = new System.Drawing.Size(255, 20);
this.md5Box.TabIndex = 16;
this.md5Box.TabStop = false;
//
// crcBox
//
this.crcBox.Location = new System.Drawing.Point(80, 477);
this.crcBox.Name = "crcBox";
this.crcBox.ReadOnly = true;
this.crcBox.Size = new System.Drawing.Size(100, 20);
this.crcBox.TabIndex = 15;
this.crcBox.TabStop = false;
//
// sha1Label
//
this.sha1Label.AutoSize = true;
this.sha1Label.Location = new System.Drawing.Point(3, 530);
this.sha1Label.Name = "sha1Label";
this.sha1Label.Size = new System.Drawing.Size(35, 13);
this.sha1Label.TabIndex = 14;
this.sha1Label.Text = "SHA1";
//
// md5Label
//
this.md5Label.AutoSize = true;
this.md5Label.Location = new System.Drawing.Point(3, 503);
this.md5Label.Name = "md5Label";
this.md5Label.Size = new System.Drawing.Size(30, 13);
this.md5Label.TabIndex = 13;
this.md5Label.Text = "MD5";
//
// crcLabel
//
this.crcLabel.AutoSize = true;
this.crcLabel.Location = new System.Drawing.Point(3, 477);
this.crcLabel.Name = "crcLabel";
this.crcLabel.Size = new System.Drawing.Size(41, 13);
this.crcLabel.TabIndex = 12;
this.crcLabel.Text = "CRC32";
//
// gameSystemBox
//
this.gameSystemBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.gameSystemBox.FormattingEnabled = true;
this.gameSystemBox.Location = new System.Drawing.Point(80, 4);
this.gameSystemBox.Name = "gameSystemBox";
this.gameSystemBox.Size = new System.Drawing.Size(121, 21);
this.gameSystemBox.TabIndex = 10;
//
// systemLabel
//
this.systemLabel.AutoSize = true;
this.systemLabel.Location = new System.Drawing.Point(3, 3);
this.systemLabel.Name = "systemLabel";
this.systemLabel.Size = new System.Drawing.Size(41, 13);
this.systemLabel.TabIndex = 11;
this.systemLabel.Text = "System";
//
// nameBox
//
this.nameBox.Location = new System.Drawing.Point(80, 27);
this.nameBox.Name = "nameBox";
this.nameBox.Size = new System.Drawing.Size(233, 20);
this.nameBox.TabIndex = 11;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(3, 27);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 0;
this.nameLabel.Text = "Name";
//
// mainMenuStrip
//
this.mainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.databaseToolStripMenuItem});
this.mainMenuStrip.Location = new System.Drawing.Point(0, 0);
this.mainMenuStrip.Name = "mainMenuStrip";
this.mainMenuStrip.Size = new System.Drawing.Size(963, 24);
this.mainMenuStrip.TabIndex = 2;
this.mainMenuStrip.Text = "menuStrip2";
//
// databaseToolStripMenuItem
//
this.databaseToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.directoryScanToolStripMenuItem,
this.cleanupDBToolStripMenuItem,
this.exportGameDBToolStripMenuItem});
this.databaseToolStripMenuItem.Name = "databaseToolStripMenuItem";
this.databaseToolStripMenuItem.Size = new System.Drawing.Size(67, 20);
this.databaseToolStripMenuItem.Text = "Database";
//
// directoryScanToolStripMenuItem
//
this.directoryScanToolStripMenuItem.Name = "directoryScanToolStripMenuItem";
this.directoryScanToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
this.directoryScanToolStripMenuItem.Text = "Directory Scan";
this.directoryScanToolStripMenuItem.Click += new System.EventHandler(this.directoryScanToolStripMenuItem_Click);
//
// cleanupDBToolStripMenuItem
//
this.cleanupDBToolStripMenuItem.Name = "cleanupDBToolStripMenuItem";
this.cleanupDBToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
this.cleanupDBToolStripMenuItem.Text = "Cleanup DB";
this.cleanupDBToolStripMenuItem.Click += new System.EventHandler(this.cleanupDBToolStripMenuItem_Click);
//
// exportGameDBToolStripMenuItem
//
this.exportGameDBToolStripMenuItem.Name = "exportGameDBToolStripMenuItem";
this.exportGameDBToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
this.exportGameDBToolStripMenuItem.Text = "Export GameDB";
this.exportGameDBToolStripMenuItem.Click += new System.EventHandler(this.exportGameDBToolStripMenuItem_Click);
//
// deleteButton
//
this.deleteButton.Location = new System.Drawing.Point(301, 589);
this.deleteButton.Name = "deleteButton";
this.deleteButton.Size = new System.Drawing.Size(75, 23);
this.deleteButton.TabIndex = 51;
this.deleteButton.Text = "Delete";
this.deleteButton.UseVisualStyleBackColor = true;
this.deleteButton.Click += new System.EventHandler(this.deleteButton_Click);
//
// DBMan_MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(963, 678);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.filterPanel);
this.Controls.Add(this.mainMenuStrip);
this.KeyPreview = true;
this.MainMenuStrip = this.menuStrip1;
this.Name = "DBMan_MainForm";
this.Text = "Bizhawk DBMan";
this.filterPanel.ResumeLayout(false);
this.filterPanel.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.detailPanel.ResumeLayout(false);
this.detailPanel.PerformLayout();
this.mainMenuStrip.ResumeLayout(false);
this.mainMenuStrip.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Panel filterPanel;
private System.Windows.Forms.Label whereLabel;
private System.Windows.Forms.ComboBox systemBox;
private System.Windows.Forms.TextBox whereBox;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ListView romListView;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.MenuStrip mainMenuStrip;
private System.Windows.Forms.ToolStripMenuItem databaseToolStripMenuItem;
private System.Windows.Forms.Panel detailPanel;
private System.Windows.Forms.ToolStripMenuItem directoryScanToolStripMenuItem;
private System.Windows.Forms.ComboBox gameSystemBox;
private System.Windows.Forms.Label systemLabel;
private System.Windows.Forms.TextBox nameBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.ColumnHeader romListColumnHeader1;
private System.Windows.Forms.ColumnHeader romListColumnHeader2;
private System.Windows.Forms.ColumnHeader romListColumnHeader3;
private System.Windows.Forms.ColumnHeader romListColumnHeader4;
private System.Windows.Forms.ColumnHeader romListColumnHeader5;
private System.Windows.Forms.TextBox crcBox;
private System.Windows.Forms.Label sha1Label;
private System.Windows.Forms.Label md5Label;
private System.Windows.Forms.Label crcLabel;
private System.Windows.Forms.TextBox sha1Box;
private System.Windows.Forms.TextBox md5Box;
private System.Windows.Forms.Label regionLabel;
private System.Windows.Forms.TextBox regionBox;
private System.Windows.Forms.Label versionLabel;
private System.Windows.Forms.TextBox versionBox;
private System.Windows.Forms.Label romMetaLabel;
private System.Windows.Forms.TextBox romMetaBox;
private System.Windows.Forms.Label gameMetaLabel;
private System.Windows.Forms.TextBox gameMetaBox;
private System.Windows.Forms.TextBox tagsBox;
private System.Windows.Forms.Label romStatusLabel;
private System.Windows.Forms.ComboBox romStatusBox;
private System.Windows.Forms.Label tagsLabel;
private System.Windows.Forms.Label developerLabel;
private System.Windows.Forms.TextBox developerBox;
private System.Windows.Forms.Label classificationLabel;
private System.Windows.Forms.ComboBox classificationBox;
private System.Windows.Forms.Label publisherLabel;
private System.Windows.Forms.TextBox publisherBox;
private System.Windows.Forms.Label releaseDateLabel;
private System.Windows.Forms.TextBox releaseDateBox;
private System.Windows.Forms.Label playersLabel;
private System.Windows.Forms.Label catalogLabel;
private System.Windows.Forms.TextBox catalogBox;
private System.Windows.Forms.TextBox playersBox;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button saveButton;
private System.Windows.Forms.ToolStripMenuItem cleanupDBToolStripMenuItem;
private System.Windows.Forms.Label altNamesLabel;
private System.Windows.Forms.TextBox altNamesBox;
private System.Windows.Forms.Label notesLabel;
private System.Windows.Forms.TextBox notesBox;
private System.Windows.Forms.Label sizeLabel;
private System.Windows.Forms.TextBox sizeBox;
private System.Windows.Forms.ToolStripMenuItem exportGameDBToolStripMenuItem;
private System.Windows.Forms.Button deleteButton;
}
}

View File

@ -1,345 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace BizHawk.Client.DBMan
{
public partial class DBMan_MainForm : Form
{
string[] Systems = { "SMS", "GG", "SG", "PCE", "PCECD", "SGX", "NES", "GEN" };
Rom SelectedRom;
public DBMan_MainForm()
{
InitializeComponent();
nameBox.GotFocus += (o, e) => { nameBox.SelectionLength = 0; nameBox.SelectionStart = nameBox.Text.Length; };
regionBox.GotFocus += (o, e) => { regionBox.SelectionLength = 0; regionBox.SelectionStart = versionBox.Text.Length; };
versionBox.GotFocus += (o, e) => { versionBox.SelectionLength = 0; versionBox.SelectionStart = versionBox.Text.Length; };
gameMetaBox.GotFocus += (o, e) => { gameMetaBox.SelectionLength = 0; gameMetaBox.SelectionStart = gameMetaBox.Text.Length; };
romMetaBox.GotFocus += (o, e) => { romMetaBox.SelectionLength = 0; romMetaBox.SelectionStart = romMetaBox.Text.Length; };
tagsBox.GotFocus += (o, e) => { tagsBox.SelectionLength = 0; tagsBox.SelectionStart = tagsBox.Text.Length; };
developerBox.GotFocus += (o, e) => { developerBox.SelectionLength = 0; developerBox.SelectionStart = developerBox.Text.Length; };
publisherBox.GotFocus += (o, e) => { publisherBox.SelectionLength = 0; publisherBox.SelectionStart = publisherBox.Text.Length; };
releaseDateBox.GotFocus += (o, e) => { releaseDateBox.SelectionLength = 0; releaseDateBox.SelectionStart = releaseDateBox.Text.Length; };
playersBox.GotFocus += (o, e) => { playersBox.SelectionLength = 0; playersBox.SelectionStart = playersBox.Text.Length; };
catalogBox.GotFocus += (o, e) => { catalogBox.SelectionLength = 0; catalogBox.SelectionStart = catalogBox.Text.Length; };
altNamesBox.GotFocus += (o, e) => { altNamesBox.SelectionLength = 0; altNamesBox.SelectionStart = altNamesBox.Text.Length; };
notesBox.GotFocus += (o, e) => { notesBox.SelectionLength = 0; notesBox.SelectionStart = notesBox.Text.Length; };
configSystemBox();
loadRomsForSelectedSystem();
}
void configSystemBox()
{
systemBox.Items.AddRange(Systems);
systemBox.Items.Add("Unassigned");
systemBox.SelectedIndex = 0;
gameSystemBox.Items.AddRange(Systems);
gameSystemBox.Items.Add("Unassigned");
}
void loadRomsForSelectedSystem()
{
DB.LoadDbForSystem(systemBox.SelectedItem.ToString());
var names = DB.GetDeveloperPublisherNames().ToArray();
romListView.Items.Clear();
foreach (var rom in DB.Roms)
{
var lvi = new ListViewItem(new string[] { rom.DisplayName, rom.Region, rom.VersionTags, rom.CombinedMetaData, rom.Game.Tags });
lvi.Tag = rom;
lvi.BackColor = rom.New ? Color.LightGreen : Color.White;
romListView.Items.Add(lvi);
}
detailPanel.Visible = false;
SelectedRom = null;
developerBox.AutoCompleteCustomSource.Clear();
developerBox.AutoCompleteCustomSource.AddRange(names);
publisherBox.AutoCompleteCustomSource.Clear();
publisherBox.AutoCompleteCustomSource.AddRange(names);
}
void systemBox_SelectedIndexChanged(object sender, EventArgs e)
{
loadRomsForSelectedSystem();
}
void directoryScanToolStripMenuItem_Click(object sender, EventArgs e)
{
var ds = new FolderBrowserDialog { ShowNewFolderButton = false };
var result = ds.ShowDialog();
if (result == DialogResult.OK)
{
var infos = DirectoryScan.GetRomInfos(ds.SelectedPath);
DirectoryScan.MergeRomInfosWithDatabase(infos);
MessageBox.Show("Directory Import complete!");
}
}
void selectedRomChanged(object sender, EventArgs e)
{
if (RomChangesMade())
{
var result = MessageBox.Show("Save changes?", "Save or Cancel Changes", MessageBoxButtons.YesNo);
if (result == DialogResult.Yes)
saveButton_Click(null, null);
SelectedRom = null;
}
if (romListView.SelectedItems.Count == 0)
{
detailPanel.Visible = false;
return;
}
var rom = (Rom)romListView.SelectedItems[0].Tag;
SelectedRom = rom;
gameSystemBox.Text = rom.System;
nameBox.Text = rom.Name;
crcBox.Text = rom.CRC32;
md5Box.Text = rom.MD5;
sha1Box.Text = rom.SHA1;
sizeBox.Text = rom.SizeFriendly;
regionBox.Text = rom.Region;
versionBox.Text = rom.VersionTags;
gameMetaBox.Text = rom.Game.GameMetadata;
romMetaBox.Text = rom.RomMetadata;
tagsBox.Text = rom.Game.Tags;
romStatusBox.Text = rom.RomStatus;
developerBox.Text = rom.Game.Developer;
publisherBox.Text = rom.Game.Publisher;
classificationBox.Text = rom.Game.Classification;
releaseDateBox.Text = rom.Game.ReleaseDate;
playersBox.Text = rom.Game.Players;
catalogBox.Text = rom.Catalog;
altNamesBox.Text = rom.Game.AltNames;
notesBox.Text = rom.Game.Notes;
detailPanel.Visible = true;
}
void cancelButton_Click(object sender, EventArgs e)
{
gameSystemBox.Text = SelectedRom.System;
nameBox.Text = SelectedRom.Name;
crcBox.Text = SelectedRom.CRC32;
md5Box.Text = SelectedRom.MD5;
sha1Box.Text = SelectedRom.SHA1;
sizeBox.Text = SelectedRom.SizeFriendly;
regionBox.Text = SelectedRom.Region;
versionBox.Text = SelectedRom.VersionTags;
gameMetaBox.Text = SelectedRom.Game.GameMetadata;
romMetaBox.Text = SelectedRom.RomMetadata;
tagsBox.Text = SelectedRom.Game.Tags;
romStatusBox.Text = SelectedRom.RomStatus;
developerBox.Text = SelectedRom.Game.Developer;
publisherBox.Text = SelectedRom.Game.Publisher;
classificationBox.Text = SelectedRom.Game.Classification;
releaseDateBox.Text = SelectedRom.Game.ReleaseDate;
playersBox.Text = SelectedRom.Game.Players;
catalogBox.Text = SelectedRom.Catalog;
altNamesBox.Text = SelectedRom.Game.AltNames;
notesBox.Text = SelectedRom.Game.Notes;
}
void saveButton_Click(object sender, EventArgs e)
{
// Check if any changes were made
if (SelectedRom.New == false && RomChangesMade() == false)
return;
int saveMode = 0;
string origSystem = SelectedRom.System;
string origName = SelectedRom.Name;
// Did we change System or Name?
if (KeyChangesMade())
{
var rslt = MessageBox.Show("Change all instances of this system/name?\n\nClicking Yes will change all roms to point to the new game info.\nClicking No will create a new Game instance.", "Confirm game change action", MessageBoxButtons.YesNo);
saveMode = (rslt == DialogResult.Yes) ? 1 : 2;
}
// Actually save the stuff
SelectedRom.System = fmt(gameSystemBox.Text);
SelectedRom.Name = fmt(nameBox.Text);
SelectedRom.Region = fmt(regionBox.Text);
SelectedRom.VersionTags = fmt(versionBox.Text);
SelectedRom.Game.GameMetadata = fmt(gameMetaBox.Text);
SelectedRom.RomMetadata = fmt(romMetaBox.Text);
SelectedRom.Game.Tags = fmt(tagsBox.Text);
SelectedRom.RomStatus = fmt(romStatusBox.Text);
SelectedRom.Game.Developer = fmt(developerBox.Text);
SelectedRom.Game.Publisher = fmt(publisherBox.Text);
SelectedRom.Game.Classification = fmt(classificationBox.Text);
SelectedRom.Game.ReleaseDate = fmt(releaseDateBox.Text);
SelectedRom.Game.Players = fmt(playersBox.Text);
SelectedRom.Catalog = fmt(catalogBox.Text);
SelectedRom.Game.AltNames = fmt(altNamesBox.Text);
SelectedRom.Game.Notes = fmt(notesBox.Text);
SelectedRom.Modified = DateTime.Now;
if (saveMode == 0) DB.SaveRom(SelectedRom);
if (saveMode == 1) DB.SaveRom1(SelectedRom, origSystem, origName);
if (saveMode == 2) DB.SaveRom2(SelectedRom);
if (romListView.SelectedItems.Count > 0)
{
// Update the side listing
var romListItem = (ListViewItem)romListView.SelectedItems[0];
romListItem.SubItems[0] = new ListViewItem.ListViewSubItem(romListItem, SelectedRom.DisplayName);
romListItem.SubItems[1] = new ListViewItem.ListViewSubItem(romListItem, SelectedRom.Region);
romListItem.SubItems[2] = new ListViewItem.ListViewSubItem(romListItem, SelectedRom.VersionTags);
romListItem.SubItems[3] = new ListViewItem.ListViewSubItem(romListItem, SelectedRom.CombinedMetaData);
romListItem.SubItems[4] = new ListViewItem.ListViewSubItem(romListItem, SelectedRom.Game.Tags);
romListItem.BackColor = SelectedRom.New ? Color.LightGreen : Color.White;
}
if (saveMode > 0) loadRomsForSelectedSystem();
}
bool RomChangesMade()
{
if (SelectedRom == null)
return false;
if (!streq(SelectedRom.System, gameSystemBox.Text)) return true;
if (!streq(SelectedRom.Name, nameBox.Text)) return true;
if (!streq(SelectedRom.Region, regionBox.Text)) return true;
if (!streq(SelectedRom.VersionTags, versionBox.Text)) return true;
if (!streq(SelectedRom.Game.GameMetadata, gameMetaBox.Text)) return true;
if (!streq(SelectedRom.RomMetadata, romMetaBox.Text)) return true;
if (!streq(SelectedRom.Game.Tags, tagsBox.Text)) return true;
if (!streq(SelectedRom.RomStatus, romStatusBox.Text)) return true;
if (!streq(SelectedRom.Game.Developer, developerBox.Text)) return true;
if (!streq(SelectedRom.Game.Publisher, publisherBox.Text)) return true;
if (!streq(SelectedRom.Game.Classification, classificationBox.Text)) return true;
if (!streq(SelectedRom.Game.ReleaseDate, releaseDateBox.Text)) return true;
if (!streq(SelectedRom.Game.Players, playersBox.Text)) return true;
if (!streq(SelectedRom.Catalog, catalogBox.Text)) return true;
if (!streq(SelectedRom.Game.AltNames, altNamesBox.Text)) return true;
if (!streq(SelectedRom.Game.Notes, notesBox.Text)) return true;
return false;
}
bool KeyChangesMade()
{
if (SelectedRom == null)
return false;
if (!streq(SelectedRom.System, gameSystemBox.Text)) return true;
if (!streq(SelectedRom.Name, nameBox.Text)) return true;
return false;
}
static bool streq(string s1, string s2)
{
if (string.IsNullOrWhiteSpace(s1) && string.IsNullOrWhiteSpace(s2)) return true;
if (s1 == null || s2 == null) return false;
return s1.Trim() == s2.Trim();
}
static string fmt(string s)
{
var trimmed = s.Trim();
if (trimmed.Length == 0)
return null;
return trimmed;
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == (Keys.F5))
{
loadRomsForSelectedSystem();
return true;
}
if (keyData == (Keys.S | Keys.Control) && SelectedRom != null)
{
saveButton_Click(null, null);
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
void cleanupDBToolStripMenuItem_Click(object sender, EventArgs e)
{
DB.Cleanup();
MessageBox.Show("Orphaned GAME records deleted and Sqlite VACUUM performed.");
}
void exportGameDBToolStripMenuItem_Click(object sender, EventArgs e)
{
var sfd = new SaveFileDialog();
sfd.DefaultExt = ".txt";
sfd.AddExtension = true;
var result = sfd.ShowDialog();
if (result == System.Windows.Forms.DialogResult.Cancel)
return;
var tw = new StreamWriter(sfd.FileName);
loadRomsForSelectedSystem();
foreach (var rom in DB.Roms)
{
string romCode = "";
if (rom.Game.Classification == "Homebrew") romCode = "D";
if (rom.RomStatus == "Overdump") romCode = "O";
if (rom.RomStatus == "Bad Dump") romCode = "V";
string regionStr = "";
if (rom.Region != null)
{
if (rom.Region.IndexOf("Japan") >= 0) regionStr += "J";
if (rom.Region.IndexOf("USA") >= 0) regionStr += "U";
if (rom.Region.IndexOf("Europe") >= 0) regionStr += "E";
if (rom.Region.IndexOf("Brazil") >= 0) regionStr += "B";
if (rom.Region.IndexOf("Taiwan") >= 0) regionStr += "T";
if (rom.Region.IndexOf("Korea") >= 0) regionStr += "K";
if (rom.Region.IndexOf("Australia") >= 0) regionStr += "Aus";
if (rom.Region.IndexOf("World") >= 0) regionStr += "W";
}
string romName = rom.NameWithTheFlipped;
if (regionStr.Length > 0)
romName += " ("+regionStr+")";
if (rom.VersionTags != null)
{
var versions = rom.VersionTags.Split(';');
foreach (var version in versions)
{
if (version.Trim().Length == 0)
continue;
romName += " (" + version + ")";
}
}
tw.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}", rom.MD5, romCode, romName, rom.System, rom.Game.Tags, rom.CombinedMetaData, rom.Region);
}
tw.Close();
}
void deleteButton_Click(object sender, EventArgs e)
{
var rslt = MessageBox.Show("Confirm deletion for ROM: "+SelectedRom.Name+" "+SelectedRom.Region+" "+SelectedRom.VersionTags+"?", "Confirm ROM Delete", MessageBoxButtons.YesNo);
if (rslt != System.Windows.Forms.DialogResult.Yes)
return;
DB.DeleteRom(SelectedRom);
loadRomsForSelectedSystem();
}
}
}

View File

@ -1,129 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="mainMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
</root>

File diff suppressed because it is too large Load Diff

View File

@ -1,120 +0,0 @@
using System.Collections.Generic;
using System.IO;
using Community.CsharpSqlite.SQLiteClient;
using BizHawk.Common.StringExtensions;
namespace BizHawk.Client.DBMan
{
public static class DirectoryScan
{
public static List<InitialRomInfo> GetRomInfos(string path)
{
var dirInfo = new DirectoryInfo(path);
var files = dirInfo.GetFiles("*", SearchOption.AllDirectories);
var romInfos = new List<InitialRomInfo>();
foreach (var f in files)
{
if (IsRomFile(f.Extension, f.Length) == false)
continue;
romInfos.Add(RomHasher.Generate(f.FullName));
}
return romInfos;
}
const long BiggestBinToHash = 16 * 1024 * 1024;
public static bool IsRomFile(string ext, long size)
{
if (string.IsNullOrEmpty(ext) || ext.Length <= 1)
return false;
ext = ext.Substring(1).ToLowerInvariant();
if (ext.In("cue", "iso", "nes", "unf", "fds", "sfc", "smc", "sms", "gg", "sg", "pce", "sgx", "gb", "gbc", "gba", "gen", "md", "smd", "a26", "a78", "col", "z64", "v64", "n64"))
return true;
// the logic here is related to cue/bin cd images.
// when we see a .cue file, we will hash the cd image including the bin.
// so we don't really want to hash the whole bin a second time.
// however, there are also non-cdimage roms with BIN extension.
// hopefully this differentiates them. It may have to be tweaked as systems are added.
if (ext == "bin" && size < BiggestBinToHash)
return true;
return false;
}
// ========================================================================================
public static void MergeRomInfosWithDatabase(IList<InitialRomInfo> roms)
{
foreach (var rom in roms)
{
if (RomInDatabase(rom.MD5) == false)
{
InsertRom(rom);
if (GameInDatabase(rom) == false)
InsertGame(rom);
}
}
}
static bool RomInDatabase(string md5)
{
using (var cmd = DB.Con.CreateCommand())
{
cmd.CommandText = "SELECT rom_id FROM rom WHERE md5 = @md5";
cmd.Parameters.Add(new SqliteParameter("@md5", md5));
var result = cmd.ExecuteScalar();
return result != null;
}
}
static bool GameInDatabase(InitialRomInfo rom)
{
using (var cmd = DB.Con.CreateCommand())
{
cmd.CommandText = "SELECT game_id FROM game WHERE system = @System and name = @Name";
cmd.Parameters.Add(new SqliteParameter("@System", rom.GuessedSystem));
cmd.Parameters.Add(new SqliteParameter("@Name", rom.Name));
var result = cmd.ExecuteScalar();
return result != null;
}
}
static void InsertRom(InitialRomInfo rom)
{
using (var cmd = DB.Con.CreateCommand())
{
cmd.CommandText =
"INSERT INTO rom (crc32, md5, sha1, size, system, name, region, version_tags, created_date) "+
"VALUES (@crc32, @md5, @sha1, @size, @System, @Name, @Region, @VersionTags, datetime('now','localtime'))";
cmd.Parameters.Add(new SqliteParameter("@crc32", rom.CRC32));
cmd.Parameters.Add(new SqliteParameter("@md5", rom.MD5));
cmd.Parameters.Add(new SqliteParameter("@sha1", rom.SHA1));
cmd.Parameters.Add(new SqliteParameter("@size", rom.Size));
cmd.Parameters.Add(new SqliteParameter("@System", rom.GuessedSystem));
cmd.Parameters.Add(new SqliteParameter("@Name", rom.Name));
cmd.Parameters.Add(new SqliteParameter("@Region", rom.GuessedRegion));
cmd.Parameters.Add(new SqliteParameter("@VersionTags", rom.VersionTags));
cmd.ExecuteNonQuery();
}
}
static void InsertGame(InitialRomInfo rom)
{
using (var cmd = DB.Con.CreateCommand())
{
cmd.CommandText = "INSERT INTO game (system, name, created_date) VALUES (@System, @Name, datetime('now','localtime'))";
cmd.Parameters.Add(new SqliteParameter("@System", rom.GuessedSystem));
cmd.Parameters.Add(new SqliteParameter("@Name", rom.Name));
cmd.ExecuteNonQuery();
}
}
}
}

View File

@ -1,131 +0,0 @@
using System;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using BizHawk.Common;
using BizHawk.Emulation.DiscSystem;
namespace BizHawk.Client.DBMan
{
class DiscHash
{
static List<string> FindExtensionsRecurse(string dir, string extUppercaseWithDot)
{
List<string> ret = new List<string>();
Queue<string> dpTodo = new Queue<string>();
dpTodo.Enqueue(dir);
for (; ; )
{
string dpCurr;
if (dpTodo.Count == 0)
break;
dpCurr = dpTodo.Dequeue();
Parallel.ForEach(new DirectoryInfo(dpCurr).GetFiles(), (fi) =>
{
if (fi.Extension.ToUpperInvariant() == extUppercaseWithDot)
lock (ret)
ret.Add(fi.FullName);
});
Parallel.ForEach(new DirectoryInfo(dpCurr).GetDirectories(), (di) =>
{
lock (dpTodo)
dpTodo.Enqueue(di.FullName);
});
}
return ret;
}
public void Run(string[] args)
{
string indir = null;
string dpTemp = null;
string fpOutfile = null;
for (int i = 0; ; )
{
if (i == args.Length) break;
var arg = args[i++];
if (arg == "--indir")
indir = args[i++];
if (arg == "--tempdir")
dpTemp = args[i++];
if (arg == "--outfile")
fpOutfile = args[i++];
}
var done = new HashSet<string>();
foreach (var line in File.ReadAllLines(fpOutfile))
{
if (line.Trim() == "") continue;
var parts = line.Split(new[] { "//" }, StringSplitOptions.None);
done.Add(parts[1]);
}
using (var outf = new StreamWriter(fpOutfile))
{
Dictionary<uint, string> FoundHashes = new Dictionary<uint, string>();
object olock = new object();
var todo = FindExtensionsRecurse(indir, ".CUE");
int progress = 0;
//loop over games (parallel doesnt work well when reading tons of data over the network, as we are here to do the complete redump hash)
var po = new ParallelOptions();
//po.MaxDegreeOfParallelism = Environment.ProcessorCount - 1;
po.MaxDegreeOfParallelism = 1;
Parallel.ForEach(todo, po, (fiCue) =>
{
string name = Path.GetFileNameWithoutExtension(fiCue);
lock (olock)
{
if (done.Contains(name))
{
progress++;
return;
}
}
//now look for the cue file
using (var disc = Disc.LoadAutomagic(fiCue))
{
var hasher = new DiscHasher(disc);
uint bizHashId = hasher.Calculate_PSX_BizIDHash();
uint redumpHash = hasher.Calculate_PSX_RedumpHash();
lock (olock)
{
progress++;
Console.WriteLine("{0}/{1} [{2:X8}] {3}", progress, todo.Count, bizHashId, Path.GetFileNameWithoutExtension(fiCue));
outf.WriteLine("bizhash:{0:X8} datahash:{1:X8} //{2}", bizHashId, redumpHash, name);
if (FoundHashes.ContainsKey(bizHashId))
{
Console.WriteLine("--> COLLISION WITH: {0}", FoundHashes[bizHashId]);
outf.WriteLine("--> COLLISION WITH: {0}", FoundHashes[bizHashId]);
}
else
FoundHashes[bizHashId] = name;
Console.Out.Flush();
outf.Flush();
}
}
}); //major loop
} //using(outfile)
} //MyRun()
} //class PsxRedump
}

View File

@ -1,144 +0,0 @@
using System;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Collections.Generic;
using Community.CsharpSqlite.SQLiteClient;
namespace BizHawk.Client.DBMan
{
internal static class Program
{
static Program()
{
#if WINDOWS
// http://www.codeproject.com/Articles/310675/AppDomain-AssemblyResolve-Event-Tips
// this will look in subdirectory "dll" to load pinvoked stuff
string dllDir = Path.Combine(GetExeDirectoryAbsolute(), "dll");
SetDllDirectory(dllDir);
// in case assembly resolution fails, such as if we moved them into the dll subdirectory, this event handler can reroute to them
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
// but before we even try doing that, whack the MOTW from everything in that directory (that's a dll)
// otherwise, some people will have crashes at boot-up due to .net security disliking MOTW.
// some people are getting MOTW through a combination of browser used to download BizHawk, and program used to dearchive it
WhackAllMOTW(dllDir);
#endif
}
public static string GetExeDirectoryAbsolute()
{
var uri = new Uri(Assembly.GetEntryAssembly().GetName().CodeBase);
string module = uri.LocalPath + System.Web.HttpUtility.UrlDecode(uri.Fragment);
return Path.GetDirectoryName(module);
}
static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
lock (AppDomain.CurrentDomain)
{
var asms = AppDomain.CurrentDomain.GetAssemblies();
foreach (var asm in asms)
if (asm.FullName == args.Name)
return asm;
// load missing assemblies by trying to find them in the dll directory
string dllName = new AssemblyName(args.Name).Name + ".dll";
string directory = Path.Combine(GetExeDirectoryAbsolute(), "dll");
string fname = Path.Combine(directory, dllName);
if (!File.Exists(fname)) return null;
// it is important that we use LoadFile here and not load from a byte array; otherwise mixed (managed/unmanaged) assemblies can't load
return Assembly.LoadFile(fname);
}
}
// declared here instead of a more usual place to avoid dependencies on the more usual place
#if WINDOWS
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool SetDllDirectory(string lpPathName);
[DllImport("kernel32.dll", EntryPoint = "DeleteFileW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern bool DeleteFileW([MarshalAs(UnmanagedType.LPWStr)]string lpFileName);
static void RemoveMOTW(string path)
{
DeleteFileW(path + ":Zone.Identifier");
}
static void WhackAllMOTW(string dllDir)
{
var todo = new Queue<DirectoryInfo>(new[] { new DirectoryInfo(dllDir) });
while (todo.Count > 0)
{
var di = todo.Dequeue();
foreach (var disub in di.GetDirectories()) todo.Enqueue(disub);
foreach (var fi in di.GetFiles("*.dll"))
RemoveMOTW(fi.FullName);
foreach (var fi in di.GetFiles("*.exe"))
RemoveMOTW(fi.FullName);
}
}
#endif
[STAThread]
static void Main(string[] args)
{
if (args.Length > 0 && args[0] == "--dischash")
{
new DiscHash().Run(args.Skip(1).ToArray());
return;
}
if (args.Length > 0 && args[0] == "--psxdb")
{
new PsxDBJob().Run(args.Skip(1).ToArray());
return;
}
if (args.Length > 0 && args[0] == "--dbman")
{
try
{
InitDB();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new DBMan_MainForm());
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}
finally
{
if (DB.Con != null) DB.Con.Dispose();
}
return;
}
//if (args.Length > 0 && args[0] == "--disccmp")
//{
// new DiscCmp().Run(args.Skip(1).ToArray());
// return;
//}
try
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new DATConverter());
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}
}
static void InitDB()
{
DB.Con = new SqliteConnection { ConnectionString = @"Version=3,uri=file://gamedb/game.db" };
DB.Con.Open();
}
}
}

View File

@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("BizHawk.Client.DBMan")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BizHawk.Client.DBMan")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("58cef5c3-fb2d-4d02-8f02-46a53c1c49cf")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,63 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18034
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BizHawk.Client.DBMan.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BizHawk.Client.DBMan.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BizHawk.Client.DBMan.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -1,127 +0,0 @@
using System;
using System.Globalization;
using System.IO;
using System.Xml;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BizHawk.Common;
using BizHawk.Emulation.DiscSystem;
namespace BizHawk.Client.DBMan
{
class PsxDBJob
{
class HashRecord
{
public string name, bizhash, datahash;
public bool matched;
}
public void Run(string[] args)
{
string fpHash = null, fpRedump = null, fpOutfile = null;
for (int i = 0; ; )
{
if (i == args.Length) break;
var arg = args[i++];
if (arg == "--hashes")
fpHash = args[i++];
if (arg == "--redump")
fpRedump = args[i++];
if (arg == "--outfile")
fpOutfile = args[i++];
}
var hashes = new Dictionary<string, HashRecord>();
Console.WriteLine("Loading redump data");
RedumpPSX rdpsx = new RedumpPSX();
rdpsx.Load(fpRedump);
Console.WriteLine("Loading hash data");
var splitSlashes = new string[]{"//"};
foreach (var line in File.ReadAllLines(fpHash))
{
var parts = line.Split(splitSlashes, StringSplitOptions.None);
var hr = new HashRecord()
{
name = parts[1],
bizhash = parts[0].Substring(8, 8),
datahash = parts[0].Substring(26, 8),
};
hashes[hr.datahash] = hr;
}
Console.WriteLine("merging");
foreach (var rr in rdpsx.Records)
{
HashRecord hr;
if (!hashes.TryGetValue(rr.crc, out hr))
continue;
hr.matched = true;
//correct name to redump current
hr.name = rr.name;
}
Console.WriteLine("writing results");
using (var outf = new StreamWriter(fpOutfile))
{
foreach (var hr in hashes.Values)
{
if (!hr.matched)
continue;
outf.WriteLine("{0}\tG\t{1}\tPSX\t\tdh={2}", hr.bizhash, hr.name, hr.datahash);
}
}
}
}
class RedumpPSX
{
public class RedumpRecord
{
public string name;
public string crc;
}
public List<RedumpRecord> Records = new List<RedumpRecord>();
public void Load(string datpath)
{
var xd = XDocument.Load(datpath);
Dictionary<uint, string> knownHashes = new Dictionary<uint, string>();
var games = xd.Root.Descendants("game").ToArray();
for(int i=0;i<games.Length;i++)
{
var game = games[i];
if (i % 100 == 0)
Console.WriteLine("{0}/{1}", i, games.Length);
var name = game.Attribute("name").Value;
BizHawk.Emulation.DiscSystem.DiscHasher.SpecialCRC32 spec_crc_calc = new Emulation.DiscSystem.DiscHasher.SpecialCRC32();
spec_crc_calc.Current = 0;
foreach (var rom in game.Elements("rom"))
{
var ext = Path.GetExtension(rom.Attribute("name").Value).ToLower();
if (ext == ".cue") continue;
uint onecrc = uint.Parse(rom.Attribute("crc").Value, NumberStyles.HexNumber);
int size = int.Parse(rom.Attribute("size").Value);
spec_crc_calc.Incorporate(onecrc, size);
}
//Console.WriteLine("{0:X8}", spec_crc_calc.Current);
Records.Add(new RedumpRecord()
{
name = name,
crc = spec_crc_calc.Current.ToString("X8")
});
}
}
}
}

View File

@ -1,261 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using BizHawk.Common;
using BizHawk.Emulation.DiscSystem;
namespace BizHawk.Client.DBMan
{
public class InitialRomInfo
{
public string FileName;
public string Name;
public string VersionTags;
public string GuessedSystem;
public string GuessedRegion;
public string CRC32;
public string MD5;
public string SHA1;
public long Size;
public override string ToString()
{
return FileName;
}
}
public static class RomHasher
{
public static InitialRomInfo Generate(string file)
{
//if (isDiscImage(file))
// return HashDiscImage(file);
return GenerateRomHashDirect(file, File.ReadAllBytes(file));
}
static char[] modifierStartChars = { '(', '[' };
static InitialRomInfo GenerateRomHashDirect(string file, byte[] filebytes)
{
var info = new InitialRomInfo();
var fileInfo = new FileInfo(file);
string ext = fileInfo.Extension.ToLowerInvariant().Replace(".", "");
info.FileName = fileInfo.Name;
// Parse the filename to guess things about the rom
var name = Path.GetFileNameWithoutExtension(fileInfo.Name);
if (name.StartsWith("[BIOS] "))
name = name.Replace("[BIOS] ","") + " [BIOS]";
string modifiers = "";
int modIndex = name.IndexOfAny(modifierStartChars);
if (modIndex > 0)
{
modifiers = name.Substring(modIndex);
name = name.Substring(0, modIndex);
}
info.Name = name.Trim();
// parse out modifiers
var mods = new List<string>();
modifiers = modifiers.Replace(")", ";").Replace("]",";");
modifiers = modifiers.Replace("(", "").Replace("[", "");
var m_ = modifiers.Split(';');
foreach (var mi in m_)
{
var m = mi.Trim();
if (m.Length == 0) continue;
mods.Add(m);
}
info.VersionTags = "";
foreach (var mi in mods)
{
if (info.VersionTags.Length != 0)
info.VersionTags += ";";
switch (mi.ToLower())
{
case "j":
case "jp":
case "jpn":
case "japan":
info.GuessedRegion = "Japan";
break;
case "usa":
case "us":
case "u":
info.GuessedRegion = "USA";
break;
case "europe":
case "eur":
case "e":
info.GuessedRegion = "Europe";
break;
case "world":
case "w":
info.GuessedRegion = "World";
break;
case "korea":
case "kr":
case "k":
info.GuessedRegion = "Korea";
break;
case "brazil":
case "br":
info.GuessedRegion = "Brazil";
break;
case "taiwan":
case "tw":
info.GuessedRegion = "Taiwan";
break;
case "usa, europe":
info.GuessedRegion = "USA;Europe";
break;
case "japan, europe":
info.GuessedRegion = "Europe;Japan";
break;
case "japan, usa":
info.GuessedRegion = "USA;Japan";
break;
default:
info.VersionTags += mi;
break;
}
}
// transform binary to canonical binary representation (de-header/de-stripe/de-swap)
byte[] romBytes = filebytes;
switch (ext)
{
case "sms":
case "gg":
case "sg":
case "pce":
case "sgx":
romBytes = MaybeStripHeader512(filebytes);
break;
case "smd":
if (filebytes.Length % 1024 == 512)
System.Windows.Forms.MessageBox.Show("derp");
romBytes = DeInterleaveSMD(filebytes);
break;
case "z64":
case "n64":
case "v64":
throw new NotImplementedException("n64 demutate not done");
}
// guess system
switch (ext)
{
case "sms": info.GuessedSystem = "SMS"; break;
case "gg": info.GuessedSystem = "GG"; break;
case "sg": info.GuessedSystem = "SG"; break;
case "pce": info.GuessedSystem = "PCE"; break;
case "sgx": info.GuessedSystem = "SGX"; break;
case "smd":
case "gen": info.GuessedSystem = "GEN"; break;
case "nes": info.GuessedSystem = "NES"; break;
default: info.GuessedSystem = "Unknown"; break;
}
// Perform hashing
info.CRC32 = Hash_CRC32(romBytes);
info.MD5 = Hash_MD5(romBytes);
info.SHA1 = Hash_SHA1(romBytes);
info.Size = romBytes.Length;
return info;
}
static string HashDiscImage(string file)
{
try
{
string ext = new FileInfo(file).Extension.ToLowerInvariant();
using (var disc = Disc.LoadAutomagic(file))
{
var hasher = new DiscHasher(disc);
return hasher.OldHash();
}
}
catch
{
return "Error Hashing Disc";
}
}
static string Hash_CRC32(byte[] data) => $"{CRC32.Calculate(data):X8}";
static string Hash_SHA1(byte[] data)
{
using (var sha1 = System.Security.Cryptography.SHA1.Create())
{
sha1.TransformFinalBlock(data, 0, data.Length);
return BytesToHexString(sha1.Hash);
}
}
static string Hash_MD5(byte[] data)
{
using (var md5 = System.Security.Cryptography.MD5.Create())
{
md5.TransformFinalBlock(data, 0, data.Length);
return BytesToHexString(md5.Hash);
}
}
static string BytesToHexString(byte[] bytes)
{
var sb = new StringBuilder();
foreach (var b in bytes)
sb.AppendFormat("{0:X2}", b);
return sb.ToString();
}
static byte[] MaybeStripHeader512(byte[] fileBytes)
{
if (fileBytes.Length % 1024 != 512)
return fileBytes;
var romBytes = new byte[fileBytes.Length - 512];
Array.Copy(fileBytes, 512, romBytes, 0, fileBytes.Length - 512);
return romBytes;
}
static byte[] DeInterleaveSMD(byte[] source)
{
int size = source.Length;
if (size > 0x400000)
size = 0x400000;
int pages = size / 0x4000;
var output = new byte[size];
for (int page = 0; page < pages; page++)
{
for (int i = 0; i < 0x2000; i++)
{
output[(page * 0x4000) + (i * 2) + 0] = source[(page * 0x4000) + 0x2000 + i];
output[(page * 0x4000) + (i * 2) + 1] = source[(page * 0x4000) + 0x0000 + i];
}
}
return output;
}
static bool isDiscImage(string file)
{
var ext = new FileInfo(file).Extension.ToLowerInvariant();
if (ext == ".cue" || ext == ".iso")
return true;
return false;
}
}
}

View File

@ -1,3 +0,0 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>

View File

@ -1,15 +1,15 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 16
# Visual Studio Version 16
VisualStudioVersion = 16.0.28729.10
MinimumVisualStudioVersion = 16.0.28729.10
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Version", "Version\Version.csproj", "{0CE8B337-08E3-4602-BF10-C4D4C75D2F13}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Version", "Version\Version.csproj", "{0CE8B337-08E3-4602-BF10-C4D4C75D2F13}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.Client.Common", "BizHawk.Client.Common\BizHawk.Client.Common.csproj", "{24A0AA3C-B25F-4197-B23D-476D6462DBA0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BizHawk.Client.Common", "BizHawk.Client.Common\BizHawk.Client.Common.csproj", "{24A0AA3C-B25F-4197-B23D-476D6462DBA0}"
ProjectSection(ProjectDependencies) = postProject
{0CE8B337-08E3-4602-BF10-C4D4C75D2F13} = {0CE8B337-08E3-4602-BF10-C4D4C75D2F13}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.Common", "BizHawk.Common\BizHawk.Common.csproj", "{866F8D13-0678-4FF9-80A4-A3993FD4D8A3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BizHawk.Common", "BizHawk.Common\BizHawk.Common.csproj", "{866F8D13-0678-4FF9-80A4-A3993FD4D8A3}"
ProjectSection(ProjectDependencies) = postProject
{0CE8B337-08E3-4602-BF10-C4D4C75D2F13} = {0CE8B337-08E3-4602-BF10-C4D4C75D2F13}
EndProjectSection
@ -24,12 +24,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.Client.DiscoHawk",
{0CE8B337-08E3-4602-BF10-C4D4C75D2F13} = {0CE8B337-08E3-4602-BF10-C4D4C75D2F13}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.Emulation.DiscSystem", "BizHawk.Emulation.DiscSystem\BizHawk.Emulation.DiscSystem.csproj", "{F51946EA-827F-4D82-B841-1F2F6D060312}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BizHawk.Emulation.DiscSystem", "BizHawk.Emulation.DiscSystem\BizHawk.Emulation.DiscSystem.csproj", "{F51946EA-827F-4D82-B841-1F2F6D060312}"
ProjectSection(ProjectDependencies) = postProject
{0CE8B337-08E3-4602-BF10-C4D4C75D2F13} = {0CE8B337-08E3-4602-BF10-C4D4C75D2F13}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.Emulation.Common", "BizHawk.Emulation.Common\BizHawk.Emulation.Common.csproj", "{E1A23168-B571-411C-B360-2229E7225E0E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BizHawk.Emulation.Common", "BizHawk.Emulation.Common\BizHawk.Emulation.Common.csproj", "{E1A23168-B571-411C-B360-2229E7225E0E}"
ProjectSection(ProjectDependencies) = postProject
{0CE8B337-08E3-4602-BF10-C4D4C75D2F13} = {0CE8B337-08E3-4602-BF10-C4D4C75D2F13}
EndProjectSection
@ -38,18 +38,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{B51F11
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Emulation", "Emulation", "{3627C08B-3E43-4224-9DA4-40BD69495FBC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.Emulation.Cores", "BizHawk.Emulation.Cores\BizHawk.Emulation.Cores.csproj", "{197D4314-8A9F-49BA-977D-54ACEFAEB6BA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BizHawk.Emulation.Cores", "BizHawk.Emulation.Cores\BizHawk.Emulation.Cores.csproj", "{197D4314-8A9F-49BA-977D-54ACEFAEB6BA}"
ProjectSection(ProjectDependencies) = postProject
{0CE8B337-08E3-4602-BF10-C4D4C75D2F13} = {0CE8B337-08E3-4602-BF10-C4D4C75D2F13}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Bizware", "Bizware", "{0540A9A6-977E-466D-8BD3-1D8590BD5282}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.Bizware.BizwareGL", "Bizware\BizHawk.Bizware.BizwareGL\BizHawk.Bizware.BizwareGL.csproj", "{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BizHawk.Bizware.BizwareGL", "Bizware\BizHawk.Bizware.BizwareGL\BizHawk.Bizware.BizwareGL.csproj", "{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.Client.DBMan", "BizHawk.Client.DBMan\BizHawk.Client.DBMan.csproj", "{2D2890A8-C338-4439-AD8B-CB9EE85A94F9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.Client.ApiHawk", "BizHawk.Client.ApiHawk\BizHawk.Client.ApiHawk.csproj", "{8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BizHawk.Client.ApiHawk", "BizHawk.Client.ApiHawk\BizHawk.Client.ApiHawk.csproj", "{8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -93,10 +91,6 @@ Global
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}.Release|Any CPU.Build.0 = Release|Any CPU
{2D2890A8-C338-4439-AD8B-CB9EE85A94F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D2890A8-C338-4439-AD8B-CB9EE85A94F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D2890A8-C338-4439-AD8B-CB9EE85A94F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D2890A8-C338-4439-AD8B-CB9EE85A94F9}.Release|Any CPU.Build.0 = Release|Any CPU
{8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E2F11F2-3955-4382-8C3A-CEBA1276CAEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -113,7 +107,6 @@ Global
{E1A23168-B571-411C-B360-2229E7225E0E} = {3627C08B-3E43-4224-9DA4-40BD69495FBC}
{197D4314-8A9F-49BA-977D-54ACEFAEB6BA} = {3627C08B-3E43-4224-9DA4-40BD69495FBC}
{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465} = {0540A9A6-977E-466D-8BD3-1D8590BD5282}
{2D2890A8-C338-4439-AD8B-CB9EE85A94F9} = {B51F1139-3D2C-41BE-A762-EF1F9B41EACA}
{8E2F11F2-3955-4382-8C3A-CEBA1276CAEA} = {B51F1139-3D2C-41BE-A762-EF1F9B41EACA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution