7 # define PACK(structure) \
8 __pragma(pack(push, 1)) \
11 #elif defined(__MINGW32__)
12 #define PACK(structure) structure __attribute__ ((gcc_struct, __packed__))
14 #define PACK(structure) structure Q_PACKED
18 #include <ff7tkdata_export.h>
19 #include <Type_FF7CHAR>
20 #include <Type_FF7CHOCOBO>
24 struct FF7TKDATA_EXPORT LOVE {
37 struct FF7TKDATA_EXPORT
FF7DESC {
51 struct FF7TKDATA_EXPORT FF7XYT {
66 struct FF7TKDATA_EXPORT
FF7SLOT {
68 static constexpr
int emptyChecksum = 0x4D1D;
69 static constexpr
int slotSize = 0x10F4;
70 inline bool operator==(
FF7SLOT &other) {
return other.toByteArray() == toByteArray(); }
71 inline bool operator!=(
FF7SLOT &other) {
return other.toByteArray() != toByteArray(); }
72 bool isEmpty() {
return (checksum == emptyChecksum || toByteArray() == QByteArray(slotSize, 0x00)); }
73 void clear() { setData(QByteArray(slotSize, 0x00)); }
74 QByteArray toByteArray() {
return QByteArray(
reinterpret_cast<const char*
>(&checksum), slotSize); }
76 void setData(
const QByteArray &data) {
77 if (data.size() == slotSize)
78 memcpy(&checksum, data, slotSize);
81 static FF7SLOT fromByteArray(
const QByteArray &data) {
87 static quint16 generateChecksum(
FF7SLOT ff7Slot) {
88 return generateChecksum(ff7Slot.toByteArray());
91 static quint16 generateChecksum(QByteArray slotData) {
92 QByteArray data = slotData.mid(4);
95 quint16 len = data.size();
96 quint16 pbit = 0x8000;
100 for (
int d = 0; d < 8; d++) {
102 r = quint16(r << 1) ^ 0x1021;
108 return ((r ^ 0xFFFF) & 0xFFFF);
111 void updateChecksum() {
112 checksum = generateChecksum(toByteArray());
141 quint16 menu_visible;
151 qint8 pennedchocos[4];
153 quint8 u_weapon_hp[3];
159 quint8 world_map_chocobos;
160 quint8 world_map_vehicles;
178 quint16 battlepoints;
181 qint8 stablesoccupied;
194 quint8 midgartrainflags;
198 quint16 BikeHighScore;
200 quint32 SnowBegFastTime;
201 quint32 SnowExpFastTime;
202 quint32 SnowCrazyFastTime;
205 quint8 SnowCrazyScore;
212 quint8 battleArenaSpecialWins;
214 quint8 stablechocorating[6];
216 qint16 cratersaveMapId;
229 quint8 chocobonames[6][6];
230 quint16 chocostaminas[6];
265 quint8 controller_map[16];
272 struct FF7TKDATA_EXPORT FF7HEADFOOT {
273 quint8 sl_header[0x0200];
274 quint8 sl_footer[0x0D0C];