Esempio n. 1
0
        /// <summary>
        /// Performs a GPU method call.
        /// </summary>
        /// <param name="state">Current GPU state</param>
        /// <param name="shadowState">Shadow GPU state</param>
        /// <param name="value">Call argument</param>
        private void Send(GpuState state, GpuState shadowState, int value)
        {
            // TODO: Figure out what TrackWithFilter does, compared to Track.
            if (_shadowCtrl == ShadowRamControl.Track ||
                _shadowCtrl == ShadowRamControl.TrackWithFilter)
            {
                shadowState.Write(_methAddr, value);
            }
            else if (_shadowCtrl == ShadowRamControl.Replay)
            {
                value = shadowState.Read(_methAddr);
            }

            MethodParams meth = new MethodParams(_methAddr, value);

            state.CallMethod(meth);

            _methAddr += _methIncr;
        }
Esempio n. 2
0
 /// <summary>
 /// Reads data from a GPU register.
 /// </summary>
 /// <param name="state">Current GPU state</param>
 /// <param name="reg">Register offset to read</param>
 /// <returns>GPU register value</returns>
 private int Read(GpuState state, int reg)
 {
     return(state.Read(reg));
 }
Esempio n. 3
0
 /// <summary>
 /// Reads data from a GPU register.
 /// </summary>
 /// <param name="state">Current GPU state</param>
 /// <param name="reg">Register offset to read</param>
 /// <returns>GPU register value</returns>
 public static int Read(GpuState state, int reg)
 {
     return(state.Read(reg));
 }