aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2006-06-03 08:53:10 +0000
committerSven Hesse2006-06-03 08:53:10 +0000
commit4b706aca434ac7c2753c3d73bcf4022be0b2cde6 (patch)
tree050f07be61c78902887bfe4d2b7c15ee6dbcb726 /engines/gob
parent2aa31f4bf3f1b0be170c5732dcf7267af24a2cd7 (diff)
downloadscummvm-rg350-4b706aca434ac7c2753c3d73bcf4022be0b2cde6.tar.gz
scummvm-rg350-4b706aca434ac7c2753c3d73bcf4022be0b2cde6.tar.bz2
scummvm-rg350-4b706aca434ac7c2753c3d73bcf4022be0b2cde6.zip
Fixing an endian-issue in setVoice()
svn-id: r22858
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/music.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/engines/gob/music.cpp b/engines/gob/music.cpp
index 71108cc968..e7e15cdd75 100644
--- a/engines/gob/music.cpp
+++ b/engines/gob/music.cpp
@@ -22,6 +22,8 @@
*/
#include "common/file.h"
+#include "common/stdafx.h"
+#include "common/endian.h"
#include "gob/music.h"
#include "gob/gob.h"
@@ -213,13 +215,20 @@ void Music::setVoices() {
}
void Music::setVoice(byte voice, byte instr, bool set) {
- unsigned short *strct;
+ int i;
+ int j;
+ uint16 strct[27];
byte channel;
+ byte *dataPtr;
// i = 0 : 0 1 2 3 4 5 6 7 8 9 10 11 12 26
// i = 1 : 13 14 15 16 17 18 19 20 21 22 23 24 25 27
- for (int i = 0; i < 2; i++) {
- strct = (unsigned short*)(_data + 3 + instr * 0x38 + i * 0x1A);
+ for (i = 0; i < 2; i++) {
+ dataPtr = _data + 3 + instr * 0x38 + i * 0x1A;
+ for (j = 0; j < 27; j++) {
+ strct[j] = READ_LE_UINT16(dataPtr);
+ dataPtr += 2;
+ }
channel = _operators[voice] + i * 3;
writeOPL(0xBD, 0x00);
writeOPL(0x08, 0x00);