Ticket #9071: scummvm_siddump.patch
File scummvm_siddump.patch, 6.9 KB (added by , 15 years ago) |
---|
-
engines/engine.h
72 72 OSystem *_system; 73 73 Audio::Mixer *_mixer; 74 74 75 const Common::String _targetName; // target name for saves 76 75 77 protected: 76 78 Common::TimerManager *_timer; 77 79 Common::EventManager *_eventMan; … … 80 82 GUI::Dialog *_mainMenuDialog; 81 83 virtual int runDialog(GUI::Dialog &dialog); 82 84 83 const Common::String _targetName; // target name for saves84 85 85 86 const Common::FSNode _gameDataDir; // FIXME: Get rid of this 86 87 -
engines/scumm/player_v0.cpp
1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/engines/scumm/player_v1.cpp $ 22 * $Id: player_v1.cpp 28966 2007-09-19 08:40:12Z peres001 $ 23 * 24 */ 25 26 27 #include "engines/engine.h" 28 #include "scumm/Player_v0.h" 29 #include "scumm/scumm.h" 30 #include "sound/mixer.h" 31 32 namespace Scumm { 33 34 Player_V0::Player_V0(ScummEngine *scumm, Audio::Mixer *mixer) { 35 _vm = scumm; 36 _mixer = mixer; 37 _sample_rate = _mixer->getOutputRate(); 38 39 _mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, false, true); 40 } 41 42 Player_V0::~Player_V0() { 43 _mixer->stopHandle(_soundHandle); 44 } 45 46 void Player_V0::setMusicVolume (int vol) { 47 _maxvol = vol; 48 } 49 50 int Player_V0::readBuffer(int16 *buffer, const int numSamples) { 51 return 0; 52 } 53 void Player_V0::stopAllSounds() { 54 } 55 56 void Player_V0::stopSound(int nr) { 57 if (nr == -1) 58 return; 59 } 60 61 void Player_V0::startSound(int nr) { 62 char sbuf[512]; 63 byte *data = _vm->getResourceAddress(rtSound, nr); 64 assert(data); 65 66 int size = _vm->getResourceSize(rtSound, nr); 67 sprintf(sbuf, "%s-%d.bin", _vm->_targetName.c_str(), nr); 68 FILE* f = fopen(sbuf, "wb"); 69 fwrite(data, size, 1, f); 70 fclose(f); 71 } 72 73 int Player_V0::getSoundStatus(int nr) const { 74 return 0; 75 } 76 77 } // End of namespace Scumm -
engines/scumm/player_v0.h
1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/engines/scumm/player_v1.h $ 22 * $Id: player_v1.h 27024 2007-05-30 21:56:52Z fingolfin $ 23 * 24 */ 25 26 #ifndef SCUMM_PLAYER_V0_H 27 #define SCUMM_PLAYER_V0_H 28 29 #include "common/scummsys.h" 30 #include "scumm/music.h" 31 #include "sound/audiostream.h" 32 #include "sound/mixer.h" 33 34 namespace Scumm { 35 36 class ScummEngine; 37 38 /** 39 * Scumm V0/V1 SID player. 40 */ 41 class Player_V0 : public Audio::AudioStream, public MusicEngine { 42 public: 43 Player_V0(ScummEngine *scumm, Audio::Mixer *mixer); 44 ~Player_V0(); 45 46 virtual void setMusicVolume(int vol); 47 virtual void startSound(int sound); 48 virtual void stopSound(int sound); 49 virtual void stopAllSounds(); 50 virtual int getSoundStatus(int sound) const; 51 52 // AudioStream API 53 int readBuffer(int16 *buffer, const int numSamples); 54 bool isStereo() const { return false; } 55 bool endOfData() const { return false; } 56 int getRate() const { return _sample_rate; } 57 58 private: 59 60 ScummEngine *_vm; 61 Audio::Mixer *_mixer; 62 Audio::SoundHandle _soundHandle; 63 int _sample_rate; 64 int _samples_per_frame; 65 int _current_sample; 66 int _maxvol; 67 }; 68 69 } // End of namespace Scumm 70 71 #endif -
engines/scumm/scumm.cpp
52 52 #include "scumm/he/sound_he.h" 53 53 #include "scumm/object.h" 54 54 #include "scumm/player_nes.h" 55 #include "scumm/player_v0.h" 55 56 #include "scumm/player_v1.h" 56 57 #include "scumm/player_v2.h" 57 58 #include "scumm/player_v2a.h" … … 1675 1676 } else if (_game.platform == Common::kPlatformApple2GS && _game.version == 0){ 1676 1677 // TODO: Add support for music format 1677 1678 } else if (_game.platform == Common::kPlatformC64 && _game.version <= 1) { 1678 // TODO: Add support for music format1679 _musicEngine = new Player_V0(this, _mixer); 1679 1680 } else if (_game.platform == Common::kPlatformNES && _game.version == 1) { 1680 1681 _musicEngine = new Player_NES(this, _mixer); 1681 1682 } else if (_game.platform == Common::kPlatformAmiga && _game.version == 2) { -
engines/scumm/scumm.h
789 789 // byte *createResource(int type, int index, uint32 size); 790 790 int loadResource(int type, int i); 791 791 // void nukeResource(int type, int i); 792 int getResourceSize(int type, int idx);793 792 794 793 public: 794 int getResourceSize(int type, int idx); 795 795 byte *getResourceAddress(int type, int i); 796 796 virtual byte *getStringAddress(int i); 797 797 byte *getStringAddressVar(int i);