home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 3
/
FREEWARE.BIN
/
towns_os
/
look
/
source
/
shell.c
< prev
next >
Wrap
Text File
|
1980-01-02
|
1KB
|
82 lines
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <snd.h>
#define BUFF_SIZE (66000)
#define BIOS_WORK_SIZE (16384)
extern int ML_Start();
extern int ML_End();
extern int ML_Set();
extern int ML_Play();
extern int ML_Stop();
extern int ML_Check();
extern int SL_Start();
extern int SL_Status();
extern int SL_Load();
extern int SL_Play();
extern int SL_Stop();
extern int SND_eup_stat_flag();
extern int SND_eup_stat_meas();
extern char *swork;
void runeup(char *filename)
{
int b,x,y;
char *buff;
wrtmos(3);
if((buff = malloc(BUFF_SIZE)) == NULL)
return;
if(ML_Start(buff,BUFF_SIZE,swork))
goto ERROR;
if ( ML_Set(filename) ) {
ML_Stop();
ML_End();
goto ERROR;
}
ML_Play(0);
while(SND_eup_stat_flag()){
if(ML_Check()){
ML_Stop();
ML_End();
goto ERROR;
}
SND_eup_stat_meas();
MOS_rdpos(&b,&x,&y);
if ( b != 0 )
break;
}
ML_End();
ERROR:
free(buff);
wrtmos(0);
}
void runsnd(char *filename)
{
int b,x,y;
char *buff;
wrtmos(4);
if((buff = malloc(BUFF_SIZE)) == NULL)
return;
if(SL_Start())
goto ERROR;
if ( SL_Load(filename,buff,BUFF_SIZE) )
goto ERROR;
SL_Play(0,0,127,64,buff);
while ( SL_Status() ) {
MOS_rdpos(&b,&x,&y);
if ( b != 0 )
break;
}
SL_Stop();
ERROR:
free(buff);
wrtmos(0);
}