[Scummvm-cvs-logs] SF.net SVN: scummvm:[36217] scummvm/trunk/engines/made
john_doe at users.sourceforge.net
john_doe at users.sourceforge.net
Wed Feb 4 20:15:12 CET 2009
Revision: 36217
http://scummvm.svn.sourceforge.net/scummvm/?rev=36217&view=rev
Author: john_doe
Date: 2009-02-04 19:15:12 +0000 (Wed, 04 Feb 2009)
Log Message:
-----------
- Fixed/completed cd audio support (sfPlayCd and sfGetCdTime) for Manhole:N&E and RtZ CD
Modified Paths:
--------------
scummvm/trunk/engines/made/made.cpp
scummvm/trunk/engines/made/made.h
scummvm/trunk/engines/made/scriptfuncs.cpp
Modified: scummvm/trunk/engines/made/made.cpp
===================================================================
--- scummvm/trunk/engines/made/made.cpp 2009-02-04 17:08:04 UTC (rev 36216)
+++ scummvm/trunk/engines/made/made.cpp 2009-02-04 19:15:12 UTC (rev 36217)
@@ -284,6 +284,9 @@
} else {
error ("Unknown MADE game");
}
+
+ if ((getFeatures() & GF_CD) || (getFeatures() & GF_CD_COMPRESSED))
+ checkCD();
_autoStopSound = false;
_eventNum = _eventKey = _eventMouseX = _eventMouseY = 0;
Modified: scummvm/trunk/engines/made/made.h
===================================================================
--- scummvm/trunk/engines/made/made.h 2009-02-04 17:08:04 UTC (rev 36216)
+++ scummvm/trunk/engines/made/made.h 2009-02-04 19:15:12 UTC (rev 36217)
@@ -121,6 +121,7 @@
SoundEnergyArray *_soundEnergyArray;
uint32 _musicBeatStart;
+ uint32 _cdTimeStart;
int32 _timers[50];
int16 getTicks();
Modified: scummvm/trunk/engines/made/scriptfuncs.cpp
===================================================================
--- scummvm/trunk/engines/made/scriptfuncs.cpp 2009-02-04 17:08:04 UTC (rev 36216)
+++ scummvm/trunk/engines/made/scriptfuncs.cpp 2009-02-04 19:15:12 UTC (rev 36217)
@@ -580,8 +580,13 @@
}
int16 ScriptFunctions::sfPlayCd(int16 argc, int16 *argv) {
- AudioCD.play(argv[0], -1, 0, 0);
- return 0;
+ AudioCD.play(argv[0] - 1, 1, 0, 0);
+ _vm->_cdTimeStart = _vm->_system->getMillis();
+ if (AudioCD.isPlaying()) {
+ return 1;
+ } else {
+ return 0;
+ }
}
int16 ScriptFunctions::sfStopCd(int16 argc, int16 *argv) {
@@ -598,10 +603,13 @@
}
int16 ScriptFunctions::sfGetCdTime(int16 argc, int16 *argv) {
- // This one is called loads of times, so it has been commented out to reduce spam
- //warning("Unimplemented opcode: sfGetCdTime");
- // TODO
- return 32000;
+ if (AudioCD.isPlaying()) {
+ uint32 deltaTime = _vm->_system->getMillis() - _vm->_cdTimeStart;
+ // This basically converts the time from milliseconds to MSF format to MADE's format
+ return (deltaTime / 1000 * 30) + (deltaTime % 1000 / 75 * 30 / 75);
+ } else {
+ return 32000;
+ }
}
int16 ScriptFunctions::sfPlayCdSegment(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