6 Bitmap *bitmap_db_field_sp;
8 struct EngineSnapshotInfo_SP engine_snapshot_sp;
19 void InitGfxBuffers_SP()
21 ReCreateBitmap(&bitmap_db_field_sp, FXSIZE, FYSIZE, DEFAULT_DEPTH);
24 unsigned int InitEngineRandom_SP(long seed)
26 if (seed == NEW_RANDOMIZE)
30 seed = (long)RandomSeed;
33 RandomSeed = (short)seed;
35 return (unsigned int) seed;
39 /* ------------------------------------------------------------------------- */
40 /* Supaplex game engine snapshot handling functions */
41 /* ------------------------------------------------------------------------- */
43 void SaveEngineSnapshotValues_SP()
47 engine_snapshot_sp.game_sp = game_sp;
49 /* these arrays have playfield-size dependent variable size */
51 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
52 engine_snapshot_sp.PlayField16[i] = PlayField16[i];
53 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
54 engine_snapshot_sp.PlayField8[i] = PlayField8[i];
55 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
56 engine_snapshot_sp.DisPlayField[i] = DisPlayField[i];
58 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
59 engine_snapshot_sp.AnimationPosTable[i] = AnimationPosTable[i];
60 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
61 engine_snapshot_sp.AnimationSubTable[i] = AnimationSubTable[i];
62 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
63 engine_snapshot_sp.TerminalState[i] = TerminalState[i];
65 /* store special data into engine snapshot buffers */
67 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(FieldWidth));
68 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(FieldHeight));
69 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(FieldMax));
70 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(LevelMax));
71 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(FileMax));
73 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(TimerVar));
74 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(RandomSeed));
76 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(TerminalMaxCycles));
78 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(mScrollX));
79 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(mScrollY));
80 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(mScrollX_last));
81 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(mScrollY_last));
83 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScreenScrollXPos));
84 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScreenScrollYPos));
85 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(DisplayMinX));
86 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(DisplayMinY));
87 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(DisplayMaxX));
88 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(DisplayMaxY));
90 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(InfotronsNeeded));
91 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(KillMurphyFlag));
92 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyMoveCounter));
93 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyExplodePos));
94 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(SplitMoveFlag));
95 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(RedDiskReleaseMurphyPos));
96 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyPosIndex));
97 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyXPos));
98 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyYPos));
99 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyScreenXPos));
100 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyScreenYPos));
101 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MurphyVarFaceLeft));
102 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(RedDiskCount));
103 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(RedDiskReleaseFlag));
104 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(MovingPictureSequencePhase));
105 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(RedDiskReleasePhase));
106 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScratchGravity));
107 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(GravityFlag));
108 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(SnikSnaksElectronsFrozen));
109 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(YellowDisksExploded));
110 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(YawnSleepCounter));
112 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(LeadOutCounter));
114 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(GfxElementLast));
115 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(GfxGraphicLast));
116 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(GfxGraphic));
117 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(GfxFrame));
119 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScrollMinX));
120 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScrollMinY));
121 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScrollMaxX));
122 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScrollMaxY));
123 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScrollX));
124 SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(ScrollY));
126 SaveEngineSnapshotBuffer(&PlayField16[-game_sp.preceding_buffer_size],
127 game_sp.preceding_buffer_size * sizeof(int));
130 void LoadEngineSnapshotValues_SP()
134 /* stored engine snapshot buffers already restored at this point */
136 game_sp = engine_snapshot_sp.game_sp;
138 /* these arrays have playfield-size dependent variable size */
140 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
141 PlayField16[i] = engine_snapshot_sp.PlayField16[i];
142 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
143 PlayField8[i] = engine_snapshot_sp.PlayField8[i];
144 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
145 DisPlayField[i] = engine_snapshot_sp.DisPlayField[i];
147 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
148 AnimationPosTable[i] = engine_snapshot_sp.AnimationPosTable[i];
149 for (i = 0; i < FieldWidth * (FieldHeight - 2); i++)
150 AnimationSubTable[i] = engine_snapshot_sp.AnimationSubTable[i];
151 for (i = 0; i < FieldWidth * FieldHeight + HeaderSize; i++)
152 TerminalState[i] = engine_snapshot_sp.TerminalState[i];
154 RedrawPlayfield_SP(TRUE);