From 697492d1e12ba642f21a95e9c245155b895ef320 Mon Sep 17 00:00:00 2001 From: someone2639 Date: Sat, 2 Oct 2021 09:26:18 -0400 Subject: [PATCH] add some logic for gWorldScale; only div on scales higher than 1 --- asm/math.s | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/asm/math.s b/asm/math.s index 2d92f6587..d67a89d3b 100644 --- a/asm/math.s +++ b/asm/math.s @@ -7,16 +7,20 @@ .section .text, "ax" .balign 32 -# glabel mtxf_to_mtx_asm -.globl mtxf_to_mtx_asm -mtxf_to_mtx_asm: +glabel mtxf_to_mtx_asm + lwc1 $f6, gWorldScale + li.s $f8, 1.0 li $v0, 1 li.s $f4, 65536.0 1: lwc1 $f0, ($a1) + lwc1 $f2, 0x04($a1) + c.eq.s $f6, $f8 + bc1f 3f + nop +2: andi $t0, $v0, (1 << 1) mul.s $f0, $f4 - lwc1 $f2, 0x04($a1) trunc.w.s $f0, $f0 mfc1 $t3, $f0 addiu $a1, 8 @@ -46,3 +50,8 @@ storezero: sh $zero, 0x02($a0) sh $zero, 0x22($a0) j loopend +3: + div.s $f0, $f6 + div.s $f2, $f6 + b 2b +