Exemple #1
0
        private void Button_Click_5(object sender, RoutedEventArgs e)
        {
            Custom_Message cm = new Custom_Message("Credits", "UWUVCI AIO - NicoAICP, Morilli, Lreiia Bot\nBeta Testers/Contributors - wowjinxy, Danis, Adolfobenjaminv\n\n7za - Igor Pavlov\nBuildPcePkg & BuildTurboCDPcePkg - JohnnyGo\nCdecrypt -  crediar\nCNUSPACKER - NicoAICP, Morilli\nINICreator - NicoAICP\nN64Converter - Morilli\npng2tga - Easy2Convert\ninject_gba_c (psb) - Morilli\nRetroInject_C - Morilli\ntga_verify - Morilli\nWiiUDownloader - Morilli\nwiiurpxtool - 0CHB0\nGoomba - FluBBa\nDarkFilter Removal N64 - MelonSpeedruns\nNintendont SD Card Menu - TeconMoon\nwit - Wiimm\nGetExtTypePatcher - Fix94\nnfs2iso2nfs - sabykos, piratesephiroth, Fix94 and many more\nWii-VMC - wanikoko\nIcon/TV Bootimages - Flump\nNKit - Nanook\nImage Creation Base - Phacox\nWiiGameLanguage Patcher - ReturnerS\nChangeAspectRatio - andot\nvWii Title Forwarder - Fix94");

            try
            {
                cm.Owner = (FindResource("mvm") as MainViewModel).mw;
            }
            catch (Exception)
            {
            }
            cm.ShowDialog();
        }
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            string path = mvm.GetFilePath(true, true);

            if (!CheckIfNull(path))
            {
                if (new FileInfo(path).Extension.Contains("wav"))
                {
                    if (mvm.ConfirmRiffWave(path))
                    {
                        mvm.BootSound = path;
                    }
                    else
                    {
                        Custom_Message cm = new Custom_Message("Incompatible WAV file", "Your WAV file needs to be a RIFF WAVE file which is 16 bit stereo and also 48000khz");
                        try
                        {
                            cm.Owner = mvm.mw;
                        }
                        catch (Exception)
                        {
                        }
                        cm.ShowDialog();
                    }
                }
                else
                {
                    mvm.BootSound = path;
                }
            }
            else
            {
                if (path == "")
                {
                    mvm.BootSound = null;
                    sound.Text    = "";
                }
            }
        }
Exemple #3
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     try
     {
         string title = "";
         if (mvm.GameConfiguration.Console.ToString().ToLower() == "nds")
         {
             title = $"Nintendo DS Inject Guide";
         }
         else
         {
             title = $"{mvm.GameConfiguration.Console.ToString()} Inject Guide";
         }
         TitleKeys webbrowser = new TitleKeys(mvm.GameConfiguration.Console.ToString().ToLower(), title);
         try
         {
             webbrowser.Owner = mvm.mw;
         }
         catch (Exception)
         {
         }
         webbrowser.Show();
         mvm.mw.Hide();
     }
     catch (Exception)
     {
         Custom_Message cm = new Custom_Message("Not Implemented", $"The Helppage for {mvm.GameConfiguration.Console.ToString()} is not implemented yet");
         try
         {
             cm.Owner = mvm.mw;
         }
         catch (Exception)
         {
         }
         cm.Show();
     }
 }
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            try
            {
                TitleKeys webbrowser = null;
                if (cd)
                {
                    webbrowser = new TitleKeys("tgcd", "TurboGrafX Inject Guide");
                }
                else
                {
                    webbrowser = new TitleKeys("tg16", "TurboGrafX Inject Guide");
                }

                try
                {
                    webbrowser.Owner = mvm.mw;
                }
                catch (Exception)
                {
                }
                webbrowser.Show();
                mvm.mw.Hide();
            }
            catch (Exception)
            {
                Custom_Message cm = new Custom_Message("Not Implemented", $"The Helppage for TurboGrafX is not implemented yet");
                try
                {
                    cm.Owner = mvm.mw;
                }
                catch (Exception)
                {
                }
                cm.Show();
            }
        }
        private void Set_Rom_Path(object sender, RoutedEventArgs e)
        {
            string path = string.Empty;

            path = mvm.GetFilePath(true, false);
            int  TitleIDInt = 0;
            bool isok       = false;

            if (!CheckIfNull(path))
            {
                using (var reader = new BinaryReader(File.OpenRead(path)))
                {
                    if (path.ToLower().Contains(".gcz"))
                    {
                        isok = true;
                    }
                    else
                    {
                        reader.BaseStream.Position = 0x00;
                        TitleIDInt = reader.ReadInt32();
                        if (TitleIDInt != 65536 && TitleIDInt != 1397113431)
                        {
                            reader.BaseStream.Position = 0x18;
                            long GameType = reader.ReadInt64();
                            if (GameType == 4440324665927270400)
                            {
                                isok = true;
                            }
                        }
                        reader.Close();
                    }
                }
                if (isok)
                {
                    trimn.IsEnabled = true;
                    if (path.Contains("nkit.iso"))
                    {
                        trimn.IsEnabled = false;
                        trimn.IsChecked = false;
                        trimn_Click(null, null);
                    }
                    mvm.RomPath = path;
                    mvm.RomSet  = true;
                    if (mvm.BaseDownloaded)
                    {
                        mvm.CanInject = true;
                    }
                    if (!path.ToLower().Contains(".gcz"))
                    {
                        trimn.IsChecked = false;
                        trimn_Click(null, null);
                        string rom = mvm.getInternalWIIGCNName(mvm.RomPath, true);
                        Regex  reg = new Regex("[*'\",_&#^@:;?!<>|µ~#°²³´`éⓇ©™]");
                        gn.Text = reg.Replace(rom, string.Empty);
                        mvm.GameConfiguration.GameName = reg.Replace(rom, string.Empty);
                        mvm.gc2rom = "";
                        if (mvm.GameConfiguration.TGAIco.ImgPath != "" || mvm.GameConfiguration.TGAIco.ImgPath != null)
                        {
                            ic.Text = mvm.GameConfiguration.TGAIco.ImgPath;
                        }
                        if (mvm.GameConfiguration.TGATv.ImgPath != "" || mvm.GameConfiguration.TGATv.ImgPath != null)
                        {
                            tv.Text = mvm.GameConfiguration.TGATv.ImgPath;
                        }
                    }
                }
                else
                {
                    Custom_Message cm = new Custom_Message("Wrong ROM", "The chosen ROM is not a supported GameCube Game");
                    try
                    {
                        cm.Owner = mvm.mw;
                    }
                    catch (Exception)
                    {
                    }
                    cm.ShowDialog();
                }
            }
        }
Exemple #6
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            if (Directory.Exists(@"custom"))
            {
                if (File.Exists(@"custom\main.dol"))
                {
                    if (File.Exists(@"bin\Tools\nintendont.dol"))
                    {
                        File.Delete(@"bin\Tools\nintendont.dol");
                        File.Copy(@"custom\main.dol", @"bin\Tools\nintendont.dol");
                    }
                    else
                    {
                        if (!Directory.Exists(@"bin"))
                        {
                            Directory.CreateDirectory(@"bin");
                        }
                        else if (!Directory.Exists(@"bin\Tools"))
                        {
                            Directory.CreateDirectory(@"bin\Tools");
                        }
                        File.Copy(@"custom\main.dol", @"bin\Tools\nintendont.dol");
                    }

                    if (File.Exists(@"bin\Tools\nintendont_force.dol"))
                    {
                        File.Delete(@"bin\Tools\nintendont_force.dol");
                        File.Copy(@"custom\main.dol", @"bin\Tools\nintendont_force.dol");
                    }
                    else
                    {
                        File.Copy(@"custom\main.dol", @"bin\Tools\nintendont_force.dol");
                    }
                }
            }
            bool check  = true;
            bool bypass = false;

            if (e.Args.Length >= 1)
            {
                foreach (var s in e.Args)
                {
                    if (s == "--skip")
                    {
                        check = false;
                    }
                    if (s == "--spacebypass")
                    {
                        bypass = true;
                    }
                }
            }

            Process[] pname = Process.GetProcessesByName("UWUVCI AIO");
            if (pname.Length > 1 && check)
            {
                t.Elapsed += KillProg;
                t.Start();
                Custom_Message cm = new Custom_Message("Another Instance Running", " You already got another instance of UWUVCI AIO running. \n This instance will terminate in 5 seconds. ");

                cm.ShowDialog();
                KillProg(null, null);
            }
            else
            {
                MainWindow wnd    = new MainWindow();
                double     height = System.Windows.SystemParameters.PrimaryScreenHeight;
                double     witdh  = System.Windows.SystemParameters.PrimaryScreenWidth;
                if (witdh < 1150 || height < 700)
                {
                    t.Elapsed += KillProg;
                    t.Start();
                    Custom_Message cm = new Custom_Message("Resolution not supported", "Your screen resolution is not supported, please use a resolution of atleast 1152x864\nThis instance will terminate in 5 seconds.");
                    cm.ShowDialog();
                    KillProg(null, null);
                }
                if (Environment.Is64BitOperatingSystem)
                {
                }
                else
                {
                    //wnd.is32();
                    Custom_Message cm = new Custom_Message("Warning", "Some features may cause issues on a 32Bit System. Upgrading to 64Bit would be recommended. \nReport any issues in the UWUVCI Discord, or ping @NicoAICP in #wiiu-assistance in the Nintendo Homebrew discord. ");
                    cm.ShowDialog();
                }

                if (bypass)
                {
                    wnd.allowBypass();
                }
                // The OpenFile() method is just an example of what you could do with the
                // parameter. The method should be declared on your MainWindow class, where
                // you could use a range of methods to process the passed file path
                if (e.Args.Length >= 1 && e.Args[0] == "--debug")
                {
                    wnd.setDebug(bypass);
                }
                wnd.Show();
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            tbCode.Text          = "Code Folder not found";
            tbCode.Foreground    = new SolidColorBrush(Color.FromRgb(205, 50, 50));
            tbContent.Text       = "Content Folder not found";
            tbContent.Foreground = new SolidColorBrush(Color.FromRgb(205, 50, 50));
            tbMeta.Text          = "Meta Folder not found";
            tbMeta.Foreground    = new SolidColorBrush(Color.FromRgb(205, 50, 50));
            mvm.BaseDownloaded   = false;
            mvm.CBasePath        = null;
            //warning if using custom bases program may crash
            Custom_Message cm = new Custom_Message("Information", "If using Custom Bases there will be a chance that the program crashes if adding a wrong base (example: a normal wiiu game instead of a nds vc game).\nA custom base is containing either the code/content/meta folders or Installable files (*.h3, *.app, ...)\nIf you add a wrong base, we will not assist you fixing it, other than telling you to use another base.\nIf you agree to this please hit continue");

            try {
                cm.Owner = mvm.mw;
            }
            catch (Exception)
            {
            }
            cm.ShowDialog();

            if (mvm.choosefolder)
            {
                mvm.choosefolder = false;        //get folder
                using (var dialog = new CommonOpenFileDialog())
                {
                    dialog.IsFolderPicker = true;
                    CommonFileDialogResult result = dialog.ShowDialog();
                    if (result == CommonFileDialogResult.Ok)
                    {
                        try
                        {
                            if (mvm.DirectoryIsEmpty(dialog.FileName))
                            {
                                Custom_Message cm1 = new Custom_Message("Issue", "The Folder is Empty. Please choose another Folder.");
                                try
                                {
                                    cm.Owner = mvm.mw;
                                }
                                catch (Exception)
                                {
                                }
                                cm1.ShowDialog();
                            }
                            else
                            {
                                if (Directory.GetDirectories(dialog.FileName).Length > 3)
                                {
                                    Custom_Message cm1 = new Custom_Message("Issue", "This Folder has too many subfolders. Please choose another folder");
                                    try
                                    {
                                        cm.Owner = mvm.mw;
                                    }
                                    catch (Exception)
                                    {
                                    }
                                    cm1.ShowDialog();
                                }
                                else
                                {
                                    if (Directory.GetDirectories(dialog.FileName).Length > 0)
                                    {
                                        //Code Content Meta
                                        if (Directory.Exists(System.IO.Path.Combine(dialog.FileName, "content")) && Directory.Exists(System.IO.Path.Combine(dialog.FileName, "code")) && Directory.Exists(System.IO.Path.Combine(dialog.FileName, "meta")))
                                        {
                                            //create new Game Config
                                            mvm.GameConfiguration.Console   = console;
                                            mvm.GameConfiguration.CBasePath = dialog.FileName;
                                            GameBases gb = new GameBases();
                                            gb.Name   = "Custom";
                                            gb.Region = Regions.EU;
                                            gb.Path   = mvm.GameConfiguration.CBasePath;
                                            bar.Text  = gb.Path;
                                            mvm.GameConfiguration.BaseRom = gb;
                                            tbCode.Text          = "Code Folder exists";
                                            tbCode.Foreground    = new SolidColorBrush(Color.FromRgb(50, 205, 50));
                                            tbContent.Text       = "Content Folder exists";
                                            tbContent.Foreground = new SolidColorBrush(Color.FromRgb(50, 205, 50));
                                            tbMeta.Text          = "Meta Folder exists";
                                            tbMeta.Foreground    = new SolidColorBrush(Color.FromRgb(50, 205, 50));
                                            mvm.BaseDownloaded   = true;
                                        }
                                        else
                                        {
                                            Custom_Message cm1 = new Custom_Message("Issue", "This folder is not in the \"loadiine\" format");
                                            try
                                            {
                                                cm.Owner = mvm.mw;
                                            }
                                            catch (Exception)
                                            {
                                            }
                                            cm1.ShowDialog();
                                        }
                                    }
                                    else
                                    {
                                        //WUP
                                        if (Directory.GetFiles(dialog.FileName, "*.app").Length > 0 && Directory.GetFiles(dialog.FileName, "*.h3").Length > 0 && File.Exists(System.IO.Path.Combine(dialog.FileName, "title.tmd")) && File.Exists(System.IO.Path.Combine(dialog.FileName, "title.tik")))
                                        {
                                            if (mvm.CBaseConvertInfo())
                                            {
                                                //Convert to LOADIINE => save under bases/custom or custom_x path => create new config
                                                string path = Injection.ExtractBase(dialog.FileName, console);
                                                mvm.GameConfiguration           = new GameConfig();
                                                mvm.GameConfiguration.Console   = console;
                                                mvm.GameConfiguration.CBasePath = path;
                                                GameBases gb = new GameBases();
                                                gb.Name       = "Custom";
                                                gb.Region     = Regions.EU;
                                                gb.Path       = mvm.GameConfiguration.CBasePath;
                                                mvm.CBasePath = mvm.GameConfiguration.CBasePath;
                                                mvm.GameConfiguration.BaseRom = gb;
                                                tbCode.Text          = "Code Folder exists";
                                                tbCode.Foreground    = new SolidColorBrush(Color.FromRgb(50, 205, 50));
                                                tbContent.Text       = "Content Folder exists";
                                                tbContent.Foreground = new SolidColorBrush(Color.FromRgb(50, 205, 50));
                                                tbMeta.Text          = "Meta Folder exists";
                                                tbMeta.Foreground    = new SolidColorBrush(Color.FromRgb(50, 205, 50));
                                                mvm.BaseDownloaded   = true;
                                            }
                                        }
                                        else
                                        {
                                            Custom_Message cm1 = new Custom_Message("Issue", "This Folder does not contain needed NUS files");
                                            try
                                            {
                                                cm.Owner = mvm.mw;
                                            }
                                            catch (Exception)
                                            {
                                            }
                                            cm1.ShowDialog();
                                        }
                                    }
                                }
                            }
                        }
                        catch (Exception)
                        {
                        }
                    }
                }
            }
        }
        private void Set_Rom_Path(object sender, RoutedEventArgs e)
        {
            string path = mvm.GetFilePath(true, false);

            if (!CheckIfNull(path))

            {
                int  TitleIDInt = 0;
                bool isok       = false;
                if (path.ToLower().Contains(".gcz") || path.ToLower().Contains(".dol") || path.ToLower().Contains(".wad"))
                {
                    isok = true;
                }
                else
                {
                    using (var reader = new BinaryReader(File.OpenRead(path)))
                    {
                        reader.BaseStream.Position = 0x00;
                        TitleIDInt = reader.ReadInt32();
                        if (TitleIDInt == 1397113431) //Performs actions if the header indicates a WBFS file
                        {
                            isok = true;
                        }
                        else if (TitleIDInt != 65536)
                        {
                            long GameType = 0;
                            reader.BaseStream.Position = 0x18;
                            GameType = reader.ReadInt64();
                            if (GameType == 2745048157)
                            {
                                isok = true;
                            }
                        }
                        reader.Close();
                    }
                }


                if (isok)
                {
                    motepass.IsEnabled = false;
                    motepass.IsChecked = false;
                    gamepad.IsEnabled  = true;
                    mvm.NKITFLAG       = false;
                    trimn.IsEnabled    = false;
                    trimn.IsChecked    = false;
                    vmcsmoll.IsEnabled = true;
                    pal.IsEnabled      = true;
                    ntsc.IsEnabled     = true;
                    mvm.donttrim       = false;
                    jppatch.IsEnabled  = true;
                    motepass.IsEnabled = false;
                    List <string> gpEmu = new List <string>();
                    gpEmu.Add("Do not use. WiiMotes only");
                    gpEmu.Add("Classic Controller");
                    gpEmu.Add("Horizontal WiiMote");
                    gpEmu.Add("Vertical WiiMote");
                    gpEmu.Add("Force Classic Controller");
                    gpEmu.Add("Force No Classic Controller");
                    gamepad.ItemsSource = gpEmu;
                    gamepad.ItemsSource = gpEmu;
                    mvm.RomPath         = path;
                    mvm.RomSet          = true;
                    if (mvm.BaseDownloaded)
                    {
                        mvm.CanInject = true;
                    }
                    if (!path.ToLower().Contains(".gcz") && !path.ToLower().Contains(".dol") && !path.ToLower().Contains(".wad"))
                    {
                        string rom = mvm.getInternalWIIGCNName(mvm.RomPath, false);
                        Regex  reg = new Regex("[*'\",_&#^@:;?!<>|µ~#°²³´`éⓇ©™]");
                        gn.Text = reg.Replace(rom, string.Empty);
                        mvm.GameConfiguration.GameName = reg.Replace(rom, string.Empty);
                        if (mvm.GameConfiguration.TGAIco.ImgPath != "" || mvm.GameConfiguration.TGAIco.ImgPath != null)
                        {
                            ic.Text = mvm.GameConfiguration.TGAIco.ImgPath;
                        }
                        if (mvm.GameConfiguration.TGATv.ImgPath != "" || mvm.GameConfiguration.TGATv.ImgPath != null)
                        {
                            tv.Text = mvm.GameConfiguration.TGATv.ImgPath;
                        }
                        if (path.ToLower().Contains("iso"))
                        {
                            trimn.IsEnabled = true;
                            mvm.IsIsoNkit();
                        }
                    }
                    else if (path.ToLower().Contains(".dol"))
                    {
                        mvm.NKITFLAG       = false;
                        trimn.IsEnabled    = false;
                        trimn.IsChecked    = false;
                        vmcsmoll.IsEnabled = false;
                        pal.IsEnabled      = false;
                        ntsc.IsEnabled     = false;
                        RF_n.IsEnabled     = false;
                        RF_tj.IsEnabled    = false;
                        RF_tn.IsEnabled    = false;
                        RF_tp.IsEnabled    = false;
                        jppatch.IsEnabled  = false;
                        motepass.IsChecked = false;
                        motepass.IsEnabled = true;
                        mvm.donttrim       = false;
                        gamepad.IsEnabled  = false;
                        LR.IsEnabled       = false;
                    }
                    else if (path.ToLower().Contains(".wad"))
                    {
                        mvm.NKITFLAG       = false;
                        trimn.IsEnabled    = false;
                        trimn.IsChecked    = false;
                        vmcsmoll.IsEnabled = false;
                        pal.IsEnabled      = false;
                        ntsc.IsEnabled     = false;
                        RF_n.IsEnabled     = false;
                        RF_tj.IsEnabled    = false;
                        RF_tn.IsEnabled    = false;
                        RF_tp.IsEnabled    = false;
                        jppatch.IsEnabled  = false;
                        mvm.donttrim       = false;
                    }
                    else
                    {
                        motepass.IsChecked = false;
                        motepass.IsEnabled = false;

                        trimn.IsEnabled = true;
                    }
                }
                else
                {
                    Custom_Message cm = new Custom_Message("Wrong ROM", "The chosen ROM is not a supported WII Game");
                    try
                    {
                        cm.Owner = mvm.mw;
                    }
                    catch (Exception)
                    {
                    }
                    cm.ShowDialog();
                }
            }
        }