mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-25 03:32:22 -05:00
Add TID/SID fetch for Battle Revolution
Can unlock boxes by setting a nonzero TID/SID https://projectpokemon.org/home/forums/topic/36582-pok%C3%A9mon-battle-revolution-save-research-thread/?do=findComment&comment=221812 ty Akunoko
This commit is contained in:
@@ -72,6 +72,7 @@ protected override byte[] GetFinalData()
|
||||
public readonly IReadOnlyList<string> SaveNames = new string[SAVE_COUNT];
|
||||
|
||||
private int _currentSlot = -1;
|
||||
private const int SIZE_SLOT = 0x6FF00;
|
||||
|
||||
public int CurrentSlot
|
||||
{
|
||||
@@ -80,7 +81,7 @@ public int CurrentSlot
|
||||
set
|
||||
{
|
||||
_currentSlot = value;
|
||||
var ofs = 0x6FF00 * _currentSlot;
|
||||
var ofs = SIZE_SLOT * _currentSlot;
|
||||
Box = ofs + 0x978;
|
||||
Party = ofs + 0x13A54; // first team slot after boxes
|
||||
BoxName = ofs + 0x58674;
|
||||
@@ -168,6 +169,26 @@ private void SetOTName(int slot, string name)
|
||||
public override int GetPartyOffset(int slot) => Party + (SIZE_PARTY * slot);
|
||||
public override int GetBoxOffset(int box) => Box + (SIZE_STORED * box * 30);
|
||||
|
||||
public override int TID
|
||||
{
|
||||
get => (Data[(_currentSlot * SIZE_SLOT) + 0x12867] << 8) | Data[(_currentSlot * SIZE_SLOT) + 0x12860];
|
||||
set
|
||||
{
|
||||
Data[(_currentSlot * SIZE_SLOT) + 0x12867] = (byte)(value >> 8);
|
||||
Data[(_currentSlot * SIZE_SLOT) + 0x12860] = (byte)(value & 0xFF);
|
||||
}
|
||||
}
|
||||
|
||||
public override int SID
|
||||
{
|
||||
get => (Data[(_currentSlot * SIZE_SLOT) + 0x12865] << 8) | Data[(_currentSlot * SIZE_SLOT) + 0x12866];
|
||||
set
|
||||
{
|
||||
Data[(_currentSlot * SIZE_SLOT) + 0x12865] = (byte)(value >> 8);
|
||||
Data[(_currentSlot * SIZE_SLOT) + 0x12866] = (byte)(value & 0xFF);
|
||||
}
|
||||
}
|
||||
|
||||
// Save file does not have Box Name / Wallpaper info
|
||||
private int BoxName = -1;
|
||||
private const int BoxNameLength = 0x28;
|
||||
|
||||
Reference in New Issue
Block a user