sm64/lib/asm/osWritebackDCache.s

44 lines
839 B
ArmAsm
Raw Permalink Normal View History

2021-07-12 23:17:54 -04:00
.set noreorder // don't insert nops after branches
2019-08-25 00:46:40 -04:00
2021-07-12 23:17:54 -04:00
#include "macros.inc"
2019-08-25 00:46:40 -04:00
.section .text, "ax"
glabel osWritebackDCache
blez $a1, .osWritebackDCacheReturn
nop
li $t3, 8192
bgeu $a1, $t3, .L80324E40
nop
move $t0, $a0
addu $t1, $a0, $a1
bgeu $t0, $t1, .osWritebackDCacheReturn
nop
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
addiu $t1, $t1, -0x10
andi $t2, $t0, 0xf
#else
2019-08-25 00:46:40 -04:00
andi $t2, $t0, 0xf
addiu $t1, $t1, -0x10
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
subu $t0, $t0, $t2
.L80324E28:
cache 0x19, ($t0)
bltu $t0, $t1, .L80324E28
addiu $t0, $t0, 0x10
.osWritebackDCacheReturn:
jr $ra
nop
.L80324E40:
lui $t0, 0x8000
addu $t1, $t0, $t3
addiu $t1, $t1, -0x10
.L80324E4C:
cache 1, ($t0)
bltu $t0, $t1, .L80324E4C
2021-07-12 23:17:54 -04:00
addiu $t0, 0x10 // addiu $t0, $t0, 0x10
2019-08-25 00:46:40 -04:00
jr $ra
nop