Example #1
0
 private void Process(CommandAction cmdAction)
 {
     if (cmdAction is SyncptIncrAction syncptIncrAction)
     {
         _syncptIncrMgr.SignalDone((uint)syncptIncrAction.Data);
     }
     else if (cmdAction is MethodCallAction methodCallAction)
     {
         _device.Write(methodCallAction.Method, methodCallAction.Data);
     }
 }
Example #2
0
        /// <summary>
        /// Calls a GPU method, using this state.
        /// </summary>
        /// <param name="meth">The GPU method to be called</param>
        public void CallMethod(MethodParams meth)
        {
            int value = meth.Argument;

            // Methods < 0x80 shouldn't be affected by shadow RAM at all.
            if (meth.Method >= 0x80)
            {
                ShadowRamControl shadowCtrl = ShadowRamControl;

                // TODO: Figure out what TrackWithFilter does, compared to Track.
                if (shadowCtrl == ShadowRamControl.Track ||
                    shadowCtrl == ShadowRamControl.TrackWithFilter)
                {
                    _shadow[meth.Method] = value;
                }
                else if (shadowCtrl == ShadowRamControl.Replay)
                {
                    value = _shadow[meth.Method];
                }
            }

            if (_deviceState != null)
            {
                _deviceState.Write(meth.Method * 4, meth.Argument);
            }
            else
            {
                Register register = _registers[meth.Method];

                if (_memory[meth.Method] != value)
                {
                    _registers[(int)register.BaseOffset].Modified = true;
                }

                _memory[meth.Method] = value;

                register.Callback?.Invoke(this, value);
            }
        }
Example #3
0
        private void Process(CommandAction cmdAction)
        {
            long contextId = cmdAction.ContextId;

            if (contextId != _previousContextId)
            {
                _previousContextId = contextId;

                if (_device is IDeviceStateWithContext deviceWithContext)
                {
                    deviceWithContext.BindContext(contextId);
                }
            }

            if (cmdAction is SyncptIncrAction syncptIncrAction)
            {
                _syncptIncrMgr.SignalDone((uint)syncptIncrAction.Data);
            }
            else if (cmdAction is MethodCallAction methodCallAction)
            {
                _device.Write(methodCallAction.Method, methodCallAction.Data);
            }
        }
Example #4
0
 /// <summary>
 /// Performs a GPU method call.
 /// </summary>
 /// <param name="state">Current GPU state</param>
 /// <param name="methAddr">Address, in words, of the method</param>
 /// <param name="value">Call argument</param>
 private static void Send(IDeviceState state, int methAddr, int value)
 {
     state.Write(methAddr * 4, value);
 }
Example #5
0
        /// <summary>
        /// Performs a GPU method call.
        /// </summary>
        /// <param name="state">Current GPU state</param>
        /// <param name="value">Call argument</param>
        private void Send(IDeviceState state, int value)
        {
            state.Write(_methAddr * 4, value);

            _methAddr += _methIncr;
        }
Example #6
0
 /// <summary>
 /// Performs a GPU method call.
 /// </summary>
 /// <param name="value">Call argument</param>
 /// <param name="state">Current GPU state</param>
 /// <param name="methAddr">Address, in words, of the method</param>
 public static void Send(int value, IDeviceState state, int methAddr)
 {
     state.Write(methAddr * 4, value);
 }
Example #7
0
 private void DeviceWrite(int offset, int data)
 {
     _device?.Write(offset * 4, data);
 }