ScummVM API documentation
specialopcodes.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 DRAGONS_SPECIALOPCODES_H
23 #define DRAGONS_SPECIALOPCODES_H
24 
25 #include "common/func.h"
26 #include "common/str.h"
27 
28 
29 namespace Dragons {
30 
31 #define DRAGONS_NUM_SPECIAL_OPCODES 0x8c
32 
33 class DragonsEngine;
34 
35 typedef Common::Functor0<void> SpecialOpcode;
36 
38 public:
40  ~SpecialOpcodes();
41  void run(int16 opcode);
42 
43  struct SceneUpdater {
44  void *tbl;
45  uint16 counter;
46  int16 iniID;
47  int16 sequenceID;
48  uint32 curSequence;
49  uint32 curSequenceIndex;
50  uint32 numTotalSequences;
51  uint32 sequenceDuration;
52  uint16 numSteps[8];
53  uint16 iniIDTbl[8][5];
54  uint16 sequenceIDTbl[8][5];
55  uint32 textTbl[8][5];
56 
57  SceneUpdater() {
58  tbl = nullptr;
59  iniID = sequenceID = 0;
60  counter = 0;
61  curSequence = curSequenceIndex = numTotalSequences = sequenceDuration = 0;
62 
63  for (uint i = 0; i < 8; i++) {
64  numSteps[i] = 0;
65  for (int j = 0; j < 5; j++) {
66  iniIDTbl[i][j] = 0;
67  sequenceIDTbl[i][j] = 0;
68  textTbl[i][j] = 0;
69  }
70  }
71  }
72  } sceneUpdater;
73 
74 protected:
75  DragonsEngine *_vm;
76  SpecialOpcode *_opcodes[DRAGONS_NUM_SPECIAL_OPCODES];
77  Common::String _opcodeNames[DRAGONS_NUM_SPECIAL_OPCODES];
78  int16 _specialOpCounter;
79  uint8 _dat_80083148;
80  uint16 _uint16_t_80083154;
81 
82 public:
83  int16 getSpecialOpCounter();
84  void setSpecialOpCounter(int16 newValue);
85 
86 protected:
87  void initOpcodes();
88  void freeOpcodes();
89 
90  // Opcodes
91  void spcCatapultMiniGame(); // 1
92  void spcThumbWrestlingMiniGame(); // 2
93  void spcClearEngineFlag10(); // 3
94  void spcSetEngineFlag10(); // 4
95 
96  void spcRabbitsMiniGame(); //6
97  void spcDancingMiniGame(); // 7
98  void spcCastleGardenLogic(); // 8
99  void spcUnk9();
100  void spcUnkA();
101 
102  void spcUnkC();
103  void spcFadeScreen(); // 0xd
104  void spcLadyOfTheLakeCapturedSceneLogic(); // 0xe, 0xf
105  void spcStopLadyOfTheLakeCapturedSceneLogic(); // 0x10
106  void spc11ShakeScreen(); //0x11
107  void spcHandleInventionBookTransition(); // 0x12
108  void spcUnk13InventionBookCloseRelated(); //0x13
109  void spcClearEngineFlag8(); // 0x14
110  void spcSetEngineFlag8(); // 0x15
111 
112  void spcKnightPoolReflectionLogic(); //0x17
113 
114  void spcWalkOnStilts(); //0x19
115  void spcActivatePizzaMakerActor(); // 0x1a
116  void spcDeactivatePizzaMakerActor(); // 0x1b
117  void spcPizzaMakerActorStopWorking(); // 0x1c
118  void spcDragonArrivesAtTournament(); // 0x1d
119  void spcDragonCatapultMiniGame(); // 0x1e
120  void spcStGeorgeDragonLanded(); // 0x1f
121 
122  void spcSetEngineFlag0x20000(); // 0x21
123  void spcClearEngineFlag0x20000(); // 0x22
124  void spcSetEngineFlag0x200000(); // 0x23
125  void spcClearEngineFlag0x200000(); // 0x24
126  void spcFlickerSetPriority2(); // 0x25
127  void spcMenInMinesSceneLogic(); //0x26
128  void spcStopMenInMinesSceneLogic(); //0x27
129  void spcMonksAtBarSceneLogic(); //0x28
130  void spcStopMonksAtBarSceneLogic(); //0x29
131 
132  void spcFlameBedroomEscapeSceneLogic(); // 0x2b
133  void spcStopFlameBedroomEscapeSceneLogic(); // 0x2c
134 
135  void spcCastleMoatFull(); //0x2e
136  void spcCastleRestoreScalePoints(); //0x2f
137  void spcCastleMoatUpdateActorSceneScalePoints(); //0x30
138  void spcCastleGateMoatDrainedSceneLogic(); //0x31
139 
140  void spcUnk34(); //0x34 pitchfork mole.
141 
142  void spcFlickerClearFlag0x80(); //0x36
143 
144  void spcNoop1(); // 0x38
145  void spcTownAngryVillagersSceneLogic(); //0x39
146  void spcBlackDragonCrashThroughGate(); //0x3a
147  void spcSetEngineFlag0x2000000(); // 0x3b
148  void spcClearEngineFlag0x2000000(); // 0x3c
149 
150  void spcZigmondFraudSceneLogic(); // 0x3e
151 
152  void spcZigmondFraudSceneLogic1(); // 0x40
153  void spcBrokenBlackDragonSceneLogic(); // 0x41
154  void spcDodoUnderAttackSceneLogic(); //0x42
155  void spcForestWithoutDodoSceneLogic(); //0x43
156 
157  void spcBlackDragonOnHillSceneLogic(); //0x46
158 
159  void spcHedgehogTest(); // 0x48
160  void spcLoadScene1(); // 0x49
161 
162  void spcKnightsSavedCastleCutScene(); //0x4b
163  void spcFlickerReturnsCutScene(); // 0x4c
164  void spcKnightsSavedAgainCutScene(); //0c4d
165  void spcUnk4e();
166  void spcUnk4f();
167  void spcCloseInventory(); // 0x50
168  void spcOpenInventionBook(); // 0x51
169  void spcCloseInventionBook(); // 0x52
170  void spcClearEngineFlag0x4000000(); // 0x53
171  void spcSetEngineFlag0x4000000(); // 0x54
172  void spcSetCursorSequenceIdToZero(); // 0x55
173 
174  void spcFlickerSetFlag0x80(); // 0x5b
175 
176  void spcUnk5d();
177  void spcUnk5e();
178  void spcUnk5f();
179 
180  void spcCastleBuildBlackDragonSceneLogic(); //0x61
181  void spcStopSceneUpdateFunction(); //0x62
182  void spcSetInventorySequenceTo5(); // 0x63
183  void spcResetInventorySequence(); // 0x64
184  void spcUnk65ScenePaletteRelated(); // 0x65;
185  void spcUnk66();
186  void spcTournamentSetCamera(); // 0x67
187  void spcTournamentCutScene(); // 0x68
188  void spcInsideBlackDragonUpdatePalette(); // 0x69
189  void spcCastleGateSceneLogic(); // 0x6a
190  void spcTransitionToMap(); // 0x6b
191  void spcTransitionFromMap(); // 0x6c
192  void spcCaveOfDilemmaSceneLogic(); // 0x6d
193 
194  void spcLoadLadyOfTheLakeActor(); //0x70
195  void spcFadeCreditsToBackStageScene(); //0x71
196  void spcRunCredits(); //0x72
197  void spcEndCreditsAndRestartGame(); //0x73
198  void spcUseClickerOnLever(); // 0x74
199 
200  void spcJesterInLibrarySceneLogic(); // 0x77
201 
202  void spcBlackDragonDialogForCamelhot(); // 0x7a
203  void spcSetCameraXToZero(); //0x7b
204  void spcDiamondIntroSequenceLogic(); //0x7c
205  void spcLoadFileS10a6act(); //0x7d
206  void spcLoadFileS10a7act(); //0x7e
207  void spcFlickerPutOnStGeorgeArmor(); //0x7f
208  void spcUnk80FlickerArmorOn(); //0x80
209  void spcShakeScreenSceneLogic(); //0x81
210  void spcClearTextFromScreen(); // 0x82
211  void spcStopScreenShakeUpdater(); // 0x83
212  void spcInsideBlackDragonScreenShake(); // 0x84
213  void spc85SetScene1To0x35(); //0x85
214  void spc86SetScene1To0x33(); //0x86
215  void spc87SetScene1To0x17(); //0x87
216  void spc88SetScene1To0x16(); //0x88
217  void spcSetUnkFlag2(); // 0x89
218  void spcClearUnkFlag2(); //0x8a
219  void spcUnk8b(); //0x8b
220 
221  void setupTableBasedSceneUpdateFunction(uint16 initialCounter, uint16 numSequences, uint16 sequenceDuration);
222 private:
223  void panCamera(int16 mode);
224  void pizzaMakerStopWorking();
225 
226  void clearSceneUpdateFunction();
227  void mapTransition(uint16 mode);
228 
229 };
230 
231 // update functions
232 
233 void castleFogUpdateFunction();
234 void menInMinesSceneUpdateFunction();
235 void monksAtBarSceneUpdateFunction();
236 void flameEscapeSceneUpdateFunction();
237 void pizzaUpdateFunction();
238 void tableBasedSceneUpdateFunction();
239 void castleBuildingBlackDragon2UpdateFunction();
240 void shakeScreenUpdateFunction();
241 void ladyOfTheLakeCapturedUpdateFunction();
242 void caveOfDilemmaUpdateFunction();
243 void moatDrainedSceneUpdateFunction();
244 
245 } // End of namespace Dragons
246 
247 #endif // DRAGONS_SPECIALOPCODES_H
Definition: str.h:59
Definition: specialopcodes.h:37
Definition: specialopcodes.h:43
Definition: actor.h:26
Definition: dragons.h:167