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); } }
public static RomFileToken Select(RomVersion version, ORom.FileList ootFile, MRom.FileList mmFile) { return((version == Game.OcarinaOfTime) ? (RomFileToken)ootFile : (RomFileToken)mmFile); }
public RomFileToken(ORom.FileList file) { Game = Game.OcarinaOfTime; OFile = file; MFile = MRom.FileList.invalid; }