示例#1
0
        static void BindSegment(RomVersion version, ORom.FileList fileO, MRom.FileList fileM, ref Ptr ram, ref Ptr rom)
        {
            RomFileToken token = RomFileToken.Select(version, fileO, fileM);

            if (Options.MapfileOptions.CanUseMap(version))
            {
                Segment seg = Options.MapfileOptions.SymbolMap.GetSegment(token.ToString());
                if (seg != null)
                {
                    ram = SPtr.New(seg.Address);
                    rom = SPtr.New(seg.LoadAddress);
                }
                else
                {
                    Console.WriteLine($"Segment {token} not found.");
                }
            }
            else
            {
                Addresser.TryGetRam(token, version, out var t1);
                ram = SPtr.New(t1);
                Addresser.TryGetRom(token, version, t1, out var t2);
                rom = SPtr.New(t2);
            }
        }
示例#2
0
 public static RomFileToken Select(RomVersion version, ORom.FileList ootFile, MRom.FileList mmFile)
 {
     return((version == Game.OcarinaOfTime) ? (RomFileToken)ootFile : (RomFileToken)mmFile);
 }
示例#3
0
 public RomFileToken(ORom.FileList file)
 {
     Game  = Game.OcarinaOfTime;
     OFile = file;
     MFile = MRom.FileList.invalid;
 }