sm64/asm/boot.s

1147 lines
23 KiB
ArmAsm
Raw Normal View History

2021-07-12 23:17:54 -04:00
// assembler directives
.set noat // allow manual use of $at
.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
2023-08-17 08:56:02 -04:00
.equ EXCEPTION_TLB_MISS, 0x80000000
.equ SP_DMEM, 0xA4000000
.equ SP_IMEM, 0xA4001000
.equ MI_MODE_REG, 0xA4300000
.equ RI_MODE_REG, 0xA4700000
#ifdef VERSION_CN
.macro cn_li a b
li \a, \b
.endm
#else
.macro cn_li a b
lui \a, %hi(\b)
addiu \a, \a, %lo(\b)
.endm
#endif
2021-07-12 23:17:54 -04:00
// 0xA0000000-0xBFFFFFFF: KSEG1 direct map non-cache mirror of 0x00000000
// 0xA4000000-0xA4000FFF: RSP DMEM
2020-04-03 14:57:26 -04:00
2021-07-12 23:17:54 -04:00
// 0xA4000000-0xA400003F: ROM header
2019-08-25 00:46:40 -04:00
.section .text, "ax"
2020-04-03 14:57:26 -04:00
2021-07-12 23:17:54 -04:00
// 0xA4000040-0xA4000B6F: IPL3
2020-04-03 14:57:26 -04:00
2021-07-12 23:17:54 -04:00
// IPL3 entry point jumped to from IPL2
glabel ipl3_entry // 0xA4000040
2019-08-25 00:46:40 -04:00
mtc0 $zero, $13
mtc0 $zero, $9
mtc0 $zero, $11
2023-08-17 08:56:02 -04:00
cn_li $t0, RI_MODE_REG
2019-08-25 00:46:40 -04:00
lw $t1, 0xc($t0)
2020-04-03 14:57:26 -04:00
bnez $t1, .LA4000410
2019-08-25 00:46:40 -04:00
nop
addiu $sp, $sp, -0x18
sw $s3, ($sp)
sw $s4, 4($sp)
sw $s5, 8($sp)
sw $s6, 0xc($sp)
sw $s7, 0x10($sp)
2023-08-17 08:56:02 -04:00
cn_li $t0, RI_MODE_REG
2020-04-03 14:57:26 -04:00
lui $t2, (0xa3f80000 >> 16)
lui $t3, (0xa3f00000 >> 16)
2023-08-17 08:56:02 -04:00
cn_li $t4, MI_MODE_REG
2019-08-25 00:46:40 -04:00
ori $t1, $zero, 64
sw $t1, 4($t0)
2023-08-17 08:56:02 -04:00
li $s1, 8000
2020-04-03 14:57:26 -04:00
.LA400009C:
2019-08-25 00:46:40 -04:00
nop
addi $s1, $s1, -1
2020-04-03 14:57:26 -04:00
bnez $s1, .LA400009C
2019-08-25 00:46:40 -04:00
nop
sw $zero, 8($t0)
ori $t1, $zero, 20
sw $t1, 0xc($t0)
sw $zero, ($t0)
li $s1, 4
2020-04-03 14:57:26 -04:00
.LA40000C0:
2019-08-25 00:46:40 -04:00
nop
addi $s1, $s1, -1
2020-04-03 14:57:26 -04:00
bnez $s1, .LA40000C0
2019-08-25 00:46:40 -04:00
nop
ori $t1, $zero, 14
sw $t1, ($t0)
li $s1, 32
2020-04-03 14:57:26 -04:00
.LA40000DC:
2019-08-25 00:46:40 -04:00
addi $s1, $s1, -1
2020-04-03 14:57:26 -04:00
bnez $s1, .LA40000DC
2019-08-25 00:46:40 -04:00
ori $t1, $zero, 271
sw $t1, ($t4)
2020-04-03 14:57:26 -04:00
lui $t1, (0x18082838 >> 16)
ori $t1, (0x18082838 & 0xFFFF)
2019-08-25 00:46:40 -04:00
sw $t1, 0x8($t2)
sw $zero, 0x14($t2)
lui $t1, 0x8000
sw $t1, 0x4($t2)
move $t5, $zero
move $t6, $zero
2020-04-03 14:57:26 -04:00
lui $t7, (0xA3F00000 >> 16)
2023-08-17 08:56:02 -04:00
move $t8, $zero
2019-08-25 00:46:40 -04:00
lui $t9, (0xA3F00000 >> 16)
lui $s6, (0xA0000000 >> 16)
2023-08-17 08:56:02 -04:00
move $s7, $zero
2019-08-25 00:46:40 -04:00
lui $a2, (0xA3F00000 >> 16)
lui $a3, (0xA0000000 >> 16)
2023-08-17 08:56:02 -04:00
move $s2, $zero
2019-08-25 00:46:40 -04:00
lui $s4, (0xA0000000 >> 16)
addiu $sp, $sp, -0x48
2023-08-17 08:56:02 -04:00
move $fp, $sp
2020-04-03 14:57:26 -04:00
lui $s0, %hi(MI_VERSION_REG)
lw $s0, %lo(MI_VERSION_REG)($s0)
2023-08-17 08:56:02 -04:00
cn_li $s1, 0x01010101
2020-04-03 14:57:26 -04:00
bne $s0, $s1, .LA4000160
2019-08-25 00:46:40 -04:00
nop
li $s0, 512
ori $s1, $t3, 0x4000
2020-04-03 14:57:26 -04:00
b .LA4000168
2019-08-25 00:46:40 -04:00
nop
2020-04-03 14:57:26 -04:00
.LA4000160:
2019-08-25 00:46:40 -04:00
li $s0, 1024
ori $s1, $t3, 0x8000
2020-04-03 14:57:26 -04:00
.LA4000168:
2019-08-25 00:46:40 -04:00
sw $t6, 4($s1)
addiu $s5, $t7, 0xc
2020-04-03 14:57:26 -04:00
jal func_A4000778
2019-08-25 00:46:40 -04:00
nop
2020-04-03 14:57:26 -04:00
beqz $v0, .LA400025C
2019-08-25 00:46:40 -04:00
nop
sw $v0, ($sp)
li $t1, 8192
sw $t1, ($t4)
lw $t3, ($t7)
lui $t0, 0xf0ff
and $t3, $t3, $t0
sw $t3, 4($sp)
addi $sp, $sp, 8
li $t1, 4096
sw $t1, ($t4)
lui $t0, 0xb019
2020-04-03 14:57:26 -04:00
bne $t3, $t0, .LA40001E0
2019-08-25 00:46:40 -04:00
nop
lui $t0, 0x800
add $t8, $t8, $t0
add $t9, $t9, $s0
add $t9, $t9, $s0
lui $t0, 0x20
add $s6, $s6, $t0
add $s4, $s4, $t0
sll $s2, $s2, 1
addi $s2, $s2, 1
2020-04-03 14:57:26 -04:00
b .LA40001E8
2019-08-25 00:46:40 -04:00
nop
2020-04-03 14:57:26 -04:00
.LA40001E0:
2019-08-25 00:46:40 -04:00
lui $t0, 0x10
add $s4, $s4, $t0
2020-04-03 14:57:26 -04:00
.LA40001E8:
2019-08-25 00:46:40 -04:00
li $t0, 8192
sw $t0, ($t4)
lw $t1, 0x24($t7)
lw $k0, ($t7)
li $t0, 4096
sw $t0, ($t4)
andi $t1, $t1, 0xffff
li $t0, 1280
2020-04-03 14:57:26 -04:00
bne $t1, $t0, .LA4000230
2019-08-25 00:46:40 -04:00
nop
lui $k1, 0x100
and $k0, $k0, $k1
2020-04-03 14:57:26 -04:00
bnez $k0, .LA4000230
2019-08-25 00:46:40 -04:00
nop
2020-04-03 14:57:26 -04:00
lui $t0, (0x101C0A04 >> 16)
ori $t0, (0x101C0A04 & 0xFFFF)
2019-08-25 00:46:40 -04:00
sw $t0, 0x18($t7)
2020-04-03 14:57:26 -04:00
b .LA400023C
.LA4000230:
lui $t0, (0x080C1204 >> 16)
ori $t0, (0x080C1204 & 0xFFFF)
2019-08-25 00:46:40 -04:00
sw $t0, 0x18($t7)
2020-04-03 14:57:26 -04:00
.LA400023C:
2019-08-25 00:46:40 -04:00
lui $t0, 0x800
add $t6, $t6, $t0
add $t7, $t7, $s0
add $t7, $t7, $s0
addiu $t5, $t5, 1
sltiu $t0, $t5, 8
2020-04-03 14:57:26 -04:00
bnez $t0, .LA4000168
2019-08-25 00:46:40 -04:00
nop
2020-04-03 14:57:26 -04:00
.LA400025C:
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
li $t0, 0xc0000000
#else
2019-08-25 00:46:40 -04:00
li $t0, 0xc4000000
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
sw $t0, 0xc($t2)
li $t0, 0x80000000
sw $t0, 0x4($t2)
2023-08-17 08:56:02 -04:00
move $sp, $fp
move $v1, $zero
2020-04-03 14:57:26 -04:00
.LA4000274:
2019-08-25 00:46:40 -04:00
lw $t1, 4($sp)
lui $t0, 0xb009
2020-04-03 14:57:26 -04:00
bne $t1, $t0, .LA40002D8
2019-08-25 00:46:40 -04:00
nop
sw $t8, 4($s1)
addiu $s5, $t9, 0xc
lw $a0, ($sp)
addi $sp, $sp, 8
li $a1, 1
2020-04-03 14:57:26 -04:00
jal func_A4000A40
2019-08-25 00:46:40 -04:00
nop
lw $t0, ($s6)
lui $t0, 8
add $t0, $t0, $s6
lw $t1, ($t0)
lw $t0, ($s6)
lui $t0, 8
add $t0, $t0, $s6
lw $t1, ($t0)
lui $t0, 0x400
add $t6, $t6, $t0
add $t9, $t9, $s0
lui $t0, 0x10
add $s6, $s6, $t0
2020-04-03 14:57:26 -04:00
b .LA400035C
.LA40002D8:
2019-08-25 00:46:40 -04:00
sw $s7, 4($s1)
addiu $s5, $a2, 0xc
lw $a0, ($sp)
addi $sp, $sp, 8
li $a1, 1
2020-04-03 14:57:26 -04:00
jal func_A4000A40
2019-08-25 00:46:40 -04:00
nop
lw $t0, ($a3)
lui $t0, 8
add $t0, $t0, $a3
lw $t1, ($t0)
lui $t0, 0x10
add $t0, $t0, $a3
lw $t1, ($t0)
lui $t0, 0x18
add $t0, $t0, $a3
lw $t1, ($t0)
lw $t0, ($a3)
lui $t0, 8
add $t0, $t0, $a3
lw $t1, ($t0)
lui $t0, 0x10
add $t0, $t0, $a3
lw $t1, ($t0)
lui $t0, 0x18
add $t0, $t0, $a3
lw $t1, ($t0)
lui $t0, 0x800
add $s7, $s7, $t0
add $a2, $a2, $s0
add $a2, $a2, $s0
lui $t0, 0x20
add $a3, $a3, $t0
2020-04-03 14:57:26 -04:00
.LA400035C:
2019-08-25 00:46:40 -04:00
addiu $v1, $v1, 1
slt $t0, $v1, $t5
2020-04-03 14:57:26 -04:00
bnez $t0, .LA4000274
2019-08-25 00:46:40 -04:00
nop
2020-04-03 14:57:26 -04:00
lui $t2, %hi(RI_REFRESH_REG)
2019-08-25 00:46:40 -04:00
sll $s2, $s2, 0x13
2020-04-03 14:57:26 -04:00
lui $t1, (0x00063634 >> 16)
ori $t1, (0x00063634 & 0xFFFF)
2019-08-25 00:46:40 -04:00
or $t1, $t1, $s2
2020-04-03 14:57:26 -04:00
sw $t1, %lo(RI_REFRESH_REG)($t2)
lw $t1, %lo(RI_REFRESH_REG)($t2)
lui $t0, (0xA0000300 >> 16)
ori $t0, (0xA0000300 & 0xFFFF)
lui $t1, (0x0FFFFFFF >> 16)
ori $t1, (0x0FFFFFFF & 0xFFFF)
2019-08-25 00:46:40 -04:00
and $s6, $s6, $t1
sw $s6, 0x18($t0)
2023-08-17 08:56:02 -04:00
move $sp, $fp
2019-08-25 00:46:40 -04:00
addiu $sp, $sp, 0x48
lw $s3, ($sp)
lw $s4, 4($sp)
lw $s5, 8($sp)
lw $s6, 0xc($sp)
lw $s7, 0x10($sp)
addiu $sp, $sp, 0x18
2023-08-17 08:56:02 -04:00
cn_li $t0, EXCEPTION_TLB_MISS
2019-08-25 00:46:40 -04:00
addiu $t1, $t0, 0x4000
addiu $t1, $t1, -0x20
mtc0 $zero, $28
mtc0 $zero, $29
2020-04-03 14:57:26 -04:00
.LA40003D8:
2019-08-25 00:46:40 -04:00
cache 8, ($t0)
sltu $at, $t0, $t1
2020-04-03 14:57:26 -04:00
bnez $at, .LA40003D8
2019-08-25 00:46:40 -04:00
addiu $t0, $t0, 0x20
2023-08-17 08:56:02 -04:00
cn_li $t0, EXCEPTION_TLB_MISS
2019-08-25 00:46:40 -04:00
addiu $t1, $t0, 0x2000
addiu $t1, $t1, -0x10
2020-04-03 14:57:26 -04:00
.LA40003F8:
2019-08-25 00:46:40 -04:00
cache 9, ($t0)
sltu $at, $t0, $t1
2020-04-03 14:57:26 -04:00
bnez $at, .LA40003F8
2019-08-25 00:46:40 -04:00
addiu $t0, $t0, 0x10
2020-04-03 14:57:26 -04:00
b .LA4000458
2019-08-25 00:46:40 -04:00
nop
2020-04-03 14:57:26 -04:00
.LA4000410:
2023-08-17 08:56:02 -04:00
cn_li $t0, EXCEPTION_TLB_MISS
2019-08-25 00:46:40 -04:00
addiu $t1, $t0, 0x4000
addiu $t1, $t1, -0x20
mtc0 $zero, $28
mtc0 $zero, $29
2020-04-03 14:57:26 -04:00
.LA4000428:
2019-08-25 00:46:40 -04:00
cache 8, ($t0)
sltu $at, $t0, $t1
2020-04-03 14:57:26 -04:00
bnez $at, .LA4000428
2019-08-25 00:46:40 -04:00
addiu $t0, $t0, 0x20
2023-08-17 08:56:02 -04:00
cn_li $t0, EXCEPTION_TLB_MISS
2019-08-25 00:46:40 -04:00
addiu $t1, $t0, 0x2000
addiu $t1, $t1, -0x10
2020-04-03 14:57:26 -04:00
.LA4000448:
2019-08-25 00:46:40 -04:00
cache 1, ($t0)
sltu $at, $t0, $t1
2020-04-03 14:57:26 -04:00
bnez $at, .LA4000448
2019-08-25 00:46:40 -04:00
addiu $t0, $t0, 0x10
2020-04-03 14:57:26 -04:00
.LA4000458:
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
la $t0, D_CN_0400049C
lui $t1, 0xf
ori $t1, $t1, 0xffff
and $t0, $t0, $t1
lui $t2, 0xa400
lui $t3, 0xfff0
and $t2, $t2, $t3
or $t0, $t0, $t2
la $t3, D_CN_0400074C
and $t3, $t3, $t1
or $t3, $t3, $t2
lui $t1, 0xa000
.LA4000474:
lw $t5, ($t0)
sw $t5, ($t1)
addiu $t0, $t0, 4
addiu $t1, $t1, 4
sltu $at, $t0, $t3
bnez $at, .LA4000474
nop
lui $t4, 0x8000
jr $t4
nop
lui $t3, 0xb000
lui $t2, 0x1fff
ori $t2, $t2, 0xffff
lw $t1, 8($t3)
and $t1, $t1, $t2
lui $at, 0xa460
sw $t1, ($at)
.LA40004B8:
lui $t0, 0xa460
lw $t0, 0x10($t0)
andi $t0, $t0, 2
bnez $t0, .LA40004B8
nop
#else
cn_li $t2, SP_DMEM
2019-08-25 00:46:40 -04:00
lui $t3, 0xfff0
2020-04-03 14:57:26 -04:00
lui $t1, 0x0010
2019-08-25 00:46:40 -04:00
and $t2, $t2, $t3
2020-04-03 14:57:26 -04:00
lui $t0, %hi(SP_DMEM_UNK0)
addiu $t1, -1
lui $t3, %hi(SP_DMEM_UNK1)
addiu $t0, %lo(SP_DMEM_UNK0)
addiu $t3, %lo(SP_DMEM_UNK1)
2019-08-25 00:46:40 -04:00
and $t0, $t0, $t1
and $t3, $t3, $t1
lui $t1, 0xa000
or $t0, $t0, $t2
or $t3, $t3, $t2
addiu $t1, $t1, 0
2020-04-03 14:57:26 -04:00
.LA4000498:
2019-08-25 00:46:40 -04:00
lw $t5, ($t0)
addiu $t0, $t0, 4
sltu $at, $t0, $t3
addiu $t1, $t1, 4
2020-04-03 14:57:26 -04:00
bnez $at, .LA4000498
2019-08-25 00:46:40 -04:00
sw $t5, -4($t1)
2023-08-17 08:56:02 -04:00
cn_li $t4, EXCEPTION_TLB_MISS
2019-08-25 00:46:40 -04:00
jr $t4
nop
2020-04-03 14:57:26 -04:00
lui $t3, %hi(D_B0000008)
2019-08-25 00:46:40 -04:00
lw $t1, %lo(D_B0000008)($t3)
2020-04-03 14:57:26 -04:00
lui $t2, (0x1FFFFFFF >> 16)
ori $t2, (0x1FFFFFFF & 0xFFFF)
lui $at, %hi(PI_DRAM_ADDR_REG)
2019-08-25 00:46:40 -04:00
and $t1, $t1, $t2
2020-04-03 14:57:26 -04:00
sw $t1, %lo(PI_DRAM_ADDR_REG)($at)
lui $t0, %hi(PI_STATUS_REG)
.LA40004D0:
lw $t0, %lo(PI_STATUS_REG)($t0)
2019-08-25 00:46:40 -04:00
andi $t0, $t0, 2
2020-04-03 14:57:26 -04:00
bnezl $t0, .LA40004D0
lui $t0, %hi(PI_STATUS_REG)
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
li $t0, 0x1000
add $t0, $t0, $t3
and $t0, $t0, $t2
2020-04-03 14:57:26 -04:00
lui $at, %hi(PI_CART_ADDR_REG)
sw $t0, %lo(PI_CART_ADDR_REG)($at)
2023-08-17 08:56:02 -04:00
cn_li $t2, 0x000FFFFF
2020-04-03 14:57:26 -04:00
lui $at, %hi(PI_WR_LEN_REG)
sw $t2, %lo(PI_WR_LEN_REG)($at)
2019-08-25 00:46:40 -04:00
2020-04-03 14:57:26 -04:00
.LA4000514:
2019-08-25 00:46:40 -04:00
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
2020-04-03 14:57:26 -04:00
lui $t3, %hi(PI_STATUS_REG)
lw $t3, %lo(PI_STATUS_REG)($t3)
andi $t3, $t3, 0x1
bnez $t3, .LA4000514
2019-08-25 00:46:40 -04:00
nop
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
#endif
#ifdef VERSION_CN
lui $t1, %hi(SP_PC)
lw $t1, %lo(SP_PC)($t1)
beqz $t1, .LA4000698
nop
addiu $t2, $zero, 0x41
lui $at, %hi(SP_STATUS_REG)
sw $t2, %lo(SP_STATUS_REG)($at)
lui $at, %hi(SP_PC)
sw $zero, %lo(SP_PC)($at)
.LA4000698:
li $t3, 0x00AAAAAE
lui $at, %hi(SP_STATUS_REG)
sw $t3, %lo(SP_STATUS_REG)($at)
li $t0, 1365
lui $at, %hi(MI_INTR_MASK_REG)
sw $t0, %lo(MI_INTR_MASK_REG)($at)
lui $at, %hi(SI_STATUS_REG)
sw $zero, %lo(SI_STATUS_REG)($at)
lui $at, %hi(AI_STATUS_REG)
sw $zero, %lo(AI_STATUS_REG)($at)
li $t1, 2048
lui $at, %hi(MI_MODE_REG)
sw $t1, %lo(MI_MODE_REG)($at)
li $t1, 2
lui $at, %hi(PI_STATUS_REG)
sw $t1, %lo(PI_STATUS_REG)($at)
lui $t0, (0xA0000300 >> 16)
ori $t0, (0xA0000300 & 0xFFFF)
sw $s4, ($t0)
sw $s3, 4($t0)
#else
2020-04-03 14:57:26 -04:00
lui $t3, %hi(D_B0000008)
2019-08-25 00:46:40 -04:00
lw $a0, %lo(D_B0000008)($t3)
move $a1, $s6
2020-04-03 14:57:26 -04:00
lui $at, (0x5D588B65 >> 16)
ori $at, (0x5D588B65 & 0xFFFF)
2019-08-25 00:46:40 -04:00
multu $a1, $at
addiu $sp, $sp, -0x20
sw $ra, 0x1c($sp)
sw $s0, 0x14($sp)
lui $ra, 0x10
move $v1, $zero
move $t0, $zero
move $t1, $a0
li $t5, 32
mflo $v0
addiu $v0, $v0, 1
move $a3, $v0
move $t2, $v0
move $t3, $v0
move $s0, $v0
move $a2, $v0
move $t4, $v0
2020-04-03 14:57:26 -04:00
.LA40005F0:
2019-08-25 00:46:40 -04:00
lw $v0, ($t1)
addu $v1, $a3, $v0
sltu $at, $v1, $a3
2020-04-03 14:57:26 -04:00
beqz $at, .LA4000608
2019-08-25 00:46:40 -04:00
move $a1, $v1
addiu $t2, $t2, 1
2020-04-03 14:57:26 -04:00
.LA4000608:
2019-08-25 00:46:40 -04:00
andi $v1, $v0, 0x1f
subu $t7, $t5, $v1
srlv $t8, $v0, $t7
sllv $t6, $v0, $v1
or $a0, $t6, $t8
sltu $at, $a2, $v0
move $a3, $a1
xor $t3, $t3, $v0
2020-04-03 14:57:26 -04:00
beqz $at, .LA400063C
2019-08-25 00:46:40 -04:00
addu $s0, $s0, $a0
xor $t9, $a3, $v0
2020-04-03 14:57:26 -04:00
b .LA4000640
2019-08-25 00:46:40 -04:00
xor $a2, $t9, $a2
2020-04-03 14:57:26 -04:00
.LA400063C:
2019-08-25 00:46:40 -04:00
xor $a2, $a2, $a0
2020-04-03 14:57:26 -04:00
.LA4000640:
2019-08-25 00:46:40 -04:00
addiu $t0, $t0, 4
xor $t7, $v0, $s0
addiu $t1, $t1, 4
2020-04-03 14:57:26 -04:00
bne $t0, $ra, .LA40005F0
2019-08-25 00:46:40 -04:00
addu $t4, $t7, $t4
xor $t6, $a3, $t2
xor $a3, $t6, $t3
xor $t8, $s0, $a2
xor $s0, $t8, $t4
2020-04-03 14:57:26 -04:00
lui $t3, %hi(D_B0000010)
2019-08-25 00:46:40 -04:00
lw $t0, %lo(D_B0000010)($t3)
2020-04-03 14:57:26 -04:00
bne $a3, $t0, halt
2019-08-25 00:46:40 -04:00
nop
lw $t0, %lo(D_B0000014)($t3)
2020-04-03 14:57:26 -04:00
bne $s0, $t0, halt
2019-08-25 00:46:40 -04:00
nop
2020-04-03 14:57:26 -04:00
bal func_A4000690
2019-08-25 00:46:40 -04:00
nop
2020-04-03 14:57:26 -04:00
halt:
bal halt
2019-08-25 00:46:40 -04:00
nop
2020-04-03 14:57:26 -04:00
func_A4000690:
lui $t1, %hi(SP_PC)
lw $t1, %lo(SP_PC)($t1)
2019-08-25 00:46:40 -04:00
lw $s0, 0x14($sp)
lw $ra, 0x1c($sp)
2020-04-03 14:57:26 -04:00
beqz $t1, .LA40006BC
2019-08-25 00:46:40 -04:00
addiu $sp, $sp, 0x20
li $t2, 65
2020-04-03 14:57:26 -04:00
lui $at, %hi(SP_STATUS_REG)
sw $t2, %lo(SP_STATUS_REG)($at)
lui $at, %hi(SP_PC)
sw $zero, %lo(SP_PC)($at)
.LA40006BC:
2023-08-17 08:56:02 -04:00
li $t3, 0x00AAAAAE
2020-04-03 14:57:26 -04:00
lui $at, %hi(SP_STATUS_REG)
sw $t3, %lo(SP_STATUS_REG)($at)
lui $at, %hi(MI_INTR_MASK_REG)
2019-08-25 00:46:40 -04:00
li $t0, 1365
2020-04-03 14:57:26 -04:00
sw $t0, %lo(MI_INTR_MASK_REG)($at)
lui $at, %hi(SI_STATUS_REG)
sw $zero, %lo(SI_STATUS_REG)($at)
lui $at, %hi(AI_STATUS_REG)
sw $zero, %lo(AI_STATUS_REG)($at)
lui $at, %hi(MI_MODE_REG)
2019-08-25 00:46:40 -04:00
li $t1, 2048
2020-04-03 14:57:26 -04:00
sw $t1, %lo(MI_MODE_REG)($at)
2019-08-25 00:46:40 -04:00
li $t1, 2
2020-04-03 14:57:26 -04:00
lui $at, %hi(PI_STATUS_REG)
lui $t0, (0xA0000300 >> 16)
ori $t0, (0xA0000300 & 0xFFFF)
sw $t1, %lo(PI_STATUS_REG)($at)
2019-08-25 00:46:40 -04:00
sw $s7, 0x14($t0)
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
sw $s5, 0xc($t0)
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
beqz $s3, .LA4000728
sw $s7, 0x14($t0)
b .LA4000730
lui $t1, 0xa600
#else
2019-08-25 00:46:40 -04:00
sw $s3, 0x4($t0)
2020-04-03 14:57:26 -04:00
beqz $s3, .LA4000728
2019-08-25 00:46:40 -04:00
sw $s4, ($t0)
lui $t1, 0xa600
2020-04-03 14:57:26 -04:00
b .LA4000730
2019-08-25 00:46:40 -04:00
addiu $t1, $t1, 0
2023-08-17 08:56:02 -04:00
#endif
2020-04-03 14:57:26 -04:00
.LA4000728:
2023-08-17 08:56:02 -04:00
cn_li $t1, 0xb0000000
2020-04-03 14:57:26 -04:00
.LA4000730:
2019-08-25 00:46:40 -04:00
sw $t1, 0x8($t0)
2023-08-17 08:56:02 -04:00
cn_li $t0, SP_DMEM
2019-08-25 00:46:40 -04:00
addi $t1, $t0, 0x1000
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
.LA4000710:
sw $zero, ($t0)
addiu $t0, $t0, 4
bne $t0, $t1, .LA4000710
nop
#else
2020-04-03 14:57:26 -04:00
.LA4000740:
2019-08-25 00:46:40 -04:00
addiu $t0, $t0, 4
2020-04-03 14:57:26 -04:00
bne $t0, $t1, .LA4000740
2019-08-25 00:46:40 -04:00
sw $zero, -4($t0)
2023-08-17 08:56:02 -04:00
#endif
cn_li $t0, SP_IMEM
2019-08-25 00:46:40 -04:00
addi $t1, $t0, 0x1000
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
.LA400072C:
sw $zero, ($t0)
addiu $t0, $t0, 4
bne $t0, $t1, .LA400072C
nop
#else
2020-04-03 14:57:26 -04:00
.LA4000758:
2019-08-25 00:46:40 -04:00
addiu $t0, $t0, 4
2020-04-03 14:57:26 -04:00
bne $t0, $t1, .LA4000758
2019-08-25 00:46:40 -04:00
sw $zero, -4($t0)
2023-08-17 08:56:02 -04:00
#endif
2020-04-03 14:57:26 -04:00
lui $t3, %hi(D_B0000008)
2019-08-25 00:46:40 -04:00
lw $t1, %lo(D_B0000008)($t3)
jr $t1
nop
nop
2020-04-03 14:57:26 -04:00
func_A4000778:
2019-08-25 00:46:40 -04:00
addiu $sp, $sp, -0xa0
2023-08-17 08:56:02 -04:00
#ifndef VERSION_CN
2019-08-25 00:46:40 -04:00
sw $s0, 0x40($sp)
sw $s1, 0x44($sp)
move $s1, $zero
move $s0, $zero
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
sw $v0, ($sp)
sw $v1, 4($sp)
sw $a0, 8($sp)
sw $a1, 0xc($sp)
sw $a2, 0x10($sp)
sw $a3, 0x14($sp)
sw $t0, 0x18($sp)
sw $t1, 0x1c($sp)
sw $t2, 0x20($sp)
sw $t3, 0x24($sp)
sw $t4, 0x28($sp)
sw $t5, 0x2c($sp)
sw $t6, 0x30($sp)
sw $t7, 0x34($sp)
sw $t8, 0x38($sp)
sw $t9, 0x3c($sp)
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
sw $s0, 0x40($sp)
sw $s1, 0x44($sp)
#endif
2019-08-25 00:46:40 -04:00
sw $s2, 0x48($sp)
sw $s3, 0x4c($sp)
sw $s4, 0x50($sp)
sw $s5, 0x54($sp)
sw $s6, 0x58($sp)
sw $s7, 0x5c($sp)
sw $fp, 0x60($sp)
sw $ra, 0x64($sp)
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
move $s0, $zero
move $s1, $zero
#endif
2020-04-03 14:57:26 -04:00
.LA40007EC:
jal func_A4000880
2019-08-25 00:46:40 -04:00
nop
addiu $s0, $s0, 1
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
addu $s1, $s1, $v0
#endif
2019-08-25 00:46:40 -04:00
slti $t1, $s0, 4
2020-04-03 14:57:26 -04:00
bnez $t1, .LA40007EC
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
nop
#else
2019-08-25 00:46:40 -04:00
addu $s1, $s1, $v0
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
srl $a0, $s1, 2
2020-04-03 14:57:26 -04:00
jal func_A4000A40
2019-08-25 00:46:40 -04:00
li $a1, 1
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
srl $v0, $s1, 2
#else
2019-08-25 00:46:40 -04:00
lw $ra, 0x64($sp)
srl $v0, $s1, 2
lw $s1, 0x44($sp)
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
lw $v1, 4($sp)
lw $a0, 8($sp)
lw $a1, 0xc($sp)
lw $a2, 0x10($sp)
lw $a3, 0x14($sp)
lw $t0, 0x18($sp)
lw $t1, 0x1c($sp)
lw $t2, 0x20($sp)
lw $t3, 0x24($sp)
lw $t4, 0x28($sp)
lw $t5, 0x2c($sp)
lw $t6, 0x30($sp)
lw $t7, 0x34($sp)
lw $t8, 0x38($sp)
lw $t9, 0x3c($sp)
lw $s0, 0x40($sp)
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
lw $s1, 0x44($sp)
#endif
2019-08-25 00:46:40 -04:00
lw $s2, 0x48($sp)
lw $s3, 0x4c($sp)
lw $s4, 0x50($sp)
lw $s5, 0x54($sp)
lw $s6, 0x58($sp)
lw $s7, 0x5c($sp)
lw $fp, 0x60($sp)
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
lw $ra, 0x64($sp)
#endif
2019-08-25 00:46:40 -04:00
jr $ra
addiu $sp, $sp, 0xa0
2020-04-03 14:57:26 -04:00
func_A4000880:
2019-08-25 00:46:40 -04:00
addiu $sp, $sp, -0x20
sw $ra, 0x1c($sp)
move $t1, $zero
move $t3, $zero
move $t4, $zero
2020-04-03 14:57:26 -04:00
.LA4000894:
2019-08-25 00:46:40 -04:00
slti $k0, $t4, 0x40
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
beqz $k0, .LA40008D4
nop
#else
2020-04-03 14:57:26 -04:00
beql $k0, $zero, .LA40008FC
2019-08-25 00:46:40 -04:00
move $v0, $zero
2023-08-17 08:56:02 -04:00
#endif
2020-04-03 14:57:26 -04:00
jal func_A400090C
2019-08-25 00:46:40 -04:00
move $a0, $t4
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
blez $v0, .LA40008CC
nop
#else
2020-04-03 14:57:26 -04:00
blezl $v0, .LA40008CC
2019-08-25 00:46:40 -04:00
slti $k0, $t1, 0x50
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
subu $k0, $v0, $t1
multu $k0, $t4
2023-08-17 08:56:02 -04:00
#ifndef VERSION_CN
2019-08-25 00:46:40 -04:00
move $t1, $v0
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
mflo $k0
addu $t3, $t3, $k0
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
move $t1, $v0
#else
2019-08-25 00:46:40 -04:00
nop
slti $k0, $t1, 0x50
2023-08-17 08:56:02 -04:00
#endif
2020-04-03 14:57:26 -04:00
.LA40008CC:
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
addiu $t4, $t4, 1
slti $k0, $t1, 0x50
#endif
2020-04-03 14:57:26 -04:00
bnez $k0, .LA4000894
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
nop
#else
2019-08-25 00:46:40 -04:00
addiu $t4, $t4, 1
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
sll $a0, $t3, 2
subu $a0, $a0, $t3
sll $a0, $a0, 2
subu $a0, $a0, $t3
sll $a0, $a0, 1
2020-04-03 14:57:26 -04:00
jal func_A4000980
addiu $a0, $a0, -0x370
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
b .LA40008FC
nop
.LA40008D4:
move $v0, $zero
#else
2020-04-03 14:57:26 -04:00
b .LA4000900
2019-08-25 00:46:40 -04:00
lw $ra, 0x1c($sp)
move $v0, $zero
2023-08-17 08:56:02 -04:00
#endif
2020-04-03 14:57:26 -04:00
.LA40008FC:
2019-08-25 00:46:40 -04:00
lw $ra, 0x1c($sp)
2020-04-03 14:57:26 -04:00
.LA4000900:
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
jr $ra
addiu $sp, $sp, 0x20
#else
2019-08-25 00:46:40 -04:00
addiu $sp, $sp, 0x20
jr $ra
nop
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
2020-04-03 14:57:26 -04:00
func_A400090C:
2019-08-25 00:46:40 -04:00
addiu $sp, $sp, -0x28
sw $ra, 0x1c($sp)
move $v0, $zero
2020-04-03 14:57:26 -04:00
jal func_A4000A40
2019-08-25 00:46:40 -04:00
li $a1, 2
move $fp, $zero
2023-08-17 08:56:02 -04:00
.LA40008FC_cn:
2019-08-25 00:46:40 -04:00
li $k0, -1
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
sw $k0, ($s4)
sw $k0, ($s4)
sw $k0, 4($s4)
lw $v1, 4($s4)
srl $v1, $v1, 0x10
move $gp, $zero
#else
2020-04-03 14:57:26 -04:00
.LA4000928:
2019-08-25 00:46:40 -04:00
sw $k0, 4($s4)
lw $v1, 4($s4)
sw $k0, ($s4)
sw $k0, ($s4)
move $gp, $zero
srl $v1, $v1, 0x10
2023-08-17 08:56:02 -04:00
#endif
2020-04-03 14:57:26 -04:00
.LA4000940:
2019-08-25 00:46:40 -04:00
andi $k0, $v1, 1
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
beqz $k0, .LA4000928_cn
nop
#else
2020-04-03 14:57:26 -04:00
beql $k0, $zero, .LA4000954
2019-08-25 00:46:40 -04:00
addiu $gp, $gp, 1
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
addiu $v0, $v0, 1
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
.LA4000928_cn:
srl $v1, $v1, 1
#endif
2019-08-25 00:46:40 -04:00
addiu $gp, $gp, 1
2020-04-03 14:57:26 -04:00
.LA4000954:
2019-08-25 00:46:40 -04:00
slti $k0, $gp, 8
2020-04-03 14:57:26 -04:00
bnez $k0, .LA4000940
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
nop
#else
2019-08-25 00:46:40 -04:00
srl $v1, $v1, 1
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
addiu $fp, $fp, 1
slti $k0, $fp, 0xa
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
bnez $k0, .LA40008FC_cn
nop
lw $ra, 0x1c($sp)
jr $ra
addiu $sp, $sp, 0x28
#else
2020-04-03 14:57:26 -04:00
bnezl $k0, .LA4000928
2019-08-25 00:46:40 -04:00
li $k0, -1
lw $ra, 0x1c($sp)
addiu $sp, $sp, 0x28
jr $ra
nop
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
2020-04-03 14:57:26 -04:00
func_A4000980:
2019-08-25 00:46:40 -04:00
addiu $sp, $sp, -0x28
sw $ra, 0x1c($sp)
sw $a0, 0x20($sp)
2023-08-17 08:56:02 -04:00
#ifndef VERSION_CN
2019-08-25 00:46:40 -04:00
sb $zero, 0x27($sp)
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
move $t0, $zero
move $t2, $zero
li $t5, 51200
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
sb $zero, 0x27($sp)
#endif
2019-08-25 00:46:40 -04:00
move $t6, $zero
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
.LA4000978:
#endif
2019-08-25 00:46:40 -04:00
slti $k0, $t6, 0x40
2020-04-03 14:57:26 -04:00
.LA40009A4:
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
bnez $k0, .LA400098C_cn
nop
#else
2020-04-03 14:57:26 -04:00
bnezl $k0, .LA40009B8
2019-08-25 00:46:40 -04:00
move $a0, $t6
2023-08-17 08:56:02 -04:00
#endif
2020-04-03 14:57:26 -04:00
b .LA4000A30
2023-08-17 08:56:02 -04:00
move $v0, $zero
#ifdef VERSION_CN
.LA400098C_cn:
#endif
move $a0, $t6
#ifndef VERSION_CN
2020-04-03 14:57:26 -04:00
.LA40009B8:
2023-08-17 08:56:02 -04:00
#endif
2020-04-03 14:57:26 -04:00
jal func_A4000A40
2019-08-25 00:46:40 -04:00
li $a1, 1
2020-04-03 14:57:26 -04:00
jal func_A4000AD0
2019-08-25 00:46:40 -04:00
addiu $a0, $sp, 0x27
2020-04-03 14:57:26 -04:00
jal func_A4000AD0
2019-08-25 00:46:40 -04:00
addiu $a0, $sp, 0x27
lbu $k0, 0x27($sp)
li $k1, 800
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
multu $k0, $k1
mflo $t0
lw $a0, 0x20($sp)
subu $k0, $t0, $a0
bgez $k0, .LA40009CC
nop
subu $k0, $a0, $t0
.LA40009CC:
slt $k1, $k0, $t5
beqz $k1, .LA40009E0
nop
move $t5, $k0
move $t2, $t6
.LA40009E0:
lw $a0, 0x20($sp)
slt $k1, $t0, $a0
beqz $k1, .LA4000A00
nop
addiu $t6, $t6, 1
slti $k1, $t6, 0x41
bnez $k1, .LA4000978
nop
.LA4000A00:
addu $v0, $t2, $t6
srl $v0, $v0, 1
.LA4000A30:
lw $ra, 0x1c($sp)
jr $ra
addiu $sp, $sp, 0x28
#else
2019-08-25 00:46:40 -04:00
lw $a0, 0x20($sp)
multu $k0, $k1
mflo $t0
subu $k0, $t0, $a0
2020-04-03 14:57:26 -04:00
bgezl $k0, .LA40009F8
2019-08-25 00:46:40 -04:00
slt $k1, $k0, $t5
subu $k0, $a0, $t0
slt $k1, $k0, $t5
2020-04-03 14:57:26 -04:00
.LA40009F8:
beql $k1, $zero, .LA4000A0C
2019-08-25 00:46:40 -04:00
lw $a0, 0x20($sp)
move $t5, $k0
move $t2, $t6
lw $a0, 0x20($sp)
2020-04-03 14:57:26 -04:00
.LA4000A0C:
2019-08-25 00:46:40 -04:00
slt $k1, $t0, $a0
2020-04-03 14:57:26 -04:00
beql $k1, $zero, .LA4000A2C
2019-08-25 00:46:40 -04:00
addu $v0, $t2, $t6
addiu $t6, $t6, 1
slti $k1, $t6, 0x41
2020-04-03 14:57:26 -04:00
bnezl $k1, .LA40009A4
2019-08-25 00:46:40 -04:00
slti $k0, $t6, 0x40
addu $v0, $t2, $t6
2020-04-03 14:57:26 -04:00
.LA4000A2C:
2019-08-25 00:46:40 -04:00
srl $v0, $v0, 1
2020-04-03 14:57:26 -04:00
.LA4000A30:
2019-08-25 00:46:40 -04:00
lw $ra, 0x1c($sp)
addiu $sp, $sp, 0x28
jr $ra
nop
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
2020-04-03 14:57:26 -04:00
func_A4000A40:
2019-08-25 00:46:40 -04:00
addiu $sp, $sp, -0x28
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
sw $ra, 0x1c($sp)
lui $t7, 0x4200
andi $a0, $a0, 0xff
xori $a0, $a0, 0x3f
li $k1, 1
bne $a1, $k1, .LA4000A64
nop
#else
2019-08-25 00:46:40 -04:00
andi $a0, $a0, 0xff
li $k1, 1
xori $a0, $a0, 0x3f
sw $ra, 0x1c($sp)
2020-04-03 14:57:26 -04:00
bne $a1, $k1, .LA4000A64
2019-08-25 00:46:40 -04:00
lui $t7, 0x4600
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
lui $k0, 0x8000
or $t7, $t7, $k0
2020-04-03 14:57:26 -04:00
.LA4000A64:
2019-08-25 00:46:40 -04:00
andi $k0, $a0, 1
sll $k0, $k0, 6
or $t7, $t7, $k0
andi $k0, $a0, 2
sll $k0, $k0, 0xd
or $t7, $t7, $k0
andi $k0, $a0, 4
sll $k0, $k0, 0x14
or $t7, $t7, $k0
andi $k0, $a0, 8
sll $k0, $k0, 4
or $t7, $t7, $k0
andi $k0, $a0, 0x10
sll $k0, $k0, 0xb
or $t7, $t7, $k0
andi $k0, $a0, 0x20
sll $k0, $k0, 0x12
or $t7, $t7, $k0
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
sw $t7, ($s5)
li $k1, 1
bne $a1, $k1, .LA4000AC0
nop
#else
2019-08-25 00:46:40 -04:00
li $k1, 1
2020-04-03 14:57:26 -04:00
bne $a1, $k1, .LA4000AC0
2019-08-25 00:46:40 -04:00
sw $t7, ($s5)
2023-08-17 08:56:02 -04:00
#endif
2020-04-03 14:57:26 -04:00
lui $k0, %hi(MI_MODE_REG)
sw $zero, %lo(MI_MODE_REG)($k0)
.LA4000AC0:
2019-08-25 00:46:40 -04:00
lw $ra, 0x1c($sp)
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
jr $ra
addiu $sp, $sp, 0x28
#else
2019-08-25 00:46:40 -04:00
addiu $sp, $sp, 0x28
jr $ra
nop
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
2020-04-03 14:57:26 -04:00
func_A4000AD0:
2019-08-25 00:46:40 -04:00
addiu $sp, $sp, -0x28
sw $ra, 0x1c($sp)
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
move $fp, $zero
#endif
2019-08-25 00:46:40 -04:00
li $k0, 0x2000
2020-04-03 14:57:26 -04:00
lui $k1, %hi(MI_MODE_REG)
sw $k0, %lo(MI_MODE_REG)($k1)
2023-08-17 08:56:02 -04:00
#ifndef VERSION_CN
2019-08-25 00:46:40 -04:00
move $fp, $zero
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
lw $fp, ($s5)
li $k0, 0x1000
2020-04-03 14:57:26 -04:00
sw $k0, %lo(MI_MODE_REG)($k1)
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
move $k0, $zero
#endif
2019-08-25 00:46:40 -04:00
li $k1, 0x40
and $k1, $k1, $fp
srl $k1, $k1, 6
2023-08-17 08:56:02 -04:00
#ifndef VERSION_CN
2019-08-25 00:46:40 -04:00
move $k0, $zero
2023-08-17 08:56:02 -04:00
#endif
2019-08-25 00:46:40 -04:00
or $k0, $k0, $k1
li $k1, 0x4000
and $k1, $k1, $fp
srl $k1, $k1, 0xd
or $k0, $k0, $k1
li $k1, 0x400000
and $k1, $k1, $fp
srl $k1, $k1, 0x14
or $k0, $k0, $k1
li $k1, 0x80
and $k1, $k1, $fp
srl $k1, $k1, 4
or $k0, $k0, $k1
li $k1, 0x8000
and $k1, $k1, $fp
srl $k1, $k1, 0xb
or $k0, $k0, $k1
li $k1, 0x800000
and $k1, $k1, $fp
srl $k1, $k1, 0x12
or $k0, $k0, $k1
sb $k0, ($a0)
lw $ra, 0x1c($sp)
2023-08-17 08:56:02 -04:00
#ifdef VERSION_CN
jr $ra
addiu $sp, $sp, 0x28
.fill 0x30
#else
2019-08-25 00:46:40 -04:00
addiu $sp, $sp, 0x28
jr $ra
nop
nop
2023-08-17 08:56:02 -04:00
#endif