dtlk.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #if 0
  2. #define TRACE_TXT(text) \
  3. { \
  4. if(dtlk_trace) \
  5. { \
  6. console_print(text); \
  7. console_print("\n"); \
  8. } \
  9. }
  10. #define TRACE_CHR(chr) \
  11. { \
  12. if(dtlk_trace) \
  13. console_print(chr); \
  14. } \
  15. #endif
  16. #define DTLK_MINOR 0
  17. #define DTLK_IO_EXTENT 0x02
  18. /* ioctl's use magic number of 0xa3 */
  19. #define DTLK_INTERROGATE 0xa390 /* get settings from the DoubleTalk */
  20. #define DTLK_STATUS 0xa391 /* get status from the DoubleTalk */
  21. #define DTLK_CLEAR 0x18 /* stops speech */
  22. #define DTLK_MAX_RETRIES (loops_per_jiffy/(10000/HZ))
  23. /* TTS Port Status Flags */
  24. #define TTS_READABLE 0x80 /* mask for bit which is nonzero if a
  25. byte can be read from the TTS port */
  26. #define TTS_SPEAKING 0x40 /* mask for SYNC bit, which is nonzero
  27. while DoubleTalk is producing
  28. output with TTS, PCM or CVSD
  29. synthesizers or tone generators
  30. (that is, all but LPC) */
  31. #define TTS_SPEAKING2 0x20 /* mask for SYNC2 bit,
  32. which falls to zero up to 0.4 sec
  33. before speech stops */
  34. #define TTS_WRITABLE 0x10 /* mask for RDY bit, which when set to
  35. 1, indicates the TTS port is ready
  36. to accept a byte of data. The RDY
  37. bit goes zero 2-3 usec after
  38. writing, and goes 1 again 180-190
  39. usec later. */
  40. #define TTS_ALMOST_FULL 0x08 /* mask for AF bit: When set to 1,
  41. indicates that less than 300 free
  42. bytes are available in the TTS
  43. input buffer. AF is always 0 in the
  44. PCM, TGN and CVSD modes. */
  45. #define TTS_ALMOST_EMPTY 0x04 /* mask for AE bit: When set to 1,
  46. indicates that less than 300 bytes
  47. of data remain in DoubleTalk's
  48. input (TTS or PCM) buffer. AE is
  49. always 1 in the TGN and CVSD
  50. modes. */
  51. /* LPC speak commands */
  52. #define LPC_5220_NORMAL 0x60 /* 5220 format decoding table, normal rate */
  53. #define LPC_5220_FAST 0x64 /* 5220 format decoding table, fast rate */
  54. #define LPC_D6_NORMAL 0x20 /* D6 format decoding table, normal rate */
  55. #define LPC_D6_FAST 0x24 /* D6 format decoding table, fast rate */
  56. /* LPC Port Status Flags (valid only after one of the LPC
  57. speak commands) */
  58. #define LPC_SPEAKING 0x80 /* mask for TS bit: When set to 1,
  59. indicates the LPC synthesizer is
  60. producing speech.*/
  61. #define LPC_BUFFER_LOW 0x40 /* mask for BL bit: When set to 1,
  62. indicates that the hardware LPC
  63. data buffer has less than 30 bytes
  64. remaining. (Total internal buffer
  65. size = 4096 bytes.) */
  66. #define LPC_BUFFER_EMPTY 0x20 /* mask for BE bit: When set to 1,
  67. indicates that the LPC data buffer
  68. ran out of data (error condition if
  69. TS is also 1). */
  70. /* data returned by Interrogate command */
  71. struct dtlk_settings
  72. {
  73. unsigned short serial_number; /* 0-7Fh:0-7Fh */
  74. unsigned char rom_version[24]; /* null terminated string */
  75. unsigned char mode; /* 0=Character; 1=Phoneme; 2=Text */
  76. unsigned char punc_level; /* nB; 0-7 */
  77. unsigned char formant_freq; /* nF; 0-9 */
  78. unsigned char pitch; /* nP; 0-99 */
  79. unsigned char speed; /* nS; 0-9 */
  80. unsigned char volume; /* nV; 0-9 */
  81. unsigned char tone; /* nX; 0-2 */
  82. unsigned char expression; /* nE; 0-9 */
  83. unsigned char ext_dict_loaded; /* 1=exception dictionary loaded */
  84. unsigned char ext_dict_status; /* 1=exception dictionary enabled */
  85. unsigned char free_ram; /* # pages (truncated) remaining for
  86. text buffer */
  87. unsigned char articulation; /* nA; 0-9 */
  88. unsigned char reverb; /* nR; 0-9 */
  89. unsigned char eob; /* 7Fh value indicating end of
  90. parameter block */
  91. unsigned char has_indexing; /* nonzero if indexing is implemented */
  92. };