26 #ifndef SWORD2_LOGIC_H 27 #define SWORD2_LOGIC_H 29 #include "common/endian.h" 30 #include "sword2/animation.h" 31 #include "sword2/memory.h" 40 #define OBJECT_KILL_LIST_SIZE 50 42 #define MAX_SEQUENCE_TEXT_LINES 15 56 inline byte *decodePtr(int32 n) {
57 return _vm->_memory->decodePtr(n);
60 uint32 _objectKillList[OBJECT_KILL_LIST_SIZE];
66 uint32 _currentRunList;
79 uint32 _smackerLeadIn;
80 uint32 _smackerLeadOut;
83 uint32 _sequenceTextLines;
85 MovieText _sequenceTextList[MAX_SEQUENCE_TEXT_LINES];
95 uint32 _speechAnimType;
97 uint32 _leftClickDelay;
98 uint32 _rightClickDelay;
103 int16 _textX, _textY;
105 void locateTalker(int32 *params);
106 void formText(int32 *params);
107 bool wantSpeechForLine(uint32 wavId);
110 byte _engineMega[56];
120 EventUnit *getEventList() {
return _eventList; }
121 byte *getEngineMega() {
return _engineMega; }
124 byte _saveGraphic[12];
133 int16 _officialTextNumber;
136 uint32 _speechTextBlocNo;
138 uint32 readVar(
int n) {
139 return READ_LE_UINT32(_scriptVars + 4 * n);
142 void writeVar(
int n, uint32 value) {
143 WRITE_LE_UINT32(_scriptVars + 4 * n, value);
146 int runResScript(uint32 scriptRes, uint32 offset);
147 int runResObjScript(uint32 scriptRes, uint32 objRes, uint32 offset);
148 int runScript(byte *scriptData, byte *objectData, uint32 offset);
149 int runScript2(byte *scriptData, byte *objectData, byte *offset);
151 void sendEvent(uint32
id, uint32 interact_id);
152 void setPlayerActionEvent(uint32
id, uint32 interact_id);
154 int checkEventWaiting();
155 void clearEvent(uint32
id);
156 void killAllIdsEvents(uint32
id);
158 uint32 countEvents();
168 void clearSyncs(uint32
id);
169 void sendSync(uint32
id, uint32 sync);
174 typedef int32 (
Logic::*OpcodeProc)(int32 *);
183 int32 fnTestFunction(int32 *params);
184 int32 fnTestFlags(int32 *params);
185 int32 fnRegisterStartPoint(int32 *params);
186 int32 fnInitBackground(int32 *params);
187 int32 fnSetSession(int32 *params);
188 int32 fnBackSprite(int32 *params);
189 int32 fnSortSprite(int32 *params);
190 int32 fnForeSprite(int32 *params);
191 int32 fnRegisterMouse(int32 *params);
192 int32 fnAnim(int32 *params);
193 int32 fnRandom(int32 *params);
194 int32 fnPreLoad(int32 *params);
195 int32 fnAddSubject(int32 *params);
196 int32 fnInteract(int32 *params);
197 int32 fnChoose(int32 *params);
198 int32 fnWalk(int32 *params);
199 int32 fnWalkToAnim(int32 *params);
200 int32 fnTurn(int32 *params);
201 int32 fnStandAt(int32 *params);
202 int32 fnStand(int32 *params);
203 int32 fnStandAfterAnim(int32 *params);
204 int32 fnPause(int32 *params);
205 int32 fnMegaTableAnim(int32 *params);
206 int32 fnAddMenuObject(int32 *params);
207 int32 fnStartConversation(int32 *params);
208 int32 fnEndConversation(int32 *params);
209 int32 fnSetFrame(int32 *params);
210 int32 fnRandomPause(int32 *params);
211 int32 fnRegisterFrame(int32 *params);
212 int32 fnNoSprite(int32 *params);
213 int32 fnSendSync(int32 *params);
214 int32 fnUpdatePlayerStats(int32 *params);
215 int32 fnPassGraph(int32 *params);
216 int32 fnInitFloorMouse(int32 *params);
217 int32 fnPassMega(int32 *params);
218 int32 fnFaceXY(int32 *params);
219 int32 fnEndSession(int32 *params);
220 int32 fnNoHuman(int32 *params);
221 int32 fnAddHuman(int32 *params);
222 int32 fnWeWait(int32 *params);
223 int32 fnTheyDoWeWait(int32 *params);
224 int32 fnTheyDo(int32 *params);
225 int32 fnWalkToTalkToMega(int32 *params);
226 int32 fnFadeDown(int32 *params);
227 int32 fnISpeak(int32 *params);
228 int32 fnTotalRestart(int32 *params);
229 int32 fnSetWalkGrid(int32 *params);
230 int32 fnSpeechProcess(int32 *params);
231 int32 fnSetScaling(int32 *params);
232 int32 fnStartEvent(int32 *params);
233 int32 fnCheckEventWaiting(int32 *params);
234 int32 fnRequestSpeech(int32 *params);
235 int32 fnGosub(int32 *params);
236 int32 fnTimedWait(int32 *params);
237 int32 fnPlayFx(int32 *params);
238 int32 fnStopFx(int32 *params);
239 int32 fnPlayMusic(int32 *params);
240 int32 fnStopMusic(int32 *params);
241 int32 fnSetValue(int32 *params);
242 int32 fnNewScript(int32 *params);
243 int32 fnGetSync(int32 *params);
244 int32 fnWaitSync(int32 *params);
245 int32 fnRegisterWalkGrid(int32 *params);
246 int32 fnReverseMegaTableAnim(int32 *params);
247 int32 fnReverseAnim(int32 *params);
248 int32 fnAddToKillList(int32 *params);
249 int32 fnSetStandbyCoords(int32 *params);
250 int32 fnBackPar0Sprite(int32 *params);
251 int32 fnBackPar1Sprite(int32 *params);
252 int32 fnForePar0Sprite(int32 *params);
253 int32 fnForePar1Sprite(int32 *params);
254 int32 fnSetPlayerActionEvent(int32 *params);
255 int32 fnSetScrollCoordinate(int32 *params);
256 int32 fnStandAtAnim(int32 *params);
257 int32 fnSetScrollLeftMouse(int32 *params);
258 int32 fnSetScrollRightMouse(int32 *params);
259 int32 fnColor(int32 *params);
260 int32 fnFlash(int32 *params);
261 int32 fnPreFetch(int32 *params);
262 int32 fnGetPlayerSaveData(int32 *params);
263 int32 fnPassPlayerSaveData(int32 *params);
264 int32 fnSendEvent(int32 *params);
265 int32 fnAddWalkGrid(int32 *params);
266 int32 fnRemoveWalkGrid(int32 *params);
267 int32 fnCheckForEvent(int32 *params);
268 int32 fnPauseForEvent(int32 *params);
269 int32 fnClearEvent(int32 *params);
270 int32 fnFaceMega(int32 *params);
271 int32 fnPlaySequence(int32 *params);
272 int32 fnShadedSprite(int32 *params);
273 int32 fnUnshadedSprite(int32 *params);
274 int32 fnFadeUp(int32 *params);
275 int32 fnDisplayMsg(int32 *params);
276 int32 fnSetObjectHeld(int32 *params);
277 int32 fnAddSequenceText(int32 *params);
278 int32 fnResetGlobals(int32 *params);
279 int32 fnSetPalette(int32 *params);
280 int32 fnRegisterPointerText(int32 *params);
281 int32 fnFetchWait(int32 *params);
282 int32 fnRelease(int32 *params);
283 int32 fnPrepareMusic(int32 *params);
284 int32 fnSoundFetch(int32 *params);
285 int32 fnSmackerLeadIn(int32 *params);
286 int32 fnSmackerLeadOut(int32 *params);
287 int32 fnStopAllFx(int32 *params);
288 int32 fnCheckPlayerActivity(int32 *params);
289 int32 fnResetPlayerActivityDelay(int32 *params);
290 int32 fnCheckMusicPlaying(int32 *params);
291 int32 fnPlayCredits(int32 *params);
292 int32 fnSetScrollSpeedNormal(int32 *params);
293 int32 fnSetScrollSpeedSlow(int32 *params);
294 int32 fnRemoveChooser(int32 *params);
295 int32 fnSetFxVolAndPan(int32 *params);
296 int32 fnSetFxVol(int32 *params);
297 int32 fnRestoreGame(int32 *params);
298 int32 fnRefreshInventory(int32 *params);
299 int32 fnChangeShadows(int32 *params);
302 int processSession();
305 void expressChangeSession(uint32 sesh_id);
310 void logicUp(uint32 new_script);
312 void logicReplace(uint32 new_script);
313 void logicOne(uint32 new_script);
314 void resetKillList();
317 uint32 getLocationNum();
Definition: animation.h:37
Definition: animation.h:46
Definition: animation.h:62