Ejemplo n.º 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);
        }
Ejemplo n.º 2
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);
        }