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/serializer.h" 37 #include "common/str.h" 38 #include "common/textconsole.h" 39 #include "graphics/surface.h" 40 #include "graphics/sjis.h" 41 #include "graphics/palette.h" 43 #include "scumm/gfx.h" 44 #include "scumm/detection.h" 45 #include "scumm/script.h" 56 #define DISABLE_TOWNS_DUAL_LAYER_MODE 64 class SeekableReadStream;
66 class SeekableWriteStream;
87 class BaseCostumeLoader;
88 class BaseCostumeRenderer;
90 class CharsetRenderer;
100 class GlyphRenderer_v7;
104 struct FindObjectInRoom;
107 extern ScummEngine *g_scumm;
112 NUM_SHADOW_PALETTE = 8
119 DEBUG_GENERAL = 1 << 0,
120 DEBUG_SCRIPTS = 1 << 2,
121 DEBUG_OPCODES = 1 << 3,
123 DEBUG_RESOURCE = 1 << 5,
124 DEBUG_IMUSE = 1 << 6,
125 DEBUG_SOUND = 1 << 7,
126 DEBUG_ACTORS = 1 << 8,
127 DEBUG_INSANE = 1 << 9,
128 DEBUG_SMUSH = 1 << 10,
129 DEBUG_MOONBASE_AI = 1 << 11,
130 DEBUG_NETWORK = 1 << 12
170 MBS_LEFT_CLICK = 0x8000,
171 MBS_RIGHT_CLICK = 0x4000,
172 MBS_MOUSE_MASK = (MBS_LEFT_CLICK | MBS_RIGHT_CLICK),
216 uint _objectRedrawCount;
217 uint _objectStripRedrawCount;
218 uint _actorRedrawCount;
219 uint _actorLimbRedrawDrawCount;
239 USERSTATE_SET_FREEZE = 0x01,
240 USERSTATE_SET_CURSOR = 0x02,
241 USERSTATE_SET_IFACE = 0x04,
242 USERSTATE_FREEZE_ON = 0x08,
243 USERSTATE_CURSOR_ON = 0x10,
244 USERSTATE_IFACE_SENTENCE = 0x20,
245 USERSTATE_IFACE_INVENTORY = 0x40,
246 USERSTATE_IFACE_VERBS = 0x80
249 #define USERSTATE_IFACE_ALL (USERSTATE_IFACE_SENTENCE | USERSTATE_IFACE_INVENTORY | USERSTATE_IFACE_VERBS) 283 typedef uint16 ResId;
327 #define PIT_BASE_FREQUENCY 1193182.0 // In Hz 328 #define PIT_V1_DIVISOR 65536.0 329 #define PIT_V2_4_DIVISOR 5041.0 330 #define PIT_V5_6_ORCHESTRATOR_DIVISOR 4096.0 331 #define PIT_V5_6_SUBTIMER_INC 3433.0 332 #define PIT_V5_SUBTIMER_THRESH 4167.0 333 #define PIT_V6_SAMNMAX_SUBTIMER_THRESH 4167.0 334 #define PIT_V6_DOTT_SUBTIMER_THRESH 4237.0 335 #define PIT_V7_ORCHESTRATOR_DIVISOR 3977.0 336 #define PIT_V7_SUBTIMER_INC 3977.0 337 #define PIT_V7_SUBTIMER_THRESH 4971.0 339 #define LOOM_STEAM_CDDA_RATE 240.0 354 #define AMIGA_NTSC_VBLANK_RATE 240.0 355 #define AMIGA_PAL_VBLANK_RATE 200.0 361 #define GAME_PROPER_SAVE 201 362 #define GAME_FAILED_SAVE 202 363 #define GAME_PROPER_LOAD 203 364 #define GAME_FAILED_LOAD 204 370 #define GUI_PAGE_MAIN 0 371 #define GUI_PAGE_SAVE 1 372 #define GUI_PAGE_LOAD 2 373 #define GUI_PAGE_RESTART 3 // Sega CD 374 #define GUI_PAGE_CODE_CONFIRM 4 // Sega CD 375 #define GUI_PAGE_INVALID_CODE 5 // Sega CD 377 #define GUI_CTRL_FIRST_SG 1 378 #define GUI_CTRL_LAST_SG 9 379 #define GUI_CTRL_SAVE_BUTTON 10 380 #define GUI_CTRL_LOAD_BUTTON 11 381 #define GUI_CTRL_PLAY_BUTTON 12 382 #define GUI_CTRL_QUIT_BUTTON 13 383 #define GUI_CTRL_OK_BUTTON 14 384 #define GUI_CTRL_CANCEL_BUTTON 15 385 #define GUI_CTRL_ARROW_UP_BUTTON 16 386 #define GUI_CTRL_ARROW_DOWN_BUTTON 17 387 #define GUI_CTRL_PATH_BUTTON 18 388 #define GUI_CTRL_MUSIC_SLIDER 19 389 #define GUI_CTRL_SPEECH_SLIDER 20 390 #define GUI_CTRL_SFX_SLIDER 21 391 #define GUI_CTRL_TEXT_SPEED_SLIDER 22 392 #define GUI_CTRL_DISPLAY_TEXT_CHECKBOX 23 393 #define GUI_CTRL_SPOOLED_MUSIC_CHECKBOX 24 394 #define GUI_CTRL_OUTER_BOX 26 395 #define GUI_CTRL_INNER_BOX 27 398 #define GUI_CTRL_NUMPAD_1 1 399 #define GUI_CTRL_NUMPAD_2 2 400 #define GUI_CTRL_NUMPAD_3 3 401 #define GUI_CTRL_NUMPAD_4 4 402 #define GUI_CTRL_NUMPAD_5 5 403 #define GUI_CTRL_NUMPAD_6 6 404 #define GUI_CTRL_NUMPAD_7 7 405 #define GUI_CTRL_NUMPAD_8 8 406 #define GUI_CTRL_NUMPAD_9 9 407 #define GUI_CTRL_NUMPAD_0 10 408 #define GUI_CTRL_RESTART_BUTTON 13 409 #define GUI_CTRL_ARROW_LEFT_BUTTON 16 410 #define GUI_CTRL_ARROW_RIGHT_BUTTON 17 411 #define GUI_CTRL_NUMPAD_BACK 23 416 gsTextSpeedSlider = 2,
427 gsGameNotLoaded = 13,
431 gsSelectLoadPrompt = 17,
432 gsReplacePrompt = 18,
437 gsTextDisplayOnly = 24,
440 gsMusicVolumeSlider = 27,
441 gsVoiceVolumeSlider = 28,
442 gsSfxVolumeSlider = 29,
453 gsInsertSaveDisk = 40,
456 gsRecalJoystick = 43,
469 gsCurrentPasscode = 56,
470 gsEnterPasscode = 57,
471 gsConfirmPasscode = 58,
472 gsInvalidPasscode = 59,
489 int highlightedTextColor;
490 int highlightedFillColor;
493 bool doubleLinesFlag;
498 kScummActionInsaneDownLeft,
499 kScummActionInsaneDown,
500 kScummActionInsaneDownRight,
501 kScummActionInsaneLeft,
502 kScummActionInsaneRight,
503 kScummActionInsaneUpLeft,
504 kScummActionInsaneUp,
505 kScummActionInsaneUpRight,
506 kScummActionInsaneAttack,
507 kScummActionInsaneSwitch,
508 kScummActionInsaneCheat,
513 extern const char *
const insaneKeymapId;
522 friend class CharsetRendererTownsClassic;
532 IMuse *_imuse =
nullptr;
533 IMuseDigital *_imuseDigital =
nullptr;
536 Sound *_sound =
nullptr;
553 int _insideCreateResource = 0;
555 int32 _activeEnhancements = kEnhGameBreakingBugFixes;
556 bool _useOriginalGUI =
true;
557 bool _enableAudioOverride =
false;
558 bool _enableCOMISong =
false;
559 bool _isAmigaPALSystem =
false;
560 bool _quitFromScriptCmd =
false;
567 bool _oldSoundsPaused =
false;
585 void errorString(
const char *buf_input,
char *buf_output,
int buf_output_size)
override;
587 bool enhancementEnabled(int32 cls);
588 void syncSoundSettings()
override;
595 void pauseEngineIntern(
bool pause)
override;
598 virtual void setupScumm(
const Common::Path &macResourceFile);
599 virtual void resetScumm();
601 virtual void setupScummVars();
602 virtual void resetScummVars();
603 void setVideoModeVarToCurrentConfig();
604 void setSoundCardVarToCurrentConfig();
606 void setupCharsetRenderer(
const Common::Path &macFontFile);
607 void setupCostumeRenderer();
609 virtual void loadLanguageBundle();
612 void setupMusic(
int midi);
613 void setTalkSpeed(
int talkspeed);
617 virtual void scummLoop(
int delta);
618 virtual void scummLoop_updateScummVars();
619 virtual void scummLoop_handleSaveLoad();
620 virtual void scummLoop_handleDrawing();
621 virtual void scummLoop_handleActors() = 0;
622 virtual void scummLoop_handleEffects();
623 virtual void scummLoop_handleSound();
625 virtual void runBootscript();
627 virtual void terminateSaveMenuScript() {};
635 void waitForTimer(
int quarterFrames,
bool freezeMacGui =
false);
636 uint32 _lastWaitTime;
638 void setTimerAndShakeFrequency();
645 uint32 getIntegralTime(
double fMsecs);
646 double _msecFractParts = 0.0;
648 virtual void processInput();
650 virtual void clearClickedStatus();
653 virtual void updateCursor();
654 virtual void animateCursor() {}
655 virtual void updatePalette();
656 virtual void setDefaultCursor() {};
657 virtual void setCursorTransparency(
int a) {};
658 virtual void resetCursors() {}
659 virtual void setCursorHotspot(
int x,
int y) {}
660 virtual void setCursorFromBuffer(
const byte *ptr,
int width,
int height,
int pitch,
bool preventScale =
false) {}
666 bool isUsingOriginalGUI();
667 bool isMessageBannerActive();
669 bool _isIndy4Jap =
false;
672 Dialog *_pauseDialog =
nullptr;
673 Dialog *_messageDialog =
nullptr;
674 Dialog *_versionDialog =
nullptr;
676 void confirmExitDialog();
677 void confirmRestartDialog();
680 void versionDialog();
683 int32 _bannerColors[50];
684 byte *_bannerMem =
nullptr;
685 uint32 _bannerMemSize = 0;
686 int _bannerSaveYStart = 0;
688 bool _messageBannerActive =
false;
689 bool _comiQuitMenuIsOpen =
false;
690 bool _closeBannerAndQueryQuitFlag =
false;
693 byte *_textSurfBannerMem =
nullptr;
694 uint32 _textSurfBannerMemSize = 0;
699 const char _emptyMsg[1] = {
'\0'};
700 const char _uncheckedBox[2] = {
' ',
'\0'};
701 const char _checkedBox[2] = {
'x',
'\0'};
702 const char _arrowUp[2] = {
'\x18',
'\0'};
703 const char _arrowDown[2] = {
'\x19',
'\0'};
704 const char _arrowLeft[2] = {
'\x3c',
'\0'};
705 const char _arrowRight[2] = {
'\x3d',
'\0'};
709 int _mainMenuSavegameLabel = 1;
710 int _curDisplayedSaveSlotPage = 0;
711 int _firstSaveStateOfList = 0;
712 bool _mainMenuIsActive =
false;
713 bool _quitByGUIPrompt =
false;
714 char _mainMenuMusicSlider[17];
715 char _mainMenuSpeechSlider[17];
716 char _mainMenuSfxSlider[17];
717 char _mainMenuTextSpeedSlider[17];
718 char _mainMenuSegaCDPasscode[5];
719 int _spooledMusicIsToBeEnabled = 1;
720 int _saveScriptParam = 0;
721 int _guiCursorAnimCounter = 0;
722 int _v5VoiceMode = 0;
725 int _internalSpeakerSoundsAreOn = 1;
726 int _guiMouseFlag = 1;
727 int _guiJoystickFlag = 1;
729 bool _mixerMutedByGUI =
false;
732 byte *_tempTextSurface =
nullptr;
733 byte *_tempMainSurface =
nullptr;
734 byte *_tempVerbSurface =
nullptr;
735 bool _postGUICharMask =
false;
738 byte *_curGrabbedCursor =
nullptr;
739 int8 _oldCursorState = 0;
740 int _curCursorState = 0;
741 int _curCursorWidth = 0;
742 int _curCursorHeight = 0;
743 int _curCursorHotspotX = 0;
744 int _curCursorHotspotY = 0;
746 virtual void setSnailCursor() {}
749 Common::KeyState showBannerAndPause(
int bannerId, int32 waitTime,
const char *msg, ...);
750 Common::KeyState showOldStyleBannerAndPause(
const char *msg,
int color, int32 waitTime);
751 Common::KeyState printMessageAndPause(
const char *msg,
int color, int32 waitTime,
bool drawOnSentenceLine);
754 void setBannerColors(
int bannerId, byte r, byte g, byte b);
755 virtual int getBannerColor(
int bannerId);
756 void setUpInternalGUIControl(
int id,
int normalFillColor,
int normalTextColor,
757 int topLineColor,
int bottomLineColor,
int leftLineColor,
int rightLineColor,
758 int highlightedTextColor,
int highlightedFillColor,
759 int anchorPointX,
int anchorPointY,
int x,
int y,
const char *label,
bool centerFlag,
bool unknownFlag);
760 void drawInternalGUIControl(
int id,
bool highlightColor);
761 int getInternalGUIControlFromCoordinates(
int x,
int y);
762 virtual bool isSmushActive() {
return false; }
763 virtual bool isInsaneActive() {
return false; }
765 virtual void queryQuit(
bool returnToLauncher);
766 virtual void queryRestart();
767 virtual const char *getGUIString(
int stringId);
768 void waitForBannerInput(int32 waitTime,
Common::KeyState &ks,
bool &leftBtnClicked,
bool &rightBtnClicked,
bool handleMouseWheel =
false);
769 virtual int getGUIStringHeight(
const char *str);
770 virtual int getGUIStringWidth(
const char *str);
771 virtual void drawGUIText(
const char *buttonString,
Common::Rect *clipRect,
int textXPos,
int textYPos,
int textColor,
bool centerFlag);
772 void getSliderString(
int stringId,
int value,
char *sliderString,
int size);
773 virtual int getMusicVolume();
774 virtual int getSpeechVolume();
775 virtual int getSFXVolume();
776 virtual void setMusicVolume(
int volume);
777 virtual void setSpeechVolume(
int volume);
778 virtual void setSFXVolume(
int volume);
779 virtual void toggleVoiceMode();
780 virtual void handleLoadDuringSmush() {}
781 virtual void setSkipVideo(
int value) {}
784 virtual void setUpMainMenuControls();
785 void setUpMainMenuControlsSegaCD();
786 void setUpMainMenuControlsIndy4Jap();
787 void drawMainMenuControls();
788 void drawMainMenuControlsSegaCD();
789 void updateMainMenuControls();
790 void updateMainMenuControlsSegaCD();
791 void drawMainMenuTitle(
const char *title);
792 bool executeMainMenuOperation(
int op,
int mouseX,
int mouseY,
bool &hasLoadedState);
793 bool executeMainMenuOperationSegaCD(
int op,
int mouseX,
int mouseY,
bool &hasLoadedState);
794 bool shouldHighlightLabelAndWait(
int clickedControl);
795 void fillSavegameLabels();
796 bool canWriteGame(
int slotId);
797 bool userWriteLabelRoutine(
Common::KeyState &ks,
bool &leftMsClicked,
bool &rightMsClicked);
798 void saveCursorPreMenu();
799 void restoreCursorPostMenu();
800 void saveSurfacesPreGUI();
801 void restoreSurfacesPostGUI();
802 void showDraftsInventory();
803 void setUpDraftsInventory();
804 void drawDraftsInventory();
807 char displayMessage(
const char *altButton, MSVC_PRINTF
const char *message, ...)
GCC_PRINTF(3, 4);
808 bool displayMessageYesNo(MSVC_PRINTF
const char *message, ...)
GCC_PRINTF(2, 3);
814 Actor **_actors =
nullptr;
815 Actor **_sortedActors =
nullptr;
817 byte *_arraySlot =
nullptr;
818 uint16 *_inventory =
nullptr;
819 uint16 *_newNames =
nullptr;
823 #define VAR(x) scummVar(x, #x, __FILE__, __LINE__) 824 int32& scummVar(byte var,
const char *varName,
const char *file,
int line) {
826 error(
"Illegal access to variable %s in file %s, line %d", varName, file, line);
828 return _scummVars[var];
830 int32 scummVar(byte var,
const char *varName,
const char *file,
int line)
const {
832 error(
"Illegal access to variable %s in file %s, line %d", varName, file, line);
834 return _scummVars[var];
839 int32 *_roomVars =
nullptr;
840 int32 *_scummVars =
nullptr;
841 byte *_bitVars =
nullptr;
844 int _numVariables = 0;
845 int _numBitVariables = 0;
846 int _numLocalObjects = 0;
847 int _numGlobalObjects = 0;
850 int _numFlObject = 0;
851 int _numInventory = 0;
852 int _numNewNames = 0;
853 int _numGlobalScripts = 0;
854 int _numRoomVariables = 0;
855 int _numPalettes = 0;
861 int _numLocalScripts = 60, _numImages = 0, _numRooms = 0, _numScripts = 0, _numSounds = 0;
862 int _numCostumes = 0;
863 int32 _numCharsets = 0;
868 int _NESCostumeSet = 0;
869 void NES_loadCostumeSet(
int n);
870 byte *_NEScostdesc =
nullptr, *_NEScostlens =
nullptr, *_NEScostoffs =
nullptr, *_NEScostdata =
nullptr;
871 byte _NESPatTable[2][4096];
872 byte _NESPalette[2][16];
873 byte _NESBaseTiles = 0;
875 int _NESStartStrip = 0;
878 int _curPalIndex = 0;
881 byte _currentRoom = 0;
882 int _roomResource = 0;
883 bool _egoPositioned =
false;
887 virtual Common::Path generateFilename(
const int room)
const;
891 bool _keyDownMap[512];
892 bool _actionMap[kScummActionCount];
897 uint16 _mouseAndKeyboardStat = 0;
898 byte _leftBtnPressed = 0, _rightBtnPressed = 0;
900 int _mouseWheelFlag = 0;
902 bool _setupIsComplete =
false;
908 uint32 _lastInputScriptTime = 0;
914 bool _dumpScripts =
false;
915 bool _hexdumpScripts =
false;
916 bool _showStack =
false;
917 bool _debugMode =
false;
920 byte _saveLoadFlag = 0, _saveLoadSlot = 0;
921 uint32 _lastSaveTime = 0;
922 bool _saveTemporaryState =
false;
923 bool _pauseSoundsDuringSave =
true;
924 bool _loadFromLauncher =
false;
925 bool _videoModeChanged =
false;
931 bool loadState(
int slot,
bool compat);
938 void copyHeapSaveGameToFile(
int slot,
const char *saveName);
939 bool changeSavegameName(
int slot,
char *newName);
944 return makeSavegameName(_targetName, slot, temporary);
947 int getKeyState(
int key);
948 int getActionState(ScummAction action);
954 void listSavegames(
bool *marks,
int num);
957 void requestLoad(
int slot);
960 bool canPauseSoundsDuringSave()
const {
return _pauseSoundsDuringSave; }
972 uint32 _localScriptOffsets[1024];
973 const byte *_scriptPointer =
nullptr;
974 const byte *_scriptOrgPointer =
nullptr;
975 const byte *
const *_lastCodePtr =
nullptr;
978 byte _currentScript = 0xFF;
979 int _scummStackPos = 0;
982 char _engineVersionString[50];
983 char _dataFileVersionString[50];
987 virtual void setupOpcodes() = 0;
988 void executeOpcode(byte i);
989 const char *getOpcodeDesc(byte i);
991 void initializeLocals(
int slot,
int *vars);
994 void startScene(
int room,
Actor *a,
int b);
998 void runScript(
int script,
bool freezeResistant,
bool recursive,
int *lvarptr,
int cycle = 0);
999 void stopScript(
int script);
1000 void nukeArrays(byte scriptSlot);
1003 void runObjectScript(
int script,
int entry,
bool freezeResistant,
bool recursive,
int *vars,
int slot = -1,
int cycle = 0);
1004 void runScriptNested(
int script);
1005 void executeScript();
1006 void updateScriptPtr();
1007 virtual void runInventoryScript(
int i);
1008 virtual void checkAndRunSentenceScript();
1009 void runExitScript();
1010 void runEntryScript();
1011 void runQuitScript();
1012 void runAllScripts();
1013 void freezeScripts(
int scr);
1014 void unfreezeScripts();
1016 bool isScriptInUse(
int script)
const;
1017 bool isRoomScriptRunning(
int script)
const;
1018 bool isScriptRunning(
int script)
const;
1020 void killAllScriptsExceptCurrent();
1021 void killScriptsAndResources();
1022 void decreaseScriptDelay(
int amount);
1024 void stopObjectCode();
1025 void stopObjectScript(
int script);
1027 void getScriptBaseAddress();
1028 void resetScriptPointer();
1029 int getVerbEntrypoint(
int obj,
int entry);
1031 void refreshScriptPointer();
1032 byte fetchScriptByte();
1033 virtual uint fetchScriptWord();
1034 virtual int fetchScriptWordSigned();
1035 uint fetchScriptDWord();
1036 int fetchScriptDWordSigned();
1037 void ignoreScriptWord() { fetchScriptWord(); }
1038 void ignoreScriptByte() { fetchScriptByte(); }
1041 virtual int readVar(uint var);
1042 virtual void writeVar(uint var,
int value);
1044 virtual void resetSentence() {}
1047 virtual void beginCutscene(
int *args);
1048 virtual void endCutscene();
1049 void abortCutscene();
1050 void beginOverride();
1053 void copyScriptString(byte *dst);
1054 int resStrLen(
const byte *src);
1055 void doSentence(
int c,
int b,
int a);
1059 uint32 _fileOffset = 0;
1068 bool isMacM68kIMuse()
const;
1071 int _resourceHeaderSize = 8;
1072 byte _resourceMapper[128];
1073 const byte *_resourceLastSearchBuf;
1074 uint32 _resourceLastSearchSize;
1076 virtual void allocateArrays();
1077 void openRoom(
int room);
1079 void deleteRoomOffsets();
1080 virtual void readRoomsOffsets();
1081 void askForDisk(
const Common::Path &filename,
int disknum);
1082 bool openResourceFile(
const Common::Path &filename, byte encByte);
1084 void loadPtrToResource(
ResType type, ResId idx,
const byte *ptr);
1085 virtual int readResTypeList(
ResType type);
1088 int loadResource(
ResType type, ResId idx);
1090 int getResourceRoomNr(
ResType type, ResId idx);
1091 virtual uint32 getResourceRoomOffset(
ResType type, ResId idx);
1094 int getResourceSize(
ResType type, ResId idx);
1095 byte *getResourceAddress(
ResType type, ResId idx);
1096 virtual byte *getStringAddress(ResId idx);
1097 byte *getStringAddressVar(
int i);
1098 void ensureResourceLoaded(
ResType type, ResId idx);
1105 int readSoundResource(ResId idx);
1106 int readSoundResourceSmallHeader(ResId idx);
1107 bool isResourceInUse(
ResType type, ResId idx)
const;
1109 virtual void setupRoomSubBlocks();
1110 virtual void resetRoomSubBlocks();
1112 virtual void clearRoomObjects();
1113 virtual void resetRoomObjects();
1114 virtual void resetRoomObject(
ObjectData *od,
const byte *room,
const byte *searchptr = NULL);
1116 virtual void readArrayFromIndexFile();
1117 virtual void readMAXS(
int blockSize) = 0;
1118 virtual void readGlobalObjects();
1119 virtual void readIndexFile();
1120 virtual void readIndexBlock(uint32 block, uint32 itemsize);
1121 virtual void loadCharset(
int i);
1122 void nukeCharset(
int i);
1124 int _lastLoadedRoom = 0;
1126 const byte *findResourceData(uint32 tag,
const byte *ptr);
1127 const byte *findResource(uint32 tag,
const byte *ptr);
1128 void applyWorkaroundIfNeeded(
ResType type,
int idx);
1129 bool verifyMI2MacBootScript();
1130 bool verifyMI2MacBootScript(byte *buf,
int size);
1131 bool tryPatchMI1CannibalScript(byte *buf,
int size);
1133 int getResourceDataSize(
const byte *ptr)
const;
1134 void dumpResource(
const char *tag,
int index,
const byte *ptr,
int length = -1);
1138 byte OF_OWNER_ROOM = 0;
1139 int getInventorySlot();
1140 int findInventory(
int owner,
int index);
1141 int getInventoryCount(
int owner);
1144 byte *_objectOwnerTable =
nullptr, *_objectRoomTable =
nullptr, *_objectStateTable =
nullptr;
1145 int _numObjectsInRoom = 0;
1148 uint32 *_classData =
nullptr;
1151 void markObjectRectAsDirty(
int obj);
1152 virtual void loadFlObject(uint
object, uint room);
1153 void nukeFlObjects(
int min,
int max);
1154 int findFlObjectSlot();
1155 int findLocalObjectSlot();
1156 void addObjectToInventory(uint obj, uint room);
1157 void updateObjectStates();
1159 bool getClass(
int obj,
int cls)
const;
1161 void putClass(
int obj,
int cls,
bool set);
1162 int getState(
int obj);
1163 void putState(
int obj,
int state);
1164 void setObjectState(
int obj,
int state,
int x,
int y);
1165 int getOwner(
int obj)
const;
1166 void putOwner(
int obj,
int owner);
1167 void setOwnerOf(
int obj,
int owner);
1168 void clearOwnerOf(
int obj);
1169 int getObjectRoom(
int obj)
const;
1170 virtual bool objIsActor(
int obj);
1171 virtual int objToActor(
int obj);
1172 virtual int actorToObj(
int actor);
1173 int getObjX(
int obj);
1174 int getObjY(
int obj);
1175 void getObjectWidth(
int object,
int &width) {
int x, y, dir; getObjectXYPos(
object, x, y, dir, width); }
1176 void getObjectXYPos(
int object,
int &x,
int &y) {
int dir, width; getObjectXYPos(
object, x, y, dir, width); }
1177 void getObjectXYPos(
int object,
int &x,
int &y,
int &dir) {
int width; getObjectXYPos(
object, x, y, dir, width); }
1178 void getObjectXYPos(
int object,
int &x,
int &y,
int &dir,
int &width);
1179 int getObjOldDir(
int obj);
1180 int getObjNewDir(
int obj);
1181 int getObjectIndex(
int object)
const;
1182 int getObjectImageCount(
int object);
1183 int whereIsObject(
int object)
const;
1184 int findObject(
int x,
int y);
1185 void findObjectInRoom(
FindObjectInRoom *fo, byte findWhat, uint
object, uint room);
1187 int getObjectOrActorWidth(
int object,
int &width);
1188 int getObjectOrActorXY(
int object,
int &x,
int &y);
1189 int getDist(
int x,
int y,
int x2,
int y2);
1192 int getObjActToObjActDist(
int a,
int b);
1193 const byte *getObjOrActorName(
int obj);
1194 void setObjectName(
int obj);
1196 void addObjectToDrawQue(
int object);
1197 void removeObjectFromDrawQue(
int object);
1198 void clearDrawObjectQueue();
1199 void processDrawQue();
1201 virtual void clearDrawQueues();
1203 uint32 getOBCDOffs(
int object)
const;
1204 byte *getOBCDFromObject(
int obj,
bool v0CheckInventory =
true);
1205 const byte *getOBIMFromObjectData(
const ObjectData &od);
1206 const byte *getObjectImage(
const byte *ptr,
int state);
1207 virtual int getObjectIdFromOBIM(
const byte *obim);
1211 uint16 _verbMouseOver = 0;
1213 uint16 _userState = 0;
1215 virtual void handleMouseOver(
bool updateInventory);
1216 virtual void redrawVerbs();
1217 virtual void checkExecVerbs();
1219 void verbMouseOver(
int verb);
1220 int findVerbAtPos(
int x,
int y)
const;
1221 virtual void drawVerb(
int verb,
int mode);
1222 virtual void runInputScript(
int clickArea,
int val,
int mode);
1223 void restoreVerbBG(
int verb);
1224 void drawVerbBitmap(
int verb,
int x,
int y);
1225 int getVerbSlot(
int id,
int mode)
const;
1226 void killVerb(
int slot);
1227 void setVerbObject(uint room, uint
object, uint verb);
1230 bool isValidActor(
int id)
const;
1233 Actor *derefActor(
int id,
const char *errmsg = 0)
const;
1234 Actor *derefActorSafe(
int id,
const char *errmsg)
const;
1238 void playActorSounds();
1239 void redrawAllActors();
1240 void setActorRedrawFlags();
1243 void resetV1ActorTalkColor();
1244 void resetActorBgs();
1245 virtual void processActors();
1246 void processUpperActors();
1247 virtual int getActorFromPos(
int x,
int y);
1251 byte _actorToPrintStrFor = 0, _V1TalkingActor = 0;
1252 int _sentenceNum = 0;
1256 int16 _talkDelay = 0;
1257 int _NES_lastTalkingActor = 0;
1258 int _NES_talkColor = 0;
1260 virtual void actorTalk(
const byte *msg);
1262 int getTalkingActor();
1263 void setTalkingActor(
int variable);
1266 bool isCostumeInUse(
int i)
const;
1270 uint16 _screenB = 0, _screenH = 0;
1272 int _roomHeight = 0, _roomWidth = 0;
1273 int _screenHeight = 0, _screenWidth = 0;
1276 bool _cameraIsFrozen =
false;
1278 int _screenStartStrip = 0, _screenEndStrip = 0;
1290 bool _useMacScreenCorrectHeight =
true;
1291 int _screenDrawOffset = 0;
1294 uint8 _bytesPerPixel = 1;
1299 uint8 _colorUsedByCycle[256];
1302 uint32 _ENCD_offs = 0, _EXCD_offs = 0;
1303 uint32 _CLUT_offs = 0, _EPAL_offs = 0;
1304 uint32 _IM00_offs = 0, _PALS_offs = 0;
1307 bool _fullRedraw =
false, _bgNeedsRedraw =
false;
1308 bool _screenEffectFlag =
false, _completeScreenRedraw =
false;
1309 bool _disableFadeInEffect =
false;
1312 int hotspotX, hotspotY, width, height;
1313 byte animate, animateIndex;
1319 byte _grabbedCursor[16384];
1320 byte _currentCursor = 0;
1322 byte _newEffect = 0, _switchRoomEffect2 = 0, _switchRoomEffect = 0;
1323 bool _doEffect =
false;
1325 bool _snapScroll =
false;
1327 virtual void setBuiltinCursor(
int index) {}
1329 bool isLightOn()
const;
1331 virtual int getCurrentLights()
const;
1334 void initScreens(
int b,
int h);
1335 void initVirtScreen(
VirtScreenNumber slot,
int top,
int width,
int height,
bool twobufs,
bool scrollable);
1336 void initBGBuffers(
int height);
1337 void initCycl(
const byte *ptr);
1339 void decodeNESBaseTiles();
1341 void drawObject(
int obj,
int arg);
1342 void drawRoomObjects(
int arg);
1343 void drawRoomObject(
int i,
int arg);
1344 void drawBox(
int x,
int y,
int x2,
int y2,
int color);
1345 void drawLine(
int x1,
int y1,
int x2,
int y2,
int color);
1346 void drawPixel(
VirtScreen *vs,
int x,
int y, int16 color,
bool useBackbuffer =
false);
1348 void moveScreen(
int dx,
int dy,
int height);
1350 void restoreBackground(
Common::Rect rect, byte backcolor = 0);
1351 void redrawBGStrip(
int start,
int num);
1352 virtual void redrawBGAreas();
1355 void setCameraAtEx(
int at);
1356 virtual void setCameraAt(
int pos_x,
int pos_y);
1357 virtual void setCameraFollows(
Actor *a,
bool setCamera =
false);
1358 virtual void moveCamera();
1359 virtual void panCameraTo(
int x,
int y);
1361 void actorFollowCamera(
int act);
1363 const byte *getPalettePtr(
int palindex,
int room);
1365 void setPaletteFromTable(
const byte *ptr,
int numcolor,
int firstIndex = 0);
1366 void resetPalette();
1368 void setCurrentPalette(
int pal);
1369 void setRoomPalette(
int pal,
int room);
1370 void setPCEPaletteFromPtr(
const byte *ptr);
1371 void setAmigaPaletteFromPtr(
const byte *ptr);
1372 virtual void setPaletteFromPtr(
const byte *ptr,
int numcolor = -1);
1373 void setV1ColorTable(
int renderMode);
1375 virtual void setPalColor(
int index,
int r,
int g,
int b);
1376 void setDirtyColors(
int min,
int max);
1377 const byte *findPalInPals(
const byte *pal,
int index);
1378 void swapPalColors(
int a,
int b);
1379 virtual void copyPalColor(
int dst,
int src);
1380 void cyclePalette();
1381 void stopCycle(
int i);
1382 virtual void palManipulateInit(
int resID,
int start,
int end,
int time);
1383 void palManipulate();
1384 uint32 findClosestPaletteColor(byte *palette,
int paletteLength, byte r, byte g, byte b);
1387 uint8 *getHEPaletteSlot(uint16 palSlot);
1388 uint16 get16BitColor(uint8 r, uint8 g, uint8 b);
1389 uint32 getPaletteColorFromRGB(byte *palette, byte r, byte g, byte b);
1390 uint32 getPackedRGBColorFromPalette(byte *palette, uint32 color);
1391 void fetchBlackAndWhite(uint32 &black, uint32 &white, byte *palette,
int paletteEntries);
1392 int remapPaletteColor(
int r,
int g,
int b,
int threshold);
1393 void readPCEPalette(
const byte **ptr, byte **dest,
int numEntries);
1394 void colorPCEToRGB(uint16 color, byte *r, byte *g, byte *b);
1395 void setPCETextPalette(uint8 color);
1397 void moveMemInPalRes(
int start,
int end, byte direction);
1398 void setShadowPalette(
int slot,
int redScale,
int greenScale,
int blueScale,
int startColor,
int endColor);
1399 void setShadowPalette(
int redScale,
int greenScale,
int blueScale,
int startColor,
int endColor,
int start,
int end);
1400 virtual void darkenPalette(
int redScale,
int greenScale,
int blueScale,
int startColor,
int endColor);
1403 void markRectAsDirty(
VirtScreenNumber virt,
int left,
int right,
int top,
int bottom,
int dirtybit = 0);
1405 markRectAsDirty(virt, rect.
left, rect.
right, rect.top, rect.bottom, dirtybit);
1409 byte *_compositeBuf;
1410 byte *_hercCGAScaleBuf =
nullptr;
1411 bool _enableEGADithering =
false;
1412 bool _supportsEGADithering =
false;
1414 virtual void drawDirtyScreenParts();
1416 void drawStripToScreen(
VirtScreen *vs,
int x,
int width,
int top,
int bottom);
1418 void mac_markScreenAsDirty(
int x,
int y,
int w,
int h);
1419 void mac_drawStripToScreen(
VirtScreen *vs,
int top,
int x,
int y,
int width,
int height);
1420 void mac_drawIndy3TextBox();
1421 void mac_undrawIndy3TextBox();
1422 void mac_undrawIndy3CreditsText();
1423 Common::KeyState mac_showOldStyleBannerAndPause(
const char *msg, int32 waitTime);
1425 const byte *postProcessDOSGraphics(
VirtScreen *vs,
int &pitch,
int &x,
int &y,
int &width,
int &height)
const;
1426 const byte *ditherVGAtoEGA(
int &pitch,
int &x,
int &y,
int &width,
int &height)
const;
1430 byte *getMaskBuffer(
int x,
int y,
int z);
1433 void fadeIn(
int effect);
1434 void fadeOut(
int effect);
1436 void dissolveEffectSelector();
1437 void transitionEffect(
int a);
1438 void dissolveEffect(
int width,
int height);
1439 void scrollEffect(
int dir);
1441 void updateScreenShakeEffect();
1444 double getTimerFrequency();
1445 double getAmigaMusicTimerFrequency();
1448 bool _shakeEnabled =
false;
1449 bool _shakeTempSavedState =
false;
1450 uint _shakeFrame = 0;
1451 uint32 _shakeNextTick = 0;
1452 uint32 _shakeTickCounter = 0;
1453 double _shakeTimerRate;
1454 double _timerFrequency;
1456 void setShake(
int mode);
1458 int _drawObjectQueNr = 0;
1459 byte _drawObjectQue[200];
1472 uint32 gfxUsageBits[410 * 3];
1474 void upgradeGfxUsageBits();
1475 void setGfxUsageBit(
int strip,
int bit);
1476 void clearGfxUsageBit(
int strip,
int bit);
1479 bool testGfxUsageBit(
int strip,
int bit) {
1480 assert(strip >= 0 && strip <
ARRAYSIZE(gfxUsageBits) / 3);
1481 assert(1 <= bit && bit <= 96);
1483 return (gfxUsageBits[3 * strip + bit / 32] & (1 << (bit % 32))) != 0;
1486 bool testGfxAnyUsageBits(
int strip);
1487 bool testGfxOtherUsageBits(
int strip,
int bit);
1490 byte _roomPalette[256];
1491 byte *_shadowPalette =
nullptr;
1492 bool _skipDrawObject = 0;
1496 byte _HEV7ActorPalette[256];
1497 uint8 *_hePalettes =
nullptr;
1498 uint16 _hePaletteSlot = 0;
1499 uint16 *_16BitPalette =
nullptr;
1502 byte *_verbPalette =
nullptr;
1507 int _shadowPaletteSize = 0;
1508 byte _currentPalette[3 * 256];
1509 byte _darkenPalette[3 * 256];
1511 int _palDirtyMin = 0, _palDirtyMax = 0;
1513 byte _palManipStart = 0, _palManipEnd = 0;
1514 uint16 _palManipCounter = 0;
1515 byte *_palManipPalette =
nullptr;
1516 byte *_palManipIntermediatePal =
nullptr;
1518 bool _haveActorSpeechMsg =
false;
1519 bool _useTalkAnims =
false;
1520 uint16 _defaultTextSpeed = 0;
1522 bool _native_mt32 =
false;
1523 bool _copyProtection =
false;
1524 bool _shadowPalRemap =
false;
1527 uint16 _amigaFirstUsedColor = 0;
1528 byte _amigaPalette[3 * 64];
1529 void amigaPaletteFindFirstUsedColor();
1530 void mapRoomPalette(
int idx);
1531 int remapRoomPaletteColor(
int r,
int g,
int b);
1532 void mapVerbPalette(
int idx);
1533 int remapVerbPaletteColor(
int r,
int g,
int b);
1536 byte *_egaColorMap[2];
1539 uint16 _extraBoxFlags[65];
1542 byte *getBoxMatrixBaseAddr();
1543 byte *getBoxConnectionBase(
int box);
1545 int getNextBox(byte from, byte to);
1547 void setBoxFlags(
int box,
int val);
1548 void setBoxScale(
int box,
int b);
1550 bool checkXYInBoxBounds(
int box,
int x,
int y);
1552 BoxCoords getBoxCoordinates(
int boxnum);
1554 byte getMaskFromBox(
int box);
1555 Box *getBoxBaseAddr(
int box);
1556 byte getBoxFlags(
int box);
1557 int getBoxScale(
int box);
1559 int getScale(
int box,
int x,
int y);
1560 int getScaleFromSlot(
int slot,
int x,
int y);
1570 void setScaleSlot(
int slot,
int x1,
int y1,
int scale1,
int x2,
int y2,
int scale2);
1571 void setBoxScaleSlot(
int box,
int slot);
1572 void convertScaleTableToScaleSlot(
int slot);
1574 void calcItineraryMatrix(byte *itineraryMatrix,
int num);
1575 void createBoxMatrix();
1576 virtual bool areBoxesNeighbors(
int i,
int j);
1581 byte _charsetColorMap[16];
1588 int _textSurfaceMultiplier = 0;
1591 MacGui *_macGui =
nullptr;
1594 byte _charsetColor = 0;
1595 byte _charsetData[23][16];
1597 int _charsetBufPos = 0;
1598 byte _charsetBuffer[512];
1600 bool _keepText =
false;
1603 int _nextLeft = 0, _nextTop = 0;
1607 void restoreCharsetBg();
1608 void clearCharsetMask();
1609 void clearTextSurface();
1611 virtual void initCharset(
int charset);
1613 virtual void printString(
int m,
const byte *msg);
1615 virtual bool handleNextCharsetCode(
Actor *a,
int *c);
1616 virtual void drawSentence() {}
1617 virtual void CHARSET_1();
1619 void drawString(
int a,
const byte *msg);
1620 virtual void fakeBidiString(byte *ltext,
bool ignoreVerb,
int ltextSize)
const;
1621 void wrapSegaCDText();
1622 void debugMessage(
const byte *msg);
1623 virtual void showMessageDialog(
const byte *msg);
1625 virtual int convertMessageToString(
const byte *msg, byte *dst,
int dstSize);
1626 int convertIntMessage(byte *dst,
int dstSize,
int var);
1627 int convertVerbMessage(byte *dst,
int dstSize,
int var);
1628 int convertNameMessage(byte *dst,
int dstSize,
int var);
1629 int convertStringMessage(byte *dst,
int dstSize,
int var);
1635 virtual void translateText(
const byte *text, byte *trans_buff,
int transBufferSize);
1637 bool reverseIfNeeded(
const byte *text, byte *reverseBuf,
int reverseBufSize)
const;
1639 Common::CodePage getDialogCodePage()
const;
1642 bool _useCJKMode =
false;
1643 bool _useMultiFont =
false;
1644 int _numLoadedFont = 0;
1645 int _2byteShadow = 0;
1646 bool _force2ByteCharHeight =
false;
1648 int _2byteHeight = 0;
1649 int _2byteWidth = 0;
1651 byte _newLineCharacter = 0;
1652 byte *get2byteCharPtr(
int idx);
1654 bool isScummvmKorTarget();
1655 bool hasLocalizer();
1658 byte *_2byteFontPtr =
nullptr;
1659 byte *_2byteMultiFontPtr[20];
1660 int _2byteMultiHeight[20];
1661 int _2byteMultiWidth[20];
1662 int _2byteMultiShadow[20];
1665 struct TranslatedLine {
1666 uint32 originalTextOffset;
1667 uint32 translatedTextOffset;
1670 struct TranslationRange {
1674 TranslationRange(uint32 left_, uint32 right_) : left(left_), right(right_) {}
1675 TranslationRange() : left(0), right(0) {}
1678 struct TranslationRoom {
1682 bool _existLanguageFile =
false;
1683 bool _isRTL =
false;
1684 byte *_languageBuffer =
nullptr;
1685 int _numTranslatedLines = 0;
1686 TranslatedLine *_translatedLines =
nullptr;
1687 uint16 *_languageLineIndex =
nullptr;
1690 const byte *searchTranslatedLine(
const byte *text,
const TranslationRange &range,
bool useIndex);
1692 virtual void createTextRenderer(GlyphRenderer_v7 *gr) {}
1697 byte VAR_KEYPRESS = 0xFF;
1698 byte VAR_SYNC = 0xFF;
1699 byte VAR_EGO = 0xFF;
1700 byte VAR_CAMERA_POS_X = 0xFF;
1701 byte VAR_HAVE_MSG = 0xFF;
1702 byte VAR_ROOM = 0xFF;
1703 byte VAR_OVERRIDE = 0xFF;
1704 byte VAR_MACHINE_SPEED = 0xFF;
1706 byte VAR_NUM_ACTOR = 0xFF;
1707 byte VAR_CURRENT_LIGHTS = 0xFF;
1708 byte VAR_CURRENTDRIVE = 0xFF;
1709 byte VAR_CURRENTDISK = 0xFF;
1710 byte VAR_TMR_1 = 0xFF;
1711 byte VAR_TMR_2 = 0xFF;
1712 byte VAR_TMR_3 = 0xFF;
1713 byte VAR_MUSIC_TIMER = 0xFF;
1714 byte VAR_ACTOR_RANGE_MIN = 0xFF;
1715 byte VAR_ACTOR_RANGE_MAX = 0xFF;
1716 byte VAR_CAMERA_MIN_X = 0xFF;
1717 byte VAR_CAMERA_MAX_X = 0xFF;
1718 byte VAR_TIMER_NEXT = 0xFF;
1719 byte VAR_VIRT_MOUSE_X = 0xFF;
1720 byte VAR_VIRT_MOUSE_Y = 0xFF;
1721 byte VAR_ROOM_RESOURCE = 0xFF;
1722 byte VAR_LAST_SOUND = 0xFF;
1723 byte VAR_CUTSCENEEXIT_KEY = 0xFF;
1724 byte VAR_OPTIONS_KEY = 0xFF;
1725 byte VAR_TALK_ACTOR = 0xFF;
1726 byte VAR_CAMERA_FAST_X = 0xFF;
1727 byte VAR_SCROLL_SCRIPT = 0xFF;
1728 byte VAR_ENTRY_SCRIPT = 0xFF;
1729 byte VAR_ENTRY_SCRIPT2 = 0xFF;
1730 byte VAR_EXIT_SCRIPT = 0xFF;
1731 byte VAR_EXIT_SCRIPT2 = 0xFF;
1732 byte VAR_VERB_SCRIPT = 0xFF;
1733 byte VAR_SENTENCE_SCRIPT = 0xFF;
1734 byte VAR_INVENTORY_SCRIPT = 0xFF;
1735 byte VAR_CUTSCENE_START_SCRIPT = 0xFF;
1736 byte VAR_CUTSCENE_END_SCRIPT = 0xFF;
1737 byte VAR_CHARINC = 0xFF;
1738 byte VAR_WALKTO_OBJ = 0xFF;
1739 byte VAR_DEBUGMODE = 0xFF;
1740 byte VAR_HEAPSPACE = 0xFF;
1741 byte VAR_RESTART_KEY = 0xFF;
1742 byte VAR_PAUSE_KEY = 0xFF;
1743 byte VAR_MOUSE_X = 0xFF;
1744 byte VAR_MOUSE_Y = 0xFF;
1745 byte VAR_TIMER = 0xFF;
1746 byte VAR_TIMER_TOTAL = 0xFF;
1747 byte VAR_SOUNDCARD = 0xFF;
1748 byte VAR_VIDEOMODE = 0xFF;
1749 byte VAR_MAINMENU_KEY = 0xFF;
1750 byte VAR_FIXEDDISK = 0xFF;
1751 byte VAR_CURSORSTATE = 0xFF;
1752 byte VAR_USERPUT = 0xFF;
1753 byte VAR_SOUNDRESULT = 0xFF;
1754 byte VAR_TALKSTOP_KEY = 0xFF;
1755 byte VAR_FADE_DELAY = 0xFF;
1756 byte VAR_NOSUBTITLES = 0xFF;
1759 byte VAR_SOUNDPARAM = 0xFF;
1760 byte VAR_SOUNDPARAM2 = 0xFF;
1761 byte VAR_SOUNDPARAM3 = 0xFF;
1762 byte VAR_INPUTMODE = 0xFF;
1763 byte VAR_MEMORY_PERFORMANCE = 0xFF;
1764 byte VAR_VIDEO_PERFORMANCE = 0xFF;
1765 byte VAR_ROOM_FLAG = 0xFF;
1766 byte VAR_GAME_LOADED = 0xFF;
1767 byte VAR_NEW_ROOM = 0xFF;
1770 byte VAR_V5_TALK_STRING_Y = 0xFF;
1773 byte VAR_ROOM_WIDTH = 0xFF;
1774 byte VAR_ROOM_HEIGHT = 0xFF;
1775 byte VAR_SUBTITLES = 0xFF;
1776 byte VAR_V6_EMSSPACE = 0xFF;
1779 byte VAR_CAMERA_POS_Y = 0xFF;
1780 byte VAR_CAMERA_MIN_Y = 0xFF;
1781 byte VAR_CAMERA_MAX_Y = 0xFF;
1782 byte VAR_CAMERA_THRESHOLD_X = 0xFF;
1783 byte VAR_CAMERA_THRESHOLD_Y = 0xFF;
1784 byte VAR_CAMERA_SPEED_X = 0xFF;
1785 byte VAR_CAMERA_SPEED_Y = 0xFF;
1786 byte VAR_CAMERA_ACCEL_X = 0xFF;
1787 byte VAR_CAMERA_ACCEL_Y = 0xFF;
1788 byte VAR_CAMERA_DEST_X = 0xFF;
1789 byte VAR_CAMERA_DEST_Y = 0xFF;
1790 byte VAR_CAMERA_FOLLOWED_ACTOR = 0xFF;
1793 byte VAR_VERSION_KEY = 0xFF;
1794 byte VAR_DEFAULT_TALK_DELAY = 0xFF;
1795 byte VAR_CUSTOMSCALETABLE = 0xFF;
1796 byte VAR_BLAST_ABOVE_TEXT = 0xFF;
1797 byte VAR_VOICE_MODE = 0xFF;
1798 byte VAR_MUSIC_BUNDLE_LOADED = 0xFF;
1799 byte VAR_VOICE_BUNDLE_LOADED = 0xFF;
1801 byte VAR_LEFTBTN_DOWN = 0xFF;
1802 byte VAR_RIGHTBTN_DOWN = 0xFF;
1803 byte VAR_LEFTBTN_HOLD = 0xFF;
1804 byte VAR_RIGHTBTN_HOLD = 0xFF;
1805 byte VAR_PRE_SAVELOAD_SCRIPT = 0xFF;
1806 byte VAR_POST_SAVELOAD_SCRIPT = 0xFF;
1807 byte VAR_SAVELOAD_PAGE = 0xFF;
1808 byte VAR_OBJECT_LABEL_FLAG = 0xFF;
1811 byte VAR_CHARSET_MASK = 0xFF;
1814 byte VAR_V6_SOUNDMODE = 0xFF;
1817 byte VAR_CHARCOUNT = 0xFF;
1818 byte VAR_VERB_ALLOWED = 0xFF;
1819 byte VAR_ACTIVE_VERB = 0xFF;
1820 byte VAR_ACTIVE_OBJECT1 = 0xFF;
1821 byte VAR_ACTIVE_OBJECT2 = 0xFF;
1824 byte VAR_REDRAW_ALL_ACTORS = 0xFF;
1825 byte VAR_SKIP_RESET_TALK_ACTOR = 0xFF;
1827 byte VAR_SOUND_CHANNEL = 0xFF;
1828 byte VAR_TALK_CHANNEL = 0xFF;
1829 byte VAR_SOUND_TOKEN_OFFSET = 0xFF;
1830 byte VAR_START_DYN_SOUND_CHANNELS = 0xFF;
1831 byte VAR_SOUND_CALLBACK_SCRIPT = 0xFF;
1833 byte VAR_EARLY_TALKIE_CALLBACK = 0xFF;
1834 byte VAR_EARLY_CHAN_0_CALLBACK = 0xFF;
1835 byte VAR_EARLY_CHAN_1_CALLBACK = 0xFF;
1836 byte VAR_EARLY_CHAN_2_CALLBACK = 0xFF;
1837 byte VAR_EARLY_CHAN_3_CALLBACK = 0xFF;
1839 byte VAR_MAIN_SCRIPT = 0xFF;
1841 byte VAR_DEFAULT_SCRIPT_PRIORITY = 0xFF;
1842 byte VAR_LAST_SCRIPT_PRIORITY = 0xFF;
1844 byte VAR_QUIT_SCRIPT = 0xFF;
1845 byte VAR_ERROR_FLAG = 0xFF;
1846 byte VAR_OPERATION_FAILURE = 0xFF;
1849 byte VAR_NUM_GLOBAL_OBJS = 0xFF;
1851 #ifdef USE_RGB_COLOR 1853 Graphics::FontSJIS *_cjkFont =
nullptr;
1857 #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE 1859 bool towns_isRectInStringBox(
int x1,
int y1,
int x2,
int y2);
1860 byte _townsPaletteFlags = 0;
1861 byte _townsCharsetColorMap[16];
1864 void towns_drawStripToScreen(
VirtScreen *vs,
int dstX,
int dstY,
int srcX,
int srcY,
int w,
int h);
1865 void towns_clearStrip(
int strip);
1866 #ifdef USE_RGB_COLOR 1867 void towns_setPaletteFromPtr(
const byte *ptr,
int numcolor = -1);
1868 void towns_setTextPaletteFromPtr(
const byte *ptr);
1870 void towns_setupPalCycleField(
int x1,
int y1,
int x2,
int y2);
1871 void towns_processPalCycleField();
1872 void towns_resetPalCycleFields();
1873 void towns_restoreCharsetBg();
1874 void towns_scriptScrollEffect(
int dir);
1876 void requestScroll(
int dir);
1877 void scrollLeft() { requestScroll(-1); }
1878 void scrollRight() { requestScroll(1); }
1879 void towns_waitForScroll(
int waitForDirection,
int threshold = 0);
1880 void towns_updateGfx();
1883 int _numCyclRects = 0;
1884 int _scrollRequest = 0;
1885 int _scrollDeltaAdjust = 0;
1886 bool _scrollNeedDeltaAdjust = 0;
1887 int _refreshDuration[20];
1888 int _refreshArrayPos = 0;
1889 bool _refreshNeedCatchUp =
false;
1890 bool _enableSmoothScrolling =
false;
1891 uint32 _scrollTimer = 0;
1892 uint32 _scrollDestOffset = 0;
1893 uint16 _scrollFeedStrips[3];
1897 byte _townsOverrideShadowColor = 0;
1898 byte _textPalette[48];
1899 byte _townsClearLayerFlag = 1;
1900 byte _townsActiveLayerFlags = 3;
1901 static const uint8 _townsLayer2Mask[];
1905 void scrollLeft() { redrawBGStrip(_gdi->_numStrips - 1, 1); }
1906 void scrollRight() { redrawBGStrip(0, 1); }
1907 void towns_updateGfx() {}
1908 void towns_waitForScroll(
int waitForDirection,
int threshold = 0) {}
1909 #endif // DISABLE_TOWNS_DUAL_LAYER_MODE #define ARRAYSIZE(x)
Definition: util.h:91
Definition: macgui_impl.h:47
VirtScreenNumber
Definition: gfx.h:161
EngineFeature
Definition: engine.h:250
ErrorCode getCode() const
Definition: error.h:115
Definition: detection.h:264
int16 right
Definition: rect.h:146
Definition: palette.h:141
RenderMode
Definition: rendermode.h:48
No error occurred.
Definition: error.h:48
Common::Path _containerFile
Definition: scumm.h:1062
Definition: resource.h:75
ResType
Definition: scumm.h:256
Definition: macgui_indy3.h:35
Definition: serializer.h:79
Graphics::Surface _textSurface
Definition: scumm.h:1587
int FORCEINLINE GCC_PRINTF(2, 0) int vsprintf_s(T(&dst)[N]
Definition: detection.h:191
Definition: player_towns.h:32
Definition: debugger.h:33
Definition: algorithm.h:29
Definition: formatinfo.h:28
int16 left
Definition: rect.h:145
Definition: serializer.h:308
Definition: charset.h:155
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
Common::Error run() override
Definition: scumm.h:577
Common::RandomSource _rnd
Definition: scumm.h:546
Definition: macgui_loom.h:33
void void void void void debugC(int level, uint32 debugChannels, MSVC_PRINTF const char *s,...) GCC_PRINTF(3
Definition: base-costume.h:49
Definition: detection.h:278
Language
Definition: language.h:45