diff options
| author | spicyjpeg <thatspicyjpeg@gmail.com> | 2023-04-05 01:30:55 +0200 |
|---|---|---|
| committer | spicyjpeg <thatspicyjpeg@gmail.com> | 2023-04-05 01:30:55 +0200 |
| commit | b4242acc35c522bd4d4a951a84933ba6f80d2015 (patch) | |
| tree | 02cdff7a11329a7445baae489dd2b38225b12d96 /libpsn00b/psxapi | |
| parent | 651415f5b549b363dec971e2ef589cce098ee1f2 (diff) | |
| download | psn00bsdk-b4242acc35c522bd4d4a951a84933ba6f80d2015.tar.gz | |
Clean up all headers, add and rename some BIOS APIs
Diffstat (limited to 'libpsn00b/psxapi')
| -rw-r--r-- | libpsn00b/psxapi/drivers.s | 32 | ||||
| -rw-r--r-- | libpsn00b/psxapi/fs.s | 18 | ||||
| -rw-r--r-- | libpsn00b/psxapi/stdio.s | 36 | ||||
| -rw-r--r-- | libpsn00b/psxapi/stubs.json | 62 | ||||
| -rw-r--r-- | libpsn00b/psxapi/sys.s | 58 |
5 files changed, 153 insertions, 53 deletions
diff --git a/libpsn00b/psxapi/drivers.s b/libpsn00b/psxapi/drivers.s index d991f90..c601201 100644 --- a/libpsn00b/psxapi/drivers.s +++ b/libpsn00b/psxapi/drivers.s @@ -32,10 +32,10 @@ _96_remove: jr $t2 li $t1, 0x72 -.section .text.AddDummyTty -.global AddDummyTty -.type AddDummyTty, @function -AddDummyTty: +.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 @@ -66,26 +66,26 @@ _card_clear: ## B0 table functions (12) -.section .text.AddDev -.global AddDev -.type AddDev, @function -AddDev: +.section .text.AddDrv +.global AddDrv +.type AddDrv, @function +AddDrv: li $t2, 0xb0 jr $t2 li $t1, 0x47 -.section .text.DelDev -.global DelDev -.type DelDev, @function -DelDev: +.section .text.DelDrv +.global DelDrv +.type DelDrv, @function +DelDrv: li $t2, 0xb0 jr $t2 li $t1, 0x48 -.section .text.ListDev -.global ListDev -.type ListDev, @function -ListDev: +.section .text.ListDrv +.global ListDrv +.type ListDrv, @function +ListDrv: li $t2, 0xb0 jr $t2 li $t1, 0x49 diff --git a/libpsn00b/psxapi/fs.s b/libpsn00b/psxapi/fs.s index f225d64..8b6d57a 100644 --- a/libpsn00b/psxapi/fs.s +++ b/libpsn00b/psxapi/fs.s @@ -6,12 +6,12 @@ .set noreorder -## B0 table functions (5) +## B0 table functions (6) -.section .text.chdir -.global chdir -.type chdir, @function -chdir: +.section .text.cd +.global cd +.type cd, @function +cd: li $t2, 0xb0 jr $t2 li $t1, 0x40 @@ -48,3 +48,11 @@ erase: 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 index e65f871..14c6d03 100644 --- a/libpsn00b/psxapi/stdio.s +++ b/libpsn00b/psxapi/stdio.s @@ -6,7 +6,7 @@ .set noreorder -## A0 table functions (13) +## A0 table functions (14) .section .text.open .global open @@ -16,10 +16,10 @@ open: jr $t2 li $t1, 0x00 -.section .text.seek -.global seek -.type seek, @function -seek: +.section .text.lseek +.global lseek +.type lseek, @function +lseek: li $t2, 0xa0 jr $t2 li $t1, 0x01 @@ -56,6 +56,14 @@ ioctl: 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 @@ -112,3 +120,21 @@ printf: 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/stubs.json b/libpsn00b/psxapi/stubs.json index 50ffb55..afa83c6 100644 --- a/libpsn00b/psxapi/stubs.json +++ b/libpsn00b/psxapi/stubs.json @@ -8,7 +8,7 @@ { "type": "a", "id": 1, - "name": "seek", + "name": "lseek", "file": "stdio.s" }, { @@ -37,6 +37,12 @@ }, { "type": "a", + "id": 7, + "name": "isatty", + "file": "stdio.s" + }, + { + "type": "a", "id": 8, "name": "getc", "file": "stdio.s" @@ -109,6 +115,12 @@ }, { "type": "a", + "id": 81, + "name": "LoadExec", + "file": "sys.s" + }, + { + "type": "a", "id": 85, "name": "_bu_init", "file": "drivers.s" @@ -128,7 +140,7 @@ { "type": "a", "id": 153, - "name": "AddDummyTty", + "name": "add_nullcon_driver", "file": "drivers.s" }, { @@ -139,6 +151,18 @@ }, { "type": "a", + "id": 157, + "name": "GetConf", + "file": "sys.s" + }, + { + "type": "a", + "id": 159, + "name": "SetMem", + "file": "sys.s" + }, + { + "type": "a", "id": 160, "name": "_boot", "file": "sys.s" @@ -170,13 +194,13 @@ { "type": "b", "id": 0, - "name": "_kernel_malloc", + "name": "alloc_kernel_memory", "file": "sys.s" }, { "type": "b", "id": 1, - "name": "_kernel_free", + "name": "free_kernel_memory", "file": "sys.s" }, { @@ -296,13 +320,13 @@ { "type": "b", "id": 24, - "name": "SetDefaultExitFromException", + "name": "ResetEntryInt", "file": "sys.s" }, { "type": "b", "id": 25, - "name": "SetCustomExitFromException", + "name": "HookEntryInt", "file": "sys.s" }, { @@ -314,7 +338,7 @@ { "type": "b", "id": 64, - "name": "chdir", + "name": "cd", "file": "fs.s" }, { @@ -343,20 +367,26 @@ }, { "type": "b", + "id": 70, + "name": "undelete", + "file": "fs.s" + }, + { + "type": "b", "id": 71, - "name": "AddDev", + "name": "AddDrv", "file": "drivers.s" }, { "type": "b", "id": 72, - "name": "DelDev", + "name": "DelDrv", "file": "drivers.s" }, { "type": "b", "id": 73, - "name": "ListDev", + "name": "ListDrv", "file": "drivers.s" }, { @@ -397,6 +427,18 @@ }, { "type": "b", + "id": 84, + "name": "_get_errno", + "file": "stdio.s" + }, + { + "type": "b", + "id": 85, + "name": "_get_error", + "file": "stdio.s" + }, + { + "type": "b", "id": 86, "name": "GetC0Table", "file": "sys.s" diff --git a/libpsn00b/psxapi/sys.s b/libpsn00b/psxapi/sys.s index e2505e1..40dcdff 100644 --- a/libpsn00b/psxapi/sys.s +++ b/libpsn00b/psxapi/sys.s @@ -6,7 +6,7 @@ .set noreorder -## A0 table functions (8) +## A0 table functions (11) .section .text.b_setjmp .global b_setjmp @@ -48,6 +48,14 @@ FlushCache: 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 @@ -56,6 +64,22 @@ SetConf: 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 @@ -74,18 +98,18 @@ GetSystemInfo: ## B0 table functions (27) -.section .text._kernel_malloc -.global _kernel_malloc -.type _kernel_malloc, @function -_kernel_malloc: +.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._kernel_free -.global _kernel_free -.type _kernel_free, @function -_kernel_free: +.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 @@ -242,18 +266,18 @@ ReturnFromException: jr $t2 li $t1, 0x17 -.section .text.SetDefaultExitFromException -.global SetDefaultExitFromException -.type SetDefaultExitFromException, @function -SetDefaultExitFromException: +.section .text.ResetEntryInt +.global ResetEntryInt +.type ResetEntryInt, @function +ResetEntryInt: li $t2, 0xb0 jr $t2 li $t1, 0x18 -.section .text.SetCustomExitFromException -.global SetCustomExitFromException -.type SetCustomExitFromException, @function -SetCustomExitFromException: +.section .text.HookEntryInt +.global HookEntryInt +.type HookEntryInt, @function +HookEntryInt: li $t2, 0xb0 jr $t2 li $t1, 0x19 |
