diff options
| author | spicyjpeg <thatspicyjpeg@gmail.com> | 2022-11-15 08:07:24 +0100 |
|---|---|---|
| committer | spicyjpeg <thatspicyjpeg@gmail.com> | 2022-11-15 08:07:24 +0100 |
| commit | 85d765f30595fe7f27c1b065c5a1934c3d389cef (patch) | |
| tree | b2a30eaa7f61b8238fdcdfd33867a5e44a4efbf0 /libpsn00b/psxapi | |
| parent | 4139331d233b7a962e747c5564fa68a285f81cc8 (diff) | |
| download | psn00bsdk-85d765f30595fe7f27c1b065c5a1934c3d389cef.tar.gz | |
Misc. libpsn00b bugfixes, new critical section macros
Diffstat (limited to 'libpsn00b/psxapi')
| -rw-r--r-- | libpsn00b/psxapi/_syscalls.s | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libpsn00b/psxapi/_syscalls.s b/libpsn00b/psxapi/_syscalls.s index 24864f3..6eaed72 100644 --- a/libpsn00b/psxapi/_syscalls.s +++ b/libpsn00b/psxapi/_syscalls.s @@ -27,20 +27,21 @@ ExitCriticalSection: .global SwEnterCriticalSection .type SwEnterCriticalSection, @function SwEnterCriticalSection: - mfc0 $a0, $12 # cop0r12 &= ~0x00000401 - li $a1, -1026 - and $a0, $a1 - mtc0 $a0, $12 - nop + mfc0 $a0, $12 # cop0r12 &= ~0x401 + li $a1, -1026 + and $a1, $a0 + mtc0 $a1, $12 + andi $a0, 0x0401 # return ((cop0r12_prev & 0x401) == 0x401) + sltiu $v0, $a0, 0x0401 - jr $ra - nop + jr $ra + xori $v0, 1 .section .text.SwExitCriticalSection .global SwExitCriticalSection .type SwExitCriticalSection, @function SwExitCriticalSection: - mfc0 $a0, $12 # cop0r12 |= 0x00000401 + mfc0 $a0, $12 # cop0r12 |= 0x401 nop ori $a0, 0x0401 mtc0 $a0, $12 |
