Ejemplo n.º 1
0
        public static uint SearchMenu(string typename, uint menuID, uint helpID)
        {
            uint pointer;

            if (typename == "UNITMENU")
            {
                pointer = MenuDefinitionForm.GetUnitMenuPointer();
            }
            else if (typename == "GAMEMENU")
            {
                pointer = MenuDefinitionForm.GetGameMenuPointer();
            }
            else if (typename == "DEBUG1")
            {
                pointer = MenuDefinitionForm.GetDebug1MenuPointer();
            }
            else if (typename == "ITEMMENU")
            {
                pointer = MenuDefinitionForm.GetItemMenuPointer();
            }
            else
            {
                return(U.NOT_FOUND);
            }
            return(SearchMenuLow(pointer, menuID, helpID));
        }
Ejemplo n.º 2
0
        public static string GetMenuNameWhereMenuCommandID(uint num)
        {
            List <U.AddrResult> menuDefineList = MenuDefinitionForm.MakeListAll();

            for (int n = 0; n < menuDefineList.Count; n++)
            {
                if (!U.isSafetyOffset(menuDefineList[n].addr + 8))
                {
                    continue;
                }
                uint p = menuDefineList[n].addr + 8;
                if (!U.isSafetyOffset(Program.ROM.p32(p)))
                {
                    continue;
                }
                List <U.AddrResult> list = MenuCommandForm.MakeListPointer(p);
                for (int i = 0; i < list.Count; i++)
                {
                    if (!U.isSafetyOffset(list[i].addr))
                    {
                        continue;
                    }
                    uint menuCommandID = MenuCommandForm.GetMenuCommandID(list[i].addr);
                    if (menuCommandID == num)
                    {
                        return(MenuCommandForm.GetMenuName(list[i].addr));
                    }
                }
            }
            return("");
        }
Ejemplo n.º 3
0
        public static uint SearchMenuUnitOrGame(uint menuID, uint helpID)
        {
            uint r = SearchMenuLow(MenuDefinitionForm.GetUnitMenuPointer(), menuID, helpID);

            if (r != U.NOT_FOUND)
            {
                return(r);
            }
            r = SearchMenuLow(MenuDefinitionForm.GetGameMenuPointer(), menuID, helpID);
            return(r);
        }
Ejemplo n.º 4
0
        public MenuCommandForm()
        {
            InitializeComponent();
            Explain();
            InputFormRef.OwnerDrawColorCombo(L_8_COMBO);

            List <U.AddrResult> menuDefineList = MenuDefinitionForm.MakeListAll();

            U.ConvertComboBox(menuDefineList, ref FilterComboBox);

            this.InputFormRef = Init(this);
            this.InputFormRef.MakeGeneralAddressListContextMenu(true);
            this.InputFormRef.AddressListExpandsEvent += AddressListExpandsEvent;
        }
Ejemplo n.º 5
0
        public static uint ExpandsArea(Form form, string typename, uint newdatacount, Undo.UndoData undodata)
        {
            uint pointer;

            if (typename == "UNITMENU")
            {
                pointer = MenuDefinitionForm.GetUnitMenuPointer();
            }
            else if (typename == "GAMEMENU")
            {
                pointer = MenuDefinitionForm.GetGameMenuPointer();
            }
            else if (typename == "DEBUG1")
            {
                pointer = MenuDefinitionForm.GetDebug1MenuPointer();
            }
            else if (typename == "ITEMMENU")
            {
                pointer = MenuDefinitionForm.GetItemMenuPointer();
            }
            else
            {
                return(U.NOT_FOUND);
            }

            uint newaddr;

            {
                InputFormRef.ExpandsEventArgs eearg = new InputFormRef.ExpandsEventArgs();

                InputFormRef ifr = Init(null);
                ifr.ReInitPointer(pointer);

                eearg.OldBaseAddress = ifr.BaseAddress;
                eearg.OldDataCount   = ifr.DataCount;
                eearg.BlockSize      = ifr.BlockSize;

                newaddr = ifr.ExpandsArea(form, newdatacount, undodata, pointer);
                if (newaddr == U.NOT_FOUND)
                {
                    return(U.NOT_FOUND);
                }

                eearg.NewBaseAddress = newaddr;
                eearg.NewDataCount   = newdatacount;
                AddressListExpandsEventInner(form, eearg, undodata);
            }
            InputFormRef.ClearCacheDataCount();
            return(newaddr);
        }
        //全データの取得
        public static void RecycleOldData(ref List <Address> recycle, uint script_pointer)
        {
            byte[] alloc = new byte[36 + (36 * 9) + 4];
            uint   addr  = Program.ROM.p32(script_pointer);

            if (U.isSafetyOffset(addr + 36 + (36 * 9)))
            {
                uint term = Program.ROM.u32(addr + 36 + (36 * 9));
                if (term == 0xFFFFFFFF)
                {//9個メニューで確定
                    FEBuilderGBA.Address.AddPointer(recycle
                                                    , script_pointer
                                                    , 36 + (36 * 9) + 4
                                                    , "SplitMenu9"
                                                    , Address.DataTypeEnum.SplitMenu9
                                                    );
                    return;
                }
            }
            if (U.isSafetyOffset(addr + 36 + (36 * 5)))
            {
                uint term = Program.ROM.u32(addr + 36 + (36 * 5));
                if (term == 0xFFFFFFFF)
                {//5個メニューで確定
                    FEBuilderGBA.Address.AddPointer(recycle
                                                    , script_pointer
                                                    , 36 + (36 * 5) + 4
                                                    , "SplitMenu5"
                                                    , Address.DataTypeEnum.SplitMenu5
                                                    );
                    return;
                }
            }
            //よくわからんので汎用ルーチン
            MenuDefinitionForm.MakeAllDataLength(recycle, script_pointer, isDirectAddress: true);
        }
Ejemplo n.º 7
0
        static void ScanSystem(List <FELint.ErrorSt> errors, List <DisassemblerTrumb.LDRPointer> ldrmap)
        {
            ROMCheck(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageBattleAnimeForm"))
            {
                return;
            }
            ImageBattleAnimeForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageBGForm"))
            {
                return;
            }
            ImageBGForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem UnitForm"))
            {
                return;
            }
            UnitForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ClassForm"))
            {
                return;
            }
            ClassForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ItemForm"))
            {
                return;
            }
            ItemForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem MoveCostForm"))
            {
                return;
            }
            MoveCostForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem PatchForm"))
            {
                return;
            }
            PatchForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitMoveIconFrom"))
            {
                return;
            }
            ImageUnitMoveIconFrom.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitWaitIconFrom"))
            {
                return;
            }
            ImageUnitWaitIconFrom.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ItemEffectPointerForm"))
            {
                return;
            }
            ItemEffectPointerForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitPaletteForm"))
            {
                return;
            }
            ImageUnitPaletteForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageBattleScreen"))
            {
                return;
            }
            ImageBattleScreenForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageMagic"))
            {
                return;
            }
            ImageMagicFEditorForm.MakeCheckError(errors);
            ImageMagicCSACreatorForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem Procs"))
            {
                return;
            }
            ProcsScriptForm.MakeCheckError(errors, ldrmap);

            if (InputFormRef.DoEvents(null, "ScanSystem MenuDefinition"))
            {
                return;
            }
            MenuDefinitionForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem EventUnit"))
            {
                return;
            }
            EventUnitForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem AIScript"))
            {
                return;
            }
            AIScriptForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem SongTable"))
            {
                return;
            }
            SongTableForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ItemWeaponEffect"))
            {
                return;
            }
            ItemWeaponEffectForm.MakeCheckError(errors);

            if (Program.ROM.RomInfo.version() == 8)
            {
                if (InputFormRef.DoEvents(null, "ScanSystem SoundFootStepsForm"))
                {
                    return;
                }
                SoundFootStepsForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitForm"))
                {
                    return;
                }
                ImagePortraitForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuForm"))
                {
                    return;
                }
                EventHaikuForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkForm"))
                {
                    return;
                }
                EventBattleTalkForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkForm"))
                {
                    return;
                }
                SupportTalkForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportUnitForm"))
                {
                    return;
                }
                SupportUnitForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SoundRoomForm"))
                {
                    return;
                }
                SoundRoomForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EDForm"))
                {
                    return;
                }
                EDForm.MakeCheckError(errors);
            }
            else if (Program.ROM.RomInfo.version() == 7)
            {
                if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitForm"))
                {
                    return;
                }
                ImagePortraitForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuFE7Form"))
                {
                    return;
                }
                EventHaikuFE7Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkFE7Form"))
                {
                    return;
                }
                EventBattleTalkFE7Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkFE7Form"))
                {
                    return;
                }
                SupportTalkFE7Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportUnitForm"))
                {
                    return;
                }
                SupportUnitForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SoundRoomForm"))
                {
                    return;
                }
                SoundRoomForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EDForm"))
                {
                    return;
                }
                EDFE7Form.MakeCheckError(errors);
            }
            else
            {
                if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitFE6Form"))
                {
                    return;
                }
                ImagePortraitFE6Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuFE6Form"))
                {
                    return;
                }
                EventHaikuFE6Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkFE6Form"))
                {
                    return;
                }
                EventBattleTalkFE6Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkFE6Form"))
                {
                    return;
                }
                SupportTalkFE6Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EDForm"))
                {
                    return;
                }
                EDFE6Form.MakeCheckError(errors);
            }
        }
 public static void MakeVarsIDArray(List <UseValsID> list, uint script_pointer)
 {
     MenuDefinitionForm.MakeVarsIDArray(list, script_pointer, isDirectAddress: true);
 }
Ejemplo n.º 9
0
        public void ImportFont(Form self, string FontROMTextBox, bool FontAutoGenelateCheckBox, Font ttf)
        {
            string filename = FontROMTextBox;

            this.YourROM = new ROM();

            this.ProcessedFont      = new Dictionary <string, bool>();
            this.MyselfPriorityCode = PatchUtil.SearchPriorityCode();

            string version;

            if (this.YourROM.Load(filename, out version))
            {//フォントを取るようのROM
                this.YourPriorityCode = PatchUtil.SearchPriorityCode(this.YourROM);
            }
            else
            {
                this.YourROM = null;
            }

            if (FontAutoGenelateCheckBox)
            {//自動生成する
                this.UseAutoGenFont = ttf;
            }
            else
            {//自動生成しない
                this.UseAutoGenFont = null;
            }
            FETextDecode decode = new FETextDecode();


            //少し時間がかかるので、しばらくお待ちください表示.
            using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(self))
            {
                this.UndoData = Program.Undo.NewUndoData("FONT Import");

                //文字列からフォントを探索
                {
                    List <U.AddrResult> list = TextForm.MakeItemList();
                    for (int i = 0; i < list.Count; i++)
                    {
                        string text = decode.Decode((uint)i);
                        pleaseWait.DoEvents("String:" + U.To0xHexString((uint)i));

                        FontImporter(text);
                    }
                }
                //メニュー1
                if (Program.ROM.RomInfo.is_multibyte())
                {
                    List <U.AddrResult> menuDefineList = MenuDefinitionForm.MakeListAll();
                    for (int n = 0; n < menuDefineList.Count; n++)
                    {
                        if (!U.isSafetyOffset(menuDefineList[n].addr + 8))
                        {
                            continue;
                        }
                        uint p = menuDefineList[n].addr + 8;
                        if (!U.isSafetyOffset(Program.ROM.p32(p)))
                        {
                            continue;
                        }
                        List <U.AddrResult> list = MenuCommandForm.MakeListPointer(p);
                        for (int i = 0; i < list.Count; i++)
                        {
                            if (!U.isSafetyOffset(list[i].addr))
                            {
                                continue;
                            }
                            uint   textid = Program.ROM.u32(list[i].addr + 0);
                            string str    = FETextDecode.Direct(textid);

                            pleaseWait.DoEvents("Menu:" + U.To0xHexString(textid));
                            FontImporter(str);
                        }
                    }
                }

                //地形
                if (Program.ROM.RomInfo.is_multibyte())
                {
                    List <U.AddrResult> list = MapTerrainNameForm.MakeList();
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (!U.isSafetyOffset(list[i].addr))
                        {
                            continue;
                        }
                        uint   textid = Program.ROM.u32(list[i].addr + 0);
                        string str    = FETextDecode.Direct(textid);

                        pleaseWait.DoEvents("Terrain:" + U.To0xHexString(textid));
                        FontImporter(str);
                    }
                }

                //サウンドルーム
                //FE7のサウンドルームは、日本語直地
                if (Program.ROM.RomInfo.is_multibyte() && Program.ROM.RomInfo.version() == 7)
                {
                    List <U.AddrResult> list = SoundRoomForm.MakeList();
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (!U.isSafetyOffset(list[i].addr))
                        {
                            continue;
                        }
                        uint   textid = Program.ROM.u32(list[i].addr + 12);
                        string str    = FETextDecode.Direct(textid);

                        pleaseWait.DoEvents("SoundRoom:" + U.To0xHexString(textid));
                        FontImporter(str);
                    }
                }
                //その他文字列
                {
                    List <U.AddrResult> list = OtherTextForm.MakeList();
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (!U.isSafetyOffset(list[i].addr))
                        {
                            continue;
                        }

                        uint   p_str = Program.ROM.p32(list[i].addr);
                        string str   = Program.ROM.getString(p_str);

                        pleaseWait.DoEvents("Other:" + U.To0xHexString(p_str));
                        FontImporter(str);
                    }
                }

                Program.Undo.Push(this.UndoData);
            }
        }
Ejemplo n.º 10
0
 //全データの取得
 public static void RecycleOldData(ref List <Address> recycle, uint script_pointer)
 {
     MenuDefinitionForm.MakeAllDataLength(recycle, script_pointer, isDirectAddress: true);
 }
Ejemplo n.º 11
0
        public void ExportallText(Form self
                                  , string writeTextFileName
                                  , string tralnslate_from, string tralnslate_to
                                  , string rom_from, string rom_to
                                  , bool isModifiedTextOnly
                                  , bool isOneLiner
                                  )
        {
            //少し時間がかかるので、しばらくお待ちください表示.
            using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(self))
            {
                FETextDecode decode = new FETextDecode();

                Dictionary <string, string> transDic = TranslateTextUtil.MakeFixedDic(tralnslate_from, tralnslate_to, rom_from, rom_to);
                if (ExportFilterArray != null)
                {
                    using (StreamWriter writer = new StreamWriter(writeTextFileName))
                    {
                        List <U.AddrResult> list = TextForm.MakeItemList();
                        for (int i = 0; i < list.Count; i++)
                        {
                            if (!ExportFilterArray.ContainsKey(i))
                            {
                                continue;
                            }
                            string text = decode.Decode((uint)i);

                            pleaseWait.DoEvents("Text:" + U.To0xHexString((uint)i));
                            ExportText(writer, (uint)i, text, tralnslate_from, tralnslate_to, transDic, isModifiedTextOnly, isOneLiner);
                        }
                    }
                    return;
                }

                using (StreamWriter writer = new StreamWriter(writeTextFileName))
                {
                    //テキスト
                    {
                        List <U.AddrResult> list = TextForm.MakeItemList();
                        for (int i = 0; i < list.Count; i++)
                        {
                            if (ExportFilterArray != null && ExportFilterArray[i] != false)
                            {
                                continue;
                            }
                            string text = decode.Decode((uint)i);

                            pleaseWait.DoEvents("Text:" + U.To0xHexString((uint)i));
                            ExportText(writer, (uint)i, text, tralnslate_from, tralnslate_to, transDic, isModifiedTextOnly, isOneLiner);
                        }
                    }

                    //メニュー1
                    if (Program.ROM.RomInfo.is_multibyte)
                    {
                        List <U.AddrResult> menuDefineList = MenuDefinitionForm.MakeListAll();
                        for (int n = 0; n < menuDefineList.Count; n++)
                        {
                            if (!U.isSafetyOffset(menuDefineList[n].addr + 8))
                            {
                                continue;
                            }
                            uint p = menuDefineList[n].addr + 8;
                            if (!U.isSafetyOffset(Program.ROM.p32(p)))
                            {
                                continue;
                            }
                            List <U.AddrResult> list = MenuCommandForm.MakeListPointer(p);
                            for (int i = 0; i < list.Count; i++)
                            {
                                if (!U.isSafetyOffset(list[i].addr))
                                {
                                    continue;
                                }
                                uint   text_pointer = list[i].addr + 0;
                                uint   textid       = Program.ROM.u32(text_pointer);
                                string str          = FETextDecode.Direct(textid);
                                if (str.Trim() == "")
                                {
                                    continue;
                                }

                                pleaseWait.DoEvents("Menu:" + U.To0xHexString(textid));
                                ExportText(writer, U.toPointer(text_pointer), str, tralnslate_from, tralnslate_to, transDic, isModifiedTextOnly, isOneLiner);
                            }
                        }
                    }

                    //地形
                    if (Program.ROM.RomInfo.is_multibyte)
                    {
                        List <U.AddrResult> list = MapTerrainNameForm.MakeList();
                        for (int i = 0; i < list.Count; i++)
                        {
                            if (!U.isSafetyOffset(list[i].addr))
                            {
                                continue;
                            }
                            uint   text_pointer = list[i].addr + 0;
                            uint   textid       = Program.ROM.u32(text_pointer);
                            string str          = FETextDecode.Direct(textid);
                            if (str.Trim() == "")
                            {
                                continue;
                            }

                            pleaseWait.DoEvents("Terrain:" + U.To0xHexString(textid));
                            ExportText(writer, U.toPointer(text_pointer), str, tralnslate_from, tralnslate_to, transDic, isModifiedTextOnly, isOneLiner);
                        }
                    }

                    //サウンドルーム
                    //FE7のサウンドルームは、日本語直地
                    if (Program.ROM.RomInfo.is_multibyte && Program.ROM.RomInfo.version == 7)
                    {
                        List <U.AddrResult> list = SoundRoomForm.MakeList();
                        for (int i = 0; i < list.Count; i++)
                        {
                            if (!U.isSafetyOffset(list[i].addr))
                            {
                                continue;
                            }
                            uint   text_pointer = list[i].addr + 12;
                            uint   textid       = Program.ROM.u32(text_pointer);
                            string str          = FETextDecode.Direct(textid);
                            if (str.Trim() == "")
                            {
                                continue;
                            }

                            pleaseWait.DoEvents("SoundRoom:" + U.To0xHexString(textid));
                            ExportText(writer, U.toPointer(text_pointer), str, tralnslate_from, tralnslate_to, transDic, isModifiedTextOnly, isOneLiner);
                        }
                    }
                    //その他文字列
                    {
                        List <U.AddrResult> list = OtherTextForm.MakeList();
                        for (int i = 0; i < list.Count; i++)
                        {
                            if (!U.isSafetyOffset(list[i].addr))
                            {
                                continue;
                            }
                            uint   text_pointer = list[i].addr + 0;
                            uint   p_str        = Program.ROM.p32(text_pointer);
                            string str          = Program.ROM.getString(p_str);
                            if (str.Trim() == "")
                            {
                                continue;
                            }

                            pleaseWait.DoEvents("Other:" + U.To0xHexString(p_str));
                            ExportText(writer, U.toPointer(text_pointer), str, tralnslate_from, tralnslate_to, transDic, isModifiedTextOnly, isOneLiner);
                        }
                    }
                }
            }
        }
Ejemplo n.º 12
0
        public static uint AllocNullMenuAddress(uint needCount, string typename)
        {
            uint pointer;

            if (typename == "UNITMENU")
            {
                pointer = MenuDefinitionForm.GetUnitMenuPointer();
            }
            else if (typename == "GAMEMENU")
            {
                pointer = MenuDefinitionForm.GetGameMenuPointer();
            }
            else
            {
                return(U.NOT_FOUND);
            }

            uint alwayFalse = 0;

            if (Program.ROM.RomInfo.version() != 6)
            {
                alwayFalse = U.toPointer(Program.ROM.RomInfo.MenuCommand_UsabilityNever() + 1);
            }

            uint nullCount = 0;
            uint foundAddr = U.NOT_FOUND;

            InputFormRef ifr = Init(null);

            ifr.ReInitPointer(pointer);

            uint addr = ifr.BaseAddress;

            for (int i = 0; i < ifr.DataCount; i++, addr += ifr.BlockSize)
            {
                uint a1 = Program.ROM.u32(addr + 0);
                uint a2 = Program.ROM.u32(addr + 4);
                uint a3 = Program.ROM.u32(addr + 8);
                uint a4 = Program.ROM.u32(addr + 12); //常にメニューを表示しないを選択
                uint a5 = Program.ROM.u32(addr + 16);
                uint a6 = Program.ROM.u32(addr + 20);
                uint a7 = Program.ROM.u32(addr + 24);
                uint a8 = Program.ROM.u32(addr + 28);
                uint a9 = Program.ROM.u32(addr + 32);

                if (a1 == 0 && a2 == 0 && a3 == 0 && a4 == alwayFalse &&
                    a5 == 0 && a6 == 0 && a7 == 0 && a8 == 0 && a9 == 0)
                {
                    if (nullCount <= 0)
                    {
                        foundAddr = addr;
                    }

                    nullCount++;
                    if (nullCount >= needCount)
                    {
                        return(foundAddr);
                    }
                }
                else
                {
                    nullCount = 0;
                    foundAddr = U.NOT_FOUND;
                }
            }
            return(U.NOT_FOUND);
        }