forked from len0rd/rockbox
FS#13539: Resync mikmod plugin with upstream
Brings it up to libmikmod 3.3.12, relased 2024-12-31 Also fix a segfault that only happened on simulators when using non-default samplerates. Change-Id: I2ade2d72a00edab5395328fe76a88a88516aac72
This commit is contained in:
parent
08c32cee7c
commit
af7ed73f31
29 changed files with 1860 additions and 706 deletions
|
@ -201,7 +201,7 @@ static UBYTE* readtrack(void)
|
|||
opcode++;
|
||||
}
|
||||
|
||||
if((!opcode)||(opcode>=UNI_LAST)) {
|
||||
if((!opcode)||(opcode>=UNI_FORMAT_LAST)) {
|
||||
MikMod_free(t);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -477,14 +477,23 @@ static int loadsmp5(void)
|
|||
|
||||
/* convert flags */
|
||||
q->flags=0;
|
||||
if(s->flags&128) q->flags|=SF_REVERSE;
|
||||
if(s->flags& 64) q->flags|=SF_SUSTAIN;
|
||||
if(s->flags& 32) q->flags|=SF_BIDI;
|
||||
if(s->flags& 16) q->flags|=SF_LOOP;
|
||||
if(s->flags& 8) q->flags|=SF_BIG_ENDIAN;
|
||||
if(s->flags& 4) q->flags|=SF_DELTA;
|
||||
if(s->flags& 2) q->flags|=SF_SIGNED;
|
||||
if(s->flags& 1) q->flags|=SF_16BITS;
|
||||
if (universion < 5) {
|
||||
/* UN04 flags, as suggested by Thomas Neumann */
|
||||
if(s->flags& 64) q->flags|=SF_OWNPAN;
|
||||
if(s->flags& 32) q->flags|=SF_SIGNED;
|
||||
if(s->flags& 16) q->flags|=SF_BIDI;
|
||||
if(s->flags& 8) q->flags|=SF_LOOP;
|
||||
if(s->flags& 4) q->flags|=SF_DELTA;
|
||||
} else {
|
||||
if(s->flags&128) q->flags|=SF_REVERSE;
|
||||
if(s->flags& 64) q->flags|=SF_OWNPAN;
|
||||
if(s->flags& 32) q->flags|=SF_BIDI;
|
||||
if(s->flags& 16) q->flags|=SF_LOOP;
|
||||
if(s->flags& 8) q->flags|=SF_BIG_ENDIAN;
|
||||
if(s->flags& 4) q->flags|=SF_DELTA;
|
||||
if(s->flags& 2) q->flags|=SF_SIGNED;
|
||||
if(s->flags& 1) q->flags|=SF_16BITS;
|
||||
}
|
||||
}
|
||||
|
||||
d=of.instruments;s=wh;
|
||||
|
@ -574,6 +583,8 @@ static int UNI_Load(int curious)
|
|||
of.bpmlimit=32;
|
||||
|
||||
of.songname=readstring();
|
||||
if(!of.songname)
|
||||
of.songname=MikMod_strdup("");
|
||||
if(universion<0x102)
|
||||
oldtype=readstring();
|
||||
if(oldtype) {
|
||||
|
@ -698,13 +709,16 @@ static CHAR *UNI_LoadTitle(void)
|
|||
{
|
||||
UBYTE ver;
|
||||
int posit[3]={304,306,26};
|
||||
CHAR *title;
|
||||
|
||||
_mm_fseek(modreader,3,SEEK_SET);
|
||||
ver=_mm_read_UBYTE(modreader);
|
||||
if(ver=='N') ver='6';
|
||||
|
||||
_mm_fseek(modreader,posit[ver-'4'],SEEK_SET);
|
||||
return readstring();
|
||||
title=readstring();
|
||||
if(!title) title=MikMod_strdup("");
|
||||
return title;
|
||||
}
|
||||
|
||||
/*========== Loader information */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue