|
|
1.1 root 1: /****************************************************************************
2:
3: File : sos.h
4:
5: Programmer(s) : Don Fowler, Nick Skrepetos
6: Date :
7:
8: Purpose : Include Files For Zortech C++ Compiler
9:
10: Last Updated :
11:
12: ****************************************************************************
13: Copyright(c) 1993,1994 Human Machine Interfaces
14: All Rights Reserved
15: ****************************************************************************/
16:
17: #ifndef _SOS_DEFINED
18: #define _SOS_DEFINED
19:
20: //
21: // #include "sosdefs.h"
22: //
23: /****************************************************************************
24:
25: File : sosdefs.h
26:
27: Programmer(s) : Don Fowler, Nick Skrepetos
28: Date :
29:
30: Purpose : Include Files For Zortech C++ Compiler
31:
32: Last Updated :
33:
34: ****************************************************************************
35: Copyright(c) 1993,1994 Human Machine Interfaces
36: All Rights Reserved
37: ****************************************************************************/
38:
39:
40: #ifndef _SOSDEFS_DEFINED
41: #define _SOSDEFS_DEFINED
42:
43: #undef _TRUE
44: #undef _FALSE
45: #undef _NULL
46: enum
47: {
48: _FALSE,
49: _TRUE
50: };
51:
52: #define _NULL 0
53:
54: #ifndef VOID
55: #define VOID void
56: #endif
57: typedef int BOOL;
58: typedef unsigned int UINT;
59: typedef unsigned char BYTE;
60: typedef unsigned WORD;
61: #ifndef LONG
62: typedef signed long LONG;
63: #endif
64: typedef unsigned long DWORD;
65:
66: typedef BYTE * PBYTE;
67: typedef char near * PSTR;
68: typedef WORD * PWORD;
69: typedef LONG * PLONG;
70: typedef VOID * PVOID;
71:
72: typedef BYTE far * LPBYTE;
73: typedef BYTE far * LPSTR;
74: typedef WORD far * LPWORD;
75: typedef LONG far * LPLONG;
76: typedef VOID far * LPVOID;
77:
78: typedef BYTE huge * HPBYTE;
79: typedef BYTE huge * HPSTR;
80: typedef WORD huge * HPWORD;
81: typedef LONG huge * HPLONG;
82: typedef VOID huge * HPVOID;
83:
84: typedef unsigned HANDLE;
85:
86: #endif
87:
88:
89:
90: #pragma pack(4)
91:
92: // error definition for sound operating system
93: #define _SOS_ERR -1
94:
95: // number of drivers allowed to be open at one time
96: #define _SOS_MAX_DRIVERS 5
97:
98: // structure definition for the capabilities
99: typedef struct _tagCAPABILITIES
100: {
101: BYTE szDeviceName[ 32 ]; // device name
102: WORD wDeviceVersion; // device version
103: WORD wBitsPerSample; // bits per sound sample
104: WORD wChannels; // stereo/mono sound card
105: WORD wMinRate; // minimum rate
106: WORD wMaxRate; // maximum rate
107: WORD wMixerOnBoard; // board contains mixer
108: WORD wMixerFlags; // mixer capabilities
109: WORD wFlags; // miscellaneous flags
110: short far * lpPortList; // list of usable ports
111: short far * lpDMAList; // list of usable dma channels
112: short far * lpIRQList; // list of usable irq channels
113: short far * lpRateList; // list of usable rates, -1 if any in min to max
114: WORD fBackground; // foreground or background driver
115: WORD wDeviceID; // ID for the device
116: WORD wTimerID; // ID for the timer
117:
118: } _SOS_CAPABILITIES;
119:
120: // far pointer to the device capabilities structure
121: typedef _SOS_CAPABILITIES far * LPSOSDEVICECAPS;
122:
123: // flag types for driver
124: #define _FLAGS_SIGNED 0x8000
125:
126: // devices that can be loaded
127: #define _SOUND_BLASTER_8_MONO 0xe000
128: #define _SOUND_BLASTER_8_ST 0xe001
129: #define _SBPRO_8_ST _SOUND_BLASTER_8_ST
130: #define _SBPRO_8_MONO 0xe00f
131: #define _SOUND_MASTER_II_8_MONO 0xe002
132: #define _MV_PAS_8_MONO 0xe003
133: #define _MV_PAS_16_MONO 0xe004
134: #define _MV_PAS_8_ST 0xe005
135: #define _MV_PAS_16_ST 0xe006
136: #define _ADLIB_GOLD_8_ST 0xe007
137: #define _ADLIB_GOLD_16_ST 0xe008
138: #define _ADLIB_GOLD_8_MONO 0xe009
139: #define _ADLIB_GOLD_16_MONO 0xe00a
140: #define _MICROSOFT_8_MONO 0xe00b
141: #define _MICROSOFT_8_ST 0xe00c
142: #define _MICROSOFT_16_MONO 0xe00d
143: #define _MICROSOFT_16_ST 0xe00e
144: #define _SOUND_SOURCE_8_MONO_PC 0xe010
145: #define _SOUND_SOURCE_8_MONO_TANDY 0xe011
146: #define _GENERAL_PORT_8_MONO 0xe012
147: #define _GENERAL_PORT_8_MONO_R 0xe013
148: #define _SIERRA_8_MONO 0xe014
149: #define _SB16_8_MONO 0xe015
150: #define _SB16_8_ST 0xe016
151: #define _SB16_16_MONO 0xe017
152: #define _SB16_16_ST 0xe018
153: #define _ESS_AUDIODRIVE_8_MONO 0xe019
154: #define _ESS_AUDIODRIVE_8_ST 0xe01a
155: #define _ESS_AUDIODRIVE_16_MONO 0xe01b
156: #define _ESS_AUDIODRIVE_16_ST 0xe01c
157: #define _SOUNDSCAPE_8_MONO 0xe01d
158: #define _SOUNDSCAPE_8_ST 0xe01e
159: #define _SOUNDSCAPE_16_MONO 0xe01f
160: #define _SOUNDSCAPE_16_ST 0xe020
161: #define _RAP10_8_MONO 0xe021
162: #define _RAP10_16_MONO 0xe022
163: #define _GUS_8_MONO 0xe023
164: #define _GUS_8_ST 0xe024
165: #define _GUS_16_MONO 0xe025
166: #define _GUS_16_ST 0xe026
167: #define _GUS_MAX_8_MONO 0xe027
168: #define _GUS_MAX_8_ST 0xe028
169: #define _GUS_MAX_16_MONO 0xe029
170: #define _GUS_MAX_16_ST 0xe02a
171: #define _WAVEJAMMER_8_MONO 0xe02b
172: #define _WAVEJAMMER_8_ST 0xe02c
173: #define _WAVEJAMMER_16_MONO 0xe02d
174: #define _WAVEJAMMER_16_ST 0xe02e
175: #define _TEMPOCS_8_MONO 0xe02f
176: #define _TEMPOCS_8_ST 0xe030
177: #define _TEMPOCS_16_MONO 0xe031
178: #define _TEMPOCS_16_ST 0xe032
179: #define _WAVEJAMMERCD_8_MONO 0xe033
180: #define _WAVEJAMMERCD_8_ST 0xe034
181: #define _WAVEJAMMERCD_16_MONO 0xe035
182: #define _WAVEJAMMERCD_16_ST 0xe036
183: #define _SOUND_BLASTER_8_MONO_R 0xe050
184: #define _MICROSOFT_8_MONO_R 0xe051
185: #define _SOUND_MASTER_II_8_MONO_R 0xe052
186: #define _ADLIB_GOLD_8_MONO_R 0xe053
187: #define _MV_PAS_8_MONO_R 0xe054
188: #define _RAP10_8_MONO_R 0xe058
189: #define _RAP10_16_MONO_R 0xe059
190: #define _SB16_8_MONO_R 0xe05a
191: #define _SB16_8_ST_R 0xe05b
192: #define _SB16_16_MONO_R 0xe05c
193: #define _SB16_16_ST_R 0xe05d
194: #define _MV_PAS_16_MONO_R 0xe060
195: #define _SOUNDSCAPE_8_MONO_R 0xe061
196: #define _SOUNDSCAPE_8_ST_R 0xe062
197: #define _SOUNDSCAPE_16_MONO_R 0xe063
198: #define _SOUNDSCAPE_16_ST_R 0xe064
199: #define _ESS_AUDIODRIVE_8_MONO_R 0xe065
200: #define _ESS_AUDIODRIVE_8_ST_R 0xe066
201: #define _ESS_AUDIODRIVE_16_MONO_R 0xe067
202: #define _ESS_AUDIODRIVE_16_ST_R 0xe068
203: #define _SPEECH_THING_8_MONO 0xe090
204: #define _YAMAHA_8_MONO 0xe106
205: #define _INT_SPEAKER_8_MONO 0xe107
206:
207: // call indexes for the loadable drivers
208: enum
209: {
210: _DRV_INIT,
211: _DRV_UNINIT,
212: _DRV_SETRATE,
213: _DRV_SETACTION,
214: _DRV_START,
215: _DRV_STOP,
216: _DRV_PAUSE,
217: _DRV_RESUME,
218: _DRV_CAPABILITIES,
219: _DRV_PLAY_FOREGROUND,
220: _DRV_GET_FILL_INFO,
221: _DRV_GET_CALL_FUNCTIONS,
222: _DRV_SET_CALL_FUNCTIONS
223: };
224:
225: // fill info
226: typedef struct _tagFillInfo
227: {
228:
229: LPSTR lpFillHandler; // pointer to fill handler
230: LPWORD lpDMAFillCount; // pointer to dma count
231: LPSTR lpSampleList; // pointer to sample list
232: LPWORD lpDMAMasterVolume; // pointer to dma count
233:
234: } _SOS_FILL_INFO;
235:
236: // caps info structure
237: typedef struct _tagCapsInfo
238: {
239:
240: LPSTR lpPortList; // pointer to port list
241: LPSTR lpDMAList; // pointer to DMA list
242: LPSTR lpIRQList; // pointer to IRQ list
243: LPSTR lpRateList; // pointer to rate list
244:
245: } _SOS_CAPS_INFO;
246:
247: // maximum number of available voice
248: #define _MAX_VOICES 32
249:
250: // structure definition
251: typedef struct _tagSAMPLE
252: {
253: LPSTR samplePtr; // pointer to data buffer
254: LPSTR sampleData; // pointer to active data
255: LPSTR sampleLoopPtr; // pointer for loop back
256:
257: WORD sampleLength; // length of sample
258: WORD sampleIndex; // index into sample
259: WORD sampleLoopLength; // length of loop
260:
261: WORD sampleBytesLeft; // bytes left to play in sample
262:
263: WORD sampleLoopPoint; // byte count for loop point
264: WORD sampleLoopEndLength; // length of remaining chunk
265:
266: short sampleFlags; // control sample
267: short sampleVolume; // volume control
268: short sampleID; // sample ID
269:
270: short sampleChannel; // channel to play sample on
271: short sampleLoopCount; // loop count
272: short sampleLastFill; // last fill position
273: VOID ( far cdecl * sampleCallback )( WORD, WORD, WORD ); // callback function for sample
274:
275: WORD samplePitchAdd;
276: short samplePitchFraction;
277:
278: short samplePort; // port to use for non-dma digitized
279:
280: WORD sampleTotalBytes;
281: WORD sampleByteLength;
282:
283: short samplePanLocation;
284: short samplePanSpeed;
285: short samplePanDirection;
286: short samplePanStart;
287: short samplePanEnd;
288:
289: short sampleDelayBytes;
290: short sampleDelayRepeat;
291:
292: WORD sampleADPCMPredicted;
293: short sampleADPCMIndex;
294:
295: short sampleRootNoteMIDI;
296:
297: WORD sampleTemp1;
298:
299: } _SOS_SAMPLE;
300:
301: // enumeration for left or right channel
302: enum
303: {
304: _LEFT_CHANNEL,
305: _RIGHT_CHANNEL,
306: _CENTER_CHANNEL,
307: _INTERLEAVED
308: };
309:
310: // enumeration for foreground and background
311: enum
312: {
313: _FOREGROUND,
314: _BACKGROUND
315: };
316:
317: // defines for the sample flags
318: #define _ACTIVE 0x8000
319: #define _LOOPING 0x4000
320: #define _FIRST_TIME 0x2000
321: #define _PENDING_RELEASE 0x1000
322: #define _CONTINUE_BLOCK 0x0800
323: #define _PITCH_SHIFT 0x0400
324: #define _PANNING 0x0200
325: #define _VOLUME 0x0100
326: #define _TRANSLATE16TO8 0x0080
327: #define _STAGE_LOOP 0x0040
328: #define _TRANSLATE8TO16 0x0020
329: #define _STEREOTOMONO 0x0010
330:
331: // defines for the wParam flags
332: #define _SINGLE_SAMPLE 0x01
333:
334: #define _SOS_DCAPS_AUTO_REINIT 0x01
335: #define _SOS_DCAPS_MPU_401 0x02
336: #define _SOS_DCAPS_OPL2 0x04
337: #define _SOS_DCAPS_OPL3 0x08
338: #define _SOS_DCAPS_OPL4 0x10
339: #define _SOS_DCAPS_WAVETABLE 0x20
340: #define _SOS_DCAPS_DL_SAMPLES 0x40
341: #define _SOS_DCAPS_FIFO_DEVICE 0x80
342: #define _SOS_DCAPS_ENV_NEEDED 0x100
343: #define _SOS_DCAPS_PSEUDO_DMA1 0x200
344: #define _SOS_DCAPS_SIGNED_DATA 0x8000
345:
346: // file header structure
347: typedef struct
348: {
349: // name ID
350: BYTE szName[ 32 ];
351:
352: // number of drivers in the file
353: WORD wDrivers;
354:
355: // offset of first driver
356: WORD lOffset;
357:
358: // size of the file
359: WORD lFileSize;
360:
361: } _FILEHEADER;
362:
363: // driver header structure
364: typedef struct
365: {
366: // name ID
367: BYTE szName[ 32 ];
368:
369: // offset of next driver
370: WORD lNextDriver;
371:
372: // size of current driver
373: WORD wSize;
374:
375: // id for the current device
376: WORD wDeviceID;
377:
378: // id for the type of DOS extender
379: WORD wExtenderType;
380:
381: } _DRIVERHEADER;
382:
383: // device hardware information
384: typedef struct
385: {
386: // port to be used
387: WORD wPort;
388:
389: // irq to use
390: WORD wIRQ;
391:
392: // dma channel to se
393: WORD wDMA;
394:
395: // extra parameter
396: WORD wParam;
397:
398: } _SOS_HARDWARE;
399:
400: // structure definition for start sample
401: typedef struct
402: {
403: // pointer to sample
404: LPSTR lpSamplePtr;
405:
406: // size of the sample
407: WORD dwSampleSize;
408:
409: // number of times to loop the sample -1 is infinite
410: WORD wLoopCount;
411:
412: // channel to play sample on
413: WORD wChannel;
414:
415: // volume to play sample at
416: WORD wVolume;
417:
418: // id for the sample
419: WORD wSampleID;
420:
421: // far pointer to the callback function
422: VOID ( far cdecl *lpCallback )( WORD, WORD, WORD );
423:
424: // port to use if driver is a non-dma background driver
425: WORD wSamplePort;
426:
427: // flags field
428: WORD wSampleFlags;
429:
430: // total length of sample including loops, etc..
431: WORD dwSampleByteLength;
432:
433: // loop point for the sample
434: WORD dwSampleLoopPoint;
435: WORD dwSampleLoopLength;
436:
437: // pitch shifting components
438: WORD dwSamplePitchAdd;
439: WORD wSamplePitchFraction;
440:
441: // pan components
442: WORD wSamplePanLocation;
443: WORD wSamplePanSpeed;
444: WORD wSamplePanDirection;
445: WORD wSamplePanStart;
446: WORD wSamplePanEnd;
447:
448: // delay parts
449: WORD wSampleDelayBytes;
450: WORD wSampleDelayRepeat;
451:
452: // compression components
453: WORD dwSampleADPCMPredicted;
454: WORD wSampleADPCMIndex;
455:
456: // root note for pitch shifting
457: WORD wSampleRootNoteMIDI;
458:
459: // filler for future upgrades
460: WORD dwSampleTemp1;
461: WORD dwSampleTemp2;
462: WORD dwSampleTemp3;
463:
464: } _SOS_START_SAMPLE;
465:
466: // structure for initializing a driver
467: typedef struct
468: {
469: WORD wBufferSize;
470: LPSTR lpBuffer;
471: BOOL wAllocateBuffer;
472: WORD wSampleRate;
473: WORD wParam;
474: LONG dwParam;
475: VOID ( far *lpFillHandler )( VOID );
476: LPSTR lpDriverMemory;
477: LPSTR lpDriverMemoryCS;
478: LPSTR lpTimerMemory;
479: LPSTR lpTimerMemoryCS;
480: WORD wTimerID;
481: WORD wPhysical;
482:
483: } _SOS_INIT_DRIVER;
484:
485: // define for the timer types to use
486: #define _SOS_NORMAL_TIMER 0x00
487:
488: // enumeration for the timer types
489: enum
490: {
491: _TIMER_8_MONO = 0x1000,
492: _TIMER_8_ST,
493: _TIMER_16_MONO,
494: _TIMER_16_ST,
495: _TIMER_8_MONO_ULAW,
496: _TIMER_8_ST_ULAW,
497: _TIMER_16_MONO_ULAW,
498: _TIMER_16_ST_ULAW,
499: _TIMER_8_MONO_REC,
500: _TIMER_8_MONO_ULAW_REC,
501: _TIMER_UNDEFINED_1,
502: _TIMER_UNDEFINED_2,
503: _TIMER_UNDEFINED_3,
504: _TIMER_UNDEFINED_4,
505: _TIMER_UNDEFINED_5,
506: _TIMER_UNDEFINED_6,
507: _TIMER_UNDEFINED_7,
508: _TIMER_UNDEFINED_8,
509: _TIMER_UNDEFINED_9,
510: _TIMER_UNDEFINED_A,
511: _TIMER_UNDEFINED_B,
512: _TIMER_UNDEFINED_C,
513: _TIMER_UNDEFINED_D,
514: _TIMER_UNDEFINED_E,
515: _TIMER_UNDEFINED_F,
516: _TIMER_UNDEFINED_10,
517: _TIMER_UNDEFINED_11,
518: _TIMER_UNDEFINED_12,
519: _TIMER_UNDEFINED_13,
520: _TIMER_UNDEFINED_14,
521: _TIMER_UNDEFINED_15,
522: _TIMER_UNDEFINED_16,
523: _TIMER_8_SOUND_SOURCE,
524: _TIMER_8_SOUND_SOURCE_TANDY,
525: _TIMER_8_GENERAL_PORT,
526: _TIMER_8_GENERAL_PORT_REC
527: };
528:
529: // define for no slots available
530: #define _ERR_NO_SLOTS ( WORD )-1
531:
532: // error codes for the system
533: enum
534: {
535: _ERR_NO_ERROR,
536: _ERR_DRIVER_NOT_LOADED,
537: _ERR_INVALID_POINTER,
538: _ERR_DETECT_INITIALIZED,
539: _ERR_FAIL_ON_FILE_OPEN,
540: _ERR_MEMORY_FAIL,
541: _ERR_INVALID_DRIVER_ID,
542: _ERR_NO_DRIVER_FOUND,
543: _ERR_DETECTION_FAILURE,
544: _ERR_DRIVER_LOADED,
545: _ERR_INVALID_HANDLE,
546: _ERR_NO_HANDLES,
547: _ERR_PAUSED,
548: _ERR_NOT_PAUSED,
549: _ERR_INVALID_DATA,
550: _ERR_DRV_FILE_FAIL,
551: _ERR_INVALID_PORT,
552: _ERR_INVALID_IRQ,
553: _ERR_INVALID_DMA,
554: _ERR_INVALID_DMA_IRQ
555: };
556:
557: // maximum number of timer events that can be registered
558: #define _TIMER_MAX_EVENTS 0x10
559:
560: // flags for the debugging system
561: #define _SOS_DEBUG_NORMAL 0x0000
562: #define _SOS_DEBUG_NO_TIMER 0x0001
563: #define _SOS_TIMER_DPMI 0x0002
564:
565: // define for types of DOS extenders
566: #define _SOS_RATIONAL 0x8000
567: #define _SOS_FLASHTECK 0x4000
568:
569: // defines for the types of timers for different
570: // dos extenders
571: #define _SOS_TIMER_NEAR 0x8000
572: #define _SOS_TIMER_FAR 0x4000
573:
574: // values for callback information
575: enum
576: {
577: _SAMPLE_PROCESSED,
578: _SAMPLE_LOOPING,
579: _SAMPLE_DONE
580: };
581:
582: // define for special 18.2 callback rate to dos
583: #define _TIMER_DOS_RATE 0xff00
584:
585: #pragma pack()
586:
587: #pragma aux int_3 = "int 3"
588:
589: #pragma pack( 1 )
590: typedef struct
591: {
592: unsigned region_size;
593: unsigned offset;
594: unsigned segment;
595: unsigned short number_available;
596: unsigned short number_used;
597: unsigned page0;
598:
599: } EVDS_STRUCT;
600:
601: typedef struct
602: {
603: unsigned region_size;
604: unsigned offset;
605: unsigned short segment;
606: unsigned short ID;
607: unsigned physical;
608:
609: } VDS_STRUCT;
610:
611: #pragma pack()
612:
613: //
614: // #include "sosdata.h"
615: //
616: /****************************************************************************
617:
618: File : sosdata.h
619:
620: Programmer(s) : Don Fowler, Nick Skrepetos
621: Date :
622:
623: Purpose : Include Files For Zortech C++ Compiler
624:
625: Last Updated :
626:
627: ****************************************************************************
628: Copyright(c) 1993,1994 Human Machine Interfaces
629: All Rights Reserved
630: ****************************************************************************/
631:
632: #ifndef _SOS_DATA
633: #define _SOS_DATA
634:
635: #include <stddef.h>
636:
637: #pragma pack(4)
638: extern WORD _sosDIGIData_Start;
639: extern WORD _sosDIGIData_End;
640: extern WORD _wSOSDriverLinear[];
641: extern WORD _wSOSTimerLinear[];
642: extern LPSTR _lpSOSDriver[];
643: extern LPSTR _lpSOSTimer[];
644: extern LPSTR _lpSOSDriverCS[];
645: extern LPSTR _lpSOSTimerCS[];
646: extern BOOL _wSOSDriverLoaded[];
647: extern BOOL _wSOSTimerLoaded[];
648: extern BOOL _wSOSDriverInitialized[];
649: extern WORD _wSOSOutputRate[];
650: extern WORD _wSOSDMABuffersize[];
651: extern LONG _dwSOSDMABufferPhysical[];
652: extern LPSTR _lpSOSDMABuffer[];
653: extern BOOL _wTimerUsed;
654: extern VOID ( far *_lpSOSFillHandler[] )( VOID );
655: extern WORD _wSOSTimerType[];
656: extern WORD _wSOSDriverType[];
657: extern _SOS_SAMPLE far * _lpSOSSampleList[][ _MAX_VOICES ];
658: extern LPWORD _lpSOSDMAIrqCount[];
659: extern LPWORD _lpSOSDMAFillCount[];
660: extern WORD _wSOSTmrNextCount;
661: extern VOID ( interrupt far *_lpSOSOldTimer )( VOID );
662: extern WORD _wSOSDriverID[];
663: extern _SOS_CAPABILITIES _sSOSDriverCaps[];
664: extern WORD _wSOSDMAPortList[];
665: extern BYTE _bSOSDMAChannel[];
666: extern _SOS_INIT_DRIVER _sSOSDIGIInitDriver[];
667: extern BYTE _pSOSDriverPath[];
668: extern BYTE _pSOSTempDriverPath[];
669: extern BOOL _wTIMERUsed;
670: extern WORD _wTIMERValue;
671: extern VOID ( far * _lpTIMEREvents[] )( VOID );
672: extern WORD _wTIMEREventRate[];
673: extern WORD _dwTIMEREventFraction[];
674: extern WORD _dwTIMEREventFractionCurrent[];
675: extern BYTE _bSOSMIDITimerSongHandler[];
676: extern BYTE _bSOSMIDISongHandle;
677: extern WORD _wSOSTimerMemHandle[];
678: extern WORD _wSOSDriverMemHandle[];
679: extern WORD _wSOSRealSeg[];
680:
681: extern _FILEHEADER _sDETFileHeader;
682: extern _DRIVERHEADER _sDETDriverHeader;
683: extern _FILEHEADER sLOADFileHeader;
684: extern _DRIVERHEADER sLOADDriverHeader;
685: extern BOOL _wDETInitialized;
686: extern WORD _wDETLinear;
687: extern LPSTR _lpDETDriverBuffer;
688: extern LPSTR _lpDETDriverBufferCS;
689: extern WORD _hDETFile;
690: extern DWORD _dwDETDriverIndex;
691: extern WORD _wDETDriverIndexCur;
692: extern WORD _wDETMemHandle;
693: extern LPSOSDEVICECAPS _lpDETDeviceCaps;
694: extern _SOS_CAPABILITIES _sDETCaps;
695: extern PSTR _pSOSErrorStrings[];
696: extern BOOL _wSOSBufferAllocated[];
697: extern BOOL _wSOSSystemInitialized;
698: extern VDS_STRUCT _sSOSVDSInfo;
699: extern _SOS_FILL_INFO _sSOSFillInfo;
700: extern WORD _wSOSTimerEventIndex;
701: extern WORD _wSOSTimerEntered;
702: extern WORD _wSOSDriverSize[];
703: extern WORD _wSOSTimerSize[];
704:
705: #ifdef __cplusplus
706: extern "C" {
707: #endif
708: extern WORD _sosDIGIData1_Start;
709: extern WORD _sosDIGIData1_End;
710: extern WORD _sosDIGIData2_Start;
711: extern WORD _sosDIGIData2_End;
712: extern BYTE _bTIMERInstalled;
713: extern BYTE _bTIMERDPMI;
714: extern WORD wDetectPort;
715: extern WORD wDetectIRQ;
716: extern WORD wDetectDMA;
717: extern WORD wDetectParam;
718: #ifdef __cplusplus
719: }
720: #endif
721:
722: #pragma pack()
723:
724: #endif
725:
726:
727: //
728: // #include "sosfnct.h"
729: //
730: /****************************************************************************
731:
732: File : sosfnct.h
733:
734: Programmer(s) : Don Fowler, Nick Skrepetos
735: Date :
736:
737: Purpose : Include Files For Zortech C++ Compiler
738:
739: Last Updated :
740:
741: ****************************************************************************
742: Copyright(c) 1993,1994 Human Machine Interfaces
743: All Rights Reserved
744: ****************************************************************************/
745:
746: #ifndef _SOS_FUNCTIONS
747: #define _SOS_FUNCTIONS
748:
749: #pragma pack(4)
750:
751: WORD sosDIGILockMemory ( VOID );
752: WORD sosDIGIUnLockMemory ( VOID );
753: WORD sosDIGIInitSystem ( LPSTR, WORD );
754: WORD sosDIGIUnInitSystem ( VOID );
755: WORD sosDIGIInitDriver ( WORD, _SOS_HARDWARE far *,
756: _SOS_INIT_DRIVER far *, WORD far * );
757: WORD sosDIGIUnInitDriver ( WORD, BOOL, BOOL );
758: WORD sosDIGILoadDriver ( WORD, WORD, LPSTR far *, LPSTR far *, PSTR, PSTR, WORD * );
759: WORD sosDIGIUnLoadDriver ( WORD );
760: WORD sosDIGIGetDeviceCaps ( WORD, LPSOSDEVICECAPS );
761:
762: #ifdef PHARLAP
763: LPSTR sosDIGIAllocateBuffer ( WORD , WORD *, WORD * );
764: #else
765: LPSTR sosDIGIAllocateBuffer ( WORD , WORD *, WORD * );
766: #endif
767:
768: WORD sosDIGIStopSample ( WORD, WORD );
769: WORD sosDIGISamplesPlaying ( WORD );
770: BOOL sosDIGISampleDone ( WORD, WORD );
771: BOOL sosDIGISampleFilling ( WORD, WORD );
772: WORD sosDIGIStartSample ( WORD, _SOS_START_SAMPLE far * );
773: WORD sosDIGIContinueSample ( WORD, WORD, _SOS_START_SAMPLE far * );
774:
775:
776: WORD sosDIGIDetectInit ( LPSTR );
777: WORD sosDIGIDetectUnInit ( VOID );
778: WORD sosDIGIDetectFindHardware ( WORD, _SOS_CAPABILITIES far *, WORD far * );
779: WORD sosDIGIDetectFindFirst ( _SOS_CAPABILITIES far *, WORD far * );
780: WORD sosDIGIDetectFindNext ( _SOS_CAPABILITIES far *, WORD far * );
781: WORD sosDIGIDetectGetSettings ( _SOS_HARDWARE far * );
782: WORD sosDIGIDetectGetCaps ( WORD, _SOS_CAPABILITIES far * );
783: WORD sosDIGIDetectVerifySettings( _SOS_HARDWARE far * );
784: PSTR sosGetErrorString ( WORD );
785:
786: WORD sosDIGILoadTimer ( WORD , LPSTR far *, LPSTR far *, PSTR, PSTR, WORD * );
787: WORD sosDIGIUnLoadTimer ( WORD );
788:
789: WORD sosTIMERRegisterEvent ( WORD wCallRate, VOID ( far * lpTimerEvent )( VOID ), WORD far *lpTimerHandle );
790: WORD sosTIMERInitSystem ( WORD, WORD );
791: WORD sosTIMERUnInitSystem ( WORD );
792: WORD sosTIMERSetRate ( WORD );
793: WORD sosTIMERRemoveEvent ( WORD );
794: WORD sosTIMERAlterEventRate ( WORD, WORD );
795: WORD sosTIMERGetEventRate ( WORD );
796: VOID far sosTIMEROldHandler ( VOID );
797: VOID far sosTIMERHandler ( VOID );
798:
799: // functions in soscntl.c
800: WORD sosDIGISetSampleVolume ( WORD, WORD, WORD );
801: WORD sosDIGIGetSampleVolume ( WORD, WORD );
802: WORD sosDIGISetChannel ( WORD, WORD, WORD );
803: WORD sosDIGIGetChannel ( WORD, WORD );
804: WORD sosDIGIGetBytesProcessed ( WORD, WORD );
805: WORD sosDIGIGetLoopCount ( WORD, WORD );
806: WORD sosDIGISetPanLocation ( WORD, WORD, WORD );
807: WORD sosDIGIGetPanLocation ( WORD, WORD );
808: DWORD sosDIGISetPitch ( WORD, WORD, DWORD );
809: DWORD sosDIGIGetPitch ( WORD, WORD );
810: WORD sosDIGIGetDMAPosition ( WORD );
811: WORD sosDIGISetPanSpeed ( WORD, WORD, WORD );
812: WORD sosDIGIGetPanSpeed ( WORD, WORD );
813: WORD sosDIGIGetSampleID ( WORD, WORD );
814: WORD sosDIGIGetSampleHandle ( WORD, WORD );
815: WORD sosDIGISetMasterVolume ( WORD, WORD );
816: #ifdef PHARLAP
817: VOID sosFreeVDSPage ( unsigned short, unsigned short, DWORD );
818: WORD sosAllocVDSPage ( unsigned short *, unsigned short *, DWORD * );
819: #else
820: WORD sosAllocVDSPage ( LPSTR *, WORD *, WORD * );
821: VOID sosFreeVDSPage ( WORD, WORD, LONG );
822: #endif
823:
824: #ifdef __cplusplus
825: extern "C" {
826: #endif
827:
828: #ifdef PHARLAP
829: extern int cdecl sosRealFree ( int );
830: extern BOOL cdecl _sos_read( WORD, LPSTR, WORD, WORD * );
831: extern int cdecl sosRealAlloc( int, int *, int * );
832: extern void cdecl sosDRVFarMemCopy( LPSTR, LPSTR, WORD );
833: extern int cdecl sosGetCS( VOID );
834: extern int cdecl sosGetES( VOID );
835: #else
836: extern int cdecl sosRealAlloc ( int, int *, int * );
837: extern int cdecl sosRealFree ( int );
838: #endif
839:
840: // sos driver functions
841: extern WORD cdecl sosDRVLockMemory ( DWORD, DWORD );
842: extern WORD cdecl sosDRVUnLockMemory ( DWORD, DWORD );
843: extern void cdecl sosDRVGetCapsInfo ( LPSTR, LPSTR, _SOS_CAPABILITIES far * );
844: extern void cdecl sosDetDRVGetCapsInfo ( LPSTR, LPSTR, _SOS_CAPABILITIES far * );
845: extern void cdecl sosDRVGetCapsPtr ( LPSTR, LPSTR, _SOS_CAPABILITIES far * );
846: extern void cdecl sosDRVInit ( LPSTR, LPSTR, int, int, int, int, int, int );
847: extern void cdecl sosDRVStart ( LPSTR, LPSTR, int, int );
848: extern void cdecl sosDRVSetRate ( LPSTR, LPSTR, int );
849: extern void cdecl sosDRVSetAction ( LPSTR, LPSTR );
850: extern void cdecl sosDRVStop ( LPSTR, LPSTR );
851: extern void cdecl sosDRVUnInit ( LPSTR, LPSTR );
852: extern void cdecl sosDRVGetFillInfo ( LPSTR, LPSTR, LPSTR, int, int, int, _SOS_FILL_INFO * );
853: extern void cdecl sosFillSampleStructs ( PSTR, LPSTR );
854: extern WORD cdecl sosDetDRVExist ( LPSTR, LPSTR );
855: extern WORD cdecl sosDetDRVGetSettings ( LPSTR, LPSTR );
856: extern WORD cdecl sosDetDRVVerifySettings( LPSTR, WORD, WORD, WORD, LPSTR );
857: extern WORD cdecl sosDIGIInitForWindows( WORD );
858: extern WORD cdecl sosDIGIUnInitForWindows( WORD );
859: extern LPSTR cdecl sosAllocateFarMem ( WORD, PSTR, WORD * );
860: extern LPSTR cdecl sosCreateAliasCS ( LPSTR );
861: extern VOID cdecl sosFreeSelector ( LPSTR, DWORD );
862: extern LPSTR cdecl sosMAKEDOSPtr ( PSTR );
863: extern VOID cdecl sosDetDRVSetEnvString ( DWORD, PSTR );
864: extern PSTR cdecl sosDetDRVGetEnvString ( DWORD );
865: extern VOID cdecl sosDetDRVEnvStringInit ( LPSTR, LPSTR );
866: extern VOID cdecl sosDRVSetupCallFunctions( LPSTR, LPSTR, LPSTR, LPSTR );
867: extern WORD cdecl sosDRVGetFreeMemory ( VOID );
868: extern WORD cdecl sosDRVAllocVDSStruct ( WORD, WORD *, WORD * );
869: extern WORD cdecl sosDRVFreeVDSStruct ( WORD, WORD );
870: extern WORD cdecl sosDRVIsWindowsActive ( VOID );
871: extern WORD cdecl sosDRVVDSGetBuffer ( WORD );
872: extern WORD cdecl sosDRVVDSFreeBuffer ( WORD );
873: extern WORD cdecl getDS( VOID );
874: extern WORD cdecl sosDRVMakeDMASelector ( WORD );
875: extern WORD cdecl sosDRVFreeDMASelector ( WORD );
876:
877:
878: extern void cdecl sosTIMERDRVInit( int wRate, void ( far * )( void ) );
879: extern void cdecl sosTIMERDRVUnInit( void );
880: extern void cdecl sosTIMERDRVHandler( void );
881: extern void cdecl sosTIMERDRVFHandler( void );
882: extern void cdecl sosTIMERDRVEnable( void );
883: extern void cdecl sosTIMERDRVDisable( void );
884: extern void cdecl sosTIMERDRVCallOld( void );
885: extern void cdecl sosTIMERDRVSetRate( WORD );
886: extern void cdecl sosDIGITimer_Start( void );
887: extern void cdecl sosDIGITimer_End( void );
888: extern void cdecl sosDIGIDrv_Start( void );
889: extern void cdecl sosDIGIDrv_End( void );
890: #ifdef __cplusplus
891: }
892: #endif
893:
894: // external functions for handling system initialization and
895: // uninitialization
896: WORD sosEXDIGInitDriver ( WORD, WORD, WORD, LPSTR,
897: _SOS_HARDWARE far *, WORD * );
898: WORD sosEXDIGIUnInitDriver ( VOID );
899:
900: WORD sosEXDETFindDriver ( WORD, LPSTR, _SOS_HARDWARE far *,
901: _SOS_CAPABILITIES far * );
902:
903: // memory locking prototypes
904: VOID sosDIGICaps_Start( VOID );
905: VOID sosDIGICaps_End( VOID );
906: VOID sosDIGIErr_Start( VOID );
907: VOID sosDIGIErr_End( VOID );
908: VOID sosDIGITmr_Start( VOID );
909: VOID sosDIGITmr_End( VOID );
910: VOID sosDIGIStart_Start( VOID );
911: VOID sosDIGIStart_End( VOID );
912: VOID sosDIGIPlyng_Start( VOID );
913: VOID sosDIGIPlyng_End( VOID );
914: VOID sosDIGIRate_Start( VOID );
915: VOID sosDIGIRate_End( VOID );
916: VOID sosDIGIDone_Start( VOID );
917: VOID sosDIGIDone_End( VOID );
918: VOID sosDIGIDetec_Start( VOID );
919: VOID sosDIGIDetec_End( VOID );
920: VOID sosDIGIInit_Start( VOID );
921: VOID sosDIGIInit_End( VOID );
922: VOID sosDIGILoad_Start( VOID );
923: VOID sosDIGILoad_End( VOID );
924: VOID sosDIGICntl_Start( VOID );
925: VOID sosDIGICntl_End( VOID );
926:
927: #pragma pack()
928:
929: #endif
930:
931:
932: #endif
933:
934:
935:
936: //
937: // include sosm.h and its includes so just call
938: // sos.h from teksnd.c
939: //
940: /****************************************************************************
941:
942: File : sosm.h
943:
944: Programmer(s) : Don Fowler, Nick Skrepetos
945: Date :
946:
947: Purpose : Include Files For Zortech C++ Compiler
948:
949: Last Updated :
950:
951: ****************************************************************************
952: Copyright(c) 1993,1994 Human Machine Interfaces
953: All Rights Reserved
954: ****************************************************************************/
955:
956: #ifndef _SOS_MIDI_DEFINED
957: #define _SOS_MIDI_DEFINED
958:
959: //
960: //#include "sosdefs.h"
961: //#include "sos.h"
962: //
963:
964: #pragma pack(4)
965:
966: #define _SOS_MIDI_ERR -1
967:
968: // number of drivers allowed to be open at one time
969: #define _SOS_MIDI_MAX_DRIVERS 5
970:
971: // maximum number of allowed channels
972: #define _SOS_MIDI_MAX_CHANNELS 0x10
973:
974: // structure definition for the capabilities
975: typedef struct
976: {
977: BYTE szDeviceName[ 32 ]; // device name
978: WORD wDeviceVersion; // device version
979: WORD wFlags; // miscellaneous flags
980: WORD wProcessData; // process data before sending to driver
981: short far * lpPortList; // list of usable ports
982: short far * lpIRQList; // list of usable irq channels
983: WORD wDeviceID; // ID for the device
984:
985: } _SOS_MIDI_CAPABILITIES;
986:
987: #define LPSOSMIDIDEVICECAPS _SOS_MIDI_CAPABILITIES far *
988:
989: // call indexes for the loadable drivers
990: enum
991: {
992: _DRV_MIDI_GET_CAPS,
993: _DRV_MIDI_GET_CALL_TABLE,
994: _DRV_MIDI_SPECIAL1
995: };
996:
997: // file header for the driver
998: typedef struct
999: {
1000: // name ID
1001: BYTE szName[ 32 ];
1002:
1003: // number of drivers in the file
1004: WORD wDrivers;
1005:
1006: // offset of first driver
1007: WORD lOffset;
1008:
1009: // size of the file
1010: WORD lFileSize;
1011:
1012: } _MIDIFILEHEADER;
1013:
1014: // driver header structure
1015: typedef struct
1016: {
1017: // name ID
1018: BYTE szName[ 32 ];
1019:
1020: // offset of next driver
1021: WORD lNextDriver;
1022:
1023: // size of current driver
1024: WORD wSize;
1025:
1026: // id for the current device
1027: WORD wDeviceID;
1028:
1029: // id for the extender type
1030: WORD wExtenderType;
1031:
1032: } _MIDIDRIVERHEADER;
1033:
1034: // device hardware information
1035: typedef struct
1036: {
1037: // port to be used
1038: WORD wPort;
1039:
1040: // IRQ for the board
1041: WORD wIRQ;
1042:
1043: // extra parameter
1044: WORD wParam;
1045:
1046: } _SOS_MIDI_HARDWARE;
1047:
1048: // structure for initializing a digital driver
1049: typedef struct
1050: {
1051: // ID for the digital driver
1052: WORD wDriverID;
1053:
1054: // timer rate to use
1055: WORD wTimerRate;
1056:
1057: // timer callback rate to use
1058: WORD wTimerCallbackRate;
1059:
1060: // max voices for the driver to use
1061: WORD wMaxVoices;
1062:
1063: // velocity sensing flag
1064: WORD wVelocitySensing;
1065:
1066: // init driver info
1067: _SOS_INIT_DRIVER far * sDIGIDriverInfo;
1068:
1069: // hardware information
1070: _SOS_HARDWARE far * sDIGIHardwareInfo;
1071:
1072: } _SOS_MIDI_DIGI_INIT_DRIVER;
1073:
1074: // structure for initializing a driver
1075: typedef struct
1076: {
1077: // type of driver to use if using a digital driver
1078: WORD wDIGIDriverID;
1079:
1080: // pointer to driver memory
1081: VOID far * lpDriverMemory;
1082: VOID far * lpDriverMemoryCS;
1083:
1084: // pointer to digital driver initialization information
1085: _SOS_MIDI_DIGI_INIT_DRIVER far * sDIGIInitInfo;
1086:
1087: // miscellaneous WORD parameter for driver
1088: WORD wParam;
1089:
1090: // miscellaneous DWORD parameter for driver
1091: DWORD dwParam;
1092:
1093: } _SOS_MIDI_INIT_DRIVER;
1094:
1095: // structure for starting a song
1096: typedef struct
1097: {
1098: // pointer to song memory
1099: BYTE _huge * lpSongData;
1100:
1101: // pointer to callback function for pertinent song information
1102: VOID ( far * lpSongCallback )( WORD );
1103:
1104: } _SOS_MIDI_INIT_SONG;
1105:
1106: // define to indicate that track mapping can be used
1107: // from the midi file for the song
1108: #define _MIDI_MAP_TRACK 0xff
1109:
1110: // MIDI channel to device mapping structure
1111: typedef struct
1112: {
1113: // track to device mapping information
1114: WORD wTrackDevice[ 32 ];
1115:
1116: } _SOS_MIDI_TRACK_DEVICE;
1117:
1118: // MIDI channel to device mapping structure
1119: typedef struct
1120: {
1121: // track to device mapping information
1122: WORD wTrackDevice[ 32 ][ 5 ];
1123:
1124: } _SOS_MIDI_TRACK_DEVICE1;
1125:
1126: // NEW
1127: // header for the NDMF format MIDI file
1128: typedef struct
1129: {
1130: // ID for the file
1131: BYTE szFileID[ 32 ];
1132:
1133: WORD dwBranchOffset;
1134: WORD temp1;
1135: WORD temp2;
1136: WORD temp3;
1137:
1138: // // name of the instrument file to use with the song
1139: // BYTE szInstrumentFile[ 16 ];
1140:
1141: // number of tracks in the song
1142: WORD wNDMFTracks;
1143:
1144: // ticks/quarter note song is used at
1145: WORD wTicksQuarterNote;
1146:
1147: // tempo
1148: WORD wTempo;
1149:
1150: // time for song to play at current tempo
1151: WORD wTimeToPlay;
1152:
1153: // channel mapping priority information
1154: WORD wChannelPriority[ _SOS_MIDI_MAX_CHANNELS ];
1155:
1156: // channel mapping information
1157: _SOS_MIDI_TRACK_DEVICE1 sTrackMap;
1158:
1159: // array of flags for which controllers to restore on a loop/branch
1160: BYTE bCtrlRestore[ 128 ];
1161:
1162: // pointer to callback function for song to call with
1163: // pertinent information
1164: VOID ( far * lpSongCallback )( WORD );
1165:
1166: } _NDMF_FILE_HEADER;
1167: // END
1168:
1169: // header for the tracks in the NDMF format MIDI file
1170: typedef struct
1171: {
1172: // track number
1173: WORD wTrackNumber;
1174:
1175: // length of the track
1176: WORD wTrackLength;
1177:
1178: // channel used on the track
1179: WORD wChannel;
1180:
1181: } _NDMF_TRACK_HEADER;
1182:
1183: // MIDI event structure
1184: typedef struct
1185: {
1186: // dummy name to access midi data from
1187: BYTE bMidiData[ 256 ];
1188:
1189: } _NDMF_MIDI_EVENT;
1190:
1191: // maximum number of songs that can be played at any time
1192: #define _SOS_MIDI_MAX_SONGS 8
1193:
1194: // maximum number of tracks that can be used
1195: #define _SOS_MIDI_MAX_TRACKS 32
1196:
1197: // number of driver functions
1198: #define _SOS_MIDI_DRV_FUNCTIONS 12
1199:
1200: // enumeration for all of the drv functions
1201: enum
1202: {
1203: _MIDI_DRV_SEND_DATA,
1204: _MIDI_DRV_INIT,
1205: _MIDI_DRV_UNINIT,
1206: _MIDI_DRV_RESET,
1207: _MIDI_DRV_SET_INST_DATA
1208: };
1209:
1210: // defines for the loadable driver ids
1211: #define _MIDI_SOUND_MASTER_II 0xa000
1212: #define _MIDI_MPU_401 0xa001
1213: #define _MIDI_FM 0xa002
1214: #define _MIDI_OPL2 0xa002
1215: #define _MIDI_CALLBACK 0xa003
1216: #define _MIDI_MT_32 0xa004
1217: #define _MIDI_DIGI 0xa005
1218: #define _MIDI_INTERNAL_SPEAKER 0xa006
1219: #define _MIDI_WAVE_TABLE_SYNTH 0xa007
1220: #define _MIDI_AWE32 0xa008
1221: #define _MIDI_OPL3 0xa009
1222: #define _MIDI_GUS 0xa00a
1223:
1224: // structure for the hmi instrument file header
1225: typedef struct
1226: {
1227: // file id type
1228: BYTE szFileID[ 32 ];
1229:
1230: // file version
1231: WORD wFileVersion;
1232:
1233: // size of the file
1234: WORD dwFileSize;
1235:
1236: } _HMI_INS_FILE_HEADER;
1237:
1238:
1239: // define for identifying a drum instrument
1240: #define _SOS_MIDI_DRUM_INS ( short )0x8000
1241:
1242: // maximum number of timer events that can be registered
1243: #define _TIMER_MAX_EVENTS 0x10
1244:
1245: // structure for digital driver queue element
1246: typedef struct _tagQueueElement
1247: {
1248: // handle for the sample
1249: WORD wSampleHandle;
1250:
1251: // id for the sample
1252: WORD wSampleID;
1253:
1254: // velocity for the sample
1255: WORD wVelocity;
1256:
1257: // channel for the sample
1258: WORD wChannel;
1259:
1260: } _DIGI_QUEUE_ELEMENT;
1261:
1262: // maximum number of instruments that can be set in the
1263: // digital driver
1264: #define _MAX_INS 128
1265:
1266: // define for the maximum number of times a channel can be stolen
1267: #define _SOS_MIDI_MAX_LEVELS 0x04
1268:
1269: // structure for MIDI information to be stored on the local stack
1270: // when a channel is stolen
1271: typedef struct
1272: {
1273: // used element
1274: BYTE bUsed;
1275:
1276: // last pitch bend information sent
1277: BYTE bPitchBend;
1278:
1279: // channel volume
1280: BYTE bChannelVolume;
1281:
1282: // instrument information
1283: BYTE bInstrument;
1284:
1285: // sustain pedal
1286: BYTE bSustain;
1287:
1288: } _SOS_MIDI_CHANNEL_DATA;
1289:
1290: // flags for the debugging system
1291: #define _SOS_DEBUG_NORMAL 0x0000
1292: #define _SOS_DEBUG_NO_TIMER 0x0001
1293:
1294: // ID for 32 bit MIDI file
1295: #define _SOS_MIDI_FILE_ID "HMIMIDIP"
1296:
1297: // structure for branch location controller
1298: typedef struct
1299: {
1300: // offset from start of track data
1301: WORD dwOffset;
1302:
1303: // branch ID number
1304: BYTE bBranchID;
1305:
1306: // current instrument
1307: BYTE bInstrument;
1308:
1309: // current loop count for temporary storage
1310: // so that a track can be looped without
1311: // needing any data from the program
1312: BYTE bLoopCount;
1313:
1314: // number of controller messages stored
1315: BYTE bCtrlChangeCount;
1316:
1317: // offset of control change information from start of file
1318: WORD lpCtrlChangeData;
1319: WORD lpCtrlChangeDataTemp;
1320:
1321: // reserved fields
1322: WORD wReserved1;
1323: WORD wReserved2;
1324:
1325: } _SOS_BRANCH_POINT;
1326:
1327: #define _SOS_MIDI_FADE_IN 0x01
1328: #define _SOS_MIDI_FADE_OUT 0x02
1329: #define _SOS_MIDI_FADE_OUT_STOP 0x04
1330:
1331: // structure for digital drums to use to store midi information
1332: typedef struct
1333: {
1334: // current volume
1335: WORD wVolume;
1336:
1337: // current pan position
1338: WORD wPanPosition;
1339:
1340: // reserved
1341: DWORD dwReserved;
1342:
1343: } _SOS_MIDI_DIGI_CHANNEL;
1344:
1345: // instrument file header structure
1346: typedef struct
1347: {
1348: // file ID
1349: BYTE szID[ 32 ];
1350:
1351: // file version
1352: WORD wVersion;
1353:
1354: // instruments in file
1355: WORD wInstruments;
1356:
1357: // list of pointers to start sample structures
1358: _SOS_START_SAMPLE far * lpStartSample[ _MAX_INS ];
1359:
1360: DWORD temp1;
1361: DWORD temp2;
1362:
1363: } _WAVE_FILE_HEADER;
1364:
1365: #pragma pack()
1366:
1367: // define for the busy error returned from send data
1368: #define _ERR_DRIVER_BUSY 0xf000
1369:
1370: // NEW
1371: // defines for the looping branch controllers
1372: #define _SOS_SET_FLAG 103
1373: #define _SOS_RESET_FLAG 104
1374: #define _SOS_BRANCH1 108
1375: #define _SOS_BRANCH2 109
1376: #define _SOS_BRANCH3 110
1377: #define _SOS_BRANCH4 111
1378: #define _SOS_BRANCH5 112
1379: #define _SOS_BRANCH6 113
1380: #define _SOS_BRANCH7 114
1381: #define _SOS_BRANCH8 115
1382: #define _SOS_BRANCH9 116
1383: #define _SOS_BRANCH10 117
1384: #define _SOS_BRANCH11 118
1385: #define _SOS_BRANCH12 119
1386: #define _SOS_BRANCH13 120
1387: #define _SOS_BRANCH14 121
1388:
1389: // define for the program change controller flag
1390: #define _SOS_PROGRAM_CHANGE_FLAG 108
1391:
1392: // END
1393:
1394:
1395: //
1396: // #include "sosmdata.h"
1397: //
1398: /****************************************************************************
1399:
1400: File : sosmdata.h
1401:
1402: Programmer(s) : Don Fowler, Nick Skrepetos
1403: Date :
1404:
1405: Purpose : Include Files For Zortech C++ Compiler
1406:
1407: Last Updated :
1408:
1409: ****************************************************************************
1410: Copyright(c) 1993,1994 Human Machine Interfaces
1411: All Rights Reserved
1412: ****************************************************************************/
1413:
1414:
1415: #ifndef _SOS_MIDI_DATA
1416: #define _SOS_MIDI_DATA
1417:
1418: // #include "sos.h"
1419:
1420: #pragma pack(4)
1421:
1422: extern WORD _wSOSMIDIDriverLinear[];
1423: extern LPSTR _lpSOSMIDIDriver[];
1424: extern LPSTR _lpSOSMIDIDriverCS[];
1425: extern WORD _wSOSMIDIMemHandle[];
1426: extern BOOL _wSOSMIDIDriverLoaded[];
1427: extern WORD _wSOSMIDIDriverType[];
1428: extern WORD _wSOSMIDIDriverID[];
1429: extern DWORD _dwSOSMIDITrackDeltaCurrent[][_SOS_MIDI_MAX_TRACKS];
1430: extern WORD _wSOSMIDIActiveTracks[];
1431: extern WORD _wSOSMIDITotalTracks[];
1432: extern DWORD _dwSOSMIDITrackDeltaTime[][_SOS_MIDI_MAX_TRACKS];
1433: extern WORD _wSOSMIDISongPaused[];
1434: extern WORD _wSOSMIDISongMuted[];
1435: extern BOOL _wSOSMIDISongActive[];
1436: extern BYTE _bSOSMIDIEventSize[];
1437: extern BYTE _bSOSMIDIEventSizeControl[];
1438: extern _SOS_MIDI_CAPABILITIES far * _lpSOSMIDIDriverCaps[];
1439: extern _SOS_MIDI_TRACK_DEVICE far * _sSOSMIDITrackMap[];
1440: extern _NDMF_MIDI_EVENT _huge * _lpSOSMIDITrack[][_SOS_MIDI_MAX_TRACKS];
1441: extern WORD ( cdecl far *_lpSOSMIDIDrvFunction[ _SOS_MIDI_MAX_DRIVERS ][ _SOS_MIDI_DRV_FUNCTIONS ] )( LPSTR, WORD, WORD );
1442: extern _NDMF_FILE_HEADER far * _sSOSMIDISongHeader[];
1443: extern _SOS_INIT_DRIVER _sSOSDIGIInitDriver[];
1444: extern WORD _wSOSMIDIEventHandle[];
1445: extern BYTE _szSOSMIDIDrvFile[];
1446: extern _MIDIFILEHEADER _sSOSMIDIDRVFileHeader;
1447: extern _MIDIDRIVERHEADER _sSOSMIDIDRVDriverHeader;
1448: extern BOOL _wSOSMIDISysInititalized;
1449: extern WORD ( cdecl far *_lpSOSMIDICBCKDrvFunctions[] )( LPSTR, WORD, WORD );
1450: extern VOID ( cdecl far *_lpSOSMIDICBCKFunctions )( LPSTR, WORD, WORD );
1451: extern WORD _wMIDIDIGISampleQueueHead[];
1452: extern WORD _wMIDIDIGISampleQueueTail[];
1453: extern WORD _wMIDIDIGIMaxSamples[];
1454: extern WORD _wMIDIDIGIUsedSamples[];
1455: extern _DIGI_QUEUE_ELEMENT _sMIDIDIGIQueue[][ _MAX_VOICES ];
1456:
1457:
1458: extern WORD ( cdecl far *_lpMIDIDIGIDrvFunctions[] )( LPSTR, WORD, WORD );
1459: extern _SOS_START_SAMPLE far * _sMIDIDIGIStartSample[][ _MAX_INS ];
1460: extern _HMI_INS_FILE_HEADER far * _sMIDIDIGIInsFileHeader[];
1461: extern WORD _wMIDIDIGIDriverHandle[];
1462: extern WORD _wMIDIDIGIDriverInitialized[];
1463: extern WORD _wMIDIDIGITimerEventHandle[];
1464: extern WORD _wMIDIDIGIDriverInitMIDI[];
1465: extern WORD _wMIDIDIGIVelocitySensing[];
1466: extern BYTE _szMIDIDIGIInsFileID[];
1467:
1468: extern BYTE _bSOSMIDIMasterVolume;
1469: extern BYTE _bSOSMIDIDeviceChannelVolume[][ _SOS_MIDI_MAX_CHANNELS ];
1470: extern BYTE _bSOSMIDIMT32SendData;
1471:
1472: extern LPSTR lpFake;
1473: extern WORD wFake;
1474:
1475: extern _NDMF_TRACK_HEADER _huge *_lpSOSMIDITrackHeaders[][ _SOS_MIDI_MAX_TRACKS ];
1476: extern BYTE _bSOSMIDIChannelRemap[][ _SOS_MIDI_MAX_SONGS ][ _SOS_MIDI_MAX_CHANNELS ];
1477: extern BYTE _bSOSMIDIChannelPriority[][ _SOS_MIDI_MAX_CHANNELS ];
1478: extern BYTE _bSOSMIDIOwnerChannel[][ _SOS_MIDI_MAX_CHANNELS ];
1479: extern BYTE _bSOSMIDIOwnerSong[][ _SOS_MIDI_MAX_CHANNELS ];
1480: extern _SOS_MIDI_CHANNEL_DATA _sSOSMIDIChannelData[][ _SOS_MIDI_MAX_CHANNELS ][ _SOS_MIDI_MAX_LEVELS ];
1481: extern BYTE _bSOSMIDIChannelDataIndex[][ _SOS_MIDI_MAX_SONGS ][ _SOS_MIDI_MAX_CHANNELS ];
1482: extern BYTE _bSOSMIDIData[];
1483: extern BYTE _bSOSMIDIData1[];
1484: extern BYTE _bSOSMIDIDeviceLowPriority[];
1485: extern WORD _wSOSMIDIChannelStealing;
1486: extern BYTE _bSOSMIDIDeviceChannelActive[][ _SOS_MIDI_MAX_CHANNELS ];
1487: extern BYTE _bSOSMIDIDeviceChannelAvailable[][ _SOS_MIDI_MAX_CHANNELS ];
1488: extern BYTE _bSOSMIDISongHandle;
1489: extern BYTE _szMIDIMIDIFileID[];
1490: extern BYTE _pSOSMIDIDriverPath[];
1491: extern BYTE _pSOSMIDITempDriverPath[];
1492: extern WORD sosMIDIData_Start;
1493: extern WORD sosMIDIData_End;
1494: extern WORD ( cdecl far *_lpSOSMIDIAWEDrvFunctions[5] )( LPSTR, WORD, WORD );
1495: extern WORD _wSOSGravisTimerHandle;
1496: extern WORD _wSOSMIDISongVolume[];
1497:
1498: extern _SOS_BRANCH_POINT far * _lpMIDIBranchData[][ _SOS_MIDI_MAX_TRACKS ];
1499: extern WORD ( far *_lpSOSMIDIBranchCallback[] )( WORD, BYTE, BYTE );
1500: extern WORD ( far *_lpSOSMIDILoopCallback[] )( WORD, BYTE, BYTE, BYTE );
1501: extern WORD ( far *_lpSOSMIDITriggerCallback[][ 127 ] )( WORD, BYTE, BYTE );
1502: extern BYTE _bSOSMIDIBranchOccurred;
1503:
1504: extern WORD _wSOSMIDIVolumeFadeDirection[];
1505: extern DWORD _dwSOSMIDIVolumeFadeFraction[];
1506: extern DWORD _dwSOSMIDIVolumeFadeVolume[];
1507: extern WORD _wSOSMIDIVolumeFadeTicks[];
1508: extern BYTE _bSOSMIDIHandleVolumeFade[];
1509: extern WORD _wSOSDIGIMIDIHandle[];
1510:
1511: extern _SOS_MIDI_DIGI_CHANNEL _sMIDIDIGIChannel[];
1512:
1513: extern WORD ( cdecl far *_lpMIDIWAVEDrvFunctions[] )( LPSTR, WORD, WORD );
1514: extern WORD _wSOSMIDIChannelMuted[][ _SOS_MIDI_MAX_CHANNELS ];
1515:
1516: extern BYTE _szPLYMIDIBuffer[];
1517: extern WORD _wPLYMIDIBufferIndex;
1518: extern WORD _wSOSMIDIDriverSize[];
1519:
1520: #pragma pack()
1521:
1522: #endif
1523:
1524:
1525: //
1526: // #include "sosmfnct.h"
1527: //
1528: /****************************************************************************
1529:
1530: File : sosmfnct.h
1531:
1532: Programmer(s) : Don Fowler, Nick Skrepetos
1533: Date :
1534:
1535: Purpose : Include Files For Zortech C++ Compiler
1536:
1537: Last Updated :
1538:
1539: ****************************************************************************
1540: Copyright(c) 1993,1994 Human Machine Interfaces
1541: All Rights Reserved
1542: ****************************************************************************/
1543:
1544: #ifndef _SOS_MIDI_FUNCTIONS
1545: #define _SOS_MIDI_FUNCTIONS
1546:
1547: #pragma pack(4)
1548:
1549: VOID interrupt far sosMIDITimerHandler ( VOID );
1550: WORD sosMIDILockMemory ( VOID );
1551: WORD sosMIDIUnLockMemory ( VOID );
1552: WORD sosMIDIGetDeviceCaps ( WORD, LPSOSMIDIDEVICECAPS );
1553: WORD sosMIDIInitSystem ( LPSTR, WORD );
1554: WORD sosMIDIUnInitSystem ( VOID );
1555: WORD sosMIDIInitDriver ( WORD, _SOS_MIDI_HARDWARE far *,
1556: _SOS_MIDI_INIT_DRIVER far *, WORD far * );
1557: WORD sosMIDIUnInitDriver ( WORD, BOOL );
1558: WORD sosMIDILoadDriver ( WORD, WORD, LPSTR far *, LPSTR far *, PSTR, PSTR, WORD * );
1559: WORD sosMIDIUnLoadDriver ( WORD );
1560: WORD sosMIDIInitSong ( _SOS_MIDI_INIT_SONG far *,
1561: _SOS_MIDI_TRACK_DEVICE far *,
1562: WORD far * );
1563: WORD sosMIDIUnInitSong ( WORD );
1564: WORD sosMIDIResetSong ( WORD, _SOS_MIDI_INIT_SONG far * );
1565: WORD sosMIDIStartSong ( WORD );
1566: WORD sosMIDIStopSong ( WORD );
1567: WORD sosMIDIPauseSong ( WORD, WORD );
1568: WORD sosMIDIMuteSong ( WORD );
1569: WORD sosMIDIUnMuteSong ( WORD );
1570: WORD sosMIDIResumeSong ( WORD );
1571: BOOL sosMIDISongDone ( WORD );
1572: WORD sosMIDISongAlterTempo ( WORD, WORD );
1573: WORD sosMIDIGetDeltaTime ( LPSTR, DWORD far * );
1574: WORD sosMIDISongGetTimeToPlay ( WORD );
1575: BYTE _huge * sosMIDINormalizePtr ( BYTE _huge * );
1576: WORD sosMIDISetInsData ( WORD, LPSTR, WORD );
1577: WORD sosMIDIResetDriver ( WORD );
1578: BOOL sosMIDIHandleMIDIData ( WORD, LPSTR, WORD, WORD );
1579: WORD sosMIDISendMIDIData ( WORD, LPSTR, WORD );
1580: // NEW
1581: VOID sosMIDISetTrackState ( WORD, WORD, WORD );
1582: // END
1583:
1584: // compiled in drivers function interface
1585: LPSTR digiGetCallTable ( VOID );
1586: LPSTR callbackGetCallTable ( VOID );
1587: LPSTR aweGetCallTable ( VOID );
1588:
1589: WORD cdecl far callbackSendData ( LPSTR, WORD, WORD );
1590: WORD cdecl far callbackInit ( LPSTR, WORD, WORD );
1591: WORD cdecl far callbackUnInit ( LPSTR, WORD, WORD );
1592: WORD cdecl far callbackReset ( LPSTR, WORD, WORD );
1593: WORD cdecl far callbackSetInstrumentData ( LPSTR, WORD, WORD );
1594:
1595: WORD cdecl far aweSendData ( LPSTR, WORD, WORD );
1596: WORD cdecl far aweInit ( LPSTR, WORD, WORD );
1597: WORD cdecl far aweUnInit ( LPSTR, WORD, WORD );
1598: WORD cdecl far aweReset ( LPSTR, WORD, WORD );
1599: WORD cdecl far aweSetInstrumentData ( LPSTR, WORD, WORD );
1600:
1601: // function prototypes
1602: WORD cdecl far digiSendData ( LPSTR, WORD, WORD );
1603: WORD cdecl far digiInit ( LPSTR, WORD, WORD );
1604: WORD cdecl far digiUnInit ( LPSTR, WORD, WORD );
1605: WORD cdecl far digiReset ( LPSTR, WORD, WORD );
1606: WORD cdecl far digiSetInstrumentData ( LPSTR, WORD, WORD );
1607:
1608: LPSTR waveGetCallTable ( VOID );
1609: WORD cdecl far waveSendData ( LPSTR, WORD, WORD );
1610: WORD cdecl far waveInit ( LPSTR, WORD, WORD );
1611: WORD cdecl far waveUnInit ( LPSTR, WORD, WORD );
1612: WORD cdecl far waveReset ( LPSTR, WORD, WORD );
1613: WORD cdecl far waveSetInstrumentData ( LPSTR, WORD, WORD );
1614: VOID cdecl far waveSampleCallback( WORD, WORD, WORD );
1615:
1616: VOID digiQueueInit ( WORD, WORD );
1617: VOID digiQueueUnInit ( WORD );
1618: WORD digiQueueAddItem ( WORD, WORD, WORD, WORD, WORD );
1619: WORD digiQueueGetItem ( WORD, WORD );
1620: WORD digiQueueGetItemWAVE ( WORD );
1621: WORD digiQueueDeleteItem ( WORD, WORD );
1622: WORD digiQueueDeleteItemWAVE ( WORD, WORD );
1623: WORD digiQueueDeleteItemMIDI ( WORD, WORD, WORD );
1624: WORD digiQueueFindItemMIDI ( WORD, WORD, WORD );
1625:
1626: // function prototypes
1627: VOID cdecl far digiSampleCallback( WORD, WORD, WORD );
1628:
1629: WORD sosMIDIRegisterBranchFunction ( WORD, WORD ( far * )( WORD, BYTE, BYTE ) );
1630: WORD sosMIDIRegisterLoopFunction ( WORD, WORD ( far * )( WORD, BYTE, BYTE, BYTE ) );
1631: WORD sosMIDIRegisterTriggerFunction( WORD, BYTE, WORD ( far * )( WORD, BYTE, BYTE ) );
1632: WORD sosMIDIBranchToTrackLocation ( WORD, BYTE, BYTE );
1633: WORD sosMIDIBranchToSongLocation ( WORD, BYTE );
1634:
1635: #ifdef __cplusplus
1636: extern "C" {
1637: #endif
1638:
1639: extern void cdecl sosMIDIDRVGetCapsInfo( LPSTR, LPSTR, _SOS_MIDI_CAPABILITIES far * );
1640: extern void cdecl sosMIDIDRVGetCapsPtr ( LPSTR, LPSTR, _SOS_MIDI_CAPABILITIES far * );
1641: extern void cdecl sosMIDIDRVGetFuncsPtr( LPSTR, LPSTR, LPSTR );
1642: extern LPSTR cdecl sosMIDIDRVSpecialFunction( LPSTR, LPSTR, WORD );
1643: extern WORD cdecl xgetES( void );
1644:
1645: #ifdef __cplusplus
1646: }
1647: #endif
1648:
1649: BOOL sosMIDIResetChannelStealing ( WORD );
1650: WORD sosMIDIEnableChannelStealing( WORD );
1651: VOID far sosMIDISongHandler( VOID );
1652:
1653: WORD sosMIDISetMT32InsData ( WORD, LPSTR, WORD );
1654: WORD sosMIDISetMasterVolume ( BYTE );
1655: VOID far sosMIDIMT32Timer ( VOID );
1656:
1657: WORD sosMIDISetSongVolume ( WORD, BYTE );
1658: WORD sosMIDIFadeSong ( WORD, WORD, WORD, BYTE, BYTE, WORD );
1659:
1660: // functions for memory locking
1661: VOID sosMIDICaps_Start( VOID );
1662: VOID sosMIDICaps_End( VOID );
1663: VOID sosMIDICbck_Start( VOID );
1664: VOID sosMIDICbck_End( VOID );
1665: VOID sosMIDIDigi_Start( VOID );
1666: VOID sosMIDIDigi_End( VOID );
1667: VOID sosMIDIDone_Start( VOID );
1668: VOID sosMIDIDone_End( VOID );
1669: VOID sosMIDIDq_Start( VOID );
1670: VOID sosMIDIDq_End( VOID );
1671: VOID sosMIDIInit_Start( VOID );
1672: VOID sosMIDIInit_End( VOID );
1673: VOID sosMIDIIns_Start( VOID );
1674: VOID sosMIDIIns_End( VOID );
1675: VOID sosMIDILoad_Start( VOID );
1676: VOID sosMIDILoad_End( VOID );
1677: VOID sosMIDIPause_Start( VOID );
1678: VOID sosMIDIPause_End( VOID );
1679: VOID sosMIDIPtr_Start( VOID );
1680: VOID sosMIDIPtr_End( VOID );
1681: VOID sosMIDISong_Start( VOID );
1682: VOID sosMIDISong_End( VOID );
1683: VOID sosMIDISt_Start( VOID );
1684: VOID sosMIDISt_End( VOID );
1685: VOID sosMIDITmpo_Start( VOID );
1686: VOID sosMIDITmpo_End( VOID );
1687: VOID sosMIDITmr_Start( VOID );
1688: VOID sosMIDITmr_End( VOID );
1689:
1690: void StringOut( BYTE X, BYTE Y, BYTE * String, BYTE Color );
1691:
1692: #pragma pack()
1693:
1694: #endif
1695:
1696:
1697: #endif
1698:
1699:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.