From ba72975d3f5e88691506c670158ccda2e542013b Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 15 Jun 2010 10:46:23 +0000 Subject: SCUMM: Fix bug #1328120: Bug #1328120: "MANIACNES: Screen width incorrect, camera halts sometimes". Fixed by workaround and was tested with intro and on the kitchen, where now it is possible to see Edna without her noticing you first. svn-id: r49764 --- engines/scumm/scumm.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index bb50ce7bb2..862353bf95 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -2081,6 +2081,12 @@ void ScummEngine::scummLoop_updateScummVars() { if (_game.version >= 7) { VAR(VAR_CAMERA_POS_X) = camera._cur.x; VAR(VAR_CAMERA_POS_Y) = camera._cur.y; + } else if (_game.platform == Common::kPlatformNES) { + // WORKAROUND: + // Since there are 2 2-stripes wide borders in MM NES screen, + // we have to compensate for it here. This fixes paning effects. + // Fixes bug #1328120: "MANIACNES: Screen width incorrect, camera halts sometimes" + VAR(VAR_CAMERA_POS_X) = (camera._cur.x >> V12_X_SHIFT) + 2; } else if (_game.version <= 2) { VAR(VAR_CAMERA_POS_X) = camera._cur.x >> V12_X_SHIFT; } else { -- cgit v1.2.3 From bbad3f333a9227ccb1de633a0fe92d9e01ad7bb3 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 21 Jun 2010 21:36:36 +0000 Subject: Patch #1956501: "GUI/LAUNCHER: Midi device selection" svn-id: r50128 --- engines/scumm/scumm.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 862353bf95..7c3b8a4a1d 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1634,28 +1634,28 @@ void ScummEngine_v100he::resetScumm() { #endif void ScummEngine::setupMusic(int midi) { - MidiDriverType midiDriver = MidiDriver::detectMusicDriver(midi); - _native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32")); + MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(midi); + _native_mt32 = ((MidiDriver::getMusicType(dev) == MT_MT32) || ConfMan.getBool("native_mt32")); - switch (midiDriver) { - case MD_NULL: + switch (MidiDriver::getMusicType(dev)) { + case MT_NULL: _musicType = MDT_NONE; break; - case MD_PCSPK: - case MD_PCJR: + case MT_PCSPK: + case MT_PCJR: _musicType = MDT_PCSPK; break; - case MD_CMS: + //case MT_CMS: #if 1 _musicType = MDT_ADLIB; #else _musicType = MDT_CMS; // Still has number of bugs, disable by default #endif break; - case MD_TOWNS: + case MT_TOWNS: _musicType = MDT_TOWNS; break; - case MD_ADLIB: + case MT_ADLIB: _musicType = MDT_ADLIB; break; default: @@ -1707,7 +1707,7 @@ void ScummEngine::setupMusic(int midi) { if (!_mixer->isReady()) { warning("Sound mixer initialization failed"); if (_musicType == MDT_ADLIB || _musicType == MDT_PCSPK || _musicType == MDT_CMS) { - midiDriver = MD_NULL; + dev = 0; _musicType = MDT_NONE; warning("MIDI driver depends on sound mixer, switching to null MIDI driver"); } @@ -1735,11 +1735,11 @@ void ScummEngine::setupMusic(int midi) { } else if (_game.platform == Common::kPlatformAmiga && _game.version <= 4) { _musicEngine = new Player_V4A(this, _mixer); } else if (_game.id == GID_MANIAC && _game.version == 1) { - _musicEngine = new Player_V1(this, _mixer, midiDriver != MD_PCSPK); + _musicEngine = new Player_V1(this, _mixer, MidiDriver::getMusicType(dev) != MT_PCSPK); } else if (_game.version <= 2) { - _musicEngine = new Player_V2(this, _mixer, midiDriver != MD_PCSPK); + _musicEngine = new Player_V2(this, _mixer, MidiDriver::getMusicType(dev) != MT_PCSPK); } else if ((_musicType == MDT_PCSPK) && (_game.version > 2 && _game.version <= 4)) { - _musicEngine = new Player_V2(this, _mixer, midiDriver != MD_PCSPK); + _musicEngine = new Player_V2(this, _mixer, MidiDriver::getMusicType(dev) != MT_PCSPK); } else if (_musicType == MDT_CMS) { _musicEngine = new Player_V2CMS(this, _mixer); } else if (_game.platform == Common::kPlatform3DO && _game.heversion <= 62) { @@ -1749,12 +1749,12 @@ void ScummEngine::setupMusic(int midi) { MidiDriver *adlibMidiDriver = 0; if (_musicType != MDT_ADLIB) - nativeMidiDriver = MidiDriver::createMidi(midiDriver); + nativeMidiDriver = MidiDriver::createMidi(dev); if (nativeMidiDriver != NULL && _native_mt32) nativeMidiDriver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); bool multi_midi = ConfMan.getBool("multi_midi") && _musicType != MDT_NONE && (midi & MDT_ADLIB); if (_musicType == MDT_ADLIB || multi_midi) { - adlibMidiDriver = MidiDriver_ADLIB_create(); + adlibMidiDriver = MidiDriver::createMidi(MidiDriver::detectDevice(MDT_ADLIB)); adlibMidiDriver->property(MidiDriver::PROP_OLD_ADLIB, (_game.features & GF_SMALL_HEADER) ? 1 : 0); } @@ -1769,7 +1769,7 @@ void ScummEngine::setupMusic(int midi) { // YM2162 driver can't handle midi->getPercussionChannel(), NULL shouldn't init MT-32/GM/GS if ((midi != MDT_TOWNS) && (midi != MDT_NONE)) { _imuse->property(IMuse::PROP_NATIVE_MT32, _native_mt32); - if (midiDriver != MD_MT32) // MT-32 Emulation shouldn't be GM/GS initialized + if (MidiDriver::getMusicType(dev) != MT_MT32) // MT-32 Emulation shouldn't be GM/GS initialized _imuse->property(IMuse::PROP_GS, _enable_gs); } if (_game.heversion >= 60 || midi == MDT_TOWNS) { -- cgit v1.2.3 From 1d4c82885ddcc0442671c863eef643aef2dc7dda Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 17 Jul 2010 18:38:42 +0000 Subject: DEBUGGER: Simplify how our console debugger works / is used * Remove _isAttached member var and isAttached method * Engines now always call the onFrame method; whether it does something is decided by the debugger class resp. its subclasses * Make detach() protected instead of private, so that subclasses can invoke it * Remove _detach_now member var (call detach() instead). * Rename _frame_countdown to _frameCountdown and properly document it. * Add more doxygen comments * Cleanup svn-id: r50963 --- engines/scumm/scumm.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 7c3b8a4a1d..b44184f5cb 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1840,8 +1840,7 @@ Common::Error ScummEngine::go() { while (!shouldQuit()) { - if (_debugger->isAttached()) - _debugger->onFrame(); + _debugger->onFrame(); // Randomize the PRNG by calling it at regular intervals. This ensures // that it will be in a different state each time you run the program. -- cgit v1.2.3 From 02cca98ed6fce6d7aced41974eaf2fd1622f207c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 3 Aug 2010 11:25:20 +0000 Subject: SCUMM: Add posibility to disable NES APU which is CPU demanding svn-id: r51679 --- engines/scumm/scumm.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/scumm/scumm.cpp') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index b44184f5cb..fc95060b6f 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1723,7 +1723,9 @@ void ScummEngine::setupMusic(int midi) { _musicEngine = new Player_SID(this, _mixer); #endif } else if (_game.platform == Common::kPlatformNES && _game.version == 1) { +#ifndef DISABLE_NES_APU _musicEngine = new Player_NES(this, _mixer); +#endif } else if (_game.platform == Common::kPlatformAmiga && _game.version == 2) { _musicEngine = new Player_V2A(this, _mixer); } else if (_game.platform == Common::kPlatformAmiga && _game.version == 3) { -- cgit v1.2.3