Exemple #1
0
 static Ptr BindPtr(AddressToken token, RomVersion version, Func <int, Ptr> func)
 {
     if (Options.MapfileOptions.CanUseMap(version))
     {
         if (Addresser.TryGetSymbolRef(token, version, out MapBinding binding) && binding != null &&
             Options.MapfileOptions.SymbolMap.TryGetSymbolAddress(binding, out N64Ptr ptr))
         {
             return(func(ptr));
         }
         Console.WriteLine($"{token} symbol not found");
         return(SPtr.New(0));
     }
     else if (Addresser.TryGetRam(token, version, out int temp))
     {
         return(func(temp));
     }
     else
     {
         return(SPtr.New(0));
     }
 }