home *** CD-ROM | disk | FTP | other *** search
/ ISV Strong Games / ISV_STRONG_GAMES.iso / shootemup / hive / !Hive / c / sound < prev    next >
Text File  |  2000-11-27  |  810b  |  43 lines

  1. #include <string.h>
  2.  
  3. #include "DeskLib:h.SWI"
  4.  
  5. #include "Popcorn:h.Popcorn"
  6.  
  7. #define SWI_QTM_Stereo        0x47E4D
  8. #define SWI_QTM_PlayRawSample 0x47E57
  9. #define SWI_QTM_SoundControl  0x47E58
  10.  
  11. int next_channel = 1;
  12.  
  13. void init_sound(void)
  14. {
  15.   SWI(3, 0, SWI_QTM_SoundControl, 4, 0, -1);
  16.   SWI(2, 0, SWI_QTM_Stereo, 0, 2);
  17. }
  18.  
  19. void kill_sound(void)
  20. {
  21.   int c;
  22.   for (c=0; c!=5; c++)
  23.     SWI(2, 0, SWI_QTM_PlayRawSample, c, 0);
  24.   SWI(3, 0, SWI_QTM_SoundControl, 0, 0, 0);
  25. }
  26.  
  27. void make_sound(char *sound_res)
  28. {
  29.   int c=0;
  30.  
  31.   while (c != resource_free)
  32.   {
  33.     if (strcmp(resource[c]->file, sound_res) == 0)
  34.     {
  35.       SWI(7, 0, SWI_QTM_PlayRawSample, next_channel, resource[c]->addr, resource[c]->size, 0, 0, 18, 64);
  36.       next_channel++;
  37.       if (next_channel == 5)
  38.         next_channel = 1;
  39.     }
  40.     c++;
  41.   }
  42. }
  43.