6 char *preceding_playfield_memory[] =
8 "95 89 95 89 95 89 3b 8a 3b 8a 3b 8a 3b 8a 3b 8a", // |......;.;.;.;.;.|
9 "3b 8a 3b 8a 3b 8a e8 8a e8 8a e8 8a e8 8a e8 8a", // |;.;.;...........|
10 "e8 8a e8 8a e8 8a b1 8b b1 8b b1 8b b1 8b b1 8b", // |................|
11 "b1 8b b1 8b b1 8b 85 8c 85 8c 85 8c 85 8c 85 8c", // |................|
12 "85 8c 85 8c 85 8c 5b 8d 5b 8d 5b 8d 5b 8d 5b 8d", // |......[.[.[.[.[.|
13 "5b 8d 5b 8d 5b 8d 06 8e 06 8e 06 8e 06 8e 06 8e", // |[.[.[...........|
14 "06 8e 06 8e 06 8e ac 8e ac 8e ac 8e ac 8e ac 8e", // |................|
15 "ac 8e ac 8e ac 8e 59 8f 59 8f 59 8f 59 8f 59 8f", // |......Y.Y.Y.Y.Y.|
16 "59 8f 59 8f 59 8f 00 00 70 13 00 00 00 00 e8 17", // |Y.Y.Y...p.......|
17 "00 00 00 00 00 00 69 38 00 00 00 00 00 00 00 00", // |......i8........|
18 "00 00 00 00 00 00 00 00 d0 86 00 00 b2 34 00 00", // |.............4..|
19 "00 00 00 00 00 00 8f 8b 1d 34 00 00 00 00 00 00", // |.........4......|
20 "00 00 00 00 23 39 09 09 00 0c 00 08 00 58 00 00", // |....#9.......X..|
21 "00 00 00 25 77 06 7f 00 00 00 01 00 00 00 00 00", // |...%w...........|
22 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
23 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
24 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
25 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
26 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
27 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
28 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
29 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
30 "00 00 00 00 00 00 00 00 00 ec 06 26 05 00 00 00", // |...........&....|
31 "00 00 00 01 00 00 00 00 31 32 33 34 35 36 37 38", // |........12345678|
32 "39 30 2d 00 08 00 51 57 45 52 54 59 55 49 4f 50", // |90-...QWERTYUIOP|
33 "00 00 0a 00 41 53 44 46 47 48 4a 4b 4c 00 00 00", // |....ASDFGHJKL...|
34 "00 00 5a 58 43 56 42 4e 4d 00 00 00 00 00 00 20", // |..ZXCVBNM...... |
35 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
36 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
37 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
38 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
39 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
40 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
41 "00 00 00 00 00 00 2e 00 1e 00 31 00 14 00 39 00", // |..........1...9.|
42 "1f 00 14 00 18 00 ff ff 01 00 01 4c 45 56 45 4c", // |...........LEVEL|
43 "53 2e 44 41 54 00 00 00 00 00 00 00 00 00 00 00", // |S.DAT...........|
44 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
45 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
46 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
47 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
48 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
49 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
50 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00", // |................|
56 Bitmap *bitmap_db_field_sp;
58 struct EngineSnapshotInfo_SP engine_snapshot_sp;
69 void InitPrecedingPlayfieldMemory()
71 int preceding_buffer_size = 0;
74 for (i = 0; preceding_playfield_memory[i] != NULL; i++)
75 preceding_buffer_size += 8; /* eight 16-bit integer values */
77 game_sp.preceding_buffer = preceding_playfield_memory;
78 game_sp.preceding_buffer_size = preceding_buffer_size;
81 void InitGfxBuffers_SP()
83 ReCreateBitmap(&bitmap_db_field_sp, FXSIZE, FYSIZE);
86 unsigned int InitEngineRandom_SP(int seed)
88 if (seed == NEW_RANDOMIZE)
92 seed = (int)RandomSeed;
95 RandomSeed = (short)seed;
97 return (unsigned int) seed;
101 /* ------------------------------------------------------------------------- */
102 /* Supaplex game engine snapshot handling functions */
103 /* ------------------------------------------------------------------------- */
105 void SaveEngineSnapshotValues_SP(ListNode **buffers)
109 engine_snapshot_sp.game_sp = game_sp;
111 /* these arrays have playfield-size dependent variable size */
113 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
114 engine_snapshot_sp.PlayField16[i] = PlayField16[i];
115 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
116 engine_snapshot_sp.PlayField8[i] = PlayField8[i];
117 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
118 engine_snapshot_sp.DisPlayField[i] = DisPlayField[i];
120 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
121 engine_snapshot_sp.AnimationPosTable[i] = AnimationPosTable[i];
122 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
123 engine_snapshot_sp.AnimationSubTable[i] = AnimationSubTable[i];
124 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
125 engine_snapshot_sp.TerminalState[i] = TerminalState[i];
127 /* store special data into engine snapshot buffers */
129 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(FieldWidth));
130 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(FieldHeight));
131 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(FieldMax));
132 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(LevelMax));
134 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(TimerVar));
135 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(RandomSeed));
137 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(FreezeZonks));
139 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(TerminalMaxCycles));
141 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(mScrollX));
142 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(mScrollY));
143 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(mScrollX_last));
144 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(mScrollY_last));
146 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScreenScrollXPos));
147 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScreenScrollYPos));
148 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(DisplayMinX));
149 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(DisplayMinY));
150 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(DisplayMaxX));
151 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(DisplayMaxY));
153 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(InfotronsNeeded));
154 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(KillMurphyFlag));
155 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyMoveCounter));
156 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyExplodePos));
157 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(SplitMoveFlag));
158 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(RedDiskReleaseMurphyPos));
159 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyPosIndex));
160 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyXPos));
161 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyYPos));
162 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyScreenXPos));
163 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyScreenYPos));
164 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyVarFaceLeft));
165 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(RedDiskCount));
166 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(RedDiskReleaseFlag));
167 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MovingPictureSequencePhase));
168 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(RedDiskReleasePhase));
169 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScratchGravity));
170 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GravityFlag));
171 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(SnikSnaksElectronsFrozen));
172 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(YellowDisksExploded));
173 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(YawnSleepCounter));
175 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(LeadOutCounter));
177 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GfxElementLast));
178 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GfxGraphicLast));
179 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GfxGraphic));
180 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GfxFrame));
182 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollMinX));
183 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollMinY));
184 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollMaxX));
185 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollMaxY));
186 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollX));
187 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollY));
189 SaveSnapshotBuffer(buffers, &PlayField16[-game_sp.preceding_buffer_size],
190 game_sp.preceding_buffer_size * sizeof(int));
192 SaveEngineSnapshotValues_SP_Murphy(buffers);
195 void LoadEngineSnapshotValues_SP()
199 /* stored engine snapshot buffers already restored at this point */
201 game_sp = engine_snapshot_sp.game_sp;
203 /* these arrays have playfield-size dependent variable size */
205 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
206 PlayField16[i] = engine_snapshot_sp.PlayField16[i];
207 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
208 PlayField8[i] = engine_snapshot_sp.PlayField8[i];
209 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
210 DisPlayField[i] = engine_snapshot_sp.DisPlayField[i];
212 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
213 AnimationPosTable[i] = engine_snapshot_sp.AnimationPosTable[i];
214 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
215 AnimationSubTable[i] = engine_snapshot_sp.AnimationSubTable[i];
216 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
217 TerminalState[i] = engine_snapshot_sp.TerminalState[i];
219 RedrawPlayfield_SP(TRUE);