home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / deskutils / _a_l / boota / C-source / c / Beep < prev    next >
Encoding:
Text File  |  1993-03-02  |  2.7 KB  |  68 lines

  1. /* > c.Beep - (c) Paul Witheridge - Version 1.00 - 02 Nov 1992       */
  2.  
  3. /*===================================================================*/
  4. /*                                                                   */
  5. /* beep  -  sound two tone beep to indicate error                    */
  6. /* ----                                                              */
  7. /*                                                                   */
  8. /* This function is here simply because I do not like the standard   */
  9. /* beep. Some people may very well think that this is even worse!    */
  10. /*                                                                   */
  11. /*===================================================================*/
  12.  
  13. #include "kernel.h"                   /* ARC specifics               */
  14. #include "Beep.h"                     /* Beep header                 */
  15. #include "useful.h"                   /* Useful defns                */
  16.  
  17. void beep(void)
  18. {
  19.   /*-----------------------------------------------------------------*/
  20.   /* Local definitions.                                              */
  21.   /*-----------------------------------------------------------------*/
  22.  
  23.   #define Sound_QSchedule   0x401C1   /* Define SWI number           */
  24.  
  25.   #define sound1_delay      0         /* Definition of 1st sound     */
  26.   #define sound1_channel    1
  27.   #define sound1_loudness -10
  28.   #define sound1_pitch     10
  29.   #define sound1_duration   4
  30.  
  31.   #define sound2_delay     15         /* Definition of 2nd sound     */
  32.   #define sound2_channel    1
  33.   #define sound2_loudness  -4
  34.   #define sound2_pitch      0
  35.   #define sound2_duration   7
  36.  
  37.   static _kernel_swi_regs sound1 =    /* SWI regs for 1st sound      */
  38.   {
  39.     sound1_delay,
  40.     0,
  41.     (sound1_loudness << 16) | (sound1_channel),
  42.     (sound1_duration << 16) | (sound1_pitch)
  43.   } ;
  44.  
  45.   static _kernel_swi_regs sound2 =    /* SWI regs for 2nd sound      */
  46.   {
  47.     sound2_delay,
  48.     0,
  49.     (sound2_loudness << 16) | (sound2_channel),
  50.     (sound2_duration << 16) | (sound2_pitch)
  51.   } ;
  52.  
  53.   _kernel_swi_regs dummy ;            /* SWI output regs - ignored   */
  54.  
  55.   /*-----------------------------------------------------------------*/
  56.   /* Executable statements                                           */
  57.   /*                                                                 */
  58.   /* Issue two Sound_QSchedule SWIs to sound two beeps, one after    */
  59.   /* the other, the first of a short duration, the second slightly   */
  60.   /* longer and also quieter and of lower pitch.                     */
  61.   /*-----------------------------------------------------------------*/
  62.  
  63.   _kernel_swi(Sound_QSchedule,&sound1,&dummy) ;
  64.   _kernel_swi(Sound_QSchedule,&sound2,&dummy) ;
  65. }
  66.  
  67. /*===================================================================*/
  68.