[Scummvm-cvs-logs] SF.net SVN: scummvm: [22951] scummvm/trunk/sound/softsynth/adlib.cpp

kirben at users.sourceforge.net kirben at users.sourceforge.net
Tue Jun 6 13:07:08 CEST 2006


Revision: 22951
Author:   kirben
Date:     2006-06-06 04:07:03 -0700 (Tue, 06 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22951&view=rev

Log Message:
-----------
Rename AdlibInstrument fields

Modified Paths:
--------------
    scummvm/trunk/sound/softsynth/adlib.cpp
Modified: scummvm/trunk/sound/softsynth/adlib.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/adlib.cpp	2006-06-06 04:33:09 UTC (rev 22950)
+++ scummvm/trunk/sound/softsynth/adlib.cpp	2006-06-06 11:07:03 UTC (rev 22951)
@@ -35,16 +35,16 @@
 };
 
 struct AdlibInstrument {
-	byte flags_1;
-	byte oplvl_1;
-	byte atdec_1;
-	byte sustrel_1;
-	byte waveform_1;
-	byte flags_2;
-	byte oplvl_2;
-	byte atdec_2;
-	byte sustrel_2;
-	byte waveform_2;
+	byte mod_characteristic;
+	byte mod_scalingOutputLevel;
+	byte mod_attackDecay;
+	byte mod_sustainRelease;
+	byte mod_waveformSelect;
+	byte car_characteristic;
+	byte car_scalingOutputLevel;
+	byte car_attackDecay;
+	byte car_sustainRelease;
+	byte car_waveformSelect;
 	byte feedback;
 	byte flags_a;
 	InstrumentExtra extra_a;
@@ -225,7 +225,7 @@
 	{0x60, 0, 15, 15},  // decay rate
 	{0x80, 4, 240, 15}, // sustain level
 	{0x80, 0, 15, 15},  // release rate
-	{0xE0, 0, 3, 0},    // waveform select
+	{0xE0, 0, 3, 0},    // waveformSelect select
 	{0x20, 7, 128, 0},  // amp mod
 	{0x20, 6, 64, 0},   // vib
 	{0x20, 5, 32, 0},   // eg typ
@@ -1340,17 +1340,17 @@
 		voice->_duration *= 63;
 
 	if (!_game_SmallHeader)
-		vol_1 = (instr->oplvl_1 & 0x3F) + lookup_table[velocity >> 1][instr->waveform_1 >> 2];
+		vol_1 = (instr->mod_scalingOutputLevel & 0x3F) + lookup_table[velocity >> 1][instr->mod_waveformSelect >> 2];
 	else
-		vol_1 = 0x3f - (instr->oplvl_1 & 0x3F);
+		vol_1 = 0x3f - (instr->mod_scalingOutputLevel & 0x3F);
 	if (vol_1 > 0x3F)
 		vol_1 = 0x3F;
 	voice->_vol_1 = vol_1;
 
 	if (!_game_SmallHeader)
-		vol_2 = (instr->oplvl_2 & 0x3F) + lookup_table[velocity >> 1][instr->waveform_2 >> 2];
+		vol_2 = (instr->car_scalingOutputLevel & 0x3F) + lookup_table[velocity >> 1][instr->car_waveformSelect >> 2];
 	else
-		vol_2 = 0x3f - (instr->oplvl_2 & 0x3F);
+		vol_2 = 0x3f - (instr->car_scalingOutputLevel & 0x3F);
 	if (vol_2 > 0x3F)
 		vol_2 = 0x3F;
 	voice->_vol_2 = vol_2;
@@ -1385,18 +1385,18 @@
 	assert(chan >= 0 && chan < 9);
 
 	port = channel_mappings[chan];
-	adlib_write(port + 0x20, instr->flags_1);
-	adlib_write(port + 0x40, (instr->oplvl_1 | 0x3F) - vol_1 );
-	adlib_write(port + 0x60, 0xff & (~instr->atdec_1));
-	adlib_write(port + 0x80, 0xff & (~instr->sustrel_1));
-	adlib_write(port + 0xE0, instr->waveform_1);
+	adlib_write(port + 0x20, instr->mod_characteristic);
+	adlib_write(port + 0x40, (instr->mod_scalingOutputLevel | 0x3F) - vol_1 );
+	adlib_write(port + 0x60, 0xff & (~instr->mod_attackDecay));
+	adlib_write(port + 0x80, 0xff & (~instr->mod_sustainRelease));
+	adlib_write(port + 0xE0, instr->mod_waveformSelect);
 
 	port = channel_mappings_2[chan];
-	adlib_write(port + 0x20, instr->flags_2);
-	adlib_write(port + 0x40, (instr->oplvl_2 | 0x3F) - vol_2 );
-	adlib_write(port + 0x60, 0xff & (~instr->atdec_2));
-	adlib_write(port + 0x80, 0xff & (~instr->sustrel_2));
-	adlib_write(port + 0xE0, instr->waveform_2);
+	adlib_write(port + 0x20, instr->car_characteristic);
+	adlib_write(port + 0x40, (instr->car_scalingOutputLevel | 0x3F) - vol_2 );
+	adlib_write(port + 0x60, 0xff & (~instr->car_attackDecay));
+	adlib_write(port + 0x80, 0xff & (~instr->car_sustainRelease));
+	adlib_write(port + 0xE0, instr->car_waveformSelect);
 
 	adlib_write((byte)chan + 0xC0, instr->feedback);
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list