From 6b7559c71b1eb4b39c34b5398b4009bc4cb91668 Mon Sep 17 00:00:00 2001 From: zeromus Date: Fri, 21 Apr 2023 15:18:32 -0400 Subject: [PATCH] fix alignment of tempMultiplyMatrix and currentMatrix[4] in GeometryEngineLegacySave. Fixes #657. It would be better to fix this perhaps by making NDSMatrix a type that has the alignas(16) put on it while inheriting from std::array perhaps, so this mistake is not possible? --- desmume/src/gfx3d.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desmume/src/gfx3d.h b/desmume/src/gfx3d.h index 9ee100d11..3328a44ce 100644 --- a/desmume/src/gfx3d.h +++ b/desmume/src/gfx3d.h @@ -666,8 +666,8 @@ struct GeometryEngineLegacySave u32 texPalette; u32 mtxCurrentMode; - NDSMatrix tempMultiplyMatrix; - NDSMatrix currentMatrix[4]; + CACHE_ALIGN NDSMatrix tempMultiplyMatrix; + CACHE_ALIGN NDSMatrix currentMatrix[4]; u8 mtxLoad4x4PendingIndex; u8 mtxLoad4x3PendingIndex; u8 mtxMultiply4x4TempIndex;