This commit is contained in:
2024-05-11 23:24:13 +02:00
commit e66c5afde0
130 changed files with 17039 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
package notificationutil
import "core:c"
import sce "../common"
foreign import notificationutil "system:SceNotificationUtil_stub"
@(link_prefix = "sceNotificationUtil")
foreign notificationutil {
/**
* Initialize notification util for use with BG application.
*
* Does not need to be called for normal applications.
*/
BgAppInitialize :: proc() -> sce.Int32 ---
/**
* Send notification.
*
* Text buffer size must be 0x410.
*/
SendNotification :: proc(text: [^]sce.WChar16) -> sce.Int32 ---
/**
* Clean notifications for calling app from notification history.
*/
CleanHistory :: proc() -> sce.Int32 ---
/**
* Start BGDL-type notification.
*/
ProgressBegin :: proc(initParams: ^SceNotificationUtilProgressInitParam) -> sce.Int32 ---
/**
* Update BGDL-type notification.
*/
ProgressUpdate :: proc(updateParams: ^SceNotificationUtilProgressUpdateParam) -> sce.Int32 ---
/**
* Finish BGDL-type notification.
*/
ProgressFinish :: proc(finishParams: ^SceNotificationUtilProgressFinishParam) -> sce.Int32 ---
}
+55
View File
@@ -0,0 +1,55 @@
package notificationutil
import "core:c"
import sce "../common"
/**
* Constants
*/
SCE_NOTIFICATIONUTIL_TEXT_MAX :: 0x3F
/**
* Error Codes
*/
// TODO:
SceNotificationUitlErrorCode :: enum c.uint {
INTERNAL = 0x80106300
}
/**
* BGDL-type notification event handler function
*/
SceNotificationUtilProgressEventHandler :: #type ^proc "c" (eventId: c.int)
SceNotificationUtilProgressInitParam :: struct {
notificationText: [SCE_NOTIFICATIONUTIL_TEXT_MAX]sce.WChar16,
separator0: sce.Int16, //must be 0
notificationSubText: [SCE_NOTIFICATIONUTIL_TEXT_MAX]sce.WChar16,
separator1: sce.Int16, //must be 0
unk: [0x3E6]sce.Char8,
unk_4EC: sce.Int32, //can be set to 0
eventHandler: SceNotificationUtilProgressEventHandler,
}
when size_of(rawptr) == 4 {
#assert(size_of(SceNotificationUtilProgressInitParam) == 0x4F0)
}
SceNotificationUtilProgressUpdateParam :: struct {
notificationText: [SCE_NOTIFICATIONUTIL_TEXT_MAX]sce.WChar16,
separator0: sce.Int16, //must be 0
notificationSubText: [SCE_NOTIFICATIONUTIL_TEXT_MAX]sce.WChar16,
separator1: sce.Int16, //must be 0
targetProgress: sce.Float,
reserved: [0x38]sce.Char8,
}
#assert(size_of(SceNotificationUtilProgressUpdateParam) == 0x13C)
SceNotificationUtilProgressFinishParam :: struct {
notificationText: [SCE_NOTIFICATIONUTIL_TEXT_MAX]sce.WChar16,
separator0: sce.Int16, //must be 0
notificationSubText: [SCE_NOTIFICATIONUTIL_TEXT_MAX]sce.WChar16,
separator1: sce.Int16, //must be 0
path: [0x3E8]sce.Char8,
}
#assert(size_of(SceNotificationUtilProgressFinishParam) == 0x4E8)