aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2012-02-07 22:40:06 +1100
committerStrangerke2012-04-06 08:20:52 +0200
commit3d9da88539bdd776d77b6accce6e77daffb72067 (patch)
tree24ed175ca7922cfc886ca19324a746402aea3d04
parent4a34f4036544c9cb137237dbf5f23d8a5d2eafa1 (diff)
downloadscummvm-rg350-3d9da88539bdd776d77b6accce6e77daffb72067.tar.gz
scummvm-rg350-3d9da88539bdd776d77b6accce6e77daffb72067.tar.bz2
scummvm-rg350-3d9da88539bdd776d77b6accce6e77daffb72067.zip
MORTEVIELLE: Merged mort.cpp into mortevielle.cpp, and split up intro from main game
-rw-r--r--engines/mortevielle/module.mk1
-rw-r--r--engines/mortevielle/mort.cpp149
-rw-r--r--engines/mortevielle/mort.h39
-rw-r--r--engines/mortevielle/mortevielle.cpp102
-rw-r--r--engines/mortevielle/mortevielle.h3
5 files changed, 102 insertions, 192 deletions
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index b977c25273..2d16106e0c 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -14,7 +14,6 @@ MODULE_OBJS := \
menu.o \
mor.o \
mor2.o \
- mort.o \
mortevielle.o \
mouse.o \
outtext.o \
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
deleted file mode 100644
index 766ae3c429..0000000000
--- a/engines/mortevielle/mort.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-/*
- * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "mortevielle/mort.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/var_mor.h" /* les variables */ //Translation: Variables
-#include "mortevielle/asm.h"
-#include "mortevielle/keyboard.h" /* la gestion du clavier */ //Translation: Keyboard manager
-#include "mortevielle/mouse.h" /* la souris */ //Translation: Mouse
-#include "mortevielle/level15.h" /* les fonctions de base */ //Translation: Lowlevel functions
-#include "mortevielle/droite.h" /* pour faire une droite */ //Translation: Display a lign
-#include "mortevielle/boite.h" //Translation: Box
-#include "mortevielle/sprint.h" /* l'affichage des textes */ //Translation: Display texts
-#include "mortevielle/outtext.h" /* fonctions sup‚rieures d'affichage */ //Translation: Highlevel display functions
-#include "mortevielle/parole.h" /* les fonctions de la parole */ //Translation: Speech functions
-#include "mortevielle/alert.h"
-#include "mortevielle/parole2.h" /* les fonctions de la parole */ //Translation: Speech functions
-/* debug le debugging */ //Translation: Debugger
-#include "mortevielle/ques.h" /* les questions */ //Translation: Questions
-#include "mortevielle/menu.h" /* les fonctions du menu */ //Translation: Menu functions
-#include "mortevielle/mor.h" /* divers */ //Translation: Misc
-#include "mortevielle/taffich.h" /* chargement des dessins */ //Translation: pictures loader
-#include "mortevielle/ovd1.h" /* les fonctions sur disque 1 */ //Translation: Disk functions
-#include "mortevielle/mor2.h" /* divers */ //Translation: Misc
-#include "mortevielle/actions.h" /* les actions */ //Translation: Actions
-#include "mortevielle/prog.h" /* fonctions toplevel */ //Translation: toplevel functions
-#include "mortevielle/disk.h" /* chargements et sauvegardes */ //Translation: Load/Save
-/* ecrihexa utilitaire */ //Translation: Toolbox
-
-namespace Mortevielle {
-
-void divers(int np, bool b) {
- teskbd();
- do {
- parole(np, 0, 0);
- atf3f8(key);
- CHECK_QUIT;
-
- if (newgd != gd) {
- gd = newgd;
- hirs();
- aff50(b);
- }
- } while (!(key == 66));
-}
-
-/* NIVEAU 0 */
-
-void mortevielle_main() {
- /*init_debug;*/
- /* ecri_seg;*/
- //pio_initialize(argc, argv);
- gd = ega;
- newgd = gd;
- zuul = false;
- tesok = false;
- chartex();
- charpal();
- charge_cfiph();
- charge_cfiec();
- zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
- c_zzz = 1;
- init_nbrepm();
- init_mouse();
- /* crep:=WRITE_LE_UINT16(&mem[$7f00:0];
- WRITE_LE_UINT16(&mem[$7f00:0]:= crep+1;
- if (WRITE_LE_UINT16(&mem[$7f00:0]<> crep+1) then
- begin
- hirs;
- show_mouse;
- crep:=do_alert('[1][ 512 k minimum requis !!][OK]',1);
- clrscr;
- halt;
- end;
- if (Dseg+$1000>adbruit5) then
- begin
- hirs;
- show_mouse;
- crep:=do_alert('[1][ Il ne reste pas assez de |place m‚moire !!][OK]',1);
- clrscr;
- halt;
- end;*/
- init_lieu();
- arret = false;
- sonoff = false;
- f2_all = false;
- textcolor(9);
- teskbd();
- dialpre();
- newgd = gd;
- teskbd();
- if (newgd != gd) gd = newgd;
- hirs();
- ades = 0x7000;
- aff50(false);
- mlec = 0;
- divers(142, false);
- CHECK_QUIT;
-
- ani50();
- divers(143, true);
- CHECK_QUIT;
-
- suite();
- music();
- adzon();
- takesav(0);
- if (rech_cfiec) charge_cfiec();
- for (crep = 1; crep <= c_zzz; crep ++)
- zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
- charge_bruit5();
- init_menu();
-
- theure();
- dprog();
- hirs();
- dessine_rouleau();
- show_mouse();
- do {
- tjouer();
- CHECK_QUIT;
- } while (!arret);
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/mort.h b/engines/mortevielle/mort.h
deleted file mode 100644
index d313e32b78..0000000000
--- a/engines/mortevielle/mort.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-/*
- * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_MORT_H
-#define MORTEVIELLE_MORT_H
-
-namespace Mortevielle {
-
-extern void divers(int np, bool b);
-/* NIVEAU 0 */
-extern void mortevielle_main();
-
-} // End of namespace Mortevielle
-
-#endif
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index fde3d424c5..35d71c92aa 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -28,8 +28,16 @@
#include "graphics/palette.h"
#include "graphics/pixelformat.h"
#include "mortevielle/mortevielle.h"
-#include "mortevielle/mort.h"
+#include "mortevielle/asm.h"
+#include "mortevielle/disk.h"
+#include "mortevielle/keyboard.h"
+#include "mortevielle/level15.h"
+#include "mortevielle/mor.h"
+#include "mortevielle/mor2.h"
#include "mortevielle/mouse.h"
+#include "mortevielle/ovd1.h"
+#include "mortevielle/parole2.h"
+#include "mortevielle/prog.h"
#include "mortevielle/var_mor.h"
namespace Mortevielle {
@@ -77,6 +85,36 @@ Common::ErrorCode MortevielleEngine::initialise() {
// Setup the mouse cursor
initMouse();
+ /*init_debug;*/
+ /* ecri_seg;*/
+ //pio_initialize(argc, argv);
+ gd = ega;
+ newgd = gd;
+ zuul = false;
+ tesok = false;
+ chartex();
+ charpal();
+ charge_cfiph();
+ charge_cfiec();
+ zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+ c_zzz = 1;
+ init_nbrepm();
+ init_mouse();
+
+ init_lieu();
+ arret = false;
+ sonoff = false;
+ f2_all = false;
+ textcolor(9);
+ teskbd();
+ dialpre();
+ newgd = gd;
+ teskbd();
+ if (newgd != gd)
+ gd = newgd;
+ hirs();
+ ades = 0x7000;
+
return Common::kNoError;
}
@@ -323,10 +361,68 @@ Common::Error MortevielleEngine::run() {
if (err != Common::kNoError)
return err;
- // Dispatch to the game's main routine
- mortevielle_main();
+ // Show the game introduction
+ showIntroduction();
+
+ adzon();
+ takesav(0);
+
+ mainGame();
return Common::kNoError;
}
+/**
+ * Show the game introduction
+ */
+void MortevielleEngine::showIntroduction() {
+ aff50(false);
+ mlec = 0;
+ divers(142, false);
+ CHECK_QUIT;
+
+ ani50();
+ divers(143, true);
+ CHECK_QUIT;
+
+ suite();
+ music();
+}
+
+void MortevielleEngine::divers(int np, bool b) {
+ teskbd();
+ do {
+ parole(np, 0, 0);
+ atf3f8(key);
+ CHECK_QUIT;
+
+ if (newgd != gd) {
+ gd = newgd;
+ hirs();
+ aff50(b);
+ }
+ } while (!(key == 66));
+}
+
+/**
+ * Main game loop
+ */
+void MortevielleEngine::mainGame() {
+ if (rech_cfiec) charge_cfiec();
+ for (crep = 1; crep <= c_zzz; crep ++)
+ zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+ charge_bruit5();
+ init_menu();
+
+ theure();
+ dprog();
+ hirs();
+ dessine_rouleau();
+ show_mouse();
+ do {
+ tjouer();
+ CHECK_QUIT;
+ } while (!arret);
+}
+
} // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 86ec947200..863cbdb95e 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -63,6 +63,9 @@ private:
bool handleEvents();
void addKeypress(Common::Event &evt);
void initMouse();
+ void showIntroduction();
+ void mainGame();
+ void divers(int np, bool b);
public:
ScreenSurface _screenSurface;
PaletteManager _paletteManager;