# HG changeset patch # User Tony Vroon # Date 1218059785 -3600 # Node ID a31410f560cfd89cd82ce7f853bc11a5755a0bd7 # Parent 0ba28b84bdefd9c3f87a444984d4a5b42a6f0c6c Sprinkle some braces to liven up the if-statements. The compiler likes it better now. diff -r 0ba28b84bdef -r a31410f560cf src/adplug/core/fmc.cxx --- a/src/adplug/core/fmc.cxx Wed Aug 06 11:48:18 2008 +0100 +++ b/src/adplug/core/fmc.cxx Wed Aug 06 22:56:25 2008 +0100 @@ -130,6 +130,7 @@ if (tracks[t][k].command == 0x0E) // 0x0E (14): Retrig tracks[t][k].param1 = 3; if (tracks[t][k].command == 0x1A) // 0x1A (26): Volume Slide + { if (tracks[t][k].param1 > tracks[t][k].param2) { tracks[t][k].param1 -= tracks[t][k].param2; @@ -140,6 +141,7 @@ tracks[t][k].param2 -= tracks[t][k].param1; tracks[t][k].param1 = 0; } + } } t++; diff -r 0ba28b84bdef -r a31410f560cf src/adplug/core/mid.cxx --- a/src/adplug/core/mid.cxx Wed Aug 06 11:48:18 2008 +0100 +++ b/src/adplug/core/mid.cxx Wed Aug 06 22:56:25 2008 +0100 @@ -328,11 +328,13 @@ break; case 0x84: if (s[1] == 0x00 && load_sierra_ins (filename, fp)) + { if (s[2] == 0xf0) good = FILE_ADVSIERRA; else good = FILE_SIERRA; break; + } default: if (s[4] == 'A' && s[5] == 'D') good = FILE_OLDLUCAS; @@ -900,10 +902,12 @@ midiprintf ("\n"); for (i = 0; i < 16; i++) if (track[i].on) + { if (track[i].pos < track[i].tend) midiprintf ("<%d>", track[i].iwait); else midiprintf ("stop"); + } /* if (ret==0 && type==FILE_ADVSIERRA) diff -r 0ba28b84bdef -r a31410f560cf src/adplug/core/s3m.cxx --- a/src/adplug/core/s3m.cxx Wed Aug 06 11:48:18 2008 +0100 +++ b/src/adplug/core/s3m.cxx Wed Aug 06 22:56:25 2008 +0100 @@ -212,15 +212,19 @@ tone_portamento (realchan, channel[realchan].dualinfo); case 4: if (info <= 0x0f) // volume slide down + { if (channel[realchan].vol - info >= 0) channel[realchan].vol -= info; else channel[realchan].vol = 0; + } if ((info & 0x0f) == 0) // volume slide up + { if (channel[realchan].vol + (info >> 4) <= 63) channel[realchan].vol += info >> 4; else channel[realchan].vol = 63; + } setvolume (realchan); break; case 5: @@ -323,6 +327,7 @@ // set channel values donote = 0; if (pattern[pattnr][row][chan].note < 14) + { // tone portamento if (pattern[pattnr][row][chan].command == 7 || pattern[pattnr][row][chan].command == 12) @@ -339,6 +344,7 @@ channel[realchan].key = 1; donote = 1; } + } if (pattern[pattnr][row][chan].note == 14) { // key off (is 14 here, cause note is only first 4 bits) channel[realchan].key = 0; @@ -371,10 +377,12 @@ donote = 1; } if (pattern[pattnr][row][chan].volume != 255) + { if (pattern[pattnr][row][chan].volume < 64) // set volume channel[realchan].vol = pattern[pattnr][row][chan].volume; else channel[realchan].vol = 63; + } channel[realchan].fx = pattern[pattnr][row][chan].command; // set command if (pattern[pattnr][row][chan].info) // set infobyte channel[realchan].info = pattern[pattnr][row][chan].info; @@ -420,15 +428,19 @@ break; // pattern break case 4: if (info > 0xf0) // fine volume down + { if (channel[realchan].vol - (info & 0x0f) >= 0) channel[realchan].vol -= info & 0x0f; else channel[realchan].vol = 0; + } if ((info & 0x0f) == 0x0f && info >= 0x1f) // fine volume up + { if (channel[realchan].vol + ((info & 0xf0) >> 4) <= 63) channel[realchan].vol += (info & 0xf0) >> 4; else channel[realchan].vol = 63; + } setvolume (realchan); break; case 5: @@ -468,6 +480,7 @@ if (info == 0xb0) // set loop start loopstart = row; if (info > 0xb0 && info <= 0xbf) // pattern loop + { if (!loopcnt) { loopcnt = info & 0x0f; @@ -479,6 +492,7 @@ crow = loopstart; pattbreak = 1; } + } if ((info & 0xf0) == 0xe0) // patterndelay del = speed * (info & 0x0f) - 1; break;