From d541506c6c7f03d7294321798651d6ad5e1c19be Mon Sep 17 00:00:00 2001 From: ashley Date: Mon, 14 Aug 2023 19:46:26 -0400 Subject: [PATCH] Fix bugs --- src/reskit/soundtrack.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/reskit/soundtrack.rs b/src/reskit/soundtrack.rs index 6f6c8bf..4c4bdf0 100644 --- a/src/reskit/soundtrack.rs +++ b/src/reskit/soundtrack.rs @@ -568,12 +568,13 @@ impl DmfModule { // (channel, patterns) let mut channel_patterns: Vec> = Vec::new(); - for _ in 0..system_total_channels { + for channel in 0..system_total_channels { let mut channel_rows: Vec = Vec::new(); let num_effects = get_u8( bytes.by_ref() )?; + println!( "Patterns for Ch. {}", channel ); for _ in 0..patterns_count { - for _ in 0..rows_per_pattern { + for row_id in 0..rows_per_pattern { let note = get_u16( bytes.by_ref() )?; let octave = get_u16( bytes.by_ref() )?; @@ -616,7 +617,7 @@ impl DmfModule { effects.push( Effect{ effect_code, - effect_value: if effect_value != -1 { Some( effect_code ) } else { None } + effect_value: if effect_value != -1 { Some( effect_value ) } else { None } } ); } @@ -629,7 +630,10 @@ impl DmfModule { None }; - channel_rows.push( PatternRow { note, volume, effects, instrument_index } ); + let pattern_row = PatternRow { note, volume, effects, instrument_index }; + println!( "{}:\t{:?}", row_id, pattern_row ); + + channel_rows.push( pattern_row ); } }