Exemplo n.º 1
0
        private void parseIsoFile(string path)
        {
            GCDiscInfo gCDiscInfo = new GCDiscInfo(path);

            string consoleID   = gCDiscInfo.getConsoleId();
            string countryCode = gCDiscInfo.getCountryCode();
            string makerCode   = gCDiscInfo.getMakerCode();

            if (consoleID != "44" && consoleID != "47" && consoleID != "55")
            {
                checkBoxCustomConsoleID.Checked = true;
            }

            if (countryCode != "45" && countryCode != "4A" && countryCode != "50" && countryCode != "55")
            {
                checkBoxCustomCountryCode.Checked = true;
            }

            if (makerCode != "01" && makerCode != "08" && makerCode != "41" && makerCode != "4F" && makerCode != "51" && makerCode != "52" && makerCode != "5D" && makerCode != "5G" && makerCode != "64" &&
                makerCode != "69" && makerCode != "6S" && makerCode != "8P" && makerCode != "A4" && makerCode != "AF" && makerCode != "B2" && makerCode != "DA" && makerCode != "EM")
            {
                checkBoxCustomMakerCode.Checked = true;
            }

            textBoxGameName.Text                  = gCDiscInfo.getGameName();
            textBoxConsoleID.Text                 = consoleID;
            textBoxCountryCode.Text               = countryCode;
            textBoxDiscID.Text                    = gCDiscInfo.getDiscId();
            textBoxDVDMagicWord.Text              = gCDiscInfo.getDVDMagicWord();
            textBoxFSTSize.Text                   = gCDiscInfo.getFSTSize();
            textBoxGameCode.Text                  = gCDiscInfo.getGameCode();
            textBoxMainExecutableOffset.Text      = gCDiscInfo.getMainExecutableDOLOffset();
            textBoxMakerCode.Text                 = makerCode;
            textBoxMaxFSTSize.Text                = gCDiscInfo.getMaxFSTSize();
            textBoxOffsetOfDebugMonitor.Text      = gCDiscInfo.getDebugMonitorOffset();
            textBoxOffsetOfFST.Text               = gCDiscInfo.getFSTOffset();
            textBoxVersion.Text                   = gCDiscInfo.getVersion();
            textBoxAddressToLoadDebugMonitor.Text = gCDiscInfo.getDebugMonitorLoadAddress();

            setComboBoxConsoleID(consoleID);
            setComboBoxCountryCode(countryCode);
            setComboBoxMakerCode(makerCode);
        }
Exemplo n.º 2
0
        private void writeISOToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GCDiscInfo gcDiscInfo = new GCDiscInfo(gamePath);

            bool result1  = gcDiscInfo.setConsoleID(textBoxConsoleID.Text);
            bool result2  = gcDiscInfo.setCountryCode(textBoxCountryCode.Text);
            bool result3  = gcDiscInfo.setDebugMonitorLoadAddress(textBoxAddressToLoadDebugMonitor.Text);
            bool result4  = gcDiscInfo.setDebugMonitorOffset(textBoxOffsetOfDebugMonitor.Text);
            bool result5  = gcDiscInfo.setDiscId(textBoxDiscID.Text);
            bool result6  = gcDiscInfo.setDVDMagicWord(textBoxDVDMagicWord.Text);
            bool result7  = gcDiscInfo.setFSTOffset(textBoxOffsetOfFST.Text);
            bool result8  = gcDiscInfo.setFSTSize(textBoxFSTSize.Text);
            bool result9  = gcDiscInfo.setGameCode(textBoxGameCode.Text);
            bool result10 = gcDiscInfo.setGameName(textBoxGameName.Text);
            bool result11 = gcDiscInfo.setMainExecutableDOLOffset(textBoxMainExecutableOffset.Text);
            bool result12 = gcDiscInfo.setMakerCode(textBoxMakerCode.Text);
            bool result13 = gcDiscInfo.setMaxFSTSize(textBoxMaxFSTSize.Text);
            bool result14 = gcDiscInfo.setVersion(textBoxVersion.Text);

            #region errorMessage
            if (!result1 || !result2 || !result3 || !result4 || !result5 || !result6 || !result7 || !result8 || !result9 || !result10 || !result11 || !result12 ||
                !result13 || !result14)
            {
                string errorMsg = "Unable to update: ";

                if (!result1)
                {
                    errorMsg += "Console ID, ";
                }

                if (!result2)
                {
                    errorMsg += "Country Code, ";
                }

                if (!result3)
                {
                    errorMsg += "Debug Monitor Load Address, ";
                }

                if (!result4)
                {
                    errorMsg += "Debug Monitor Offset, ";
                }

                if (!result5)
                {
                    errorMsg += "Disc ID, ";
                }

                if (!result6)
                {
                    errorMsg += "DVD Magic Word, ";
                }

                if (!result7)
                {
                    errorMsg += "FST Offset, ";
                }

                if (!result8)
                {
                    errorMsg += "FST Size, ";
                }

                if (!result9)
                {
                    errorMsg += "Game Code, ";
                }

                if (!result10)
                {
                    errorMsg += "Game Name, ";
                }

                if (!result11)
                {
                    errorMsg += "Main Executable DOL Offset, ";
                }

                if (!result12)
                {
                    errorMsg += "Maker Code, ";
                }

                if (!result13)
                {
                    errorMsg += "Max FST Size, ";
                }

                if (!result14)
                {
                    errorMsg += "Version, ";
                }

                errorMsg = errorMsg.TrimEnd(' ');
                errorMsg = errorMsg.TrimEnd(',');

                MessageBox.Show("There was a problem updating the ROM header. " + errorMsg + ".",
                                "Error",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error,
                                MessageBoxDefaultButton.Button1);
            }
            else
            {
                MessageBox.Show("GameCube Iso updated!.",
                                "Success",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information,
                                MessageBoxDefaultButton.Button1);
            }
            #endregion

            parseIsoFile(gamePath);
        }