aboutsummaryrefslogtreecommitdiff
path: root/src/itfile.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/itfile.rs')
-rw-r--r--src/itfile.rs26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/itfile.rs b/src/itfile.rs
index 57d235d..e744ce3 100644
--- a/src/itfile.rs
+++ b/src/itfile.rs
@@ -4,6 +4,8 @@ use std::io::SeekFrom;
use std::fs::File;
use std::mem::{size_of, zeroed};
+use crate::portmod::{Effect, Slide};
+
macro_rules! zero_default {
($t:ty) =>
{
@@ -283,18 +285,20 @@ impl Patt
} else { print!(".. "); }
if mask & 0x44 != 0
{
- match vol
+ match Effect::from_it_vol(*vol)
{
- 0..=64 => print!("v{:02} ", vol),
- 65..=74 => print!("a{:02} ", vol - 65),
- 75..=84 => print!("b{:02} ", vol - 75),
- 85..=94 => print!("c{:02} ", vol - 85),
- 95..=104 => print!("d{:02} ", vol - 95),
- 105..=114 => print!("e{:02} ", vol - 105),
- 115..=124 => print!("f{:02} ", vol - 115),
- 128..=192 => print!("p{:02} ", vol - 128),
- 193..=202 => print!("g{:02} ", vol - 193),
- 203..=212 => print!("h{:02} ", vol - 203),
+ Effect::SetVolume(vol) => print!("v{:02} ", vol),
+ Effect::VolumeSlide(s) => match s {
+ Slide::FineUp(x) => print!("a{:02} ", x),
+ Slide::FineDown(x) => print!("b{:02} ", x),
+ Slide::Up(x) => print!("c{:02} ", x),
+ Slide::Down(x) => print!("d{:02} ", x),
+ },
+ Effect::PortaDown(x) => print!("e{:02} ", x / 4),
+ Effect::PortaUp(x) => print!("f{:02} ", x / 4),
+ Effect::SetPan(p) => print!("p{:02} ", p),
+ Effect::TonePorta(_) => print!("g{:02} ", vol - 193),
+ Effect::Vibrato(_, x) => print!("h{:02} ", x),
_ => print!("??? ")
}
} else { print!("... "); }