diff --git a/include/opengl.hpp b/include/opengl.hpp index 8cb1613e..32d1dfa6 100644 --- a/include/opengl.hpp +++ b/include/opengl.hpp @@ -20,6 +20,7 @@ #pragma once #include #include +#include #include #include #include @@ -546,7 +547,8 @@ namespace OpenGL { T& y() { return g(); } T& z() { return b(); } T& w() { return a(); } - T& operator[](int index) { return m_storage[index]; } + T& operator[](size_t index) { return m_storage[index]; } + const T& operator[](size_t index) const { return m_storage[index]; } T& u() { return r(); } T& v() { return g(); } diff --git a/src/core/PICA/dynapica/shader_rec_emitter_x64.cpp b/src/core/PICA/dynapica/shader_rec_emitter_x64.cpp index a2ddc9c1..5214613a 100644 --- a/src/core/PICA/dynapica/shader_rec_emitter_x64.cpp +++ b/src/core/PICA/dynapica/shader_rec_emitter_x64.cpp @@ -103,6 +103,7 @@ void ShaderEmitter::compileInstruction(const PICAShader& shaderUnit) { case ShaderOpcodes::IFC: recIFC(shaderUnit, instruction); break; case ShaderOpcodes::IFU: recIFU(shaderUnit, instruction); break; case ShaderOpcodes::MOV: recMOV(shaderUnit, instruction); break; + case ShaderOpcodes::MOVA: recMOVA(shaderUnit, instruction); break; case ShaderOpcodes::MAX: recMAX(shaderUnit, instruction); break; case ShaderOpcodes::MUL: recMUL(shaderUnit, instruction); break; case ShaderOpcodes::NOP: break; @@ -280,6 +281,16 @@ void ShaderEmitter::recMOV(const PICAShader& shader, u32 instruction) { const u32 operandDescriptor = shader.operandDescriptors[instruction & 0x7f]; const u32 src = getBits<12, 7>(instruction); const u32 idx = getBits<19, 2>(instruction); + + loadRegister<1>(src1_xmm, shader, src, idx, operandDescriptor); // Load source 1 into scratch1 + u32 componentMask = operandDescriptor & 0xf; + Helpers::panic("Implement MOVA"); +} + +void ShaderEmitter::recMOVA(const PICAShader& shader, u32 instruction) { + const u32 operandDescriptor = shader.operandDescriptors[instruction & 0x7f]; + const u32 src = getBits<12, 7>(instruction); + const u32 idx = getBits<19, 2>(instruction); const u32 dest = getBits<21, 5>(instruction); loadRegister<1>(src1_xmm, shader, src, idx, operandDescriptor); // Load source 1 into scratch1