Save MACS rifle data in snapshot, increase snapshot version

This commit is contained in:
OV2 2018-06-04 21:32:25 +02:00
parent 6f47239fae
commit 3af67e1e68
4 changed files with 9 additions and 5 deletions

View File

@ -3686,7 +3686,7 @@ void S9xControlPreSaveState (struct SControlSnapshot *s)
COPY(macsrifle.y); COPY(macsrifle.y);
COPY(macsrifle.buttons); COPY(macsrifle.buttons);
assert(i == sizeof(s->internal)); assert(i == sizeof(s->internal) + sizeof(s->internal_macs));
#undef COPY #undef COPY
@ -3757,13 +3757,15 @@ void S9xControlPostLoadState (struct SControlSnapshot *s)
for (int k = 0; k < 2; k++) for (int k = 0; k < 2; k++)
COPY(mp5[j].pads[k]); COPY(mp5[j].pads[k]);
assert(i == sizeof(s->internal));
if (s->ver > 3) if (s->ver > 3)
{ {
COPY(macsrifle.x); COPY(macsrifle.x);
COPY(macsrifle.y); COPY(macsrifle.y);
COPY(macsrifle.buttons); COPY(macsrifle.buttons);
assert(i == sizeof(s->internal)); assert(i == sizeof(s->internal) + sizeof(s->internal_macs));
} }
#undef COPY #undef COPY

View File

@ -467,7 +467,8 @@ struct SControlSnapshot
uint8 justifier_select; uint8 justifier_select;
uint8 dummy3[8]; uint8 dummy3[8];
bool8 pad_read, pad_read_last; bool8 pad_read, pad_read_last;
uint8 internal[65]; // yes, we need to save this! uint8 internal[60]; // yes, we need to save this!
uint8 internal_macs[5];
}; };
void S9xControlPreSaveState (struct SControlSnapshot *s); void S9xControlPreSaveState (struct SControlSnapshot *s);

View File

@ -573,7 +573,8 @@ static FreezeData SnapControls[] =
ARRAY_ENTRY(6, dummy3, 8, uint8_ARRAY_V), ARRAY_ENTRY(6, dummy3, 8, uint8_ARRAY_V),
INT_ENTRY(6, pad_read), INT_ENTRY(6, pad_read),
INT_ENTRY(6, pad_read_last), INT_ENTRY(6, pad_read_last),
ARRAY_ENTRY(6, internal, 60, uint8_ARRAY_V) ARRAY_ENTRY(6, internal, 60, uint8_ARRAY_V),
ARRAY_ENTRY(10, internal_macs, 5, uint8_ARRAY_V)
}; };
#undef STRUCT #undef STRUCT

View File

@ -198,7 +198,7 @@
#define SNAPSHOT_MAGIC "#!s9xsnp" #define SNAPSHOT_MAGIC "#!s9xsnp"
#define SNAPSHOT_VERSION_IRQ 7 #define SNAPSHOT_VERSION_IRQ 7
#define SNAPSHOT_VERSION_BAPU 8 #define SNAPSHOT_VERSION_BAPU 8
#define SNAPSHOT_VERSION 9 #define SNAPSHOT_VERSION 10
#define SUCCESS 1 #define SUCCESS 1
#define WRONG_FORMAT (-1) #define WRONG_FORMAT (-1)