6 Bitmap *bitmap_db_field_sp;
8 struct EngineSnapshotInfo_SP engine_snapshot_sp;
15 printf("::: open 1: %d, %d [%08x]\n", FXSIZE, FYSIZE, bitmap_db_field_sp);
18 bitmap_db_field_sp = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH);
19 bitmap_db_field_sp = CreateBitmap(MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY,
23 ReCreateBitmap(&bitmap_db_field_sp, FXSIZE, FYSIZE, DEFAULT_DEPTH);
25 printf("::: open 2: %d, %d [%08x]\n", FXSIZE, FYSIZE, bitmap_db_field_sp);
33 void InitGfxBuffers_SP()
36 printf("::: init 1: %d, %d [%08x]\n", FXSIZE, FYSIZE, bitmap_db_field_sp);
39 ReCreateBitmap(&bitmap_db_field_sp, MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY,
43 ReCreateBitmap(&bitmap_db_field_sp, FXSIZE, FYSIZE, DEFAULT_DEPTH);
45 printf("::: init 2: %d, %d [%08x]\n", FXSIZE, FYSIZE, bitmap_db_field_sp);
49 unsigned int InitEngineRandom_SP(long seed)
51 if (seed == NEW_RANDOMIZE)
55 seed = (long)RandomSeed;
58 RandomSeed = (short)seed;
60 return (unsigned int) seed;
64 /* ------------------------------------------------------------------------- */
65 /* Supaplex game engine snapshot handling functions */
66 /* ------------------------------------------------------------------------- */
68 void SaveEngineSnapshotValues_SP()
72 engine_snapshot_sp.game_sp = game_sp;
74 /* these arrays have playfield-size dependent variable size */
76 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
77 engine_snapshot_sp.PlayField16[i] = PlayField16[i];
78 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
79 engine_snapshot_sp.PlayField8[i] = PlayField8[i];
80 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
81 engine_snapshot_sp.DisPlayField[i] = DisPlayField[i];
83 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
84 engine_snapshot_sp.AnimationPosTable[i] = AnimationPosTable[i];
85 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
86 engine_snapshot_sp.AnimationSubTable[i] = AnimationSubTable[i];
87 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
88 engine_snapshot_sp.TerminalState[i] = TerminalState[i];
90 /* store special data into engine snapshot buffers */
92 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(FieldWidth));
93 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(FieldHeight));
94 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(FieldMax));
95 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(LevelMax));
96 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(FileMax));
98 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(TimerVar));
99 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(RandomSeed));
101 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(TerminalMaxCycles));
103 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(mScrollX));
104 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(mScrollY));
105 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(mScrollX_last));
106 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(mScrollY_last));
108 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScreenScrollXPos));
109 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScreenScrollYPos));
110 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(DisplayMinX));
111 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(DisplayMinY));
112 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(DisplayMaxX));
113 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(DisplayMaxY));
115 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(InfotronsNeeded));
116 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(KillMurphyFlag));
117 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyMoveCounter));
118 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyExplodePos));
119 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(SplitMoveFlag));
120 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(RedDiskReleaseMurphyPos));
121 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyPosIndex));
122 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyXPos));
123 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyYPos));
124 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyScreenXPos));
125 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyScreenYPos));
126 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyVarFaceLeft));
127 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(RedDiskCount));
128 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(RedDiskReleaseFlag));
129 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MovingPictureSequencePhase));
130 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(RedDiskReleasePhase));
131 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScratchGravity));
132 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(GravityFlag));
133 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(SnikSnaksElectronsFrozen));
134 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(YellowDisksExploded));
135 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(YawnSleepCounter));
137 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(LeadOutCounter));
139 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(GfxElementLast));
140 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(GfxGraphicLast));
141 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(GfxGraphic));
142 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(GfxFrame));
144 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScrollMinX));
145 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScrollMinY));
146 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScrollMaxX));
147 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScrollMaxY));
148 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScrollX));
149 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScrollY));
151 SaveEngineSnapshotBuffer(&PlayField16[-game_sp.preceding_buffer_size],
152 game_sp.preceding_buffer_size * sizeof(int));
155 void LoadEngineSnapshotValues_SP()
159 /* stored engine snapshot buffers already restored at this point */
161 game_sp = engine_snapshot_sp.game_sp;
163 /* these arrays have playfield-size dependent variable size */
165 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
166 PlayField16[i] = engine_snapshot_sp.PlayField16[i];
167 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
168 PlayField8[i] = engine_snapshot_sp.PlayField8[i];
169 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
170 DisPlayField[i] = engine_snapshot_sp.DisPlayField[i];
172 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
173 AnimationPosTable[i] = engine_snapshot_sp.AnimationPosTable[i];
174 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
175 AnimationSubTable[i] = engine_snapshot_sp.AnimationSubTable[i];
176 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
177 TerminalState[i] = engine_snapshot_sp.TerminalState[i];
179 RedrawPlayfield_SP(TRUE);