diff options
author | Strangerke | 2012-11-10 23:52:49 +0100 |
---|---|---|
committer | Strangerke | 2012-11-10 23:52:49 +0100 |
commit | 8290b04018080e9f0698e6f53a92e677a76460db (patch) | |
tree | 9ebce255fb912c7389b0ee16e8553765086ad8d1 /engines/hopkins | |
parent | 11d73dfc8d383e1fe8084aafdcb5a5be83de09cb (diff) | |
download | scummvm-rg350-8290b04018080e9f0698e6f53a92e677a76460db.tar.gz scummvm-rg350-8290b04018080e9f0698e6f53a92e677a76460db.tar.bz2 scummvm-rg350-8290b04018080e9f0698e6f53a92e677a76460db.zip |
HOPKINS: Split run() in two in order to prepare future diffing between versions
Diffstat (limited to 'engines/hopkins')
-rw-r--r-- | engines/hopkins/hopkins.cpp | 466 | ||||
-rw-r--r-- | engines/hopkins/hopkins.h | 4 |
2 files changed, 435 insertions, 35 deletions
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index a66012ae9f..a6ebfb6097 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -104,9 +104,31 @@ Common::Error HopkinsEngine::run() { _soundManager.WSOUND_INIT(); - if (!getIsDemo()) - _soundManager.WSOUND(16); + bool retVal; + if (getPlatform() == Common::kPlatformLinux) { + if (getIsDemo()) + retVal = runLinuxDemo(); + else + retVal = runLinuxFull(); + } else { + warning("Unhandled version, switching to linux demo"); + retVal = runLinuxDemo(); + } + + if (!retVal) + return Common::kNoError; + + // Stub event loop + Common::Event evt; + while (!g_system->getEventManager()->shouldQuit()) { + while (g_system->getEventManager()->pollEvent(evt)) + g_system->updateScreen(); + } + + return Common::kNoError; +} +bool HopkinsEngine::runLinuxDemo() { _globals.CHARGE_OBJET(); _objectsManager.CHANGE_OBJET(14); _objectsManager.AJOUTE_OBJET(14); @@ -118,33 +140,418 @@ Common::Error HopkinsEngine::run() { _graphicsManager.Cls_Video(); _graphicsManager.DD_Unlock(); - if (getIsDemo()) - _graphicsManager.LOAD_IMAGE("LINUX"); - else - _graphicsManager.LOAD_IMAGE("H2"); - + _graphicsManager.LOAD_IMAGE("LINUX"); _graphicsManager.FADE_INW(); - if (getIsDemo()) - _eventsManager.delay(1500); - else { - _eventsManager.delay(500); - _globals.vitesse = 2; - _globals.iRegul = 1; + _eventsManager.delay(1500); + _graphicsManager.FADE_OUTW(); + + if (!_globals.internet) { _graphicsManager.FADE_LINUX = 2; + _animationManager.PLAY_ANM("MP.ANM", 10, 16, 200); } + + _graphicsManager.LOAD_IMAGE("H2"); + _graphicsManager.FADE_INW(); + _eventsManager.delay(500); _graphicsManager.FADE_OUTW(); - if (getIsDemo()) { - if (!_globals.internet) { - _graphicsManager.FADE_LINUX = 2; - _animationManager.PLAY_ANM("MP.ANM", 10, 16, 200); + if (!_eventsManager.ESC_KEY) + INTRORUN(); + + _globals.iRegul = 0; + _fileManager.CONSTRUIT_SYSTEM("PERSO.SPR"); + _globals.PERSO = _fileManager.CHARGE_FICHIER(_globals.NFICHIER); + _globals.PERSO_TYPE = 0; + _globals.PLANX = _globals.PLANY = 0; + memset(_globals.SAUVEGARDE, 0, 2000); + _globals.SORTIE = 0; + _globals.PASSWORD = true; + +LABEL_12: + if (_globals.SORTIE == 300) +LABEL_13: + _globals.SORTIE = 0; + + if (!_globals.SORTIE) { + _globals.SORTIE = _menuManager.MENU(); + if (_globals.SORTIE == -1) { + if (!g_system->getEventManager()->shouldQuit()) + PUBQUIT(); + _globals.PERSO = _globals.dos_free2(_globals.PERSO); + REST_SYSTEM(); } + } + + for (;;) { + for (;;) { + for (;;) { + for (;;) { + for (;;) { + for (;;) { + for (;;) { + for (;;) { + if (g_system->getEventManager()->shouldQuit()) + return false; + + if (_globals.SORTIE == 300) + goto LABEL_13; + if (_globals.SORTIE == 18) + PASS(); + if (_globals.SORTIE == 23) + PASS(); + if (_globals.SORTIE == 22) + PASS(); + if (_globals.SORTIE == 19) + PASS(); + if (_globals.SORTIE == 20) + PASS(); + if (_globals.SORTIE != 1) + break; + + _globals.Max_Propre = 50; + _globals.Max_Ligne_Long = 40; + _globals.Max_Propre_Gen = 20; + _globals.Max_Perso_Y = 435; + _objectsManager.PERSONAGE2("IM01", "IM01", "ANIM01", "IM01", 1); + } + + if (_globals.SORTIE != 3) + break; + + if (!*((byte *)_globals.SAUVEGARDE + 170)) { + _soundManager.WSOUND(3); + if (_globals.FR == 1) + _graphicsManager.LOAD_IMAGE("fondfr"); + if (!_globals.FR) + _graphicsManager.LOAD_IMAGE("fondan"); + if (_globals.FR == 2) + _graphicsManager.LOAD_IMAGE("fondes"); + _graphicsManager.FADE_INW(); + _eventsManager.delay(500); + _graphicsManager.FADE_OUTW(); + _globals.iRegul = 1; + _soundManager.SPECIAL_SOUND = 2; + + _graphicsManager.DD_Lock(); + _graphicsManager.Cls_Video(); + _graphicsManager.DD_Unlock(); + _graphicsManager.Cls_Pal(); + _graphicsManager.FADE_LINUX = 2; + + if (!_globals.CENSURE) + _animationManager.PLAY_ANM("BANQUE.ANM", 200, 28, 200); + if (_globals.CENSURE == 1) + _animationManager.PLAY_ANM("BANKUK.ANM", 200, 28, 200); + _soundManager.SPECIAL_SOUND = 0; + _soundManager.DEL_SAMPLE(1); + _soundManager.DEL_SAMPLE(2); + _soundManager.DEL_SAMPLE(3); + _soundManager.DEL_SAMPLE(4); + *((byte *)_globals.SAUVEGARDE + 170) = 1; + } + + _globals.Max_Propre = 5; + _globals.Max_Ligne_Long = 5; + _globals.Max_Propre_Gen = 5; + _globals.Max_Perso_Y = 450; + _globals.NOSPRECRAN = 1; + _objectsManager.PERSONAGE2("IM03", "IM03", "ANIM03", "IM03", 2); + } + + if (_globals.SORTIE != 4) + break; + _globals.DESACTIVE_INVENT = true; + _objectsManager.PLAN_BETA(); + _globals.DESACTIVE_INVENT = false; + } + + if (_globals.SORTIE != 5) + break; + _globals.Max_Propre = 5; + _globals.Max_Ligne_Long = 5; + _globals.Max_Propre_Gen = 5; + _globals.Max_Perso_Y = 455; + _globals.NOSPRECRAN = 1; + byte v1 = *((byte *)_globals.SAUVEGARDE + 80); + if (v1) { + if (v1 == 1) + _objectsManager.PERSONAGE2("IM05", "IM05A", "ANIM05B", "IM05", 3); + } else { + _objectsManager.PERSONAGE2("IM05", "IM05", "ANIM05", "IM05", 3); + } + + _globals.NOSPRECRAN = 0; + } + + if (_globals.SORTIE != 8) + break; + + _globals.Max_Propre = 15; + _globals.Max_Ligne_Long = 15; + _globals.Max_Propre_Gen = 10; + _globals.Max_Perso_Y = 450; + _objectsManager.PERSONAGE2("IM08", "IM08", "ANIM08", "IM08", 2); + } + + if (_globals.SORTIE != 6) + break; + _globals.Max_Propre = 15; + _globals.Max_Ligne_Long = 20; + _globals.Max_Propre_Gen = 10; + _globals.Max_Perso_Y = 460; + _objectsManager.PERSONAGE2("IM06", "IM06", "ANIM06", "IM06", 2); + } + + if (_globals.SORTIE != 7) + break; + if (*((byte *)_globals.SAUVEGARDE + 220)) + _objectsManager.PERSONAGE("BOMBEB", "BOMBE", "BOMBE", "BOMBE", 2); + else + _objectsManager.PERSONAGE("BOMBEA", "BOMBE", "BOMBE", "BOMBE", 2); + } + + if (_globals.SORTIE == 9) { + _globals.Max_Propre = 15; + _globals.Max_Ligne_Long = 20; + _globals.Max_Propre_Gen = 10; + _globals.Max_Perso_Y = 440; + + if (!*((byte *)_globals.SAUVEGARDE + 225)) + goto LABEL_109; + _objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10); + } else { + if (_globals.SORTIE == 10) { + _globals.NOSPRECRAN = 1; + _objectsManager.PERSONAGE("IM10", "IM10", "ANIM10", "IM10", 9); + goto LABEL_124; + } + + if (_globals.SORTIE == 11) { + _globals.NOSPRECRAN = 1; + _globals.Max_Propre = 15; + _globals.Max_Ligne_Long = 20; + _globals.Max_Propre_Gen = 10; + _globals.Max_Perso_Y = 450; + _objectsManager.PERSONAGE2("IM11", "IM11", "ANIM11", "IM11", 2); + goto LABEL_124; + } + + switch (_globals.SORTIE) { + case 12: + _globals.Max_Propre = 15; + _globals.Max_Ligne_Long = 20; + _globals.Max_Propre_Gen = 10; + _globals.Max_Perso_Y = 450; + if (*((byte *)_globals.SAUVEGARDE + 225)) { + _globals.NOSPRECRAN = 1; + _objectsManager.PERSONAGE2("IM12", "IM12", "ANIM12", "IM12", 1); + } else { +LABEL_109: + BOOM(); + } + break; + case 13: + _globals.Max_Propre = 50; + _globals.Max_Ligne_Long = 40; + _globals.Max_Propre_Gen = 20; + _globals.Max_Perso_Y = 440; + _objectsManager.PERSONAGE2("IM13", "IM13", "ANIM13", "IM13", 1); + break; + case 14: + _globals.Max_Propre = 50; + _globals.Max_Ligne_Long = 40; + _globals.Max_Propre_Gen = 20; + _globals.Max_Perso_Y = 440; + _objectsManager.PERSONAGE2("IM14", "IM14", "ANIM14", "IM14", 1); + break; + default: + if (_globals.SORTIE == 15) { + _globals.NOSPRECRAN = 1; + _objectsManager.PERSONAGE("IM15", "IM15", "ANIM15", "IM15", 29); + goto LABEL_124; + } + if (_globals.SORTIE == 16) { + _globals.Max_Propre = 5; + _globals.Max_Ligne_Long = 5; + _globals.Max_Propre_Gen = 5; + _globals.Max_Perso_Y = 450; - _graphicsManager.LOAD_IMAGE("H2"); - _graphicsManager.FADE_INW(); - _eventsManager.delay(500); - _graphicsManager.FADE_OUTW(); + byte v2 = *((byte *)_globals.SAUVEGARDE + 113); + if (v2 == 1) { + _objectsManager.PERSONAGE2("IM16", "IM16A", "ANIM16", "IM16", 7); + } else if (!v2) { + _objectsManager.PERSONAGE2("IM16", "IM16", "ANIM16", "IM16", 7); + } + } else { + if (_globals.SORTIE == 17) + PASS(); + if (_globals.SORTIE == 24) + PASS(); + if (_globals.SORTIE == 25) { + _globals.Max_Propre = 15; + _globals.Max_Ligne_Long = 20; + _globals.Max_Propre_Gen = 10; + _globals.Max_Perso_Y = 445; + _objectsManager.PERSONAGE2("IM25", "IM25", "ANIM25", "IM25", 30); + } else { + if (_globals.SORTIE == 33) { + _globals.NOSPRECRAN = 1; + _objectsManager.PERSONAGE("IM33", "IM33", "ANIM33", "IM33", 8); + goto LABEL_124; + } + + if (_globals.SORTIE == 26) { + _globals.Max_Propre = 50; + _globals.Max_Ligne_Long = 40; + _globals.Max_Propre_Gen = 20; + _globals.Max_Perso_Y = 435; + _objectsManager.PERSONAGE2("IM26", "IM26", "ANIM26", "IM26", 30); + } else { + if (_globals.SORTIE == 27) + PASS(); + if (_globals.SORTIE == 28) + PASS(); + if (_globals.SORTIE == 29) + PASS(); + if (_globals.SORTIE == 30) + PASS(); + if (_globals.SORTIE == 31) + PASS(); + if (_globals.SORTIE == 35) + ENDEMO(); + if (_globals.SORTIE == 32) + PASS(); + if (_globals.SORTIE == 34) + PASS(); + + if ((uint16)(_globals.SORTIE - 51) <= 38) + PASS(); + if (_globals.SORTIE == 111) { + _globals.NOSPRECRAN = 1; + _objectsManager.PERSONAGE("IM111", "IM111", "ANIM111", "IM111", 10); + goto LABEL_124; + } + + if (_globals.SORTIE == 112) { + _globals.NOSPRECRAN = 1; + _objectsManager.PERSONAGE("IM112", "IM112", "ANIM112", "IM112", 10); +LABEL_124: + _globals.NOSPRECRAN = 0; + } else if (_globals.SORTIE == 113) { + _globals.SORTIE = 0; + _globals.OLD_ECRAN = _globals.ECRAN; + *((byte *)_globals.SAUVEGARDE + 6) = _globals.ECRAN; + _globals.ECRAN = 113; + *((byte *)_globals.SAUVEGARDE + 5) = 113; + _menuManager.COMPUT_HOPKINS(1); + + _graphicsManager.DD_Lock(); + _graphicsManager.Cls_Video(); + _graphicsManager.DD_Unlock(); + _graphicsManager.DD_VBL(); + memset(_graphicsManager.VESA_BUFFER, 0, 0x4B000u); + memset(_graphicsManager.VESA_SCREEN, 0, 0x4B000u); + _graphicsManager.Cls_Pal(); + _graphicsManager.RESET_SEGMENT_VESA(); + } else { + if (_globals.SORTIE == 114) { + _globals.SORTIE = 0; + _globals.OLD_ECRAN = _globals.ECRAN; + *((byte *)_globals.SAUVEGARDE + 6) = _globals.ECRAN; + _globals.ECRAN = 114; + *((byte *)_globals.SAUVEGARDE + 5) = 114; + _menuManager.COMPUT_HOPKINS(2); + goto LABEL_128; + } + if (_globals.SORTIE == 115) { + _globals.SORTIE = 0; + _globals.OLD_ECRAN = _globals.ECRAN; + *((byte *)_globals.SAUVEGARDE + 6) = _globals.ECRAN; + _globals.ECRAN = 115; + *((byte *)_globals.SAUVEGARDE + 5) = 115; + _menuManager.COMPUT_HOPKINS(3); + +LABEL_128: + _graphicsManager.DD_Lock(); + _graphicsManager.Cls_Video(); + _graphicsManager.DD_Unlock(); + } else if ((uint16)(_globals.SORTIE - 194) > 5) { + if (_globals.SORTIE == 151) { + _soundManager.WSOUND(16); + _globals.iRegul = 1; + + _graphicsManager.DD_Lock(); + _graphicsManager.Cls_Video(); + _graphicsManager.DD_Unlock(); + _graphicsManager.Cls_Pal(); + _graphicsManager.FADE_LINUX = 2; + _animationManager.PLAY_ANM("JOUR3A.anm", 12, 12, 2000); + _globals.iRegul = 0; + _globals.SORTIE = 300; + } + + if (_globals.SORTIE == 150) { + _soundManager.WSOUND(16); + _globals.iRegul = 1; + + _graphicsManager.DD_Lock(); + _graphicsManager.Cls_Video(); + _graphicsManager.DD_Unlock(); + _graphicsManager.Cls_Pal(); + _graphicsManager.FADE_LINUX = 2; + _animationManager.PLAY_ANM("JOUR1A.anm", 12, 12, 2000); + _globals.iRegul = 0; + _globals.SORTIE = 300; + } + + if (_globals.SORTIE == 152) { + _soundManager.WSOUND(16); + _globals.iRegul = 1; + + _graphicsManager.DD_Lock(); + _graphicsManager.Cls_Video(); + _graphicsManager.DD_Unlock(); + _graphicsManager.Cls_Pal(); + _graphicsManager.FADE_LINUX = 2; + _animationManager.PLAY_ANM("JOUR4A.anm", 12, 12, 2000); + _globals.iRegul = 0; + _globals.SORTIE = 300; + } + goto LABEL_12; + } + } + } + } + } + break; + } + } } + return true; +} + +bool HopkinsEngine::runLinuxFull() { + _soundManager.WSOUND(16); + + _globals.CHARGE_OBJET(); + _objectsManager.CHANGE_OBJET(14); + _objectsManager.AJOUTE_OBJET(14); + + _globals.HELICO = 0; + _eventsManager.MOUSE_OFF(); + + _graphicsManager.DD_Lock(); + _graphicsManager.Cls_Video(); + _graphicsManager.DD_Unlock(); + + _graphicsManager.LOAD_IMAGE("H2"); + _graphicsManager.FADE_INW(); + _eventsManager.delay(500); + + _globals.vitesse = 2; + _globals.iRegul = 1; + _graphicsManager.FADE_LINUX = 2; + _graphicsManager.FADE_OUTW(); if (!_eventsManager.ESC_KEY) INTRORUN(); @@ -156,10 +563,7 @@ Common::Error HopkinsEngine::run() { _globals.PLANX = _globals.PLANY = 0; memset(_globals.SAUVEGARDE, 0, 2000); _globals.SORTIE = 0; - if (getIsDemo()) - _globals.PASSWORD = true; - else - _globals.PASSWORD = false; + _globals.PASSWORD = false; LABEL_12: if (_globals.SORTIE == 300) @@ -185,7 +589,7 @@ LABEL_13: for (;;) { for (;;) { if (g_system->getEventManager()->shouldQuit()) - return Common::kNoError; + return false; if (_globals.SORTIE == 300) goto LABEL_13; @@ -521,15 +925,7 @@ LABEL_128: } } } - - // Stub event loop - Common::Event evt; - while (!g_system->getEventManager()->shouldQuit()) { - while (g_system->getEventManager()->pollEvent(evt)) - g_system->updateScreen(); - } - - return Common::kNoError; + return true; } bool HopkinsEngine::shouldQuit() const { diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h index 1399a80498..b2ae4d940d 100644 --- a/engines/hopkins/hopkins.h +++ b/engines/hopkins/hopkins.h @@ -91,6 +91,10 @@ private: void PUBQUIT(); void ENDEMO(); void BOOM(); + + bool runLinuxDemo(); + bool runLinuxFull(); + protected: // Engine APIs virtual Common::Error run(); |