diff --git a/controls.cpp b/controls.cpp index 8c71090a..38786648 100644 --- a/controls.cpp +++ b/controls.cpp @@ -3686,7 +3686,7 @@ void S9xControlPreSaveState (struct SControlSnapshot *s) COPY(macsrifle.y); COPY(macsrifle.buttons); - assert(i == sizeof(s->internal)); + assert(i == sizeof(s->internal) + sizeof(s->internal_macs)); #undef COPY @@ -3757,13 +3757,15 @@ void S9xControlPostLoadState (struct SControlSnapshot *s) for (int k = 0; k < 2; k++) COPY(mp5[j].pads[k]); + assert(i == sizeof(s->internal)); + if (s->ver > 3) { COPY(macsrifle.x); COPY(macsrifle.y); COPY(macsrifle.buttons); - assert(i == sizeof(s->internal)); + assert(i == sizeof(s->internal) + sizeof(s->internal_macs)); } #undef COPY diff --git a/controls.h b/controls.h index c254386d..d3cfcc77 100644 --- a/controls.h +++ b/controls.h @@ -467,7 +467,8 @@ struct SControlSnapshot uint8 justifier_select; uint8 dummy3[8]; 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); diff --git a/snapshot.cpp b/snapshot.cpp index fe66e69c..468cf781 100644 --- a/snapshot.cpp +++ b/snapshot.cpp @@ -573,7 +573,8 @@ static FreezeData SnapControls[] = ARRAY_ENTRY(6, dummy3, 8, uint8_ARRAY_V), INT_ENTRY(6, pad_read), 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 diff --git a/snapshot.h b/snapshot.h index 07d9442e..a88d6123 100644 --- a/snapshot.h +++ b/snapshot.h @@ -198,7 +198,7 @@ #define SNAPSHOT_MAGIC "#!s9xsnp" #define SNAPSHOT_VERSION_IRQ 7 #define SNAPSHOT_VERSION_BAPU 8 -#define SNAPSHOT_VERSION 9 +#define SNAPSHOT_VERSION 10 #define SUCCESS 1 #define WRONG_FORMAT (-1)