예제 #1
0
파일: Io704.cs 프로젝트: sailfish009/Sim704
 public static void OnProcessExit(object sender, EventArgs e)
 {
     if (currdev != null)
     {
         currdev.Disconnect();
     }
     currdev = null;
     if (CRD != null)
     {
         CRD.Dispose();
         CRD = null;
     }
     if (CPU != null)
     {
         CPU.Dispose();
         CPU = null;
     }
     if (MT != null)
     {
         for (int i = 0; i < MT.Length; i++)
         {
             if (MT[i] != null)
             {
                 MT[i].Dispose();
                 MT[i] = null;
             }
         }
     }
     if (DR != null)
     {
         for (int i = 0; i < DR.Length; i++)
         {
             if (DR[i] != null)
             {
                 DR[i].Dispose();
                 DR[i] = null;
             }
         }
     }
     if (LP != null)
     {
         LP.Dispose();
         LP = null;
     }
     if (LogCPU != null)
     {
         LogCPU.Dispose();
         LogCPU = null;
     }
     if (LogIO != null)
     {
         if (Config.LogIO != Config.LogCPU)
         {
             LogIO.Dispose();
         }
         LogIO = null;
     }
     Console.Error.WriteLine("finished");
 }
예제 #2
0
파일: Io704.cs 프로젝트: sailfish009/Sim704
 static void OpenCardPunch()
 {
     if (CPU == null && Config.CPU != null)
     {
         CPU = new CardPunch();
         CPU.MountDeck(Config.CPU);
     }
     if (CPU == null)
     {
         throw new InvalidOperationException("Invalid CardPunch selected for write");
     }
 }