From 176050dcb3b595b8f4e6ab270e44261e766f9528 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 1 Nov 2014 21:19:58 -0400 Subject: opl: Fix code style to match guidelines. Eliminate tab characters and trailing whitespace. Add extra whitespace around operators in for() expressions. --- src/i_oplmusic.c | 60 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'src/i_oplmusic.c') diff --git a/src/i_oplmusic.c b/src/i_oplmusic.c index 4641912e..c02f1941 100644 --- a/src/i_oplmusic.c +++ b/src/i_oplmusic.c @@ -13,7 +13,7 @@ // GNU General Public License for more details. // // DESCRIPTION: -// System interface for music. +// System interface for music. // @@ -519,32 +519,32 @@ static void SetVoiceVolume(opl_voice_t *voice, unsigned int volume) unsigned int full_volume; unsigned int car_volume; unsigned int mod_volume; - + voice->note_volume = volume; - + opl_voice = &voice->current_instr->voices[voice->current_instr_voice]; - + // Multiply note volume and channel volume to get the actual volume. - + midi_volume = 2 * (volume_mapping_table[(voice->channel->volume * current_music_volume) / 127] + 1); - + full_volume = (volume_mapping_table[voice->note_volume] * midi_volume) >> 9; - + // The volume value to use in the register: car_volume = 0x3f - full_volume; - + // Update the volume register(s) if necessary. - + if (car_volume != voice->reg_volume) { voice->reg_volume = car_volume | (opl_voice->carrier.scale & 0xc0); - + OPL_WriteRegister(OPL_REGS_LEVEL + voice->op2, voice->reg_volume); - + // If we are using non-modulated feedback mode, we must set the // volume for both voices. - + if ((opl_voice->feedback & 0x01) != 0 && opl_voice->modulator.level != 0x3f) { mod_volume = 0x3f - opl_voice->modulator.level; @@ -570,7 +570,7 @@ static void InitVoices(void) // Initialize each voice. - for (i=0; i 95) { note -= 12; @@ -741,9 +741,9 @@ static unsigned int FrequencyForVoice(opl_voice_t *voice) if (freq_index < 0) { - freq_index = 0; + freq_index = 0; } - + // The first 7 notes use the start of the table, while // consecutive notes loop around the latter part. @@ -793,7 +793,7 @@ static void UpdateVoiceFrequency(opl_voice_t *voice) } } -// Program a single voice for an instrument. For a double voice +// Program a single voice for an instrument. For a double voice // instrument (GENMIDI_FLAG_2VOICE), this is called twice for each // key on event. @@ -894,7 +894,7 @@ static void KeyOnEvent(opl_track_data_t *track, midi_event_t *event) if (voice_free_list == NULL) { - ReplaceExistingVoice(); + ReplaceExistingVoice(); } // Find and program a voice for this instrument. If this @@ -931,7 +931,7 @@ static void SetChannelVolume(opl_channel_data_t *channel, unsigned int volume) // Update all voices that this channel is using. - for (i=0; iiter = MIDI_IterateTrack(file, track_num); - for (i=0; ichannels[i]); } @@ -1245,7 +1245,7 @@ static void I_OPL_PlaySong(void *handle, boolean looping) us_per_beat = 500 * 1000; - for (i=0; i