1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 
24 
25 #ifdef ENABLE_AGOS2
26 
27 #include "common/system.h"
28 
29 #include "agos/animation.h"
30 #include "agos/agos.h"
31 #include "agos/intern.h"
32 #include "agos/sound.h"
33 
34 namespace AGOS {
35 
36 #define OPCODE(x)	_OPCODE(AGOSEngine_Feeble, x)
37 
setupOpcodes()38 void AGOSEngine_Feeble::setupOpcodes() {
39 	static const OpcodeEntryFeeble opcodes[] = {
40 		/* 00 */
41 		OPCODE(o_invalid),
42 		OPCODE(o_at),
43 		OPCODE(o_notAt),
44 		OPCODE(o_invalid),
45 		/* 04 */
46 		OPCODE(o_invalid),
47 		OPCODE(o_carried),
48 		OPCODE(o_notCarried),
49 		OPCODE(o_isAt),
50 		/* 08 */
51 		OPCODE(o_invalid),
52 		OPCODE(o_invalid),
53 		OPCODE(o_invalid),
54 		OPCODE(o_zero),
55 		/* 12 */
56 		OPCODE(o_notZero),
57 		OPCODE(o_eq),
58 		OPCODE(o_notEq),
59 		OPCODE(o_gt),
60 		/* 16 */
61 		OPCODE(o_lt),
62 		OPCODE(o_eqf),
63 		OPCODE(o_notEqf),
64 		OPCODE(o_ltf),
65 		/* 20 */
66 		OPCODE(o_gtf),
67 		OPCODE(o_invalid),
68 		OPCODE(o_invalid),
69 		OPCODE(off_chance),
70 		/* 24 */
71 		OPCODE(o_invalid),
72 		OPCODE(o_isRoom),
73 		OPCODE(o_isObject),
74 		OPCODE(o_state),
75 		/* 28 */
76 		OPCODE(o_oflag),
77 		OPCODE(o_invalid),
78 		OPCODE(o_invalid),
79 		OPCODE(o_destroy),
80 		/* 32 */
81 		OPCODE(o_invalid),
82 		OPCODE(o_place),
83 		OPCODE(o_invalid),
84 		OPCODE(o_invalid),
85 		/* 36 */
86 		OPCODE(o_copyff),
87 		OPCODE(off_jumpOut),
88 		OPCODE(o_invalid),
89 		OPCODE(o_invalid),
90 		/* 40 */
91 		OPCODE(o_invalid),
92 		OPCODE(o_clear),
93 		OPCODE(o_let),
94 		OPCODE(o_add),
95 		/* 44 */
96 		OPCODE(o_sub),
97 		OPCODE(o_addf),
98 		OPCODE(o_subf),
99 		OPCODE(o_mul),
100 		/* 48 */
101 		OPCODE(o_div),
102 		OPCODE(o_mulf),
103 		OPCODE(o_divf),
104 		OPCODE(o_mod),
105 		/* 52 */
106 		OPCODE(o_modf),
107 		OPCODE(o_random),
108 		OPCODE(o_invalid),
109 		OPCODE(o_goto),
110 		/* 56 */
111 		OPCODE(o_oset),
112 		OPCODE(o_oclear),
113 		OPCODE(o_putBy),
114 		OPCODE(o_inc),
115 		/* 60 */
116 		OPCODE(o_dec),
117 		OPCODE(o_setState),
118 		OPCODE(o_print),
119 		OPCODE(o_message),
120 		/* 64 */
121 		OPCODE(o_msg),
122 		OPCODE(off_addTextBox),
123 		OPCODE(oww_setShortText),
124 		OPCODE(oww_setLongText),
125 		/* 68 */
126 		OPCODE(o_end),
127 		OPCODE(o_done),
128 		OPCODE(off_printLongText),
129 		OPCODE(o_process),
130 		/* 72 */
131 		OPCODE(o_invalid),
132 		OPCODE(o_invalid),
133 		OPCODE(o_invalid),
134 		OPCODE(o_invalid),
135 		/* 76 */
136 		OPCODE(o_when),
137 		OPCODE(o_if1),
138 		OPCODE(o_if2),
139 		OPCODE(o_isCalled),
140 		/* 80 */
141 		OPCODE(o_is),
142 		OPCODE(o_invalid),
143 		OPCODE(o_debug),
144 		OPCODE(os2_rescan),
145 		/* 84 */
146 		OPCODE(o_invalid),
147 		OPCODE(o_invalid),
148 		OPCODE(o_invalid),
149 		OPCODE(o_comment),
150 		/* 88 */
151 		OPCODE(o_invalid),
152 		OPCODE(o_invalid),
153 		OPCODE(o_getParent),
154 		OPCODE(o_getNext),
155 		/* 92 */
156 		OPCODE(o_getChildren),
157 		OPCODE(o_invalid),
158 		OPCODE(o_invalid),
159 		OPCODE(o_invalid),
160 		/* 96 */
161 		OPCODE(o_picture),
162 		OPCODE(o_loadZone),
163 		OPCODE(os2_animate),
164 		OPCODE(os2_stopAnimate),
165 		/* 100 */
166 		OPCODE(o_killAnimate),
167 		OPCODE(o_defWindow),
168 		OPCODE(o_window),
169 		OPCODE(o_cls),
170 		/* 104 */
171 		OPCODE(o_closeWindow),
172 		OPCODE(o_invalid),
173 		OPCODE(o_invalid),
174 		OPCODE(off_addBox),
175 		/* 108 */
176 		OPCODE(o_delBox),
177 		OPCODE(o_enableBox),
178 		OPCODE(o_disableBox),
179 		OPCODE(o_moveBox),
180 		/* 112 */
181 		OPCODE(o_invalid),
182 		OPCODE(o_invalid),
183 		OPCODE(o_doIcons),
184 		OPCODE(o_isClass),
185 		/* 116 */
186 		OPCODE(o_setClass),
187 		OPCODE(o_unsetClass),
188 		OPCODE(o_invalid),
189 		OPCODE(o_waitSync),
190 		/* 120 */
191 		OPCODE(o_sync),
192 		OPCODE(o_defObj),
193 		OPCODE(off_oracleTextDown),
194 		OPCODE(off_oracleTextUp),
195 		/* 124 */
196 		OPCODE(off_ifTime),
197 		OPCODE(o_here),
198 		OPCODE(o_doClassIcons),
199 		OPCODE(o_invalid),
200 		/* 128 */
201 		OPCODE(o_invalid),
202 		OPCODE(o_invalid),
203 		OPCODE(o_setAdjNoun),
204 		OPCODE(off_setTime),
205 		/* 132 */
206 		OPCODE(off_saveUserGame),
207 		OPCODE(off_loadUserGame),
208 		OPCODE(off_listSaveGames),
209 		OPCODE(off_checkCD),
210 		/* 136 */
211 		OPCODE(o_copysf),
212 		OPCODE(o_restoreIcons),
213 		OPCODE(o_freezeZones),
214 		OPCODE(o_placeNoIcons),
215 		/* 140 */
216 		OPCODE(o_clearTimers),
217 		OPCODE(o_setDollar),
218 		OPCODE(o_isBox),
219 		OPCODE(oe2_doTable),
220 		/* 144 */
221 		OPCODE(o_invalid),
222 		OPCODE(o_invalid),
223 		OPCODE(o_invalid),
224 		OPCODE(o_invalid),
225 		/* 148 */
226 		OPCODE(o_invalid),
227 		OPCODE(o_invalid),
228 		OPCODE(o_invalid),
229 		OPCODE(oe2_storeItem),
230 		/* 152 */
231 		OPCODE(oe2_getItem),
232 		OPCODE(oe2_bSet),
233 		OPCODE(oe2_bClear),
234 		OPCODE(oe2_bZero),
235 		/* 156 */
236 		OPCODE(oe2_bNotZero),
237 		OPCODE(oe2_getOValue),
238 		OPCODE(oe2_setOValue),
239 		OPCODE(o_invalid),
240 		/* 160 */
241 		OPCODE(oe2_ink),
242 		OPCODE(off_screenTextBox),
243 		OPCODE(os1_screenTextMsg),
244 		OPCODE(o_invalid),
245 		/* 164 */
246 		OPCODE(oe2_getDollar2),
247 		OPCODE(off_isAdjNoun),
248 		OPCODE(off_b2Set),
249 		OPCODE(oe2_b2Clear),
250 		/* 168 */
251 		OPCODE(oe2_b2Zero),
252 		OPCODE(oe2_b2NotZero),
253 		OPCODE(o_invalid),
254 		OPCODE(off_hyperLinkOn),
255 		/* 172 */
256 		OPCODE(off_hyperLinkOff),
257 		OPCODE(off_checkPaths),
258 		OPCODE(o_invalid),
259 		OPCODE(oww_lockZones),
260 		/* 176 */
261 		OPCODE(oww_unlockZones),
262 		OPCODE(off_screenTextPObj),
263 		OPCODE(os1_getPathPosn),
264 		OPCODE(os1_scnTxtLongText),
265 		/* 180 */
266 		OPCODE(off_mouseOn),
267 		OPCODE(off_mouseOff),
268 		OPCODE(off_loadVideo),
269 		OPCODE(off_playVideo),
270 		/* 184 */
271 		OPCODE(os1_unloadZone),
272 		OPCODE(o_invalid),
273 		OPCODE(os1_unfreezeZones),
274 		OPCODE(off_centerScroll),
275 		/* 188 */
276 		OPCODE(os2_isShortText),
277 		OPCODE(os2_clearMarks),
278 		OPCODE(os2_waitMark),
279 		OPCODE(off_resetPVCount),
280 		/* 192 */
281 		OPCODE(off_setPathValues),
282 		OPCODE(off_stopClock),
283 		OPCODE(off_restartClock),
284 		OPCODE(off_setColor),
285 		/* 196 */
286 		OPCODE(off_b3Set),
287 		OPCODE(off_b3Clear),
288 		OPCODE(off_b3Zero),
289 		OPCODE(off_b3NotZero)
290 	};
291 
292 	_opcodesFeeble = opcodes;
293 	_numOpcodes = 200;
294 }
295 
executeOpcode(int opcode)296 void AGOSEngine_Feeble::executeOpcode(int opcode) {
297 	OpcodeProcFeeble op = _opcodesFeeble[opcode].proc;
298 	(this->*op) ();
299 }
300 
setLoyaltyRating(byte rating)301 void AGOSEngine_Feeble::setLoyaltyRating(byte rating) {
302 	// WORKAROUND: The 4CD version of The Feeble File is missing the parts
303 	// of the script that set the loyalty rating. This approximates the
304 	// script from the 2CD version. See bug #6525.
305 
306 	switch (rating) {
307 	case 1:
308 		// Kicking vending machine: Possibility of Undesirable Character Flaws
309 		writeVariable(120, 1);
310 		break;
311 	case 2:
312 		// Confessing: Confirmed Minor Character Flaws
313 		writeVariable(120, 2);
314 		break;
315 	case 3:
316 		// Being sent to Cygnus Alpha: Suspected Subversive Activity
317 		writeVariable(120, 3);
318 		break;
319 	case 4:
320 		// Escaping from Cygnus Alpha: Confirmed Subversive Activity
321 		writeVariable(120, 4);
322 		break;
323 	case 5:
324 		// Being brought before Filbert: Confirmed Treasonous Activity
325 		writeVariable(120, 5);
326 		break;
327 	case 6:
328 		// Arriving at rebel base: Freedom Fighters Operative
329 		writeVariable(120, 6);
330 		break;
331 	}
332 }
333 
334 // -----------------------------------------------------------------------
335 // Feeble Files Opcodes
336 // -----------------------------------------------------------------------
337 
off_chance()338 void AGOSEngine_Feeble::off_chance() {
339 	// 23
340 	uint16 a = getVarOrWord();
341 
342 	if (a == 0) {
343 		setScriptCondition(false);
344 		return;
345 	}
346 
347 	if (a == 100) {
348 		setScriptCondition(true);
349 		return;
350 	}
351 
352 	if (_rnd.getRandomNumber(99) < a)
353 		setScriptCondition(true);
354 	else
355 		setScriptCondition(false);
356 }
357 
off_jumpOut()358 void AGOSEngine_Feeble::off_jumpOut() {
359 	// 37
360 	getVarOrByte();
361 	setScriptReturn(1);
362 }
363 
off_addTextBox()364 void AGOSEngine_Feeble::off_addTextBox() {
365 	// 65: add hit area
366 	uint flags = kBFTextBox | kBFBoxItem;
367 	uint id = getVarOrWord();
368 	uint params = id / 1000;
369 	uint x, y, w, h, num;
370 
371 	id %= 1000;
372 
373 	if (params & 1)
374 		flags |= kBFInvertTouch;
375 
376 	x = getVarOrWord();
377 	y = getVarOrWord();
378 	w = getVarOrWord();
379 	h = getVarOrWord();
380 	num = getVarOrByte();
381 	if (num < _numTextBoxes)
382 		defineBox(id, x, y, w, h, flags + (num << 8), 208, _dummyItem2);
383 }
384 
off_printLongText()385 void AGOSEngine_Feeble::off_printLongText() {
386 	// 70: show string from array
387 	int num = getVarOrByte();
388 	const char *str = (const char *)getStringPtrByID(_longText[num]);
389 	sendInteractText(num, "%d. %s\n", num, str);
390 }
391 
off_addBox()392 void AGOSEngine_Feeble::off_addBox() {
393 	// 107: add item hitarea
394 	uint flags = 0;
395 	uint id = getVarOrWord();
396 	uint params = id / 1000;
397 	uint x, y, w, h, verb;
398 	Item *item;
399 
400 	id = id % 1000;
401 
402 	if (params & 1)
403 		flags |= kBFInvertTouch;
404 	if (params & 2)
405 		flags |= kBFNoTouchName;
406 	if (params & 4)
407 		flags |= kBFBoxItem;
408 	if (params & 8)
409 		flags |= kBFTextBox;
410 	if (params & 16)
411 		flags |= kBFHyperBox;
412 
413 	x = getVarOrWord();
414 	y = getVarOrWord();
415 	w = getVarOrWord();
416 	h = getVarOrWord();
417 	item = getNextItemPtrStrange();
418 	verb = getVarOrWord();
419 	defineBox(id, x, y, w, h, flags, verb, item);
420 }
421 
off_oracleTextDown()422 void AGOSEngine_Feeble::off_oracleTextDown() {
423 	// 122: oracle text down
424 	oracleTextDown();
425 }
426 
off_oracleTextUp()427 void AGOSEngine_Feeble::off_oracleTextUp() {
428 	// 123: oracle text up
429 	oracleTextUp();
430 }
431 
off_ifTime()432 void AGOSEngine_Feeble::off_ifTime() {
433 	// 124: if time
434 	uint a = getVarOrWord();
435 	uint32 t = getTime() - _gameStoppedClock - a;
436 	if (t >= _timeStore)
437 		setScriptCondition(true);
438 	else
439 		setScriptCondition(false);
440 }
441 
off_setTime()442 void AGOSEngine_Feeble::off_setTime() {
443 	// 131
444 	_timeStore = getTime() - _gameStoppedClock;
445 }
446 
off_saveUserGame()447 void AGOSEngine_Feeble::off_saveUserGame() {
448 	// 132: save game
449 	_noOracleScroll = 0;
450 	_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
451 	saveUserGame(countSaveGames() + 1 - readVariable(55));
452 	_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
453 }
454 
off_loadUserGame()455 void AGOSEngine_Feeble::off_loadUserGame() {
456 	// 133: load game
457 	if (readVariable(55) == 999) {
458 		loadGame(getFileName(GAME_RESTFILE), true);
459 	} else {
460 		loadGame(genSaveName(readVariable(55)));
461 	}
462 }
463 
off_listSaveGames()464 void AGOSEngine_Feeble::off_listSaveGames() {
465 	listSaveGamesFeeble();
466 }
467 
off_checkCD()468 void AGOSEngine_Feeble::off_checkCD() {
469 	// 135: switch CD
470 	uint16 disc = readVariable(97);
471 
472 	if (!strcmp(getExtra(), "4CD")) {
473 		_sound->switchVoiceFile(gss, disc);
474 	} else if (!strcmp(getExtra(), "2CD")) {
475 		if (disc == 1 || disc == 2)
476 			_sound->switchVoiceFile(gss, 1);
477 		else if (disc == 3 || disc == 4)
478 			_sound->switchVoiceFile(gss, 2);
479 	}
480 
481 	debug(0, "Switch to CD number %d", disc);
482 }
483 
off_screenTextBox()484 void AGOSEngine_Feeble::off_screenTextBox() {
485 	// 161: setup text
486 	TextLocation *tl = getTextLocation(getVarOrByte());
487 
488 	tl->x = getVarOrWord();
489 	tl->y = getVarOrWord();
490 	tl->width = getVarOrWord();
491 }
492 
off_isAdjNoun()493 void AGOSEngine_Feeble::off_isAdjNoun() {
494 	// 165: item unk1 unk2 is
495 	Item *item = getNextItemPtr();
496 	int16 a = getNextWord(), b = getNextWord();
497 	if (item->adjective == a && item->noun == b)
498 		setScriptCondition(true);
499 	else if (a == -1 && item->noun == b)
500 		setScriptCondition(true);
501 	else
502 		setScriptCondition(false);
503 }
504 
off_b2Set()505 void AGOSEngine_Feeble::off_b2Set() {
506 	// 166: set bit2
507 	uint bit = getVarOrByte();
508 	_bitArrayTwo[bit / 16] |= (1 << (bit & 15));
509 
510 	if (getFeatures() & GF_BROKEN_FF_RATING) {
511 		switch (bit) {
512 		case 152:
513 			setLoyaltyRating(1);
514 			break;
515 		case 153:
516 			setLoyaltyRating(2);
517 			break;
518 		case 240:
519 			setLoyaltyRating(3);
520 			break;
521 		case 251:
522 			setLoyaltyRating(4);
523 			break;
524 		case 253:
525 			setLoyaltyRating(6);
526 			break;
527 		default:
528 			break;
529 		}
530 	}
531 }
532 
off_hyperLinkOn()533 void AGOSEngine_Feeble::off_hyperLinkOn() {
534 	// 171: oracle hyperlink on
535 	hyperLinkOn(getVarOrWord());
536 }
537 
off_hyperLinkOff()538 void AGOSEngine_Feeble::off_hyperLinkOff() {
539 	// 172: oracle hyperlink off
540 	hyperLinkOff();
541 }
542 
off_checkPaths()543 void AGOSEngine_Feeble::off_checkPaths() {
544 	// 173 check paths
545 	int i, count;
546 	const uint8 *pathVal1 = _pathValues1;
547 	bool result = false;
548 
549 	count = _variableArray2[38];
550 	for (i = 0; i < count; i++) {
551 		uint8 val = pathVal1[2];
552 		if (val == _variableArray2[50] ||
553 			val == _variableArray2[51] ||
554 			val == _variableArray2[201] ||
555 			val == _variableArray2[203] ||
556 			val == _variableArray2[205] ||
557 			val == _variableArray2[207] ||
558 			val == _variableArray2[209] ||
559 			val == _variableArray2[211] ||
560 			val == _variableArray2[213] ||
561 			val == _variableArray2[215] ||
562 			val == _variableArray2[219] ||
563 			val == _variableArray2[220] ||
564 			val == _variableArray2[221] ||
565 			val == _variableArray2[222] ||
566 			val == _variableArray2[223] ||
567 			val == _variableArray2[224] ||
568 			val == _variableArray2[225] ||
569 			val == _variableArray2[226]) {
570 				result = true;
571 				break;
572 		}
573 		pathVal1 += 4;
574 	}
575 
576 	_variableArray2[52] = result;
577 }
578 
off_screenTextPObj()579 void AGOSEngine_Feeble::off_screenTextPObj() {
580 	// 177: inventory descriptions
581 	uint vgaSpriteId = getVarOrByte();
582 	uint color = getVarOrByte();
583 	const char *string_ptr = NULL;
584 	TextLocation *tl = NULL;
585 	char buf[256];
586 
587 	SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), kObjectType);
588 	if (subObject != NULL && subObject->objectFlags & kOFText) {
589 		string_ptr = (const char *)getStringPtrByID(subObject->objectFlagValue[0]);
590 		tl = getTextLocation(vgaSpriteId);
591 	}
592 
593 	if (subObject != NULL && subObject->objectFlags & kOFVoice) {
594 		uint offs = getOffsetOfChild2Param(subObject, kOFVoice);
595 		playSpeech(subObject->objectFlagValue[offs], vgaSpriteId);
596 	}
597 
598 	if (subObject != NULL && (subObject->objectFlags & kOFText) && _subtitles) {
599 		if (subObject->objectFlags & kOFNumber) {
600 			sprintf(buf, "%d%s", subObject->objectFlagValue[getOffsetOfChild2Param(subObject, kOFNumber)], string_ptr);
601 			string_ptr = buf;
602 		}
603 		if (string_ptr != NULL)
604 			printScreenText(vgaSpriteId, color, string_ptr, tl->x, tl->y, tl->width);
605 	}
606 }
607 
off_mouseOn()608 void AGOSEngine_Feeble::off_mouseOn() {
609 	// 180: force mouseOn
610 	if (_mouseCursor != 5) {
611 		resetVerbs();
612 		_noRightClick = 0;
613 	}
614 	_mouseHideCount = 0;
615 }
616 
off_mouseOff()617 void AGOSEngine_Feeble::off_mouseOff() {
618 	// 181: force mouseOff
619 	scriptMouseOff();
620 	clearName();
621 }
622 
off_loadVideo()623 void AGOSEngine_Feeble::off_loadVideo() {
624 	// 182: load video file
625 	const byte *filename = getStringPtrByID(getNextStringID());
626 
627 	_moviePlayer = makeMoviePlayer(this, (const char *)filename);
628 
629 	assert(_moviePlayer);
630 	_moviePlayer->load();
631 
632 	if (getFeatures() & GF_BROKEN_FF_RATING) {
633 		if (strcmp((const char *)filename, "Statue1.smk") == 0) {
634 			setLoyaltyRating(5);
635 		}
636 	}
637 }
638 
off_playVideo()639 void AGOSEngine_Feeble::off_playVideo() {
640 	// 183: play video
641 	if (getBitFlag(40)) {
642 		// Omni TV controls
643 		if (_moviePlayer) {
644 			setBitFlag(42, false);
645 			_interactiveVideo = MoviePlayer::TYPE_OMNITV;
646 			_moviePlayer->play();
647 		} else {
648 			_variableArray[254] = 6747;
649 		}
650 	} else {
651 		assert(_moviePlayer);
652 		_moviePlayer->play();
653 
654 		delete _moviePlayer;
655 		_moviePlayer = NULL;
656 	}
657 }
658 
off_centerScroll()659 void AGOSEngine_Feeble::off_centerScroll() {
660 	// 187
661 	centerScroll();
662 }
663 
off_resetPVCount()664 void AGOSEngine_Feeble::off_resetPVCount() {
665 	// 191
666 	if (getBitFlag(83)) {
667 		_PVCount1 = 0;
668 		_GPVCount1 = 0;
669 	} else {
670 		_PVCount = 0;
671 		_GPVCount = 0;
672 	}
673 }
674 
off_setPathValues()675 void AGOSEngine_Feeble::off_setPathValues() {
676 	// 192
677 	uint8 a = getVarOrByte();
678 	uint8 b = getVarOrByte();
679 	uint8 c = getVarOrByte();
680 	uint8 d = getVarOrByte();
681 	if (getBitFlag(83)) {
682 		_pathValues1[_PVCount1++] = a;
683 		_pathValues1[_PVCount1++] = b;
684 		_pathValues1[_PVCount1++] = c;
685 		_pathValues1[_PVCount1++] = d;
686 	} else {
687 		_pathValues[_PVCount++] = a;
688 		_pathValues[_PVCount++] = b;
689 		_pathValues[_PVCount++] = c;
690 		_pathValues[_PVCount++] = d;
691 	}
692 }
693 
off_stopClock()694 void AGOSEngine_Feeble::off_stopClock() {
695 	// 193: pause clock
696 	_clockStopped = getTime();
697 }
698 
off_restartClock()699 void AGOSEngine_Feeble::off_restartClock() {
700 	// 194: resume clock
701 	if (_clockStopped != 0)
702 		_gameStoppedClock += getTime() - _clockStopped;
703 	_clockStopped = 0;
704 }
705 
off_setColor()706 void AGOSEngine_Feeble::off_setColor() {
707 	// 195: set palette color
708 	uint16 c = getVarOrByte() * 3;
709 	uint8 r = getVarOrByte();
710 	uint8 g = getVarOrByte();
711 	uint8 b = getVarOrByte();
712 
713 	_displayPalette[c + 0] = r;
714 	_displayPalette[c + 1] = g;
715 	_displayPalette[c + 2] = b;
716 
717 	_paletteFlag = 2;
718 }
719 
off_b3Set()720 void AGOSEngine_Feeble::off_b3Set() {
721 	// 196: set bit3
722 	uint8 bit = getVarOrByte();
723 	_bitArrayThree[bit / 16] |= (1 << (bit & 15));
724 }
725 
off_b3Clear()726 void AGOSEngine_Feeble::off_b3Clear() {
727 	// 197: clear bit3
728 	uint8 bit = getVarOrByte();
729 	_bitArrayThree[bit / 16] &= ~(1 << (bit & 15));
730 }
731 
off_b3Zero()732 void AGOSEngine_Feeble::off_b3Zero() {
733 	// 198: is bit3 clear
734 	uint8 bit = getVarOrByte();
735 	setScriptCondition((_bitArrayThree[bit / 16] & (1 << (bit & 15))) == 0);
736 }
737 
off_b3NotZero()738 void AGOSEngine_Feeble::off_b3NotZero() {
739 	// 199: is bit3 set
740 	uint8 bit = getVarOrByte();
741 	setScriptCondition((_bitArrayThree[bit / 16] & (1 << (bit & 15))) != 0);
742 }
743 
744 } // End of namespace AGOS
745 
746 #endif // ENABLE_AGOS2
747