aboutsummaryrefslogtreecommitdiff
path: root/engines/mortevielle/mort.cpp
blob: 9b05196ab9b44e0d658f5590925ccd0f2de2d455 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/* 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/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);
		if (newgd != gd) {
			gd = newgd;
			hirs();
			aff50(b);
		}
	} while (!(key == 66));
}

/* NIVEAU 0 */

int mortevielle_main(int argc, const char *argv[]) {
	/*init_debug;*/
	/*  ecri_seg;*/
	//pio_initialize(argc, argv);
	gd = cga;
	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);

	ani50();
	divers(143, true);
	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();
	} while (!arret);
	hide_mouse();
	clrscr;
	/*out_debug;*/
	return EXIT_SUCCESS;
}

} // End of namespace Mortevielle