From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:Pokémon Generation 3 save file" |
|---|
| claim | "The sector checksum is the sum of the data as little-endian u32 words, folded as (sum >> 16) + sum and truncated to 16 bits, stored at sector offset 0xFF6." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Gen 3 Pokémon saves; PKHeX sums all 0xF80 bytes, the decompilation only each section's real size (same result, zero padding)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "validating or writing a save sector" |
|---|
| effect | "checksum = (u16)((sum32 >> 16) + sum32), sum32 = wrapping sum of u32 LE words of the data bytes" |
|---|
| setting | | name | "checksum offset" |
|---|
| default | "0xFF6" |
|---|
|
|---|
| test_vectors | | input | "data bytes 78 56 34 12 (one u32 word)" |
|---|
| expected | "0x68AC" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "CalculateChecksum" |
|---|
| repo | "https://github.com/pret/pokeemerald" |
|---|
| commit | "731ad5bfd6e6f265508d0efcca0ba42f9dcf5881" |
|---|
| path | "src/save.c" |
|---|
| lines | "675-687" |
|---|
|
| type | "source" |
|---|
| detail | "CheckSum32 and its use over the first SIZE_SECTOR_USED (0xF80) bytes" |
|---|
| repo | "https://github.com/kwsch/PKHeX" |
|---|
| commit | "641c26ba100225f3605e5a44b61b3b16e15a3774" |
|---|
| path | "PKHeX.Core/Saves/SAV3.cs" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Gen 3 sector checksum" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T18:56:46.077Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T06:02:49.102Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read CalculateChecksum in pokeemerald save.c (675-687) at 731ad5b: u32 sum of size/4 words, returns u16 of (sum>>16)+sum; struct SaveSector in include/save.h puts the checksum at 0xFF6 (0xF80 data + 0x74 unused + u16 id). Did not re-read PKHeX." |
|---|
|
|
|---|