Savegames/es: Difference between revisions

Xerpi (talk | contribs)
No edit summary
Xerpi (talk | contribs)
No edit summary
Line 26: Line 26:
*Se ha observado que el xorpad se repite cada 0x1000 bytes (podría ser la longitud máxima pero aún no se ha probado).
*Se ha observado que el xorpad se repite cada 0x1000 bytes (podría ser la longitud máxima pero aún no se ha probado).


=== Wear leveling ===
=== Nivel de desgaste ===


The 3DS employs a wear leveling scheme on the savegame FLASH chips. This is done through the usage of blockmaps and a journal. The blockmap is located at offset 0 of the flash chip, and is immediately followed by the journal. The initial state is dictated by the blockmap, and the journal is then applied to that.
La 3DS utiliza un esquema para prevenir el nivel de desgaste de los chips FLASH de las partidas. Eso lo consigue utilizando blockmaps i un journal. El blockmap se encuentra en el offset 0 del chip, y es seguido inmediatamente por el journal. El estado inicial es dictado por el blockmap, y el journal es entonces aplicado.


First, there are 8 bytes whose purposes are currently unknown. Then comes the actual blockmap.
Primero hay 8 bytes cuyos fines se desconocen aún. Luego viene el blockmap.
The blockmap structure is simple:
La estructura del blockmap es simple:
<pre>
<pre>
struct header_entry {
struct header_entry {
         uint8_t phys_sec; // when bit7 is set, block has checksums, otherwise checksums are all zero
         uint8_t phys_sec; // cuando se establece el sépitmo bit, el bloque tiene  checksums, de lo contrario los checksums son cero
         uint8_t alloc_cnt;
         uint8_t alloc_cnt;
         uint8_t chksums[8];
         uint8_t chksums[8];
Line 40: Line 40:
</pre>
</pre>


There's one entry per sector, counting from physical sector 1 (sector 0 contains the blockmap/journal).
Hay un journal por sector, contando desde el sector físico 1(el sector 0 contiene el blockmap/journal).
 
Los siguientes dos bytes que siguen al blockmap son el CRC16 (con 0xFFFF como valor inicial (como el modbus)) de los primeros 8 bytes del blockmap.
The 2 bytes that follow the blockmap are the CRC16 (with starting value 0xFFFF (like modbus)) of the first 8 bytes and the blockmap.


Then comes the journal.
Then comes the journal.