From beb76e4dd362374b8f42cd971d394bba1074cd8d Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sat, 5 Jul 2025 02:34:11 +0200 Subject: Replace .include with #include For some reason, both mipsel-unknown-elf-gcc 8.2.0 and mipsel-non-elf 15.1.0 were unable to resolve .include assembler directives. As a workaround, it is still possible to use the preprocessor, and therefore the usual #include preprocessor directive. However, this requires the assembly files to use the uppercase .S file extension. --- libpsn00b/psxapi/_syscalls.S | 161 +++++++++++++++++++ libpsn00b/psxapi/_syscalls.s | 161 ------------------- libpsn00b/psxapi/drivers.S | 164 ++++++++++++++++++++ libpsn00b/psxapi/drivers.s | 164 -------------------- libpsn00b/psxapi/fs.S | 58 +++++++ libpsn00b/psxapi/fs.s | 58 ------- libpsn00b/psxapi/stdio.S | 140 +++++++++++++++++ libpsn00b/psxapi/stdio.s | 140 ----------------- libpsn00b/psxapi/sys.S | 358 +++++++++++++++++++++++++++++++++++++++++++ libpsn00b/psxapi/sys.s | 358 ------------------------------------------- 10 files changed, 881 insertions(+), 881 deletions(-) create mode 100644 libpsn00b/psxapi/_syscalls.S delete mode 100644 libpsn00b/psxapi/_syscalls.s create mode 100644 libpsn00b/psxapi/drivers.S delete mode 100644 libpsn00b/psxapi/drivers.s create mode 100644 libpsn00b/psxapi/fs.S delete mode 100644 libpsn00b/psxapi/fs.s create mode 100644 libpsn00b/psxapi/stdio.S delete mode 100644 libpsn00b/psxapi/stdio.s create mode 100644 libpsn00b/psxapi/sys.S delete mode 100644 libpsn00b/psxapi/sys.s (limited to 'libpsn00b/psxapi') diff --git a/libpsn00b/psxapi/_syscalls.S b/libpsn00b/psxapi/_syscalls.S new file mode 100644 index 0000000..cef349d --- /dev/null +++ b/libpsn00b/psxapi/_syscalls.S @@ -0,0 +1,161 @@ +# PSn00bSDK syscall wrappers +# (C) 2022-2023 spicyjpeg - MPL licensed + +.set noreorder + +## Interrupt enable/disable + +.section .text.EnterCriticalSection, "ax", @progbits +.global EnterCriticalSection +.type EnterCriticalSection, @function + +EnterCriticalSection: + li $a0, 0x01 + syscall 0 + + jr $ra + nop + +.section .text.ExitCriticalSection, "ax", @progbits +.global ExitCriticalSection +.type ExitCriticalSection, @function + +ExitCriticalSection: + li $a0, 0x02 + syscall 0 + + jr $ra + nop + +.section .text.SwEnterCriticalSection, "ax", @progbits +.global SwEnterCriticalSection +.type SwEnterCriticalSection, @function + +SwEnterCriticalSection: + 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 + xori $v0, 1 + +.section .text.SwExitCriticalSection, "ax", @progbits +.global SwExitCriticalSection +.type SwExitCriticalSection, @function + +SwExitCriticalSection: + mfc0 $a0, $12 # cop0r12 |= 0x401 + nop + ori $a0, 0x0401 + mtc0 $a0, $12 + nop + + jr $ra + nop + +## PCDRV (host file access) API + +.section .text.PCinit, "ax", @progbits +.global PCinit +.type PCinit, @function + +PCinit: + break 0, 0x101 # () -> error + + jr $ra + nop + +.section .text.PCcreat, "ax", @progbits +.global PCcreat +.type PCcreat, @function + +PCcreat: + li $a2, 0 + move $a1, $a0 + break 0, 0x102 # (path, path, 0) -> error, fd + + bgez $v0, .Lcreate_ok # if (error < 0) fd = error + nop + move $v1, $v0 +.Lcreate_ok: + jr $ra # return fd + move $v0, $v1 + +.section .text.PCopen, "ax", @progbits +.global PCopen +.type PCopen, @function + +PCopen: + move $a2, $a1 + move $a1, $a0 + break 0, 0x103 # (path, path, mode) -> error, fd + + bgez $v0, .Lopen_ok # if (error < 0) fd = error + nop + move $v1, $v0 +.Lopen_ok: + jr $ra # return fd + move $v0, $v1 + +.section .text.PCclose, "ax", @progbits +.global PCclose +.type PCclose, @function + +PCclose: + move $a1, $a0 + break 0, 0x104 # (fd, fd) -> error + + jr $ra + nop + +.section .text.PCread, "ax", @progbits +.global PCread +.type PCread, @function + +PCread: + move $a3, $a1 + move $a1, $a0 + break 0, 0x105 # (fd, fd, length, data) -> error, length + + bgez $v0, .Lread_ok # if (error < 0) length = error + nop + move $v1, $v0 +.Lread_ok: + jr $ra # return length + move $v0, $v1 + +.section .text.PCwrite, "ax", @progbits +.global PCwrite +.type PCwrite, @function + +PCwrite: + move $a3, $a1 + move $a1, $a0 + break 0, 0x106 # (fd, fd, length, data) -> error, length + + bgez $v0, .Lwrite_ok # if (error < 0) length = error + nop + move $v1, $v0 +.Lwrite_ok: + jr $ra # return length + move $v0, $v1 + +.section .text.PClseek, "ax", @progbits +.global PClseek +.type PClseek, @function + +PClseek: + move $a3, $a2 + move $a2, $a1 + move $a1, $a0 + break 0, 0x107 # (fd, fd, offset, mode) -> error, offset + + bgez $v0, .Lseek_ok # if (error < 0) offset = error + nop + move $v1, $v0 +.Lseek_ok: + jr $ra # return offset + move $v0, $v1 diff --git a/libpsn00b/psxapi/_syscalls.s b/libpsn00b/psxapi/_syscalls.s deleted file mode 100644 index cef349d..0000000 --- a/libpsn00b/psxapi/_syscalls.s +++ /dev/null @@ -1,161 +0,0 @@ -# PSn00bSDK syscall wrappers -# (C) 2022-2023 spicyjpeg - MPL licensed - -.set noreorder - -## Interrupt enable/disable - -.section .text.EnterCriticalSection, "ax", @progbits -.global EnterCriticalSection -.type EnterCriticalSection, @function - -EnterCriticalSection: - li $a0, 0x01 - syscall 0 - - jr $ra - nop - -.section .text.ExitCriticalSection, "ax", @progbits -.global ExitCriticalSection -.type ExitCriticalSection, @function - -ExitCriticalSection: - li $a0, 0x02 - syscall 0 - - jr $ra - nop - -.section .text.SwEnterCriticalSection, "ax", @progbits -.global SwEnterCriticalSection -.type SwEnterCriticalSection, @function - -SwEnterCriticalSection: - 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 - xori $v0, 1 - -.section .text.SwExitCriticalSection, "ax", @progbits -.global SwExitCriticalSection -.type SwExitCriticalSection, @function - -SwExitCriticalSection: - mfc0 $a0, $12 # cop0r12 |= 0x401 - nop - ori $a0, 0x0401 - mtc0 $a0, $12 - nop - - jr $ra - nop - -## PCDRV (host file access) API - -.section .text.PCinit, "ax", @progbits -.global PCinit -.type PCinit, @function - -PCinit: - break 0, 0x101 # () -> error - - jr $ra - nop - -.section .text.PCcreat, "ax", @progbits -.global PCcreat -.type PCcreat, @function - -PCcreat: - li $a2, 0 - move $a1, $a0 - break 0, 0x102 # (path, path, 0) -> error, fd - - bgez $v0, .Lcreate_ok # if (error < 0) fd = error - nop - move $v1, $v0 -.Lcreate_ok: - jr $ra # return fd - move $v0, $v1 - -.section .text.PCopen, "ax", @progbits -.global PCopen -.type PCopen, @function - -PCopen: - move $a2, $a1 - move $a1, $a0 - break 0, 0x103 # (path, path, mode) -> error, fd - - bgez $v0, .Lopen_ok # if (error < 0) fd = error - nop - move $v1, $v0 -.Lopen_ok: - jr $ra # return fd - move $v0, $v1 - -.section .text.PCclose, "ax", @progbits -.global PCclose -.type PCclose, @function - -PCclose: - move $a1, $a0 - break 0, 0x104 # (fd, fd) -> error - - jr $ra - nop - -.section .text.PCread, "ax", @progbits -.global PCread -.type PCread, @function - -PCread: - move $a3, $a1 - move $a1, $a0 - break 0, 0x105 # (fd, fd, length, data) -> error, length - - bgez $v0, .Lread_ok # if (error < 0) length = error - nop - move $v1, $v0 -.Lread_ok: - jr $ra # return length - move $v0, $v1 - -.section .text.PCwrite, "ax", @progbits -.global PCwrite -.type PCwrite, @function - -PCwrite: - move $a3, $a1 - move $a1, $a0 - break 0, 0x106 # (fd, fd, length, data) -> error, length - - bgez $v0, .Lwrite_ok # if (error < 0) length = error - nop - move $v1, $v0 -.Lwrite_ok: - jr $ra # return length - move $v0, $v1 - -.section .text.PClseek, "ax", @progbits -.global PClseek -.type PClseek, @function - -PClseek: - move $a3, $a2 - move $a2, $a1 - move $a1, $a0 - break 0, 0x107 # (fd, fd, offset, mode) -> error, offset - - bgez $v0, .Lseek_ok # if (error < 0) offset = error - nop - move $v1, $v0 -.Lseek_ok: - jr $ra # return offset - move $v0, $v1 diff --git a/libpsn00b/psxapi/drivers.S b/libpsn00b/psxapi/drivers.S new file mode 100644 index 0000000..eb6dcd5 --- /dev/null +++ b/libpsn00b/psxapi/drivers.S @@ -0,0 +1,164 @@ +# PSn00bSDK BIOS API stubs +# (C) 2022 spicyjpeg - MPL licensed + +# This file has been generated automatically. Each function is placed in its +# own section to allow the linker to strip unused functions. + +.set noreorder + +## A0 table functions (7) + +.section .text._bu_init +.global _bu_init +.type _bu_init, @function +_bu_init: + li $t2, 0xa0 + jr $t2 + li $t1, 0x70 + +.section .text._96_init +.global _96_init +.type _96_init, @function +_96_init: + li $t2, 0xa0 + jr $t2 + li $t1, 0x71 + +.section .text._96_remove +.global _96_remove +.type _96_remove, @function +_96_remove: + li $t2, 0xa0 + jr $t2 + li $t1, 0x72 + +.section .text.add_nullcon_driver +.global add_nullcon_driver +.type add_nullcon_driver, @function +add_nullcon_driver: + li $t2, 0xa0 + jr $t2 + li $t1, 0x99 + +.section .text._card_info +.global _card_info +.type _card_info, @function +_card_info: + li $t2, 0xa0 + jr $t2 + li $t1, 0xab + +.section .text._card_load +.global _card_load +.type _card_load, @function +_card_load: + li $t2, 0xa0 + jr $t2 + li $t1, 0xac + +.section .text._card_clear +.global _card_clear +.type _card_clear, @function +_card_clear: + li $t2, 0xa0 + jr $t2 + li $t1, 0xaf + +## B0 table functions (12) + +.section .text.AddDrv +.global AddDrv +.type AddDrv, @function +AddDrv: + li $t2, 0xb0 + jr $t2 + li $t1, 0x47 + +.section .text.DelDrv +.global DelDrv +.type DelDrv, @function +DelDrv: + li $t2, 0xb0 + jr $t2 + li $t1, 0x48 + +.section .text.ListDrv +.global ListDrv +.type ListDrv, @function +ListDrv: + li $t2, 0xb0 + jr $t2 + li $t1, 0x49 + +.section .text.InitCARD +.global InitCARD +.type InitCARD, @function +InitCARD: + li $t2, 0xb0 + jr $t2 + li $t1, 0x4a + +.section .text.StartCARD +.global StartCARD +.type StartCARD, @function +StartCARD: + li $t2, 0xb0 + jr $t2 + li $t1, 0x4b + +.section .text.StopCARD +.global StopCARD +.type StopCARD, @function +StopCARD: + li $t2, 0xb0 + jr $t2 + li $t1, 0x4c + +.section .text._card_write +.global _card_write +.type _card_write, @function +_card_write: + li $t2, 0xb0 + jr $t2 + li $t1, 0x4e + +.section .text._card_read +.global _card_read +.type _card_read, @function +_card_read: + li $t2, 0xb0 + jr $t2 + li $t1, 0x4f + +.section .text._new_card +.global _new_card +.type _new_card, @function +_new_card: + li $t2, 0xb0 + jr $t2 + li $t1, 0x50 + +.section .text._card_chan +.global _card_chan +.type _card_chan, @function +_card_chan: + li $t2, 0xb0 + jr $t2 + li $t1, 0x58 + +.section .text._card_status +.global _card_status +.type _card_status, @function +_card_status: + li $t2, 0xb0 + jr $t2 + li $t1, 0x5c + +.section .text._card_wait +.global _card_wait +.type _card_wait, @function +_card_wait: + li $t2, 0xb0 + jr $t2 + li $t1, 0x5d + diff --git a/libpsn00b/psxapi/drivers.s b/libpsn00b/psxapi/drivers.s deleted file mode 100644 index eb6dcd5..0000000 --- a/libpsn00b/psxapi/drivers.s +++ /dev/null @@ -1,164 +0,0 @@ -# PSn00bSDK BIOS API stubs -# (C) 2022 spicyjpeg - MPL licensed - -# This file has been generated automatically. Each function is placed in its -# own section to allow the linker to strip unused functions. - -.set noreorder - -## A0 table functions (7) - -.section .text._bu_init -.global _bu_init -.type _bu_init, @function -_bu_init: - li $t2, 0xa0 - jr $t2 - li $t1, 0x70 - -.section .text._96_init -.global _96_init -.type _96_init, @function -_96_init: - li $t2, 0xa0 - jr $t2 - li $t1, 0x71 - -.section .text._96_remove -.global _96_remove -.type _96_remove, @function -_96_remove: - li $t2, 0xa0 - jr $t2 - li $t1, 0x72 - -.section .text.add_nullcon_driver -.global add_nullcon_driver -.type add_nullcon_driver, @function -add_nullcon_driver: - li $t2, 0xa0 - jr $t2 - li $t1, 0x99 - -.section .text._card_info -.global _card_info -.type _card_info, @function -_card_info: - li $t2, 0xa0 - jr $t2 - li $t1, 0xab - -.section .text._card_load -.global _card_load -.type _card_load, @function -_card_load: - li $t2, 0xa0 - jr $t2 - li $t1, 0xac - -.section .text._card_clear -.global _card_clear -.type _card_clear, @function -_card_clear: - li $t2, 0xa0 - jr $t2 - li $t1, 0xaf - -## B0 table functions (12) - -.section .text.AddDrv -.global AddDrv -.type AddDrv, @function -AddDrv: - li $t2, 0xb0 - jr $t2 - li $t1, 0x47 - -.section .text.DelDrv -.global DelDrv -.type DelDrv, @function -DelDrv: - li $t2, 0xb0 - jr $t2 - li $t1, 0x48 - -.section .text.ListDrv -.global ListDrv -.type ListDrv, @function -ListDrv: - li $t2, 0xb0 - jr $t2 - li $t1, 0x49 - -.section .text.InitCARD -.global InitCARD -.type InitCARD, @function -InitCARD: - li $t2, 0xb0 - jr $t2 - li $t1, 0x4a - -.section .text.StartCARD -.global StartCARD -.type StartCARD, @function -StartCARD: - li $t2, 0xb0 - jr $t2 - li $t1, 0x4b - -.section .text.StopCARD -.global StopCARD -.type StopCARD, @function -StopCARD: - li $t2, 0xb0 - jr $t2 - li $t1, 0x4c - -.section .text._card_write -.global _card_write -.type _card_write, @function -_card_write: - li $t2, 0xb0 - jr $t2 - li $t1, 0x4e - -.section .text._card_read -.global _card_read -.type _card_read, @function -_card_read: - li $t2, 0xb0 - jr $t2 - li $t1, 0x4f - -.section .text._new_card -.global _new_card -.type _new_card, @function -_new_card: - li $t2, 0xb0 - jr $t2 - li $t1, 0x50 - -.section .text._card_chan -.global _card_chan -.type _card_chan, @function -_card_chan: - li $t2, 0xb0 - jr $t2 - li $t1, 0x58 - -.section .text._card_status -.global _card_status -.type _card_status, @function -_card_status: - li $t2, 0xb0 - jr $t2 - li $t1, 0x5c - -.section .text._card_wait -.global _card_wait -.type _card_wait, @function -_card_wait: - li $t2, 0xb0 - jr $t2 - li $t1, 0x5d - diff --git a/libpsn00b/psxapi/fs.S b/libpsn00b/psxapi/fs.S new file mode 100644 index 0000000..8b6d57a --- /dev/null +++ b/libpsn00b/psxapi/fs.S @@ -0,0 +1,58 @@ +# PSn00bSDK BIOS API stubs +# (C) 2022 spicyjpeg - MPL licensed + +# This file has been generated automatically. Each function is placed in its +# own section to allow the linker to strip unused functions. + +.set noreorder + +## B0 table functions (6) + +.section .text.cd +.global cd +.type cd, @function +cd: + li $t2, 0xb0 + jr $t2 + li $t1, 0x40 + +.section .text.firstfile +.global firstfile +.type firstfile, @function +firstfile: + li $t2, 0xb0 + jr $t2 + li $t1, 0x42 + +.section .text.nextfile +.global nextfile +.type nextfile, @function +nextfile: + li $t2, 0xb0 + jr $t2 + li $t1, 0x43 + +.section .text.rename +.global rename +.type rename, @function +rename: + li $t2, 0xb0 + jr $t2 + li $t1, 0x44 + +.section .text.erase +.global erase +.type erase, @function +erase: + li $t2, 0xb0 + jr $t2 + li $t1, 0x45 + +.section .text.undelete +.global undelete +.type undelete, @function +undelete: + li $t2, 0xb0 + jr $t2 + li $t1, 0x46 + diff --git a/libpsn00b/psxapi/fs.s b/libpsn00b/psxapi/fs.s deleted file mode 100644 index 8b6d57a..0000000 --- a/libpsn00b/psxapi/fs.s +++ /dev/null @@ -1,58 +0,0 @@ -# PSn00bSDK BIOS API stubs -# (C) 2022 spicyjpeg - MPL licensed - -# This file has been generated automatically. Each function is placed in its -# own section to allow the linker to strip unused functions. - -.set noreorder - -## B0 table functions (6) - -.section .text.cd -.global cd -.type cd, @function -cd: - li $t2, 0xb0 - jr $t2 - li $t1, 0x40 - -.section .text.firstfile -.global firstfile -.type firstfile, @function -firstfile: - li $t2, 0xb0 - jr $t2 - li $t1, 0x42 - -.section .text.nextfile -.global nextfile -.type nextfile, @function -nextfile: - li $t2, 0xb0 - jr $t2 - li $t1, 0x43 - -.section .text.rename -.global rename -.type rename, @function -rename: - li $t2, 0xb0 - jr $t2 - li $t1, 0x44 - -.section .text.erase -.global erase -.type erase, @function -erase: - li $t2, 0xb0 - jr $t2 - li $t1, 0x45 - -.section .text.undelete -.global undelete -.type undelete, @function -undelete: - li $t2, 0xb0 - jr $t2 - li $t1, 0x46 - diff --git a/libpsn00b/psxapi/stdio.S b/libpsn00b/psxapi/stdio.S new file mode 100644 index 0000000..14c6d03 --- /dev/null +++ b/libpsn00b/psxapi/stdio.S @@ -0,0 +1,140 @@ +# PSn00bSDK BIOS API stubs +# (C) 2022 spicyjpeg - MPL licensed + +# This file has been generated automatically. Each function is placed in its +# own section to allow the linker to strip unused functions. + +.set noreorder + +## A0 table functions (14) + +.section .text.open +.global open +.type open, @function +open: + li $t2, 0xa0 + jr $t2 + li $t1, 0x00 + +.section .text.lseek +.global lseek +.type lseek, @function +lseek: + li $t2, 0xa0 + jr $t2 + li $t1, 0x01 + +.section .text.read +.global read +.type read, @function +read: + li $t2, 0xa0 + jr $t2 + li $t1, 0x02 + +.section .text.write +.global write +.type write, @function +write: + li $t2, 0xa0 + jr $t2 + li $t1, 0x03 + +.section .text.close +.global close +.type close, @function +close: + li $t2, 0xa0 + jr $t2 + li $t1, 0x04 + +.section .text.ioctl +.global ioctl +.type ioctl, @function +ioctl: + li $t2, 0xa0 + jr $t2 + li $t1, 0x05 + +.section .text.isatty +.global isatty +.type isatty, @function +isatty: + li $t2, 0xa0 + jr $t2 + li $t1, 0x07 + +.section .text.getc +.global getc +.type getc, @function +getc: + li $t2, 0xa0 + jr $t2 + li $t1, 0x08 + +.section .text.putc +.global putc +.type putc, @function +putc: + li $t2, 0xa0 + jr $t2 + li $t1, 0x09 + +.section .text.getchar +.global getchar +.type getchar, @function +getchar: + li $t2, 0xa0 + jr $t2 + li $t1, 0x3b + +.section .text.putchar +.global putchar +.type putchar, @function +putchar: + li $t2, 0xa0 + jr $t2 + li $t1, 0x3c + +.section .text.gets +.global gets +.type gets, @function +gets: + li $t2, 0xa0 + jr $t2 + li $t1, 0x3d + +.section .text.puts +.global puts +.type puts, @function +puts: + li $t2, 0xa0 + jr $t2 + li $t1, 0x3e + +.section .text.printf +.global printf +.type printf, @function +printf: + li $t2, 0xa0 + jr $t2 + li $t1, 0x3f + +## B0 table functions (2) + +.section .text._get_errno +.global _get_errno +.type _get_errno, @function +_get_errno: + li $t2, 0xb0 + jr $t2 + li $t1, 0x54 + +.section .text._get_error +.global _get_error +.type _get_error, @function +_get_error: + li $t2, 0xb0 + jr $t2 + li $t1, 0x55 + diff --git a/libpsn00b/psxapi/stdio.s b/libpsn00b/psxapi/stdio.s deleted file mode 100644 index 14c6d03..0000000 --- a/libpsn00b/psxapi/stdio.s +++ /dev/null @@ -1,140 +0,0 @@ -# PSn00bSDK BIOS API stubs -# (C) 2022 spicyjpeg - MPL licensed - -# This file has been generated automatically. Each function is placed in its -# own section to allow the linker to strip unused functions. - -.set noreorder - -## A0 table functions (14) - -.section .text.open -.global open -.type open, @function -open: - li $t2, 0xa0 - jr $t2 - li $t1, 0x00 - -.section .text.lseek -.global lseek -.type lseek, @function -lseek: - li $t2, 0xa0 - jr $t2 - li $t1, 0x01 - -.section .text.read -.global read -.type read, @function -read: - li $t2, 0xa0 - jr $t2 - li $t1, 0x02 - -.section .text.write -.global write -.type write, @function -write: - li $t2, 0xa0 - jr $t2 - li $t1, 0x03 - -.section .text.close -.global close -.type close, @function -close: - li $t2, 0xa0 - jr $t2 - li $t1, 0x04 - -.section .text.ioctl -.global ioctl -.type ioctl, @function -ioctl: - li $t2, 0xa0 - jr $t2 - li $t1, 0x05 - -.section .text.isatty -.global isatty -.type isatty, @function -isatty: - li $t2, 0xa0 - jr $t2 - li $t1, 0x07 - -.section .text.getc -.global getc -.type getc, @function -getc: - li $t2, 0xa0 - jr $t2 - li $t1, 0x08 - -.section .text.putc -.global putc -.type putc, @function -putc: - li $t2, 0xa0 - jr $t2 - li $t1, 0x09 - -.section .text.getchar -.global getchar -.type getchar, @function -getchar: - li $t2, 0xa0 - jr $t2 - li $t1, 0x3b - -.section .text.putchar -.global putchar -.type putchar, @function -putchar: - li $t2, 0xa0 - jr $t2 - li $t1, 0x3c - -.section .text.gets -.global gets -.type gets, @function -gets: - li $t2, 0xa0 - jr $t2 - li $t1, 0x3d - -.section .text.puts -.global puts -.type puts, @function -puts: - li $t2, 0xa0 - jr $t2 - li $t1, 0x3e - -.section .text.printf -.global printf -.type printf, @function -printf: - li $t2, 0xa0 - jr $t2 - li $t1, 0x3f - -## B0 table functions (2) - -.section .text._get_errno -.global _get_errno -.type _get_errno, @function -_get_errno: - li $t2, 0xb0 - jr $t2 - li $t1, 0x54 - -.section .text._get_error -.global _get_error -.type _get_error, @function -_get_error: - li $t2, 0xb0 - jr $t2 - li $t1, 0x55 - diff --git a/libpsn00b/psxapi/sys.S b/libpsn00b/psxapi/sys.S new file mode 100644 index 0000000..40dcdff --- /dev/null +++ b/libpsn00b/psxapi/sys.S @@ -0,0 +1,358 @@ +# PSn00bSDK BIOS API stubs +# (C) 2022 spicyjpeg - MPL licensed + +# This file has been generated automatically. Each function is placed in its +# own section to allow the linker to strip unused functions. + +.set noreorder + +## A0 table functions (11) + +.section .text.b_setjmp +.global b_setjmp +.type b_setjmp, @function +b_setjmp: + li $t2, 0xa0 + jr $t2 + li $t1, 0x13 + +.section .text.b_longjmp +.global b_longjmp +.type b_longjmp, @function +b_longjmp: + li $t2, 0xa0 + jr $t2 + li $t1, 0x14 + +.section .text.b_InitHeap +.global b_InitHeap +.type b_InitHeap, @function +b_InitHeap: + li $t2, 0xa0 + jr $t2 + li $t1, 0x39 + +.section .text.Exec +.global Exec +.type Exec, @function +Exec: + li $t2, 0xa0 + jr $t2 + li $t1, 0x43 + +.section .text.FlushCache +.global FlushCache +.type FlushCache, @function +FlushCache: + li $t2, 0xa0 + jr $t2 + li $t1, 0x44 + +.section .text.LoadExec +.global LoadExec +.type LoadExec, @function +LoadExec: + li $t2, 0xa0 + jr $t2 + li $t1, 0x51 + +.section .text.SetConf +.global SetConf +.type SetConf, @function +SetConf: + li $t2, 0xa0 + jr $t2 + li $t1, 0x9c + +.section .text.GetConf +.global GetConf +.type GetConf, @function +GetConf: + li $t2, 0xa0 + jr $t2 + li $t1, 0x9d + +.section .text.SetMem +.global SetMem +.type SetMem, @function +SetMem: + li $t2, 0xa0 + jr $t2 + li $t1, 0x9f + +.section .text._boot +.global _boot +.type _boot, @function +_boot: + li $t2, 0xa0 + jr $t2 + li $t1, 0xa0 + +.section .text.GetSystemInfo +.global GetSystemInfo +.type GetSystemInfo, @function +GetSystemInfo: + li $t2, 0xa0 + jr $t2 + li $t1, 0xb4 + +## B0 table functions (27) + +.section .text.alloc_kernel_memory +.global alloc_kernel_memory +.type alloc_kernel_memory, @function +alloc_kernel_memory: + li $t2, 0xb0 + jr $t2 + li $t1, 0x00 + +.section .text.free_kernel_memory +.global free_kernel_memory +.type free_kernel_memory, @function +free_kernel_memory: + li $t2, 0xb0 + jr $t2 + li $t1, 0x01 + +.section .text.SetRCnt +.global SetRCnt +.type SetRCnt, @function +SetRCnt: + li $t2, 0xb0 + jr $t2 + li $t1, 0x02 + +.section .text.GetRCnt +.global GetRCnt +.type GetRCnt, @function +GetRCnt: + li $t2, 0xb0 + jr $t2 + li $t1, 0x03 + +.section .text.StartRCnt +.global StartRCnt +.type StartRCnt, @function +StartRCnt: + li $t2, 0xb0 + jr $t2 + li $t1, 0x04 + +.section .text.StopRCnt +.global StopRCnt +.type StopRCnt, @function +StopRCnt: + li $t2, 0xb0 + jr $t2 + li $t1, 0x05 + +.section .text.ResetRCnt +.global ResetRCnt +.type ResetRCnt, @function +ResetRCnt: + li $t2, 0xb0 + jr $t2 + li $t1, 0x06 + +.section .text.DeliverEvent +.global DeliverEvent +.type DeliverEvent, @function +DeliverEvent: + li $t2, 0xb0 + jr $t2 + li $t1, 0x07 + +.section .text.OpenEvent +.global OpenEvent +.type OpenEvent, @function +OpenEvent: + li $t2, 0xb0 + jr $t2 + li $t1, 0x08 + +.section .text.CloseEvent +.global CloseEvent +.type CloseEvent, @function +CloseEvent: + li $t2, 0xb0 + jr $t2 + li $t1, 0x09 + +.section .text.WaitEvent +.global WaitEvent +.type WaitEvent, @function +WaitEvent: + li $t2, 0xb0 + jr $t2 + li $t1, 0x0a + +.section .text.TestEvent +.global TestEvent +.type TestEvent, @function +TestEvent: + li $t2, 0xb0 + jr $t2 + li $t1, 0x0b + +.section .text.EnableEvent +.global EnableEvent +.type EnableEvent, @function +EnableEvent: + li $t2, 0xb0 + jr $t2 + li $t1, 0x0c + +.section .text.DisableEvent +.global DisableEvent +.type DisableEvent, @function +DisableEvent: + li $t2, 0xb0 + jr $t2 + li $t1, 0x0d + +.section .text.OpenTh +.global OpenTh +.type OpenTh, @function +OpenTh: + li $t2, 0xb0 + jr $t2 + li $t1, 0x0e + +.section .text.CloseTh +.global CloseTh +.type CloseTh, @function +CloseTh: + li $t2, 0xb0 + jr $t2 + li $t1, 0x0f + +.section .text.ChangeTh +.global ChangeTh +.type ChangeTh, @function +ChangeTh: + li $t2, 0xb0 + jr $t2 + li $t1, 0x10 + +.section .text.InitPAD +.global InitPAD +.type InitPAD, @function +InitPAD: + li $t2, 0xb0 + jr $t2 + li $t1, 0x12 + +.section .text.StartPAD +.global StartPAD +.type StartPAD, @function +StartPAD: + li $t2, 0xb0 + jr $t2 + li $t1, 0x13 + +.section .text.StopPAD +.global StopPAD +.type StopPAD, @function +StopPAD: + li $t2, 0xb0 + jr $t2 + li $t1, 0x14 + +.section .text.ReturnFromException +.global ReturnFromException +.type ReturnFromException, @function +ReturnFromException: + li $t2, 0xb0 + jr $t2 + li $t1, 0x17 + +.section .text.ResetEntryInt +.global ResetEntryInt +.type ResetEntryInt, @function +ResetEntryInt: + li $t2, 0xb0 + jr $t2 + li $t1, 0x18 + +.section .text.HookEntryInt +.global HookEntryInt +.type HookEntryInt, @function +HookEntryInt: + li $t2, 0xb0 + jr $t2 + li $t1, 0x19 + +.section .text.UnDeliverEvent +.global UnDeliverEvent +.type UnDeliverEvent, @function +UnDeliverEvent: + li $t2, 0xb0 + jr $t2 + li $t1, 0x20 + +.section .text.GetC0Table +.global GetC0Table +.type GetC0Table, @function +GetC0Table: + li $t2, 0xb0 + jr $t2 + li $t1, 0x56 + +.section .text.GetB0Table +.global GetB0Table +.type GetB0Table, @function +GetB0Table: + li $t2, 0xb0 + jr $t2 + li $t1, 0x57 + +.section .text.ChangeClearPAD +.global ChangeClearPAD +.type ChangeClearPAD, @function +ChangeClearPAD: + li $t2, 0xb0 + jr $t2 + li $t1, 0x5b + +## C0 table functions (5) + +.section .text.SysEnqIntRP +.global SysEnqIntRP +.type SysEnqIntRP, @function +SysEnqIntRP: + li $t2, 0xc0 + jr $t2 + li $t1, 0x02 + +.section .text.SysDeqIntRP +.global SysDeqIntRP +.type SysDeqIntRP, @function +SysDeqIntRP: + li $t2, 0xc0 + jr $t2 + li $t1, 0x03 + +.section .text.InstallExceptionHandlers +.global InstallExceptionHandlers +.type InstallExceptionHandlers, @function +InstallExceptionHandlers: + li $t2, 0xc0 + jr $t2 + li $t1, 0x07 + +.section .text.SysInitMemory +.global SysInitMemory +.type SysInitMemory, @function +SysInitMemory: + li $t2, 0xc0 + jr $t2 + li $t1, 0x08 + +.section .text.ChangeClearRCnt +.global ChangeClearRCnt +.type ChangeClearRCnt, @function +ChangeClearRCnt: + li $t2, 0xc0 + jr $t2 + li $t1, 0x0a + diff --git a/libpsn00b/psxapi/sys.s b/libpsn00b/psxapi/sys.s deleted file mode 100644 index 40dcdff..0000000 --- a/libpsn00b/psxapi/sys.s +++ /dev/null @@ -1,358 +0,0 @@ -# PSn00bSDK BIOS API stubs -# (C) 2022 spicyjpeg - MPL licensed - -# This file has been generated automatically. Each function is placed in its -# own section to allow the linker to strip unused functions. - -.set noreorder - -## A0 table functions (11) - -.section .text.b_setjmp -.global b_setjmp -.type b_setjmp, @function -b_setjmp: - li $t2, 0xa0 - jr $t2 - li $t1, 0x13 - -.section .text.b_longjmp -.global b_longjmp -.type b_longjmp, @function -b_longjmp: - li $t2, 0xa0 - jr $t2 - li $t1, 0x14 - -.section .text.b_InitHeap -.global b_InitHeap -.type b_InitHeap, @function -b_InitHeap: - li $t2, 0xa0 - jr $t2 - li $t1, 0x39 - -.section .text.Exec -.global Exec -.type Exec, @function -Exec: - li $t2, 0xa0 - jr $t2 - li $t1, 0x43 - -.section .text.FlushCache -.global FlushCache -.type FlushCache, @function -FlushCache: - li $t2, 0xa0 - jr $t2 - li $t1, 0x44 - -.section .text.LoadExec -.global LoadExec -.type LoadExec, @function -LoadExec: - li $t2, 0xa0 - jr $t2 - li $t1, 0x51 - -.section .text.SetConf -.global SetConf -.type SetConf, @function -SetConf: - li $t2, 0xa0 - jr $t2 - li $t1, 0x9c - -.section .text.GetConf -.global GetConf -.type GetConf, @function -GetConf: - li $t2, 0xa0 - jr $t2 - li $t1, 0x9d - -.section .text.SetMem -.global SetMem -.type SetMem, @function -SetMem: - li $t2, 0xa0 - jr $t2 - li $t1, 0x9f - -.section .text._boot -.global _boot -.type _boot, @function -_boot: - li $t2, 0xa0 - jr $t2 - li $t1, 0xa0 - -.section .text.GetSystemInfo -.global GetSystemInfo -.type GetSystemInfo, @function -GetSystemInfo: - li $t2, 0xa0 - jr $t2 - li $t1, 0xb4 - -## B0 table functions (27) - -.section .text.alloc_kernel_memory -.global alloc_kernel_memory -.type alloc_kernel_memory, @function -alloc_kernel_memory: - li $t2, 0xb0 - jr $t2 - li $t1, 0x00 - -.section .text.free_kernel_memory -.global free_kernel_memory -.type free_kernel_memory, @function -free_kernel_memory: - li $t2, 0xb0 - jr $t2 - li $t1, 0x01 - -.section .text.SetRCnt -.global SetRCnt -.type SetRCnt, @function -SetRCnt: - li $t2, 0xb0 - jr $t2 - li $t1, 0x02 - -.section .text.GetRCnt -.global GetRCnt -.type GetRCnt, @function -GetRCnt: - li $t2, 0xb0 - jr $t2 - li $t1, 0x03 - -.section .text.StartRCnt -.global StartRCnt -.type StartRCnt, @function -StartRCnt: - li $t2, 0xb0 - jr $t2 - li $t1, 0x04 - -.section .text.StopRCnt -.global StopRCnt -.type StopRCnt, @function -StopRCnt: - li $t2, 0xb0 - jr $t2 - li $t1, 0x05 - -.section .text.ResetRCnt -.global ResetRCnt -.type ResetRCnt, @function -ResetRCnt: - li $t2, 0xb0 - jr $t2 - li $t1, 0x06 - -.section .text.DeliverEvent -.global DeliverEvent -.type DeliverEvent, @function -DeliverEvent: - li $t2, 0xb0 - jr $t2 - li $t1, 0x07 - -.section .text.OpenEvent -.global OpenEvent -.type OpenEvent, @function -OpenEvent: - li $t2, 0xb0 - jr $t2 - li $t1, 0x08 - -.section .text.CloseEvent -.global CloseEvent -.type CloseEvent, @function -CloseEvent: - li $t2, 0xb0 - jr $t2 - li $t1, 0x09 - -.section .text.WaitEvent -.global WaitEvent -.type WaitEvent, @function -WaitEvent: - li $t2, 0xb0 - jr $t2 - li $t1, 0x0a - -.section .text.TestEvent -.global TestEvent -.type TestEvent, @function -TestEvent: - li $t2, 0xb0 - jr $t2 - li $t1, 0x0b - -.section .text.EnableEvent -.global EnableEvent -.type EnableEvent, @function -EnableEvent: - li $t2, 0xb0 - jr $t2 - li $t1, 0x0c - -.section .text.DisableEvent -.global DisableEvent -.type DisableEvent, @function -DisableEvent: - li $t2, 0xb0 - jr $t2 - li $t1, 0x0d - -.section .text.OpenTh -.global OpenTh -.type OpenTh, @function -OpenTh: - li $t2, 0xb0 - jr $t2 - li $t1, 0x0e - -.section .text.CloseTh -.global CloseTh -.type CloseTh, @function -CloseTh: - li $t2, 0xb0 - jr $t2 - li $t1, 0x0f - -.section .text.ChangeTh -.global ChangeTh -.type ChangeTh, @function -ChangeTh: - li $t2, 0xb0 - jr $t2 - li $t1, 0x10 - -.section .text.InitPAD -.global InitPAD -.type InitPAD, @function -InitPAD: - li $t2, 0xb0 - jr $t2 - li $t1, 0x12 - -.section .text.StartPAD -.global StartPAD -.type StartPAD, @function -StartPAD: - li $t2, 0xb0 - jr $t2 - li $t1, 0x13 - -.section .text.StopPAD -.global StopPAD -.type StopPAD, @function -StopPAD: - li $t2, 0xb0 - jr $t2 - li $t1, 0x14 - -.section .text.ReturnFromException -.global ReturnFromException -.type ReturnFromException, @function -ReturnFromException: - li $t2, 0xb0 - jr $t2 - li $t1, 0x17 - -.section .text.ResetEntryInt -.global ResetEntryInt -.type ResetEntryInt, @function -ResetEntryInt: - li $t2, 0xb0 - jr $t2 - li $t1, 0x18 - -.section .text.HookEntryInt -.global HookEntryInt -.type HookEntryInt, @function -HookEntryInt: - li $t2, 0xb0 - jr $t2 - li $t1, 0x19 - -.section .text.UnDeliverEvent -.global UnDeliverEvent -.type UnDeliverEvent, @function -UnDeliverEvent: - li $t2, 0xb0 - jr $t2 - li $t1, 0x20 - -.section .text.GetC0Table -.global GetC0Table -.type GetC0Table, @function -GetC0Table: - li $t2, 0xb0 - jr $t2 - li $t1, 0x56 - -.section .text.GetB0Table -.global GetB0Table -.type GetB0Table, @function -GetB0Table: - li $t2, 0xb0 - jr $t2 - li $t1, 0x57 - -.section .text.ChangeClearPAD -.global ChangeClearPAD -.type ChangeClearPAD, @function -ChangeClearPAD: - li $t2, 0xb0 - jr $t2 - li $t1, 0x5b - -## C0 table functions (5) - -.section .text.SysEnqIntRP -.global SysEnqIntRP -.type SysEnqIntRP, @function -SysEnqIntRP: - li $t2, 0xc0 - jr $t2 - li $t1, 0x02 - -.section .text.SysDeqIntRP -.global SysDeqIntRP -.type SysDeqIntRP, @function -SysDeqIntRP: - li $t2, 0xc0 - jr $t2 - li $t1, 0x03 - -.section .text.InstallExceptionHandlers -.global InstallExceptionHandlers -.type InstallExceptionHandlers, @function -InstallExceptionHandlers: - li $t2, 0xc0 - jr $t2 - li $t1, 0x07 - -.section .text.SysInitMemory -.global SysInitMemory -.type SysInitMemory, @function -SysInitMemory: - li $t2, 0xc0 - jr $t2 - li $t1, 0x08 - -.section .text.ChangeClearRCnt -.global ChangeClearRCnt -.type ChangeClearRCnt, @function -ChangeClearRCnt: - li $t2, 0xc0 - jr $t2 - li $t1, 0x0a - -- cgit v1.2.3