sm64

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

osWritebackDCache.s (839B)


      1 .set noreorder // don't insert nops after branches
      2 
      3 #include "macros.inc"
      4 
      5 
      6 .section .text, "ax"
      7 
      8 glabel osWritebackDCache
      9     blez  $a1, .osWritebackDCacheReturn
     10      nop
     11     li    $t3, 8192
     12     bgeu  $a1, $t3, .L80324E40
     13      nop
     14     move  $t0, $a0
     15     addu  $t1, $a0, $a1
     16     bgeu  $t0, $t1, .osWritebackDCacheReturn
     17      nop
     18 #ifdef VERSION_CN
     19     addiu $t1, $t1, -0x10
     20     andi  $t2, $t0, 0xf
     21 #else
     22     andi  $t2, $t0, 0xf
     23     addiu $t1, $t1, -0x10
     24 #endif
     25     subu  $t0, $t0, $t2
     26 .L80324E28:
     27     cache 0x19, ($t0)
     28     bltu  $t0, $t1, .L80324E28
     29      addiu $t0, $t0, 0x10
     30 .osWritebackDCacheReturn:
     31     jr    $ra
     32      nop
     33 
     34 .L80324E40:
     35     lui   $t0, 0x8000
     36     addu  $t1, $t0, $t3
     37     addiu $t1, $t1, -0x10
     38 .L80324E4C:
     39     cache 1, ($t0)
     40     bltu  $t0, $t1, .L80324E4C
     41      addiu $t0, 0x10 // addiu $t0, $t0, 0x10
     42     jr    $ra
     43      nop