ScummVM API documentation
inter.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  * This file is dual-licensed.
22  * In addition to the GPLv3 license mentioned above, this code is also
23  * licensed under LGPL 2.1. See LICENSES/COPYING.LGPL file for the
24  * full text of the license.
25  *
26  */
27 
28 #ifndef GOB_INTER_H
29 #define GOB_INTER_H
30 
31 #include "common/func.h"
32 #include "common/hashmap.h"
33 
34 #include "gob/goblin.h"
35 #include "gob/variables.h"
36 #include "gob/iniconfig.h"
37 #include "gob/databases.h"
38 
39 namespace Common {
40  class WinResources;
41 }
42 
43 namespace Gob {
44 
45 class Cheater_Geisha;
46 
47 namespace Geisha {
48  class Diving;
49  class Penetration;
50 }
51 
52 // This is to help devices with small memory (PDA, smartphones, ...)
53 // to save a bit of memory used by opcode names in the Gob engine.
54 #ifndef REDUCE_MEMORY_USAGE
55  #define _OPCODEDRAW(ver, x) setProc(new Common::Functor0Mem<void, ver>(this, &ver::x), #x)
56  #define _OPCODEFUNC(ver, x) setProc(new Common::Functor1Mem<OpFuncParams &, void, ver>(this, &ver::x), #x)
57  #define _OPCODEGOB(ver, x) setProc(new Common::Functor1Mem<OpGobParams &, void, ver>(this, &ver::x), #x)
58 #else
59  #define _OPCODEDRAW(ver, x) setProc(new Common::Functor0Mem<void, ver>(this, &ver::x), "")
60  #define _OPCODEFUNC(ver, x) setProc(new Common::Functor1Mem<OpFuncParams &, void, ver>(this, &ver::x), "")
61  #define _OPCODEGOB(ver, x) setProc(new Common::Functor1Mem<OpGobParams &, void, ver>(this, &ver::x), "")
62 #endif
63 
64 #define CLEAROPCODEDRAW(i) _opcodesDraw[i].setProc(0, 0)
65 #define CLEAROPCODEFUNC(i) _opcodesFunc[i].setProc(0, 0)
66 #define CLEAROPCODEGOB(i) _opcodesGob.erase(i)
67 
68 typedef Common::Functor0<void> OpcodeDraw;
71 
72 struct OpFuncParams {
73  byte cmdCount;
74  byte counter;
75  int16 retFlag;
76  bool doReturn;
77 };
78 struct OpGobParams {
79  int16 extraData;
80  int16 paramCount;
81  VariableReference retVarPtr;
82  Goblin::Gob_Object *objDesc;
83 };
84 
85 template<typename T>
87  T *proc;
88  const char *desc;
89 
90  OpcodeEntry() : proc(0), desc(0) {}
91  ~OpcodeEntry() {
92  setProc(0, 0);
93  }
94 
95  void setProc(T *p, const char *d) {
96  if (proc != p) {
97  delete proc;
98  proc = p;
99  }
100  desc = d;
101  }
102 };
103 
104 class Inter {
105 public:
106  uint8 _terminate;
107 
108  int16 *_breakFromLevel;
109  int16 *_nestLevel;
110 
111  uint32 _soundEndTimeKey;
112  int16 _soundStopVal;
113 
114  Variables *_variables;
115 
116  void setupOpcodes();
117 
118  void initControlVars(char full);
119  void renewTimeInVars();
120  void storeMouse();
121  void storeKey(int16 key);
122 
123  void writeVar(uint32 offset, uint16 type, uint32 value);
124 
125  void funcBlock(int16 retFlag);
126  void callSub(int16 retFlag);
127 
128  void allocateVars(uint32 count);
129  void delocateVars();
130 
131  virtual int16 loadSound(int16 slot) = 0;
132  virtual void animPalette() = 0;
133 
134  Inter(GobEngine *vm);
135  virtual ~Inter();
136 
137 protected:
138  OpcodeEntry<OpcodeDraw> _opcodesDraw[256];
139  OpcodeEntry<OpcodeFunc> _opcodesFunc[256];
141 
142  bool _break;
143 
144  int16 _animPalLowIndex[8];
145  int16 _animPalHighIndex[8];
146  int16 _animPalDir[8];
147 
148  VariableStack _varStack;
149 
150  // Busy-wait detection
151  bool _noBusyWait;
152  uint32 _lastBusyWait;
153 
154  GobEngine *_vm;
155 
156  void executeOpcodeDraw(byte i);
157  void executeOpcodeFunc(byte i, byte j, OpFuncParams &params);
158  void executeOpcodeGob(int i, OpGobParams &params);
159 
160  const char *getDescOpcodeDraw(byte i);
161  const char *getDescOpcodeFunc(byte i, byte j);
162  const char *getDescOpcodeGob(int i);
163 
164  virtual void setupOpcodesDraw() = 0;
165  virtual void setupOpcodesFunc() = 0;
166  virtual void setupOpcodesGob() = 0;
167 
168  virtual void checkSwitchTable(uint32 &offset) = 0;
169 
170  void o_drawNOP() {}
171  void o_funcNOP(OpFuncParams &params) {}
172  void o_gobNOP(OpGobParams &params) {}
173 
174  void storeValue(uint16 index, uint16 type, uint32 value);
175  void storeValue(uint32 value);
176 
177  void storeString(uint16 index, uint16 type, const char *value);
178  void storeString(const char *value);
179 
180  uint32 readValue(uint16 index, uint16 type);
181 
182  void handleBusyWait();
183 };
184 
185 class Inter_v1 : public Inter {
186 public:
187  Inter_v1(GobEngine *vm);
188  ~Inter_v1() override {}
189 
190  int16 loadSound(int16 slot) override;
191  void animPalette() override;
192 
193 protected:
194  void setupOpcodesDraw() override;
195  void setupOpcodesFunc() override;
196  void setupOpcodesGob() override;
197 
198  void checkSwitchTable(uint32 &offset) override;
199 
200  void o1_loadMult();
201  void o1_playMult();
202  void o1_freeMultKeys();
203  void o1_initCursor();
204  void o1_initCursorAnim();
205  void o1_clearCursorAnim();
206  void o1_setRenderFlags();
207  void o1_loadAnim();
208  void o1_freeAnim();
209  void o1_updateAnim();
210  void o1_initMult();
211  void o1_freeMult();
212  void o1_animate();
213  void o1_loadMultObject();
214  void o1_getAnimLayerInfo();
215  void o1_getObjAnimSize();
216  void o1_loadStatic();
217  void o1_freeStatic();
218  void o1_renderStatic();
219  void o1_loadCurLayer();
220  void o1_playCDTrack();
221  void o1_getCDTrackPos();
222  void o1_stopCD();
223  void o1_loadFontToSprite();
224  void o1_freeFontToSprite();
225  void o1_callSub(OpFuncParams &params);
226  void o1_printTotText(OpFuncParams &params);
227  void o1_loadCursor(OpFuncParams &params);
228  void o1_switch (OpFuncParams &params);
229  void o1_repeatUntil(OpFuncParams &params);
230  void o1_whileDo(OpFuncParams &params);
231  void o1_if(OpFuncParams &params);
232  void o1_assign(OpFuncParams &params);
233  void o1_loadSpriteToPos(OpFuncParams &params);
234  void o1_printText(OpFuncParams &params);
235  void o1_loadTot(OpFuncParams &params);
236  void o1_palLoad(OpFuncParams &params);
237  void o1_keyFunc(OpFuncParams &params);
238  void o1_capturePush(OpFuncParams &params);
239  void o1_capturePop(OpFuncParams &params);
240  void o1_animPalInit(OpFuncParams &params);
241  void o1_drawOperations(OpFuncParams &params);
242  void o1_setcmdCount(OpFuncParams &params);
243  void o1_return(OpFuncParams &params);
244  void o1_renewTimeInVars(OpFuncParams &params);
245  void o1_speakerOn(OpFuncParams &params);
246  void o1_speakerOff(OpFuncParams &params);
247  void o1_putPixel(OpFuncParams &params);
248  void o1_goblinFunc(OpFuncParams &params);
249  void o1_createSprite(OpFuncParams &params);
250  void o1_freeSprite(OpFuncParams &params);
251  void o1_returnTo(OpFuncParams &params);
252  void o1_loadSpriteContent(OpFuncParams &params);
253  void o1_copySprite(OpFuncParams &params);
254  void o1_fillRect(OpFuncParams &params);
255  void o1_drawLine(OpFuncParams &params);
256  void o1_strToLong(OpFuncParams &params);
257  void o1_invalidate(OpFuncParams &params);
258  void o1_setBackDelta(OpFuncParams &params);
259  void o1_playSound(OpFuncParams &params);
260  void o1_stopSound(OpFuncParams &params);
261  void o1_loadSound(OpFuncParams &params);
262  void o1_freeSoundSlot(OpFuncParams &params);
263  void o1_waitEndPlay(OpFuncParams &params);
264  void o1_playComposition(OpFuncParams &params);
265  void o1_getFreeMem(OpFuncParams &params);
266  void o1_checkData(OpFuncParams &params);
267  void o1_cleanupStr(OpFuncParams &params);
268  void o1_insertStr(OpFuncParams &params);
269  void o1_cutStr(OpFuncParams &params);
270  void o1_strstr(OpFuncParams &params);
271  void o1_istrlen(OpFuncParams &params);
272  void o1_setMousePos(OpFuncParams &params);
273  void o1_setFrameRate(OpFuncParams &params);
274  void o1_animatePalette(OpFuncParams &params);
275  void o1_animateCursor(OpFuncParams &params);
276  void o1_blitCursor(OpFuncParams &params);
277  void o1_loadFont(OpFuncParams &params);
278  void o1_freeFont(OpFuncParams &params);
279  void o1_readData(OpFuncParams &params);
280  void o1_writeData(OpFuncParams &params);
281  void o1_manageDataFile(OpFuncParams &params);
282  void o1_setState(OpGobParams &params);
283  void o1_setCurFrame(OpGobParams &params);
284  void o1_setNextState(OpGobParams &params);
285  void o1_setMultState(OpGobParams &params);
286  void o1_setOrder(OpGobParams &params);
287  void o1_setActionStartState(OpGobParams &params);
288  void o1_setCurLookDir(OpGobParams &params);
289  void o1_setType(OpGobParams &params);
290  void o1_setNoTick(OpGobParams &params);
291  void o1_setPickable(OpGobParams &params);
292  void o1_setXPos(OpGobParams &params);
293  void o1_setYPos(OpGobParams &params);
294  void o1_setDoAnim(OpGobParams &params);
295  void o1_setRelaxTime(OpGobParams &params);
296  void o1_setMaxTick(OpGobParams &params);
297  void o1_getState(OpGobParams &params);
298  void o1_getCurFrame(OpGobParams &params);
299  void o1_getNextState(OpGobParams &params);
300  void o1_getMultState(OpGobParams &params);
301  void o1_getOrder(OpGobParams &params);
302  void o1_getActionStartState(OpGobParams &params);
303  void o1_getCurLookDir(OpGobParams &params);
304  void o1_getType(OpGobParams &params);
305  void o1_getNoTick(OpGobParams &params);
306  void o1_getPickable(OpGobParams &params);
307  void o1_getObjMaxFrame(OpGobParams &params);
308  void o1_getXPos(OpGobParams &params);
309  void o1_getYPos(OpGobParams &params);
310  void o1_getDoAnim(OpGobParams &params);
311  void o1_getRelaxTime(OpGobParams &params);
312  void o1_getMaxTick(OpGobParams &params);
313  void o1_manipulateMap(OpGobParams &params);
314  void o1_getItem(OpGobParams &params);
315  void o1_manipulateMapIndirect(OpGobParams &params);
316  void o1_getItemIndirect(OpGobParams &params);
317  void o1_setPassMap(OpGobParams &params);
318  void o1_setGoblinPosH(OpGobParams &params);
319  void o1_getGoblinPosXH(OpGobParams &params);
320  void o1_getGoblinPosYH(OpGobParams &params);
321  void o1_setGoblinMultState(OpGobParams &params);
322  void o1_setGoblinUnk14(OpGobParams &params);
323  void o1_setItemIdInPocket(OpGobParams &params);
324  void o1_setItemIndInPocket(OpGobParams &params);
325  void o1_getItemIdInPocket(OpGobParams &params);
326  void o1_getItemIndInPocket(OpGobParams &params);
327  void o1_setGoblinPos(OpGobParams &params);
328  void o1_setGoblinState(OpGobParams &params);
329  void o1_setGoblinStateRedraw(OpGobParams &params);
330  void o1_decRelaxTime(OpGobParams &params);
331  void o1_getGoblinPosX(OpGobParams &params);
332  void o1_getGoblinPosY(OpGobParams &params);
333  void o1_clearPathExistence(OpGobParams &params);
334  void o1_setGoblinVisible(OpGobParams &params);
335  void o1_setGoblinInvisible(OpGobParams &params);
336  void o1_getObjectIntersect(OpGobParams &params);
337  void o1_getGoblinIntersect(OpGobParams &params);
338  void o1_setItemPos(OpGobParams &params);
339  void o1_loadObjects(OpGobParams &params);
340  void o1_freeObjects(OpGobParams &params);
341  void o1_animateObjects(OpGobParams &params);
342  void o1_drawObjects(OpGobParams &params);
343  void o1_loadMap(OpGobParams &params);
344  void o1_moveGoblin(OpGobParams &params);
345  void o1_switchGoblin(OpGobParams &params);
346  void o1_loadGoblin(OpGobParams &params);
347  void o1_writeTreatItem(OpGobParams &params);
348  void o1_moveGoblin0(OpGobParams &params);
349  void o1_setGoblinTarget(OpGobParams &params);
350  void o1_setGoblinObjectsPos(OpGobParams &params);
351  void o1_initGoblin(OpGobParams &params);
352 
353  void manipulateMap(int16 xPos, int16 yPos, int16 item);
354 
355 private:
356  bool _ignoreSpeakerOff = false;
357 };
358 
359 class Inter_Geisha : public Inter_v1 {
360 public:
361  Inter_Geisha(GobEngine *vm);
362  ~Inter_Geisha() override;
363 
364 protected:
365  void setupOpcodesDraw() override;
366  void setupOpcodesFunc() override;
367  void setupOpcodesGob() override;
368 
369  void oGeisha_loadCursor(OpFuncParams &params);
370  void oGeisha_loadTot(OpFuncParams &params);
371  void oGeisha_goblinFunc(OpFuncParams &params);
372  void oGeisha_loadSound(OpFuncParams &params);
373  void oGeisha_checkData(OpFuncParams &params);
374  void oGeisha_readData(OpFuncParams &params);
375  void oGeisha_writeData(OpFuncParams &params);
376 
377  void oGeisha_gamePenetration(OpGobParams &params);
378  void oGeisha_gameDiving(OpGobParams &params);
379  void oGeisha_loadTitleMusic(OpGobParams &params);
380  void oGeisha_playMusic(OpGobParams &params);
381  void oGeisha_stopMusic(OpGobParams &params);
382 
383  void oGeisha_caress1(OpGobParams &params);
384  void oGeisha_caress2(OpGobParams &params);
385 
386  int16 loadSound(int16 slot) override;
387 
388 private:
389  Geisha::Diving *_diving;
390  Geisha::Penetration *_penetration;
391 
392  Cheater_Geisha *_cheater;
393 };
394 
395 class Inter_v2 : public Inter_v1 {
396 public:
397  Inter_v2(GobEngine *vm);
398  ~Inter_v2() override {}
399 
400  int16 loadSound(int16 search) override;
401  void animPalette() override;
402 
403 protected:
404  void setupOpcodesDraw() override;
405  void setupOpcodesFunc() override;
406  void setupOpcodesGob() override;
407 
408  void checkSwitchTable(uint32 &offset) override;
409 
410  void o2_playMult();
411  void o2_freeMultKeys();
412  void o2_setRenderFlags();
413  void o2_multSub();
414  void o2_initMult();
415  void o2_loadMultObject();
416  void o2_renderStatic();
417  void o2_loadCurLayer();
418  void o2_playCDTrack();
419  void o2_waitCDTrackEnd();
420  void o2_stopCD();
421  void o2_readLIC();
422  void o2_freeLIC();
423  void o2_getCDTrackPos();
424  void o2_loadFontToSprite();
425  void o2_totSub();
426  void o2_switchTotSub();
427  void o2_pushVars();
428  void o2_popVars();
429  void o2_loadMapObjects();
430  void o2_freeGoblins();
431  void o2_moveGoblin();
432  void o2_writeGoblinPos();
433  void o2_stopGoblin();
434  void o2_setGoblinState();
435  void o2_placeGoblin();
436  void o2_initScreen();
437  void o2_scroll();
438  void o2_setScrollOffset();
439  void o2_playImd();
440  void o2_getImdInfo();
441  void o2_openItk();
442  void o2_closeItk();
443  void o2_setImdFrontSurf();
444  void o2_resetImdFrontSurf();
445  void o2_assign(OpFuncParams &params);
446  void o2_printText(OpFuncParams &params);
447  void o2_animPalInit(OpFuncParams &params);
448  void o2_addHotspot(OpFuncParams &params);
449  void o2_removeHotspot(OpFuncParams &params);
450  void o2_getTotTextItemPart(OpFuncParams &params);
451  void o2_goblinFunc(OpFuncParams &params);
452  void o2_stopSound(OpFuncParams &params);
453  void o2_loadSound(OpFuncParams &params);
454  void o2_getFreeMem(OpFuncParams &params);
455  void o2_checkData(OpFuncParams &params);
456  void o2_readData(OpFuncParams &params);
457  void o2_writeData(OpFuncParams &params);
458  void o2_loadInfogramesIns(OpGobParams &params);
459  void o2_playInfogrames(OpGobParams &params);
460  void o2_startInfogrames(OpGobParams &params);
461  void o2_stopInfogrames(OpGobParams &params);
462  void o2_handleGoblins(OpGobParams &params);
463  void o2_playProtracker(OpGobParams &params);
464  void o2_stopProtracker(OpGobParams &params);
465 };
466 
467 class Inter_Bargon : public Inter_v2 {
468 public:
469  Inter_Bargon(GobEngine *vm);
470  ~Inter_Bargon() override {}
471 
472 protected:
473  void setupOpcodesDraw() override;
474  void setupOpcodesFunc() override;
475  void setupOpcodesGob() override;
476 
477  void oBargon_intro0(OpGobParams &params);
478  void oBargon_intro1(OpGobParams &params);
479  void oBargon_intro2(OpGobParams &params);
480  void oBargon_intro3(OpGobParams &params);
481  void oBargon_intro4(OpGobParams &params);
482  void oBargon_intro5(OpGobParams &params);
483  void oBargon_intro6(OpGobParams &params);
484  void oBargon_intro7(OpGobParams &params);
485  void oBargon_intro8(OpGobParams &params);
486  void oBargon_intro9(OpGobParams &params);
487 };
488 
489 class Inter_Fascination : public Inter_v2 {
490 public:
492  ~Inter_Fascination() override {}
493 
494 protected:
495  void setupOpcodesDraw() override;
496  void setupOpcodesFunc() override;
497  void setupOpcodesGob() override;
498 
499  void oFascin_playProtracker(OpGobParams &params);
500 
501  void oFascin_repeatUntil(OpFuncParams &params);
502  void oFascin_assign(OpFuncParams &params);
503  void oFascin_copySprite(OpFuncParams &params);
504  void oFascin_keyFunc(OpFuncParams &params);
505 
506  void oFascin_playTirb(OpGobParams &params);
507  void oFascin_playTira(OpGobParams &params);
508  void oFascin_loadExtasy(OpGobParams &params);
509  void oFascin_adlibPlay(OpGobParams &params);
510  void oFascin_adlibStop(OpGobParams &params);
511  void oFascin_adlibUnload(OpGobParams &params);
512  void oFascin_loadMus1(OpGobParams &params);
513  void oFascin_loadMus2(OpGobParams &params);
514  void oFascin_loadMus3(OpGobParams &params);
515  void oFascin_loadBatt1(OpGobParams &params);
516  void oFascin_loadBatt2(OpGobParams &params);
517  void oFascin_loadBatt3(OpGobParams &params);
518  void oFascin_loadMod(OpGobParams &params);
519  void oFascin_setWinSize();
520  void oFascin_closeWin();
521  void oFascin_activeWin();
522  void oFascin_openWin();
523  void oFascin_initCursorAnim();
524  void oFascin_setRenderFlags();
525  void oFascin_setWinFlags();
526 };
527 
528 class Inter_LittleRed : public Inter_v2 {
529 public:
531  ~Inter_LittleRed() override {}
532 
533 protected:
534  void setupOpcodesDraw() override;
535  void setupOpcodesFunc() override;
536  void setupOpcodesGob() override;
537 
538  void oLittleRed_keyFunc(OpFuncParams &params);
539  void oLittleRed_playComposition(OpFuncParams &params);
540 };
541 
542 class Inter_Adibou1 : public Inter_v2 {
543 public:
545  ~Inter_Adibou1() override {}
546 
547 protected:
548  void setupOpcodesDraw() override;
549  void setupOpcodesFunc() override;
550  void setupOpcodesGob() override;
551 
552  void oAdibou1_writeSprite(OpGobParams &params);
553  void oAdibou1_readSprite(OpGobParams &params);
554  void oAdibou1_fillAreaAtPoint(OpGobParams &params);
555  void oAdibou1_getAppliNameFromId(OpGobParams &params);
556  void oAdibou1_listApplications(OpGobParams &params);
557 };
558 
559 class Inter_v3 : public Inter_v2 {
560 public:
561  Inter_v3(GobEngine *vm);
562  ~Inter_v3() override {}
563 
564 protected:
565  void setupOpcodesDraw() override;
566  void setupOpcodesFunc() override;
567  void setupOpcodesGob() override;
568 
569  void o3_speakerOn(OpFuncParams &params);
570  void o3_speakerOff(OpFuncParams &params);
571  void o3_copySprite(OpFuncParams &params);
572 
573  void o3_wobble(OpGobParams &params);
574 
575 private:
576  bool _ignoreSpeakerOff;
577 };
578 
579 class Inter_Inca2 : public Inter_v3 {
580 public:
581  Inter_Inca2(GobEngine *vm);
582  ~Inter_Inca2() override {}
583 
584 protected:
585  void setupOpcodesDraw() override;
586  void setupOpcodesFunc() override;
587  void setupOpcodesGob() override;
588 
589  void oInca2_spaceShooter(OpFuncParams &params);
590  void oInca2_goblinFunc(OpFuncParams &params);
591 };
592 
593 class Inter_v4 : public Inter_v3 {
594 public:
595  Inter_v4(GobEngine *vm);
596  ~Inter_v4() override {}
597 
598 protected:
599  void setupOpcodesDraw() override;
600  void setupOpcodesFunc() override;
601  void setupOpcodesGob() override;
602 
603  void o4_initScreen();
604  void o4_playVmdOrMusic();
605 };
606 
607 class Inter_v5 : public Inter_v4 {
608 public:
609  Inter_v5(GobEngine *vm);
610  ~Inter_v5() override {}
611 
612 protected:
613  byte _gob_97_98_val;
614 
615  void setupOpcodesDraw() override;
616  void setupOpcodesFunc() override;
617  void setupOpcodesGob() override;
618 
619  void o5_deleteFile();
620  void o5_initScreen();
621 
622  void o5_istrlen(OpFuncParams &params);
623 
624  void o5_spaceShooter(OpGobParams &params);
625  void o5_getSystemCDSpeed(OpGobParams &params);
626  void o5_getSystemRAM(OpGobParams &params);
627  void o5_getSystemCPUSpeed(OpGobParams &params);
628  void o5_getSystemDrawSpeed(OpGobParams &params);
629  void o5_totalSystemSpecs(OpGobParams &params);
630  void o5_saveSystemSpecs(OpGobParams &params);
631  void o5_loadSystemSpecs(OpGobParams &params);
632 
633  void o5_gob92(OpGobParams &params);
634  void o5_gob95(OpGobParams &params);
635  void o5_gob96(OpGobParams &params);
636  void o5_gob97(OpGobParams &params);
637  void o5_gob98(OpGobParams &params);
638  void o5_gob100(OpGobParams &params);
639  void o5_gob200(OpGobParams &params);
640 };
641 
642 class Inter_v6 : public Inter_v5 {
643 public:
644  Inter_v6(GobEngine *vm);
645  ~Inter_v6() override {}
646 
647 protected:
648  bool _gotFirstPalette;
649 
650  void setupOpcodesDraw() override;
651  void setupOpcodesFunc() override;
652  void setupOpcodesGob() override;
653 
654  void o6_totSub();
655  void o6_playVmdOrMusic();
656 
657  void o6_loadCursor(OpFuncParams &params);
658  void o6_assign(OpFuncParams &params);
659  void o6_removeHotspot(OpFuncParams &params);
660  void o6_fillRect(OpFuncParams &params);
661 
662  void probe16bitMusic(Common::String &fileName);
663 };
664 
665 class Inter_Playtoons : public Inter_v6 {
666 public:
668  ~Inter_Playtoons() override {}
669 
670 protected:
671  void setupOpcodesDraw() override;
672  void setupOpcodesFunc() override;
673  void setupOpcodesGob() override;
674 
675  void oPlaytoons_printText(OpFuncParams &params);
676  void oPlaytoons_F_1B(OpFuncParams &params);
677  void oPlaytoons_putPixel(OpFuncParams &params);
678  void oPlaytoons_freeSprite(OpFuncParams &params);
679  void oPlaytoons_checkData(OpFuncParams &params);
680  void oPlaytoons_readData(OpFuncParams &params);
681 
682  void oPlaytoons_loadMultObject();
683  void oPlaytoons_getObjAnimSize();
684  void oPlaytoons_CD_20_23();
685  void oPlaytoons_CD_25();
686  void oPlaytoons_copyFile();
687  void oPlaytoons_openItk();
688 
689  Common::String getFile(const char *path, bool stripPath = true);
690 
691  bool readSprite(Common::String file, int32 dataVar, int32 size, int32 offset);
692 };
693 
694 class Inter_v7 : public Inter_Playtoons {
695 public:
696  Inter_v7(GobEngine *vm);
697  ~Inter_v7() override {};
698 
699 protected:
700  void setupOpcodesDraw() override;
701  void setupOpcodesFunc() override;
702  void setupOpcodesGob() override;
703 
704  void o7_draw0x0C();
705  void o7_setCursorToLoadFromExec();
706  void o7_freeMult();
707  void o7_loadMultObject();
708  void o7_getFreeMem(OpFuncParams &params);
709  void o7_displayWarning();
710  void o7_logString();
711  void o7_moveGoblin();
712  void o7_setGoblinState();
713  void o7_intToString();
714  void o7_callFunction();
715  void o7_loadFunctions();
716  void o7_moveFile();
717  void o7_copyFile();
718  void o7_deleteFile();
719  void o7_playVmdOrMusic();
720  void o7_initScreen();
721  void o7_setActiveCD();
722  void o7_findFile();
723  void o7_findNextFile();
724  void o7_getSystemProperty();
725  void o7_loadImage();
726  void o7_setVolume();
727  void o7_zeroVar();
728  void o7_getINIValue();
729  void o7_setINIValue();
730  void o7_loadIFFPalette();
731  void o7_opendBase();
732  void o7_closedBase();
733  void o7_getDBString();
734 
735  void o7_loadCursor(OpFuncParams &params);
736  void o7_printText(OpFuncParams &params);
737  void o7_fillRect(OpFuncParams &params);
738  void o7_drawLine(OpFuncParams &params);
739  void o7_invalidate(OpFuncParams &params);
740  void o7_checkData(OpFuncParams &params);
741  void o7_readData(OpFuncParams &params);
742  void o7_writeData(OpFuncParams &params);
743 
744  void o7_oemToANSI(OpGobParams &params);
745  void o7_gob0x201(OpGobParams &params);
746 
747 private:
748  INIConfig _inis;
749  Databases _databases;
750 
751  Common::ArchiveMemberList _remainingFilesFromPreviousSearch;
752  Common::String _currentCDPath;
753 
754  Common::String findFile(const Common::String &mask, const Common::String &previousFile);
755  void copyFile(const Common::String &sourceFile, const Common::String &destFile);
756 
757  bool setCurrentCDPath(const Common::String &dir);
758  Common::Array<uint32> getAdibou2InstalledApplications();
759 };
760 
761 } // End of namespace Gob
762 
763 #endif // GOB_INTER_H
Definition: inter.h:559
Definition: inter.h:359
Definition: gob.h:163
Definition: str.h:59
Definition: inter.h:665
Definition: inter.h:489
Definition: inter.h:542
Definition: inter.h:86
Definition: inter.h:694
Definition: variables.h:33
Definition: inter.h:642
Definition: diving.h:52
Definition: cheater.h:55
Definition: list.h:44
Definition: goblin.h:63
Definition: inter.h:528
Definition: variables.h:153
Definition: noncopyable.h:39
Definition: inter.h:467
Definition: inter.h:607
Definition: anifile.h:40
Definition: inter.h:72
Definition: hashmap.h:85
Definition: inter.h:104
Definition: algorithm.h:29
Definition: inter.h:395
Definition: func.h:437
Definition: inter.h:78
Definition: variables.h:133
Definition: inter.h:593
Definition: databases.h:40
Definition: penetration.h:51
Definition: inter.h:185
Definition: iniconfig.h:37
Definition: inter.h:579