Files
amiga/RetroTerm/bell-smoke.c
T

16 lines
999 B
C

#include "bell.c"
#include <proto/dos.h>
struct GfxBase *GfxBase;
int main(void){FILE*f=fopen("PROGDIR:bell-test.log","w");int i,error=99,started;ULONG unit,period;
if(!f)return 20;GfxBase=(struct GfxBase*)OpenLibrary("graphics.library",40);
if(!GfxBase){fprintf(f,"Graphics library unavailable.\n");fclose(f);return 20;}
if(!bell_init()){fprintf(f,"Sample/device resources unavailable.\n");fclose(f);CloseLibrary((struct Library*)GfxBase);return 20;}
bell_play(0);started=active;unit=(ULONG)audio->ioa_Request.io_Unit;period=audio->ioa_Period;unit=allocated;
for(i=0;active&&i<100;i++){
if(CheckIO((struct IORequest*)audio))error=audio->ioa_Request.io_Error;
bell_poll();if(active)Delay(1);
}
fprintf(f,"Started=%d completed=%d audio.device error=%d length=%lu volume=18/64 stereo\n",started,!active,error,length);fprintf(f,"poll_ticks=%d unit_mask=%lu period=%lu\n",i,unit,period);
bell_exit();CloseLibrary((struct Library*)GfxBase);fclose(f);return started&&!active&&error==0?0:20;
}