Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/lib/asm/osInvalDCache.s
7858 views
1
.set noat // allow manual use of $at
2
.set noreorder // don't insert nops after branches
3
.set gp=64
4
5
#include "macros.inc"
6
7
8
.section .text, "ax"
9
10
glabel osInvalDCache
11
blez $a1, .L80323500
12
nop
13
li $t3, 8192
14
sltu $at, $a1, $t3
15
beqz $at, .L80323508
16
nop
17
move $t0, $a0
18
addu $t1, $a0, $a1
19
sltu $at, $t0, $t1
20
beqz $at, .L80323500
21
nop
22
andi $t2, $t0, 0xf
23
beqz $t2, .L803234D0
24
addiu $t1, $t1, -0x10
25
subu $t0, $t0, $t2
26
cache 0x15, ($t0)
27
sltu $at, $t0, $t1
28
beqz $at, .L80323500
29
nop
30
addiu $t0, $t0, 0x10
31
.L803234D0:
32
andi $t2, $t1, 0xf
33
beqz $t2, .L803234F0
34
nop
35
subu $t1, $t1, $t2
36
cache 0x15, 0x10($t1)
37
sltu $at, $t1, $t0
38
bnez $at, .L80323500
39
nop
40
.L803234F0:
41
cache 0x11, ($t0)
42
sltu $at, $t0, $t1
43
bnez $at, .L803234F0
44
addiu $t0, $t0, 0x10
45
.L80323500:
46
jr $ra
47
nop
48
49
.L80323508:
50
li $t0, K0BASE
51
addu $t1, $t0, $t3
52
addiu $t1, $t1, -0x10
53
.L80323514:
54
cache 1, ($t0)
55
sltu $at, $t0, $t1
56
bnez $at, .L80323514
57
addiu $t0, $t0, 0x10
58
jr $ra
59
nop
60
61