mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-08 14:15:27 -05:00
Add batrev as a blank sav option via code
This commit is contained in:
@@ -31,9 +31,12 @@ private void InitializeData(byte[] data)
|
||||
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))
|
||||
var first = BigEndian.ToUInt32(Data, 0x00004C);
|
||||
var second = BigEndian.ToUInt32(Data, 0x1C004C);
|
||||
SaveCount = Math.Max(second, first);
|
||||
if (second > first)
|
||||
{
|
||||
// swap halves
|
||||
byte[] tempData = new byte[0x1C0000];
|
||||
Array.Copy(Data, 0, tempData, 0, 0x1C0000);
|
||||
Array.Copy(Data, 0x1C0000, Data, 0, 0x1C0000);
|
||||
@@ -57,6 +60,7 @@ private void InitializeData(byte[] data)
|
||||
CurrentSlot = _currentSlot;
|
||||
}
|
||||
|
||||
/// <summary> Amount of times the primary save has been saved </summary>
|
||||
private uint SaveCount;
|
||||
|
||||
protected override byte[] GetFinalData()
|
||||
|
||||
@@ -727,6 +727,7 @@ public static SaveFile GetBlankSAV(GameVersion game, string trainerName, Languag
|
||||
D or P or DP => new SAV4DP(),
|
||||
Pt or DPPt => new SAV4Pt(),
|
||||
HG or SS or HGSS => new SAV4HGSS(),
|
||||
BATREV => new SAV4BR(),
|
||||
|
||||
B or W or BW => new SAV5BW(),
|
||||
B2 or W2 or B2W2 => new SAV5B2W2(),
|
||||
|
||||
Reference in New Issue
Block a user