Changes

Jump to navigation Jump to search
No change in size ,  21:15, 12 November 2018
no edit summary
Line 287: Line 287:  
|  
 
|  
 
| End
 
| End
|}
  −
  −
=== Duplex header ===
  −
  −
* Block sizes are stored as powers of 2
  −
  −
{| class="wikitable"
  −
|-
  −
! Start
  −
! Length
  −
! Description
  −
|-
  −
| 0x00
  −
| 4
  −
| Magic ("DPFS")
  −
|-
  −
| 0x04
  −
| 4
  −
| Version (Upper 2 bytes must be 0x0001)
  −
|-
  −
| 0x08
  −
| 8
  −
| Master bitmap offset
  −
|-
  −
| 0x10
  −
| 8
  −
| Master bitmap size
  −
|-
  −
| 0x18
  −
| 4
  −
| Master bitmap block size power
  −
|-
  −
| 0x1C
  −
| 8
  −
| Level 1 offset
  −
|-
  −
| 0x24
  −
| 8
  −
| Level 1 size
  −
|-
  −
| 0x2C
  −
| 4
  −
| Level 1 block size power
  −
|-
  −
| 0x30
  −
| 8
  −
| Level 2 offset
  −
|-
  −
| 0x38
  −
| 8
  −
| Level 2 size
  −
|-
  −
| 0x40
  −
| 4
  −
| Level 2 block size power
  −
|-
   
|}
 
|}
   Line 474: Line 418:  
| Padding
 
| Padding
 
|-
 
|-
|}
  −
  −
=== Save FS header ===
  −
  −
* Structure is different than 3DS.
  −
  −
{| class="wikitable"
  −
|-
  −
! Start
  −
! Length
  −
! Description
  −
|-
  −
| 0x00
  −
| 4
  −
| Magic ("SAVE")
  −
|-
  −
| 0x04
  −
| 4
  −
| Version (Upper 2 bytes must be 0x0006)
  −
|-
  −
| 0x08
  −
| 8
  −
| Number of blocks. Does not change if save file is resized.
  −
|-
  −
| 0x10
  −
| 8
  −
| Block Size
  −
|-
  −
| 0x18
  −
| 0x30
  −
| FAT header
  −
|-
  −
|}
  −
  −
==== File allocation table header ====
  −
  −
{| class="wikitable"
  −
|-
  −
! Start
  −
! Length
  −
! Description
  −
|-
  −
| 0x00
  −
| 8
  −
| Block size
  −
|-
  −
| 0x08
  −
| 8
  −
| FAT offset
  −
|-
  −
| 0x10
  −
| 4
  −
| FAT entry count
  −
|-
  −
| 0x14
  −
| 4
  −
| Padding
  −
|-
  −
| 0x18
  −
| 8
  −
| Data offset
  −
|-
  −
| 0x20
  −
| 4
  −
| Data block count
  −
|-
  −
| 0x24
  −
| 4
  −
| Padding
  −
|-
  −
| 0x28
  −
| 4
  −
| Directory table block index
  −
|-
  −
| 0x2C
  −
| 4
  −
| File table block index
  −
|-
  −
|}
  −
  −
=== Remap storage header ===
  −
  −
{| class="wikitable"
  −
|-
  −
! Start
  −
! Length
  −
! Description
  −
|-
  −
| 0x00
  −
| 4
  −
| Magic ("RMAP")
  −
|-
  −
| 0x04
  −
| 4
  −
| Version (Must be 0x10000 or less)
  −
|-
  −
| 0x08
  −
| 4
  −
| Number of remapping entries
  −
|-
  −
| 0x0C
  −
| 4
  −
| Number of remapping segments
  −
|-
  −
| 0x10
  −
| 4
  −
| Number of bits reserved for the segment index in virtual offsets
  −
|-
  −
| 0x40
  −
|
  −
| End
   
|}
 
|}
   Line 647: Line 480:  
If 4 bits were reserved for the segment index, the offset would be split like this, representing offset 0x100 of segment 3.<br />
 
If 4 bits were reserved for the segment index, the offset would be split like this, representing offset 0x100 of segment 3.<br />
 
Segment index: 0x3 Offset: 0x000000000000100
 
Segment index: 0x3 Offset: 0x000000000000100
 +
 +
=== Remap storage header ===
 +
 +
{| class="wikitable"
 +
|-
 +
! Start
 +
! Length
 +
! Description
 +
|-
 +
| 0x00
 +
| 4
 +
| Magic ("RMAP")
 +
|-
 +
| 0x04
 +
| 4
 +
| Version (Must be 0x10000 or less)
 +
|-
 +
| 0x08
 +
| 4
 +
| Number of remapping entries
 +
|-
 +
| 0x0C
 +
| 4
 +
| Number of remapping segments
 +
|-
 +
| 0x10
 +
| 4
 +
| Number of bits reserved for the segment index in virtual offsets
 +
|-
 +
| 0x40
 +
|
 +
| End
 +
|}
    
=== Remapping Entry ===
 
=== Remapping Entry ===
Line 698: Line 564:  
This allows for atomic operations on the Hierarchical Duplex Storage. When writing to the storage, data will be written to the inactive blocks and inactive bitmaps. When the data is committed the bit in the save file header is flipped, changing which master bitmap is active.
 
This allows for atomic operations on the Hierarchical Duplex Storage. When writing to the storage, data will be written to the inactive blocks and inactive bitmaps. When the data is committed the bit in the save file header is flipped, changing which master bitmap is active.
   −
== Files ==
+
=== Duplex header ===
 +
 
 +
* Block sizes are stored as powers of 2
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Start
 +
! Length
 +
! Description
 +
|-
 +
| 0x00
 +
| 4
 +
| Magic ("DPFS")
 +
|-
 +
| 0x04
 +
| 4
 +
| Version (Upper 2 bytes must be 0x0001)
 +
|-
 +
| 0x08
 +
| 8
 +
| Master bitmap offset
 +
|-
 +
| 0x10
 +
| 8
 +
| Master bitmap size
 +
|-
 +
| 0x18
 +
| 4
 +
| Master bitmap block size power
 +
|-
 +
| 0x1C
 +
| 8
 +
| Level 1 offset
 +
|-
 +
| 0x24
 +
| 8
 +
| Level 1 size
 +
|-
 +
| 0x2C
 +
| 4
 +
| Level 1 block size power
 +
|-
 +
| 0x30
 +
| 8
 +
| Level 2 offset
 +
|-
 +
| 0x38
 +
| 8
 +
| Level 2 size
 +
|-
 +
| 0x40
 +
| 4
 +
| Level 2 block size power
 +
|-
 +
|}
 +
 
 +
== Save FS ==
 +
 
 +
=== Save FS header ===
 +
 
 +
* Structure is different than 3DS.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Start
 +
! Length
 +
! Description
 +
|-
 +
| 0x00
 +
| 4
 +
| Magic ("SAVE")
 +
|-
 +
| 0x04
 +
| 4
 +
| Version (Upper 2 bytes must be 0x0006)
 +
|-
 +
| 0x08
 +
| 8
 +
| Number of blocks. Does not change if save file is resized.
 +
|-
 +
| 0x10
 +
| 8
 +
| Block Size
 +
|-
 +
| 0x18
 +
| 0x30
 +
| FAT header
 +
|-
 +
|}
 +
 
 +
=== File allocation table header ===
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Start
 +
! Length
 +
! Description
 +
|-
 +
| 0x00
 +
| 8
 +
| Block size
 +
|-
 +
| 0x08
 +
| 8
 +
| FAT offset
 +
|-
 +
| 0x10
 +
| 4
 +
| FAT entry count
 +
|-
 +
| 0x14
 +
| 4
 +
| Padding
 +
|-
 +
| 0x18
 +
| 8
 +
| Data offset
 +
|-
 +
| 0x20
 +
| 4
 +
| Data block count
 +
|-
 +
| 0x24
 +
| 4
 +
| Padding
 +
|-
 +
| 0x28
 +
| 4
 +
| Directory table block index
 +
|-
 +
| 0x2C
 +
| 4
 +
| File table block index
 +
|-
 +
|}
    
=== Directory Table Entry ===
 
=== Directory Table Entry ===
74

edits

Navigation menu