From db302a7f7e59d49929dd10ad9c082b2431e44391 Mon Sep 17 00:00:00 2001 From: ashley Date: Tue, 29 Aug 2023 19:46:09 -0400 Subject: [PATCH] None of this shit has to be public --- src/reskit/soundtrack/engines/echo/dmf.rs | 6 ++++-- src/reskit/soundtrack/engines/echo/engine.rs | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/reskit/soundtrack/engines/echo/dmf.rs b/src/reskit/soundtrack/engines/echo/dmf.rs index 12c6cde..98b3594 100644 --- a/src/reskit/soundtrack/engines/echo/dmf.rs +++ b/src/reskit/soundtrack/engines/echo/dmf.rs @@ -311,8 +311,8 @@ impl EchoFormat for DmfModule { // Iterate for each row, for each channel // Recall items are stored as self.channel_patterns[ channel ][ row_number ] let mut all_events: Vec = Vec::new(); - let rows_per_pattern: u32 = self.channel_patterns[ 0 ].len() as u32; - for row_number in 0..rows_per_pattern { + let total_rows: u32 = self.channel_patterns[ 0 ].len() as u32; + for row_number in 0..total_rows { let events_this_row: Vec = get_events_for_row( &mut channels, &self.instruments, @@ -334,6 +334,8 @@ impl EchoFormat for DmfModule { // Transfer ESF events to the main stream all_events.extend( events_this_row ); + + // Any jumps? } // Compact sequences of delays to save rom space diff --git a/src/reskit/soundtrack/engines/echo/engine.rs b/src/reskit/soundtrack/engines/echo/engine.rs index 3fbf161..97f4ef7 100644 --- a/src/reskit/soundtrack/engines/echo/engine.rs +++ b/src/reskit/soundtrack/engines/echo/engine.rs @@ -544,7 +544,7 @@ fn apply_effects_to_channel( channel: &mut Channel, effects: &LinkedHashSet ) -> Result, Box> { +fn sequence_to_compacted_delay( current_sequence: &Vec ) -> Result, Box> { let mut new_events: Vec = Vec::new(); let mut cumulative_delay: u16 = 0; @@ -605,7 +605,7 @@ pub fn compact_delays( events: Vec ) -> Result, Box Result> { +fn get_portamento( channel: &mut Channel, portamento_effect: &Effect ) -> Result> { if channel.id != ESF_FM_6_PCM && channel.id != ESF_PSG_4 { // A portamento was called for on this channel, and if none was provided, we need to start with C, octave 0 // This replicates the behaviour in deflemask @@ -696,7 +696,7 @@ pub fn get_portamento( channel: &mut Channel, portamento_effect: &Effect ) -> Re /** * Generate a note cut effect for this channel and modify channel state to reflect it */ -pub fn get_note_cut( channel: &mut Channel, note_cut_effect: &Effect, tick: u8 ) -> Result> { +fn get_note_cut( channel: &mut Channel, note_cut_effect: &Effect, tick: u8 ) -> Result> { let after_ticks = match note_cut_effect { Effect::NoteCut { after_ticks } => *after_ticks, _ => return Err( "internal error: provided effect is not the note cut effect" )? @@ -721,7 +721,7 @@ pub fn get_note_cut( channel: &mut Channel, note_cut_effect: &Effect, tick: u8 ) /** * Get effects that require a specific action when computing the event flushes to Echo. */ -pub fn get_actionable_effects( channels: &mut [Channel] ) -> Result, Box> { +fn get_actionable_effects( channels: &mut [Channel] ) -> Result, Box> { // All portamento effects deploy per tick, not per row. So we need to aggregate all portamentos across all // channels for this row, then flush them once per `ticks_to_wait` for this row. let mut actionable_effects: Vec<(usize, Effect)> = Vec::new(); @@ -750,7 +750,7 @@ pub fn get_actionable_effects( channels: &mut [Channel] ) -> Result Result, Box> { +fn get_actionable_effect_sequence( channels: &mut [Channel], ticks_to_wait: u8 ) -> Result, Box> { let mut events: Vec = Vec::new(); let actionable_effects = get_actionable_effects( channels )?; @@ -780,7 +780,7 @@ pub fn get_actionable_effect_sequence( channels: &mut [Channel], ticks_to_wait: /** * Get the delays due at the end of a row. These delays are what flushes the tick to Echo so that it can play. */ -pub fn get_delays( events: Vec, channels: &mut [Channel], ticks_to_wait: u8 ) -> Result, Box> { +fn get_delays( events: Vec, channels: &mut [Channel], ticks_to_wait: u8 ) -> Result, Box> { let mut events: Vec = events; let applied_effects = get_actionable_effect_sequence( channels, ticks_to_wait )?;