Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/lib/asm/osWritebackDCache.s
7858 views
1
.set noreorder // don't insert nops after branches
2
.set gp=64
3
4
#include "macros.inc"
5
6
7
.section .text, "ax"
8
9
glabel osWritebackDCache
10
blez $a1, .osWritebackDCacheReturn
11
nop
12
li $t3, 8192
13
bgeu $a1, $t3, .L80324E40
14
nop
15
move $t0, $a0
16
addu $t1, $a0, $a1
17
bgeu $t0, $t1, .osWritebackDCacheReturn
18
nop
19
andi $t2, $t0, 0xf
20
addiu $t1, $t1, -0x10
21
subu $t0, $t0, $t2
22
.L80324E28:
23
cache 0x19, ($t0)
24
bltu $t0, $t1, .L80324E28
25
addiu $t0, $t0, 0x10
26
.osWritebackDCacheReturn:
27
jr $ra
28
nop
29
30
.L80324E40:
31
lui $t0, 0x8000
32
addu $t1, $t0, $t3
33
addiu $t1, $t1, -0x10
34
.L80324E4C:
35
cache 1, ($t0)
36
bltu $t0, $t1, .L80324E4C
37
addiu $t0, 0x10 // addiu $t0, $t0, 0x10
38
jr $ra
39
nop
40
41