[Scummvm-cvs-logs] CVS: scummvm/scumm module.mk,1.19,1.20 player_v2.h,2.8,2.9 resource_v2.cpp,1.22,1.23 scummvm.cpp,2.330,2.331 sound.cpp,1.198,1.199
Travis Howell
kirben at users.sourceforge.net
Wed Aug 13 19:42:52 CEST 2003
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv31420/scumm
Modified Files:
module.mk player_v2.h resource_v2.cpp scummvm.cpp sound.cpp
Log Message:
Inital support for v1 maniac sound from Hoenicke
Had to move music init for v1/v2 games to get this working
Index: module.mk
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/module.mk,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- module.mk 14 Jun 2003 21:18:14 -0000 1.19
+++ module.mk 14 Aug 2003 02:28:19 -0000 1.20
@@ -20,6 +20,7 @@
scumm/help.o \
scumm/nut_renderer.o \
scumm/object.o \
+ scumm/player_v1.o\
scumm/player_v2.o\
scumm/resource.o \
scumm/resource_v2.o \
Index: player_v2.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2.h,v
retrieving revision 2.8
retrieving revision 2.9
diff -u -d -r2.8 -r2.9
--- player_v2.h 5 Aug 2003 17:52:47 -0000 2.8
+++ player_v2.h 14 Aug 2003 02:28:19 -0000 2.9
@@ -73,18 +73,18 @@
class Player_V2 {
public:
Player_V2(Scumm *scumm);
- ~Player_V2();
+ virtual ~Player_V2();
- void set_pcjr(bool pcjr);
- void set_master_volume(int vol);
+ virtual void set_pcjr(bool pcjr);
+ virtual void set_master_volume(int vol);
- void startSound(int nr, byte *data);
- void stopSound(int nr);
- void stopAllSounds();
- bool getSoundStatus(int nr) const;
- int getMusicTimer() const;
+ virtual void startSound(int nr, byte *data);
+ virtual void stopSound(int nr);
+ virtual void stopAllSounds();
+ virtual bool getSoundStatus(int nr) const;
+ virtual int getMusicTimer() const;
-private:
+protected:
bool _isV3Game;
SoundMixer *_mixer;
OSystem *_system;
@@ -121,15 +121,15 @@
void mutex_up() { _system->lock_mutex (_mutex); }
void mutex_down() { _system->unlock_mutex (_mutex); }
- void restartSound();
+ virtual void restartSound();
void execute_cmd(ChannelInfo *channel);
- void next_freqs(ChannelInfo *channel);
- void clear_channel(int i);
- void chainSound(int nr, byte *data);
- void chainNextSound();
+ virtual void next_freqs(ChannelInfo *channel);
+ virtual void clear_channel(int i);
+ virtual void chainSound(int nr, byte *data);
+ virtual void chainNextSound();
static void premix_proc(void *param, int16 *buf, uint len);
- void do_mix (int16 *buf, uint len);
+ virtual void do_mix (int16 *buf, uint len);
void lowPassFilter(int16 *data, uint len);
void squareGenerator(int channel, int freq, int vol,
Index: resource_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v2.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- resource_v2.cpp 7 Jun 2003 00:13:24 -0000 1.22
+++ resource_v2.cpp 14 Aug 2003 02:28:19 -0000 1.23
@@ -22,18 +22,27 @@
#include "stdafx.h"
#include "scumm.h"
#include "intern.h"
+#include "player_v2.h"
+#include "player_v1.h"
#include "resource.h"
+#include "sound/mididrv.h"
void Scumm_v2::readClassicIndexFile() {
int i;
if (_gameId == GID_MANIAC) {
+ if (!(_features & GF_AMIGA))
+ _playerV2 = new Player_V1(this);
+
_numGlobalObjects = 800;
_numRooms = 55;
_numCostumes = 35;
_numScripts = 200;
_numSounds = 100;
} else if (_gameId == GID_ZAK) {
+ if (!(_features & GF_AMIGA))
+ _playerV2 = new Player_V2(this);
+
_numGlobalObjects = 775;
_numRooms = 61;
_numCostumes = 37;
@@ -96,6 +105,13 @@
}
void Scumm_v2::readEnhancedIndexFile() {
+
+ if (!(_features & GF_AMIGA)) {
+ _playerV2 = new Player_V2(this);
+ if (_midiDriver == MD_PCSPK)
+ _playerV2->set_pcjr(false);
+ }
+
_numGlobalObjects = _fileHandle.readUint16LE();
_fileHandle.seek(_numGlobalObjects, SEEK_CUR); // Skip object flags
_numRooms = _fileHandle.readByte();
Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.330
retrieving revision 2.331
diff -u -d -r2.330 -r2.331
--- scummvm.cpp 13 Aug 2003 17:18:31 -0000 2.330
+++ scummvm.cpp 14 Aug 2003 02:28:19 -0000 2.331
@@ -32,6 +32,7 @@
#include "intern.h"
#include "object.h"
#include "player_v2.h"
+#include "player_v1.h"
#include "resource.h"
#include "sound.h"
#include "string.h"
@@ -620,14 +621,10 @@
_imuseDigital = new IMuseDigital(this);
} else if ((_features & GF_AMIGA) && (_features & GF_OLD_BUNDLE)) {
_playerV2 = NULL;
- } else if (((_midiDriver == MD_PCJR) || (_midiDriver == MD_PCSPK) && (_version < 5)) || (_version <= 2)) {
- if ((_version == 1) && (_gameId == GID_MANIAC)) {
- _playerV2 = NULL;
- } else {
- _playerV2 = new Player_V2(this);
- if (_midiDriver == MD_PCSPK)
- _playerV2->set_pcjr(false);
- }
+ } else if (((_midiDriver == MD_PCJR) || (_midiDriver == MD_PCSPK)) && ((_version > 2) && (_version < 5))) {
+ _playerV2 = new Player_V2(this);
+ if (_midiDriver == MD_PCSPK)
+ _playerV2->set_pcjr(false);
} else {
_imuse = IMuse::create (syst, _mixer, detector->createMidi());
if (_imuse) {
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -d -r1.198 -r1.199
--- sound.cpp 13 Aug 2003 15:37:28 -0000 1.198
+++ sound.cpp 14 Aug 2003 02:28:19 -0000 1.199
@@ -178,6 +178,7 @@
debug(3,"playSound #%d (room %d)", soundID, _scumm->getResourceRoomNr(rtSound, soundID));
ptr = _scumm->getResourceAddress(rtSound, soundID);
if (ptr) {
+ //hexdump(ptr, 0x400);
if (READ_UINT32(ptr) == MKID('iMUS')){
assert(_scumm->_imuseDigital);
_scumm->_imuseDigital->startSound(soundID);
@@ -453,23 +454,8 @@
return;
}
- if (((_scumm->_midiDriver == MD_PCJR) || (_scumm->_midiDriver == MD_PCSPK) && (_scumm->_version < 5)) || (_scumm->_version <= 2)) {
- //TODO: support maniac v1 sounds
- if ((_scumm->_version == 1) && (_scumm->_gameId == GID_MANIAC))
- return;
- // other versions seem to be 0000 at this point...
- // hopefully this test is correct
- // 0xfe7f seems to be sound and 0x764a music
- bool amigatest = (READ_LE_UINT16(ptr + 12) == 0xfe7f) || (READ_LE_UINT16(ptr + 12) == 0x764a);
- if (amigatest) {
- // TODO: support amiga sounds
- } else {
- if (_scumm->_playerV2) {
- _scumm->_playerV2->startSound (soundID, ptr);
- }
- }
- return;
- }
+ if (_scumm->_playerV2)
+ _scumm->_playerV2->startSound (soundID, ptr);
if (_scumm->_imuse) {
_scumm->getResourceAddress(rtSound, soundID);
More information about the Scummvm-git-logs
mailing list