aboutsummaryrefslogtreecommitdiff
path: root/src/convert.rs
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2022-11-12 20:02:58 -0500
committerGravatar Chris Xiong <chirs241097@gmail.com> 2022-11-12 20:02:58 -0500
commit343db25d7f94f579c92d3e2d8be6dd8a612a0a7c (patch)
tree7b2462700886ab8c82c4582677c56a5fae5b37ed /src/convert.rs
parentaf733bc521d1f8578e4ec4d704c3e776be185603 (diff)
downloadit2midi-343db25d7f94f579c92d3e2d8be6dd8a612a0a7c.tar.xz
All original IT effects in portmod. Handle S6x in timing code.
Diffstat (limited to 'src/convert.rs')
-rw-r--r--src/convert.rs8
1 files changed, 5 insertions, 3 deletions
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
};