public void NotReady(ReadyFlags lf)
 {
     lock (m_Lock)
     {
         ReadyFlags oldFlags = m_CurrentFlags;
         m_CurrentFlags |= lf;
         if (oldFlags == ReadyFlags.None && m_CurrentFlags != ReadyFlags.None)
         {
             TriggerLoginsEnabled(false);
         }
     }
 }
 public void Ready(ReadyFlags lf)
 {
     lock (m_Lock)
     {
         ReadyFlags oldFlags = m_CurrentFlags;
         m_CurrentFlags &= ~lf;
         if (oldFlags != ReadyFlags.None && m_CurrentFlags == ReadyFlags.None)
         {
             TriggerLoginsEnabled(true);
         }
     }
 }
예제 #3
0
        ///////////////////////////////////////////////////////////////////////

        #region Event Manager Support Methods
        public static void AdjustReadyFlags(
            bool noCancel,            /* in */
            ref ReadyFlags readyFlags /* in, out */
            )
        {
            //
            // HACK: Always perform full interpreter readiness checks
            //       *IF* we actually care about script cancellation.
            //
            if (!noCancel)
            {
                readyFlags &= ~ReadyFlags.Limited;
            }
        }
예제 #4
0
        ///////////////////////////////////////////////////////////////////////

        public static bool HasFlags(
            ReadyFlags flags,
            ReadyFlags hasFlags,
            bool all
            )
        {
            if (all)
            {
                return((flags & hasFlags) == hasFlags);
            }
            else
            {
                return((flags & hasFlags) != ReadyFlags.None);
            }
        }
예제 #5
0
        /// <summary>
        /// Updates the ready state for busy devices, and sends a status update
        /// to the PERQ if something has changed.
        /// </summary>
        private void RefreshReadyState()
        {
            ReadyFlags oldFlags = _deviceReadyState;

            _deviceReadyState = 0;

            // Run our busy clocks and set new ready state
            for (int i = 0; i < _devices.Count; i++)
            {
                if (_devices[i].BusyBit != 0)           // Skip devices without a Ready bit
                {
                    if (_devices[i].BusyClocks != 0)    // If they're busy, clock 'em
                    {
                        _devices[i].BusyClocks--;
                    }

                    if (_devices[i].BusyClocks == 0)    // If they aren't busy now, set Ready bit
                    {
                        _deviceReadyState |= _devices[i].BusyBit;
                    }
                }
            }

            // If something changed, tell the PERQ
            if (oldFlags != _deviceReadyState)
            {
#if TRACING_ENABLED
                if (Trace.TraceOn)
                {
                    Trace.Log(LogType.Z80State, "Sending Z80 device ready status @ {0}: {1}.",
                              _clocks, _deviceReadyState);
                }
#endif
                _outputFifo.Enqueue(Z80System.SOM);           // SOM
                _outputFifo.Enqueue((byte)Z80toPERQMessage.Z80StatusChange);
                _outputFifo.Enqueue((byte)_deviceReadyState); // Data
            }
        }