[Scummvm-cvs-logs] SF.net SVN: scummvm: [31184] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Tue Mar 18 19:07:06 CET 2008


Revision: 31184
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31184&view=rev
Author:   lordhoto
Date:     2008-03-18 11:07:05 -0700 (Tue, 18 Mar 2008)

Log Message:
-----------
- Impelemented opcodes:
  -> 95: o2_showPickUpString
  -> 107: o2_waitForConfirmationClick
  -> 161: o2_getRainbowRoomData
  -> 162: o2_drawSceneShapeEx
- Did I mention that HoF is completable now?

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_v2.h
    scummvm/trunk/engines/kyra/script_v2.cpp
    scummvm/trunk/engines/kyra/staticres.cpp

Modified: scummvm/trunk/engines/kyra/kyra_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.h	2008-03-18 17:00:26 UTC (rev 31183)
+++ scummvm/trunk/engines/kyra/kyra_v2.h	2008-03-18 18:07:05 UTC (rev 31184)
@@ -1031,11 +1031,13 @@
 	int o2_blockInRegion(ScriptState *script);
 	int o2_blockOutRegion(ScriptState *script);
 	int o2_setCauldronState(ScriptState *script);
+	int o2_showPickUpString(ScriptState *script);
 	int o2_getRand(ScriptState *script);
 	int o2_setDeathHandlerFlag(ScriptState *script);
 	int o2_setDrawNoShapeFlag(ScriptState *script);
 	int o2_showLetter(ScriptState *script);
 	int o2_fillRect(ScriptState *script);
+	int o2_waitForConfirmationClick(ScriptState *script);
 	int o2_encodeShape(ScriptState *script);
 	int o2_defineRoomEntrance(ScriptState *script);
 	int o2_runTemporaryScript(ScriptState *script);
@@ -1083,6 +1085,8 @@
 	int o2_setTimerCountdown(ScriptState *script);
 	int o2_processPaletteIndex(ScriptState *script);
 	int o2_updateTwoSceneAnims(ScriptState *script);
+	int o2_getRainbowRoomData(ScriptState *script);
+	int o2_drawSceneShapeEx(ScriptState *script);
 	int o2_getBoolFromStack(ScriptState *script);
 	int o2_setVocHigh(ScriptState *script);
 	int o2_getVocHigh(ScriptState *script);
@@ -1187,6 +1191,8 @@
 	Sequence *_sequences;
 	NestedSequence *_nSequences;
 
+	static const uint8 _rainbowRoomData[];
+
 	// color code related vars
 	int _colorCodeFlag1;
 	int _colorCodeFlag2;

Modified: scummvm/trunk/engines/kyra/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v2.cpp	2008-03-18 17:00:26 UTC (rev 31183)
+++ scummvm/trunk/engines/kyra/script_v2.cpp	2008-03-18 18:07:05 UTC (rev 31184)
@@ -857,6 +857,27 @@
 	return 0;
 }
 
+int KyraEngine_v2::o2_showPickUpString(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_showPickUpString(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+	const int item = stackPos(0);
+	
+	int string = 0;
+	if (stackPos(1) == 1) {
+		if (_lang == 1)
+			string = getItemCommandStringPickUp(item);
+		else
+			string = 7;
+	} else {
+		if (_lang == 1)
+			string = getItemCommandStringInv(item);
+		else
+			string = 8;
+	}
+
+	updateCommandLineEx(item+54, string, 0xD6);
+	return 0;
+}
+
 int KyraEngine_v2::o2_getRand(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getRand(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
 	assert(stackPos(0) < stackPos(1));
@@ -941,6 +962,30 @@
 	return 0;
 }
 
+int KyraEngine_v2::o2_waitForConfirmationClick(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_waitForConfirmationClick(%p) (%d)", (const void *)script, stackPos(0));
+	resetSkipFlag();
+	uint32 maxWaitTime = _system->getMillis() + stackPos(0) * _tickLength;
+
+	while (_system->getMillis() < maxWaitTime) {
+		int inputFlag = checkInput(0);
+		removeInputTop();
+
+		if (inputFlag == 198 || inputFlag == 199) {
+			_sceneScriptState.regs[1] = _mouseX;
+			_sceneScriptState.regs[2] = _mouseY;
+			return 0;
+		}
+
+		update();
+		_system->delayMillis(10);
+	}
+
+	_sceneScriptState.regs[1] = _mouseX;
+	_sceneScriptState.regs[2] = _mouseY;
+	return 1;
+}
+
 int KyraEngine_v2::o2_encodeShape(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_encodeShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1),
 		stackPos(2), stackPos(3), stackPos(4));
@@ -1489,6 +1534,29 @@
 	return 0;
 }
 
+int KyraEngine_v2::o2_getRainbowRoomData(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getRainbowRoomData(%p) (%d)", (const void *)script, stackPos(0));
+	return _rainbowRoomData[stackPos(0)];
+}
+
+int KyraEngine_v2::o2_drawSceneShapeEx(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_drawSceneShapeEx(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+	const int itemShape = stackPos(0) + 64;
+	const int x = stackPos(1);
+	const int y = stackPos(2);
+	const bool skipFronUpdate = (stackPos(3) != 0);
+
+	_screen->drawShape(2, _sceneShapeTable[6], x, y, 2, 0);
+	_screen->drawShape(2, getShapePtr(itemShape), x+2, y+2, 2, 0);
+
+	if (!skipFronUpdate) {
+		_screen->copyRegion(x, y, x, y, 0x15, 0x14, 2, 0, Screen::CR_NO_P_CHECK);
+		_screen->updateScreen();
+	}
+
+	return 0;
+}
+
 int KyraEngine_v2::o2_getBoolFromStack(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getBoolFromStack(%p) ()", (const void *)script);
 	return stackPos(0) ? 1 : 0;
@@ -1707,7 +1775,7 @@
 		Opcode(o2_blockOutRegion),
 		OpcodeUnImpl(),
 		Opcode(o2_setCauldronState),
-		OpcodeUnImpl(),
+		Opcode(o2_showPickUpString),
 		// 0x60
 		Opcode(o2_getRand),
 		OpcodeUnImpl(),
@@ -1722,7 +1790,7 @@
 		OpcodeUnImpl(),
 		OpcodeUnImpl(),
 		OpcodeUnImpl(),
-		OpcodeUnImpl(),
+		Opcode(o2_waitForConfirmationClick),
 		// 0x6c
 		Opcode(o2_encodeShape),
 		Opcode(o2_defineRoomEntrance),
@@ -1790,8 +1858,8 @@
 		Opcode(o2_processPaletteIndex),
 		// 0xa0
 		Opcode(o2_updateTwoSceneAnims),
-		OpcodeUnImpl(),
-		OpcodeUnImpl(),
+		Opcode(o2_getRainbowRoomData),
+		Opcode(o2_drawSceneShapeEx),
 		Opcode(o2_getBoolFromStack),
 		// 0xa4
 		OpcodeUnImpl(),

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2008-03-18 17:00:26 UTC (rev 31183)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2008-03-18 18:07:05 UTC (rev 31184)
@@ -1600,6 +1600,18 @@
 	0x1B, 0x39, 0x1A, 0x3A, 0x4D, 0x72, -1
 };
 
+const uint8 KyraEngine_v2::_rainbowRoomData[] = {
+	0x02, 0xA9, 0x9E, 0x75, 0x73, 0x17, 0x00, 0xA0,
+	0x08, 0x01, 0x19, 0x9F, 0x66, 0x05, 0x22, 0x7D,
+	0x20, 0x25, 0x1D, 0x64, 0xA0, 0x78, 0x85, 0x3B,
+	0x3C, 0x5E, 0x38, 0x45, 0x8F, 0x61, 0xA1, 0x71,
+	0x47, 0x77, 0x86, 0x41, 0xA2, 0x5F, 0x03, 0x72,
+	0x83, 0x9E, 0x84, 0x8E, 0xAD, 0xA8, 0x04, 0x79,
+	0xAA, 0xA3, 0x06, 0x27, 0x8F, 0x9F, 0x0A, 0x76,
+	0x46, 0x1E, 0x24, 0x63, 0x18, 0x69, 0x39, 0x1F,
+	0x7E, 0xAD, 0x28, 0x60, 0x67, 0x21, 0x84, 0x34
+};
+
 // kyra 3 static res
 
 const char *KyraEngine_v3::_soundList[] = {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list