aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/psxetc/isr.s
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2022-08-13 21:26:36 +0200
committerspicyjpeg <thatspicyjpeg@gmail.com>2022-08-13 21:26:36 +0200
commitec3ed1574dac08b1c07a8126f6090adce0e7efb8 (patch)
tree825f4bb5e044ce2fa674780b66c77e51e48ab9a4 /libpsn00b/psxetc/isr.s
parentedb967394d22420c9aaad529862a670c016cc2c7 (diff)
downloadpsn00bsdk-ec3ed1574dac08b1c07a8126f6090adce0e7efb8.tar.gz
Rewrite libpsxetc in C, add ResetCallback()
Diffstat (limited to 'libpsn00b/psxetc/isr.s')
-rw-r--r--libpsn00b/psxetc/isr.s107
1 files changed, 0 insertions, 107 deletions
diff --git a/libpsn00b/psxetc/isr.s b/libpsn00b/psxetc/isr.s
deleted file mode 100644
index 440be50..0000000
--- a/libpsn00b/psxetc/isr.s
+++ /dev/null
@@ -1,107 +0,0 @@
-.set noreorder
-
-.include "hwregs_a.h"
-
-.set ISR_STACK_SIZE, 4096
-
-
-.section .text
-
-# Global ISR handler of PSn00bSDK
-
-.set at
-
-.type _global_isr, @function
-_global_isr:
-
-.Lisr_loop:
-
- #la $gp, _gp # Keep restoring GP since it gets
- # changed elsewhere sometimes
-
- lui $a0, IOBASE # Get IRQ status
- lw $v0, IRQ_MASK($a0)
- nop
-
- srl $v0, $s1 # Check IRQ mask bit if set
- andi $v0, 0x1
-
- beqz $v0, .Lno_irq # Don't execute callback if IRQ not enabled
- nop
-
- lw $v0, IRQ_STAT($a0)
- nop
- srl $v0, $s1 # Check IRQ status bit if set
- andi $v0, 0x1
- beqz $v0, .Lno_irq # Don't execute callback if no IRQ
- nop
-
- lw $v1, 0($s0) # Load IRQ callback function
- nop
-
- lw $v0, IRQ_STAT($a0) # Acknowledge the IRQ (by writing a 0 bit)
- li $a1, 1
- sll $a1, $s1
- addiu $a2, $0 , -1
- xor $a1, $a2
- sw $a1, IRQ_STAT($a0)
-
- beqz $v1, .Lno_irq # Don't execute if callback is not set
- nop
-
- jalr $v1 # Call interrupt handler
- nop
-
-.Lno_irq:
-
- addiu $s0, 4
-
- blt $s1, 11, .Lisr_loop
- addiu $s1, 1
-
- j ReturnFromException
- nop
-
-
-.section .data
-
-# Global ISR callback table
-
-.global _irq_func_table
-.type _irq_func_table, @object
-_irq_func_table:
- .word 0
- .word 0
- .word 0
- .word 0
- .word 0
- .word 0
- .word 0
- .word 0
- .word 0
- .word 0
- .word 0
- .word 0
-
-# Global ISR hook structure
-.global _custom_exit
-.type _custom_exit, @object
-_custom_exit:
- .word _global_isr # pc
- .word _isr_stack+ISR_STACK_SIZE # sp
- .word 0 # fp
- .word _irq_func_table # s0
- .word 0 # s1
- .word 0 # s2
- .word 0 # s3
- .word 0 # s4
- .word 0 # s5
- .word 0 # s6
- .word 0 # s7
- .word _gp # gp
-
-# Global ISR stack
-# .fill 1024
-#_custom_exit_stack:
-# .fill 4
-.comm _isr_stack, ISR_STACK_SIZE+4