mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-29 18:22:29 -05:00
add some ORAS detection for powersaves
This commit is contained in:
@@ -580,7 +580,7 @@ private void open1MB(byte[] input, string path, string GameType, bool oras)
|
||||
Array.Copy(savefile, 0x43C - 1 * 0x130, realHash2, 0, 0x20);
|
||||
|
||||
B_SwitchSAV.Enabled = (hashValue1.SequenceEqual(realHash1) && hashValue2.SequenceEqual(realHash2));
|
||||
getSAVOffsets(); // just in case
|
||||
getSAVOffsets(); // to detect if we are ORAS or not
|
||||
Array.Copy(savefile, 0x5400 + 0x7F000 * savindex, cyberSAV, 0, cyberSAV.Length);
|
||||
|
||||
openSave(oras);
|
||||
@@ -3602,10 +3602,16 @@ private void getSAVOffsets()
|
||||
// Get the save file offsets for the input game
|
||||
bool enableInterface = false;
|
||||
if (BitConverter.ToUInt32(savefile, 0x6A810 + 0x7F000 * savindex) == 0x42454546)
|
||||
{
|
||||
{
|
||||
enableInterface = true;
|
||||
SaveGame = new PKX.Structures.SaveGame("XY");
|
||||
}
|
||||
else if (BitConverter.ToUInt32(savefile, 0x7B210 + 0x7F000 * savindex) == 0x42454546)
|
||||
{
|
||||
enableInterface = true;
|
||||
SaveGame = new PKX.Structures.SaveGame("ORAS");
|
||||
savegame_oras = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Util.Error("Unrecognized Save File loaded.");
|
||||
|
||||
Reference in New Issue
Block a user