static void DecodeStringBlocks() { var filename = @"c:\working\dq3\~~string block read results -- {0}.txt"; var lists = All.AllLists.Concat(new List <TextList> { All.Instance }); // Process each separately foreach (var list in lists) { var lines = new List <string>(); var maxAddress = list.RoughEndAddress - Rom.AddressOffset; var stream = Rom.GetStream(list.StartAddress); while (stream.Address < maxAddress) { var startAddress = stream.Address; var data = stream.ReadUntil(SmallFontTable.EndOfString); var endAddress = stream.Address - 2; startAddress += (int)Rom.AddressOffset; endAddress += (int)Rom.AddressOffset; var jap = SmallFontTable.Decode(data); var eng = list.ToEnglish(jap); lines.Add($"{startAddress.ToString("x6", CultureInfo.InvariantCulture)} - {endAddress.ToString("x6", CultureInfo.InvariantCulture)} -- {data.Length.ToString("x2", CultureInfo.InvariantCulture)} -- {data.ToHexString()} -- {jap} -- {eng}"); } File.WriteAllLines(string.Format(CultureInfo.InvariantCulture, filename, list.TitleTag), lines); } }
static void DecodeStringBlock() { var filename = @"c:\working\dq3\~~string block read results.txt"; var lines = new List <string>(); var maxAddress = 0xfede00 - Rom.AddressOffset; var stream = Rom.GetStream(MonsterNames.Instance.StartAddress); while (stream.Address < maxAddress) { var startAddress = stream.Address; var data = stream.ReadUntil(SmallFontTable.EndOfString); var endAddress = stream.Address - 2; startAddress += (int)Rom.AddressOffset; endAddress += (int)Rom.AddressOffset; var jap = SmallFontTable.Decode(data); var eng = MonsterNames.Instance.ToEnglish(jap); lines.Add($"{startAddress.ToString("x6", CultureInfo.InvariantCulture)} - {endAddress.ToString("x6", CultureInfo.InvariantCulture)} -- {data.Length.ToString("x2", CultureInfo.InvariantCulture)} -- {data.ToHexString()} -- {jap} -- {eng}"); } File.WriteAllLines(filename, lines); }
// Overworld tilemap top-level grid layout public static byte[] GetLayout() { var source = Rom.GetStream(0xed8a00); return(Compression.BasicRing400.Decompress(source, 0x2000)); }