Add PBR save count identification

via Tux at
https://projectpokemon.org/forums/forums/topic/36582-pok%C3%A9mon-battle-revolution-save-research-thread/
Closes #317
This commit is contained in:
Kurt 2016-12-10 22:57:31 -08:00
parent 1f94dbf28e
commit 7404a65c15

View File

@ -24,6 +24,7 @@ public SAV4BR(byte[] data = null)
Data = DecryptPBRSaveData(data);
// Detect active save
SaveCount = Math.Max(BigEndian.ToUInt32(Data, 0x1C004C), BigEndian.ToUInt32(Data, 0x4C));
if (BigEndian.ToUInt32(Data, 0x1C004C) > BigEndian.ToUInt32(Data, 0x4C))
{
byte[] tempData = new byte[0x1C0000];
@ -52,7 +53,7 @@ public SAV4BR(byte[] data = null)
resetBoxes();
}
private readonly int SaveCount; // TODO : unique save identification
private readonly uint SaveCount;
public override byte[] Write(bool DSV)
{
setChecksums();