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, DEFAULT_DEPTH);
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(TerminalMaxCycles));
139 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(mScrollX));
140 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(mScrollY));
141 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(mScrollX_last));
142 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(mScrollY_last));
144 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScreenScrollXPos));
145 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScreenScrollYPos));
146 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(DisplayMinX));
147 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(DisplayMinY));
148 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(DisplayMaxX));
149 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(DisplayMaxY));
151 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(InfotronsNeeded));
152 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(KillMurphyFlag));
153 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyMoveCounter));
154 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyExplodePos));
155 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(SplitMoveFlag));
156 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(RedDiskReleaseMurphyPos));
157 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyPosIndex));
158 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyXPos));
159 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyYPos));
160 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyScreenXPos));
161 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyScreenYPos));
162 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MurphyVarFaceLeft));
163 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(RedDiskCount));
164 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(RedDiskReleaseFlag));
165 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(MovingPictureSequencePhase));
166 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(RedDiskReleasePhase));
167 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScratchGravity));
168 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GravityFlag));
169 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(SnikSnaksElectronsFrozen));
170 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(YellowDisksExploded));
171 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(YawnSleepCounter));
173 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(LeadOutCounter));
175 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GfxElementLast));
176 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GfxGraphicLast));
177 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GfxGraphic));
178 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(GfxFrame));
180 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollMinX));
181 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollMinY));
182 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollMaxX));
183 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollMaxY));
184 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollX));
185 SaveSnapshotBuffer(buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollY));
187 SaveSnapshotBuffer(buffers, &PlayField16[-game_sp.preceding_buffer_size],
188 game_sp.preceding_buffer_size * sizeof(int));
191 void LoadEngineSnapshotValues_SP()
195 /* stored engine snapshot buffers already restored at this point */
197 game_sp = engine_snapshot_sp.game_sp;
199 /* these arrays have playfield-size dependent variable size */
201 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
202 PlayField16[i] = engine_snapshot_sp.PlayField16[i];
203 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
204 PlayField8[i] = engine_snapshot_sp.PlayField8[i];
205 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
206 DisPlayField[i] = engine_snapshot_sp.DisPlayField[i];
208 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
209 AnimationPosTable[i] = engine_snapshot_sp.AnimationPosTable[i];
210 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
211 AnimationSubTable[i] = engine_snapshot_sp.AnimationSubTable[i];
212 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
213 TerminalState[i] = engine_snapshot_sp.TerminalState[i];
215 RedrawPlayfield_SP(TRUE);