예제 #1
0
파일: CPU.cs 프로젝트: Silenthal/gbemu
 public CPU(InterruptManager iM, ReadFromMMUDelegate mmuRead, WriteToMMUDelegate mmuWrite, UpdateTimeDelegate sysTimeUpdate)
 {
     interruptManager = iM;
     ReadGB = mmuRead;
     WriteGB = mmuWrite;
     UpdateTimeGB = sysTimeUpdate;
     InitializeDefaultValues();
 }
예제 #2
0
        /// <summary>
        /// 用于窗体加载时间中的方法
        /// </summary>
        internal void TimeWorkForFromLoad()
        {
            //声明更新时间线程回调
            SetTimeThreadCallBack = new SetTimeThreadDelegate(SetTimeForCallBack);
            //
            UpdateTimeCallBack = new UpdateTimeDelegate(UpdateTime);
            //更新时间线程
            Thread thread = new Thread(new ThreadStart(SetTimeThreadCallBack))
            {
                IsBackground = true
            };

            thread.Start();

            Thread.Sleep(40);
        }
예제 #3
0
 private void UpdateTime(TimeSpan time)
 {
     if (this.InvokeRequired)
     {
         UpdateTimeDelegate d = new UpdateTimeDelegate(UpdateTime);
         this.Invoke(d, new object[] { time });
     }
     else
     {
         TimeSpan fileDur = TimeSpan.Zero;
         if (mPCMInfo != null)
         {
             fileDur = mPCMInfo.Duration.TimeDeltaAsTimeSpan;
         }
         mTimeLabel.Text = String.Format(
             "{0}/{1}", FormatTimeSpan(time), FormatTimeSpan(fileDur));
         if (time <= fileDur)
         {
             mTimeTrackBar.Maximum = (int)(fileDur.Ticks / TimeSpan.TicksPerMillisecond);
             mTimeTrackBar.Value   = (int)(time.Ticks / TimeSpan.TicksPerMillisecond);
         }
     }
 }