[Scummvm-cvs-logs] CVS: scummvm readme.txt,1.11,1.12 resource.cpp,1.50,1.51 scumm.h,1.80,1.81 scummvm.cpp,1.77,1.78 sdl.cpp,1.41,1.42 sound.cpp,1.26,1.27 sound.h,1.5,1.6

James Brown ender at users.sourceforge.net
Thu Mar 14 00:05:04 CET 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv21510

Modified Files:
	readme.txt resource.cpp scumm.h scummvm.cpp sdl.cpp sound.cpp 
	sound.h 
Log Message:
Rewire the MIDI subsystem to use drivers selecting from the commandline.
No -DTIMIDITY, etc! Yippie!. Also updated readme.



Index: readme.txt
===================================================================
RCS file: /cvsroot/scummvm/scummvm/readme.txt,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** readme.txt	8 Mar 2002 22:22:32 -0000	1.11
--- readme.txt	14 Mar 2002 08:04:20 -0000	1.12
***************
*** 29,33 ****
  
  	Loom (256 color CD version)
! 	Zak McKraken (256 color FM towns version)
  	Indiana Jones and the Last Crusade (256 color version)
          Full Throttle
--- 29,33 ----
  
  	Loom (256 color CD version)
! 	Zak McKraken (256 color FM Towns version)
  	Indiana Jones and the Last Crusade (256 color version)
          Full Throttle
***************
*** 43,49 ****
  
  Please be aware that the engine may contains bugs and non-implemented-
! features that sometimes make it impossible to finish the game. Please file a
! bug report (follow the link on the homepage) if you discover such a bug. Attach
! a saved game if possible.
  
  Known Bugs:
--- 43,49 ----
  
  Please be aware that the engine may contains bugs and non-implemented-
! features that sometimes make it impossible to finish the game. Save often,
! and please file a bug report (follow the link on the homepage) if you discover
! such a bug. Attach a saved game if possible.
  
  Known Bugs:
***************
*** 125,130 ****
--- 125,133 ----
          -m<num>   - set the music volume, 0-100  default is '60'
          -t<num>   - set music tempo              default is '2031616'
+         -e<num>   - select sound engine. see below.
+         -g<num>   - select graphics scaler. see below.
  	-f        - fullscreen mode
          -n        - disable subtitles
+         -r        - enable roland conversion. Use this option if music doesn't sound correct.
  
  In game Hot Keys:
***************
*** 140,143 ****
--- 143,203 ----
  	Alt-Enter toggles full screen (on *nix only)
  
+ 
+ Graphics filters:
+ -----------------
+ ScummVM offers several antialiasing filters to attempt to improve visual
+ quality. These are the same filters used in many other emulators, such as
+ MAME. They are:
+         -g0 - No filtering. Fastest, obviously.
+         -g1 - 2xSal
+         -g2 - SuperSal. Less blurrier than 2x, but slightly slower
+         -g3 - SuperEagle.
+ 
+ Note that at the moment filters are very slow, and slightly buggy. Use at 
+ your own risk! .... but feel free to submit a bugfix or optimisation patch :)
+ 
+ 
+ Music and Sound: 
+ ----------------
+ By default, on most operating systems, ScummVM will automatically use ADLIB
+ emulation. However, some games do not include adlib music - such as Sam and
+ Max. To hear music in such games, you will need to remove the 'USE_ADLIB'
+ define and recompile using Midi support.. (TODO: Make ADLIB and MIDI dynamic!)
+ 
+ If you ARE using MIDI, you have several different choices of output, 
+ depending on your operating system and configuration.
+ 
+         -e0 - Null output. Don't play any music. This is default on non-windows operating systems
+         -e1 - Windows output. This uses the builtin Windows sequencer. Naturally, only on Windows
+         -e4 - Quicktime sound, for Macintosh users.
+ 
+ 
+ Playing sound with Adlib emulation:
+ -----------------------------------
+ If you compile ScummVM with the USE_ADLIB flag, an Adlib card will be
+ emulated and ScummVM will output the music as sampled waves. This offers
+ far superior preformance to Timidity, however does not work with some games
+ such as Sam and Max.
+ 
+ 
+ Playing sound with Sequencer:
+ -----------------------------
+ If your soundcard driver supports a sequencer, you may set the environment
+ variable "SCUMMVM_MIDI" to your sequencer device - eg, /dev/sequencer
+ 
+ Then start ScummVM with the parameter '-e3'. This should work on several
+ cards, and may offer better preformance and quality than Adlib emulation.
+ 
+ 
+ Playing music with Timidity:
+ ----------------------------
+ Start Timidity with the following command line :
+ 	$ timidity -irv 7777
+ Then start ScummVM with the parameter '-e2'. However, Timidity is not designed
+ to cope with the rapid changes most iMUSE equipped games use - so Adlib emulation
+ or sequencer support are the recommended methods for non-windows/non-macintosh 
+ users.
+ 
+ 
  Savegames:
  ----------
***************
*** 153,169 ****
          set SCUMMVM_SAVEPATH=C:\saved_games\
  
- Playing sound with Timidity (*nix only):
- ----------------------------------------
- 
- Start Timidity with the following command line :
- 
- $ timidity -irv 7777
- 
- Then just start ScummVM and you should have sound.
- In order to use timidity, you need to compile ScummVM with USE_TIMIDITY.
- 
- If you compile ScummVM with the USE_ADLIB flag, an Adlib card will be
- emulated and ScummVM will output the music as sampled waves.
- (doesn't work with Sam&Max)
  
  ------------------------------------------------------------------------
--- 213,216 ----

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/resource.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** resource.cpp	10 Mar 2002 17:33:02 -0000	1.50
--- resource.cpp	14 Mar 2002 08:04:21 -0000	1.51
***************
*** 697,702 ****
  			fileRead(_fileHandle,createResource(type, idx, best_size), best_size);
  			return 1;
! 		}
! 
  	}
  	res.roomoffs[type][idx] = 0xFFFFFFFF;
--- 697,701 ----
  			fileRead(_fileHandle,createResource(type, idx, best_size), best_size);
  			return 1;
! 		}		
  	}
  	res.roomoffs[type][idx] = 0xFFFFFFFF;

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.80
retrieving revision 1.81
diff -C2 -d -r1.80 -r1.81
*** scumm.h	13 Mar 2002 04:57:32 -0000	1.80
--- scumm.h	14 Mar 2002 08:04:21 -0000	1.81
***************
*** 52,55 ****
--- 52,62 ----
  };
  
+ enum {
+ 	MIDI_NULL = 0,
+ 	MIDI_WINDOWS = 1,
+ 	MIDI_TIMIDITY = 2,
+ 	MIDI_SEQ = 3,
+ 	MIDI_QTMUSIC = 4
+ };
  
  const uint16 many_direction_tab[18] = {
***************
*** 903,906 ****
--- 910,914 ----
  	int _keyPressed;
  
+ 	int _midi_driver;	
  	void *_soundEngine;
  

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -C2 -d -r1.77 -r1.78
*** scummvm.cpp	14 Mar 2002 06:06:49 -0000	1.77
--- scummvm.cpp	14 Mar 2002 08:04:21 -0000	1.78
***************
*** 200,206 ****
  
  	_gameDataPath = NULL;
!         _gameTempo = 0;
  	_videoMode = 0;
!         _soundCardType = 3;
  	parseCommandLine(argc, argv);
  
--- 200,212 ----
  
  	_gameDataPath = NULL;
!     _gameTempo = 0;
  	_videoMode = 0;
!     _soundCardType = 3;
! 
! 	#ifdef WIN32
! 		_midi_driver = MIDI_WINDOWS;
! 	#else
! 		_midi_driver = MIDI_NULL;
! 	#endif
  	parseCommandLine(argc, argv);
  
***************
*** 420,423 ****
--- 426,430 ----
  						"\tp<path> - look for game in <path>\n" \
  						"\tm<num>  - set music volume to <num> (0-100)\n" \
+ 						"\te<num>  - set music engine. see readme.txt for details\n" \
  						"\tr       - emulate roland mt32 instruments\n" \
  						"\tf       - fullscreen mode\n" \
***************
*** 501,504 ****
--- 508,516 ----
  					break;
  				}
+ 				case 'e':
+ 					if (*(s+1) == '\0')
+ 						goto ShowHelpAndExit;
+ 					_midi_driver = atoi(s+1);
+ 					goto NextArg;
  				case 'g':
                  	if (*(s+1) == '\0')

Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sdl.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** sdl.cpp	10 Mar 2002 17:33:03 -0000	1.41
--- sdl.cpp	14 Mar 2002 08:04:21 -0000	1.42
***************
*** 810,820 ****
  #endif
  
- 	sound.initialize(&scumm, &snd_driv);
- 
  	scumm._gui = &gui;
!         scumm.scummMain(argc, argv);
! 
!         if (!(scumm._features & GF_SMALL_HEADER))
!                 gui.init(&scumm);
  
  	last_time = SDL_GetTicks();
--- 810,819 ----
  #endif
  
  	scumm._gui = &gui;
! 	sound.initialize(&scumm, &snd_driv);
!     scumm.scummMain(argc, argv);
! 	
!     if (!(scumm._features & GF_SMALL_HEADER))
!        gui.init(&scumm);
  
  	last_time = SDL_GetTicks();

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** sound.cpp	7 Mar 2002 08:45:54 -0000	1.26
--- sound.cpp	14 Mar 2002 08:04:21 -0000	1.27
***************
*** 328,335 ****
  void Scumm::setupSound() {
  	SoundEngine *se = (SoundEngine*)_soundEngine;
  	if (se) {
  		se->setBase(res.address[rtSound]);
!                 if (se->get_music_volume() == 0) se->set_music_volume(60);
  		se->set_master_volume(125);
  	}
  	_sfxFile = openSfxFile();
--- 328,338 ----
  void Scumm::setupSound() {
  	SoundEngine *se = (SoundEngine*)_soundEngine;
+ 	SOUND_DRIVER_TYPE *driver = se->driver();
  	if (se) {
  		se->setBase(res.address[rtSound]);
!         if (se->get_music_volume() == 0) se->set_music_volume(60);
  		se->set_master_volume(125);
+ 		
+ 		driver->midiSetDriver(se->midiGetDriver());
  	}
  	_sfxFile = openSfxFile();

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** sound.h	14 Mar 2002 06:06:49 -0000	1.5
--- sound.h	14 Mar 2002 08:04:21 -0000	1.6
***************
*** 18,21 ****
--- 18,25 ----
   * Change Log:
   * $Log$
+  * Revision 1.6  2002/03/14 08:04:21  ender
+  * Rewire the MIDI subsystem to use drivers selecting from the commandline.
+  * No -DTIMIDITY, etc! Yippie!. Also updated readme.
+  *
   * Revision 1.5  2002/03/14 06:06:49  ender
   * Added some new midi drivers - QuickTime Music and RawMidi.
***************
*** 405,412 ****
  };
  
! struct MidiSoundDriver : SoundDriver {
! 	void *_mo;	
! 	SoundEngine *_se;
  
  	MidiChannelGM _midi_channels[9];
  
--- 409,436 ----
  };
  
! struct MidiDriver {
! 	bool MidiInitialized;
! 	int DeviceType;
! 	int SeqDevice;
! 	void *_mo; /* midi out */
! 	
! 	void midiInit();
! 	void midiInitTimidity();
! 	void midiInitSeq();
! 	void midiInitWindows();
! 	void midiInitNull();
! 	void midiInitQuicktime();
  
+ 	void MidiOut(int b);
+ 	void MidiOutSeq(void *a, int b);
+ 	void MidiOutWindows(void *a, int b);
+ 	void MidiOutQuicktime(void *a, int b);
+ 
+ 	int connect_to_timidity(int port);
+ 	int open_sequencer_device();
+ };
+ 
+ struct MidiSoundDriver : SoundDriver {	
+ 	SoundEngine *_se;
  	MidiChannelGM _midi_channels[9];
  
***************
*** 419,422 ****
--- 443,447 ----
  	int8 _midi_pan_last[16];
  
+ 	MidiDriver _midi_driver;
  	void midiPitchBend(byte chan, int16 pitchbend);
  	void midiVolume(byte chan, byte volume);
***************
*** 448,452 ****
  	void part_key_off(Part *part, byte note);
  	void part_changed(Part *part,byte what);
! 
  	bool wave_based() { return false; }
  };
--- 473,477 ----
  	void part_key_off(Part *part, byte note);
  	void part_changed(Part *part,byte what);
! 	void midiSetDriver(int devicetype);
  	bool wave_based() { return false; }
  };
***************
*** 551,557 ****
  	int32 do_command(int a, int b, int c, int d, int e, int f, int g, int h);
  	int clear_queue();
! 	void setBase(byte **base) { _base_sounds = base; }
  
  	SOUND_DRIVER_TYPE *driver() { return _driver; }
  	bool _mt32emulate;	
  };
--- 576,584 ----
  	int32 do_command(int a, int b, int c, int d, int e, int f, int g, int h);
  	int clear_queue();
! 	void setBase(byte **base) { _base_sounds = base; }	
  
  	SOUND_DRIVER_TYPE *driver() { return _driver; }
+ 	int  midiGetDriver() {return _s->_midi_driver;}
+ 	void midiSetDriver(int devicetype);
  	bool _mt32emulate;	
  };





More information about the Scummvm-git-logs mailing list