summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderARM64.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2015-06-20 21:12:31 -0500
committerRyan Houdek <Sonicadvance1@gmail.com>2015-06-20 21:12:31 -0500
commita811370329a996d13676ef6a710eefc3b6087d02 (patch)
treec55afa689137d886d9520bf4f5e377d0d5dd1290 /Source/Core/VideoCommon/VertexLoaderARM64.cpp
parent3948dc77c73136d7a828c161d2fc4f9c9b180760 (diff)
[AArch64] Fix a couple of bugs in the vertex loader
In particular this fixes the 6666 colour format We were loading from the wrong location and it was causing /terrible/ colour changes. This also fixes a bug in the all the colour formats(except 888) where the unaligned path was loading in to the wrong register.
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderARM64.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoaderARM64.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderARM64.cpp b/Source/Core/VideoCommon/VertexLoaderARM64.cpp
index 35d3a989e7..cf321baa60 100644
--- a/Source/Core/VideoCommon/VertexLoaderARM64.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderARM64.cpp
@@ -217,7 +217,7 @@ void VertexLoaderARM64::ReadColor(u64 attribute, int format, s32 offset)
if (offset == -1)
LDRH(INDEX_UNSIGNED, scratch3_reg, EncodeRegTo64(scratch1_reg), 0);
else if (offset & 1) // Not aligned - unscaled
- LDURH(scratch2_reg, src_reg, offset);
+ LDURH(scratch3_reg, src_reg, offset);
else
LDRH(INDEX_UNSIGNED, scratch3_reg, src_reg, offset);
@@ -254,7 +254,7 @@ void VertexLoaderARM64::ReadColor(u64 attribute, int format, s32 offset)
if (offset == -1)
LDRH(INDEX_UNSIGNED, scratch3_reg, EncodeRegTo64(scratch1_reg), 0);
else if (offset & 1) // Not aligned - unscaled
- LDURH(scratch2_reg, src_reg, offset);
+ LDURH(scratch3_reg, src_reg, offset);
else
LDRH(INDEX_UNSIGNED, scratch3_reg, src_reg, offset);
@@ -284,16 +284,22 @@ void VertexLoaderARM64::ReadColor(u64 attribute, int format, s32 offset)
// RRRRRRGG GGGGBBBB BBAAAAAA
// AAAAAAAA BBBBBBBB GGGGGGGG RRRRRRRR
if (offset == -1)
- LDR(INDEX_UNSIGNED, scratch3_reg, EncodeRegTo64(scratch1_reg), 0);
- else if (offset & 3) // Not aligned - unscaled
- LDUR(scratch2_reg, src_reg, offset);
+ {
+ LDUR(scratch3_reg, EncodeRegTo64(scratch1_reg), -1);
+ }
else
- LDR(INDEX_UNSIGNED, scratch3_reg, src_reg, m_src_ofs);
+ {
+ offset -= 1;
+ if (offset & 3) // Not aligned - unscaled
+ LDUR(scratch3_reg, src_reg, offset);
+ else
+ LDR(INDEX_UNSIGNED, scratch3_reg, src_reg, offset);
+ }
REV32(scratch3_reg, scratch3_reg);
// A
- AND(scratch2_reg, scratch3_reg, 32, 5);
+ UBFM(scratch2_reg, scratch3_reg, 0, 5);
ORR(scratch2_reg, WSP, scratch2_reg, ArithOption(scratch2_reg, ST_LSL, 2));
ORR(scratch2_reg, scratch2_reg, scratch2_reg, ArithOption(scratch2_reg, ST_LSR, 6));
ORR(scratch1_reg, WSP, scratch2_reg, ArithOption(scratch2_reg, ST_LSL, 24));
@@ -316,6 +322,7 @@ void VertexLoaderARM64::ReadColor(u64 attribute, int format, s32 offset)
ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ST_LSR, 4));
STR(INDEX_UNSIGNED, scratch1_reg, dst_reg, m_dst_ofs);
+
load_bytes = 3;
break;
}