Generation 4 & 5 Save Files
Save file implementations for Nintendo DS Pokemon games.SAV4 (Abstract Base)
Base class for Diamond, Pearl, Platinum, HeartGold, and SoulSilver save files.Class Definition
PKHeX.Core/Saves/SAV4.cs
Storage Structure
Gen 4 uses a dual-buffer system:| Buffer | Size | Contents |
|---|---|---|
| General | Game-specific | Trainer info, party, items, event data |
| Storage | Game-specific | All PC boxes |
Storage Specifications
| Property | Value |
|---|---|
| Box Count | 18 |
| Box Slot Count | 30 |
| Party Size | 6 |
| Daycare Slots | 2 |
Save File Layout
Key Properties
Trainer Information
Position Coordinates
Adventure Info
Geonet
Event System
Daycare System
Pokedex
Battle Features
Fashion & Accessories
Seals
Accessories
Backdrops
Mystery Gift
Swarm System
Groups (DPPt/HGSS)
Checksums
SAV5 (Abstract Base)
Base class for Black, White, Black 2, and White 2 save files.Class Definition
PKHeX.Core/Saves/SAV5.cs
Storage Specifications
| Property | Value |
|---|---|
| Box Count | 24 |
| Box Slot Count | 30 |
| Party Size | 6 |
| Daycare Slots | 2 |
Block System
Gen 5 uses a block-based structure:Key Properties
Trainer Information
Time Tracking
Daycare System
Box Management
Block Accessors
External Data
Gen 5 stores additional data outside the main save:Checksums
Gen 5 uses CRC16-CCITT checksums with special footer structure:Technical Notes
Save Detection
Both Gen 4 and Gen 5 use footer comparison to determine the active save:String Encoding
- Gen 4: UTF-16 with custom terminator handling
- Gen 5: UTF-16 with custom terminator handling
\uffff as string terminator.