Beispiel #1
0
        private void UpdateText(TextBox selected)
        {
            var noBase = radioDec.Checked ? Util.NumberBase.Decimal : Util.NumberBase.Hexadecimal;
            var digits = noBase == Util.NumberBase.Hexadecimal && radioSNES.Checked ? 6 : 0;

            if (StartRomOffset < 0)
            {
                StartRomOffset = 0;
            }
            if (EndRomOffset >= data.GetRomSize())
            {
                EndRomOffset = data.GetRomSize() - 1;
            }
            Count = EndRomOffset - StartRomOffset;
            if (Count < 0)
            {
                Count = 0;
            }

            updatingText = true;
            if (selected != textStart)
            {
                textStart.Text = Util.NumberToBaseString(radioSNES.Checked ? data.ConvertPCtoSnes(StartRomOffset) : StartRomOffset, noBase, digits);
            }
            if (selected != textEnd)
            {
                textEnd.Text = Util.NumberToBaseString(radioSNES.Checked ? data.ConvertPCtoSnes(EndRomOffset) : EndRomOffset, noBase, digits);
            }
            if (selected != textCount)
            {
                textCount.Text = Util.NumberToBaseString(Count, noBase, 0);
            }
            updatingText = false;
        }
Beispiel #2
0
        public HarshAutoStep(int offset, Data data)
        {
            Debug.Assert(data != null);
            this.data = data;

            InitializeComponent();

            StartRomOffset = offset;
            var rest = data.GetRomSize() - StartRomOffset;

            Count        = rest < 0x100 ? rest : 0x100;
            EndRomOffset = StartRomOffset + Count;

            UpdateText(null);
        }