2019-10-13 08:02:07 +02:00
|
|
|
using Ryujinx.Graphics.Gpu.State;
|
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Gpu.Engine
|
|
|
|
{
|
|
|
|
partial class Methods
|
|
|
|
{
|
|
|
|
private Inline2MemoryParams _params;
|
|
|
|
|
|
|
|
private bool _isLinear;
|
|
|
|
|
|
|
|
private int _offset;
|
|
|
|
private int _size;
|
|
|
|
|
2019-10-26 19:50:52 +02:00
|
|
|
public void LaunchDma(int argument)
|
2019-10-13 08:02:07 +02:00
|
|
|
{
|
2019-10-26 19:50:52 +02:00
|
|
|
_params = _context.State.Get<Inline2MemoryParams>(MethodOffset.I2mParams);
|
2019-10-13 08:02:07 +02:00
|
|
|
|
|
|
|
_isLinear = (argument & 1) != 0;
|
|
|
|
|
|
|
|
_offset = 0;
|
|
|
|
_size = _params.LineLengthIn * _params.LineCount;
|
|
|
|
}
|
|
|
|
|
2019-10-26 19:50:52 +02:00
|
|
|
public void LoadInlineData(int argument)
|
2019-10-13 08:02:07 +02:00
|
|
|
{
|
|
|
|
if (_isLinear)
|
|
|
|
{
|
|
|
|
for (int shift = 0; shift < 32 && _offset < _size; shift += 8, _offset++)
|
|
|
|
{
|
|
|
|
ulong gpuVa = _params.DstAddress.Pack() + (ulong)_offset;
|
|
|
|
|
|
|
|
_context.MemoryAccessor.Write(gpuVa, new byte[] { (byte)(argument >> shift) });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|