public void CheckForBoxes() { if (NintendontOptions.GetItemChecked(1)) { MemcardText.Enabled = true; MemcardBlocks.Enabled = true; MemcardMulti.Enabled = true; } else { MemcardText.Enabled = false; MemcardBlocks.Enabled = false; MemcardMulti.Checked = false; MemcardMulti.Enabled = false; } if (NintendontOptions.GetItemChecked(9)) { VideoWidth.Enabled = false; VideoWidthText.Enabled = false; WidthNumber.Text = Trt.Tr("Auto"); } else { VideoWidth.Enabled = true; VideoWidthText.Enabled = true; WidthNumber.Text = VideoWidth.Value.ToString(); } }
//Buttons that make changes to SD Card private void NintendontUpdate_Click(object sender, EventArgs e) { if (DriveSpecified) { if (CheckForInternetConnection() == false) { DialogResult dialogResult = MessageBox.Show( Trt.Tr("Your internet connection could not be verified, do you wish to try and download Nintendont anyways?"), Trt.Tr("Internet Connection Verification Failed"), MessageBoxButtons.YesNo); if (dialogResult == DialogResult.No) { goto skipnintendontdownload; } } ActionStatus.Text = Trt.Tr("Downloading..."); ActionStatus.Refresh(); Directory.CreateDirectory(SelectedDriveLetter + "apps\\nintendont"); var client = new WebClient(); client.DownloadFile("https://raw.githubusercontent.com/FIX94/Nintendont/master/loader/loader.dol", SelectedDriveLetter + "apps\\nintendont\\boot.dol"); client.DownloadFile("https://raw.githubusercontent.com/FIX94/Nintendont/master/nintendont/meta.xml", SelectedDriveLetter + "apps\\nintendont\\meta.xml"); client.DownloadFile("https://raw.githubusercontent.com/FIX94/Nintendont/master/nintendont/icon.png", SelectedDriveLetter + "apps\\nintendont\\icon.png"); ActionStatus.Text = ""; MessageBox.Show(Trt.Tr("Download complete.")); } else { MessageBox.Show(Trt.Tr("Drive not specified, nowhere to download contents")); } skipnintendontdownload :; }
/// <summary> /// Check for if .Net v3.5 component is installed. /// </summary> private static bool CheckForNet35() { if (Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v3.5") == null) { MessageBox.Show( Trt.Tr(".NET Framework 3.5 was not detected on your machine, which is required by programs used during the build process.\n\nYou should be able to enable this in \"Programs and Features\" under \"Turn Windows features on or off\", or download it from Microsoft.\n\nClick OK to close the injector and open \"Programs and Features\"..."), Trt.Tr(".NET Framework v3.5 not found...")); Process.Start("appwiz.cpl"); return(false); } return(true); }
private bool BuildSpawn() { bool exitNormally = true; ProcessStartInfo spawnInfo = new ProcessStartInfo(SpawnFile, SpawnArgs); if (HideProcess) { spawnInfo.CreateNoWindow = true; spawnInfo.WindowStyle = ProcessWindowStyle.Hidden; } spawnInfo.UseShellExecute = false; spawnInfo.RedirectStandardOutput = true; spawnInfo.RedirectStandardError = true; BuildOutputBuffer buildOutputBuffer = new BuildOutputBuffer(); buildOutputBuffer.FlushBuffer += (s, e) => { BeginInvoke(ActBuildOutput, e); }; if (currentLogLevel <= LogLevel.Debug) { BeginInvoke(ActBuildOutput, new BuildOutputItem() { Output = Trt.Tr("Executing:") + ' ' + SpawnFile + Environment.NewLine + Trt.Tr("Args:") + ' ' + SpawnArgs + Environment.NewLine, OutputType = BuildOutputType.Exec }); } try { Process spawner = Process.Start(spawnInfo); System.Timers.Timer OutputPumpTimer = new System.Timers.Timer(); spawner.OutputDataReceived += (s, d) => { if (currentLogLevel <= LogLevel.Debug) { lock (buildOutputBuffer) { buildOutputBuffer.AppendOutput(d.Data, BuildOutputType.Normal); } } }; spawner.ErrorDataReceived += (s, d) => { // // Whatever, the error information should be printed. // lock (buildOutputBuffer) { buildOutputBuffer.AppendOutput(d.Data, BuildOutputType.Error); } }; OutputPumpTimer.Interval = 100; OutputPumpTimer.Elapsed += (sender, e) => { lock (buildOutputBuffer) { buildOutputBuffer.Flush(); } }; OutputPumpTimer.Start(); spawner.BeginOutputReadLine(); spawner.BeginErrorReadLine(); while (!spawner.WaitForExit(500)) { if (LastBuildCancelled) { spawner.CloseMainWindow(); if (!spawner.WaitForExit(100)) { spawner.Kill(); } exitNormally = false; } } OutputPumpTimer.Stop(); spawner.Close(); lock (buildOutputBuffer) { buildOutputBuffer.Flush(); } } catch (Exception ex) { Console.WriteLine("BuildSpawn exception: " + ex.Message); if (ThrowProcessException) { throw ex; } exitNormally = false; } if (!exitNormally && ThrowProcessException) { throw new Exception(NormalizeCmdlineArg(SpawnFile) + Trt.Tr(" does not exit normally.")); } return(exitNormally); }
private void BatchBuildNext() { while (Program.BatchBuildList.Any()) { string game = Program.BatchBuildList[0]; // Search for second disc if (GCRetail.Checked) { string[] discs = SearchGCDiscs(game); game = discs[0]; if (discs.Length > 1) { OpenGC2.FileName = discs[1]; SelectGC2Source(discs[1]); } } if (SelectGameSource(game, true)) { if (Directory.Exists(GetOutputFolder())) { AppendBuildOutput( string.Format( Trt.Tr("Title output folder already exists: {0}\nSkipping: {1}.\n"), GetOutputFolder(), game), BuildOutputType.Error); BatchBuildSkippedList.Add(game); Program.BatchBuildList.RemoveAt(0); continue; } else { BatchBuildCurrent(); PreBuild = null; break; } } AppendBuildOutput( string.Format(Trt.Tr("Invalid Title: {0}.\n"), game), BuildOutputType.Error); BatchBuildInvalidList.Add(game); Program.BatchBuildList.RemoveAt(0); } if (!Program.BatchBuildList.Any()) { PostBuild -= WiiVC_Injector_PostBuild; if (!InClosing) { MessageBox.Show(string.Format( Trt.Tr("All conversions have been completed.\nSucceed: {0}.\nFailed: {1}.\nSkipped: {2}.\nInvalid: {3}."), BatchBuildSucceedList.Count, BatchBuildFailedList.Count, BatchBuildSkippedList.Count, BatchBuildInvalidList.Count)); } } }
private void GenerateConfig_Click(object sender, EventArgs e) { if (DriveSpecified == false) { MessageBox.Show(Trt.Tr("Drive not specified, nowhere to place generated config")); goto SkipGeneration; } int DecOffset09 = 0; int DecOffset0A_0C = 0; int DecOffset0D = 0; int DecOffset0F = 0; uint DecOffset10_13 = 0; int DecOffset21C = 0; int DecOffset21D = 0; string HexOffset09; string HexOffset0A_0C; string HexOffset0D; string HexOffset0F; string HexOffset10_13; string HexOffset21C; string HexOffset21D; //09 Offsets //TRI Arcade Mode if (NintendontOptions.GetItemChecked(11)) { DecOffset09 = DecOffset09 + 1; } //Wiimote CC Rumble if (NintendontOptions.GetItemChecked(12)) { DecOffset09 = DecOffset09 + 2; } //Skip IPL if (NintendontOptions.GetItemChecked(13)) { DecOffset09 = DecOffset09 + 4; } //convert to hex string HexOffset09 = DecOffset09.ToString("X"); HexOffset09 = HexOffset09.PadLeft(2, '0'); //0A-0C Offsets //Cheats if (NintendontOptions.GetItemChecked(0)) { DecOffset0A_0C = DecOffset0A_0C + 256; } //Memcard Emu if (NintendontOptions.GetItemChecked(1)) { DecOffset0A_0C = DecOffset0A_0C + 2049; } //Memcard Multi if (MemcardMulti.Checked) { DecOffset0A_0C = DecOffset0A_0C + 2097152; } //Cheat Path if (NintendontOptions.GetItemChecked(2)) { DecOffset0A_0C = DecOffset0A_0C + 4097; } //Force Widescreen if (NintendontOptions.GetItemChecked(3)) { DecOffset0A_0C = DecOffset0A_0C + 8193; } //Force Progressive if (NintendontOptions.GetItemChecked(4)) { DecOffset0A_0C = DecOffset0A_0C + 16387; } //Unlock Read Speed if (NintendontOptions.GetItemChecked(5)) { DecOffset0A_0C = DecOffset0A_0C + 65540; } //OSReport if (NintendontOptions.GetItemChecked(6)) { DecOffset0A_0C = DecOffset0A_0C + 131076; } //WiiU Widescreen if (NintendontOptions.GetItemChecked(7)) { DecOffset0A_0C = DecOffset0A_0C + 8388612; } //Log if (NintendontOptions.GetItemChecked(8)) { DecOffset0A_0C = DecOffset0A_0C + 1048594; } //convert to hex string HexOffset0A_0C = DecOffset0A_0C.ToString("X"); HexOffset0A_0C = HexOffset0A_0C.PadLeft(6, '0'); //0D Offsets //Video Force Options //Auto if (VideoForceMode.SelectedIndex == 0) { DecOffset0D = 0; } //Force if (VideoForceMode.SelectedIndex == 1) { DecOffset0D = 1; } //Force (Deflicker) if (VideoForceMode.SelectedIndex == 2) { DecOffset0D = 5; } //None if (VideoForceMode.SelectedIndex == 3) { DecOffset0D = 2; } //convert to hex string HexOffset0D = DecOffset0D.ToString("X"); HexOffset0D = HexOffset0D.PadLeft(2, '0'); //0F Offsets //Video Mode Options //None if (VideoTypeMode.SelectedIndex == 0) { DecOffset0F = 16; } //NTSC if (VideoTypeMode.SelectedIndex == 1) { DecOffset0F = 20; } //MPAL if (VideoTypeMode.SelectedIndex == 2) { DecOffset0F = 24; } //PAL50 if (VideoTypeMode.SelectedIndex == 3) { DecOffset0F = 17; } //PAL60 if (VideoTypeMode.SelectedIndex == 4) { DecOffset0F = 18; } //Patch PAL50 if (NintendontOptions.GetItemChecked(10)) { DecOffset0F = DecOffset0F + 32; } //convert to hex string HexOffset0F = DecOffset0F.ToString("X"); HexOffset0F = HexOffset0F.PadLeft(2, '0'); //10-13 Offsets //Language Selection //Automatic if (LanguageBox.SelectedIndex == 0) { DecOffset10_13 = 4294967295; } //English if (LanguageBox.SelectedIndex == 1) { DecOffset10_13 = 0; } //German if (LanguageBox.SelectedIndex == 2) { DecOffset10_13 = 1; } //French if (LanguageBox.SelectedIndex == 3) { DecOffset10_13 = 2; } //Spanish if (LanguageBox.SelectedIndex == 4) { DecOffset10_13 = 3; } //Italian if (LanguageBox.SelectedIndex == 5) { DecOffset10_13 = 4; } //Dutch if (LanguageBox.SelectedIndex == 6) { DecOffset10_13 = 5; } //convert to hex string HexOffset10_13 = DecOffset10_13.ToString("X"); HexOffset10_13 = HexOffset10_13.PadLeft(8, '0'); //21C Offsets //Memcard Blocks //59 if (MemcardBlocks.SelectedIndex == 0) { DecOffset21C = 0; } //123 if (MemcardBlocks.SelectedIndex == 1) { DecOffset21C = 1; } //251 if (MemcardBlocks.SelectedIndex == 2) { DecOffset21C = 2; } //507 if (MemcardBlocks.SelectedIndex == 3) { DecOffset21C = 3; } //1019 if (MemcardBlocks.SelectedIndex == 4) { DecOffset21C = 4; } //2043 if (MemcardBlocks.SelectedIndex == 5) { DecOffset21C = 5; } //convert to hex string HexOffset21C = DecOffset21C.ToString("X"); HexOffset21C = HexOffset21C.PadLeft(2, '0'); //21D Offsets //Video Width if (NintendontOptions.GetItemChecked(9)) { DecOffset21D = 0; } else { DecOffset21D = VideoWidth.Value - 600; } //convert to hex string HexOffset21D = DecOffset21D.ToString("X"); HexOffset21D = HexOffset21D.PadLeft(2, '0'); //Output Hex File string config = "01070CF60000000800" + HexOffset09 + HexOffset0A_0C + HexOffset0D + "00" + HexOffset0F + HexOffset10_13 + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + HexOffset21C + HexOffset21D + "0000"; File.WriteAllBytes(SelectedDriveLetter + "nincfg.bin", StringToByteArray(config)); MessageBox.Show(Trt.Tr("Config generation complete.")); SkipGeneration :; }