Worked around two issues in DUMB's XM reader; Fixes dark lighthouse.xm

CQTexperiment
Chris Moeller 2014-03-20 22:37:11 -07:00
parent a567183510
commit 741271e153
1 changed files with 10 additions and 0 deletions

View File

@ -897,6 +897,16 @@ static DUMB_IT_SIGDATA *it_xm_load_sigdata(DUMBFILE *f, int * version)
if (sigdata->speed == 0) sigdata->speed = 6; // Should we? What about tempo? if (sigdata->speed == 0) sigdata->speed = 6; // Should we? What about tempo?
sigdata->tempo = dumbfile_igetw(f); sigdata->tempo = dumbfile_igetw(f);
// FT2 always clips restart position against the song length
if (sigdata->restart_position > sigdata->n_orders)
sigdata->restart_position = sigdata->n_orders;
// And FT2 starts playback on order 0, regardless of length,
// and only checks if the next order is greater than or equal
// to this, not the current pattern. Work around this with
// DUMB's playback core by overriding a zero length with one.
if (sigdata->n_orders == 0)
sigdata->n_orders = 1;
/* sanity checks */ /* sanity checks */
// XXX // XXX
i = header_size - 4 - 2 * 8; /* Maximum number of orders expected */ i = header_size - 4 - 2 * 8; /* Maximum number of orders expected */