1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef CRYO_EDEN_H
#define CRYO_EDEN_H
#include "cryo/sound.h"
#include "cryo/defs.h"
enum Direction {
kCryoNorth = 0,
kCryoEast = 1,
kCryoSouth = 2,
kCryoWest = 3
};
#define EDEN_DEBUG
namespace Cryo {
class CryoEngine;
class EdenGame {
private:
CryoEngine *_vm;
public:
void run();
EdenGame(CryoEngine *vm);
private:
void removeConsole();
void scroll();
void resetScroll();
void scrollFrescoes();
void displayFrescoes();
void gametofresques();
void doFrescoes();
void actionEndFrescoes();
void scrollMirror();
void scrollPanel();
void displayFollower(Follower *follower, int16 x, int16 y);
void characterInMirror();
void gameToMirror(byte arg1);
void flipMode();
void quitMirror();
void clictimbre();
void actionClickValleyPlan();
void gotoPlace(Goto *go);
void deplaval(uint16 roomNum);
void move(Direction dir);
void move2(Direction dir);
void actionDinoBlow();
void actionPlateMonk();
void actionGraaFrescoe();
void actionLascFrescoe();
void actionPushStone();
void actionMummyHead();
void actionSkelettonHead();
void actionSkelettonMoorkong();
void actionChoose();
void handleDinaDialog();
void handleKingDialog();
void actionKingDialog1();
void actionKingDialog2();
void actionKingDialog3();
void actionGetKnife();
void actionGetPrism();
void actionGetMushroom();
void actionGetBadMushroom();
void actionGetGold();
void actionGetFullNest();
void actionGetEmptyNest();
void actionGetHorn();
void actionGetSunStone();
void actionGetEgg();
void actionGetTablet();
void actionLookLake();
void actionGotoHall();
void actionLabyrinthTurnAround();
void actionGotoFullNest();
void actionGotoVal();
void actionVisit();
void actionFinal();
void actionMoveNorth();
void actionMoveEast();
void actionMoveSouth();
void actionMoveWest();
void display();
void afficher128();
void saveFriezes();
void saveTopFrieze(int16 x);
void saveBottomFrieze();
void restoreFriezes();
void restoreTopFrieze();
void restoreBottomFrieze();
void useMainBank();
void useCharacterBank();
void useBank(int16 bank);
void sundcurs(int16 x, int16 y);
void rundcurs();
void noclipax(int16 index, int16 x, int16 y);
void noclipax_avecnoir(int16 index, int16 x, int16 y);
void getglow(int16 x, int16 y, int16 w, int16 h);
void unglow();
void glow(int16 index);
void readPalette(byte *ptr);
void spriteOnSubtitle(int16 index, int16 x, int16 y);
void hideBars();
void showBars();
void saveMouthBackground();
void restoreMouthBackground();
void drawBlackBars();
void drawTopScreen();
void displayValleyMap();
void displayMapMark(int16 index, int16 location);
void displayAdamMapMark(int16 location);
void restoreAdamMapMark();
void saveAdamMapMark(int16 x, int16 y);
bool istrice(int16 roomNum);
bool istyran(int16 roomNum);
void istyranval(Area *area);
char getDirection(perso_t *perso);
bool canMoveThere(char loc, perso_t *perso);
void scramble1(uint8 elem[4]);
void scramble2(uint8 elem[4]);
void scrambleDirections();
bool naitredino(char persoType);
void newCitadel(char area, int16 level, Room *room);
void evolveCitadel(int16 level);
void destroyCitadelRoom(int16 roomNum);
void narratorBuildCitadel();
void citadelFalls(char level);
void buildCitadel();
void moveDino(perso_t *perso);
void moveAllDino();
void newValley();
char whereIsCita();
bool isCita(int16 loc);
void placeVava(Area *area);
void vivredino();
void vivreval(int16 areaNum);
void handleDay();
void addTime(int16 t);
void animCharacter();
void getanimrnd();
void addanim();
void removeMouthSprite();
void AnimEndCharacter();
void setCharacterSprite(byte *spr);
void displayImage();
void displayCharacter1();
void displayCharacter();
void ef_perso();
void loadCharacter(perso_t *perso);
void loadCurrCharacter();
void fin_perso();
void no_perso();
void closeCharacterScreen();
void displayBackgroundFollower();
void displayNoFollower(int16 bank);
void displayCharacterBackground1();
void displayCharacterBackground();
void setCharacterIcon();
void showCharacter();
void displayCharacterPanel();
void getDataSync();
int16 readFrameNumber();
void waitEndSpeak();
void my_bulle();
void my_pr_bulle();
void drawSubtitleChar(byte c, byte color, int16 width);
void displaySubtitles();
void saveUnderSubtitles(int16 y);
void restoreUnderSubtitles();
void displayHNMSubtitle();
void patchSentence();
void vavapers();
void citadelle();
void selectZone();
void showEvents1();
void showEvents();
void parle_mfin();
void parlemoi_normal();
void parle_moi();
void initCharacterPointers(perso_t *perso);
void perso1(perso_t *perso);
void perso_normal(perso_t *perso);
void handleCharacterDialog(int16 pers);
void actionKing();
void actionDina();
void actionThoo();
void actionMonk();
void actionTormentor();
void actionMessenger();
void actionMango();
void actionEve();
void actionAzia();
void actionMammi();
void actionGuards();
void actionBamboo();
void actionKabuka();
void actionFisher();
void actionDino();
void actionTyran();
void actionMorkus();
void comment();
void actionAdam();
void setChoiceYes();
void setChoiceNo();
bool isAnswerYes();
void specialMushroom(perso_t *perso);
void specialEmptyNest(perso_t *perso);
void specialNestWithEggs(perso_t *perso);
void specialApple(perso_t *perso);
void specialGold(perso_t *perso);
void specialPrism(perso_t *perso);
void specialTalisman(perso_t *perso);
void specialMask(perso_t *perso);
void specialBag(perso_t *perso);
void specialTrumpet(perso_t *perso);
void specialWeapons(perso_t *perso);
void specialInstrument(perso_t *perso);
void specialEgg(perso_t *perso);
void tyranDies(perso_t *perso);
void specialObjects(perso_t *perso, char objid);
void dialautoon();
void dialautooff();
void follow();
void dialonfollow();
void abortDialogue();
void subHandleNarrator();
void handleNarrator();
void checkPhraseFile();
byte *getPhrase(int16 id);
void actionGotoMap();
void record();
bool dial_scan(dial_t *dial);
bool dialoscansvmas(dial_t *dial);
bool dialogEvent(perso_t *perso);
void characterStayHere();
void endDeath(int16 vid);
void chronoEvent();
void setChrono(int16 t);
void preloadDialogs(int16 vid);
void displayEffect1();
void displayEffect2();
void displayEffect3();
void displayEffect4();
void clearScreen();
void colimacon(int16 pattern[16]);
void fadeToBlack(int delay);
void fadeToBlackLowPalette(int delay);
void fadeFromBlackLowPalette(int delay);
void blackRect32();
void setSrcRect(int16 sx, int16 sy, int16 ex, int16 ey);
void setDestRect(int16 sx, int16 sy, int16 ex, int16 ey);
void wait(int howlong);
void effetpix();
void verifh(byte *ptr);
void openbigfile();
void closebigfile();
void loadRawFile(uint16 num, byte *buffer);
void loadIconFile(uint16 num, Icon *buffer);
void loadRoomFile(uint16 num, Room *buffer);
void loadHnm(uint16 num);
int loadSound(uint16 num);
void convertMacToPC();
void loadpermfiles();
bool ReadDataSyncVOC(unsigned int num);
bool ReadDataSync(uint16 num);
void loadpartoffile(uint16 num, void *buffer, int32 pos, int32 len);
void expandHSQ(byte *input, byte *output);
void addInfo(byte info);
void unlockInfo();
void nextInfo();
void removeInfo(byte info);
void updateInfoList();
void initGlobals();
void initRects();
void closeRoom();
void displaySingleRoom(Room *room);
void displayRoom();
void displayPlace();
void loadPlace(int16 num);
void specialoutside();
void specialout();
void specialin();
void animpiece();
void getdino(Room *room);
Room *getRoom(int16 loc);
void initPlace(int16 roomNum);
void maj2();
void updateRoom1(int16 roomNum);
void updateRoom(uint16 roomNum);
void allocateBuffers();
void freebuf();
void openWindow();
void EmergencyExit();
void edmain();
void intro();
void enterGame();
void signon(const char *s);
void FRDevents();
Icon *scan_icon_list(int16 x, int16 y, int16 index);
void updateCursor();
void mouse();
void showMovie(char arg1);
void playHNM(int16 num);
void handleHNMSubtitles();
void musique();
void startmusique(byte num);
void musicspy();
int loadmusicfile(int16 num);
void persovox();
void endCharacterSpeech();
void fademusicup();
void fademusica0(int16 delay);
object_t *getObjectPtr(int16 id);
void countObjects();
void showObjects();
void winObject(int16 id);
void loseObject(int16 id);
void lostObject();
bool isObjectHere(int16 id);
void objectmain(int16 id);
void getObject(int16 id);
void putObject();
void newObject(int16 id, int16 arg2);
void giveobjectal(int16 id);
void giveObject();
void actionTakeObject();
void newMushroom();
void newEmptyNest();
void newNestWithEggs();
void newor();
void gotoPanel();
void noclicpanel();
void generique();
void cancel2();
void testvoice();
void load();
void initafterload();
void save();
void desktopcolors();
void panelrestart();
void reallyquit();
void confirmer(char mode, char yesId);
void confirmYes();
void confirmNo();
void restart();
void edenQuit();
void choseSubtitleOption();
void changeVolume();
void changervol();
void newvol(byte *volptr, int16 delta);
void playtape();
void rewindtape();
void depcurstape();
void affcurstape();
void forwardtape();
void stoptape();
void cliccurstape();
void paneltobuf();
void cursbuftopanel();
void langbuftopanel();
void displayPanel();
void displayLanguage();
void displayVolCursor(int16 x, int16 vol1, int16 vol2);
void displayCursors();
void selectCursor(int itemId);
void displayTopPanel();
void displayResult();
void restrictCursorArea(int16 xmin, int16 xmax, int16 ymin, int16 ymax);
void edenShudown();
void habitants(perso_t *perso);
void suiveurs(perso_t *perso);
void evenements(perso_t *perso);
void followme(perso_t *perso);
void rangermammi(perso_t *perso, Room *room);
void perso_ici(int16 action);
void setCharacterHere();
void faire_suivre(int16 roomNum);
void AddCharacterToParty();
void addToParty(int16 index);
void removeCharacterFromParty();
void removeFromParty(int16 index);
void handleEloiDeparture();
bool checkEloiReturn();
void handleEloiReturn();
void incPhase();
void phase113();
void phase130();
void phase161();
void phase226();
void phase257();
void phase353();
void phase369();
void phase371();
void phase385();
void phase418();
void phase433();
void phase434();
void phase513();
void phase514();
void phase529();
void phase545();
void phase561();
void bigphase1();
void bigphase();
void phase16();
void phase32();
void phase48();
void phase64();
void phase80();
void phase96();
void phase112();
void phase128();
void phase144();
void phase160();
void phase176();
void phase192();
void phase208();
void phase224();
void phase240();
void phase256();
void phase272();
void phase288();
void phase304();
void phase320();
void phase336();
void phase352();
void phase368();
void phase384();
void phase400();
void phase416();
void phase432();
void phase448();
void phase464();
void phase480();
void phase496();
void phase512();
void phase528();
void phase544();
void phase560();
void savegame(char *name);
void loadrestart();
void loadgame(char *name);
void vavaoffsetout();
void vavaoffsetin();
void lieuoffsetout();
void lieuoffsetin();
void bandeoffsetout();
void bandeoffsetin();
char testCondition(int16 index);
uint16 operAdd(uint16 v1, uint16 v2);
uint16 operSub(uint16 v1, uint16 v2);
uint16 operLogicalAnd(uint16 v1, uint16 v2);
uint16 operLogicalOr(uint16 v1, uint16 v2);
uint16 operIsEqual(uint16 v1, uint16 v2);
uint16 operIsSmaller(uint16 v1, uint16 v2);
uint16 operIsGreater(uint16 v1, uint16 v2);
uint16 operIsDifferent(uint16 v1, uint16 v2);
uint16 operIsSmallerOrEqual(uint16 v1, uint16 v2);
uint16 operIsGreaterOrEqual(uint16 v1, uint16 v2);
uint16 operFalse(uint16 v1, uint16 v2);
uint16 operation(byte op, uint16 v1, uint16 v2);
uint16 fetchValue();
void actionNop();
void initCosTable();
void makeMatriceFix();
void projectionFix(cube_t *cube, int n);
void initCubeMac();
void engineMac();
void displayObject(cube_t *cube);
void loadMap(int file_id, byte *buffer);
void NEWcharge_objet_mob(cube_t *cube, int fileNum, byte *texturePtr);
static int nextVal(char **ptr, char *error);
void selectMap(int16 num);
void Eden_dep_and_rot();
void restoreZDEP();
void displayPolygoneMapping(cube_t *cube, cubeface_t *face);
void drawMappingLine(int16 r3, int16 r4, int16 r5, int16 r6, int16 r7, int16 r8, int16 r9, int16 r10, int16 *lines);
void displayMappingLine(int16 r3, int16 r4, byte *target, byte *texture);
int16 OpenDialog(void *arg1, void *arg2);
void LostEdenMac_InitPrefs();
void initCubePC();
void enginePC();
void selectPCMap(int16 num);
void makeTables();
void getSinCosTables(unsigned short angle, signed char **cos_table, signed char **sin_table);
void rotatePoint(XYZ *point, XYZ *rpoint);
void mapPoint(XYZ *point, short *x, short *y);
short calcFaceArea(XYZ *face);
void paintPixel(XYZ *point, unsigned char pixel);
void paintFace0(XYZ *point);
void paintFace1(XYZ *point);
void paintFace2(XYZ *point);
void paintFace3(XYZ *point);
void paintFace4(XYZ *point);
void paintFace5(XYZ *point);
void paintFaces();
void renderCube();
void incAngleX(int step);
void decAngleX();
void incAngleY(int step);
void decAngleY();
void incZoom();
void decZoom();
cubeCursor *_pcCursor;
int8 tab1[30];
int8 tab2[30];
int8 tab3[36][71];
short _angleX, _angleY, _angleZ, _zoomZ, _zoomZStep;
int8 *_cosX, *_sinX;
int8 *_cosY, *_sinY;
int8 *_cosZ, *_sinZ;
uint8 *_face[6], *_newface[6];
int8 _faceSkip;
uint8 _cursor[40 * 40];
uint8 *_cursorCenter;
private:
int16 _scrollPos;
int16 _oldScrollPos;
bool _frescoTalk;
byte _oldPix[8];
Common::Point _adamMapMarkPos;
byte _cursKeepBuf[2500];
Common::Point _cursKeepPos;
bool _torchCursor;
int16 _curBankNum;
int16 _glowX;
int16 _glowY;
int16 _glowW;
int16 _glowH;
bool _paletteUpdateRequired;
bool _cursorSaved;
bool _showBlackBars;
bool _backgroundSaved;
byte *_bankData;
color_t _globalPalette[256]; //TODO palette_t
perso_t *_tyranPtr;
int _lastAnimFrameNumb;
int _curAnimFrameNumb;
int _lastAnimTicks;
prect_t *_curCharacterRect;
int16 _numAnimFrames;
int16 _maxPersoDesc;
int16 _numImgDesc;
bool _restartAnimation;
bool _animationActive;
byte _animationDelay;
byte _animationIndex;
byte _lastAnimationIndex;
byte *dword_30724;
byte *dword_30728; //TODO: rename - something amim-related
byte *_mouthAnimations;
byte *_animationTable;
byte _imageDesc[512];
byte *_characterBankData;
bool _savedUnderSubtitles;
int16 _numTextLines;
byte _sentenceBuffer[400];
byte phraseIconsBuffer[10];
byte _sentenceCoordsBuffer[22];
byte *_textOutPtr;
byte *textout;
object_t *_curSpecialObject;
bool _lastDialogChoice;
bool parlemoiNormalFlag;
bool _closeCharacterDialog;
int dword_30B04;
char lastPhrasesFile;
byte dialogSkipFlags;
color3_t newColor;
color_t oldPalette[256]; // TODO palette_t ?
color_t newPalette[256];
Common::Rect rect_dst, rect_src;
byte *_voiceSamplesBuffer; //TODO: sound sample buffer
Common::File _bigfile;
byte _infoList[16];
bool _needToFade;
byte *_mainBankBuf;
byte *_musicBuf;
byte *_gameLipsync;
byte *_gamePhrases;
byte *_gameDialogs; //TODO: rename to dialogs?
byte *_gameConditions;
byte *_placeRawBuf; //TODO: fixme
byte *_bankDataBuf;
Icon *_gameIcons;
Room *_gameRooms;
PakHeaderNode *_bigfileHeader;
byte *_glowBuffer;
byte *_mainViewBuf;
byte *_view2Buf;
byte *_gameFont; //TODO: rename to font?
byte *_subtitlesViewBuf;
byte *_underSubtitlesViewBuf; // CHECKME: Useless?
global_t *_globals;
uint16 _mouseCenterX;
uint16 _mouseCenterY;
bool _bufferAllocationErrorFl;
bool _quitFlag2;
bool _quitFlag3;
bool _gameStarted;
bool _soundAllocated;
CSoundChannel *_musicChannel;
CSoundChannel *_voiceChannel;
SoundChannel *_hnmSoundChannel;
Sound *_voiceSound;
View *_view2;
View *_underSubtitlesView;
View *_subtitlesView;
View *_underBarsView;
View *_mainView;
View *_hnmView;
Common::Rect _underSubtitlesBackupRect;
Common::Rect _underSubtitlesScreenRect;
Common::Rect _underBottomBarBackupRect;
Common::Rect _underBottomBarScreenRect;
Common::Rect _underTopBarBackupRect;
Common::Rect _underTopBarScreenRect;
int _demoCurrentTicks;
int _demoStartTicks;
int _currentTime;
bool _doubledScreen;
int16 _cirsorPanX;
int16 _inventoryScrollDelay;
int16 _cursorPosX;
int16 _cursorPosY;
int16 _currCursor;
Icon *_currSpot;
Icon *_curSpot2;
bool _keyboardHeld;
bool _mouseHeld;
bool _normalCursor;
byte *_hnmViewBuf;
bool _showVideoSubtitle;
bool _videoCanceledFlag; //TODO: hnm_canceled
bool _specialTextMode;
int _hnmFrameNum;
int _voiceSamplesSize; //TODO: perso vox sample data len
int16 _musicRightVol;
int16 _musicLeftVol;
bool _animateTalking;
bool _personTalking;
byte _musicFadeFlag;
char _musicSequencePos;
bool _musicPlayingFlag;
byte *_musicSamplesPtr;
byte *_musicPatternsPtr; //TODO: sndblock_t ?
byte *_musSequencePtr;
bool _musicEnabledFlag;
uint16 *_currentObjectLocation;
byte _ownObjects[128];
bool byte_31D64;
bool _noPalette;
bool _gameLoaded;
#define MAX_TAPES 16
tape_t _tapes[MAX_TAPES];
byte _confirmMode;
byte *_curSliderValuePtr;
byte _lastMenuItemIdLo;
int16 _lastTapeRoomNum;
int16 _curSliderX;
int16 _curSliderY;
int16 _destinationRoom;
int16 word_31E7A; // CHECKME: Unused?
int16 word_378CC; // TODO: set by CLComputer_Init to 0
int16 word_378CE; // CHECKME: Unused
int _invIconsCount;
int _invIconsBase;
int _roomIconsBase;
//// cube.c
int16 _cosSinTable[361 * 2];
int _passMat31, _passMat21, _passMat11;
int _passMat32, _passMat22, _passMat12;
int _passMat33, _passMat23, _passMat13;
int16 _rotationAngleY; // CHECKME: USeless?
int16 _rotationAngleX, _rotationAngleZ;
float _translationY, _translationX; // CHECKME: Useless?
cube_t _cube;
int16 _cursCurPCMap;
int16 _lines[200 * 8];
byte _cubeTexture[0x4000];
int _cubeFaces;
uint32 _cursorOldTick, _cursorNewTick;
byte *_codePtr;
};
}
#endif
|