Closed sezero closed 3 years ago
Comments? (@AliceLR?)
It's bogus.
It's bogus.
Then I suggest the following patch:
diff --git a/libmikmod/loaders/load_asy.c b/libmikmod/loaders/load_asy.c
index 8dbd9d2..33f31bd 100644
--- a/libmikmod/loaders/load_asy.c
+++ b/libmikmod/loaders/load_asy.c
@@ -146,11 +146,10 @@ static void ASY_Cleanup(void)
static int ConvertNote(MODNOTE *n)
{
UBYTE instrument, effect, effdat, note;
UWORD period;
- UBYTE lastnote = 0;
instrument = n->b&0x1f;
effect = n->c;
effdat = n->d;
@@ -191,27 +190,23 @@ static int ConvertNote(MODNOTE *n)
/* ...unless an effect was specified,
* which forces a new note to be
* played */
if (effect || effdat) {
UniInstrument(instrument - 1);
- note = lastnote;
} else
UniPTEffect(0xc,
mh->samples[instrument -
1].volume & 0x7f);
}
} else {
/* Fasttracker handling */
UniInstrument(instrument - 1);
- if (!note)
- note = lastnote;
}
}
}
if (note) {
UniNote(note + 2 * OCTAVE - 1);
- lastnote = note;
}
/* Convert pattern jump from Dec to Hex */
if (effect == 0xd)
effdat = (((effdat & 0xf0) >> 4) * 10) + (effdat & 0xf);
Comments?
Looks sensible to me.
Patch applied as 3c248bac7285b7d4bd93bc39369f8c7bb7257e7a
As reported by Thomas Neumann (@neumatho):
https://github.com/sezero/mikmod/blob/master/libmikmod/loaders/load_asy.c#L147
Indeed, lastnote assignment doesn't seem to matter in present code, it is never used after being assigned.
Further note by Thomas Neumann (@neumatho):