aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/psxetc/interruptcallback.s
diff options
context:
space:
mode:
authorJohn "Lameguy" Wilbert Villamor <lameguy64@gmail.com>2022-09-26 16:49:56 +0800
committerGitHub <noreply@github.com>2022-09-26 16:49:56 +0800
commitc4a2533d21dfd05cde841ea48c67b05e0e6a853f (patch)
treec7ef61653b157b69fb0956709366996ddbc4ecfa /libpsn00b/psxetc/interruptcallback.s
parenta8b404b3400c3ebd8e0b923dcaefcc49ea563e36 (diff)
parent86f0064afb8200e60dd80827535cac30d0eab028 (diff)
downloadpsn00bsdk-c4a2533d21dfd05cde841ea48c67b05e0e6a853f.tar.gz
Merge pull request #55 from spicyjpeg/psxmdec
Full MDEC support, C library refactors, cleanups and bugfixes (v0.20)
Diffstat (limited to 'libpsn00b/psxetc/interruptcallback.s')
-rw-r--r--libpsn00b/psxetc/interruptcallback.s48
1 files changed, 0 insertions, 48 deletions
diff --git a/libpsn00b/psxetc/interruptcallback.s b/libpsn00b/psxetc/interruptcallback.s
deleted file mode 100644
index 78e5e6e..0000000
--- a/libpsn00b/psxetc/interruptcallback.s
+++ /dev/null
@@ -1,48 +0,0 @@
-.set noreorder
-
-.include "hwregs_a.h"
-
-.section .text
-
-.global InterruptCallback
-.type InterruptCallback, @function
-InterruptCallback:
-
- # a0 - Interrupt number
- # a1 - Callback function
-
- lui $a2, IOBASE
-
- beqz $a1, .Ldisable_irq
- nop
-
- lw $v0, IRQ_MASK($a2) # Enable interrupt mask
- li $v1, 1
- sll $v1, $a0
- or $v0, $v1
-
- b .Lcont
- sw $v0, IRQ_MASK($a2)
-
-.Ldisable_irq:
-
-.set noat
- lw $v0, IRQ_MASK($a2) # Disable interrupt mask
- li $v1, 1
- sll $v1, $a0
- addiu $at, $0 , -1
- xor $v1, $at
-.set at
- and $v0, $v1
- sw $v0, IRQ_MASK($a2)
-
-.Lcont:
-
- la $a2, _irq_func_table # Get address to IRQ function table
-
- sll $v1, $a0, 2 # Compute the slot
- addu $v1, $a2, $v1
- lw $v0, 0($v1) # Get old handler address
-
- jr $ra # Return and set new IRQ handler
- sw $a1, 0($v1)