mirror of
https://github.com/Brawl345/customizemii.git
synced 2024-11-13 03:45:10 +01:00
CustomizeMii 2.2
This commit is contained in:
parent
f1f598c218
commit
342875a7f5
@ -67,7 +67,11 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="CustomizeMiiInstaller, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\CustomizeMiiInstaller\bin\Debug\CustomizeMiiInstaller.dll</HintPath>
|
||||
<HintPath>..\CustomizeMiiInstaller\bin\Release\CustomizeMiiInstaller.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ForwardMii, Version=1.2.0.0, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\ForwardMii\bin\x86\Release\ForwardMii.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
@ -206,12 +210,6 @@
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ForwardMii\ForwardMii.csproj">
|
||||
<Project>{20CB2CA7-6767-4758-97FA-97395F47CD6B}</Project>
|
||||
<Name>ForwardMii</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
@ -464,10 +464,13 @@ namespace CustomizeMii
|
||||
try
|
||||
{
|
||||
BackgroundWorker bwLoadChannel = sender as BackgroundWorker;
|
||||
EventHandler Initialize = new EventHandler(this.Initialize);
|
||||
EventHandler SetSourceWad = new EventHandler(this.SetSourceWad);
|
||||
byte[] WadFile = Wii.Tools.LoadFileToByteArray((string)e.Argument);
|
||||
bool hashesMatch = true;
|
||||
|
||||
this.Invoke(Initialize);
|
||||
|
||||
if (Directory.Exists(TempUnpackPath)) Directory.Delete(TempUnpackPath, true);
|
||||
|
||||
bwLoadChannel.ReportProgress(0, "Loading WAD...");
|
||||
@ -475,6 +478,7 @@ namespace CustomizeMii
|
||||
if (Wii.U8.CheckU8(TempUnpackPath + "00000000.app") == false)
|
||||
throw new Exception("CustomizeMii only edits Channel WADs!");
|
||||
|
||||
SourceWad = (string)e.Argument;
|
||||
this.Invoke(SetSourceWad);
|
||||
|
||||
bwLoadChannel.ReportProgress(25, "Loading 00000000.app...");
|
||||
@ -490,21 +494,24 @@ namespace CustomizeMii
|
||||
string[] ChannelTitles = Wii.WadInfo.GetChannelTitles(WadFile);
|
||||
string TitleID = Wii.WadInfo.GetTitleID(WadFile, 1);
|
||||
|
||||
bool allLangs = true;
|
||||
SetText(tbTitleID, TitleID);
|
||||
SetText(tbAllLanguages, ChannelTitles[1]);
|
||||
|
||||
if (ChannelTitles[0] != ChannelTitles[1])
|
||||
SetText(tbJapanese, ChannelTitles[0]);
|
||||
if (ChannelTitles[2] != ChannelTitles[1])
|
||||
SetText(tbGerman, ChannelTitles[2]);
|
||||
if (ChannelTitles[3] != ChannelTitles[1])
|
||||
SetText(tbFrench, ChannelTitles[3]);
|
||||
if (ChannelTitles[4] != ChannelTitles[1])
|
||||
SetText(tbSpanish, ChannelTitles[4]);
|
||||
if (ChannelTitles[5] != ChannelTitles[1])
|
||||
SetText(tbItalian, ChannelTitles[5]);
|
||||
if (ChannelTitles[6] != ChannelTitles[1])
|
||||
SetText(tbDutch, ChannelTitles[6]);
|
||||
if (ChannelTitles[0] != ChannelTitles[1]) SetText(tbJapanese, ChannelTitles[0]);
|
||||
else allLangs = false;
|
||||
if (ChannelTitles[2] != ChannelTitles[1]) SetText(tbGerman, ChannelTitles[2]);
|
||||
else allLangs = false;
|
||||
if (ChannelTitles[3] != ChannelTitles[1]) SetText(tbFrench, ChannelTitles[3]);
|
||||
else allLangs = false;
|
||||
if (ChannelTitles[4] != ChannelTitles[1]) SetText(tbSpanish, ChannelTitles[4]);
|
||||
else allLangs = false;
|
||||
if (ChannelTitles[5] != ChannelTitles[1]) SetText(tbItalian, ChannelTitles[5]);
|
||||
else allLangs = false;
|
||||
if (ChannelTitles[6] != ChannelTitles[1]) SetText(tbDutch, ChannelTitles[6]);
|
||||
else allLangs = false;
|
||||
|
||||
if (allLangs) SetText(tbEnglish, ChannelTitles[1]);
|
||||
else SetText(tbAllLanguages, ChannelTitles[1]);
|
||||
|
||||
string[] trailer = Directory.GetFiles(TempUnpackPath, "*.trailer");
|
||||
if (trailer.Length > 0)
|
||||
@ -532,6 +539,8 @@ namespace CustomizeMii
|
||||
EventHandler EnableCtrls = new EventHandler(this.EnableControls);
|
||||
this.Invoke(EnableCtrls);
|
||||
|
||||
SetButton(btnBrowseSource, "Clear");
|
||||
|
||||
if (!hashesMatch)
|
||||
System.Windows.Forms.MessageBox.Show("At least one content's hash doesn't match the hash in the TMD!\n" +
|
||||
"Some files of the WAD might be corrupted, thus it might brick your Wii!", "Warning",
|
||||
@ -558,7 +567,6 @@ namespace CustomizeMii
|
||||
|
||||
if (transmitInfo.timeElapsed > 0)
|
||||
{
|
||||
this.Invoke(Initialize);
|
||||
System.Windows.Forms.DialogResult dlg;
|
||||
|
||||
if (transmitInfo.usedCompression)
|
||||
@ -585,6 +593,8 @@ namespace CustomizeMii
|
||||
if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
File.Copy(TempPath + "SendToWii.wad", sfd.FileName, true);
|
||||
}
|
||||
|
||||
this.Invoke(Initialize);
|
||||
}
|
||||
|
||||
try { File.Delete(TempPath + "SendToWii.wad"); }
|
||||
@ -750,13 +760,17 @@ namespace CustomizeMii
|
||||
if (!this.sendToWii)
|
||||
{
|
||||
EventHandler EnableControls = new EventHandler(this.EnableControls);
|
||||
EventHandler Initialize = new EventHandler(this.Initialize);
|
||||
currentProgress.progressValue = 100;
|
||||
currentProgress.progressState = " ";
|
||||
|
||||
this.Invoke(ProgressUpdate);
|
||||
this.Invoke(EnableControls);
|
||||
this.Invoke(Initialize);
|
||||
|
||||
if (wadCreationInfo.success)
|
||||
{
|
||||
EventHandler Initialize = new EventHandler(this.Initialize);
|
||||
this.Invoke(Initialize);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -793,6 +807,9 @@ namespace CustomizeMii
|
||||
this.sendToWii = wadInfo.sendToWii;
|
||||
sendWadReady = 0;
|
||||
|
||||
wadCreationInfo = wadInfo;
|
||||
wadCreationInfo.success = false;
|
||||
|
||||
bwCreateWad.ReportProgress(0, "Making TPLs transparent");
|
||||
MakeBannerTplsTransparent();
|
||||
MakeIconTplsTransparent();
|
||||
@ -925,7 +942,7 @@ namespace CustomizeMii
|
||||
{
|
||||
CreateForwarderSimple(TempUnpackPath + "\\00000001.app");
|
||||
}
|
||||
else if (tbDol.Text.StartsWith("Complex Forwarder:"))
|
||||
else if (tbDol.Text.StartsWith("Complex Forwarder"))
|
||||
{
|
||||
bwCreateWad.ReportProgress(82, "Compiling Forwarder...");
|
||||
CreateForwarderComplex(TempUnpackPath + "\\00000001.app");
|
||||
@ -989,6 +1006,7 @@ namespace CustomizeMii
|
||||
else sendWadReady = 1;
|
||||
|
||||
wadCreationInfo = wadInfo;
|
||||
wadCreationInfo.success = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
297
CustomizeMii/CustomizeMii_ComplexForwarder.Designer.cs
generated
297
CustomizeMii/CustomizeMii_ComplexForwarder.Designer.cs
generated
@ -59,13 +59,38 @@ namespace CustomizeMii
|
||||
this.tb2 = new System.Windows.Forms.TextBox();
|
||||
this.tb3 = new System.Windows.Forms.TextBox();
|
||||
this.tb4 = new System.Windows.Forms.TextBox();
|
||||
this.tabPaths = new System.Windows.Forms.TabControl();
|
||||
this.tabRequired = new System.Windows.Forms.TabPage();
|
||||
this.tabOptional1 = new System.Windows.Forms.TabPage();
|
||||
this.cbPack1 = new System.Windows.Forms.CheckBox();
|
||||
this.tb5 = new System.Windows.Forms.TextBox();
|
||||
this.tb6 = new System.Windows.Forms.TextBox();
|
||||
this.tb7 = new System.Windows.Forms.TextBox();
|
||||
this.tb8 = new System.Windows.Forms.TextBox();
|
||||
this.tabOptional2 = new System.Windows.Forms.TabPage();
|
||||
this.cbPack2 = new System.Windows.Forms.CheckBox();
|
||||
this.tb9 = new System.Windows.Forms.TextBox();
|
||||
this.tb10 = new System.Windows.Forms.TextBox();
|
||||
this.tb11 = new System.Windows.Forms.TextBox();
|
||||
this.tb12 = new System.Windows.Forms.TextBox();
|
||||
this.tabOptional3 = new System.Windows.Forms.TabPage();
|
||||
this.cbPack3 = new System.Windows.Forms.CheckBox();
|
||||
this.tb13 = new System.Windows.Forms.TextBox();
|
||||
this.tb14 = new System.Windows.Forms.TextBox();
|
||||
this.tb15 = new System.Windows.Forms.TextBox();
|
||||
this.tb16 = new System.Windows.Forms.TextBox();
|
||||
this.tabPaths.SuspendLayout();
|
||||
this.tabRequired.SuspendLayout();
|
||||
this.tabOptional1.SuspendLayout();
|
||||
this.tabOptional2.SuspendLayout();
|
||||
this.tabOptional3.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tb1
|
||||
//
|
||||
this.tb1.Location = new System.Drawing.Point(12, 62);
|
||||
this.tb1.Location = new System.Drawing.Point(6, 17);
|
||||
this.tb1.Name = "tb1";
|
||||
this.tb1.Size = new System.Drawing.Size(334, 20);
|
||||
this.tb1.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb1.TabIndex = 1;
|
||||
this.tb1.Text = "SD:/apps/example/boot.dol";
|
||||
//
|
||||
@ -73,7 +98,7 @@ namespace CustomizeMii
|
||||
//
|
||||
this.cbImage43.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.cbImage43.AutoSize = true;
|
||||
this.cbImage43.Location = new System.Drawing.Point(15, 224);
|
||||
this.cbImage43.Location = new System.Drawing.Point(15, 282);
|
||||
this.cbImage43.Name = "cbImage43";
|
||||
this.cbImage43.Size = new System.Drawing.Size(73, 17);
|
||||
this.cbImage43.TabIndex = 3;
|
||||
@ -85,7 +110,7 @@ namespace CustomizeMii
|
||||
//
|
||||
this.cbImage169.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.cbImage169.AutoSize = true;
|
||||
this.cbImage169.Location = new System.Drawing.Point(15, 254);
|
||||
this.cbImage169.Location = new System.Drawing.Point(15, 312);
|
||||
this.cbImage169.Name = "cbImage169";
|
||||
this.cbImage169.Size = new System.Drawing.Size(79, 17);
|
||||
this.cbImage169.TabIndex = 3;
|
||||
@ -97,7 +122,7 @@ namespace CustomizeMii
|
||||
//
|
||||
this.tbImage43.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.tbImage43.Enabled = false;
|
||||
this.tbImage43.Location = new System.Drawing.Point(94, 222);
|
||||
this.tbImage43.Location = new System.Drawing.Point(94, 280);
|
||||
this.tbImage43.Name = "tbImage43";
|
||||
this.tbImage43.Size = new System.Drawing.Size(171, 20);
|
||||
this.tbImage43.TabIndex = 4;
|
||||
@ -106,7 +131,7 @@ namespace CustomizeMii
|
||||
//
|
||||
this.tbImage169.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.tbImage169.Enabled = false;
|
||||
this.tbImage169.Location = new System.Drawing.Point(94, 251);
|
||||
this.tbImage169.Location = new System.Drawing.Point(94, 309);
|
||||
this.tbImage169.Name = "tbImage169";
|
||||
this.tbImage169.Size = new System.Drawing.Size(171, 20);
|
||||
this.tbImage169.TabIndex = 5;
|
||||
@ -115,7 +140,7 @@ namespace CustomizeMii
|
||||
//
|
||||
this.btnBrowseImage43.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.btnBrowseImage43.Enabled = false;
|
||||
this.btnBrowseImage43.Location = new System.Drawing.Point(271, 222);
|
||||
this.btnBrowseImage43.Location = new System.Drawing.Point(271, 280);
|
||||
this.btnBrowseImage43.Name = "btnBrowseImage43";
|
||||
this.btnBrowseImage43.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnBrowseImage43.TabIndex = 6;
|
||||
@ -127,7 +152,7 @@ namespace CustomizeMii
|
||||
//
|
||||
this.btnBrowseImage169.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.btnBrowseImage169.Enabled = false;
|
||||
this.btnBrowseImage169.Location = new System.Drawing.Point(271, 251);
|
||||
this.btnBrowseImage169.Location = new System.Drawing.Point(271, 309);
|
||||
this.btnBrowseImage169.Name = "btnBrowseImage169";
|
||||
this.btnBrowseImage169.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnBrowseImage169.TabIndex = 6;
|
||||
@ -138,7 +163,7 @@ namespace CustomizeMii
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.label1.Location = new System.Drawing.Point(0, 174);
|
||||
this.label1.Location = new System.Drawing.Point(0, 232);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(358, 40);
|
||||
this.label1.TabIndex = 7;
|
||||
@ -149,7 +174,7 @@ namespace CustomizeMii
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.btnOK.Location = new System.Drawing.Point(15, 292);
|
||||
this.btnOK.Location = new System.Drawing.Point(15, 347);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(160, 23);
|
||||
this.btnOK.TabIndex = 8;
|
||||
@ -161,7 +186,7 @@ namespace CustomizeMii
|
||||
//
|
||||
this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(186, 292);
|
||||
this.btnCancel.Location = new System.Drawing.Point(186, 347);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(160, 23);
|
||||
this.btnCancel.TabIndex = 8;
|
||||
@ -172,7 +197,7 @@ namespace CustomizeMii
|
||||
// label2
|
||||
//
|
||||
this.label2.Anchor = System.Windows.Forms.AnchorStyles.Top;
|
||||
this.label2.Location = new System.Drawing.Point(0, 14);
|
||||
this.label2.Location = new System.Drawing.Point(0, 15);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(358, 40);
|
||||
this.label2.TabIndex = 7;
|
||||
@ -182,35 +207,236 @@ namespace CustomizeMii
|
||||
//
|
||||
// tb2
|
||||
//
|
||||
this.tb2.Location = new System.Drawing.Point(12, 88);
|
||||
this.tb2.Location = new System.Drawing.Point(6, 46);
|
||||
this.tb2.Name = "tb2";
|
||||
this.tb2.Size = new System.Drawing.Size(334, 20);
|
||||
this.tb2.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb2.TabIndex = 1;
|
||||
this.tb2.Text = "SD:/apps/example/boot.elf";
|
||||
//
|
||||
// tb3
|
||||
//
|
||||
this.tb3.Location = new System.Drawing.Point(12, 114);
|
||||
this.tb3.Location = new System.Drawing.Point(6, 75);
|
||||
this.tb3.Name = "tb3";
|
||||
this.tb3.Size = new System.Drawing.Size(334, 20);
|
||||
this.tb3.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb3.TabIndex = 1;
|
||||
this.tb3.Text = "USB:/apps/example/boot.dol";
|
||||
//
|
||||
// tb4
|
||||
//
|
||||
this.tb4.Location = new System.Drawing.Point(12, 140);
|
||||
this.tb4.Location = new System.Drawing.Point(6, 104);
|
||||
this.tb4.Name = "tb4";
|
||||
this.tb4.Size = new System.Drawing.Size(334, 20);
|
||||
this.tb4.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb4.TabIndex = 1;
|
||||
this.tb4.Text = "USB:/apps/example/boot.elf";
|
||||
//
|
||||
// tabPaths
|
||||
//
|
||||
this.tabPaths.Controls.Add(this.tabRequired);
|
||||
this.tabPaths.Controls.Add(this.tabOptional1);
|
||||
this.tabPaths.Controls.Add(this.tabOptional2);
|
||||
this.tabPaths.Controls.Add(this.tabOptional3);
|
||||
this.tabPaths.Location = new System.Drawing.Point(15, 62);
|
||||
this.tabPaths.Name = "tabPaths";
|
||||
this.tabPaths.SelectedIndex = 0;
|
||||
this.tabPaths.Size = new System.Drawing.Size(331, 159);
|
||||
this.tabPaths.TabIndex = 9;
|
||||
//
|
||||
// tabRequired
|
||||
//
|
||||
this.tabRequired.Controls.Add(this.tb1);
|
||||
this.tabRequired.Controls.Add(this.tb2);
|
||||
this.tabRequired.Controls.Add(this.tb3);
|
||||
this.tabRequired.Controls.Add(this.tb4);
|
||||
this.tabRequired.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabRequired.Name = "tabRequired";
|
||||
this.tabRequired.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabRequired.Size = new System.Drawing.Size(323, 133);
|
||||
this.tabRequired.TabIndex = 0;
|
||||
this.tabRequired.Text = "Required";
|
||||
this.tabRequired.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tabOptional1
|
||||
//
|
||||
this.tabOptional1.Controls.Add(this.cbPack1);
|
||||
this.tabOptional1.Controls.Add(this.tb5);
|
||||
this.tabOptional1.Controls.Add(this.tb6);
|
||||
this.tabOptional1.Controls.Add(this.tb7);
|
||||
this.tabOptional1.Controls.Add(this.tb8);
|
||||
this.tabOptional1.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabOptional1.Name = "tabOptional1";
|
||||
this.tabOptional1.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabOptional1.Size = new System.Drawing.Size(323, 133);
|
||||
this.tabOptional1.TabIndex = 1;
|
||||
this.tabOptional1.Text = "Optional 1";
|
||||
this.tabOptional1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbPack1
|
||||
//
|
||||
this.cbPack1.AutoSize = true;
|
||||
this.cbPack1.Location = new System.Drawing.Point(6, 6);
|
||||
this.cbPack1.Name = "cbPack1";
|
||||
this.cbPack1.Size = new System.Drawing.Size(59, 17);
|
||||
this.cbPack1.TabIndex = 6;
|
||||
this.cbPack1.Text = "Enable";
|
||||
this.cbPack1.UseVisualStyleBackColor = true;
|
||||
this.cbPack1.CheckedChanged += new System.EventHandler(this.cbPack1_CheckedChanged);
|
||||
//
|
||||
// tb5
|
||||
//
|
||||
this.tb5.Enabled = false;
|
||||
this.tb5.Location = new System.Drawing.Point(6, 29);
|
||||
this.tb5.Name = "tb5";
|
||||
this.tb5.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb5.TabIndex = 4;
|
||||
//
|
||||
// tb6
|
||||
//
|
||||
this.tb6.Enabled = false;
|
||||
this.tb6.Location = new System.Drawing.Point(6, 54);
|
||||
this.tb6.Name = "tb6";
|
||||
this.tb6.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb6.TabIndex = 5;
|
||||
//
|
||||
// tb7
|
||||
//
|
||||
this.tb7.Enabled = false;
|
||||
this.tb7.Location = new System.Drawing.Point(6, 79);
|
||||
this.tb7.Name = "tb7";
|
||||
this.tb7.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb7.TabIndex = 2;
|
||||
//
|
||||
// tb8
|
||||
//
|
||||
this.tb8.Enabled = false;
|
||||
this.tb8.Location = new System.Drawing.Point(6, 104);
|
||||
this.tb8.Name = "tb8";
|
||||
this.tb8.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb8.TabIndex = 3;
|
||||
//
|
||||
// tabOptional2
|
||||
//
|
||||
this.tabOptional2.Controls.Add(this.cbPack2);
|
||||
this.tabOptional2.Controls.Add(this.tb9);
|
||||
this.tabOptional2.Controls.Add(this.tb10);
|
||||
this.tabOptional2.Controls.Add(this.tb11);
|
||||
this.tabOptional2.Controls.Add(this.tb12);
|
||||
this.tabOptional2.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabOptional2.Name = "tabOptional2";
|
||||
this.tabOptional2.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabOptional2.Size = new System.Drawing.Size(323, 133);
|
||||
this.tabOptional2.TabIndex = 2;
|
||||
this.tabOptional2.Text = "Optional 2";
|
||||
this.tabOptional2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbPack2
|
||||
//
|
||||
this.cbPack2.AutoSize = true;
|
||||
this.cbPack2.Location = new System.Drawing.Point(6, 6);
|
||||
this.cbPack2.Name = "cbPack2";
|
||||
this.cbPack2.Size = new System.Drawing.Size(59, 17);
|
||||
this.cbPack2.TabIndex = 11;
|
||||
this.cbPack2.Text = "Enable";
|
||||
this.cbPack2.UseVisualStyleBackColor = true;
|
||||
this.cbPack2.CheckedChanged += new System.EventHandler(this.cbPack2_CheckedChanged);
|
||||
//
|
||||
// tb9
|
||||
//
|
||||
this.tb9.Enabled = false;
|
||||
this.tb9.Location = new System.Drawing.Point(6, 29);
|
||||
this.tb9.Name = "tb9";
|
||||
this.tb9.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb9.TabIndex = 9;
|
||||
//
|
||||
// tb10
|
||||
//
|
||||
this.tb10.Enabled = false;
|
||||
this.tb10.Location = new System.Drawing.Point(6, 54);
|
||||
this.tb10.Name = "tb10";
|
||||
this.tb10.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb10.TabIndex = 10;
|
||||
//
|
||||
// tb11
|
||||
//
|
||||
this.tb11.Enabled = false;
|
||||
this.tb11.Location = new System.Drawing.Point(6, 79);
|
||||
this.tb11.Name = "tb11";
|
||||
this.tb11.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb11.TabIndex = 7;
|
||||
//
|
||||
// tb12
|
||||
//
|
||||
this.tb12.Enabled = false;
|
||||
this.tb12.Location = new System.Drawing.Point(6, 104);
|
||||
this.tb12.Name = "tb12";
|
||||
this.tb12.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb12.TabIndex = 8;
|
||||
//
|
||||
// tabOptional3
|
||||
//
|
||||
this.tabOptional3.Controls.Add(this.cbPack3);
|
||||
this.tabOptional3.Controls.Add(this.tb13);
|
||||
this.tabOptional3.Controls.Add(this.tb14);
|
||||
this.tabOptional3.Controls.Add(this.tb15);
|
||||
this.tabOptional3.Controls.Add(this.tb16);
|
||||
this.tabOptional3.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabOptional3.Name = "tabOptional3";
|
||||
this.tabOptional3.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabOptional3.Size = new System.Drawing.Size(323, 133);
|
||||
this.tabOptional3.TabIndex = 3;
|
||||
this.tabOptional3.Text = "Optional 3";
|
||||
this.tabOptional3.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbPack3
|
||||
//
|
||||
this.cbPack3.AutoSize = true;
|
||||
this.cbPack3.Location = new System.Drawing.Point(6, 6);
|
||||
this.cbPack3.Name = "cbPack3";
|
||||
this.cbPack3.Size = new System.Drawing.Size(59, 17);
|
||||
this.cbPack3.TabIndex = 11;
|
||||
this.cbPack3.Text = "Enable";
|
||||
this.cbPack3.UseVisualStyleBackColor = true;
|
||||
this.cbPack3.CheckedChanged += new System.EventHandler(this.cbPack3_CheckedChanged);
|
||||
//
|
||||
// tb13
|
||||
//
|
||||
this.tb13.Enabled = false;
|
||||
this.tb13.Location = new System.Drawing.Point(6, 29);
|
||||
this.tb13.Name = "tb13";
|
||||
this.tb13.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb13.TabIndex = 9;
|
||||
//
|
||||
// tb14
|
||||
//
|
||||
this.tb14.Enabled = false;
|
||||
this.tb14.Location = new System.Drawing.Point(6, 54);
|
||||
this.tb14.Name = "tb14";
|
||||
this.tb14.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb14.TabIndex = 10;
|
||||
//
|
||||
// tb15
|
||||
//
|
||||
this.tb15.Enabled = false;
|
||||
this.tb15.Location = new System.Drawing.Point(6, 79);
|
||||
this.tb15.Name = "tb15";
|
||||
this.tb15.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb15.TabIndex = 7;
|
||||
//
|
||||
// tb16
|
||||
//
|
||||
this.tb16.Enabled = false;
|
||||
this.tb16.Location = new System.Drawing.Point(6, 104);
|
||||
this.tb16.Name = "tb16";
|
||||
this.tb16.Size = new System.Drawing.Size(311, 20);
|
||||
this.tb16.TabIndex = 8;
|
||||
//
|
||||
// CustomizeMii_ComplexForwarder
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(358, 333);
|
||||
this.ClientSize = new System.Drawing.Size(358, 383);
|
||||
this.Controls.Add(this.tabPaths);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnOK);
|
||||
this.Controls.Add(this.label2);
|
||||
@ -221,14 +447,19 @@ namespace CustomizeMii
|
||||
this.Controls.Add(this.tbImage43);
|
||||
this.Controls.Add(this.cbImage169);
|
||||
this.Controls.Add(this.cbImage43);
|
||||
this.Controls.Add(this.tb4);
|
||||
this.Controls.Add(this.tb3);
|
||||
this.Controls.Add(this.tb2);
|
||||
this.Controls.Add(this.tb1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Name = "CustomizeMii_ComplexForwarder";
|
||||
this.Text = "CustomizeMii_ComplexForwarder";
|
||||
this.Load += new System.EventHandler(this.CustomizeMii_ComplexForwarder_Load);
|
||||
this.tabPaths.ResumeLayout(false);
|
||||
this.tabRequired.ResumeLayout(false);
|
||||
this.tabRequired.PerformLayout();
|
||||
this.tabOptional1.ResumeLayout(false);
|
||||
this.tabOptional1.PerformLayout();
|
||||
this.tabOptional2.ResumeLayout(false);
|
||||
this.tabOptional2.PerformLayout();
|
||||
this.tabOptional3.ResumeLayout(false);
|
||||
this.tabOptional3.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@ -250,5 +481,25 @@ namespace CustomizeMii
|
||||
public System.Windows.Forms.TextBox tb2;
|
||||
public System.Windows.Forms.TextBox tb3;
|
||||
public System.Windows.Forms.TextBox tb4;
|
||||
private System.Windows.Forms.TabControl tabPaths;
|
||||
private System.Windows.Forms.TabPage tabRequired;
|
||||
private System.Windows.Forms.TabPage tabOptional1;
|
||||
private System.Windows.Forms.TabPage tabOptional2;
|
||||
private System.Windows.Forms.TabPage tabOptional3;
|
||||
public System.Windows.Forms.TextBox tb5;
|
||||
public System.Windows.Forms.TextBox tb6;
|
||||
public System.Windows.Forms.TextBox tb7;
|
||||
public System.Windows.Forms.TextBox tb8;
|
||||
public System.Windows.Forms.TextBox tb9;
|
||||
public System.Windows.Forms.TextBox tb10;
|
||||
public System.Windows.Forms.TextBox tb11;
|
||||
public System.Windows.Forms.TextBox tb12;
|
||||
public System.Windows.Forms.TextBox tb13;
|
||||
public System.Windows.Forms.TextBox tb14;
|
||||
public System.Windows.Forms.TextBox tb15;
|
||||
public System.Windows.Forms.TextBox tb16;
|
||||
public System.Windows.Forms.CheckBox cbPack1;
|
||||
public System.Windows.Forms.CheckBox cbPack2;
|
||||
public System.Windows.Forms.CheckBox cbPack3;
|
||||
}
|
||||
}
|
@ -58,15 +58,47 @@ namespace CustomizeMii
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
TextBox[] tbs = new TextBox[] { tb1, tb2, tb3, tb4 };
|
||||
foreach (TextBox tbThis in tbs)
|
||||
TextBox[] tbPack1 = new TextBox[] { tb1, tb2, tb3, tb4 };
|
||||
TextBox[] tbPack2 = new TextBox[] { tb5, tb6, tb7, tb8 };
|
||||
TextBox[] tbPack3 = new TextBox[] { tb9, tb10, tb11, tb12 };
|
||||
TextBox[] tbPack4 = new TextBox[] { tb13, tb14, tb15, tb16 };
|
||||
|
||||
foreach (TextBox tbThis in tbPack1)
|
||||
{
|
||||
if ((!tbThis.Text.StartsWith("USB:/") && !tbThis.Text.StartsWith("SD:/")) ||
|
||||
(!tbThis.Text.EndsWith(".dol") && !tbThis.Text.EndsWith(".elf")))
|
||||
{ tbThis.Focus(); tbThis.SelectAll(); return; }
|
||||
{ tabPaths.SelectedTab = tabRequired; tbThis.Focus(); tbThis.SelectAll(); return; }
|
||||
}
|
||||
|
||||
tb1.Focus();
|
||||
if (cbPack1.Checked)
|
||||
{
|
||||
foreach (TextBox tbThis in tbPack2)
|
||||
{
|
||||
if ((!tbThis.Text.StartsWith("USB:/") && !tbThis.Text.StartsWith("SD:/")) ||
|
||||
(!tbThis.Text.EndsWith(".dol") && !tbThis.Text.EndsWith(".elf")))
|
||||
{ tabPaths.SelectedTab = tabOptional1; tbThis.Focus(); tbThis.SelectAll(); return; }
|
||||
}
|
||||
}
|
||||
|
||||
if (cbPack2.Checked)
|
||||
{
|
||||
foreach (TextBox tbThis in tbPack3)
|
||||
{
|
||||
if ((!tbThis.Text.StartsWith("USB:/") && !tbThis.Text.StartsWith("SD:/")) ||
|
||||
(!tbThis.Text.EndsWith(".dol") && !tbThis.Text.EndsWith(".elf")))
|
||||
{ tabPaths.SelectedTab = tabOptional2; tbThis.Focus(); tbThis.SelectAll(); return; }
|
||||
}
|
||||
}
|
||||
|
||||
if (cbPack3.Checked)
|
||||
{
|
||||
foreach (TextBox tbThis in tbPack4)
|
||||
{
|
||||
if ((!tbThis.Text.StartsWith("USB:/") && !tbThis.Text.StartsWith("SD:/")) ||
|
||||
(!tbThis.Text.EndsWith(".dol") && !tbThis.Text.EndsWith(".elf")))
|
||||
{ tabPaths.SelectedTab = tabOptional3; tbThis.Focus(); tbThis.SelectAll(); return; }
|
||||
}
|
||||
}
|
||||
|
||||
if (!File.Exists(tbImage43.Text)) tbImage43.Text = string.Empty;
|
||||
if (!File.Exists(tbImage169.Text)) tbImage169.Text = string.Empty;
|
||||
@ -87,5 +119,38 @@ namespace CustomizeMii
|
||||
else tbImage169.Text = ofd.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
private void cbPack1_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
TextBox[] tbPack2 = new TextBox[] { tb5, tb6, tb7, tb8 };
|
||||
|
||||
foreach (TextBox thisTb in tbPack2)
|
||||
{
|
||||
thisTb.Enabled = cbPack1.Checked;
|
||||
if (!cbPack1.Checked) thisTb.Text = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private void cbPack2_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
TextBox[] tbPack3 = new TextBox[] { tb9, tb10, tb11, tb12 };
|
||||
|
||||
foreach (TextBox thisTb in tbPack3)
|
||||
{
|
||||
thisTb.Enabled = cbPack2.Checked;
|
||||
if (!cbPack2.Checked) thisTb.Text = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private void cbPack3_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
TextBox[] tbPack4 = new TextBox[] { tb13, tb14, tb15, tb16 };
|
||||
|
||||
foreach (TextBox thisTb in tbPack4)
|
||||
{
|
||||
thisTb.Enabled = cbPack3.Checked;
|
||||
if (!cbPack3.Checked) thisTb.Text = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,36 +25,53 @@ namespace CustomizeMii
|
||||
|
||||
internal class Complex
|
||||
{
|
||||
private string path1 = "SD:/apps/example/boot.dol";
|
||||
private string path2 = "SD:/apps/example/boot.elf";
|
||||
private string path3 = "USB:/apps/example/boot.dol";
|
||||
private string path4 = "USB:/apps/example/boot.elf";
|
||||
private string[] paths = new string[16];
|
||||
private bool[] packs = new bool[3];
|
||||
private string image43;
|
||||
private string image169;
|
||||
public string Path1 { get { return path1; } set { path1 = value; } }
|
||||
public string Path2 { get { return path2; } set { path2 = value; } }
|
||||
public string Path3 { get { return path3; } set { path3 = value; } }
|
||||
public string Path4 { get { return path4; } set { path4 = value; } }
|
||||
public bool[] Packs { get { return packs; } set { packs = value; } }
|
||||
public string[] Paths { get { return paths; } set { paths = value; } }
|
||||
public string Image43 { get { return image43; } set { image43 = value; } }
|
||||
public string Image169 { get { return image169; } set { image169 = value; } }
|
||||
|
||||
public Complex()
|
||||
{
|
||||
paths[0] = "SD:/apps/example/boot.dol";
|
||||
paths[1] = "SD:/apps/example/boot.elf";
|
||||
paths[2] = "USB:/apps/example/boot.dol";
|
||||
paths[3] = "USB:/apps/example/boot.elf";
|
||||
}
|
||||
|
||||
public string GetPath(int pathNum)
|
||||
{
|
||||
return paths[pathNum];
|
||||
}
|
||||
|
||||
public void SetPath(int pathNum, string forwardPath)
|
||||
{
|
||||
paths[pathNum] = forwardPath;
|
||||
}
|
||||
|
||||
public void Save(string Destination)
|
||||
{
|
||||
GXForwarder Forwarder = new GXForwarder(image43, image169, path1, path2, path3, path4);
|
||||
GXForwarder Forwarder = new GXForwarder(image43, image169, paths);
|
||||
Forwarder.Save(Destination, true);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
path1 = "SD:/apps/example/boot.dol";
|
||||
path2 = "SD:/apps/example/boot.elf";
|
||||
path3 = "USB:/apps/example/boot.dol";
|
||||
path4 = "USB:/apps/example/boot.elf";
|
||||
paths[0] = "SD:/apps/example/boot.dol";
|
||||
paths[1] = "SD:/apps/example/boot.elf";
|
||||
paths[2] = "USB:/apps/example/boot.dol";
|
||||
paths[3] = "USB:/apps/example/boot.elf";
|
||||
|
||||
packs[0] = false;
|
||||
packs[1] = false;
|
||||
packs[2] = false;
|
||||
|
||||
for (int i = 4; i < paths.Length; i++)
|
||||
paths[i] = string.Empty;
|
||||
|
||||
image43 = string.Empty;
|
||||
image169 = string.Empty;
|
||||
}
|
||||
|
19
CustomizeMii/CustomizeMii_Main.Designer.cs
generated
19
CustomizeMii/CustomizeMii_Main.Designer.cs
generated
@ -142,7 +142,6 @@ namespace CustomizeMii
|
||||
this.rtbInstructions = new System.Windows.Forms.RichTextBox();
|
||||
this.tabCredits = new System.Windows.Forms.TabPage();
|
||||
this.lbCreditInstaller = new System.Windows.Forms.Label();
|
||||
this.lbForwardMiiVersion = new System.Windows.Forms.Label();
|
||||
this.panCredits = new System.Windows.Forms.Panel();
|
||||
this.lbCreditThanks = new System.Windows.Forms.Label();
|
||||
this.llbUpdateAvailable = new System.Windows.Forms.LinkLabel();
|
||||
@ -788,6 +787,9 @@ namespace CustomizeMii
|
||||
"IA4",
|
||||
"I8",
|
||||
"I4",
|
||||
"CI4",
|
||||
"CI8",
|
||||
"CI14X2",
|
||||
"CMP"});
|
||||
this.cmbFormatBanner.Location = new System.Drawing.Point(360, 182);
|
||||
this.cmbFormatBanner.Name = "cmbFormatBanner";
|
||||
@ -908,6 +910,9 @@ namespace CustomizeMii
|
||||
"IA4",
|
||||
"I8",
|
||||
"I4",
|
||||
"CI4",
|
||||
"CI8",
|
||||
"CI14X2",
|
||||
"CMP"});
|
||||
this.cmbFormatIcon.Location = new System.Drawing.Point(360, 182);
|
||||
this.cmbFormatIcon.Name = "cmbFormatIcon";
|
||||
@ -1234,7 +1239,6 @@ namespace CustomizeMii
|
||||
// tabCredits
|
||||
//
|
||||
this.tabCredits.Controls.Add(this.lbCreditInstaller);
|
||||
this.tabCredits.Controls.Add(this.lbForwardMiiVersion);
|
||||
this.tabCredits.Controls.Add(this.panCredits);
|
||||
this.tabCredits.Controls.Add(this.llbUpdateAvailable);
|
||||
this.tabCredits.Controls.Add(this.llbSite);
|
||||
@ -1257,16 +1261,6 @@ namespace CustomizeMii
|
||||
this.lbCreditInstaller.Text = "CustomizeMii Installer X by WiiCrazy / I.R.on";
|
||||
this.lbCreditInstaller.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// lbForwardMiiVersion
|
||||
//
|
||||
this.lbForwardMiiVersion.Location = new System.Drawing.Point(0, 68);
|
||||
this.lbForwardMiiVersion.Name = "lbForwardMiiVersion";
|
||||
this.lbForwardMiiVersion.Size = new System.Drawing.Size(443, 13);
|
||||
this.lbForwardMiiVersion.TabIndex = 6;
|
||||
this.lbForwardMiiVersion.Text = "You\'re using Version X of the ForwardMii Plugin";
|
||||
this.lbForwardMiiVersion.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
this.lbForwardMiiVersion.Visible = false;
|
||||
//
|
||||
// panCredits
|
||||
//
|
||||
this.panCredits.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
@ -1708,7 +1702,6 @@ namespace CustomizeMii
|
||||
private System.Windows.Forms.ToolStripMenuItem cmLoadDol;
|
||||
private System.Windows.Forms.ToolStripMenuItem cmDolFromSource;
|
||||
private System.Windows.Forms.Panel panCredits;
|
||||
private System.Windows.Forms.Label lbForwardMiiVersion;
|
||||
private System.Windows.Forms.Label lbCreated;
|
||||
private System.Windows.Forms.Label lbCreatedValue;
|
||||
private System.Windows.Forms.Label lbCreditInstaller;
|
||||
|
@ -26,17 +26,14 @@ using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Windows.Forms;
|
||||
|
||||
#if !Mono
|
||||
using ForwardMii;
|
||||
#endif
|
||||
|
||||
namespace CustomizeMii
|
||||
{
|
||||
public partial class CustomizeMii_Main : Form
|
||||
{
|
||||
#region Constants
|
||||
const string version = "2.1"; //Hint for myself: Never use a char in the Version (UpdateCheck)!
|
||||
const string version = "2.2"; //Hint for myself: Never use a char in the Version (UpdateCheck)!
|
||||
const int SoundMaxLength = 30; //In seconds
|
||||
const int SoundWarningLength = 20; //In seconds
|
||||
const int BnsWarningLength = 45; //In seconds
|
||||
@ -82,11 +79,6 @@ namespace CustomizeMii
|
||||
private List<string> BannerTransparents = new List<string>();
|
||||
private List<string> IconTransparents = new List<string>();
|
||||
private string Mp3Path;
|
||||
private Forwarder.Simple SimpleForwarder = new Forwarder.Simple();
|
||||
private Forwarder.Complex ComplexForwarder = new Forwarder.Complex();
|
||||
private delegate void BoxInvoker(string message);
|
||||
private delegate void SetTextInvoker(string text, TextBox tb);
|
||||
private delegate void SetLabelInvoker(string text, Label lb);
|
||||
private double separatorBtn;
|
||||
private Timer tmrCredits = new Timer();
|
||||
private ToolTip tTip = new ToolTip();
|
||||
@ -163,7 +155,8 @@ namespace CustomizeMii
|
||||
else this.lbCreditInstaller.Text = this.lbCreditInstaller.Text.Replace(" X", string.Empty);
|
||||
if (Directory.Exists(TempPath)) Directory.Delete(TempPath, true);
|
||||
ProgressUpdate = new EventHandler(this.UpdateProgress);
|
||||
SetButtonText();
|
||||
btnBrowseSource.Text = "Browse...";
|
||||
DrawCreateButton();
|
||||
cmbNandLoader.SelectedIndex = 0;
|
||||
cmbFormatBanner.SelectedIndex = 0;
|
||||
cmbFormatIcon.SelectedIndex = 0;
|
||||
@ -179,30 +172,11 @@ namespace CustomizeMii
|
||||
tmrCredits.Interval = CreditsScrollSpeed;
|
||||
tmrCredits.Tick += new EventHandler(tmrCredits_Tick);
|
||||
|
||||
#if !Mono
|
||||
if (File.Exists(Application.StartupPath + "\\ForwardMii.dll") && lbForwardMiiVersion.Tag != (object)"Update")
|
||||
{
|
||||
SetForwardMiiLabel();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !Debug
|
||||
DisableControls(null, null);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !Mono
|
||||
private void SetForwardMiiLabel()
|
||||
{
|
||||
try
|
||||
{
|
||||
lbForwardMiiVersion.Text = lbForwardMiiVersion.Text.Replace("X", GetForwardMiiVersion());
|
||||
lbForwardMiiVersion.Visible = true;
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
#endif
|
||||
|
||||
private void CommonKeyCheck()
|
||||
{
|
||||
if (!File.Exists(Application.StartupPath + "\\common-key.bin") && !File.Exists(Application.StartupPath + "\\key.bin"))
|
||||
@ -375,7 +349,7 @@ namespace CustomizeMii
|
||||
}
|
||||
}
|
||||
|
||||
private void SetButtonText()
|
||||
private void DrawCreateButton()
|
||||
{
|
||||
btnCreateWad.Text = string.Empty;
|
||||
|
||||
@ -562,8 +536,6 @@ namespace CustomizeMii
|
||||
{
|
||||
llbUpdateAvailable.Text = llbUpdateAvailable.Text.Replace("X", NewVersion);
|
||||
llbUpdateAvailable.Visible = true;
|
||||
lbForwardMiiVersion.Tag = "Update";
|
||||
lbForwardMiiVersion.Visible = false;
|
||||
|
||||
if (MessageBox.Show("Version " + NewVersion +
|
||||
" is available.\nDo you want the download page to be opened?",
|
||||
@ -637,7 +609,8 @@ namespace CustomizeMii
|
||||
|
||||
private void btnBrowseSource_Click(object sender, EventArgs e)
|
||||
{
|
||||
LoadChannel();
|
||||
if (btnBrowseSource.Text.ToLower() == "clear") { Initialize(null, null); }
|
||||
else LoadChannel();
|
||||
}
|
||||
|
||||
private void btnLoadBaseWad_Click(object sender, EventArgs e)
|
||||
@ -759,34 +732,22 @@ namespace CustomizeMii
|
||||
{
|
||||
if (pbProgress.Value == 100)
|
||||
{
|
||||
string Url = SourceWadUrls[lbxBaseWads.SelectedIndex];
|
||||
string Url = "http://customizemii.googlecode.com/svn/branches/Base_WADs/" + SourceWadUrls[lbxBaseWads.SelectedIndex];
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.Filter = "Wii Channels|*.wad";
|
||||
sfd.FileName = Url.Remove(0, Url.LastIndexOf('/') + 1);
|
||||
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
if (tbSourceWad.Text == SourceWadUrls[lbxBaseWads.SelectedIndex] && File.Exists(TempWadPath))
|
||||
if (tbSourceWad.Text == Url && File.Exists(TempWadPath))
|
||||
{
|
||||
File.Copy(TempWadPath, sfd.FileName, true);
|
||||
InfoBox(string.Format("Saved channel as {0}", Path.GetFileName(sfd.FileName)));
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
WebClient SaveClient = new WebClient();
|
||||
SaveClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(SaveClient_DownloadProgressChanged);
|
||||
SaveClient.DownloadFileCompleted += new AsyncCompletedEventHandler(SaveClient_DownloadFileCompleted);
|
||||
|
||||
lbStatusText.Text = "Downloading Base WAD...";
|
||||
pbProgress.Value = 0;
|
||||
SaveClient.DownloadFileAsync(new Uri(Url), sfd.FileName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrorBox(ex.Message);
|
||||
}
|
||||
System.Threading.Thread saveThread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(SaveBaseWad));
|
||||
saveThread.Start((object) new string[] { Url, sfd.FileName });
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -799,15 +760,38 @@ namespace CustomizeMii
|
||||
}
|
||||
}
|
||||
|
||||
void SaveBaseWad(object urlAndSavePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
WebClient SaveClient = new WebClient();
|
||||
SaveClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(SaveClient_DownloadProgressChanged);
|
||||
SaveClient.DownloadFileCompleted += new AsyncCompletedEventHandler(SaveClient_DownloadFileCompleted);
|
||||
|
||||
currentProgress.progressValue = 0;
|
||||
currentProgress.progressState = "Downloading Base WAD...";
|
||||
this.Invoke(ProgressUpdate);
|
||||
|
||||
SaveClient.DownloadFileAsync(new Uri(((string[])urlAndSavePath)[0]), ((string[])urlAndSavePath)[1]);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrorBox(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
void SaveClient_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
|
||||
{
|
||||
pbProgress.Value = e.ProgressPercentage;
|
||||
currentProgress.progressValue = e.ProgressPercentage;
|
||||
currentProgress.progressState = "Downloading Base WAD...";
|
||||
this.Invoke(ProgressUpdate);
|
||||
}
|
||||
|
||||
void SaveClient_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
|
||||
{
|
||||
lbStatusText.Text = string.Empty;
|
||||
pbProgress.Value = 100;
|
||||
currentProgress.progressValue = 100;
|
||||
currentProgress.progressState = " ";
|
||||
this.Invoke(ProgressUpdate);
|
||||
}
|
||||
|
||||
private void cmbReplace_SelectedIndexChanged(object sender, EventArgs e)
|
||||
@ -937,9 +921,18 @@ namespace CustomizeMii
|
||||
case 6:
|
||||
cmbFormatBanner.SelectedIndex = 0;
|
||||
break;
|
||||
case 14:
|
||||
case 8:
|
||||
cmbFormatBanner.SelectedIndex = 7;
|
||||
break;
|
||||
case 9:
|
||||
cmbFormatBanner.SelectedIndex = 8;
|
||||
break;
|
||||
case 10:
|
||||
cmbFormatBanner.SelectedIndex = 9;
|
||||
break;
|
||||
case 14:
|
||||
cmbFormatBanner.SelectedIndex = 10;
|
||||
break;
|
||||
default:
|
||||
cmbFormatBanner.SelectedIndex = -1;
|
||||
break;
|
||||
@ -989,8 +982,17 @@ namespace CustomizeMii
|
||||
case 6:
|
||||
cmbFormatIcon.SelectedIndex = 0;
|
||||
break;
|
||||
case 8:
|
||||
cmbFormatBanner.SelectedIndex = 7;
|
||||
break;
|
||||
case 9:
|
||||
cmbFormatBanner.SelectedIndex = 8;
|
||||
break;
|
||||
case 10:
|
||||
cmbFormatBanner.SelectedIndex = 9;
|
||||
break;
|
||||
case 14:
|
||||
cmbFormatIcon.SelectedIndex = 7;
|
||||
cmbFormatBanner.SelectedIndex = 10;
|
||||
break;
|
||||
default:
|
||||
cmbFormatIcon.SelectedIndex = -1;
|
||||
@ -1012,7 +1014,7 @@ namespace CustomizeMii
|
||||
{
|
||||
int Format = cmbFormatBanner.SelectedIndex;
|
||||
|
||||
if (Format == 0 || Format == 1 || Format == 2)
|
||||
if (Format < 7)
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
ofd.Filter = "PNG|*.png|JPG|*.jpg|GIF|*.gif|BMP|*.bmp|TPL|*.tpl|All|*.png;*.jpg;*.gif;*.bmp;*.tpl";
|
||||
@ -1041,6 +1043,18 @@ namespace CustomizeMii
|
||||
|
||||
switch (Format)
|
||||
{
|
||||
case 6: //I4
|
||||
TplFormat = 0;
|
||||
break;
|
||||
case 5: //I8
|
||||
TplFormat = 1;
|
||||
break;
|
||||
case 4: //IA4
|
||||
TplFormat = 2;
|
||||
break;
|
||||
case 3: //IA8
|
||||
TplFormat = 3;
|
||||
break;
|
||||
case 1:
|
||||
TplFormat = 4;
|
||||
break;
|
||||
@ -1062,7 +1076,7 @@ namespace CustomizeMii
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorBox("This format is not supported, you must choose either RGBA8, RGB565 or RGB5A3!");
|
||||
ErrorBox("This format is not supported, you must choose a different one!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1071,6 +1085,10 @@ namespace CustomizeMii
|
||||
{
|
||||
if (lbxBannerTpls.SelectedIndex != -1)
|
||||
{
|
||||
string Tpl = BannerTplPath + lbxBannerTpls.SelectedItem.ToString().Replace(" (Transparent)", string.Empty);
|
||||
int format = Wii.TPL.GetTextureFormat(Tpl);
|
||||
if (format == 8 || format == 9 || format == 10) { ErrorBox("This format is not supported!"); return; }
|
||||
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.Filter = "PNG|*.png|JPG|*.jpg|GIF|*.gif|BMP|*.bmp|TPL|*.tpl|All|*.png;*.jpg;*.gif;*.bmp;*.tpl";
|
||||
sfd.FilterIndex = 6;
|
||||
@ -1082,7 +1100,6 @@ namespace CustomizeMii
|
||||
{
|
||||
if (!sfd.FileName.ToLower().EndsWith(".tpl"))
|
||||
{
|
||||
string Tpl = BannerTplPath + lbxBannerTpls.SelectedItem.ToString().Replace(" (Transparent)", string.Empty);
|
||||
Image Img = Wii.TPL.ConvertFromTPL(Tpl);
|
||||
|
||||
switch (sfd.FileName.Remove(0, sfd.FileName.LastIndexOf('.')))
|
||||
@ -1103,7 +1120,6 @@ namespace CustomizeMii
|
||||
}
|
||||
else
|
||||
{
|
||||
string Tpl = BannerTplPath + lbxBannerTpls.SelectedItem.ToString().Replace(" (Transparent)", string.Empty);
|
||||
File.Copy(Tpl, sfd.FileName, true);
|
||||
}
|
||||
}
|
||||
@ -1121,24 +1137,10 @@ namespace CustomizeMii
|
||||
{
|
||||
try
|
||||
{
|
||||
//string Tpl = BannerTplPath + lbxBannerTpls.SelectedItem.ToString().Replace(" (Transparent)", string.Empty);
|
||||
//Image Img = Wii.TPL.ConvertFromTPL(Tpl);
|
||||
|
||||
//CustomizeMii_Preview pvw = new CustomizeMii_Preview();
|
||||
|
||||
//if (Img.Width > 200) pvw.Width = Img.Width + 50;
|
||||
//else pvw.Width = 250;
|
||||
//if (Img.Height > 200) pvw.Height = Img.Height + 50;
|
||||
//else pvw.Height = 250;
|
||||
|
||||
//pvw.pbImage.Image = Img;
|
||||
//pvw.Text = string.Format("CustomizeMii - Preview ({0} x {1})", Img.Width, Img.Height);
|
||||
|
||||
//pvw.ShowDialog();
|
||||
|
||||
CustomizeMii_Preview pvw = new CustomizeMii_Preview();
|
||||
pvw.startTPL = lbxBannerTpls.SelectedItem.ToString().Replace(" (Transparent)", string.Empty);
|
||||
pvw.ShowDialog();
|
||||
pvw = null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -1155,7 +1157,7 @@ namespace CustomizeMii
|
||||
{
|
||||
int Format = cmbFormatIcon.SelectedIndex;
|
||||
|
||||
if (Format == 0 || Format == 1 || Format == 2)
|
||||
if (Format < 7)
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
ofd.Filter = "PNG|*.png|JPG|*.jpg|GIF|*.gif|BMP|*.bmp|TPL|*.tpl|All|*.png;*.jpg;*.gif;*.bmp;*.tpl";
|
||||
@ -1184,6 +1186,18 @@ namespace CustomizeMii
|
||||
|
||||
switch (Format)
|
||||
{
|
||||
case 6: //I4
|
||||
TplFormat = 0;
|
||||
break;
|
||||
case 5: //I8
|
||||
TplFormat = 1;
|
||||
break;
|
||||
case 4: //IA4
|
||||
TplFormat = 2;
|
||||
break;
|
||||
case 3: //IA8
|
||||
TplFormat = 3;
|
||||
break;
|
||||
case 1:
|
||||
TplFormat = 4;
|
||||
break;
|
||||
@ -1205,7 +1219,7 @@ namespace CustomizeMii
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorBox("This format is not supported, you must choose either RGBA8, RGB565 or RGB5A3!");
|
||||
ErrorBox("This format is not supported, you must choose a different one!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1214,6 +1228,10 @@ namespace CustomizeMii
|
||||
{
|
||||
if (lbxIconTpls.SelectedIndex != -1)
|
||||
{
|
||||
string Tpl = BannerTplPath + lbxBannerTpls.SelectedItem.ToString().Replace(" (Transparent)", string.Empty);
|
||||
int format = Wii.TPL.GetTextureFormat(Tpl);
|
||||
if (format == 8 || format == 9 || format == 10) { ErrorBox("This format is not supported!"); return; }
|
||||
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.Filter = "PNG|*.png|JPG|*.jpg|GIF|*.gif|BMP|*.bmp|TPL|*.tpl|All|*.png;*.jpg;*.gif;*.bmp;*.tpl";
|
||||
sfd.FilterIndex = 6;
|
||||
@ -1225,7 +1243,6 @@ namespace CustomizeMii
|
||||
{
|
||||
if (!sfd.FileName.ToLower().EndsWith(".tpl"))
|
||||
{
|
||||
string Tpl = IconTplPath + lbxIconTpls.SelectedItem.ToString().Replace(" (Transparent)", string.Empty);
|
||||
Image Img = Wii.TPL.ConvertFromTPL(Tpl);
|
||||
|
||||
switch (sfd.FileName.Remove(0, sfd.FileName.LastIndexOf('.')))
|
||||
@ -1246,7 +1263,6 @@ namespace CustomizeMii
|
||||
}
|
||||
else
|
||||
{
|
||||
string Tpl = IconTplPath + lbxIconTpls.SelectedItem.ToString().Replace(" (Transparent)", string.Empty);
|
||||
File.Copy(Tpl, sfd.FileName, true);
|
||||
}
|
||||
}
|
||||
@ -1264,25 +1280,11 @@ namespace CustomizeMii
|
||||
{
|
||||
try
|
||||
{
|
||||
//string Tpl = IconTplPath + lbxIconTpls.SelectedItem.ToString().Replace(" (Transparent)", string.Empty);
|
||||
//Image Img = Wii.TPL.ConvertFromTPL(Tpl);
|
||||
|
||||
//CustomizeMii_Preview pvw = new CustomizeMii_Preview();
|
||||
|
||||
//if (Img.Width > 200) pvw.Width = Img.Width + 50;
|
||||
//else pvw.Width = 250;
|
||||
//if (Img.Height > 200) pvw.Height = Img.Height + 50;
|
||||
//else pvw.Height = 250;
|
||||
|
||||
//pvw.pbImage.Image = Img;
|
||||
//pvw.Text = string.Format("CustomizeMii - Preview ({0} x {1})", Img.Width, Img.Height);
|
||||
|
||||
//pvw.ShowDialog();
|
||||
|
||||
CustomizeMii_Preview pvw = new CustomizeMii_Preview();
|
||||
pvw.startIcon = true;
|
||||
pvw.startTPL = lbxIconTpls.SelectedItem.ToString().Replace(" (Transparent)", string.Empty);
|
||||
pvw.ShowDialog();
|
||||
pvw = null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -2263,7 +2265,10 @@ namespace CustomizeMii
|
||||
{
|
||||
try
|
||||
{
|
||||
if (double.Parse(GetForwardMiiVersion()) < 1.1)
|
||||
string CurrentVersion = GetForwardMiiVersion();
|
||||
int cVersion = Convert.ToInt32(CurrentVersion.Replace(".", string.Empty).Length == 2 ? (CurrentVersion.Replace(".", string.Empty) + "0") : CurrentVersion.Replace(".", string.Empty));
|
||||
|
||||
if (cVersion < 110)
|
||||
{
|
||||
ErrorBox("Version 1.1 or higher of the ForwardMii.dll is required!");
|
||||
return;
|
||||
|
@ -125,8 +125,8 @@ Xuzz, SquidMan, megazig, Matt_P, Omega and The Lemon Man for Wii.py
|
||||
SquidMan for Zetsubou
|
||||
Andre Perrot for gbalzss
|
||||
comex and Waninkoko for both their NAND Loader
|
||||
djdynamite123 for the forwarder base files (ForwardMii-Plugin)
|
||||
The USB Loader GX Team for their forwarder source (ForwardMii-Plugin)</value>
|
||||
djdynamite123 for his forwarder base files
|
||||
The USB Loader GX Team for their forwarder source</value>
|
||||
</data>
|
||||
<metadata name="ssMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>16, 7</value>
|
||||
|
86
CustomizeMii/CustomizeMii_Preview.Designer.cs
generated
86
CustomizeMii/CustomizeMii_Preview.Designer.cs
generated
@ -47,6 +47,7 @@ namespace CustomizeMii
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.Panel = new System.Windows.Forms.Panel();
|
||||
this.btnReplace = new System.Windows.Forms.Button();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.cbIcon = new System.Windows.Forms.ComboBox();
|
||||
this.lbIcon = new System.Windows.Forms.Label();
|
||||
@ -58,11 +59,15 @@ namespace CustomizeMii
|
||||
this.lbSize = new System.Windows.Forms.Label();
|
||||
this.lbSizeText = new System.Windows.Forms.Label();
|
||||
this.pbPic = new System.Windows.Forms.PictureBox();
|
||||
this.btnReplace = new System.Windows.Forms.Button();
|
||||
this.cmFormat = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.cmRGBA8 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.cmRGB565 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.cmRGB5A3 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.cmIA8 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.cmIA4 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.cmI8 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.cmI4 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.lbNoPreview = new System.Windows.Forms.Label();
|
||||
this.Panel.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbPic)).BeginInit();
|
||||
@ -83,6 +88,17 @@ namespace CustomizeMii
|
||||
this.Panel.Size = new System.Drawing.Size(817, 28);
|
||||
this.Panel.TabIndex = 0;
|
||||
//
|
||||
// btnReplace
|
||||
//
|
||||
this.btnReplace.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnReplace.Location = new System.Drawing.Point(512, 4);
|
||||
this.btnReplace.Name = "btnReplace";
|
||||
this.btnReplace.Size = new System.Drawing.Size(137, 21);
|
||||
this.btnReplace.TabIndex = 3;
|
||||
this.btnReplace.Text = "Replace";
|
||||
this.btnReplace.UseVisualStyleBackColor = true;
|
||||
this.btnReplace.Click += new System.EventHandler(this.btnReplace_Click);
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
@ -200,25 +216,18 @@ namespace CustomizeMii
|
||||
this.pbPic.TabIndex = 3;
|
||||
this.pbPic.TabStop = false;
|
||||
//
|
||||
// btnReplace
|
||||
//
|
||||
this.btnReplace.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnReplace.Location = new System.Drawing.Point(512, 4);
|
||||
this.btnReplace.Name = "btnReplace";
|
||||
this.btnReplace.Size = new System.Drawing.Size(137, 21);
|
||||
this.btnReplace.TabIndex = 3;
|
||||
this.btnReplace.Text = "Replace";
|
||||
this.btnReplace.UseVisualStyleBackColor = true;
|
||||
this.btnReplace.Click += new System.EventHandler(this.btnReplace_Click);
|
||||
//
|
||||
// cmFormat
|
||||
//
|
||||
this.cmFormat.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.cmRGBA8,
|
||||
this.cmRGB565,
|
||||
this.cmRGB5A3});
|
||||
this.cmRGB5A3,
|
||||
this.cmIA8,
|
||||
this.cmIA4,
|
||||
this.cmI8,
|
||||
this.cmI4});
|
||||
this.cmFormat.Name = "cmFormat";
|
||||
this.cmFormat.Size = new System.Drawing.Size(234, 70);
|
||||
this.cmFormat.Size = new System.Drawing.Size(234, 158);
|
||||
//
|
||||
// cmRGBA8
|
||||
//
|
||||
@ -244,12 +253,56 @@ namespace CustomizeMii
|
||||
this.cmRGB5A3.Text = "As RGB5A3 (Low Quality)";
|
||||
this.cmRGB5A3.Click += new System.EventHandler(this.cmFormat_Click);
|
||||
//
|
||||
// cmIA8
|
||||
//
|
||||
this.cmIA8.Name = "cmIA8";
|
||||
this.cmIA8.Size = new System.Drawing.Size(233, 22);
|
||||
this.cmIA8.Tag = "ia8";
|
||||
this.cmIA8.Text = "As IA8 (B/W with Alpha)";
|
||||
this.cmIA8.Click += new System.EventHandler(this.cmFormat_Click);
|
||||
//
|
||||
// cmIA4
|
||||
//
|
||||
this.cmIA4.Name = "cmIA4";
|
||||
this.cmIA4.Size = new System.Drawing.Size(233, 22);
|
||||
this.cmIA4.Tag = "ia4";
|
||||
this.cmIA4.Text = "As IA4 (B/W with Alpha)";
|
||||
this.cmIA4.Click += new System.EventHandler(this.cmFormat_Click);
|
||||
//
|
||||
// cmI8
|
||||
//
|
||||
this.cmI8.Name = "cmI8";
|
||||
this.cmI8.Size = new System.Drawing.Size(233, 22);
|
||||
this.cmI8.Tag = "i8";
|
||||
this.cmI8.Text = "As I8 (B/W)";
|
||||
this.cmI8.Click += new System.EventHandler(this.cmFormat_Click);
|
||||
//
|
||||
// cmI4
|
||||
//
|
||||
this.cmI4.Name = "cmI4";
|
||||
this.cmI4.Size = new System.Drawing.Size(233, 22);
|
||||
this.cmI4.Tag = "i4";
|
||||
this.cmI4.Text = "As I4 (B/W)";
|
||||
this.cmI4.Click += new System.EventHandler(this.cmFormat_Click);
|
||||
//
|
||||
// lbNoPreview
|
||||
//
|
||||
this.lbNoPreview.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbNoPreview.Location = new System.Drawing.Point(0, 22);
|
||||
this.lbNoPreview.Name = "lbNoPreview";
|
||||
this.lbNoPreview.Size = new System.Drawing.Size(817, 412);
|
||||
this.lbNoPreview.TabIndex = 4;
|
||||
this.lbNoPreview.Text = "No Preview";
|
||||
this.lbNoPreview.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.lbNoPreview.Visible = false;
|
||||
//
|
||||
// CustomizeMii_Preview
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnClose;
|
||||
this.ClientSize = new System.Drawing.Size(817, 462);
|
||||
this.Controls.Add(this.lbNoPreview);
|
||||
this.Controls.Add(this.pbPic);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.Panel);
|
||||
@ -289,5 +342,10 @@ namespace CustomizeMii
|
||||
private System.Windows.Forms.ToolStripMenuItem cmRGBA8;
|
||||
private System.Windows.Forms.ToolStripMenuItem cmRGB565;
|
||||
private System.Windows.Forms.ToolStripMenuItem cmRGB5A3;
|
||||
private System.Windows.Forms.ToolStripMenuItem cmIA8;
|
||||
private System.Windows.Forms.ToolStripMenuItem cmIA4;
|
||||
private System.Windows.Forms.ToolStripMenuItem cmI8;
|
||||
private System.Windows.Forms.ToolStripMenuItem cmI4;
|
||||
private System.Windows.Forms.Label lbNoPreview;
|
||||
}
|
||||
}
|
@ -26,7 +26,7 @@ namespace CustomizeMii
|
||||
{
|
||||
public string startTPL;
|
||||
public bool startIcon = false;
|
||||
private Image[,] images;
|
||||
private TplImage[,] images;
|
||||
|
||||
public CustomizeMii_Preview()
|
||||
{
|
||||
@ -41,6 +41,7 @@ namespace CustomizeMii
|
||||
|
||||
private void Preview_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
images = null;
|
||||
cbBanner.Items.Clear();
|
||||
cbIcon.Items.Clear();
|
||||
}
|
||||
@ -89,9 +90,9 @@ namespace CustomizeMii
|
||||
}
|
||||
|
||||
if (bannerpics.Length > iconpics.Length)
|
||||
images = new Image[2, bannerpics.Length];
|
||||
images = new TplImage[2, bannerpics.Length];
|
||||
else
|
||||
images = new Image[2, iconpics.Length];
|
||||
images = new TplImage[2, iconpics.Length];
|
||||
|
||||
try
|
||||
{
|
||||
@ -111,21 +112,7 @@ namespace CustomizeMii
|
||||
{
|
||||
if (cbBanner.SelectedIndex != -1)
|
||||
{
|
||||
//byte[] tpl;
|
||||
|
||||
//if (string.IsNullOrEmpty(CustomizeMii_Main.BannerReplace))
|
||||
// tpl = Wii.Tools.LoadFileToByteArray(CustomizeMii_Main.TempUnpackBannerTplPath + cbBanner.SelectedItem.ToString() + ".tpl");
|
||||
//else tpl = Wii.Tools.LoadFileToByteArray(CustomizeMii_Main.BannerTplPath + cbBanner.SelectedItem.ToString() + ".tpl");
|
||||
|
||||
//lbSize.Text = Wii.TPL.GetTextureWidth(tpl).ToString() + " x " + Wii.TPL.GetTextureHeight(tpl).ToString();
|
||||
//lbFormat.Text = Wii.TPL.GetTextureFormatName(tpl);
|
||||
|
||||
//Image tmpImg = Wii.TPL.ConvertFromTPL(tpl);
|
||||
//pbPic.Image = tmpImg;
|
||||
|
||||
//cbIcon.SelectedIndex = -1;
|
||||
|
||||
if (images[0, cbBanner.SelectedIndex] == null)
|
||||
if (images[0, cbBanner.SelectedIndex].tplImage == null)
|
||||
{
|
||||
byte[] tpl;
|
||||
|
||||
@ -134,12 +121,35 @@ namespace CustomizeMii
|
||||
else tpl = Wii.Tools.LoadFileToByteArray(CustomizeMii_Main.BannerTplPath + cbBanner.SelectedItem.ToString() + ".tpl");
|
||||
|
||||
lbSize.Text = Wii.TPL.GetTextureWidth(tpl).ToString() + " x " + Wii.TPL.GetTextureHeight(tpl).ToString();
|
||||
lbFormat.Text = Wii.TPL.GetTextureFormatName(tpl);
|
||||
images[0, cbBanner.SelectedIndex].tplFormat = Wii.TPL.GetTextureFormatName(tpl);
|
||||
lbFormat.Text = images[0, cbBanner.SelectedIndex].tplFormat;
|
||||
|
||||
images[0, cbBanner.SelectedIndex] = Wii.TPL.ConvertFromTPL(tpl);
|
||||
if (images[0, cbBanner.SelectedIndex].tplFormat.ToLower() == "ci4" ||
|
||||
images[0, cbBanner.SelectedIndex].tplFormat.ToLower() == "ci8" ||
|
||||
images[0, cbBanner.SelectedIndex].tplFormat.ToLower() == "ci14x2")
|
||||
{
|
||||
int tempW = Wii.TPL.GetTextureWidth(tpl);
|
||||
int tempH = Wii.TPL.GetTextureHeight(tpl);
|
||||
|
||||
images[0, cbBanner.SelectedIndex].tplImage = new Bitmap(tempW, tempH);
|
||||
}
|
||||
else
|
||||
{
|
||||
images[0, cbBanner.SelectedIndex].tplImage = Wii.TPL.ConvertFromTPL(tpl);
|
||||
}
|
||||
|
||||
tpl = null;
|
||||
}
|
||||
|
||||
pbPic.Image = images[0, cbBanner.SelectedIndex];
|
||||
pbPic.Image = images[0, cbBanner.SelectedIndex].tplImage;
|
||||
lbFormat.Text = images[0, cbBanner.SelectedIndex].tplFormat;
|
||||
lbSize.Text = string.Format("{0} x {1}", images[0, cbBanner.SelectedIndex].tplImage.Width, images[0, cbBanner.SelectedIndex].tplImage.Height);
|
||||
|
||||
if (images[0, cbBanner.SelectedIndex].tplFormat.ToLower() == "ci4" ||
|
||||
images[0, cbBanner.SelectedIndex].tplFormat.ToLower() == "ci8" ||
|
||||
images[0, cbBanner.SelectedIndex].tplFormat.ToLower() == "ci14x2")
|
||||
lbNoPreview.Visible = true;
|
||||
else lbNoPreview.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,21 +157,7 @@ namespace CustomizeMii
|
||||
{
|
||||
if (cbIcon.SelectedIndex != -1)
|
||||
{
|
||||
//byte[] tpl;
|
||||
|
||||
//if (string.IsNullOrEmpty(CustomizeMii_Main.IconReplace))
|
||||
// tpl = Wii.Tools.LoadFileToByteArray(CustomizeMii_Main.TempUnpackIconTplPath + cbIcon.SelectedItem.ToString() + ".tpl");
|
||||
//else tpl = Wii.Tools.LoadFileToByteArray(CustomizeMii_Main.IconTplPath + cbIcon.SelectedItem.ToString() + ".tpl");
|
||||
|
||||
//lbSize.Text = Wii.TPL.GetTextureWidth(tpl).ToString() + " x " + Wii.TPL.GetTextureHeight(tpl).ToString();
|
||||
//lbFormat.Text = Wii.TPL.GetTextureFormatName(tpl);
|
||||
|
||||
//Image tmpImg = Wii.TPL.ConvertFromTPL(tpl);
|
||||
//pbPic.Image = tmpImg;
|
||||
|
||||
//cbBanner.SelectedIndex = -1;
|
||||
|
||||
if (images[1, cbIcon.SelectedIndex] == null)
|
||||
if (images[1, cbIcon.SelectedIndex].tplImage == null)
|
||||
{
|
||||
byte[] tpl;
|
||||
|
||||
@ -170,12 +166,35 @@ namespace CustomizeMii
|
||||
else tpl = Wii.Tools.LoadFileToByteArray(CustomizeMii_Main.IconTplPath + cbIcon.SelectedItem.ToString() + ".tpl");
|
||||
|
||||
lbSize.Text = Wii.TPL.GetTextureWidth(tpl).ToString() + " x " + Wii.TPL.GetTextureHeight(tpl).ToString();
|
||||
lbFormat.Text = Wii.TPL.GetTextureFormatName(tpl);
|
||||
images[1, cbIcon.SelectedIndex].tplFormat = Wii.TPL.GetTextureFormatName(tpl);
|
||||
lbFormat.Text = images[1, cbIcon.SelectedIndex].tplFormat;
|
||||
|
||||
images[1, cbIcon.SelectedIndex] = Wii.TPL.ConvertFromTPL(tpl);
|
||||
if (images[1, cbIcon.SelectedIndex].tplFormat.ToLower() == "ci4" ||
|
||||
images[1, cbIcon.SelectedIndex].tplFormat.ToLower() == "ci8" ||
|
||||
images[1, cbIcon.SelectedIndex].tplFormat.ToLower() == "ci14x2")
|
||||
{
|
||||
int tempW = Wii.TPL.GetTextureWidth(tpl);
|
||||
int tempH = Wii.TPL.GetTextureHeight(tpl);
|
||||
|
||||
images[1, cbIcon.SelectedIndex].tplImage = new Bitmap(tempW, tempH);
|
||||
}
|
||||
else
|
||||
{
|
||||
images[1, cbIcon.SelectedIndex].tplImage = Wii.TPL.ConvertFromTPL(tpl);
|
||||
}
|
||||
|
||||
tpl = null;
|
||||
}
|
||||
|
||||
pbPic.Image = images[1, cbIcon.SelectedIndex];
|
||||
pbPic.Image = images[1, cbIcon.SelectedIndex].tplImage;
|
||||
lbFormat.Text = images[1, cbIcon.SelectedIndex].tplFormat;
|
||||
lbSize.Text = string.Format("{0} x {1}", images[1, cbIcon.SelectedIndex].tplImage.Width, images[1, cbIcon.SelectedIndex].tplImage.Height);
|
||||
|
||||
if (images[1, cbIcon.SelectedIndex].tplFormat.ToLower() == "ci4" ||
|
||||
images[1, cbIcon.SelectedIndex].tplFormat.ToLower() == "ci8" ||
|
||||
images[1, cbIcon.SelectedIndex].tplFormat.ToLower() == "ci14x2")
|
||||
lbNoPreview.Visible = true;
|
||||
else lbNoPreview.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -237,6 +256,22 @@ namespace CustomizeMii
|
||||
ToolStripMenuItem cmSender = sender as ToolStripMenuItem;
|
||||
switch (cmSender.Tag.ToString().ToLower())
|
||||
{
|
||||
case "i4":
|
||||
TplFormat = 0;
|
||||
lbFormat.Text = "I4";
|
||||
break;
|
||||
case "i8":
|
||||
TplFormat = 1;
|
||||
lbFormat.Text = "I8";
|
||||
break;
|
||||
case "ia4":
|
||||
TplFormat = 2;
|
||||
lbFormat.Text = "IA4";
|
||||
break;
|
||||
case "ia8":
|
||||
TplFormat = 3;
|
||||
lbFormat.Text = "IA8";
|
||||
break;
|
||||
case "rgb565":
|
||||
TplFormat = 4;
|
||||
lbFormat.Text = "RGB565";
|
||||
@ -252,7 +287,25 @@ namespace CustomizeMii
|
||||
}
|
||||
|
||||
Wii.TPL.ConvertToTPL(Img, Tpl, TplFormat);
|
||||
pbPic.Image = Wii.TPL.ConvertFromTPL(Tpl);
|
||||
|
||||
if (cbBanner.SelectedIndex != -1)
|
||||
{
|
||||
images[0, cbBanner.SelectedIndex].tplImage = Wii.TPL.ConvertFromTPL(Tpl);
|
||||
images[0, cbBanner.SelectedIndex].tplFormat = Wii.TPL.GetTextureFormatName(File.ReadAllBytes(Tpl));
|
||||
|
||||
pbPic.Image = images[0, cbBanner.SelectedIndex].tplImage;
|
||||
lbFormat.Text = images[0, cbBanner.SelectedIndex].tplFormat;
|
||||
lbSize.Text = string.Format("{0} x {1}", images[0, cbBanner.SelectedIndex].tplImage.Width, images[0, cbBanner.SelectedIndex].tplImage.Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
images[1, cbIcon.SelectedIndex].tplImage = Wii.TPL.ConvertFromTPL(Tpl);
|
||||
images[1, cbIcon.SelectedIndex].tplFormat = Wii.TPL.GetTextureFormatName(File.ReadAllBytes(Tpl));
|
||||
|
||||
pbPic.Image = images[1, cbIcon.SelectedIndex].tplImage;
|
||||
lbFormat.Text = images[1, cbIcon.SelectedIndex].tplFormat;
|
||||
lbSize.Text = string.Format("{0} x {1}", images[1, cbIcon.SelectedIndex].tplImage.Width, images[1, cbIcon.SelectedIndex].tplImage.Height);
|
||||
}
|
||||
|
||||
if (cbBanner.SelectedIndex != -1) cbBanner.Select();
|
||||
else if (cbIcon.SelectedIndex != -1) cbIcon.Select();
|
||||
|
@ -27,6 +27,13 @@ namespace CustomizeMii
|
||||
{
|
||||
partial class CustomizeMii_Main
|
||||
{
|
||||
private Forwarder.Simple SimpleForwarder = new Forwarder.Simple();
|
||||
private Forwarder.Complex ComplexForwarder = new Forwarder.Complex();
|
||||
private delegate void BoxInvoker(string message);
|
||||
private delegate void SetTextInvoker(string text, TextBox tb);
|
||||
private delegate void SetLabelInvoker(string text, Label lb);
|
||||
private delegate void SetButtonInvoker(string text, Button btn);
|
||||
|
||||
private bool FailureCheck()
|
||||
{
|
||||
try
|
||||
@ -279,10 +286,15 @@ namespace CustomizeMii
|
||||
private void ForwarderDialogComplex()
|
||||
{
|
||||
CustomizeMii_ComplexForwarder cf = new CustomizeMii_ComplexForwarder();
|
||||
cf.tb1.Text = ComplexForwarder.Path1;
|
||||
cf.tb2.Text = ComplexForwarder.Path2;
|
||||
cf.tb3.Text = ComplexForwarder.Path3;
|
||||
cf.tb4.Text = ComplexForwarder.Path4;
|
||||
|
||||
TextBox[] tbs = new TextBox[] { cf.tb1, cf.tb2, cf.tb3, cf.tb4, cf.tb5, cf.tb6, cf.tb7, cf.tb8,
|
||||
cf.tb9, cf.tb10, cf.tb11, cf.tb12, cf.tb13, cf.tb14, cf.tb15, cf.tb16};
|
||||
for (int i = 0; i < tbs.Length; i++)
|
||||
tbs[i].Text = ComplexForwarder.GetPath(i);
|
||||
|
||||
cf.cbPack1.Checked = ComplexForwarder.Packs[0];
|
||||
cf.cbPack2.Checked = ComplexForwarder.Packs[1];
|
||||
cf.cbPack3.Checked = ComplexForwarder.Packs[2];
|
||||
|
||||
if (!string.IsNullOrEmpty(ComplexForwarder.Image43))
|
||||
{
|
||||
@ -303,10 +315,12 @@ namespace CustomizeMii
|
||||
|
||||
if (cf.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
ComplexForwarder.Path1 = cf.tb1.Text;
|
||||
ComplexForwarder.Path2 = cf.tb2.Text;
|
||||
ComplexForwarder.Path3 = cf.tb3.Text;
|
||||
ComplexForwarder.Path4 = cf.tb4.Text;
|
||||
for (int i = 0; i < tbs.Length; i++)
|
||||
ComplexForwarder.SetPath(i, tbs[i].Text.Replace('\\', '/'));
|
||||
|
||||
ComplexForwarder.Packs[0] = cf.cbPack1.Checked;
|
||||
ComplexForwarder.Packs[1] = cf.cbPack2.Checked;
|
||||
ComplexForwarder.Packs[2] = cf.cbPack3.Checked;
|
||||
|
||||
ComplexForwarder.Image43 = cf.tbImage43.Text;
|
||||
ComplexForwarder.Image169 = cf.tbImage169.Text;
|
||||
@ -412,6 +426,17 @@ namespace CustomizeMii
|
||||
lb.Text = text;
|
||||
}
|
||||
|
||||
private void SetButton(Button btn, string text)
|
||||
{
|
||||
SetButtonInvoker invoker = new SetButtonInvoker(this.SetButton);
|
||||
this.Invoke(invoker, text, btn);
|
||||
}
|
||||
|
||||
private void SetButton(string text, Button btn)
|
||||
{
|
||||
btn.Text = text;
|
||||
}
|
||||
|
||||
private void AddBannerTpls(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
@ -683,6 +708,18 @@ namespace CustomizeMii
|
||||
int switchVal = lbx == lbxBannerTpls ? cmbFormatBanner.SelectedIndex : cmbFormatIcon.SelectedIndex;
|
||||
switch (switchVal)
|
||||
{
|
||||
case 6: //I4
|
||||
TplFormat = 0;
|
||||
break;
|
||||
case 5: //I8
|
||||
TplFormat = 1;
|
||||
break;
|
||||
case 4: //IA4
|
||||
TplFormat = 2;
|
||||
break;
|
||||
case 3: //IA8
|
||||
TplFormat = 3;
|
||||
break;
|
||||
case 0:
|
||||
TplFormat = 6;
|
||||
break;
|
||||
@ -694,7 +731,7 @@ namespace CustomizeMii
|
||||
break;
|
||||
default:
|
||||
if (!inputFile.ToLower().EndsWith(".tpl"))
|
||||
throw new Exception("This format is not supported, you must choose either RGBA8, RGB565 or RGB5A3!");
|
||||
throw new Exception("This format is not supported, you must choose a different one!");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -740,7 +777,6 @@ namespace CustomizeMii
|
||||
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
SourceWad = ofd.FileName;
|
||||
BackgroundWorker bwLoadChannel = new BackgroundWorker();
|
||||
bwLoadChannel.DoWork += new DoWorkEventHandler(bwLoadChannel_DoWork);
|
||||
bwLoadChannel.ProgressChanged += new ProgressChangedEventHandler(bwLoadChannel_ProgressChanged);
|
||||
@ -751,7 +787,6 @@ namespace CustomizeMii
|
||||
}
|
||||
else
|
||||
{
|
||||
SourceWad = inputFile;
|
||||
BackgroundWorker bwLoadChannel = new BackgroundWorker();
|
||||
bwLoadChannel.DoWork += new DoWorkEventHandler(bwLoadChannel_DoWork);
|
||||
bwLoadChannel.ProgressChanged += new ProgressChangedEventHandler(bwLoadChannel_ProgressChanged);
|
||||
|
@ -17,6 +17,12 @@
|
||||
|
||||
namespace CustomizeMii
|
||||
{
|
||||
public struct TplImage
|
||||
{
|
||||
public System.Drawing.Image tplImage;
|
||||
public string tplFormat;
|
||||
}
|
||||
|
||||
public struct TransmitInfo
|
||||
{
|
||||
public bool usedCompression;
|
||||
@ -61,6 +67,7 @@ namespace CustomizeMii
|
||||
public string transmitIp;
|
||||
public int transmitIos;
|
||||
public bool saveAfterTransmit;
|
||||
public bool success;
|
||||
}
|
||||
|
||||
public struct Progress
|
||||
|
@ -17,20 +17,40 @@
|
||||
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
namespace CustomizeMii
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
static Mutex mtx;
|
||||
|
||||
/// <summary>
|
||||
/// Der Haupteinstiegspunkt für die Anwendung.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
CleanupRemains();
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new CustomizeMii_Main());
|
||||
}
|
||||
|
||||
static void CleanupRemains()
|
||||
{
|
||||
bool firstInstance = false;
|
||||
mtx = new System.Threading.Mutex(false, "CustomizeMii", out firstInstance);
|
||||
|
||||
if (firstInstance)
|
||||
{
|
||||
if (Directory.Exists(Path.GetTempPath() + "CustomizeMii_Temp"))
|
||||
Directory.Delete(Path.GetTempPath() + "CustomizeMii_Temp", true);
|
||||
if (Directory.Exists(Path.GetTempPath() + "ForwardMii_Temp"))
|
||||
Directory.Delete(Path.GetTempPath() + "ForwardMii_Temp", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,6 @@ using System.Resources;
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.1.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.1.0.0")]
|
||||
[assembly: AssemblyVersion("2.2.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.2.0.0")]
|
||||
[assembly: NeutralResourcesLanguageAttribute("en")]
|
||||
|
@ -9,6 +9,17 @@ Thanks to icefire / Xuzz for the basic idea of this Application!
|
||||
-----------------------------------------------------------------------------------------
|
||||
Changelog:
|
||||
|
||||
Version 2.2
|
||||
- Fixed some bugs with the preview window
|
||||
- Fixed Complex Forwarder in combination with Waninkoko's NAND Loader
|
||||
- Fixed saving of base WADs
|
||||
- Fixed saving of WAD after sending it to the Wii
|
||||
- Fixed CMP TPL code (thanks pbsds)
|
||||
- Added conversion to IA8 (thanks pbsds), IA4, I8 and I4
|
||||
- Fixed conversion from IA8 and I4
|
||||
- Fixed some general TPL bugs (format detection, ...)
|
||||
- Added additional paths to the Complex Forwarder (max. 16)
|
||||
|
||||
Version 2.1
|
||||
- Added CustomizeMii Installer (by WiiCrazy / I.R.on)
|
||||
- Fixed rough edges (artifacts) on images (will be fixed automatically)
|
||||
|
@ -88,28 +88,12 @@ namespace Wii
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts UInt32 Array into Byte Array
|
||||
/// </summary>
|
||||
/// <param name="array"></param>
|
||||
/// <returns></returns>
|
||||
public static byte[] UInt32ArrayToByteArray(UInt32[] array)
|
||||
{
|
||||
List<byte> results = new List<byte>();
|
||||
foreach (UInt32 value in array)
|
||||
{
|
||||
byte[] converted = BitConverter.GetBytes(value);
|
||||
results.AddRange(converted);
|
||||
}
|
||||
return results.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts UInt16 Array into Byte Array
|
||||
/// </summary>
|
||||
/// <param name="array"></param>
|
||||
/// <returns></returns>
|
||||
public static byte[] UInt16ArrayToByteArray(UInt16[] array)
|
||||
public static byte[] UIntArrayToByteArray(UInt16[] array)
|
||||
{
|
||||
List<byte> results = new List<byte>();
|
||||
foreach (UInt16 value in array)
|
||||
@ -2315,6 +2299,45 @@ namespace Wii
|
||||
Tools.InsertByteArray(tik, newKey, 447);
|
||||
return tik;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the decrypted TitleKey
|
||||
/// </summary>
|
||||
/// <param name="wadtik"></param>
|
||||
/// <returns></returns>
|
||||
public static byte[] GetTitleKey(byte[] encryptedkey, byte[] titleid)
|
||||
{
|
||||
byte[] commonkey = new byte[16];
|
||||
|
||||
if (File.Exists(System.Windows.Forms.Application.StartupPath + "\\common-key.bin"))
|
||||
{ commonkey = Tools.LoadFileToByteArray(System.Windows.Forms.Application.StartupPath + "\\common-key.bin"); }
|
||||
else if (File.Exists(System.Windows.Forms.Application.StartupPath + "\\key.bin"))
|
||||
{ commonkey = Tools.LoadFileToByteArray(System.Windows.Forms.Application.StartupPath + "\\key.bin"); }
|
||||
else { throw new FileNotFoundException("The (common-)key.bin must be in the application directory!"); }
|
||||
|
||||
Array.Resize(ref titleid, 16);
|
||||
|
||||
RijndaelManaged decrypt = new RijndaelManaged();
|
||||
decrypt.Mode = CipherMode.CBC;
|
||||
decrypt.Padding = PaddingMode.None;
|
||||
decrypt.KeySize = 128;
|
||||
decrypt.BlockSize = 128;
|
||||
decrypt.Key = commonkey;
|
||||
decrypt.IV = titleid;
|
||||
|
||||
ICryptoTransform cryptor = decrypt.CreateDecryptor();
|
||||
|
||||
MemoryStream memory = new MemoryStream(encryptedkey);
|
||||
CryptoStream crypto = new CryptoStream(memory, cryptor, CryptoStreamMode.Read);
|
||||
|
||||
byte[] decryptedkey = new byte[16];
|
||||
crypto.Read(decryptedkey, 0, decryptedkey.Length);
|
||||
|
||||
crypto.Close();
|
||||
memory.Close();
|
||||
|
||||
return decryptedkey;
|
||||
}
|
||||
}
|
||||
|
||||
public class WadUnpack
|
||||
@ -4242,7 +4265,7 @@ namespace Wii
|
||||
|
||||
public class TPL
|
||||
{
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Fixes rough edges (artifacts), if necessary
|
||||
/// </summary>
|
||||
/// <param name="tplFile"></param>
|
||||
@ -4265,7 +4288,7 @@ namespace Wii
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Tpl to a Bitmap
|
||||
/// </summary>
|
||||
@ -4314,6 +4337,15 @@ namespace Wii
|
||||
case 6:
|
||||
byte[] temp6 = FromRGBA8(tpl);
|
||||
return ConvertPixelToBitmap(temp6, width, height);
|
||||
case 8:
|
||||
byte[] temp8 = FromCI4(tpl);
|
||||
return ConvertPixelToBitmap(temp8, width, height);
|
||||
case 9:
|
||||
byte[] temp9 = FromCI8(tpl);
|
||||
return ConvertPixelToBitmap(temp9, width, height);
|
||||
case 10:
|
||||
byte[] temp10 = FromCI14X2(tpl);
|
||||
return ConvertPixelToBitmap(temp10, width, height);
|
||||
case 14:
|
||||
byte[] temp14 = FromCMP(tpl);
|
||||
return ConvertPixelToBitmap(temp14, width, height);
|
||||
@ -4341,6 +4373,126 @@ namespace Wii
|
||||
return bmp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the offset to the Texture Header
|
||||
/// </summary>
|
||||
/// <param name="tpl"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetTextureHeaderOffset(byte[] tpl)
|
||||
{
|
||||
byte[] tmp = new byte[] { tpl[15], tpl[14], tpl[13], tpl[12] };
|
||||
return BitConverter.ToInt32(tmp, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the offset to the Texture Palette Header
|
||||
/// </summary>
|
||||
/// <param name="tpl"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetTexturePaletteHeaderOffset(byte[] tpl)
|
||||
{
|
||||
byte[] tmp = new byte[] { tpl[19], tpl[18], tpl[17], tpl[16] };
|
||||
return BitConverter.ToInt32(tmp, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the offset to the Texture Palette
|
||||
/// </summary>
|
||||
/// <param name="tpl"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetTexturePaletteOffset(byte[] tpl)
|
||||
{
|
||||
int paletteheaderoffset = GetTexturePaletteHeaderOffset(tpl);
|
||||
|
||||
byte[] tmp = new byte[] { tpl[paletteheaderoffset + 11],
|
||||
tpl[paletteheaderoffset + 10], tpl[paletteheaderoffset + 9], tpl[paletteheaderoffset + 8] };
|
||||
return BitConverter.ToInt32(tmp, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Texture Palette Format
|
||||
/// </summary>
|
||||
/// <param name="tpl"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetTexturePaletteFormat(byte[] tpl)
|
||||
{
|
||||
int paletteheaderoffset = GetTexturePaletteHeaderOffset(tpl);
|
||||
|
||||
byte[] tmp = new byte[] { tpl[paletteheaderoffset + 7],
|
||||
tpl[paletteheaderoffset + 6], tpl[paletteheaderoffset + 5], tpl[paletteheaderoffset + 4] };
|
||||
return BitConverter.ToInt32(tmp, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the item count of the Texture Palette
|
||||
/// </summary>
|
||||
/// <param name="tpl"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetTexturePaletteItemCount(byte[] tpl)
|
||||
{
|
||||
int paletteheaderoffset = GetTexturePaletteHeaderOffset(tpl);
|
||||
|
||||
byte[] tmp = new byte[] { tpl[paletteheaderoffset + 1], tpl[paletteheaderoffset] };
|
||||
return BitConverter.ToInt16(tmp, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Texture Palette of the TPL
|
||||
/// </summary>
|
||||
/// <param name="tpl"></param>
|
||||
/// <returns></returns>
|
||||
public static uint[] GetTexturePalette(byte[] tpl)
|
||||
{
|
||||
int paletteoffset = GetTexturePaletteOffset(tpl);
|
||||
int paletteformat = GetTexturePaletteFormat(tpl);
|
||||
int itemcount = GetTexturePaletteItemCount(tpl);
|
||||
int r, g, b, a;
|
||||
|
||||
uint[] output = new uint[itemcount];
|
||||
for (int i = 0; i < itemcount; i++)
|
||||
{
|
||||
if (i >= itemcount) continue;
|
||||
|
||||
UInt16 pixel = BitConverter.ToUInt16(new byte[] { tpl[i * 2 + 1], tpl[i * 2] }, 0);
|
||||
|
||||
if (paletteformat == 0) //IA8
|
||||
{
|
||||
r = (pixel >> 8);
|
||||
b = r;
|
||||
g = r;
|
||||
a = ((pixel >> 0) & 0xff);
|
||||
}
|
||||
else if (paletteformat == 1) //RGB565
|
||||
{
|
||||
b = (((pixel >> 11) & 0x1F) << 3) & 0xff;
|
||||
g = (((pixel >> 5) & 0x3F) << 2) & 0xff;
|
||||
r = (((pixel >> 0) & 0x1F) << 3) & 0xff;
|
||||
a = 255;
|
||||
}
|
||||
else //RGB5A3
|
||||
{
|
||||
if ((pixel & (1 << 15)) != 0) //RGB555
|
||||
{
|
||||
a = 255;
|
||||
b = (((pixel >> 10) & 0x1F) * 255) / 31;
|
||||
g = (((pixel >> 5) & 0x1F) * 255) / 31;
|
||||
r = (((pixel >> 0) & 0x1F) * 255) / 31;
|
||||
}
|
||||
else //RGB4A3
|
||||
{
|
||||
a = (((pixel >> 12) & 0x07) * 255) / 7;
|
||||
b = (((pixel >> 8) & 0x0F) * 255) / 15;
|
||||
g = (((pixel >> 4) & 0x0F) * 255) / 15;
|
||||
r = (((pixel >> 0) & 0x0F) * 255) / 15;
|
||||
}
|
||||
}
|
||||
|
||||
output[i] = (uint)((r << 0) | (g << 8) | (b << 16) | (a << 24));
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Number of Textures in a Tpl
|
||||
/// </summary>
|
||||
@ -4353,8 +4505,7 @@ namespace Wii
|
||||
tmp[2] = tpl[5];
|
||||
tmp[1] = tpl[6];
|
||||
tmp[0] = tpl[7];
|
||||
UInt32 count = BitConverter.ToUInt32(tmp, 0);
|
||||
return (int)count;
|
||||
return BitConverter.ToInt32(tmp, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -4364,7 +4515,7 @@ namespace Wii
|
||||
/// <returns></returns>
|
||||
public static int GetTextureFormat(string tpl)
|
||||
{
|
||||
byte[] temp = Tools.LoadFileToByteArray(tpl, 0, 50);
|
||||
byte[] temp = Tools.LoadFileToByteArray(tpl, 0, 512);
|
||||
return GetTextureFormat(temp);
|
||||
}
|
||||
|
||||
@ -4375,11 +4526,13 @@ namespace Wii
|
||||
/// <returns></returns>
|
||||
public static int GetTextureFormat(byte[] tpl)
|
||||
{
|
||||
int offset = GetTextureHeaderOffset(tpl);
|
||||
|
||||
byte[] tmp = new byte[4];
|
||||
tmp[3] = tpl[24];
|
||||
tmp[2] = tpl[25];
|
||||
tmp[1] = tpl[26];
|
||||
tmp[0] = tpl[27];
|
||||
tmp[3] = tpl[offset + 4];
|
||||
tmp[2] = tpl[offset + 5];
|
||||
tmp[1] = tpl[offset + 6];
|
||||
tmp[0] = tpl[offset + 7];
|
||||
UInt32 format = BitConverter.ToUInt32(tmp, 0);
|
||||
|
||||
if (format == 0 ||
|
||||
@ -4389,6 +4542,9 @@ namespace Wii
|
||||
format == 4 ||
|
||||
format == 5 ||
|
||||
format == 6 ||
|
||||
format == 8 ||
|
||||
format == 9 ||
|
||||
format == 10 ||
|
||||
format == 14) return (int)format;
|
||||
|
||||
else return -1; //Unsupported Format
|
||||
@ -4417,6 +4573,12 @@ namespace Wii
|
||||
return "RGB5A3";
|
||||
case 6:
|
||||
return "RGBA8";
|
||||
case 8:
|
||||
return "CI4";
|
||||
case 9:
|
||||
return "CI8";
|
||||
case 10:
|
||||
return "CI14X2";
|
||||
case 14:
|
||||
return "CMP";
|
||||
default:
|
||||
@ -4451,11 +4613,12 @@ namespace Wii
|
||||
/// <returns></returns>
|
||||
public static int GetTextureWidth(byte[] tpl)
|
||||
{
|
||||
int offset = GetTextureHeaderOffset(tpl);
|
||||
|
||||
byte[] tmp = new byte[2];
|
||||
tmp[1] = tpl[22];
|
||||
tmp[0] = tpl[23];
|
||||
UInt16 width = BitConverter.ToUInt16(tmp, 0);
|
||||
return (int)width;
|
||||
tmp[1] = tpl[offset + 2];
|
||||
tmp[0] = tpl[offset + 3];
|
||||
return BitConverter.ToInt16(tmp, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -4465,11 +4628,12 @@ namespace Wii
|
||||
/// <returns></returns>
|
||||
public static int GetTextureHeight(byte[] tpl)
|
||||
{
|
||||
int offset = GetTextureHeaderOffset(tpl);
|
||||
|
||||
byte[] tmp = new byte[2];
|
||||
tmp[1] = tpl[20];
|
||||
tmp[0] = tpl[21];
|
||||
UInt16 height = BitConverter.ToUInt16(tmp, 0);
|
||||
return (int)height;
|
||||
tmp[1] = tpl[offset];
|
||||
tmp[0] = tpl[offset + 1];
|
||||
return BitConverter.ToInt16(tmp, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -4479,13 +4643,14 @@ namespace Wii
|
||||
/// <returns></returns>
|
||||
public static int GetTextureOffset(byte[] tpl)
|
||||
{
|
||||
int offset = GetTextureHeaderOffset(tpl);
|
||||
|
||||
byte[] tmp = new byte[4];
|
||||
tmp[3] = tpl[28];
|
||||
tmp[2] = tpl[29];
|
||||
tmp[1] = tpl[30];
|
||||
tmp[0] = tpl[31];
|
||||
UInt32 offset = BitConverter.ToUInt32(tmp, 0);
|
||||
return (int)offset;
|
||||
tmp[3] = tpl[offset + 8];
|
||||
tmp[2] = tpl[offset + 9];
|
||||
tmp[1] = tpl[offset + 10];
|
||||
tmp[0] = tpl[offset + 11];
|
||||
return BitConverter.ToInt32(tmp, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -4537,7 +4702,7 @@ namespace Wii
|
||||
}
|
||||
}
|
||||
|
||||
return Tools.UInt32ArrayToByteArray(output);
|
||||
return Tools.UIntArrayToByteArray(output);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -4593,7 +4758,7 @@ namespace Wii
|
||||
}
|
||||
}
|
||||
|
||||
return Tools.UInt32ArrayToByteArray(output);
|
||||
return Tools.UIntArrayToByteArray(output);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -4637,7 +4802,7 @@ namespace Wii
|
||||
}
|
||||
}
|
||||
|
||||
return Tools.UInt32ArrayToByteArray(output);
|
||||
return Tools.UIntArrayToByteArray(output);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -4652,6 +4817,7 @@ namespace Wii
|
||||
int offset = GetTextureOffset(tpl);
|
||||
UInt32[] output = new UInt32[width * height];
|
||||
int inp = 0;
|
||||
|
||||
for (int y = 0; y < height; y += 8)
|
||||
{
|
||||
for (int x = 0; x < width; x += 8)
|
||||
@ -4660,7 +4826,7 @@ namespace Wii
|
||||
{
|
||||
for (int x1 = x; x1 < x + 8; x1 += 2)
|
||||
{
|
||||
int pixel = tpl[offset + inp];
|
||||
int pixel = tpl[offset + inp++];
|
||||
|
||||
if (y1 >= height || x1 >= width)
|
||||
continue;
|
||||
@ -4668,21 +4834,15 @@ namespace Wii
|
||||
int r = (pixel >> 4) * 255 / 15;
|
||||
int g = (pixel >> 4) * 255 / 15;
|
||||
int b = (pixel >> 4) * 255 / 15;
|
||||
int a = (pixel >> 4) * 255 / 15;
|
||||
int a = 255;
|
||||
|
||||
int rgba = (r << 0) | (g << 8) | (b << 16) | (a << 24);
|
||||
output[y1 * width + x1] = (UInt32)rgba;
|
||||
|
||||
pixel = tpl[offset + inp];
|
||||
inp++;
|
||||
|
||||
if (y1 >= height || x1 >= width)
|
||||
continue;
|
||||
|
||||
r = (pixel & 0x0F) * 255 / 15;
|
||||
g = (pixel & 0x0F) * 255 / 15;
|
||||
b = (pixel & 0x0F) * 255 / 15;
|
||||
a = (pixel & 0x0F) * 255 / 15;
|
||||
a = 255;
|
||||
|
||||
rgba = (r << 0) | (g << 8) | (b << 16) | (a << 24);
|
||||
output[y1 * width + x1 + 1] = (UInt32)rgba;
|
||||
@ -4691,7 +4851,7 @@ namespace Wii
|
||||
}
|
||||
}
|
||||
|
||||
return Tools.UInt32ArrayToByteArray(output);
|
||||
return Tools.UIntArrayToByteArray(output);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -4706,6 +4866,7 @@ namespace Wii
|
||||
int offset = GetTextureOffset(tpl);
|
||||
UInt32[] output = new UInt32[width * height];
|
||||
int inp = 0;
|
||||
|
||||
for (int y = 0; y < height; y += 4)
|
||||
{
|
||||
for (int x = 0; x < width; x += 8)
|
||||
@ -4732,7 +4893,7 @@ namespace Wii
|
||||
}
|
||||
}
|
||||
|
||||
return Tools.UInt32ArrayToByteArray(output);
|
||||
return Tools.UIntArrayToByteArray(output);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -4747,6 +4908,7 @@ namespace Wii
|
||||
int offset = GetTextureOffset(tpl);
|
||||
UInt32[] output = new UInt32[width * height];
|
||||
int inp = 0;
|
||||
|
||||
for (int y = 0; y < height; y += 4)
|
||||
{
|
||||
for (int x = 0; x < width; x += 8)
|
||||
@ -4773,7 +4935,7 @@ namespace Wii
|
||||
}
|
||||
}
|
||||
|
||||
return Tools.UInt32ArrayToByteArray(output);
|
||||
return Tools.UIntArrayToByteArray(output);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -4788,6 +4950,7 @@ namespace Wii
|
||||
int offset = GetTextureOffset(tpl);
|
||||
UInt32[] output = new UInt32[width * height];
|
||||
int inp = 0;
|
||||
|
||||
for (int y = 0; y < height; y += 4)
|
||||
{
|
||||
for (int x = 0; x < width; x += 4)
|
||||
@ -4808,7 +4971,7 @@ namespace Wii
|
||||
int r = (pixel >> 8);// &0xff;
|
||||
int g = (pixel >> 8);// &0xff;
|
||||
int b = (pixel >> 8);// &0xff;
|
||||
int a = (pixel >> 8) & 0xff;
|
||||
int a = (pixel >> 0) & 0xff;
|
||||
|
||||
int rgba = (r << 0) | (g << 8) | (b << 16) | (a << 24);
|
||||
output[y1 * width + x1] = (UInt32)rgba;
|
||||
@ -4817,7 +4980,7 @@ namespace Wii
|
||||
}
|
||||
}
|
||||
|
||||
return Tools.UInt32ArrayToByteArray(output);
|
||||
return Tools.UIntArrayToByteArray(output);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -4832,7 +4995,7 @@ namespace Wii
|
||||
int offset = GetTextureOffset(tpl);
|
||||
UInt32[] output = new UInt32[width * height];
|
||||
UInt16[] c = new UInt16[4];
|
||||
int[] pix = new int[3];
|
||||
int[] pix = new int[4];
|
||||
int inp = 0;
|
||||
|
||||
for (int y = 0; y < height; y++)
|
||||
@ -4883,18 +5046,158 @@ namespace Wii
|
||||
pix[0] = (raw >> 8) & 0xf8;
|
||||
pix[1] = (raw >> 3) & 0xf8;
|
||||
pix[2] = (raw << 3) & 0xf8;
|
||||
pix[3] = 0xff;
|
||||
if (((pixel >> (30 - (2 * ix))) & 0x03) == 3 && c[0] <= c[1]) pix[3] = 0x00;
|
||||
|
||||
int intout = (pix[0] << 16) | (pix[1] << 8) | (pix[2] << 0) | (255 << 24);
|
||||
int intout = (pix[0] << 16) | (pix[1] << 8) | (pix[2] << 0) | (pix[3] << 24);
|
||||
output[inp] = (UInt32)intout;
|
||||
inp++;
|
||||
}
|
||||
}
|
||||
|
||||
return Tools.UInt32ArrayToByteArray(output);
|
||||
return Tools.UIntArrayToByteArray(output);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the pixel data of a Bitmap as an Byte Array
|
||||
/// Converts CI4 Tpl Array to RGBA Byte Array
|
||||
/// </summary>
|
||||
/// <param name="tpl"></param>
|
||||
/// <returns></returns>
|
||||
public static byte[] FromCI4(byte[] tpl)
|
||||
{
|
||||
uint[] palette = GetTexturePalette(tpl);
|
||||
|
||||
int width = GetTextureWidth(tpl);
|
||||
int height = GetTextureHeight(tpl);
|
||||
int offset = GetTextureOffset(tpl);
|
||||
UInt32[] output = new UInt32[width * height + 1];
|
||||
int i = 0;
|
||||
|
||||
for (int y = 0; y < height; y += 8)
|
||||
{
|
||||
for (int x = 0; x < width; x += 8)
|
||||
{
|
||||
for (int y1 = y; y1 < y + 8; y1++)
|
||||
{
|
||||
for (int x1 = x; x1 < x + 8; x1 += 2)
|
||||
{
|
||||
if (y1 >= height || x1 >= width)
|
||||
continue;
|
||||
|
||||
UInt16 pixel = tpl[offset + i++];
|
||||
|
||||
uint r = ((palette[pixel >> 4] & 0xFF000000) >> 24);
|
||||
uint g = (uint)((palette[pixel >> 4] & 0x00FF0000) >> 16);
|
||||
uint b = (uint)((palette[pixel >> 4] & 0x0000FF00) >> 8);
|
||||
uint a = (uint)((palette[pixel >> 4] & 0x000000FF) >> 0);
|
||||
|
||||
uint rgba = (r << 0) | (g << 8) | (b << 16) | (a << 24);
|
||||
output[y1 * width + x1] = rgba;
|
||||
|
||||
r = ((palette[pixel & 0x0F] & 0xFF000000) >> 24);
|
||||
g = (uint)((palette[pixel & 0x0F] & 0x00FF0000) >> 16);
|
||||
b = (uint)((palette[pixel & 0x0F] & 0x0000FF00) >> 8);
|
||||
a = (uint)((palette[pixel & 0x0F] & 0x000000FF) >> 0);
|
||||
|
||||
rgba = (r << 0) | (g << 8) | (b << 16) | (a << 24);
|
||||
|
||||
output[y1 * width + x1 + 1] = rgba;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Tools.UIntArrayToByteArray(output);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts CI8 Tpl Array to RGBA Byte Array
|
||||
/// </summary>
|
||||
/// <param name="tpl"></param>
|
||||
/// <returns></returns>
|
||||
public static byte[] FromCI8(byte[] tpl)
|
||||
{
|
||||
uint[] palette = GetTexturePalette(tpl);
|
||||
|
||||
int width = GetTextureWidth(tpl);
|
||||
int height = GetTextureHeight(tpl);
|
||||
int offset = GetTextureOffset(tpl);
|
||||
UInt32[] output = new UInt32[width * height];
|
||||
int i = 0;
|
||||
|
||||
for (int y = 0; y < height; y += 4)
|
||||
{
|
||||
for (int x = 0; x < width; x += 8)
|
||||
{
|
||||
for (int y1 = y; y1 < y + 4; y1++)
|
||||
{
|
||||
for (int x1 = x; x1 < x + 8; x1++)
|
||||
{
|
||||
if (y1 >= height || x1 >= width)
|
||||
continue;
|
||||
|
||||
UInt16 pixel = tpl[offset + i++];
|
||||
|
||||
uint r = ((palette[pixel] & 0xFF000000) >> 24);
|
||||
uint g = (uint)((palette[pixel] & 0x00FF0000) >> 16);
|
||||
uint b = (uint)((palette[pixel] & 0x0000FF00) >> 8);
|
||||
uint a = (uint)((palette[pixel] & 0x000000FF) >> 0);
|
||||
|
||||
uint rgba = (r << 0) | (g << 8) | (b << 16) | (a << 24);
|
||||
output[y1 * width + x1] = rgba;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Tools.UIntArrayToByteArray(output);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts CI14X2 Tpl Array to RGBA Byte Array
|
||||
/// </summary>
|
||||
/// <param name="tpl"></param>
|
||||
/// <returns></returns>
|
||||
public static byte[] FromCI14X2(byte[] tpl)
|
||||
{
|
||||
uint[] palette = GetTexturePalette(tpl);
|
||||
|
||||
int width = GetTextureWidth(tpl);
|
||||
int height = GetTextureHeight(tpl);
|
||||
int offset = GetTextureOffset(tpl);
|
||||
UInt32[] output = new UInt32[width * height];
|
||||
int i = 0;
|
||||
|
||||
for (int y = 0; y < height; y += 4)
|
||||
{
|
||||
for (int x = 0; x < width; x += 4)
|
||||
{
|
||||
for (int y1 = y; y1 < y + 4; y1++)
|
||||
{
|
||||
for (int x1 = x; x1 < x + 4; x1++)
|
||||
{
|
||||
if (y1 >= height || x1 >= width)
|
||||
continue;
|
||||
|
||||
UInt16 pixel = tpl[offset + i++];
|
||||
|
||||
uint r = ((palette[pixel & 0x3FFF] & 0xFF000000) >> 24);
|
||||
uint g = (uint)((palette[pixel & 0x3FFF] & 0x00FF0000) >> 16);
|
||||
uint b = (uint)((palette[pixel & 0x3FFF] & 0x0000FF00) >> 8);
|
||||
uint a = (uint)((palette[pixel & 0x3FFF] & 0x000000FF) >> 0);
|
||||
|
||||
uint rgba = (r << 0) | (g << 8) | (b << 16) | (a << 24);
|
||||
output[y1 * width + x1] = rgba;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Tools.UIntArrayToByteArray(output);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the pixel data of a Bitmap as a Byte Array
|
||||
/// </summary>
|
||||
/// <param name="img"></param>
|
||||
/// <returns></returns>
|
||||
@ -4929,7 +5232,7 @@ namespace Wii
|
||||
/// Converts an Image to a Tpl
|
||||
/// </summary>
|
||||
/// <param name="img"></param>
|
||||
/// <param name="format">4 = RGB565, 5 = RGB5A3, 6 = RGBA8</param>
|
||||
/// <param name="format">0 = I4, 1 = I8, 2 = IA4, 3 = IA8, 4 = RGB565, 5 = RGB5A3, 6 = RGBA8</param>
|
||||
/// <returns></returns>
|
||||
public static void ConvertToTPL(Bitmap img, string destination, int format)
|
||||
{
|
||||
@ -4945,7 +5248,7 @@ namespace Wii
|
||||
/// Converts an Image to a Tpl
|
||||
/// </summary>
|
||||
/// <param name="img"></param>
|
||||
/// <param name="format">4 = RGB565, 5 = RGB5A3, 6 = RGBA8</param>
|
||||
/// <param name="format">0 = I4, 1 = I8, 2 = IA4, 3 = IA8, 4 = RGB565, 5 = RGB5A3, 6 = RGBA8</param>
|
||||
/// <returns></returns>
|
||||
public static void ConvertToTPL(Image img, string destination, int format)
|
||||
{
|
||||
@ -4961,7 +5264,7 @@ namespace Wii
|
||||
/// Converts an Image to a Tpl
|
||||
/// </summary>
|
||||
/// <param name="img"></param>
|
||||
/// <param name="format">4 = RGB565, 5 = RGB5A3, 6 = RGBA8</param>
|
||||
/// <param name="format">0 = I4, 1 = I8, 2 = IA4, 3 = IA8, 4 = RGB565, 5 = RGB5A3, 6 = RGBA8</param>
|
||||
/// <returns></returns>
|
||||
public static byte[] ConvertToTPL(Image img, int format)
|
||||
{
|
||||
@ -4972,7 +5275,7 @@ namespace Wii
|
||||
/// Converts an Image to a Tpl
|
||||
/// </summary>
|
||||
/// <param name="img"></param>
|
||||
/// <param name="format">4 = RGB565, 5 = RGB5A3, 6 = RGBA8</param>
|
||||
/// <param name="format">0 = I4, 1 = I8, 2 = IA4, 3 = IA8, 4 = RGB565, 5 = RGB5A3, 6 = RGBA8</param>
|
||||
/// <returns></returns>
|
||||
public static byte[] ConvertToTPL(Bitmap img, int format)
|
||||
{
|
||||
@ -4995,6 +5298,22 @@ namespace Wii
|
||||
|
||||
switch (format)
|
||||
{
|
||||
case 0: //I4
|
||||
texformat = 0x0;
|
||||
rgbaData = ToI4(img);
|
||||
break;
|
||||
case 1: //I8
|
||||
texformat = 0x1;
|
||||
rgbaData = ToI8(img);
|
||||
break;
|
||||
case 2: //IA4
|
||||
texformat = 0x2;
|
||||
rgbaData = ToIA4(img);
|
||||
break;
|
||||
case 3: //IA8
|
||||
texformat = 0x3;
|
||||
rgbaData = ToIA8(img);
|
||||
break;
|
||||
case 4: //RGB565
|
||||
texformat = 0x4;
|
||||
rgbaData = ToRGB565(img);
|
||||
@ -5003,10 +5322,12 @@ namespace Wii
|
||||
texformat = 0x5;
|
||||
rgbaData = ToRGB5A3(img);
|
||||
break;
|
||||
default: //RGBA8 = 6
|
||||
case 6: //RGBA8
|
||||
texformat = 0x6;
|
||||
rgbaData = ToRGBA8(img);
|
||||
break;
|
||||
default:
|
||||
throw new FormatException();
|
||||
}
|
||||
|
||||
byte[] buffer = BitConverter.GetBytes(tplmagic); Array.Reverse(buffer);
|
||||
@ -5241,6 +5562,214 @@ namespace Wii
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts an Image to I4 Tpl data
|
||||
/// </summary>
|
||||
/// <param name="img"></param>
|
||||
/// <returns></returns>
|
||||
public static byte[] ToI4(Bitmap img)
|
||||
{
|
||||
uint[] pixeldata = BitmapToRGBA(img);
|
||||
int w = img.Width;
|
||||
int h = img.Height;
|
||||
int inp = -1;
|
||||
byte[] output = new byte[Tools.AddPadding(w, 8) * Tools.AddPadding(h, 8) / 2];
|
||||
|
||||
for (int y1 = 0; y1 < h; y1 += 8)
|
||||
{
|
||||
for (int x1 = 0; x1 < w; x1 += 8)
|
||||
{
|
||||
for (int y = y1; y < y1 + 8; y++)
|
||||
{
|
||||
for (int x = x1; x < x1 + 8; x += 2)
|
||||
{
|
||||
byte newpixel;
|
||||
|
||||
if (x >= w || y >= h)
|
||||
{
|
||||
newpixel = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint rgba = pixeldata[x + (y * w)];
|
||||
|
||||
uint Red = (rgba >> 0) & 0xff;
|
||||
uint Green = (rgba >> 8) & 0xff;
|
||||
uint Blue = (rgba >> 16) & 0xff;
|
||||
|
||||
uint Intensity1 = ((Red + Green + Blue) / 3) & 0xff;
|
||||
|
||||
rgba = pixeldata[x + (y * w) + 1];
|
||||
|
||||
Red = (rgba >> 0) & 0xff;
|
||||
Green = (rgba >> 8) & 0xff;
|
||||
Blue = (rgba >> 16) & 0xff;
|
||||
|
||||
uint Intensity2 = ((Red + Green + Blue) / 3) & 0xff;
|
||||
|
||||
newpixel = (byte)((((Intensity1 * 15) / 255) << 4) | (((Intensity2 * 15) / 255) & 0xf));
|
||||
}
|
||||
|
||||
output[++inp] = newpixel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts an Image to I8 Tpl data
|
||||
/// </summary>
|
||||
/// <param name="img"></param>
|
||||
/// <returns></returns>
|
||||
public static byte[] ToI8(Bitmap img)
|
||||
{
|
||||
uint[] pixeldata = BitmapToRGBA(img);
|
||||
int w = img.Width;
|
||||
int h = img.Height;
|
||||
int inp = -1;
|
||||
byte[] output = new byte[Tools.AddPadding(w, 8) * Tools.AddPadding(h, 4)];
|
||||
|
||||
for (int y1 = 0; y1 < h; y1 += 4)
|
||||
{
|
||||
for (int x1 = 0; x1 < w; x1 += 8)
|
||||
{
|
||||
for (int y = y1; y < y1 + 4; y++)
|
||||
{
|
||||
for (int x = x1; x < x1 + 8; x++)
|
||||
{
|
||||
byte newpixel;
|
||||
|
||||
if (x >= w || y >= h)
|
||||
{
|
||||
newpixel = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint rgba = pixeldata[x + (y * w)];
|
||||
|
||||
uint Red = (rgba >> 0) & 0xff;
|
||||
uint Green = (rgba >> 8) & 0xff;
|
||||
uint Blue = (rgba >> 16) & 0xff;
|
||||
|
||||
newpixel = (byte)(((Red + Green + Blue) / 3) & 0xff);
|
||||
}
|
||||
|
||||
output[++inp] = newpixel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts an Image to IA4 Tpl data
|
||||
/// </summary>
|
||||
/// <param name="img"></param>
|
||||
/// <returns></returns>
|
||||
public static byte[] ToIA4(Bitmap img)
|
||||
{
|
||||
uint[] pixeldata = BitmapToRGBA(img);
|
||||
int w = img.Width;
|
||||
int h = img.Height;
|
||||
int inp = -1;
|
||||
byte[] output = new byte[Tools.AddPadding(w, 8) * Tools.AddPadding(h, 4)];
|
||||
|
||||
for (int y1 = 0; y1 < h; y1 += 4)
|
||||
{
|
||||
for (int x1 = 0; x1 < w; x1 += 8)
|
||||
{
|
||||
for (int y = y1; y < y1 + 4; y++)
|
||||
{
|
||||
for (int x = x1; x < x1 + 8; x++)
|
||||
{
|
||||
byte newpixel;
|
||||
|
||||
if (x >= w || y >= h)
|
||||
{
|
||||
newpixel = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint rgba = pixeldata[x + (y * w)];
|
||||
|
||||
uint Red = (rgba >> 0) & 0xff;
|
||||
uint Green = (rgba >> 8) & 0xff;
|
||||
uint Blue = (rgba >> 16) & 0xff;
|
||||
|
||||
uint Intensity = ((Red + Green + Blue) / 3) & 0xff;
|
||||
uint Alpha = (rgba >> 24) & 0xff;
|
||||
|
||||
newpixel = (byte)((((Intensity * 15) / 255) & 0xf) | (((Alpha * 15) / 255) << 4));
|
||||
}
|
||||
|
||||
output[++inp] = newpixel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts an Image to IA8 Tpl data
|
||||
/// </summary>
|
||||
/// <param name="img"></param>
|
||||
/// <returns></returns>
|
||||
public static byte[] ToIA8(Bitmap img)
|
||||
{
|
||||
uint[] pixeldata = BitmapToRGBA(img);
|
||||
int w = img.Width;
|
||||
int h = img.Height;
|
||||
int inp = -1;
|
||||
byte[] output = new byte[Tools.AddPadding(w, 4) * Tools.AddPadding(h, 4) * 2];
|
||||
|
||||
for (int y1 = 0; y1 < h; y1 += 4)
|
||||
{
|
||||
for (int x1 = 0; x1 < w; x1 += 4)
|
||||
{
|
||||
for (int y = y1; y < y1 + 4; y++)
|
||||
{
|
||||
for (int x = x1; x < x1 + 4; x++)
|
||||
{
|
||||
UInt16 newpixel;
|
||||
|
||||
if (x >= w || y >= h)
|
||||
{
|
||||
newpixel = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint rgba = pixeldata[x + (y * w)];
|
||||
|
||||
uint Red = (rgba >> 0) & 0xff;
|
||||
uint Green = (rgba >> 8) & 0xff;
|
||||
uint Blue = (rgba >> 16) & 0xff;
|
||||
|
||||
uint Intensity = ((Red + Green + Blue) / 3) & 0xff;
|
||||
uint Alpha = (rgba >> 24) & 0xff;
|
||||
|
||||
newpixel = (ushort)((Intensity << 8) | Alpha);
|
||||
}
|
||||
|
||||
byte[] temp = BitConverter.GetBytes(newpixel);
|
||||
Array.Reverse(temp);
|
||||
|
||||
output[++inp] = temp[0];
|
||||
output[++inp] = temp[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
||||
public class NAND
|
||||
@ -5738,15 +6267,19 @@ namespace Wii
|
||||
}
|
||||
|
||||
//Lets also get brlan tpls (frame animations)
|
||||
string[] brlanTpls = GetBrlanTpls(brlan);
|
||||
foreach (string thisTpl in brlanTpls)
|
||||
try
|
||||
{
|
||||
if (thisTpl.EndsWith(".tpl"))
|
||||
string[] brlanTpls = GetBrlanTpls(brlan);
|
||||
foreach (string thisTpl in brlanTpls)
|
||||
{
|
||||
if (!Tpls.Contains(thisTpl))
|
||||
Tpls.Add(thisTpl);
|
||||
if (thisTpl.EndsWith(".tpl"))
|
||||
{
|
||||
if (!Tpls.Contains(thisTpl))
|
||||
Tpls.Add(thisTpl);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { } //If it throws any error, it's probably an empty brlan
|
||||
|
||||
return Tpls.ToArray();
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace ForwardMii
|
||||
{
|
||||
public class ForwardMii_Plugin
|
||||
{
|
||||
const string version = "1.1"; //Hint for myself: Never use a char in the Version (UpdateCheck)!
|
||||
const string version = "1.2"; //Hint for myself: Never use a char in the Version (UpdateCheck)!
|
||||
|
||||
public static string GetVersion()
|
||||
{
|
||||
|
@ -29,50 +29,49 @@ namespace ForwardMii
|
||||
public class GXForwarder
|
||||
{
|
||||
private readonly string TempDir = Path.GetTempPath() + "ForwardMii_Temp\\" + Guid.NewGuid() + "\\";
|
||||
private string path1;
|
||||
private string path2;
|
||||
private string path3;
|
||||
private string path4;
|
||||
private bool[] packs = new bool[] { false, false, false };
|
||||
private string[] paths = new string[16]; //Maximum 16 Paths
|
||||
private string image43;
|
||||
private string image169;
|
||||
public string Path1 { get { return path1; } set { path1 = value; } }
|
||||
public string Path2 { get { return path2; } set { path2 = value; } }
|
||||
public string Path3 { get { return path3; } set { path3 = value; } }
|
||||
public string Path4 { get { return path4; } set { path4 = value; } }
|
||||
public string Image43 { get { return image43; } set { image43 = value; } }
|
||||
public string Image169 { get { return image169; } set { image169 = value; } }
|
||||
public string[] Paths { get { return paths; } set { paths = value; } }
|
||||
public bool[] Packs { get { return packs; } set { packs = value; } }
|
||||
|
||||
public GXForwarder()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public GXForwarder(params string[] paths)
|
||||
public GXForwarder(params string[] forwardPaths)
|
||||
{
|
||||
if (ForwardMii_Plugin.CheckDevKit() == false) throw new Exception("DevkitPro or one of it's components wasn't found!");
|
||||
path1 = paths[0];
|
||||
path2 = paths[1];
|
||||
path3 = paths[2];
|
||||
path4 = paths[3];
|
||||
for (int i = 0; i < forwardPaths.Length; i++)
|
||||
paths[i] = forwardPaths[i];
|
||||
}
|
||||
|
||||
public GXForwarder(string Image43, string Image169, params string[] paths)
|
||||
public GXForwarder(string Image43, string Image169, params string[] forwardPaths)
|
||||
{
|
||||
if (ForwardMii_Plugin.CheckDevKit() == false) throw new Exception("DevkitPro or one of it's components wasn't found!");
|
||||
path1 = paths[0];
|
||||
path2 = paths[1];
|
||||
path3 = paths[2];
|
||||
path4 = paths[3];
|
||||
image43 = Image43;
|
||||
image169 = Image169;
|
||||
for (int i = 0; i < forwardPaths.Length; i++)
|
||||
paths[i] = forwardPaths[i];
|
||||
}
|
||||
|
||||
public void SetPath(int pathNum, string forwardPath)
|
||||
{
|
||||
paths[pathNum] = forwardPath;
|
||||
}
|
||||
|
||||
public string GetPath(int pathNum)
|
||||
{
|
||||
return paths[pathNum];
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
path1 = string.Empty;
|
||||
path2 = string.Empty;
|
||||
path3 = string.Empty;
|
||||
path4 = string.Empty;
|
||||
for (int i = 0; i < paths.Length; i++) paths[i] = string.Empty;
|
||||
image43 = string.Empty;
|
||||
image169 = string.Empty;
|
||||
}
|
||||
@ -116,7 +115,12 @@ namespace ForwardMii
|
||||
CopyResources();
|
||||
EditMainCpp();
|
||||
CopyImages();
|
||||
if (Compile() == false) throw new Exception("An error occured during compiling!");
|
||||
if (Compile() == false)
|
||||
{
|
||||
try { Directory.Delete(TempDir, true); }
|
||||
catch { }
|
||||
throw new Exception("An error occured during compiling!\nYou may try the libogc from the CustomizeMii download page...");
|
||||
}
|
||||
byte[] fileTemp = File.ReadAllBytes(TempDir + "boot.dol");
|
||||
|
||||
try { Directory.Delete(TempDir, true); }
|
||||
@ -224,6 +228,13 @@ namespace ForwardMii
|
||||
|
||||
private void EditMainCpp()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(paths[4]) && !string.IsNullOrEmpty(paths[5]) &&
|
||||
!string.IsNullOrEmpty(paths[6]) && !string.IsNullOrEmpty(paths[7])) packs[0] = true;
|
||||
if (!string.IsNullOrEmpty(paths[8]) && !string.IsNullOrEmpty(paths[9]) &&
|
||||
!string.IsNullOrEmpty(paths[10]) && !string.IsNullOrEmpty(paths[11])) packs[1] = true;
|
||||
if (!string.IsNullOrEmpty(paths[12]) && !string.IsNullOrEmpty(paths[13]) &&
|
||||
!string.IsNullOrEmpty(paths[14]) && !string.IsNullOrEmpty(paths[15])) packs[2] = true;
|
||||
|
||||
Stream maincpp = GetReourceStream("main.cpp");
|
||||
StreamReader reader = new StreamReader(maincpp);
|
||||
List<string> tempLines = new List<string>();
|
||||
@ -239,13 +250,58 @@ namespace ForwardMii
|
||||
for (int i = 0; i < lines.Length; i++)
|
||||
{
|
||||
if (lines[i].Contains("---path1---"))
|
||||
lines[i] = lines[i].Replace("---path1---", path1);
|
||||
lines[i] = lines[i].Replace("---path1---", paths[0]);
|
||||
else if (lines[i].Contains("---path2---"))
|
||||
lines[i] = lines[i].Replace("---path2---", path2);
|
||||
lines[i] = lines[i].Replace("---path2---", paths[1]);
|
||||
else if (lines[i].Contains("---path3---"))
|
||||
lines[i] = lines[i].Replace("---path3---", path3);
|
||||
lines[i] = lines[i].Replace("---path3---", paths[2]);
|
||||
else if (lines[i].Contains("---path4---"))
|
||||
lines[i] = lines[i].Replace("---path4---", path4);
|
||||
lines[i] = lines[i].Replace("---path4---", paths[3]);
|
||||
|
||||
if (packs[0])
|
||||
{
|
||||
if (lines[i].Contains("PACK2"))
|
||||
lines[i] = lines[i].Replace("false", "true");
|
||||
|
||||
if (lines[i].Contains("---path5---"))
|
||||
lines[i] = lines[i].Replace("---path5---", paths[4]);
|
||||
else if (lines[i].Contains("---path6---"))
|
||||
lines[i] = lines[i].Replace("---path6---", paths[5]);
|
||||
else if (lines[i].Contains("---path7---"))
|
||||
lines[i] = lines[i].Replace("---path7---", paths[6]);
|
||||
else if (lines[i].Contains("---path8---"))
|
||||
lines[i] = lines[i].Replace("---path8---", paths[7]);
|
||||
}
|
||||
|
||||
if (packs[1])
|
||||
{
|
||||
if (lines[i].Contains("PACK3"))
|
||||
lines[i] = lines[i].Replace("false", "true");
|
||||
|
||||
if (lines[i].Contains("---path9---"))
|
||||
lines[i] = lines[i].Replace("---path9---", paths[8]);
|
||||
else if (lines[i].Contains("---path10---"))
|
||||
lines[i] = lines[i].Replace("---path10---", paths[9]);
|
||||
else if (lines[i].Contains("---path11---"))
|
||||
lines[i] = lines[i].Replace("---path11---", paths[10]);
|
||||
else if (lines[i].Contains("---path12---"))
|
||||
lines[i] = lines[i].Replace("---path12---", paths[11]);
|
||||
}
|
||||
|
||||
if (packs[2])
|
||||
{
|
||||
if (lines[i].Contains("PACK4"))
|
||||
lines[i] = lines[i].Replace("false", "true");
|
||||
|
||||
if (lines[i].Contains("---path13---"))
|
||||
lines[i] = lines[i].Replace("---path13---", paths[12]);
|
||||
else if (lines[i].Contains("---path14---"))
|
||||
lines[i] = lines[i].Replace("---path14---", paths[13]);
|
||||
else if (lines[i].Contains("---path15---"))
|
||||
lines[i] = lines[i].Replace("---path15---", paths[14]);
|
||||
else if (lines[i].Contains("---path16---"))
|
||||
lines[i] = lines[i].Replace("---path16---", paths[15]);
|
||||
}
|
||||
}
|
||||
|
||||
using (FileStream fs = new FileStream(TempDir + "source\\main.cpp", FileMode.Create))
|
||||
@ -284,13 +340,6 @@ namespace ForwardMii
|
||||
byte[] temp = new byte[theStream.Length];
|
||||
theStream.Read(temp, 0, temp.Length);
|
||||
fs.Write(temp, 0, temp.Length);
|
||||
|
||||
//int count = 0;
|
||||
//int length = 4096;
|
||||
//byte[] buffer = new byte[length];
|
||||
|
||||
//while ((count = theStream.Read(buffer, 0, length)) != 0)
|
||||
// fs.Write(buffer, 0, length);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -49,5 +49,5 @@ using System.Runtime.InteropServices;
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.2.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.2.0")]
|
||||
[assembly: AssemblyVersion("1.2.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.2.0.0")]
|
||||
|
@ -40,13 +40,31 @@
|
||||
#include "fatmounter.h"
|
||||
|
||||
/*edit these*/
|
||||
#define USB_FIRST false
|
||||
#define ELF_FIRST false
|
||||
#define PATH1 "---path1---"
|
||||
#define PATH2 "---path2---"
|
||||
#define PATH3 "---path3---"
|
||||
#define PATH4 "---path4---"
|
||||
|
||||
#define SD_DOL "---path1---"
|
||||
#define SD_ELF "---path2---"
|
||||
#define USB_DOL "---path3---"
|
||||
#define USB_ELF "---path4---"
|
||||
#define PACK2 false
|
||||
|
||||
#define PATH5 "---path5---"
|
||||
#define PATH6 "---path6---"
|
||||
#define PATH7 "---path7---"
|
||||
#define PATH8 "---path8---"
|
||||
|
||||
#define PACK3 false
|
||||
|
||||
#define PATH9 "---path9---"
|
||||
#define PATH10 "---path10---"
|
||||
#define PATH11 "---path11---"
|
||||
#define PATH12 "---path12---"
|
||||
|
||||
#define PACK4 false
|
||||
|
||||
#define PATH13 "---path13---"
|
||||
#define PATH14 "---path14---"
|
||||
#define PATH15 "---path15---"
|
||||
#define PATH16 "---path16---"
|
||||
|
||||
static PNGUPROP imgProp;
|
||||
static IMGCTX ctx;
|
||||
@ -99,7 +117,6 @@ int main(int argc, char **argv)
|
||||
int exeSize = 0;
|
||||
u32 exeEntryPointAddress = 0;
|
||||
entrypoint exeEntryPoint;
|
||||
char cfgpath[256], first[256], second[256], third[256], fourth[256];
|
||||
|
||||
/* int videomod */
|
||||
InitVideo();
|
||||
@ -113,58 +130,103 @@ int main(int argc, char **argv)
|
||||
Menu_Render();
|
||||
}
|
||||
|
||||
/*set order*/
|
||||
if (USB_FIRST && ELF_FIRST)
|
||||
{
|
||||
sprintf(first, USB_ELF);
|
||||
sprintf(second, USB_DOL);
|
||||
sprintf(third, SD_ELF);
|
||||
sprintf(fourth, SD_DOL);
|
||||
}
|
||||
else if (USB_FIRST)
|
||||
{
|
||||
sprintf(first, USB_DOL);
|
||||
sprintf(second, USB_ELF);
|
||||
sprintf(third, SD_DOL);
|
||||
sprintf(fourth, SD_ELF);
|
||||
}
|
||||
else if (ELF_FIRST)
|
||||
{
|
||||
sprintf(first, SD_ELF);
|
||||
sprintf(second, SD_DOL);
|
||||
sprintf(third, USB_ELF);
|
||||
sprintf(fourth, USB_DOL);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(first, SD_DOL);
|
||||
sprintf(second, SD_ELF);
|
||||
sprintf(third, USB_DOL);
|
||||
sprintf(fourth, USB_ELF);
|
||||
}
|
||||
|
||||
/* check devices */
|
||||
SDCard_Init();
|
||||
USBDevice_Init();
|
||||
|
||||
char cfgpath[256];
|
||||
|
||||
/* Open dol File and check exist */
|
||||
sprintf(cfgpath, first);
|
||||
sprintf(cfgpath, PATH1);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, second);
|
||||
sprintf(cfgpath, PATH2);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, third);
|
||||
sprintf(cfgpath, PATH3);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, fourth);
|
||||
sprintf(cfgpath, PATH4);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
|
||||
if (PACK2)
|
||||
{
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, PATH5);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, PATH6);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, PATH7);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, PATH8);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
}
|
||||
|
||||
if (PACK3)
|
||||
{
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, PATH9);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, PATH10);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, PATH11);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, PATH12);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
}
|
||||
|
||||
if (PACK4)
|
||||
{
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, PATH13);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, PATH14);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, PATH15);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
if (exeFile==NULL)
|
||||
{
|
||||
sprintf(cfgpath, PATH16);
|
||||
exeFile = fopen (cfgpath ,"rb");
|
||||
}
|
||||
}
|
||||
|
||||
// if nothing found exiting
|
||||
if (exeFile==NULL) {
|
||||
printf("\n\n\t\tCan't find DOL File...\n");
|
||||
|
Loading…
Reference in New Issue
Block a user