aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2012-12-02 10:42:04 +0100
committerStrangerke2012-12-02 10:42:04 +0100
commita23813f9a1340654607a647b6a2494e253c4b348 (patch)
tree76a29b63388cf735967f5f2464eb145a11985bcb
parentad7ed5eae89f0fc70df8ee6316b272fa05be199a (diff)
downloadscummvm-rg350-a23813f9a1340654607a647b6a2494e253c4b348.tar.gz
scummvm-rg350-a23813f9a1340654607a647b6a2494e253c4b348.tar.bz2
scummvm-rg350-a23813f9a1340654607a647b6a2494e253c4b348.zip
HOPKINS: Add main code for Win95 demo
-rw-r--r--engines/hopkins/graphics.cpp5
-rw-r--r--engines/hopkins/hopkins.cpp331
-rw-r--r--engines/hopkins/hopkins.h2
3 files changed, 334 insertions, 4 deletions
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index 3b204ba057..697a57cdde 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -88,8 +88,11 @@ void GraphicsManager::setParent(HopkinsEngine *vm) {
_vm = vm;
if (_vm->getIsDemo()) {
+ if (_vm->getPlatform() == Common::kPlatformLinux)
// CHECKME: Should be 0?
- MANU_SCROLL = 1;
+ MANU_SCROLL = 1;
+ else
+ MANU_SCROLL = 0;
SPEED_SCROLL = 16;
} else {
MANU_SCROLL = 0;
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index 24e8240856..4b2497fc22 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -110,6 +110,13 @@ Common::Error HopkinsEngine::run() {
runLinuxDemo();
else
runLinuxFull();
+ } else if (getPlatform() == Common::kPlatformWindows) {
+ if (getIsDemo())
+ runWin95Demo();
+ else {
+ warning("Unhandled version, switching to linux demo");
+ runLinuxDemo();
+ }
} else {
warning("Unhandled version, switching to linux demo");
runLinuxDemo();
@@ -118,6 +125,321 @@ Common::Error HopkinsEngine::run() {
return Common::kNoError;
}
+bool HopkinsEngine::runWin95Demo() {
+ _globals.CHARGE_OBJET();
+ _objectsManager.CHANGE_OBJET(14);
+ _objectsManager.AJOUTE_OBJET(14);
+
+ _globals.HELICO = 0;
+ _globals.iRegul = 1;
+
+ warning("TODO Affiche_Version(1)");
+
+ _graphicsManager.DD_LOCK();
+ _graphicsManager.Cls_Video();
+ _graphicsManager.DD_UNLOCK();
+ _graphicsManager.Cls_Pal();
+
+ _graphicsManager.LOAD_IMAGE("H2");
+ _graphicsManager.FADE_INW();
+
+ warning("TODO Fin_Interrupt()");
+ warning("TODO TEST = 1;");
+ warning("TODO no_vsync = 1;");
+ _eventsManager.lItCounter = 0;
+ warning("TODO Init_Interrupt_();");
+
+ _globals.iRegul = 1;
+ _globals.vitesse = 1;
+
+ int v23 = 1;
+ do {
+ ++v23;
+ _graphicsManager.SCOPY(_graphicsManager.VESA_SCREEN, 0, 0, 640, 440, _graphicsManager.VESA_BUFFER, 0, 0);
+ _eventsManager.VBL();
+ } while (v23 < 50);
+
+ _globals.iRegul = 0;
+ warning("TODO SPEEDJ = _globals.lItCounter;");
+ warning("TODO no_vsync = 0;");
+ warning("TODO TEST = 0;");
+// printf_(v27, v26, (int)"\n speed=%d", SBYTE2(dword_452A26));
+// if (SPEEDJ > 475)
+ if (_eventsManager.lItCounter > 475)
+ _globals.vitesse = 2;
+// if (SPEEDJ > 700)
+ if (_eventsManager.lItCounter > 700)
+ _globals.vitesse = 3;
+ warning("TODO Fin_Interrupt_();");
+ warning("TODO Init_Interrupt_();");
+ _graphicsManager.FADE_OUTW();
+ _globals.iRegul = 1;
+ _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;
+ warning("TODO ADULT();");
+// v37 = v35;
+LABEL_18:
+ if (_globals.SORTIE == 300)
+ _globals.SORTIE = 0;
+
+ if (!_globals.SORTIE) {
+ _globals.SORTIE = _menuManager.MENU();
+ if (_globals.SORTIE == -1) {
+ _globals.PERSO = _globals.dos_free2(_globals.PERSO);
+ REST_SYSTEM();
+ }
+ }
+ while (1) {
+ while (1) {
+ while (1) {
+ while (1) {
+ while (1) {
+ if (_globals.SORTIE == 300)
+ goto LABEL_18;
+ 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", 2);
+ }
+ if (_globals.SORTIE != 3)
+ break;
+ if (!_globals.SAUVEGARDE->data[svField170]) {
+ _soundManager.WSOUND(3);
+ if (_globals.FR == 1)
+ _graphicsManager.LOAD_IMAGE("fondfr");
+ if (!_globals.FR)
+ _graphicsManager.LOAD_IMAGE("fondan");
+ _graphicsManager.FADE_INW();
+ _eventsManager.delay(0x1F4u);
+ _graphicsManager.FADE_OUTW();
+ _globals.iRegul = 1;
+ _soundManager.SPECIAL_SOUND = 2;
+ _graphicsManager.DD_LOCK();
+ _graphicsManager.Cls_Video();
+ _graphicsManager.DD_UNLOCK();
+ _graphicsManager.Cls_Pal();
+ if (!_globals.CENSURE)
+ _animationManager.PLAY_ANM("BANQUE.ANM", 200, 200, 28);
+ else
+ _animationManager.PLAY_ANM("BANKUK.ANM", 200, 200, 28);
+ _soundManager.SPECIAL_SOUND = 0;
+ _soundManager.DEL_SAMPLE(1);
+ _soundManager.DEL_SAMPLE(2);
+ _soundManager.DEL_SAMPLE(3);
+ _soundManager.DEL_SAMPLE(4);
+ _graphicsManager.FADE_OUTW();
+ _globals.SAUVEGARDE->data[svField170] = 1;
+ }
+ _globals.Max_Propre = 5;
+ _globals.Max_Ligne_Long = 5;
+ _globals.Max_Propre_Gen = 5;
+ _globals.Max_Perso_Y = 450;
+ _globals.NOSPRECRAN = true;
+ _objectsManager.PERSONAGE2("IM03", "IM03", "ANIM03", "IM03", 2);
+ }
+ if (4 != _globals.SORTIE)
+ break;
+ _globals.DESACTIVE_INVENT = true;
+ _objectsManager.PLAN_BETA();
+ _globals.DESACTIVE_INVENT = false;
+ }
+ if (_globals.SORTIE == 5)
+ break;
+ switch (_globals.SORTIE) {
+ case 8:
+ _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);
+ break;
+ case 6:
+ _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);
+ break;
+ case 7:
+ if (_globals.SAUVEGARDE->data[svField220])
+ _objectsManager.PERSONAGE("BOMBEB", "BOMBE", "BOMBE", "BOMBE", 2);
+ else
+ _objectsManager.PERSONAGE("BOMBEA", "BOMBE", "BOMBE", "BOMBE", 2);
+ break;
+ case 9:
+ _globals.Max_Propre_Gen = 10;
+ _globals.Max_Propre = 15;
+ _globals.Max_Perso_Y = 440;
+ _globals.Max_Ligne_Long = 20;
+ if (_globals.SAUVEGARDE->data[svField225])
+ _objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10);
+ else
+ BOOM();
+ break;
+ case 10:
+ _globals.NOSPRECRAN = true;
+ _objectsManager.PERSONAGE("IM10", "IM10", "ANIM10", "IM10", 9);
+ _globals.NOSPRECRAN = false;
+ break;
+ case 11:
+ _globals.NOSPRECRAN = true;
+ _globals.Max_Ligne_Long = 20;
+ _globals.Max_Propre_Gen = 10;
+ _globals.Max_Perso_Y = 450;
+ _globals.Max_Propre = 15;
+ _objectsManager.PERSONAGE2("IM11", "IM11", "ANIM11", "IM11", 2);
+ _globals.NOSPRECRAN = false;
+ break;
+ case 12:
+ _globals.Max_Propre_Gen = 10;
+ _globals.Max_Propre = 15;
+ _globals.Max_Perso_Y = 450;
+ _globals.Max_Ligne_Long = 20;
+ if (_globals.SAUVEGARDE->data[svField225]) {
+ if (_globals.FR == 1)
+ _graphicsManager.LOAD_IMAGE("ENDFR");
+ else if (!_globals.FR)
+ _graphicsManager.LOAD_IMAGE("ENDUK");
+ _graphicsManager.FADE_INW();
+ _eventsManager.MOUSE_ON();
+ do
+ _eventsManager.VBL();
+ while (_eventsManager.BMOUSE() != 1);
+ _graphicsManager.FADE_OUTW();
+ REST_SYSTEM();
+ }
+ BOOM();
+ break;
+ case 13:
+ case 14:
+ case 15:
+ NO_DISPO(11);
+ break;
+ default:
+ if (_globals.SORTIE == 16)
+ goto LABEL_52;
+ if (_globals.SORTIE == 17) {
+ NO_DISPO(1);
+ } else if (_globals.SORTIE != 24 && _globals.SORTIE != 25 && _globals.SORTIE != 33
+ && _globals.SORTIE != 26 && _globals.SORTIE != 27 && _globals.SORTIE != 28
+ && _globals.SORTIE != 29 && _globals.SORTIE != 30 && _globals.SORTIE != 31
+ && _globals.SORTIE != 32 && _globals.SORTIE != 34
+ && (_globals.SORTIE <= 34 || _globals.SORTIE >= 100)) {
+ switch (_globals.SORTIE) {
+ case 111:
+ _globals.NOSPRECRAN = true;
+ _objectsManager.PERSONAGE("IM111", "IM111", "ANIM111", "IM111", 10);
+ _globals.NOSPRECRAN = false;
+ break;
+ case 112:
+ _globals.NOSPRECRAN = true;
+ _objectsManager.PERSONAGE("IM112", "IM112", "ANIM112", "IM112", 10);
+ _globals.NOSPRECRAN = false;
+ break;
+ case 113:
+ _globals.SORTIE = 0;
+ _globals.OLD_ECRAN = _globals.ECRAN;
+ _globals.SAUVEGARDE->data[svField6] = _globals.ECRAN;
+ _globals.ECRAN = 113;
+ _globals.SAUVEGARDE->data[svField5] = _globals.ECRAN;
+ _computerManager.COMPUT_HOPKINS(COMPUTER_HOPKINS);
+// MODE_VESA();
+ _graphicsManager.SET_MODE(640, 480);
+ break;
+ case 114:
+ _globals.OLD_ECRAN = _globals.ECRAN;
+ _globals.SAUVEGARDE->data[svField6] = _globals.ECRAN;
+ _globals.ECRAN = 114;
+ _globals.SAUVEGARDE->data[svField5] = _globals.ECRAN;
+ _globals.SORTIE = 0;
+ _computerManager.COMPUT_HOPKINS(COMPUTER_SAMANTHAS);
+// MODE_VESA();
+ _graphicsManager.SET_MODE(640, 480);
+ break;
+ case 115:
+ _globals.SORTIE = 0;
+ _globals.OLD_ECRAN = _globals.ECRAN;
+ _globals.SAUVEGARDE->data[svField6] = _globals.ECRAN;
+ _globals.ECRAN = 115;
+ _globals.SAUVEGARDE->data[svField5] = _globals.ECRAN;
+ _computerManager.COMPUT_HOPKINS(COMPUTER_PUBLIC);
+// MODE_VESA();
+ _graphicsManager.SET_MODE(640, 480);
+ break;
+ default:
+ if (_globals.SORTIE == 151) {
+ _soundManager.WSOUND(28);
+ _globals.iRegul = 4; // CHECKME!
+ _graphicsManager.DD_LOCK();
+ _graphicsManager.Cls_Video();
+ _graphicsManager.DD_UNLOCK();
+ _graphicsManager.Cls_Pal();
+ _graphicsManager.LOAD_IMAGE("njour3a");
+ _graphicsManager.FADE_INW();
+ _eventsManager.delay(5000);
+ _graphicsManager.FADE_OUTW();
+ _globals.SORTIE = 300;
+ _globals.iRegul = 0;
+ }
+ if (_globals.SORTIE == 150) {
+ _soundManager.WSOUND(28);
+ _globals.iRegul = 4; // CHECKME!
+ _graphicsManager.DD_LOCK();
+ _graphicsManager.Cls_Video();
+ _graphicsManager.DD_UNLOCK();
+ _graphicsManager.Cls_Pal();
+ _animationManager.PLAY_ANM("JOUR1A.anm", 12, 12, 2000);
+ _globals.iRegul = 0;
+ _globals.SORTIE = 300;
+ }
+ if (_globals.SORTIE == 152) {
+ _soundManager.WSOUND(28);
+ _globals.iRegul = 4; // CHECKME!
+ _graphicsManager.DD_LOCK();
+ _graphicsManager.Cls_Video();
+ _graphicsManager.DD_UNLOCK();
+ _graphicsManager.Cls_Pal();
+ _animationManager.PLAY_ANM("JOUR4A.anm", 12, 12, 2000);
+ _globals.iRegul = 0;
+ _globals.SORTIE = 300;
+ }
+ goto LABEL_18;
+ }
+ }
+ else
+ {
+LABEL_52:
+ NO_DISPO(4);
+ }
+ break;
+ }
+ }
+ _globals.Max_Propre = 5;
+ _globals.Max_Ligne_Long = 5;
+ _globals.Max_Propre_Gen = 5;
+ _globals.NOSPRECRAN = true;
+ _globals.Max_Perso_Y = 455;
+
+ byte v1 = _globals.SAUVEGARDE->data[svField80];
+ if (v1) {
+ if (v1 == 1)
+ _objectsManager.PERSONAGE2("IM05", "IM05A", "ANIM05B", "IM05", 3);
+ } else {
+ _objectsManager.PERSONAGE2("IM05", "IM05", "ANIM05", "IM05", 3);
+ }
+
+ _globals.NOSPRECRAN = false;
+ }
+}
+
bool HopkinsEngine::runLinuxDemo() {
_globals.CHARGE_OBJET();
_objectsManager.CHANGE_OBJET(14);
@@ -451,7 +773,9 @@ LABEL_124:
_globals.ECRAN = 114;
_globals.SAUVEGARDE->data[svField5] = 114;
_computerManager.COMPUT_HOPKINS(COMPUTER_SAMANTHAS);
- goto LABEL_128;
+ _graphicsManager.DD_Lock();
+ _graphicsManager.Cls_Video();
+ _graphicsManager.DD_Unlock();
}
if (_globals.SORTIE == 115) {
_globals.SORTIE = 0;
@@ -460,8 +784,6 @@ LABEL_124:
_globals.ECRAN = 115;
_globals.SAUVEGARDE->data[svField5] = 115;
_computerManager.COMPUT_HOPKINS(COMPUTER_PUBLIC);
-
-LABEL_128:
_graphicsManager.DD_Lock();
_graphicsManager.Cls_Video();
_graphicsManager.DD_Unlock();
@@ -2765,4 +3087,7 @@ void HopkinsEngine::syncSoundSettings() {
_soundManager.syncSoundSettings();
}
+void HopkinsEngine::NO_DISPO(int sortie) {
+ warning("STUB - NO_DISPO");
+}
} // End of namespace Hopkins
diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h
index 5b5968a73f..7663926566 100644
--- a/engines/hopkins/hopkins.h
+++ b/engines/hopkins/hopkins.h
@@ -109,7 +109,9 @@ private:
void Charge_Credits();
void CREDIT_AFFICHE(int startPosY, byte *buffer, char colour);
void Credits();
+ void NO_DISPO(int sortie);
+ bool runWin95Demo();
bool runLinuxDemo();
bool runLinuxFull();