diff options
author | md5 | 2011-03-01 16:28:08 +0200 |
---|---|---|
committer | md5 | 2011-03-01 16:28:08 +0200 |
commit | d149405d79c2f6d1acf7faa31d95491b98fb17ad (patch) | |
tree | a46de244a25ae8e48a89f53d260ccfd17447294c /engines/sci/sound/drivers | |
parent | 5b50113bc089a885290a0b7d2d9db0aadad78c0b (diff) | |
download | scummvm-rg350-d149405d79c2f6d1acf7faa31d95491b98fb17ad.tar.gz scummvm-rg350-d149405d79c2f6d1acf7faa31d95491b98fb17ad.tar.bz2 scummvm-rg350-d149405d79c2f6d1acf7faa31d95491b98fb17ad.zip |
SCI: Fixed bug #3039188 - "LSL2 Amiga: Failed to Initialize Sound Driver error"
This was a signed/unsigned issue. Also fixed compilation when DEBUG is
enabled. Thanks to waltervn for his help on this.
Diffstat (limited to 'engines/sci/sound/drivers')
-rw-r--r-- | engines/sci/sound/drivers/amigamac.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp index 0ec4c283f7..f28d81ee81 100644 --- a/engines/sci/sound/drivers/amigamac.cpp +++ b/engines/sci/sound/drivers/amigamac.cpp @@ -34,7 +34,7 @@ namespace Sci { -/* #define DEBUG */ +//#define DEBUG class MidiDriver_AmigaMac : public MidiDriver_Emulated { public: @@ -289,7 +289,7 @@ void MidiDriver_AmigaMac::playInstrument(int16 *dest, Voice *channel, int count) void MidiDriver_AmigaMac::changeInstrument(int channel, int instrument) { #ifdef DEBUG if (_bank.instruments[instrument][0]) - debugN("[sfx:seq:amiga] Setting channel %i to \"%s\" (%i)\n", channel, _bank.instruments[instrument]->name, instrument); + debugN("[sfx:seq:amiga] Setting channel %i to \"%s\" (%i)\n", channel, _bank.instruments[instrument].name, instrument); else warning("[sfx:seq:amiga] instrument %i does not exist (channel %i)", instrument, channel); #endif @@ -452,9 +452,9 @@ MidiDriver_AmigaMac::InstrumentSample *MidiDriver_AmigaMac::readInstrumentSCI0(C } int seg_size[3]; - seg_size[0] = READ_BE_UINT16(header + 35) * 2; - seg_size[1] = READ_BE_UINT16(header + 41) * 2; - seg_size[2] = READ_BE_UINT16(header + 47) * 2; + seg_size[0] = (int16)READ_BE_UINT16(header + 35) * 2; + seg_size[1] = (int16)READ_BE_UINT16(header + 41) * 2; + seg_size[2] = (int16)READ_BE_UINT16(header + 47) * 2; InstrumentSample *instrument = new InstrumentSample; @@ -495,7 +495,7 @@ MidiDriver_AmigaMac::InstrumentSample *MidiDriver_AmigaMac::readInstrumentSCI0(C debugN(" Looping: %s\n", instrument->mode & kModeLoop ? "on" : "off"); debugN(" Pitch changes: %s\n", instrument->mode & kModePitch ? "on" : "off"); debugN(" Segment sizes: %i %i %i\n", seg_size[0], seg_size[1], seg_size[2]); - debugN(" Segment offsets: 0 %i %i\n", loop_offset, read_int32(header + 43)); + debugN(" Segment offsets: 0 %i %i\n", loop_offset, (int32)READ_BE_UINT32(header + 43)); #endif instrument->samples = (int8 *) malloc(size + 1); |