static void AddROMTCSPointer(List <Address> list, uint addr, uint pointer, string info, bool isPointerOnly) { addr = U.toOffset(addr); if (!U.isSafetyOffset(addr)) { return; } if (pointer != U.NOT_FOUND) { pointer = U.toOffset(pointer); if (!U.isSafetyOffset(pointer)) { return; } } uint length; if (isPointerOnly) { length = 0; } else { length = ImageUtilAP.CalcROMTCSLength(addr); } list.Add(new Address(addr, length, pointer, info, DataTypeEnum.ROMTCS)); }
void TypeToLengthAndName(AsmMapSt p, uint pointer, ROM rom) { string type = p.TypeName; if (type == "LZ77") { p.Length = LZ77.getCompressedSize(rom.Data, U.toOffset(pointer)); } else if (type == "OAMREGS") { p.Length = U.OAMREGSLength(U.toOffset(pointer), rom); p.Name += " Count_" + ((p.Length - 2) / (3 * 2)); } else if (type == "OAMREGS_ARRAY") { p.Length = ScanOAMREGSTable(pointer, p.Name, rom); } else if (type == "TEXTBATCH") { p.Length = U.TextBatchLength(U.toOffset(pointer), rom); p.Name += " Count_" + ((p.Length) / 8); } else if (type == "TEXTBATCHSHORT") { p.Length = U.TextBatchShortLength(U.toOffset(pointer), rom); p.Name += " Count_" + ((p.Length) / 2); } else if (type == "EVENT") { p.Length = EventScript.SearchEveneLength(rom.Data, U.toOffset(pointer)); p.Name += " Count_" + ((p.Length - 2) / (3 * 2)); } else if (type == "HEADERTSA") { p.Length = ImageUtil.CalcByteLengthForHeaderTSAData(rom.Data, (int)U.toOffset(pointer)); } else if (type == "ROMPALETTEANIMEFRAME") { p.Length = ImageRomAnimeForm.GetPaletteFrameCountLow(rom.Data, U.toOffset(pointer)) * 2; } else if (type == "PALETTE") { p.Length = 0x20; } else if (type == "PALETTE2") { p.Length = 0x20 * 2; } else if (type == "PALETTE3") { p.Length = 0x20 * 3; } else if (type == "PALETTE4") { p.Length = 0x20 * 4; } else if (type == "PALETTE8") { p.Length = 0x20 * 8; } else if (type == "PALETTE7") { p.Length = 0x20 * 7; } else if (type == "PALETTE16") { p.Length = 0x20 * 16; } else if (type == "ROMTCS") { p.Length = ImageUtilAP.CalcROMTCSLength(U.toOffset(pointer), rom); } else if (type == "NAZO60") { p.Length = 60; } else if (type == "FONTCOLOR0x200") { p.Length = 0x200; } else if (type == "NewPopupSimple") { p.Length = ImageUtilAP.CalcPopupSimpleLength(U.toOffset(pointer), rom); } else if (type == "SECONDARYOAM") { p.Length = 14; } else if (type == "SECONDARYOAM_ARRAY") { p.Length = ScanSECONDARYOAMTable(pointer, p.Name, rom); } else if (type == "CSTRING") { int length; string strname = rom.getString(U.toOffset(pointer), out length); p.Length = (uint)length; p.Name += " => " + strname; } else if (type == "SOUND_85COMMAND_POINTER_ARRAY") { p.Length = ScanSOUND85COMMANDPointerTable(pointer, p.Name, rom); } else if (type == "ASM_POINTER_ARRAY") { p.Length = ScanASMPointerTable(pointer, p.Name, rom); } else if (type == "PROC") { uint length = ProcsScriptForm.CalcLengthAndCheck(U.toOffset(pointer)); if (length != U.NOT_FOUND) { p.Length = length; } } else if (type == "NAZO8_DATA_POINTER_ARRAY") { p.Length = ScanNazo8DataPointerTable(pointer, p.Name, rom); } else if (type == "ASM") { p.Length = 0; } else if (type == "BGCONFIG") { p.Length = 10 * 2; } }