25#include "audio/mixer.h"
26#include "common/archive.h"
27#include "common/array.h"
28#include "common/events.h"
30#include "common/rect.h"
31#include "common/str-enc.h"
32#include "common/ustr.h"
33#include "engines/engine.h"
34#include "harold/bcb/ui.h"
35#include "harold/detection.h"
88 bool initializeSearchPaths();
89 bool showInitialLogoScreen();
90 bool showTitleScreen();
91 bool transitionFromLogoToTitle();
92 bool startNewGameFromTitle();
93 bool playNumberedMovie(
int movieId,
bool blankScreenMovie =
false);
95 bool switchActiveMediaDisc(
int discNumber);
96 void stopActiveMovie();
98 void startMenuBackgroundMusic();
99 void updateMenuBackgroundMusic();
100 void stopMenuBackgroundMusic();
101 void startGameOverMusic();
102 void stopGameOverMusic();
103 void startSceneIdleMovie();
104 void stopSceneIdleMovie();
105 void enterSystemMenu();
106 bool showSystemScreen();
107 void restoreTitleScreenRegion(
const Common::Rect &rect,
bool present =
true);
108 void drawSystemSaveLoadSlots(
bool present =
true);
109 void drawSystemSubmodeButtons(
bool present =
true);
110 void drawSystemSubmodeButton(uint buttonIndex,
bool selected,
bool present =
true);
111 void drawSystemWaveVolumeIndicator(
bool present =
true);
112 void syncSystemWaveVolumeFromMixer();
113 void applySystemWaveVolume();
114 bool handleSystemWaveVolumeClick(
const Common::Point &mousePosition);
116 void activateSystemExitButton();
117 bool readSaveSlotHeader(
int slot,
int &savedDay,
int &savedClockTicks);
118 bool isSaveSlotOccupied(
int slot);
119 void writeContinueState();
120 bool showSystemConfirmationDialog(
const Common::U32String &message,
bool showCancelButton);
121 void returnFromSystemMenuToPreviousState();
122 bool handleSaveLoadSlotClick(
const Common::Point &mousePosition);
123 bool openMapMoveMovie();
124 void startMapMoveMovie();
125 void stopMapMoveMovie();
126 void resetGameState();
127 void resetTransientRuntimeStateAfterLoad();
128 bool loadScriptData();
129 bool loadExecutableDataTables();
131 void processGameStateDispatcher(
bool runScriptBeforeDispatch);
132 bool dispatchGameStateControlCode(uint32 dispatcherControlCode);
133 bool dispatchGameStateNoOp();
134 bool dispatchSceneChoiceControls();
135 bool dispatchMapMoveControls();
136 bool dispatchComputerMainControls();
137 bool dispatchComputerDetailControls();
138 bool dispatchGameOverScreen();
139 bool dispatchEndingStillDisplayState();
141 bool showComputerScreen();
142 void drawComputerChoiceGroupControls();
143 void drawComputerConditionalChoiceControls(
const ButtonControlRecord *choiceButtonRecords,
int firstStateIndex,
int stateCount);
145 void drawComputerButtonPressed(
const ButtonControlRecord &button,
int sourceX,
int sourceY);
149 void processXorRectangleBorderAnimation(
bool expand,
const Common::Rect &sourceRect,
const Common::Rect &targetRect);
150 bool showComputerDetailScreen(
int compositeIndex);
151 void checkCurrentMediaPathReady();
152 void clearDisplayAndResetState();
153 void executeCurrentScriptSequence();
154 uint32 executeScriptExpression(uint32 &scriptPc,
int &branchTokenSeen);
155 bool pushScriptValue(uint32 value);
156 uint32 popScriptValue();
157 void popScriptOperands(uint32 &leftValue, uint32 &rightValue);
158 uint32 dereferenceScriptValue(uint32 value);
159 uint32 &scriptOperandDword(uint32 encodedOperand);
160 uint32 &stateDword(uint byteOffset);
161 uint32 stateDword(uint byteOffset)
const;
162 bool processPendingMovieRequest();
163 void loadTimedCaptionRecord(
int movieId);
164 void loadNextTimedCaptionText();
166 const byte *findAllBinRecordData(
const Common::String &recordName, uint32 &recordSize)
const;
167 bool drawTimedVideoTextOverlay();
168 void restoreActiveCaptionBackingRect();
171 void restoreCaptionBackingRect(
const Common::Rect &rect);
173 bool shouldDrawMovieControlStrip()
const;
174 void drawMapSubmodeMovieBackdrop(
bool present =
true);
175 void drawSceneChoiceControlStrip(
int sourceX = 0,
bool present =
true);
176 void drawMovieControlStrip(
int sourceX = 0,
bool present =
true);
177 void stopActiveMovieAndDispatch();
178 void processQueuedMovieSequence();
179 bool isMapButtonEnabled(uint buttonIndex)
const;
180 void drawMapButtonPressed(uint buttonIndex,
bool present =
true);
182 void drawMapControls(
bool present =
true);
183 bool handleMapControlClick(
const Common::Point &mousePosition);
184 bool showPendingStillImageScreen();
185 void completePendingStillImageScreen();
186 bool showMainSceneScreen();
187 bool drawMainSceneScreen(
bool lineReveal);
188 bool showMapScreen();
189 bool showActiveSceneChoiceControls();
190 void captureSceneChoiceBacking();
191 void restoreSceneChoiceBacking(
bool present =
true);
192 void freeSceneChoiceBacking();
193 void clearSceneChoiceAfterSelection();
194 bool isSceneChoiceButtonVisible(
int buttonIndex)
const;
195 void drawSceneChoiceButtons(
int sceneChoiceUiSetToShowId,
bool present =
true,
int pressedButtonIndex = -1);
196 void handleSceneChoiceClick(
const Common::Point &mousePosition);
197 void handleSceneChoiceSelection(
int buttonIndex);
198 bool handleComputerClick(
const Common::Point &mousePosition);
199 bool handleComputerKey(Common::KeyCode keycode);
200 void applyPendingClockTickDelta();
201 void notifyGameClockTicksChanged();
202 void drawClockAndChipIndicator(
bool present =
true);
203 void drawAnalogClockAndChip(
int baseHourOffset,
int gameClockTicks,
bool present =
true);
204 void renderClockAndChipToSurface(
Graphics::Surface &surface,
int baseHourOffset,
int gameClockTicks);
214 void blitScreenWithLineReveal(
const Graphics::Surface &surface,
bool presentFinalFrame =
true);
215 void drawTitleButton(uint buttonIndex,
bool pressed);
216 void handleLeftButtonDown(
const Common::Point &mousePosition);
218 bool handleEscapeAction();
219 void handleSkipKey();
220 void handleSceneChoiceKeyboardSelection(
int choiceNumber);
221 bool parseCheatNumber(
const Common::String &text, uint32 &value)
const;
222 void addCheatTime(
int minutes);
223 void jumpToCheatSequence(uint sequenceId);
225 bool pollEvents(
bool handleClicks);
226 void serviceCursorRefresh(
bool screenUpdated =
false);
227 void delayWithEventPolling(uint32 millis);
228 void delayWithEventPolling(uint32 millis,
bool handleClicks);
244 Common::CodePage _executableTextEncoding = Common::kWindows932;
258 Graphics::FontSJIS *_sjisFont =
nullptr;
276 uint32 _gameState[0x100] = {};
277 uint32 _scriptValueStack[0x100] = {};
278 int _scriptStackDepth = 0;
279 bool _scriptStopFlag =
false;
280 int _currentDisplayState = 0;
281 int _initialLogoElapsedTimerTicks = 0;
282 int _pendingStillElapsedTimerTicks = 0;
283 int _gameOverElapsedTimerTicks = 0;
284 int _pendingStillDurationIndex = 0;
285 int _pendingClockTickDelta = 0;
286 int _sceneIdleMovieTimerTicks = 0;
287 int _activeMediaDiscNumber = 1;
288 uint _timedCaptionCursorOffset = 0;
289 int _nextTimedCaptionThreshold = 99999;
290 int _queuedMoviePlaybackIndex = 0;
291 int _previousDisplayStateBeforeSystem = 0;
292 int _computerChoiceGroupIndex = 0;
293 int _computerDetailVariantIndex = 0;
294 int _sceneChoiceTerminatorButtonIndex = 0;
295 int _sceneChoiceEnabledButtonLimit = 0;
296 bool _computerControlsActive =
false;
297 bool _computerDetailControlsActive =
false;
298 bool _computerDetailNextVariantEnabled =
false;
305 uint32 _lastTimerTick = 0;
306 int _lastLoggedGameClockTicks = -1;
307 uint32 _lastCursorRefreshMillis = 0;
309 bool _activeMovieDispatchOnFinish =
false;
310 bool _activeMovieOnBlankScreen =
false;
311 bool _activeMoviePaused =
false;
312 bool _sceneChoiceActive =
false;
313 bool _mapControlsActive =
false;
314 bool _suppressClickHandling =
false;
315 bool _titleButtonsActive =
false;
316 bool _systemButtonsVisible =
false;
317 int _systemSaveLoadSlotActionMode = 0;
318 int _systemWaveVolume = 0xffff;
319 bool _titleLoadSlotsActive =
false;
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Common::Error loadGameState(int slot) override
Common::Error run() override
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
bool canSaveAutosaveCurrently() override
bool hasFeature(EngineFeature f) const override
Definition: debugger.h:31
Definition: archive.h:330
EngineFeature
Definition: engine.h:282
Definition: avi_decoder.h:65
uint32 CustomEventType
Definition: events.h:212
Definition: formatinfo.h:28
Definition: detection.h:33
Definition: atari-screen.h:58