Compare commits

...

No commits in common. "master" and "TransmitMii" have entirely different histories.

136 changed files with 1278 additions and 25793 deletions

View File

@ -1,44 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomizeMii", "CustomizeMii\CustomizeMii.csproj", "{46B7F0BC-101B-4167-95AD-4C5D78AA0A20}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ForwardMii", "ForwardMii\ForwardMii.csproj", "{20CB2CA7-6767-4758-97FA-97395F47CD6B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomizeMiiInstaller", "CustomizeMiiInstaller\CustomizeMiiInstaller.csproj", "{475F3ADF-B529-449F-89DA-BA5E8BE15DD5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{46B7F0BC-101B-4167-95AD-4C5D78AA0A20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46B7F0BC-101B-4167-95AD-4C5D78AA0A20}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46B7F0BC-101B-4167-95AD-4C5D78AA0A20}.Debug|x86.ActiveCfg = Debug|x86
{46B7F0BC-101B-4167-95AD-4C5D78AA0A20}.Debug|x86.Build.0 = Debug|x86
{46B7F0BC-101B-4167-95AD-4C5D78AA0A20}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46B7F0BC-101B-4167-95AD-4C5D78AA0A20}.Release|Any CPU.Build.0 = Release|Any CPU
{46B7F0BC-101B-4167-95AD-4C5D78AA0A20}.Release|x86.ActiveCfg = Release|x86
{46B7F0BC-101B-4167-95AD-4C5D78AA0A20}.Release|x86.Build.0 = Release|x86
{20CB2CA7-6767-4758-97FA-97395F47CD6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20CB2CA7-6767-4758-97FA-97395F47CD6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20CB2CA7-6767-4758-97FA-97395F47CD6B}.Debug|x86.ActiveCfg = Debug|x86
{20CB2CA7-6767-4758-97FA-97395F47CD6B}.Debug|x86.Build.0 = Debug|x86
{20CB2CA7-6767-4758-97FA-97395F47CD6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20CB2CA7-6767-4758-97FA-97395F47CD6B}.Release|Any CPU.Build.0 = Release|Any CPU
{20CB2CA7-6767-4758-97FA-97395F47CD6B}.Release|x86.ActiveCfg = Release|x86
{20CB2CA7-6767-4758-97FA-97395F47CD6B}.Release|x86.Build.0 = Release|x86
{475F3ADF-B529-449F-89DA-BA5E8BE15DD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{475F3ADF-B529-449F-89DA-BA5E8BE15DD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{475F3ADF-B529-449F-89DA-BA5E8BE15DD5}.Debug|x86.ActiveCfg = Debug|Any CPU
{475F3ADF-B529-449F-89DA-BA5E8BE15DD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{475F3ADF-B529-449F-89DA-BA5E8BE15DD5}.Release|Any CPU.Build.0 = Release|Any CPU
{475F3ADF-B529-449F-89DA-BA5E8BE15DD5}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1,834 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Windows.Forms;
using libWiiSharp;
namespace CustomizeMii
{
partial class CustomizeMii_Main
{
private TransmitInfo transmitInfo;
private WadCreationInfo wadCreationInfo;
private bool internalSound;
private WAD sourceWad = new WAD();
private U8 bannerBin = new U8();
private U8 newBannerBin = new U8();
private U8 iconBin = new U8();
private U8 newIconBin = new U8();
private byte[] newSoundBin = new byte[0];
private byte[] newDol = new byte[0];
private string replacedBanner = string.Empty;
private string replacedIcon = string.Empty;
private string replacedSound = string.Empty;
void bwBannerReplace_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
currentProgress.progressValue = 100;
currentProgress.progressState = " ";
this.Invoke(ProgressUpdate);
setControlText(tbReplace, replacedBanner);
}
void bwBannerReplace_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
currentProgress.progressValue = e.ProgressPercentage;
currentProgress.progressState = (string)e.UserState;
this.Invoke(ProgressUpdate);
}
void bwBannerReplace_DoWork(object sender, DoWorkEventArgs e)
{
try
{
BackgroundWorker bwBannerReplace = sender as BackgroundWorker;
replacedBanner = (string)e.Argument;
if (replacedBanner.ToLower().EndsWith(".bin"))
{
bwBannerReplace.ReportProgress(0, "Loading banner.bin...");
newBannerBin.LoadFile(replacedBanner);
}
else if (replacedBanner.ToLower().EndsWith(".app"))
{
bwBannerReplace.ReportProgress(0, "Loading 00000000.app...");
U8 tmpU8 = U8.Load(replacedBanner);
bwBannerReplace.ReportProgress(50, "Loading banner.bin...");
for (int i = 0; i < tmpU8.NumOfNodes; i++)
if (tmpU8.StringTable[i].ToLower() == "banner.bin")
{ newBannerBin.LoadFile(tmpU8.Data[i]); break; }
}
else //wad
{
bwBannerReplace.ReportProgress(0, "Loading WAD...");
WAD tmpWad = WAD.Load(replacedBanner);
if (!tmpWad.HasBanner)
throw new Exception("CustomizeMii only handles Channel WADs!");
bwBannerReplace.ReportProgress(60, "Loading banner.bin...");
for (int i = 0; i < tmpWad.BannerApp.NumOfNodes; i++)
if (tmpWad.BannerApp.StringTable[i].ToLower() == "banner.bin")
{ newBannerBin.LoadFile(tmpWad.BannerApp.Data[i]); break; }
}
bannerTransparents.Clear();
addTpls();
addBrlyts();
addBrlans();
}
catch (Exception ex)
{
replacedBanner = string.Empty;
errorBox(ex.Message);
}
}
void bwIconReplace_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
currentProgress.progressValue = 100;
currentProgress.progressState = " ";
this.Invoke(ProgressUpdate);
setControlText(tbReplace, replacedIcon);
}
void bwIconReplace_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
currentProgress.progressValue = e.ProgressPercentage;
currentProgress.progressState = (string)e.UserState;
this.Invoke(ProgressUpdate);
}
void bwIconReplace_DoWork(object sender, DoWorkEventArgs e)
{
try
{
BackgroundWorker bwIconReplace = sender as BackgroundWorker;
replacedIcon = (string)e.Argument;
bwIconReplace.ReportProgress(0);
if (replacedIcon.ToLower().EndsWith(".bin"))
{
bwIconReplace.ReportProgress(0, "Loading icon.bin...");
newIconBin.LoadFile(replacedIcon);
}
else if (replacedIcon.ToLower().EndsWith(".app"))
{
bwIconReplace.ReportProgress(0, "Loading 00000000.app...");
U8 tmpU8 = U8.Load(replacedIcon);
bwIconReplace.ReportProgress(50, "Loading icon.bin...");
for (int i = 0; i < tmpU8.NumOfNodes; i++)
if (tmpU8.StringTable[i].ToLower() == "icon.bin")
{ newIconBin.LoadFile(tmpU8.Data[i]); break; }
}
else //wad
{
bwIconReplace.ReportProgress(0, "Loading WAD...");
WAD tmpWad = WAD.Load(replacedIcon);
if (!tmpWad.HasBanner)
throw new Exception("CustomizeMii only handles Channel WADs!");
bwIconReplace.ReportProgress(60, "Loading icon.bin...");
for (int i = 0; i < tmpWad.BannerApp.NumOfNodes; i++)
if (tmpWad.BannerApp.StringTable[i].ToLower() == "icon.bin")
{ newIconBin.LoadFile(tmpWad.BannerApp.Data[i]); break; }
}
iconTransparents.Clear();
addTpls();
addBrlyts();
addBrlans();
}
catch (Exception ex)
{
replacedIcon = string.Empty;
errorBox(ex.Message);
}
}
void bwSoundReplace_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
currentProgress.progressValue = 100;
currentProgress.progressState = " ";
this.Invoke(ProgressUpdate);
setControlText(tbReplace, replacedSound);
}
void bwSoundReplace_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
currentProgress.progressValue = e.ProgressPercentage;
currentProgress.progressState = (string)e.UserState;
this.Invoke(ProgressUpdate);
}
void bwSoundReplace_DoWork(object sender, DoWorkEventArgs e)
{
try
{
BackgroundWorker bwSoundReplace = sender as BackgroundWorker;
replacedSound = (string)e.Argument;
bwSoundReplace.ReportProgress(0);
if (replacedSound.ToLower().EndsWith(".bin"))
{
bwSoundReplace.ReportProgress(0, "Loading sound.bin...");
newSoundBin = File.ReadAllBytes(replacedSound);
}
else if (replacedSound.ToLower().EndsWith(".app"))
{
bwSoundReplace.ReportProgress(0, "Loading 00000000.app...");
U8 tmpU8 = U8.Load(replacedSound);
bwSoundReplace.ReportProgress(80, "Loading sound.bin...");
for (int i = 0; i < tmpU8.NumOfNodes; i++)
if (tmpU8.StringTable[i].ToLower() == "sound.bin")
{ newSoundBin = tmpU8.Data[i]; break; }
}
else
{
bwSoundReplace.ReportProgress(0, "Loading WAD...");
WAD tmpWad = WAD.Load(replacedSound);
if (!tmpWad.HasBanner)
throw new Exception("CustomizeMii only handles Channel WADs!");
bwSoundReplace.ReportProgress(90, "Loading sound.bin...");
for (int i = 0; i < tmpWad.BannerApp.NumOfNodes; i++)
if (tmpWad.BannerApp.StringTable[i].ToLower() == "sound.bin")
{ newSoundBin = tmpWad.BannerApp.Data[i]; break; }
}
}
catch (Exception ex)
{
replacedSound = string.Empty;
errorBox(ex.Message);
}
}
void bwConvertToBns_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (!string.IsNullOrEmpty(replacedSound))
{
if (internalSound == true)
setControlText(tbSound, "BNS: Internal Sound");
else
setControlText(tbSound, "BNS: " + replacedSound);
btnBrowseSound.Text = "Clear";
if (cmbReplace.SelectedIndex == 2) setControlText(tbReplace, string.Empty);
}
currentProgress.progressValue = 100;
currentProgress.progressState = " ";
this.Invoke(ProgressUpdate);
}
void bwConvertToBns_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
currentProgress.progressValue = e.ProgressPercentage;
if (!string.IsNullOrEmpty((string)e.UserState)) currentProgress.progressState = (string)e.UserState;
this.Invoke(ProgressUpdate);
}
void bns_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
currentProgress.progressValue = e.ProgressPercentage;
this.Invoke(ProgressUpdate);
}
void bwConvertToBns_DoWork(object sender, DoWorkEventArgs e)
{
try
{
BackgroundWorker bwConvertToBns = sender as BackgroundWorker;
BnsConversionInfo bnsInfo = (BnsConversionInfo)e.Argument;
byte[] audioData = new byte[0];
if (bnsInfo.audioFile.ToLower() == "internal sound")
{
for (int i = 0; i < sourceWad.BannerApp.NumOfNodes; i++)
{
if (sourceWad.BannerApp.StringTable[i].ToLower() == "sound.bin")
audioData = Headers.IMD5.RemoveHeader(sourceWad.BannerApp.Data[i]);
}
internalSound = true;
}
else
audioData = File.ReadAllBytes(bnsInfo.audioFile);
bool mp3 = bnsInfo.audioFile.EndsWith(".mp3");
if (mp3 && bnsInfo.loopType == BnsConversionInfo.LoopType.FromWave) bnsInfo.loopType = BnsConversionInfo.LoopType.None;
if (mp3)
{
bwConvertToBns.ReportProgress(0, "Converting MP3...");
ProcessStartInfo lameI = new ProcessStartInfo(Application.StartupPath + Path.DirectorySeparatorChar + "lame.exe",
string.Format("--decode \"{0}\" \"{1}\"", bnsInfo.audioFile, Application.StartupPath + Path.DirectorySeparatorChar + "customizemii_temp.wav"));
lameI.CreateNoWindow = true;
lameI.UseShellExecute = false;
lameI.RedirectStandardError = true;
Process lame = Process.Start(lameI);
string thisLine = string.Empty;
while (lame.HasExited == false)
{
thisLine = lame.StandardError.ReadLine();
if (!string.IsNullOrEmpty(thisLine))
{
if (thisLine.StartsWith("Frame#"))
{
string thisFrame = thisLine.Remove(thisLine.IndexOf('/'));
thisFrame = thisFrame.Remove(0, thisFrame.LastIndexOf(' ') + 1);
string Frames = thisLine.Remove(0, thisLine.IndexOf('/') + 1);
Frames = Frames.Remove(Frames.IndexOf(' '));
int thisProgress = (int)((Convert.ToDouble(thisFrame) / Convert.ToDouble(Frames)) * 100);
bwConvertToBns.ReportProgress(thisProgress);
}
}
}
lame.WaitForExit();
lame.Close();
if (File.Exists(Application.StartupPath + Path.DirectorySeparatorChar + "customizemii_temp.wav"))
{
audioData = File.ReadAllBytes(Application.StartupPath + Path.DirectorySeparatorChar + "customizemii_temp.wav");
File.Delete(Application.StartupPath + Path.DirectorySeparatorChar + "customizemii_temp.wav");
}
else throw new Exception("Error converting MP3...");
}
bwConvertToBns.ReportProgress(0, "Converting to BNS...");
BNS bns = new BNS(audioData, bnsInfo.loopType == BnsConversionInfo.LoopType.FromWave);
bns.Progress += new EventHandler<ProgressChangedEventArgs>(bns_ProgressChanged);
bns.StereoToMono = bnsInfo.stereoToMono;
bns.Convert();
if (bnsInfo.loopType == BnsConversionInfo.LoopType.Manual && bnsInfo.loopStartSample > -1 && bnsInfo.loopStartSample < bns.TotalSampleCount)
bns.SetLoop(bnsInfo.loopStartSample);
newSoundBin = Headers.IMD5.AddHeader(bns.ToByteArray());
replacedSound = bnsInfo.audioFile;
}
catch (Exception ex)
{
replacedSound = string.Empty;
if (File.Exists(Application.StartupPath + Path.DirectorySeparatorChar + "customizemii_temp.wav")) File.Delete(Application.StartupPath + Path.DirectorySeparatorChar + "customizemii_temp.wav");
errorBox("Error during conversion:\n" + ex.Message);
}
}
void bwConvertMp3_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (!string.IsNullOrEmpty(replacedSound))
{
setControlText(tbSound, replacedSound);
btnBrowseSound.Text = "Clear";
if (cmbReplace.SelectedIndex == 2) setControlText(tbReplace, string.Empty);
}
currentProgress.progressValue = 100;
currentProgress.progressState = " ";
this.Invoke(ProgressUpdate);
}
void bwConvertMp3_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
currentProgress.progressValue = e.ProgressPercentage;
currentProgress.progressState = (string)e.UserState;
this.Invoke(ProgressUpdate);
}
void bwConvertMp3_DoWork(object sender, DoWorkEventArgs e)
{
try
{
BackgroundWorker bwConvertMp3 = sender as BackgroundWorker;
ProcessStartInfo lameI = new ProcessStartInfo(Application.StartupPath + Path.DirectorySeparatorChar + "lame.exe",
string.Format("--decode \"{0}\" \"{1}\"", e.Argument, Application.StartupPath + Path.DirectorySeparatorChar + "customizemii_temp.wav"));
lameI.CreateNoWindow = true;
lameI.UseShellExecute = false;
lameI.RedirectStandardError = true;
Process lame = Process.Start(lameI);
string thisLine = string.Empty;
while (lame.HasExited == false)
{
thisLine = lame.StandardError.ReadLine();
if (!string.IsNullOrEmpty(thisLine))
{
if (thisLine.StartsWith("Frame#"))
{
string thisFrame = thisLine.Remove(thisLine.IndexOf('/'));
thisFrame = thisFrame.Remove(0, thisFrame.LastIndexOf(' ') + 1);
string Frames = thisLine.Remove(0, thisLine.IndexOf('/') + 1);
Frames = Frames.Remove(Frames.IndexOf(' '));
int thisProgress = (int)((Convert.ToDouble(thisFrame) / Convert.ToDouble(Frames)) * 100);
bwConvertMp3.ReportProgress(thisProgress, "Converting MP3...");
}
}
}
lame.WaitForExit();
lame.Close();
if (File.Exists(Application.StartupPath + Path.DirectorySeparatorChar + "customizemii_temp.wav"))
{
newSoundBin = Headers.IMD5.AddHeader(File.ReadAllBytes(Application.StartupPath + Path.DirectorySeparatorChar + "customizemii_temp.wav"));
File.Delete(Application.StartupPath + Path.DirectorySeparatorChar + "customizemii_temp.wav");
replacedSound = (string)e.Argument;
}
}
catch (Exception ex)
{
if (File.Exists(Application.StartupPath + Path.DirectorySeparatorChar + "customizemii_temp.wav")) File.Delete(Application.StartupPath + Path.DirectorySeparatorChar + "customizemii_temp.wav");
replacedSound = string.Empty;
errorBox("Error during conversion:\n" + ex.Message);
}
}
void bwLoadChannel_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
currentProgress.progressValue = 100;
currentProgress.progressState = " ";
this.Invoke(ProgressUpdate);
}
void bwLoadChannel_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
currentProgress.progressValue = e.ProgressPercentage;
currentProgress.progressState = (string)e.UserState;
this.Invoke(ProgressUpdate);
}
void bwLoadChannel_DoWork(object sender, DoWorkEventArgs e)
{
try
{
BackgroundWorker bwLoadChannel = sender as BackgroundWorker;
initialize();
if (e.Argument is string) setControlText(tbSourceWad, (string)e.Argument);
else if (e.Argument is DownloadDataCompletedEventArgs) setControlText(tbSourceWad, (string)((DownloadDataCompletedEventArgs)e.Argument).UserState);
bwLoadChannel.ReportProgress(0, "Loading WAD...");
if (e.Argument is string) sourceWad.LoadFile((string)e.Argument);
else if (e.Argument is DownloadDataCompletedEventArgs) sourceWad.LoadFile(((DownloadDataCompletedEventArgs)e.Argument).Result);
if (!sourceWad.HasBanner)
throw new Exception("CustomizeMii only edits Channel WADs!");
int progressValue = 30;
for (int i = 0; i < sourceWad.BannerApp.NumOfNodes; i++)
{
if (sourceWad.BannerApp.StringTable[i].ToLower() == "banner.bin")
{
progressValue += 20;
bwLoadChannel.ReportProgress(progressValue, "Loading banner.bin...");
bannerBin.LoadFile(sourceWad.BannerApp.Data[i]);
}
else if (sourceWad.BannerApp.StringTable[i].ToLower() == "icon.bin")
{
progressValue += 20;
bwLoadChannel.ReportProgress(progressValue, "Loading icon.bin...");
iconBin.LoadFile(sourceWad.BannerApp.Data[i]);
}
}
bwLoadChannel.ReportProgress(90, "Loading Channel Information...");
setControlText(tbTitleID, sourceWad.UpperTitleID);
setControlText(tbStartupIos, ((int)sourceWad.StartupIOS).ToString());
string[] channelTitles = ((Headers.IMET)sourceWad.BannerApp.Header).GetTitles();
bool allLangs = true;
if (channelTitles[0] != channelTitles[1]) setControlText(tbJapanese, channelTitles[0]);
else allLangs = false;
if (channelTitles[2] != channelTitles[1]) setControlText(tbGerman, channelTitles[2]);
else allLangs = false;
if (channelTitles[3] != channelTitles[1]) setControlText(tbFrench, channelTitles[3]);
else allLangs = false;
if (channelTitles[4] != channelTitles[1]) setControlText(tbSpanish, channelTitles[4]);
else allLangs = false;
if (channelTitles[5] != channelTitles[1]) setControlText(tbItalian, channelTitles[5]);
else allLangs = false;
if (channelTitles[6] != channelTitles[1]) setControlText(tbDutch, channelTitles[6]);
else allLangs = false;
if (channelTitles[7] != channelTitles[1]) setControlText(tbKorean, channelTitles[7]);
if (allLangs) setControlText(tbEnglish, channelTitles[1]);
else setControlText(tbAllLanguages, channelTitles[1]);
bwLoadChannel.ReportProgress(95, "Loading Footer...");
if (sourceWad.CreationTimeUTC > new DateTime(1970, 1, 1))
setControlText(lbCreatedValue, sourceWad.CreationTimeUTC.ToString() + " (UTC)");
else setControlText(lbCreatedValue, "No Timestamp!");
addTpls();
addBrlyts();
addBrlans();
enableControls();
setControlText(btnBrowseSource, "Clear");
}
catch (Exception ex)
{
setControlText(tbSourceWad, string.Empty);
errorBox(ex.Message);
}
}
void bwTransmit_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
currentProgress.progressValue = 100;
currentProgress.progressState = " ";
this.Invoke(ProgressUpdate);
enableControls();
if (transmitInfo.timeElapsed > 0)
{
DialogResult dlg;
if (transmitInfo.compressionRatio > 0)
dlg = MessageBox.Show(
string.Format("Transmitted {0} kB in {1} milliseconds...\nCompression Ratio: {2}%\n\nDo you want to save the wad file?",
transmitInfo.transmittedLength, transmitInfo.timeElapsed, transmitInfo.compressionRatio),
"Save File?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
else
dlg = MessageBox.Show(
string.Format("Transmitted {0} kB in {1} milliseconds...\n\nDo you want to save the wad file?",
transmitInfo.transmittedLength, transmitInfo.timeElapsed),
"Save File?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dlg == DialogResult.Yes)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "Wii Channels|*.wad";
if (!string.IsNullOrEmpty(tbAllLanguages.Text))
sfd.FileName = tbAllLanguages.Text + " - " + tbTitleID.Text.ToUpper() + ".wad";
else
sfd.FileName = tbEnglish.Text + " - " + tbTitleID.Text.ToUpper() + ".wad";
if (sfd.ShowDialog() == DialogResult.OK)
{
if (File.Exists(sfd.FileName)) File.Delete(sfd.FileName);
File.WriteAllBytes(sfd.FileName, wadCreationInfo.wadFile);
}
}
initialize();
}
}
void bwTransmit_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
currentProgress.progressValue = e.ProgressPercentage;
currentProgress.progressState = (string)e.UserState;
this.Invoke(ProgressUpdate);
}
void bwTransmit_DoWork(object sender, DoWorkEventArgs e)
{
try
{
BackgroundWorker bwTransmit = sender as BackgroundWorker;
//Insert wad into stub dol
string fileName = "CMiiInstaller.dol";
byte[] fileData = CustomizeMiiInstaller.InstallerHelper.CreateInstaller(wadCreationInfo.wadFile, (byte)wadCreationInfo.transmitIos).ToArray();
//Transmit installer
Stopwatch transmitTimer = new Stopwatch();
HbcTransmitter transmitter = new HbcTransmitter(wadCreationInfo.transmitProtocol, wadCreationInfo.transmitIp);
transmitter.Progress += new EventHandler<ProgressChangedEventArgs>(transmitter_Progress);
transmitter_Progress(null, new ProgressChangedEventArgs(0, null));
transmitTimer.Start();
bool success = transmitter.TransmitFile(fileName, fileData);
transmitTimer.Stop();
if (!success) errorBox(transmitter.LastError);
else
{
transmitInfo.timeElapsed = (int)transmitTimer.ElapsedMilliseconds;
transmitInfo.compressionRatio = transmitter.CompressionRatio;
transmitInfo.transmittedLength = Math.Round(transmitter.TransmittedLength * 0.0009765625, 2);
}
}
catch (Exception ex) { errorBox(ex.Message); }
}
void transmitter_Progress(object sender, ProgressChangedEventArgs e)
{
currentProgress.progressValue = e.ProgressPercentage;
currentProgress.progressState = "Sending File...";
this.Invoke(ProgressUpdate);
}
void bwCreateWad_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (!wadCreationInfo.sendToWii)
{
currentProgress.progressValue = 100;
currentProgress.progressState = " ";
this.Invoke(ProgressUpdate);
enableControls();
if (wadCreationInfo.success)
initialize();
}
else
{
if (wadCreationInfo.sendWadReady == true)
{
//Start new BackgroundWorker to Transmit
BackgroundWorker bwTransmit = new BackgroundWorker();
bwTransmit.WorkerReportsProgress = true;
bwTransmit.DoWork += new DoWorkEventHandler(bwTransmit_DoWork);
bwTransmit.ProgressChanged += new ProgressChangedEventHandler(bwTransmit_ProgressChanged);
bwTransmit.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwTransmit_RunWorkerCompleted);
bwTransmit.RunWorkerAsync();
}
else
{
currentProgress.progressValue = 100;
currentProgress.progressState = " ";
this.Invoke(ProgressUpdate);
enableControls();
}
}
}
void bwCreateWad_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
currentProgress.progressValue = e.ProgressPercentage;
currentProgress.progressState = (string)e.UserState;
this.Invoke(ProgressUpdate);
}
void bwCreateWad_DoWork(object sender, DoWorkEventArgs e)
{
BackgroundWorker bwCreateWad = sender as BackgroundWorker;
Stopwatch creationTimer = new Stopwatch();
creationTimer.Start();
try
{
WadCreationInfo wadInfo = (WadCreationInfo)e.Argument;
disableControls();
//Check Startup IOS
if (wadInfo.startupIos < 0 || wadInfo.startupIos > 255)
throw new Exception("Startup IOS must be between 0 and 255!");
wadInfo.success = false;
wadInfo.sendWadReady = false;
wadCreationInfo = wadInfo;
//Make TPLs transparent
makeBannerTplsTransparent();
makeIconTplsTransparent();
//Pack icon.bin
bwCreateWad.ReportProgress(0, "Packing icon.bin...");
if (string.IsNullOrEmpty(replacedIcon))
{
iconBin.AddHeaderImd5();
iconBin.Lz77Compress = wadInfo.lz77;
for (int i = 0; i < sourceWad.BannerApp.NumOfNodes; i++)
if (sourceWad.BannerApp.StringTable[i].ToLower() == "icon.bin")
{ sourceWad.BannerApp.ReplaceFile(i, iconBin.ToByteArray()); break; }
}
else
{
newIconBin.AddHeaderImd5();
newIconBin.Lz77Compress = wadInfo.lz77;
for (int i = 0; i < sourceWad.BannerApp.NumOfNodes; i++)
if (sourceWad.BannerApp.StringTable[i].ToLower() == "icon.bin")
{ sourceWad.BannerApp.ReplaceFile(i, newIconBin.ToByteArray()); break; }
}
//Pack banner.bin
bwCreateWad.ReportProgress(20, "Packing banner.bin...");
if (string.IsNullOrEmpty(replacedBanner))
{
bannerBin.AddHeaderImd5();
bannerBin.Lz77Compress = wadInfo.lz77;
for (int i = 0; i < sourceWad.BannerApp.NumOfNodes; i++)
if (sourceWad.BannerApp.StringTable[i].ToLower() == "banner.bin")
{ sourceWad.BannerApp.ReplaceFile(i, bannerBin.ToByteArray()); break; }
}
else
{
newBannerBin.AddHeaderImd5();
bannerBin.Lz77Compress = wadInfo.lz77;
for (int i = 0; i < sourceWad.BannerApp.NumOfNodes; i++)
if (sourceWad.BannerApp.StringTable[i].ToLower() == "banner.bin")
{ sourceWad.BannerApp.ReplaceFile(i, newBannerBin.ToByteArray()); break; }
}
//Pack sound.bin
bwCreateWad.ReportProgress(40, "Packing sound.bin...");
if (!string.IsNullOrEmpty(replacedSound) || !string.IsNullOrEmpty(wadInfo.sound))
{
for (int i = 0; i < sourceWad.BannerApp.NumOfNodes; i++)
if (sourceWad.BannerApp.StringTable[i].ToLower() == "sound.bin")
{ sourceWad.BannerApp.ReplaceFile(i, newSoundBin); break; }
}
//Insert new dol
if (!string.IsNullOrEmpty(wadInfo.dol))
{
bwCreateWad.ReportProgress(50, "Inserting DOL...");
sourceWad.RemoveAllContents();
if (wadInfo.nandLoader == WadCreationInfo.NandLoader.comex)
{
sourceWad.AddContent(Properties.Resources.comex, 1, 1, ContentType.Normal);
if (wadInfo.dol.StartsWith("Simple Forwarder:"))
sourceWad.AddContent(createForwarderSimple(), 2, 2, ContentType.Normal);
else if (wadInfo.dol.StartsWith("Complex Forwarder"))
{
bwCreateWad.ReportProgress(55, "Compiling Forwarder...");
sourceWad.AddContent(createForwarderComplex(), 2, 2, ContentType.Normal);
}
else
sourceWad.AddContent(newDol, 2, 2, ContentType.Normal);
sourceWad.BootIndex = 1;
}
else
{
sourceWad.AddContent(Properties.Resources.Waninkoko, 2, 2, ContentType.Normal);
if (wadInfo.dol.StartsWith("Simple Forwarder:"))
sourceWad.AddContent(createForwarderSimple(), 1, 1, ContentType.Normal);
else if (wadInfo.dol.StartsWith("Complex Forwarder"))
{
bwCreateWad.ReportProgress(55, "Compiling Forwarder...");
sourceWad.AddContent(createForwarderComplex(), 1, 1, ContentType.Normal);
}
else
sourceWad.AddContent(newDol, 1, 1, ContentType.Normal);
sourceWad.BootIndex = 2;
}
}
//Change channel information
for (int i = 0; i < wadInfo.titles.Length; i++)
if (string.IsNullOrEmpty(wadInfo.titles[i]))
wadInfo.titles[i] = wadInfo.allLangTitle;
bwCreateWad.ReportProgress(75, "Updating Channel Information...");
sourceWad.ChangeStartupIOS(wadInfo.startupIos);
sourceWad.ChangeChannelTitles(wadInfo.titles);
if (!string.IsNullOrEmpty(wadInfo.titleId))
sourceWad.ChangeTitleID(LowerTitleID.Channel, wadInfo.titleId);
sourceWad.FakeSign = true;
sourceWad.ChangeTitleKey("GottaGetSomeBeer");
//Pack WAD
bwCreateWad.ReportProgress(80, "Packing WAD...");
if (!wadInfo.sendToWii) sourceWad.Save(wadInfo.outFile);
else wadInfo.wadFile = sourceWad.ToByteArray();
bwCreateWad.ReportProgress(100, " ");
creationTimer.Stop();
if (!wadInfo.sendToWii)
{
FileInfo fi = new FileInfo(wadInfo.outFile);
double fileSize = Math.Round(fi.Length * 0.0009765625 * 0.0009765625, 2);
infoBox(string.Format("Successfully created custom channel!\nTime elapsed: {0} ms\nFilesize: {1} MB\nApprox. Blocks: {2}", creationTimer.ElapsedMilliseconds, fileSize, sourceWad.NandBlocks));
}
else wadInfo.sendWadReady = true;
wadCreationInfo = wadInfo;
wadCreationInfo.success = true;
}
catch (Exception ex)
{
wadCreationInfo.sendWadReady = false;
creationTimer.Stop();
enableControls();
errorBox(ex.Message);
}
}
}
}

View File

@ -1,462 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace CustomizeMii
{
partial class CustomizeMii_BnsConvert
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.btnCancel = new System.Windows.Forms.Button();
this.btnConvert = new System.Windows.Forms.Button();
this.lbAudioFile = new System.Windows.Forms.Label();
this.tbAudioFile = new System.Windows.Forms.TextBox();
this.btnBrowseAudioFile = new System.Windows.Forms.Button();
this.gbLoop = new System.Windows.Forms.GroupBox();
this.tbarLoopStartSample = new System.Windows.Forms.TrackBar();
this.lbStartSample = new System.Windows.Forms.Label();
this.tbLoopStart = new System.Windows.Forms.TextBox();
this.rbEnterManually = new System.Windows.Forms.RadioButton();
this.rbFromAudioFile = new System.Windows.Forms.RadioButton();
this.rbNone = new System.Windows.Forms.RadioButton();
this.gbWaveInfo = new System.Windows.Forms.GroupBox();
this.lbStatusValue = new System.Windows.Forms.Label();
this.lbLoopStartValue = new System.Windows.Forms.Label();
this.lbLoopCountValue = new System.Windows.Forms.Label();
this.lbFormatValue = new System.Windows.Forms.Label();
this.lbChannelCountValue = new System.Windows.Forms.Label();
this.lbSamplerateValue = new System.Windows.Forms.Label();
this.lbBitdepthValue = new System.Windows.Forms.Label();
this.lbStatus = new System.Windows.Forms.Label();
this.lbLoopStart = new System.Windows.Forms.Label();
this.lbLoopCount = new System.Windows.Forms.Label();
this.lbFormat = new System.Windows.Forms.Label();
this.lbChannelCount = new System.Windows.Forms.Label();
this.lbSamplerate = new System.Windows.Forms.Label();
this.lbBitdepth = new System.Windows.Forms.Label();
this.cbSourceSound = new System.Windows.Forms.CheckBox();
this.gbPrelisten = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.btnPlay = new System.Windows.Forms.Button();
this.gbLoop.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tbarLoopStartSample)).BeginInit();
this.gbWaveInfo.SuspendLayout();
this.gbPrelisten.SuspendLayout();
this.SuspendLayout();
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(186, 189);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(160, 23);
this.btnCancel.TabIndex = 10;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnConvert
//
this.btnConvert.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnConvert.Location = new System.Drawing.Point(15, 189);
this.btnConvert.Name = "btnConvert";
this.btnConvert.Size = new System.Drawing.Size(160, 23);
this.btnConvert.TabIndex = 9;
this.btnConvert.Text = "Convert";
this.btnConvert.UseVisualStyleBackColor = true;
this.btnConvert.Click += new System.EventHandler(this.btnConvert_Click);
//
// lbAudioFile
//
this.lbAudioFile.AutoSize = true;
this.lbAudioFile.Location = new System.Drawing.Point(12, 24);
this.lbAudioFile.Name = "lbAudioFile";
this.lbAudioFile.Size = new System.Drawing.Size(56, 13);
this.lbAudioFile.TabIndex = 11;
this.lbAudioFile.Text = "Audio File:";
//
// tbAudioFile
//
this.tbAudioFile.Location = new System.Drawing.Point(74, 21);
this.tbAudioFile.Name = "tbAudioFile";
this.tbAudioFile.ReadOnly = true;
this.tbAudioFile.Size = new System.Drawing.Size(191, 20);
this.tbAudioFile.TabIndex = 12;
//
// btnBrowseAudioFile
//
this.btnBrowseAudioFile.Location = new System.Drawing.Point(271, 20);
this.btnBrowseAudioFile.Name = "btnBrowseAudioFile";
this.btnBrowseAudioFile.Size = new System.Drawing.Size(75, 23);
this.btnBrowseAudioFile.TabIndex = 13;
this.btnBrowseAudioFile.Text = "Browse...";
this.btnBrowseAudioFile.UseVisualStyleBackColor = true;
this.btnBrowseAudioFile.Click += new System.EventHandler(this.btnBrowseAudioFile_Click);
//
// gbLoop
//
this.gbLoop.Controls.Add(this.tbarLoopStartSample);
this.gbLoop.Controls.Add(this.lbStartSample);
this.gbLoop.Controls.Add(this.tbLoopStart);
this.gbLoop.Controls.Add(this.rbEnterManually);
this.gbLoop.Controls.Add(this.rbFromAudioFile);
this.gbLoop.Controls.Add(this.rbNone);
this.gbLoop.Location = new System.Drawing.Point(15, 70);
this.gbLoop.Name = "gbLoop";
this.gbLoop.Size = new System.Drawing.Size(331, 113);
this.gbLoop.TabIndex = 14;
this.gbLoop.TabStop = false;
this.gbLoop.Text = "Loop";
//
// tbarLoopStartSample
//
this.tbarLoopStartSample.Enabled = false;
this.tbarLoopStartSample.Location = new System.Drawing.Point(107, 62);
this.tbarLoopStartSample.Maximum = 1059620;
this.tbarLoopStartSample.Name = "tbarLoopStartSample";
this.tbarLoopStartSample.Size = new System.Drawing.Size(142, 45);
this.tbarLoopStartSample.TabIndex = 3;
this.tbarLoopStartSample.TickStyle = System.Windows.Forms.TickStyle.None;
this.tbarLoopStartSample.Scroll += new System.EventHandler(this.tbarLoopStartSample_Scroll);
//
// lbStartSample
//
this.lbStartSample.AutoSize = true;
this.lbStartSample.Location = new System.Drawing.Point(35, 74);
this.lbStartSample.Name = "lbStartSample";
this.lbStartSample.Size = new System.Drawing.Size(66, 13);
this.lbStartSample.TabIndex = 2;
this.lbStartSample.Text = "(startsample)";
//
// tbLoopStart
//
this.tbLoopStart.Enabled = false;
this.tbLoopStart.Location = new System.Drawing.Point(256, 66);
this.tbLoopStart.Name = "tbLoopStart";
this.tbLoopStart.Size = new System.Drawing.Size(60, 20);
this.tbLoopStart.TabIndex = 1;
this.tbLoopStart.Text = "0";
this.tbLoopStart.TextChanged += new System.EventHandler(this.tbLoopStart_TextChanged);
this.tbLoopStart.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbLoopStart_KeyPress);
//
// rbEnterManually
//
this.rbEnterManually.AutoSize = true;
this.rbEnterManually.Location = new System.Drawing.Point(6, 59);
this.rbEnterManually.Name = "rbEnterManually";
this.rbEnterManually.Size = new System.Drawing.Size(95, 17);
this.rbEnterManually.TabIndex = 0;
this.rbEnterManually.Text = "Enter Manually";
this.rbEnterManually.UseVisualStyleBackColor = true;
this.rbEnterManually.CheckedChanged += new System.EventHandler(this.rbSelectionChanged);
//
// rbFromAudioFile
//
this.rbFromAudioFile.AutoSize = true;
this.rbFromAudioFile.Enabled = false;
this.rbFromAudioFile.Location = new System.Drawing.Point(6, 39);
this.rbFromAudioFile.Name = "rbFromAudioFile";
this.rbFromAudioFile.Size = new System.Drawing.Size(281, 17);
this.rbFromAudioFile.TabIndex = 0;
this.rbFromAudioFile.Text = "From Audio File (only works with pre-looped wave files)";
this.rbFromAudioFile.UseVisualStyleBackColor = true;
this.rbFromAudioFile.CheckedChanged += new System.EventHandler(this.rbSelectionChanged);
//
// rbNone
//
this.rbNone.AutoSize = true;
this.rbNone.Checked = true;
this.rbNone.Location = new System.Drawing.Point(6, 19);
this.rbNone.Name = "rbNone";
this.rbNone.Size = new System.Drawing.Size(51, 17);
this.rbNone.TabIndex = 0;
this.rbNone.TabStop = true;
this.rbNone.Text = "None";
this.rbNone.UseVisualStyleBackColor = true;
this.rbNone.CheckedChanged += new System.EventHandler(this.rbSelectionChanged);
//
// gbWaveInfo
//
this.gbWaveInfo.Controls.Add(this.lbStatusValue);
this.gbWaveInfo.Controls.Add(this.lbLoopStartValue);
this.gbWaveInfo.Controls.Add(this.lbLoopCountValue);
this.gbWaveInfo.Controls.Add(this.lbFormatValue);
this.gbWaveInfo.Controls.Add(this.lbChannelCountValue);
this.gbWaveInfo.Controls.Add(this.lbSamplerateValue);
this.gbWaveInfo.Controls.Add(this.lbBitdepthValue);
this.gbWaveInfo.Controls.Add(this.lbStatus);
this.gbWaveInfo.Controls.Add(this.lbLoopStart);
this.gbWaveInfo.Controls.Add(this.lbLoopCount);
this.gbWaveInfo.Controls.Add(this.lbFormat);
this.gbWaveInfo.Controls.Add(this.lbChannelCount);
this.gbWaveInfo.Controls.Add(this.lbSamplerate);
this.gbWaveInfo.Controls.Add(this.lbBitdepth);
this.gbWaveInfo.Location = new System.Drawing.Point(363, 20);
this.gbWaveInfo.Name = "gbWaveInfo";
this.gbWaveInfo.Size = new System.Drawing.Size(135, 192);
this.gbWaveInfo.TabIndex = 15;
this.gbWaveInfo.TabStop = false;
this.gbWaveInfo.Text = "Wave Info";
//
// lbStatusValue
//
this.lbStatusValue.Location = new System.Drawing.Point(75, 157);
this.lbStatusValue.Name = "lbStatusValue";
this.lbStatusValue.Size = new System.Drawing.Size(54, 13);
this.lbStatusValue.TabIndex = 7;
//
// lbLoopStartValue
//
this.lbLoopStartValue.Location = new System.Drawing.Point(75, 135);
this.lbLoopStartValue.Name = "lbLoopStartValue";
this.lbLoopStartValue.Size = new System.Drawing.Size(54, 13);
this.lbLoopStartValue.TabIndex = 7;
//
// lbLoopCountValue
//
this.lbLoopCountValue.Location = new System.Drawing.Point(75, 113);
this.lbLoopCountValue.Name = "lbLoopCountValue";
this.lbLoopCountValue.Size = new System.Drawing.Size(54, 13);
this.lbLoopCountValue.TabIndex = 7;
//
// lbFormatValue
//
this.lbFormatValue.Location = new System.Drawing.Point(75, 91);
this.lbFormatValue.Name = "lbFormatValue";
this.lbFormatValue.Size = new System.Drawing.Size(54, 13);
this.lbFormatValue.TabIndex = 7;
//
// lbChannelCountValue
//
this.lbChannelCountValue.Location = new System.Drawing.Point(75, 69);
this.lbChannelCountValue.Name = "lbChannelCountValue";
this.lbChannelCountValue.Size = new System.Drawing.Size(54, 13);
this.lbChannelCountValue.TabIndex = 7;
//
// lbSamplerateValue
//
this.lbSamplerateValue.Location = new System.Drawing.Point(75, 47);
this.lbSamplerateValue.Name = "lbSamplerateValue";
this.lbSamplerateValue.Size = new System.Drawing.Size(54, 13);
this.lbSamplerateValue.TabIndex = 7;
//
// lbBitdepthValue
//
this.lbBitdepthValue.Location = new System.Drawing.Point(75, 25);
this.lbBitdepthValue.Name = "lbBitdepthValue";
this.lbBitdepthValue.Size = new System.Drawing.Size(54, 13);
this.lbBitdepthValue.TabIndex = 7;
//
// lbStatus
//
this.lbStatus.AutoSize = true;
this.lbStatus.Location = new System.Drawing.Point(6, 157);
this.lbStatus.Name = "lbStatus";
this.lbStatus.Size = new System.Drawing.Size(40, 13);
this.lbStatus.TabIndex = 6;
this.lbStatus.Text = "Status:";
//
// lbLoopStart
//
this.lbLoopStart.AutoSize = true;
this.lbLoopStart.Location = new System.Drawing.Point(6, 135);
this.lbLoopStart.Name = "lbLoopStart";
this.lbLoopStart.Size = new System.Drawing.Size(59, 13);
this.lbLoopStart.TabIndex = 5;
this.lbLoopStart.Text = "Loop Start:";
//
// lbLoopCount
//
this.lbLoopCount.AutoSize = true;
this.lbLoopCount.Location = new System.Drawing.Point(6, 113);
this.lbLoopCount.Name = "lbLoopCount";
this.lbLoopCount.Size = new System.Drawing.Size(39, 13);
this.lbLoopCount.TabIndex = 4;
this.lbLoopCount.Text = "Loops:";
//
// lbFormat
//
this.lbFormat.AutoSize = true;
this.lbFormat.Location = new System.Drawing.Point(6, 91);
this.lbFormat.Name = "lbFormat";
this.lbFormat.Size = new System.Drawing.Size(42, 13);
this.lbFormat.TabIndex = 3;
this.lbFormat.Text = "Format:";
//
// lbChannelCount
//
this.lbChannelCount.AutoSize = true;
this.lbChannelCount.Location = new System.Drawing.Point(6, 69);
this.lbChannelCount.Name = "lbChannelCount";
this.lbChannelCount.Size = new System.Drawing.Size(54, 13);
this.lbChannelCount.TabIndex = 2;
this.lbChannelCount.Text = "Channels:";
//
// lbSamplerate
//
this.lbSamplerate.AutoSize = true;
this.lbSamplerate.Location = new System.Drawing.Point(6, 47);
this.lbSamplerate.Name = "lbSamplerate";
this.lbSamplerate.Size = new System.Drawing.Size(63, 13);
this.lbSamplerate.TabIndex = 1;
this.lbSamplerate.Text = "Samplerate:";
//
// lbBitdepth
//
this.lbBitdepth.AutoSize = true;
this.lbBitdepth.Location = new System.Drawing.Point(6, 25);
this.lbBitdepth.Name = "lbBitdepth";
this.lbBitdepth.Size = new System.Drawing.Size(49, 13);
this.lbBitdepth.TabIndex = 0;
this.lbBitdepth.Text = "Bitdepth:";
//
// cbSourceSound
//
this.cbSourceSound.AutoSize = true;
this.cbSourceSound.Enabled = false;
this.cbSourceSound.Location = new System.Drawing.Point(15, 48);
this.cbSourceSound.Name = "cbSourceSound";
this.cbSourceSound.Size = new System.Drawing.Size(170, 17);
this.cbSourceSound.TabIndex = 16;
this.cbSourceSound.Text = "Take sound from source WAD";
this.cbSourceSound.UseVisualStyleBackColor = true;
this.cbSourceSound.CheckedChanged += new System.EventHandler(this.cbSourceSound_CheckedChanged);
//
// gbPrelisten
//
this.gbPrelisten.Controls.Add(this.label1);
this.gbPrelisten.Controls.Add(this.btnPlay);
this.gbPrelisten.Location = new System.Drawing.Point(519, 20);
this.gbPrelisten.Name = "gbPrelisten";
this.gbPrelisten.Size = new System.Drawing.Size(135, 192);
this.gbPrelisten.TabIndex = 17;
this.gbPrelisten.TabStop = false;
this.gbPrelisten.Text = "Prelisten Loop";
//
// label1
//
this.label1.Location = new System.Drawing.Point(6, 25);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(123, 118);
this.label1.TabIndex = 0;
this.label1.Text = "Note:\r\n\r\nYou will only hear the looped part, not the part before.\r\nAlso, the Loop" +
" might be inaccurate (only a few samples)";
//
// btnPlay
//
this.btnPlay.Location = new System.Drawing.Point(6, 156);
this.btnPlay.Name = "btnPlay";
this.btnPlay.Size = new System.Drawing.Size(123, 23);
this.btnPlay.TabIndex = 13;
this.btnPlay.Text = "Play Loop";
this.btnPlay.UseVisualStyleBackColor = true;
this.btnPlay.Click += new System.EventHandler(this.btnPlay_Click);
//
// CustomizeMii_BnsConvert
//
this.AcceptButton = this.btnConvert;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Control;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(674, 230);
this.Controls.Add(this.gbPrelisten);
this.Controls.Add(this.cbSourceSound);
this.Controls.Add(this.gbWaveInfo);
this.Controls.Add(this.gbLoop);
this.Controls.Add(this.btnBrowseAudioFile);
this.Controls.Add(this.tbAudioFile);
this.Controls.Add(this.lbAudioFile);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnConvert);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "CustomizeMii_BnsConvert";
this.Text = "CustomizeMii_BnsConvert";
this.Load += new System.EventHandler(this.CustomizeMii_BnsConvert_Load);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.CustomizeMii_BnsConvert_FormClosing);
this.gbLoop.ResumeLayout(false);
this.gbLoop.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.tbarLoopStartSample)).EndInit();
this.gbWaveInfo.ResumeLayout(false);
this.gbWaveInfo.PerformLayout();
this.gbPrelisten.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnConvert;
private System.Windows.Forms.Label lbAudioFile;
private System.Windows.Forms.TextBox tbAudioFile;
private System.Windows.Forms.Button btnBrowseAudioFile;
private System.Windows.Forms.GroupBox gbLoop;
private System.Windows.Forms.RadioButton rbNone;
private System.Windows.Forms.RadioButton rbEnterManually;
private System.Windows.Forms.RadioButton rbFromAudioFile;
private System.Windows.Forms.TextBox tbLoopStart;
private System.Windows.Forms.GroupBox gbWaveInfo;
private System.Windows.Forms.Label lbBitdepth;
private System.Windows.Forms.Label lbSamplerate;
private System.Windows.Forms.Label lbChannelCount;
private System.Windows.Forms.Label lbFormat;
private System.Windows.Forms.Label lbLoopCount;
private System.Windows.Forms.Label lbLoopStart;
private System.Windows.Forms.Label lbStatus;
private System.Windows.Forms.Label lbStatusValue;
private System.Windows.Forms.Label lbLoopStartValue;
private System.Windows.Forms.Label lbLoopCountValue;
private System.Windows.Forms.Label lbFormatValue;
private System.Windows.Forms.Label lbChannelCountValue;
private System.Windows.Forms.Label lbSamplerateValue;
private System.Windows.Forms.Label lbBitdepthValue;
private System.Windows.Forms.CheckBox cbSourceSound;
private System.Windows.Forms.GroupBox gbPrelisten;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnPlay;
private System.Windows.Forms.Label lbStartSample;
private System.Windows.Forms.TrackBar tbarLoopStartSample;
}
}

View File

@ -1,428 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.IO;
using System.Windows.Forms;
using System.ComponentModel;
using System.Media;
using libWiiSharp;
namespace CustomizeMii
{
public partial class CustomizeMii_BnsConvert : Form
{
private bool lameExists;
private int loopStartSample;
private BackgroundWorker bwGatherInfo;
private int bitDepth;
private int sampleRate;
private int channelCount;
private int dataFormat;
private int loopCount;
private int loopStart;
private bool error = false;
private bool cancelled = false;
private int sampleCount;
private SoundPlayer sPlayer;
private bool mp3LengthKnown = false;
private byte[] sourceSound = new byte[0];
public string AudioFile { get { return tbAudioFile.Text; } }
public bool LoopNone { get { return rbNone.Checked; } }
public bool LoopFromAudio { get { return rbFromAudioFile.Checked; } }
public bool LoopManually { get { return rbEnterManually.Checked; } }
public int LoopStartSample { get { return loopStartSample; } }
public int ChannelCount { get { return channelCount; } }
public byte[] SourceSound { get { return sourceSound; } set { sourceSound = value; } }
public CustomizeMii_BnsConvert(bool lameExists)
{
InitializeComponent();
this.lameExists = lameExists;
}
private void CustomizeMii_BnsConvert_Load(object sender, EventArgs e)
{
//this.Size = new System.Drawing.Size(358, 220);
this.Size = new System.Drawing.Size(btnCancel.Location.X + btnCancel.Size.Width + 15, this.Size.Height);
this.CenterToParent();
bwGatherInfo = new BackgroundWorker();
bwGatherInfo.WorkerSupportsCancellation = true;
bwGatherInfo.DoWork += new DoWorkEventHandler(bwGatherInfo_DoWork);
if (sourceSound[0] == 'R' && sourceSound[1] == 'I' && sourceSound[2] == 'F' && sourceSound[3] == 'F')
{ cbSourceSound.Enabled = true; }
else if (sourceSound[0] == 'L' && sourceSound[1] == 'Z' && sourceSound[2] == '7' && sourceSound[3] == '7')
if (sourceSound[9] == 'R' && sourceSound[10] == 'I' && sourceSound[11] == 'F' && sourceSound[12] == 'F')
{ cbSourceSound.Enabled = true; }
}
private void CustomizeMii_BnsConvert_FormClosing(object sender, FormClosingEventArgs e)
{
cancelled = true;
if (bwGatherInfo.IsBusy)
bwGatherInfo.CancelAsync();
}
private void rbSelectionChanged(object sender, EventArgs e)
{
tbLoopStart.Enabled = rbEnterManually.Checked;
if (tbAudioFile.Text.ToLower().EndsWith(".mp3")) { tbarLoopStartSample.Enabled = (rbEnterManually.Checked && mp3LengthKnown); }
else { tbarLoopStartSample.Enabled = rbEnterManually.Checked; }
if (!rbNone.Checked && this.Size.Width > 400)
this.Size = new System.Drawing.Size(gbPrelisten.Location.X + gbPrelisten.Size.Width + 15, this.Size.Height);
else if (rbNone.Checked && this.Size.Width > 400)
this.Size = new System.Drawing.Size(gbWaveInfo.Location.X + gbWaveInfo.Size.Width + 15, this.Size.Height);
}
private void tbLoopStart_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = !char.IsDigit(e.KeyChar) && e.KeyChar != '\b';
}
private void btnConvert_Click(object sender, EventArgs e)
{
if (!File.Exists(tbAudioFile.Text) && tbAudioFile.Text != "Internal Sound")
{
tbAudioFile.Focus();
tbAudioFile.SelectAll();
return;
}
if (!int.TryParse(tbLoopStart.Text, out loopStartSample))
{
tbLoopStart.Focus();
tbLoopStart.SelectAll();
}
if (this.sPlayer != null) { this.sPlayer.Stop(); this.sPlayer.Dispose(); }
this.DialogResult = DialogResult.OK;
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
if (this.sPlayer != null) { this.sPlayer.Stop(); this.sPlayer.Dispose(); }
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void cbSourceSound_CheckedChanged(object sender, EventArgs e)
{
if (cbSourceSound.Checked)
{
tbAudioFile.Text = "Internal Sound";
if (Lz77.IsLz77Compressed(sourceSound))
{ Lz77 l = new Lz77(); sourceSound = l.Decompress(sourceSound); }
foreach (Label thisLabel in gbWaveInfo.Controls)
if (thisLabel.Name.ToLower().Contains("value"))
{
thisLabel.ForeColor = System.Drawing.Color.Black;
thisLabel.Text = "Gathering";
}
bwGatherInfo.RunWorkerAsync(sourceSound);
//this.Size = new System.Drawing.Size(510, 220);
this.Size = new System.Drawing.Size(gbWaveInfo.Location.X + gbWaveInfo.Size.Width + 15, this.Size.Height);
}
else
{
if (tbAudioFile.Text == "Internal Sound")
tbAudioFile.Text = string.Empty;
//this.Size = new System.Drawing.Size(358, 220);
this.Size = new System.Drawing.Size(btnCancel.Location.X + btnCancel.Size.Width + 15, this.Size.Height);
}
}
private void btnBrowseAudioFile_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
if (lameExists)
{ ofd.Filter = "Wave|*.wav|MP3|*.mp3|All|*.wav;*.mp3"; ofd.FilterIndex = 3; }
else
{ ofd.Filter = "Wave|*.wav"; }
if (ofd.ShowDialog() == DialogResult.OK)
{
if (ofd.FileName != tbAudioFile.Text)
{
btnConvert.Enabled = false;
tbarLoopStartSample.Enabled = false;
mp3LengthKnown = false;
cbSourceSound.Checked = false;
tbAudioFile.Text = ofd.FileName;
if (ofd.FileName.EndsWith(".wav"))
{
rbFromAudioFile.Enabled = true;
foreach (Label thisLabel in gbWaveInfo.Controls)
if (thisLabel.Name.ToLower().Contains("value"))
{
thisLabel.ForeColor = System.Drawing.Color.Black;
thisLabel.Text = "Gathering";
}
bwGatherInfo.RunWorkerAsync(ofd.FileName);
this.Size = new System.Drawing.Size(gbWaveInfo.Location.X + gbWaveInfo.Size.Width + 15, this.Size.Height);
}
else if (ofd.FileName.EndsWith(".mp3"))
{
channelCount = 0;
btnConvert.Enabled = true;
if (rbFromAudioFile.Checked) rbNone.Checked = true;
rbFromAudioFile.Enabled = false;
this.Size = new System.Drawing.Size(btnCancel.Location.X + btnCancel.Size.Width + 15, this.Size.Height);
try
{
MP3Info mp3Info = new MP3Info(ofd.FileName);
tbarLoopStartSample.Maximum = mp3Info.AudioSamples;
mp3LengthKnown = true;
if (rbEnterManually.Checked) tbarLoopStartSample.Enabled = true;
}
catch { }
}
}
}
}
void bwGatherInfo_DoWork(object sender, DoWorkEventArgs e)
{
EventHandler UpdateValues = new EventHandler(this.UpdateValues);
try
{
Wave wave;
if (e.Argument is byte[])
{ wave = new Wave((byte[])e.Argument); }
else
{ wave = new Wave((string)e.Argument); }
try { this.sampleCount = wave.NumSamples; }
catch { }
try { bitDepth = wave.BitDepth; }
catch { bitDepth = -1; }
try { sampleRate = wave.SampleRate; }
catch { sampleRate = -1; }
try { channelCount = wave.NumChannels; }
catch { channelCount = -1; }
try { dataFormat = wave.DataFormat; }
catch { dataFormat = -1; }
try { loopCount = wave.NumLoops; }
catch { loopCount = -1; }
try { loopStart = wave.LoopStart; }
catch { loopStart = -1; }
if (!cancelled)
this.Invoke(UpdateValues);
}
catch
{
error = true;
if (!cancelled)
this.Invoke(UpdateValues);
}
}
void UpdateValues(object sender, EventArgs e)
{
if (error == true)
{
foreach (Label thisLabel in gbWaveInfo.Controls)
if (thisLabel.Name.ToLower().Contains("value"))
{
thisLabel.Text = "Error";
thisLabel.ForeColor = System.Drawing.Color.Red;
}
error = false;
return;
}
bool statusOk = true;
tbarLoopStartSample.Maximum = this.sampleCount;
if (rbEnterManually.Checked) tbarLoopStartSample.Enabled = true;
if (bitDepth == -1) lbBitdepthValue.Text = "Error";
else lbBitdepthValue.Text = bitDepth.ToString();
if (sampleRate == -1) lbSamplerateValue.Text = "Error";
else lbSamplerateValue.Text = sampleRate.ToString();
if (dataFormat == -1) lbFormatValue.Text = "Error";
else if (dataFormat == 1) lbFormatValue.Text = "1 (PCM)";
else lbFormatValue.Text = dataFormat.ToString();
if (channelCount == -1) lbChannelCountValue.Text = "Error";
else if (channelCount == 1) lbChannelCountValue.Text = "1 (Mono)";
else if (channelCount == 2) lbChannelCountValue.Text = "2 (Stereo)";
else lbChannelCountValue.Text = channelCount.ToString();
if (loopCount == -1) lbLoopCountValue.Text = "Error";
else lbLoopCountValue.Text = loopCount.ToString();
if (loopCount == -1) lbLoopStartValue.Text = "Error";
else if (loopCount == 1) { lbLoopStartValue.Text = loopStart == -1 ? "Error" : loopStart.ToString(); }
else lbLoopStartValue.Text = "-";
if (lbBitdepthValue.Text == "Error" || bitDepth != 16)
{
lbBitdepthValue.ForeColor = System.Drawing.Color.Red;
statusOk = false;
}
else lbBitdepthValue.ForeColor = System.Drawing.Color.Green;
if (lbSamplerateValue.Text == "Error")
{
lbSamplerateValue.ForeColor = System.Drawing.Color.Red;
statusOk = false;
}
else lbSamplerateValue.ForeColor = System.Drawing.Color.Green;
if (lbFormatValue.Text == "Error" || dataFormat != 1)
{
lbFormatValue.ForeColor = System.Drawing.Color.Red;
statusOk = false;
}
else lbFormatValue.ForeColor = System.Drawing.Color.Green;
if (lbChannelCountValue.Text == "Error" || (channelCount > 2 || channelCount < 1))
{
lbChannelCountValue.ForeColor = System.Drawing.Color.Red;
statusOk = false;
}
else lbChannelCountValue.ForeColor = System.Drawing.Color.Green;
if (lbLoopCountValue.Text == "Error" || loopCount > 1)
lbLoopCountValue.ForeColor = System.Drawing.Color.Orange;
else lbLoopCountValue.ForeColor = System.Drawing.Color.Green;
if (lbLoopStartValue.Text == "Error" || lbLoopStartValue.Text == "-")
lbLoopStartValue.ForeColor = System.Drawing.Color.Orange;
else lbLoopStartValue.ForeColor = System.Drawing.Color.Green;
if (!statusOk)
{
lbStatusValue.Text = "Not OK!";
lbStatusValue.ForeColor = System.Drawing.Color.Red;
btnConvert.Enabled = false;
}
else
{
btnConvert.Enabled = true;
if (lbLoopCountValue.ForeColor == System.Drawing.Color.Orange ||
lbLoopStartValue.ForeColor == System.Drawing.Color.Orange)
{
lbStatusValue.Text = "No Loop!";
lbStatusValue.ForeColor = System.Drawing.Color.Orange;
if (rbFromAudioFile.Checked) rbNone.Checked = true;
rbFromAudioFile.Enabled = false;
}
else
{
rbFromAudioFile.Enabled = true;
lbStatusValue.Text = "OK!";
lbStatusValue.ForeColor = System.Drawing.Color.Green;
}
}
}
private void btnPlay_Click(object sender, EventArgs e)
{
if (btnPlay.Text == "Stop")
{
if (sPlayer != null)
{
sPlayer.Stop();
sPlayer = null;
btnPlay.Text = "Play Loop";
}
}
else
{
try
{
int loopStart = rbFromAudioFile.Checked ? int.Parse(lbLoopStartValue.Text) : int.Parse(tbLoopStart.Text);
Wave wave;
if (cbSourceSound.Checked)
wave = new Wave(sourceSound);
else
wave = new Wave(tbAudioFile.Text);
wave.TrimStart(loopStart);
MemoryStream waveFile = wave.ToMemoryStream();
wave.Dispose();
waveFile.Seek(0, SeekOrigin.Begin);
sPlayer = new SoundPlayer(waveFile);
sPlayer.PlayLooping();
btnPlay.Text = "Stop";
}
catch (Exception ex)
{
sPlayer = null;
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void tbarLoopStartSample_Scroll(object sender, EventArgs e)
{
try { tbLoopStart.Text = tbarLoopStartSample.Value.ToString(); }
catch { }
}
private void tbLoopStart_TextChanged(object sender, EventArgs e)
{
if (tbarLoopStartSample.Enabled)
try { tbarLoopStartSample.Value = int.Parse(tbLoopStart.Text); }
catch { }
}
}
}

View File

@ -1,524 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace CustomizeMii
{
partial class CustomizeMii_ComplexForwarder
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.tb1 = new System.Windows.Forms.TextBox();
this.cbImage43 = new System.Windows.Forms.CheckBox();
this.cbImage169 = new System.Windows.Forms.CheckBox();
this.tbImage43 = new System.Windows.Forms.TextBox();
this.tbImage169 = new System.Windows.Forms.TextBox();
this.btnBrowseImage43 = new System.Windows.Forms.Button();
this.btnBrowseImage169 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
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(6, 17);
this.tb1.Name = "tb1";
this.tb1.Size = new System.Drawing.Size(311, 20);
this.tb1.TabIndex = 1;
this.tb1.Text = "SD:/apps/example/boot.dol";
this.tb1.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// cbImage43
//
this.cbImage43.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.cbImage43.AutoSize = true;
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;
this.cbImage43.Text = "Image 4:3";
this.cbImage43.UseVisualStyleBackColor = true;
this.cbImage43.CheckedChanged += new System.EventHandler(this.cbImage43_CheckedChanged);
//
// cbImage169
//
this.cbImage169.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.cbImage169.AutoSize = true;
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;
this.cbImage169.Text = "Image 16:9";
this.cbImage169.UseVisualStyleBackColor = true;
this.cbImage169.CheckedChanged += new System.EventHandler(this.cbImage169_CheckedChanged);
//
// tbImage43
//
this.tbImage43.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.tbImage43.Enabled = false;
this.tbImage43.Location = new System.Drawing.Point(94, 280);
this.tbImage43.Name = "tbImage43";
this.tbImage43.ReadOnly = true;
this.tbImage43.Size = new System.Drawing.Size(171, 20);
this.tbImage43.TabIndex = 4;
//
// tbImage169
//
this.tbImage169.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.tbImage169.Enabled = false;
this.tbImage169.Location = new System.Drawing.Point(94, 309);
this.tbImage169.Name = "tbImage169";
this.tbImage169.ReadOnly = true;
this.tbImage169.Size = new System.Drawing.Size(171, 20);
this.tbImage169.TabIndex = 5;
//
// btnBrowseImage43
//
this.btnBrowseImage43.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.btnBrowseImage43.Enabled = false;
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;
this.btnBrowseImage43.Text = "Browse...";
this.btnBrowseImage43.UseVisualStyleBackColor = true;
this.btnBrowseImage43.Click += new System.EventHandler(this.btnBrowse_Click);
//
// btnBrowseImage169
//
this.btnBrowseImage169.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.btnBrowseImage169.Enabled = false;
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;
this.btnBrowseImage169.Text = "Browse...";
this.btnBrowseImage169.UseVisualStyleBackColor = true;
this.btnBrowseImage169.Click += new System.EventHandler(this.btnBrowse_Click);
//
// label1
//
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
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;
this.label1.Text = "The images must be 640 x 480, else they will be resized!\r\nThe 16:9 image should b" +
"e made in 832 x 480 and resized\r\nto 640 x 480, it will be streched on the Wii!";
this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// btnOK
//
this.btnOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
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;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
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;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// label2
//
this.label2.Anchor = System.Windows.Forms.AnchorStyles.Top;
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;
this.label2.Text = "The forwarder will try to load in this order.\r\nEntries must begin with \"SD:/\" or " +
"\"USB:/\" and end with \".dol\" or \".elf\"!\r\nYou may enter whatever path you want.";
this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// tb2
//
this.tb2.Location = new System.Drawing.Point(6, 46);
this.tb2.Name = "tb2";
this.tb2.Size = new System.Drawing.Size(311, 20);
this.tb2.TabIndex = 1;
this.tb2.Text = "SD:/apps/example/boot.elf";
this.tb2.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// tb3
//
this.tb3.Location = new System.Drawing.Point(6, 75);
this.tb3.Name = "tb3";
this.tb3.Size = new System.Drawing.Size(311, 20);
this.tb3.TabIndex = 1;
this.tb3.Text = "USB:/apps/example/boot.dol";
this.tb3.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// tb4
//
this.tb4.Location = new System.Drawing.Point(6, 104);
this.tb4.Name = "tb4";
this.tb4.Size = new System.Drawing.Size(311, 20);
this.tb4.TabIndex = 1;
this.tb4.Text = "USB:/apps/example/boot.elf";
this.tb4.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// 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;
this.tb5.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// 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;
this.tb6.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// 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;
this.tb7.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// 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;
this.tb8.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// 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;
this.tb9.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// 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;
this.tb10.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// 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;
this.tb11.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// 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;
this.tb12.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// 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;
this.tb13.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// 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;
this.tb14.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// 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;
this.tb15.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// 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;
this.tb16.TextChanged += new System.EventHandler(this.tb_TextChanged);
//
// CustomizeMii_ComplexForwarder
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Control;
this.CancelButton = this.btnCancel;
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);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnBrowseImage169);
this.Controls.Add(this.btnBrowseImage43);
this.Controls.Add(this.tbImage169);
this.Controls.Add(this.tbImage43);
this.Controls.Add(this.cbImage169);
this.Controls.Add(this.cbImage43);
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();
}
#endregion
private System.Windows.Forms.Label label1;
public System.Windows.Forms.TextBox tb1;
public System.Windows.Forms.CheckBox cbImage43;
public System.Windows.Forms.CheckBox cbImage169;
public System.Windows.Forms.TextBox tbImage43;
public System.Windows.Forms.TextBox tbImage169;
public System.Windows.Forms.Button btnBrowseImage43;
public System.Windows.Forms.Button btnBrowseImage169;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label label2;
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;
}
}

View File

@ -1,180 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace CustomizeMii
{
public partial class CustomizeMii_ComplexForwarder : Form
{
public CustomizeMii_ComplexForwarder()
{
InitializeComponent();
}
private void CustomizeMii_ComplexForwarder_Load(object sender, EventArgs e)
{
this.CenterToParent();
}
private void cbImage43_CheckedChanged(object sender, EventArgs e)
{
tbImage43.Enabled = cbImage43.Checked;
btnBrowseImage43.Enabled = cbImage43.Checked;
}
private void cbImage169_CheckedChanged(object sender, EventArgs e)
{
tbImage169.Enabled = cbImage169.Checked;
btnBrowseImage169.Enabled = cbImage169.Checked;
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void btnOK_Click(object sender, EventArgs e)
{
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")))
{ tabPaths.SelectedTab = tabRequired; tbThis.Focus(); tbThis.SelectAll(); return; }
}
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;
this.DialogResult = DialogResult.OK;
this.Close();
}
private void btnBrowse_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "PNG|*.png|JPG|*.jpg|GIF|*.gif|BMP|*.bmp|All|*.png;*.jpg;*.gif;*.bmp";
ofd.FilterIndex = 5;
if (ofd.ShowDialog() == DialogResult.OK)
{
if (sender == btnBrowseImage43) tbImage43.Text = ofd.FileName;
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;
}
}
private void tb_TextChanged(object sender, EventArgs e)
{
TextBox tbSender = sender as TextBox;
int curPos = tbSender.SelectionStart;
if (tbSender.Text.Contains("\\"))
tbSender.Text = tbSender.Text.Replace("\\", "/");
if (tbSender.Text.Contains("sd:"))
tbSender.Text = tbSender.Text.Replace("sd:", "SD:");
if (tbSender.Text.Contains("usb:"))
tbSender.Text = tbSender.Text.Replace("usb:", "USB:");
if (tbSender.Text.Contains(".DOL"))
tbSender.Text = tbSender.Text.Replace(".DOL", ".dol");
if (tbSender.Text.Contains(".ELF"))
tbSender.Text = tbSender.Text.Replace(".ELF", ".elf");
tbSender.SelectionStart = curPos;
}
}
}

View File

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,258 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
using System.Collections.Generic;
using libWiiSharp;
namespace CustomizeMii
{
partial class CustomizeMii_Main
{
private void CustomizeMii_Main_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop) && pbProgress.Value == 100)
{
string[] data = (string[])e.Data.GetData(DataFormats.FileDrop);
if (data.Length == 1 && data[0].ToLower().EndsWith(".wad"))
e.Effect = DragDropEffects.Copy;
}
}
private void CustomizeMii_Main_DragDrop(object sender, DragEventArgs e)
{
string[] data = (string[])e.Data.GetData(DataFormats.FileDrop);
if (data.Length == 1 && data[0].ToLower().EndsWith(".wad"))
{
loadChannel(data[0]);
}
}
private void tbReplace_DragEnter(object sender, DragEventArgs e)
{
if (!string.IsNullOrEmpty(tbSourceWad.Text))
{
if (pbProgress.Value == 100 && e.Data.GetDataPresent(DataFormats.FileDrop))
{
string[] data = (string[])e.Data.GetData(DataFormats.FileDrop);
if (data.Length == 1)
{
if (data[0].ToLower().EndsWith(".wad") ||
data[0].ToLower().EndsWith("00000000.app"))
e.Effect = DragDropEffects.Copy;
else if ((cmbReplace.SelectedIndex == 2 && data[0].ToLower().EndsWith("sound.bin")) ||
(cmbReplace.SelectedIndex == 1 && data[0].ToLower().EndsWith("icon.bin")) ||
(cmbReplace.SelectedIndex == 0 && data[0].ToLower().EndsWith("banner.bin")))
e.Effect = DragDropEffects.Copy;
}
}
}
}
private void tbReplace_DragDrop(object sender, DragEventArgs e)
{
string[] data = (string[])e.Data.GetData(DataFormats.FileDrop);
if (data.Length == 1 && (data[0].ToLower().EndsWith(".wad") ||
data[0].ToLower().EndsWith("00000000.app") ||
data[0].ToLower().EndsWith("sound.bin") ||
data[0].ToLower().EndsWith("icon.bin") ||
data[0].ToLower().EndsWith("banner.bin")))
{
replacePart(data[0]);
}
}
private void tbDol_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop) && pbProgress.Value == 100)
{
string[] data = (string[])e.Data.GetData(DataFormats.FileDrop);
if (data.Length == 1 && (data[0].ToLower().EndsWith(".wad") || data[0].ToLower().EndsWith(".dol")))
e.Effect = DragDropEffects.Copy;
}
}
private void tbDol_DragDrop(object sender, DragEventArgs e)
{
string[] data = (string[])e.Data.GetData(DataFormats.FileDrop);
if (data[0].ToLower().EndsWith(".wad"))
{
try
{
WAD tmpWad = WAD.Load(data[0]);
if (tmpWad.NumOfContents == 3)
{
int appIndex = 0;
if (tmpWad.BootIndex == 1) appIndex = 2;
else if (tmpWad.BootIndex == 2) appIndex = 1;
if (appIndex > 0)
{
newDol = tmpWad.Contents[appIndex];
setControlText(tbDol, data[0]);
btnBrowseDol.Text = "Clear";
}
else errorBox("The DOL file couldn't be found!");
}
else errorBox("The DOL file couldn't be found!");
}
catch (Exception ex)
{
setControlText(tbDol, string.Empty);
btnBrowseDol.Text = "Browse...";
errorBox(ex.Message);
}
}
else if (data[0].ToLower().EndsWith(".dol"))
{
newDol = File.ReadAllBytes(data[0]);
setControlText(tbDol, data[0]);
btnBrowseDol.Text = "Clear";
}
}
private void tbSound_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop) && pbProgress.Value == 100)
{
string[] data = (string[])e.Data.GetData(DataFormats.FileDrop);
if (File.Exists(Application.StartupPath + Path.DirectorySeparatorChar + "lame.exe"))
{
if (data.Length == 1 && (data[0].ToLower().EndsWith(".wav") ||
data[0].ToLower().EndsWith(".bns") ||
data[0].ToLower().EndsWith(".mp3")))
e.Effect = DragDropEffects.Copy;
}
else
{
if (data.Length == 1 && (data[0].ToLower().EndsWith(".wav") ||
data[0].ToLower().EndsWith(".bns")))
e.Effect = DragDropEffects.Copy;
}
}
}
private void tbSound_DragDrop(object sender, DragEventArgs e)
{
string[] data = (string[])e.Data.GetData(DataFormats.FileDrop);
if (data[0].ToLower().EndsWith(".mp3"))
{
convertMp3ToWave(data[0]);
}
else
{
replacedSound = data[0];
setControlText(tbSound, data[0]);
btnBrowseSound.Text = "Clear";
newSoundBin = Headers.IMD5.AddHeader(File.ReadAllBytes(data[0]));
if (cmbReplace.SelectedIndex == 2) setControlText(tbReplace, string.Empty);
}
}
private void lbxBannerTpls_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop) && pbProgress.Value == 100)
{
string[] data = (string[])e.Data.GetData(DataFormats.FileDrop);
bool correct = true;
for (int i = 0; i < data.Length; i++)
if (!(data[0].ToLower().EndsWith(".tpl") ||
data[0].ToLower().EndsWith(".png") ||
data[0].ToLower().EndsWith(".jpg") ||
data[0].ToLower().EndsWith(".gif") ||
data[0].ToLower().EndsWith(".bmp")))
correct = false;
if (correct) e.Effect = DragDropEffects.Copy;
}
}
private void lbxBannerTpls_DragDrop(object sender, DragEventArgs e)
{
string[] data = (string[])e.Data.GetData(DataFormats.FileDrop);
List<string> errors = new List<string>();
foreach (string thisFile in data)
{
try
{
addTpl(lbxBannerTpls, thisFile);
}
catch { errors.Add(thisFile); }
}
if (errors.Count > 0)
{
errorBox(string.Format("These files were not added, because either they already exist or an error occured during conversion:\n\n{0}", string.Join("\n", (errors.ToArray()))));
}
}
private void lbxIconTpls_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop) && pbProgress.Value == 100)
{
string[] data = (string[])e.Data.GetData(DataFormats.FileDrop);
bool correct = true;
for (int i = 0; i < data.Length; i++)
if (!(data[0].ToLower().EndsWith(".tpl") ||
data[0].ToLower().EndsWith(".png") ||
data[0].ToLower().EndsWith(".jpg") ||
data[0].ToLower().EndsWith(".gif") ||
data[0].ToLower().EndsWith(".bmp")))
correct = false;
if (correct) e.Effect = DragDropEffects.Copy;
}
}
private void lbxIconTpls_DragDrop(object sender, DragEventArgs e)
{
string[] data = (string[])e.Data.GetData(DataFormats.FileDrop);
List<string> errors = new List<string>();
foreach (string thisFile in data)
{
try
{
addTpl(lbxIconTpls, thisFile);
}
catch { errors.Add(thisFile); }
}
if (errors.Count > 0)
{
errorBox(string.Format("These files were not added, because either they already exist or an error occured during conversion:\n\n{0}", string.Join("\n", (errors.ToArray()))));
}
}
}
}

View File

@ -1,114 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using ForwardMii;
namespace CustomizeMii
{
namespace Forwarder
{
//Let's use this kind of wrapper, so CustomizeMii can still run, if the ForwardMii.dll is missing...
internal class Complex
{
private string[] paths = new string[16];
private bool[] packs = new bool[3];
private string image43;
private string image169;
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, paths);
Forwarder.Save(Destination, true);
}
public byte[] ToByteArray()
{
GXForwarder Forwarder = new GXForwarder(image43, image169, paths);
return Forwarder.ToByteArray();
}
public void Clear()
{
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;
}
}
internal class Simple
{
private string thisAppFolder;
private bool toElf = false;
public string AppFolder { get { return thisAppFolder; } set { thisAppFolder = value; } }
public bool ForwardToElf { get { return toElf; } set { toElf = value; } }
public Simple() { }
public void Save(string Destination)
{
SDSDHC_Forwarder Forwarder = new SDSDHC_Forwarder(thisAppFolder, toElf);
Forwarder.Save(Destination, true);
}
public byte[] ToByteArray()
{
SDSDHC_Forwarder Forwarder = new SDSDHC_Forwarder(thisAppFolder, toElf);
return Forwarder.ToByteArray();
}
public void Clear()
{
thisAppFolder = string.Empty;
toElf = false;
}
}
}
}

View File

@ -1,151 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace CustomizeMii
{
partial class CustomizeMii_InputBox
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.tbInput = new System.Windows.Forms.TextBox();
this.lbInfo = new System.Windows.Forms.Label();
this.btnOK = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.cbElf = new System.Windows.Forms.CheckBox();
this.tbInput2 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// tbInput
//
this.tbInput.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.tbInput.Location = new System.Drawing.Point(7, 34);
this.tbInput.MaxLength = 3;
this.tbInput.Name = "tbInput";
this.tbInput.Size = new System.Drawing.Size(222, 20);
this.tbInput.TabIndex = 0;
//
// lbInfo
//
this.lbInfo.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.lbInfo.Location = new System.Drawing.Point(4, 9);
this.lbInfo.Name = "lbInfo";
this.lbInfo.Size = new System.Drawing.Size(225, 32);
this.lbInfo.TabIndex = 1;
this.lbInfo.Text = "Please enter \"45e\" to create the Common-Key";
this.lbInfo.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// btnOK
//
this.btnOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.btnOK.Location = new System.Drawing.Point(7, 62);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(108, 23);
this.btnOK.TabIndex = 2;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnExit
//
this.btnExit.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.btnExit.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnExit.Location = new System.Drawing.Point(121, 62);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(108, 23);
this.btnExit.TabIndex = 3;
this.btnExit.Text = "Exit";
this.btnExit.UseVisualStyleBackColor = true;
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// cbElf
//
this.cbElf.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.cbElf.AutoSize = true;
this.cbElf.Location = new System.Drawing.Point(61, 16);
this.cbElf.Name = "cbElf";
this.cbElf.Size = new System.Drawing.Size(114, 17);
this.cbElf.TabIndex = 4;
this.cbElf.Text = "Forward to boot.elf";
this.cbElf.UseVisualStyleBackColor = true;
this.cbElf.Visible = false;
//
// tbInput2
//
this.tbInput2.Location = new System.Drawing.Point(121, 34);
this.tbInput2.Name = "tbInput2";
this.tbInput2.Size = new System.Drawing.Size(108, 20);
this.tbInput2.TabIndex = 1;
this.tbInput2.Visible = false;
//
// CustomizeMii_InputBox
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Control;
this.CancelButton = this.btnExit;
this.ClientSize = new System.Drawing.Size(238, 92);
this.Controls.Add(this.tbInput2);
this.Controls.Add(this.cbElf);
this.Controls.Add(this.btnExit);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.tbInput);
this.Controls.Add(this.lbInfo);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "CustomizeMii_InputBox";
this.ShowInTaskbar = false;
this.Text = "InputBox";
this.Load += new System.EventHandler(this.CustomizeMii_InputBox_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnOK;
public System.Windows.Forms.Label lbInfo;
public System.Windows.Forms.TextBox tbInput;
public System.Windows.Forms.Button btnExit;
public System.Windows.Forms.CheckBox cbElf;
public System.Windows.Forms.TextBox tbInput2;
}
}

View File

@ -1,88 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Windows.Forms;
namespace CustomizeMii
{
public partial class CustomizeMii_InputBox : Form
{
//Wow, need to change this whole thing, but too lazy ~~
public bool CommonKeyMode = true;
public string Input { get { return tbInput.Text; } set { tbInput.Text = value; } }
public string Description { get { return lbInfo.Text; } set { lbInfo.Text = value; } }
public string Input2 { get { return tbInput2.Text; } set { tbInput2.Text = value; } }
public CustomizeMii_InputBox()
{
InitializeComponent();
}
public CustomizeMii_InputBox(bool CommonKeyMode)
{
InitializeComponent();
this.CommonKeyMode = CommonKeyMode;
}
private void CustomizeMii_InputBox_Load(object sender, EventArgs e)
{
this.CenterToParent();
if (this.Location.X == 0 && this.Location.Y == 0) this.CenterToScreen();
}
private void btnExit_Click(object sender, EventArgs e)
{
if (CommonKeyMode == true)
{
Application.Exit();
}
else this.Close();
}
private void btnOK_Click(object sender, EventArgs e)
{
if (this.CommonKeyMode == true)
{
if (tbInput.Text == "45e")
{
this.DialogResult = DialogResult.OK;
this.Close();
}
else
{
tbInput.Focus();
tbInput.SelectAll();
}
}
else
{
if (tbInput.Text.Length > 0)
{
this.DialogResult = DialogResult.OK;
this.Close();
}
else
{
tbInput.Focus();
tbInput.SelectAll();
}
}
}
}
}

View File

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,154 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="lbCreditThanks.Text" xml:space="preserve">
<value>Thanks:
Xuzz for his idea and hard work
WiiCrazy / I.R.on for CustomizeMii Installer
Xuzz, SquidMan, megazig, Matt_P, Omega and The Lemon Man for Wii.py
megazig for his BNS conversion code
SquidMan for Zetsubou
Andre Perrot for gbalzss
comex and Waninkoko for both their NAND Loader
djdynamite123 for his forwarder base files
The USB Loader GX Team for their forwarder source
wilsoff for helping me debugging 3.0</value>
</data>
<metadata name="cmTpls.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>559, 14</value>
</metadata>
<metadata name="ssMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 12</value>
</metadata>
<metadata name="cmForwarder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>104, 12</value>
</metadata>
<metadata name="cmOptionsExtract.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>230, 12</value>
</metadata>
<metadata name="cmSound.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>369, 15</value>
</metadata>
<metadata name="cmDol.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>474, 13</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>42</value>
</metadata>
</root>

View File

@ -1,100 +0,0 @@
namespace CustomizeMii
{
partial class CustomizeMii_PaletteFormatBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.btnIA8 = new System.Windows.Forms.Button();
this.btnRGB5A3 = new System.Windows.Forms.Button();
this.btnRGB565 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(307, 83);
this.label1.TabIndex = 0;
this.label1.Text = "You\'re converting to an indexed format, please choose a format\r\nfor the Palette:\r" +
"\n\r\nIA8: Black & White + Alpha\r\nRGB5A3: Color + Alpha\r\nRGB565: Color";
//
// btnIA8
//
this.btnIA8.Location = new System.Drawing.Point(12, 101);
this.btnIA8.Name = "btnIA8";
this.btnIA8.Size = new System.Drawing.Size(75, 23);
this.btnIA8.TabIndex = 1;
this.btnIA8.Text = "IA8";
this.btnIA8.UseVisualStyleBackColor = true;
this.btnIA8.Click += new System.EventHandler(this.btnIA8_Click);
//
// btnRGB5A3
//
this.btnRGB5A3.Location = new System.Drawing.Point(128, 101);
this.btnRGB5A3.Name = "btnRGB5A3";
this.btnRGB5A3.Size = new System.Drawing.Size(75, 23);
this.btnRGB5A3.TabIndex = 1;
this.btnRGB5A3.Text = "RGB5A3";
this.btnRGB5A3.UseVisualStyleBackColor = true;
this.btnRGB5A3.Click += new System.EventHandler(this.btnRGB5A3_Click);
//
// btnRGB565
//
this.btnRGB565.Location = new System.Drawing.Point(244, 101);
this.btnRGB565.Name = "btnRGB565";
this.btnRGB565.Size = new System.Drawing.Size(75, 23);
this.btnRGB565.TabIndex = 1;
this.btnRGB565.Text = "RGB565";
this.btnRGB565.UseVisualStyleBackColor = true;
this.btnRGB565.Click += new System.EventHandler(this.btnRGB565_Click);
//
// CustomizeMii_PaletteFormatBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(331, 137);
this.Controls.Add(this.btnRGB565);
this.Controls.Add(this.btnRGB5A3);
this.Controls.Add(this.btnIA8);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "CustomizeMii_PaletteFormatBox";
this.Text = "CustomizeMii_PaletteFormatBox";
this.Load += new System.EventHandler(this.CustomizeMii_PaletteFormatBox_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnIA8;
private System.Windows.Forms.Button btnRGB5A3;
private System.Windows.Forms.Button btnRGB565;
}
}

View File

@ -1,40 +0,0 @@
using System.Windows.Forms;
using libWiiSharp;
namespace CustomizeMii
{
public partial class CustomizeMii_PaletteFormatBox : Form
{
private TPL_PaletteFormat pFormat = TPL_PaletteFormat.RGB5A3;
public TPL_PaletteFormat PaletteFormat { get { return pFormat; } }
public CustomizeMii_PaletteFormatBox()
{
InitializeComponent();
}
private void btnIA8_Click(object sender, System.EventArgs e)
{
pFormat = TPL_PaletteFormat.IA8;
this.Close();
}
private void btnRGB5A3_Click(object sender, System.EventArgs e)
{
pFormat = TPL_PaletteFormat.RGB5A3;
this.Close();
}
private void btnRGB565_Click(object sender, System.EventArgs e)
{
pFormat = TPL_PaletteFormat.RGB565;
this.Close();
}
private void CustomizeMii_PaletteFormatBox_Load(object sender, System.EventArgs e)
{
CenterToParent();
}
}
}

View File

@ -1,650 +0,0 @@
/* This file is part of ShowMiiWads
* Copyright (C) 2009 Leathl
*
* ShowMiiWads is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ShowMiiWads is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace CustomizeMii
{
partial class CustomizeMii_Preview
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.Panel = new System.Windows.Forms.Panel();
this.cbCheckerBoard = new System.Windows.Forms.CheckBox();
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();
this.lbBanner = new System.Windows.Forms.Label();
this.cbBanner = new System.Windows.Forms.ComboBox();
this.panel1 = new System.Windows.Forms.Panel();
this.lbFormat = new System.Windows.Forms.Label();
this.lbFormatText = new System.Windows.Forms.Label();
this.lbSize = new System.Windows.Forms.Label();
this.lbSizeText = new System.Windows.Forms.Label();
this.pbPic = new System.Windows.Forms.PictureBox();
this.cmFormat = new System.Windows.Forms.ContextMenuStrip();
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.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.cmChangeFormat = new System.Windows.Forms.ToolStripMenuItem();
this.cmToRGBA8 = new System.Windows.Forms.ToolStripMenuItem();
this.cmToRGB565 = new System.Windows.Forms.ToolStripMenuItem();
this.cmToRGB5A3 = new System.Windows.Forms.ToolStripMenuItem();
this.cmToIA8 = new System.Windows.Forms.ToolStripMenuItem();
this.cmToIA4 = new System.Windows.Forms.ToolStripMenuItem();
this.cmToI8 = new System.Windows.Forms.ToolStripMenuItem();
this.cmToI4 = new System.Windows.Forms.ToolStripMenuItem();
this.lbNoPreview = new System.Windows.Forms.Label();
this.cmCI8 = new System.Windows.Forms.ToolStripMenuItem();
this.cmCI4 = new System.Windows.Forms.ToolStripMenuItem();
this.cmCI8RGB5A3 = new System.Windows.Forms.ToolStripMenuItem();
this.cmCI8RGB565 = new System.Windows.Forms.ToolStripMenuItem();
this.cmCI8IA8 = new System.Windows.Forms.ToolStripMenuItem();
this.cmCI4RGB5A3 = new System.Windows.Forms.ToolStripMenuItem();
this.cmCI4RGB565 = new System.Windows.Forms.ToolStripMenuItem();
this.cmCI4IA8 = new System.Windows.Forms.ToolStripMenuItem();
this.lbTip = new System.Windows.Forms.Label();
this.cmToCI8 = new System.Windows.Forms.ToolStripMenuItem();
this.cmToCI4 = new System.Windows.Forms.ToolStripMenuItem();
this.cmToCI8RGB5A3 = new System.Windows.Forms.ToolStripMenuItem();
this.cmToCI8RGB565 = new System.Windows.Forms.ToolStripMenuItem();
this.cmToCI8IA8 = new System.Windows.Forms.ToolStripMenuItem();
this.cmToCI4RGB5A3 = new System.Windows.Forms.ToolStripMenuItem();
this.cmToCI4RGB565 = new System.Windows.Forms.ToolStripMenuItem();
this.cmToCI4IA8 = new System.Windows.Forms.ToolStripMenuItem();
this.Panel.SuspendLayout();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbPic)).BeginInit();
this.cmFormat.SuspendLayout();
this.SuspendLayout();
//
// Panel
//
this.Panel.Controls.Add(this.cbCheckerBoard);
this.Panel.Controls.Add(this.btnReplace);
this.Panel.Controls.Add(this.btnClose);
this.Panel.Controls.Add(this.cbIcon);
this.Panel.Controls.Add(this.lbIcon);
this.Panel.Controls.Add(this.lbBanner);
this.Panel.Controls.Add(this.cbBanner);
this.Panel.Dock = System.Windows.Forms.DockStyle.Bottom;
this.Panel.Location = new System.Drawing.Point(0, 434);
this.Panel.Name = "Panel";
this.Panel.Size = new System.Drawing.Size(817, 28);
this.Panel.TabIndex = 0;
//
// cbCheckerBoard
//
this.cbCheckerBoard.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.cbCheckerBoard.AutoSize = true;
this.cbCheckerBoard.Checked = true;
this.cbCheckerBoard.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbCheckerBoard.Location = new System.Drawing.Point(390, 7);
this.cbCheckerBoard.Name = "cbCheckerBoard";
this.cbCheckerBoard.Size = new System.Drawing.Size(93, 17);
this.cbCheckerBoard.TabIndex = 4;
this.cbCheckerBoard.Text = "Checkerboard";
this.cbCheckerBoard.UseVisualStyleBackColor = true;
this.cbCheckerBoard.CheckedChanged += new System.EventHandler(this.cbCheckerBoard_CheckedChanged);
//
// 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(513, 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)));
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnClose.Location = new System.Drawing.Point(670, 4);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(137, 21);
this.btnClose.TabIndex = 3;
this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// cbIcon
//
this.cbIcon.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.cbIcon.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbIcon.FormattingEnabled = true;
this.cbIcon.Location = new System.Drawing.Point(234, 4);
this.cbIcon.MaxDropDownItems = 20;
this.cbIcon.Name = "cbIcon";
this.cbIcon.Size = new System.Drawing.Size(121, 21);
this.cbIcon.TabIndex = 1;
this.cbIcon.SelectedIndexChanged += new System.EventHandler(this.cbIcon_SelectedIndexChanged);
//
// lbIcon
//
this.lbIcon.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lbIcon.AutoSize = true;
this.lbIcon.Location = new System.Drawing.Point(198, 7);
this.lbIcon.Name = "lbIcon";
this.lbIcon.Size = new System.Drawing.Size(31, 13);
this.lbIcon.TabIndex = 2;
this.lbIcon.Text = "Icon:";
//
// lbBanner
//
this.lbBanner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lbBanner.AutoSize = true;
this.lbBanner.Location = new System.Drawing.Point(3, 7);
this.lbBanner.Name = "lbBanner";
this.lbBanner.Size = new System.Drawing.Size(44, 13);
this.lbBanner.TabIndex = 1;
this.lbBanner.Text = "Banner:";
//
// cbBanner
//
this.cbBanner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.cbBanner.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbBanner.FormattingEnabled = true;
this.cbBanner.Location = new System.Drawing.Point(51, 4);
this.cbBanner.MaxDropDownItems = 20;
this.cbBanner.Name = "cbBanner";
this.cbBanner.Size = new System.Drawing.Size(121, 21);
this.cbBanner.TabIndex = 0;
this.cbBanner.SelectedIndexChanged += new System.EventHandler(this.cbBanner_SelectedIndexChanged);
//
// panel1
//
this.panel1.Controls.Add(this.lbTip);
this.panel1.Controls.Add(this.lbFormat);
this.panel1.Controls.Add(this.lbFormatText);
this.panel1.Controls.Add(this.lbSize);
this.panel1.Controls.Add(this.lbSizeText);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(817, 22);
this.panel1.TabIndex = 2;
//
// lbFormat
//
this.lbFormat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lbFormat.AutoSize = true;
this.lbFormat.Location = new System.Drawing.Point(729, 5);
this.lbFormat.Name = "lbFormat";
this.lbFormat.Size = new System.Drawing.Size(43, 13);
this.lbFormat.TabIndex = 3;
this.lbFormat.Text = "RGBA8";
//
// lbFormatText
//
this.lbFormatText.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lbFormatText.Location = new System.Drawing.Point(523, 5);
this.lbFormatText.Name = "lbFormatText";
this.lbFormatText.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.lbFormatText.Size = new System.Drawing.Size(205, 13);
this.lbFormatText.TabIndex = 2;
this.lbFormatText.Text = "Texture Format:";
this.lbFormatText.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// lbSize
//
this.lbSize.AutoSize = true;
this.lbSize.Location = new System.Drawing.Point(39, 5);
this.lbSize.Name = "lbSize";
this.lbSize.Size = new System.Drawing.Size(30, 13);
this.lbSize.TabIndex = 1;
this.lbSize.Text = "0 x 0";
//
// lbSizeText
//
this.lbSizeText.AutoSize = true;
this.lbSizeText.Location = new System.Drawing.Point(4, 5);
this.lbSizeText.Name = "lbSizeText";
this.lbSizeText.Size = new System.Drawing.Size(30, 13);
this.lbSizeText.TabIndex = 0;
this.lbSizeText.Text = "Size:";
//
// pbPic
//
this.pbPic.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pbPic.Dock = System.Windows.Forms.DockStyle.Fill;
this.pbPic.Location = new System.Drawing.Point(0, 22);
this.pbPic.Name = "pbPic";
this.pbPic.Size = new System.Drawing.Size(817, 412);
this.pbPic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pbPic.TabIndex = 3;
this.pbPic.TabStop = false;
//
// cmFormat
//
this.cmFormat.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cmRGBA8,
this.cmRGB565,
this.cmRGB5A3,
this.cmIA8,
this.cmIA4,
this.cmI8,
this.cmI4,
this.cmCI8,
this.cmCI4,
this.toolStripSeparator1,
this.cmChangeFormat});
this.cmFormat.Name = "cmFormat";
this.cmFormat.Size = new System.Drawing.Size(267, 252);
//
// cmRGBA8
//
this.cmRGBA8.Name = "cmRGBA8";
this.cmRGBA8.Size = new System.Drawing.Size(266, 22);
this.cmRGBA8.Tag = "rgba8";
this.cmRGBA8.Text = "As RGBA8 (High Quality with Alpha)";
this.cmRGBA8.Click += new System.EventHandler(this.cmFormat_Click);
//
// cmRGB565
//
this.cmRGB565.Name = "cmRGB565";
this.cmRGB565.Size = new System.Drawing.Size(266, 22);
this.cmRGB565.Tag = "rgb565";
this.cmRGB565.Text = "As RGB565 (Moderate Quality)";
this.cmRGB565.Click += new System.EventHandler(this.cmFormat_Click);
//
// cmRGB5A3
//
this.cmRGB5A3.Name = "cmRGB5A3";
this.cmRGB5A3.Size = new System.Drawing.Size(266, 22);
this.cmRGB5A3.Tag = "rgb5a3";
this.cmRGB5A3.Text = "As RGB5A3 (Low Quality with Alpha)";
this.cmRGB5A3.Click += new System.EventHandler(this.cmFormat_Click);
//
// cmIA8
//
this.cmIA8.Name = "cmIA8";
this.cmIA8.Size = new System.Drawing.Size(266, 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(266, 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(266, 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(266, 22);
this.cmI4.Tag = "i4";
this.cmI4.Text = "As I4 (B/W)";
this.cmI4.Click += new System.EventHandler(this.cmFormat_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(263, 6);
//
// cmChangeFormat
//
this.cmChangeFormat.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cmToRGBA8,
this.cmToRGB565,
this.cmToRGB5A3,
this.cmToIA8,
this.cmToIA4,
this.cmToI8,
this.cmToI4,
this.cmToCI8,
this.cmToCI4});
this.cmChangeFormat.Name = "cmChangeFormat";
this.cmChangeFormat.Size = new System.Drawing.Size(266, 22);
this.cmChangeFormat.Text = "Change Format";
//
// cmToRGBA8
//
this.cmToRGBA8.Name = "cmToRGBA8";
this.cmToRGBA8.Size = new System.Drawing.Size(267, 22);
this.cmToRGBA8.Tag = "rgba8";
this.cmToRGBA8.Text = "To RGBA8 (High Quality with Alpha)";
this.cmToRGBA8.Click += new System.EventHandler(this.cmChangeFormat_Click);
//
// cmToRGB565
//
this.cmToRGB565.Name = "cmToRGB565";
this.cmToRGB565.Size = new System.Drawing.Size(267, 22);
this.cmToRGB565.Tag = "rgb565";
this.cmToRGB565.Text = "To RGB565 (Moderate Quality)";
this.cmToRGB565.Click += new System.EventHandler(this.cmChangeFormat_Click);
//
// cmToRGB5A3
//
this.cmToRGB5A3.Name = "cmToRGB5A3";
this.cmToRGB5A3.Size = new System.Drawing.Size(267, 22);
this.cmToRGB5A3.Tag = "rgb5a3";
this.cmToRGB5A3.Text = "To RGB5A3 (Low Quality with Alpha)";
this.cmToRGB5A3.Click += new System.EventHandler(this.cmChangeFormat_Click);
//
// cmToIA8
//
this.cmToIA8.Name = "cmToIA8";
this.cmToIA8.Size = new System.Drawing.Size(267, 22);
this.cmToIA8.Tag = "ia8";
this.cmToIA8.Text = "To IA8 (B/W with Alpha)";
this.cmToIA8.Click += new System.EventHandler(this.cmChangeFormat_Click);
//
// cmToIA4
//
this.cmToIA4.Name = "cmToIA4";
this.cmToIA4.Size = new System.Drawing.Size(267, 22);
this.cmToIA4.Tag = "ia4";
this.cmToIA4.Text = "To IA4 (B/W with Alpha)";
this.cmToIA4.Click += new System.EventHandler(this.cmChangeFormat_Click);
//
// cmToI8
//
this.cmToI8.Name = "cmToI8";
this.cmToI8.Size = new System.Drawing.Size(267, 22);
this.cmToI8.Tag = "i8";
this.cmToI8.Text = "To I8 (B/W)";
this.cmToI8.Click += new System.EventHandler(this.cmChangeFormat_Click);
//
// cmToI4
//
this.cmToI4.Name = "cmToI4";
this.cmToI4.Size = new System.Drawing.Size(267, 22);
this.cmToI4.Tag = "i4";
this.cmToI4.Text = "To I4 (B/W)";
this.cmToI4.Click += new System.EventHandler(this.cmChangeFormat_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;
//
// cmCI8
//
this.cmCI8.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cmCI8RGB5A3,
this.cmCI8RGB565,
this.cmCI8IA8});
this.cmCI8.Name = "cmCI8";
this.cmCI8.Size = new System.Drawing.Size(266, 22);
this.cmCI8.Text = "As CI8 (Indexed, max. 256 Colors)";
//
// cmCI4
//
this.cmCI4.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cmCI4RGB5A3,
this.cmCI4RGB565,
this.cmCI4IA8});
this.cmCI4.Name = "cmCI4";
this.cmCI4.Size = new System.Drawing.Size(266, 22);
this.cmCI4.Text = "As CI4 (Indexed, max. 16 Colors)";
//
// cmCI8RGB5A3
//
this.cmCI8RGB5A3.Name = "cmCI8RGB5A3";
this.cmCI8RGB5A3.Size = new System.Drawing.Size(283, 22);
this.cmCI8RGB5A3.Tag = "ci8rgb5a3";
this.cmCI8RGB5A3.Text = "With RGB5A3 Palette (Color with Alpha)";
this.cmCI8RGB5A3.Click += new System.EventHandler(this.cmFormat_Click);
//
// cmCI8RGB565
//
this.cmCI8RGB565.Name = "cmCI8RGB565";
this.cmCI8RGB565.Size = new System.Drawing.Size(283, 22);
this.cmCI8RGB565.Tag = "ci8rgb565";
this.cmCI8RGB565.Text = "With RGB565 Palette (Color)";
this.cmCI8RGB565.Click += new System.EventHandler(this.cmFormat_Click);
//
// cmCI8IA8
//
this.cmCI8IA8.Name = "cmCI8IA8";
this.cmCI8IA8.Size = new System.Drawing.Size(283, 22);
this.cmCI8IA8.Tag = "ci8ia8";
this.cmCI8IA8.Text = "With IA8 Palette (B/W with Alpha)";
this.cmCI8IA8.Click += new System.EventHandler(this.cmFormat_Click);
//
// cmCI4RGB5A3
//
this.cmCI4RGB5A3.Name = "cmCI4RGB5A3";
this.cmCI4RGB5A3.Size = new System.Drawing.Size(283, 22);
this.cmCI4RGB5A3.Tag = "ci4rgb5a3";
this.cmCI4RGB5A3.Text = "With RGB5A3 Palette (Color with Alpha)";
this.cmCI4RGB5A3.Click += new System.EventHandler(this.cmFormat_Click);
//
// cmCI4RGB565
//
this.cmCI4RGB565.Name = "cmCI4RGB565";
this.cmCI4RGB565.Size = new System.Drawing.Size(283, 22);
this.cmCI4RGB565.Tag = "ci4rgb565";
this.cmCI4RGB565.Text = "With RGB565 Palette (Color)";
this.cmCI4RGB565.Click += new System.EventHandler(this.cmFormat_Click);
//
// cmCI4IA8
//
this.cmCI4IA8.Name = "cmCI4IA8";
this.cmCI4IA8.Size = new System.Drawing.Size(283, 22);
this.cmCI4IA8.Tag = "ci4ia8";
this.cmCI4IA8.Text = "With IA8 Palette (B/W with Alpha)";
this.cmCI4IA8.Click += new System.EventHandler(this.cmFormat_Click);
//
// lbTip
//
this.lbTip.AutoSize = true;
this.lbTip.ForeColor = System.Drawing.Color.Red;
this.lbTip.Location = new System.Drawing.Point(149, 6);
this.lbTip.Name = "lbTip";
this.lbTip.Size = new System.Drawing.Size(470, 13);
this.lbTip.TabIndex = 4;
this.lbTip.Text = "Tip: Reduce the colors of an image with Photoshop or GIMP to gain better results " +
"with CI formats...";
this.lbTip.Visible = false;
//
// cmToCI8
//
this.cmToCI8.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cmToCI8RGB5A3,
this.cmToCI8RGB565,
this.cmToCI8IA8});
this.cmToCI8.Name = "cmToCI8";
this.cmToCI8.Size = new System.Drawing.Size(267, 22);
this.cmToCI8.Text = "To CI8 (Indexed, max. 256 Colors)";
//
// cmToCI4
//
this.cmToCI4.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cmToCI4RGB5A3,
this.cmToCI4RGB565,
this.cmToCI4IA8});
this.cmToCI4.Name = "cmToCI4";
this.cmToCI4.Size = new System.Drawing.Size(267, 22);
this.cmToCI4.Text = "To CI4 (Indexed, max. 16 Colors)";
//
// cmToCI8RGB5A3
//
this.cmToCI8RGB5A3.Name = "cmToCI8RGB5A3";
this.cmToCI8RGB5A3.Size = new System.Drawing.Size(283, 22);
this.cmToCI8RGB5A3.Tag = "ci8rgb5a3";
this.cmToCI8RGB5A3.Text = "With RGB5A3 Palette (Color with Alpha)";
this.cmToCI8RGB5A3.Click += new System.EventHandler(this.cmChangeFormat_Click);
//
// cmToCI8RGB565
//
this.cmToCI8RGB565.Name = "cmToCI8RGB565";
this.cmToCI8RGB565.Size = new System.Drawing.Size(283, 22);
this.cmToCI8RGB565.Tag = "ci8rgb565";
this.cmToCI8RGB565.Text = "With RGB565 Palette (Color)";
this.cmToCI8RGB565.Click += new System.EventHandler(this.cmChangeFormat_Click);
//
// cmToCI8IA8
//
this.cmToCI8IA8.Name = "cmToCI8IA8";
this.cmToCI8IA8.Size = new System.Drawing.Size(283, 22);
this.cmToCI8IA8.Tag = "ci8ia8";
this.cmToCI8IA8.Text = "With IA8 Palette (B/W with Alpha)";
this.cmToCI8IA8.Click += new System.EventHandler(this.cmChangeFormat_Click);
//
// cmToCI4RGB5A3
//
this.cmToCI4RGB5A3.Name = "cmToCI4RGB5A3";
this.cmToCI4RGB5A3.Size = new System.Drawing.Size(283, 22);
this.cmToCI4RGB5A3.Tag = "ci4rgb5a3";
this.cmToCI4RGB5A3.Text = "With RGB5A3 Palette (Color with Alpha)";
this.cmToCI4RGB5A3.Click += new System.EventHandler(this.cmChangeFormat_Click);
//
// cmToCI4RGB565
//
this.cmToCI4RGB565.Name = "cmToCI4RGB565";
this.cmToCI4RGB565.Size = new System.Drawing.Size(283, 22);
this.cmToCI4RGB565.Tag = "ci4rgb565";
this.cmToCI4RGB565.Text = "With RGB565 Palette (Color)";
this.cmToCI4RGB565.Click += new System.EventHandler(this.cmChangeFormat_Click);
//
// cmToCI4IA8
//
this.cmToCI4IA8.Name = "cmToCI4IA8";
this.cmToCI4IA8.Size = new System.Drawing.Size(283, 22);
this.cmToCI4IA8.Tag = "ci4ia8";
this.cmToCI4IA8.Text = "With IA8 Palette (B/W with Alpha)";
this.cmToCI4IA8.Click += new System.EventHandler(this.cmChangeFormat_Click);
//
// 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);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(833, 500);
this.Name = "CustomizeMii_Preview";
this.Text = "Preview";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Preview_FormClosing);
this.Load += new System.EventHandler(this.Preview_Load);
this.Panel.ResumeLayout(false);
this.Panel.PerformLayout();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pbPic)).EndInit();
this.cmFormat.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel Panel;
private System.Windows.Forms.Label lbIcon;
private System.Windows.Forms.Label lbBanner;
public System.Windows.Forms.ComboBox cbBanner;
public System.Windows.Forms.Button btnClose;
public System.Windows.Forms.ComboBox cbIcon;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.PictureBox pbPic;
private System.Windows.Forms.Label lbSize;
private System.Windows.Forms.Label lbFormat;
public System.Windows.Forms.Label lbSizeText;
public System.Windows.Forms.Label lbFormatText;
public System.Windows.Forms.Button btnReplace;
private System.Windows.Forms.ContextMenuStrip cmFormat;
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;
private System.Windows.Forms.ToolStripMenuItem cmChangeFormat;
private System.Windows.Forms.ToolStripMenuItem cmToRGBA8;
private System.Windows.Forms.ToolStripMenuItem cmToRGB565;
private System.Windows.Forms.ToolStripMenuItem cmToRGB5A3;
private System.Windows.Forms.ToolStripMenuItem cmToIA8;
private System.Windows.Forms.ToolStripMenuItem cmToIA4;
private System.Windows.Forms.ToolStripMenuItem cmToI8;
private System.Windows.Forms.ToolStripMenuItem cmToI4;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.CheckBox cbCheckerBoard;
private System.Windows.Forms.ToolStripMenuItem cmCI8;
private System.Windows.Forms.ToolStripMenuItem cmCI4;
private System.Windows.Forms.ToolStripMenuItem cmCI8RGB5A3;
private System.Windows.Forms.ToolStripMenuItem cmCI8RGB565;
private System.Windows.Forms.ToolStripMenuItem cmCI8IA8;
private System.Windows.Forms.ToolStripMenuItem cmCI4RGB5A3;
private System.Windows.Forms.ToolStripMenuItem cmCI4RGB565;
private System.Windows.Forms.ToolStripMenuItem cmCI4IA8;
private System.Windows.Forms.Label lbTip;
private System.Windows.Forms.ToolStripMenuItem cmToCI8;
private System.Windows.Forms.ToolStripMenuItem cmToCI4;
private System.Windows.Forms.ToolStripMenuItem cmToCI8RGB5A3;
private System.Windows.Forms.ToolStripMenuItem cmToCI8RGB565;
private System.Windows.Forms.ToolStripMenuItem cmToCI8IA8;
private System.Windows.Forms.ToolStripMenuItem cmToCI4RGB5A3;
private System.Windows.Forms.ToolStripMenuItem cmToCI4RGB565;
private System.Windows.Forms.ToolStripMenuItem cmToCI4IA8;
}
}

View File

@ -1,500 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using libWiiSharp;
namespace CustomizeMii
{
public partial class CustomizeMii_Preview : Form
{
private TplImage[][] images = new TplImage[2][];
private U8 bannerBin;
private U8 iconBin;
private string startTPL;
private bool startIcon = false;
Timer tipTimer = new Timer();
public U8 BannerBin { get { return bannerBin; } set { bannerBin = value; } }
public U8 IconBin { get { return iconBin; } set { iconBin = value; } }
public string StartTPL { get { return startTPL; } set { startTPL = value; } }
public bool StartIcon { get { return startIcon; } set { startIcon = value; } }
public CustomizeMii_Preview()
{
InitializeComponent();
this.Icon = global::CustomizeMii.Properties.Resources.CustomizeMii;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
private void Preview_FormClosing(object sender, FormClosingEventArgs e)
{
images = null;
cbBanner.Items.Clear();
cbIcon.Items.Clear();
}
private void Preview_Load(object sender, EventArgs e)
{
this.CenterToParent();
cbBanner.Items.Clear();
cbIcon.Items.Clear();
int startIndex = -1;
List<TplImage> bannerImages = new List<TplImage>();
List<TplImage> iconImages = new List<TplImage>();
for (int i = 0; i < bannerBin.NumOfNodes; i++)
{
if (bannerBin.StringTable[i].ToLower().EndsWith(".tpl"))
{
TplImage tmpImage = new TplImage();
TPL tmpTpl = TPL.Load(bannerBin.Data[i]);
if (i == 10) { }
tmpImage.fileName = bannerBin.StringTable[i];
tmpImage.tplFormat = tmpTpl.GetTextureFormat(0).ToString();
tmpImage.tplImage = tmpTpl.ExtractTexture();
tmpImage.checkerBoard = createCheckerBoard(tmpImage.tplImage.Width, tmpImage.tplImage.Height);
if (tmpImage.tplFormat.StartsWith("CI"))
tmpImage.tplFormat += " + " + tmpTpl.GetPaletteFormat(0);
bannerImages.Add(tmpImage);
}
}
for (int i = 0; i < iconBin.NumOfNodes; i++)
{
if (iconBin.StringTable[i].ToLower().EndsWith(".tpl"))
{
TplImage tmpImage = new TplImage();
TPL tmpTpl = TPL.Load(iconBin.Data[i]);
tmpImage.fileName = iconBin.StringTable[i];
tmpImage.tplFormat = tmpTpl.GetTextureFormat(0).ToString();
tmpImage.tplImage = tmpTpl.ExtractTexture();
tmpImage.checkerBoard = createCheckerBoard(tmpImage.tplImage.Width, tmpImage.tplImage.Height);
if (tmpImage.tplFormat.StartsWith("CI"))
tmpImage.tplFormat += " + " + tmpTpl.GetPaletteFormat(0);
iconImages.Add(tmpImage);
}
}
images[0] = bannerImages.ToArray();
images[1] = iconImages.ToArray();
for (int i = 0; i < images[0].Length; i++)
{
cbBanner.Items.Add(images[0][i].fileName);
if (!startIcon)
if (images[0][i].fileName.ToLower() == startTPL.ToLower())
startIndex = i;
}
for (int i = 0; i < images[1].Length; i++)
{
cbIcon.Items.Add(images[1][i].fileName);
if (startIcon)
if (images[1][i].fileName.ToLower() == startTPL.ToLower())
startIndex = i;
}
try
{
if (startIndex != -1)
if (!startIcon)
cbBanner.SelectedIndex = startIndex;
else
cbIcon.SelectedIndex = startIndex;
}
catch { }
if (cbBanner.SelectedIndex != -1) cbBanner.Select();
else if (cbIcon.SelectedIndex != -1) cbIcon.Select();
tipTimer.Interval = 7000;
tipTimer.Tag = 0;
tipTimer.Tick += new EventHandler(tipTimer_Tick);
}
void tipTimer_Tick(object sender, EventArgs e)
{
lbTip.Visible = false;
tipTimer.Stop();
}
private void cbBanner_SelectedIndexChanged(object sender, EventArgs e)
{
if (cbBanner.SelectedIndex != -1)
{
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 (cbCheckerBoard.Checked) pbPic.BackgroundImage = images[0][cbBanner.SelectedIndex].checkerBoard;
cbIcon.SelectedIndex = -1;
}
}
private void cbIcon_SelectedIndexChanged(object sender, EventArgs e)
{
if (cbIcon.SelectedIndex != -1)
{
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 (cbCheckerBoard.Checked) pbPic.BackgroundImage = images[1][cbIcon.SelectedIndex].checkerBoard;
cbBanner.SelectedIndex = -1;
}
}
private Image resizeImage(Image img, int x, int y)
{
Image newimage = new Bitmap(x, y);
using (Graphics gfx = Graphics.FromImage(newimage))
gfx.DrawImage(img, 0, 0, x, y);
return newimage;
}
private Image createCheckerBoard(int w, int h)
{
Color darkColor = Color.DarkGray;
Color lightColor = Color.White;
int tileSize = 10;
Bitmap img = new Bitmap(w, h);
using (Graphics g = Graphics.FromImage(img))
{
g.Clear(lightColor);
for (int col = 0; col < w; col += tileSize)
{
for (int row = 0; row < h; row += tileSize)
{
Color curColor;
if ((col / tileSize) % 2 == 0)
curColor = (row / tileSize) % 2 == 0 ? darkColor : lightColor;
else
curColor = (row / tileSize) % 2 == 0 ? lightColor : darkColor;
if (curColor == lightColor) continue;
Rectangle rect = new Rectangle(col, row, tileSize, tileSize);
g.FillRectangle(new SolidBrush(darkColor), rect);
}
}
}
return (Image)img;
}
private void btnReplace_Click(object sender, EventArgs e)
{
cmFormat.Show(MousePosition);
}
private void cmFormat_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "PNG|*.png|JPG|*.jpg|GIF|*.gif|BMP|*.bmp|TPL|*.tpl|All|*.png;*.jpg;*.gif;*.bmp;*.tpl";
ofd.FilterIndex = 6;
if (ofd.ShowDialog() == DialogResult.OK)
{
try
{
string tplName;
TPL tmpTpl = new TPL();
Image newImg;
if (cbIcon.SelectedIndex == -1)
{
tplName = cbBanner.SelectedItem.ToString().ToLower();
tmpTpl.LoadFile(bannerBin.Data[bannerBin.GetNodeIndex(tplName)]);
}
else
{
tplName = cbIcon.SelectedItem.ToString().ToLower();
tmpTpl.LoadFile(iconBin.Data[iconBin.GetNodeIndex(tplName)]);
}
if (!ofd.FileName.ToLower().EndsWith(".tpl")) newImg = Image.FromFile(ofd.FileName);
else
{
TPL newTpl = TPL.Load(ofd.FileName);
newImg = newTpl.ExtractTexture();
}
Size tplSize = tmpTpl.GetTextureSize(0);
if (newImg.Width != tplSize.Width ||
newImg.Height != tplSize.Height)
newImg = resizeImage(newImg, tplSize.Width, tplSize.Height);
ToolStripMenuItem cmSender = sender as ToolStripMenuItem;
TPL_TextureFormat tplFormat;
TPL_PaletteFormat pFormat = TPL_PaletteFormat.RGB5A3;
switch (cmSender.Tag.ToString().ToLower())
{
case "i4":
tplFormat = TPL_TextureFormat.I4;
break;
case "i8":
tplFormat = TPL_TextureFormat.I8;
break;
case "ia4":
tplFormat = TPL_TextureFormat.IA4;
break;
case "ia8":
tplFormat = TPL_TextureFormat.IA8;
break;
case "rgb565":
tplFormat = TPL_TextureFormat.RGB565;
break;
case "rgb5a3":
tplFormat = TPL_TextureFormat.RGB5A3;
break;
case "ci8rgb5a3":
tplFormat = TPL_TextureFormat.CI8;
pFormat = TPL_PaletteFormat.RGB5A3;
break;
case "ci8rgb565":
tplFormat = TPL_TextureFormat.CI8;
pFormat = TPL_PaletteFormat.RGB565;
break;
case "ci8ia8":
tplFormat = TPL_TextureFormat.CI8;
pFormat = TPL_PaletteFormat.IA8;
break;
case "ci4rgb5a3":
tplFormat = TPL_TextureFormat.CI4;
pFormat = TPL_PaletteFormat.RGB5A3;
break;
case "ci4rgb565":
tplFormat = TPL_TextureFormat.CI4;
pFormat = TPL_PaletteFormat.RGB565;
break;
case "ci4ia8":
tplFormat = TPL_TextureFormat.CI4;
pFormat = TPL_PaletteFormat.IA8;
break;
default:
tplFormat = TPL_TextureFormat.RGBA8;
break;
}
tmpTpl.RemoveTexture(0);
tmpTpl.AddTexture(newImg, tplFormat, pFormat);
if (cbBanner.SelectedIndex != -1)
{
bannerBin.ReplaceFile(bannerBin.GetNodeIndex(tplName), tmpTpl.ToByteArray());
images[0][cbBanner.SelectedIndex].tplImage = tmpTpl.ExtractTexture();
images[0][cbBanner.SelectedIndex].tplFormat = tmpTpl.GetTextureFormat(0).ToString();
if (images[0][cbBanner.SelectedIndex].tplFormat.StartsWith("CI"))
images[0][cbBanner.SelectedIndex].tplFormat += " + " + tmpTpl.GetPaletteFormat(0);
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
{
iconBin.ReplaceFile(iconBin.GetNodeIndex(tplName), tmpTpl.ToByteArray());
images[1][cbIcon.SelectedIndex].tplImage = tmpTpl.ExtractTexture();
images[1][cbIcon.SelectedIndex].tplFormat = tmpTpl.GetTextureFormat(0).ToString();
if (images[1][cbIcon.SelectedIndex].tplFormat.StartsWith("CI"))
images[1][cbIcon.SelectedIndex].tplFormat += " + " + tmpTpl.GetPaletteFormat(0);
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();
if (tplFormat == TPL_TextureFormat.CI4 || tplFormat == TPL_TextureFormat.CI8)
{
lbTip.Visible = true;
tipTimer.Start();
}
}
catch (Exception ex)
{ MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
}
}
private void cmChangeFormat_Click(object sender, EventArgs e)
{
try
{
string tplName;
TPL tmpTpl = new TPL();
Image newImg;
if (cbIcon.SelectedIndex == -1)
{
tplName = cbBanner.SelectedItem.ToString().ToLower();
tmpTpl.LoadFile(bannerBin.Data[bannerBin.GetNodeIndex(tplName)]);
}
else
{
tplName = cbIcon.SelectedItem.ToString().ToLower();
tmpTpl.LoadFile(iconBin.Data[iconBin.GetNodeIndex(tplName)]);
}
newImg = tmpTpl.ExtractTexture();
TPL_TextureFormat tplFormat;
TPL_PaletteFormat pFormat = TPL_PaletteFormat.RGB5A3;
ToolStripMenuItem cmSender = sender as ToolStripMenuItem;
switch (cmSender.Tag.ToString().ToLower())
{
case "i4":
tplFormat = TPL_TextureFormat.I4;
break;
case "i8":
tplFormat = TPL_TextureFormat.I8;
break;
case "ia4":
tplFormat = TPL_TextureFormat.IA4;
break;
case "ia8":
tplFormat = TPL_TextureFormat.IA8;
break;
case "rgb565":
tplFormat = TPL_TextureFormat.RGB565;
break;
case "rgb5a3":
tplFormat = TPL_TextureFormat.RGB5A3;
break;
case "ci8rgb5a3":
tplFormat = TPL_TextureFormat.CI8;
pFormat = TPL_PaletteFormat.RGB5A3;
break;
case "ci8rgb565":
tplFormat = TPL_TextureFormat.CI8;
pFormat = TPL_PaletteFormat.RGB565;
break;
case "ci8ia8":
tplFormat = TPL_TextureFormat.CI8;
pFormat = TPL_PaletteFormat.IA8;
break;
case "ci4rgb5a3":
tplFormat = TPL_TextureFormat.CI4;
pFormat = TPL_PaletteFormat.RGB5A3;
break;
case "ci4rgb565":
tplFormat = TPL_TextureFormat.CI4;
pFormat = TPL_PaletteFormat.RGB565;
break;
case "ci4ia8":
tplFormat = TPL_TextureFormat.CI4;
pFormat = TPL_PaletteFormat.IA8;
break;
default:
tplFormat = TPL_TextureFormat.RGBA8;
break;
}
if (tmpTpl.GetTextureFormat(0) == tplFormat) return;
tmpTpl.RemoveTexture(0);
tmpTpl.AddTexture(newImg, tplFormat, pFormat);
if (cbBanner.SelectedIndex != -1)
{
bannerBin.ReplaceFile(bannerBin.GetNodeIndex(tplName), tmpTpl.ToByteArray());
images[0][cbBanner.SelectedIndex].tplImage = tmpTpl.ExtractTexture();
images[0][cbBanner.SelectedIndex].tplFormat = tmpTpl.GetTextureFormat(0).ToString();
if (images[0][cbBanner.SelectedIndex].tplFormat.StartsWith("CI"))
images[0][cbBanner.SelectedIndex].tplFormat += " + " + tmpTpl.GetPaletteFormat(0);
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
{
iconBin.ReplaceFile(iconBin.GetNodeIndex(tplName), tmpTpl.ToByteArray());
images[1][cbIcon.SelectedIndex].tplImage = tmpTpl.ExtractTexture();
images[1][cbIcon.SelectedIndex].tplFormat = tmpTpl.GetTextureFormat(0).ToString();
if (images[1][cbIcon.SelectedIndex].tplFormat.StartsWith("CI"))
images[1][cbIcon.SelectedIndex].tplFormat += " + " + tmpTpl.GetPaletteFormat(0);
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();
if (tplFormat == TPL_TextureFormat.CI4 || tplFormat == TPL_TextureFormat.CI8)
{
lbTip.Visible = true;
tipTimer.Start();
}
}
catch (Exception ex)
{ MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
}
private void cbCheckerBoard_CheckedChanged(object sender, EventArgs e)
{
if (cbCheckerBoard.Checked)
{
if (cbBanner.SelectedIndex != -1)
pbPic.BackgroundImage = images[0][cbBanner.SelectedIndex].checkerBoard;
else
pbPic.BackgroundImage = images[1][cbIcon.SelectedIndex].checkerBoard;
}
else pbPic.BackgroundImage = null;
if (cbBanner.SelectedIndex != -1)
cbBanner.Focus();
else
cbIcon.Focus();
}
}
}

View File

@ -1,126 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="cmFormat.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>14, 7</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>36</value>
</metadata>
</root>

File diff suppressed because it is too large Load Diff

View File

@ -1,82 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace CustomizeMii
{
public struct TplImage
{
public System.Drawing.Image tplImage;
public System.Drawing.Image checkerBoard;
public string tplFormat;
public string fileName;
}
public struct TransmitInfo
{
public double compressionRatio;
public double transmittedLength;
public int timeElapsed;
}
public struct BnsConversionInfo
{
public enum LoopType
{
None,
FromWave,
Manual
}
public LoopType loopType;
public int loopStartSample;
public string audioFile;
public bool stereoToMono;
}
public struct WadCreationInfo
{
public enum NandLoader : int
{
comex = 0,
Waninkoko = 1,
}
public string titleId;
public string[] titles;
public string allLangTitle;
public int startupIos;
public string sound;
public string dol;
public string outFile;
public NandLoader nandLoader;
public bool sendToWii;
public libWiiSharp.Protocol transmitProtocol;
public string transmitIp;
public int transmitIos;
public bool saveAfterTransmit;
public bool success;
public bool sendWadReady;
public byte[] wadFile;
public bool lz77;
}
public struct Progress
{
public int progressValue;
public string progressState;
}
}

View File

@ -1,169 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace CustomizeMii
{
partial class CustomizeMii_Transmit
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.lbProtocol = new System.Windows.Forms.Label();
this.cmbProtocol = new System.Windows.Forms.ComboBox();
this.lbIP = new System.Windows.Forms.Label();
this.tbIP = new System.Windows.Forms.TextBox();
this.lbIOS = new System.Windows.Forms.Label();
this.tbIOS = new System.Windows.Forms.TextBox();
this.btnTransmit = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lbProtocol
//
this.lbProtocol.AutoSize = true;
this.lbProtocol.Location = new System.Drawing.Point(12, 16);
this.lbProtocol.Name = "lbProtocol";
this.lbProtocol.Size = new System.Drawing.Size(49, 13);
this.lbProtocol.TabIndex = 0;
this.lbProtocol.Text = "Protocol:";
//
// cmbProtocol
//
this.cmbProtocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbProtocol.FormattingEnabled = true;
this.cmbProtocol.Items.AddRange(new object[] {
"Homebrew Channel 1.0.5+ (JODI)",
"Homebrew Channel -1.0.4 (HAXX)"});
this.cmbProtocol.Location = new System.Drawing.Point(67, 13);
this.cmbProtocol.Name = "cmbProtocol";
this.cmbProtocol.Size = new System.Drawing.Size(194, 21);
this.cmbProtocol.TabIndex = 1;
//
// lbIP
//
this.lbIP.AutoSize = true;
this.lbIP.Location = new System.Drawing.Point(12, 48);
this.lbIP.Name = "lbIP";
this.lbIP.Size = new System.Drawing.Size(61, 13);
this.lbIP.TabIndex = 2;
this.lbIP.Text = "IP Address:";
//
// tbIP
//
this.tbIP.Location = new System.Drawing.Point(79, 45);
this.tbIP.Name = "tbIP";
this.tbIP.Size = new System.Drawing.Size(182, 20);
this.tbIP.TabIndex = 3;
//
// lbIOS
//
this.lbIOS.AutoSize = true;
this.lbIOS.Location = new System.Drawing.Point(12, 78);
this.lbIOS.Name = "lbIOS";
this.lbIOS.Size = new System.Drawing.Size(127, 13);
this.lbIOS.TabIndex = 4;
this.lbIOS.Text = "IOS to use for installation:";
//
// tbIOS
//
this.tbIOS.Location = new System.Drawing.Point(145, 75);
this.tbIOS.Name = "tbIOS";
this.tbIOS.Size = new System.Drawing.Size(116, 20);
this.tbIOS.TabIndex = 5;
this.tbIOS.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbIOS_KeyPress);
//
// btnTransmit
//
this.btnTransmit.Location = new System.Drawing.Point(15, 109);
this.btnTransmit.Name = "btnTransmit";
this.btnTransmit.Size = new System.Drawing.Size(120, 23);
this.btnTransmit.TabIndex = 6;
this.btnTransmit.Text = "Transmit";
this.btnTransmit.UseVisualStyleBackColor = true;
this.btnTransmit.Click += new System.EventHandler(this.btnTransmit_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(141, 109);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(120, 23);
this.btnCancel.TabIndex = 6;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// CustomizeMii_Transmit
//
this.AcceptButton = this.btnTransmit;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Control;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(273, 145);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnTransmit);
this.Controls.Add(this.tbIOS);
this.Controls.Add(this.lbIOS);
this.Controls.Add(this.tbIP);
this.Controls.Add(this.lbIP);
this.Controls.Add(this.cmbProtocol);
this.Controls.Add(this.lbProtocol);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "CustomizeMii_Transmit";
this.Text = "CustomizeMii_Transmit";
this.Load += new System.EventHandler(this.CustomizeMii_Transmit_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lbProtocol;
private System.Windows.Forms.ComboBox cmbProtocol;
private System.Windows.Forms.Label lbIP;
private System.Windows.Forms.TextBox tbIP;
private System.Windows.Forms.Label lbIOS;
private System.Windows.Forms.TextBox tbIOS;
private System.Windows.Forms.Button btnTransmit;
private System.Windows.Forms.Button btnCancel;
}
}

View File

@ -1,92 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace CustomizeMii
{
public partial class CustomizeMii_Transmit : Form
{
public int Protocol { get { return cmbProtocol.SelectedIndex; } set { cmbProtocol.SelectedIndex = value; } }
public string IPAddress { get { return tbIP.Text; } set { tbIP.Text = value; } }
public string IOS { get { return tbIOS.Text; } set { tbIOS.Text = value; } }
public CustomizeMii_Transmit()
{
InitializeComponent();
}
private void CustomizeMii_Transmit_Load(object sender, System.EventArgs e)
{
this.CenterToParent();
try
{
cmbProtocol.SelectedIndex = Properties.Settings.Default.Protocol;
tbIP.Text = Properties.Settings.Default.IP;
tbIOS.Text = Properties.Settings.Default.IOS;
}
catch { }
}
private void btnCancel_Click(object sender, System.EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void btnTransmit_Click(object sender, System.EventArgs e)
{
string IpPattern = @"([01]?\d\d?|2[0-4]\d|25[0-5])\." +
@"([01]?\d\d?|2[0-4]\d|25[0-5])\." +
@"([01]?\d\d?|2[0-4]\d|25[0-5])\." +
@"([01]?\d\d?|2[0-4]\d|25[0-5])";
Regex IpAdress = new Regex(IpPattern);
if (IpAdress.IsMatch(tbIP.Text))
{
int tmp = int.Parse(tbIOS.Text);
if (tmp > 0 && tmp < 255)
{
Properties.Settings.Default.Protocol = cmbProtocol.SelectedIndex;
Properties.Settings.Default.IP = tbIP.Text;
Properties.Settings.Default.IOS = tbIOS.Text;
Properties.Settings.Default.Save();
this.DialogResult = DialogResult.OK;
this.Close();
}
else
{
tbIOS.Focus();
tbIOS.SelectAll();
}
}
else
{
tbIP.Focus();
tbIP.SelectAll();
}
}
private void tbIOS_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = !char.IsDigit(e.KeyChar) && e.KeyChar != '\b';
}
}
}

View File

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,138 +0,0 @@
These are some basic instructions for CustomizeMii.
At the very beginning, let me say this again: Don't install any WADs without a proper brick protection!
Ok, so you want to create your own custom channels?
First it is important to understand how the creation of a custom channel with CustomizeMii works.
Skip this if you already know.
Basically, you can't create a channel from scratch. Well, you could, but not with this application.
You need a base WAD which you can modify. You can either download one within this application or use
any WAD (must be a channel of course) from anywhere.
You can then edit the WAD file.
The editing of animations is for advanced users, so if you're not familiar with brlyt's and brlan's
(I guess you're not unless you created your own animations), get a static base WAD or one with the
animation you want.
So, let's start to create a channel. Download a base WAD through the application or load one from your HDD.
You can preview the downloadable WADs through the preview button.
All options below are optional!
MIXING BANNER, ICON AND SOUND
The options below the downloadable base WADs are the "replace" options.
Let's say you have loaded WAD A as a base, but you want the icon of WAD B and you have a 00000000.app that
contains a sound that you want to use.
No problem! Just use the dropdownbox which yet says "Banner" and choose "Icon". Click on the browse button
next to it and choose WAD B. The icon of WAD B will replace the icon of WAD A.
After that, choose "Sound" from the dropdownbox and browse for the 00000000.app, the sound.bin will be
extracted and used instead of the one within WAD A.
Note: These features are non-destructive, i.e. you can always use the clear button to get back to the
banner/icon/sound of WAD A!
CHANNEL INFORMATION
You may want to change the channel information, i.e. the title and ID.
Let's change the channel title first. It's the text that will be displayed when you hold your cursor
over the channel. Goto the "Title" tab and enter a title for all languages. If you want to change the
title for a specific language, just use the language's textbox. If you want a different title for every
language, you don't need to fill in a title for all languages.
You may also use the translate "Channel" button. Enter the english name in the all languages textbox
(e.g. "MPlayer Channel"). Click translate and it will be automatically translated to each language.
Now, the title ID. Open the "Options" tab and you'll see a textbox for the ID. The ID is 4 characters long
and only contains letters and numerics. Lower case letters will automatically converted to upper case.
Change it to a unique(!) ID, because channels will overwrite existing channles with the same ID!
I recommend not to use any title ID beginning with the following characters, because official channels
use these and thus your channel may overwrite them:
C, E, F, H, J, L, M, N, P, Q, W
INSERTING A NEW DOL
Let's bring some life into the channel. In the "Options" tab, use the browse button for a new DOL.
Either load a forwarder, the DOL of any application or a WAD to use it's DOL. Note that some applications
require more than just a DOL and thus may not work in a channel (e.g. MPlayer CE).
Choose a NAND loader or just stick with the one selected (both will do fine).
You can also use the built-in forwarder creation by using the forwarder button right below the browse button
for DOLs.
You need the ForwardMii.dll in order to use the forwarder creation.
INSERTING A NEW SOUND
For the sound, you can either use a wave or mp3 (needs lame.exe) file or the sound replace function to use
the sound of an existing sound.bin/00000000.app/WAD.
If you want looped sound, open your wave file with wavosaur and add loop points before.
To save space, you can convert your wav or mp3 files to BNS. You can take the loop from a prelooped wave file
or enter the loop start point manually. Wave files must be 16bit PCM.
It is possible to directly convert stereo Wave files to mono BNS files, note that only the left channel of
the Wave will be taken.
EDITING THE BANNER/ICON (If you're an advanced user and want to edit the brlyt/brlan, do that first!)
So, let's begin with the real customization. I will only talk about the banner here, the instructions
are the same for the icon.
Goto the "Banner" tab. You shouldn't touch the add and remove buttons, they're for advanced users that
change the animation. (However, they can't really harm your channel, as CustomizeMii will check for missing
and unneeded TPLs while creating a WAD).
You will see a list with all TPLs inside the banner.bin. When you select a TPL,
it's current format will be shown in the "Format" dropdownbox. Note that CustomizeMii can read 8 different
TPL formats, but only write 3 (RGBA8, RGB565 and RGB5A3), that should be enough for your needs.
You can use the preview button to preview a TPL (obvious, right?), but you get one more important info,
the image size. It will be shown in the title of the preview window. If your images aren't the same size,
they will be resized! So be sure to have at least the correct aspect ratio, so your images wont be
squeezed or whatever.
Before replacing the image, choose a format from the dropdownbox.
(RGBA8 = High Quality, Big Size --- RGB565 = Moderate Quality, Small Size --- RGB5A3 = Bad Quality, Small Size)
Now you can use the replace button to insert your image. Preview the TPL after replacing to check the
image. Maybe you want to use another format though? No problem, just replace the TPL again.
Note: You can use the "Make Transparent" checkbox to make a TPL transparent, e.g. if you don't like
one piece of an animation (It's non-destructive, i.e. you can always uncheck the box).
EDITING THE ANIMATION (Advanced users only!)
Skip this part, if you don't really know what brlyt and brlan files are and how they're structured.
Goto the "Layout" tab. You will see the banner.brlyt and icon.brlyt there.
Above the buttons is a text that will indicate whether you're doing actions on the "Banner" or
the "Icon" (When you select the banner.brlyt, you're editing the "Banner" and vice versa).
Now, just replace the banner.brlyt and icon.brlyt files as you want. You can use the list TPLs button
afterwards to see all TPLs that are required by the banner.brlyt/icon.brlyt (Don't worry, CustomizeMii
won't let you create a WAD, if you forgot a required TPL).
Now, goto the "Animation" tab. It's similar to the "Layout" tab. You shouldn't touch the add or delete button
unless your base WAD only has a banner.brlan and you want to use a banner_Start.brlan and banner_Loop.brlan.
In this case, first add the two files and then delete the old banner.brlan.
Else just replace the files with yours. Be absolutely sure the your brlan files only refer to panes that are
indicated in your brlyt files!
That's it, here's nothing left to do.
CREATING THE WAD (OR SENDING IT TO THE WII)
Well, your channel should be ready to be created.
Just click on the create WAD button.
CustomizeMii will do some failure checks and if all went fine, a save dialog will pop up.
If you get an error or warning, read the message carefully. It should give you enough information to fix
the problem yourself.
You can also send the Channel directly to the Wii. For it to work, the Channel must be less than 4 MB of space.
Make sure the Homebrew Channel is running and connected. Click the send WAD button. Choose a protocol
and enter your Wii's IP and the IOS to use for installation. Click on transmit to start the creation and
transmission process. After the channel was sent, you will be asked if you want to save the Channel.
So, if you got down to here, you're done by now. Please, if you find any bugs or have suggestions, take some
seconds to report them at the issue tracker: http://code.google.com/p/customizemii/issues/list

View File

@ -1,245 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections;
using System.IO;
class MP3Info
{
//Private Variables
private int fileSize;
private int headerPos;
private BitArray bitHeader;
private MpegVersion mpegVersion;
private MpegLayer mpegLayer;
private int bitrate;
private int frequency;
private bool paddingBit;
private int frameLength;
private int frameCount;
private double secLength;
private int waveSamples;
//Public Variables
public int FileSize { get { return fileSize; } }
public MpegVersion MPEGVersion { get { return mpegVersion; } }
public MpegLayer MPEGLayer { get { return mpegLayer; } }
public int Bitrate { get { return bitrate; } }
public int Frequency { get { return frequency; } }
public int FrameLength { get { return frameLength; } }
public int FrameCount { get { return frameCount; } }
public double Seconds { get { return secLength; } }
public int AudioSamples { get { return waveSamples; } }
//Public Functions
public MP3Info(string mp3File)
{
FileInfo fi = new FileInfo(mp3File);
this.fileSize = (int)fi.Length;
FileStream fs = fi.OpenRead();
fs.Seek(0, SeekOrigin.Begin);
this.headerPos = SearchHeader(fs);
byte[] header = new byte[4];
fs.Seek(this.headerPos, SeekOrigin.Begin);
fs.Read(header, 0, header.Length);
fs.Close();
GetHeaderBits(header);
LoadHeader();
}
public MP3Info(byte[] mp3Header)
{
GetHeaderBits(mp3Header);
LoadHeader();
}
//Private Functions
private void ShowHeader()
{
//For debugging
if (this.bitHeader != null)
{
string strBits = string.Empty;
foreach (bool x in this.bitHeader)
if (x) strBits += "1"; else strBits += "0";
for (int i = strBits.Length - 8; i >= 0; i -= 8)
strBits = strBits.Insert(i, " ");
System.Windows.Forms.MessageBox.Show(strBits);
}
}
private int SearchHeader(Stream fileStream)
{
int tmp;
while ((tmp = fileStream.ReadByte()) != -1)
{
if (tmp == 255)
{
tmp = fileStream.ReadByte();
BitArray tmpBits = new BitArray(new int[] { tmp });
if (tmpBits[7] && tmpBits[6] && tmpBits[5]) return (int)(fileStream.Position - 2);
}
}
throw new Exception("Frame Header couldn't be found!");
}
private void GetHeaderBits(byte[] fourBytes)
{
BitArray tmp = new BitArray(fourBytes);
this.bitHeader = new BitArray(4 * 8);
int count = 0;
for (int i = 0; i < 32; i += 8)
for (int j = 7; j >= 0; j--)
this.bitHeader[count++] = tmp[i + j];
}
private void LoadHeader()
{
GetVersion(this.bitHeader[11], this.bitHeader[12]);
if (this.mpegVersion == MpegVersion.Reserved) throw new NotSupportedException("Unsupported MPEG Version!");
GetLayer(this.bitHeader[13], this.bitHeader[14]);
if (this.mpegLayer == MpegLayer.Reserved) throw new NotSupportedException("Unsupported MPEG Layer!");
GetBitrate(this.bitHeader[16], this.bitHeader[17], this.bitHeader[18], this.bitHeader[19]);
if (this.bitrate == 0) throw new NotSupportedException("Unsupported Bitrate!");
GetFrequency(this.bitHeader[20], this.bitHeader[21]);
if (this.frequency == -1) throw new NotSupportedException("Unsupported Frequency");
this.paddingBit = this.bitHeader[22];
GetFrameLength();
GetFrameCount();
GetSeconds();
GetWaveSamples();
}
private void GetVersion(params bool[] twoBits)
{
if (twoBits[0] && twoBits[1]) this.mpegVersion = MpegVersion.MpegVersion1;
else if (twoBits[0] && !twoBits[1]) this.mpegVersion = MpegVersion.MpegVersion2;
else if (!twoBits[0] && twoBits[1]) this.mpegVersion = MpegVersion.Reserved;
else if (!twoBits[0] && !twoBits[1]) this.mpegVersion = MpegVersion.MpegVersion25;
}
private void GetLayer(params bool[] twoBits)
{
if (twoBits[0] && twoBits[1]) this.mpegLayer = MpegLayer.I;
else if (twoBits[0] && !twoBits[1]) this.mpegLayer = MpegLayer.II;
else if (!twoBits[0] && twoBits[1]) this.mpegLayer = MpegLayer.III;
else if (!twoBits[0] && !twoBits[1]) this.mpegLayer = MpegLayer.Reserved;
}
private void GetBitrate(params bool[] fourBits)
{
int[] bitrateTable = GetBitrateTable();
Array.Reverse(fourBits);
BitArray bArray = new BitArray(fourBits);
byte[] index = new byte[1];
bArray.CopyTo(index, 0);
this.bitrate = bitrateTable[index[0]];
}
private int[] GetBitrateTable()
{
if (this.mpegVersion == MpegVersion.MpegVersion1)
{
if (this.mpegLayer == MpegLayer.I) return new int[] { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 0 };
if (this.mpegLayer == MpegLayer.II) return new int[] { 0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 0 };
if (this.mpegLayer == MpegLayer.III) return new int[] { 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 0 };
}
else
{
if (this.mpegLayer == MpegLayer.I) return new int[] { 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 0 };
if (this.mpegLayer == MpegLayer.II ||
this.mpegLayer == MpegLayer.III) return new int[] { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0 };
}
throw new NotSupportedException("Unsupported MPEG Version or Layer!");
}
private void GetFrequency(params bool[] twoBits)
{
int[] frequencyTable = GetFrequencyTable();
Array.Reverse(twoBits);
BitArray bArray = new BitArray(twoBits);
byte[] index = new byte[1];
bArray.CopyTo(index, 0);
this.frequency = frequencyTable[index[0]];
}
private int[] GetFrequencyTable()
{
if (this.mpegVersion == MpegVersion.MpegVersion1)
return new int[] { 44100, 48000, 32000, -1 };
else if (this.mpegVersion == MpegVersion.MpegVersion2)
return new int[] { 22050, 24000, 16000, -1 };
else if (this.mpegVersion == MpegVersion.MpegVersion25)
return new int[] { 32000, 16000, 8000, -1 };
else
return new int[] { 0, 0, 0, -1 };
}
private void GetFrameLength()
{
double frmSize = (double)((this.mpegLayer == MpegLayer.I ? 12 : 144) * ((1000.0 * (float)this.bitrate / (float)this.frequency)));
this.frameLength = (int)Math.Ceiling(frmSize);
}
private void GetFrameCount()
{
this.frameCount = (this.fileSize - this.headerPos) / this.frameLength;
}
private void GetSeconds()
{
this.secLength = ((this.fileSize - this.headerPos) * 8.00) / (1000.00 * this.bitrate);
}
private void GetWaveSamples()
{
this.waveSamples = this.frameCount * 1125;
}
//Structs & Enums
public enum MpegVersion : int
{
Reserved = 0,
MpegVersion1 = 1,
MpegVersion25 = 2,
MpegVersion2 = 3
}
public enum MpegLayer : int
{
Reserved = 0,
I = 1,
II = 2,
III = 3
}
}

View File

@ -1,55 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Resources;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("CustomizeMii")]
[assembly: AssemblyDescription("A custom channel creator for the Wii")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CustomizeMii")]
[assembly: AssemblyCopyright("Copyright © Leathl 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("b8292272-5915-44f7-a7b1-a347bea3ecd5")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.1.1.0")]
[assembly: AssemblyFileVersion("3.1.1.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View File

@ -1,139 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="btnCreate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\btnCreate.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="btnSend" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\btnSend.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="comex" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\comex.app;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="CustomizeMii" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\CustomizeMii.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Instructions" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\instructions.rtf;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="Waninkoko" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\waninkoko.app;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View File

@ -1,152 +0,0 @@
CustomizeMii is a custom channel creator for the Wii.
The .NET Framework 2.0 is required to run this application!
For any further information, see: http://customizemii.googlecode.com
Please use the issue tracker there to report any occuring bugs.
Thanks to icefire / Xuzz for the basic idea of this application!
-----------------------------------------------------------------------------------------
Changelog:
Version 3.11
- Updated libWiiSharp to 0.21
=> - Fixed detection of loops in wave files
Version 3.1
- Updated libWiiSharp to 0.2
=> - Speed up in TPL conversion
=> - Fixed IA8 TPL code (from/to)
=> - Fixed CI14X2 TPL code (from)
=> - Added conversion to CI4 / CI8
=> - Added BNS to Wave conversion (Extract -> Sound -> As Audiofile)
- Added option to make the sound silent
Version 3.0
- Switched backend to libWiiSharp (http://libwiisharp.googlecode.com)
- Speed improvements through using RAM instead of temp files on HDD
- No separate Mono version anymore, the normal version works with Mono (even compiling forwarders!)
- Fixed complex forwarder loading screen to be fullscreen (thanks wilsoff / tantric!)
- Fixed bug where startup IOS was set to 0 when sending channel to Wii
- Doesn't require common-key.bin anymore
- Added checkerboard for transparent areas in images (preview window)
- Added ability to change a TPLs format (preview window)
- Added ability to rename and resize TPLs (right click on listbox)
Version 2.31
- Fixed sending to Wii
Version 2.3
- Fixed bug when extracting icon images
- Added ability to change the startup IOS (IOS used to launch the title)
- Added support for Korean channel title (reading and writing)
- Added TPL width and height to Banner and Icon list
- Added ability to replace multiple TPLs at once (images must have the same filename!)
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)
- Replaced the TPL preview window with the one from ShowMiiWads for easier handling
- Added loop prelistening to the BNS conversion window (only for wave files)
- Added drag & drop ability cause the file dialogs kept bothering me
- Improvement in startup speed (thanks shadow1643)
- Added creation/last edited time (only for CustomizeMii 2.1+ channels)
- Added a button to translate the word "Channel" to every language
- Improved detection of required TPLs
- Little improvements and fixes
- Changed the complex forwarder to be more configurable (choose any path you want)
- ForwardMii is now bundled with CustomizeMii
Version 2.01
- Base WAD downloading works again
Version 2.0
- Added BNS conversion (Mono and Stereo, with and without loop)
- Fixed MP3 conversion (some files didn't convert)
- Lz77 checkbox is now ticked by default
- Removed Lz77 compression of sound.bin as most sounds will get bigger
- Added ability to insert DOLs from any channel WAD
- Added ability to re-add the interal DOL (To switch the NAND Loader)
- Added ability to extract the contents, DOL, sound and all images
- Added displaying of approx. blocks to the success-message
- Deleted some functions of the complex forwarder as they weren't working properly
- Some bugfixes and improvements
Version 1.2
- Fixed writing/reading of channel titles, so japanese characters will work now
- Added checkbox (Options tab) to turn security checks off
- Added built-in forwarder creator (Needs the ForwardMii.dll which is separately avaiable)
- You can choose MP3 files as channel sound (Needs lame.exe in application directory)
- Bugfixes
Version 1.1
- Note: License upgraded to GNU GPL v3!
- Sound is working now
- Added brlan and brlyt tabs (for advanced users)
- Added displaying of image width and height in preview window
- Added "Make Transparent" checkbox for TPLs
- Fixed IA8 previewing / extracting
- Improved bricksafety (hopefully!)
- Added Tooltips
- Added update check at startup
- Wrote basic instructions (see Instructions.txt or help tab)
Version 1.0
- Initial Release
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
Disclaimer:
Editing WAD files can result in a brick of your Wii.
Only use this application if you have a bricksafe Wii, meaning either Preloader or
BootMii/boot2 is installed, and if you know what you're doing.
This application comes without any express or implied warranty.
The author can't be held responsible for any damages arising from the use of it.
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
Thanks:
Xuzz for his idea and hard work
WiiCrazy / I.R.on for CustomizeMii Installer
Xuzz, SquidMan, megazig, Matt_P, Omega and The Lemon Man for Wii.py
megazig for his BNS conversion code
SquidMan for Zetsubou
Andre Perrot for gbalzss
comex and Waninkoko for both their NAND Loader
djdynamite123 for the forwarder base files
The USB Loader GX Team for their forwarder source
wilsoff for helping me debugging 3.0
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
License:
Copyright (C) 2009 Leathl
CustomizeMii is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CustomizeMii is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-----------------------------------------------------------------------------------------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

View File

@ -1,138 +0,0 @@
{\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}}
{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}
{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\sl276\slmult1\b\f0\fs17 These are some basic instructions for CustomizeMii.\b0\par
\par
\cf1 At the very beginning, let me say this again: Don't install any WADs without a proper brick protection!\cf0\par
\par
Ok, so you want to create your own custom channels?\par
First it is important to understand how the creation of a custom channel with CustomizeMii works.\par
Skip this if you already know.\par
\par
Basically, you can't create a channel from scratch. Well, you could, but not with this application.\par
You need a base WAD which you can modify. You can either download one within this application or use\par
any WAD (must be a channel of course) from anywhere.\par
You can then edit the WAD file.\par
The editing of animations is for advanced users, so if you're not familiar with brlyt's and brlan's\par
(I guess you're not unless you created your own animations), get a static base WAD or one with the\par
animation you want.\par
\par
So, let's start to create a channel. Download a base WAD through the application or load one from your HDD.\par
You can preview the downloadable WADs through the preview button.\par
All options below are optional!\par
\par
\par
\par
\b MIXING BANNER, ICON AND SOUND\b0\par
\par
The options below the downloadable base WADs are the "replace" options.\par
Let's say you have loaded WAD A as a base, but you want the icon of WAD B and you have a 00000000.app that\par
contains a sound that you want to use.\par
No problem! Just use the dropdownbox which yet says "Banner" and choose "Icon". Click on the browse button\par
next to it and choose WAD B. The icon of WAD B will replace the icon of WAD A.\par
After that, choose "Sound" from the dropdownbox and browse for the 00000000.app, the sound.bin will be\par
extracted and used instead of the one within WAD A.\par
\par
Note: These features are non-destructive, i.e. you can always use the clear button to get back to the\par
banner/icon/sound of WAD A!\par
\par
\par
\par
\b CHANNEL INFORMATION\b0\par
\par
You may want to change the channel information, i.e. the title and ID.\par
Let's change the channel title first. It's the text that will be displayed when you hold your cursor\par
over the channel. Goto the "Title" tab and enter a title for all languages. If you want to change the\par
title for a specific language, just use the language's textbox. If you want a different title for every\par
language, you don't need to fill in a title for all languages.\par
You may also use the translate "Channel" button. Enter the english name in the all languages textbox\par
(e.g. "MPlayer Channel"). Click translate and it will be automatically translated to each language.\par
Now, the title ID. Open the "Options" tab and you'll see a textbox for the ID. The ID is 4 characters long\par
and only contains letters and numerics. Lower case letters will automatically converted to upper case.\par
Change it to a unique(!) ID, because channels will overwrite existing channles with the same ID!\par
\par
\par
\par
\b INSERTING A NEW DOL\b0\par
\par
Let's bring some life into the channel. In the "Options" tab, use the browse button for a new DOL.\par
Either load a forwarder, the DOL of any application or a WAD to use it's DOL. Note that some applications\par
require more than just a DOL and thus may not work in a channel (e.g. MPlayer CE).\par
Choose a NAND loader or just stick with the one selected (both will do fine).\par
\par
You can also use the built-in forwarder creation by using the forwarder button right below the browse button\par
for DOLs.\par
You need the ForwardMii.dll in order to use the forwarder creation.\par
\par
\par
\par
\b INSERTING A NEW SOUND\b0\par
\par
For the sound, you can either use a wave or mp3 (needs lame.exe) file or the sound replace function to use\par
the sound of an existing sound.bin/00000000.app/WAD.\par
If you want looped sound, open your wave file with wavosaur and add loop points before.\par
\par
To save space, you can convert your wav or mp3 files to BNS. You can take the loop from a prelooped wave file\par
or enter the loop start point manually. Wave files must be 16bit PCM.\par
It is possible to directly convert stereo Wave files to mono BNS files, note that only the left channel of\par
the Wave will be taken.\par
\par
\par
\par
\b EDITING THE BANNER/ICON (If you're an advanced user and want to edit the brlyt/brlan, do that first!)\b0\par
\par
So, let's begin with the real customization. I will only talk about the banner here, the instructions\par
are the same for the icon.\par
Goto the "Banner" tab. You shouldn't touch the add and remove buttons, they're for advanced users that\par
change the animation. (However, they can't really harm your channel, as CustomizeMii will check for missing\par
and unneeded TPLs while creating a WAD).\par
You will see a list with all TPLs inside the banner.bin. When you select a TPL,\par
it's current format will be shown in the "Format" dropdownbox. Note that CustomizeMii can read 8 different\par
TPL formats, but only write 3 (RGBA8, RGB565 and RGB5A3), that should be enough for your needs.\par
You can use the preview button to preview a TPL (obvious, right?), but you get one more important info,\par
the image size. It will be shown in the title of the preview window. If your images aren't the same size,\par
they will be resized! So be sure to have at least the correct aspect ratio, so your images wont be\par
squeezed or whatever.\par
Before replacing the image, choose a format from the dropdownbox.\par
(RGBA8 = High Quality, Big Size --- RGB565 = Moderate Quality, Small Size --- RGB5A3 = Bad Quality, Small Size)\par
Now you can use the replace button to insert your image. Preview the TPL after replacing to check the\par
image. Maybe you want to use another format though? No problem, just replace the TPL again.\par
\par
Note: You can use the "Make Transparent" checkbox to make a TPL transparent, e.g. if you don't like\par
one piece of an animation (It's non-destructive, i.e. you can always uncheck the box).\par
\par
\par
\par
\b EDITING THE ANIMATION (Advanced users only!)\b0\par
\par
Skip this part, if you don't really know what brlyt and brlan files are and how they're structured.\par
Goto the "Layout" tab. You will see the banner.brlyt and icon.brlyt there.\par
Above the buttons is a text that will indicate whether you're doing actions on the "Banner" or\par
the "Icon" (When you select the banner.brlyt, you're editing the "Banner" and vice versa).\par
Now, just replace the banner.brlyt and icon.brlyt files as you want. You can use the list TPLs button\par
afterwards to see all TPLs that are required by the banner.brlyt/icon.brlyt (Don't worry, CustomizeMii\par
won't let you create a WAD, if you forgot a required TPL).\par
Now, goto the "Animation" tab. It's similar to the "Layout" tab. You shouldn't touch the add or delete button\par
unless your base WAD only has a banner.brlan and you want to use a banner_Start.brlan and banner_Loop.brlan.\par
In this case, first add the two files and then delete the old banner.brlan.\par
Else just replace the files with yours. Be absolutely sure the your brlan files only refer to panes that are\par
indicated in your brlyt files!\par
That's it, here's nothing left to do.\par
\par
\par
\par
\b CREATING THE WAD\b0\par
\par
Well, your channel should be ready to be created.\par
Just click on the create WAD button.\par
CustomizeMii will do some failure checks and if all went fine, a save dialog will pop up.\par
If you get an error or warning, read the message carefully. It should give you enough information to fix\par
the problem yourself.\par
You can also send the Channel directly to the Wii. For it to work, the Channel must be less than 4 MB of space.\par
Make sure the Homebrew Channel is running and connected. Click the send WAD button. Choose a protocol\par
and enter your Wii's IP and the IOS to use for installation. Click on transmit to start the creation and\par
transmission process. After the channel was sent, you will be asked if you want to save the Channel.\par
\par
So, if you got down to here, you're done by now. Please, if you find any bugs or have suggestions, take some\par
seconds to report them at the issue tracker: {\field{\*\fldinst{HYPERLINK "http://code.google.com/p/customizemii/issues/list"}}{\fldrslt{\ul\cf2 http://code.google.com/p/customizemii/issues/list}}}\lang7\i\f0\fs17\par
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="CustomizeMii.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<CustomizeMii.Properties.Settings>
<setting name="Protocol" serializeAs="String">
<value>0</value>
</setting>
<setting name="IP" serializeAs="String">
<value />
</setting>
<setting name="IOS" serializeAs="String">
<value />
</setting>
</CustomizeMii.Properties.Settings>
</userSettings>
</configuration>

Binary file not shown.

Binary file not shown.

View File

@ -1,58 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{475F3ADF-B529-449F-89DA-BA5E8BE15DD5}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CustomizeMiiInstaller</RootNamespace>
<AssemblyName>CustomizeMiiInstaller</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
</ItemGroup>
<ItemGroup>
<Compile Include="InstallerHelper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\CustomizeMiiInstaller.dol.z" />
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,120 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 WiiCrazy / I.R.on
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.IO;
using System.IO.Compression;
using System.Security.Cryptography;
namespace CustomizeMiiInstaller
{
public class CustomizeMiiInstaller_Plugin
{
const string version = "1.0";
public static string GetVersion()
{
return version;
}
}
public class InstallerHelper
{
public static MemoryStream CreateInstaller(string wadFile, byte iosToUse)
{
return CreateInstaller(File.ReadAllBytes(wadFile), iosToUse);
}
public static MemoryStream CreateInstaller(byte[] wadFileBytes, byte iosToUse)
{
const int injectionPosition = 0x5A74C;
const int maxAllowedSizeForWads = 4 * 1024 * 1024 - 32; //(Max 4MB-32bytes )
//0. Read length of the wad to ensure it has an allowed size
uint wadLength = (uint)wadFileBytes.Length;
if (wadLength > maxAllowedSizeForWads)
{
throw new ArgumentException(String.Format("The file is sized above the max allowed limit of {1} for network installation.", maxAllowedSizeForWads));
}
//1. Open the stub installer from resources
MemoryStream compressedStubInstallerStream = LoadCompressedStubInstaller("CustomizeMiiInstaller.dol.z");
compressedStubInstallerStream.Seek(0, SeekOrigin.Begin);
//2. Decompress compressed installer
MemoryStream uncompressedStubInstallerStream = new MemoryStream();
using (GZipStream gzipStream = new GZipStream(compressedStubInstallerStream, CompressionMode.Decompress))
{
byte[] decompressedBuff = new byte[1024];
while (true)
{
int length = gzipStream.Read(decompressedBuff, 0, 1024);
if (length == 0) break;
uncompressedStubInstallerStream.Write(decompressedBuff, 0, length);
}
}
//3. Take SHA of the wad and store it in the stub installer along with the size of the wad
byte[] shaHash;
using (SHA1 shaGen = SHA1.Create())
{
shaHash = shaGen.ComputeHash(wadFileBytes);
}
//4. Inject the data into the installer
//Write out the wad size
uncompressedStubInstallerStream.Seek(injectionPosition, SeekOrigin.Begin);
uncompressedStubInstallerStream.WriteByte((byte)((wadLength >> 24) & 0xff));
uncompressedStubInstallerStream.WriteByte((byte)((wadLength >> 16) & 0xff));
uncompressedStubInstallerStream.WriteByte((byte)((wadLength >> 8) & 0xff));
uncompressedStubInstallerStream.WriteByte((byte)(wadLength & 0xff));
//Write out the SHA1 value (Against corruption of the file on the network, this value will be checked by the installer)
uncompressedStubInstallerStream.Write(shaHash, 0, 20);
//Write out the ios to be used...
uncompressedStubInstallerStream.WriteByte(iosToUse);
//pad it with three zeroes (to align it into 32-bit)
uncompressedStubInstallerStream.WriteByte(0); uncompressedStubInstallerStream.WriteByte(0); uncompressedStubInstallerStream.WriteByte(0);
//Write out to be installed wad file's contents...
uncompressedStubInstallerStream.Write(wadFileBytes, 0, (int)wadLength);
return uncompressedStubInstallerStream;
}
private static MemoryStream LoadCompressedStubInstaller(string installerResourceName)
{
using (BinaryReader resLoader = new BinaryReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CustomizeMiiInstaller.Resources." + installerResourceName)))
{
MemoryStream ms = new MemoryStream();
byte[] temp = resLoader.ReadBytes((int)resLoader.BaseStream.Length);
ms.Write(temp, 0, temp.Length);
return ms;
}
}
}
}

View File

@ -1,53 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 WiiCrazy / I.R.on
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CustomizeMiiInstaller")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Irduco")]
[assembly: AssemblyProduct("CustomizeMiiInstaller")]
[assembly: AssemblyCopyright("Copyright © Irduco 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("032fe41d-4954-44ea-a8f3-e51de3546361")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,139 +0,0 @@
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
#DEVKITPRO = /opt/devkitPPC
#DEVKITPPC = /opt/devkitPPC
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
endif
include $(DEVKITPPC)/wii_rules
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := source source/libpng source/libpng/pngu
DATA := data
INCLUDES :=
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
CFLAGS = -Os -Wall $(MACHDEP) $(INCLUDE)
CXXFLAGS = $(CFLAGS)
LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lpng -lfat -lwiiuse -lbte -logc -lm -lz
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(CURDIR)
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export OUTPUT := $(CURDIR)/$(TARGET)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
export DEPSDIR := $(CURDIR)/$(BUILD)
#---------------------------------------------------------------------------------
# automatically build a list of object files for our project
#---------------------------------------------------------------------------------
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
export LD := $(CC)
else
export LD := $(CXX)
endif
export OFILES := $(addsuffix .o,$(BINFILES)) \
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
$(sFILES:.s=.o) $(SFILES:.S=.o)
#---------------------------------------------------------------------------------
# build a list of include paths
#---------------------------------------------------------------------------------
export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD) \
-I$(LIBOGC_INC)
#---------------------------------------------------------------------------------
# build a list of library paths
#---------------------------------------------------------------------------------
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
-L$(LIBOGC_LIB)
export OUTPUT := $(CURDIR)/$(TARGET)
.PHONY: $(BUILD) clean
#---------------------------------------------------------------------------------
$(BUILD):
@[ -d $@ ] || mkdir -p $@
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol
#---------------------------------------------------------------------------------
run:
wiiload $(TARGET).dol
#---------------------------------------------------------------------------------
else
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)
#---------------------------------------------------------------------------------
# This rule links in binary data with the .jpg extension
#---------------------------------------------------------------------------------
%.jpg.o : %.jpg
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
-include $(DEPENDS)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------

View File

@ -1,43 +0,0 @@
+----------------------------+
| WAD Manager v1.4 |
| developed by Waninkoko |
+----------------------------+
| www.teknoconsolas.es |
+----------------------------+
[ DISCLAIMER ]:
- ESTA APLICACION VIENE SIN NINGUNA GARANTIA, EXPLICITA NI IMPLICITA.
NO ME HAGO RESPONSABLE POR CUALQUIER DAÑO EN TU CONSOLA WII DEBIDO A
UN USO NO APROPIADO DE ESTE SOFTWARE.
[ DESCRIPCION ]:
- WAD Manager es una aplicacion que te permite (des)instalar paquetes WAD.
La aplicacion muestra todos los paquetes WAD disponibles en un
dispositivo de almacenamiento para poder elegir cual (des)instalar.
[ DISPOSITIVOS SOPORTADOS ]:
- SDGecko.
- Puerto SD interno (con soporte SDHC).
- Dispositivo USB (1.1 y 2.0).
[ COMO USARLO ]:
1. Crea un directorio llamado "wad" en la raiz del dispositivo de almacenamiento.
2. Copia todos los paquetes WAD en el directorio creado en el paso 1.
3. Ejecuta la aplicacion con cualquier metodo para cargar homebrew.
[ KUDOS ]:
- Team Twiizers/devkitPRO
- svpe
- kwiirk
- Todos mis betatesters.

View File

@ -1,44 +0,0 @@
+----------------------------+
| WAD Manager v1.4 |
| developed by Waninkoko |
+----------------------------+
| www.teknoconsolas.es |
+----------------------------+
[ DISCLAIMER ]:
- THIS APPLICATION COMES WITH NO WARRANTY AT ALL, NEITHER EXPRESS NOR IMPLIED.
I DO NOT TAKE ANY RESPONSIBILITY FOR ANY DAMAGE IN YOUR WII CONSOLE
BECAUSE OF A IMPROPER USAGE OF THIS SOFTWARE.
[ DESCRIPTION ]:
- WAD Manager is an application that allows you to (un)install
WAD packages.
It lists all the available WAD packages in a storage device
so you can select which one to (un)install.
[ SUPPORTED DEVICES ]:
- SDGecko.
- Internal SD slot (with SDHC support).
- USB device (1.1 and 2.0).
[ HOW TO USE ]:
1. Create a folder called "wad" in the root of the storage device.
2. Copy all the WAD packages in the folder created in the step 1.
3. Run the application with any method to load homebrew.
[ KUDOS ]:
- Team Twiizers/devkitPRO
- svpe
- kwiirk
- All my betatesters.

View File

@ -1,3 +0,0 @@
Modified wad manager used to install wads. Make sure you have exactly 4MB
padding file all containing zeroes as install.c. This file is not included
in the source release since it's quite large.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

View File

@ -1 +0,0 @@
<Project name="installer"><File path="source\fat.h"></File><File path="source\gui.c"></File><File path="source\gui.h"></File><File path="source\install.c"></File><File path="source\install.h"></File><File path="source\menu.c"></File><File path="source\menu.h"></File><File path="source\restart.c"></File><File path="source\restart.h"></File><File path="source\sha1.c"></File><File path="source\sha1.h"></File><File path="source\stub.S"></File><File path="source\sys.c"></File><File path="source\sys.h"></File><File path="source\title.c"></File><File path="source\title.h"></File><File path="source\utils.h"></File><File path="source\video.c"></File><File path="source\video.h"></File><File path="source\wad.c"></File><File path="source\wad.h"></File><File path="source\wad-manager.c"></File><File path="source\wpad.c"></File><File path="source\wpad.h"></File><File path="source\fat.c"></File></Project>

View File

@ -1 +0,0 @@
<pd><ViewState><e p="installer" x="true"></e></ViewState></pd>

View File

@ -1,57 +0,0 @@
#include <stdio.h>
#include <string.h>
#include <ogcsys.h>
#include "fat.h"
s32 Fat_Mount(fatDevice *dev)
{
s32 ret;
/* Initialize interface */
ret = dev->interface->startup();
if (!ret)
return -1;
/* Mount device */
ret = fatMountSimple(dev->mount, dev->interface);
if (!ret)
return -1;
return 0;
}
void Fat_Unmount(fatDevice *dev)
{
/* Unmount device */
fatUnmount(dev->mount);
/* Shutdown interface */
dev->interface->shutdown();
}
char *Fat_ToFilename(const char *filename)
{
static char buffer[128];
u32 cnt, idx, len;
/* Clear buffer */
memset(buffer, 0, sizeof(buffer));
/* Get filename length */
len = strlen(filename);
for (cnt = idx = 0; idx < len; idx++) {
char c = filename[idx];
/* Valid characters */
if ( (c >= '#' && c <= ')') || (c >= '-' && c <= '.') ||
(c >= '0' && c <= '9') || (c >= 'A' && c <= 'z') ||
(c >= 'a' && c <= 'z') || (c == '!') )
buffer[cnt++] = c;
}
return buffer;
}

View File

@ -1,41 +0,0 @@
#ifndef _FAT_H_
#define _FAT_H_
/* libfat header */
#include <fat.h>
#include <sys/dir.h>
/* SD headers */
#include <sdcard/gcsd.h>
#include <sdcard/wiisd_io.h>
/* 'FAT Device' structure */
typedef struct {
/* Device mount point */
char *mount;
/* Device name */
char *name;
/* Device interface */
const DISC_INTERFACE *interface;
} fatDevice;
/* 'FAT File' structure */
typedef struct {
/* Filename */
char filename[128];
/* Filestat */
struct stat filestat;
} fatFile;
/* Prototypes */
s32 Fat_Mount(fatDevice *);
void Fat_Unmount(fatDevice *);
char *Fat_ToFilename(const char *);
#endif

View File

@ -1,62 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <ogcsys.h>
#include "video.h"
/* Constants */
#define CONSOLE_XCOORD 96
#define CONSOLE_YCOORD 118
#define CONSOLE_WIDTH 496
#define CONSOLE_HEIGHT 236
s32 __Gui_DrawPng(void *img, u32 x, u32 y)
{
IMGCTX ctx = NULL;
PNGUPROP imgProp;
s32 ret;
/* Select PNG data */
ctx = PNGU_SelectImageFromBuffer(img);
if (!ctx) {
ret = -1;
goto out;
}
/* Get image properties */
ret = PNGU_GetImageProperties(ctx, &imgProp);
if (ret != PNGU_OK) {
ret = -1;
goto out;
}
/* Draw image */
Video_DrawPng(ctx, imgProp, x, y);
/* Success */
ret = 0;
out:
/* Free memory */
if (ctx)
PNGU_ReleaseImageContext(ctx);
return ret;
}
void Gui_InitConsole(void)
{
/* Initialize console */
Con_Init(CONSOLE_XCOORD, CONSOLE_YCOORD, CONSOLE_WIDTH, CONSOLE_HEIGHT);
}
void Gui_DrawBackground(void)
{
extern char bgData[];
/* Draw background */
__Gui_DrawPng(bgData, 0, 0);
}

View File

@ -1,8 +0,0 @@
#ifndef _GUI_H_
#define _GUI_H_
/* Prototypes */
void Gui_InitConsole(void);
void Gui_DrawBackground(void);
#endif

View File

@ -1,14 +0,0 @@
/*
This file was autogenerated by raw2c.
Visit http://www.devkitpro.org
*/
//---------------------------------------------------------------------------------
#ifndef _install_h_
#define _install_h_
//---------------------------------------------------------------------------------
extern const unsigned char install[];
extern const int install_size;
//---------------------------------------------------------------------------------
#endif //_install_h_
//---------------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,171 +0,0 @@
/********************************************************************************************
PNGU Version : 0.2a
Coder : frontier
More info : http://frontier-dev.net
********************************************************************************************/
#ifndef __PNGU__
#define __PNGU__
// Return codes
#define PNGU_OK 0
#define PNGU_ODD_WIDTH 1
#define PNGU_ODD_STRIDE 2
#define PNGU_INVALID_WIDTH_OR_HEIGHT 3
#define PNGU_FILE_IS_NOT_PNG 4
#define PNGU_UNSUPPORTED_COLOR_TYPE 5
#define PNGU_NO_FILE_SELECTED 6
#define PNGU_CANT_OPEN_FILE 7
#define PNGU_CANT_READ_FILE 8
#define PNGU_LIB_ERROR 9
// Color types
#define PNGU_COLOR_TYPE_GRAY 1
#define PNGU_COLOR_TYPE_GRAY_ALPHA 2
#define PNGU_COLOR_TYPE_PALETTE 3
#define PNGU_COLOR_TYPE_RGB 4
#define PNGU_COLOR_TYPE_RGB_ALPHA 5
#define PNGU_COLOR_TYPE_UNKNOWN 6
#ifdef __cplusplus
extern "C" {
#endif
// Types
typedef unsigned char PNGU_u8;
typedef unsigned short PNGU_u16;
typedef unsigned int PNGU_u32;
typedef unsigned long long PNGU_u64;
typedef struct
{
PNGU_u8 r;
PNGU_u8 g;
PNGU_u8 b;
} PNGUCOLOR;
typedef struct
{
PNGU_u32 imgWidth; // In pixels
PNGU_u32 imgHeight; // In pixels
PNGU_u32 imgBitDepth; // In bitx
PNGU_u32 imgColorType; // PNGU_COLOR_TYPE_*
PNGU_u32 validBckgrnd; // Non zero if there is a background color
PNGUCOLOR bckgrnd; // Backgroun color
PNGU_u32 numTrans; // Number of transparent colors
PNGUCOLOR *trans; // Transparent colors
} PNGUPROP;
// Image context, always initialize with SelectImageFrom* and free with ReleaseImageContext
struct _IMGCTX;
typedef struct _IMGCTX *IMGCTX;
/****************************************************************************
* Pixel conversion *
****************************************************************************/
// Macro to convert RGB8 values to RGB565
#define PNGU_RGB8_TO_RGB565(r,g,b) ( ((((PNGU_u16) r) & 0xF8U) << 8) | ((((PNGU_u16) g) & 0xFCU) << 3) | (((PNGU_u16) b) >> 3) )
// Macro to convert RGBA8 values to RGB5A3
#define PNGU_RGB8_TO_RGB5A3(r,g,b,a) (PNGU_u16) (((a & 0xE0U) == 0xE0U) ? \
(0x8000U | ((((PNGU_u16) r) & 0xF8U) << 7) | ((((PNGU_u16) g) & 0xF8U) << 2) | (((PNGU_u16) b) >> 3)) : \
(((((PNGU_u16) a) & 0xE0U) << 7) | ((((PNGU_u16) r) & 0xF0U) << 4) | (((PNGU_u16) g) & 0xF0U) | ((((PNGU_u16) b) & 0xF0U) >> 4)))
// Function to convert two RGB8 values to YCbYCr
PNGU_u32 PNGU_RGB8_TO_YCbYCr (PNGU_u8 r1, PNGU_u8 g1, PNGU_u8 b1, PNGU_u8 r2, PNGU_u8 g2, PNGU_u8 b2);
// Function to convert an YCbYCr to two RGB8 values.
void PNGU_YCbYCr_TO_RGB8 (PNGU_u32 ycbycr, PNGU_u8 *r1, PNGU_u8 *g1, PNGU_u8 *b1, PNGU_u8 *r2, PNGU_u8 *g2, PNGU_u8 *b2);
/****************************************************************************
* Image context handling *
****************************************************************************/
// Selects a PNG file, previosly loaded into a buffer, and creates an image context for subsequent procesing.
IMGCTX PNGU_SelectImageFromBuffer (const void *buffer);
// Selects a PNG file, from any devoptab device, and creates an image context for subsequent procesing.
IMGCTX PNGU_SelectImageFromDevice (const char *filename);
// Frees resources associated with an image context. Always call this function when you no longer need the IMGCTX.
void PNGU_ReleaseImageContext (IMGCTX ctx);
/****************************************************************************
* Miscelaneous *
****************************************************************************/
// Retrieves info from selected PNG file, including image dimensions, color format, background and transparency colors.
int PNGU_GetImageProperties (IMGCTX ctx, PNGUPROP *fileproperties);
/****************************************************************************
* Image conversion *
****************************************************************************/
// Expands selected image into an YCbYCr buffer. You need to specify context, image dimensions,
// destination address and stride in pixels (stride = buffer width - image width).
int PNGU_DecodeToYCbYCr (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffer, PNGU_u32 stride);
// Macro for decoding an image inside a buffer at given coordinates.
#define PNGU_DECODE_TO_COORDS_YCbYCr(ctx,coordX,coordY,imgWidth,imgHeight,bufferWidth,bufferHeight,buffer) \
\
PNGU_DecodeToYCbYCr (ctx, imgWidth, imgHeight, ((void *) buffer) + (coordY) * (bufferWidth) * 2 + \
(coordX) * 2, (bufferWidth) - (imgWidth))
// Expands selected image into a linear RGB565 buffer. You need to specify context, image dimensions,
// destination address and stride in pixels (stride = buffer width - image width).
int PNGU_DecodeToRGB565 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffer, PNGU_u32 stride);
// Macro for decoding an image inside a buffer at given coordinates.
#define PNGU_DECODE_TO_COORDS_RGB565(ctx,coordX,coordY,imgWidth,imgHeight,bufferWidth,bufferHeight,buffer) \
\
PNGU_DecodeToRGB565 (ctx, imgWidth, imgHeight, ((void *) buffer) + (coordY) * (bufferWidth) * 2 + \
(coordX) * 2, (bufferWidth) - (imgWidth))
// Expands selected image into a linear RGBA8 buffer. You need to specify context, image dimensions,
// destination address, stride in pixels and default alpha value, which is used if the source image
// doesn't have an alpha channel.
int PNGU_DecodeToRGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffer, PNGU_u32 stride, PNGU_u8 default_alpha);
// Macro for decoding an image inside a buffer at given coordinates.
#define PNGU_DECODE_TO_COORDS_RGBA8(ctx,coordX,coordY,imgWidth,imgHeight,default_alpha,bufferWidth,bufferHeight,buffer) \
\
PNGU_DecodeToRGBA8 (ctx, imgWidth, imgHeight, ((void *) buffer) + (coordY) * (bufferWidth) * 2 + \
(coordX) * 2, (bufferWidth) - (imgWidth), default_alpha)
// Expands selected image into a 4x4 tiled RGB565 buffer. You need to specify context, image dimensions
// and destination address.
int PNGU_DecodeTo4x4RGB565 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffer);
// Expands selected image into a 4x4 tiled RGB5A3 buffer. You need to specify context, image dimensions,
// destination address and default alpha value, which is used if the source image doesn't have an alpha channel.
int PNGU_DecodeTo4x4RGB5A3 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffer, PNGU_u8 default_alpha);
// Expands selected image into a 4x4 tiled RGBA8 buffer. You need to specify context, image dimensions,
// destination address and default alpha value, which is used if the source image doesn't have an alpha channel.
int PNGU_DecodeTo4x4RGBA8 (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffer, PNGU_u8 default_alpha);
// Encodes an YCbYCr image in PNG format and stores it in the selected device or memory buffer. You need to
// specify context, image dimensions, destination address and stride in pixels (stride = buffer width - image width).
int PNGU_EncodeFromYCbYCr (IMGCTX ctx, PNGU_u32 width, PNGU_u32 height, void *buffer, PNGU_u32 stride);
// Macro for encoding an image stored into an YCbYCr buffer at given coordinates.
#define PNGU_ENCODE_TO_COORDS_YCbYCr(ctx,coordX,coordY,imgWidth,imgHeight,bufferWidth,bufferHeight,buffer) \
\
PNGU_EncodeFromYCbYCr (ctx, imgWidth, imgHeight, ((void *) buffer) + (coordY) * (bufferWidth) * 2 + \
(coordX) * 2, (bufferWidth) - (imgWidth))
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,36 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <ogcsys.h>
#include "fat.h"
#include "restart.h"
#include "title.h"
#include "utils.h"
#include "video.h"
#include "wad.h"
#include "wpad.h"
/* Constants */
#define CIOS_VERSION 249
void LoadSelectedIOS()
{
u8 selectedIOS = Wad_SelectIOS();
s32 ret;
ret = IOS_ReloadIOS(selectedIOS);
if (ret<0)
{
printf("\nUsing default IOS");
} else
{
printf("\nUsing selected IOS %d\n", selectedIOS);
}
}
void Menu_Loop(void)
{
Wad_InstallFromMemory();
}

View File

@ -1,8 +0,0 @@
#ifndef _MENU_H_
#define _MENU_H_
/* Prototypes */
void Menu_Loop(void);
#endif

View File

@ -1,33 +0,0 @@
#include <stdio.h>
#include <ogcsys.h>
#include "sys.h"
#include "wpad.h"
void Restart(void)
{
printf("\n Restarting Wii...");
fflush(stdout);
/* Load system menu */
Sys_LoadMenu();
}
void Restart_Wait(void)
{
printf("\n");
printf(" Press any button to restart...");
fflush(stdout);
/* Wait for button */
Wpad_WaitButtons();
printf(" Restarting Wii...");
fflush(stdout);
/* Load system menu */
Sys_LoadMenu();
}

View File

@ -1,8 +0,0 @@
#ifndef _RESTART_H_
#define _RESTART_H_
/* Prototypes */
void Restart(void);
void Restart_Wait(void);
#endif

View File

@ -1,172 +0,0 @@
/*
SHA-1 in C
By Steve Reid <steve@edmweb.com>
100% Public Domain
Test Vectors (from FIPS PUB 180-1)
"abc"
A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
A million repetitions of "a"
34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
*/
/* #define LITTLE_ENDIAN * This should be #define'd if true. */
#define SHA1HANDSOFF
#include <stdio.h>
#include <string.h>
#include "sha1.h"
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
/* blk0() and blk() perform the initial expand. */
/* I got the idea of expanding during the round function from SSLeay */
#ifdef LITTLE_ENDIAN
#define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \
|(rol(block->l[i],8)&0x00FF00FF))
#else
#define blk0(i) block->l[i]
#endif
#define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \
^block->l[(i+2)&15]^block->l[i&15],1))
/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);
#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30);
#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);
#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);
#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
/* Hash a single 512-bit block. This is the core of the algorithm. */
void SHA1Transform(unsigned long state[5], unsigned char buffer[64])
{
unsigned long a, b, c, d, e;
typedef union {
unsigned char c[64];
unsigned long l[16];
} CHAR64LONG16;
CHAR64LONG16* block;
#ifdef SHA1HANDSOFF
static unsigned char workspace[64];
block = (CHAR64LONG16*)workspace;
memcpy(block, buffer, 64);
#else
block = (CHAR64LONG16*)buffer;
#endif
/* Copy context->state[] to working vars */
a = state[0];
b = state[1];
c = state[2];
d = state[3];
e = state[4];
/* 4 rounds of 20 operations each. Loop unrolled. */
R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);
R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);
R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);
R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);
R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);
R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);
R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);
R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);
R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);
R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);
R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);
R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);
R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);
R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);
R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);
R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);
R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);
R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);
R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);
/* Add the working vars back into context.state[] */
state[0] += a;
state[1] += b;
state[2] += c;
state[3] += d;
state[4] += e;
/* Wipe variables */
a = b = c = d = e = 0;
}
/* SHA1Init - Initialize new context */
void SHA1Init(SHA1_CTX* context)
{
/* SHA1 initialization constants */
context->state[0] = 0x67452301;
context->state[1] = 0xEFCDAB89;
context->state[2] = 0x98BADCFE;
context->state[3] = 0x10325476;
context->state[4] = 0xC3D2E1F0;
context->count[0] = context->count[1] = 0;
}
/* Run your data through this. */
void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len)
{
unsigned int i, j;
j = (context->count[0] >> 3) & 63;
if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;
context->count[1] += (len >> 29);
if ((j + len) > 63) {
memcpy(&context->buffer[j], data, (i = 64-j));
SHA1Transform(context->state, context->buffer);
for ( ; i + 63 < len; i += 64) {
SHA1Transform(context->state, &data[i]);
}
j = 0;
}
else i = 0;
memcpy(&context->buffer[j], &data[i], len - i);
}
/* Add padding and return the message digest. */
void SHA1Final(unsigned char digest[20], SHA1_CTX* context)
{
unsigned long i, j;
unsigned char finalcount[8];
for (i = 0; i < 8; i++) {
finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)]
>> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */
}
SHA1Update(context, (unsigned char *)"\200", 1);
while ((context->count[0] & 504) != 448) {
SHA1Update(context, (unsigned char *)"\0", 1);
}
SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */
for (i = 0; i < 20; i++) {
digest[i] = (unsigned char)
((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
}
/* Wipe variables */
i = j = 0;
memset(context->buffer, 0, 64);
memset(context->state, 0, 20);
memset(context->count, 0, 8);
memset(&finalcount, 0, 8);
#ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */
SHA1Transform(context->state, context->buffer);
#endif
}
void SHA1(unsigned char *ptr, unsigned int size, unsigned char *outbuf) {
SHA1_CTX ctx;
SHA1Init(&ctx);
SHA1Update(&ctx, ptr, size);
SHA1Final(outbuf, &ctx);
}

View File

@ -1,12 +0,0 @@
typedef struct {
unsigned long state[5];
unsigned long count[2];
unsigned char buffer[64];
} SHA1_CTX;
void SHA1Transform(unsigned long state[5], unsigned char buffer[64]);
void SHA1Init(SHA1_CTX* context);
void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len);
void SHA1Final(unsigned char digest[20], SHA1_CTX* context);
void SHA1(unsigned char *ptr, unsigned int size, unsigned char *outbuf);

View File

@ -1,6 +0,0 @@
.rodata
.globl bgData
.balign 32
bgData:
.incbin "../data/background"

View File

@ -1,98 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <ogcsys.h>
#include "sys.h"
/* Constants */
#define CERTS_LEN 0x280
/* Variables */
static const char certs_fs[] ATTRIBUTE_ALIGN(32) = "/sys/cert.sys";
void __Sys_ResetCallback(void)
{
/* Reboot console */
Sys_Reboot();
}
void __Sys_PowerCallback(void)
{
/* Poweroff console */
Sys_Shutdown();
}
void Sys_Init(void)
{
/* Initialize video subsytem */
VIDEO_Init();
/* Set RESET/POWER button callback */
SYS_SetResetCallback(__Sys_ResetCallback);
SYS_SetPowerCallback(__Sys_PowerCallback);
}
void Sys_Reboot(void)
{
/* Restart console */
STM_RebootSystem();
}
void Sys_Shutdown(void)
{
/* Poweroff console */
if(CONF_GetShutdownMode() == CONF_SHUTDOWN_IDLE) {
s32 ret;
/* Set LED mode */
ret = CONF_GetIdleLedMode();
if(ret >= 0 && ret <= 2)
STM_SetLedMode(ret);
/* Shutdown to idle */
STM_ShutdownToIdle();
} else {
/* Shutdown to standby */
STM_ShutdownToStandby();
}
}
void Sys_LoadMenu(void)
{
u32 *stub = (u32 *)0x80001800;
/* Homebrew Channel stub */
if (*stub)
exit(0);
/* Return to the Wii system menu */
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
}
s32 Sys_GetCerts(signed_blob **certs, u32 *len)
{
static signed_blob certificates[CERTS_LEN] ATTRIBUTE_ALIGN(32);
s32 fd, ret;
/* Open certificates file */
fd = IOS_Open(certs_fs, 1);
if (fd < 0)
return fd;
/* Read certificates */
ret = IOS_Read(fd, certificates, sizeof(certificates));
/* Close file */
IOS_Close(fd);
/* Set values */
if (ret > 0) {
*certs = certificates;
*len = sizeof(certificates);
}
return ret;
}

View File

@ -1,11 +0,0 @@
#ifndef _SYS_H_
#define _SYS_H_
/* Prototypes */
void Sys_Init(void);
void Sys_Reboot(void);
void Sys_Shutdown(void);
void Sys_LoadMenu(void);
s32 Sys_GetCerts(signed_blob **, u32 *);
#endif

View File

@ -1,256 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <ogcsys.h>
#include "utils.h"
s32 Title_GetList(u64 **outbuf, u32 *outlen)
{
u64 *titles = NULL;
u32 len, nb_titles;
s32 ret;
/* Get number of titles */
ret = ES_GetNumTitles(&nb_titles);
if (ret < 0)
return ret;
/* Calculate buffer lenght */
len = round_up(sizeof(u64) * nb_titles, 32);
/* Allocate memory */
titles = memalign(32, len);
if (!titles)
return -1;
/* Get titles */
ret = ES_GetTitles(titles, nb_titles);
if (ret < 0)
goto err;
/* Set values */
*outbuf = titles;
*outlen = nb_titles;
return 0;
err:
/* Free memory */
if (titles)
free(titles);
return ret;
}
s32 Title_GetTicketViews(u64 tid, tikview **outbuf, u32 *outlen)
{
tikview *views = NULL;
u32 nb_views;
s32 ret;
/* Get number of ticket views */
ret = ES_GetNumTicketViews(tid, &nb_views);
if (ret < 0)
return ret;
/* Allocate memory */
views = (tikview *)memalign(32, sizeof(tikview) * nb_views);
if (!views)
return -1;
/* Get ticket views */
ret = ES_GetTicketViews(tid, views, nb_views);
if (ret < 0)
goto err;
/* Set values */
*outbuf = views;
*outlen = nb_views;
return 0;
err:
/* Free memory */
if (views)
free(views);
return ret;
}
s32 Title_GetTMD(u64 tid, signed_blob **outbuf, u32 *outlen)
{
void *p_tmd = NULL;
u32 len;
s32 ret;
/* Get TMD size */
ret = ES_GetStoredTMDSize(tid, &len);
if (ret < 0)
return ret;
/* Allocate memory */
p_tmd = memalign(32, round_up(len, 32));
if (!p_tmd)
return -1;
/* Read TMD */
ret = ES_GetStoredTMD(tid, p_tmd, len);
if (ret < 0)
goto err;
/* Set values */
*outbuf = p_tmd;
*outlen = len;
return 0;
err:
/* Free memory */
if (p_tmd)
free(p_tmd);
return ret;
}
s32 Title_GetVersion(u64 tid, u16 *outbuf)
{
signed_blob *p_tmd = NULL;
tmd *tmd_data = NULL;
u32 len;
s32 ret;
/* Get title TMD */
ret = Title_GetTMD(tid, &p_tmd, &len);
if (ret < 0)
return ret;
/* Retrieve TMD info */
tmd_data = (tmd *)SIGNATURE_PAYLOAD(p_tmd);
/* Set values */
*outbuf = tmd_data->title_version;
/* Free memory */
free(p_tmd);
return 0;
}
s32 Title_GetSysVersion(u64 tid, u64 *outbuf)
{
signed_blob *p_tmd = NULL;
tmd *tmd_data = NULL;
u32 len;
s32 ret;
/* Get title TMD */
ret = Title_GetTMD(tid, &p_tmd, &len);
if (ret < 0)
return ret;
/* Retrieve TMD info */
tmd_data = (tmd *)SIGNATURE_PAYLOAD(p_tmd);
/* Set values */
*outbuf = tmd_data->sys_version;
/* Free memory */
free(p_tmd);
return 0;
}
s32 Title_GetSize(u64 tid, u32 *outbuf)
{
signed_blob *p_tmd = NULL;
tmd *tmd_data = NULL;
u32 cnt, len, size = 0;
s32 ret;
/* Get title TMD */
ret = Title_GetTMD(tid, &p_tmd, &len);
if (ret < 0)
return ret;
/* Retrieve TMD info */
tmd_data = (tmd *)SIGNATURE_PAYLOAD(p_tmd);
/* Calculate title size */
for (cnt = 0; cnt < tmd_data->num_contents; cnt++) {
tmd_content *content = &tmd_data->contents[cnt];
/* Add content size */
size += content->size;
}
/* Set values */
*outbuf = size;
/* Free memory */
free(p_tmd);
return 0;
}
s32 Title_GetIOSVersions(u8 **outbuf, u32 *outlen)
{
u8 *buffer = NULL;
u64 *list = NULL;
u32 count, cnt, idx;
s32 ret;
/* Get title list */
ret = Title_GetList(&list, &count);
if (ret < 0)
return ret;
/* Count IOS */
for (cnt = idx = 0; idx < count; idx++) {
u32 tidh = (list[idx] >> 32);
u32 tidl = (list[idx] & 0xFFFFFFFF);
/* Title is IOS */
if ((tidh == 0x1) && (tidl >= 3) && (tidl <= 255))
cnt++;
}
/* Allocate memory */
buffer = (u8 *)memalign(32, cnt);
if (!buffer) {
ret = -1;
goto out;
}
/* Copy IOS */
for (cnt = idx = 0; idx < count; idx++) {
u32 tidh = (list[idx] >> 32);
u32 tidl = (list[idx] & 0xFFFFFFFF);
/* Title is IOS */
if ((tidh == 0x1) && (tidl >= 3) && (tidl <= 255))
buffer[cnt++] = (u8)(tidl & 0xFF);
}
/* Set values */
*outbuf = buffer;
*outlen = cnt;
goto out;
out:
/* Free memory */
if (list)
free(list);
return ret;
}

View File

@ -1,16 +0,0 @@
#ifndef _TITLE_H_
#define _TITLE_H_
/* Constants */
#define BLOCK_SIZE 1024
/* Prototypes */
s32 Title_GetList(u64 **, u32 *);
s32 Title_GetTicketViews(u64, tikview **, u32 *);
s32 Title_GetTMD(u64, signed_blob **, u32 *);
s32 Title_GetVersion(u64, u16 *);
s32 Title_GetSysVersion(u64, u64 *);
s32 Title_GetSize(u64, u32 *);
s32 Title_GetIOSVersions(u8 **, u32 *);
#endif

View File

@ -1,15 +0,0 @@
#ifndef _UTILS_H_
#define _UTILS_H_
/* Constants */
#define KB_SIZE 1024.0
#define MB_SIZE 1048576.0
#define GB_SIZE 1073741824.0
/* Macros */
#define round_up(x,n) (-(-(x) & -(n)))
/* Prototypes */
u32 swap32(u32);
#endif

View File

@ -1,141 +0,0 @@
#include <stdio.h>
#include <ogcsys.h>
#include "sys.h"
#include "video.h"
/* Video variables */
static void *framebuffer = NULL;
static GXRModeObj *vmode = NULL;
void Con_Init(u32 x, u32 y, u32 w, u32 h)
{
/* Create console in the framebuffer */
CON_InitEx(vmode, x, y, w, h);
}
void Con_Clear(void)
{
/* Clear console */
printf("\x1b[2J");
fflush(stdout);
}
void Con_ClearLine(void)
{
s32 cols, rows;
u32 cnt;
printf("\r");
fflush(stdout);
/* Get console metrics */
CON_GetMetrics(&cols, &rows);
/* Erase line */
for (cnt = 1; cnt < cols; cnt++) {
printf(" ");
fflush(stdout);
}
printf("\r");
fflush(stdout);
}
void Con_FgColor(u32 color, u8 bold)
{
/* Set foreground color */
printf("\x1b[%u;%um", color + 30, bold);
fflush(stdout);
}
void Con_BgColor(u32 color, u8 bold)
{
/* Set background color */
printf("\x1b[%u;%um", color + 40, bold);
fflush(stdout);
}
void Con_FillRow(u32 row, u32 color, u8 bold)
{
s32 cols, rows;
u32 cnt;
/* Set color */
printf("\x1b[%u;%um", color + 40, bold);
fflush(stdout);
/* Get console metrics */
CON_GetMetrics(&cols, &rows);
/* Save current row and col */
printf("\x1b[s");
fflush(stdout);
/* Move to specified row */
printf("\x1b[%u;0H", row);
fflush(stdout);
/* Fill row */
for (cnt = 0; cnt < cols; cnt++) {
printf(" ");
fflush(stdout);
}
/* Load saved row and col */
printf("\x1b[u");
fflush(stdout);
/* Set default color */
Con_BgColor(0, 0);
Con_FgColor(7, 1);
}
void Video_Configure(GXRModeObj *rmode)
{
/* Configure the video subsystem */
VIDEO_Configure(rmode);
/* Setup video */
VIDEO_SetBlack(FALSE);
VIDEO_Flush();
VIDEO_WaitVSync();
if (rmode->viTVMode & VI_NON_INTERLACE)
VIDEO_WaitVSync();
}
void Video_SetMode(void)
{
/* Select preferred video mode */
vmode = VIDEO_GetPreferredMode(NULL);
/* Allocate memory for the framebuffer */
framebuffer = MEM_K0_TO_K1(SYS_AllocateFramebuffer(vmode));
/* Configure the video subsystem */
VIDEO_Configure(vmode);
/* Setup video */
VIDEO_SetNextFramebuffer(framebuffer);
VIDEO_SetBlack(FALSE);
VIDEO_Flush();
VIDEO_WaitVSync();
if (vmode->viTVMode & VI_NON_INTERLACE)
VIDEO_WaitVSync();
/* Clear the screen */
Video_Clear(COLOR_BLACK);
}
void Video_Clear(s32 color)
{
VIDEO_ClearFrameBuffer(vmode, framebuffer, color);
}
void Video_DrawPng(IMGCTX ctx, PNGUPROP imgProp, u16 x, u16 y)
{
PNGU_DECODE_TO_COORDS_YCbYCr(ctx, x, y, imgProp.imgWidth, imgProp.imgHeight, vmode->fbWidth, vmode->xfbHeight, framebuffer);
}

View File

@ -1,19 +0,0 @@
#ifndef _VIDEO_H_
#define _VIDEO_H_
#include "libpng/pngu/pngu.h"
/* Prototypes */
void Con_Init(u32, u32, u32, u32);
void Con_Clear(void);
void Con_ClearLine(void);
void Con_FgColor(u32, u8);
void Con_BgColor(u32, u8);
void Con_FillRow(u32, u32, u8);
void Video_Configure(GXRModeObj *);
void Video_SetMode(void);
void Video_Clear(s32);
void Video_DrawPng(IMGCTX, PNGUPROP, u16, u16);
#endif

View File

@ -1,72 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ogcsys.h>
#include "gui.h"
#include "menu.h"
#include "restart.h"
#include "sys.h"
#include "video.h"
#include "wpad.h"
void Disclaimer(void)
{
/* Print disclaimer */
printf(" [DISCLAIMER]:\n\n");
printf(" THIS APPLICATION COMES WITH NO WARRANTY AT ALL,\n");
printf(" NEITHER EXPRESS NOR IMPLIED.\n");
printf(" I DO NOT TAKE ANY RESPONSIBILITY FOR ANY DAMAGE IN YOUR\n");
printf(" WII CONSOLE BECAUSE OF A IMPROPER USAGE OF THIS SOFTWARE.\n\n");
printf(">> If you agree and install the streamed wad\n");
printf(">> press A button to continue.\n");
printf(">> Otherwise, press B button to restart your Wii.\n");
/* Wait for user answer */
for (;;) {
u32 buttons = Wpad_WaitButtons();
/* A button */
if ((buttons & WPAD_BUTTON_A)||(buttons & PAD_BUTTON_A))
break;
/* B button */
if ((buttons & WPAD_BUTTON_B)||(buttons & WPAD_CLASSIC_BUTTON_B))
Restart();
}
}
int main(int argc, char **argv)
{
/* Initialize subsystems */
Sys_Init();
/* Set video mode */
Video_SetMode();
/* Initialize console */
Gui_InitConsole();
/* Draw background */
Gui_DrawBackground();
/* Load Selected IOS */
LoadSelectedIOS();
/* Initialize Wiimote */
Wpad_Init();
/* Print disclaimer */
Disclaimer();
/* Menu loop */
Menu_Loop();
/* Restart Wii */
Restart_Wait();
return 0;
}

View File

@ -1,374 +0,0 @@
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <ogcsys.h>
#include "title.h"
#include "utils.h"
#include "video.h"
#include "wad.h"
#include "sha1.h"
#include "install.h"
/* 'WAD Header' structure */
typedef struct {
/* Header length */
u32 header_len;
/* WAD type */
u16 type;
u16 padding;
/* Data length */
u32 certs_len;
u32 crl_len;
u32 tik_len;
u32 tmd_len;
u32 data_len;
u32 footer_len;
} ATTRIBUTE_PACKED wadHeader;
/* Variables */
static u8 wadBuffer[BLOCK_SIZE] ATTRIBUTE_ALIGN(32);
void * startOfData;
void * endOfData;
void * internalPointer;
void mopen(void * memPointer)
{
u32 size = *((u32 * ) memPointer);
startOfData = memPointer + 28;
endOfData = startOfData + size;
internalPointer = startOfData;
}
int mseek(u32 offset, int origin)
{
if (origin == SEEK_SET)
{
internalPointer = startOfData + offset;
} else if (origin == SEEK_CUR)
{
internalPointer = internalPointer + offset;
} else if (origin == SEEK_END) {
internalPointer = endOfData - offset;
} else
{
return -2;
}
if ((internalPointer<startOfData) || (internalPointer> endOfData))
{
return -1;
} else
{
return 0;
}
}
int mread(void * buf, int size, int count)
{
memcpy(buf, internalPointer, size*count);
//DCFlushRange(buf, size*count);
return 0;
}
//-------------------------- INSTALL FROM MEMORY -------------------------------
s32 __Wad_ReadFile(void *outbuf, u32 offset, u32 len)
{
s32 ret;
/* Seek to offset */
mseek(offset, SEEK_SET);
/* Read data */
ret = mread(outbuf, len, 1);
if (ret < 0)
return ret;
return 0;
}
s32 __Wad_ReadAlloc(void **outbuf, u32 offset, u32 len)
{
void *buffer = NULL;
s32 ret;
/* Allocate memory */
buffer = memalign(32, len);
if (!buffer)
return -1;
/* Read file */
ret = __Wad_ReadFile(buffer, offset, len);
if (ret < 0) {
free(buffer);
return ret;
}
/* Set pointer */
*outbuf = buffer;
return 0;
}
s32 __Wad_GetTitleID(wadHeader *header, u64 *tid)
{
signed_blob *p_tik = NULL;
tik *tik_data = NULL;
u32 offset = 0;
s32 ret;
/* Ticket offset */
offset += round_up(header->header_len, 64);
offset += round_up(header->certs_len, 64);
offset += round_up(header->crl_len, 64);
/* Read ticket */
ret = __Wad_ReadAlloc((void *)&p_tik, offset, header->tik_len);
if (ret < 0)
goto out;
/* Ticket data */
tik_data = (tik *)SIGNATURE_PAYLOAD(p_tik);
/* Copy title ID */
*tid = tik_data->titleid;
out:
/* Free memory */
if (p_tik)
free(p_tik);
return ret;
}
s32 __Wad_Install()
{
wadHeader *header = NULL;
signed_blob *p_certs = NULL, *p_crl = NULL, *p_tik = NULL, *p_tmd = NULL;
tmd *tmd_data = NULL;
u32 cnt, offset = 0;
s32 ret;
printf("\t\t>> Reading WAD data...");
fflush(stdout);
/* WAD header */
ret = __Wad_ReadAlloc((void *)&header, offset, sizeof(wadHeader));
if (ret < 0)
goto err;
else
offset += round_up(header->header_len, 64);
/* WAD certificates */
ret = __Wad_ReadAlloc((void *)&p_certs, offset, header->certs_len);
if (ret < 0)
goto err;
else
offset += round_up(header->certs_len, 64);
/* WAD crl */
if (header->crl_len) {
ret = __Wad_ReadAlloc((void *)&p_crl, offset, header->crl_len);
if (ret < 0)
goto err;
else
offset += round_up(header->crl_len, 64);
}
/* WAD ticket */
ret = __Wad_ReadAlloc((void *)&p_tik, offset, header->tik_len);
if (ret < 0)
goto err;
else
offset += round_up(header->tik_len, 64);
/* WAD TMD */
ret = __Wad_ReadAlloc((void *)&p_tmd, offset, header->tmd_len);
if (ret < 0)
goto err;
else
offset += round_up(header->tmd_len, 64);
Con_ClearLine();
printf("\t\t>> Installing ticket...");
fflush(stdout);
/* Install ticket */
ret = ES_AddTicket(p_tik, header->tik_len, p_certs, header->certs_len, p_crl, header->crl_len);
if (ret < 0)
goto err;
Con_ClearLine();
printf("\r\t\t>> Installing title...");
fflush(stdout);
/* Install title */
ret = ES_AddTitleStart(p_tmd, header->tmd_len, p_certs, header->certs_len, p_crl, header->crl_len);
if (ret < 0)
goto err;
/* Get TMD info */
tmd_data = (tmd *)SIGNATURE_PAYLOAD(p_tmd);
/* Install contents */
for (cnt = 0; cnt < tmd_data->num_contents; cnt++) {
tmd_content *content = &tmd_data->contents[cnt];
u32 idx = 0, len;
s32 cfd;
Con_ClearLine();
printf("\r\t\t>> Installing content #%02d...", content->cid);
fflush(stdout);
/* Encrypted content size */
len = round_up(content->size, 64);
/* Install content */
cfd = ES_AddContentStart(tmd_data->title_id, content->cid);
if (cfd < 0) {
ret = cfd;
goto err;
}
/* Install content data */
while (idx < len) {
u32 size;
/* Data length */
size = (len - idx);
if (size > BLOCK_SIZE)
size = BLOCK_SIZE;
/* Read data */
ret = __Wad_ReadFile(&wadBuffer, offset, size);
if (ret < 0)
goto err;
/* Install data */
ret = ES_AddContentData(cfd, wadBuffer, size);
if (ret < 0)
goto err;
/* Increase variables */
idx += size;
offset += size;
}
/* Finish content installation */
ret = ES_AddContentFinish(cfd);
if (ret < 0)
goto err;
}
Con_ClearLine();
printf("\r\t\t>> Finishing installation...");
fflush(stdout);
/* Finish title install */
ret = ES_AddTitleFinish();
if (ret >= 0) {
printf(" OK!\n");
goto out;
}
err:
printf(" ERROR! (ret = %d)\n", ret);
/* Cancel install */
ES_AddTitleCancel();
out:
/* Free memory */
if (header)
free(header);
if (p_certs)
free(p_certs);
if (p_crl)
free(p_crl);
if (p_tik)
free(p_tik);
if (p_tmd)
free(p_tmd);
return ret;
}
void DumpHash(u8 * hash)
{
int i;
for (i=0;i<20;i++)
{
printf("%x", hash[i]);
}
}
s32 CompareHashes(u8 * hash1, u8 * hash2)
{
printf("\nCalculated SHA1 Hash: "); DumpHash(hash1);
printf("\nStored SHA1 Hash : "); DumpHash(hash2);
sleep(3);
if (memcmp(hash1, hash2, 20)==0)
{
return 1;
}
else
{
return 0;
}
}
s32 Wad_EnsureInjectedData()
{
u32 size = *((u32 * ) install);
u8 wadOffset = 28;
u8 hash1[20];
SHA1(((u8 *)install)+wadOffset, size , hash1); //Taking SHA of contents...
return CompareHashes(hash1, ((u8 *)install)+4);
}
s32 Wad_InstallFromMemory()
{
/* Check integrity of the wad file using SHA */
/* SHA digest of the installed wad will be from XX-XX region in the injected data */
printf("\n");
printf("\r\t\t>> Checking integrity of the contents...");
if (Wad_EnsureInjectedData())
{
printf("\n\n\t\t>> Wad file integrity check succeeded\n\n");
mopen(install);
return __Wad_Install();
} else
{
printf("\n\n\t\t>> Wad file integrity check failed! Will not install the wad, possible corruption during transfer...");
}
}
u8 Wad_SelectIOS()
{
u8 iosOffset = 24;
return *(install+iosOffset);
}

View File

@ -1,7 +0,0 @@
#ifndef _WAD_H_
#define _WAD_H_
/* Prototypes */
s32 Wad_InstallFromMemory();
#endif

View File

@ -1,81 +0,0 @@
#include <stdio.h>
#include <ogcsys.h>
#include "sys.h"
#include "wpad.h"
/* Constants */
#define MAX_WIIMOTES 4
void __Wpad_PowerCallback(s32 chan)
{
/* Poweroff console */
Sys_Shutdown();
}
s32 Wpad_Init(void)
{
s32 ret;
/* Initialize GC Pads */
ret = PAD_Init();
if (ret < 0)
return ret;
/* Initialize Wiimote subsystem */
ret = WPAD_Init();
if (ret < 0)
return ret;
/* Set POWER button callback */
WPAD_SetPowerButtonCallback(__Wpad_PowerCallback);
return ret;
}
void Wpad_Disconnect(void)
{
u32 cnt;
/* Disconnect Wiimotes */
for (cnt = 0; cnt < MAX_WIIMOTES; cnt++)
WPAD_Disconnect(cnt);
/* Shutdown Wiimote subsystem */
WPAD_Shutdown();
}
u32 Wpad_GetButtons(void)
{
u32 buttons = 0, cnt;
/* Scan pads */
WPAD_ScanPads();
/* Get pressed buttons */
for (cnt = 0; cnt < MAX_WIIMOTES; cnt++)
buttons |= WPAD_ButtonsDown(cnt);
return buttons;
}
u32 Wpad_WaitButtons(void)
{
u32 buttons = 0;
/* Wait for button pressing */
while (!buttons) {
buttons = Wpad_GetButtons();
if (!buttons)
{
PAD_ScanPads();
buttons = PAD_ButtonsDown(0);
}
VIDEO_WaitVSync();
}
return buttons;
}

View File

@ -1,12 +0,0 @@
#ifndef _WPAD_H_
#define _WPAD_H_
#include <wiiuse/wpad.h>
/* Prototypes */
s32 Wpad_Init(void);
void Wpad_Disconnect(void);
u32 Wpad_GetButtons(void);
u32 Wpad_WaitButtons(void);
#endif

View File

@ -1,44 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
namespace ForwardMii
{
public class ForwardMii_Plugin
{
const string version = "1.2"; //Hint for myself: Never use a char in the Version (UpdateCheck)!
public static string GetVersion()
{
return version;
}
public static bool CheckDevKit()
{
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DEVKITPRO")) ||
string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DEVKITPPC"))) return false;
if (Environment.OSVersion.VersionString.ToLower().Contains("windows"))
{ if (!System.IO.Directory.Exists(Environment.GetEnvironmentVariable("DEVKITPRO").Remove(0, 1).Insert(1, ":") + "/libogc")) return false; }
else
{ if (!System.IO.Directory.Exists(Environment.GetEnvironmentVariable("DEVKITPRO") + "/libogc")) return false; }
return true;
}
}
}

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{20CB2CA7-6767-4758-97FA-97395F47CD6B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ForwardMii</RootNamespace>
<AssemblyName>ForwardMii</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Drawing" />
</ItemGroup>
<ItemGroup>
<Compile Include="ForwardMii.cs" />
<Compile Include="ForwardMii_GX.cs" />
<Compile Include="ForwardMii_SDSDHC.cs" />
<Compile Include="ForwardMii_BaseEdit.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\SDSDHC\10CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\11CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\12CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\13CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\14CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\15CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\16CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\17CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\18CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\3CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\4CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\5CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\6CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\7CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\8CharsTail.bin" />
<EmbeddedResource Include="Resources\SDSDHC\9CharsTail.bin" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\SDSDHC\17CharsBase.bin" />
<EmbeddedResource Include="Resources\SDSDHC\3CharsBase.bin" />
<EmbeddedResource Include="Resources\SDSDHC\6CharsBase.bin" />
</ItemGroup>
<ItemGroup>
<Content Include="License.txt" />
<Content Include="Readme_ForwardMii.txt" />
<EmbeddedResource Include="Resources\GX\dolloader.c" />
<EmbeddedResource Include="Resources\GX\dolloader.h" />
<EmbeddedResource Include="Resources\GX\elfloader.c" />
<EmbeddedResource Include="Resources\GX\elfloader.h" />
<EmbeddedResource Include="Resources\GX\elf_abi.h" />
<EmbeddedResource Include="Resources\GX\fatmounter.c" />
<EmbeddedResource Include="Resources\GX\fatmounter.h" />
<EmbeddedResource Include="Resources\GX\filelist.h" />
<EmbeddedResource Include="Resources\GX\main.cpp" />
<EmbeddedResource Include="Resources\GX\video.cpp" />
<EmbeddedResource Include="Resources\GX\video.h" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\GX\Makefile" />
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -1,355 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Text;
using System.Runtime.InteropServices;
namespace ForwardMii
{
public class GXForwarder
{
private readonly string TempDir = Path.GetTempPath() + "ForwardMii_Temp" + Path.DirectorySeparatorChar + Guid.NewGuid() + Path.DirectorySeparatorChar;
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 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[] forwardPaths)
{
if (ForwardMii_Plugin.CheckDevKit() == false) throw new Exception("DevkitPro or one of it's components wasn't found!");
for (int i = 0; i < forwardPaths.Length; i++)
paths[i] = forwardPaths[i];
}
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!");
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()
{
for (int i = 0; i < paths.Length; i++) paths[i] = string.Empty;
image43 = string.Empty;
image169 = string.Empty;
}
public void Save(string Destionation)
{
Save(Destionation, false);
}
public void Save(string Destination, bool Overwrite)
{
byte[] theForwarder = ToByteArray();
if (Path.HasExtension(Destination) == false) Destination += ".dol";
if (File.Exists(Destination))
{
if (Overwrite == true)
File.Delete(Destination);
else
throw new Exception("The destination file already exists!");
}
using (FileStream fs = new FileStream(Destination, FileMode.Create))
{
fs.Write(theForwarder, 0, theForwarder.Length);
}
}
public byte[] ToByteArray()
{
MemoryStream ms = this.ToMemoryStream();
return ms.ToArray();
}
public MemoryStream ToMemoryStream()
{
try
{
if (Directory.Exists(TempDir)) Directory.Delete(TempDir, true);
CopyResources();
EditMainCpp();
CopyImages();
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); }
catch { }
return new MemoryStream(fileTemp);
}
catch (Exception ex)
{
if (Directory.Exists(TempDir)) Directory.Delete(TempDir, true);
throw new Exception(ex.Message);
}
}
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern uint GetShortPathName([MarshalAs(UnmanagedType.LPTStr)] string lpszLongPath,
[MarshalAs(UnmanagedType.LPTStr)] StringBuilder lpszShortPath, uint cchBuffer);
public static string GetShortPathName(string longPath)
{
uint size = 256;
StringBuilder buffer = new StringBuilder((int)size);
uint result = GetShortPathName(longPath, buffer, size);
return buffer.ToString();
}
private bool Compile()
{
try
{
string tempDir = TempDir;
if (tempDir.Contains(" ")) { tempDir = GetShortPathName(tempDir); }
ProcessStartInfo makeI = new ProcessStartInfo("make", "-C " + tempDir);
makeI.UseShellExecute = false;
makeI.CreateNoWindow = true;
Process make = Process.Start(makeI);
make.WaitForExit();
make.Close();
if (File.Exists(TempDir + "boot.dol") && File.Exists(TempDir + "boot.elf"))
{
return true;
}
else return false;
}
catch { return false; }
}
private void CopyImages()
{
if (!string.IsNullOrEmpty(image43) && File.Exists(image43))
{
try
{
Image img = Image.FromFile(image43);
if (img.Width != 640 || img.Height != 480)
img = ResizeImage(img, 640, 480);
img.Save(TempDir + Path.DirectorySeparatorChar + "source" + Path.DirectorySeparatorChar + "images" + Path.DirectorySeparatorChar + "background.png", System.Drawing.Imaging.ImageFormat.Png);
}
catch
{
Bitmap img = new Bitmap(640, 480);
img.Save(TempDir + Path.DirectorySeparatorChar + "source" + Path.DirectorySeparatorChar + "images" + Path.DirectorySeparatorChar + "background.png", System.Drawing.Imaging.ImageFormat.Png);
}
}
else
{
Bitmap img = new Bitmap(640, 480);
img.Save(TempDir + Path.DirectorySeparatorChar + "source" + Path.DirectorySeparatorChar + "images" + Path.DirectorySeparatorChar + "background.png", System.Drawing.Imaging.ImageFormat.Png);
}
if (!string.IsNullOrEmpty(image169) && File.Exists(image169))
{
try
{
Image img = Image.FromFile(image169);
if (img.Width != 640 || img.Height != 480)
img = ResizeImage(img, 640, 480);
img.Save(TempDir + Path.DirectorySeparatorChar + "source" + Path.DirectorySeparatorChar + "images" + Path.DirectorySeparatorChar + "background169.png", System.Drawing.Imaging.ImageFormat.Png);
}
catch
{
Bitmap img = new Bitmap(640, 480);
img.Save(TempDir + Path.DirectorySeparatorChar + "source" + Path.DirectorySeparatorChar + "images" + Path.DirectorySeparatorChar + "background169.png", System.Drawing.Imaging.ImageFormat.Png);
}
}
else
{
Bitmap img = new Bitmap(640, 480);
img.Save(TempDir + Path.DirectorySeparatorChar + "source" + Path.DirectorySeparatorChar + "images" + Path.DirectorySeparatorChar + "background169.png", System.Drawing.Imaging.ImageFormat.Png);
}
}
private Image ResizeImage(Image img, int x, int y)
{
Image newimage = new Bitmap(x, y);
using (Graphics gfx = Graphics.FromImage(newimage))
{
gfx.DrawImage(img, 0, 0, x, y);
}
return newimage;
}
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>();
string tempLine;
while ((tempLine = reader.ReadLine()) != null)
{
tempLines.Add(tempLine);
}
string[] lines = tempLines.ToArray();
for (int i = 0; i < lines.Length; i++)
{
if (lines[i].Contains("---path1---"))
lines[i] = lines[i].Replace("---path1---", paths[0]);
else if (lines[i].Contains("---path2---"))
lines[i] = lines[i].Replace("---path2---", paths[1]);
else if (lines[i].Contains("---path3---"))
lines[i] = lines[i].Replace("---path3---", paths[2]);
else if (lines[i].Contains("---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" + Path.DirectorySeparatorChar + "main.cpp", FileMode.Create))
{
using (StreamWriter writer = new StreamWriter(fs))
{
foreach (string thisLine in lines)
{
writer.WriteLine(thisLine);
}
}
}
}
private void CopyResources()
{
if (Directory.Exists(TempDir)) Directory.Delete(TempDir, true);
Directory.CreateDirectory(TempDir + "source" + Path.DirectorySeparatorChar + "images");
string[] Resources = new string[] { "dolloader.c", "dolloader.h", "elf_abi.h", "elfloader.c",
"elfloader.h", "fatmounter.c", "fatmounter.h", "filelist.h", "video.cpp", "video.h" };
foreach (string thisResource in Resources)
{
Stream tempStream = GetReourceStream(thisResource);
StreamToFile(tempStream, TempDir + "source" + Path.DirectorySeparatorChar + thisResource);
}
Stream makefile = GetReourceStream("Makefile");
StreamToFile(makefile, TempDir + "Makefile");
}
private void StreamToFile(Stream theStream, string Destination)
{
using (FileStream fs = new FileStream(Destination, FileMode.Create))
{
byte[] temp = new byte[theStream.Length];
theStream.Read(temp, 0, temp.Length);
fs.Write(temp, 0, temp.Length);
}
}
private MemoryStream GetReourceStream(string theResource)
{
Stream thisStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ForwardMii.Resources.GX." + theResource);
byte[] thisArray = new byte[thisStream.Length];
thisStream.Read(thisArray, 0, thisArray.Length);
return new MemoryStream(thisArray);
}
}
}

View File

@ -1,439 +0,0 @@
/* This file is part of CustomizeMii
* Copyright (C) 2009 Leathl
*
* CustomizeMii is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CustomizeMii is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.IO;
using System.Reflection;
namespace ForwardMii
{
public class SDSDHC_Forwarder
{
private string thisAppFolder;
private bool toElf = false;
public string AppFolder { get { return thisAppFolder; } set { thisAppFolder = value; } }
public bool ForwardToElf { get { return toElf; } set { toElf = value; } }
public SDSDHC_Forwarder()
{
}
public SDSDHC_Forwarder(string AppFolder)
{
if (AppFolder.Length > 18 || AppFolder.Length < 3) throw new Exception("Application folder must be 3 - 18 chars!");
thisAppFolder = AppFolder;
}
public SDSDHC_Forwarder(string AppFolder, bool ForwardToElf)
{
if (AppFolder.Length > 18 || AppFolder.Length < 3) throw new Exception("Application folder must be 3 - 18 chars!");
thisAppFolder = AppFolder;
toElf = ForwardToElf;
}
public void Clear()
{
thisAppFolder = string.Empty;
toElf = false;
}
public void Save(string Destionation)
{
Save(Destionation, false);
}
public void Save(string Destination, bool Overwrite)
{
byte[] theForwarder = ToByteArray();
if (Path.HasExtension(Destination) == false) Destination += ".dol";
if (File.Exists(Destination))
{
if (Overwrite == true)
File.Delete(Destination);
else
throw new Exception("The destination file already exists!");
}
using (FileStream fs = new FileStream(Destination, FileMode.Create))
{
fs.Write(theForwarder, 0, theForwarder.Length);
}
}
public byte[] ToByteArray()
{
MemoryStream ms = this.ToMemoryStream();
return ms.ToArray();
}
public MemoryStream ToMemoryStream()
{
MemoryStream BaseStream = GetBase();
MemoryStream TailStream = GetTail();
BaseStream = ConvertBase(BaseStream);
TailStream = EditTailFolder(TailStream);
byte[] BaseArray = BaseStream.ToArray();
byte[] TailArray = TailStream.ToArray();
MemoryStream Result = new MemoryStream();
Result.Seek(0, SeekOrigin.End);
Result.Write(BaseArray, 0, BaseArray.Length);
Result.Write(TailArray, 0, TailArray.Length);
return Result;
}
private MemoryStream EditTailFolder(MemoryStream TailStream)
{
char[] FolderChars = thisAppFolder.ToCharArray();
int[] Offsets = GetOffsets(FolderChars.Length);
TailStream.Seek(1, SeekOrigin.Begin);
foreach (char thisChar in FolderChars)
TailStream.WriteByte((byte)thisChar);
TailStream.Seek(Offsets[0], SeekOrigin.Begin);
foreach (char thisChar in FolderChars)
TailStream.WriteByte((byte)thisChar);
TailStream.Seek(Offsets[1], SeekOrigin.Begin);
foreach (char thisChar in FolderChars)
TailStream.WriteByte((byte)thisChar);
if (toElf == true)
TailStream = EditTailToElf(TailStream);
return TailStream;
}
private MemoryStream EditTailToElf(MemoryStream TailStream)
{
int[] Offsets = GetDolOffsets(thisAppFolder.Length);
byte[] Elf = new byte[] { 0x65, 0x6c, 0x66 };
foreach (int thisOffset in Offsets)
{
TailStream.Seek(thisOffset, SeekOrigin.Begin);
TailStream.Write(Elf, 0, Elf.Length);
}
return TailStream;
}
private int[] GetDolOffsets(int CharCount)
{
int[] Offsets = new int[5];
switch (CharCount)
{
case 3:
Offsets[0] = 10;
Offsets[1] = 25;
Offsets[2] = 87;
Offsets[3] = 336;
Offsets[4] = 344;
break;
case 4:
Offsets[0] = 11;
Offsets[1] = 25;
Offsets[2] = 87;
Offsets[3] = 336;
Offsets[4] = 344;
break;
case 5:
Offsets[0] = 12;
Offsets[1] = 25;
Offsets[2] = 91;
Offsets[3] = 340;
Offsets[4] = 348;
break;
case 6:
Offsets[0] = 13;
Offsets[1] = 29;
Offsets[2] = 95;
Offsets[3] = 348;
Offsets[4] = 356;
break;
case 7:
Offsets[0] = 14;
Offsets[1] = 29;
Offsets[2] = 95;
Offsets[3] = 348;
Offsets[4] = 356;
break;
case 8:
Offsets[0] = 15;
Offsets[1] = 29;
Offsets[2] = 95;
Offsets[3] = 348;
Offsets[4] = 356;
break;
case 9:
Offsets[0] = 16;
Offsets[1] = 29;
Offsets[2] = 99;
Offsets[3] = 352;
Offsets[4] = 360;
break;
case 10:
Offsets[0] = 17;
Offsets[1] = 33;
Offsets[2] = 103;
Offsets[3] = 360;
Offsets[4] = 368;
break;
case 11:
Offsets[0] = 18;
Offsets[1] = 33;
Offsets[2] = 103;
Offsets[3] = 360;
Offsets[4] = 368;
break;
case 12:
Offsets[0] = 19;
Offsets[1] = 33;
Offsets[2] = 103;
Offsets[3] = 360;
Offsets[4] = 368;
break;
case 13:
Offsets[0] = 20;
Offsets[1] = 33;
Offsets[2] = 107;
Offsets[3] = 364;
Offsets[4] = 372;
break;
case 14:
Offsets[0] = 21;
Offsets[1] = 37;
Offsets[2] = 111;
Offsets[3] = 372;
Offsets[4] = 380;
break;
case 15:
Offsets[0] = 22;
Offsets[1] = 37;
Offsets[2] = 11;
Offsets[3] = 372;
Offsets[4] = 380;
break;
case 16:
Offsets[0] = 23;
Offsets[1] = 37;
Offsets[2] = 111;
Offsets[3] = 372;
Offsets[4] = 380;
break;
case 17:
Offsets[0] = 24;
Offsets[1] = 37;
Offsets[2] = 115;
Offsets[3] = 376;
Offsets[4] = 384;
break;
case 18:
Offsets[0] = 25;
Offsets[1] = 41;
Offsets[2] = 119;
Offsets[3] = 384;
Offsets[4] = 392;
break;
default:
throw new Exception();
}
return Offsets;
}
private int[] GetOffsets(int CharCount)
{
int First = 0;
int Second = 0;
switch (CharCount)
{
case 3:
case 4:
First = 57;
Second = 100;
break;
case 5:
First = 57;
Second = 104;
break;
case 6:
case 7:
case 8:
First = 61;
Second = 108;
break;
case 9:
First = 61;
Second = 112;
break;
case 10:
case 11:
case 12:
case 13:
First = 65;
Second = 120;
break;
case 14:
case 15:
case 16:
First = 69;
Second = 124;
break;
case 17:
First = 69;
Second = 128;
break;
case 18:
First = 73;
Second = 132;
break;
default:
throw new Exception();
}
return new int[] { First, Second };
}
private MemoryStream GetBase()
{
switch (thisAppFolder.Length)
{
case 3:
case 4:
case 5:
return GetReourceStream("ForwardMii.Resources.SDSDHC.3CharsBase.bin");
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
return GetReourceStream("ForwardMii.Resources.SDSDHC.6CharsBase.bin");
case 17:
case 18:
return GetReourceStream("ForwardMii.Resources.SDSDHC.17CharsBase.bin");
default:
throw new Exception();
}
}
private MemoryStream GetTail()
{
switch (thisAppFolder.Length)
{
case 3:
return GetReourceStream("ForwardMii.Resources.SDSDHC.3CharsTail.bin");
case 4:
return GetReourceStream("ForwardMii.Resources.SDSDHC.4CharsTail.bin");
case 5:
return GetReourceStream("ForwardMii.Resources.SDSDHC.5CharsTail.bin");
case 6:
return GetReourceStream("ForwardMii.Resources.SDSDHC.6CharsTail.bin");
case 7:
return GetReourceStream("ForwardMii.Resources.SDSDHC.7CharsTail.bin");
case 8:
return GetReourceStream("ForwardMii.Resources.SDSDHC.8CharsTail.bin");
case 9:
return GetReourceStream("ForwardMii.Resources.SDSDHC.9CharsTail.bin");
case 10:
return GetReourceStream("ForwardMii.Resources.SDSDHC.10CharsTail.bin");
case 11:
return GetReourceStream("ForwardMii.Resources.SDSDHC.11CharsTail.bin");
case 12:
return GetReourceStream("ForwardMii.Resources.SDSDHC.12CharsTail.bin");
case 13:
return GetReourceStream("ForwardMii.Resources.SDSDHC.13CharsTail.bin");
case 14:
return GetReourceStream("ForwardMii.Resources.SDSDHC.14CharsTail.bin");
case 15:
return GetReourceStream("ForwardMii.Resources.SDSDHC.15CharsTail.bin");
case 16:
return GetReourceStream("ForwardMii.Resources.SDSDHC.16CharsTail.bin");
case 17:
return GetReourceStream("ForwardMii.Resources.SDSDHC.17CharsTail.bin");
case 18:
return GetReourceStream("ForwardMii.Resources.SDSDHC.18CharsTail.bin");
default:
throw new Exception();
}
}
private MemoryStream ConvertBase(MemoryStream BaseStream)
{
switch (thisAppFolder.Length)
{
case 3:
return BaseStream;
case 4:
return BaseStream;
case 5:
return SDSDHC_ConvertBaseStream.ConvertTo5Chars(BaseStream);
case 6:
return BaseStream;
case 7:
return BaseStream;
case 8:
return BaseStream;
case 9:
return SDSDHC_ConvertBaseStream.ConvertTo9Chars(BaseStream);
case 10:
return SDSDHC_ConvertBaseStream.ConvertTo10Chars(BaseStream);
case 11:
return SDSDHC_ConvertBaseStream.ConvertTo10Chars(BaseStream);
case 12:
return SDSDHC_ConvertBaseStream.ConvertTo10Chars(BaseStream);
case 13:
return SDSDHC_ConvertBaseStream.ConvertTo13Chars(BaseStream);
case 14:
return SDSDHC_ConvertBaseStream.ConvertTo14Chars(BaseStream);
case 15:
return SDSDHC_ConvertBaseStream.ConvertTo14Chars(BaseStream);
case 16:
return SDSDHC_ConvertBaseStream.ConvertTo14Chars(BaseStream);
case 17:
return BaseStream;
case 18:
return SDSDHC_ConvertBaseStream.ConvertTo18Chars(BaseStream);
default:
throw new Exception();
}
}
private MemoryStream GetReourceStream(string theResource)
{
Stream thisStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(theResource);
byte[] thisArray = new byte[thisStream.Length];
thisStream.Read(thisArray, 0, thisArray.Length);
return new MemoryStream(thisArray);
}
}
}

View File

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -1,146 +0,0 @@
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
endif
include $(DEVKITPPC)/wii_rules
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
TARGET := boot
BUILD := build
SOURCES := source source/images
DATA := data
INCLUDES :=
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
CFLAGS = -g -O2 -Wall $(MACHDEP) $(INCLUDE)
CXXFLAGS = $(CFLAGS)
#---------------------------------------------------------------------------------
# move loader to another location - THANKS CREDIAR - 0x81330000 for HBC
#---------------------------------------------------------------------------------
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map -Wl,--section-start,.init=0x81230000
#LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
#LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map -Wl,--section-start,.init=0x80003f00
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lfat -lpngu -lpng -lz -lbte -logc -lm
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(CURDIR)
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export OUTPUT := $(CURDIR)/$(TARGET)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
export DEPSDIR := $(CURDIR)/$(BUILD)
#---------------------------------------------------------------------------------
# automatically build a list of object files for our project
#---------------------------------------------------------------------------------
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
PNGFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.png)))
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
export LD := $(CC)
else
export LD := $(CXX)
endif
export OFILES := $(addsuffix .o,$(BINFILES)) \
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
$(sFILES:.s=.o) $(SFILES:.S=.o) \
$(PNGFILES:.png=.png.o)
#---------------------------------------------------------------------------------
# build a list of include paths
#---------------------------------------------------------------------------------
export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD) \
-I$(LIBOGC_INC)
#---------------------------------------------------------------------------------
# build a list of library paths
#---------------------------------------------------------------------------------
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
-L$(LIBOGC_LIB)
export OUTPUT := $(CURDIR)/$(TARGET)
.PHONY: $(BUILD) clean
#---------------------------------------------------------------------------------
$(BUILD):
@[ -d $@ ] || mkdir -p $@
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol
#---------------------------------------------------------------------------------
run:
wiiload $(TARGET).dol
#---------------------------------------------------------------------------------
pack:
zip -9 loadMii.zip $(TARGET).dol ../icon.png ../meta.xml ../README
#---------------------------------------------------------------------------------
else
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)
#---------------------------------------------------------------------------------
# This rule links in binary data with the .jpg extension
#---------------------------------------------------------------------------------
%.png.o : %.png
@echo $(notdir $<)
$(bin2o)
-include $(DEPENDS)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------

View File

@ -1,54 +0,0 @@
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <ogc/machine/processor.h>
#include <gccore.h>
#include <dirent.h>
#include <string.h>
#include "dolloader.h"
typedef struct _dolheader {
u32 text_pos[7];
u32 data_pos[11];
u32 text_start[7];
u32 data_start[11];
u32 text_size[7];
u32 data_size[11];
u32 bss_start;
u32 bss_size;
u32 entry_point;
} dolheader;
u32 load_dol_image (void *dolstart, struct __argv *argv) {
u32 i;
dolheader *dolfile;
if (dolstart) {
dolfile = (dolheader *) dolstart;
for (i = 0; i < 7; i++) {
if ((!dolfile->text_size[i]) || (dolfile->text_start[i] < 0x100)) continue;
VIDEO_WaitVSync();
ICInvalidateRange ((void *) dolfile->text_start[i],dolfile->text_size[i]);
memmove ((void *) dolfile->text_start[i],dolstart+dolfile->text_pos[i],dolfile->text_size[i]);
}
for(i = 0; i < 11; i++) {
if ((!dolfile->data_size[i]) || (dolfile->data_start[i] < 0x100)) continue;
VIDEO_WaitVSync();
memmove ((void *) dolfile->data_start[i],dolstart+dolfile->data_pos[i],dolfile->data_size[i]);
DCFlushRangeNoSync ((void *) dolfile->data_start[i],dolfile->data_size[i]);
}
memset ((void *) dolfile->bss_start, 0, dolfile->bss_size);
DCFlushRange((void *) dolfile->bss_start, dolfile->bss_size);
if (argv && argv->argvMagic == ARGV_MAGIC) {
void *new_argv = (void *)(dolfile->entry_point + 8);
memmove(new_argv, argv, sizeof(*argv));
DCFlushRange(new_argv, sizeof(*argv));
}
return dolfile->entry_point;
}
return 0;
}

View File

@ -1,23 +0,0 @@
#ifndef _DOLLOADER_H_
#define _DOLLOADER_H_
#ifdef __cplusplus
extern "C"
{
#endif
// Apps goes here
#define EXECUTABLE_MEM_ADDR 0x92000000
/* dol header */
extern void __exception_closeall();
typedef void (*entrypoint) (void);
u32 load_dol_image (void *dolstart, struct __argv *argv);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,594 +0,0 @@
/*
* Copyright (c) 1995, 1996, 2001, 2002
* Erik Theisen. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* This is the ELF ABI header file
* formerly known as "elf_abi.h".
*/
#ifndef _ELF_ABI_H
#define _ELF_ABI_H
#include <gctypes.h>
/*
* This version doesn't work for 64-bit ABIs - Erik.
*/
/*
* These typedefs need to be handled better.
*/
typedef u32 Elf32_Addr; /* Unsigned program address */
typedef u32 Elf32_Off; /* Unsigned file offset */
typedef s32 Elf32_Sword; /* Signed large integer */
typedef u32 Elf32_Word; /* Unsigned large integer */
typedef u16 Elf32_Half; /* Unsigned medium integer */
/* e_ident[] identification indexes */
#define EI_MAG0 0 /* file ID */
#define EI_MAG1 1 /* file ID */
#define EI_MAG2 2 /* file ID */
#define EI_MAG3 3 /* file ID */
#define EI_CLASS 4 /* file class */
#define EI_DATA 5 /* data encoding */
#define EI_VERSION 6 /* ELF header version */
#define EI_OSABI 7 /* OS/ABI specific ELF extensions */
#define EI_ABIVERSION 8 /* ABI target version */
#define EI_PAD 9 /* start of pad bytes */
#define EI_NIDENT 16 /* Size of e_ident[] */
/* e_ident[] magic number */
#define ELFMAG0 0x7f /* e_ident[EI_MAG0] */
#define ELFMAG1 'E' /* e_ident[EI_MAG1] */
#define ELFMAG2 'L' /* e_ident[EI_MAG2] */
#define ELFMAG3 'F' /* e_ident[EI_MAG3] */
#define ELFMAG "\177ELF" /* magic */
#define SELFMAG 4 /* size of magic */
/* e_ident[] file class */
#define ELFCLASSNONE 0 /* invalid */
#define ELFCLASS32 1 /* 32-bit objs */
#define ELFCLASS64 2 /* 64-bit objs */
#define ELFCLASSNUM 3 /* number of classes */
/* e_ident[] data encoding */
#define ELFDATANONE 0 /* invalid */
#define ELFDATA2LSB 1 /* Little-Endian */
#define ELFDATA2MSB 2 /* Big-Endian */
#define ELFDATANUM 3 /* number of data encode defines */
/* e_ident[] OS/ABI specific ELF extensions */
#define ELFOSABI_NONE 0 /* No extension specified */
#define ELFOSABI_HPUX 1 /* Hewlett-Packard HP-UX */
#define ELFOSABI_NETBSD 2 /* NetBSD */
#define ELFOSABI_LINUX 3 /* Linux */
#define ELFOSABI_SOLARIS 6 /* Sun Solaris */
#define ELFOSABI_AIX 7 /* AIX */
#define ELFOSABI_IRIX 8 /* IRIX */
#define ELFOSABI_FREEBSD 9 /* FreeBSD */
#define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX */
#define ELFOSABI_MODESTO 11 /* Novell Modesto */
#define ELFOSABI_OPENBSD 12 /* OpenBSD */
/* 64-255 Architecture-specific value range */
/* e_ident[] ABI Version */
#define ELFABIVERSION 0
/* e_ident */
#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \
(ehdr).e_ident[EI_MAG1] == ELFMAG1 && \
(ehdr).e_ident[EI_MAG2] == ELFMAG2 && \
(ehdr).e_ident[EI_MAG3] == ELFMAG3)
/* ELF Header */
typedef struct elfhdr{
unsigned char e_ident[EI_NIDENT]; /* ELF Identification */
Elf32_Half e_type; /* object file type */
Elf32_Half e_machine; /* machine */
Elf32_Word e_version; /* object file version */
Elf32_Addr e_entry; /* virtual entry point */
Elf32_Off e_phoff; /* program header table offset */
Elf32_Off e_shoff; /* section header table offset */
Elf32_Word e_flags; /* processor-specific flags */
Elf32_Half e_ehsize; /* ELF header size */
Elf32_Half e_phentsize; /* program header entry size */
Elf32_Half e_phnum; /* number of program header entries */
Elf32_Half e_shentsize; /* section header entry size */
Elf32_Half e_shnum; /* number of section header entries */
Elf32_Half e_shstrndx; /* section header table's "section
header string table" entry offset */
} Elf32_Ehdr;
/* e_type */
#define ET_NONE 0 /* No file type */
#define ET_REL 1 /* relocatable file */
#define ET_EXEC 2 /* executable file */
#define ET_DYN 3 /* shared object file */
#define ET_CORE 4 /* core file */
#define ET_NUM 5 /* number of types */
#define ET_LOOS 0xfe00 /* reserved range for operating */
#define ET_HIOS 0xfeff /* system specific e_type */
#define ET_LOPROC 0xff00 /* reserved range for processor */
#define ET_HIPROC 0xffff /* specific e_type */
/* e_machine */
#define EM_NONE 0 /* No Machine */
#define EM_M32 1 /* AT&T WE 32100 */
#define EM_SPARC 2 /* SPARC */
#define EM_386 3 /* Intel 80386 */
#define EM_68K 4 /* Motorola 68000 */
#define EM_88K 5 /* Motorola 88000 */
#if 0
#define EM_486 6 /* RESERVED - was Intel 80486 */
#endif
#define EM_860 7 /* Intel 80860 */
#define EM_MIPS 8 /* MIPS R3000 Big-Endian only */
#define EM_S370 9 /* IBM System/370 Processor */
#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */
#if 0
#define EM_SPARC64 11 /* RESERVED - was SPARC v9
64-bit unoffical */
#endif
/* RESERVED 11-14 for future use */
#define EM_PARISC 15 /* HPPA */
/* RESERVED 16 for future use */
#define EM_VPP500 17 /* Fujitsu VPP500 */
#define EM_SPARC32PLUS 18 /* Enhanced instruction set SPARC */
#define EM_960 19 /* Intel 80960 */
#define EM_PPC 20 /* PowerPC */
#define EM_PPC64 21 /* 64-bit PowerPC */
#define EM_S390 22 /* IBM System/390 Processor */
/* RESERVED 23-35 for future use */
#define EM_V800 36 /* NEC V800 */
#define EM_FR20 37 /* Fujitsu FR20 */
#define EM_RH32 38 /* TRW RH-32 */
#define EM_RCE 39 /* Motorola RCE */
#define EM_ARM 40 /* Advanced Risc Machines ARM */
#define EM_ALPHA 41 /* Digital Alpha */
#define EM_SH 42 /* Hitachi SH */
#define EM_SPARCV9 43 /* SPARC Version 9 */
#define EM_TRICORE 44 /* Siemens TriCore embedded processor */
#define EM_ARC 45 /* Argonaut RISC Core */
#define EM_H8_300 46 /* Hitachi H8/300 */
#define EM_H8_300H 47 /* Hitachi H8/300H */
#define EM_H8S 48 /* Hitachi H8S */
#define EM_H8_500 49 /* Hitachi H8/500 */
#define EM_IA_64 50 /* Intel Merced */
#define EM_MIPS_X 51 /* Stanford MIPS-X */
#define EM_COLDFIRE 52 /* Motorola Coldfire */
#define EM_68HC12 53 /* Motorola M68HC12 */
#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/
#define EM_PCP 55 /* Siemens PCP */
#define EM_NCPU 56 /* Sony nCPU embeeded RISC */
#define EM_NDR1 57 /* Denso NDR1 microprocessor */
#define EM_STARCORE 58 /* Motorola Start*Core processor */
#define EM_ME16 59 /* Toyota ME16 processor */
#define EM_ST100 60 /* STMicroelectronic ST100 processor */
#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/
#define EM_X86_64 62 /* AMD x86-64 */
#define EM_PDSP 63 /* Sony DSP Processor */
/* RESERVED 64,65 for future use */
#define EM_FX66 66 /* Siemens FX66 microcontroller */
#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */
#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */
#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */
#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */
#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */
#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */
#define EM_SVX 73 /* Silicon Graphics SVx */
#define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */
#define EM_VAX 75 /* Digital VAX */
#define EM_CHRIS 76 /* Axis Communications embedded proc. */
#define EM_JAVELIN 77 /* Infineon Technologies emb. proc. */
#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */
#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */
#define EM_MMIX 80 /* Donald Knuth's edu 64-bit proc. */
#define EM_HUANY 81 /* Harvard University mach-indep objs */
#define EM_PRISM 82 /* SiTera Prism */
#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */
#define EM_FR30 84 /* Fujitsu FR30 */
#define EM_D10V 85 /* Mitsubishi DV10V */
#define EM_D30V 86 /* Mitsubishi DV30V */
#define EM_V850 87 /* NEC v850 */
#define EM_M32R 88 /* Mitsubishi M32R */
#define EM_MN10300 89 /* Matsushita MN10200 */
#define EM_MN10200 90 /* Matsushita MN10200 */
#define EM_PJ 91 /* picoJava */
#define EM_NUM 92 /* number of machine types */
/* Version */
#define EV_NONE 0 /* Invalid */
#define EV_CURRENT 1 /* Current */
#define EV_NUM 2 /* number of versions */
/* Section Header */
typedef struct {
Elf32_Word sh_name; /* name - index into section header
string table section */
Elf32_Word sh_type; /* type */
Elf32_Word sh_flags; /* flags */
Elf32_Addr sh_addr; /* address */
Elf32_Off sh_offset; /* file offset */
Elf32_Word sh_size; /* section size */
Elf32_Word sh_link; /* section header table index link */
Elf32_Word sh_info; /* extra information */
Elf32_Word sh_addralign; /* address alignment */
Elf32_Word sh_entsize; /* section entry size */
} Elf32_Shdr;
/* Special Section Indexes */
#define SHN_UNDEF 0 /* undefined */
#define SHN_LORESERVE 0xff00 /* lower bounds of reserved indexes */
#define SHN_LOPROC 0xff00 /* reserved range for processor */
#define SHN_HIPROC 0xff1f /* specific section indexes */
#define SHN_LOOS 0xff20 /* reserved range for operating */
#define SHN_HIOS 0xff3f /* specific semantics */
#define SHN_ABS 0xfff1 /* absolute value */
#define SHN_COMMON 0xfff2 /* common symbol */
#define SHN_XINDEX 0xffff /* Index is an extra table */
#define SHN_HIRESERVE 0xffff /* upper bounds of reserved indexes */
/* sh_type */
#define SHT_NULL 0 /* inactive */
#define SHT_PROGBITS 1 /* program defined information */
#define SHT_SYMTAB 2 /* symbol table section */
#define SHT_STRTAB 3 /* string table section */
#define SHT_RELA 4 /* relocation section with addends*/
#define SHT_HASH 5 /* symbol hash table section */
#define SHT_DYNAMIC 6 /* dynamic section */
#define SHT_NOTE 7 /* note section */
#define SHT_NOBITS 8 /* no space section */
#define SHT_REL 9 /* relation section without addends */
#define SHT_SHLIB 10 /* reserved - purpose unknown */
#define SHT_DYNSYM 11 /* dynamic symbol table section */
#define SHT_INIT_ARRAY 14 /* Array of constructors */
#define SHT_FINI_ARRAY 15 /* Array of destructors */
#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */
#define SHT_GROUP 17 /* Section group */
#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */
#define SHT_NUM 19 /* number of section types */
#define SHT_LOOS 0x60000000 /* Start OS-specific */
#define SHT_HIOS 0x6fffffff /* End OS-specific */
#define SHT_LOPROC 0x70000000 /* reserved range for processor */
#define SHT_HIPROC 0x7fffffff /* specific section header types */
#define SHT_LOUSER 0x80000000 /* reserved range for application */
#define SHT_HIUSER 0xffffffff /* specific indexes */
/* Section names */
#define ELF_BSS ".bss" /* uninitialized data */
#define ELF_COMMENT ".comment" /* version control information */
#define ELF_DATA ".data" /* initialized data */
#define ELF_DATA1 ".data1" /* initialized data */
#define ELF_DEBUG ".debug" /* debug */
#define ELF_DYNAMIC ".dynamic" /* dynamic linking information */
#define ELF_DYNSTR ".dynstr" /* dynamic string table */
#define ELF_DYNSYM ".dynsym" /* dynamic symbol table */
#define ELF_FINI ".fini" /* termination code */
#define ELF_FINI_ARRAY ".fini_array" /* Array of destructors */
#define ELF_GOT ".got" /* global offset table */
#define ELF_HASH ".hash" /* symbol hash table */
#define ELF_INIT ".init" /* initialization code */
#define ELF_INIT_ARRAY ".init_array" /* Array of constuctors */
#define ELF_INTERP ".interp" /* Pathname of program interpreter */
#define ELF_LINE ".line" /* Symbolic line numnber information */
#define ELF_NOTE ".note" /* Contains note section */
#define ELF_PLT ".plt" /* Procedure linkage table */
#define ELF_PREINIT_ARRAY ".preinit_array" /* Array of pre-constructors */
#define ELF_REL_DATA ".rel.data" /* relocation data */
#define ELF_REL_FINI ".rel.fini" /* relocation termination code */
#define ELF_REL_INIT ".rel.init" /* relocation initialization code */
#define ELF_REL_DYN ".rel.dyn" /* relocaltion dynamic link info */
#define ELF_REL_RODATA ".rel.rodata" /* relocation read-only data */
#define ELF_REL_TEXT ".rel.text" /* relocation code */
#define ELF_RODATA ".rodata" /* read-only data */
#define ELF_RODATA1 ".rodata1" /* read-only data */
#define ELF_SHSTRTAB ".shstrtab" /* section header string table */
#define ELF_STRTAB ".strtab" /* string table */
#define ELF_SYMTAB ".symtab" /* symbol table */
#define ELF_SYMTAB_SHNDX ".symtab_shndx"/* symbol table section index */
#define ELF_TBSS ".tbss" /* thread local uninit data */
#define ELF_TDATA ".tdata" /* thread local init data */
#define ELF_TDATA1 ".tdata1" /* thread local init data */
#define ELF_TEXT ".text" /* code */
/* Section Attribute Flags - sh_flags */
#define SHF_WRITE 0x1 /* Writable */
#define SHF_ALLOC 0x2 /* occupies memory */
#define SHF_EXECINSTR 0x4 /* executable */
#define SHF_MERGE 0x10 /* Might be merged */
#define SHF_STRINGS 0x20 /* Contains NULL terminated strings */
#define SHF_INFO_LINK 0x40 /* sh_info contains SHT index */
#define SHF_LINK_ORDER 0x80 /* Preserve order after combining*/
#define SHF_OS_NONCONFORMING 0x100 /* Non-standard OS specific handling */
#define SHF_GROUP 0x200 /* Member of section group */
#define SHF_TLS 0x400 /* Thread local storage */
#define SHF_MASKOS 0x0ff00000 /* OS specific */
#define SHF_MASKPROC 0xf0000000 /* reserved bits for processor */
/* specific section attributes */
/* Section Group Flags */
#define GRP_COMDAT 0x1 /* COMDAT group */
#define GRP_MASKOS 0x0ff00000 /* Mask OS specific flags */
#define GRP_MASKPROC 0xf0000000 /* Mask processor specific flags */
/* Symbol Table Entry */
typedef struct elf32_sym {
Elf32_Word st_name; /* name - index into string table */
Elf32_Addr st_value; /* symbol value */
Elf32_Word st_size; /* symbol size */
unsigned char st_info; /* type and binding */
unsigned char st_other; /* 0 - no defined meaning */
Elf32_Half st_shndx; /* section header index */
} Elf32_Sym;
/* Symbol table index */
#define STN_UNDEF 0 /* undefined */
/* Extract symbol info - st_info */
#define ELF32_ST_BIND(x) ((x) >> 4)
#define ELF32_ST_TYPE(x) (((unsigned int) x) & 0xf)
#define ELF32_ST_INFO(b,t) (((b) << 4) + ((t) & 0xf))
#define ELF32_ST_VISIBILITY(x) ((x) & 0x3)
/* Symbol Binding - ELF32_ST_BIND - st_info */
#define STB_LOCAL 0 /* Local symbol */
#define STB_GLOBAL 1 /* Global symbol */
#define STB_WEAK 2 /* like global - lower precedence */
#define STB_NUM 3 /* number of symbol bindings */
#define STB_LOOS 10 /* reserved range for operating */
#define STB_HIOS 12 /* system specific symbol bindings */
#define STB_LOPROC 13 /* reserved range for processor */
#define STB_HIPROC 15 /* specific symbol bindings */
/* Symbol type - ELF32_ST_TYPE - st_info */
#define STT_NOTYPE 0 /* not specified */
#define STT_OBJECT 1 /* data object */
#define STT_FUNC 2 /* function */
#define STT_SECTION 3 /* section */
#define STT_FILE 4 /* file */
#define STT_NUM 5 /* number of symbol types */
#define STT_TLS 6 /* Thread local storage symbol */
#define STT_LOOS 10 /* reserved range for operating */
#define STT_HIOS 12 /* system specific symbol types */
#define STT_LOPROC 13 /* reserved range for processor */
#define STT_HIPROC 15 /* specific symbol types */
/* Symbol visibility - ELF32_ST_VISIBILITY - st_other */
#define STV_DEFAULT 0 /* Normal visibility rules */
#define STV_INTERNAL 1 /* Processor specific hidden class */
#define STV_HIDDEN 2 /* Symbol unavailable in other mods */
#define STV_PROTECTED 3 /* Not preemptible, not exported */
/* Relocation entry with implicit addend */
typedef struct
{
Elf32_Addr r_offset; /* offset of relocation */
Elf32_Word r_info; /* symbol table index and type */
} Elf32_Rel;
/* Relocation entry with explicit addend */
typedef struct
{
Elf32_Addr r_offset; /* offset of relocation */
Elf32_Word r_info; /* symbol table index and type */
Elf32_Sword r_addend;
} Elf32_Rela;
/* Extract relocation info - r_info */
#define ELF32_R_SYM(i) ((i) >> 8)
#define ELF32_R_TYPE(i) ((unsigned char) (i))
#define ELF32_R_INFO(s,t) (((s) << 8) + (unsigned char)(t))
/* Program Header */
typedef struct {
Elf32_Word p_type; /* segment type */
Elf32_Off p_offset; /* segment offset */
Elf32_Addr p_vaddr; /* virtual address of segment */
Elf32_Addr p_paddr; /* physical address - ignored? */
Elf32_Word p_filesz; /* number of bytes in file for seg. */
Elf32_Word p_memsz; /* number of bytes in mem. for seg. */
Elf32_Word p_flags; /* flags */
Elf32_Word p_align; /* memory alignment */
} Elf32_Phdr;
/* Segment types - p_type */
#define PT_NULL 0 /* unused */
#define PT_LOAD 1 /* loadable segment */
#define PT_DYNAMIC 2 /* dynamic linking section */
#define PT_INTERP 3 /* the RTLD */
#define PT_NOTE 4 /* auxiliary information */
#define PT_SHLIB 5 /* reserved - purpose undefined */
#define PT_PHDR 6 /* program header */
#define PT_TLS 7 /* Thread local storage template */
#define PT_NUM 8 /* Number of segment types */
#define PT_LOOS 0x60000000 /* reserved range for operating */
#define PT_HIOS 0x6fffffff /* system specific segment types */
#define PT_LOPROC 0x70000000 /* reserved range for processor */
#define PT_HIPROC 0x7fffffff /* specific segment types */
/* Segment flags - p_flags */
#define PF_X 0x1 /* Executable */
#define PF_W 0x2 /* Writable */
#define PF_R 0x4 /* Readable */
#define PF_MASKOS 0x0ff00000 /* OS specific segment flags */
#define PF_MASKPROC 0xf0000000 /* reserved bits for processor */
/* specific segment flags */
/* Dynamic structure */
typedef struct
{
Elf32_Sword d_tag; /* controls meaning of d_val */
union
{
Elf32_Word d_val; /* Multiple meanings - see d_tag */
Elf32_Addr d_ptr; /* program virtual address */
} d_un;
} Elf32_Dyn;
extern Elf32_Dyn _DYNAMIC[];
/* Dynamic Array Tags - d_tag */
#define DT_NULL 0 /* marks end of _DYNAMIC array */
#define DT_NEEDED 1 /* string table offset of needed lib */
#define DT_PLTRELSZ 2 /* size of relocation entries in PLT */
#define DT_PLTGOT 3 /* address PLT/GOT */
#define DT_HASH 4 /* address of symbol hash table */
#define DT_STRTAB 5 /* address of string table */
#define DT_SYMTAB 6 /* address of symbol table */
#define DT_RELA 7 /* address of relocation table */
#define DT_RELASZ 8 /* size of relocation table */
#define DT_RELAENT 9 /* size of relocation entry */
#define DT_STRSZ 10 /* size of string table */
#define DT_SYMENT 11 /* size of symbol table entry */
#define DT_INIT 12 /* address of initialization func. */
#define DT_FINI 13 /* address of termination function */
#define DT_SONAME 14 /* string table offset of shared obj */
#define DT_RPATH 15 /* string table offset of library
search path */
#define DT_SYMBOLIC 16 /* start sym search in shared obj. */
#define DT_REL 17 /* address of rel. tbl. w addends */
#define DT_RELSZ 18 /* size of DT_REL relocation table */
#define DT_RELENT 19 /* size of DT_REL relocation entry */
#define DT_PLTREL 20 /* PLT referenced relocation entry */
#define DT_DEBUG 21 /* bugger */
#define DT_TEXTREL 22 /* Allow rel. mod. to unwritable seg */
#define DT_JMPREL 23 /* add. of PLT's relocation entries */
#define DT_BIND_NOW 24 /* Process relocations of object */
#define DT_INIT_ARRAY 25 /* Array with addresses of init fct */
#define DT_FINI_ARRAY 26 /* Array with addresses of fini fct */
#define DT_INIT_ARRAYSZ 27 /* Size in bytes of DT_INIT_ARRAY */
#define DT_FINI_ARRAYSZ 28 /* Size in bytes of DT_FINI_ARRAY */
#define DT_RUNPATH 29 /* Library search path */
#define DT_FLAGS 30 /* Flags for the object being loaded */
#define DT_ENCODING 32 /* Start of encoded range */
#define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/
#define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */
#define DT_NUM 34 /* Number used. */
#define DT_LOOS 0x60000000 /* reserved range for OS */
#define DT_HIOS 0x6fffffff /* specific dynamic array tags */
#define DT_LOPROC 0x70000000 /* reserved range for processor */
#define DT_HIPROC 0x7fffffff /* specific dynamic array tags */
/* Dynamic Tag Flags - d_un.d_val */
#define DF_ORIGIN 0x01 /* Object may use DF_ORIGIN */
#define DF_SYMBOLIC 0x02 /* Symbol resolutions starts here */
#define DF_TEXTREL 0x04 /* Object contains text relocations */
#define DF_BIND_NOW 0x08 /* No lazy binding for this object */
#define DF_STATIC_TLS 0x10 /* Static thread local storage */
/* Standard ELF hashing function */
unsigned long elf_hash(const unsigned char *name);
#define ELF_TARG_VER 1 /* The ver for which this code is intended */
/*
* XXX - PowerPC defines really don't belong in here,
* but we'll put them in for simplicity.
*/
/* Values for Elf32/64_Ehdr.e_flags. */
#define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */
/* Cygnus local bits below */
#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/
#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib
flag */
/* PowerPC relocations defined by the ABIs */
#define R_PPC_NONE 0
#define R_PPC_ADDR32 1 /* 32bit absolute address */
#define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */
#define R_PPC_ADDR16 3 /* 16bit absolute address */
#define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */
#define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */
#define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */
#define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */
#define R_PPC_ADDR14_BRTAKEN 8
#define R_PPC_ADDR14_BRNTAKEN 9
#define R_PPC_REL24 10 /* PC relative 26 bit */
#define R_PPC_REL14 11 /* PC relative 16 bit */
#define R_PPC_REL14_BRTAKEN 12
#define R_PPC_REL14_BRNTAKEN 13
#define R_PPC_GOT16 14
#define R_PPC_GOT16_LO 15
#define R_PPC_GOT16_HI 16
#define R_PPC_GOT16_HA 17
#define R_PPC_PLTREL24 18
#define R_PPC_COPY 19
#define R_PPC_GLOB_DAT 20
#define R_PPC_JMP_SLOT 21
#define R_PPC_RELATIVE 22
#define R_PPC_LOCAL24PC 23
#define R_PPC_UADDR32 24
#define R_PPC_UADDR16 25
#define R_PPC_REL32 26
#define R_PPC_PLT32 27
#define R_PPC_PLTREL32 28
#define R_PPC_PLT16_LO 29
#define R_PPC_PLT16_HI 30
#define R_PPC_PLT16_HA 31
#define R_PPC_SDAREL16 32
#define R_PPC_SECTOFF 33
#define R_PPC_SECTOFF_LO 34
#define R_PPC_SECTOFF_HI 35
#define R_PPC_SECTOFF_HA 36
/* Keep this the last entry. */
#define R_PPC_NUM 37
/* The remaining relocs are from the Embedded ELF ABI, and are not
in the SVR4 ELF ABI. */
#define R_PPC_EMB_NADDR32 101
#define R_PPC_EMB_NADDR16 102
#define R_PPC_EMB_NADDR16_LO 103
#define R_PPC_EMB_NADDR16_HI 104
#define R_PPC_EMB_NADDR16_HA 105
#define R_PPC_EMB_SDAI16 106
#define R_PPC_EMB_SDA2I16 107
#define R_PPC_EMB_SDA2REL 108
#define R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */
#define R_PPC_EMB_MRKREF 110
#define R_PPC_EMB_RELSEC16 111
#define R_PPC_EMB_RELST_LO 112
#define R_PPC_EMB_RELST_HI 113
#define R_PPC_EMB_RELST_HA 114
#define R_PPC_EMB_BIT_FLD 115
#define R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */
/* Diab tool relocations. */
#define R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */
#define R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */
#define R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */
#define R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */
#define R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */
#define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */
/* This is a phony reloc to handle any old fashioned TOC16 references
that may still be in object files. */
#define R_PPC_TOC16 255
#endif /* _ELF_H */

View File

@ -1,103 +0,0 @@
/*
* Copyright (c) 2001 William L. Pitts
* Modifications (c) 2004 Felix Domke
* All rights reserved.
*
* Redistribution and use in source and binary forms are freely
* permitted provided that the above copyright notice and this
* paragraph and the following disclaimer are duplicated in all
* such forms.
*
* This software is provided "AS IS" and without any express or
* implied warranties, including, without limitation, the implied
* warranties of merchantability and fitness for a particular
* purpose.
*/
#include <stdio.h>
#include <string.h>
#include <gccore.h>
#include "elf_abi.h"
/* ======================================================================
* Determine if a valid ELF image exists at the given memory location.
* First looks at the ELF header magic field, the makes sure that it is
* executable and makes sure that it is for a PowerPC.
* ====================================================================== */
s32 valid_elf_image (void *addr)
{
Elf32_Ehdr *ehdr; /* Elf header structure pointer */
ehdr = (Elf32_Ehdr *) addr;
if (!IS_ELF (*ehdr))
return 0;
if (ehdr->e_type != ET_EXEC)
return -1;
if (ehdr->e_machine != EM_PPC)
return -1;
return 1;
}
/* ======================================================================
* A very simple elf loader, assumes the image is valid, returns the
* entry point address.
* ====================================================================== */
u32 load_elf_image (void *addr)
{
Elf32_Ehdr *ehdr;
Elf32_Shdr *shdr;
u8 *strtab = 0;
u8 *image;
int i;
ehdr = (Elf32_Ehdr *) addr;
/* Find the section header string table for output info */
shdr = (Elf32_Shdr *) (addr + ehdr->e_shoff +
(ehdr->e_shstrndx * sizeof (Elf32_Shdr)));
if (shdr->sh_type == SHT_STRTAB)
strtab = (u8 *) (addr + shdr->sh_offset);
/* Load each appropriate section */
for (i = 0; i < ehdr->e_shnum; ++i) {
shdr = (Elf32_Shdr *) (addr + ehdr->e_shoff +
(i * sizeof (Elf32_Shdr)));
if (!(shdr->sh_flags & SHF_ALLOC)
|| shdr->sh_addr == 0 || shdr->sh_size == 0) {
continue;
}
shdr->sh_addr &= 0x3FFFFFFF;
shdr->sh_addr |= 0x80000000;
if (strtab) {
/*printf ("%sing section %s @ 0x%08x (0x%08x bytes)\n",
(shdr->sh_type == SHT_NOBITS) ?
"clear" : "load",
&strtab[shdr->sh_name],
(u32) shdr->sh_addr,
(u32) shdr->sh_size);*/
}
if (shdr->sh_type == SHT_NOBITS) {
memset ((void *) shdr->sh_addr, 0, shdr->sh_size);
} else {
image = (u8 *) addr + shdr->sh_offset;
memcpy ((void *) shdr->sh_addr,
(const void *) image,
shdr->sh_size);
}
DCFlushRangeNoSync ((void *) shdr->sh_addr, shdr->sh_size);
}
return (ehdr->e_entry & 0x3FFFFFFF) | 0x80000000;
}

View File

@ -1,18 +0,0 @@
#ifndef _ELFLOADER_H_
#define _ELFLOADER_H_
#include <wiiuse/wpad.h>
#ifdef __cplusplus
extern "C"
{
#endif
s32 valid_elf_image (void *addr);
u32 load_elf_image (void *addr);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,184 +0,0 @@
#include <fat.h>
#include <string.h>
#include <sys/dir.h>
#include <sys/iosupport.h>
#include <ogc/lwp_watchdog.h>
#include <ogc/mutex.h>
#include <ogc/system.h>
#include <ogc/usbstorage.h>
#include <sdcard/wiisd_io.h>
//these are the only stable and speed is good
#define CACHE 8
#define SECTORS 64
enum BPB {
BPB_jmpBoot = 0x00,
BPB_OEMName = 0x03,
// BIOS Parameter Block
BPB_bytesPerSector = 0x0B,
BPB_sectorsPerCluster = 0x0D,
BPB_reservedSectors = 0x0E,
BPB_numFATs = 0x10,
BPB_rootEntries = 0x11,
BPB_numSectorsSmall = 0x13,
BPB_mediaDesc = 0x15,
BPB_sectorsPerFAT = 0x16,
BPB_sectorsPerTrk = 0x18,
BPB_numHeads = 0x1A,
BPB_numHiddenSectors = 0x1C,
BPB_numSectors = 0x20,
// Ext BIOS Parameter Block for FAT16
BPB_FAT16_driveNumber = 0x24,
BPB_FAT16_reserved1 = 0x25,
BPB_FAT16_extBootSig = 0x26,
BPB_FAT16_volumeID = 0x27,
BPB_FAT16_volumeLabel = 0x2B,
BPB_FAT16_fileSysType = 0x36,
// Bootcode
BPB_FAT16_bootCode = 0x3E,
// FAT32 extended block
BPB_FAT32_sectorsPerFAT32 = 0x24,
BPB_FAT32_extFlags = 0x28,
BPB_FAT32_fsVer = 0x2A,
BPB_FAT32_rootClus = 0x2C,
BPB_FAT32_fsInfo = 0x30,
BPB_FAT32_bkBootSec = 0x32,
// Ext BIOS Parameter Block for FAT32
BPB_FAT32_driveNumber = 0x40,
BPB_FAT32_reserved1 = 0x41,
BPB_FAT32_extBootSig = 0x42,
BPB_FAT32_volumeID = 0x43,
BPB_FAT32_volumeLabel = 0x47,
BPB_FAT32_fileSysType = 0x52,
// Bootcode
BPB_FAT32_bootCode = 0x5A,
BPB_bootSig_55 = 0x1FE,
BPB_bootSig_AA = 0x1FF
};
static const char FAT_SIG[3] = {'F', 'A', 'T'};
#define BYTES_PER_READ 512
static bool _FAT_partition_isFAT(const DISC_INTERFACE* disc, sec_t startSector)
{
uint8_t sectorBuffer[BYTES_PER_READ] = {0};
if (!disc->readSectors(startSector, 1, sectorBuffer)) {
return false;
}
// Make sure it is a valid BPB
if ( (sectorBuffer[BPB_bootSig_55] != 0x55) || (sectorBuffer[BPB_bootSig_AA] != 0xAA)) {
return false;
}
// Now verify that this is indeed a FAT partition
if (memcmp(sectorBuffer + BPB_FAT16_fileSysType, FAT_SIG, sizeof(FAT_SIG)) &&
memcmp(sectorBuffer + BPB_FAT32_fileSysType, FAT_SIG, sizeof(FAT_SIG)))
{
return false;
}
// check again for the last two cases to make sure that we really have a FAT filesystem here
// and won't corrupt any data
if(memcmp(sectorBuffer + BPB_FAT16_fileSysType, "FAT", 3) != 0 && memcmp(sectorBuffer + BPB_FAT32_fileSysType, "FAT32", 5) != 0)
{
return false;
}
return true;
}
static inline uint32_t u8array_to_u32 (const uint8_t* item, int offset) {
return ( item[offset] | (item[offset + 1] << 8) | (item[offset + 2] << 16) | (item[offset + 3] << 24));
}
sec_t GetFATPartition(const DISC_INTERFACE* disc)
{
int i;
uint8_t sectorBuffer[BYTES_PER_READ] = {0};
sec_t startSector = 0;
if(!disc->startup())
return 0;
// Read first sector of disc
if (!disc->readSectors(0, 1, sectorBuffer))
startSector = 0;
// Make sure it is a valid MBR or boot sector
if ( (sectorBuffer[BPB_bootSig_55] != 0x55) || (sectorBuffer[BPB_bootSig_AA] != 0xAA))
startSector = 0;
if (!memcmp(sectorBuffer + BPB_FAT16_fileSysType, FAT_SIG, sizeof(FAT_SIG)))
{
// Check if there is a FAT string, which indicates this is a boot sector
startSector = 0;
}
else if (!memcmp(sectorBuffer + BPB_FAT32_fileSysType, FAT_SIG, sizeof(FAT_SIG)))
{
// Check for FAT32
startSector = 0;
}
else
{
// This is an MBR
// Find first valid partition from MBR
// First check for an active partition
for (i=0x1BE; (i < 0x1FE) && (sectorBuffer[i] != 0x80); i+= 0x10);
// If it find an active partition, check for FAT-Partition
if ( i != 0x1FE && !_FAT_partition_isFAT(disc, u8array_to_u32(sectorBuffer, 0x8 + i)) )
i = 0x1FE;
// If it didn't find an active partition, search for any valid partition
if (i == 0x1FE)
{
for (i=0x1BE; i < 0x1FE; i+= 0x10)
{
if ( sectorBuffer[i+0x04] != 0x00 && _FAT_partition_isFAT(disc, u8array_to_u32(sectorBuffer, 0x8 + i)) )
break;
}
}
if (i != 0x1FE)
startSector = u8array_to_u32(sectorBuffer, 0x8 + i);;
}
disc->shutdown();
return startSector;
}
int USBDevice_Init()
{
//closing all open Files write back the cache and then shutdown em!
fatUnmount("USB:/");
//right now mounts first FAT-partition
if (fatMount("USB", &__io_usbstorage, GetFATPartition(&__io_usbstorage), CACHE, SECTORS)) {
//try first mount with libogc
return 1;
}
return -1;
}
void USBDevice_deInit()
{
//closing all open Files write back the cache and then shutdown em!
fatUnmount("USB:/");
}
int isSdInserted()
{
return __io_wiisd.isInserted();
}
int SDCard_Init()
{
//closing all open Files write back the cache and then shutdown em!
fatUnmount("SD:/");
//right now mounts first FAT-partition
if (fatMount("SD", &__io_wiisd, GetFATPartition(&__io_wiisd), CACHE, SECTORS))
return 1;
return -1;
}
void SDCard_deInit()
{
//closing all open Files write back the cache and then shutdown em!
fatUnmount("SD:/");
}

View File

@ -1,19 +0,0 @@
#ifndef _FATMOUNTER_H_
#define _FATMOUNTER_H_
#ifdef __cplusplus
extern "C"
{
#endif
int USBDevice_Init();
void USBDevice_deInit();
int isSdInserted();
int SDCard_Init();
void SDCard_deInit();
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,20 +0,0 @@
/****************************************************************************
* libwiigui Template
* Tantric 2009
*
* imagelist.h
* Contains a list of all of the files in the images, fonts, sounds folders
***************************************************************************/
#ifndef _FILELIST_H_
#define _FILELIST_H_
#include <gccore.h>
extern const u8 background_png[];
extern const u32 background_png_size;
extern const u8 background169_png[];
extern const u32 background169_png_size;
#endif

View File

@ -1,306 +0,0 @@
/*
* loadMii loader v0.3
* main.c
* http://code.google.com/p/loadmii
*
* Copyright 2009 The Lemon Man
* Thanks to luccax, Wiipower, Aurelio and crediar
* GX added by dimok (thanks to Tantric)
* usbGecko powered by Nuke
* little modifications by Leathl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#include <gccore.h>
#include <malloc.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <ogc/machine/processor.h>
#include "pngu/pngu.h"
#include "video.h"
#include "filelist.h"
#include "dolloader.h"
#include "elfloader.h"
#include "fatmounter.h"
/*edit these*/
#define PATH1 "---path1---"
#define PATH2 "---path2---"
#define PATH3 "---path3---"
#define PATH4 "---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;
u8 * GetImageData(void) {
u8 * data = NULL;
int ret;
if (CONF_GetAspectRatio()) {
ctx = PNGU_SelectImageFromBuffer(background169_png);
if (!ctx)
return NULL;
} else {
ctx = PNGU_SelectImageFromBuffer(background_png);
if (!ctx)
return NULL;
}
ret = PNGU_GetImageProperties(ctx, &imgProp);
if (ret != PNGU_OK)
return NULL;
int len = imgProp.imgWidth * imgProp.imgHeight * 4;
if(len%32) len += (32-len%32);
data = (u8 *)memalign (32, len);
ret = PNGU_DecodeTo4x4RGBA8 (ctx, imgProp.imgWidth, imgProp.imgHeight, data, 255);
DCFlushRange(data, len);
PNGU_ReleaseImageContext(ctx);
return data;
}
void Background_Show(int x, int y, int z, u8 * data, int angle, int scaleX, int scaleY, int alpha)
{
/* Draw image */
Menu_DrawImg(x, y, z, imgProp.imgWidth, imgProp.imgHeight, data, angle, scaleX, scaleY, alpha);
}
int main(int argc, char **argv)
{
u32 cookie;
FILE *exeFile = NULL;
void *exeBuffer = (void *)EXECUTABLE_MEM_ADDR;
int exeSize = 0;
u32 exeEntryPointAddress = 0;
entrypoint exeEntryPoint;
/* int videomod */
InitVideo();
/* get imagedata */
u8 * imgdata = GetImageData();
/* fadein of image */
for(int i = 0; i < 255; i = i+10)
{
if(i>255) i = 255;
Background_Show(0, 0, 0, imgdata, 0, 1, 1, i);
Menu_Render();
}
/* check devices */
SDCard_Init();
USBDevice_Init();
char cfgpath[256];
/* Open dol File and check exist */
sprintf(cfgpath, PATH1);
exeFile = fopen (cfgpath ,"rb");
if (exeFile==NULL)
{
sprintf(cfgpath, PATH2);
exeFile = fopen (cfgpath ,"rb");
}
if (exeFile==NULL)
{
sprintf(cfgpath, PATH3);
exeFile = fopen (cfgpath ,"rb");
}
if (exeFile==NULL)
{
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");
Menu_Render();
sleep(3);
fclose (exeFile);
SDCard_deInit();
USBDevice_deInit();
StopGX();
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
}
fseek (exeFile, 0, SEEK_END);
exeSize = ftell(exeFile);
fseek (exeFile, 0, SEEK_SET);
if(fread (exeBuffer, 1, exeSize, exeFile) != (unsigned int) exeSize)
{
printf("\n\n\t\tCan't open DOL File...\n");
Menu_Render();
fclose (exeFile);
sleep(3);
SDCard_deInit();
USBDevice_deInit();
StopGX();
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
}
fclose (exeFile);
/* load entry point */
struct __argv args;
bzero(&args, sizeof(args));
args.argvMagic = ARGV_MAGIC;
args.length = strlen(cfgpath) + 2;
args.commandLine = (char*)malloc(args.length);
if (!args.commandLine) SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
strcpy(args.commandLine, cfgpath);
args.commandLine[args.length - 1] = '\0';
args.argc = 1;
args.argv = &args.commandLine;
args.endARGV = args.argv + 1;
int ret = valid_elf_image(exeBuffer);
if (ret == 1)
exeEntryPointAddress = load_elf_image(exeBuffer);
else
exeEntryPointAddress = load_dol_image(exeBuffer, &args);
/* fadeout of image */
for(int i = 255; i > 1; i = i-7)
{
if(i < 0) i = 0;
Background_Show(0, 0, 0, imgdata, 0, 1, 1, i);
Menu_Render();
}
SDCard_deInit();
USBDevice_deInit();
StopGX();
if (exeEntryPointAddress == 0) {
printf("EntryPointAddress failed...\n");
Menu_Render();
sleep(3);
fclose (exeFile);
SDCard_deInit();
USBDevice_deInit();
StopGX();
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);;
}
exeEntryPoint = (entrypoint) exeEntryPointAddress;
/* cleaning up and load dol */
SYS_ResetSystem(SYS_SHUTDOWN, 0, 0);
_CPU_ISR_Disable (cookie);
__exception_closeall ();
exeEntryPoint ();
_CPU_ISR_Restore (cookie);
return 0;
}

View File

@ -1,245 +0,0 @@
/****************************************************************************
* libwiigui Template
* Tantric 2009
*
* video.cpp
* Video routines
***************************************************************************/
#include <gccore.h>
#include <ogcsys.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <ogc/conf.h>
#define DEFAULT_FIFO_SIZE 256 * 1024
static unsigned int *xfb[2] = { NULL, NULL }; // Double buffered
static int whichfb = 0; // Switch
static GXRModeObj *vmode; // Menu video mode
static unsigned char gp_fifo[DEFAULT_FIFO_SIZE] ATTRIBUTE_ALIGN (32);
static Mtx GXmodelView2D;
/****************************************************************************
* StartGX
*
* Initialises GX and sets it up for use
***************************************************************************/
static void
StartGX ()
{
GXColor background = { 0, 0, 0, 0xff };
/*** Clear out FIFO area ***/
memset (&gp_fifo, 0, DEFAULT_FIFO_SIZE);
/*** Initialise GX ***/
GX_Init (&gp_fifo, DEFAULT_FIFO_SIZE);
GX_SetCopyClear (background, 0x00ffffff);
GX_SetDispCopyGamma (GX_GM_1_0);
GX_SetCullMode (GX_CULL_NONE);
}
/****************************************************************************
* ResetVideo_Menu
*
* Reset the video/rendering mode for the menu
****************************************************************************/
void
ResetVideo_Menu()
{
Mtx44 p;
f32 yscale;
u32 xfbHeight;
VIDEO_Configure (vmode);
VIDEO_Flush();
VIDEO_WaitVSync();
if (vmode->viTVMode & VI_NON_INTERLACE)
VIDEO_WaitVSync();
else
while (VIDEO_GetNextField())
VIDEO_WaitVSync();
// clears the bg to color and clears the z buffer
GXColor background = {0, 0, 0, 255};
GX_SetCopyClear (background, 0x00ffffff);
yscale = GX_GetYScaleFactor(vmode->efbHeight,vmode->xfbHeight);
xfbHeight = GX_SetDispCopyYScale(yscale);
GX_SetScissor(0,0,vmode->fbWidth,vmode->efbHeight);
GX_SetDispCopySrc(0,0,vmode->fbWidth,vmode->efbHeight);
GX_SetDispCopyDst(vmode->fbWidth,xfbHeight);
GX_SetCopyFilter(vmode->aa,vmode->sample_pattern,GX_TRUE,vmode->vfilter);
GX_SetFieldMode(vmode->field_rendering,((vmode->viHeight==2*vmode->xfbHeight)?GX_ENABLE:GX_DISABLE));
if (vmode->aa)
GX_SetPixelFmt(GX_PF_RGB565_Z16, GX_ZC_LINEAR);
else
GX_SetPixelFmt(GX_PF_RGB8_Z24, GX_ZC_LINEAR);
// setup the vertex descriptor
// tells the flipper to expect direct data
GX_ClearVtxDesc();
GX_InvVtxCache ();
GX_InvalidateTexAll();
GX_SetVtxDesc(GX_VA_TEX0, GX_NONE);
GX_SetVtxDesc(GX_VA_POS, GX_DIRECT);
GX_SetVtxDesc (GX_VA_CLR0, GX_DIRECT);
GX_SetVtxAttrFmt (GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
GX_SetVtxAttrFmt (GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
GX_SetZMode (GX_FALSE, GX_LEQUAL, GX_TRUE);
GX_SetNumChans(1);
GX_SetNumTexGens(1);
GX_SetTevOp (GX_TEVSTAGE0, GX_PASSCLR);
GX_SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GX_SetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
guMtxIdentity(GXmodelView2D);
guMtxTransApply (GXmodelView2D, GXmodelView2D, 0.0F, 0.0F, -200.0F);
GX_LoadPosMtxImm(GXmodelView2D,GX_PNMTX0);
guOrtho(p,0,479,0,639,0,300);
GX_LoadProjectionMtx(p, GX_ORTHOGRAPHIC);
GX_SetViewport(0,0,vmode->fbWidth,vmode->efbHeight,0,1);
GX_SetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_CLEAR);
GX_SetAlphaUpdate(GX_TRUE);
}
/****************************************************************************
* InitVideo
*
* This function MUST be called at startup.
* - also sets up menu video mode
***************************************************************************/
void
InitVideo ()
{
VIDEO_Init();
vmode = VIDEO_GetPreferredMode(NULL); // get default video mode
//Widescreen loading image fix...
vmode->viWidth = 678;
vmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 678) / 2;
VIDEO_Configure (vmode);
// Allocate the video buffers
xfb[0] = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer (vmode));
xfb[1] = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer (vmode));
// A console is always useful while debugging
console_init (xfb[0], 20, 64, vmode->fbWidth, vmode->xfbHeight, vmode->fbWidth * 2);
// Clear framebuffers etc.
VIDEO_ClearFrameBuffer (vmode, xfb[0], COLOR_BLACK);
VIDEO_ClearFrameBuffer (vmode, xfb[1], COLOR_BLACK);
VIDEO_SetNextFramebuffer (xfb[0]);
VIDEO_SetBlack (FALSE);
VIDEO_Flush ();
VIDEO_WaitVSync ();
if (vmode->viTVMode & VI_NON_INTERLACE)
VIDEO_WaitVSync ();
StartGX();
ResetVideo_Menu();
// Finally, the video is up and ready for use :)
}
/****************************************************************************
* StopGX
*
* Stops GX (when exiting)
***************************************************************************/
void StopGX()
{
GX_AbortFrame();
GX_Flush();
VIDEO_SetBlack(TRUE);
VIDEO_Flush();
}
/****************************************************************************
* Menu_Render
*
* Renders everything current sent to GX, and flushes video
***************************************************************************/
void Menu_Render()
{
GX_DrawDone ();
whichfb ^= 1; // flip framebuffer
GX_SetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);
GX_SetColorUpdate(GX_TRUE);
GX_CopyDisp(xfb[whichfb],GX_TRUE);
VIDEO_SetNextFramebuffer(xfb[whichfb]);
VIDEO_Flush();
VIDEO_WaitVSync();
}
/****************************************************************************
* Menu_DrawImg
*
* Draws the specified image on screen using GX
***************************************************************************/
void Menu_DrawImg(f32 xpos, f32 ypos, f32 zpos, u16 width, u16 height, u8 data[],
f32 degrees, f32 scaleX, f32 scaleY, u8 alpha)
{
if(data == NULL)
return;
GXTexObj texObj;
GX_InitTexObj(&texObj, data, width,height, GX_TF_RGBA8,GX_CLAMP, GX_CLAMP,GX_FALSE);
GX_LoadTexObj(&texObj, GX_TEXMAP0);
GX_InvalidateTexAll();
GX_SetTevOp (GX_TEVSTAGE0, GX_MODULATE);
GX_SetVtxDesc (GX_VA_TEX0, GX_DIRECT);
Mtx m,m1,m2, mv;
width *=.5;
height*=.5;
guMtxIdentity (m1);
guMtxScaleApply(m1,m1,scaleX,scaleY,1.0);
Vector axis = (Vector) {0 , 0, 1 };
guMtxRotAxisDeg (m2, &axis, degrees);
guMtxConcat(m1,m2,m);
guMtxTransApply(m,m, xpos+width+0.5,ypos+height+0.5,zpos);
guMtxConcat (GXmodelView2D, m, mv);
GX_LoadPosMtxImm (mv, GX_PNMTX0);
GX_Begin(GX_QUADS, GX_VTXFMT0,4);
GX_Position3f32(-width, -height, 0);
GX_Color4u8(0xFF,0xFF,0xFF,alpha);
GX_TexCoord2f32(0, 0);
GX_Position3f32(width, -height, 0);
GX_Color4u8(0xFF,0xFF,0xFF,alpha);
GX_TexCoord2f32(1, 0);
GX_Position3f32(width, height, 0);
GX_Color4u8(0xFF,0xFF,0xFF,alpha);
GX_TexCoord2f32(1, 1);
GX_Position3f32(-width, height, 0);
GX_Color4u8(0xFF,0xFF,0xFF,alpha);
GX_TexCoord2f32(0, 1);
GX_End();
GX_LoadPosMtxImm (GXmodelView2D, GX_PNMTX0);
GX_SetTevOp (GX_TEVSTAGE0, GX_PASSCLR);
GX_SetVtxDesc (GX_VA_TEX0, GX_NONE);
}

View File

@ -1,20 +0,0 @@
/****************************************************************************
* libwiigui Template
* Tantric 2009
*
* video.h
* Video routines
***************************************************************************/
#ifndef _VIDEO_H_
#define _VIDEO_H_
#include <ogcsys.h>
void InitVideo ();
void StopGX();
void ResetVideo_Menu();
void Menu_Render();
void Menu_DrawImg(f32 xpos, f32 ypos, f32 zpos, u16 width, u16 height, u8 data[], f32 degrees, f32 scaleX, f32 scaleY, u8 alphaF );
#endif

Some files were not shown because too many files have changed in this diff Show More