summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorXTra.KrazzY <XTra.KrazzY@gmail.com>2009-01-10 23:10:33 +0000
committerXTra.KrazzY <XTra.KrazzY@gmail.com>2009-01-10 23:10:33 +0000
commitee3646cfb4e8ec0fb09297c2d75b91de4dcb6241 (patch)
tree9a24bc2d39a7c45a2cfd6b747871d270c99df4c3 /Source
parent2d8e15600bd9bf020f90a25300c0cf01ac1e2984 (diff)
Linux 64-bit fix by tinctorius, please verify!
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1845 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/VideoCommon/Src/VertexLoader.cpp44
-rw-r--r--Source/Core/VideoCommon/Src/VertexLoader.h4
2 files changed, 43 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexLoader.cpp b/Source/Core/VideoCommon/Src/VertexLoader.cpp
index 8c8e7c254f..83103856fb 100644
--- a/Source/Core/VideoCommon/Src/VertexLoader.cpp
+++ b/Source/Core/VideoCommon/Src/VertexLoader.cpp
@@ -152,15 +152,15 @@ void VertexLoader::CompileVertexTranslator()
// Reset component counters if present in vertex format only.
if (m_VtxDesc.Tex0Coord || m_VtxDesc.Tex1Coord || m_VtxDesc.Tex2Coord || m_VtxDesc.Tex3Coord ||
m_VtxDesc.Tex4Coord || m_VtxDesc.Tex5Coord || m_VtxDesc.Tex6Coord || m_VtxDesc.Tex7Coord) {
- MOV(32, M(&tcIndex), Imm32(0));
+ WriteSetVariable(32, &tcIndex, Imm32(0));
}
if (m_VtxDesc.Color0 || m_VtxDesc.Color1) {
- MOV(32, M(&colIndex), Imm32(0));
+ WriteSetVariable(32, &colIndex, Imm32(0));
}
if (m_VtxDesc.Tex0MatIdx || m_VtxDesc.Tex1MatIdx || m_VtxDesc.Tex2MatIdx || m_VtxDesc.Tex3MatIdx ||
m_VtxDesc.Tex4MatIdx || m_VtxDesc.Tex5MatIdx || m_VtxDesc.Tex6MatIdx || m_VtxDesc.Tex7MatIdx) {
- MOV(32, M(&s_texmtxwrite), Imm32(0));
- MOV(32, M(&s_texmtxread), Imm32(0));
+ WriteSetVariable(32, &s_texmtxwrite, Imm32(0));
+ WriteSetVariable(32, &s_texmtxread, Imm32(0));
}
#endif
@@ -469,8 +469,13 @@ void VertexLoader::CompileVertexTranslator()
#ifdef USE_JIT
// End loop here
+#ifdef _M_X64
+ MOV(64, R(RAX), Imm64((u64)&loop_counter));
+ SUB(32, MatR(RAX), Imm8(1));
+#else
SUB(32, M(&loop_counter), Imm8(1));
- //SUB(32, R(EBX), Imm8(1));
+#endif
+
J_CC(CC_NZ, loop_start, true);
ABI_EmitEpilogue(4);
#endif
@@ -480,12 +485,41 @@ void VertexLoader::CompileVertexTranslator()
void VertexLoader::WriteCall(TPipelineFunction func)
{
#ifdef USE_JIT
+#ifdef _M_X64
+ MOV(64, R(RAX), Imm64((u64)func));
+ CALLptr(R(RAX));
+#else
CALL((void*)func);
+#endif
#else
m_PipelineStages[m_numPipelineStages++] = func;
#endif
}
+void VertexLoader::WriteGetVariable(int bits, OpArg dest, void *address)
+{
+#ifdef USE_JIT
+#ifdef _M_X64
+ MOV(64, R(RAX), Imm64((u64)address));
+ MOV(bits, dest, MatR(RAX));
+#else
+ MOV(bits, dest, M(address));
+#endif
+#endif
+}
+
+void VertexLoader::WriteSetVariable(int bits, void *address, OpArg value)
+{
+#ifdef USE_JIT
+#ifdef _M_X64
+ MOV(64, R(RAX), Imm64((u64)address));
+ MOV(bits, MatR(RAX), value);
+#else
+ MOV(bits, M(address), value);
+#endif
+#endif
+}
+
void VertexLoader::RunVertices(int vtx_attr_group, int primitive, int count)
{
DVSTARTPROFILE();
diff --git a/Source/Core/VideoCommon/Src/VertexLoader.h b/Source/Core/VideoCommon/Src/VertexLoader.h
index 34ead98b88..54ddce4c14 100644
--- a/Source/Core/VideoCommon/Src/VertexLoader.h
+++ b/Source/Core/VideoCommon/Src/VertexLoader.h
@@ -96,6 +96,10 @@ private:
void CompileVertexTranslator();
void WriteCall(TPipelineFunction);
+
+ void WriteGetVariable(int bits, Gen::OpArg, void*);
+
+ void WriteSetVariable(int bits, void*, Gen::OpArg);
};
#endif