Reorder vfpu data in saved kernel contexts when loading in a new version.

This commit is contained in:
Henrik Rydgard committed 2013-11-28 13:27:51 +01:00
1 parent 55500d4bb6
commit f9f6e9492d
3 files changed
+37 -9

No files matched your search

+13 -1
View File
@@ -520,7 +520,7 @@ public:
virtual void DoState(PointerWrap &p)
{
auto s = p.Section("Thread", 1, 3);
auto s = p.Section("Thread", 1, 4);
if (!s)
return;
@@ -533,6 +533,18 @@ public:
// TODO: How do I "version" adding a DoState method to ThreadContext?
p.Do(context);
if (s <= 3)
{
// We must have been loading an old state if we're here.
// Reorder VFPU data to new order.
float temp[128];
memcpy(temp, context.v, 128 * sizeof(float));
for (int i = 0; i < 128; i++) {
context.v[voffset[i]] = temp[i];
}
}
if (s <= 2)
{
context.other[4] = context.other[5];