wip gba darkFilter removal

This commit is contained in:
ZestyTS 2022-01-10 00:32:52 -08:00
parent 5e4d117989
commit c6ace10600
2 changed files with 22 additions and 4 deletions

View file

@ -1,4 +1,5 @@
using GameBaseClassLibrary;
using GMWare.M2.MArchive;
using NAudio.Wave;
using System;
using System.Collections.Generic;
@ -407,7 +408,7 @@ namespace UWUVCI_AIO_WPF
break;
case GameConsoles.GBA:
GBA(RomPath);
GBA(RomPath, cfg.GBAStuff);
break;
case GameConsoles.NES:
@ -2093,7 +2094,7 @@ namespace UWUVCI_AIO_WPF
mvvm.Progress = 80;
}
private static void GBA(string injectRomPath)
private static void GBA(string injectRomPath, N64Conf config)
{
bool delete = false;
if(!new FileInfo(injectRomPath).Extension.Contains("gba"))
@ -2134,13 +2135,28 @@ namespace UWUVCI_AIO_WPF
mvvm.Progress = 40;
}
var allDataPath = Path.Combine(baseRomPath, "content", "alldata.psb.m");
if (config.DarkFilter == false)
{
var packer = new MArchivePacker(new ZlibCodec(), "MX8wgGEJ2+M47", 80);
AllDataPacker.UnpackFiles(allDataPath, "psbout", packer);
var lastModDirect = new DirectoryInfo("psbout").GetDirectories().OrderByDescending(d => d.LastWriteTimeUtc).FirstOrDefault();
packer.DecompressFile(Directory.GetCurrentDirectory() + @"\psbout\" + lastModDirect + @"\config\title_prof.psb.m");
AllDataPacker.Build("psbout", "mod_alldata", packer);
allDataPath = Directory.GetCurrentDirectory() + @"\mod_alldata.psb.m";
}
using (Process psb = new Process())
{
mvvm.msg = "Injecting ROM...";
psb.StartInfo.UseShellExecute = false;
psb.StartInfo.CreateNoWindow = true;
psb.StartInfo.FileName = Path.Combine(toolsPath, "psb.exe");
psb.StartInfo.Arguments = $"\"{Path.Combine(baseRomPath, "content", "alldata.psb.m")}\" \"{injectRomPath}\" \"{Path.Combine(baseRomPath, "content", "alldata.psb.m")}\"";
psb.StartInfo.Arguments = $"\"{allDataPath}\" \"{injectRomPath}\" \"{allDataPath}\"";
psb.Start();
psb.WaitForExit();

View file

@ -28,12 +28,14 @@
<RadioButton Content="Enabled" Width="78" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" GroupName="df" Name="rbREF" Click="RadioButton_Click" IsTabStop="False"/>
<RadioButton x:Name="rbRDF" Width="111" Content="Disabled" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" GroupName="df" Click="rbRDF_Click" IsChecked="True" IsTabStop="False"/>
</StackPanel>
<StackPanel Margin="248,18,153,438" Orientation="Horizontal">
<Label Content="DarkFilter:" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="14" Width="90"/>
<RadioButton x:Name="rbREF_GBA" Content="Enabled" Width="78" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" GroupName="dfgba" IsChecked="True" Click="rbREF_GBA_Click" IsTabStop="False" Checked="RbREF_GBA_Checked"/>
<RadioButton x:Name="rbRDF_GBA" Width="111" Content="Disabled" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" GroupName="dfgba" Click="rbRDF_GBA_Click" IsTabStop="False"/>
</StackPanel>
<TextBox materialDesign:HintAssist.Hint="BOOT SOUND (OPTIONAL)" ToolTip="Needs to be a RIFF WAVE file 48000khz and 16bit stereo." x:Name="sound" Text="{Binding BootSound}" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="10,365,157,101" Background="{x:Null}" Foreground="Black" SelectionBrush="#FF00C3D7" CaretBrush="#FF21C3F3" FontSize="18" IsReadOnly="True" Focusable="False" Cursor="Help" TextChanged="sound_TextChanged" IsTabStop="False"/>
<Image HorizontalAlignment="Left" Height="35" Margin="452,191,0,0" VerticalAlignment="Top" Width="38" OpacityMask="LightGray" Name="icoIMG" Source="/UWUVCI AIO WPF;component/UI/Images/newcamera2.png" Cursor="Hand" MouseLeftButtonDown="icoIMG_MouseLeftButtonDown" Visibility="Hidden" />
<Image HorizontalAlignment="Left" Height="35" Margin="452,236,0,0" VerticalAlignment="Top" Width="38" OpacityMask="LightGray" Name="tvIMG" Source="/UWUVCI AIO WPF;component/UI/Images/newcamera2.png" Cursor="Hand" MouseLeftButtonDown="tvIMG_MouseLeftButtonDown" Visibility="Hidden" />