25#include "common/rect.h"
26#include "common/str.h"
27#include "common/ustr.h"
28#include "graphics/mactoolbox/toolbox.h"
43using Graphics::MacToolbox::OSErr;
44using Graphics::MacToolbox::OSType;
46using Graphics::MacToolbox::PatternMode;
51using Graphics::MacToolbox::SourceMode;
55enum FoolStateBits : uint16 {
59 kStateSaveGame = 0x04,
61 kStateOpenGame = 0x10,
63 kStateChapterSelect = 0x40,
64 kStatePuzzleSelect = 0x80,
65 kStateMetapuzzleSelect = 0x100,
66 kStatePrintStory = 0x400,
67 kStateMetapuzzleComplete = 0x800,
70enum FoolPuzzleFlags : uint16 {
71 kFlagMenuDisabled = 0x00,
72 kFlagMenuEnabled = 0x01,
73 kFlagMenuDiamond = 0x02,
77enum FoolZStrOffset : uint16 {
95 kOffsetPrologueMemory,
97 kOffsetDemoInstructions,
98 kOffsetDemoPuzzleComplete,
101enum FoolFontID : uint16 {
111 FoolGame(FoolVersion version,
const Common::String &saveFileName): _version(version), _startSaveFileName(saveFileName) {}
117 void copyScreen(int16 put, BitMap &bmp);
120 void getGridFromMouse(int16 &gridX, int16 &gridY);
121 void sub_128_342(int16 unk2, int16 unk1);
122 void delay(int16 numTicks);
123 void delayFromMarker(int16 numTicks);
124 int16 puzzlesReadByte();
125 int16 puzzlesReadShort();
126 int32 puzzlesReadLong();
128 void toggleMouseCursor(
bool visible);
129 void playTone(int16 freq, int16 duration,
bool wait);
131 int16 getVolRefNum();
132 OSErr setVolRefNum(int16 volRefNum);
133 void fillRect(int16 patternID, PatternMode mode, int16 top, int16 left, int16 bottom, int16 right);
134 void drawTarotCard(int16 rectID, int16 deckPos, int16 type);
135 void fillRect(int16 top, int16 left, int16 bottom, int16 right, int16 patternID);
137 void zoomRect(int16 startTop, int16 startLeft, int16 startBottom, int16 startRight, int16 endTop, int16 endLeft, int16 endBottom, int16 endRight, int16 patternID, PatternMode mode, int16 steps);
138 void screenZap(int16 unk6, int16 unk5, int16 unk4, int16 unk3, int16 unk2, int16 unk1);
139 void getNextEvent(int32 mask);
140 void flashRect(int16 top, int16 left, int16 bottom, int16 right, int16 millis);
141 void showChoiceModal(uint16 font, int16 lineCount, int16 buttonCount,
bool beep,
bool dark);
144 void setStateBits(uint16 bits);
145 void clearStateBits(uint16 bits);
152 void menuChapterSelect();
154 void storyRenderPage();
155 void menuClickMessage();
157 void fetchPuzzleData();
159 void writeSaveFile();
163 void menuSaveGameAs();
165 void menuPrintStory();
171 void menuToggleSound();
177 void cursorExplodingWatch();
178 void cursorExplodingWatchShort();
181 void storyUnlockChapter();
182 void puzzleSetupMenu();
184 void puzzleLoadContext();
185 void puzzleSaveContext();
187 void storyDrawZoom();
201 void thothHidePlayfield();
202 void thothShowPlayfield();
204 void onUpdateEvent();
207 void waitForMouseUp();
214 void menuLoadingMessage(int16 percent);
216 void menuDemoAbout();
217 void menuDemoInstructions();
218 void demoPuzzleComplete();
223 void jumbleStoreState();
224 void jumbleRunRearrange();
225 void jumbleRunSubstitution();
227 void jumbleRunWordSquare();
228 void jumbleRunHiddenMessage();
230 void jumbleOnClick();
234 void jumbleClickFixedSquare();
237 void jumbleSelectSquare();
239 void jumbleDrawLetter();
243 void jumbleNextPosition();
244 void jumblePreviousPosition();
249 void jumbleDrawHint();
250 void jumbleDrawHintBoat();
251 void jumbleDrawHintBlacksmith();
252 void jumbleDrawHintSentry();
253 void jumbleDrawHintMetapuzzle();
258 void wordSearchRun();
259 void wordSearchOnClick();
260 void wordSearchBadSelect();
261 void wordSearchDrawFooter();
262 void wordSearchStoreState();
263 void wordSearchSuccess();
267 void jigsawOnClick();
268 void jigsawDragSelect();
269 void jigsawMoveSelected();
270 void jigsawCancelSelect();
271 void jigsawDropSelected();
272 void jigsawStoreState();
273 void jigsawCheckIfSolved();
274 void jigsawSuccess();
278 void polyominoOnClick();
279 void polyominoCancelMove();
280 void polyominoMove(int16 x, int16 y);
281 void polyominoOnClickFixed();
282 void polyominoReset();
283 void polyominoDrawFrame();
284 void polyominoCheckIfSolved();
285 void polyominoSuccess();
286 void polyominoStoreState();
290 void revealOnClick();
291 void revealSelectButton();
293 void revealSuccess();
297 void sentenceOnClick();
298 void sentenceAddLeft(int16 index);
299 void sentenceAddRight(int16 index);
300 void sentenceAddLeftRight(int16 index);
301 void sentenceReplace(int16 index);
302 void sentenceReverse();
304 void sentenceDrawButton(int16 gridIndex);
305 void sentenceDrawBuffer();
306 void sentenceStoreState();
307 void sentenceSuccess();
312 void mazeFlashWall();
313 void mazeMovePlayer();
316 void mazePrintMessage();
317 void mazePickUpItem();
319 void mazeWanderingWinds();
320 void mazeDrawLetter();
324 void mazeHiddenDoorOpen();
325 void mazeHiddenDoorShut();
327 void mazeSetTrigger();
328 void mazeClearTrigger();
329 void mazePickUpTone();
330 void mazeFireDemon();
332 void mazeNoisySprite();
334 void mazeYeetObject();
335 void mazeThornsGetScroll();
336 void mazeWaitForMouseUp();
337 void mazeClearText();
338 void mazeMovementTrail();
340 void mazeLoadTone(int16 offset);
344 void mazeDrawPlayer();
345 void mazeSetupMenu();
346 void mazeAddWallLeft();
347 void mazeAddWallTop();
348 void mazeAddWallRight();
349 void mazeAddWallBottom();
350 void mazeDrawWallLeft();
351 void mazeDrawWallTop();
352 void mazeDrawWallRight();
353 void mazeDrawWallBottom();
354 void mazeStoreState();
357 void mazeLoadState();
363 void sunMapOnClick();
364 void sunMapDragSelect();
365 void sunMapMoveSelected();
366 void sunMapUndoMove();
367 void sunMapDropSelected();
368 void sunMapCheckIfSolved();
369 void sunMapRevealPiece();
372 void metapuzzleRun();
373 void metapuzzleOnClick();
375 void metapuzzleSetupMenu();
376 void metapuzzleWheel();
377 void metapuzzleSecretCode();
378 void metapuzzleSecretCodeDrawText();
381 void metapuzzleSecretCodeReset();
383 void metapuzzleOnOption();
384 void metapuzzleOnShift();
390 void cardsShuffleDeck();
391 void cardsDrawTable();
394 void cardsOpponentYields();
395 void cardsRevealHands();
399 void cardsDrawScores();
400 void cardsStoreState();
404 void highPriestessRun();
405 void thoth99Enchantments();
406 void thothMoveEnchantment();
407 void thothDrawEnchantment();
409 void thothScrambleScreen();
416 void thothKey3rdOnClick();
420 void thothKeyLastOnClick();
421 void thothBadSelect();
422 void hermitNextStage();
423 void hermitScreenFlash();
424 void hermitScreenZoom();
425 void hermitScreenBehold();
428 void thothKeyLastSetup();
429 void thothSetupMenu();
435 void thothAdjustPuzzleData();
440 void deathMoveBlackEye();
441 void deathDrawWhiteEye();
443 void deathDrawZoom();
447 void humbugPlayTrail();
448 void humbugMoveMouse();
449 void humbugSuccess();
450 void humbugShowThoth();
455 void justiceOnClick();
457 void justiceDrawBlock(int16 gridIndex);
458 void justiceRemoveBlock(int16 gridIndex);
459 void justiceStoreState();
460 void justiceResetGrid();
466 void straightPathRun();
467 void straightPathOnClick();
468 void straightPathReset();
469 void straightPathDrawText();
470 void straightPathClearText();
471 void straightPathSuccess();
473 void metapuzzleComplete();
477 FoolVersion _version;
481 const int *_zstrOffset;
490 GrafPtr var_i32_8_thoth;
509 bool _screenOversized;
523 uint32 _puzzleDataPtr;
524 Handle _puzzleDataBuffer;
538 int16 _savePromptChoice;
540 int16 _keyLastPressed;
541 PicHandle var_pic_7c2;
546 int16 _storyCurrentChapter;
547 int16 _sunMapRestored;
548 int16 _storyCurrentPage;
550 int16 _storyNextPage;
551 int16 _storyPageCount;
552 int16 _selectedMenuChapter;
571 int16 _activePuzzleStatus;
576 bool _activePuzzleSolved;
581 bool _menuHidesPlayfield;
582 int16 _selectedMenuID;
583 int16 _selectedMenuItem;
596 PicHandle _metapuzzleWheelPic;
602 int16 _jumbleSubPuzzleCount;
603 int16 _jumbleCurrentSubPuzzle;
608 int16 _polyominoPosX;
609 int16 _polyominoPosY;
610 int16 _jumbleGameType;
612 SourceMode var_i16_106c;
614 int16 _jumblePosition;
628 int16 _straightPathSelected;
629 int16 _jumbleSelected;
663 int16 _jigsawPieceCount;
665 int16 _metapuzzleSecretCodeSpaceOffset;
679 PicHandle var_i32_1ac0;
688 int16 _mazePlayerDirection;
711 PatternMode var_i16_1dee;
712 SourceMode var_src_1dee;
723 int16 mazeToneFreqStep;
732 int16 _metapuzzleSecretCodeCount;
748 int16 _hermitPathStage;
752 Handle var_bytes_232a;
759 bool _deathWhiteEyeNeedsDraw;
760 int16 _justiceFirstMove;
761 int16 _humbugTrailIndex;
764 int16 _pageLineRanges[202];
765 int16 _pageLineFace[1301];
766 int16 _pageLineBreak[1301];
767 int16 arr_i16_15e8[101];
768 int16 arr_i16_16b2[0x100];
769 int16 _puzzleType[101];
770 int16 _puzzleUnlockChapter[101];
771 int16 _pageToChapter[101];
772 int16 _puzzleMenuInstructions[0x40];
773 int16 _pageVisible[101];
774 int16 _puzzleCompletionStatus[101];
775 uint16 _puzzleFlags[101];
776 int16 _pageLines[202];
777 int16 arr_i16_1eb8[0x29];
781 int16 arr_i16_2f38[0x400];
782 int16 arr_i16_3738[0x200];
783 int16 arr_i16_3b38[0x400];
786 int16 arr_i16_4338[0x200];
788 int16 arr_i16_4758[15];
790 int16 arr_i16_47d8[0x100];
791 PicHandle _polyominoPics[0x80];
792 int16 _sunMapTileID[0x52];
793 int16 arr_i16_4c7c[0x52];
794 int16 arr_i16_4d20[52];
797 int16 arr_i16_5bbc[128];
798 int16 arr_i16_5cbc[128];
799 int16 _mazeInvItemCount[128];
800 float arr_bcd_5dbc[8];
802 BitMap _jigsawPieces[128];
808 Handle arr_bytes_109dc;
809 BitMap arr_bmp_109dc;
810 BitMap arr_bmp_138bc;
818 PicHandle _sunMapTilePic[0x54];
819 PicHandle arr_i32_192c0[101];
820 PolyHandle _revealPoly[101];
821 int32 _puzzleDataOffsets[101];
830 int16 _demoChapters[101];
Definition: fool_game.h:109