diff --git a/src/platform/gba/asm/common_asm.inc b/src/platform/gba/asm/common_asm.inc index 0ff99981..c2b7486d 100644 --- a/src/platform/gba/asm/common_asm.inc +++ b/src/platform/gba/asm/common_asm.inc @@ -110,13 +110,14 @@ ldrsh vx2, [vp2, #VERTEX_X] ldrsh vy1, [vp1, #VERTEX_Y] rsb vx2, vx2, vx0, asr #16 // reverse order for mla - sub vy1, vy1, vy0, asr #16 - mul vy1, vx2, vy1 + subs vy1, vy1, vy0, asr #16 + mulne vy1, vx2, vy1 ldrsh vx1, [vp1, #VERTEX_X] sub vx0, vx1, vx0, asr #16 ldrsh vy2, [vp2, #VERTEX_Y] - sub vy0, vy2, vy0, asr #16 - mlas vy1, vx0, vy0, vy1 + subs vy0, vy2, vy0, asr #16 + mulne vy0, vx0, vy0 + adds vy1, vy0 ble \skip .endm diff --git a/src/platform/gba/asm/matrixSetIdentity.s b/src/platform/gba/asm/matrixSetIdentity.s index e6c2268a..82ed435d 100644 --- a/src/platform/gba/asm/matrixSetIdentity.s +++ b/src/platform/gba/asm/matrixSetIdentity.s @@ -4,12 +4,15 @@ e0 .req r0 e1 .req r1 e2 .req r2 e3 .req r3 -e4 .req r12 -m .req lr +// FIQ regs +e4 .req r8 +e5 .req r9 +e6 .req r10 +m .req r11 .global matrixSetIdentity_asm matrixSetIdentity_asm: - stmfd sp!, {lr} + fiq_on ldr m, =gMatrixPtr ldr m, [m] mov e0, #0x4000 @@ -17,15 +20,16 @@ matrixSetIdentity_asm: mov e2, #0 mov e3, #0 mov e4, #0 + mov e5, #0x4000 + mov e6, #0 // row-major // e0 e1 e2 e3 - // e4 e0 e1 e2 - // e3 e4 e0 e1 + // e4 e5 e6 e2 + // e3 e4 e5 e6 - stmia m!, {e0, e1, e2, e3, e4} - stmia m!, {e0, e1, e2, e3, e4} - stmia m!, {e0, e1} + stmia m!, {e0, e1, e2, e3, e4, e5, e6} + stmia m!, {e2, e3, e4, e5, e6} - ldmfd sp!, {lr} + fiq_off bx lr diff --git a/src/platform/gba/asm/sndPCM.s b/src/platform/gba/asm/sndPCM.s index dfc5492f..63b53f82 100644 --- a/src/platform/gba/asm/sndPCM.s +++ b/src/platform/gba/asm/sndPCM.s @@ -29,8 +29,8 @@ out .req size .macro pcm_sample_fetch ldrb out, [data, pos, lsr #SND_FIXED_SHIFT] add pos, inc - sub out, #128 - mul out, volume + subs out, #128 + mulne out, volume .endm .macro pcm_sample_fill