Make current box reads s8 instead of s32

https://projectpokemon.org/home/forums/topic/55168-bug-report-pkhex-unable-to-load-pokemon-platinum-save/

saves with un-initialized boxes (FF'd) have 00 FF FF FF in the first 4
bytes
This commit is contained in:
Kurt
2019-10-05 14:32:40 -07:00
parent e81deff512
commit d249975895
2 changed files with 6 additions and 6 deletions

View File

@@ -79,11 +79,11 @@ private void GetSAVOffsets()
private static int GetBoxNameOffset(int box) => BOX_NAME + (box * BOX_NAME_LEN);
protected override int GetBoxWallpaperOffset(int box) => BOX_WP + box;
// 8 bytes current & (stored count?)
// 8 bytes current box (align 32) & (stored count?)
public override int CurrentBox
{
get => BitConverter.ToInt32(Storage, BOX_END);
set => SetData(Storage, BitConverter.GetBytes(value), BOX_END);
get => Storage[BOX_END];
set => Storage[BOX_END] = (byte)value;
}
public int Counter

View File

@@ -31,10 +31,10 @@ public abstract class SAV4Sinnoh : SAV4
private static int GetBoxNameOffset(int box) => BOX_NAME + (box * BOX_NAME_LEN);
protected override int GetBoxWallpaperOffset(int box) => BOX_WP + box;
public override int CurrentBox
public override int CurrentBox // (align 32)
{
get => BitConverter.ToInt32(Storage, 0);
set => SetData(Storage, BitConverter.GetBytes(value), 0);
get => Storage[0];
set => Storage[0] = (byte)value;
}
public int Unknown