From 343db25d7f94f579c92d3e2d8be6dd8a612a0a7c Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sat, 12 Nov 2022 20:02:58 -0500 Subject: All original IT effects in portmod. Handle S6x in timing code. --- src/convert.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/convert.rs') diff --git a/src/convert.rs b/src/convert.rs index 05866f3..2cbe15b 100644 --- a/src/convert.rs +++ b/src/convert.rs @@ -17,6 +17,7 @@ struct PlayerState tempo: u8, loop_start: u8, loop_ctr: u8, + row_extension: u8, in_rep: bool } @@ -85,6 +86,7 @@ impl<'a> Player<'a> Effect::SetSpeed(s) => PlayerState{speed: s, ..ps}, Effect::PattLoopStart => PlayerState{loop_start: ps.current_row, ..ps}, Effect::SetTempo(t) => PlayerState{tempo: t, ..ps}, + Effect::RowExtention(t) => PlayerState{row_extension: ps.row_extension + t, ..ps}, _ => ps } } @@ -130,7 +132,7 @@ impl<'a> Player<'a> { ret.current_row = r; ret.current_tick = 0; - while ret.current_tick < ret.speed + while ret.current_tick < ret.speed + ret.row_extension { for c in 0..64 { @@ -141,6 +143,7 @@ impl<'a> Player<'a> ret.current_tick += 1; } ret = (&self.h).borrow_mut().process(!0, itfile::Cell::default(), ret); + ret.row_extension = 0; if (!ret.skip_row) != 0 || (!ret.skip_ord) != 0 { return ret; } } ret @@ -148,8 +151,6 @@ impl<'a> Player<'a> /// Used for effects Bxx, Cxx and SBx /// /// passing !0 to row or ord if it's unused - /// - /// in_loop == true inhibits loop detection and should only be used for SBx fn skip_to(&self, row: u8, ord: u8, ps: PlayerState) -> PlayerState { PlayerState { @@ -172,6 +173,7 @@ impl<'a> Player<'a> tempo: self.it.header.tempo, loop_start: 0, loop_ctr: !0, + row_extension: 0, in_rep: false }; -- cgit v1.2.3