mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Minor clean
Shed some unused code
This commit is contained in:
parent
203cb50bef
commit
394c5c2c95
5 changed files with 3 additions and 61 deletions
|
@ -64,35 +64,4 @@ namespace PKHeX.Core
|
|||
public BlockInfo7b(int bo, uint id, int ofs, int len) : base(bo, id, ofs, len) { }
|
||||
protected override ushort GetChecksum(byte[] data) => Checksums.CRC16NoInvert(new ReadOnlySpan<byte>(data, Offset, Length));
|
||||
}
|
||||
|
||||
public static class BlockInfoBEEFUtil
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the <see cref="BlockInfo"/> for the input <see cref="data"/>.
|
||||
/// </summary>
|
||||
/// <param name="data">Complete data array</param>
|
||||
/// <param name="blockInfoOffset">Offset the <see cref="BlockInfo"/> starts at.</param>
|
||||
public static void DumpComputedBlockInfo(byte[] data, int blockInfoOffset)
|
||||
{
|
||||
blockInfoOffset += 0x14;
|
||||
|
||||
uint CurrentPosition = 0;
|
||||
for (int i = 0;; i++)
|
||||
{
|
||||
int ofs = blockInfoOffset + (i * 8);
|
||||
|
||||
var Offset = CurrentPosition;
|
||||
var Length = BitConverter.ToUInt32(data, ofs + 0);
|
||||
if (Length == 0)
|
||||
break;
|
||||
var ID = BitConverter.ToUInt16(data, ofs + 4);
|
||||
// var Checksum = BitConverter.ToUInt16(data, ofs + 6);
|
||||
Console.WriteLine($"ID={ID}, Offset=0x{Offset:X5}, Length=0x{Length:X5}");
|
||||
|
||||
// Expand out to nearest 0x200
|
||||
var remainder = Length & 0x1FF;
|
||||
CurrentPosition += remainder == 0 ? Length : Length + 0x200 - remainder;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ namespace PKHeX.Core
|
|||
{
|
||||
return data.Length switch
|
||||
{
|
||||
SecretBase6.SIZE => new SecretBase6(data),
|
||||
SIZE => new SecretBase6(data),
|
||||
SecretBase6Other.SIZE => new SecretBase6Other(data),
|
||||
_ => null,
|
||||
};
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace PKHeX.Core
|
||||
{
|
||||
public sealed class GameTime8 : SaveBlock
|
||||
{
|
||||
public GameTime8(SaveFile sav, int offset) : base(sav) => Offset = offset;
|
||||
public uint SecondsToStart { get => BitConverter.ToUInt32(Data, 0x28); set => BitConverter.GetBytes(value).CopyTo(Data, 0x28); }
|
||||
public uint SecondsToFame { get => BitConverter.ToUInt32(Data, 0x30); set => BitConverter.GetBytes(value).CopyTo(Data, 0x30); }
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace PKHeX.Core
|
||||
{
|
||||
public sealed class Situation8 : SaveBlock
|
||||
{
|
||||
public Situation8(SAV8SWSH sav, SCBlock block) : base(sav, block.Data) { }
|
||||
|
||||
// "StartLocation"
|
||||
public int M { get => BitConverter.ToUInt16(Data, Offset + 0x00); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, Offset + 0x00); }
|
||||
public float X { get => BitConverter.ToSingle(Data, Offset + 0x08); set => BitConverter.GetBytes(value).CopyTo(Data, Offset + 0x08); }
|
||||
public float Z { get => BitConverter.ToSingle(Data, Offset + 0x10); set => BitConverter.GetBytes(value).CopyTo(Data, Offset + 0x10); }
|
||||
public float Y { get => (int)BitConverter.ToSingle(Data, Offset + 0x18); set => BitConverter.GetBytes(value).CopyTo(Data, Offset + 0x18); }
|
||||
public float R { get => (int)BitConverter.ToSingle(Data, Offset + 0x20); set => BitConverter.GetBytes(value).CopyTo(Data, Offset + 0x20); }
|
||||
}
|
||||
}
|
|
@ -100,7 +100,7 @@ namespace PKHeX.WinForms
|
|||
|
||||
GB_M_OT.Enabled = GB_M_CT.Enabled = GB_Residence.Enabled =
|
||||
BTN_Save.Enabled = M_Fullness.Enabled = M_Enjoyment.Enabled =
|
||||
L_Sociability.Enabled = MT_Sociability.Enabled =
|
||||
L_Sociability.Enabled = MT_Sociability.Enabled =
|
||||
L_Fullness.Enabled = L_Enjoyment.Enabled = !pkm.IsEgg;
|
||||
|
||||
if (!pkm.IsEgg)
|
||||
|
|
Loading…
Reference in a new issue