示例#1
0
 private static void MEMInitialize(IRom rom)
 {
     // Find the mapper
     Console.WriteLine("Finding mapper # " + rom.MapperNumber.ToString("D3"));
     bool found = false;
     string mapperName = "MyNes.Core.Mapper" + rom.MapperNumber.ToString("D3");
     Type[] types = Assembly.GetExecutingAssembly().GetTypes();
     foreach (Type tp in types)
     {
         if (tp.FullName == mapperName)
         {
             board = Activator.CreateInstance(tp) as Board;
             board.Initialize(rom.SHA1, rom.PRG, rom.CHR, rom.Trainer, rom.Mirroring);
             found = true;
             Console.WriteLine("Mapper # " + rom.MapperNumber.ToString("D3") + " initialized successfully.");
             break;
         }
     }
     if (!found)
     {
         Console.WriteLine("Mapper # " + rom.MapperNumber.ToString("D3") + " is not implemented yet.");
         throw new MapperNotSupportedException(rom.MapperNumber);
     }
 }