SOSFNCT.H 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. /*
  2. ** Command & Conquer Red Alert(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /****************************************************************************
  19. File : sosfnct.h
  20. Programmer(s) : Don Fowler, Nick Skrepetos
  21. Date :
  22. Purpose : Include Files For Zortech C++ Compiler
  23. Last Updated :
  24. ****************************************************************************
  25. Copyright(c) 1993,1994 Human Machine Interfaces
  26. All Rights Reserved
  27. ****************************************************************************/
  28. #ifndef _SOS_FUNCTIONS
  29. #define _SOS_FUNCTIONS
  30. #pragma pack(4)
  31. WORD sosDIGILockMemory ( VOID );
  32. WORD sosDIGIUnLockMemory ( VOID );
  33. WORD sosDIGIInitSystem ( LPSTR, WORD );
  34. WORD sosDIGIUnInitSystem ( VOID );
  35. WORD sosDIGIInitDriver ( WORD, _SOS_HARDWARE far *,
  36. _SOS_INIT_DRIVER far *, WORD far * );
  37. WORD sosDIGIUnInitDriver ( WORD, BOOL, BOOL );
  38. WORD sosDIGILoadDriver ( WORD, WORD, LPSTR far *, LPSTR far *, PSTR, PSTR, WORD * );
  39. WORD sosDIGIUnLoadDriver ( WORD );
  40. WORD sosDIGIGetDeviceCaps ( WORD, LPSOSDEVICECAPS );
  41. #ifdef PHARLAP
  42. LPSTR sosDIGIAllocateBuffer ( WORD , WORD *, WORD * );
  43. #else
  44. LPSTR sosDIGIAllocateBuffer ( WORD , WORD *, WORD * );
  45. #endif
  46. WORD sosDIGIStopSample ( WORD, WORD );
  47. WORD sosDIGISamplesPlaying ( WORD );
  48. BOOL sosDIGISampleDone ( WORD, WORD );
  49. BOOL sosDIGISampleFilling ( WORD, WORD );
  50. WORD sosDIGIStartSample ( WORD, _SOS_START_SAMPLE far * );
  51. WORD sosDIGIContinueSample ( WORD, WORD, _SOS_START_SAMPLE far * );
  52. WORD sosDIGIDetectInit ( LPSTR );
  53. WORD sosDIGIDetectUnInit ( VOID );
  54. WORD sosDIGIDetectFindHardware ( WORD, _SOS_CAPABILITIES far *, WORD far * );
  55. WORD sosDIGIDetectFindFirst ( _SOS_CAPABILITIES far *, WORD far * );
  56. WORD sosDIGIDetectFindNext ( _SOS_CAPABILITIES far *, WORD far * );
  57. WORD sosDIGIDetectGetSettings ( _SOS_HARDWARE far * );
  58. WORD sosDIGIDetectGetCaps ( WORD, _SOS_CAPABILITIES far * );
  59. WORD sosDIGIDetectVerifySettings( _SOS_HARDWARE far * );
  60. PSTR sosGetErrorString ( WORD );
  61. WORD sosDIGILoadTimer ( WORD , LPSTR far *, LPSTR far *, PSTR, PSTR, WORD * );
  62. WORD sosDIGIUnLoadTimer ( WORD );
  63. WORD sosTIMERRegisterEvent ( WORD wCallRate, VOID ( far * lpTimerEvent )( VOID ), WORD far *lpTimerHandle );
  64. WORD sosTIMERInitSystem ( WORD, WORD );
  65. WORD sosTIMERUnInitSystem ( WORD );
  66. WORD sosTIMERSetRate ( WORD );
  67. WORD sosTIMERRemoveEvent ( WORD );
  68. WORD sosTIMERAlterEventRate ( WORD, WORD );
  69. WORD sosTIMERGetEventRate ( WORD );
  70. VOID far sosTIMEROldHandler ( VOID );
  71. VOID far sosTIMERHandler ( VOID );
  72. // functions in soscntl.c
  73. WORD sosDIGISetSampleVolume ( WORD, WORD, WORD );
  74. WORD sosDIGIGetSampleVolume ( WORD, WORD );
  75. WORD sosDIGISetChannel ( WORD, WORD, WORD );
  76. WORD sosDIGIGetChannel ( WORD, WORD );
  77. WORD sosDIGIGetBytesProcessed ( WORD, WORD );
  78. WORD sosDIGIGetLoopCount ( WORD, WORD );
  79. WORD sosDIGISetPanLocation ( WORD, WORD, WORD );
  80. WORD sosDIGIGetPanLocation ( WORD, WORD );
  81. DWORD sosDIGISetPitch ( WORD, WORD, DWORD );
  82. DWORD sosDIGIGetPitch ( WORD, WORD );
  83. WORD sosDIGIGetDMAPosition ( WORD );
  84. WORD sosDIGISetPanSpeed ( WORD, WORD, WORD );
  85. WORD sosDIGIGetPanSpeed ( WORD, WORD );
  86. WORD sosDIGIGetSampleID ( WORD, WORD );
  87. WORD sosDIGIGetSampleHandle ( WORD, WORD );
  88. WORD sosDIGISetMasterVolume ( WORD, WORD );
  89. #ifdef PHARLAP
  90. VOID sosFreeVDSPage ( unsigned short, unsigned short, DWORD );
  91. WORD sosAllocVDSPage ( unsigned short *, unsigned short *, DWORD * );
  92. #else
  93. WORD sosAllocVDSPage ( LPSTR *, WORD *, WORD * );
  94. VOID sosFreeVDSPage ( WORD, WORD, LONG );
  95. #endif
  96. #ifdef __cplusplus
  97. extern "C" {
  98. #endif
  99. #ifdef PHARLAP
  100. extern int cdecl sosRealFree ( int );
  101. extern BOOL cdecl _sos_read( WORD, LPSTR, WORD, WORD * );
  102. extern int cdecl sosRealAlloc( int, int *, int * );
  103. extern void cdecl sosDRVFarMemCopy( LPSTR, LPSTR, WORD );
  104. extern int cdecl sosGetCS( VOID );
  105. extern int cdecl sosGetES( VOID );
  106. #else
  107. extern int cdecl sosRealAlloc ( int, int *, int * );
  108. extern int cdecl sosRealFree ( int );
  109. #endif
  110. // sos driver functions
  111. extern WORD cdecl sosDRVLockMemory ( DWORD, DWORD );
  112. extern WORD cdecl sosDRVUnLockMemory ( DWORD, DWORD );
  113. extern void cdecl sosDRVGetCapsInfo ( LPSTR, LPSTR, _SOS_CAPABILITIES far * );
  114. extern void cdecl sosDetDRVGetCapsInfo ( LPSTR, LPSTR, _SOS_CAPABILITIES far * );
  115. extern void cdecl sosDRVGetCapsPtr ( LPSTR, LPSTR, _SOS_CAPABILITIES far * );
  116. extern void cdecl sosDRVInit ( LPSTR, LPSTR, int, int, int, int, int, int );
  117. extern void cdecl sosDRVStart ( LPSTR, LPSTR, int, int );
  118. extern void cdecl sosDRVSetRate ( LPSTR, LPSTR, int );
  119. extern void cdecl sosDRVSetAction ( LPSTR, LPSTR );
  120. extern void cdecl sosDRVStop ( LPSTR, LPSTR );
  121. extern void cdecl sosDRVUnInit ( LPSTR, LPSTR );
  122. extern void cdecl sosDRVGetFillInfo ( LPSTR, LPSTR, LPSTR, int, int, int, _SOS_FILL_INFO * );
  123. extern void cdecl sosFillSampleStructs ( PSTR, LPSTR );
  124. extern WORD cdecl sosDetDRVExist ( LPSTR, LPSTR );
  125. extern WORD cdecl sosDetDRVGetSettings ( LPSTR, LPSTR );
  126. extern WORD cdecl sosDetDRVVerifySettings( LPSTR, WORD, WORD, WORD, LPSTR );
  127. extern WORD cdecl sosDIGIInitForWindows( WORD );
  128. extern WORD cdecl sosDIGIUnInitForWindows( WORD );
  129. extern LPSTR cdecl sosAllocateFarMem ( WORD, PSTR, WORD * );
  130. extern LPSTR cdecl sosCreateAliasCS ( LPSTR );
  131. extern VOID cdecl sosFreeSelector ( LPSTR, DWORD );
  132. extern LPSTR cdecl sosMAKEDOSPtr ( PSTR );
  133. extern VOID cdecl sosDetDRVSetEnvString ( DWORD, PSTR );
  134. extern PSTR cdecl sosDetDRVGetEnvString ( DWORD );
  135. extern VOID cdecl sosDetDRVEnvStringInit ( LPSTR, LPSTR );
  136. extern VOID cdecl sosDRVSetupCallFunctions( LPSTR, LPSTR, LPSTR, LPSTR );
  137. extern WORD cdecl sosDRVGetFreeMemory ( VOID );
  138. extern WORD cdecl sosDRVAllocVDSStruct ( WORD, WORD *, WORD * );
  139. extern WORD cdecl sosDRVFreeVDSStruct ( WORD, WORD );
  140. extern WORD cdecl sosDRVIsWindowsActive ( VOID );
  141. extern WORD cdecl sosDRVVDSGetBuffer ( WORD );
  142. extern WORD cdecl sosDRVVDSFreeBuffer ( WORD );
  143. extern WORD cdecl getDS( VOID );
  144. extern WORD cdecl sosDRVMakeDMASelector ( WORD );
  145. extern WORD cdecl sosDRVFreeDMASelector ( WORD );
  146. extern void cdecl sosTIMERDRVInit( int wRate, void ( far * )( void ) );
  147. extern void cdecl sosTIMERDRVUnInit( void );
  148. extern void cdecl sosTIMERDRVHandler( void );
  149. extern void cdecl sosTIMERDRVFHandler( void );
  150. extern void cdecl sosTIMERDRVEnable( void );
  151. extern void cdecl sosTIMERDRVDisable( void );
  152. extern void cdecl sosTIMERDRVCallOld( void );
  153. extern void cdecl sosTIMERDRVSetRate( WORD );
  154. extern void cdecl sosDIGITimer_Start( void );
  155. extern void cdecl sosDIGITimer_End( void );
  156. extern void cdecl sosDIGIDrv_Start( void );
  157. extern void cdecl sosDIGIDrv_End( void );
  158. #ifdef __cplusplus
  159. }
  160. #endif
  161. // external functions for handling system initialization and
  162. // uninitialization
  163. WORD sosEXDIGInitDriver ( WORD, WORD, WORD, LPSTR,
  164. _SOS_HARDWARE far *, WORD * );
  165. WORD sosEXDIGIUnInitDriver ( VOID );
  166. WORD sosEXDETFindDriver ( WORD, LPSTR, _SOS_HARDWARE far *,
  167. _SOS_CAPABILITIES far * );
  168. // memory locking prototypes
  169. VOID sosDIGICaps_Start( VOID );
  170. VOID sosDIGICaps_End( VOID );
  171. VOID sosDIGIErr_Start( VOID );
  172. VOID sosDIGIErr_End( VOID );
  173. VOID sosDIGITmr_Start( VOID );
  174. VOID sosDIGITmr_End( VOID );
  175. VOID sosDIGIStart_Start( VOID );
  176. VOID sosDIGIStart_End( VOID );
  177. VOID sosDIGIPlyng_Start( VOID );
  178. VOID sosDIGIPlyng_End( VOID );
  179. VOID sosDIGIRate_Start( VOID );
  180. VOID sosDIGIRate_End( VOID );
  181. VOID sosDIGIDone_Start( VOID );
  182. VOID sosDIGIDone_End( VOID );
  183. VOID sosDIGIDetec_Start( VOID );
  184. VOID sosDIGIDetec_End( VOID );
  185. VOID sosDIGIInit_Start( VOID );
  186. VOID sosDIGIInit_End( VOID );
  187. VOID sosDIGILoad_Start( VOID );
  188. VOID sosDIGILoad_End( VOID );
  189. VOID sosDIGICntl_Start( VOID );
  190. VOID sosDIGICntl_End( VOID );
  191. #pragma pack()
  192. #endif