Пример #1
0
        private void StandardCodeAddressStuff(UInt32 address, UInt32 value, UInt32 add)
        {
            CodeContent nCode = CodeController.CodeTextBoxToCodeContent(textBoxCodeEntries.Text);
            //UInt32 cAddressR = 0x80000000;
            UInt32 rAddressR;
            UInt32 offset;

            // base address is masked differently than pointer offset
            if (radioButtonBA.Checked)
            {
                rAddressR = address & 0xFE000000;
            }
            else
            {
                // TODO the po doesn't actually have this restriction
                // but for now we keep it like the ba
                //rAddressR = address & 0xFEFFFFFF;
                rAddressR = address & 0xFE000000;
                add      += 0x10000000;
            }

            // Do we need to change the ba or po?
            bool changeBAorPO = false;

            if ((address & 0xFE000000) != 0x80000000)
            {
                changeBAorPO = true;
            }

            if (changeBAorPO)
            {
                if (radioButtonBA.Checked)
                {
                    nCode.addLine(0x42000000, rAddressR);
                }
                else
                {
                    nCode.addLine(0x4A000000, rAddressR);
                }
            }

            // Add the actual code
            offset = address - rAddressR + add;
            nCode.addLine(offset, value);

            // Add terminator if necessary
            if (changeBAorPO)
            {
                nCode.addLine(0xE0000000, 0x80008000);
            }

            textBoxCodeEntries.Text = CodeController.CodeContentToCodeTextBox(nCode);
        }
Пример #2
0
 public GCTWizard(CodeController codeController)
 {
     InitializeComponent();
     RAMWriteCollection = new string[] {
         "Write",
         "Fill"
     };
     IfThenCollection = new string[] {
         "equal",
         "not equal",
         "greater",
         "lesser"
     };
     GCTCodeContents = codeController;
 }
Пример #3
0
        private void StandardCodeAddressStuff(uint address, uint value, uint add)
        {
            CodeContent nCode = CodeController.CodeTextBoxToCodeContent(textBoxCodeEntries.Text);
            uint        rAddressR;
            uint        offset;

            if (radioButtonBA.Checked)
            {
                rAddressR = address & 0xFE000000;
            }
            else
            {
                rAddressR = address & 0xFE000000;
                add      += 0x10000000;
            }

            bool changeBAorPO = false;

            if ((address & 0xFE000000) != 0x80000000)
            {
                changeBAorPO = true;
            }

            if (changeBAorPO)
            {
                if (radioButtonBA.Checked)
                {
                    nCode.addLine(0x42000000, rAddressR);
                }
                else
                {
                    nCode.addLine(0x4A000000, rAddressR);
                }
            }

            offset = address - rAddressR + add;
            nCode.addLine(offset, value);

            if (changeBAorPO)
            {
                nCode.addLine(0xE0000000, 0x80008000);
            }

            textBoxCodeEntries.Text = CodeController.CodeContentToCodeTextBox(nCode);
        }
Пример #4
0
        private void comboBoxCodeName_SelectedIndexChanged(object sender, EventArgs e)
        {
            int index = SelectedCodeNameIndex;

            if (comboBoxCodeName.SelectedIndex != index)
            {
                comboBoxCodeName.SelectedIndex = index;
            }

            if (comboBoxCodeName.SelectedIndex == comboBoxCodeName.Items.Count - 1)
            {
                textBoxCodeEntries.Text = string.Empty;
            }
            else
            {
                textBoxCodeEntries.Text = CodeController.CodeContentToCodeTextBox(GCTCodeContents[comboBoxCodeName.SelectedIndex]);
            }
        }
Пример #5
0
        public GCTWizard(CodeController codeController)
        {
            InitializeComponent();
            RAMWriteCollection = new String[] {
                "Write",
                "Fill" };
            IfThenCollection = new String[] {
                "equal",
                "not equal",
                "greater",
                "lesser" };
            //BasePointerCollection = new String[] {
            //    "Load into",
            //    "Set to",
            //    "Save to",
            //    "Load Code Address", };

            GCTCodeContents = codeController;
        }
Пример #6
0
        public GCTWizard(CodeController codeController)
        {
            InitializeComponent();
            RAMWriteCollection = new String[] {
                "Write",
                "Fill"
            };
            IfThenCollection = new String[] {
                "equal",
                "not equal",
                "greater",
                "lesser"
            };
            //BasePointerCollection = new String[] {
            //    "Load into",
            //    "Set to",
            //    "Save to",
            //    "Load Code Address", };

            GCTCodeContents = codeController;
        }
Пример #7
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            this.Icon = Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetEntryAssembly().Location);

            int i;
            SettingsFile = new Xml("gecko.xml");
            SettingsFile.RootName = "gecko";

            gamename = "";
            gecko = new USBGecko();
            gecko.chunkUpdate += transfer;

            exceptionHandling = new ExceptionHandler(this);

            if (!Directory.Exists("DumpHistory"))
                Directory.CreateDirectory("DumpHistory");

            search = new MemSearch(gecko, SearchResults,
                PrvPage, NxtPage, ResList, UpDownSearchResultPage, exceptionHandling);

            viewer = new MemoryViewer(gecko, ValidMemory.ValidAreas[0].low, memViewGrid,
                memViewPAddress, memViewPValue, MemViewFPValue, exceptionHandling);

#if MONO
            disassembler = new Disassembly(gecko, "./vdappc", DisAssBox, DisScroll,
                DisRegion, AsAddress, AsText, exceptionHandling);
#else
            disassembler = new Disassembly(gecko, "vdappc.exe", DisAssBox, DisScroll,
                DisRegion, AsAddress, AsText, exceptionHandling);
#endif

            bpHandler = new Breakpoints(gecko, BPList, this, disassembler, BPDiss, BPClassic, BPCondList, exceptionHandling);
            //bpHandler = new Breakpoints(gecko, BPList, this, disassembler, richTextBox1, BPClassic, BPCondList, exceptionHandling);
            foreach (String reg in BPList.longRegNames)
                BPConditionRegSelect.Items.Add(reg.Trim());
            BPConditionRegSelect.Items.Add("VoA");

            BPConditionRegSelect.SelectedIndex = 0;
            BPConditionCompare.SelectedIndex = 0;

            bpHandler.BPSkip += BPSkipped;

            watcher = new WatchList(gecko, WatchList, WatchIntervalSet, exceptionHandling);
            addWatchDialog = null;
            watchValueInput = null;

            fst = new FST(gecko, FSTTreeView, FSTCodeData, FSTSetAsSource, FSTSetAsTarget,
                FSTGenSwap, FSTFileSource, FSTFileTarget, FSTSwapCode, FSTSwapNow, exceptionHandling);

            GCTCodeContents = new CodeController(GCTCodeList, GCTCodeValues);
            GCTCodeContents.codesModified += GCTModified;

            bpHandler.BPStop += BPStopped;

            for (i = 0; i < ValidMemory.ValidAreas.Length; i++)
            {
                memRange.Items.Add(
                    GlobalFunctions.toHex(ValidMemory.ValidAreas[i].id, 2));
                MemViewARange.Items.Add(
                    GlobalFunctions.toHex(ValidMemory.ValidAreas[i].id, 2));
                ToolsDumpRegions.Items.Add(
                    GlobalFunctions.toHex(ValidMemory.ValidAreas[i].id, 2));
            }

            codeWizard = new GCTWizard(GCTCodeContents);

            memRange.SelectedIndex = 0;
            MemViewARange.SelectedIndex = 0;
            MemViewShowMode.SelectedIndex = 0;
            MemViewSearchType.SelectedIndex = 0;
            ToolsDumpRegions.SelectedIndex = 0;

            comboBoxSearchDataType.SelectedIndex = 2;

            //UpperEnable.SelectedIndex = 0;


            //BPType.SelectedIndex = 0;
            comboBoxDisplayType.SelectedIndex = 0;

            WasAlreadyDisabled = new List<Control>();
            searchComparisons = new List<SearchComparisonInfo>();
            searchComparisons.Add(new SearchComparisonInfo());
            comboBoxComparisonType.SelectedIndex = 0;
            comboBoxComparisonRHS.SelectedIndex = 0;
            buttonCancelSearch.Enabled = false;
            SteppingOut = false;
            buttonUndoSearch.Enabled = search.CanUndo();

            TabLock = null;
            BPStepLogWriter = null;

            comboBoxPokeOperation.SelectedIndex = 0;

            SetComboboxValue("Screenshots", "Format", 0, ImgFormat);
            SetComboboxValue("Screenshots", "Sizing", 0, ShotSizingType);

            int value = SettingsFile.GetValue("Screenshots", "JPEGQuality", 85);
            if (value < 0 || value > 100)
                value = 85;
            JPGQual.Value = value;

            multiPokeAddr = new List<UInt32>();

            FormStop(false);
            CUSBGecko.Enabled = true;

            codesModified = false;

            AbtText.Text = "gecko dotNET Beta 0.63 by Link and dcx2\n\n"
                          + "Special thanks to:\n\n"
                          + "kenobi: for original WiiRd GUI!\n"
                          + "Nuke: for the USB Gecko!\n"
                          + "brkirch: for continuing Gecko OS!\n"
                          + "Y.S.: for the original code handler!\n"
                          + "Team Twiizers for bringing homebrew to the Wii\n"
                          + "DevKitPro team: No homebrew without them!\n"
                          + "Frank Wille: vdappc developer!\n"
                          + "various beta testers!\n"
                          + "and you!";

            notes = new NoteSheets();

            //Set MEM2 upper to 93400000
            MEM2UpperBoundary.SelectedIndex = 0;

            // Restore previous settings
            checkBoxAlwaysOnTop.Checked = GeckoApp.Properties.Settings.Default.AlwaysOnTop;
            numericUpDownFPS.Value = GeckoApp.Properties.Settings.Default.FPS;
            BPAddress.Text = GeckoApp.Properties.Settings.Default.BPAddr;
            memViewAValue.Text = GeckoApp.Properties.Settings.Default.MemViewAddr;
            BPType.SelectedIndex = GeckoApp.Properties.Settings.Default.BPType;
            checkBoxBPNext.Checked = GeckoApp.Properties.Settings.Default.BPNext;
            checkBoxPauseCodes.Checked = GeckoApp.Properties.Settings.Default.PauseCodes;
            Size = GeckoApp.Properties.Settings.Default.LastSize;
            int oldSplitter = GeckoApp.Properties.Settings.Default.LastSplitterSize;
            // The splitter gets moved when the breakpoint page is entered
            // so artificially force it to move
            MainControl.SelectedTab = BreakpointPage;
            MainControl.SelectedTab = searchPage;
            splitContainerRegASM.SplitterDistance = oldSplitter;
            toolStripTextBoxMemViewFontSize.Text = GeckoApp.Properties.Settings.Default.MemViewFontSize.ToString();
            toolStripTextBoxMemViewFontSize_KeyDown(null, new KeyEventArgs(Keys.Enter));
            viewFloatsInHexToolStripMenuItem.Checked = GeckoApp.Properties.Settings.Default.ViewFloatsInHex;
            //addressTextBox1.CopyStringToHistory(GeckoApp.Properties.Settings.Default.addressHistory);
            //addressTextBox1.AutoHistory = true;

        }