home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / gchsrc31 / beeps.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-27  |  2.1 KB  |  81 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  This file is part of the Atari graphical interface for GNU Chess,
  4. //  and is Copyright 1992 by Warwick W. Allison.
  5. //
  6. //  You are free to copy and modify these sources, provided you acknowledge
  7. //  the origin by retaining this notice, and adhere to the conditions
  8. //  of the CHESS General Public License described in the main chess file
  9. //  gnuchess.cc.
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12.  
  13. #include <osbind.h>
  14.  
  15. // Low level macros
  16. #define PitchA(p) 0,(p)&255,1,(p)>>8
  17. #define PitchB(p) 2,(p)&255,3,(p)>>8
  18. #define PitchC(p) 4,(p)&255,5,(p)>>8
  19. #define Noise(n) 6,(n)
  20. #define Control(c) 7,63-(c)
  21. #define VolumeA(v) 8,(v)
  22. #define VolumeB(v) 9,(v)
  23. #define VolumeC(v) 10,(v)
  24. #define WaveA VolumeA(16)
  25. #define WaveB VolumeB(16)
  26. #define WaveC VolumeC(16)
  27. #define Sustain(s) 11,(s)&255,12,(s)>>8
  28. #define Wave(w) 13,(w)
  29.  
  30. // Control macros
  31. #define Atone 1
  32. #define Btone 2
  33. #define Ctone 4
  34. #define Anoise 8
  35. #define Bnoise 16
  36. #define Cnoise 32
  37.  
  38. // Wave macros
  39. #define Pop Wave(0)
  40. #define Bang Wave(4)
  41. #define BangBang Wave(8)
  42. #define PopBang Wave(10)
  43. #define PopBeep Wave(11)
  44. #define PopPop Wave(12)
  45. #define BangBeep Wave(13)
  46. #define BangPop Wave(14)
  47.  
  48. // Dosound level macros
  49. #define ForBy(r,f,t,b) 0x80,(f),0x81,(r),b,(t)
  50. #define For(r,f,t) ForBy(r,f,t,(f)<(t) ? 1 : -1)
  51. #define Pause(t) 0x82,(t)
  52. #define End 0x82,0
  53.  
  54. // Second level Dosound macros
  55. #define StartA Control(Atone)
  56. #define StartB Control(Atone)
  57. #define StartC Control(Atone)
  58. #define ForVolumeA(f,t) For(8,f,t)
  59. #define ForVolumeB(f,t) For(8,f,t)
  60. #define ForVolumeC(f,t) For(8,f,t)
  61.  
  62. // stdsnd macros
  63. #define Start StartA
  64. #define Pitch PitchA
  65. #define Volume VolumeA
  66. #define ForVolume ForVolumeA
  67.  
  68.  
  69. char ChimeSound[]={ Start, Pitch(30), ForVolume(14,0), End };
  70. char RaspberrySound[]={ Control(Atone|Anoise), Noise(20), Pitch(100), ForVolume(14,0), End };
  71.  
  72. void Chime()
  73. {
  74.     Dosound(ChimeSound);
  75. }
  76.  
  77. void Raspberry()
  78. {
  79.     Dosound(RaspberrySound);
  80. }
  81.