ScummVM API documentation
scumm_v5.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef SCUMM_SCRIPT_V5_H
23 #define SCUMM_SCRIPT_V5_H
24 
25 #include "scumm/scumm.h"
26 
27 namespace Scumm {
28 
29 class ScummEngine_v5 : public ScummEngine {
30 protected:
31  uint16 _cursorImages[4][17];
32  byte _cursorHotspots[2 * 4];
33 
34  struct {
35  int x, y, w, h;
36  byte *buffer;
37  uint16 xStrips, yStrips;
38  bool eraseFlag;
39  } _flashlight;
40 
41  char _saveLoadVarsFilename[256];
42 
43  enum {
44  PARAM_1 = 0x80,
45  PARAM_2 = 0x40,
46  PARAM_3 = 0x20
47  };
48 
49  int _resultVarNumber;
50 
51 public:
52  ScummEngine_v5(OSystem *syst, const DetectorResult &dr);
53 
54  void clearFlashlight();
55 
56  void resetCursors() override;
57 
58 protected:
59  void setupOpcodes() override;
60 
61  void scummLoop_handleActors() override;
62  void scummLoop_handleSaveLoad() override;
63 
64  void setupScummVars() override;
65  void resetScummVars() override;
66  virtual void decodeParseString();
67  void decodeParseStringTextString(int textSlot);
68  void printPatchedMI1CannibalString(int textSlot, const byte *ptr);
69 
70  void saveLoadWithSerializer(Common::Serializer &s) override;
71  int checkSoundEngineSaveDataSize(Serializer &s) override;
72 
73  void readMAXS(int blockSize) override;
74 
75  int getWordVararg(int *ptr);
76 
77  virtual int getVar();
78  virtual int getVarOrDirectByte(byte mask);
79  virtual int getVarOrDirectWord(byte mask);
80 
81  virtual void getResultPos();
82  void setResult(int result);
83 
84  void animateCursor() override;
85 
86  void setBuiltinCursor(int index) override;
87  void redefineBuiltinCursorFromChar(int index, int chr);
88  void redefineBuiltinCursorHotspot(int index, int x, int y);
89 
90  void drawFlashlight();
91 
92  void walkActorToActor(int actor, int toActor, int dist);
93 
94  void injectMISESpeech();
95 
96  void workaroundIndy3TownsMissingLightningCastle(int sound);
97  void workaroundLoomHetchelDoubleHead(Actor *a, int act);
98  bool workaroundMonkey1JollyRoger(byte callerOpcode, int arg);
99  bool workaroundMonkey1StorekeeperWaitTablesLine();
100 
105  void jumpRelative(bool cond);
106 
107  /* Version 5 script opcodes */
108  void o5_actorFollowCamera();
109  void o5_actorFromPos();
110  void o5_actorOps();
111  void o5_add();
112  void o5_and();
113  void o5_animateActor();
114  void o5_breakHere();
115  void o5_chainScript();
116  void o5_cursorCommand();
117  void o5_cutscene();
118  void o5_debug();
119  void o5_decrement();
120  void o5_delay();
121  void o5_delayVariable();
122  void o5_divide();
123  void o5_doSentence();
124  void o5_drawBox();
125  void o5_drawObject();
126  void o5_dummy();
127  void o5_endCutscene();
128  void o5_equalZero();
129  void o5_expression();
130  void o5_faceActor();
131  void o5_findInventory();
132  void o5_findObject();
133  void o5_freezeScripts();
134  void o5_getActorCostume();
135  void o5_getActorElevation();
136  void o5_getActorFacing();
137  void o5_getActorMoving();
138  void o5_getActorRoom();
139  void o5_getActorScale();
140  void o5_getActorWalkBox();
141  void o5_getActorWidth();
142  void o5_getActorX();
143  void o5_getActorY();
144  void o5_getAnimCounter();
145  void o5_getClosestObjActor();
146  void o5_getDist();
147  void o5_getInventoryCount();
148  void o5_getObjectOwner();
149  void o5_getObjectState();
150  void o5_getRandomNr();
151  void o5_getStringWidth();
152  void o5_getVerbEntrypoint();
153  void o5_ifClassOfIs();
154  void o5_increment();
155  void o5_isActorInBox();
156  void o5_isEqual();
157  void o5_isGreater();
158  void o5_isGreaterEqual();
159  void o5_isLess();
160  void o5_isLessEqual();
161  void o5_isNotEqual();
162  void o5_isScriptRunning();
163  void o5_isSoundRunning();
164  void o5_jumpRelative();
165  void o5_lights();
166  void o5_loadRoom();
167  void o5_loadRoomWithEgo();
168  void o5_matrixOps();
169  void o5_move();
170  void o5_move_segafix();
171  void o5_multiply();
172  void o5_notEqualZero();
173  void o5_or();
174  void o5_beginOverride();
175  void o5_panCameraTo();
176  void o5_pickupObject();
177  void o5_print();
178  void o5_printEgo();
179  void o5_pseudoRoom();
180  void o5_putActor();
181  void o5_putActorAtObject();
182  void o5_putActorInRoom();
183  void o5_systemOps();
184  void o5_resourceRoutines();
185  void o5_roomOps();
186  void o5_saveRestoreVerbs();
187  void o5_setCameraAt();
188  void o5_setClass();
189  void o5_setObjectName();
190  void o5_setOwnerOf();
191  void o5_setState();
192  void o5_setVarRange();
193  void o5_soundKludge();
194  void o5_startMusic();
195  void o5_startObject();
196  void o5_startScript();
197  void o5_startSound();
198  void o5_stopMusic();
199  void o5_stopObjectCode();
200  void o5_stopObjectScript();
201  void o5_stopScript();
202  void o5_stopSound();
203  void o5_stringOps();
204  void o5_subtract();
205  void o5_verbOps();
206  void o5_wait();
207  void o5_walkActorTo();
208  void o5_walkActorToActor();
209  void o5_walkActorToObject();
210 };
211 
212 
213 } // End of namespace Scumm
214 
215 #endif
Definition: scumm_v5.h:29
Definition: serializer.h:79
Definition: scumm.h:508
Definition: actor.h:100
void jumpRelative(bool cond)
Definition: serializer.h:33
Definition: system.h:163
Definition: actor.h:30
Definition: detection.h:133