TurboGrafXCD

This commit is contained in:
NicoAICP 2020-04-07 05:55:44 +02:00
parent 33408eb69e
commit f2166f0c22
8 changed files with 255 additions and 11 deletions

View file

@ -344,17 +344,36 @@ namespace UWUVCI_AIO_WPF
private static void TG16(string injectRomPath)
{
//creating pkg file including the TG16 rom
using (Process TurboInject = new Process())
//checking if folder
if (Directory.Exists(injectRomPath))
{
TurboInject.StartInfo.UseShellExecute = false;
TurboInject.StartInfo.CreateNoWindow = true;
TurboInject.StartInfo.FileName = Path.Combine(toolsPath, "BuildPcePkg.exe");
TurboInject.StartInfo.Arguments = $"\"{injectRomPath}\"";
TurboInject.Start();
TurboInject.WaitForExit();
DirectoryCopy(injectRomPath, "test", true);
//TurboGrafCD
using (Process TurboInject = new Process())
{
TurboInject.StartInfo.UseShellExecute = false;
TurboInject.StartInfo.CreateNoWindow = true;
TurboInject.StartInfo.FileName = Path.Combine(toolsPath, "BuildTurboCDPcePkg.exe");
TurboInject.StartInfo.Arguments = $"test";
TurboInject.Start();
TurboInject.WaitForExit();
}
Directory.Delete("test", true);
}
else
{
//creating pkg file including the TG16 rom
using (Process TurboInject = new Process())
{
TurboInject.StartInfo.UseShellExecute = false;
TurboInject.StartInfo.CreateNoWindow = true;
TurboInject.StartInfo.FileName = Path.Combine(toolsPath, "BuildPcePkg.exe");
TurboInject.StartInfo.Arguments = $"\"{injectRomPath}\"";
TurboInject.Start();
TurboInject.WaitForExit();
}
}
//replacing tg16 rom
File.Delete(Path.Combine(baseRomPath, "content", "pceemu", "pce.pkg"));
File.Copy("pce.pkg", Path.Combine(baseRomPath, "content", "pceemu", "pce.pkg"));

View file

@ -25,7 +25,8 @@ namespace UWUVCI_AIO_WPF.Classes
"7za.exe",
"blank.ini",
"FreeImage.dll",
"BuildPcePkg.exe"
"BuildPcePkg.exe",
"BuildTurboCDPcePkg.exe"
};
public static bool DoesToolsFolderExist()

View file

@ -46,6 +46,57 @@ namespace UWUVCI_AIO_WPF
}
}
public string turbocd()
{
string ret = string.Empty;
MessageBox.Show("Please put a TurboGraf CD ROM into a folder and select said folder.\n\nThe Folder should atleast contain:\nEXACTLY ONE *.hcd file\nOne or more *.ogg files\nOne or More *.bin files\n\nNot doing so will result in a faulty Inject. You have been warned!");
using(var dialog = new FolderBrowserDialog())
{
System.Windows.Forms.DialogResult result = dialog.ShowDialog();
if (result == DialogResult.OK)
{
try
{
if (DirectoryIsEmpty(dialog.SelectedPath))
{
System.Windows.Forms.MessageBox.Show("The folder is Empty. Please choose another folder");
}
else
{
if (Directory.GetDirectories(dialog.SelectedPath).Length > 0)
{
MessageBox.Show("This folder mustn't contain any subfolders");
}
else
{
//WUP
if (Directory.GetFiles(dialog.SelectedPath, "*.hcd").Length == 1 && Directory.GetFiles(dialog.SelectedPath, "*.ogg").Length > 0 && Directory.GetFiles(dialog.SelectedPath, "*.bin").Length > 0)
{
ret = dialog.SelectedPath;
}
else
{
MessageBox.Show("This Folder does not contain needed minimum of Files");
}
}
}
}
catch (Exception)
{
}
}
}
return ret;
}
private GameBases gbTemp;

View file

@ -28,6 +28,9 @@ namespace UWUVCI_AIO_WPF.UI.Frames
if(console == GameConsoles.N64)
{
fLoadConfig.Content = new InjectFrames.Configurations.N64Config();
} else if (console == GameConsoles.TG16)
{
fLoadConfig.Content = new InjectFrames.Configurations.TurboGrafX();
}
else
{

View file

@ -0,0 +1,28 @@
<Page x:Class="UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations.TurboGrafX"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations"
mc:Ignorable="d"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
d:DesignHeight="408" d:DesignWidth="643"
Title="OtherConfigs">
<Grid DataContext="{StaticResource mvm}">
<TextBox materialDesign:HintAssist.Hint="ROM PATH" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,38,157,325" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Text="{Binding RomPath}"/>
<TextBox materialDesign:HintAssist.Hint="ICONTEX" Name="ic" Style="{StaticResource MaterialDesignFloatingHintTextBox}" ToolTip="Needs a BitDepth of 32 and a Dimension of 128x128" Margin="10,121,157,242" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Text="{Binding GameConfiguration.TGAIco.ImgPath}" Cursor="Help"/>
<TextBox materialDesign:HintAssist.Hint="BOOTDRCTEX" Name="drc" Style="{StaticResource MaterialDesignFloatingHintTextBox}" ToolTip="Needs a BitDepth of 24 and a Dimension of 854x480" Margin="10,167,157,196" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Text="{Binding GameConfiguration.TGADrc.ImgPath}" Cursor="Help"/>
<TextBox materialDesign:HintAssist.Hint="BOOTTVTEX" Name="tv" Style="{StaticResource MaterialDesignFloatingHintTextBox}" ToolTip="Needs a BitDepth of 24 and a Dimension of 1280x720" Margin="10,212,157,151" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Text="{Binding GameConfiguration.TGATv.ImgPath}" Cursor="Help"/>
<TextBox materialDesign:HintAssist.Hint="BOOTLOGOTEX" ToolTip="Needs a BitDepth of 32 and a Dimension of 170x42" Name="log" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,257,157,106" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Cursor="Help" Text="{Binding GameConfiguration.TGALog.ImgPath}"/>
<TextBox materialDesign:HintAssist.Hint="GAME NAME" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,329,157,34" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" Text="{Binding GameConfiguration.GameName}" Name="gn"/>
<Button Content="Inject" HorizontalAlignment="Left" Margin="506,353,0,0" VerticalAlignment="Top" Width="127" IsEnabled="{Binding CanInject}" Click="InjectGame"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,270,0,0" VerticalAlignment="Top" Width="127" Click="Set_LogoTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,225,0,0" VerticalAlignment="Top" Width="127" Click="Set_TvTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,180,0,0" VerticalAlignment="Top" Width="127" Click="Set_DrcTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,134,0,0" VerticalAlignment="Top" Width="127" Click="Set_IconTex"/>
<Button Content="Set Path" HorizontalAlignment="Left" Margin="506,51,0,0" VerticalAlignment="Top" Width="127" Click="Set_Rom_Path"/>
<CheckBox Content="TurboGrafxCD" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="98" Click="CheckBox_Click"/>
</Grid>
</Page>

View file

@ -0,0 +1,135 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using UWUVCI_AIO_WPF.Properties;
namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
{
/// <summary>
/// Interaktionslogik für OtherConfigs.xaml
/// </summary>
public partial class TurboGrafX : Page, IDisposable
{
MainViewModel mvm;
bool cd = false;
public TurboGrafX()
{
InitializeComponent();
mvm = FindResource("mvm") as MainViewModel;
mvm.setThing(this);
}
public void Dispose()
{
}
private void Set_Rom_Path(object sender, RoutedEventArgs e)
{
string path = string.Empty;
if (!cd) path = mvm.GetFilePath(true, false);
else path = mvm.turbocd();
if (!CheckIfNull(path)) {
mvm.RomPath = path;
mvm.RomSet = true;
if (mvm.BaseDownloaded)
{
mvm.CanInject = true;
}
}
}
private void InjectGame(object sender, RoutedEventArgs e)
{
mvm.Inject();
}
private void Set_TvTex(object sender, RoutedEventArgs e)
{
mvm.ImageWarning();
string path = mvm.GetFilePath(false, false);
if (!CheckIfNull(path))
{
mvm.GameConfiguration.TGATv.ImgPath = path;
mvm.GameConfiguration.TGATv.extension = new FileInfo(path).Extension;
tv.Text = path;
}
}
private void Set_DrcTex(object sender, RoutedEventArgs e)
{
mvm.ImageWarning();
string path = mvm.GetFilePath(false, false);
if (!CheckIfNull(path))
{
mvm.GameConfiguration.TGADrc.ImgPath = path;
mvm.GameConfiguration.TGADrc.extension = new FileInfo(path).Extension;
drc.Text = path;
}
}
private void Set_IconTex(object sender, RoutedEventArgs e)
{
mvm.ImageWarning();
string path = mvm.GetFilePath(false, false);
if (!CheckIfNull(path)) {
mvm.GameConfiguration.TGAIco.ImgPath = path;
mvm.GameConfiguration.TGAIco.extension = new FileInfo(path).Extension;
ic.Text = path;
}
}
private void Set_LogoTex(object sender, RoutedEventArgs e)
{
mvm.ImageWarning();
string path = mvm.GetFilePath(false, false);
if (!CheckIfNull(path)) {
mvm.GameConfiguration.TGALog.ImgPath = path;
mvm.GameConfiguration.TGALog.extension = new FileInfo(path).Extension;
log.Text = path;
}
}
public void getInfoFromConfig()
{
tv.Text = mvm.GameConfiguration.TGATv.ImgPath;
ic.Text = mvm.GameConfiguration.TGAIco.ImgPath;
drc.Text = mvm.GameConfiguration.TGADrc.ImgPath;
log.Text = mvm.GameConfiguration.TGALog.ImgPath;
gn.Text = mvm.GameConfiguration.GameName;
}
private bool CheckIfNull(string s)
{
if(s == null || s.Equals(string.Empty))
{
return true;
}
return false;
}
private void CheckBox_Click(object sender, RoutedEventArgs e)
{
mvm.RomPath = null;
mvm.RomSet = false;
mvm.CanInject = false;
if (cd) cd = false;
else cd = true;
}
}
}

View file

@ -64,7 +64,7 @@ namespace UWUVCI_AIO_WPF.UI.Frames
private void Button_Click_5(object sender, RoutedEventArgs e)
{
MessageBox.Show("UWUVCI AIO - NicoAICP, Morilli, Lreiia Bot\n\n7za - Igor Pavlov\nBuildPcePkg - JohnnyGo\nCdecrypt - crediar\nCNUSPACKER - NicoAICP, Morilli\nINICreator - NicoAICP\nN64Creator - Morilli\npng2tga - Easy2Convert\ninject_gba_c (psb) - Morilli\nRetroInject_C - Morilli\ntga_verify - Morilli\nWiiUDownloader - Morilli\nwiiurpxtool - 0CHB0", "Credits");
MessageBox.Show("UWUVCI AIO - NicoAICP, Morilli, Lreiia Bot\n\n7za - Igor Pavlov\nBuildPcePkg & BuildTurboCDPcePkg - JohnnyGo\nCdecrypt - crediar\nCNUSPACKER - NicoAICP, Morilli\nINICreator - NicoAICP\nN64Creator - Morilli\npng2tga - Easy2Convert\ninject_gba_c (psb) - Morilli\nRetroInject_C - Morilli\ntga_verify - Morilli\nWiiUDownloader - Morilli\nwiiurpxtool - 0CHB0", "Credits");
}
}
}

View file

@ -97,6 +97,9 @@
<Compile Include="UI\Done.xaml.cs">
<DependentUpon>Done.xaml</DependentUpon>
</Compile>
<Compile Include="UI\Frames\InjectFrames\Configurations\OtherConfigs - Kopieren.xaml.cs">
<DependentUpon>OtherConfigs - Kopieren.xaml</DependentUpon>
</Compile>
<Compile Include="UI\Frames\KeyFrame\TKFrame.xaml.cs">
<DependentUpon>TKFrame.xaml</DependentUpon>
</Compile>
@ -133,6 +136,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UI\Frames\InjectFrames\Configurations\OtherConfigs - Kopieren.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UI\Frames\InjectFrames\Configurations\OtherConfigs.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>