Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/lib/asm/__osProbeTLB.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 __osProbeTLB
11
mfc0 $t0, $10
12
andi $t1, $t0, 0xff
13
li $at, -8192
14
and $t2, $a0, $at
15
or $t1, $t1, $t2
16
mtc0 $t1, $10
17
nop
18
nop
19
nop
20
tlbp
21
nop
22
nop
23
mfc0 $t3, $0
24
lui $at, 0x8000
25
and $t3, $t3, $at
26
bnez $t3, .L8032A0D8
27
nop
28
tlbr
29
nop
30
nop
31
nop
32
mfc0 $t3, $5
33
addi $t3, $t3, 0x2000
34
srl $t3, $t3, 1
35
and $t4, $t3, $a0
36
bnez $t4, .L8032A0A8
37
addi $t3, $t3, -1
38
mfc0 $v0, $2
39
b .L8032A0AC
40
nop
41
.L8032A0A8:
42
mfc0 $v0, $3
43
.L8032A0AC:
44
andi $t5, $v0, 2
45
beqz $t5, .L8032A0D8
46
nop
47
lui $at, (0x3FFFFFC0 >> 16) // lui $at, 0x3fff
48
ori $at, (0x3FFFFFC0 & 0xFFFF) // ori $at, $at, 0xffc0
49
and $v0, $v0, $at
50
sll $v0, $v0, 6
51
and $t5, $a0, $t3
52
add $v0, $v0, $t5
53
b .L8032A0DC
54
nop
55
.L8032A0D8:
56
li $v0, -1
57
.L8032A0DC:
58
mtc0 $t0, $10
59
jr $ra
60
nop
61
62
nop
63
nop
64
65
66