Difference between revisions of "AMPXI:WriteTWLSavedata"

From 3dbrew
Jump to navigation Jump to search
(Created page with "=Request= {| class="wikitable" border="1" |- ! Index Word ! Description |- | 0 | Header code [0x00460182] |- | 1 | TWL TitleID lower word |- | 2 | TWL TitleID upper word |- | 3...")
 
 
(10 intermediate revisions by 2 users not shown)
Line 8: Line 8:
 
| Header code [0x00460182]
 
| Header code [0x00460182]
 
|-
 
|-
| 1
+
| 1-2
| TWL TitleID lower word
+
| u64, TWL Title ID
|-
 
| 2
 
| TWL TitleID upper word
 
 
|-
 
|-
 
| 3
 
| 3
| Input buffer size
+
| Input size
 
|-
 
|-
 
| 4
 
| 4
| u32, unknown
+
| NAND file offset
 
|-
 
|-
 
| 5
 
| 5
| u8, unknown
+
| u8, Section type. See below.
 
|-
 
|-
 
| 6
 
| 6
| u8, unknown
+
| u8, [[AM:ImportDSiWare|Operation]]. Must be 5 or 11.
 
|-
 
|-
 
| 7
 
| 7
| (Size<<8) <nowiki>|</nowiki> 6
+
| (Size << 8) <nowiki>|</nowiki> 6
 
|-
 
|-
 
| 8
 
| 8
| Ptr for the input buffer
+
| Input pointer
 
|}
 
|}
  
Line 40: Line 37:
 
|-
 
|-
 
| 0
 
| 0
| Header code
+
| Header code [0x00460040]
 
|-
 
|-
 
| 1
 
| 1
 
| Result code
 
| Result code
 +
|}
 +
 +
=Section types=
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Section type
 +
!  Allowed with operation type
 +
!  Written filename
 +
!  Normal filename
 +
|-
 +
| 5
 +
| Both
 +
| "public.new"
 +
| "public.sav"
 +
|-
 +
| 6
 +
| Both
 +
| "banner.new"
 +
| "banner.sav"
 +
|-
 +
| 7
 +
| 11
 +
| "private.new"
 +
| "private.sav"
 
|}
 
|}
  
 
=Description=
 
=Description=
This writes the specified input buffer data to the specified TWL-NAND title raw savedata image.
+
This writes the specified input plaintext buffer data to the specified TWL-NAND title raw ".new" file. The file which is written to in NAND depends on the section_type.
 +
 
 +
The ".new" files written by this are moved to the regular filenames by [[AMPXI:InstallTitlesFinish]] / other install-finish command(s).
 +
 
 +
When used with sections which the title doesn't actually use, this command returns 0, but after the DSiWare import is all finished the .sav/.new files for those sections don't exist under the NAND data/. The filesizes are also set to the sizes used by the title by the time the import is finished(trying to write larger savedata with this command doesn't change the final filesize in NAND).

Latest revision as of 00:54, 25 October 2016

Request[edit]

Index Word Description
0 Header code [0x00460182]
1-2 u64, TWL Title ID
3 Input size
4 NAND file offset
5 u8, Section type. See below.
6 u8, Operation. Must be 5 or 11.
7 (Size << 8) | 6
8 Input pointer

Response[edit]

Index Word Description
0 Header code [0x00460040]
1 Result code

Section types[edit]

Section type Allowed with operation type Written filename Normal filename
5 Both "public.new" "public.sav"
6 Both "banner.new" "banner.sav"
7 11 "private.new" "private.sav"

Description[edit]

This writes the specified input plaintext buffer data to the specified TWL-NAND title raw ".new" file. The file which is written to in NAND depends on the section_type.

The ".new" files written by this are moved to the regular filenames by AMPXI:InstallTitlesFinish / other install-finish command(s).

When used with sections which the title doesn't actually use, this command returns 0, but after the DSiWare import is all finished the .sav/.new files for those sections don't exist under the NAND data/. The filesizes are also set to the sizes used by the title by the time the import is finished(trying to write larger savedata with this command doesn't change the final filesize in NAND).