Skip to content

Commit

Permalink
Fix issue #203 and issue #204
Browse files Browse the repository at this point in the history
Issue #203 is ECS.bin is not always passed to jzintv. LUI was only doing this when -s1 was needed based on ROM features and user settings. Change is to always send the -E /ecs/path/ECS.bin to jzintv since jzintv will only really care to load it if -s1 is also sent.

Custom command line setting in the case where this bug was found was including -s1 for all ROMs - which exposed the interaction between the two args.

For Issue #204, code had overlooked that settings data stores path strings as NSUrl data on Mac, so a 'resolve' is needed for the C# System.IO.Path validation code to work properly. Due to that oversight, hackfiles could *never* work on Mac because the validation code would never find files with paths that had URI syntax (file:///path/to/hackfile.txt).
  • Loading branch information
intvsteve committed Jun 30, 2018
1 parent 9486b43 commit f0e202b
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions INTV.jzIntvUI/Commands/JzIntvLauncherCommandGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,27 @@ private static void OnLaunch(object parameter)
options[CommandLineArgument.Custom] = Properties.Settings.Default.CustomCommandLine;
}

// EXEC argument
// EXEC ROM argument
if (!customCommandLine && !string.IsNullOrWhiteSpace(Properties.Settings.Default.ExecRomPath) && ConfigurationCommandGroup.IsExecRomPathvalid(Properties.Settings.Default.ExecRomPath))
{
var execPath = ConfigurationCommandGroup.ResolvePathSetting(Properties.Settings.Default.ExecRomPath);
options[CommandLineArgument.ExecPath] = execPath;
}

// GROM argument
// GROM ROM argument
if (!customCommandLine && !string.IsNullOrWhiteSpace(Properties.Settings.Default.GromRomPath) && ConfigurationCommandGroup.IsGromRomPathValid(Properties.Settings.Default.GromRomPath))
{
var gromPath = ConfigurationCommandGroup.ResolvePathSetting(Properties.Settings.Default.GromRomPath);
options[CommandLineArgument.GromPath] = gromPath;
}

// ECS ROM argument
if (!customCommandLine && !string.IsNullOrWhiteSpace(Properties.Settings.Default.EcsRomPath) && ConfigurationCommandGroup.IsEcsRomPathValid(Properties.Settings.Default.EcsRomPath))
{
var ecsPath = ConfigurationCommandGroup.ResolvePathSetting(Properties.Settings.Default.EcsRomPath);
options[CommandLineArgument.EcsPath] = ecsPath;
}

// ECS argument
var enableEcs = false;
forceSetting = false;
Expand Down Expand Up @@ -191,14 +198,6 @@ private static void OnLaunch(object parameter)
}
if (enableEcs || forceSetting)
{
if (enableEcs)
{
if (!string.IsNullOrWhiteSpace(Properties.Settings.Default.EcsRomPath) && ConfigurationCommandGroup.IsEcsRomPathValid())
{
var ecsPath = ConfigurationCommandGroup.ResolvePathSetting(Properties.Settings.Default.EcsRomPath);
options[CommandLineArgument.EcsPath] = ecsPath;
}
}
options[CommandLineArgument.EnableEcs] = enableEcs;
}

Expand Down Expand Up @@ -305,10 +304,13 @@ private static void OnLaunch(object parameter)
}

// Keyboard hackfile argument
if (!customCommandLine && ConfigurationCommandGroup.IsPathValid(Properties.Settings.Default.DefaultKeyboardConfigPath))
if (!customCommandLine && !string.IsNullOrWhiteSpace(Properties.Settings.Default.DefaultKeyboardConfigPath))
{
var hackfile = ConfigurationCommandGroup.ResolvePathSetting(Properties.Settings.Default.DefaultKeyboardConfigPath);
options[CommandLineArgument.KeyboardHackFile] = hackfile;
if (ConfigurationCommandGroup.IsPathValid(hackfile))
{
options[CommandLineArgument.KeyboardHackFile] = hackfile;
}
}

// Keyboard map argument
Expand Down Expand Up @@ -355,15 +357,15 @@ private static void OnLaunch(object parameter)
// Classic Game Controller configuration arguments
if (!customCommandLine)
{
if (ConfigurationCommandGroup.IsPathValid(Properties.Settings.Default.ClassicGameController0ConfigPath))
var cgcPath = string.IsNullOrWhiteSpace(Properties.Settings.Default.ClassicGameController0ConfigPath) ? string.Empty : ConfigurationCommandGroup.ResolvePathSetting(Properties.Settings.Default.ClassicGameController0ConfigPath);
if (ConfigurationCommandGroup.IsPathValid(cgcPath))
{
var configfile = ConfigurationCommandGroup.ResolvePathSetting(Properties.Settings.Default.ClassicGameController0ConfigPath);
options[CommandLineArgument.ClassicGameControllerMaster] = configfile;
options[CommandLineArgument.ClassicGameControllerMaster] = cgcPath;
}
if (ConfigurationCommandGroup.IsPathValid(Properties.Settings.Default.ClassicGameController1ConfigPath))
cgcPath = string.IsNullOrWhiteSpace(Properties.Settings.Default.ClassicGameController1ConfigPath) ? string.Empty : ConfigurationCommandGroup.ResolvePathSetting(Properties.Settings.Default.ClassicGameController1ConfigPath);
if (ConfigurationCommandGroup.IsPathValid(cgcPath))
{
var configfile = ConfigurationCommandGroup.ResolvePathSetting(Properties.Settings.Default.ClassicGameController1ConfigPath);
options[CommandLineArgument.ClassicGameControllerEcs] = configfile;
options[CommandLineArgument.ClassicGameControllerEcs] = cgcPath;
}
}

Expand Down

0 comments on commit f0e202b

Please sign in to comment.