[Scummvm-cvs-logs] SF.net SVN: scummvm:[36023] scummvm/trunk/engines/made

john_doe at users.sourceforge.net john_doe at users.sourceforge.net
Fri Jan 23 13:17:12 CET 2009


Revision: 36023
          http://scummvm.svn.sourceforge.net/scummvm/?rev=36023&view=rev
Author:   john_doe
Date:     2009-01-23 12:17:12 +0000 (Fri, 23 Jan 2009)

Log Message:
-----------
- Implemented sfGetMusicBeat (used in several games as some kind of timer)

Modified Paths:
--------------
    scummvm/trunk/engines/made/made.h
    scummvm/trunk/engines/made/scriptfuncs.cpp

Modified: scummvm/trunk/engines/made/made.h
===================================================================
--- scummvm/trunk/engines/made/made.h	2009-01-23 04:57:18 UTC (rev 36022)
+++ scummvm/trunk/engines/made/made.h	2009-01-23 12:17:12 UTC (rev 36023)
@@ -119,6 +119,8 @@
 	bool _autoStopSound;
 	uint _soundEnergyIndex;
 	SoundEnergyArray *_soundEnergyArray;
+	
+	uint32 _musicBeatStart;
 
 	int32 _timers[50];
 	int16 getTicks();

Modified: scummvm/trunk/engines/made/scriptfuncs.cpp
===================================================================
--- scummvm/trunk/engines/made/scriptfuncs.cpp	2009-01-23 04:57:18 UTC (rev 36022)
+++ scummvm/trunk/engines/made/scriptfuncs.cpp	2009-01-23 12:17:12 UTC (rev 36023)
@@ -249,6 +249,8 @@
 int16 ScriptFunctions::sfPlayMusic(int16 argc, int16 *argv) {
 	int16 musicNum = argv[0];
 
+	_vm->_musicBeatStart = _vm->_system->getMillis();
+
 	if (_vm->getGameID() == GID_RTZ) {
 		if (musicNum > 0) {
 			_musicRes = _vm->_res->getXmidi(musicNum);
@@ -337,11 +339,8 @@
 }
 
 int16 ScriptFunctions::sfGetMusicBeat(int16 argc, int16 *argv) {
-	// TODO
-	// This is called loads of times in the intro of the floppy version
-	// of RtZ. Not sure what it does. Commented out to reduce spam
-	//warning("Unimplemented opcode: sfGetMusicBeat");
-	return 0;
+	// This is used as timer in some games
+	return (_vm->_system->getMillis() - _vm->_musicBeatStart) / 360;
 }
 
 int16 ScriptFunctions::sfSetScreenLock(int16 argc, int16 *argv) {


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