mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
Add support for retrigger command
This commit is contained in:
parent
559367f607
commit
54a31934b2
|
@ -94,6 +94,7 @@ pub enum PatternEffect {
|
|||
PitchBend(Num<u32, 8>),
|
||||
Jump(Jump),
|
||||
SampleOffset(u16),
|
||||
Retrigger(u8),
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
|
@ -403,6 +404,7 @@ impl quote::ToTokens for PatternEffect {
|
|||
quote! { Jump(#jump) }
|
||||
}
|
||||
PatternEffect::SampleOffset(offset) => quote! { SampleOffset(#offset) },
|
||||
PatternEffect::Retrigger(ticks) => quote! { Retrigger(#ticks) },
|
||||
};
|
||||
|
||||
tokens.append_all(quote! {
|
||||
|
|
|
@ -613,6 +613,11 @@ impl TrackerChannel {
|
|||
self.current_pos = Some(*offset);
|
||||
}
|
||||
}
|
||||
PatternEffect::Retrigger(ticks) => {
|
||||
if tick % *ticks as u32 == 0 {
|
||||
self.current_pos = Some(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -439,6 +439,17 @@ pub fn parse_module(module: &Module) -> agb_tracker_interop::Track {
|
|||
PatternEffect::GlobalVolumeSlide(Num::new(first as i32) / 0x40)
|
||||
}
|
||||
}
|
||||
// R
|
||||
0x1B => {
|
||||
let first = effect_parameter >> 4;
|
||||
let second = effect_parameter & 0xF;
|
||||
|
||||
if first != 0 {
|
||||
eprintln!("Unsupported retrigger effect volume {first}");
|
||||
}
|
||||
|
||||
PatternEffect::Retrigger(second)
|
||||
}
|
||||
e => {
|
||||
let effect_char = char::from_digit(e as u32, 36)
|
||||
.unwrap_or('?')
|
||||
|
|
BIN
tracker/desktop-player/tests/retrigger.xm
Normal file
BIN
tracker/desktop-player/tests/retrigger.xm
Normal file
Binary file not shown.
Loading…
Reference in a new issue