[Scummvm-cvs-logs] CVS: scummvm/saga sceneproc.cpp,1.7,1.8 sfuncs.cpp,1.3,1.4 sfuncs.h,1.3,1.4 sthread.cpp,1.7,1.8

Eugene Sandulenko sev at users.sourceforge.net
Wed May 12 18:42:03 CEST 2004


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3000

Modified Files:
	sceneproc.cpp sfuncs.cpp sfuncs.h sthread.cpp 
Log Message:
Added more stubs from script fucntions, some renames for consistency with
disassembly.


Index: sceneproc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sceneproc.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- sceneproc.cpp	5 May 2004 13:05:44 -0000	1.7
+++ sceneproc.cpp	13 May 2004 01:41:23 -0000	1.8
@@ -105,6 +105,8 @@
 
 		ANIM_SetFlag(0, ANIM_LOOP);
 		ANIM_Play(0, delay_time);
+
+		debug(0, "InitialSceneproc(): Scene started");
 		break;
 	case SCENE_END:
 		break;

Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- sfuncs.cpp	1 May 2004 14:34:00 -0000	1.3
+++ sfuncs.cpp	13 May 2004 01:41:23 -0000	1.4
@@ -40,21 +40,21 @@
 
 R_SFUNC_ENTRY SFuncList[R_SFUNC_NUM] = {
 	{0, 0, NULL},
-	{1, 1, SF_Sleep},
+	{1, 1, SF_sleep},
 	{2, 0, NULL},
 	{3, 1, SF_3},
-	{4, 1, SF_SetCommandText},
+	{4, 1, SF_setCommandText},
 	{5, 0, NULL},
-	{6, 3, SF_ActorWalkTo},
-	{7, 0, NULL},
-	{8, 2, SF_SetActorOrient},
+	{6, 3, SF_actorWalkTo},
+	{7, 0, SF_doAction},
+	{8, 2, SF_setFacing},
 	{9, 0, NULL},
 	{10, 0, NULL},
-	{11, 1, SF_FreezeInterface},
+	{11, 1, SF_freezeInterface},
 	{12, 0, NULL},
 	{13, 0, NULL},
-	{14, 0, NULL},
-	{15, 0, NULL},
+	{14, 0, SF_faceTowards},
+	{15, 0, SF_setFollower},
 	{16, 0, NULL},
 	{17, 0, NULL},
 	{18, 0, NULL},
@@ -64,43 +64,43 @@
 	{22, 0, NULL},
 	{23, 0, NULL},
 	{24, 0, NULL},
-	{25, 0, NULL},
-	{26, 3, SF_StartAnim},
-	{27, 3, SF_ActorWalkToAsync},
+	{25, 0, SF_centerActor},
+	{26, 3, SF_startAnim},
+	{27, 3, SF_actorWalkToAsync},
 	{28, 0, NULL},
-	{29, 0, NULL},
-	{30, 3, SF_PlaceActor},
+	{29, 0, SF_setActorState},
+	{30, 3, SF_moveTo},
 	{31, 0, NULL},
 	{32, 0, NULL},
 	{33, 0, NULL},
-	{34, 0, NULL},
+	{34, 0, SF_swapActors},
 	{35, 0, NULL},
-	{36, 4, SF_ActorWalkTo2},
-	{37, 4, SF_SetActorAct},
-	{38, 3, SF_SetActorAct2},
+	{36, 4, SF_actorWalk},
+	{37, 4, SF_cycleActorFrames},
+	{38, 3, SF_setFrame},
 	{39, 0, NULL},
 	{40, 0, NULL},
-	{41, 4, SF_LinkAnim},
-	{42, 0, NULL},
-	{43, 6, SF_PlaceActorEx},
-	{44, 0, SF_CheckUserInterrupt},
-	{45, 0, NULL},
-	{46, 0, NULL},
+	{41, 4, SF_linkAnim},
+	{42, 0, SF_scriptSpecialWalk},
+	{43, 6, SF_placeActor},
+	{44, 0, SF_checkUserInterrupt},
+	{45, 0, SF_walkRelative},
+	{46, 0, SF_moveRelative},
 	{47, 0, NULL},
 	{48, 0, NULL},
 	{49, 0, NULL},
 	{50, 0, NULL},
 	{51, 0, NULL},
-	{52, 0, NULL},
-	{53, 0, NULL},
+	{52, 0, SF_throwActor},
+	{53, 0, SF_waitWalk},
 	{54, 0, NULL},
-	{55, 0, NULL},
-	{56, 0, NULL},
+	{55, 0, SF_changeActorScene},
+	{56, 0, SF_climb},
 	{57, 0, NULL},
-	{58, 0, NULL},
+	{58, 0, SF_setActorZ},
 	{59, 0, NULL},
-	{60, 0, NULL},
-	{61, 0, NULL},
+	{60, 0, SF_getActorX},
+	{61, 0, SF_getActorY},
 	{62, 0, NULL},
 	{63, 0, NULL},
 	{64, 0, NULL},
@@ -122,7 +122,7 @@
 // Script function #1 (0x01) blocking
 // Suspends thread execution for the specified time period
 // Param1: time to suspend ( units? )
-int SF_Sleep(R_SCRIPTFUNC_PARAMS) {
+int SF_sleep(R_SCRIPTFUNC_PARAMS) {
 	SDataWord_T time_param;
 	int time;
 
@@ -148,7 +148,7 @@
 // Script function #4 (0x04) nonblocking
 // Set the command display to the specified text string
 // Param1: dialogue index of string
-int SF_SetCommandText(R_SCRIPTFUNC_PARAMS) {
+int SF_setCommandText(R_SCRIPTFUNC_PARAMS) {
 	SDataWord_T s_idx_parm;
 
 	SSTACK_Pop(thread->stack, &s_idx_parm);
@@ -162,7 +162,7 @@
 // Param1: actor id
 // Param2: actor destination x
 // Param3: actor destination y
-int SF_ActorWalkTo(R_SCRIPTFUNC_PARAMS) {
+int SF_actorWalkTo(R_SCRIPTFUNC_PARAMS) {
 	SDataWord_T actor_parm;
 	SDataWord_T x_parm;
 	SDataWord_T y_parm;
@@ -189,11 +189,16 @@
 	return R_SUCCESS;
 }
 
+// Script function #7
+int SF_doAction(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
 // Script function #8 (0x08) nonblocking
 // Sets the orientation of the specified actor.
 // Param1: actor id
 // Param2: actor orientation
-int SF_SetActorOrient(R_SCRIPTFUNC_PARAMS) {
+int SF_setFacing(R_SCRIPTFUNC_PARAMS) {
 	SDataWord_T actor_parm;
 	SDataWord_T orient_parm;
 	int actor_id;
@@ -220,7 +225,7 @@
 // continues to run. If the parameter is false, the user interface is 
 // reenabled.
 // Param1: boolean
-int SF_FreezeInterface(R_SCRIPTFUNC_PARAMS) {
+int SF_freezeInterface(R_SCRIPTFUNC_PARAMS) {
 	SDataWord_T b_param;
 
 	SSTACK_Pop(thread->stack, &b_param);
@@ -234,12 +239,28 @@
 	return R_SUCCESS;
 }
 
+// Script function #14
+int SF_faceTowards(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
+// Script function #15
+int SF_setFollower(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
+// Script function #25
+int SF_centerActor(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
 // Script function #26 (0x1A) nonblocking
 // Starts the specified animation 
 // Param1: ?
 // Param2: frames of animation to play or -1 to loop
 // Param3: animation id
-int SF_StartAnim(R_SCRIPTFUNC_PARAMS) {
+int SF_startAnim(R_SCRIPTFUNC_PARAMS) {
+// FIXME: implementation is wrong. Should link animation
 	SDataWord_T unk_parm;
 	SDataWord_T frame_parm;
 	SDataWord_T anim_id_parm;
@@ -266,7 +287,7 @@
 // Param1: actor id
 // Param2: actor destination x
 // Param3: actor destination y
-int SF_ActorWalkToAsync(R_SCRIPTFUNC_PARAMS) {
+int SF_actorWalkToAsync(R_SCRIPTFUNC_PARAMS) {
 	SDataWord_T actor_parm;
 	SDataWord_T x_parm;
 	SDataWord_T y_parm;
@@ -293,13 +314,18 @@
 	return R_SUCCESS;
 }
 
+// Script function #29
+int SF_setActorState(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
 // Script function #30 (0x1E) nonblocking
 // Positions an actor at the specified location; actor is created if the 
 // actor does not already exist.
 // Param1: actor id
 // Param2: actor pos x
 // Param3: actor pos y
-int SF_PlaceActor(R_SCRIPTFUNC_PARAMS) {
+int SF_moveTo(R_SCRIPTFUNC_PARAMS) {
 	SDataWord_T actor_parm;
 	SDataWord_T x_parm;
 	SDataWord_T y_parm;
@@ -330,13 +356,18 @@
 	return R_SUCCESS;
 }
 
+// Script function #34
+int SF_swapActors(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
 // Script function #36 (0x24) ?
 // Commands the specified actor to walk to the given position
 // Param1: actor id
 // Param2: actor destination x
 // Param3: actor destination y
 // Param4: unknown
-int SF_ActorWalkTo2(R_SCRIPTFUNC_PARAMS) {
+int SF_actorWalk(R_SCRIPTFUNC_PARAMS) {
 	// INCOMPLETE
 	SDataWord_T actor_parm;
 	SDataWord_T x_parm;
@@ -374,7 +405,7 @@
 // Param2: unknown
 // Param3: actor action state
 // Param4: unknown
-int SF_SetActorAct(R_SCRIPTFUNC_PARAMS) {
+int SF_cycleActorFrames(R_SCRIPTFUNC_PARAMS) {
 	// INCOMPLETE
 	SDataWord_T actor_parm;
 	SDataWord_T unk1_parm;
@@ -406,7 +437,7 @@
 // Param1: actor id
 // Param2: actor action state
 // Param3: unknown
-int SF_SetActorAct2(R_SCRIPTFUNC_PARAMS) {
+int SF_setFrame(R_SCRIPTFUNC_PARAMS) {
 	// INCOMPLETE
 
 	SDataWord_T actor_parm;
@@ -441,7 +472,7 @@
 // Param2: total linked frame count
 // Param3: animation id link target
 // Param4: animation id link source
-int SF_LinkAnim(R_SCRIPTFUNC_PARAMS) {
+int SF_linkAnim(R_SCRIPTFUNC_PARAMS) {
 	SDataWord_T unk_parm;
 	SDataWord_T tframes_parm;
 	SDataWord_T anim1_parm;
@@ -466,6 +497,11 @@
 	return R_SUCCESS;
 }
 
+// Script function #42
+int SF_scriptSpecialWalk(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
 // Script function #43 (0x2B) nonblocking
 // Positions an actor at the specified location; actor is created if the 
 //  actor does not already exist.
@@ -475,7 +511,7 @@
 // Param4: ?
 // Param5: actor action
 // Param6: ?
-int SF_PlaceActorEx(R_SCRIPTFUNC_PARAMS) {
+int SF_placeActor(R_SCRIPTFUNC_PARAMS) {
 	// INCOMPLETE
 	SDataWord_T actor_parm;
 	SDataWord_T x_parm;
@@ -522,7 +558,7 @@
 // Checks to see if the user has interrupted a currently playing 
 // game cinematic. Pushes a zero or positive value if the game 
 // has not been interrupted.
-int SF_CheckUserInterrupt(R_SCRIPTFUNC_PARAMS) {
+int SF_checkUserInterrupt(R_SCRIPTFUNC_PARAMS) {
 	SSTACK_Push(thread->stack, 0);
 
 	// INCOMPLETE
@@ -530,4 +566,49 @@
 	return R_SUCCESS;
 }
 
+// Script function #45
+int SF_walkRelative(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
+// Script function #46
+int SF_moveRelative(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
+// Script function #52
+int SF_throwActor(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
+// Script function #53
+int SF_waitWalk(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
+// Script function #55
+int SF_changeActorScene(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
+// Script function #56
+int SF_climb(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
+// Script function #58
+int SF_setActorZ(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
+// Script function #60
+int SF_getActorX(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
+// Script function #61
+int SF_getActorY(R_SCRIPTFUNC_PARAMS) {
+	return R_SUCCESS;
+}
+
 } // End of namespace Saga

Index: sfuncs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- sfuncs.h	1 May 2004 14:34:00 -0000	1.3
+++ sfuncs.h	13 May 2004 01:41:23 -0000	1.4
@@ -44,37 +44,38 @@
 
 extern R_SFUNC_ENTRY SFuncList[];
 
-// SF 1
-int SF_Sleep(R_SCRIPTFUNC_PARAMS);
-// SF 3
+int SF_sleep(R_SCRIPTFUNC_PARAMS);
 int SF_3(R_SCRIPTFUNC_PARAMS);
-// SF 4
-int SF_SetCommandText(R_SCRIPTFUNC_PARAMS);
-// SF 6
-int SF_ActorWalkTo(R_SCRIPTFUNC_PARAMS);
-// SF 8
-int SF_SetActorOrient(R_SCRIPTFUNC_PARAMS);
-// SF 11
-int SF_FreezeInterface(R_SCRIPTFUNC_PARAMS);
-// SF 26
-int SF_StartAnim(R_SCRIPTFUNC_PARAMS);
-// SF 27
-int SF_ActorWalkToAsync(R_SCRIPTFUNC_PARAMS);
-// SF 30
-int SF_PlaceActor(R_SCRIPTFUNC_PARAMS);
-// SF 36
-int SF_ActorWalkTo2(R_SCRIPTFUNC_PARAMS);
-// SF 37
-int SF_SetActorAct(R_SCRIPTFUNC_PARAMS);
-// SF 38
-int SF_SetActorAct2(R_SCRIPTFUNC_PARAMS);
-// SF 41
-int SF_LinkAnim(R_SCRIPTFUNC_PARAMS);
-// SF 43
-int SF_PlaceActorEx(R_SCRIPTFUNC_PARAMS);
-// SF 44
-int SF_CheckUserInterrupt(R_SCRIPTFUNC_PARAMS);
+int SF_setCommandText(R_SCRIPTFUNC_PARAMS);
+int SF_actorWalkTo(R_SCRIPTFUNC_PARAMS);
+int SF_setFacing(R_SCRIPTFUNC_PARAMS);
+int SF_freezeInterface(R_SCRIPTFUNC_PARAMS);
+int SF_startAnim(R_SCRIPTFUNC_PARAMS);
+int SF_actorWalkToAsync(R_SCRIPTFUNC_PARAMS);
+int SF_moveTo(R_SCRIPTFUNC_PARAMS);
+int SF_actorWalk(R_SCRIPTFUNC_PARAMS);
+int SF_cycleActorFrames(R_SCRIPTFUNC_PARAMS);
+int SF_setFrame(R_SCRIPTFUNC_PARAMS);
+int SF_linkAnim(R_SCRIPTFUNC_PARAMS);
+int SF_placeActor(R_SCRIPTFUNC_PARAMS);
+int SF_checkUserInterrupt(R_SCRIPTFUNC_PARAMS);
+int SF_moveRelative(R_SCRIPTFUNC_PARAMS);
+int SF_doAction(R_SCRIPTFUNC_PARAMS);
+int SF_faceTowards(R_SCRIPTFUNC_PARAMS);
+int SF_setFollower(R_SCRIPTFUNC_PARAMS);
+int SF_centerActor(R_SCRIPTFUNC_PARAMS);
+int SF_setActorState(R_SCRIPTFUNC_PARAMS);
+int SF_swapActors(R_SCRIPTFUNC_PARAMS);
+int SF_scriptSpecialWalk(R_SCRIPTFUNC_PARAMS);
+int SF_walkRelative(R_SCRIPTFUNC_PARAMS);
+int SF_throwActor(R_SCRIPTFUNC_PARAMS);
+int SF_waitWalk(R_SCRIPTFUNC_PARAMS);
+int SF_changeActorScene(R_SCRIPTFUNC_PARAMS);
+int SF_climb(R_SCRIPTFUNC_PARAMS);
+int SF_setActorZ(R_SCRIPTFUNC_PARAMS);
+int SF_getActorX(R_SCRIPTFUNC_PARAMS);
+int SF_getActorY(R_SCRIPTFUNC_PARAMS);
 
-} // End of namespace Saga
+}
 
 #endif

Index: sthread.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sthread.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- sthread.cpp	5 May 2004 13:05:45 -0000	1.7
+++ sthread.cpp	13 May 2004 01:41:23 -0000	1.8
@@ -547,7 +547,6 @@
 			iresult = iparam1 + iparam2;
 			SSTACK_Push(thread->stack, (SDataWord_T) iresult);
 			break;
-
 			// (SUB): Subtraction
 		case 0x2D:
 			SSTACK_Pop(thread->stack, &param2);
@@ -566,7 +565,7 @@
 			iresult = iparam1 * iparam2;
 			SSTACK_Push(thread->stack, (SDataWord_T) iresult);
 			break;
-			// (DIB): Integer division
+			// (DIV): Integer division
 		case 0x2F:
 			SSTACK_Pop(thread->stack, &param2);
 			SSTACK_Pop(thread->stack, &param1);
@@ -638,6 +637,9 @@
 			data = (iparam1 <= iparam2) ? 1 : 0;
 			SSTACK_Push(thread->stack, data);
 			break;
+
+// BITWISE INSTRUCTIONS   
+
 			// (SHR): Arithmetic binary shift right
 		case 0x3F:
 			SSTACK_Pop(thread->stack, &param2);
@@ -651,9 +653,6 @@
 			}
 			SSTACK_Push(thread->stack, param1);
 			break;
-
-// BITWISE INSTRUCTIONS   
-
 			// (SHL) Binary shift left
 		case 0x40:
 			SSTACK_Pop(thread->stack, &param2);
@@ -734,7 +733,7 @@
 					if (!ScriptModule.voice_lut_present) {
 						voice_rn = -1;
 					} else {
-						voice_rn = ScriptModule. current_script->voice->voices[data];
+						voice_rn = ScriptModule.current_script->voice->voices[data];
 					}
 					ACTOR_Speak(a_index, ScriptModule.current_script->diag-> str[data], voice_rn, &thread->sem);
 				}





More information about the Scummvm-git-logs mailing list