aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise/function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cruise/function.cpp')
-rw-r--r--engines/cruise/function.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index 44107d4879..1dbac3e209 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -32,6 +32,10 @@
namespace Cruise {
+uint32 Period(uint32 hz) {
+ return ((uint32)(100000000L / ((uint32)hz * 28L)));
+}
+
//#define FUNCTION_DEBUG
int16 Op_LoadOverlay(void) {
@@ -246,15 +250,14 @@ int16 Op_StopFX(void) {
int16 Op_FreqFX(void) {
int volume = popVar();
- int speed = popVar();
+ int freq2 = popVar();
int channelNum = popVar();
int sampleNum = popVar();
if ((sampleNum >= 0) && (sampleNum < NUM_FILE_ENTRIES) && (filesDatabase[sampleNum].subData.ptr)) {
- if (speed == -1)
- speed = filesDatabase[sampleNum].subData.transparency;
-
- _vm->sound().startNote(channelNum, volume, speed);
+ int freq = Period(freq2 * 1000);
+
+ _vm->sound().startNote(channelNum, volume, freq);
}
return (0);