[Scummvm-cvs-logs] CVS: scummvm/sound adlib.cpp,1.9,1.10 fmopl.cpp,1.5,1.6 gmidi.cpp,1.11,1.12 imuse.cpp,1.18,1.19

James Brown ender at users.sourceforge.net
Thu Apr 11 10:20:07 CEST 2002


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

Modified Files:
	adlib.cpp fmopl.cpp gmidi.cpp imuse.cpp 
Log Message:
Large pointless reindentation of all the code. Also fixed a few mistakes 
in the object flags code cleanup.

Flags used:

indent *.cpp -br -bap -nbc -lp -ce -cdw -brs -nbad -nbc -npsl -nip
-ts2 -ncs -nbs -npcs -nbap -Tbyte -Tuint32 -Tuint8 -Tuint16 -TArrayHeader
-TMemBlkHeader -TVerbSlot -TObjectData -Tvoid -TImageHeader -TRoomHeader
-TCodeHeader -TResHdr -TBompHeader -TMidiChannelAdl -TGui -TScumm
-TSoundEngine -TPart -TPlayer



Index: adlib.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/adlib.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** adlib.cpp	21 Mar 2002 16:12:02 -0000	1.9
--- adlib.cpp	11 Apr 2002 17:19:15 -0000	1.10
***************
*** 28,62 ****
  static byte lookup_table[64][32];
  const byte volume_table[] = {
! 0, 4, 7, 11,
! 13, 16, 18, 20,
! 22, 24, 26, 27,
! 29, 30, 31, 33,
! 34, 35, 36, 37,
! 38, 39, 40, 41,
! 42, 43, 44, 44,
! 45, 46, 47, 47,
[...1533 lines suppressed...]
--- 966,984 ----
  }
  
! void AdlibSoundDriver::part_set_instrument(Part *part, Instrument * instr)
! {
  	Instrument *i = &_part_instr[part->_slot];
  	memcpy(i, instr, sizeof(Instrument));
  }
  
! int AdlibSoundDriver::part_update_active(Part *part, uint16 *active)
! {
  	uint16 bits;
  	int count = 0;
  	MidiChannelAdl *mc;
  
! 	bits = 1 << part->_chan;
  
! 	for (mc = part->_mc->adl(); mc; mc = mc->_next) {
  		if (!(active[mc->_note] & bits)) {
  			active[mc->_note] |= bits;

Index: fmopl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/fmopl.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** fmopl.cpp	13 Mar 2002 04:57:33 -0000	1.5
--- fmopl.cpp	11 Apr 2002 17:19:15 -0000	1.6
***************
*** 28,37 ****
  /* -------------------- preliminary define section --------------------- */
  /* attack/decay rate time rate */
! #define OPL_ARRATE     141280  /* RATE 4 =  2826.24ms @ 3.6MHz */
! #define OPL_DRRATE    1956000  /* RATE 4 = 39280.64ms @ 3.6MHz */
  
! #define DELTAT_MIXING_LEVEL (1) /* DELTA-T ADPCM MIXING LEVEL */
  
! #define FREQ_BITS 24			/* frequency turn          */
  
  /* counter bits = 20 , octerve 7 */
[...1894 lines suppressed...]
  {
! 	if (c) {											/* Timer B */
! 		OPL_STATUS_SET(OPL, 0x20);
! 	} else {											/* Timer A */
! 		OPL_STATUS_SET(OPL, 0x40);
  		/* CSM mode key,TL controll */
! 		if (OPL->mode & 0x80) {			/* CSM mode total level latch and auto key on */
  			int ch;
! 			if (OPL->UpdateHandler)
! 				OPL->UpdateHandler(OPL->UpdateParam, 0);
! 			for (ch = 0; ch < 9; ch++)
! 				CSMKeyControll(&OPL->P_CH[ch]);
  		}
  	}
  	/* reload timer */
! 	if (OPL->TimerHandler)
! 		(OPL->TimerHandler) (OPL->TimerParam + c,
! 												 (double)OPL->T[c] * OPL->TimerBase);
! 	return OPL->status >> 7;
  }

Index: gmidi.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/gmidi.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** gmidi.cpp	21 Mar 2002 16:12:02 -0000	1.11
--- gmidi.cpp	11 Apr 2002 17:19:15 -0000	1.12
***************
*** 36,48 ****
  #include "gmidi.h"
  
! void MidiSoundDriver::midiSetDriver(int devicetype) {	
  	_midi_driver.DeviceType = devicetype;
  	_midi_driver.midiInit();
  }
  
! void MidiDriver::midiInit() {
! 	if (MidiInitialized != true) {		
  		switch (DeviceType) {
[...968 lines suppressed...]
  	if (what & pcMod)
! 		midiPitchBend(mc->_chan,
! 									clamp(part->_pitchbend + part->_detune_eff +
! 												(part->_transpose_eff << 7), -2048, 2047));
  
  	if (what & pcVolume)
***************
*** 600,604 ****
  
  
! void MidiSoundDriver::part_off(Part *part) {
  	MidiChannelGM *mc = part->_mc->gm();
  	if (mc) {
--- 656,661 ----
  
  
! void MidiSoundDriver::part_off(Part *part)
! {
  	MidiChannelGM *mc = part->_mc->gm();
  	if (mc) {

Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/imuse.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** imuse.cpp	24 Mar 2002 17:49:47 -0000	1.18
--- imuse.cpp	11 Apr 2002 17:19:15 -0000	1.19
***************
*** 29,41 ****
  
  #ifdef USE_ADLIB
! 	#ifdef _WIN32_WCE
! 		#define TEMPO_BASE 0x1F0000 * 2 // Sampled down to 11 kHz
! 	#else
! 		#define TEMPO_BASE 0x1924E0
! 	#endif
! 	#define HARDWARE_TYPE 1
  #else
! 	#define TEMPO_BASE 0x400000
[...3792 lines suppressed...]
  		_bank = 0;
***************
*** 2343,2350 ****
  }
  
! void Part::set_instrument(uint b) {
! 	_bank = (byte)(b>>8);
  	_program = (byte)b;
  	changed(SoundDriver::pcProgram);
  }
- 
--- 2493,2500 ----
  }
  
! void Part::set_instrument(uint b)
! {
! 	_bank = (byte)(b >> 8);
  	_program = (byte)b;
  	changed(SoundDriver::pcProgram);
  }





More information about the Scummvm-git-logs mailing list