BOSSU:GetNsDataIdList: Difference between revisions

DaniElectra (talk | contribs)
m Internals: Add more info about first type parameter
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=Request=
=Request=
{{IPC/Request}}
{{IPC/Request}}
{{#vardefine:ipc_offset|0}}
{{IPC/RequestHeader|0x0010|4|2}}
{{IPC/RequestEntry|Header code [0x00100102]}}
{{IPC/RequestEntry|u32, Filter}}
{{IPC/RequestEntry|Unknown, usually 0xffffffff.}}
{{IPC/RequestEntry|u32, Number of entries that the list can hold (max entries)}}
{{IPC/RequestEntry|Buffer size in words(max entries).}}
{{IPC/RequestEntry|u16, Starting index in the internal NS Data ID list}}
{{IPC/RequestEntry|u16, unknown.}}
{{IPC/RequestEntry|u32, Starting NS Data ID}}
{{IPC/RequestEntry|u32, unknown.}}
{{IPC/MapPointerW|Output NS Data ID list}}
{{IPC/MapPointerW|Destination pointer}}
{{IPC/RequestEnd}}
{{IPC/RequestEnd}}


Line 13: Line 12:
{{IPC/Request}}
{{IPC/Request}}
{{#vardefine:ipc_offset|0}}
{{#vardefine:ipc_offset|0}}
{{IPC/RequestEntry|Header code}}
{{IPC/RequestHeader|0x0010|3|2}}
{{IPC/RequestEntry|Result code}}
{{IPC/RequestEntry|Result code}}
{{IPC/RequestEntry|u16 Actual number of output entries.}}
{{IPC/RequestEntry|u16, Actual number of output entries}}
{{IPC/RequestEntry|u16 Unknown}}
{{IPC/RequestEntry|u16, Last index copied to output in the internal NS Data ID list}}
{{IPC/MapPointerW|Output NS Data ID list}}
{{IPC/RequestEnd}}
{{IPC/RequestEnd}}


=Description=
=Description=
This writes an array of u32 entries(NsDataId) to the output buffer, for the current programID.
Writes an array of NS Data ID entries (u32) for the program ID of the current session to the output buffer using the provided filters.
 
==Internals==
This eventually calls a function with the following type parameters: 0, 1, 1. This function doesn't use the second type parameter. Afterwards another function is called using the program ID.
 
The first type parameter is a filter based on the new flag of the NsData:
 
{| class="wikitable" border="1"
! Value !! Description
|-
| 0 || Allow everything. This will also unset the [[BOSS_Savegame#BOSS_A_TitleInfo|arrival flag]]
|-
| 1 || Only allow entries which don't have the new flag set. This will also set the [[BOSS_Savegame#BOSS_A_TitleInfo|arrival flag]]
|-
| 2 || Only allow entries which have the new flag set. This will also set the [[BOSS_Savegame#BOSS_A_TitleInfo|arrival flag]]
|}
 
The second type parameter represents the session being used for the command:
 
{| class="wikitable" border="1"
! Value !! Description
|-
| 1 || User
|-
| 2 || Privileged
|}
 
The third type parameter is a filter based on the program ID of the session:
 
{| class="wikitable" border="1"
! Value !! Description
|-
| 0 || Allow everything
|-
| 1 || Only allow entries which have a target program ID matching the program ID of the session
|}
 
Hence, this command only lists entries whose program ID matches the one from this session.
 
=Filter=
Content filtering is enabled when this word isn't 0xFFFFFFFF. This is only used for the following: <code>if (filterword_u16high != contentdatatype_u16high || (filterword_u16low & contentdatatype_u16low) == 0) continue;</code> Hence, filterword_u16high must match contentdatatype_u16high, and the bitmask specified by filterword_u16low must be non-zero in contentdatatype_u16low. The contentdatatype is extracted from the extdata filename, which originates from the [[SpotPass|BOSS-container]]. The NS Data ID for the content entry is only written to the output when processing isn't skipped due to filtering.
 
=Start NsDataId=
This field is only used when the starting index is non-zero or when this field is non-zero.


This eventually calls a function with the following type parameters: 0, 1, 1. This function doesn't use the second type parameter. Afterwards another function is called using the programID.
The NS Data ID at the specified starting index must match this field, otherwise error 0xD840F846 is returned. It will then skip normal content entry processing for this matching entry (cur_wordindex is field is increased by 0x1 before starting the content entry processing loop).