Skip to content

Commit

Permalink
HLE: Swap endian in matrix multiply replacement.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Feb 19, 2021
1 parent 9a3e587 commit 1556187
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Core/HLE/ReplaceTables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,25 @@ static int Replace_fabsf() {
}

static int Replace_vmmul_q_transp() {
float *out = (float *)Memory::GetPointer(PARAM(0));
const float *a = (const float *)Memory::GetPointer(PARAM(1));
const float *b = (const float *)Memory::GetPointer(PARAM(2));
float_le *out = (float_le *)Memory::GetPointer(PARAM(0));
const float_le *a = (const float_le *)Memory::GetPointer(PARAM(1));
const float_le *b = (const float_le *)Memory::GetPointer(PARAM(2));

// TODO: Actually use an optimized matrix multiply here...
if (out && b && a) {
#ifdef COMMON_BIG_ENDIAN
float outn[16], an[16], bn[16];
for (int i = 0; i < 16; ++i) {
an[i] = a[i];
bn[i] = b[i];
}
Matrix4ByMatrix4(outn, bn, an);
for (int i = 0; i < 16; ++i) {
out[i] = outn[i];
}
#else
Matrix4ByMatrix4(out, b, a);
#endif
}
return 16;
}
Expand Down

0 comments on commit 1556187

Please sign in to comment.