Add music player for Amiga versions of indy3ega/loom from unused.
Revert last change to common.rules for now, it broke compile. svn-id: r10061
This commit is contained in:
parent
698b2f0be6
commit
9de8a0cfa9
4 changed files with 26 additions and 18 deletions
|
@ -23,6 +23,7 @@ SCUMM_OBJS = \
|
||||||
scumm/object.o \
|
scumm/object.o \
|
||||||
scumm/player_v1.o\
|
scumm/player_v1.o\
|
||||||
scumm/player_v2.o\
|
scumm/player_v2.o\
|
||||||
|
scumm/player_v3a.o\
|
||||||
scumm/resource.o \
|
scumm/resource.o \
|
||||||
scumm/resource_v2.o \
|
scumm/resource_v2.o \
|
||||||
scumm/resource_v3.o \
|
scumm/resource_v3.o \
|
||||||
|
|
|
@ -41,6 +41,7 @@ class IMuse;
|
||||||
class IMuseDigital;
|
class IMuseDigital;
|
||||||
class NewGui;
|
class NewGui;
|
||||||
class Player_V2;
|
class Player_V2;
|
||||||
|
class Player_V3A;
|
||||||
class Scumm;
|
class Scumm;
|
||||||
class ScummDebugger;
|
class ScummDebugger;
|
||||||
class Serializer;
|
class Serializer;
|
||||||
|
@ -305,6 +306,7 @@ public:
|
||||||
IMuse *_imuse;
|
IMuse *_imuse;
|
||||||
IMuseDigital *_imuseDigital;
|
IMuseDigital *_imuseDigital;
|
||||||
Player_V2 *_playerV2;
|
Player_V2 *_playerV2;
|
||||||
|
Player_V3A *_playerV3A;
|
||||||
Sound *_sound;
|
Sound *_sound;
|
||||||
|
|
||||||
VerbSlot *_verbs;
|
VerbSlot *_verbs;
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "imuse_digi.h"
|
#include "imuse_digi.h"
|
||||||
#include "intern.h"
|
#include "intern.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
#include "player_v3a.h"
|
||||||
#include "player_v2.h"
|
#include "player_v2.h"
|
||||||
#include "player_v1.h"
|
#include "player_v1.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
@ -690,8 +691,11 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst)
|
||||||
_imuse = NULL;
|
_imuse = NULL;
|
||||||
_imuseDigital = NULL;
|
_imuseDigital = NULL;
|
||||||
_playerV2 = NULL;
|
_playerV2 = NULL;
|
||||||
|
_playerV3A = NULL;
|
||||||
if (_features & GF_DIGI_IMUSE) {
|
if (_features & GF_DIGI_IMUSE) {
|
||||||
_imuseDigital = new IMuseDigital(this);
|
_imuseDigital = new IMuseDigital(this);
|
||||||
|
} else if ((_features & GF_AMIGA) && (_version == 3)) {
|
||||||
|
_playerV3A = new Player_V3A(this);
|
||||||
} else if ((_features & GF_AMIGA) && (_version < 5)) {
|
} else if ((_features & GF_AMIGA) && (_version < 5)) {
|
||||||
_playerV2 = NULL;
|
_playerV2 = NULL;
|
||||||
} else if (((_midiDriver == MD_PCJR) || (_midiDriver == MD_PCSPK)) && ((_version > 2) && (_version < 5))) {
|
} else if (((_midiDriver == MD_PCJR) || (_midiDriver == MD_PCSPK)) && ((_version > 2) && (_version < 5))) {
|
||||||
|
@ -783,6 +787,7 @@ Scumm::~Scumm () {
|
||||||
delete _imuse;
|
delete _imuse;
|
||||||
delete _imuseDigital;
|
delete _imuseDigital;
|
||||||
delete _playerV2;
|
delete _playerV2;
|
||||||
|
delete _playerV3A;
|
||||||
free(_languageBuffer);
|
free(_languageBuffer);
|
||||||
free(_audioNames);
|
free(_audioNames);
|
||||||
|
|
||||||
|
@ -1272,6 +1277,10 @@ int Scumm::scummLoop(int delta) {
|
||||||
// Covered automatically by the Sound class
|
// Covered automatically by the Sound class
|
||||||
} else if (_playerV2) {
|
} else if (_playerV2) {
|
||||||
VAR(VAR_MUSIC_TIMER) = _playerV2->getMusicTimer();
|
VAR(VAR_MUSIC_TIMER) = _playerV2->getMusicTimer();
|
||||||
|
} else if (_playerV3A) {
|
||||||
|
for (int i = 0; i < delta; i++)
|
||||||
|
_playerV3A->playMusic();
|
||||||
|
VAR(VAR_MUSIC_TIMER) = _playerV3A->getMusicTimer();
|
||||||
} else if (_imuse) {
|
} else if (_imuse) {
|
||||||
VAR(VAR_MUSIC_TIMER) = _imuse->getMusicTimer();
|
VAR(VAR_MUSIC_TIMER) = _imuse->getMusicTimer();
|
||||||
} else if (_features & GF_SMALL_HEADER) {
|
} else if (_features & GF_SMALL_HEADER) {
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "imuse.h"
|
#include "imuse.h"
|
||||||
#include "imuse_digi.h"
|
#include "imuse_digi.h"
|
||||||
#include "player_v2.h"
|
#include "player_v2.h"
|
||||||
|
#include "player_v3a.h"
|
||||||
#include "scumm.h"
|
#include "scumm.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "sound/mididrv.h"
|
#include "sound/mididrv.h"
|
||||||
|
@ -430,26 +431,14 @@ void Sound::playSound(int soundID) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Used in Amiga verisons of indy3ega and loom
|
if ((_scumm->_features & GF_MACINTOSH) && (_scumm->_gameId == GID_INDY3)) {
|
||||||
// Used in Mac. version of indy3ega
|
|
||||||
if (((_scumm->_features & GF_MACINTOSH) && (_scumm->_gameId == GID_INDY3))
|
|
||||||
|| ((_scumm->_features & GF_AMIGA) && (_scumm->_version == 3))) {
|
|
||||||
if (ptr[26] == 00) {
|
if (ptr[26] == 00) {
|
||||||
size = READ_BE_UINT16(ptr + 12);
|
size = READ_BE_UINT16(ptr + 12);
|
||||||
rate = 3579545 / READ_BE_UINT16(ptr + 20);
|
rate = 3579545 / READ_BE_UINT16(ptr + 20);
|
||||||
sound = (char *)malloc(size);
|
sound = (char *)malloc(size);
|
||||||
int vol = ptr[24] * 4;
|
int vol = ptr[24] * 4;
|
||||||
memcpy(sound,ptr + READ_BE_UINT16(ptr + 8), size);
|
memcpy(sound,ptr + READ_BE_UINT16(ptr + 8), size);
|
||||||
if ((_scumm->_features & GF_AMIGA) && (READ_BE_UINT16(ptr + 16) || READ_BE_UINT16(ptr + 6))) {
|
_scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, soundID, vol, 0);
|
||||||
// the first check is for pitch-bending looped sounds (i.e. "pouring liquid", "biplane dive", etc.)
|
|
||||||
// the second check is for simple looped sounds
|
|
||||||
int loopStart = READ_BE_UINT16(ptr + 10) - READ_BE_UINT16(ptr + 8);
|
|
||||||
int loopEnd = READ_BE_UINT16(ptr + 14);
|
|
||||||
_scumm->_mixer->playRaw(NULL, sound, size, rate,
|
|
||||||
SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_LOOP, soundID, vol, 0, loopStart, loopEnd);
|
|
||||||
} else {
|
|
||||||
_scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, soundID, vol, 0);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -497,6 +486,9 @@ void Sound::playSound(int soundID) {
|
||||||
_scumm->_playerV2->startSound(soundID, ptr);
|
_scumm->_playerV2->startSound(soundID, ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_scumm->_playerV3A)
|
||||||
|
_scumm->_playerV3A->startSound(soundID, ptr);
|
||||||
|
|
||||||
if (_scumm->_imuse) {
|
if (_scumm->_imuse) {
|
||||||
_scumm->_imuse->startSound(soundID);
|
_scumm->_imuse->startSound(soundID);
|
||||||
}
|
}
|
||||||
|
@ -699,6 +691,9 @@ int Sound::isSoundRunning(int sound) const {
|
||||||
if (_scumm->_playerV2)
|
if (_scumm->_playerV2)
|
||||||
return _scumm->_playerV2->getSoundStatus(sound);
|
return _scumm->_playerV2->getSoundStatus(sound);
|
||||||
|
|
||||||
|
if (_scumm->_playerV3A)
|
||||||
|
return _scumm->_playerV3A->getSoundStatus(sound);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -769,9 +764,8 @@ void Sound::stopSound(int a) {
|
||||||
_scumm->_imuse->stopSound(a);
|
_scumm->_imuse->stopSound(a);
|
||||||
} else if (_scumm->_playerV2) {
|
} else if (_scumm->_playerV2) {
|
||||||
_scumm->_playerV2->stopSound (a);
|
_scumm->_playerV2->stopSound (a);
|
||||||
} else if ((_scumm->_features & GF_AMIGA) && (_scumm->_version <= 3)) {
|
} else if (_scumm->_playerV3A) {
|
||||||
// this handles stopping looped sounds for now
|
_scumm->_playerV3A->stopSound(a);
|
||||||
_scumm->_mixer->stopID(a);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 10; i++)
|
for (i = 0; i < 10; i++)
|
||||||
|
@ -790,6 +784,8 @@ void Sound::stopAllSounds() {
|
||||||
_scumm->_imuse->clear_queue();
|
_scumm->_imuse->clear_queue();
|
||||||
} else if (_scumm->_playerV2) {
|
} else if (_scumm->_playerV2) {
|
||||||
_scumm->_playerV2->stopAllSounds();
|
_scumm->_playerV2->stopAllSounds();
|
||||||
|
} else if (_scumm->_playerV3A) {
|
||||||
|
_scumm->_playerV3A->stopAllSounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
clearSoundQue();
|
clearSoundQue();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue