Fixing some stuff on the GSDumpGUI (more update to come) to allow me to test decently Gsdx while waiting for DirectX SDK to complete download

1) Change log to "log.txt"
2) Fix a crash when an invalid directory is specified in the textbox.
3) Fix working folder for loading library. Now it searches for dependencies in the same folder as the plugin dll.
4) Fix configuration save/loading

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4102 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
feal87@gmail.com 2010-12-19 10:48:09 +00:00
parent 4ebbe65c4f
commit 40f6aef1d3
4 changed files with 42 additions and 4 deletions

View File

@ -7,6 +7,7 @@ using System.Runtime.InteropServices;
using System.Threading;
using System.Diagnostics;
using GSDumpGUI.Properties;
using System.IO;
namespace GSDumpGUI
{
@ -51,6 +52,7 @@ namespace GSDumpGUI
GSDXWrapper wrap = new GSDXWrapper();
wrap.Load(DLLPath);
Directory.SetCurrentDirectory(Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory + "GSDumpGSDXConfigs\\" + Path.GetFileName(DLLPath) + "\\"));
if (Operation == "GSReplay")
{
ChangeIcon = true;

View File

@ -124,18 +124,29 @@ namespace GSDumpGUI
private void cmdSave_Click(object sender, EventArgs e)
{
Boolean Err = false;
if (System.IO.Directory.Exists(txtDumpsDirectory.Text))
Properties.Settings.Default.DumpDir = txtDumpsDirectory.Text;
else
{
Err = true;
MessageBox.Show("Select a correct directory for dumps", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
if (System.IO.Directory.Exists(txtGSDXDirectory.Text))
Properties.Settings.Default.GSDXDir = txtGSDXDirectory.Text;
else
{
Err = true;
MessageBox.Show("Select a correct directory for GSDX", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Properties.Settings.Default.Save();
ReloadGSDXs();
if (!Err)
{
Properties.Settings.Default.Save();
ReloadGSDXs();
}
}
private void cmdStart_Click(object sender, EventArgs e)

View File

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GSDumpGUI", "GSDumpGUI.csproj", "{825E4311-652D-4A1E-8AA1-F6D81B186E33}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{825E4311-652D-4A1E-8AA1-F6D81B186E33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{825E4311-652D-4A1E-8AA1-F6D81B186E33}.Debug|Any CPU.Build.0 = Debug|Any CPU
{825E4311-652D-4A1E-8AA1-F6D81B186E33}.Release|Any CPU.ActiveCfg = Release|Any CPU
{825E4311-652D-4A1E-8AA1-F6D81B186E33}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.IO;
namespace GSDumpGUI
{
@ -24,6 +25,8 @@ namespace GSDumpGUI
{
NativeMethods.SetErrorMode(0x8007);
Boolean Ris = true;
Directory.SetCurrentDirectory(Path.GetDirectoryName(DLL));
IntPtr hmod = NativeMethods.LoadLibrary(DLL);
if (hmod.ToInt64() > 0)
{
@ -35,16 +38,17 @@ namespace GSDumpGUI
if (!((funcaddrConfig.ToInt64() > 0) && (funcaddrLibName.ToInt64() > 0) && (funcaddrReplay.ToInt64() > 0)))
{
Int32 id = NativeMethods.GetLastError();
System.IO.File.AppendAllText(AppDomain.CurrentDomain.BaseDirectory + "test.txt", DLL + " failed to load. Error " + id);
System.IO.File.AppendAllText(AppDomain.CurrentDomain.BaseDirectory + "log.txt", DLL + " failed to load. Error " + id + Environment.NewLine);
Ris = false;
}
}
else
{
Int32 id = NativeMethods.GetLastError();
System.IO.File.AppendAllText(AppDomain.CurrentDomain.BaseDirectory + "test.txt", DLL + " failed to load. Error " + id + Environment.NewLine);
System.IO.File.AppendAllText(AppDomain.CurrentDomain.BaseDirectory + "log.txt", DLL + " failed to load. Error " + id + Environment.NewLine);
Ris = false;
}
NativeMethods.SetErrorMode(0x0000);
return Ris;
}
@ -60,6 +64,7 @@ namespace GSDumpGUI
Unload();
Loaded = true;
Directory.SetCurrentDirectory(Path.GetDirectoryName(DLL));
IntPtr hmod = NativeMethods.LoadLibrary(DLL);
if (hmod.ToInt64() > 0)
{