Ticket #7559: sky-hack4c.diff

File sky-hack4c.diff, 10.7 KB (added by eriktorbjorn, 6 years ago)

Updated patch

  • engines/sky/intro.cpp

    diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp
    index d4476e2916..00b1e51248 100644
    a b namespace Sky {  
    6060#define PLAYBG                  15 // play background sound
    6161#define LOOPBG                  16 // loop background sound
    6262#define STOPBG                  17 // stop background sound
     63#define CLEARBOTTOM             18 // clear the screen
    6364#define SEQEND           65535 // end of intro sequence
    6465
     66// Modifier flag for SHOWSCREEN when we want the image to cover the entire
     67// screen.
     68#define FULLSCREEN              0x8000
     69
    6570#define IC_PREPARE_TEXT 20 // commands used in COMMANDFLIRT block
    6671#define IC_SHOW_TEXT    21
    6772#define IC_REMOVE_TEXT  22
    uint16 Intro::_cdIntroSeq[] = {  
    331336        WAITFLIRT,
    332337        WAITVOICE,
    333338        FADEDOWN,
    334         SHOWSCREEN,     CD_19_LOG,
     339        SHOWSCREEN | FULLSCREEN,        CD_19_LOG,
    335340        FADEUP,         CD_19_PAL,
    336341        PLAYVOICE,      CDV_19,         // Joey: "Foster! (zzzt) H-Help!"
    337342        WAITVOICE,
    338343        PLAYVOICE,      CDV_20,         // Joey: "Better make my next body move faster, Foster..."
    339344        FADEDOWN,
    340         SHOWSCREEN,     CD_20_LOG,
     345        SHOWSCREEN | FULLSCREEN,        CD_20_LOG,
    341346        FADEUP,         CD_19_PAL,
    342347        WAITVOICE,
    343348        LOADBG,         59496, // quiet heli
    344349        LOOPBG,
    345350        PLAYVOICE,      CDV_21,         // Foster: "He was only a robot, but, well, I loved the little guy."
    346351        FADEDOWN,
    347         SHOWSCREEN,     CD_21_LOG,
     352        SHOWSCREEN | FULLSCREEN,        CD_21_LOG,
    348353        FADEUP,         CD_19_PAL,
    349354        WAITVOICE,
    350355        PLAYVOICE,      CDV_22,         // Foster: "Then, as suddenly as it started, the shooting stopped."
    uint16 Intro::_cdIntroSeq[] = {  
    355360        /* fade down while Foster's saying his line */
    356361        FADEDOWN,
    357362        WAITVOICE,
    358         SHOWSCREEN,     CD_24_LOG,
     363        SHOWSCREEN | FULLSCREEN,        CD_24_LOG,
    359364        FADEUP,         CD_23_PAL,
    360365        PLAYVOICE,      CDV_24,         // Reich: "Whoever is in charge here, come forward..."
    361366        WAITVOICE,
    uint16 Intro::_cdIntroSeq[] = {  
    364369        PLAYVOICE,      CDV_26,         // Foster: "Only a fool would have argued with that firepower."
    365370        WAITVOICE,
    366371        FADEDOWN,
    367         SHOWSCREEN,     CD_27_LOG,
     372        SHOWSCREEN | FULLSCREEN,        CD_27_LOG,
    368373        FADEUP,         CD_27_PAL,
    369374        PLAYVOICE,      CDV_27,         // Shaman: "... I am the leader of these people... We are peaceful..."
    370375        WAITVOICE,
    uint16 Intro::_cdIntroSeq[] = {  
    374379        WAITVOICE,
    375380        BGFLIRT,        CD_27,
    376381                PLAYVOICE,      CDV_31, // Reich: "We're looking for someone..."
     382                WAITFLIRT,
     383                CLEARBOTTOM,
    377384                WAITVOICE,
    378385                PLAYVOICE,      CDV_32, // Reich: "Someone who doesn't belong here..."
    379386                WAITVOICE,
    380387                PLAYVOICE,      CDV_33, // Reich: "Who wasn't born in this garbage dump..."
    381388                WAITVOICE,
    382389                PLAYVOICE,      CDV_34, // Reich: "Who came from the city as a child..."
    383         WAITFLIRT,
    384390        WAITVOICE,
    385391        PLAYVOICE,      CDV_35,         // Reich: "We want to take him home again."
    386392        WAITVOICE,
    387393        PLAYVOICE,      CDV_36,         // Foster: "My mind racing, I remembered where I'd seen that symbol before..."
    388394                FADEDOWN,
    389                 SHOWSCREEN,     CD_35_LOG,
     395                SHOWSCREEN | FULLSCREEN,        CD_35_LOG,
    390396                FADEUP,         CD_35_PAL,
    391397        WAITVOICE,
    392398        PLAYVOICE,      CDV_37,         // Foster: "It was the day the tribe found me..."
    393399                DOFLIRT,        CD_35,
     400        CLEARBOTTOM,
    394401        WAITVOICE,
    395402        PLAYVOICE,      CDV_38,         // Foster: "The day of the crash..."
    396403                DOFLIRT,        CD_37,
    uint16 Intro::_cdIntroSeq[] = {  
    398405        PLAYVOICE,      CDV_39,         // Foster: "The day my mother died."
    399406        WAITVOICE,
    400407        FADEDOWN,
    401         SHOWSCREEN,     CD_40_LOG,
     408        SHOWSCREEN | FULLSCREEN,        CD_40_LOG,
    402409        FADEUP,         CD_40_PAL,
    403410        PLAYVOICE,      CDV_40,         // Shaman: "You alright, city boy?"
    404411        WAITVOICE,
    uint16 Intro::_cdIntroSeq[] = {  
    407414        PLAYVOICE,      CDV_42,         // Foster: "R-Robert."
    408415        WAITVOICE,
    409416        FADEDOWN,
    410         SHOWSCREEN,     CD_43_LOG,
     417        SHOWSCREEN | FULLSCREEN,        CD_43_LOG,
    411418        FADEUP,         CD_43_PAL,
    412419        PLAYVOICE,      CDV_43,         // Shaman: "Hah! Welcome to the Gap, Robert!"
    413420        WAITVOICE,
    uint16 Intro::_cdIntroSeq[] = {  
    421428        DOFLIRT,        CD_45,
    422429        WAITVOICE,
    423430        FADEDOWN,
    424         SHOWSCREEN,     CD_47_LOG,
     431        SHOWSCREEN | FULLSCREEN,        CD_47_LOG,
    425432        FADEUP,         CD_47_PAL,
    426433        PLAYVOICE,      CDV_47,         // Foster: "His tribe was poor, but they treated me like one of their own..."
    427434        WAITVOICE,
    428435        PLAYVOICE,      CDV_48,         // Foster: "I learned how to survive in the wasteland they called the Gap..."
    429436        FADEDOWN,
    430         SHOWSCREEN,     CD_48_LOG,
     437        SHOWSCREEN | FULLSCREEN,        CD_48_LOG,
    431438        FADEUP,         CD_48_PAL,
    432439        WAITVOICE,
    433440        BGFLIRT,        CD_48,
    uint16 Intro::_cdIntroSeq[] = {  
    500507        FADEDOWN,
    501508        PLAYVOICE,      CDV_71,         // Reich: "Good. Detonate."
    502509        WAITVOICE,
    503         SHOWSCREEN,     CD_72_LOG,
     510        SHOWSCREEN | FULLSCREEN,        CD_72_LOG,
    504511        FADEUP,         CD_72_PAL,
    505512        PLAYVOICE,      CDV_72,         // Foster: "Much too late."
    506513        WAITVOICE,
    507514        FADEDOWN,
    508         SHOWSCREEN,     CD_73_LOG,
     515        SHOWSCREEN | FULLSCREEN,        CD_73_LOG,
    509516        FADEUP,         CD_73_PAL,
    510517        PLAYVOICE,      CDV_73,         // Foster: "Why, you murdering..."
    511518        WAITVOICE,
    uint16 Intro::_cdIntroSeq[] = {  
    513520        WAITVOICE,
    514521        PLAYVOICE,      CDV_75,         // Foster: "All I could do was wait."
    515522        FADEDOWN,
    516         SHOWSCREEN,     CD_76_LOG,
     523        SHOWSCREEN | FULLSCREEN,        CD_76_LOG,
    517524        FADEUP,         CD_76_PAL,
    518525        WAITVOICE,
    519526        PLAYVOICE,      CDV_76,         // Foster: "Just like on a hunt. Just like the old man taught me."
    uint16 Intro::_cdIntroSeq[] = {  
    521528        PLAYVOICE,      CDV_77,         // Foster: "Wait... and be ready."
    522529        WAITVOICE,
    523530        FADEDOWN,
     531        CLEARBOTTOM,
    524532        SHOWSCREEN,     CD_78_LOG,
    525533        FADEUP,         CD_78_PAL,
    526534        PLAYVOICE,      CDV_78,         // Foster: "It was dawn when we reached the City."
    uint16 Intro::_cdIntroSeq[] = {  
    544552                PLAYVOICE,      CDV_85, // Guard: "We're going to HIT!"
    545553                WAITVOICE,
    546554        WAITFLIRT,
     555        CLEARBOTTOM,
    547556        SHOWSCREEN,     CD_102_LOG,
    548557        PLAYVOICE,      CDV_86,         // Foster: "Maybe I'd get some answers now."
    549558        DOFLIRT,        CD_102,
    550559        FADEDOWN,
     560        // This one could be fullscreen, but that causes animation glitches.
    551561        SHOWSCREEN,     CD_103_LOG,
    552562        FADEUP,         CD_103_PAL,
    553563        BGFLIRT,        CD_103,
    uint16 Intro::_cdIntroSeq[] = {  
    557567        WAITVOICE,
    558568        STARTMUSIC,     2,
    559569        FADEDOWN,
    560         SHOWSCREEN,     CD_104_LOG,
     570        SHOWSCREEN | FULLSCREEN,        CD_104_LOG,
    561571        FADEUP,         CD_104_PAL,
    562572        DOFLIRT,        CD_104,
    563573        DOFLIRT,        CD_105,
    uint16 Intro::_cdIntroSeq[] = {  
    565575};
    566576
    567577uint16 Intro::_floppyIntroSeq[] = {
     578        // This one could be fullscreen, but that causes animation glitches.
    568579        SHOWSCREEN,   60081,
    569580        FADEUP,       60080,
    570581        DOFLIRT,      60082,
    uint16 Intro::_floppyIntroSeq[] = {  
    591602                  35, IC_SHOW_TEXT,     30, 160,
    592603                   3, IC_REMOVE_TEXT,
    593604        COMMANDEND,
     605        CLEARBOTTOM,
    594606        SHOWSCREEN,   60090,
    595607        COMMANDFLIRT, 60091, // => command list 4c
    596608                1000, IC_FX_VOLUME, 100,
    uint16 Intro::_floppyIntroSeq[] = {  
    599611                   4, IC_FX_VOLUME, 127,
    600612        COMMANDEND,
    601613        FADEDOWN,
     614        // This one could be fullscreen, but that causes animation glitches.
    602615        SHOWSCREEN,  60093,
    603616        FADEUP,       60092,
    604617        COMMANDFLIRT, 60094, // => command list 5
    uint16 Intro::_floppyIntroSeq[] = {  
    606619        COMMANDEND,
    607620        WAITMUSIC,
    608621        FADEDOWN,
    609         SHOWSCREEN,   60096,
     622        SHOWSCREEN | FULLSCREEN,   60096,
    610623        STARTMUSIC,       2,
    611624        FADEUP,       60095,
    612625        COMMANDFLIRT, 60097, // => command list 6a
    bool Intro::nextPart(uint16 *&data) {  
    685698
    686699        // return false means cancel intro
    687700        uint16 command = *data++;
    688         switch (command) {
     701        switch (command & 0x7fff) {
    689702        case SHOWSCREEN:
    690                 _skyScreen->showScreen(*data++);
     703                _skyScreen->showScreen(*data++, (command & FULLSCREEN) ? true : false);
    691704                return true;
    692705        case FADEUP:
    693706                _skyScreen->paletteFadeUp(*data++);
    bool Intro::nextPart(uint16 *&data) {  
    767780        case STOPBG:
    768781                _mixer->stopID(SOUND_BG);
    769782                return true;
     783        case CLEARBOTTOM:
     784                {
     785                        byte *screenBuf = _skyScreen->giveCurrent() + GAME_SCREEN_HEIGHT * GAME_SCREEN_WIDTH;
     786                        memset(screenBuf, 0, GAME_SCREEN_WIDTH * (FULL_SCREEN_HEIGHT - GAME_SCREEN_HEIGHT));
     787                        _system->copyRectToScreen(screenBuf, GAME_SCREEN_WIDTH, 0, GAME_SCREEN_HEIGHT, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT - GAME_SCREEN_HEIGHT);
     788                        _system->updateScreen();
     789                }
     790                return true;
    770791        default:
    771792                error("Unknown intro command %X", command);
    772793        }
  • engines/sky/screen.cpp

    diff --git a/engines/sky/screen.cpp b/engines/sky/screen.cpp
    index c96b449162..b91403c6bf 100644
    a b Screen::~Screen() {  
    9696        free(_scrollScreen);
    9797}
    9898
    99 void Screen::clearScreen() {
     99void Screen::clearScreen(bool fullscreen) {
    100100        memset(_currentScreen, 0, FULL_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
    101         _system->copyRectToScreen(_currentScreen, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT);
     101        _system->copyRectToScreen(_currentScreen, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, fullscreen ? FULL_SCREEN_HEIGHT : GAME_SCREEN_HEIGHT);
    102102        _system->updateScreen();
    103103}
    104104
    void Screen::setPalette(uint16 fileNum) {  
    146146                warning("Screen::setPalette: can't load file nr. %d",fileNum);
    147147}
    148148
    149 void Screen::showScreen(uint16 fileNum) {
     149  void Screen::showScreen(uint16 fileNum, bool fullscreen) {
    150150        // This is only used for static images in the floppy and cd intro
    151151        free(_currentScreen);
    152152        _currentScreen = _skyDisk->loadFile(fileNum);
    153         // make sure the last 8 lines are forced to black.
    154         memset(_currentScreen + GAME_SCREEN_HEIGHT * GAME_SCREEN_WIDTH, 0, (FULL_SCREEN_HEIGHT - GAME_SCREEN_HEIGHT) * GAME_SCREEN_WIDTH);
     153        if (!fullscreen) {
     154                // make sure the last 8 lines are forced to black.
     155                memset(_currentScreen + GAME_SCREEN_HEIGHT * GAME_SCREEN_WIDTH, 0, (FULL_SCREEN_HEIGHT - GAME_SCREEN_HEIGHT) * GAME_SCREEN_WIDTH);
     156        }
    155157
    156158        if (_currentScreen)
    157                 showScreen(_currentScreen);
     159                showScreen(_currentScreen, fullscreen);
    158160        else
    159161                warning("Screen::showScreen: can't load file nr. %d",fileNum);
    160162}
    161163
    162 void Screen::showScreen(uint8 *pScreen) {
    163         _system->copyRectToScreen(pScreen, 320, 0, 0, GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT);
     164void Screen::showScreen(uint8 *pScreen, bool fullscreen) {
     165        _system->copyRectToScreen(pScreen, 320, 0, 0, GAME_SCREEN_WIDTH, fullscreen ? FULL_SCREEN_HEIGHT : GAME_SCREEN_HEIGHT);
    164166        _system->updateScreen();
    165167}
    166168
  • engines/sky/screen.h

    diff --git a/engines/sky/screen.h b/engines/sky/screen.h
    index fa04cd91c3..f8ddd212f8 100644
    a b public:  
    6464        void paletteFadeUp(uint8 *pal);
    6565        void paletteFadeUp(uint16 fileNr);
    6666
    67         void showScreen(uint16 fileNum);
    68         void showScreen(uint8 *pScreen);
     67        void showScreen(uint16 fileNum, bool fullscreen = false);
     68        void showScreen(uint8 *pScreen, bool fullscreen = false);
    6969
    7070        void handleTimer();
    7171        void startSequence(uint16 fileNum);
    public:  
    8383        void fnFadeUp(uint32 palNum, uint32 scroll);
    8484        void fnFadeDown(uint32 scroll);
    8585        void fnDrawScreen(uint32 palette, uint32 scroll);
    86         void clearScreen();
     86        void clearScreen(bool fullscreen = false);
    8787        void setFocusRectangle(const Common::Rect& rect);
    8888
    8989        void recreate();
  • engines/sky/sky.cpp

    diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
    index 674bfab95b..8d569407be 100644
    a b Common::Error SkyEngine::go() {  
    187187                }
    188188
    189189                if (!shouldQuit()) {
     190                        _skyScreen->clearScreen(true);
    190191                        // restartGame() takes us to the first scene, without showing the
    191192                        // initial animation where Foster is being chased. initScreen0()
    192193                        // shows the first scene together with that animation. We can't