sm64

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

__osProbeTLB.s (1088B)


      1 .set noat      // allow manual use of $at
      2 .set noreorder // don't insert nops after branches
      3 
      4 #include "macros.inc"
      5 
      6 
      7 .section .text, "ax"
      8 
      9 glabel __osProbeTLB
     10     mfc0  $t0, $10
     11     andi  $t1, $t0, 0xff
     12     li    $at, 0xFFFFE000
     13     and   $t2, $a0, $at
     14     or    $t1, $t1, $t2
     15     mtc0  $t1, $10
     16     nop
     17     nop
     18     nop
     19     tlbp
     20     nop
     21     nop
     22     mfc0  $t3, $0
     23     lui   $at, 0x8000
     24     and   $t3, $t3, $at
     25     bnez  $t3, .L8032A0D8
     26      nop
     27     tlbr
     28     nop
     29     nop
     30     nop
     31     mfc0  $t3, $5
     32     addi  $t3, $t3, 0x2000
     33     srl   $t3, $t3, 1
     34     and   $t4, $t3, $a0
     35     bnez  $t4, .L8032A0A8
     36      addi  $t3, $t3, -1
     37     mfc0  $v0, $2
     38     b     .L8032A0AC
     39      nop
     40 .L8032A0A8:
     41     mfc0  $v0, $3
     42 .L8032A0AC:
     43     andi  $t5, $v0, 2
     44     beqz  $t5, .L8032A0D8
     45      nop
     46     lui   $at, (0x3FFFFFC0 >> 16) // lui $at, 0x3fff
     47     ori   $at, (0x3FFFFFC0 & 0xFFFF) // ori $at, $at, 0xffc0
     48     and   $v0, $v0, $at
     49     sll   $v0, $v0, 6
     50     and   $t5, $a0, $t3
     51     add   $v0, $v0, $t5
     52     b     .L8032A0DC
     53      nop
     54 .L8032A0D8:
     55     li    $v0, -1
     56 .L8032A0DC:
     57     mtc0  $t0, $10
     58     jr    $ra
     59      nop