diff options
| author | spicyjpeg <thatspicyjpeg@gmail.com> | 2023-05-12 18:05:21 +0200 |
|---|---|---|
| committer | spicyjpeg <thatspicyjpeg@gmail.com> | 2023-05-12 18:05:21 +0200 |
| commit | 513a6e99dd1f9cf5531d55f544478bec72efb910 (patch) | |
| tree | 47d7789347ba596dca54704df24e85b6763f26a2 /libpsn00b/libc | |
| parent | 4230715311892502452f326f3618e5ef4dc81972 (diff) | |
| download | psn00bsdk-513a6e99dd1f9cf5531d55f544478bec72efb910.tar.gz | |
Downgrade GCC to 12.3, add setjmp(), fix CdGetRegion()
Diffstat (limited to 'libpsn00b/libc')
| -rw-r--r-- | libpsn00b/libc/setjmp.s | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/libpsn00b/libc/setjmp.s b/libpsn00b/libc/setjmp.s new file mode 100644 index 0000000..465a712 --- /dev/null +++ b/libpsn00b/libc/setjmp.s @@ -0,0 +1,48 @@ +# PSn00bSDK setjmp/longjmp +# (C) 2023 spicyjpeg - MPL licensed +# +# This is not a "proper" implementation of setjmp/longjmp as it does not save +# COP0 and GTE registers, but it is fully compatible with the version found in +# the BIOS. + +.set noreorder + +.section .text.setjmp +.global setjmp +.type setjmp, @function +setjmp: + sw $ra, 0x00($a0) + sw $sp, 0x04($a0) + sw $fp, 0x08($a0) + sw $s0, 0x0c($a0) + sw $s1, 0x10($a0) + sw $s2, 0x14($a0) + sw $s3, 0x18($a0) + sw $s4, 0x1c($a0) + sw $s5, 0x20($a0) + sw $s6, 0x24($a0) + sw $s7, 0x28($a0) + sw $gp, 0x2c($a0) + + jr $ra + li $v0, 0 + +.section .text.longjmp +.global longjmp +.type longjmp, @function +longjmp: + lw $ra, 0x00($a0) + lw $sp, 0x04($a0) + lw $fp, 0x08($a0) + lw $s0, 0x0c($a0) + lw $s1, 0x10($a0) + lw $s2, 0x14($a0) + lw $s3, 0x18($a0) + lw $s4, 0x1c($a0) + lw $s5, 0x20($a0) + lw $s6, 0x24($a0) + lw $s7, 0x28($a0) + lw $gp, 0x2c($a0) + + jr $ra + move $v0, $a1 |
