sm64

A Super Mario 64 decompilation
Log | Files | Refs | README | LICENSE

guTranslate.s (1420B)


      1 .set noat
      2 .set noreorder // don't insert nops after branches
      3 
      4 #include "macros.inc"
      5 
      6 
      7 .section .text, "ax"
      8 
      9 #ifdef VERSION_CN
     10 
     11 .balign 16
     12 
     13 glabel guTranslate
     14     li    $at, 0x47800000 // 65536.000000
     15     mtc1  $at, $f4
     16     mtc1  $a1, $f6
     17     mul.s $f8, $f6, $f4
     18     trunc.w.s $f10, $f8
     19     mfc1  $t1, $f10
     20     mtc1  $a2, $f6
     21     mul.s $f8, $f6, $f4
     22     trunc.w.s $f10, $f8
     23     mfc1  $t3, $f10
     24     srl   $t2, $t1, 0x10
     25     sll   $t0, $t2, 0x10
     26     srl   $t2, $t3, 0x10
     27     or    $t0, $t0, $t2
     28     sw    $t0, 0x18($a0)
     29     sll   $t0, $t1, 0x10
     30     sll   $t2, $t3, 0x10
     31     srl   $t2, $t2, 0x10
     32     or    $t0, $t0, $t2
     33     sw    $t0, 0x38($a0)
     34     mtc1  $a3, $f6
     35     mul.s $f8, $f6, $f4
     36     trunc.w.s $f10, $f8
     37     mfc1  $t1, $f10
     38     srl   $t2, $t1, 0x10
     39     sll   $t0, $t2, 0x10
     40     addiu $t0, $t0, 1
     41     sw    $t0, 0x1c($a0)
     42     sll   $t2, $t1, 0x10
     43     sw    $t2, 0x3c($a0)
     44     sw    $zero, ($a0)
     45     sw    $zero, 4($a0)
     46     sw    $zero, 8($a0)
     47     sw    $zero, 0xc($a0)
     48     sw    $zero, 0x10($a0)
     49     sw    $zero, 0x14($a0)
     50     sw    $zero, 0x20($a0)
     51     sw    $zero, 0x24($a0)
     52     sw    $zero, 0x28($a0)
     53     sw    $zero, 0x2c($a0)
     54     sw    $zero, 0x30($a0)
     55     sw    $zero, 0x34($a0)
     56     lui   $t0, 1
     57     ori   $t0, $t0, 0
     58     sw    $t0, ($a0)
     59     sw    $t0, 0x14($a0)
     60     lui   $t0, (0x00000001 >> 16) # lui $t0, 0
     61     ori   $t0, (0x00000001 & 0xFFFF) # ori $t0, $t0, 1
     62     jr    $ra
     63      sw    $t0, 8($a0)
     64 
     65 #endif