News Services

News Services

This system module handles the system notifications.

The maximum number of notifications that can be stored/handled is 100, hence the intended range for notificationIDs is 0-99.

News service “news:u” #

Command HeaderDescription
0x000100C8AddNotification

This service only has one command.

News service “news:s” #

Command HeaderDescription
0x000100C6AddNotification
0x0002….Stubbed, only returns 0.
0x0003….Stubbed, only returns 0.
0x00040000ResetNotifications
0x00050000GetTotalNotifications
0x00060042SetNewsDBHeader
0x00070082SetNotificationHeader
0x00080082SetNotificationMessage
0x00090082SetNotificationImage
0x000A0042GetNewsDBHeader
0x000B0082GetNotificationHeader
0x000C0082GetNotificationMessage
0x000D0082GetNotificationImage
0x000E0040SetInfoLEDPattern
0x000F0000SyncArrivedNotifications
0x00100040SyncOneArrivedNotification
0x00110040SetAutomaticSyncFlag
0x00120082SetNotificationHeaderOther
0x00130000WriteNewsDBSavedata
0x00140000GetTotalArrivedNotifications

News module NAND savedata #

  • “news.db”: This is the main save-file, the filesize is fixed to 0x2BD0-bytes.
  • “newsXXX.txt” This is the message data for this notification, where XXX is the decimal notification-index in the below headers-array. The filesize should be <= <size listed here>, since that’s the max size read by the notifications applet.
  • “newsXXX.mpo” This is the MPO data for this notification if any, where XXX is the decimal notification-index in the below headers-array. The filesize should be <= <size listed here>, since that’s the max size read by the notifications applet.

news.db #

OffsetSizeDescription
0x00x10Header, see below.
0x100x2BC0 (100 * 0x70)Array of headers for each notification.
OffsetSizeDescription
0x00x1Must be 0x1 “is valid”.
0x10x1Flags
0x20xENormally zero?

Flags #

BitDescription
0Set by news module when handling BOSS notifications and the AddNotification commands. This indicates that there’s “unread” notifications, the notifications applet clears this once all notifications have been “read”.
1Set by news module when handling CECD notifications.

News module startup #

The actual main function called by main() does the following:

  • srv_init()
  • Registers services “news:u” and “news:s”.
  • Initializes the service session handle for “ptm:sysm”.
  • Loads 4 handles from somewhere, which gets used with svcReplyAndReceive later.
  • Does notificationID state init, uses SRV:GetNotificationSemaphore, then subscribes to srv notifications 0x104 and 0x106.
  • Here PTMSYSM:SetInfoLEDPattern is used.
  • Some state init is done, then the usual svcReplyAndReceive loop begins.

Errors #

Error codeDescription
0xC8A12805The news.db or notification header data for the specified notificationID is not set(the specified notification doesn’t exist).

Title Versions #

Title versionSystem versionChanges
v71689.7.0-XAll of the changes are the following:

  • See here regarding the updated CTRSDK function code.
  • This function is eventually called by newss_cmdf, newss_cmd10, and . When calling a certain function fails in here, this code now calls before returning.
  • Mutex enter/leave function calls were added to a certain function.
  • More state init was added to the start of an initialization function called during news module startup(crt0?).
  • 0x14 new bytes were added to .rodata.