#ifdef LATTICE
LONG __asm InitPlayer(void);
void __asm RemPlayer(void);
void __asm PlayModule(register __a0 struct MMD0 *);
void __asm ContModule(register __a0 struct MMD0 *);
void __asm StopPlayer(void);
void __asm SetTempo(register __d0 UWORD);
struct MMD0 * __asm LoadModule(register __a0 char *);
void __asm RelocModule(register __a0 struct MMD0 *);
void __asm UnLoadModule(register __a0 struct MMD0 *);
/* These are the definitions for 8-channel OctaMED routines */
LONG __asm InitPlayer8(void);
void __asm RemPlayer8(void);
void __asm PlayModule8(register __a0 struct MMD0 *);
void __asm ContModule8(register __a0 struct MMD0 *);
void __asm StopPlayer8(void);
#endif
struct MMD0 {
	ULONG id;			/* "MMD0" */
	ULONG modlen;			/* module length (in bytes) */
	struct MMD0song *song;		/* pointer to song (see med.h) */
	ULONG songlen;			/* length of song (usually zero) */
	struct MMD0block **blockarr;	/* pointer to pointers of blocks */
	ULONG blockarrlen;		/* length... */
	struct Soitin **smplarr;	/* pointer to pointers of samples */
	ULONG smplarrlen;		/* len.. */
	struct MMD0exp *expdata;	/* pointer to expansion data (see med.h) */
	ULONG expsize;			/* len.. (don't care about these) */
/* Followed by some private variables that have become obsolete in V3.00... */
};

struct InstrExt {	/* THIS STRUCT MAY GROW IN THE FUTURE!! */
	UBYTE hold;	/* to get the correct size, examine s_ext_entrsz */
	UBYTE decay;
};

struct MMD0exp {
	ULONG	reserved; /* for future... */
	struct InstrExt *exp_smp;
	UWORD  s_ext_entries;  /* # of entries */
	UWORD  s_ext_entrsz;   /* size of entry*/
	UBYTE  *annotxt;	/* song name, ©, notes etc... */
	ULONG  annolen;	/* length (including 0-byte) */
	ULONG  reserved2[16]; /* better have enough of these... */
};

struct MMD0sample {
	UWORD rep,replen;	/* offs: 0(s), 2(s) */
	UBYTE midich;		/* offs: 4(s) */
	UBYTE midipreset;	/* offs: 5(s) */
	UBYTE svol;		/* offs: 6(s) */
	BYTE strans;		/* offs: 7(s) */
};

struct MMD0song {
	struct MMD0sample sample[63]; /* 63 * 8 bytes = 504 bytes */
	UWORD	numblocks;		/* offs: 504 */
	UWORD	songlen;		/* offs: 506 */
	UBYTE	playseq[256];		/* offs: 508 */
	UWORD	deftempo;		/* offs: 764 */
	BYTE	playtransp;		/* offs: 766 */
	UBYTE	flags;			/* offs: 767 */
	UBYTE	reserved;		/* offs: 768 */
	UBYTE	tempo2;			/* offs: 769 */
	UBYTE	trkvol[16];		/* offs: 770 */
	UBYTE	mastervol;		/* offs: 786 */
	UBYTE	numsamples;		/* offs: 787 */
}; /* length = 788 bytes */

 /* FLAGS of the above structure */
#define	FLAG_FILTERON	0x1	/* hardware low-pass filter */
#define	FLAG_JUMPINGON	0x2	/* jumping.. (not used in modules) */
#define	FLAG_JUMP8TH	0x4	/* jump 8th..  "	"	" */
#define	FLAG_INSTRSATT	0x8	/* instruments are attached (sng+samples) */
#define	FLAG_VOLHEX	0x10	/* volumes are represented as hex */
#define FLAG_STSLIDE	0x20	/* no effects on 1st timing pulse (STS) */
#define FLAG_8CHANNEL	0x40	/* OctaMED 8 channel song */
