svn-id: r10620
This commit is contained in:
Max Horn 2003-10-05 17:32:38 +00:00
parent 052fc3368b
commit 0954fc1dac
10 changed files with 23 additions and 26 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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:

View File

@ -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:

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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);