Esempio n. 1
0
        private Dictionary<int, string> ReadTableText(Mother3Rom rom, int offset, int bugContext = 0)
        {
            if (offset == 0)
            {
                return null;
            }

            Mother3Reader reader = new Mother3Reader(rom);
            reader.Position = offset;

            FixedTableHeader header = reader.ReadFixedTableHeader();

            if (bugContext == 1)
            {
                // Bug in English versions 1.0 through 1.2 -- one of the entries is
                // missing from the table, so the header's entry count is too high by one
                switch (rom.Settings.Version)
                {
                    case Mother3Version.English10:
                    case Mother3Version.English11:
                    case Mother3Version.English12:
                        header = new FixedTableHeader(header.EntryLength, header.Count - 1);
                        break;
                }
            }

            Dictionary<int, string> text = new Dictionary<int, string>();

            for (int i = 0; i < header.Count; i++)
            {
                text.Add(i, reader.ReadCodedString(header.EntryLength));
            }

            return text;
        }