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
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
|
/* 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 DREAMWEB_H
#define DREAMWEB_H
#include "common/error.h"
#include "common/file.h"
#include "common/random.h"
#include "common/rect.h"
#include "common/savefile.h"
#include "common/scummsys.h"
#include "common/system.h"
#include "audio/audiostream.h"
#include "audio/mixer.h"
#include "engines/advancedDetector.h"
#include "engines/engine.h"
#include "dreamweb/console.h"
#include "dreamweb/structs.h"
#define SCUMMVM_HEADER MKTAG('S', 'C', 'V', 'M')
#define SCUMMVM_BLOCK_MAGIC_SIZE 0x1234
#define SAVEGAME_VERSION 1
namespace DreamWeb {
const unsigned int kNumReelRoutines = 57;
const unsigned int kUnderTextSizeX = 180;
const unsigned int kUnderTextSizeY = 10;
const unsigned int kUnderTimedTextSizeY = 24;
const unsigned int kUnderTextSizeX_f = 228; // foreign version
const unsigned int kUnderTextSizeY_f = 13; // foreign version
const unsigned int kUnderTimedTextSizeY_f = 30;
const unsigned int kUnderTextBufSize = kUnderTextSizeX_f * kUnderTextSizeY_f;
const unsigned int kUnderTimedTextBufSize = 256 * kUnderTimedTextSizeY_f;
const unsigned int kLengthOfVars = 68;
const unsigned int kNumChanges = 250;
const unsigned int kLenOfMapStore = 22*8*20*8;
const unsigned int kMapWidth = 66;
const unsigned int kMapHeight = 60;
const unsigned int kLengthOfMap = kMapWidth * kMapHeight;
const unsigned int kNumExObjects = 114;
const unsigned int kScreenwidth = 320;
const unsigned int kDiaryx = (68+24);
const unsigned int kDiaryy = (48+12);
const unsigned int kInventx = 80;
const unsigned int kInventy = 58;
const unsigned int kMenux = (80+40);
const unsigned int kMenuy = 60;
const unsigned int kOpsx = 60;
const unsigned int kOpsy = 52;
const unsigned int kSymbolx = 64;
const unsigned int kSymboly = 56;
const unsigned int kLengthofvars = 68;
const unsigned int kDebuglevel1 = (0);
const unsigned int kDebuglevel2 = (0);
const unsigned int kPlayback = (0);
const unsigned int kSpanish = (0);
const unsigned int kRecording = (0);
const unsigned int kGerman = (0);
const unsigned int kDemo = (0);
const unsigned int kExframedata = (0);
const unsigned int kExframes = (0+2080);
const unsigned int kExdata = (0+2080+30000);
const unsigned int kExtextdat = (0+2080+30000+(16*114));
const unsigned int kExtext = (0+2080+30000+(16*114)+((114+2)*2));
const unsigned int kLengthofextra = (0+2080+30000+(16*114)+((114+2)*2)+18000);
const unsigned int kForeign = (1);
const unsigned int kCd = (1);
const unsigned int kNumexobjects = (114);
const unsigned int kExtextlen = (18000);
const unsigned int kExframeslen = (30000);
const unsigned int kItempicsize = (44);
// Keyboard buffer. data.word(kBufferin) and data.word(kBufferout) are indexes
// into this, making it a ring buffer
extern uint8 g_keyBuffer[16];
// Engine Debug Flags
enum {
kDebugAnimation = (1 << 0),
kDebugSaveLoad = (1 << 1)
};
struct DreamWebGameDescription {
ADGameDescription desc;
};
class DreamWebEngine : public Engine {
private:
DreamWebConsole *_console;
bool _vSyncInterrupt;
protected:
// Engine APIs
virtual Common::Error run();
virtual bool hasFeature(EngineFeature f) const;
public:
DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc);
virtual ~DreamWebEngine();
void setVSyncInterrupt(bool flag);
void waitForVSync();
Common::Error loadGameState(int slot);
Common::Error saveGameState(int slot, const Common::String &desc);
bool canLoadGameStateCurrently();
bool canSaveGameStateCurrently();
uint8 randomNumber() { return _rnd.getRandomNumber(255); }
void openFile(const Common::String &name);
uint32 readFromFile(uint8 *data, unsigned size);
uint32 skipBytes(uint32 bytes);
void closeFile();
void mouseCall(uint16 *x, uint16 *y, uint16 *state); //fill mouse pos and button state
void processEvents();
void blit(const uint8 *src, int pitch, int x, int y, int w, int h);
void cls();
void getPalette(uint8 *data, uint start, uint count);
void setPalette(const uint8 *data, uint start, uint count);
Common::String getSavegameFilename(int slot) const;
void setShakePos(int pos) { _system->setShakePos(pos); }
void printUnderMonitor();
void quit();
void loadSounds(uint bank, const Common::String &file);
bool loadSpeech(const Common::String &filename);
void enableSavingOrLoading(bool enable = true) { _enableSavingOrLoading = enable; }
Common::Language getLanguage() const { return _language; }
uint8 modifyChar(uint8 c) const;
void stopSound(uint8 channel);
private:
void keyPressed(uint16 ascii);
void setSpeed(uint speed);
void soundHandler();
void playSound(uint8 channel, uint8 id, uint8 loops);
const DreamWebGameDescription *_gameDescription;
Common::RandomSource _rnd;
Common::File _file;
Common::InSaveFile *_inSaveFile;
uint _speed;
bool _turbo;
uint _oldMouseState;
bool _enableSavingOrLoading;
Common::Language _language;
struct Sample {
uint offset;
uint size;
Sample(): offset(), size() {}
};
struct SoundData {
Common::Array<Sample> samples;
Common::Array<uint8> data;
};
SoundData _soundData[2];
Common::Array<uint8> _speechData;
Audio::SoundHandle _channelHandle[2];
uint8 _channel0, _channel1;
protected:
const char *_timedString;
GameVars _vars; // saved variables
// from backdrop.cpp
uint8 *_backdropBlocks;
BackdropMapFlag _backdropFlags[96];
uint8 _mapData[kLengthOfMap + 32];
// from keypad.cpp
uint8 _pressList[6];
// from monitor.cpp
char _inputLine[64];
char _operand1[14];
char _currentFile[14];
// from newplace.cpp
uint8 _roomsCanGo[16];
// from object.cpp
uint16 _openChangeSize;
ObjectRef _oldSubject;
// from pathfind.cpp
Common::Point _lineData[200]; // Output of Bresenham
// from saveload.cpp
char _saveNames[17*7];
char _saveNamesOld[17*7];
// from vgagrafx.cpp
uint8 _workspace[(0x1000 + 2) * 16];
uint8 _mapStore[kLenOfMapStore + 32];
// from people.cpp
ReelRoutine _reelRoutines[kNumReelRoutines+1];
ReelRoutine *_personData;
// from Buffers
uint8 _textUnder[kUnderTextBufSize];
ObjectRef _openInvList[16];
ObjectRef _ryanInvList[30];
uint8 _pointerBack[32*32];
MapFlag _mapFlags[11*10];
uint8 _startPal[3*256];
uint8 _endPal[3*256];
uint8 _mainPal[3*256];
Common::List<Sprite> _spriteTable;
Common::List<ObjPos> _setList;
Common::List<ObjPos> _freeList;
Common::List<ObjPos> _exList;
Common::List<People> _peopleList;
uint8 _zoomSpace[46*40];
// _printedList (unused?)
Change _listOfChanges[kNumChanges]; // Note: this array is saved
uint8 _underTimedText[kUnderTimedTextBufSize];
Common::List<Rain> _rainList;
// textfiles
TextFile _textFile1;
TextFile _textFile2;
TextFile _textFile3;
TextFile _travelText;
TextFile _puzzleText;
TextFile _commandText;
// graphics files
GraphicsFile _tempGraphics;
GraphicsFile _tempGraphics2;
GraphicsFile _tempGraphics3;
GraphicsFile _icons1;
GraphicsFile _icons2;
GraphicsFile _tempCharset;
GraphicsFile _charset1;
GraphicsFile _mainSprites;
const GraphicsFile *_currentCharset;
// room files
GraphicsFile _setFrames;
GraphicsFile _freeFrames;
GraphicsFile _reel1;
GraphicsFile _reel2;
GraphicsFile _reel3;
TextFile _setDesc;
TextFile _blockDesc;
TextFile _roomDesc;
TextFile _freeDesc;
TextFile _personText;
uint16 _personFramesLE[12];
RoomPaths _pathData[36];
Reel *_reelList;
SetObject _setDat[128];
DynObject _freeDat[80];
// Extras segment (NB: this is saved)
GraphicsFile _exFrames;
DynObject _exData[kNumExObjects];
TextFile _exText;
public:
DreamWebEngine(/*DreamWeb::DreamWebEngine *en*/);
bool _quitRequested;
bool _subtitles;
bool _foreignRelease;
bool _wonGame;
// sound related
uint8 _roomsSample;
uint8 _currentSample;
uint8 _channel0Playing;
uint8 _channel0Repeat;
uint8 _channel1Playing;
uint8 _volume;
uint8 _volumeTo;
int8 _volumeDirection;
uint8 _volumeCount;
bool _speechLoaded;
// misc variables
uint8 _speechCount;
uint16 _charShift;
uint8 _kerning;
uint8 _brightness;
uint8 _roomLoaded;
uint8 _didZoom;
uint16 _lineSpacing;
uint16 _textAddressX;
uint16 _textAddressY;
uint8 _textLen;
uint16 _lastXPos;
uint8 _itemFrame;
uint8 _withObject;
uint8 _withType;
uint16 _lookCounter;
uint8 _command;
uint8 _commandType;
uint8 _objectType;
uint8 _getBack;
uint8 _invOpen;
uint8 _mainMode;
uint8 _pickUp;
uint8 _lastInvPos;
uint8 _examAgain;
uint8 _newTextLine;
uint8 _openedOb;
uint8 _openedType;
uint16 _mapAdX;
uint16 _mapAdY;
uint16 _mapOffsetX;
uint16 _mapOffsetY;
uint16 _mapXStart;
uint16 _mapYStart;
uint8 _mapXSize;
uint8 _mapYSize;
uint8 _haveDoneObs;
uint8 _manIsOffScreen;
uint8 _facing;
uint8 _leaveDirection;
uint8 _turnToFace;
uint8 _turnDirection;
uint16 _mainTimer;
uint8 _introCount;
uint8 _currentKey;
uint8 _timerCount;
uint8 _mapX;
uint8 _mapY;
uint8 _ryanX;
uint8 _ryanY;
uint8 _lastFlag;
uint8 _destPos;
uint8 _realLocation;
uint8 _roomNum;
uint8 _nowInNewRoom;
uint8 _resetManXY;
uint8 _newLocation;
uint8 _autoLocation;
uint16 _mouseX;
uint16 _mouseY;
uint16 _mouseButton;
uint16 _oldButton;
uint16 _oldX;
uint16 _oldY;
uint16 _oldPointerX;
uint16 _oldPointerY;
uint16 _delHereX;
uint16 _delHereY;
uint8 _pointerXS;
uint8 _pointerYS;
uint8 _delXS;
uint8 _delYS;
uint8 _pointerFrame;
uint8 _pointerPower;
uint8 _pointerMode;
uint8 _pointerSpeed;
uint8 _pointerCount;
uint8 _inMapArea;
uint8 _talkMode;
uint8 _talkPos;
uint8 _character;
uint8 _watchDump;
uint8 _logoNum;
uint8 _oldLogoNum;
uint8 _pressed;
uint16 _pressPointer;
uint8 _graphicPress;
uint8 _pressCount;
uint8 _lightCount;
uint8 _folderPage;
uint8 _diaryPage;
uint8 _menuCount;
uint8 _symbolTopX;
uint8 _symbolTopNum;
uint8 _symbolTopDir;
uint8 _symbolBotX;
uint8 _symbolBotNum;
uint8 _symbolBotDir;
uint16 _dumpX;
uint16 _dumpY;
uint8 _walkAndExam;
uint8 _walkExamType;
uint8 _walkExamNum;
uint16 _cursLocX;
uint16 _cursLocY;
uint16 _curPos;
uint16 _monAdX;
uint16 _monAdY;
uint16 _timeCount;
uint16 _countToTimed;
uint8 _timedY;
uint8 _timedX;
uint8 _needToDumpTimed;
uint8 _loadingOrSave;
uint8 _currentSlot;
uint8 _cursorPos;
uint8 _colourPos;
uint8 _fadeDirection;
uint8 _numToFade;
uint8 _fadeCount;
uint8 _addToGreen;
uint8 _addToRed;
uint8 _addToBlue;
uint16 _lastSoundReel;
uint8 _lastHardKey;
uint16 _bufferIn;
uint16 _bufferOut;
uint8 _blinkFrame;
uint8 _blinkCount;
uint8 _reAssesChanges;
uint8 _pointersPath;
uint8 _mansPath;
uint8 _pointerFirstPath;
uint8 _finalDest;
uint8 _destination;
uint16 _lineStartX;
uint16 _lineStartY;
uint16 _lineEndX;
uint16 _lineEndY;
uint8 _linePointer;
uint8 _lineDirection;
uint8 _lineLength;
// from backdrop.cpp
void doBlocks();
uint8 getXAd(const uint8 *setData, uint8 *result);
uint8 getYAd(const uint8 *setData, uint8 *result);
uint8 getMapAd(const uint8 *setData, uint16 *x, uint16 *y);
void calcFrFrame(const Frame &frame, uint8* width, uint8* height, uint16 x, uint16 y, ObjPos *objPos);
void makeBackOb(SetObject *objData, uint16 x, uint16 y);
void showAllObs();
void getDimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *mapXsize, uint8 *mapYsize);
void calcMapAd();
void showAllFree();
void drawFlags();
void showAllEx();
// from keypad.cpp
void getUnderMenu();
void putUnderMenu();
void singleKey(uint8 key, uint16 x, uint16 y);
void loadKeypad();
void showKeypad();
bool isItRight(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3);
void addToPressList();
void buttonOne();
void buttonTwo();
void buttonThree();
void buttonFour();
void buttonFive();
void buttonSix();
void buttonSeven();
void buttonEight();
void buttonNine();
void buttonNought();
void buttonEnter();
void buttonPress(uint8 buttonId);
void showOuterPad();
void dumpKeypad();
void dumpSymbol();
void dumpSymBox();
void quitSymbol();
void enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3);
// from monitor.cpp
void input();
byte makeCaps(byte c);
void delChar();
void monMessage(uint8 index);
void netError();
void monitorLogo();
void randomAccess(uint16 count);
void printOuterMon();
void showCurrentFile();
void accessLightOn();
void accessLightOff();
void turnOnPower();
void powerLightOn();
void powerLightOff();
void printLogo();
void scrollMonitor();
const char *monPrint(const char *string);
void lockLightOn();
void lockLightOff();
void loadPersonal();
void loadNews();
void loadCart();
void showKeys();
const char *parser();
const char *searchForString(const char *topic, const char *text);
const char *getKeyAndLogo(const char *foundString);
void read();
void dirFile(const char *dirName);
void dirCom();
void useMon();
bool execCommand();
// from newplace.cpp
void getUnderCentre();
void putUnderCentre();
void showArrows();
uint8 getLocation(uint8 index);
void setLocation(uint8 index);
void clearLocation(uint8 index);
void resetLocation(uint8 index);
void readCityPic();
void readDestIcon();
void showCity();
void locationPic();
void selectLocation();
void newPlace();
void nextDest();
void lastDest();
void destSelect();
void lookAtPlace();
// from object.cpp
void obIcons();
void fillRyan();
void findAllRyan();
void obToInv(uint8 index, uint8 flag, uint16 x, uint16 y);
void obPicture();
void removeObFromInv();
void deleteExObject(uint8 index);
void deleteExFrame(uint8 frameNum);
void deleteExText(uint8 textNum);
void purgeALocation(uint8 index);
const uint8 *getObTextStart();
void wornError();
void makeWorn(DynObject *object);
void dropObject();
ObjectRef findOpenPos();
byte getOpenedSlotSize();
byte getOpenedSlotCount();
void openOb();
void findAllOpen();
void fillOpen();
ObjectRef findInvPos();
void reExFromInv();
void swapWithInv();
void transferText(uint8 from, uint8 to);
void pickupConts(uint8 from, uint8 containerEx);
byte transferToEx(uint8 from);
void swapWithOpen();
void outOfOpen();
void inToInv();
void outOfInv();
bool checkObjectSize();
void useOpened();
void setPickup();
void selectOpenOb();
void examineOb(bool examineAgain = true);
void selectOb();
void inventory();
void identifyOb();
// from pathfind.cpp
void turnPathOn(uint8 param);
void turnPathOff(uint8 param);
void turnAnyPathOn(uint8 param, uint8 room);
void turnAnyPathOff(uint8 param, uint8 room);
RoomPaths *getRoomsPaths();
void faceRightWay();
void setWalk();
void autoSetWalk();
void checkDest(const RoomPaths *roomsPaths);
void findXYFromPath();
bool checkIfPathIsOn(uint8 index);
void bresenhams();
void workoutFrames();
byte findFirstPath(byte x, byte y);
byte findPathOfPoint(byte x, byte y);
// from people.cpp
void setupInitialReelRoutines();
void updatePeople();
void madmanText();
void madman(ReelRoutine &routine);
void madMode();
void addToPeopleList(ReelRoutine *routine);
bool checkSpeed(ReelRoutine &routine);
void sparkyDrip(ReelRoutine &routine);
void genericPerson(ReelRoutine &routine);
void gamer(ReelRoutine &routine);
void eden(ReelRoutine &routine);
void sparky(ReelRoutine &routine);
void rockstar(ReelRoutine &routine);
void madmansTelly(ReelRoutine &routine);
void smokeBloke(ReelRoutine &routine);
void manAsleep(ReelRoutine &routine);
void drunk(ReelRoutine &routine);
void introMagic1(ReelRoutine &routine);
void introMagic2(ReelRoutine &routine);
void introMagic3(ReelRoutine &routine);
void introMusic(ReelRoutine &routine);
void candles(ReelRoutine &routine);
void candles1(ReelRoutine &routine);
void candles2(ReelRoutine &routine);
void smallCandle(ReelRoutine &routine);
void gates(ReelRoutine &routine);
void security(ReelRoutine &routine);
void edenInBath(ReelRoutine &routine);
void louis(ReelRoutine &routine);
void handClap(ReelRoutine &routine);
void carParkDrip(ReelRoutine &routine);
void foghornSound(ReelRoutine &routine);
void train(ReelRoutine &routine);
void attendant(ReelRoutine &routine);
void keeper(ReelRoutine &routine);
void interviewer(ReelRoutine &routine);
void drinker(ReelRoutine &routine);
void alleyBarkSound(ReelRoutine &routine);
void louisChair(ReelRoutine &routine);
void bossMan(ReelRoutine &routine);
void priest(ReelRoutine &routine);
void monkAndRyan(ReelRoutine &routine);
void copper(ReelRoutine &routine);
void introMonks1(ReelRoutine &routine);
void introMonks2(ReelRoutine &routine);
void soldier1(ReelRoutine &routine);
void receptionist(ReelRoutine &routine);
void bartender(ReelRoutine &routine);
void heavy(ReelRoutine &routine);
void helicopter(ReelRoutine &routine);
void mugger(ReelRoutine &routine);
void businessMan(ReelRoutine &routine);
void endGameSeq(ReelRoutine &routine);
void poolGuard(ReelRoutine &routine);
// from print.cpp
uint8 getNextWord(const GraphicsFile &charSet, const uint8 *string, uint8 *totalWidth, uint8 *charCount);
void printChar(const GraphicsFile &charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height);
void printChar(const GraphicsFile &charSet, uint16 x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height);
void printBoth(const GraphicsFile &charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar);
uint8 printDirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered);
uint8 printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered);
uint8 getNumber(const GraphicsFile &charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16 *offset);
uint8 kernChars(uint8 firstChar, uint8 secondChar, uint8 width);
uint8 printSlow(const uint8 *string, uint16 x, uint16 y, uint8 maxWidth, bool centered);
uint16 waitFrames();
void printCurs();
void delCurs();
void rollEndCreditsGameWon();
void rollEndCreditsGameLost();
// from saveload.cpp
void loadGame();
void doLoad(int slot);
void saveGame();
void namesToOld();
void oldToNames();
void saveLoad();
void doSaveLoad();
void showMainOps();
void showDiscOps();
void discOps();
void actualSave();
void actualLoad();
void loadPosition(unsigned int slot);
void savePosition(unsigned int slot, const char *descbuf);
uint scanForNames();
void loadOld();
void showDecisions();
void loadSaveBox();
void showNames();
void checkInput();
void selectSlot();
void showSlots();
void showOpBox();
void showSaveOps();
void showLoadOps();
// from sound.cpp
bool loadSpeech(byte type1, int idx1, byte type2, int idx2);
void volumeAdjust();
void cancelCh0();
void cancelCh1();
void loadRoomsSample();
void playChannel0(uint8 index, uint8 repeat);
void playChannel1(uint8 index);
// from sprite.cpp
void printSprites();
void printASprite(const Sprite *sprite);
void clearSprites();
Sprite *makeSprite(uint8 x, uint8 y, bool _mainManCallback, const GraphicsFile *frameData);
void initMan();
void walking(Sprite *sprite);
void aboutTurn(Sprite *sprite);
void backObject(Sprite *sprite);
void constant(Sprite *sprite, SetObject *objData);
void randomSprite(Sprite *sprite, SetObject *objData);
void doorway(Sprite *sprite, SetObject *objData);
void wideDoor(Sprite *sprite, SetObject *objData);
void doDoor(Sprite *sprite, SetObject *objData, Common::Rect check);
void steady(Sprite *sprite, SetObject *objData);
void lockedDoorway(Sprite *sprite, SetObject *objData);
void liftSprite(Sprite *sprite, SetObject *objData);
Reel *getReelStart(uint16 reelPointer);
const GraphicsFile *findSource(uint16 &frame);
void showReelFrame(Reel *reel);
void showGameReel(ReelRoutine *routine);
const Frame *getReelFrameAX(uint16 frame);
void moveMap(uint8 param);
void checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY);
uint8 getBlockOfPixel(uint8 x, uint8 y);
void splitIntoLines(uint8 x, uint8 y);
void initRain();
void intro1Text();
void intro2Text(uint16 nextReelPointer);
void intro3Text(uint16 nextReelPointer);
void monks2text();
void textForEnd();
void textForMonkHelper(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount);
void textForMonk();
void priestText(ReelRoutine &routine);
void soundOnReels(uint16 reelPointer);
void clearBeforeLoad();
void clearReels();
void getRidOfReels();
void liftNoise(uint8 index);
void checkForExit(Sprite *sprite);
void mainMan(Sprite *sprite);
void spriteUpdate();
void showRain();
void reconstruct();
void reelsOnScreen();
// from stubs.cpp
void setupInitialVars();
bool isCD();
void crosshair();
void delTextLine();
void showBlink();
void dumpBlink();
void dumpPointer();
void showPointer();
void delPointer();
void showRyanPage();
void switchRyanOn();
void switchRyanOff();
void middlePanel();
void showDiary();
void readMouse();
uint16 readMouseState();
void hangOn(uint16 frameCount);
void lockMon();
uint8 *textUnder();
void readKey();
void findOrMake(uint8 index, uint8 value, uint8 type);
DynObject *getFreeAd(uint8 index);
DynObject *getExAd(uint8 index);
DynObject *getEitherAdCPP();
void *getAnyAdDir(uint8 index, uint8 flag);
void showWatch();
void showTime();
void showExit();
void showMan();
void panelIcons1();
SetObject *getSetAd(uint8 index);
void *getAnyAd(uint8 *slotSize, uint8 *slotCount);
const uint8 *getTextInFile1(uint16 index);
uint8 findNextColon(const uint8 **string);
void allocateBuffers();
void loadTextFile(TextFile &file, const char *fileName);
void loadGraphicsFile(GraphicsFile &file, const char *fileName);
void loadGraphicsSegment(GraphicsFile &file, unsigned int len);
void loadTextSegment(TextFile &file, unsigned int len);
void loadIntoTemp(const char *fileName);
void loadIntoTemp2(const char *fileName);
void loadIntoTemp3(const char *fileName);
void loadTempCharset(const char *fileName);
void loadTravelText();
void loadTempText(const char *fileName);
void clearAndLoad(uint8 *buf, uint8 c, unsigned int size, unsigned int maxSize);
void sortOutMap();
void loadRoomData(const Room &room, bool skipDat);
void useTempCharset();
void useCharset1();
void printMessage(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered);
void printMessage2(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered, uint8 count);
bool isItDescribed(const ObjPos *objPos);
void zoomIcon();
void roomName();
void showIcon();
void eraseOldObs();
void commandOnly(uint8 command);
void blank();
void setTopLeft();
void setTopRight();
void setBotLeft();
void setBotRight();
void examIcon();
void animPointer();
void getFlagUnderP(uint8 *flag, uint8 *flagEx);
void workToScreenM();
void quitKey();
void restoreReels();
void loadFolder();
void folderHints();
void folderExit();
void showFolder();
void showLeftPage();
void showRightPage();
void underTextLine();
void hangOnP(uint16 count);
void getUnderZoom();
void putUnderZoom();
void examineInventory();
void openInv();
void getBack1();
void getBackFromOb();
void getBackFromOps();
void getBackToOps();
void DOSReturn();
bool isItWorn(const DynObject *object);
bool compare(uint8 index, uint8 flag, const char id[4]);
void hangOnW(uint16 frameCount);
void getRidOfTemp();
void getRidOfTempText();
void getRidOfTemp2();
void getRidOfTemp3();
void getRidOfTempCharset();
void getRidOfAll();
void placeSetObject(uint8 index);
void removeSetObject(uint8 index);
bool isSetObOnMap(uint8 index);
void dumpZoom();
void diaryKeyP();
void diaryKeyN();
void findRoomInLoc();
void loadMenu();
void showMenu();
void dumpMenu();
void dealWithSpecial(uint8 firstParam, uint8 secondParam);
void plotReel(uint16 &reelPointer);
void setupTimedTemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount);
void getUnderTimed();
void putUnderTimed();
void dumpTextLine();
void useTimedText();
void dumpTimedText();
void getTime();
void doChange(uint8 index, uint8 value, uint8 type);
bool isRyanHolding(const char *id);
void clearBuffers();
void clearChanges();
void drawFloor();
uint16 findSetObject(const char *id);
void hangOnCurs(uint16 frameCount);
const uint8 *findObName(uint8 type, uint8 index);
void copyName(uint8 type, uint8 index, uint8 *dst);
uint16 findExObject(const char *id);
void makeMainScreen();
void showWatchReel();
void watchReel();
void commandWithOb(uint8 command, uint8 type, uint8 index);
void examineObText();
void blockNameText();
void personNameText();
void walkToText();
void entryTexts();
void setAllChanges();
void restoreAll();
void redrawMainScrn();
template <class T>
void checkCoords(const RectWithCallback<T> *rectWithCallbacks) {
if (_newLocation != 0xff)
return;
const RectWithCallback<T> *r;
for (r = rectWithCallbacks; r->_xMin != 0xffff; ++r) {
if (r->contains(_mouseX, _mouseY)) {
(((T *)this)->*(r->_callback))();
return;
}
}
}
void newGame();
void deleteTaken();
void autoAppear();
void loadRoom();
void startLoading(const Room &room);
void startup();
void atmospheres();
bool objectMatches(void *object, const char *id);
void checkFolderCoords();
void nextFolder();
void lastFolder();
void lookAtCard();
void obsThatDoThings();
void describeOb();
void putBackObStuff();
void reExFromOpen();
void showDiaryPage();
void showDiaryKeys();
void dumpDiaryKeys();
void useMenu();
void incRyanPage();
void edensFlatReminders();
void dropError();
void cantDrop();
void entryAnims();
bool finishedWalking();
void emergencyPurge();
void purgeAnItem();
uint8 nextSymbol(uint8 symbol);
void enterSymbol();
void showSymbol();
void updateSymbolTop();
void updateSymbolBot();
void pickupOb(uint8 command, uint8 pos);
void errorMessage1();
void errorMessage2();
void errorMessage3();
void decide();
void allPointer();
void dumpWatch();
void watchCount();
void signOn();
void searchForFiles(const char *filesString);
void triggerMessage(uint16 index);
void processTrigger();
void dreamweb();
void screenUpdate();
void startup1();
void quickQuit();
void readOneBlock();
void seeCommandTail();
void quickQuit2();
bool checkIfPerson(uint8 x, uint8 y);
bool checkIfFree(uint8 x, uint8 y);
bool checkIfEx(uint8 x, uint8 y);
void walkAndExamine();
void obName(uint8 command, uint8 commandType);
bool checkIfSet(uint8 x, uint8 y);
void readSetData();
void look();
void autoLook();
void doLook();
void mainScreen();
void zoomOnOff();
void initialInv();
void walkIntoRoom();
void afterNewRoom();
void madmanRun();
void showGun();
// from talk.cpp
void talk();
void convIcons();
uint16 getPersFrame(uint8 index);
const uint8 *getPersonText(uint8 index, uint8 talkPos);
void startTalk();
void moreTalk();
void doSomeTalk();
bool hangOnPQ();
void redes();
// from titles.cpp
void endGame();
void monkSpeaking();
void gettingShot();
void bibleQuote();
void hangOne(uint16 delay);
void intro();
void runIntroSeq();
void runEndSeq();
void loadIntroRoom();
void set16ColPalette();
void realCredits();
uint8 getExPos();
// from use.cpp
void useRoutine();
void useObject();
void placeFreeObject(uint8 index);
void removeFreeObject(uint8 index);
void setupTimedUse(uint16 offset, uint16 countToTimed, uint16 timeCount, byte x, byte y);
void withWhat();
uint16 checkInside(uint16 command, uint16 type);
void showPuzText(uint16 command, uint16 count);
void useText(const uint8 *string);
void showFirstUse();
void showSecondUse();
void viewFolder();
void edensCDPlayer();
void hotelBell();
void playGuitar();
void useElevator1();
void useElevator2();
void useElevator3();
void useElevator4();
void useElevator5();
void useHatch();
void wheelSound();
void callHotelLift();
void useShield();
void useCoveredBox();
void useRailing();
void useChurchHole();
void sitDownInBar();
void useBalcony();
void useWindow();
void trapDoor();
void useDryer();
void callEdensDLift();
void callEdensLift();
void openYourNeighbour();
void openRyan();
void openPoolBoss();
void openEden();
void openSarters();
void openLouis();
void useWall();
void useChurchGate();
void useLadder();
void useLadderB();
bool defaultUseHandler(const char *id);
void slabDoorA();
void slabDoorB();
void slabDoorC();
void slabDoorE();
void slabDoorD();
void slabDoorF();
void useGun();
void useFullCart();
void useClearBox();
void openTVDoor();
void usePlate();
void usePlinth();
void useElvDoor();
void useWinch();
void useCart();
void useHole();
void openHotelDoor();
void openHotelDoor2();
void grafittiDoor();
void useCardReader1();
void useCardReader2();
void useCardReader3();
void usePoolReader();
void useLighter();
void useWire();
void openTomb();
void hotelControl();
void useCooker();
void useDiary();
void useControl();
void useSlab();
void usePipe();
void useOpenBox();
void runTap();
void useAxe();
void useHandle();
void useAltar();
void notHeldError();
void useCashCard();
void useButtonA();
void wearWatch();
void wearShades();
void useTrainer();
void useStereo();
void chewy();
void delEverything();
void afterIntroRoom();
// from vgafades.cpp
void clearStartPal();
void clearEndPal();
void palToStartPal();
void endPalToStart();
void startPalToEnd();
void palToEndPal();
void fadeDOS();
void doFade();
void fadeCalculation();
void fadeUpYellows();
void fadeUpMonFirst();
void fadeUpMon();
void fadeDownMon();
void initialMonCols();
void fadeScreenUp();
void fadeScreenUps();
void fadeScreenUpHalf();
void fadeScreenDown();
void fadeScreenDowns();
void fadeScreenDownHalf();
void clearPalette();
void greyscaleSum();
void allPalette();
void dumpCurrent();
// from vgagrafx.cpp
inline uint8 *workspace() { return _workspace; }
void clearWork();
void panelToMap();
void mapToPanel();
void dumpMap();
void transferFrame(uint8 from, uint8 to, uint8 offset);
void zoom();
void multiGet(uint8 *dst, uint16 x, uint16 y, uint8 width, uint8 height);
void multiPut(const uint8 *src, uint16 x, uint16 y, uint8 width, uint8 height);
void multiDump(uint16 x, uint16 y, uint8 width, uint8 height);
void workToScreen();
void printUnderMon();
void frameOutV(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, int16 x, int16 y);
void frameOutNm(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y);
void frameOutBh(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y);
void frameOutFx(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y);
void doShake();
void vSync();
void setMode();
void showPCX(const Common::String &name);
void showFrameInternal(const uint8 *pSrc, uint16 x, uint16 y, uint8 effectsFlag, uint8 width, uint8 height);
void showFrame(const GraphicsFile &frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height);
void showFrame(const GraphicsFile &frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag);
bool pixelCheckSet(const ObjPos *pos, uint8 x, uint8 y);
void loadPalFromIFF();
void createPanel();
void createPanel2();
void showPanel();
};
} // End of namespace DreamWeb
#endif
|