[#24] Implement M0 volume effect (portamento)

Written so Mx is equivalent to 3x0; I think if both are present, it
might not do exactly what FT2 does.
This commit is contained in:
Andy Sloane 2016-04-19 16:33:21 -07:00
commit 27d9435d83

7
xm.js
View file

@ -215,6 +215,11 @@ function nextRow() {
player.effects_t1[4](ch); // and also call it on tick 0
} else if (v >= 0xc0 && v < 0xd0) { // set panning
ch.pan = (v & 0x0f) * 0x11;
} else if (v >= 0xf0 && v <= 0xff) { // portamento
if (v & 0x0f) {
ch.portaspeed = (v & 0x0f) << 4;
}
ch.voleffectfn = player.effects_t1[3]; // just run 3x0
} else {
console.log("channel", i, "volume effect", v.toString(16));
}
@ -233,7 +238,7 @@ function nextRow() {
}
// special handling for portamentos: don't trigger the note
if (ch.effect == 3 || ch.effect == 5) {
if (ch.effect == 3 || ch.effect == 5 || r[i][2] >= 0xf0) {
if (r[i][0] != -1) {
ch.periodtarget = periodForNote(ch, ch.note);
}