diff options
author | Max Horn | 2003-10-05 17:32:38 +0000 |
---|---|---|
committer | Max Horn | 2003-10-05 17:32:38 +0000 |
commit | 0954fc1dac5195d86335edb4def33006a2c8be29 (patch) | |
tree | 2ec4b622a0081ade28daa558449b289a8f4fd047 | |
parent | 052fc3368b0009690ad92bdd4d106a81274241ae (diff) | |
download | scummvm-rg350-0954fc1dac5195d86335edb4def33006a2c8be29.tar.gz scummvm-rg350-0954fc1dac5195d86335edb4def33006a2c8be29.tar.bz2 scummvm-rg350-0954fc1dac5195d86335edb4def33006a2c8be29.zip |
cleanup
svn-id: r10620
-rw-r--r-- | scumm/player_v1.cpp | 2 | ||||
-rw-r--r-- | scumm/player_v1.h | 4 | ||||
-rw-r--r-- | scumm/player_v2.cpp | 7 | ||||
-rw-r--r-- | scumm/player_v2.h | 6 | ||||
-rw-r--r-- | scumm/player_v2a.h | 2 | ||||
-rw-r--r-- | scumm/player_v3a.h | 2 | ||||
-rw-r--r-- | scumm/resource_v2.cpp | 6 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 6 | ||||
-rw-r--r-- | scumm/scumm.h | 6 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 8 |
10 files changed, 23 insertions, 26 deletions
diff --git a/scumm/player_v1.cpp b/scumm/player_v1.cpp index a934b56bf5..5fc4dea07a 100644 --- a/scumm/player_v1.cpp +++ b/scumm/player_v1.cpp @@ -34,7 +34,7 @@ namespace Scumm { #define FIXP_SHIFT 16 -Player_V1::Player_V1(ScummEngine *scumm) : Player_V2(scumm) { +Player_V1::Player_V1(ScummEngine *scumm, bool pcjr) : Player_V2(scumm, pcjr) { // Initialize channel code for (int i = 0; i < 4; ++i) clear_channel(i); diff --git a/scumm/player_v1.h b/scumm/player_v1.h index 83a901ea75..b7c25466c6 100644 --- a/scumm/player_v1.h +++ b/scumm/player_v1.h @@ -28,11 +28,11 @@ namespace Scumm { /** - * V1 PC-Speaker player. + * Scumm V1 PC-Speaker player. */ class Player_V1 : public Player_V2 { public: - Player_V1(ScummEngine *scumm); + Player_V1(ScummEngine *scumm, bool pcjr); ~Player_V1(); virtual void startSound(int sound); diff --git a/scumm/player_v2.cpp b/scumm/player_v2.cpp index a86a6ad43f..8a853922ea 100644 --- a/scumm/player_v2.cpp +++ b/scumm/player_v2.cpp @@ -341,12 +341,9 @@ static const uint16 pcjr_freq_table[12] = { #endif -Player_V2::Player_V2(ScummEngine *scumm) { +Player_V2::Player_V2(ScummEngine *scumm, bool pcjr) { int i; - // This simulates the pc speaker sound, which is driven - // by the 8253 (square wave generator) and a low-band filter. - _isV3Game = (scumm->_version >= 3); _scumm = scumm; _system = scumm->_system; @@ -376,7 +373,7 @@ Player_V2::Player_V2(ScummEngine *scumm) { _RNG = NG_PRESET; - set_pcjr(scumm->_midiDriver != MD_PCSPK); + set_pcjr(pcjr); setMasterVolume(255); _mixer->setupPremix(premix_proc, this); diff --git a/scumm/player_v2.h b/scumm/player_v2.h index 0490845f92..bda919015d 100644 --- a/scumm/player_v2.h +++ b/scumm/player_v2.h @@ -68,11 +68,13 @@ struct channel_data { /** - * V2 PC-Speaker MIDI driver. + * Scumm V2 PC-Speaker MIDI driver. + * This simulates the pc speaker sound, which is driven by the 8253 (square + * wave generator) and a low-band filter. */ class Player_V2 : public MusicEngine { public: - Player_V2(ScummEngine *scumm); + Player_V2(ScummEngine *scumm, bool pcjr); virtual ~Player_V2(); virtual void setMasterVolume(int vol); diff --git a/scumm/player_v2a.h b/scumm/player_v2a.h index e3fec9b27d..dfd7ba27bf 100644 --- a/scumm/player_v2a.h +++ b/scumm/player_v2a.h @@ -36,7 +36,7 @@ class ScummEngine; class V2A_Sound; /** - * V2 Amiga sound/music driver. + * Scumm V2 Amiga sound/music driver. */ class Player_V2A : public MusicEngine { public: diff --git a/scumm/player_v3a.h b/scumm/player_v3a.h index e175111482..3635ed7ade 100644 --- a/scumm/player_v3a.h +++ b/scumm/player_v3a.h @@ -35,7 +35,7 @@ namespace Scumm { class ScummEngine; /** - * V3 Amiga sound/music driver. + * Scumm V3 Amiga sound/music driver. */ class Player_V3A : public MusicEngine { public: diff --git a/scumm/resource_v2.cpp b/scumm/resource_v2.cpp index 34030268d3..2bfe44d588 100644 --- a/scumm/resource_v2.cpp +++ b/scumm/resource_v2.cpp @@ -34,7 +34,7 @@ void ScummEngine_v2::readClassicIndexFile() { if (_gameId == GID_MANIAC) { if (!(_features & GF_AMIGA) && !(_features & GF_NES)) - _musicEngine = new Player_V1(this); + _musicEngine = new Player_V1(this, _midiDriver != MD_PCSPK); _numGlobalObjects = 800; _numRooms = 55; @@ -43,7 +43,7 @@ void ScummEngine_v2::readClassicIndexFile() { _numSounds = 100; } else if (_gameId == GID_ZAK) { if (!(_features & GF_AMIGA)) - _musicEngine = new Player_V2(this); + _musicEngine = new Player_V2(this, _midiDriver != MD_PCSPK); _numGlobalObjects = 775; _numRooms = 61; @@ -109,7 +109,7 @@ void ScummEngine_v2::readClassicIndexFile() { void ScummEngine_v2::readEnhancedIndexFile() { if (!(_features & GF_AMIGA)) - _musicEngine = new Player_V2(this); + _musicEngine = new Player_V2(this, _midiDriver != MD_PCSPK); _numGlobalObjects = _fileHandle.readUint16LE(); _fileHandle.seek(_numGlobalObjects, SEEK_CUR); // Skip object flags diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 2af5817cff..4259405058 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -421,7 +421,7 @@ void ScummEngine_v2::decodeParseString() { // V1 Mansion Mansion uses dynamic color table for subtitles if ((_gameId == GID_MANIAC) && (_version == 1)) { // Demo mode doesn't set subtitle color before display first subtitle. - if (_demo_mode && _actorToPrintStrFor == 0xFF) + if (_demoMode && _actorToPrintStrFor == 0xFF) _string[textSlot].color = 1; else if (_actorToPrintStrFor != 0xFF) _string[textSlot].color = v1_mm_actor_speech_color[_actorToPrintStrFor]; @@ -836,7 +836,7 @@ void ScummEngine_v2::o2_verbOps() { vs = &_verbs[slot]; vs->verbid = verb; if (_version == 1) { - if (_gameId == GID_MANIAC && _demo_mode) + if (_gameId == GID_MANIAC && _demoMode) vs->color = 4; else vs->color = 5; @@ -1382,7 +1382,7 @@ void ScummEngine_v2::o2_cutscene() { // FIXME allows quotes script (173) to start during introudction of // demo mode of V1 Maniac Mansion. setUserState was halting script // 173 before it started. - if (!(_gameId == GID_MANIAC && _version == 1 && _demo_mode)) + if (!(_gameId == GID_MANIAC && _version == 1 && _demoMode)) // Hide inventory, freeze scripts, hide cursor setUserState(15); diff --git a/scumm/scumm.h b/scumm/scumm.h index d6664263e9..b6cdc4d5e5 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -955,7 +955,6 @@ public: byte _proc_special_palette[256]; byte *_roomPalette; byte *_shadowPalette; - int _midiDriver; // Use the MD_ values from mididrv.h protected: int _shadowPaletteSize; @@ -969,6 +968,9 @@ protected: int tempMusic; int _saveSound; bool _native_mt32; + int _midiDriver; // Use the MD_ values from mididrv.h + bool _demoMode; + bool _confirmExit; public: bool _silentDigitalImuse, _noDigitalSamples; @@ -1022,9 +1024,7 @@ protected: byte _charsetBuffer[512]; public: - bool _demo_mode; bool _noSubtitles; // Whether to skip all subtitles - bool _confirmExit; protected: void initCharset(int charset); diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index ad421fb38d..5c5638ecf6 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -65,7 +65,6 @@ extern bool isSmartphone(void); extern NewGui *g_gui; extern uint16 _debugLevel; -extern uint16 _demo_mode; namespace Scumm { @@ -453,7 +452,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst) memset(_charsetData, 0, sizeof(_charsetData)); _charsetBufPos = 0; memset(_charsetBuffer, 0, sizeof(_charsetBuffer)); - _demo_mode = false; _noSubtitles = false; _confirmExit = false; _numInMsgStack = 0; @@ -606,7 +604,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst) _version = detector->_game.version; setFeatures(detector->_game.features); - _demo_mode = detector->_demo_mode; + _demoMode = detector->_demo_mode; _noSubtitles = detector->_noSubtitles; _confirmExit = detector->_confirmExit; _defaultTalkDelay = detector->_talkSpeed; @@ -680,7 +678,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst) } else if ((_features & GF_AMIGA) && (_version < 5)) { _musicEngine = NULL; } else if (((_midiDriver == MD_PCJR) || (_midiDriver == MD_PCSPK)) && ((_version > 2) && (_version < 5))) { - _musicEngine = new Player_V2(this); + _musicEngine = new Player_V2(this, _midiDriver != MD_PCSPK); } else if (_version > 2) { MidiDriver *driver = detector->createMidi(); if (driver && detector->_native_mt32) @@ -890,7 +888,7 @@ void ScummEngine::launch() { // If requested, load a save game instead of running the boot script if (_saveLoadFlag != 2 || !loadState(_saveLoadSlot, _saveLoadCompatible)) { - if (_gameId == GID_MANIAC && _demo_mode) + if (_gameId == GID_MANIAC && _demoMode) runScript(9, 0, 0, &_bootParam); else runScript(1, 0, 0, &_bootParam); |