home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 4: The Falcon Archive / nf_archive_four_v1.0.iso / ARCHIVE / WORK / MSX / MEGPL116.ZIP / MGPL-116 / AMIGA / USE-030.C < prev    next >
C/C++ Source or Header  |  1995-08-22  |  2KB  |  95 lines

  1. /************************************************************/
  2. /*                                                */
  3. /*        De l'utilisation du Replay 030 Amiga            */
  4. /*                                                */
  5. /*        Of Use of the Amiga 030 Replay                */
  6. /*                                                */
  7. /*        Par Simplet / FATAL DESIGN                    */
  8. /*                                                */
  9. /************************************************************/
  10.  
  11. #include <tos.h>
  12. #include <screen.h>
  13. #include <amiga030.h>
  14.  
  15. #define MODNAME "E:\\SNDTRACK\\DEPACK\\NEXUS-7.MOD"
  16.  
  17. void main(void);
  18.  
  19. void main(void)
  20. {
  21.     long        adr,max,length;
  22.     int        dummy,handle;
  23.     char        tch;
  24.     DTA        *buf;
  25.  
  26.     Cconws(CLEAR_HOME);
  27.     Cconws("Amiga 4 interlaced voices 030 Replay Routine by Simplet / FATAL DESIGN\r\n");
  28.     Cconws("----------------------------------------------------------------------\r\n\n");
  29.  
  30.     dummy=Fsfirst(MODNAME,0);
  31.     buf=Fgetdta();
  32.     length=buf->d_length;
  33.     
  34.     if (dummy!=0)
  35.         {
  36.         Cconws("Disk Error!\r\nPress any key...");
  37.         Crawcin();exit();
  38.         }
  39.  
  40.     Cconws("Allocating Memory...");
  41.  
  42.     adr=Malloc(length+20832);        /* Workspace takes up to 20832 bytes */
  43.     if (adr<=0)
  44.         {
  45.         Cconws("Error!\r\nNot enough Memory to load!\r\nPress any key...");
  46.         Crawcin();exit();
  47.         }
  48.     
  49.     Cconws("Ok!\r\nLoading Module...");
  50.  
  51.     handle=Fopen(MODNAME,FO_READ);
  52.     Fread(handle,length,adr);
  53.     Fclose(handle);
  54.  
  55.     Cconws("\r\nInitialising Module and Samples...");
  56.  
  57.     dummy=MGTK_Init_Module_Samples(adr,adr+length+20832);
  58.     if (dummy==-3)
  59.         {
  60.         Cconws("Error!\r\n");
  61.         Cconws("Not enough workspace to prepare samples!\r\n");
  62.         Cconws("Press any key...");
  63.         Crawcin();exit();
  64.         }
  65.  
  66.     Cconws("Ok!\r\n\n");
  67.  
  68.     MGTK_Save_Sound();
  69.     MGTK_Init_Sound();
  70.     MGTK_Restart_Loop=-1;
  71.     MGTK_Play_Music();
  72.  
  73.     Cconws("You can use the following keys :\r\n");
  74.     Cconws("  - or + for previous or next music position\r\n");
  75.     Cconws("  L for play, P for pause, S for stop\r\n");
  76.     Cconws("  Space to quit\r\n");
  77.  
  78.     do
  79.         {
  80.         tch=Crawcin();
  81.         switch ( tch-32*((97<=tch) && (tch<=122)) )
  82.             {
  83.             case    '-':    MGTK_Previous_Position();break;
  84.             case '+':    MGTK_Next_Position();break;
  85.             case    'L':    MGTK_Play_Music();break;
  86.             case    'P':    MGTK_Pause_Music();break;
  87.             case    'S':    MGTK_Stop_Music();break;
  88.             }
  89.         }
  90.     while (tch!=*" ");
  91.         
  92.     MGTK_Stop_Music();
  93.     MGTK_Restore_Sound();
  94. }
  95.