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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
|
/* 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.
*
* $URL$
* $Id$
*
*/
#include "common/endian.h"
#include "gob/gob.h"
#include "gob/inter.h"
#include "gob/global.h"
#include "gob/util.h"
#include "gob/dataio.h"
#include "gob/draw.h"
#include "gob/parse.h"
#include "gob/game.h"
#include "gob/palanim.h"
#include "gob/video.h"
#include "gob/videoplayer.h"
#include "gob/sound/sound.h"
namespace Gob {
#define OPCODEVER Inter_Fascination
#define OPCODEDRAW(i, x) _opcodesDraw[i]._OPCODEDRAW(OPCODEVER, x)
#define OPCODEFUNC(i, x) _opcodesFunc[i]._OPCODEFUNC(OPCODEVER, x)
#define OPCODEGOB(i, x) _opcodesGob[i]._OPCODEGOB(OPCODEVER, x)
Inter_Fascination::Inter_Fascination(GobEngine *vm) : Inter_v2(vm) {
}
void Inter_Fascination::setupOpcodesDraw() {
Inter_v2::setupOpcodesDraw();
OPCODEDRAW(0x03, oFascin_cdUnknown3);
OPCODEDRAW(0x04, oFascin_cdUnknown4);
OPCODEDRAW(0x05, oFascin_cdUnknown5);
OPCODEDRAW(0x06, oFascin_cdUnknown6);
OPCODEDRAW(0x0A, oFascin_setRenderFlags);
OPCODEDRAW(0x0B, oFascin_cdUnknown11);
CLEAROPCODEDRAW(0x50);
CLEAROPCODEDRAW(0x51);
CLEAROPCODEDRAW(0x52);
CLEAROPCODEDRAW(0x53);
CLEAROPCODEDRAW(0x54);
CLEAROPCODEDRAW(0x55);
CLEAROPCODEDRAW(0x56);
CLEAROPCODEDRAW(0x80);
CLEAROPCODEDRAW(0x81);
CLEAROPCODEDRAW(0x82);
CLEAROPCODEDRAW(0x83);
CLEAROPCODEDRAW(0x84);
CLEAROPCODEDRAW(0x85);
CLEAROPCODEDRAW(0x86);
CLEAROPCODEDRAW(0x87);
CLEAROPCODEDRAW(0x88);
}
void Inter_Fascination::setupOpcodesFunc() {
Inter_v2::setupOpcodesFunc();
}
void Inter_Fascination::setupOpcodesGob() {
OPCODEGOB( 1, oFascin_geUnknown0);
OPCODEGOB( 2, oFascin_geUnknown1);
OPCODEGOB( 3, oFascin_geUnknown2);
OPCODEGOB( 4, oFascin_geUnknown3);
OPCODEGOB( 5, oFascin_geUnknown4);
OPCODEGOB( 6, oFascin_geUnknown5);
OPCODEGOB( 7, oFascin_geUnknown6);
OPCODEGOB( 8, oFascin_geUnknown7);
OPCODEGOB( 9, oFascin_geUnknown8);
OPCODEGOB( 10, oFascin_geUnknown9);
OPCODEGOB( 11, oFascin_geUnknown10);
OPCODEGOB( 12, oFascin_geUnknown11);
OPCODEGOB(1000, oFascin_geUnknown1000);
OPCODEGOB(1001, oFascin_geUnknown1001); //protrackerPlay doesn't play correctly "mod.extasy"
OPCODEGOB(1002, oFascin_geUnknown1002); //to be replaced by o2_stopProtracker when protrackerPlay is fixed
}
void Inter_Fascination::oFascin_geUnknown0(OpGobParams ¶ms) {
warning("Fascination Unknown GE Function 0");
warning("funcPlayImd with parameter : 'tirb.imd'");
if (_vm->_vidPlayer->primaryOpen("tirb.imd")) {
_vm->_vidPlayer->primaryPlay();
_vm->_vidPlayer->primaryClose();
}
_vm->_draw->closeScreen();
}
void Inter_Fascination::oFascin_geUnknown1(OpGobParams ¶ms) {
warning("Fascination Unknown GE Function 1");
warning("funcPlayImd with parameter : 'tira.imd'");
if (_vm->_vidPlayer->primaryOpen("tira.imd")) {
_vm->_vidPlayer->primaryPlay();
_vm->_vidPlayer->primaryClose();
}
_vm->_draw->closeScreen();
}
void Inter_Fascination::oFascin_geUnknown2(OpGobParams ¶ms) {
_vm->_sound->adlibLoadTBR("extasy.tbr");
_vm->_sound->adlibLoadMDY("extasy.mdy");
}
void Inter_Fascination::oFascin_geUnknown3(OpGobParams ¶ms) {
_vm->_sound->adlibPlay();
}
void Inter_Fascination::oFascin_geUnknown4(OpGobParams ¶ms) {
_vm->_sound->adlibStop();
}
void Inter_Fascination::oFascin_geUnknown5(OpGobParams ¶ms) {
_vm->_sound->adlibUnload();
}
void Inter_Fascination::oFascin_geUnknown6(OpGobParams ¶ms) {
_vm->_sound->adlibLoadTBR("music1.tbr");
_vm->_sound->adlibLoadMDY("music1.mdy");
}
void Inter_Fascination::oFascin_geUnknown7(OpGobParams ¶ms) {
_vm->_sound->adlibLoadTBR("music2.tbr");
_vm->_sound->adlibLoadMDY("music2.mdy");
}
void Inter_Fascination::oFascin_geUnknown8(OpGobParams ¶ms) {
_vm->_sound->adlibLoadTBR("music3.tbr");
_vm->_sound->adlibLoadMDY("music3.mdy");
}
void Inter_Fascination::oFascin_geUnknown9(OpGobParams ¶ms) {
_vm->_sound->adlibLoadTBR("batt1.tbr");
_vm->_sound->adlibLoadMDY("batt1.mdy");
}
void Inter_Fascination::oFascin_geUnknown10(OpGobParams ¶ms) {
_vm->_sound->adlibLoadTBR("batt2.tbr");
_vm->_sound->adlibLoadMDY("batt2.mdy");
}
void Inter_Fascination::oFascin_geUnknown11(OpGobParams ¶ms) {
_vm->_sound->adlibLoadTBR("batt3.tbr");
_vm->_sound->adlibLoadMDY("batt3.mdy");
}
void Inter_Fascination::oFascin_geUnknown1000(OpGobParams ¶ms) {
warning("Fascination Unknown GE Function 1000 - Load MOD music");
}
void Inter_Fascination::oFascin_geUnknown1001(OpGobParams ¶ms) {
warning("Fascination oFascin_playProtracker - MOD not compatible (sample > 32768), To Be Fixed");
}
void Inter_Fascination::oFascin_geUnknown1002(OpGobParams ¶ms) {
warning("Fascination o2_stopProtracker - Commented out");
}
bool Inter_Fascination::oFascin_feUnknown4(OpFuncParams ¶ms) {
warning("Fascination Unknown FE Function 4");
return true;
}
bool Inter_Fascination::oFascin_feUnknown27(OpFuncParams ¶ms) {
warning("Fascination Unknown FE Function 27h");
return true;
}
void Inter_Fascination::oFascin_cdUnknown3() {
uint16 resVar, resVar2;
int16 retVal1, retVal2, retVal3, retVal4, retVal5, retVal6, retVal7;
warning("Fascination oFascin_cdUnknown3 - Variables initialisations");
resVar = (uint16) load16();
resVar2 = (uint16) load16();
retVal1 = _vm->_parse->parseVarIndex();
retVal2 = _vm->_parse->parseVarIndex();
retVal3 = _vm->_parse->parseVarIndex();
retVal4 = _vm->_parse->parseVarIndex();
retVal5 = _vm->_parse->parseVarIndex();
retVal6 = _vm->_parse->parseVarIndex();
retVal7 = _vm->_parse->parseVarIndex();
warning ("Width? :%d Height? :%d",resVar, resVar2);
warning ("Fetched variables 1:%d 2:%d 3:%d 4:%d 5:%d 6:%d 7:%d", retVal1, retVal2, retVal3, retVal4, retVal5, retVal6, retVal7);
}
void Inter_Fascination::oFascin_cdUnknown4() {
int16 expr;
warning("Fascination oFascin_cdUnknown4");
evalExpr(&expr);
warning ("evalExpr: %d, the rest is not yet implemented",expr);
}
void Inter_Fascination::oFascin_cdUnknown5() {
int16 retVal1,expr;
warning("Fascination oFascin_cdUnknown5");
evalExpr(&expr);
retVal1 = _vm->_parse->parseVarIndex();
warning ("evalExpr: %d Variable index %d, the rest is not yet implemented",expr, retVal1);
}
void Inter_Fascination::oFascin_cdUnknown6() {
int16 retVal1,expr;
warning("Fascination oFascin_cdUnknown6");
evalExpr(&expr);
retVal1 = _vm->_parse->parseVarIndex();
warning ("evalExpr: %d Variable index %d, the rest is not yet implemented",expr, retVal1);
}
void Inter_Fascination::oFascin_setRenderFlags() {
int16 expr;
// warning("Fascination oFascin_cdUnknown10 (set render flags)");
evalExpr(&expr);
warning("_draw_renderFlags <- %d",expr);
_vm->_draw->_renderFlags = expr;
}
void Inter_Fascination::oFascin_cdUnknown11() {
// warning("Fascination oFascin_cdUnknown11 (set variable)");
evalExpr(0);
}
void Inter_Fascination::oFascin_playProtracker(OpGobParams ¶ms) {
_vm->_sound->protrackerPlay("mod.extasy");
}
} // End of namespace Gob
|