diff --git a/src/fixed/common.h b/src/fixed/common.h index 62ca36c1..c86e852c 100644 --- a/src/fixed/common.h +++ b/src/fixed/common.h @@ -1,7 +1,7 @@ #ifndef H_COMMON #define H_COMMON //#define STATIC_ITEMS -#define PROFILING +//#define PROFILING #ifdef PROFILING #define STATIC_ITEMS #define PROFILE_FRAMETIME diff --git a/src/platform/gba/asm/matrixFrame.s b/src/platform/gba/asm/matrixFrame.s index d028d1f7..d4bfdc51 100644 --- a/src/platform/gba/asm/matrixFrame.s +++ b/src/platform/gba/asm/matrixFrame.s @@ -5,9 +5,10 @@ angles .req r1 // arg x .req pos y .req angles z .req r2 +mask .req r3 packed .req r12 -.extern matrixTranslateRel_asm, matrixRotateYXZ_asm +.extern matrixTranslateRel_asm, matrixRotateYXZ_fast_asm .global matrixFrame_asm matrixFrame_asm: @@ -20,20 +21,14 @@ matrixFrame_asm: bl matrixTranslateRel_asm // doesn't affect user mode r12 - lsl z, packed, #22 - asr z, #16 + mov mask, #4096 + sub mask, #4 - lsr packed, #10 - - lsl y, packed, #22 - asr y, #16 - - lsr packed, #10 - - lsl x, packed, #22 - asr x, #16 + and z, mask, packed, lsl #2 + and y, mask, packed, lsr #(10 - 2) + and x, mask, packed, lsr #(20 - 2) ldmfd sp!, {lr} - b matrixRotateYXZ_asm + b matrixRotateYXZ_fast_asm // TODO matrixFrameLerp \ No newline at end of file diff --git a/src/platform/gba/asm/matrixRotate.s b/src/platform/gba/asm/matrixRotate.s index a406af89..e7776af3 100644 --- a/src/platform/gba/asm/matrixRotate.s +++ b/src/platform/gba/asm/matrixRotate.s @@ -142,7 +142,7 @@ cosZ .req angleZ mask .req tmp mm .req tmp -.global matrixRotateYXZ_asm +.global matrixRotateYXZ_asm, matrixRotateYXZ_fast_asm matrixRotateYXZ_asm: mov mask, #0xFF orr mask, mask, #0xF00 ; mask = 0xFFF @@ -151,6 +151,7 @@ matrixRotateYXZ_asm: and angleY, mask, angleY, lsr #4 and angleZ, mask, angleZ, lsr #4 +matrixRotateYXZ_fast_asm: orr mask, angleX, angleY orrs mask, mask, angleZ bxeq lr