nuke some leftover MIPS assembly and binary blobs

This commit is contained in:
fgsfds 2020-06-04 23:42:19 +03:00
parent bd68d6cb67
commit 3954f7d1d3
57 changed files with 0 additions and 2424 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,18 +0,0 @@
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel __osDisableInt
mfc0 $t0, $12
and $t1, $t0, -2
mtc0 $t1, $12
andi $v0, $t0, 1
nop
jr $ra
nop

File diff suppressed because it is too large Load diff

View file

@ -1,15 +0,0 @@
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel __osGetCause
mfc0 $v0, $13
jr $ra
nop
nop

View file

@ -1,15 +0,0 @@
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel __osGetSR
mfc0 $v0, $12
jr $ra
nop
nop

View file

@ -1,64 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel __osProbeTLB
mfc0 $t0, $10
andi $t1, $t0, 0xff
li $at, -8192
and $t2, $a0, $at
or $t1, $t1, $t2
mtc0 $t1, $10
nop
nop
nop
tlbp
nop
nop
mfc0 $t3, $0
lui $at, 0x8000
and $t3, $t3, $at
bnez $t3, .L8032A0D8
nop
tlbr
nop
nop
nop
mfc0 $t3, $5
addi $t3, $t3, 0x2000
srl $t3, $t3, 1
and $t4, $t3, $a0
bnez $t4, .L8032A0A8
addi $t3, $t3, -1
mfc0 $v0, $2
b .L8032A0AC
nop
.L8032A0A8:
mfc0 $v0, $3
.L8032A0AC:
andi $t5, $v0, 2
beqz $t5, .L8032A0D8
nop
lui $at, (0x3FFFFFC0 >> 16) # lui $at, 0x3fff
ori $at, (0x3FFFFFC0 & 0xFFFF) # ori $at, $at, 0xffc0
and $v0, $v0, $at
sll $v0, $v0, 6
and $t5, $a0, $t3
add $v0, $v0, $t5
b .L8032A0DC
nop
.L8032A0D8:
li $v0, -1
.L8032A0DC:
mtc0 $t0, $10
jr $ra
nop
nop
nop

View file

@ -1,19 +0,0 @@
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel __osRestoreInt
mfc0 $t0, $12
or $t0, $t0, $a0
mtc0 $t0, $12
nop
nop
jr $ra
nop
nop

View file

@ -1,15 +0,0 @@
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel __osSetCompare
mtc0 $a0, $11
jr $ra
nop
nop

View file

@ -1,14 +0,0 @@
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel __osSetFpcCsr
cfc1 $v0, $31
ctc1 $a0, $31
jr $ra
nop

View file

@ -1,14 +0,0 @@
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel __osSetSR
mtc0 $a0, $12
nop
jr $ra
nop

View file

@ -1,22 +0,0 @@
.set noreorder # don't insert nops after branches
.set gp=64
.set noat
.include "macros.inc"
.section .text, "ax"
# cache related
glabel __os_eu_802ef550
lui $t0,0x8000
li $t2,0x2000
addu $t1,$t0,$t2
addiu $t1,$t1,-0x10
.L: cache 0x1,0($t0)
sltu $at,$t0,$t1
bnez $at,.L
addiu $t0,$t0,0x10
jr $ra
nop
nop
nop

View file

@ -1,232 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel bcopy
beqz $a2, .L80323A4C
move $a3, $a1
beq $a0, $a1, .L80323A4C
slt $at, $a1, $a0
bnezl $at, .L80323A14
slti $at, $a2, 0x10
add $v0, $a0, $a2
slt $at, $a1, $v0
beql $at, $zero, .L80323A14
slti $at, $a2, 0x10
b .L80323B78
slti $at, $a2, 0x10
slti $at, $a2, 0x10
.L80323A14:
bnez $at, .L80323A2C
nop
andi $v0, $a0, 3
andi $v1, $a1, 3
beq $v0, $v1, .L80323A54
nop
.L80323A2C:
beqz $a2, .L80323A4C
nop
addu $v1, $a0, $a2
.L80323A38:
lb $v0, ($a0)
addiu $a0, $a0, 1
addiu $a1, $a1, 1
bne $a0, $v1, .L80323A38
sb $v0, -1($a1)
.L80323A4C:
jr $ra
move $v0, $a3
.L80323A54:
beqz $v0, .L80323AB8
li $at, 1
beq $v0, $at, .L80323A9C
li $at, 2
beql $v0, $at, .L80323A88
lh $v0, ($a0)
lb $v0, ($a0)
addiu $a0, $a0, 1
addiu $a1, $a1, 1
addiu $a2, $a2, -1
b .L80323AB8
sb $v0, -1($a1)
lh $v0, ($a0)
.L80323A88:
addiu $a0, $a0, 2
addiu $a1, $a1, 2
addiu $a2, $a2, -2
b .L80323AB8
sh $v0, -2($a1)
.L80323A9C:
lb $v0, ($a0)
lh $v1, 1($a0)
addiu $a0, $a0, 3
addiu $a1, $a1, 3
addiu $a2, $a2, -3
sb $v0, -3($a1)
sh $v1, -2($a1)
.L80323AB8:
slti $at, $a2, 0x20
bnezl $at, .L80323B18
slti $at, $a2, 0x10
lw $v0, ($a0)
lw $v1, 4($a0)
lw $t0, 8($a0)
lw $t1, 0xc($a0)
lw $t2, 0x10($a0)
lw $t3, 0x14($a0)
lw $t4, 0x18($a0)
lw $t5, 0x1c($a0)
addiu $a0, $a0, 0x20
addiu $a1, $a1, 0x20
addiu $a2, $a2, -0x20
sw $v0, -0x20($a1)
sw $v1, -0x1c($a1)
sw $t0, -0x18($a1)
sw $t1, -0x14($a1)
sw $t2, -0x10($a1)
sw $t3, -0xc($a1)
sw $t4, -8($a1)
b .L80323AB8
sw $t5, -4($a1)
.L80323B14:
slti $at, $a2, 0x10
.L80323B18:
bnezl $at, .L80323B54
slti $at, $a2, 4
lw $v0, ($a0)
lw $v1, 4($a0)
lw $t0, 8($a0)
lw $t1, 0xc($a0)
addiu $a0, $a0, 0x10
addiu $a1, $a1, 0x10
addiu $a2, $a2, -0x10
sw $v0, -0x10($a1)
sw $v1, -0xc($a1)
sw $t0, -8($a1)
b .L80323B14
sw $t1, -4($a1)
.L80323B50:
slti $at, $a2, 4
.L80323B54:
bnez $at, .L80323A2C
nop
lw $v0, ($a0)
addiu $a0, $a0, 4
addiu $a1, $a1, 4
addiu $a2, $a2, -4
b .L80323B50
sw $v0, -4($a1)
slti $at, $a2, 0x10
.L80323B78:
add $a0, $a0, $a2
bnez $at, .L80323B94
add $a1, $a1, $a2
andi $v0, $a0, 3
andi $v1, $a1, 3
beq $v0, $v1, .L80323BC4
nop
.L80323B94:
beqz $a2, .L80323A4C
nop
addiu $a0, $a0, -1
addiu $a1, $a1, -1
subu $v1, $a0, $a2
.L80323BA8:
lb $v0, ($a0)
addiu $a0, $a0, -1
addiu $a1, $a1, -1
bne $a0, $v1, .L80323BA8
sb $v0, 1($a1)
jr $ra
move $v0, $a3
.L80323BC4:
beqz $v0, .L80323C28
li $at, 3
beq $v0, $at, .L80323C0C
li $at, 2
beql $v0, $at, .L80323BF8
lh $v0, -2($a0)
lb $v0, -1($a0)
addiu $a0, $a0, -1
addiu $a1, $a1, -1
addiu $a2, $a2, -1
b .L80323C28
sb $v0, ($a1)
lh $v0, -2($a0)
.L80323BF8:
addiu $a0, $a0, -2
addiu $a1, $a1, -2
addiu $a2, $a2, -2
b .L80323C28
sh $v0, ($a1)
.L80323C0C:
lb $v0, -1($a0)
lh $v1, -3($a0)
addiu $a0, $a0, -3
addiu $a1, $a1, -3
addiu $a2, $a2, -3
sb $v0, 2($a1)
sh $v1, ($a1)
.L80323C28:
slti $at, $a2, 0x20
bnezl $at, .L80323C88
slti $at, $a2, 0x10
lw $v0, -4($a0)
lw $v1, -8($a0)
lw $t0, -0xc($a0)
lw $t1, -0x10($a0)
lw $t2, -0x14($a0)
lw $t3, -0x18($a0)
lw $t4, -0x1c($a0)
lw $t5, -0x20($a0)
addiu $a0, $a0, -0x20
addiu $a1, $a1, -0x20
addiu $a2, $a2, -0x20
sw $v0, 0x1c($a1)
sw $v1, 0x18($a1)
sw $t0, 0x14($a1)
sw $t1, 0x10($a1)
sw $t2, 0xc($a1)
sw $t3, 8($a1)
sw $t4, 4($a1)
b .L80323C28
sw $t5, ($a1)
.L80323C84:
slti $at, $a2, 0x10
.L80323C88:
bnezl $at, .L80323CC4
slti $at, $a2, 4
lw $v0, -4($a0)
lw $v1, -8($a0)
lw $t0, -0xc($a0)
lw $t1, -0x10($a0)
addiu $a0, $a0, -0x10
addiu $a1, $a1, -0x10
addiu $a2, $a2, -0x10
sw $v0, 0xc($a1)
sw $v1, 8($a1)
sw $t0, 4($a1)
b .L80323C84
sw $t1, ($a1)
.L80323CC0:
slti $at, $a2, 4
.L80323CC4:
bnez $at, .L80323B94
nop
lw $v0, -4($a0)
addiu $a0, $a0, -4
addiu $a1, $a1, -4
addiu $a2, $a2, -4
b .L80323CC0
sw $v0, ($a1)
nop
nop
nop

View file

@ -1,53 +0,0 @@
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
#this file is probably handwritten
.section .text, "ax"
glabel bzero
blt $a1, 0xc, .L803236BC
negu $v1, $a0
andi $v1, $v1, 3
beqz $v1, .L80323660
subu $a1, $a1, $v1
swl $zero, ($a0)
addu $a0, $a0, $v1
.L80323660:
and $a3, $a1, -32
beqz $a3, .L8032369C
subu $a1, $a1, $a3
addu $a3, $a3, $a0
.L80323674:
addiu $a0, $a0, 0x20
sw $zero, -0x20($a0)
sw $zero, -0x1c($a0)
sw $zero, -0x18($a0)
sw $zero, -0x14($a0)
sw $zero, -0x10($a0)
sw $zero, -0xc($a0)
sw $zero, -8($a0)
bne $a0, $a3, .L80323674
sw $zero, -4($a0)
.L8032369C:
and $a3, $a1, -4
beqz $a3, .L803236BC
subu $a1, $a1, $a3
addu $a3, $a3, $a0
.L803236B0:
addiu $a0, $a0, 4
bne $a0, $a3, .L803236B0
sw $zero, -4($a0)
.L803236BC:
blez $a1, .L803236D4
nop
addu $a1, $a1, $a0
.L803236C8:
addiu $a0, $a0, 1
bne $a0, $a1, .L803236C8
sb $zero, -1($a0)
.L803236D4:
jr $ra

View file

@ -1,100 +0,0 @@
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
/* -------------------------------------------------------------------------------------- */
/* need to asm these functions because lib32gcc-7-dev-mips-cross does not exist so we */
/* cannot naturally link a libgcc variant for this target given this architecture and */
/* compiler. Until we have a good workaround with a gcc target that doesn't involve */
/* assuming a 32-bit to 64-bit change, we have to encode these functions as raw assembly */
/* for it to compile. */
/* -------------------------------------------------------------------------------------- */
/* TODO: Is there a non-insane way to fix this hack that doesn't involve the user compiling */
/* a library themselves? */
glabel __umoddi3
sw $a0, ($sp)
sw $a1, 4($sp)
sw $a2, 8($sp)
sw $a3, 0xc($sp)
ld $t7, 8($sp)
ld $t6, ($sp)
ddivu $zero, $t6, $t7
bnez $t7, .L80324144
nop
break 7
.L80324144:
mfhi $v0
dsll32 $v1, $v0, 0
dsra32 $v1, $v1, 0
jr $ra
dsra32 $v0, $v0, 0
glabel __udivdi3
sw $a0, ($sp)
sw $a1, 4($sp)
sw $a2, 8($sp)
sw $a3, 0xc($sp)
ld $t7, 8($sp)
ld $t6, ($sp)
ddivu $zero, $t6, $t7
bnez $t7, .L80324180
nop
break 7
.L80324180:
mflo $v0
dsll32 $v1, $v0, 0
dsra32 $v1, $v1, 0
jr $ra
dsra32 $v0, $v0, 0
glabel __moddi3
sw $a0, ($sp)
sw $a1, 4($sp)
sw $a2, 8($sp)
sw $a3, 0xc($sp)
ld $t7, 8($sp)
ld $t6, ($sp)
ddivu $zero, $t6, $t7
bnez $t7, .L803241E8
nop
break 7
.L803241E8:
mfhi $v0
dsll32 $v1, $v0, 0
dsra32 $v1, $v1, 0
jr $ra
dsra32 $v0, $v0, 0
glabel __divdi3
sw $a0, ($sp)
sw $a1, 4($sp)
sw $a2, 8($sp)
sw $a3, 0xc($sp)
ld $t7, 8($sp)
ld $t6, ($sp)
ddiv $zero, $t6, $t7
nop
bnez $t7, .L80324228
nop
break 7
.L80324228:
daddiu $at, $zero, -1
bne $t7, $at, .L80324244
daddiu $at, $zero, 1
dsll32 $at, $at, 0x1f
bne $t6, $at, .L80324244
nop
break 6
.L80324244:
mflo $v0
dsll32 $v1, $v0, 0
dsra32 $v1, $v1, 0
jr $ra
dsra32 $v0, $v0, 0

View file

@ -1,15 +0,0 @@
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel osGetCount
mfc0 $v0, $9
jr $ra
nop
nop

View file

@ -1,59 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel osInvalDCache
blez $a1, .L80323500
nop
li $t3, 8192
sltu $at, $a1, $t3
beqz $at, .L80323508
nop
move $t0, $a0
addu $t1, $a0, $a1
sltu $at, $t0, $t1
beqz $at, .L80323500
nop
andi $t2, $t0, 0xf
beqz $t2, .L803234D0
addiu $t1, $t1, -0x10
subu $t0, $t0, $t2
cache 0x15, ($t0)
sltu $at, $t0, $t1
beqz $at, .L80323500
nop
addiu $t0, $t0, 0x10
.L803234D0:
andi $t2, $t1, 0xf
beqz $t2, .L803234F0
nop
subu $t1, $t1, $t2
cache 0x15, 0x10($t1)
sltu $at, $t1, $t0
bnez $at, .L80323500
nop
.L803234F0:
cache 0x11, ($t0)
sltu $at, $t0, $t1
bnez $at, .L803234F0
addiu $t0, $t0, 0x10
.L80323500:
jr $ra
nop
.L80323508:
li $t0, K0BASE
addu $t1, $t0, $t3
addiu $t1, $t1, -0x10
.L80323514:
cache 1, ($t0)
sltu $at, $t0, $t1
bnez $at, .L80323514
addiu $t0, $t0, 0x10
jr $ra
nop

View file

@ -1,44 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel osInvalICache
blez $a1, .L80323728
nop
li $t3, 16384
sltu $at, $a1, $t3
beqz $at, .L80323730
nop
move $t0, $a0
addu $t1, $a0, $a1
sltu $at, $t0, $t1
beqz $at, .L80323728
nop
andi $t2, $t0, 0x1f
addiu $t1, $t1, -0x20
subu $t0, $t0, $t2
.L80323718:
cache 0x10, ($t0)
sltu $at, $t0, $t1
bnez $at, .L80323718
addiu $t0, $t0, 0x20
.L80323728:
jr $ra
nop
.L80323730:
li $t0, K0BASE
addu $t1, $t0, $t3
addiu $t1, $t1, -0x20
.L8032373C:
cache 0, ($t0)
sltu $at, $t0, $t1
bnez $at, .L8032373C
addiu $t0, $t0, 0x20
jr $ra
nop

View file

@ -1,63 +0,0 @@
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
# This file is handwritten
#void osMapTLB(s32 index, OSPageMask pm, void *vaddr, u32 evenpaddr, u32 oddpaddr, s32 asid);
glabel osMapTLB
mfc0 $t0, $10
mtc0 $a0, $0
mtc0 $a1, $5
lw $t1, 0x14($sp) #asid
beq $t1, -1, .L803214D8
li $t4, 1
li $t2, 30
b .L803214DC
or $a2, $a2, $t1 #vaddr
.L803214D8:
li $t2, 31
.L803214DC:
mtc0 $a2, $10 #vaddr
beq $a3, -1, .L80321500 #even paddr
nop
srl $t3, $a3, 6 #evenpaddr
or $t3, $t3, $t2
mtc0 $t3, $2
b .L80321504
nop
.L80321500:
mtc0 $t4, $2
.L80321504:
lw $t3, 0x10($sp) #oddpaddr
beq $t3, -1, .L80321528
nop
srl $t3, $t3, 6
or $t3, $t3, $t2
mtc0 $t3, $3
b .L80321540
nop
.L80321528:
mtc0 $t4, $3
bne $a3, -1, .L80321540 #evenpaddr
nop
lui $t3, 0x8000
mtc0 $t3, $10
.L80321540:
nop
tlbwi
nop
nop
nop
nop
mtc0 $t0, $10
jr $ra
nop #file gets padded but
nop
nop
nop

View file

@ -1,36 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel osMapTLBRdb
mfc0 $t0, $10
li $t1, 31
mtc0 $t1, $0
mtc0 $zero, $5
li $t2, 23
lui $t1, 0xc000
mtc0 $t1, $10
lui $t1, 0x8000
srl $t3, $t1, 6
or $t3, $t3, $t2
mtc0 $t3, $2
li $t1, 1
mtc0 $t1, $3
nop
tlbwi
nop
nop
nop
nop
mtc0 $t0, $10
jr $ra
nop
nop
nop

View file

@ -1,138 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.eqv MI_INTR_MASK_REG, 0xA430000C
.section .text, "ax"
glabel osSetIntMask
.ifndef VERSION_EU
mfc0 $t1, $12
andi $v0, $t1, 0xff01
.else
mfc0 $t4, $12
andi $v0, $t4, 0xff01
lui $t0, %hi(D_8030208C) # $t0, 0x8030
addiu $t0, %lo(D_8030208C) # addiu $t0, $t0, 0x208c
lw $t3, ($t0)
li $at, -1
xor $t0, $t3, $at
andi $t0, $t0, 0xff00
or $v0, $v0, $t0
.endif
lui $t2, %hi(MI_INTR_MASK_REG) # $t2, 0xa430
lw $t2, %lo(MI_INTR_MASK_REG)($t2)
.ifdef VERSION_EU
beqz $t2, .L80200074
srl $t1, $t3, 0x10
li $at, -1
xor $t1, $t1, $at
andi $t1, $t1, 0x3f
or $t2, $t2, $t1
.L80200074:
.endif
sll $t2, $t2, 0x10
or $v0, $v0, $t2
lui $at, 0x3f
and $t0, $a0, $at
.ifdef VERSION_EU
and $t0, $t0, $t3
.endif
srl $t0, $t0, 0xf
lui $t2, %hi(D_803386D0)
addu $t2, $t2, $t0
lhu $t2, %lo(D_803386D0)($t2)
lui $at, %hi(MI_INTR_MASK_REG) # $at, 0xa430
sw $t2, %lo(MI_INTR_MASK_REG)($at)
andi $t0, $a0, 0xff01
.ifdef VERSION_EU
andi $t1, $t3, 0xff00
and $t0, $t0, $t1
.endif
lui $at, (0xFFFF00FF >> 16) # lui $at, 0xffff
ori $at, (0xFFFF00FF & 0xFFFF) # ori $at, $at, 0xff
.ifndef VERSION_EU
and $t1, $t1, $at
or $t1, $t1, $t0
mtc0 $t1, $12
.else
and $t4, $t4, $at
or $t4, $t4, $t0
mtc0 $t4, $12
.endif
nop
nop
jr $ra
nop
.section .rodata
glabel D_803386D0
.half 0x0555
.half 0x0556
.half 0x0559
.half 0x055A
.half 0x0565
.half 0x0566
.half 0x0569
.half 0x056A
.half 0x0595
.half 0x0596
.half 0x0599
.half 0x059A
.half 0x05A5
.half 0x05A6
.half 0x05A9
.half 0x05AA
.half 0x0655
.half 0x0656
.half 0x0659
.half 0x065A
.half 0x0665
.half 0x0666
.half 0x0669
.half 0x066A
.half 0x0695
.half 0x0696
.half 0x0699
.half 0x069A
.half 0x06A5
.half 0x06A6
.half 0x06A9
.half 0x06AA
.half 0x0955
.half 0x0956
.half 0x0959
.half 0x095A
.half 0x0965
.half 0x0966
.half 0x0969
.half 0x096A
.half 0x0995
.half 0x0996
.half 0x0999
.half 0x099A
.half 0x09A5
.half 0x09A6
.half 0x09A9
.half 0x09AA
.half 0x0A55
.half 0x0A56
.half 0x0A59
.half 0x0A5A
.half 0x0A65
.half 0x0A66
.half 0x0A69
.half 0x0A6A
.half 0x0A95
.half 0x0A96
.half 0x0A99
.half 0x0A9A
.half 0x0AA5
.half 0x0AA6
.half 0x0AA9
.half 0x0AAA

View file

@ -1,32 +0,0 @@
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel osUnmapTLBAll
mfc0 $t0, $10
li $t1, 31
lui $t2, 0x8000
mtc0 $t2, $10
mtc0 $zero, $2
mtc0 $zero, $3
.L80321588:
mtc0 $t1, $0
nop
tlbwi
nop
nop
addi $t1, $t1, -1
bnezl $t1, .L80321588 #bnezl, bnez but with likely hint
nop
mtc0 $t0, $10
jr $ra
nop
nop
nop
nop

View file

@ -1,39 +0,0 @@
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.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
andi $t2, $t0, 0xf
addiu $t1, $t1, -0x10
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
addiu $t0, 0x10 # addiu $t0, $t0, 0x10
jr $ra
nop

View file

@ -1,24 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64
.include "macros.inc"
.section .text, "ax"
glabel osWritebackDCacheAll
li $t0, K0BASE
li $t2, 8192
addu $t1, $t0, $t2
addiu $t1, $t1, -0x10
.L80322020:
cache 1, ($t0)
sltu $at, $t0, $t1
bnez $at, .L80322020
addiu $t0, $t0, 0x10
jr $ra
nop
nop
nop

View file

@ -1,18 +0,0 @@
.macro gsymbol sym addr
.global \sym
.set \sym, \addr
.ifndef VERSION_JP
nop
nop
.endif
.endm
.text
gsymbol osTvType 0x80000300
gsymbol osRomType 0x80000304
gsymbol osRomBase 0x80000308
gsymbol osResetType 0x8000030C
gsymbol osCiCId 0x80000310
gsymbol osVersion 0x80000314
gsymbol osMemSize 0x80000318
gsymbol osAppNmiBuffer 0x8000031C

252
lib/rsp.s
View file

@ -1,252 +0,0 @@
.include "macros.inc"
.set UCODE_SIZE, 0x800
.section .text
.balign 16
glabel rspF3DBootStart
.ifndef VERSION_EU
.incbin "lib/PR/boot/F3D_boot.bin"
.else
.incbin "lib/PR/boot/F3D_boot_eu.bin"
.half 0
.endif
glabel rspF3DBootEnd
.balign 16
.ifndef F3DEX_GBI_SHARED
glabel rspF3DStart /* Use regular Fast3D bins (default) */
.ifndef F3D_OLD
.incbin "lib/PR/f3d/new/F3D.bin" /* OS 2.0H (J2 and IQ) */
.else
.incbin "lib/PR/f3d/old/F3D.bin" /* OS 2.0D (US and JP) */
.endif
glabel rspF3DEnd
.else /* Use one of the Fast3DEX series grucodes. */
glabel rspF3DStart
.if F3DEX_GBI_2 == 1
.incbin "lib/PR/f3dex2/F3DEX2.bin"
.elseif F3DEX_GBI == 1
.incbin "lib/PR/f3dex/F3DEX.bin"
.else /* Fast3DZEX */
.incbin "lib/PR/f3dex2/F3DZEX.bin"
.endif
glabel rspF3DEnd
.endif
/* Audio Bins */
.balign 16
glabel rspAspMainStart
.incbin "lib/PR/audio/aspMain.bin"
glabel rspAspMainEnd
/*
* LESS COMMON MICROCODES
* These are setup to be loaded by G_LOAD_UCODE
*/
/* Fast3DEX NoN Text */
.ifdef F3DEX_NON_GBI
glabel rspF3DEXNoNStart
.balign 16
.incbin "lib/PR/f3dex/F3DEX_NoN.bin"
glabel rspF3DEXNoNEnd
.endif
/* Fast3DLX Text */
.ifdef F3DLX_GBI
glabel rspF3DLXStart
.incbin "lib/PR/f3dex/F3DLX.bin"
glabel rspF3DLXEnd
.endif
/* Fast3DLX NoN Text */
.ifdef F3DLX_NON_GBI
glabel rspF3DLXNoNStart
.balign 16
.incbin "lib/PR/f3dex/F3DLX_NoN.bin"
glabel rspF3DLXNoNEnd
.endif
/* Fast3DLX Rej Text */
.ifdef F3DLX_REJ_GBI
glabel rspF3DLXRejStart
.balign 16
.incbin "lib/PR/f3dex/F3DLX_Rej.bin"
glabel rspF3DLXRejEnd
.endif
/* Line3DEX Text */
.ifdef L3DEX_GBI
glabel rspL3DEXStart
.balign 16
.incbin "lib/PR/f3dex/L3DEX.bin"
glabel rspL3DEXEnd
.endif
/* S2DEX Text */
.ifdef S2DEX_GBI
glabel rspS2DEXStart
.balign 16
.incbin "lib/PR/s2dex/S2DEX.bin"
glabel rspS2DEXEnd
.endif
/* Fast3DEX2 series */
/* Fast3DEX2 NoN Text */
.ifdef F3DEX2_NON_GBI
.balign 16
glabel rspF3DEX2NoNStart
.incbin "lib/PR/f3dex2/F3DEX2_NoN.bin"
glabel rspF3DEX2NoNEnd
.endif
/* Fast3DEX2 Rej Text */
.ifdef F3DEX2_REJ_GBI
.balign 16
glabel rspF3DEX2RejStart
.incbin "lib/PR/f3dex2/F3DEX2_Rej.bin"
glabel rspF3DEX2RejEnd
.endif
/* Line3DEX2 Text */
.ifdef L3DEX2_GBI
.balign 16
glabel rspL3DEX2Start
.incbin "lib/PR/f3dex2/L3DEX2.bin"
glabel rspL3DEX2End
.endif
/* S2DEX2 Text */
.ifdef S2DEX_GBI_2
.balign 16
glabel rspS2DEXStart
.incbin "lib/PR/s2dex/S2DEX2.bin"
glabel rspS2DEXEnd
.endif
/* DATA SECTION START */
.section .rodata
.balign 16
.ifndef F3DEX_GBI_SHARED /* Use regular Fast3D data (default) */
glabel rspF3DDataStart
.ifndef F3D_OLD /* OS 2.0H (J2 and IQ) */
.ifdef VERSION_EU
.incbin "lib/PR/f3d/new/F3D_data_EU.bin"
.else
.incbin "lib/PR/f3d/new/F3D_data.bin"
.endif
.else /* OS 2.0D (US and JP) */
.incbin "lib/PR/f3d/old/F3D_data.bin"
.endif
glabel rspF3DDataEnd
.else /* Using one of the Fast3DEX series grucodes */
glabel rspF3DDataStart
.if F3DEX_GBI_2 == 1
.incbin "lib/PR/f3dex2/F3DEX2_data.bin"
.elseif F3DEX_GBI == 1
.incbin "lib/PR/f3dex/F3DEX_data.bin"
.else /* Fast3DZEX */
.incbin "lib/PR/f3dex2/F3DZEX_data.bin"
.endif
glabel rspF3DDataEnd
.endif
/* Audio Data */
.balign 16
glabel rspAspMainDataStart
.incbin "lib/PR/audio/aspMain_data.bin"
glabel rspAspMainDataEnd
/* LESS COMMON MICROCODES */
/* Fast3DEX Series */
/* Fast3DEX NoN Data */
.ifdef F3DEX_NON_GBI
.balign 16
glabel rspF3DEXNoNDataStart
.incbin "lib/PR/f3dex/F3DEX_NoN_data.bin"
glabel rspF3DEXNoNDataEnd
.endif
/* Fast3DLX Data */
.ifdef F3DLX_GBI
.balign 16
glabel rspF3DLXDataStart
.incbin "lib/PR/f3dex/F3DLX_data.bin"
glabel rspF3DLXDataEnd
.endif
/* Fast3DLX NoN Data */
.ifdef F3DLX_NON_GBI
.balign 16
glabel rspF3DLXNoNDataStart
.incbin "lib/PR/f3dex/F3DLX_NoN_data.bin"
glabel rspF3DLXNoNDataEnd
.endif
/* Fast3DLX Rej Data */
.ifdef F3DLX_REJ_GBI
.balign 16
glabel rspF3DLXRejDataStart
.incbin "lib/PR/f3dex/F3DLX_Rej_data.bin"
glabel rspF3DLXRejDataEnd
.endif
/* Line3DEX Data */
.ifdef L3DEX_GBI
.balign 16
glabel rspL3DEXDataStart
.incbin "lib/PR/f3dex/L3DEX_data.bin"
glabel rspL3DEXDataEnd
.endif
/* S2DEX Data */
.ifdef S2DEX_GBI
.balign 16
glabel rspS2DEXDataStart
.incbin "lib/PR/s2dex/S2DEX_data.bin"
glabel rspS2DEXDataEnd
.endif
/* Fast3DEX2 Series */
/* Fast3DEX2 NoN Data */
.ifdef F3DEX2_NON_GBI
.balign 16
glabel rspF3DEX2NoNStart
.incbin "lib/PR/f3dex2/F3DEX2_NoN_data.bin"
glabel rspF3DEX2NoNEnd
.endif
/* Fast3DEX2 Rej Data */
.ifdef F3DEX2_REJ_GBI
.balign 16
glabel rspF3DEX2RejStart
.incbin "lib/PR/f3dex2/F3DEX2_Rej_data.bin"
glabel rspF3DEX2RejEnd
.endif
/* Line3DEX2 Data */
.ifdef L3DEX2_GBI
.balign 16
glabel rspL3DEX2Start
.incbin "lib/PR/f3dex2/L3DEX2_data.bin"
glabel rspL3DEX2End
.endif
/* S2DEX2 Data */
.ifdef S2DEX_GBI_2
.balign 16
glabel rspS2DEXStart
.incbin "lib/PR/s2dex/S2DEX2_data.bin"
glabel rspS2DEXEnd
.endif