コード例 #1
0
 private static void InjectAllStrings(
     Config config, SCS wscs, List <MainDolString> doltext, MemoryStream ms, HyoutaTools.GameCube.Dol dol, MemchunkStorage memchunks,
     List <(int index, string entry)> j, List <(int index, string entry)> u
コード例 #2
0
        public static List <MainDolString> ReadDolStrings(DuplicatableStream filestream)
        {
            var dol    = new HyoutaTools.GameCube.Dol(filestream);
            var stream = filestream.CopyToMemory();
            var data   = new List <MainDolString>();

            ReadStringsInBlocks(data, dol, stream, 0x535A68, 0x0024, 0x04, 1, false);             // wii home archive references
            ReadStringsInBlocks(data, dol, stream, 0x576224, 0x1044, 0x04, 1, false);             // item icon strings...?
            ReadStringsInBlocks(data, dol, stream, 0x537480, 0x0054, 0x04, 1, false);             // wii error messages
            ReadStringsInBlocks(data, dol, stream, 0x5D5E08, 0x0070, 0x04, 1, false);             // wii error messages??
            ReadStringsInBlocks(data, dol, stream, 0x60CF58, 0x0008, 0x04, 1, false);             // wii error messages
            ReadStringsInBlocks(data, dol, stream, 0x5605E4, 0x0A00, 0x14, 1, false);             // battle field names?
            ReadStringsInBlocks(data, dol, stream, 0x56106C, 0x0210, 0x04, 1, false);             // menu strings
            ReadStringsInBlocks(data, dol, stream, 0x5612BC, 0x0028, 0x04, 1, false);             // menu strings
            ReadStringsInBlocks(data, dol, stream, 0x5624E8, 0x0258, 0x14, 1, false);             // debug strings
            ReadStringsInBlocks(data, dol, stream, 0x562740, 0x0154, 0x04, 1, false);             // debug strings
            ReadStringsInBlocks(data, dol, stream, 0x56FEA4, 0x0EBC, 0x04, 1, false);             // menu strings
            ReadStringsInBlocks(data, dol, stream, 0x570DAC, 0x0040, 0x04, 1, false);             // menu strings
            ReadStringsInBlocks(data, dol, stream, 0x570F94, 0x14AC, 0x1C, 4, false);             // equipment effects
            ReadStringsInBlocks(data, dol, stream, 0x572440, 0x0074, 0x04, 1, false);             // attack types
            ReadStringsInBlocks(data, dol, stream, 0x5724B8, 0x01F8, 0x08, 1, false);             // cooking effects
            ReadStringsInBlocks(data, dol, stream, 0x5726E4, 0x044C, 0x14, 2, false);             // item traits
            ReadStringsInBlocks(data, dol, stream, 0x572E38, 0x0044, 0x04, 1, false);             // gem names
            ReadStringsInBlocks(data, dol, stream, 0x572EE8, 0x0090, 0x10, 4, false);             // tutorials short
            ReadStringsInBlocks(data, dol, stream, 0x572F78, 0x0B80, 0x20, 7, false);             // tutorials long
            ReadStringsInBlocks(data, dol, stream, 0x573AF8, 0x0604, 0x1C, 7, false);             // tutorials long
            ReadStringsInBlocks(data, dol, stream, 0x574100, 0x01A8, 0x08, 1, false);             // books
            ReadStringsInBlocks(data, dol, stream, 0x5742A8, 0x008C, 0x04, 1, false);             // books [synopsis]
            ReadStringsInBlocks(data, dol, stream, 0x574338, 0x0A38, 0x0C, 1, false);             // books [sidequests]
            ReadStringsInBlocks(data, dol, stream, 0x574FA8, 0x0888, 0x1C, 2, false);             // discoveries
            ReadStringsInBlocks(data, dol, stream, 0x575844, 0x0444, 0x04, 1, false);             // enemy descriptions
            ReadStringsInBlocks(data, dol, stream, 0x577268, 0x1464, 0x24, 2, false);             // items
            ReadStringsInBlocks(data, dol, stream, 0x5786D0, 0x1E18, 0x24, 2, false);             // items
            ReadStringsInBlocks(data, dol, stream, 0x57A504, 0x02D8, 0x1C, 2, false);             // items
            ReadStringsInBlocks(data, dol, stream, 0x57A808, 0x1158, 0x28, 2, false);             // items
            ReadStringsInBlocks(data, dol, stream, 0x57B984, 0x13B0, 0x24, 2, false);             // items
            ReadStringsInBlocks(data, dol, stream, 0x57CD50, 0x02D8, 0x1C, 2, false);             // items
            ReadStringsInBlocks(data, dol, stream, 0x57D040, 0x1308, 0x18, 2, false);             // items
            ReadStringsInBlocks(data, dol, stream, 0x585C98, 0x0240, 0x0C, 2, false);             // grade shop
            ReadStringsInBlocks(data, dol, stream, 0x585F14, 0x2370, 0x24, 3, false);             // requests
            ReadStringsInBlocks(data, dol, stream, 0x5884A8, 0x55B0, 0x50, 3, false);             // artes
            ReadStringsInBlocks(data, dol, stream, 0x58DA58, 0x0078, 0x0C, 2, false);             // strategy
            ReadStringsInBlocks(data, dol, stream, 0x58DAD0, 0x0078, 0x08, 2, false);             // strategy
            ReadStringsInBlocks(data, dol, stream, 0x596B40, 0x0258, 0x0C, 2, false);             // title effects (?)
            ReadStringsInBlocks(data, dol, stream, 0x58DB80, 0x8FC0, 0x28, 2, false);             // titles

            //ReadStringsInBlocks(data, dol, stream, 0x56127C, 0x0040, 0x04, 1, false); // voiceline refs?
            //ReadStringsInBlocks(data, dol, stream, 0x535530, 0x0108, 0x04, 1, false); // letters...?
            //ReadStringsInBlocks(data, dol, stream, 0x5D5EE0, 0x0090, 0x18, 1, false); // title screen model refs?
            //ReadStringsInBlocks(data, dol, stream, 0x553654, 0x033C, 0x0C, 1, false); // disc file paths?
            //ReadStringsInBlocks(data, dol, stream, 0x553ab0, 0x000C, 0x04, 1, false); // disc file paths?
            //ReadStringsInBlocks(data, dol, stream, 0x5562E0, 0x0018, 0x04, 1, false); // disc file paths?
            //ReadStringsInBlocks(data, dol, stream, 0x556304, 0x0208, 0x04, 1, false); // disc file paths?
            //ReadStringsInBlocks(data, dol, stream, 0x556514, 0x0444, 0x04, 1, false); // disc file paths?
            //ReadStringsInBlocks(data, dol, stream, 0x556964, 0x0200, 0x04, 1, false); // disc file paths?
            //ReadStringsInBlocks(data, dol, stream, 0x556B6C, 0x0120, 0x04, 1, false); // disc file paths?
            //ReadStringsInBlocks(data, dol, stream, 0x556C94, 0x0028, 0x04, 1, false); // disc file paths?
            //ReadStringsInBlocks(data, dol, stream, 0x556CC4, 0x03A8, 0x04, 1, false); // disc file paths?
            //ReadStringsInBlocks(data, dol, stream, 0x557074, 0x0070, 0x04, 1, false); // disc file paths?
            //ReadStringsInBlocks(data, dol, stream, 0x5570EC, 0x0190, 0x04, 1, false); // disc file paths?
            //ReadStringsInBlocks(data, dol, stream, 0x557284, 0x00B8, 0x04, 1, false); // disc file paths?

            // sanity check: should have no duplicate rom pointer positions
            {
                HashSet <uint> a = new HashSet <uint>();
                foreach (var d in data)
                {
                    if (a.Contains(d.RomPointerPosition))
                    {
                        throw new Exception("duplicate strings loaded!");
                    }
                    a.Add(d.RomPointerPosition);
                }
            }
            return(data);
        }