mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-18 14:28:33 +00:00
Add batrev as a blank sav option via code
This commit is contained in:
parent
98a80b4bf1
commit
3b344bd5c3
2 changed files with 7 additions and 2 deletions
|
@ -31,9 +31,12 @@ namespace PKHeX.Core
|
||||||
Data = DecryptPBRSaveData(data);
|
Data = DecryptPBRSaveData(data);
|
||||||
|
|
||||||
// Detect active save
|
// Detect active save
|
||||||
SaveCount = Math.Max(BigEndian.ToUInt32(Data, 0x1C004C), BigEndian.ToUInt32(Data, 0x4C));
|
var first = BigEndian.ToUInt32(Data, 0x00004C);
|
||||||
if (BigEndian.ToUInt32(Data, 0x1C004C) > BigEndian.ToUInt32(Data, 0x4C))
|
var second = BigEndian.ToUInt32(Data, 0x1C004C);
|
||||||
|
SaveCount = Math.Max(second, first);
|
||||||
|
if (second > first)
|
||||||
{
|
{
|
||||||
|
// swap halves
|
||||||
byte[] tempData = new byte[0x1C0000];
|
byte[] tempData = new byte[0x1C0000];
|
||||||
Array.Copy(Data, 0, tempData, 0, 0x1C0000);
|
Array.Copy(Data, 0, tempData, 0, 0x1C0000);
|
||||||
Array.Copy(Data, 0x1C0000, Data, 0, 0x1C0000);
|
Array.Copy(Data, 0x1C0000, Data, 0, 0x1C0000);
|
||||||
|
@ -57,6 +60,7 @@ namespace PKHeX.Core
|
||||||
CurrentSlot = _currentSlot;
|
CurrentSlot = _currentSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary> Amount of times the primary save has been saved </summary>
|
||||||
private uint SaveCount;
|
private uint SaveCount;
|
||||||
|
|
||||||
protected override byte[] GetFinalData()
|
protected override byte[] GetFinalData()
|
||||||
|
|
|
@ -727,6 +727,7 @@ namespace PKHeX.Core
|
||||||
D or P or DP => new SAV4DP(),
|
D or P or DP => new SAV4DP(),
|
||||||
Pt or DPPt => new SAV4Pt(),
|
Pt or DPPt => new SAV4Pt(),
|
||||||
HG or SS or HGSS => new SAV4HGSS(),
|
HG or SS or HGSS => new SAV4HGSS(),
|
||||||
|
BATREV => new SAV4BR(),
|
||||||
|
|
||||||
B or W or BW => new SAV5BW(),
|
B or W or BW => new SAV5BW(),
|
||||||
B2 or W2 or B2W2 => new SAV5B2W2(),
|
B2 or W2 or B2W2 => new SAV5B2W2(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue