Skip to content

Commit

Permalink
Notification tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-Azif committed Feb 28, 2021
1 parent f8e6a0c commit bbf8498
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions libPS4/include/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ typedef struct {
char message[1024]; //0x2D
char uri[1024]; //0x42D
char unkstr[1024]; //0x82D
} NotificationBuffer; //Size = 0xC30
} SceNotificationRequest; //Size = 0xC30

typedef struct timeval SceKernelTimeval;
typedef uint64_t SceKernelEqueue;
Expand Down Expand Up @@ -82,7 +82,7 @@ extern int (*setgid)(int gid);
extern int (*setreuid)(int ruid, int euid);
extern int (*setregid)(int rgid, int egid);

extern int (*sceKernelSendNotificationRequest)(int64_t unk1, char *Buffer, size_t size, int64_t unk2);
extern int (*sceKernelSendNotificationRequest)(int device, SceNotificationRequest *req, size_t size, int blocking);
extern const char *(*sceKernelGetFsSandboxRandomWord)();
extern int (*sceKernelGetSystemSwVersion)(SceFwInfo *fw_info);

Expand Down
24 changes: 12 additions & 12 deletions libPS4/include/sysutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ void shutdown();

// HUGE shoutout to OSM-Made for removing the need to use the football/soccer icon in the notifications
// https://github.com/OSM-Made/PS4-Notify
#define printf_notification(...) \
do { \
NotificationBuffer noti_buffer; \
char icon_uri[38] = "cxml://psnotification/tex_icon_system"; \
noti_buffer.type = 0; \
noti_buffer.unk3 = 0; \
noti_buffer.use_icon_image_uri = 1; \
noti_buffer.target_id = -1; \
strncpy_s(noti_buffer.uri, sizeof(noti_buffer.uri), icon_uri, sizeof(icon_uri)); \
snprintf_s(noti_buffer.message, sizeof(noti_buffer.message), ##__VA_ARGS__); \
printf_debug("[NOTIFICATION]: %s\n", noti_buffer.message); \
sceKernelSendNotificationRequest(0, (char *)&noti_buffer, 3120, 0); \
#define printf_notification(...) \
do { \
SceNotificationRequest noti_buffer; \
char icon_uri[38] = "cxml://psnotification/tex_icon_system"; \
noti_buffer.type = 0; \
noti_buffer.unk3 = 0; \
noti_buffer.use_icon_image_uri = 1; \
noti_buffer.target_id = -1; \
snprintf_s(noti_buffer.uri, sizeof(noti_buffer.uri), icon_uri); \
snprintf_s(noti_buffer.message, sizeof(noti_buffer.message), ##__VA_ARGS__); \
printf_debug("[NOTIFICATION]: %s\n", noti_buffer.message); \
sceKernelSendNotificationRequest(0, (SceNotificationRequest *)&noti_buffer, sizeof(noti_buffer), 0); \
} while (0)

#endif
2 changes: 1 addition & 1 deletion libPS4/source/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int (*setgid)(int gid);
int (*setreuid)(int ruid, int euid);
int (*setregid)(int rgid, int egid);

int (*sceKernelSendNotificationRequest)(int64_t unk1, char *Buffer, size_t size, int64_t unk2);
int (*sceKernelSendNotificationRequest)(int device, SceNotificationRequest *req, size_t size, int blocking);
const char *(*sceKernelGetFsSandboxRandomWord)();
int (*sceKernelGetSystemSwVersion)(SceFwInfo *fw_info);

Expand Down

0 comments on commit bbf8498

Please sign in to comment.