25 #include "engines/engine.h" 27 #include "common/endian.h" 28 #include "common/events.h" 29 #include "common/file.h" 30 #include "common/savefile.h" 31 #include "common/keyboard.h" 32 #include "common/mutex.h" 33 #include "common/random.h" 34 #include "common/rect.h" 35 #include "common/rendermode.h" 36 #include "common/str.h" 37 #include "common/textconsole.h" 38 #include "common/text-to-speech.h" 39 #include "graphics/surface.h" 40 #include "graphics/sjis.h" 41 #include "graphics/palette.h" 43 #include "scumm/file.h" 44 #include "scumm/gfx.h" 45 #include "scumm/detection.h" 46 #include "scumm/script.h" 47 #include "scumm/serializer.h" 58 #define DISABLE_TOWNS_DUAL_LAYER_MODE 66 class SeekableReadStream;
68 class SeekableWriteStream;
89 class BaseCostumeLoader;
90 class BaseCostumeRenderer;
92 class CharsetRenderer;
102 class GlyphRenderer_v7;
106 struct FindObjectInRoom;
109 extern ScummEngine *g_scumm;
114 NUM_SHADOW_PALETTE = 8
157 MBS_LEFT_CLICK = 0x8000,
158 MBS_RIGHT_CLICK = 0x4000,
159 MBS_MOUSE_MASK = (MBS_LEFT_CLICK | MBS_RIGHT_CLICK),
203 uint _objectRedrawCount;
204 uint _objectStripRedrawCount;
205 uint _actorRedrawCount;
206 uint _actorLimbRedrawDrawCount;
226 USERSTATE_SET_FREEZE = 0x01,
227 USERSTATE_SET_CURSOR = 0x02,
228 USERSTATE_SET_IFACE = 0x04,
229 USERSTATE_FREEZE_ON = 0x08,
230 USERSTATE_CURSOR_ON = 0x10,
231 USERSTATE_IFACE_SENTENCE = 0x20,
232 USERSTATE_IFACE_INVENTORY = 0x40,
233 USERSTATE_IFACE_VERBS = 0x80
236 #define USERSTATE_IFACE_ALL (USERSTATE_IFACE_SENTENCE | USERSTATE_IFACE_INVENTORY | USERSTATE_IFACE_VERBS) 270 typedef uint16 ResId;
314 #define PIT_BASE_FREQUENCY 1193182.0 // In Hz 315 #define PIT_V1_DIVISOR 65536.0 316 #define PIT_V2_4_DIVISOR 5041.0 317 #define PIT_V5_6_ORCHESTRATOR_DIVISOR 4096.0 318 #define PIT_V5_6_SUBTIMER_INC 3433.0 319 #define PIT_V5_SUBTIMER_THRESH 4167.0 320 #define PIT_V6_SAMNMAX_SUBTIMER_THRESH 4167.0 321 #define PIT_V6_DOTT_SUBTIMER_THRESH 4237.0 322 #define PIT_V7_ORCHESTRATOR_DIVISOR 3977.0 323 #define PIT_V7_SUBTIMER_INC 3977.0 324 #define PIT_V7_SUBTIMER_THRESH 4971.0 326 #define PIT_HE_PUTT_PUTT_DIVISOR 9362.0 327 #define PIT_HE_FATTY_BEAR_DIVISOR 21845.0 329 #define LOOM_STEAM_CDDA_RATE 240.0 344 #define AMIGA_NTSC_VBLANK_RATE 240.0 345 #define AMIGA_PAL_VBLANK_RATE 200.0 351 #define GAME_PROPER_SAVE 201 352 #define GAME_FAILED_SAVE 202 353 #define GAME_PROPER_LOAD 203 354 #define GAME_FAILED_LOAD 204 360 #define GUI_PAGE_MAIN 0 361 #define GUI_PAGE_SAVE 1 362 #define GUI_PAGE_LOAD 2 363 #define GUI_PAGE_RESTART 3 // Sega CD 364 #define GUI_PAGE_CODE_CONFIRM 4 // Sega CD 365 #define GUI_PAGE_INVALID_CODE 5 // Sega CD 367 #define GUI_CTRL_FIRST_SG 1 368 #define GUI_CTRL_LAST_SG 9 369 #define GUI_CTRL_SAVE_BUTTON 10 370 #define GUI_CTRL_LOAD_BUTTON 11 371 #define GUI_CTRL_PLAY_BUTTON 12 372 #define GUI_CTRL_QUIT_BUTTON 13 373 #define GUI_CTRL_OK_BUTTON 14 374 #define GUI_CTRL_CANCEL_BUTTON 15 375 #define GUI_CTRL_ARROW_UP_BUTTON 16 376 #define GUI_CTRL_ARROW_DOWN_BUTTON 17 377 #define GUI_CTRL_PATH_BUTTON 18 378 #define GUI_CTRL_MUSIC_SLIDER 19 379 #define GUI_CTRL_SPEECH_SLIDER 20 380 #define GUI_CTRL_SFX_SLIDER 21 381 #define GUI_CTRL_TEXT_SPEED_SLIDER 22 382 #define GUI_CTRL_DISPLAY_TEXT_CHECKBOX 23 383 #define GUI_CTRL_SPOOLED_MUSIC_CHECKBOX 24 384 #define GUI_CTRL_OUTER_BOX 26 385 #define GUI_CTRL_INNER_BOX 27 388 #define GUI_CTRL_NUMPAD_1 1 389 #define GUI_CTRL_NUMPAD_2 2 390 #define GUI_CTRL_NUMPAD_3 3 391 #define GUI_CTRL_NUMPAD_4 4 392 #define GUI_CTRL_NUMPAD_5 5 393 #define GUI_CTRL_NUMPAD_6 6 394 #define GUI_CTRL_NUMPAD_7 7 395 #define GUI_CTRL_NUMPAD_8 8 396 #define GUI_CTRL_NUMPAD_9 9 397 #define GUI_CTRL_NUMPAD_0 10 398 #define GUI_CTRL_RESTART_BUTTON 13 399 #define GUI_CTRL_ARROW_LEFT_BUTTON 16 400 #define GUI_CTRL_ARROW_RIGHT_BUTTON 17 401 #define GUI_CTRL_NUMPAD_BACK 23 406 gsTextSpeedSlider = 2,
417 gsGameNotLoaded = 13,
421 gsSelectLoadPrompt = 17,
422 gsReplacePrompt = 18,
427 gsTextDisplayOnly = 24,
430 gsMusicVolumeSlider = 27,
431 gsVoiceVolumeSlider = 28,
432 gsSfxVolumeSlider = 29,
443 gsInsertSaveDisk = 40,
446 gsRecalJoystick = 43,
459 gsCurrentPasscode = 56,
460 gsEnterPasscode = 57,
461 gsConfirmPasscode = 58,
462 gsInvalidPasscode = 59,
479 int highlightedTextColor;
480 int highlightedFillColor;
486 bool doubleLinesFlag;
491 kScummActionInsaneDownLeft,
492 kScummActionInsaneDown,
493 kScummActionInsaneDownRight,
494 kScummActionInsaneLeft,
495 kScummActionInsaneRight,
496 kScummActionInsaneUpLeft,
497 kScummActionInsaneUp,
498 kScummActionInsaneUpRight,
499 kScummActionInsaneAttack,
500 kScummActionInsaneSwitch,
501 kScummActionInsaneCheat,
502 kScummActionInsaneBack,
503 kScummActionInsaneSkip,
508 enum ScummBackendAction {
509 kScummBackendActionRebel1AxisUp = 11000,
510 kScummBackendActionRebel1AxisDown,
511 kScummBackendActionRebel1AxisLeft,
512 kScummBackendActionRebel1AxisRight,
513 kScummBackendActionRebel2AxisUp,
514 kScummBackendActionRebel2AxisDown,
515 kScummBackendActionRebel2AxisLeft,
516 kScummBackendActionRebel2AxisRight
519 extern const char *
const insaneKeymapId;
528 friend class CharsetRendererTownsClassic;
535 friend class LogicHEBasketball;
542 IMuse *_imuse =
nullptr;
543 IMuseDigital *_imuseDigital =
nullptr;
546 Sound *_sound =
nullptr;
563 int _insideCreateResource = 0;
565 bool _useOriginalGUI =
true;
566 bool _enableAudioOverride =
false;
567 bool _enableCOMISong =
false;
568 bool _isAmigaPALSystem =
false;
569 bool _quitFromScriptCmd =
false;
570 bool _isHE995 =
false;
571 bool _enableHECompetitiveOnlineMods =
false;
578 bool _needsSoundUnpause =
false;
596 void errorString(
const char *buf_input,
char *buf_output,
int buf_output_size)
override;
598 bool gameSupportsQuitDialogOverride()
const;
599 void syncSoundSettings()
override;
607 void pauseEngineIntern(
bool pause)
override;
610 virtual void setupScumm(
const Common::Path &macResourceFile);
611 virtual void resetScumm();
613 virtual void setupScummVars();
614 virtual void resetScummVars();
615 void setVideoModeVarToCurrentConfig();
616 void setSoundCardVarToCurrentConfig();
618 void setupCharsetRenderer(
const Common::Path &macFontFile);
619 void setupCostumeRenderer();
621 virtual void loadLanguageBundle();
624 void setupMusic(
int midi);
625 void setTalkSpeed(
int talkspeed);
629 virtual void scummLoop(
int delta);
630 virtual void scummLoop_updateScummVars();
631 virtual void scummLoop_handleSaveLoad();
632 virtual void scummLoop_handleDrawing();
633 virtual void scummLoop_handleActors() = 0;
634 virtual void scummLoop_handleEffects();
635 virtual void scummLoop_handleSound();
637 virtual void runBootscript();
639 virtual void terminateSaveMenuScript() {};
643 void beginTextInput();
650 void waitForTimer(
int quarterFrames,
bool freezeMacGui =
false);
651 uint32 _lastWaitTime;
653 void setTimerAndShakeFrequency();
660 uint32 getIntegralTime(
double fMsecs);
661 double _msecFractParts = 0.0;
663 virtual void processInput();
665 virtual void clearClickedStatus();
668 virtual void updateCursor();
669 virtual void animateCursor() {}
670 virtual void updatePalette();
671 virtual void setDefaultCursor() {};
672 virtual void setCursorTransparency(
int a) {};
673 virtual void resetCursors() {}
674 virtual void setCursorHotspot(
int x,
int y) {}
675 virtual void setCursorFromBuffer(
const byte *ptr,
int width,
int height,
int pitch,
bool preventScale =
false) {}
680 bool isUsingOriginalGUI()
const;
681 bool isMessageBannerActive();
683 bool _isIndy4Jap =
false;
686 Dialog *_pauseDialog =
nullptr;
687 Dialog *_messageDialog =
nullptr;
688 Dialog *_versionDialog =
nullptr;
690 void confirmExitDialog();
691 void confirmRestartDialog();
694 void versionDialog();
697 int32 _bannerColors[50];
698 byte *_bannerMem =
nullptr;
699 uint32 _bannerMemSize = 0;
700 int _bannerSaveYStart = 0;
702 bool _messageBannerActive =
false;
703 bool _comiQuitMenuIsOpen =
false;
704 bool _closeBannerAndQueryQuitFlag =
false;
707 byte *_textSurfBannerMem =
nullptr;
708 uint32 _textSurfBannerMemSize = 0;
713 const char _emptyMsg[1] = {
'\0'};
714 const char _uncheckedBox[2] = {
' ',
'\0'};
715 const char _checkedBox[2] = {
'x',
'\0'};
716 const char _arrowUp[2] = {
'\x18',
'\0'};
717 const char _arrowDown[2] = {
'\x19',
'\0'};
718 const char _arrowLeft[2] = {
'\x3c',
'\0'};
719 const char _arrowRight[2] = {
'\x3d',
'\0'};
723 int _mainMenuSavegameLabel = 1;
724 int _curDisplayedSaveSlotPage = 0;
725 int _firstSaveStateOfList = 0;
726 bool _mainMenuIsActive =
false;
727 bool _quitByGUIPrompt =
false;
728 char _mainMenuMusicSlider[17];
729 char _mainMenuSpeechSlider[17];
730 char _mainMenuSfxSlider[17];
731 char _mainMenuTextSpeedSlider[17];
732 char _mainMenuSegaCDPasscode[5];
733 int _spooledMusicIsToBeEnabled = 1;
734 int _saveScriptParam = 0;
735 int _guiCursorAnimCounter = 0;
736 int _v5VoiceMode = 0;
739 int _internalSpeakerSoundsAreOn = 1;
740 int _guiMouseFlag = 1;
741 int _guiJoystickFlag = 1;
743 bool _mixerMutedByGUI =
false;
746 byte *_tempTextSurface =
nullptr;
747 byte *_tempMainSurface =
nullptr;
748 byte *_tempVerbSurface =
nullptr;
749 bool _postGUICharMask =
false;
752 byte *_curGrabbedCursor =
nullptr;
753 int8 _oldCursorState = 0;
754 int _curCursorState = 0;
755 int _curCursorWidth = 0;
756 int _curCursorHeight = 0;
757 int _curCursorHotspotX = 0;
758 int _curCursorHotspotY = 0;
760 virtual void setSnailCursor() {}
763 Common::KeyState showBannerAndPause(
int bannerId, int32 waitTime,
const char *msg, ...);
764 bool showBannerAndPauseForTextInput(
int bannerId,
const char *prompt,
Common::String &input, uint maxLength = 255);
765 Common::KeyState showOldStyleBannerAndPause(
const char *msg,
int color, int32 waitTime);
766 Common::KeyState printMessageAndPause(
const char *msg,
int color, int32 waitTime,
bool drawOnSentenceLine);
769 void setBannerColors(
int bannerId, byte r, byte g, byte b);
770 virtual int getBannerColor(
int bannerId);
771 void setUpInternalGUIControl(
int id,
int normalFillColor,
int normalTextColor,
772 int topLineColor,
int bottomLineColor,
int leftLineColor,
int rightLineColor,
773 int highlightedTextColor,
int highlightedFillColor,
774 int anchorPointX,
int anchorPointY,
int x,
int y,
const char *label,
bool centerFlag,
bool unknownFlag);
775 void drawInternalGUIControl(
int id,
bool highlightColor);
776 int getInternalGUIControlFromCoordinates(
int x,
int y);
777 virtual bool isSmushActive() {
return false; }
778 virtual bool isInsaneActive() {
return false; }
780 virtual void queryQuit(
bool returnToLauncher);
781 virtual void queryRestart();
782 virtual const char *getGUIString(
int stringId);
783 void waitForBannerInput(int32 waitTime,
Common::KeyState &ks,
bool &leftBtnClicked,
bool &rightBtnClicked,
bool handleMouseWheel =
false);
784 virtual int getGUIStringHeight(
const char *str);
785 virtual int getGUIStringWidth(
const char *str);
786 virtual void drawGUIText(
const char *buttonString,
Common::Rect *clipRect,
int textXPos,
int textYPos,
int textColor,
bool centerFlag);
787 void getSliderString(
int stringId,
int value,
char *sliderString,
int size);
788 virtual int getMusicVolume();
789 virtual int getSpeechVolume();
790 virtual int getSFXVolume();
791 virtual void setMusicVolume(
int volume);
792 virtual void setSpeechVolume(
int volume);
793 virtual void setSFXVolume(
int volume);
794 virtual void toggleVoiceMode();
795 virtual void handleLoadDuringSmush() {}
796 virtual void setSkipVideo(
int value) {}
799 virtual void setUpMainMenuControls();
800 void setUpMainMenuControlsSegaCD();
801 void setUpMainMenuControlsIndy4Jap();
802 void drawMainMenuControls();
803 void drawMainMenuControlsSegaCD();
804 void updateMainMenuControls();
805 void updateMainMenuControlsSegaCD();
806 void drawMainMenuTitle(
const char *title);
807 bool executeMainMenuOperation(
int op,
int mouseX,
int mouseY,
bool &hasLoadedState);
808 bool executeMainMenuOperationSegaCD(
int op,
int mouseX,
int mouseY,
bool &hasLoadedState);
809 bool shouldHighlightLabelAndWait(
int clickedControl);
810 void fillSavegameLabels();
811 bool canWriteGame(
int slotId);
812 bool userWriteLabelRoutine(
Common::KeyState &ks,
bool &leftMsClicked,
bool &rightMsClicked);
813 void saveCursorPreMenu();
814 void restoreCursorPostMenu();
815 void saveSurfacesPreGUI();
816 void restoreSurfacesPostGUI();
817 void showDraftsInventory();
818 void setUpDraftsInventory();
819 void drawDraftsInventory();
822 char displayMessage(MSVC_PRINTF
const char *message, ...)
GCC_PRINTF(2, 3);
823 bool displayMessageYesNo(MSVC_PRINTF
const char *message, ...)
GCC_PRINTF(2, 3);
824 bool displayMessageOKQuit(MSVC_PRINTF
const char *message, ...)
GCC_PRINTF(2, 3);
830 Actor **_actors =
nullptr;
831 Actor **_sortedActors =
nullptr;
833 byte *_arraySlot =
nullptr;
834 uint16 *_inventory =
nullptr;
835 uint16 *_newNames =
nullptr;
839 #define VAR(x) scummVar(x, #x, __FILE__, __LINE__) 840 int32& scummVar(byte var,
const char *varName,
const char *file,
int line) {
842 error(
"Illegal access to variable %s in file %s, line %d", varName, file, line);
844 return _scummVars[var];
846 int32 scummVar(byte var,
const char *varName,
const char *file,
int line)
const {
848 error(
"Illegal access to variable %s in file %s, line %d", varName, file, line);
850 return _scummVars[var];
853 bool applyMi2NiDemoOverride();
866 bool _loaded =
false;
867 bool _attempted =
false;
868 bool _active =
false;
870 bool _mi2DemoVarsApplied =
false;
874 uint32 _streamOff = 0;
875 uint32 _streamBytes = 0;
877 uint32 _nextIndex = 0;
880 bool _hasPrevMbs =
false;
882 uint32 _firstInteractIndex = 0;
883 bool _firstInteractValid =
false;
887 bool _pendingLUp =
false;
888 bool _pendingRUp =
false;
890 bool _sputmCmdActive =
false;
891 byte _sputmCmdEnterCount = 0;
901 void mi2DemoArmPlaybackByRoom(
ScummEngine *engine);
902 void mi2DemoPlaybackJumpRoom(
ScummEngine *engine,
int room);
903 bool handleMi2NIDemoSputmDebugKey(
ScummEngine *engine, uint16 rawKey);
910 int32 *_roomVars =
nullptr;
911 int32 *_scummVars =
nullptr;
912 byte *_bitVars =
nullptr;
915 int _numVariables = 0;
916 int _numBitVariables = 0;
917 int _numLocalObjects = 0;
918 int _numGlobalObjects = 0;
921 int _numFlObject = 0;
922 int _numInventory = 0;
923 int _numNewNames = 0;
924 int _numGlobalScripts = 0;
925 int _numRoomVariables = 0;
926 int _numPalettes = 0;
933 int _numLocalScripts = 60, _numImages = 0, _numRooms = 0, _numScripts = 0, _numSounds = 0;
934 int _numCostumes = 0;
935 int32 _numCharsets = 0;
940 int _NESCostumeSet = 0;
941 void NES_loadCostumeSet(
int n);
942 byte *_NEScostdesc =
nullptr, *_NEScostlens =
nullptr, *_NEScostoffs =
nullptr, *_NEScostdata =
nullptr;
943 byte _NESPatTable[2][4096];
944 byte _NESPalette[2][16];
945 byte _NESBaseTiles = 0;
947 int _NESStartStrip = 0;
950 int _curPalIndex = 0;
953 byte _currentRoom = 0;
954 int _roomResource = 0;
955 bool _egoPositioned =
false;
959 virtual Common::Path generateFilename(
const int room)
const;
963 bool _keyDownMap[512];
964 bool _actionMap[kScummActionCount];
969 uint16 _mouseAndKeyboardStat = 0;
970 byte _leftBtnPressed = 0, _rightBtnPressed = 0;
972 int _mouseWheelFlag = 0;
974 bool _setupIsComplete =
false;
980 uint32 _lastInputScriptTime = 0;
986 bool _dumpScripts =
false;
987 bool _hexdumpScripts =
false;
988 bool _showStack =
false;
989 bool _debugMode =
false;
992 byte _saveLoadFlag = 0, _saveLoadSlot = 0;
993 uint32 _lastSaveTime = 0;
994 bool _saveTemporaryState =
false;
995 bool _pauseSoundsDuringSave =
true;
996 bool _loadFromLauncher =
false;
997 bool _videoModeChanged =
false;
1003 bool loadState(
int slot,
bool compat);
1010 virtual int checkSoundEngineSaveDataSize(
Serializer &s);
1012 void copyHeapSaveGameToFile(
int slot,
const char *saveName);
1013 bool changeSavegameName(
int slot,
char *newName);
1017 Common::String makeSavegameName(
int slot,
bool temporary)
const {
1018 return makeSavegameName(_targetName, slot, temporary);
1021 int getKeyState(
int key);
1022 int getActionState(ScummAction action);
1028 void listSavegames(
bool *marks,
int num);
1031 void requestLoad(
int slot);
1034 bool canPauseSoundsDuringSave()
const {
return _pauseSoundsDuringSave; }
1045 uint32 _localScriptOffsets[1024];
1047 const byte *_scriptPointer =
nullptr;
1048 const byte *_scriptOrgPointer =
nullptr;
1049 const byte *
const *_lastCodePtr =
nullptr;
1051 bool _debug =
false;
1052 byte _currentScript = 0xFF;
1053 int _scummStackPos = 0;
1056 char _engineVersionString[50];
1057 char _dataFileVersionString[50];
1066 return _currentScript != 0xFF && vm.slot[_currentScript].number == script;
1069 virtual void setupOpcodes() = 0;
1070 void executeOpcode(byte i);
1071 const char *getOpcodeDesc(byte i);
1073 void initializeLocals(
int slot,
int *vars);
1074 int getScriptSlot();
1076 void startScene(
int room,
Actor *a,
int b);
1080 void runScript(
int script,
bool freezeResistant,
bool recursive,
int *lvarptr,
int cycle = 0);
1081 void stopScript(
int script);
1082 void nukeArrays(byte scriptSlot);
1085 void runObjectScript(
int script,
int entry,
bool freezeResistant,
bool recursive,
int *vars,
int slot = -1,
int cycle = 0);
1086 void runScriptNested(
int script);
1087 void executeScript();
1088 void updateScriptPtr();
1089 virtual void runInventoryScript(
int i);
1090 virtual void runInventoryScriptEx(
int i);
1091 virtual void checkAndRunSentenceScript();
1092 bool monkey1HermanNoteWorkaround(
const SentenceTab &st);
1093 void runExitScript();
1094 void runEntryScript();
1095 void runQuitScript();
1096 void runAllScripts();
1097 void freezeScripts(
int scr);
1098 void unfreezeScripts();
1100 bool isScriptInUse(
int script)
const;
1101 bool isRoomScriptRunning(
int script)
const;
1102 bool isScriptRunning(
int script)
const;
1104 void killAllScriptsExceptCurrent();
1105 void killScriptsAndResources();
1106 void decreaseScriptDelay(
int amount);
1108 void stopObjectCode();
1109 void stopObjectScript(
int script);
1111 void getScriptBaseAddress();
1112 void resetScriptPointer();
1113 int getVerbEntrypoint(
int obj,
int entry);
1115 void refreshScriptPointer();
1116 byte fetchScriptByte();
1117 virtual uint fetchScriptWord();
1118 virtual int fetchScriptWordSigned();
1119 uint fetchScriptDWord();
1120 int fetchScriptDWordSigned();
1121 void ignoreScriptWord() { fetchScriptWord(); }
1122 void ignoreScriptByte() { fetchScriptByte(); }
1125 virtual int readVar(uint var);
1126 virtual void writeVar(uint var,
int value);
1128 virtual void resetSentence() {}
1131 virtual void beginCutscene(
int *args);
1132 virtual void endCutscene();
1133 void abortCutscene();
1134 void beginOverride();
1137 void copyScriptString(byte *dst);
1138 int resStrLen(
const byte *src);
1139 void doSentence(
int c,
int b,
int a);
1143 uint32 _fileOffset = 0;
1150 ScummFile *instantiateScummFile(
bool indexPAKFiles =
true);
1153 int _resourceHeaderSize = 8;
1154 byte _resourceMapper[128];
1155 const byte *_resourceLastSearchBuf;
1156 uint32 _resourceLastSearchSize;
1158 virtual void allocateArrays();
1159 void openRoom(
int room);
1161 void deleteRoomOffsets();
1162 virtual void readRoomsOffsets();
1163 void askForDisk(
const Common::Path &filename,
int disknum);
1164 byte getEncByte(
int room);
1165 bool openResourceFile(
const Common::Path &filename, byte encByte);
1167 void loadPtrToResource(
ResType type, ResId idx,
const byte *ptr);
1168 virtual int readResTypeList(
ResType type);
1171 int loadResource(
ResType type, ResId idx);
1173 int getResourceRoomNr(
ResType type, ResId idx);
1174 virtual uint32 getResourceRoomOffset(
ResType type, ResId idx);
1176 void scriptOverride(ResId room,
int script);
1179 int getResourceSize(
ResType type, ResId idx);
1180 byte *getResourceAddress(
ResType type, ResId idx);
1181 virtual byte *getStringAddress(ResId idx);
1182 byte *getStringAddressVar(
int i);
1183 void ensureResourceLoaded(
ResType type, ResId idx);
1190 int readSoundResource(ResId idx);
1191 int readSoundResourceSmallHeader(ResId idx);
1192 bool isResourceInUse(
ResType type, ResId idx)
const;
1194 virtual void setupRoomSubBlocks();
1195 virtual void resetRoomSubBlocks();
1197 virtual void clearRoomObjects();
1198 virtual void resetRoomObjects();
1199 virtual void resetRoomObject(
ObjectData *od,
const byte *room,
const byte *searchptr = NULL);
1201 virtual void readArrayFromIndexFile();
1202 virtual void readMAXS(
int blockSize) = 0;
1203 virtual void readGlobalObjects();
1204 virtual void readIndexFile();
1205 virtual void readIndexBlock(uint32 block, uint32 itemsize);
1206 virtual void loadCharset(
int i);
1207 void nukeCharset(
int i);
1209 int _lastLoadedRoom = 0;
1211 const byte *findResourceData(uint32 tag,
const byte *ptr);
1212 const byte *findResource(uint32 tag,
const byte *ptr);
1213 void applyWorkaroundIfNeeded(
ResType type,
int idx);
1214 bool verifyMI2MacBootScript();
1215 bool verifyMI2MacBootScript(byte *buf,
int size);
1216 bool tryPatchMI1CannibalScript(byte *buf,
int size);
1218 int getResourceDataSize(
const byte *ptr)
const;
1219 void dumpResource(
const char *tag,
int index,
const byte *ptr,
int length = -1);
1223 byte OF_OWNER_ROOM = 0;
1224 int getInventorySlot();
1225 int findInventory(
int owner,
int index);
1226 int getInventoryCount(
int owner);
1229 byte *_objectOwnerTable =
nullptr, *_objectRoomTable =
nullptr, *_objectStateTable =
nullptr;
1230 int _numObjectsInRoom = 0;
1233 uint32 *_classData =
nullptr;
1236 void markObjectRectAsDirty(
int obj);
1237 virtual void loadFlObject(uint
object, uint room);
1238 void nukeFlObjects(
int min,
int max);
1239 int findFlObjectSlot();
1240 int findLocalObjectSlot();
1241 void addObjectToInventory(uint obj, uint room);
1242 void updateObjectStates();
1244 bool getClass(
int obj,
int cls)
const;
1246 void putClass(
int obj,
int cls,
bool set);
1247 int getState(
int obj);
1248 void putState(
int obj,
int state);
1249 void setObjectState(
int obj,
int state,
int x,
int y);
1250 int getOwner(
int obj)
const;
1251 void putOwner(
int obj,
int owner);
1252 void setOwnerOf(
int obj,
int owner);
1253 void clearOwnerOf(
int obj);
1254 int getObjectRoom(
int obj)
const;
1255 virtual bool objIsActor(
int obj);
1256 virtual int objToActor(
int obj);
1257 virtual int actorToObj(
int actor);
1258 int getObjX(
int obj);
1259 int getObjY(
int obj);
1260 void getObjectWidth(
int object,
int &width) {
int x, y, dir; getObjectXYPos(
object, x, y, dir, width); }
1261 void getObjectXYPos(
int object,
int &x,
int &y) {
int dir, width; getObjectXYPos(
object, x, y, dir, width); }
1262 void getObjectXYPos(
int object,
int &x,
int &y,
int &dir) {
int width; getObjectXYPos(
object, x, y, dir, width); }
1263 void getObjectXYPos(
int object,
int &x,
int &y,
int &dir,
int &width);
1264 int getObjOldDir(
int obj);
1265 int getObjNewDir(
int obj);
1266 int getObjectIndex(
int object)
const;
1267 int getObjectImageCount(
int object);
1268 int whereIsObject(
int object)
const;
1269 int findObject(
int x,
int y);
1270 void findObjectInRoom(
FindObjectInRoom *fo, byte findWhat, uint
object, uint room);
1272 int getObjectOrActorWidth(
int object,
int &width);
1273 int getObjectOrActorXY(
int object,
int &x,
int &y);
1274 int getDist(
int x,
int y,
int x2,
int y2);
1277 int getObjActToObjActDist(
int a,
int b);
1278 const byte *getObjOrActorName(
int obj);
1279 void setObjectName(
int obj);
1281 void addObjectToDrawQue(
int object);
1282 void removeObjectFromDrawQue(
int object);
1283 void clearDrawObjectQueue();
1284 void processDrawQue();
1286 virtual void clearDrawQueues();
1288 uint32 getOBCDOffs(
int object)
const;
1289 byte *getOBCDFromObject(
int obj,
bool v0CheckInventory =
true);
1290 const byte *getOBIMFromObjectData(
const ObjectData &od);
1291 const byte *getObjectImage(
const byte *ptr,
int state);
1292 virtual int getObjectIdFromOBIM(
const byte *obim);
1296 uint16 _verbMouseOver = 0;
1298 uint16 _userState = 0;
1300 virtual void handleMouseOver(
bool updateInventory);
1301 virtual void redrawVerbs();
1302 virtual void checkExecVerbs();
1304 void verbMouseOver(
int verb);
1305 int findVerbAtPos(
int x,
int y)
const;
1306 virtual void drawVerb(
int verb,
int mode, Common::TextToSpeechManager::Action ttsAction = Common::TextToSpeechManager::INTERRUPT);
1307 virtual void runInputScript(
int clickArea,
int val,
int mode);
1308 void restoreVerbBG(
int verb);
1309 void drawVerbBitmap(
int verb,
int x,
int y);
1310 int getVerbSlot(
int id,
int mode)
const;
1311 void killVerb(
int slot);
1312 void setVerbObject(uint room, uint
object, uint verb);
1315 bool isValidActor(
int id)
const;
1318 Actor *derefActor(
int id,
const char *errmsg = 0)
const;
1319 Actor *derefActorSafe(
int id,
const char *errmsg)
const;
1323 void playActorSounds();
1324 void redrawAllActors();
1325 virtual void setActorRedrawFlags();
1328 void resetV1ActorTalkColor();
1329 virtual void resetActorBgs();
1330 virtual void processActors();
1331 void processUpperActors();
1332 virtual int getActorFromPos(
int x,
int y);
1336 byte _actorToPrintStrFor = 0, _V1TalkingActor = 0;
1337 int _sentenceNum = 0;
1341 int16 _talkDelay = 0;
1342 int _NES_lastTalkingActor = 0;
1343 int _NES_talkColor = 0;
1345 virtual void actorTalk(
const byte *msg);
1347 int getTalkingActor();
1348 void setTalkingActor(
int variable);
1351 bool isCostumeInUse(
int i)
const;
1355 uint16 _screenB = 0, _screenH = 0;
1357 int _roomHeight = 0, _roomWidth = 0;
1358 int _screenHeight = 0, _screenWidth = 0;
1361 bool _cameraIsFrozen =
false;
1363 int _screenStartStrip = 0, _screenEndStrip = 0;
1365 bool _forceBannerVirtScreen =
false;
1376 bool _useMacScreenCorrectHeight =
true;
1377 int _macScreenDrawOffset = 20;
1380 uint8 _bytesPerPixel = 1;
1385 uint8 _colorUsedByCycle[256];
1388 uint32 _ENCD_offs = 0, _EXCD_offs = 0;
1389 uint32 _CLUT_offs = 0, _EPAL_offs = 0;
1390 uint32 _IM00_offs = 0, _PALS_offs = 0;
1393 bool _fullRedraw =
false, _bgNeedsRedraw =
false;
1394 bool _screenEffectFlag =
false, _completeScreenRedraw =
false;
1395 bool _disableFadeInEffect =
false;
1398 int hotspotX, hotspotY, width, height;
1399 byte animate, animateIndex;
1405 byte _grabbedCursor[16384];
1406 byte _macGrabbedCursor[16384 * 4];
1407 byte _currentCursor = 0;
1409 byte _newEffect = 0, _switchRoomEffect2 = 0, _switchRoomEffect = 0;
1410 bool _doEffect =
false;
1412 bool _snapScroll =
false;
1414 virtual void setBuiltinCursor(
int index) {}
1416 bool isLightOn()
const;
1418 virtual int getCurrentLights()
const;
1421 void initScreens(
int b,
int h);
1422 void initVirtScreen(
VirtScreenNumber slot,
int top,
int width,
int height,
bool twobufs,
bool scrollable);
1423 void initBGBuffers(
int height);
1424 void initCycl(
const byte *ptr);
1426 void decodeNESBaseTiles();
1427 void playNESTitleScreens();
1429 void drawObject(
int obj,
int scrollType);
1430 void drawRoomObjects(
int arg);
1431 void drawRoomObject(
int i,
int arg);
1432 void drawBox(
int x,
int y,
int x2,
int y2,
int color);
1433 void drawLine(
int x1,
int y1,
int x2,
int y2,
int color);
1434 void drawPixel(
VirtScreen *vs,
int x,
int y, int16 color,
bool useBackbuffer =
false);
1436 void moveScreen(
int dx,
int dy,
int height);
1438 void restoreBackground(
Common::Rect rect, byte backcolor = 0);
1439 void redrawBGStrip(
int start,
int num);
1440 virtual void redrawBGAreas();
1443 void setCameraAtEx(
int at);
1444 virtual void setCameraAt(
int pos_x,
int pos_y);
1445 virtual void setCameraFollows(
Actor *a,
bool setCamera =
false);
1446 virtual void moveCamera();
1447 virtual void panCameraTo(
int x,
int y);
1449 void actorFollowCamera(
int act);
1451 const byte *getPalettePtr(
int palindex,
int room);
1453 void setPaletteFromTable(
const byte *ptr,
int numcolor,
int firstIndex = 0);
1454 void resetPalette(
bool isBootUp =
false);
1456 void setCurrentPalette(
int pal);
1457 void setRoomPalette(
int pal,
int room);
1458 void setPCEPaletteFromPtr(
const byte *ptr);
1459 void setAmigaPaletteFromPtr(
const byte *ptr);
1460 virtual void setPaletteFromPtr(
const byte *ptr,
int numcolor = -1);
1461 void setV1ColorTable(
int renderMode);
1463 virtual void setPalColor(
int index,
int r,
int g,
int b);
1464 void setDirtyColors(
int min,
int max);
1465 const byte *findPalInPals(
const byte *pal,
int index);
1466 void swapPalColors(
int a,
int b);
1467 virtual void copyPalColor(
int dst,
int src);
1468 void cyclePalette();
1469 void stopCycle(
int i);
1470 virtual void palManipulateInit(
int resID,
int start,
int end,
int time);
1471 void palManipulate();
1472 uint32 findClosestPaletteColor(byte *palette,
int paletteLength, byte r, byte g, byte b);
1473 void applyGrayscaleToPaletteRange(
int min,
int max);
1474 bool haveToApplyMonkey1PaletteFix();
1477 uint8 *getHEPaletteSlot(uint16 palSlot);
1478 uint16 get16BitColor(uint8 r, uint8 g, uint8 b);
1479 uint32 getPaletteColorFromRGB(byte *palette, byte r, byte g, byte b);
1480 uint32 getPackedRGBColorFromPalette(byte *palette, uint32 color);
1481 void fetchBlackAndWhite(uint32 &black, uint32 &white, byte *palette,
int paletteEntries);
1482 int remapPaletteColor(
int r,
int g,
int b,
int threshold);
1483 void readPCEPalette(
const byte **ptr, byte **dest,
int numEntries);
1484 void colorPCEToRGB(uint16 color, byte *r, byte *g, byte *b);
1485 void setPCETextPalette(uint8 color);
1487 void moveMemInPalRes(
int start,
int end, byte direction);
1488 void setShadowPalette(
int slot,
int redScale,
int greenScale,
int blueScale,
int startColor,
int endColor);
1489 void setShadowPalette(
int redScale,
int greenScale,
int blueScale,
int startColor,
int endColor,
int start,
int end);
1490 virtual void darkenPalette(
int redScale,
int greenScale,
int blueScale,
int startColor,
int endColor);
1493 void markRectAsDirty(
VirtScreenNumber virt,
int left,
int right,
int top,
int bottom,
int dirtybit = 0);
1495 markRectAsDirty(virt, rect.
left, rect.
right, rect.top, rect.bottom, dirtybit);
1499 byte *_compositeBuf;
1500 byte *_hercCGAScaleBuf =
nullptr;
1501 bool _enableEGADithering =
false;
1502 bool _supportsEGADithering =
false;
1503 bool _enableSegaShadowMode =
false;
1505 virtual void drawDirtyScreenParts();
1507 void drawStripToScreen(
VirtScreen *vs,
int x,
int width,
int top,
int bottom);
1509 void mac_markScreenAsDirty(
int x,
int y,
int w,
int h);
1510 void mac_drawStripToScreen(
VirtScreen *vs,
int top,
int x,
int y,
int width,
int height);
1511 void mac_drawIndy3TextBox();
1512 void mac_undrawIndy3TextBox();
1513 void mac_undrawIndy3CreditsText();
1514 void mac_drawBufferToScreen(
const byte *buffer,
int pitch,
int x,
int y,
int width,
int height,
bool epxRectangleExpansion =
true);
1515 void mac_updateCompositeBuffer(
const byte *buffer,
int pitch,
int x,
int y,
int width,
int height);
1516 void mac_blitDoubleResImage(
const byte *buffer,
int pitch,
int x,
int y,
int width,
int height);
1517 void mac_applyDoubleResToBuffer(
const byte *inputBuffer, byte *outputBuffer,
int width,
int height,
int inputPitch,
int outputPitch);
1518 void mac_blitEPXImage(
const byte *buffer,
int pitch,
int x,
int y,
int width,
int height,
bool epxRectangleExpansion =
true);
1519 void mac_applyEPXToBuffer(
const byte *inputBuffer, byte *outputBuffer,
int width,
int height,
int inputPitch,
int outputPitch,
int xOffset,
int yOffset,
int bufferWidth,
int bufferHeight);
1520 void mac_scaleCursor(byte *&outCursor,
int &outHotspotX,
int &outHotspotY,
int &outWidth,
int &outHeight);
1521 void mac_toggleSmoothing();
1523 Common::KeyState mac_showOldStyleBannerAndPause(
const char *msg, int32 waitTime);
1525 const byte *postProcessDOSGraphics(
VirtScreen *vs,
int &pitch,
int &x,
int &y,
int &width,
int &height)
const;
1526 const byte *ditherVGAtoEGA(
int &pitch,
int &x,
int &y,
int &width,
int &height)
const;
1530 byte *getMaskBuffer(
int x,
int y,
int z);
1533 void fadeIn(
int effect);
1534 void fadeOut(
int effect);
1536 void dissolveEffectSelector();
1537 void transitionEffect(
int a);
1538 void dissolveEffect(
int width,
int height);
1539 void scrollEffect(
int dir);
1541 void updateScreenShakeEffect();
1544 double getTimerFrequency();
1545 double getAmigaMusicTimerFrequency();
1548 bool _shakeEnabled =
false;
1549 bool _shakeTempSavedState =
false;
1550 uint _shakeFrame = 0;
1551 uint32 _shakeNextTick = 0;
1552 uint32 _shakeTickCounter = 0;
1553 double _shakeTimerRate;
1554 double _timerFrequency;
1556 void setShake(
int mode);
1558 int _drawObjectQueNr = 0;
1559 byte _drawObjectQue[200];
1572 uint32 gfxUsageBits[410 * 3];
1574 void upgradeGfxUsageBits();
1575 void setGfxUsageBit(
int strip,
int bit);
1576 void clearGfxUsageBit(
int strip,
int bit);
1579 bool testGfxUsageBit(
int strip,
int bit) {
1580 assert(strip >= 0 && strip <
ARRAYSIZE(gfxUsageBits) / 3);
1581 assert(1 <= bit && bit <= 96);
1583 return (gfxUsageBits[3 * strip + bit / 32] & (1 << (bit % 32))) != 0;
1586 bool testGfxAnyUsageBits(
int strip);
1587 bool testGfxObjectUsageBits(
int strip);
1588 bool testGfxOtherUsageBits(
int strip,
int bit);
1591 byte _roomPalette[256];
1592 byte *_shadowPalette =
nullptr;
1593 bool _skipDrawObject = 0;
1595 int _soundEnabled = 0;
1598 byte _HEV7ActorPalette[256];
1599 uint8 *_hePalettes =
nullptr;
1600 uint16 _hePaletteSlot = 0;
1601 uint16 *_16BitPalette =
nullptr;
1604 byte *_verbPalette =
nullptr;
1609 int _shadowPaletteSize = 0;
1610 byte _currentPalette[3 * 256];
1611 byte _darkenPalette[3 * 256];
1612 int _paletteChangedCounter = 1;
1614 int _palDirtyMin = 0, _palDirtyMax = 0;
1616 byte _palManipStart = 0, _palManipEnd = 0;
1617 uint16 _palManipCounter = 0;
1618 byte *_palManipPalette =
nullptr;
1619 byte *_palManipIntermediatePal =
nullptr;
1621 bool _haveActorSpeechMsg =
false;
1622 bool _useTalkAnims =
false;
1623 uint16 _defaultTextSpeed = 0;
1625 bool _native_mt32 =
false;
1626 bool _copyProtection =
false;
1627 bool _shadowPalRemap =
false;
1630 uint16 _amigaFirstUsedColor = 0;
1631 byte _amigaPalette[3 * 64];
1632 void amigaPaletteFindFirstUsedColor();
1633 void mapRoomPalette(
int idx);
1634 int remapRoomPaletteColor(
int r,
int g,
int b);
1635 void mapVerbPalette(
int idx);
1636 int remapVerbPaletteColor(
int r,
int g,
int b);
1639 byte *_egaColorMap[2];
1642 uint16 _extraBoxFlags[65];
1645 byte *getBoxMatrixBaseAddr();
1646 byte *getBoxConnectionBase(
int box);
1648 int getNextBox(byte from, byte to);
1650 void setBoxFlags(
int box,
int val);
1651 void setBoxScale(
int box,
int b);
1653 bool checkXYInBoxBounds(
int box,
int x,
int y);
1655 BoxCoords getBoxCoordinates(
int boxnum);
1657 byte getMaskFromBox(
int box);
1658 Box *getBoxBaseAddr(
int box);
1659 byte getBoxFlags(
int box);
1660 int getBoxScale(
int box);
1662 int getScale(
int box,
int x,
int y);
1663 int getScaleFromSlot(
int slot,
int x,
int y);
1673 void setScaleSlot(
int slot,
int x1,
int y1,
int scale1,
int x2,
int y2,
int scale2);
1674 void setBoxScaleSlot(
int box,
int slot);
1675 void convertScaleTableToScaleSlot(
int slot);
1677 void calcItineraryMatrix(byte *itineraryMatrix,
int num);
1678 void createBoxMatrix();
1679 virtual bool areBoxesNeighbors(
int i,
int j);
1684 byte _charsetColorMap[16];
1691 int _textSurfaceMultiplier = 0;
1693 bool _isModernMacVersion =
false;
1694 bool _useGammaCorrection =
true;
1697 MacGui *_macGui =
nullptr;
1698 bool _useMacGraphicsSmoothing =
true;
1699 byte _completeScreenBuffer[320 * 200];
1702 byte _charsetColor = 0;
1703 byte _charsetData[23][16];
1705 int _charsetBufPos = 0;
1706 byte _charsetBuffer[512];
1708 bool _keepText =
false;
1711 int _nextLeft = 0, _nextTop = 0;
1716 bool _voiceNextString =
false;
1717 bool _checkPreviousSaid =
false;
1718 bool _voicePassHelpButtons =
false;
1719 int _previousVerb = -1;
1720 int _previousControl = -1;
1725 void restoreCharsetBg();
1726 void clearCharsetMask();
1727 void clearTextSurface();
1729 virtual void initCharset(
int charset);
1731 virtual void printString(
int m,
const byte *msg);
1733 virtual bool handleNextCharsetCode(
Actor *a,
int *c);
1734 virtual void drawSentence() {}
1735 virtual void displayDialog();
1736 int countNumberOfWaits();
1738 void drawString(
int a,
const byte *msg, Common::TextToSpeechManager::Action ttsAction = Common::TextToSpeechManager::QUEUE);
1739 virtual void fakeBidiString(byte *ltext,
bool ignoreVerb,
int ltextSize)
const;
1740 void wrapSegaCDText();
1741 void debugMessage(
const byte *msg);
1742 virtual void showMessageDialog(
const byte *msg);
1745 void sayText(
const Common::String &text, Common::TextToSpeechManager::Action action = Common::TextToSpeechManager::QUEUE)
const;
1746 void stopTextToSpeech()
const;
1747 void sayButtonText();
1750 virtual int convertMessageToString(
const byte *msg, byte *dst,
int dstSize);
1751 int convertIntMessage(byte *dst,
int dstSize,
int var);
1752 int convertVerbMessage(byte *dst,
int dstSize,
int var);
1753 int convertNameMessage(byte *dst,
int dstSize,
int var);
1754 int convertStringMessage(byte *dst,
int dstSize,
int var);
1760 virtual void translateText(
const byte *text, byte *trans_buff,
int transBufferSize);
1762 bool reverseIfNeeded(
const byte *text, byte *reverseBuf,
int reverseBufSize)
const;
1764 Common::CodePage getDialogCodePage()
const;
1767 bool _useCJKMode =
false;
1768 bool _useMultiFont =
false;
1769 int _numLoadedFont = 0;
1770 int _2byteShadow = 0;
1771 bool _force2ByteCharHeight =
false;
1773 int _2byteHeight = 0;
1774 int _2byteWidth = 0;
1776 byte _newLineCharacter = 0;
1777 byte *get2byteCharPtr(
int idx);
1779 bool isScummvmKorTarget();
1780 bool hasLocalizer();
1783 byte *_2byteFontPtr =
nullptr;
1784 byte *_2byteMultiFontPtr[20];
1785 int _2byteMultiHeight[20];
1786 int _2byteMultiWidth[20];
1787 int _2byteMultiShadow[20];
1790 struct TranslatedLine {
1791 uint32 originalTextOffset;
1792 uint32 translatedTextOffset;
1795 struct TranslationRange {
1799 TranslationRange(uint32 left_, uint32 right_) : left(left_), right(right_) {}
1800 TranslationRange() : left(0), right(0) {}
1803 struct TranslationRoom {
1807 bool _existLanguageFile =
false;
1808 bool _isRTL =
false;
1809 byte *_languageBuffer =
nullptr;
1810 int _numTranslatedLines = 0;
1811 TranslatedLine *_translatedLines =
nullptr;
1812 uint16 *_languageLineIndex =
nullptr;
1815 const byte *searchTranslatedLine(
const byte *text,
const TranslationRange &range,
bool useIndex);
1817 virtual void createTextRenderer(GlyphRenderer_v7 *gr) {}
1822 byte VAR_KEYPRESS = 0xFF;
1823 byte VAR_SYNC = 0xFF;
1824 byte VAR_EGO = 0xFF;
1825 byte VAR_CAMERA_POS_X = 0xFF;
1826 byte VAR_HAVE_MSG = 0xFF;
1827 byte VAR_ROOM = 0xFF;
1828 byte VAR_OVERRIDE = 0xFF;
1829 byte VAR_MACHINE_SPEED = 0xFF;
1831 byte VAR_NUM_ACTOR = 0xFF;
1832 byte VAR_CURRENT_LIGHTS = 0xFF;
1833 byte VAR_CURRENTDRIVE = 0xFF;
1834 byte VAR_CURRENTDISK = 0xFF;
1835 byte VAR_TMR_1 = 0xFF;
1836 byte VAR_TMR_2 = 0xFF;
1837 byte VAR_TMR_3 = 0xFF;
1838 byte VAR_MUSIC_TIMER = 0xFF;
1839 byte VAR_ACTOR_RANGE_MIN = 0xFF;
1840 byte VAR_ACTOR_RANGE_MAX = 0xFF;
1841 byte VAR_CAMERA_MIN_X = 0xFF;
1842 byte VAR_CAMERA_MAX_X = 0xFF;
1843 byte VAR_TIMER_NEXT = 0xFF;
1844 byte VAR_VIRT_MOUSE_X = 0xFF;
1845 byte VAR_VIRT_MOUSE_Y = 0xFF;
1846 byte VAR_ROOM_RESOURCE = 0xFF;
1847 byte VAR_LAST_SOUND = 0xFF;
1848 byte VAR_CUTSCENEEXIT_KEY = 0xFF;
1849 byte VAR_OPTIONS_KEY = 0xFF;
1850 byte VAR_TALK_ACTOR = 0xFF;
1851 byte VAR_CAMERA_FAST_X = 0xFF;
1852 byte VAR_SCROLL_SCRIPT = 0xFF;
1853 byte VAR_ENTRY_SCRIPT = 0xFF;
1854 byte VAR_ENTRY_SCRIPT2 = 0xFF;
1855 byte VAR_EXIT_SCRIPT = 0xFF;
1856 byte VAR_EXIT_SCRIPT2 = 0xFF;
1857 byte VAR_VERB_SCRIPT = 0xFF;
1858 byte VAR_SENTENCE_SCRIPT = 0xFF;
1859 byte VAR_INVENTORY_SCRIPT = 0xFF;
1860 byte VAR_CUTSCENE_START_SCRIPT = 0xFF;
1861 byte VAR_CUTSCENE_END_SCRIPT = 0xFF;
1862 byte VAR_CHARINC = 0xFF;
1863 byte VAR_WALKTO_OBJ = 0xFF;
1864 byte VAR_DEBUGMODE = 0xFF;
1865 byte VAR_HEAPSPACE = 0xFF;
1866 byte VAR_RESTART_KEY = 0xFF;
1867 byte VAR_PAUSE_KEY = 0xFF;
1868 byte VAR_MOUSE_X = 0xFF;
1869 byte VAR_MOUSE_Y = 0xFF;
1870 byte VAR_TIMER = 0xFF;
1871 byte VAR_TIMER_TOTAL = 0xFF;
1872 byte VAR_SOUNDCARD = 0xFF;
1873 byte VAR_VIDEOMODE = 0xFF;
1874 byte VAR_MAINMENU_KEY = 0xFF;
1875 byte VAR_FIXEDDISK = 0xFF;
1876 byte VAR_CURSORSTATE = 0xFF;
1877 byte VAR_USERPUT = 0xFF;
1878 byte VAR_SOUNDRESULT = 0xFF;
1879 byte VAR_TALKSTOP_KEY = 0xFF;
1880 byte VAR_FADE_DELAY = 0xFF;
1881 byte VAR_NOSUBTITLES = 0xFF;
1884 byte VAR_SOUNDPARAM = 0xFF;
1885 byte VAR_SOUNDPARAM2 = 0xFF;
1886 byte VAR_SOUNDPARAM3 = 0xFF;
1887 byte VAR_INPUTMODE = 0xFF;
1888 byte VAR_MEMORY_PERFORMANCE = 0xFF;
1889 byte VAR_VIDEO_PERFORMANCE = 0xFF;
1890 byte VAR_ROOM_FLAG = 0xFF;
1891 byte VAR_GAME_LOADED = 0xFF;
1892 byte VAR_NEW_ROOM = 0xFF;
1895 byte VAR_V5_TALK_STRING_Y = 0xFF;
1898 byte VAR_ROOM_WIDTH = 0xFF;
1899 byte VAR_ROOM_HEIGHT = 0xFF;
1900 byte VAR_SUBTITLES = 0xFF;
1901 byte VAR_V6_EMSSPACE = 0xFF;
1904 byte VAR_CAMERA_POS_Y = 0xFF;
1905 byte VAR_CAMERA_MIN_Y = 0xFF;
1906 byte VAR_CAMERA_MAX_Y = 0xFF;
1907 byte VAR_CAMERA_THRESHOLD_X = 0xFF;
1908 byte VAR_CAMERA_THRESHOLD_Y = 0xFF;
1909 byte VAR_CAMERA_SPEED_X = 0xFF;
1910 byte VAR_CAMERA_SPEED_Y = 0xFF;
1911 byte VAR_CAMERA_ACCEL_X = 0xFF;
1912 byte VAR_CAMERA_ACCEL_Y = 0xFF;
1913 byte VAR_CAMERA_DEST_X = 0xFF;
1914 byte VAR_CAMERA_DEST_Y = 0xFF;
1915 byte VAR_CAMERA_FOLLOWED_ACTOR = 0xFF;
1918 byte VAR_VERSION_KEY = 0xFF;
1919 byte VAR_DEFAULT_TALK_DELAY = 0xFF;
1920 byte VAR_CUSTOMSCALETABLE = 0xFF;
1921 byte VAR_BLAST_ABOVE_TEXT = 0xFF;
1922 byte VAR_VOICE_MODE = 0xFF;
1923 byte VAR_MUSIC_BUNDLE_LOADED = 0xFF;
1924 byte VAR_VOICE_BUNDLE_LOADED = 0xFF;
1926 byte VAR_LEFTBTN_DOWN = 0xFF;
1927 byte VAR_RIGHTBTN_DOWN = 0xFF;
1928 byte VAR_LEFTBTN_HOLD = 0xFF;
1929 byte VAR_RIGHTBTN_HOLD = 0xFF;
1930 byte VAR_PRE_SAVELOAD_SCRIPT = 0xFF;
1931 byte VAR_POST_SAVELOAD_SCRIPT = 0xFF;
1932 byte VAR_SAVELOAD_PAGE = 0xFF;
1933 byte VAR_OBJECT_LABEL_FLAG = 0xFF;
1936 byte VAR_CHARSET_MASK = 0xFF;
1939 byte VAR_V6_SOUNDMODE = 0xFF;
1942 byte VAR_CHARCOUNT = 0xFF;
1943 byte VAR_VERB_ALLOWED = 0xFF;
1944 byte VAR_ACTIVE_VERB = 0xFF;
1945 byte VAR_ACTIVE_OBJECT1 = 0xFF;
1946 byte VAR_ACTIVE_OBJECT2 = 0xFF;
1949 byte VAR_ALWAYS_REDRAW_ACTORS = 0xFF;
1950 byte VAR_SKIP_RESET_TALK_ACTOR = 0xFF;
1952 byte VAR_SOUND_CHANNEL = 0xFF;
1953 byte VAR_TALK_CHANNEL = 0xFF;
1954 byte VAR_SOUND_TOKEN_OFFSET = 0xFF;
1955 byte VAR_START_DYN_SOUND_CHANNELS = 0xFF;
1956 byte VAR_SOUND_CALLBACK_SCRIPT = 0xFF;
1958 byte VAR_EARLY_TALKIE_CALLBACK = 0xFF;
1959 byte VAR_EARLY_CHAN_0_CALLBACK = 0xFF;
1960 byte VAR_EARLY_CHAN_1_CALLBACK = 0xFF;
1961 byte VAR_EARLY_CHAN_2_CALLBACK = 0xFF;
1962 byte VAR_EARLY_CHAN_3_CALLBACK = 0xFF;
1964 byte VAR_MAIN_SCRIPT = 0xFF;
1966 byte VAR_DEFAULT_SCRIPT_PRIORITY = 0xFF;
1967 byte VAR_LAST_SCRIPT_PRIORITY = 0xFF;
1969 byte VAR_QUIT_SCRIPT = 0xFF;
1970 byte VAR_ERROR_FLAG = 0xFF;
1971 byte VAR_OPERATION_FAILURE = 0xFF;
1973 byte VAR_COLOR_BLACK = 0xFF;
1976 byte VAR_NUM_GLOBAL_OBJS = 0xFF;
1978 byte VAR_LAST_FRAME_BURN_TIME = 0xFF;
1979 byte VAR_LAST_FRAME_SCUMM_TIME = 0xFF;
1981 byte VAR_WINDEX_RUNNING = 0xFF;
1983 #ifdef USE_RGB_COLOR 1985 Graphics::FontSJIS *_cjkFont =
nullptr;
1989 #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE 1991 bool towns_isRectInStringBox(
int x1,
int y1,
int x2,
int y2);
1992 byte _townsPaletteFlags = 0;
1993 byte _townsCharsetColorMap[16];
1996 void towns_drawStripToScreen(
VirtScreen *vs,
int dstX,
int dstY,
int srcX,
int srcY,
int w,
int h);
1997 void towns_fillTopLayerRect(
int x1,
int y1,
int x2,
int y2,
int col);
1998 void towns_swapVirtScreenArea(
VirtScreen *vs,
int x,
int y,
int w,
int h);
1999 void towns_clearStrip(
int strip);
2000 #ifdef USE_RGB_COLOR 2001 void towns_setPaletteFromPtr(
const byte *ptr,
int numcolor = -1);
2002 void towns_setTextPaletteFromPtr(
const byte *ptr);
2004 void towns_setupPalCycleField(
int x1,
int y1,
int x2,
int y2);
2005 void towns_processPalCycleField();
2006 void towns_resetPalCycleFields();
2007 void towns_restoreCharsetBg();
2008 void towns_scriptScrollEffect(
int dir);
2010 void requestScroll(
int dir);
2011 void scrollLeft() { requestScroll(-1); }
2012 void scrollRight() { requestScroll(1); }
2013 void towns_waitForScroll(
int waitForDirection,
int threshold = 0);
2014 void towns_updateGfx();
2017 int _numCyclRects = 0;
2018 int _scrollRequest = 0;
2019 int _scrollDeltaAdjust = 0;
2020 bool _scrollNeedDeltaAdjust = 0;
2021 int _refreshDuration[20];
2022 int _refreshArrayPos = 0;
2023 bool _refreshNeedCatchUp =
false;
2024 bool _enableSmoothScrolling =
false;
2025 bool _forceFMTownsHiResMode =
false;
2026 uint32 _scrollTimer = 0;
2027 uint32 _scrollDestOffset = 0;
2028 uint16 _scrollFeedStrips[3];
2032 byte _townsOverrideShadowColor = 0;
2033 byte _textPalette[48];
2034 byte _townsClearLayerFlag = 1;
2035 byte _townsActiveLayerFlags = 3;
2036 static const uint8 _townsLayer2Mask[];
2040 void scrollLeft() { redrawBGStrip(_gdi->_numStrips - 1, 1); }
2041 void scrollRight() { redrawBGStrip(0, 1); }
2042 void towns_updateGfx() {}
2043 void towns_waitForScroll(
int waitForDirection,
int threshold = 0) {}
2044 void towns_fillTopLayerRect(
int x1,
int y1,
int x2,
int y2,
int col) {}
2045 void towns_swapVirtScreenArea(
VirtScreen *vs,
int x,
int y,
int w,
int h) {}
2046 #endif // DISABLE_TOWNS_DUAL_LAYER_MODE #define ARRAYSIZE(x)
Definition: util.h:114
Definition: macgui_impl.h:52
VirtScreenNumber
Definition: gfx.h:161
EngineFeature
Definition: engine.h:282
T left
Definition: rect.h:170
ErrorCode getCode() const
Definition: error.h:112
Definition: detection.h:125
Definition: macgui_v6.h:33
Definition: palette.h:195
RenderMode
Definition: rendermode.h:48
No error occurred.
Definition: error.h:48
Common::Path _containerFile
Definition: scumm.h:1146
Definition: resource.h:80
ResType
Definition: scumm.h:243
Definition: macgui_indy3.h:39
Definition: printman.h:30
void void void void void debugC(int level, uint32 debugChannel, MSVC_PRINTF const char *s,...) GCC_PRINTF(3
Definition: serializer.h:80
Graphics::Surface _textSurface
Definition: scumm.h:1690
int FORCEINLINE GCC_PRINTF(2, 0) int vsprintf_s(T(&dst)[N]
Definition: detection.h:52
T right
Definition: rect.h:171
bool currentScriptSlotIs(uint16 script) const
Definition: scumm.h:1065
Definition: player_towns.h:32
Definition: debugger.h:33
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: macgui_v5.h:33
Definition: serializer.h:352
Definition: charset.h:159
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: localizer.h:31
Definition: base-costume.h:68
Definition: keyboard.h:294
Definition: serializer.h:33
Common::Error run() override
Definition: scumm.h:588
Common::RandomSource _rnd
Definition: scumm.h:556
Definition: macgui_loom.h:33
Common::String getSaveStateName(int slot) const override
Definition: scumm.h:605
Definition: base-costume.h:49
Definition: detection.h:139
Language
Definition: language.h:45