aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/psxgpu/restartcallback.s
diff options
context:
space:
mode:
authorJohn Wilbert M. Villamor <lameguy64@gmail.com>2019-07-17 11:30:07 +0800
committerJohn Wilbert M. Villamor <lameguy64@gmail.com>2019-07-17 11:30:07 +0800
commit0d4345a9bf2623df079c50a3bc73cbb7deca1176 (patch)
tree6cda70b844f39fc2d65a806b91a6010066433b56 /libpsn00b/psxgpu/restartcallback.s
parentb956c5391b955e793a4d54572aa58872b4c66c30 (diff)
downloadpsn00bsdk-0d4345a9bf2623df079c50a3bc73cbb7deca1176.tar.gz
Added C++ support, updated build instructions and makefiles, consolidated libc and libgcc (during build process), libraries now v0.12b and more
Diffstat (limited to 'libpsn00b/psxgpu/restartcallback.s')
-rw-r--r--libpsn00b/psxgpu/restartcallback.s50
1 files changed, 50 insertions, 0 deletions
diff --git a/libpsn00b/psxgpu/restartcallback.s b/libpsn00b/psxgpu/restartcallback.s
new file mode 100644
index 0000000..ffdeecd
--- /dev/null
+++ b/libpsn00b/psxgpu/restartcallback.s
@@ -0,0 +1,50 @@
+.set noreorder
+
+.include "hwregs_a.h"
+
+.section .text
+
+.global RestartCallback
+.type RestartCallback, @function
+RestartCallback:
+
+ addiu $sp, -4
+ sw $ra, 0($sp)
+
+ la $a0, _custom_exit
+ jal SetCustomExitFromException
+ addiu $sp, -12
+
+ jal ChangeClearPAD
+ move $a0, $0
+
+ li $a0, 3
+ jal ChangeClearRCnt
+ move $a1, $0
+
+
+ la $a0, _irq_func_table
+ move $a1, $0
+ move $v0, $0
+
+.Lcheck_cbs:
+ lw $v1, 0($a0)
+ nop
+ beqz $v1, .Lno_cb
+ addiu $a0, 4
+ li $v1, 1
+ sll $v1, $a1
+ or $v0, $v1
+.Lno_cb:
+ blt $a1, 10, .Lcheck_cbs
+ addiu $a1, 1
+
+ lui $a0, IOBASE
+ sw $0 , ISTAT($a0)
+ sw $v0, IMASK($a0)
+
+ addiu $sp, 12
+ lw $ra, 0($sp)
+ nop
+ jr $ra
+ nop \ No newline at end of file