News Services: Difference between revisions

No edit summary
Line 82: Line 82:
|}
|}


=News module savedata=
=News module NAND [[System_SaveData|savedata]]=
* "news.db": This is the main save-file, the filesize is fixed to 0x2BD0-bytes.
* "news.db": This is the main save-file, the filesize is fixed to 0x2BD0-bytes.
* "newsXXX.txt" This is the [[NEWSS:AddNotification|message]] data for this notification, where XXX is the decimal notification-index in the below headers-array. The filesize should be <= <size listed [[NEWSS:GetNotificationMessage|here]]>, since that's the max size read by the notifications applet.
* "newsXXX.txt" This is the [[NEWSS:AddNotification|message]] data for this notification, where XXX is the decimal notification-index in the below headers-array. The filesize should be <= <size listed [[NEWSS:GetNotificationMessage|here]]>, since that's the max size read by the notifications applet.
Line 122: Line 122:
| Normally zero?
| Normally zero?
|}
|}
=News module startup=
The actual main function called by main() does the following:
* srv_init()
* Registers services <nowiki>"news:u" and "news:s"</nowiki>.
* 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.
* <Some func calls>
* Here [[PTMSYSM:SetInfoLEDPattern]] is used.
* Some state init is done, then the usual svcReplyAndReceive loop begins.


=Errors=
=Errors=