diff options
-rw-r--r-- | include/kernel/audioout.h | 21 | ||||
-rw-r--r-- | include/kernel/display.h | 12 | ||||
-rw-r--r-- | include/kernel/kernel/processmgr.h | 6 | ||||
-rw-r--r-- | include/kernel/kernel/sysmem.h | 5 | ||||
-rw-r--r-- | include/kernel/kernel/threadmgr.h | 3 | ||||
-rw-r--r-- | include/kernel/lowio/iftu.h | 26 | ||||
-rw-r--r-- | include/kernel/power.h | 19 | ||||
-rw-r--r-- | include/kernel/sblacmgr.h | 1 | ||||
-rw-r--r-- | include/kernel/udcd.h | 2 | ||||
-rw-r--r-- | include/user/kernel/clib.h | 1 | ||||
-rw-r--r-- | include/user/kernel/processmgr.h | 3 | ||||
-rw-r--r-- | include/user/kernel/threadmgr.h | 3 | ||||
-rw-r--r-- | include/user/registrymgr.h | 4 | ||||
-rw-r--r-- | nids/360/SceSysmem.yml | 1 |
14 files changed, 90 insertions, 17 deletions
diff --git a/include/kernel/audioout.h b/include/kernel/audioout.h new file mode 100644 index 0000000..c1381ee --- /dev/null +++ b/include/kernel/audioout.h @@ -0,0 +1,21 @@ +#ifndef _PSP2_KERNEL_AUDIOOUT_H_ +#define _PSP2_KERNEL_AUDIOOUT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum SceAudioOutPortType { + //! Used for main audio output, freq must be set to 48000 Hz + SCE_AUDIO_OUT_PORT_TYPE_MAIN = 0, + //! Used for Background Music port + SCE_AUDIO_OUT_PORT_TYPE_BGM = 1, + //! Used for voice chat port + SCE_AUDIO_OUT_PORT_TYPE_VOICE = 2 +} SceAudioOutPortType; + +#ifdef __cplusplus +} +#endif + +#endif /* _PSP2_KERNEL_AUDIOOUT_H_ */ diff --git a/include/kernel/display.h b/include/kernel/display.h index 18800c5..5cfdc9a 100644 --- a/include/kernel/display.h +++ b/include/kernel/display.h @@ -277,6 +277,18 @@ int sceDisplaySetInvertColors(int display, int enable); */ int sceDisplaySetOwner(int head, int index, SceUID pid); +/** + * Set display scaling configuration + * + * @param[in] scale - Scaling factor between 0.80000001 and 1.20000005 + * @param[in] head - Use 0 for OLED/LCD and 1 for HDMI + * @param[in] index - Can be 0 or 1 + * @param[in] flags - Returns error if ((flags & 1) && (flags & 0xC0)) + * + * @return 0 on success, < 0 on error. +*/ +int sceDisplaySetScaleConf(float scale, int head, int index, int flags); + #ifdef __cplusplus } #endif diff --git a/include/kernel/kernel/processmgr.h b/include/kernel/kernel/processmgr.h index e0209f9..465066e 100644 --- a/include/kernel/kernel/processmgr.h +++ b/include/kernel/kernel/processmgr.h @@ -7,6 +7,12 @@ extern "C" { #endif +/** UID of the current process */ +#define SCE_KERNEL_PROCESS_ID_SELF 0 + +/** UID of the kernel process */ +#define SCE_KERNEL_PROCESS_ID_KERNEL 0x10005 + typedef struct SceKernelProcessInfo { SceSize size; //!< size of this struct, make sure it's 0xE8 SceUID pid; //!< our process ID diff --git a/include/kernel/kernel/sysmem.h b/include/kernel/kernel/sysmem.h index 978db42..3b3ebc0 100644 --- a/include/kernel/kernel/sysmem.h +++ b/include/kernel/kernel/sysmem.h @@ -1,6 +1,7 @@ #ifndef _PSP2_KERNEL_SYSMEM_H_ #define _PSP2_KERNEL_SYSMEM_H_ +#include <stdarg.h> #include <psp2kern/types.h> #ifdef __cplusplus @@ -439,7 +440,9 @@ typedef struct kernel_message_ctx // msg_type_flag : 0 or 0xB int sceDebugPrintf2(int msg_type_flag, kernel_message_ctx *msg_ctx, const char *fmt, ...); - + +int sceDebugVprintf(const char *fmt, va_list args); + int sceDebugPrintKernelPanic(kernel_message_ctx *msg_ctx, void *some_address); int sceDebugPrintfKernelPanic(kernel_message_ctx *msg_ctx, void *some_address, char* format, ...); diff --git a/include/kernel/kernel/threadmgr.h b/include/kernel/kernel/threadmgr.h index 61f96b3..14d0cfd 100644 --- a/include/kernel/kernel/threadmgr.h +++ b/include/kernel/kernel/threadmgr.h @@ -14,6 +14,9 @@ typedef SceUInt64 SceKernelSysClock; /* Threads. */ +/** UID of the current thread */ +#define SCE_KERNEL_THREAD_ID_SELF 0 + typedef int (*SceKernelThreadEntry)(SceSize args, void *argp); /** Additional options used when creating threads. */ diff --git a/include/kernel/lowio/iftu.h b/include/kernel/lowio/iftu.h index 29b233f..a03d221 100644 --- a/include/kernel/lowio/iftu.h +++ b/include/kernel/lowio/iftu.h @@ -69,19 +69,19 @@ typedef struct SceIftuFrameBuf { typedef struct SceIftuPlaneState { SceIftuFrameBuf fb; - unsigned int unk20; - unsigned int src_x; /* In (0x10000 / 960) multiples */ - unsigned int src_y; /* in (0x10000 / 544) multiples */ - unsigned int src_w; /* in (0x10000 / 960) multiples */ - unsigned int src_h; /* in (0x10000 / 544) multiples */ - unsigned int dst_x; - unsigned int dst_y; - unsigned int dst_w; - unsigned int dst_h; - unsigned int vtop_padding; - unsigned int vbot_padding; /* h - aligned_h */ - unsigned int hleft_padding; - unsigned int hright_padding; /* w - aligned_w */ + unsigned int unk20; /* not observed to be non-zero */ + unsigned int unk24; /* not observed to be non-zero */ + unsigned int unk28; /* not observed to be non-zero */ + unsigned int src_w; /* inverse scaling factor in 16.16 fixed point, greater than or equal to 0.25 */ + unsigned int src_h; /* inverse scaling factor in 16.16 fixed point, greater than or equal to 0.25 */ + unsigned int dst_x; /* offset into the destination buffer */ + unsigned int dst_y; /* offset into the destination buffer */ + unsigned int src_x; /* offset into the source buffer in 8.8 fixed point, strictly less than 4.0 */ + unsigned int src_y; /* offset into the source buffer in 8.8 fixed point, strictly less than 4.0 */ + unsigned int crop_top; + unsigned int crop_bot; + unsigned int crop_left; + unsigned int crop_right; } SceIftuPlaneState; int sceIftuCsc(SceIftuFrameBuf *dst, SceIftuPlaneState *src, SceIftuConvParams *params); diff --git a/include/kernel/power.h b/include/kernel/power.h index 105535a..b56731b 100644 --- a/include/kernel/power.h +++ b/include/kernel/power.h @@ -246,6 +246,25 @@ int scePowerSetGpuClockFrequency(int freq); */ int scePowerSetGpuXbarClockFrequency(int freq); +/** + * Sets the time before idle callback is notified. + * + * @param callback_slot - Callback slot from 0 to 7. + * @param time - Time in microseconds. + * + * @return 0 on success, < 0 on error + */ +int scePowerSetIdleTimer(int callback_slot, SceUInt64 time); + +/** + * Sets the PS button hold time for showing the quick menu. + * + * @param time - Time in microseconds. + * + * @return 0 always + */ +int scePowerSetPsButtonPushTime(int time); + #ifdef __cplusplus } #endif diff --git a/include/kernel/sblacmgr.h b/include/kernel/sblacmgr.h index 99621dc..04a182c 100644 --- a/include/kernel/sblacmgr.h +++ b/include/kernel/sblacmgr.h @@ -8,6 +8,7 @@ extern "C" { #endif int sceSblACMgrIsShell(SceUID pid); +int sceSblACMgrIsPspEmu(SceUID pid); int sceSblACMgrIsGameProgram(SceUID pid); int sceSblACMgrIsNonGameProgram(SceUID pid); int sceSblACMgrIsDevelopmentMode(void); diff --git a/include/kernel/udcd.h b/include/kernel/udcd.h index f23024f..25d1e2a 100644 --- a/include/kernel/udcd.h +++ b/include/kernel/udcd.h @@ -2,7 +2,7 @@ #define _PSP2_KERNEL_UDCD_H_ #include <psp2kern/types.h> -#include <vitasdk/align.h> +#include <dolcesdk/align.h> #ifdef __cplusplus extern "C" { diff --git a/include/user/kernel/clib.h b/include/user/kernel/clib.h index a7aa75e..72f60e7 100644 --- a/include/user/kernel/clib.h +++ b/include/user/kernel/clib.h @@ -21,6 +21,7 @@ int sceClibTolower(char ch); int sceClibToupper(char ch); int sceClibPrintf(const char *fmt, ...); +int sceClibVprintf(const char *fmt, va_list args); int sceClibSnprintf(char *dst, SceSize dst_max_size, const char *fmt, ...); int sceClibVsnprintf(char *dst, SceSize dst_max_size, const char *fmt, va_list args); diff --git a/include/user/kernel/processmgr.h b/include/user/kernel/processmgr.h index 272fe51..70e50b6 100644 --- a/include/user/kernel/processmgr.h +++ b/include/user/kernel/processmgr.h @@ -8,6 +8,9 @@ extern "C" { #endif +/** UID of the current process */ +#define SCE_KERNEL_PROCESS_ID_SELF 0 + typedef enum SceKernelProcessPrioritySystem { SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_HIGH = 32, SCE_KERNEL_PROCESS_PRIORITY_SYSTEM_DEFAULT = 96, diff --git a/include/user/kernel/threadmgr.h b/include/user/kernel/threadmgr.h index c5d93b7..9d42eb4 100644 --- a/include/user/kernel/threadmgr.h +++ b/include/user/kernel/threadmgr.h @@ -12,6 +12,9 @@ typedef SceUInt64 SceKernelSysClock; /* Threads. */ +/** UID of the current thread */ +#define SCE_KERNEL_THREAD_ID_SELF 0 + typedef int (*SceKernelThreadEntry)(SceSize args, void *argp); /** Additional options used when creating threads. */ diff --git a/include/user/registrymgr.h b/include/user/registrymgr.h index cc363b5..dbf4946 100644 --- a/include/user/registrymgr.h +++ b/include/user/registrymgr.h @@ -59,11 +59,11 @@ int sceRegMgrSetKeyBin(const char *category, const char *name, void *buf, int si * * @param category - The path to the directory to be opened (e.g. /CONFIG/SYSTEM) * @param name - Name of the key - * @param buf - Pointer to an int buffer to hold the value + * @param value - Value to set to * * @return 0 on success, < 0 on error */ -int sceRegMgrSetKeyInt(const char* category, const char* name, int buf); +int sceRegMgrSetKeyInt(const char* category, const char* name, int value); /** * Set a key's information by category and name diff --git a/nids/360/SceSysmem.yml b/nids/360/SceSysmem.yml index 29cf2b2..414ea4d 100644 --- a/nids/360/SceSysmem.yml +++ b/nids/360/SceSysmem.yml @@ -147,6 +147,7 @@ modules: sceDebugPrintf2: 0x02B04343 sceDebugPrintfKernelAssertion: 0x821A2D59 sceDebugPrintfKernelPanic: 0x00CCE39C + sceDebugVprintf: 0x411C0733 SceDebugForKernel: nid: 0x88C17370 functions: |