Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion App.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<configuration>
<appSettings>
<add key="dicPath" value="Programs\DiscImageCreator.exe"/>
<add key="psxt001zPath" value="psxt001z.exe"/>
<add key="subdumpPath" value="subdump.exe"/>
<add key="defaultOutputPath" value="ISO"/>
</appSettings>
Expand Down
8 changes: 4 additions & 4 deletions Data/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ public static class Template
public const string DATField = "DAT";
public const string ErrorCountField = "Error Count";
public const string CuesheetField = "Cuesheet";
public const string SubIntentionField = "SubIntention Data (SecuROM)";
public const string SubIntentionField = "SubIntention Data (SecuROM/LibCrypt)";
public const string WriteOffsetField = "Write Offset";
public const string LayerbreakField = "Layerbreak";
public const string PlaystationEXEDateField = "EXE Date";
public const string PlayStationEDCField = "EDC"; // TODO: Not automatic yet
public const string PlayStationAntiModchipField = "Anti-modchip"; // TODO: Not automatic yet
public const string PlayStationLibCryptField = "LibCrypt"; // TODO: Not automatic yet
public const string PlayStationEDCField = "EDC";
public const string PlayStationAntiModchipField = "Anti-modchip";
public const string PlayStationLibCryptField = "LibCrypt";
public const string SaturnHeaderField = "Header";
public const string SaturnBuildDateField = "Build Date";
public const string XBOXDMIHash = "DMI.bin Hashes";
Expand Down
82 changes: 22 additions & 60 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public MainWindow()

// Populate the list of drives
PopulateDrives();
SetCurrentDiscType();

// Populate the list of drive speeds
PopulateDriveSpeeds();
Expand Down Expand Up @@ -178,7 +177,6 @@ private void PopulateSystems()
cmb_SystemType.ItemsSource = _systems;
cmb_SystemType.DisplayMemberPath = "Key";
cmb_SystemType.SelectedIndex = 0;
cmb_SystemType_SelectionChanged(null, null);

btn_StartStop.IsEnabled = false;
}
Expand All @@ -195,16 +193,16 @@ private void PopulateDrives()
.ToList();
cmb_DriveLetter.ItemsSource = _drives;
cmb_DriveLetter.DisplayMemberPath = "Key";
cmb_DriveLetter.SelectedIndex = 0;
cmb_DriveLetter_SelectionChanged(null, null);

if (cmb_DriveLetter.Items.Count > 0)
{
cmb_DriveLetter.SelectedIndex = 0;
lbl_Status.Content = "Valid optical disc found! Choose your Disc Type";
btn_StartStop.IsEnabled = (_drives.Count > 0 ? true : false);
btn_StartStop.IsEnabled = true;
}
else
{
cmb_DriveLetter.SelectedIndex = -1;
lbl_Status.Content = "No valid optical disc found!";
btn_StartStop.IsEnabled = false;
}
Expand Down Expand Up @@ -247,7 +245,6 @@ private async void StartDumping()

// Get the currently selected options
string dicPath = _options.dicPath;
string psxtPath = _options.psxtPath;
string subdumpPath = _options.subdumpPath;
char driveLetter = (char)driveKvp?.Key;
bool isFloppy = (driveKvp?.Value == UIElements.FloppyDriveString);
Expand Down Expand Up @@ -344,51 +341,6 @@ await Task.Run(() =>
childProcess.WaitForExit();
});
break;
case KnownSystem.SonyPlayStation:
if (!File.Exists(psxtPath))
{
lbl_Status.Content = "Error! Could not find psxt001z!";
break;
}

// Invoke the program with all 3 configurations
// TODO: Use these outputs for PSX information
await Task.Run(() =>
{
childProcess = new Process()
{
StartInfo = new ProcessStartInfo()
{
FileName = psxtPath,
Arguments = "\"" + DumpInformation.GetFirstTrack(outputDirectory, outputFilename) + "\" > " + "\"" + Path.Combine(outputDirectory, "psxt001z.txt"),
},
};
childProcess.Start();
childProcess.WaitForExit();

childProcess = new Process()
{
StartInfo = new ProcessStartInfo()
{
FileName = psxtPath,
Arguments = "--libcrypt \"" + Path.Combine(outputDirectory, Path.GetFileNameWithoutExtension(outputFilename) + ".sub") + "\" > \"" + Path.Combine(outputDirectory, "libcrypt.txt"),
},
};
childProcess.Start();
childProcess.WaitForExit();

childProcess = new Process()
{
StartInfo = new ProcessStartInfo()
{
FileName = psxtPath,
Arguments = "--libcryptdrvfast " + driveLetter + " > " + "\"" + Path.Combine(outputDirectory, "libcryptdrv.log"),
},
};
childProcess.Start();
childProcess.WaitForExit();
});
break;
}

// Check to make sure that the output had all the correct files
Expand Down Expand Up @@ -473,14 +425,27 @@ private void EnsureDiscInformation()
var systemKvp = cmb_SystemType.SelectedItem as KeyValuePair<string, KnownSystem?>?;
var mediaKvp = cmb_MediaType.SelectedItem as KeyValuePair<string, MediaType?>?;

// If we're on a separator, go to the next item
// If we're on a separator, go to the next item and return
if (systemKvp?.Value == null)
{
systemKvp = cmb_SystemType.Items[++cmb_SystemType.SelectedIndex] as KeyValuePair<string, KnownSystem?>?;
cmb_SystemType.SelectedIndex++;
return;
}

// Get the selected system info
var selectedSystem = systemKvp?.Value;
var selectedMediaType = mediaKvp != null ? mediaKvp?.Value : MediaType.NONE;
int currentMediaTypeIndex = _mediaTypes.FindIndex(kvp => kvp.Value == _currentMediaType);

// If the current system contains the media type, switch to it and return
if (_currentMediaType != null && _currentMediaType != MediaType.NONE)
{
if (currentMediaTypeIndex != -1 && cmb_MediaType.SelectedIndex != currentMediaTypeIndex)
{
cmb_MediaType.SelectedIndex = currentMediaTypeIndex;
return;
}
}

// No system chosen, update status
if (selectedSystem == KnownSystem.NONE)
Expand Down Expand Up @@ -524,14 +489,8 @@ private void EnsureDiscInformation()
// Take care of the selected item
if (_currentMediaType != null && _currentMediaType != MediaType.NONE)
{
int index = _mediaTypes.FindIndex(kvp => kvp.Value == _currentMediaType);
if (index != -1)
if (currentMediaTypeIndex != -1)
{
if (cmb_MediaType.SelectedIndex != index)
{
cmb_MediaType.SelectedIndex = index;
}

lbl_Status.Content = string.Format("{0} ready to dump", mediaKvp?.Key);
}
else
Expand Down Expand Up @@ -638,6 +597,9 @@ private void GetOutputNames()
/// </summary>
private void SetSupportedDriveSpeed()
{
// Set generic drive speed just in case
cmb_DriveSpeed.SelectedItem = 8;

// Get the drive letter from the selected item
var selected = cmb_DriveLetter.SelectedItem as KeyValuePair<char, string>?;
if (selected == null || (selected?.Value == UIElements.FloppyDriveString))
Expand Down
2 changes: 0 additions & 2 deletions Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public class Options
{
public string defaultOutputPath { get; private set; }
public string dicPath { get; private set; }
public string psxtPath { get; private set; }
public string subdumpPath { get; private set; }

public void Save()
Expand All @@ -31,7 +30,6 @@ public void Load()
{
//TODO: hardcoded, we should find a better way
dicPath = ConfigurationManager.AppSettings["dicPath"] ?? @"Programs\DiscImageCreator.exe";
psxtPath = ConfigurationManager.AppSettings["psxt001zPath"] ?? "psxt001z.exe";
subdumpPath = ConfigurationManager.AppSettings["subdumpPath"] ?? "subdump.exe";
defaultOutputPath = ConfigurationManager.AppSettings["defaultOutputPath"] ?? "ISO";
}
Expand Down
17 changes: 6 additions & 11 deletions OptionsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,19 @@
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>

<Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="DicImageCreator Path:" FontWeight="Bold"/>
<TextBox x:Name="txt_dicPath" Grid.Row="0" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
<Button x:Name="btn_dicPath" Grid.Row="0" Grid.Column="2" Height="22" Width="22" Content="..." Click="btn_BrowseForPath_Click" />

<Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="psxt001z Path:" FontWeight="Bold"/>
<TextBox x:Name="txt_psxtPath" Grid.Row="1" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
<Button x:Name="btn_psxtPath" Grid.Row="1" Grid.Column="2" Height="22" Width="22" Content="..." Click="btn_BrowseForPath_Click" />

<Label Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="subdump Path:" FontWeight="Bold"/>
<TextBox x:Name="txt_subdumpPath" Grid.Row="2" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
<Button x:Name="btn_subdumpPath" Grid.Row="2" Grid.Column="2" Height="22" Width="22" Content="..." Click="btn_BrowseForPath_Click"/>
<Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="subdump Path:" FontWeight="Bold"/>
<TextBox x:Name="txt_subdumpPath" Grid.Row="1" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
<Button x:Name="btn_subdumpPath" Grid.Row="1" Grid.Column="2" Height="22" Width="22" Content="..." Click="btn_BrowseForPath_Click"/>

<Label Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="Default Output Path:" FontWeight="Bold"/>
<TextBox x:Name="txt_defaultOutputPath" Grid.Row="3" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
<Button x:Name="btn_defaultOutputPath" Grid.Row="3" Grid.Column="2" Height="22" Width="22" Content="..." Click="btn_BrowseForPath_Click" />
<Label Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="Default Output Path:" FontWeight="Bold"/>
<TextBox x:Name="txt_defaultOutputPath" Grid.Row="2" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
<Button x:Name="btn_defaultOutputPath" Grid.Row="2" Grid.Column="2" Height="22" Width="22" Content="..." Click="btn_BrowseForPath_Click" />

</Grid>

Expand Down
13 changes: 1 addition & 12 deletions OptionsWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using Button = System.Windows.Controls.Button;
using TextBox = System.Windows.Controls.TextBox;
Expand Down Expand Up @@ -51,7 +40,7 @@ private FolderBrowserDialog CreateFolderBrowserDialog()

private string[] PathSettings()
{
string[] pathSettings = { "defaultOutputPath", "dicPath", "psxtPath", "subdumpPath" };
string[] pathSettings = { "defaultOutputPath", "dicPath", "subdumpPath" };
return pathSettings;
}

Expand Down
1 change: 1 addition & 0 deletions Utilities/Converters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ public static List<string> KnownSystemAndMediaTypeToParameters(KnownSystem? sys,
break;
case KnownSystem.SonyPlayStation:
parameters.Add(DICFlags.ScanAntiMod);
parameters.Add(DICFlags.NoFixSubQLibCrypt);
break;
}
break;
Expand Down
Loading