diff options
author | Robert Göffringmann | 2003-07-17 00:17:42 +0000 |
---|---|---|
committer | Robert Göffringmann | 2003-07-17 00:17:42 +0000 |
commit | 301f1cdf08bdfb393a945d9c268ed23f78f84f6b (patch) | |
tree | 38893c1b566fa9f21a49fe293171373d39f0d679 /sky | |
parent | 0c21927428457859730d7f3cca0d313a048d9603 (diff) | |
download | scummvm-rg350-301f1cdf08bdfb393a945d9c268ed23f78f84f6b.tar.gz scummvm-rg350-301f1cdf08bdfb393a945d9c268ed23f78f84f6b.tar.bz2 scummvm-rg350-301f1cdf08bdfb393a945d9c268ed23f78f84f6b.zip |
reprogrammed sky intros.
svn-id: r9053
Diffstat (limited to 'sky')
-rw-r--r-- | sky/cd_intro.cpp | 798 | ||||
-rw-r--r-- | sky/intro.cpp | 1302 | ||||
-rw-r--r-- | sky/intro.h | 61 | ||||
-rw-r--r-- | sky/module.mk | 1 | ||||
-rw-r--r-- | sky/sky.cpp | 23 | ||||
-rw-r--r-- | sky/sky.h | 25 |
6 files changed, 919 insertions, 1291 deletions
diff --git a/sky/cd_intro.cpp b/sky/cd_intro.cpp deleted file mode 100644 index cab9422e72..0000000000 --- a/sky/cd_intro.cpp +++ /dev/null @@ -1,798 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2003 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Header$ - * - */ - -#include "stdafx.h" -#include "sky/sky.h" -#include "sky/skydefs.h" - -//CD intro file defines -#define cdv_00 59500 -#define cd_pal 59501 -#define cd_1_log 59502 -#define cd_1 59503 -#define cdv_01 59504 -#define cdv_02 59505 -#define cd_2 59506 -#define cdv_03 59507 -#define cdv_04 59508 -#define cd_3 59509 -#define cdv_05 59510 -#define cdv_06 59511 -#define cd_5 59512 -#define cdv_07 59513 -#define cdv_08 59514 -#define cdv_09 59515 -#define cd_7 59516 -#define cdv_10 59518 -#define cd_11 59519 -#define cdv_11 59520 -#define cd_11_pal 59521 -#define cd_11_log 59522 -#define cdv_12 59523 -#define cd_13 59524 -#define cdv_13 59525 -#define cdv_14 59527 -#define cdv_15 59528 -#define cd_15_pal 59529 -#define cd_15_log 59530 -#define cdv_16 59531 -#define cd_17_log 59532 -#define cd_17 59533 -#define cdv_17 59534 -#define cdv_18 59535 -#define cdv_19 59536 -#define cd_19_pal 59537 -#define cd_19_log 59538 -#define cdv_20 59539 -#define cd_20_log 59540 -#define cdv_21 59541 -#define cd_21_log 59542 -#define cdv_22 59545 -#define cdv_23 59546 -#define cd_23_pal 59547 -#define cd_24_log 59550 -#define cdv_24 59551 -#define cdv_25 59554 -#define cdv_26 59556 -#define cd_27 59557 -#define cdv_27 59558 -#define cd_27_pal 59559 -#define cd_27_log 59560 -#define cdv_28 59561 -#define cdv_29 59562 -#define cdv_30 59563 -#define cdv_31 59565 -#define cdv_32 59566 -#define cdv_33 59567 -#define cdv_34 59568 -#define cd_35 59569 -#define cdv_35 59570 -#define cd_35_pal 59571 -#define cd_35_log 59572 -#define cdv_36 59574 -#define cd_37 59575 -#define cdv_37 59576 -#define cd_37_pal 59577 -#define cd_37_log 59578 -#define cdv_38 59579 -#define cdv_39 59581 -#define cdv_40 59583 -#define cd_40_pal 59584 -#define cd_40_log 59585 -#define cdv_41 59587 -#define cdv_42 59588 -#define cd_43 59589 -#define cdv_43 59590 -#define cd_43_pal 59591 -#define cd_43_log 59592 -#define cdv_44 59594 -#define cd_45 59595 -#define cdv_45 59596 -#define cd_45_pal 59597 -#define cd_45_log 59598 -#define cdv_46 59600 -#define cdv_47 59602 -#define cd_47_pal 59603 -#define cd_47_log 59604 -#define cd_48 59605 -#define cdv_48 59606 -#define cd_48_pal 59607 -#define cd_48_log 59608 -#define cd_49 59609 -#define cdv_49 59610 -#define cd_50 59611 -#define cdv_50 59612 -#define cdv_51 59613 -#define cdv_52 59614 -#define cdv_53 59615 -#define cdv_54 59616 -#define cdv_55 59618 -#define cd_55_pal 59619 -#define cd_55_log 59620 -#define cdv_56 59621 -#define cdv_57 59622 -#define cd_58 59623 -#define cdv_58 59624 -#define cd_58_pal 59625 -#define cd_58_log 59626 -#define cdv_59 59627 -#define cdv_60 59628 -#define cdv_61 59629 -#define cdv_62 59630 -#define cdv_63 59631 -#define cdv_64 59632 -#define cdv_65 59633 -#define cdv_66 59635 -#define cd_66_pal 59636 -#define cd_66_log 59637 -#define cdv_67 59639 -#define cd_67_pal 59640 -#define cd_67_log 59641 -#define cdv_68 59642 -#define cd_69 59643 -#define cdv_69 59644 -#define cd_69_pal 59645 -#define cd_69_log 59646 -#define cdv_70 59647 -#define cdv_71 59648 -#define cdv_72 59649 -#define cd_72_pal 59650 -#define cd_72_log 59651 -#define cd_73_pal 59652 -#define cd_73_log 59653 -#define cdv_73 59654 -#define cdv_74 59655 -#define cdv_75 59656 -#define cd_76_pal 59657 -#define cd_76_log 59658 -#define cdv_76 59659 -#define cdv_77 59660 -#define cd_78_pal 59661 -#define cd_78_log 59662 -#define cdv_78 59663 -#define cdv_79 59664 -#define cdv_80 59665 -#define cdv_81 59666 -#define cdv_82 59667 -#define cdv_83 59668 -#define cdv_84 59669 -#define cdv_85 59670 -#define cdv_86 59671 -#define cdv_87 59672 -#define cd_100 60087 -#define cd_101_log 60088 -#define cd_101 60099 -#define cd_102_log 60090 -#define cd_102 60091 -#define cd_103_pal 60092 -#define cd_103_log 60093 -#define cd_103 60094 -#define cd_104_pal 60095 -#define cd_104_log 60096 -#define cd_104 60097 -#define cd_105 60098 - -#define START_VOICE ( delay(200), _skySound->playVoice(vocBuffer, loadedVocSize) ) -#define START_BG ( _skySound->playBgSound(bgVocBuffer, bgVocSize) ) -#define LOAD_NEW_VOICE(num) ( free (vocBuffer), vocBuffer = _skyDisk->loadFile(num, NULL), loadedVocSize = _skyDisk->_lastLoadedFileSize ) -#define LOAD_NEW_BG(num) ( free (bgVocBuffer), bgVocBuffer = _skyDisk->loadFile(num, NULL), bgVocSize = _skyDisk->_lastLoadedFileSize ) -#define WAIT_VOICE while (_skySound->_voiceHandle != 0) { delay(50); CHECK_ESC } -#define CHECK_ESC if (_key_pressed == 27) { _skyScreen->stopSequence(); _mixer->stopAll(); return false; } -#define WAIT_SEQUENCE while (_skyScreen->sequenceRunning()) { delay(50); CHECK_ESC } -#define WAIT_RELATIVE(x) ( delay(20 * (x)) ) - -#define NORMAL_CD_INTRO - -bool SkyState::doCDIntro() { - - uint32 loadedVocSize, bgVocSize; - byte *vocBuffer, *bgVocBuffer; - - assert(isCDVersion()); - - vocBuffer = _skyDisk->loadFile(cdv_00, NULL); - loadedVocSize = _skyDisk->_lastLoadedFileSize; - - _skyDisk->prefetchFile(cd_pal); - _skyDisk->prefetchFile(cd_1_log); - _skyDisk->prefetchFile(cd_1); - - bgVocBuffer = _skyDisk->loadFile(59499, NULL); - bgVocSize = _skyDisk->_lastLoadedFileSize; - escDelay(2000); //keep gibbons screen up for 2 seconds - _skyScreen->fnFadeDown(0); //and fade out - - START_VOICE; - START_BG; - free (vocBuffer); - - vocBuffer = _skyDisk->loadFile(cdv_01, NULL); - loadedVocSize = _skyDisk->_lastLoadedFileSize; - WAIT_VOICE; //wait for the voice to finish - - START_VOICE; - START_BG; - _skyScreen->showScreen(cd_1_log); - _skyScreen->paletteFadeUp(cd_pal); - _skyScreen->startSequence(cd_1); - - LOAD_NEW_VOICE(cdv_02); - WAIT_VOICE; - START_VOICE; - START_BG; - _skyDisk->prefetchFile(cd_2); //load seq 2 while 1 is playing - LOAD_NEW_VOICE(cdv_03); - WAIT_VOICE; - _skyScreen->startSequence(cd_2); //start second sequence - START_VOICE; //03 - START_BG; - - LOAD_NEW_VOICE(cdv_04); - - WAIT_VOICE; //03 - START_VOICE; //04 - START_BG; - - _skyDisk->prefetchFile(cd_3); - LOAD_NEW_VOICE(cdv_05); - - WAIT_SEQUENCE; //2 - WAIT_VOICE; //4 - - START_VOICE; //5 - START_BG; - - WAIT_RELATIVE(100); - - _skyScreen->startSequence(cd_3); - LOAD_NEW_VOICE(cdv_06); - WAIT_VOICE; //5 - START_VOICE; //6 - START_BG; - - _skyDisk->prefetchFile(cd_5); - LOAD_NEW_VOICE(cdv_07); - - WAIT_SEQUENCE; //3 - WAIT_VOICE; //6 - - START_VOICE; //7 - _skyScreen->startSequence(cd_5); - START_BG; - - LOAD_NEW_VOICE(cdv_08); - WAIT_VOICE; //7 - START_VOICE; //8 - START_BG; - LOAD_NEW_VOICE(cdv_09); - WAIT_VOICE; //8 - START_VOICE; //9 - START_BG; - - _skyDisk->prefetchFile(cd_7); - LOAD_NEW_VOICE(cdv_10); - - WAIT_SEQUENCE; //5 - WAIT_VOICE; //9 - - START_VOICE; //10 - _skyScreen->startSequence(cd_7); - START_BG; - - _skyDisk->prefetchFile(cd_11_pal); - _skyDisk->prefetchFile(cd_11_log); - _skyDisk->prefetchFile(cd_11); - LOAD_NEW_VOICE(cdv_11); - - WAIT_VOICE; //10 - START_VOICE; //11 - START_BG; - - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_11_log); - _skyScreen->paletteFadeUp(cd_11_pal); - - LOAD_NEW_VOICE(cdv_12); - WAIT_SEQUENCE; //7 - WAIT_VOICE; //11 - START_VOICE; //12 - START_BG; - - WAIT_RELATIVE(80); - _skyScreen->startSequence(cd_11); - - LOAD_NEW_VOICE(cdv_13); - WAIT_VOICE; //12 - START_VOICE; //13 - START_BG; - - _skyDisk->prefetchFile(cd_13); - LOAD_NEW_VOICE(cdv_14); - - LOAD_NEW_BG(59498); - - WAIT_SEQUENCE; //11 - WAIT_VOICE; //13 - - START_VOICE; //14 - _skyScreen->startSequence(cd_13); - START_BG; - - LOAD_NEW_VOICE(cdv_15); - _skyDisk->prefetchFile(cd_15_pal); - _skyDisk->prefetchFile(cd_15_log); - - WAIT_SEQUENCE; //13 - WAIT_VOICE; //14 - - START_VOICE; //15 - START_BG; - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_15_log); - _skyScreen->paletteFadeUp(cd_15_pal); - - LOAD_NEW_VOICE(cdv_16); - WAIT_VOICE; //15 - START_VOICE; //16 - START_BG; - - _skyDisk->prefetchFile(cd_17_log); - _skyDisk->prefetchFile(cd_17); - LOAD_NEW_VOICE(cdv_17); - - WAIT_VOICE; //16 - START_VOICE; //17 - - WAIT_RELATIVE(40); - _skyScreen->showScreen(cd_17_log); - - LOAD_NEW_VOICE(cdv_18); - LOAD_NEW_BG(59497); //Loud heli - - WAIT_VOICE; //17 - _skyScreen->startSequence(cd_17); - START_VOICE; //18 - START_BG; - - LOAD_NEW_VOICE(cdv_19); - _skyDisk->prefetchFile(cd_19_pal); - _skyDisk->prefetchFile(cd_19_log); - START_BG; - LOAD_NEW_BG(59496); //loud heli to quiet - - WAIT_SEQUENCE; //17 - WAIT_VOICE; //18 - - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_19_log); - _skyScreen->paletteFadeUp(cd_19_pal); - - START_VOICE; //19 - START_BG; - LOAD_NEW_VOICE(cdv_20); - LOAD_NEW_BG(59496); //quiet heli - _skyDisk->prefetchFile(cd_20_log); - _skyDisk->prefetchFile(cd_19_pal); - - WAIT_VOICE; //19 - START_VOICE; //20 - START_BG; - - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_20_log); - _skyScreen->paletteFadeUp(cd_19_pal); - - LOAD_NEW_VOICE(cdv_21); - _skyDisk->prefetchFile(cd_21_log); - - START_BG; - _skyDisk->prefetchFile(cd_19_pal); - WAIT_SEQUENCE; //19 - WAIT_VOICE; //20 - START_VOICE; //21 - START_BG; - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_21_log); - _skyScreen->paletteFadeUp(cd_19_pal); - - LOAD_NEW_VOICE(cdv_22); - LOAD_NEW_BG(59494); //heli whine - - WAIT_SEQUENCE; //20 - WAIT_VOICE; //21 - - START_VOICE; //22 - START_BG; - LOAD_NEW_VOICE(cdv_23); - WAIT_VOICE; //22 - START_VOICE; //23 - _skyScreen->fnFadeDown(0); - - _skyDisk->prefetchFile(cd_23_pal); - _skyDisk->prefetchFile(cd_24_log); - LOAD_NEW_VOICE(cdv_24); - WAIT_VOICE; //23 - - _skyScreen->showScreen(cd_24_log); - _skyScreen->paletteFadeUp(cd_23_pal); - START_VOICE; //24 - LOAD_NEW_VOICE(cdv_25); - WAIT_VOICE; //24 - START_VOICE; //25 - LOAD_NEW_VOICE(cdv_26); - WAIT_VOICE; //25 - START_VOICE; //26 - - _skyDisk->prefetchFile(cd_27); - LOAD_NEW_VOICE(cdv_27); - _skyDisk->prefetchFile(cd_27_pal); - _skyDisk->prefetchFile(cd_27_log); - WAIT_VOICE; //26 - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_27_log); - _skyScreen->paletteFadeUp(cd_27_pal); - START_VOICE; //27 - LOAD_NEW_VOICE(cdv_29); - WAIT_VOICE; //27 - START_VOICE; //29 - LOAD_NEW_VOICE(cdv_30); - WAIT_VOICE; //29 - START_VOICE; //30 - LOAD_NEW_VOICE(cdv_31); - WAIT_VOICE; //30 - - _skyScreen->startSequence(cd_27); - START_VOICE; //31 - LOAD_NEW_VOICE(cdv_32); - WAIT_VOICE; //31 - START_VOICE; //32 - LOAD_NEW_VOICE(cdv_33); - WAIT_VOICE; //32 - START_VOICE; //33 - LOAD_NEW_VOICE(cdv_34); - WAIT_VOICE; //33 - START_VOICE; //34 - LOAD_NEW_VOICE(cdv_35); - WAIT_SEQUENCE; //27 - WAIT_VOICE; //34 - START_VOICE; //35 - - _skyDisk->prefetchFile(cd_35); - LOAD_NEW_VOICE(cdv_36); - _skyDisk->prefetchFile(cd_35_pal); - _skyDisk->prefetchFile(cd_35_log); - WAIT_VOICE; //35 - START_VOICE; //36 - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_35_log); - _skyScreen->paletteFadeUp(cd_35_pal); - - LOAD_NEW_VOICE(cdv_37); - WAIT_VOICE; //36 - _skyScreen->startSequence(cd_35); - START_VOICE; //37 - - _skyDisk->prefetchFile(cd_37); - LOAD_NEW_VOICE(cdv_38); - - WAIT_SEQUENCE; //35 - WAIT_VOICE; //37 - START_VOICE; //38 - _skyScreen->startSequence(cd_37); - LOAD_NEW_VOICE(cdv_39); - WAIT_SEQUENCE; //37 - WAIT_VOICE; //38 - START_VOICE; //39 - - LOAD_NEW_VOICE(cdv_40); - _skyDisk->prefetchFile(cd_40_pal); - _skyDisk->prefetchFile(cd_40_log); - WAIT_VOICE; //39 - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_40_log); - _skyScreen->paletteFadeUp(cd_40_pal); - - START_VOICE; //40 - LOAD_NEW_VOICE(cdv_41); - WAIT_VOICE; //40 - START_VOICE; //41 - LOAD_NEW_VOICE(cdv_42); - WAIT_VOICE; //41 - START_VOICE; //42 - LOAD_NEW_VOICE(cdv_43); - - _skyDisk->prefetchFile(cd_43_pal); - _skyDisk->prefetchFile(cd_43_log); - WAIT_VOICE; //42 - - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_43_log); - _skyScreen->paletteFadeUp(cd_43_pal); - - START_VOICE; //43 - _skyDisk->prefetchFile(cd_43); - WAIT_VOICE; //43 - _skyScreen->startSequence(cd_43); - LOAD_NEW_VOICE(cdv_45); - _skyDisk->prefetchFile(cd_45_pal); - _skyDisk->prefetchFile(cd_45_log); - WAIT_SEQUENCE; //43 - START_VOICE; //45 - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_45_log); - _skyScreen->paletteFadeUp(cd_45_pal); - _skyDisk->prefetchFile(cd_45); - LOAD_NEW_VOICE(cdv_46); - WAIT_VOICE; //45 - _skyScreen->startSequence(cd_45); - START_VOICE; //46 - LOAD_NEW_VOICE(cdv_47); - - _skyDisk->prefetchFile(cd_47_pal); - _skyDisk->prefetchFile(cd_47_log); - - WAIT_SEQUENCE; //45 - WAIT_VOICE; //46 - - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_47_log); - _skyScreen->paletteFadeUp(cd_47_pal); - START_VOICE; //47 - LOAD_NEW_VOICE(cdv_48); - _skyDisk->prefetchFile(cd_48_pal); - _skyDisk->prefetchFile(cd_48_log); - WAIT_VOICE; //47 - START_VOICE; //48 - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_48_log); - _skyScreen->paletteFadeUp(cd_48_pal); - - _skyDisk->prefetchFile(cd_48); - LOAD_NEW_VOICE(cdv_49); - WAIT_VOICE; //48 - _skyScreen->startSequence(cd_48); - START_VOICE; //49 - LOAD_NEW_VOICE(cdv_50); - WAIT_VOICE; //49 - START_VOICE; //50 - _skyDisk->prefetchFile(cd_49); - LOAD_NEW_VOICE(cdv_51); - WAIT_SEQUENCE; //48 - WAIT_VOICE; //50 - START_VOICE; //51 - _skyScreen->startSequence(cd_49); - LOAD_NEW_VOICE(cdv_52); - WAIT_VOICE; //51 - START_VOICE; //52 - LOAD_NEW_VOICE(cdv_53); - WAIT_VOICE; //52 - START_VOICE; //53 - LOAD_NEW_VOICE(cdv_54); - _skyDisk->prefetchFile(cd_50); - WAIT_VOICE; //53 - WAIT_SEQUENCE; //49 - - START_VOICE; //54 - _skyScreen->startSequence(cd_50); - LOAD_NEW_VOICE(cdv_55); - WAIT_SEQUENCE; //50 - WAIT_VOICE; //54 - START_VOICE; //55 - -#ifdef NORMAL_CD_INTRO - _skyDisk->prefetchFile(cd_55_pal); - _skyDisk->prefetchFile(cd_55_log); -#endif - LOAD_NEW_VOICE(cdv_56); - WAIT_VOICE; //55 - START_VOICE; //56 - - _skyScreen->fnFadeDown(0); -#ifdef NORMAL_CD_INTRO - _skyScreen->showScreen(cd_55_log); // foster screen - _skyScreen->paletteFadeUp(cd_55_pal); -#else - memset(_skyScreen->giveCurrent(), 0, 320*200); - _system->copy_rect(_skyScreen->giveCurrent(), 320, 0, 0, 320, 200); - _system->copy_rect(fosterImg, 297, 11, 28, 297, 143); - _skyScreen->paletteFadeUp(fosterPal); -#endif - - LOAD_NEW_VOICE(cdv_57); - WAIT_VOICE; //56 - START_VOICE; //57 - - LOAD_NEW_VOICE(cdv_58); - _skyDisk->prefetchFile(cd_58_pal); - _skyDisk->prefetchFile(cd_58_log); - - WAIT_VOICE; //57 - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_58_log); - _skyScreen->paletteFadeUp(cd_58_pal); - START_VOICE; //58 - LOAD_NEW_VOICE(cdv_59); - WAIT_VOICE; //48 - START_VOICE; //59 - _skyDisk->prefetchFile(cd_58); - WAIT_VOICE; //59 - LOAD_NEW_VOICE(cdv_60); - START_VOICE; //60 - LOAD_NEW_VOICE(cdv_61); - WAIT_VOICE; //60 - START_VOICE; //61 - LOAD_NEW_VOICE(cdv_62); - WAIT_VOICE; //61 - START_VOICE; //62 - _skyScreen->startSequence(cd_58); - LOAD_NEW_VOICE(cdv_63); - WAIT_VOICE; //62 - START_VOICE; //63 - LOAD_NEW_VOICE(cdv_64); - WAIT_VOICE; //63 - START_VOICE; //64 - LOAD_NEW_VOICE(cdv_65); - WAIT_SEQUENCE; //58 - WAIT_VOICE; //64 - START_VOICE; //65 - _skyScreen->fnFadeDown(0); - LOAD_NEW_VOICE(cdv_66); - _skyDisk->prefetchFile(cd_66_pal); - _skyDisk->prefetchFile(cd_66_log); - WAIT_VOICE; //65 - _skyScreen->showScreen(cd_66_log); - _skyScreen->paletteFadeUp(cd_66_pal); - START_VOICE; //66 - LOAD_NEW_VOICE(cdv_67); - WAIT_VOICE; //66 - START_VOICE; //67 - _skyDisk->prefetchFile(cd_67_pal); - _skyDisk->prefetchFile(cd_67_log); - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_67_log); - _skyScreen->paletteFadeUp(cd_67_pal); - LOAD_NEW_VOICE(cdv_68); - WAIT_VOICE; //67 - START_VOICE; //68 - _skyDisk->prefetchFile(cd_69); - LOAD_NEW_VOICE(cdv_69); - _skyDisk->prefetchFile(cd_69_pal); - _skyDisk->prefetchFile(cd_69_log); - WAIT_VOICE; //68 - START_VOICE; //69 - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_69_log); - _skyScreen->paletteFadeUp(cd_69_pal); - LOAD_NEW_VOICE(cdv_70); - WAIT_VOICE; //69 - _skyScreen->startSequence(cd_69); - START_VOICE; //70 - LOAD_NEW_VOICE(cdv_71); - WAIT_VOICE; //70 - _skyScreen->fnFadeDown(0); - START_VOICE; //71 - _skyDisk->prefetchFile(cd_72_pal); - _skyDisk->prefetchFile(cd_72_log); - WAIT_VOICE; //71 - _skyScreen->showScreen(cd_72_log); - _skyScreen->paletteFadeUp(cd_72_pal); - LOAD_NEW_VOICE(cdv_72); - START_VOICE; //72 - - _skyDisk->prefetchFile(cd_73_pal); - _skyDisk->prefetchFile(cd_73_log); - LOAD_NEW_VOICE(cdv_73); - WAIT_VOICE; //72 - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_73_log); - _skyScreen->paletteFadeUp(cd_73_pal); - START_VOICE; //73 - LOAD_NEW_VOICE(cdv_74); - WAIT_VOICE; //73 - START_VOICE; //74 - LOAD_NEW_VOICE(cdv_75); - WAIT_VOICE; //74 - START_VOICE; //75 - _skyDisk->prefetchFile(cd_76_pal); - _skyDisk->prefetchFile(cd_76_log); - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_76_log); - _skyScreen->paletteFadeUp(cd_76_pal); - - LOAD_NEW_VOICE(cdv_76); - WAIT_VOICE; //75 - START_VOICE; //76 - LOAD_NEW_VOICE(cdv_77); - WAIT_VOICE; //76 - START_VOICE; //77 - - _skyDisk->prefetchFile(cd_100); - _skyDisk->prefetchFile(cd_78_pal); - _skyDisk->prefetchFile(cd_78_log); - LOAD_NEW_VOICE(cdv_78); - WAIT_VOICE; //77 - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_78_log); - _skyScreen->paletteFadeUp(cd_78_pal); - START_VOICE; //78 - LOAD_NEW_VOICE(cdv_79); - WAIT_VOICE; //78 - START_VOICE; //79 - LOAD_NEW_VOICE(cdv_80); - WAIT_VOICE; //79 - START_VOICE; //80 - _skyScreen->startSequence(cd_100); - LOAD_NEW_VOICE(cdv_81); - WAIT_VOICE; //80 - START_VOICE; //81 - LOAD_NEW_VOICE(cdv_82); - WAIT_VOICE; //81 - START_VOICE; //82 - LOAD_NEW_VOICE(cdv_83); - WAIT_VOICE; //82 - _skyDisk->prefetchFile(cd_101_log); - _skyDisk->prefetchFile(cd_101); - WAIT_SEQUENCE; //100 - _skyScreen->showScreen(cd_101_log); - _skyScreen->startSequence(cd_101); - START_VOICE; //83 - LOAD_NEW_VOICE(cdv_84); - WAIT_VOICE; //83 - START_VOICE; //84 - LOAD_NEW_VOICE(cdv_85); - WAIT_VOICE; //84 - START_VOICE; //85 - LOAD_NEW_VOICE(cdv_86); - WAIT_VOICE; //85 - - _skyDisk->prefetchFile(cd_102_log); - _skyDisk->prefetchFile(cd_102); - WAIT_SEQUENCE; //101 - _skyScreen->showScreen(cd_102_log); - _skyScreen->startSequence(cd_102); - START_VOICE; //86 - LOAD_NEW_VOICE(cdv_87); - _skyDisk->prefetchFile(cd_103_pal); - _skyDisk->prefetchFile(cd_103_log); - _skyDisk->prefetchFile(cd_103); - WAIT_SEQUENCE; //102 - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_103_log); - _skyScreen->paletteFadeUp(cd_103_pal); - _skyScreen->startSequence(cd_103); - WAIT_VOICE; //86 - START_VOICE; //87 - _skyDisk->prefetchFile(cd_104_pal); - _skyDisk->prefetchFile(cd_104_log); - _skyDisk->prefetchFile(cd_104); - WAIT_SEQUENCE; //103 - - _skyMusic->startMusic(2); - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(cd_104_log); - _skyScreen->paletteFadeUp(cd_104_pal); - _skyScreen->startSequence(cd_104); - _skyDisk->prefetchFile(cd_105); - WAIT_SEQUENCE; //104 - _skyScreen->startSequence(cd_105); - WAIT_SEQUENCE; //105 - return true; -} diff --git a/sky/intro.cpp b/sky/intro.cpp index 8bc8dcb4dc..e9e3bd3c32 100644 --- a/sky/intro.cpp +++ b/sky/intro.cpp @@ -20,503 +20,881 @@ */ #include "stdafx.h" -#include <string.h> -#include "common/scummsys.h" -#include "sky/skydefs.h" +#include "sky/intro.h" #include "sky/sky.h" -#define FREE_IF_NOT_0(ptr) if (ptr != NULL) { free (ptr); ptr = 0; } -#define REMOVE_INTRO commandPtr = (uint32 *)zeroCommands; \ - FREE_IF_NOT_0(_introTextSpace) \ - FREE_IF_NOT_0(_introTextSave) \ - _mixer->stopAll(); -#define CHECK_ESC if (_key_pressed == 27) { _skyScreen->stopSequence(); REMOVE_INTRO return false; } -#define WAIT_SEQUENCE while (_skyScreen->sequenceRunning()) { checkCommands(commandPtr); delay(50); CHECK_ESC } -#define WAIT_MUSIC while (_skyMusic->musicIsPlaying()) { delay(50); CHECK_ESC } - -#define INTRO_TEXT_WIDTH 128 - -#define FN_A_PAL 60080 -#define FN_1A_LOG 60081 -#define FN_1A 60082 -#define FN_1B 60083 -#define FN_1C 60084 -#define FN_1D 60085 -#define FN_1E 60086 -#define FN_4A 60087 -#define FN_4B_LOG 60088 -#define FN_4B 60089 -#define FN_4C_LOG 60090 -#define FN_4C 60091 -#define FN_5_PAL 60092 -#define FN_5_LOG 60093 -#define FN_5 60094 -#define FN_6_PAL 60095 -#define FN_6_LOG 60096 -#define FN_6A 60097 -#define FN_6B 60098 - -#define IC_PREPARE_TEXT 0 -#define IC_SHOW_TEXT 1 -#define IC_REMOVE_TEXT 2 -#define IC_MAKE_SOUND 3 -#define IC_FX_VOLUME 4 - -uint32 cockpitCommands[] = { - - 1000, //do straight away - IC_PREPARE_TEXT, - 77, - 220, - IC_SHOW_TEXT, //radar detects jamming signal - 20, - 160, - 105, - IC_REMOVE_TEXT, - 105, - IC_PREPARE_TEXT, - 81, - 105, - IC_SHOW_TEXT, //well switch to override you fool - 170, - 86, - 35, - IC_REMOVE_TEXT, - 35, - IC_PREPARE_TEXT, - 477, - 35, - IC_SHOW_TEXT, - 30, - 160, - 3, - IC_REMOVE_TEXT, - 0 +#define SHOWSCREEN 0 +#define COMMANDEND 0 // end of COMMANDFLIRT block +#define FADEUP 1 // fade up palette +#define FADEDOWN 2 +#define DELAY 3 +#define DOFLIRT 4 // start flirt sequence (and wait for it to finish) +#define SCROLLFLIRT 5 // start special floppy intro flirt sequence (and wait for it) +#define COMMANDFLIRT 6 // start flirt sequence and wait for it, while processing command block +#define BGFLIRT 7 // start flirt sequence without waiting for it +#define WAITFLIRT 8 // wait for sequence started by BGFLIRT +#define STOPFLIRT 9 +#define STARTMUSIC 10 +#define WAITMUSIC 11 +#define PLAYVOICE 12 +#define WAITVOICE 13 +#define LOADBG 14 // load new background sound +#define PLAYBG 15 // play background sound +#define SEQEND 65535 // end of intro sequence + +#define IC_PREPARE_TEXT 20 // commands used in COMMANDFLIRT block +#define IC_SHOW_TEXT 21 +#define IC_REMOVE_TEXT 22 +#define IC_MAKE_SOUND 23 +#define IC_FX_VOLUME 24 + +#define FRAME_SIZE (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT) +#define INTRO_TEXT_WIDTH 128 +//CD intro file defines +#define CDV_00 59500 +#define CD_PAL 59501 +#define CD_1_LOG 59502 +#define CD_1 59503 +#define CDV_01 59504 +#define CDV_02 59505 +#define CD_2 59506 +#define CDV_03 59507 +#define CDV_04 59508 +#define CD_3 59509 +#define CDV_05 59510 +#define CDV_06 59511 +#define CD_5 59512 +#define CDV_07 59513 +#define CDV_08 59514 +#define CDV_09 59515 +#define CD_7 59516 +#define CDV_10 59518 +#define CD_11 59519 +#define CDV_11 59520 +#define CD_11_PAL 59521 +#define CD_11_LOG 59522 +#define CDV_12 59523 +#define CD_13 59524 +#define CDV_13 59525 +#define CDV_14 59527 +#define CDV_15 59528 +#define CD_15_PAL 59529 +#define CD_15_LOG 59530 +#define CDV_16 59531 +#define CD_17_LOG 59532 +#define CD_17 59533 +#define CDV_17 59534 +#define CDV_18 59535 +#define CDV_19 59536 +#define CD_19_PAL 59537 +#define CD_19_LOG 59538 +#define CDV_20 59539 +#define CD_20_LOG 59540 +#define CDV_21 59541 +#define CD_21_LOG 59542 +#define CDV_22 59545 +#define CDV_23 59546 +#define CD_23_PAL 59547 +#define CD_24_LOG 59550 +#define CDV_24 59551 +#define CDV_25 59554 +#define CDV_26 59556 +#define CD_27 59557 +#define CDV_27 59558 +#define CD_27_PAL 59559 +#define CD_27_LOG 59560 +#define CDV_28 59561 +#define CDV_29 59562 +#define CDV_30 59563 +#define CDV_31 59565 +#define CDV_32 59566 +#define CDV_33 59567 +#define CDV_34 59568 +#define CD_35 59569 +#define CDV_35 59570 +#define CD_35_PAL 59571 +#define CD_35_LOG 59572 +#define CDV_36 59574 +#define CD_37 59575 +#define CDV_37 59576 +#define CD_37_PAL 59577 +#define CD_37_LOG 59578 +#define CDV_38 59579 +#define CDV_39 59581 +#define CDV_40 59583 +#define CD_40_PAL 59584 +#define CD_40_LOG 59585 +#define CDV_41 59587 +#define CDV_42 59588 +#define CD_43 59589 +#define CDV_43 59590 +#define CD_43_PAL 59591 +#define CD_43_LOG 59592 +#define CDV_44 59594 +#define CD_45 59595 +#define CDV_45 59596 +#define CD_45_PAL 59597 +#define CD_45_LOG 59598 +#define CDV_46 59600 +#define CDV_47 59602 +#define CD_47_PAL 59603 +#define CD_47_LOG 59604 +#define CD_48 59605 +#define CDV_48 59606 +#define CD_48_PAL 59607 +#define CD_48_LOG 59608 +#define CD_49 59609 +#define CDV_49 59610 +#define CD_50 59611 +#define CDV_50 59612 +#define CDV_51 59613 +#define CDV_52 59614 +#define CDV_53 59615 +#define CDV_54 59616 +#define CDV_55 59618 +#define CD_55_PAL 59619 +#define CD_55_LOG 59620 +#define CDV_56 59621 +#define CDV_57 59622 +#define CD_58 59623 +#define CDV_58 59624 +#define CD_58_PAL 59625 +#define CD_58_LOG 59626 +#define CDV_59 59627 +#define CDV_60 59628 +#define CDV_61 59629 +#define CDV_62 59630 +#define CDV_63 59631 +#define CDV_64 59632 +#define CDV_65 59633 +#define CDV_66 59635 +#define CD_66_PAL 59636 +#define CD_66_LOG 59637 +#define CDV_67 59639 +#define CD_67_PAL 59640 +#define CD_67_LOG 59641 +#define CDV_68 59642 +#define CD_69 59643 +#define CDV_69 59644 +#define CD_69_PAL 59645 +#define CD_69_LOG 59646 +#define CDV_70 59647 +#define CDV_71 59648 +#define CDV_72 59649 +#define CD_72_PAL 59650 +#define CD_72_LOG 59651 +#define CD_73_PAL 59652 +#define CD_73_LOG 59653 +#define CDV_73 59654 +#define CDV_74 59655 +#define CDV_75 59656 +#define CD_76_PAL 59657 +#define CD_76_LOG 59658 +#define CDV_76 59659 +#define CDV_77 59660 +#define CD_78_PAL 59661 +#define CD_78_LOG 59662 +#define CDV_78 59663 +#define CDV_79 59664 +#define CDV_80 59665 +#define CDV_81 59666 +#define CDV_82 59667 +#define CDV_83 59668 +#define CDV_84 59669 +#define CDV_85 59670 +#define CDV_86 59671 +#define CDV_87 59672 +#define CD_100 60087 +#define CD_101_LOG 60088 +#define CD_101 60099 +#define CD_102_LOG 60090 +#define CD_102 60091 +#define CD_103_PAL 60092 +#define CD_103_LOG 60093 +#define CD_103 60094 +#define CD_104_PAL 60095 +#define CD_104_LOG 60096 +#define CD_104 60097 +#define CD_105 60098 + + +uint16 SkyIntro::_mainIntroSeq[] = { + DELAY, 3000, // keep virgin screen up + FADEDOWN, + SHOWSCREEN, 60112, // revo screen + palette + FADEUP, 60113, + DELAY, 8000, + FADEDOWN, + SHOWSCREEN, 60114, // gibbo screen + palette + FADEUP, 60115, + DELAY, 2000, + FADEDOWN, + SEQEND }; -uint32 zeroCommands[] = { 0 }; - -uint32 anim5Commands[] = { - - 31, - IC_MAKE_SOUND, - 2, - 127, - 0 -}; - -uint32 anim4aCommands[] = { - - 136, - IC_MAKE_SOUND, - 1, - 70, - 90, - IC_FX_VOLUME, - 80, - 50, - IC_FX_VOLUME, - 90, - 5, - IC_FX_VOLUME, - 100, - 0 +uint16 SkyIntro::_cdIntroSeq[] = { + PLAYVOICE, 59500, + LOADBG, 59499, + PLAYBG, + WAITVOICE, + PLAYVOICE, 59504, + PLAYBG, + SHOWSCREEN, CD_1_LOG, + FADEUP, CD_PAL, + BGFLIRT, CD_1, + WAITVOICE, + PLAYVOICE, CDV_02, + PLAYBG, + WAITVOICE, + STOPFLIRT, + BGFLIRT, CD_2, + PLAYVOICE, CDV_03, + PLAYBG, + WAITVOICE, + PLAYVOICE, CDV_04, + PLAYBG, + WAITFLIRT, + WAITVOICE, + PLAYVOICE, CDV_05, + PLAYBG, + DELAY, 2000, + BGFLIRT, CD_3, + WAITVOICE, + PLAYVOICE, CDV_06, + PLAYBG, + WAITFLIRT, + WAITVOICE, + PLAYVOICE, CDV_07, + BGFLIRT, CD_5, + PLAYBG, + WAITVOICE, + PLAYVOICE, CDV_08, + PLAYBG, + WAITVOICE, + PLAYVOICE, CDV_09, + PLAYBG, + WAITFLIRT, + WAITVOICE, + PLAYVOICE, CDV_10, + BGFLIRT, CD_7, + PLAYBG, + WAITVOICE, + PLAYVOICE, CDV_11, + PLAYBG, + WAITFLIRT, + FADEDOWN, + SHOWSCREEN, CD_11_LOG, + FADEUP, CD_11_PAL, + WAITVOICE, + PLAYVOICE, CDV_12, + PLAYBG, + DELAY, 1600, + BGFLIRT, CD_11, + WAITVOICE, + PLAYVOICE, CDV_13, + WAITVOICE, + PLAYBG, + WAITFLIRT, + WAITVOICE, + LOADBG, 59498, // quite heli + PLAYVOICE, CDV_14, + PLAYBG, + DOFLIRT, CD_13, + WAITVOICE, + PLAYVOICE, CDV_15, + PLAYBG, + FADEDOWN, + SHOWSCREEN, CD_15_LOG, + FADEUP, CD_15_PAL, + WAITVOICE, + PLAYVOICE, CDV_16, + PLAYBG, + WAITVOICE, + PLAYVOICE, CDV_17, + DELAY, 2000, + SHOWSCREEN, CD_17_LOG, + WAITVOICE, + BGFLIRT, CD_17, + PLAYVOICE, CDV_18, + PLAYBG, + WAITFLIRT, + WAITVOICE, + LOADBG, 59496, // quiet heli + FADEDOWN, + SHOWSCREEN, CD_19_LOG, + FADEUP, CD_19_PAL, + PLAYVOICE, CDV_19, + PLAYBG, + WAITVOICE, + LOADBG, 59496, + PLAYVOICE, CDV_20, + PLAYBG, + FADEDOWN, + SHOWSCREEN, CD_20_LOG, + FADEUP, CD_19_PAL, + PLAYBG, + WAITVOICE, + PLAYVOICE, CDV_21, + PLAYBG, + FADEDOWN, + SHOWSCREEN, CD_21_LOG, + FADEUP, CD_19_PAL, + WAITVOICE, + LOADBG, 59494, // heli whine + PLAYVOICE, CDV_22, + PLAYBG, + WAITVOICE, + PLAYVOICE, CDV_23, + FADEDOWN, + WAITVOICE, + SHOWSCREEN, CD_24_LOG, + FADEUP, CD_23_PAL, + PLAYVOICE, CDV_24, + WAITVOICE, + PLAYVOICE, CDV_25, + WAITVOICE, + PLAYVOICE, CDV_26, + WAITVOICE, + FADEDOWN, + SHOWSCREEN, CD_27_LOG, + FADEUP, CD_27_PAL, + PLAYVOICE, CDV_27, + WAITVOICE, + PLAYVOICE, CDV_29, + WAITVOICE, + PLAYVOICE, CDV_30, + WAITVOICE, + BGFLIRT, CD_27, + PLAYVOICE, CDV_31, + WAITVOICE, + PLAYVOICE, CDV_32, + WAITVOICE, + PLAYVOICE, CDV_33, + WAITVOICE, + PLAYVOICE, CDV_34, + WAITFLIRT, + WAITVOICE, + PLAYVOICE, CDV_35, + WAITVOICE, + PLAYVOICE, CDV_36, + FADEDOWN, + SHOWSCREEN, CD_35_LOG, + FADEUP, CD_35_PAL, + WAITVOICE, + PLAYVOICE, CDV_37, + DOFLIRT, CD_35, + WAITVOICE, + PLAYVOICE, CDV_38, + DOFLIRT, CD_37, + WAITVOICE, + PLAYVOICE, CDV_39, + WAITVOICE, + FADEDOWN, + SHOWSCREEN, CD_40_LOG, + FADEUP, CD_40_PAL, + PLAYVOICE, CDV_40, + WAITVOICE, + PLAYVOICE, CDV_41, + WAITVOICE, + PLAYVOICE, CDV_42, + WAITVOICE, + FADEDOWN, + SHOWSCREEN, CD_43_LOG, + FADEUP, CD_43_PAL, + PLAYVOICE, CDV_43, + WAITVOICE, + DOFLIRT, CD_43, + PLAYVOICE, CDV_45, + FADEDOWN, + SHOWSCREEN, CD_45_LOG, + FADEUP, CD_45_PAL, + WAITVOICE, + PLAYVOICE, CDV_46, + DOFLIRT, CD_45, + WAITVOICE, + FADEDOWN, + SHOWSCREEN, CD_47_LOG, + FADEUP, CD_47_PAL, + PLAYVOICE, CDV_47, + WAITVOICE, + PLAYVOICE, CDV_48, + FADEDOWN, + SHOWSCREEN, CD_48_LOG, + FADEUP, CD_48_PAL, + WAITVOICE, + BGFLIRT, CD_48, + PLAYVOICE, CDV_49, + WAITVOICE, + PLAYVOICE, CDV_50, + WAITFLIRT, + WAITVOICE, + PLAYVOICE, CDV_51, + BGFLIRT, CD_49, + WAITVOICE, + PLAYVOICE, CDV_52, + WAITVOICE, + PLAYVOICE, CDV_53, + WAITVOICE, + WAITFLIRT, + PLAYVOICE, CDV_54, + DOFLIRT, CD_50, + WAITVOICE, + PLAYVOICE, CDV_55, + WAITVOICE, + PLAYVOICE, CDV_56, + FADEDOWN, + SHOWSCREEN, CD_55_LOG, + FADEUP, CD_55_PAL, + WAITVOICE, + PLAYVOICE, CDV_57, + WAITVOICE, + FADEDOWN, + SHOWSCREEN, CD_58_LOG, + FADEUP, CD_58_PAL, + PLAYVOICE, CDV_58, + WAITVOICE, + PLAYVOICE, CDV_59, + WAITVOICE, + PLAYVOICE, CDV_60, + WAITVOICE, + PLAYVOICE, CDV_61, + WAITVOICE, + PLAYVOICE, CDV_62, + BGFLIRT, CD_58, + WAITVOICE, + PLAYVOICE, CDV_63, + WAITVOICE, + PLAYVOICE, CDV_64, + WAITFLIRT, + WAITVOICE, + PLAYVOICE, CDV_65, + FADEDOWN, + WAITVOICE, + SHOWSCREEN, CD_66_LOG, + FADEUP, CD_66_PAL, + PLAYVOICE, CDV_66, + WAITVOICE, + PLAYVOICE, CDV_67, + FADEDOWN, + SHOWSCREEN, CD_67_LOG, + FADEUP, CD_67_PAL, + WAITVOICE, + PLAYVOICE, CDV_68, + WAITVOICE, + PLAYVOICE, CDV_69, + FADEDOWN, + SHOWSCREEN, CD_69_LOG, + FADEUP, CD_69_PAL, + WAITVOICE, + PLAYVOICE, CDV_70, + DOFLIRT, CD_69, + WAITVOICE, + FADEDOWN, + PLAYVOICE, CDV_71, + WAITVOICE, + SHOWSCREEN, CD_72_LOG, + FADEUP, CD_72_PAL, + PLAYVOICE, CDV_72, + WAITVOICE, + FADEDOWN, + SHOWSCREEN, CD_73_LOG, + FADEUP, CD_73_PAL, + PLAYVOICE, CDV_73, + WAITVOICE, + PLAYVOICE, CDV_74, + WAITVOICE, + PLAYVOICE, CDV_75, + FADEDOWN, + SHOWSCREEN, CD_76_LOG, + FADEUP, CD_76_PAL, + WAITVOICE, + PLAYVOICE, CDV_76, + WAITVOICE, + PLAYVOICE, CDV_77, + WAITVOICE, + FADEDOWN, + SHOWSCREEN, CD_78_LOG, + FADEUP, CD_78_PAL, + PLAYVOICE, CDV_78, + WAITVOICE, + PLAYVOICE, CDV_79, + WAITVOICE, + PLAYVOICE, CDV_80, + BGFLIRT, CD_100, + WAITVOICE, + PLAYVOICE, CDV_81, + WAITVOICE, + PLAYVOICE, CDV_82, + WAITVOICE, + WAITFLIRT, + SHOWSCREEN, CD_101_LOG, + BGFLIRT, CD_101, + PLAYVOICE, CDV_83, + WAITVOICE, + PLAYVOICE, CDV_84, + WAITVOICE, + PLAYVOICE, CDV_85, + WAITVOICE, + WAITFLIRT, + SHOWSCREEN, CD_102_LOG, + PLAYVOICE, CDV_86, + DOFLIRT, CD_102, + FADEDOWN, + SHOWSCREEN, CD_103_LOG, + FADEUP, CD_103_PAL, + BGFLIRT, CD_103, + WAITVOICE, + PLAYVOICE, CDV_87, + WAITFLIRT, + WAITVOICE, + STARTMUSIC, 2, + FADEDOWN, + SHOWSCREEN, CD_104_LOG, + FADEUP, CD_104_PAL, + DOFLIRT, CD_104, + DOFLIRT, CD_105, + SEQEND }; -uint32 anim4cCommands[] = { - - 1000, - IC_FX_VOLUME, - 100, - 25, - IC_FX_VOLUME, - 110, - 15, - IC_FX_VOLUME, - 120, - 4, - IC_FX_VOLUME, - 127, - 0 +uint16 SkyIntro::_floppyIntroSeq[] = { + SHOWSCREEN, 60081, + FADEUP, 60080, + DOFLIRT, 60082, + DOFLIRT, 60083, + DOFLIRT, 60084, // Beneath a Steel Sky + DOFLIRT, 60085, + DOFLIRT, 60086, + SCROLLFLIRT, + COMMANDFLIRT, 60087, // => command list 4a + 136, IC_MAKE_SOUND, 1, 70, + 90, IC_FX_VOLUME, 80, + 50, IC_FX_VOLUME, 90, + 5, IC_FX_VOLUME, 100, + COMMANDEND, + SHOWSCREEN, 60088, + COMMANDFLIRT, 60089, // => command list 4b (cockpit) + 1000, IC_PREPARE_TEXT, 77, + 220, IC_SHOW_TEXT, 20, 160, // radar detects jamming signal + 105, IC_REMOVE_TEXT, + 105, IC_PREPARE_TEXT, 81, + 105, IC_SHOW_TEXT, 170, 86, // well switch to override you fool + 35, IC_REMOVE_TEXT, + 35, IC_PREPARE_TEXT, 477, + 35, IC_SHOW_TEXT, 30, 160, + 3, IC_REMOVE_TEXT, + COMMANDEND, + SHOWSCREEN, 60090, + COMMANDFLIRT, 60091, // => command list 4c + 1000, IC_FX_VOLUME, 100, + 25, IC_FX_VOLUME, 110, + 15, IC_FX_VOLUME, 120, + 4, IC_FX_VOLUME, 127, + COMMANDEND, + FADEDOWN, + SHOWSCREEN, 60093, + FADEUP, 60092, + COMMANDFLIRT, 60094, // => command list 5 + 31, IC_MAKE_SOUND, 2, 127, + COMMANDEND, + WAITMUSIC, + FADEDOWN, + SHOWSCREEN, 60096, + STARTMUSIC, 2, + FADEUP, 60095, + COMMANDFLIRT, 60097, // => command list 6a + 1000, IC_PREPARE_TEXT, 478, + 13, IC_SHOW_TEXT, 175, 155, + COMMANDEND, + COMMANDFLIRT, 60098, // => command list 6b + 131, IC_REMOVE_TEXT, + 131, IC_PREPARE_TEXT, 479, + 74, IC_SHOW_TEXT, 175, 155, + 45, IC_REMOVE_TEXT, + 45, IC_PREPARE_TEXT, 162, + 44, IC_SHOW_TEXT, 175, 155, + 4, IC_REMOVE_TEXT, + COMMANDEND, + SEQEND }; -uint32 anim6aCommands[] = { - - 1000, - IC_PREPARE_TEXT, - 478, - 13, - IC_SHOW_TEXT, - 175, - 155, - 0 -}; - -uint32 anim6bCommands[] = { - - 131, - IC_REMOVE_TEXT, - 131, - IC_PREPARE_TEXT, - 479, - 74, - IC_SHOW_TEXT, - 175, - 155, - 45, - IC_REMOVE_TEXT, - 45, - IC_PREPARE_TEXT, - 162, - 44, - IC_SHOW_TEXT, - 175, - 155, - 4, - IC_REMOVE_TEXT, - 0 -}; - -typedef void (SkyState::*commandRoutinesProc)(uint32 *&cmdPtr); -static const commandRoutinesProc commandRoutines[] = { - &SkyState::prepareText, - &SkyState::showIntroText, - &SkyState::removeText, - &SkyState::introFx, - &SkyState::introVol, -}; - -void SkyState::initVirgin() { - - _skyScreen->setPalette(60111); - _skyScreen->showScreen(60110); +SkyIntro::SkyIntro(SkyDisk *disk, SkyScreen *screen, SkyMusicBase *music, SkySound *sound, SkyText *text, SoundMixer *mixer, OSystem *system) { + + _skyDisk = disk; + _skyScreen = screen; + _skyMusic = music; + _skySound = sound; + _skyText = text; + _mixer = mixer; + _system = system; + _textBuf = (uint8*)malloc(10000); + _saveBuf = (uint8*)malloc(10000); + _bgBuf = NULL; + _quitProg = false; } -void SkyState::escDelay(uint32 pDelay) { +SkyIntro::~SkyIntro(void) { - pDelay /= 500; - while (pDelay) { - delay(500); - if (_key_pressed == 27) pDelay = 0; - else pDelay--; - } + _mixer->stopAll(); + _skyDisk->flushPrefetched(); + _skyScreen->stopSequence(); + if (_textBuf) + free(_textBuf); + if (_saveBuf) + free(_saveBuf); + if (_bgBuf) + free(_bgBuf); } -bool SkyState::intro(void) { - - uint32 *commandPtr = (uint32 *)zeroCommands; - - if (!isCDVersion()) - _floppyIntro = true; +bool SkyIntro::doIntro(bool floppyIntro) { - _skyDisk->prefetchFile(60112); // revolution screen - _skyDisk->prefetchFile(60113); // revolution palette + if (!SkyState::isCDVersion()) + floppyIntro = true; + _skyDisk->prefetchFile(60112); + _skyDisk->prefetchFile(60113); _skyMusic->loadSection(0); _skySound->loadSection(0); - - escDelay(3000); //keep virgin screen up for 3 seconds - CHECK_ESC - - if (_floppyIntro) + + if (!escDelay(3000)) + return false; + if (floppyIntro) _skyMusic->startMusic(1); - - escDelay(3000); //and another 3 seconds. - CHECK_ESC - - _skyScreen->fnFadeDown(0); //remove virgin screen - - _skyScreen->showScreen(60112); - _skyScreen->paletteFadeUp(60113); - - //while rev is up, load gibbons screen - _skyDisk->prefetchFile(60114); // gibbo screen - _skyDisk->prefetchFile(60115); // gibbo palette - - _introTextSpace = (uint8 *)calloc(10000, 1); - _introTextSave = (uint8 *)calloc(10000, 1); - - _skyText->getText(77); - - escDelay(8000); // keep revolution up for 8 seconds - CHECK_ESC - - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(60114); - _skyScreen->paletteFadeUp(60115); - - - if (!_floppyIntro) { - return doCDIntro(); - } else { - _skyDisk->prefetchFile(FN_A_PAL); - _skyDisk->prefetchFile(FN_1A_LOG); - _skyDisk->prefetchFile(FN_1A); - - //keep gibbo up for 2 seconds - escDelay(2000); - CHECK_ESC - _skyScreen->fnFadeDown(0); - - _skyScreen->showScreen(FN_1A_LOG); - _skyScreen->paletteFadeUp(FN_A_PAL); - _skyScreen->startSequence(FN_1A); - _skyDisk->prefetchFile(FN_1B); - WAIT_SEQUENCE; - - _skyScreen->startSequence(FN_1B); - _skyDisk->prefetchFile(FN_1C); - WAIT_SEQUENCE; - - _skyScreen->startSequence(FN_1C); - _skyDisk->prefetchFile(FN_1D); - WAIT_SEQUENCE; - - _skyScreen->startSequence(FN_1D); - _skyDisk->prefetchFile(FN_1E); - WAIT_SEQUENCE; - - _skyScreen->startSequence(FN_1E); - - uint8 *vgaData, *diffData, *vgaPointer, *diffPointer, *scrollData; - uint8 *currScreenPos; - vgaData = _skyDisk->loadFile(60100, NULL); - vgaPointer = vgaData; - diffData = _skyDisk->loadFile(60101, NULL); - diffPointer = diffData + 2; - uint16 noFrames = READ_LE_UINT16(diffData); - - _skyDisk->prefetchFile(FN_4A); - - WAIT_SEQUENCE; - - - //set up the scrolling intro - scrollData = (byte *)malloc(GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT * 2); - //clear the base - memset(scrollData, 0, GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT); - memcpy(scrollData + (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT), _skyScreen->giveCurrent(), GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT); - currScreenPos = scrollData + (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT); - - byte scrollByte; - for (uint16 frameCounter = 1; frameCounter < noFrames; frameCounter++) { - scrollByte = *diffPointer++; - if (scrollByte) - currScreenPos -= scrollByte * GAME_SCREEN_WIDTH; - - delay(40); - if (_key_pressed == 27) { - REMOVE_INTRO; + + uint16 *seqData = _mainIntroSeq; + while (*seqData != SEQEND) { + if (!nextPart(seqData)) + return false; + } + if (floppyIntro) + seqData = _floppyIntroSeq; + else + seqData = _cdIntroSeq; + + while (*seqData != SEQEND) { + if (!nextPart(seqData)) + return false; + } + return true; +} + +bool SkyIntro::nextPart(uint16 *&data) { + + uint8 *vData = NULL; + // return false means cancel intro + uint16 command = *data++; + switch (command) { + case SHOWSCREEN: + _skyScreen->showScreen(*data++); + return true; + case FADEUP: + _skyScreen->paletteFadeUp(*data++); + return true; + case FADEDOWN: + _skyScreen->fnFadeDown(0); + return true; + case DELAY: + if (!escDelay(*data++)) return false; + return true; + case DOFLIRT: + _skyScreen->startSequence(*data++); + while (_skyScreen->sequenceRunning()) + if (!escDelay(50)) + return false; + return true; + case SCROLLFLIRT: + return floppyScrollFlirt(); + case COMMANDFLIRT: + return commandFlirt(data); + case STOPFLIRT: + _skyScreen->stopSequence(); + return true; + case STARTMUSIC: + _skyMusic->startMusic(*data++); + return true; + case WAITMUSIC: + while (_skyMusic->musicIsPlaying()) + if (!escDelay(50)) + return false; + return true; + case BGFLIRT: + _skyScreen->startSequence(*data++); + return true; + case WAITFLIRT: + while (_skyScreen->sequenceRunning()) + if (!escDelay(50)) + return false; + return true; + case PLAYVOICE: + if (!escDelay(200)) + return false; + vData = _skyDisk->loadFile(*data++, NULL); + _mixer->playRaw(&_voice, vData, _skyDisk->_lastLoadedFileSize, 11025, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_UNSIGNED); + return true; + case WAITVOICE: + while (_voice) + if (!escDelay(50)) + return false; + return true; + case LOADBG: + if (_bgBuf) { + if (_bgSfx) { + data++; + return true; + } + free(_bgBuf); } - - //non-scrolling frame update - introFrame(&diffPointer, &vgaPointer, currScreenPos); - _skyScreen->showScreen(currScreenPos); - } - memcpy(_skyScreen->giveCurrent(), currScreenPos, GAME_SCREEN_HEIGHT * GAME_SCREEN_WIDTH); - _skyScreen->startSequence(FN_4A); - free(scrollData); - free(vgaData); - free(diffData); - commandPtr = (uint32 *)anim4aCommands; - _skyDisk->prefetchFile(FN_4B); - _skyDisk->prefetchFile(FN_4B_LOG); - WAIT_SEQUENCE; - - _skyScreen->showScreen(FN_4B_LOG); - commandPtr = (uint32 *)cockpitCommands; - _skyScreen->startSequence(FN_4B); - checkCommands(commandPtr); - checkCommands(commandPtr); - _skyDisk->prefetchFile(FN_4C); - WAIT_SEQUENCE; //4b - - _skyScreen->showScreen(FN_4C_LOG); - _skyScreen->startSequence(FN_4C); - commandPtr = (uint32 *)anim4cCommands; - WAIT_SEQUENCE; //4c - - _skyDisk->prefetchFile(FN_5_PAL); - _skyDisk->prefetchFile(FN_5_LOG); - _skyDisk->prefetchFile(FN_5); - - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(FN_5_LOG); - _skyScreen->paletteFadeUp(FN_5_PAL); - - _skyScreen->startSequence(FN_5); - - commandPtr = (uint32 *)anim5Commands; - - _skyDisk->prefetchFile(FN_6_PAL); - _skyDisk->prefetchFile(FN_6_LOG); - _skyDisk->prefetchFile(FN_6A); - - WAIT_SEQUENCE; - - // There is no synchronization mechanism between the music and - // the graphics. Which means that there is no guarantee that - // they both end at the same time. So just to be safe, wait - // for the music to stop before continuing with the final part. - // - // This part of the intro looks pretty nice even as a static - // image, so it makes sense to do the waiting before fading - // down the palette. - - WAIT_MUSIC; - - _skyScreen->fnFadeDown(0); - _skyScreen->showScreen(FN_6_LOG); - - _skyMusic->startMusic(2); - _skyScreen->paletteFadeUp(FN_6_PAL); - - _skyScreen->startSequence(FN_6A); - _skyDisk->prefetchFile(FN_6B); - - commandPtr = (uint32 *)anim6aCommands; - WAIT_SEQUENCE; //6a - - _skyScreen->startSequence(FN_6B); - commandPtr = (uint32 *)anim6bCommands; - WAIT_SEQUENCE; //6b + _bgBuf = _skyDisk->loadFile(*data++, NULL); + _bgSize = _skyDisk->_lastLoadedFileSize; + return true; + case PLAYBG: + _mixer->playRaw(&_bgSfx, _bgBuf + 256, _bgSize - 768, 11025, SoundMixer::FLAG_UNSIGNED); + return true; + default: + error("Unknown intro command %X", command); } return true; } -void SkyState::introFrame(uint8 **diffPtr, uint8 **vgaPtr, uint8 *screenData) { - - uint32 scrPos = 0; - uint8 nrToSkip, nrToDo; - - do { - do { - nrToSkip = **diffPtr; - (*diffPtr)++; - scrPos += nrToSkip; - } while (nrToSkip == 255); - - do { - nrToDo = **diffPtr; - (*diffPtr)++; - memcpy(screenData + scrPos, *vgaPtr, nrToDo); - scrPos += nrToDo; - *vgaPtr += nrToDo; - } while (nrToDo == 255); - - } while (scrPos < GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT); -} - -void SkyState::checkCommands(uint32 *&cmdPtr) { - - //check for sequence commands - assert (cmdPtr != NULL); - - uint32 afterFrame = *(cmdPtr); - - if (afterFrame >= _skyScreen->seqFramesLeft()) { - - //do a command - uint32 command = *(cmdPtr + 1); - (this->*commandRoutines[command])(cmdPtr); - } -} - -void SkyState::prepareText(uint32 *&cmdPtr) { - - uint32 textNum = *(cmdPtr + 2); - _skyText->getText(textNum); - _skyText->displayText(_introTextSpace, true, INTRO_TEXT_WIDTH, 255); - cmdPtr += 3; -} - -#define _workScreen _skyScreen->giveCurrent() -void SkyState::showIntroText(uint32 *&cmdPtr) { - - uint32 xPos = *(cmdPtr + 2); - uint32 yPos = *(cmdPtr + 3); - uint32 startPos = (yPos * FULL_SCREEN_WIDTH) + xPos; - byte *destBuf = _introTextSpace; - byte *saveBuf = _introTextSave; - uint16 width = ((struct dataFileHeader *)destBuf)->s_width; - uint16 height = ((struct dataFileHeader *)destBuf)->s_height; - - *(uint32 *)saveBuf = TO_LE_32(startPos); - *(uint32 *)(saveBuf + 4) = TO_LE_32(height); - *(uint32 *)(saveBuf + 8) = TO_LE_32(width); - saveBuf += 12; - - //save current screen contents - byte *savePtr = (byte *)_workScreen + startPos; - - uint i, j; - - for (i = 0; i < height; i++) { - memcpy(saveBuf, savePtr, width); - saveBuf += width; - savePtr += GAME_SCREEN_WIDTH; +bool SkyIntro::floppyScrollFlirt(void) { + + uint8 *scrollScreen = (uint8*)malloc(FRAME_SIZE * 2); + memset(scrollScreen, 0, FRAME_SIZE); + memcpy(scrollScreen + FRAME_SIZE, _skyScreen->giveCurrent(), FRAME_SIZE); + uint8 *scrollPos = scrollScreen + FRAME_SIZE; + uint8 *vgaData = _skyDisk->loadFile(60100, NULL); + uint8 *diffData = _skyDisk->loadFile(60101, NULL); + uint16 frameNum = READ_LE_UINT16(diffData); + uint8 *diffPtr = diffData + 2; + uint8 *vgaPtr = vgaData; + bool doContinue = true; + + for (uint16 frameCnt = 1; (frameCnt < frameNum) && doContinue; frameCnt++) { + uint8 scrollVal = *diffPtr++; + if (scrollVal) + scrollPos -= scrollVal * GAME_SCREEN_WIDTH; + + uint16 scrPos = 0; + while (scrPos < FRAME_SIZE) { + uint8 nrToDo, nrToSkip; + do { + nrToSkip = *diffPtr++; + scrPos += nrToSkip; + } while (nrToSkip == 255); + do { + nrToDo = *diffPtr++; + memcpy(scrollPos + scrPos, vgaPtr, nrToDo); + scrPos += nrToDo; + vgaPtr += nrToDo; + } while (nrToDo == 255); + } + _system->copy_rect(scrollPos, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT); + _system->update_screen(); + if (!escDelay(40)) + doContinue = false; } + memcpy(_skyScreen->giveCurrent(), scrollPos, FRAME_SIZE); + free(diffData); + free(vgaData); + free(scrollScreen); + return doContinue; +} - //now print the text - - byte *textBuf = _introTextSpace + sizeof(struct dataFileHeader); - byte *curPos = (byte *)_workScreen + startPos; - - for (i = 0; i < height; i++) { - - byte *prevPos = curPos; - - for (j = 0; j < width; j++) { - - uint8 pixel = *textBuf++; - if (pixel) - *curPos = pixel; - - curPos++; +bool SkyIntro::commandFlirt(uint16 *&data) { + + _skyScreen->startSequence(*data++); + while ((*data != COMMANDEND) || _skyScreen->sequenceRunning()) { + while ((_skyScreen->seqFramesLeft() < *data)) { + data++; + uint16 command = *data++; + switch(command) { + case IC_PREPARE_TEXT: + _skyText->getText(*data++); + _skyText->displayText(_textBuf, true, INTRO_TEXT_WIDTH, 255); + break; + case IC_SHOW_TEXT: + ((dataFileHeader*)_textBuf)->s_x = *data++; + ((dataFileHeader*)_textBuf)->s_y = *data++; + showTextBuf(); + break; + case IC_REMOVE_TEXT: + restoreScreen(); + break; + case IC_MAKE_SOUND: + _skySound->playSound(data[0], data[1], 0); + data += 2; + break; + case IC_FX_VOLUME: + _skySound->playSound(1, *data++, 0); + break; + default: + error("Unknown FLIRT command %X\n", command); + } + } + if (!escDelay(50)) { + _skyScreen->stopSequence(); + return false; } - - curPos = prevPos + GAME_SCREEN_WIDTH; } - - cmdPtr += 4; - _system->copy_rect(_workScreen + startPos, GAME_SCREEN_WIDTH, xPos, yPos, width, height); - _system->update_screen(); + data++; // move pointer over "COMMANDEND" + return true; } -void SkyState::removeText(uint32 *&cmdPtr) { - - byte *saveBuf = _introTextSave; - uint32 startPos = READ_LE_UINT32(saveBuf); - uint32 height = READ_LE_UINT32(saveBuf + 4); - uint32 width = READ_LE_UINT32(saveBuf + 8); - byte *dest = _workScreen + startPos; - saveBuf += 12; - - for (unsigned int i = 0; i < height; i++) { - memcpy(dest, saveBuf, width); +void SkyIntro::showTextBuf(void) { + + uint16 x = ((dataFileHeader*)_textBuf)->s_x; + uint16 y = ((dataFileHeader*)_textBuf)->s_y; + uint16 width = ((dataFileHeader*)_textBuf)->s_width; + uint16 height = ((dataFileHeader*)_textBuf)->s_height; + uint8 *screenBuf = _skyScreen->giveCurrent() + y * GAME_SCREEN_WIDTH + x; + memcpy(_saveBuf, _textBuf, sizeof(dataFileHeader)); + uint8 *saveBuf = _saveBuf + sizeof(dataFileHeader); + uint8 *textBuf = _textBuf + sizeof(dataFileHeader); + for (uint16 cnty = 0; cnty < height; cnty++) { + memcpy(saveBuf, screenBuf, width); + for (uint16 cntx = 0; cntx < width; cntx++) + if (textBuf[cntx]) + screenBuf[cntx] = textBuf[cntx]; + screenBuf += GAME_SCREEN_WIDTH; + textBuf += width; saveBuf += width; - dest += FULL_SCREEN_WIDTH; } - - cmdPtr += 2; - _system->copy_rect(_workScreen + startPos, GAME_SCREEN_WIDTH, startPos % GAME_SCREEN_WIDTH, startPos / GAME_SCREEN_WIDTH, width, height); - _system->update_screen(); + screenBuf = _skyScreen->giveCurrent() + y * GAME_SCREEN_WIDTH + x; + _system->copy_rect(screenBuf, GAME_SCREEN_WIDTH, x, y, width, height); } -#undef _workScreen -void SkyState::introFx(uint32 *&cmdPtr) { - - _mixer->stopAll(); - _skySound->playSound((uint16)cmdPtr[2], (uint16)cmdPtr[3], 0); - cmdPtr += 4; +void SkyIntro::restoreScreen(void) { + + uint16 x = ((dataFileHeader*)_saveBuf)->s_x; + uint16 y = ((dataFileHeader*)_saveBuf)->s_y; + uint16 width = ((dataFileHeader*)_saveBuf)->s_width; + uint16 height = ((dataFileHeader*)_saveBuf)->s_height; + uint8 *screenBuf = _skyScreen->giveCurrent() + y * GAME_SCREEN_WIDTH + x; + uint8 *saveBuf = _saveBuf + sizeof(dataFileHeader); + for (uint16 cnt = 0; cnt < height; cnt++) { + memcpy(screenBuf, saveBuf, width); + screenBuf += GAME_SCREEN_WIDTH; + saveBuf += width; + } + _system->copy_rect(_saveBuf + sizeof(dataFileHeader), width, x, y, width, height); } -void SkyState::introVol(uint32 *&cmdPtr) { +bool SkyIntro::escDelay(uint32 msecs) { - // HACK: for some reason, the mixer will only stop playing - // looping sounds if you do it using SoundMixer::stopAll(); - _mixer->stopAll(); - _skySound->playSound(1, (uint16)(cmdPtr[2] & 0x7F), 0); - cmdPtr += 3; + OSystem::Event event; + do { + while (_system->poll_event(&event)) { + if (event.event_code == OSystem::EVENT_KEYDOWN) { + if (event.kbd.keycode == 27) + return false; + } else if (event.event_code == OSystem::EVENT_QUIT) { + _quitProg = true; + return false; + } + } + uint8 nDelay = (msecs > 50)?(50):((uint8)msecs); + _system->delay_msecs(nDelay); + msecs -= nDelay; + } while (msecs > 0); + return true; } diff --git a/sky/intro.h b/sky/intro.h new file mode 100644 index 0000000000..396cab5e50 --- /dev/null +++ b/sky/intro.h @@ -0,0 +1,61 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2003 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +#ifndef INTRO_H +#define INTRO_H + +#include "sky/screen.h" +#include "sky/disk.h" + +class SkyIntro { +public: + SkyIntro(SkyDisk *disk, SkyScreen *screen, SkyMusicBase *music, SkySound *sound, SkyText *text, SoundMixer *mixer, OSystem *system); + ~SkyIntro(void); + bool doIntro(bool floppyIntro); + bool _quitProg; +private: + static uint16 _mainIntroSeq[]; + static uint16 _floppyIntroSeq[]; + static uint16 _cdIntroSeq[]; + + SkyDisk *_skyDisk; + SkyScreen *_skyScreen; + SkyMusicBase *_skyMusic; + SkySound *_skySound; + SkyText *_skyText; + OSystem *_system; + SoundMixer *_mixer; + + uint8 *_textBuf, *_saveBuf; + uint8 *_bgBuf; + uint32 _bgSize; + PlayingSoundHandle _voice, _bgSfx; + + bool escDelay(uint32 msecs); + bool nextPart(uint16 *&data); + bool floppyScrollFlirt(void); + bool commandFlirt(uint16 *&data); + void showTextBuf(void); + void restoreScreen(void); +}; + +#endif // INTRO_H + diff --git a/sky/module.mk b/sky/module.mk index 90f17eb527..e6e157b6b7 100644 --- a/sky/module.mk +++ b/sky/module.mk @@ -2,7 +2,6 @@ MODULE := sky MODULE_OBJS = \ sky/autoroute.o \ - sky/cd_intro.o \ sky/compact.o \ sky/debug.o \ sky/disk.o \ diff --git a/sky/sky.cpp b/sky/sky.cpp index 01ddd1d41f..def1af0eed 100644 --- a/sky/sky.cpp +++ b/sky/sky.cpp @@ -92,9 +92,6 @@ SkyState::SkyState(GameDetector *detector, OSystem *syst) _detector = detector; _floppyIntro = detector->_floppyIntro; - - _introTextSpace = 0; - _introTextSave = 0; } SkyState::~SkyState() { @@ -111,6 +108,12 @@ void SkyState::errorString(const char *buf1, char *buf2) { strcpy(buf2, buf1); } +void SkyState::initVirgin() { + + _skyScreen->setPalette(60111); + _skyScreen->showScreen(60110); +} + uint8 SkyState::_languageTable[11] = { SKY_USA, // EN_USA SKY_GERMAN, // DE_DEU @@ -179,11 +182,15 @@ void SkyState::go() { bool introSkipped = false; if (!_quickLaunch) { - if (_systemVars.gameVersion > 267) // don't do intro for floppydemos - introSkipped = !intro(); - - _skyDisk->flushPrefetched(); - + if (_systemVars.gameVersion > 267) {// don't do intro for floppydemos + _skyIntro = new SkyIntro(_skyDisk, _skyScreen, _skyMusic, _skySound, _skyText, _mixer, _system); + introSkipped = !_skyIntro->doIntro(_floppyIntro); + if (_skyIntro->_quitProg) { + delete _skyIntro; + _skyControl->showGameQuitMsg(); + } + delete _skyIntro; + } loadBase0(); } @@ -38,6 +38,7 @@ #include "sky/music/mt32music.h" #include "sky/mouse.h" #include "sky/control.h" +#include "sky/intro.h" #include "common/config-file.h" struct SystemVars { @@ -55,6 +56,7 @@ struct SystemVars { class SkyLogic; class SkyScreen; class SkyControl; +class SkyIntro; class SkyState : public Engine { void errorString(const char *buf_input, char *buf_output); @@ -63,12 +65,6 @@ protected: byte _key_pressed; static uint8 _languageTable[11]; bool _quickLaunch; // set when starting with -x - - //intro related - - byte *_introTextSpace; - byte *_introTextSave; - bool _floppyIntro; uint16 _debugMode; @@ -92,6 +88,7 @@ protected: SkyControl *_skyControl; SkyMusicBase *_skyMusic; + SkyIntro *_skyIntro; GameDetector *_detector; // necessary for music public: @@ -108,13 +105,6 @@ public: static SystemVars _systemVars; - //intro related - void prepareText(uint32 *&cmdPtr); - void showIntroText(uint32 *&cmdPtr); - void removeText(uint32 *&cmdPtr); - void introFx(uint32 *&cmdPtr); - void introVol(uint32 *&cmdPtr); - protected: void logic_engine(); void delay(uint amount); @@ -122,12 +112,8 @@ protected: void doCheat(uint8 num); void handleKey(void); - //intro related static uint8 fosterImg[297 * 143]; static uint8 fosterPal[256 * 3]; - void checkCommands(uint32 *&cmdPtr); - void introFrame(uint8 **diffPtr, uint8 **vgaPtr, uint8 *screenData); - void escDelay(uint32 pDelay); uint32 _lastSaveTime; SkyText *getSkyText(); @@ -135,17 +121,12 @@ protected: void initItemList(); void initVirgin(); - bool intro(); - bool doCDIntro(); - void startTimerSequence(byte *sequence); static void timerHandler(void *ptr); void gotTimerTick(); void loadFixedItems(); void loadBase0(); static int CDECL game_thread_proc(void *param); - - void shutdown(); }; #endif |