Disassemble osMapTLB

This commit is contained in:
Ryan Dwyer 2021-10-05 21:22:11 +10:00
parent 567c3965db
commit b6885e9420
3 changed files with 58 additions and 96 deletions

View File

@ -1,39 +0,0 @@
#include <libultra_internal.h>
#include "data.h"
GLOBAL_ASM(
glabel osInvalICache
/* 48150: 18a00011 */ blez $a1,.L00048198
/* 48154: 00000000 */ nop
/* 48158: 240b4000 */ addiu $t3,$zero,0x4000
/* 4815c: 00ab082b */ sltu $at,$a1,$t3
/* 48160: 1020000f */ beqz $at,.L000481a0
/* 48164: 00000000 */ nop
/* 48168: 00804025 */ or $t0,$a0,$zero
/* 4816c: 00854821 */ addu $t1,$a0,$a1
/* 48170: 0109082b */ sltu $at,$t0,$t1
/* 48174: 10200008 */ beqz $at,.L00048198
/* 48178: 00000000 */ nop
/* 4817c: 310a001f */ andi $t2,$t0,0x1f
/* 48180: 2529ffe0 */ addiu $t1,$t1,-32
/* 48184: 010a4023 */ subu $t0,$t0,$t2
.L00048188:
/* 48188: bd100000 */ cache 0x10,0x0($t0)
/* 4818c: 0109082b */ sltu $at,$t0,$t1
/* 48190: 1420fffd */ bnez $at,.L00048188
/* 48194: 25080020 */ addiu $t0,$t0,0x20
.L00048198:
/* 48198: 03e00008 */ jr $ra
/* 4819c: 00000000 */ nop
.L000481a0:
/* 481a0: 3c088000 */ lui $t0,0x8000
/* 481a4: 010b4821 */ addu $t1,$t0,$t3
/* 481a8: 2529ffe0 */ addiu $t1,$t1,-32
.L000481ac:
/* 481ac: bd000000 */ cache 0x0,0x0($t0)
/* 481b0: 0109082b */ sltu $at,$t0,$t1
/* 481b4: 1420fffd */ bnez $at,.L000481ac
/* 481b8: 25080020 */ addiu $t0,$t0,0x20
/* 481bc: 03e00008 */ jr $ra
/* 481c0: 00000000 */ nop
);

View File

@ -1,57 +0,0 @@
#include <libultra_internal.h>
#include "data.h"
GLOBAL_ASM(
glabel osMapTLB
/* 4e1b0: 40085000 */ mfc0 $t0,$10
/* 4e1b4: 40840000 */ mtc0 $a0,$0
/* 4e1b8: 40852800 */ mtc0 $a1,$5
/* 4e1bc: 8fa90014 */ lw $t1,0x14($sp)
/* 4e1c0: 2401ffff */ addiu $at,$zero,-1
/* 4e1c4: 11210004 */ beq $t1,$at,.L0004e1d8
/* 4e1c8: 240c0001 */ addiu $t4,$zero,0x1
/* 4e1cc: 240a001e */ addiu $t2,$zero,0x1e
/* 4e1d0: 10000002 */ b .L0004e1dc
/* 4e1d4: 00c93025 */ or $a2,$a2,$t1
.L0004e1d8:
/* 4e1d8: 240a001f */ addiu $t2,$zero,0x1f
.L0004e1dc:
/* 4e1dc: 40865000 */ mtc0 $a2,$10
/* 4e1e0: 2401ffff */ addiu $at,$zero,-1
/* 4e1e4: 10e10006 */ beq $a3,$at,.L0004e200
/* 4e1e8: 00000000 */ nop
/* 4e1ec: 00075982 */ srl $t3,$a3,0x6
/* 4e1f0: 016a5825 */ or $t3,$t3,$t2
/* 4e1f4: 408b1000 */ mtc0 $t3,$2
/* 4e1f8: 10000002 */ b .L0004e204
/* 4e1fc: 00000000 */ nop
.L0004e200:
/* 4e200: 408c1000 */ mtc0 $t4,$2
.L0004e204:
/* 4e204: 8fab0010 */ lw $t3,0x10($sp)
/* 4e208: 2401ffff */ addiu $at,$zero,-1
/* 4e20c: 11610006 */ beq $t3,$at,.L0004e228
/* 4e210: 00000000 */ nop
/* 4e214: 000b5982 */ srl $t3,$t3,0x6
/* 4e218: 016a5825 */ or $t3,$t3,$t2
/* 4e21c: 408b1800 */ mtc0 $t3,$3
/* 4e220: 10000007 */ b .L0004e240
/* 4e224: 00000000 */ nop
.L0004e228:
/* 4e228: 408c1800 */ mtc0 $t4,$3
/* 4e22c: 2401ffff */ addiu $at,$zero,-1
/* 4e230: 14e10003 */ bne $a3,$at,.L0004e240
/* 4e234: 00000000 */ nop
/* 4e238: 3c0b8000 */ lui $t3,0x8000
/* 4e23c: 408b5000 */ mtc0 $t3,$10
.L0004e240:
/* 4e240: 00000000 */ nop
/* 4e244: 42000002 */ tlbwi
/* 4e248: 00000000 */ nop
/* 4e24c: 00000000 */ nop
/* 4e250: 00000000 */ nop
/* 4e254: 00000000 */ nop
/* 4e258: 40885000 */ mtc0 $t0,$10
/* 4e25c: 03e00008 */ jr $ra
/* 4e260: 00000000 */ nop
);

58
src/lib/ultra/os/maptlb.s Normal file
View File

@ -0,0 +1,58 @@
#include "macros.inc"
.set noat
.set noreorder
.section .text
glabel osMapTLB
mfc0 $t0, $10
mtc0 $a0, $0
mtc0 $a1, $5
lw $t1, 0x14($sp)
addiu $at, $zero, -1
beq $t1, $at, .L0004e1d8
addiu $t4, $zero, 0x1
addiu $t2, $zero, 0x1e
b .L0004e1dc
or $a2, $a2, $t1
.L0004e1d8:
addiu $t2, $zero, 0x1f
.L0004e1dc:
mtc0 $a2, $10
addiu $at, $zero, -1
beq $a3, $at, .L0004e200
nop
srl $t3, $a3, 0x6
or $t3, $t3, $t2
mtc0 $t3, $2
b .L0004e204
nop
.L0004e200:
mtc0 $t4, $2
.L0004e204:
lw $t3, 0x10($sp)
addiu $at, $zero, -1
beq $t3, $at, .L0004e228
nop
srl $t3, $t3, 0x6
or $t3, $t3, $t2
mtc0 $t3, $3
b .L0004e240
nop
.L0004e228:
mtc0 $t4, $3
addiu $at, $zero, -1
bne $a3, $at, .L0004e240
nop
lui $t3, 0x8000
mtc0 $t3, $10
.L0004e240:
nop
tlbwi
nop
nop
nop
nop
mtc0 $t0, $10
jr $ra
nop