Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
 //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 :;
 }
Exemplo n.º 3
0
        public SDCardMenu()
        {
            InitializeComponent();

            if (Trt.IsValidate)
            {
                Trt.TranslateForm(this);
            }
        }
Exemplo n.º 4
0
        /// <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);
        }
Exemplo n.º 5
0
        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 :;
        }