aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBenjamin Haisch2009-02-04 19:15:12 +0000
committerBenjamin Haisch2009-02-04 19:15:12 +0000
commit22812367aa3db0f31856ad910f250cea83d609a4 (patch)
tree8cf550bf1520900ff2a9a8ecc99123961aced947 /engines
parent9de91ecdeaf5fc1e7b32094ba72076eca1d3f875 (diff)
downloadscummvm-rg350-22812367aa3db0f31856ad910f250cea83d609a4.tar.gz
scummvm-rg350-22812367aa3db0f31856ad910f250cea83d609a4.tar.bz2
scummvm-rg350-22812367aa3db0f31856ad910f250cea83d609a4.zip
- Fixed/completed cd audio support (sfPlayCd and sfGetCdTime) for Manhole:N&E and RtZ CD
svn-id: r36217
Diffstat (limited to 'engines')
-rw-r--r--engines/made/made.cpp3
-rw-r--r--engines/made/made.h1
-rw-r--r--engines/made/scriptfuncs.cpp20
3 files changed, 18 insertions, 6 deletions
diff --git a/engines/made/made.cpp b/engines/made/made.cpp
index 927b597c2a..892e8b1638 100644
--- a/engines/made/made.cpp
+++ b/engines/made/made.cpp
@@ -284,6 +284,9 @@ Common::Error MadeEngine::go() {
} else {
error ("Unknown MADE game");
}
+
+ if ((getFeatures() & GF_CD) || (getFeatures() & GF_CD_COMPRESSED))
+ checkCD();
_autoStopSound = false;
_eventNum = _eventKey = _eventMouseX = _eventMouseY = 0;
diff --git a/engines/made/made.h b/engines/made/made.h
index 0b66146e0b..16ccf66b71 100644
--- a/engines/made/made.h
+++ b/engines/made/made.h
@@ -121,6 +121,7 @@ public:
SoundEnergyArray *_soundEnergyArray;
uint32 _musicBeatStart;
+ uint32 _cdTimeStart;
int32 _timers[50];
int16 getTicks();
diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp
index a548aff15f..7a07550b6f 100644
--- a/engines/made/scriptfuncs.cpp
+++ b/engines/made/scriptfuncs.cpp
@@ -580,8 +580,13 @@ int16 ScriptFunctions::sfPlayVoice(int16 argc, int16 *argv) {
}
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::sfGetCdStatus(int16 argc, int16 *argv) {
}
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) {