home *** CD-ROM | disk | FTP | other *** search
- /* > c.Beep - (c) Paul Witheridge - Version 1.00 - 02 Nov 1992 */
-
- /*===================================================================*/
- /* */
- /* beep - sound two tone beep to indicate error */
- /* ---- */
- /* */
- /* This function is here simply because I do not like the standard */
- /* beep. Some people may very well think that this is even worse! */
- /* */
- /*===================================================================*/
-
- #include "kernel.h" /* ARC specifics */
- #include "Beep.h" /* Beep header */
- #include "useful.h" /* Useful defns */
-
- void beep(void)
- {
- /*-----------------------------------------------------------------*/
- /* Local definitions. */
- /*-----------------------------------------------------------------*/
-
- #define Sound_QSchedule 0x401C1 /* Define SWI number */
-
- #define sound1_delay 0 /* Definition of 1st sound */
- #define sound1_channel 1
- #define sound1_loudness -10
- #define sound1_pitch 10
- #define sound1_duration 4
-
- #define sound2_delay 15 /* Definition of 2nd sound */
- #define sound2_channel 1
- #define sound2_loudness -4
- #define sound2_pitch 0
- #define sound2_duration 7
-
- static _kernel_swi_regs sound1 = /* SWI regs for 1st sound */
- {
- sound1_delay,
- 0,
- (sound1_loudness << 16) | (sound1_channel),
- (sound1_duration << 16) | (sound1_pitch)
- } ;
-
- static _kernel_swi_regs sound2 = /* SWI regs for 2nd sound */
- {
- sound2_delay,
- 0,
- (sound2_loudness << 16) | (sound2_channel),
- (sound2_duration << 16) | (sound2_pitch)
- } ;
-
- _kernel_swi_regs dummy ; /* SWI output regs - ignored */
-
- /*-----------------------------------------------------------------*/
- /* Executable statements */
- /* */
- /* Issue two Sound_QSchedule SWIs to sound two beeps, one after */
- /* the other, the first of a short duration, the second slightly */
- /* longer and also quieter and of lower pitch. */
- /*-----------------------------------------------------------------*/
-
- _kernel_swi(Sound_QSchedule,&sound1,&dummy) ;
- _kernel_swi(Sound_QSchedule,&sound2,&dummy) ;
- }
-
- /*===================================================================*/
-