#pragma aux SP_START "_*" parm caller [];
extern void SP_START(byte *modplace);
#pragma aux SP_STOP "_*" parm caller [];
extern void SP_STOP(void);
#pragma aux POLLMUSIC "_*" parm caller [];
extern void POLLMUSIC(void);
#pragma aux SP_NEWINT8 "_*" parm caller [];
extern void SP_NEWINT8(void);
extern unsigned char SP_ACTORDER;
extern unsigned char SP_ACTROW;
extern unsigned char SP_ACTCHANNEL;
extern unsigned char SP_SAMPLENUM;
extern unsigned char SP_EFFECTNUM;
extern unsigned char SP_EFFECTPAR;
extern unsigned char SP_MASTERVOLUME;
extern unsigned char SP_QUIET;
extern word SP_GUSBASE;

int     position;
int     row;
int     musichandle;
int     ofs1,ofs2;
int     exelength;

ofs1 = 70644;
ofs2 = 70644+786456;

void    startmusic(void)
        {
        printf("DEMO_INIT: LOADING MUSIC\n");
        musichandle = open ("ONE.EXE", O_RDONLY | O_BINARY);
        lseek(musichandle, ofs1, SEEK_SET);
        read(musichandle, modplace, 786456);
        close(musichandle);
        atrak();
        SP_START(modplace);
        }
void    startmusic2(void)
        {
        musichandle = open ("ONE.EXE", O_RDONLY | O_BINARY);
        lseek(musichandle, ofs2, SEEK_SET);
        read(musichandle, modplace, 313560);
        close(musichandle);
        atrak2();
        SP_START(modplace);
        }
void    stopmusic(void)
        {
        SP_STOP();
        }
void    updateinfo(void)
        {
        position=SP_ACTORDER;
        row=SP_ACTROW;
        }
void atrak(void);
#pragma aux atrak = \
               "mov ecx,0" \
               "mov esi,modplace" \
     "@@loop00: mov bl,byte ptr [esi+ecx]" \
               "xor bl,132" \
               "mov byte ptr [esi+ecx],bl" \
               "inc ecx" \
               "cmp ecx,786456" \
               "jb @@loop00" \
            modify [eax ebx ecx edx edi];

void atrak2(void);
#pragma aux atrak2 = \
               "mov ecx,0" \
               "mov esi,modplace" \
     "@@loop00: mov bl,byte ptr [esi+ecx]" \
               "xor bl,132" \
               "mov byte ptr [esi+ecx],bl" \
               "inc ecx" \
               "cmp ecx,313560" \
               "jb @@loop00" \
            modify [eax ebx ecx edx edi];
