]> 4ch.mooo.com Git - 16.git/blob - 16/sb_sd.c
porting and tweaking sd more i added a cuted code file and a xxdiff friendlyer versio...
[16.git] / 16 / sb_sd.c
1 // Macros for SoundBlaster stuff\r
2 #define sbOut(n,b)      outportb((n) + sbLocation,b)\r
3 #define sbIn(n)         inportb((n) + sbLocation)\r
4 #define sbWriteDelay()  while (sbIn(sbWriteStat) & 0x80);\r
5 #define sbReadDelay()   while (sbIn(sbDataAvail) & 0x80);\r
6 \r
7         SoundSourcePresent,\r
8                                 SoundBlasterPresent,SBProPresent,\r
9 \r
10                 word            ssPort = 2;\r
11 \r
12                                                         "nosb",\r
13                                                         "nopro",\r
14                                                         "noss",\r
15                                                         "sst",\r
16                                                         "ss1",\r
17                                                         "ss2",\r
18                                                         "ss3",\r
19 \r
20 //      SoundBlaster variables\r
21 static  boolean                                 sbNoCheck,sbNoProCheck;\r
22 static  volatile boolean                sbSamplePlaying;\r
23 static  byte                                    sbOldIntMask = -1;\r
24 static  volatile byte                   huge *sbNextSegPtr;\r
25 static  byte                                    sbDMA = 1,\r
26                                                                 sbDMAa1 = 0x83,sbDMAa2 = 2,sbDMAa3 = 3,\r
27                                                                 sba1Vals[] = {0x87,0x83,0,0x82},\r
28                                                                 sba2Vals[] = {0,2,0,6},\r
29                                                                 sba3Vals[] = {1,3,0,7};\r
30 static  int                                             sbLocation = -1,sbInterrupt = 7,sbIntVec = 0xf,\r
31                                                                 sbIntVectors[] = {-1,-1,0xa,0xb,-1,0xd,-1,0xf,-1,-1,-1};\r
32 static  volatile dword          sbNextSegLen;\r
33 static  volatile SampledSound   huge *sbSamples;\r
34 static  void interrupt                  (*sbOldIntHand)(void);\r
35 static  byte                                    sbpOldFMMix,sbpOldVOCMix;\r
36 \r
37 //      SoundSource variables\r
38                 boolean                         ssNoCheck;\r
39                 boolean                         ssActive;\r
40                 word                            ssControl,ssStatus,ssData;\r
41                 byte                            ssOn,ssOff;\r
42                 volatile byte           far *ssSample;\r
43                 volatile dword  ssLengthLeft;\r
44 \r
45 \r
46 \r
47 //++#if 0\r
48 //\r
49 //      SoundBlaster code\r
50 //\r
51 \r
52 ///////////////////////////////////////////////////////////////////////////\r
53 //\r
54 //      SDL_SBStopSample() - Stops any active sampled sound and causes DMA\r
55 //              requests from the SoundBlaster to cease\r
56 //\r
57 ///////////////////////////////////////////////////////////////////////////\r
58 #ifdef  _MUSE_\r
59 void\r
60 #else\r
61 static void\r
62 #endif\r
63 SDL_SBStopSample(void)\r
64 {\r
65         byte    is;\r
66 \r
67 asm     pushf\r
68 asm     cli\r
69 \r
70         if (sbSamplePlaying)\r
71         {\r
72                 sbSamplePlaying = false;\r
73 \r
74                 sbWriteDelay();\r
75                 sbOut(sbWriteCmd,0xd0); // Turn off DSP DMA\r
76 \r
77                 is = inportb(0x21);     // Restore interrupt mask bit\r
78                 if (sbOldIntMask & (1 << sbInterrupt))\r
79                         is |= (1 << sbInterrupt);\r
80                 else\r
81                         is &= ~(1 << sbInterrupt);\r
82                 outportb(0x21,is);\r
83         }\r
84 \r
85 asm     popf\r
86 }\r
87 \r
88 ///////////////////////////////////////////////////////////////////////////\r
89 //\r
90 //      SDL_SBPlaySeg() - Plays a chunk of sampled sound on the SoundBlaster\r
91 //      Insures that the chunk doesn't cross a bank boundary, programs the DMA\r
92 //       controller, and tells the SB to start doing DMA requests for DAC\r
93 //\r
94 ///////////////////////////////////////////////////////////////////////////\r
95 static dword\r
96 SDL_SBPlaySeg(volatile byte huge *data,dword length)\r
97 {\r
98         unsigned                datapage;\r
99         dword           dataofs,uselen;\r
100 \r
101         uselen = length;\r
102         datapage = FP_SEG(data) >> 12;\r
103         dataofs = ((FP_SEG(data) & 0xfff) << 4) + FP_OFF(data);\r
104         if (dataofs >= 0x10000)\r
105         {\r
106                 datapage++;\r
107                 dataofs -= 0x10000;\r
108         }\r
109 \r
110         if (dataofs + uselen > 0x10000)\r
111                 uselen = 0x10000 - dataofs;\r
112 \r
113         uselen--;\r
114 \r
115         // Program the DMA controller\r
116 asm     pushf\r
117 asm     cli\r
118         outportb(0x0a,sbDMA | 4);                                       // Mask off DMA on channel sbDMA\r
119         outportb(0x0c,0);                                                       // Clear byte ptr flip-flop to lower byte\r
120         outportb(0x0b,0x49);                                            // Set transfer mode for D/A conv\r
121         outportb(sbDMAa2,(byte)dataofs);                        // Give LSB of address\r
122         outportb(sbDMAa2,(byte)(dataofs >> 8));         // Give MSB of address\r
123         outportb(sbDMAa1,(byte)datapage);                       // Give page of address\r
124         outportb(sbDMAa3,(byte)uselen);                         // Give LSB of length\r
125         outportb(sbDMAa3,(byte)(uselen >> 8));          // Give MSB of length\r
126         outportb(0x0a,sbDMA);                                           // Re-enable DMA on channel sbDMA\r
127 \r
128         // Start playing the thing\r
129         sbWriteDelay();\r
130         sbOut(sbWriteCmd,0x14);\r
131         sbWriteDelay();\r
132         sbOut(sbWriteData,(byte)uselen);\r
133         sbWriteDelay();\r
134         sbOut(sbWriteData,(byte)(uselen >> 8));\r
135 asm     popf\r
136 \r
137         return(uselen + 1);\r
138 }\r
139 \r
140 ///////////////////////////////////////////////////////////////////////////\r
141 //\r
142 //      SDL_SBService() - Services the SoundBlaster DMA interrupt\r
143 //\r
144 ///////////////////////////////////////////////////////////////////////////\r
145 /*static*/ void interrupt\r
146 SDL_SBService(void)\r
147 {\r
148         dword   used;\r
149 \r
150         sbIn(sbDataAvail);      // Ack interrupt to SB\r
151 \r
152         if (sbNextSegPtr)\r
153         {\r
154                 used = SDL_SBPlaySeg(sbNextSegPtr,sbNextSegLen);\r
155                 if (sbNextSegLen <= used)\r
156                         sbNextSegPtr = nil;\r
157                 else\r
158                 {\r
159                         sbNextSegPtr += used;\r
160                         sbNextSegLen -= used;\r
161                 }\r
162         }\r
163         else\r
164         {\r
165                 SDL_SBStopSample();\r
166                 SDL_DigitizedDone();\r
167         }\r
168 \r
169         outportb(0x20,0x20);    // Ack interrupt\r
170 }\r
171 \r
172 ///////////////////////////////////////////////////////////////////////////\r
173 //\r
174 //      SDL_SBPlaySample() - Plays a sampled sound on the SoundBlaster. Sets up\r
175 //              DMA to play the sound\r
176 //\r
177 ///////////////////////////////////////////////////////////////////////////\r
178 #ifdef  _MUSE_\r
179 void\r
180 #else\r
181 static void\r
182 #endif\r
183 SDL_SBPlaySample(byte huge *data,dword len)\r
184 {\r
185         dword   used;\r
186 \r
187         SDL_SBStopSample();\r
188 \r
189 asm     pushf\r
190 asm     cli\r
191 \r
192         used = SDL_SBPlaySeg(data,len);\r
193         if (len <= used)\r
194                 sbNextSegPtr = nil;\r
195         else\r
196         {\r
197                 sbNextSegPtr = data + used;\r
198                 sbNextSegLen = len - used;\r
199         }\r
200 \r
201         // Save old interrupt status and unmask ours\r
202         sbOldIntMask = inportb(0x21);\r
203         outportb(0x21,sbOldIntMask & ~(1 << sbInterrupt));\r
204 \r
205         sbWriteDelay();\r
206         sbOut(sbWriteCmd,0xd4);                                         // Make sure DSP DMA is enabled\r
207 \r
208         sbSamplePlaying = true;\r
209 \r
210 asm     popf\r
211 }\r
212 \r
213 ///////////////////////////////////////////////////////////////////////////\r
214 //\r
215 //      SDL_PositionSBP() - Sets the attenuation levels for the left and right\r
216 //              channels by using the mixer chip on the SB Pro. This hits a hole in\r
217 //              the address map for normal SBs.\r
218 //\r
219 ///////////////////////////////////////////////////////////////////////////\r
220 static void\r
221 SDL_PositionSBP(int leftpos,int rightpos)\r
222 {\r
223         byte    v;\r
224 \r
225         if (!SBProPresent)\r
226                 return;\r
227 \r
228         leftpos = 15 - leftpos;\r
229         rightpos = 15 - rightpos;\r
230         v = ((leftpos & 0x0f) << 4) | (rightpos & 0x0f);\r
231 \r
232 asm     pushf\r
233 asm     cli\r
234 \r
235         sbOut(sbpMixerAddr,sbpmVoiceVol);\r
236         sbOut(sbpMixerData,v);\r
237 \r
238 asm     popf\r
239 }\r
240 \r
241 ///////////////////////////////////////////////////////////////////////////\r
242 //\r
243 //      SDL_CheckSB() - Checks to see if a SoundBlaster resides at a\r
244 //              particular I/O location\r
245 //\r
246 ///////////////////////////////////////////////////////////////////////////\r
247 static boolean\r
248 SDL_CheckSB(int port)\r
249 {\r
250         int     i;\r
251 \r
252         sbLocation = port << 4;         // Initialize stuff for later use\r
253 \r
254         sbOut(sbReset,true);            // Reset the SoundBlaster DSP\r
255 asm     mov     dx,0x388                                // Wait >4usec\r
256 asm     in      al, dx\r
257 asm     in      al, dx\r
258 asm     in      al, dx\r
259 asm     in      al, dx\r
260 asm     in      al, dx\r
261 asm     in      al, dx\r
262 asm     in      al, dx\r
263 asm     in      al, dx\r
264 asm     in      al, dx\r
265 \r
266         sbOut(sbReset,false);           // Turn off sb DSP reset\r
267 asm     mov     dx,0x388                                // Wait >100usec\r
268 asm     mov     cx,100\r
269 #ifdef __WATCOMC__\r
270         __asm {\r
271 #endif\r
272 usecloop:\r
273 asm     in      al,dx\r
274 asm     loop usecloop\r
275 #ifdef __WATCOMC__\r
276         }\r
277 #endif\r
278 \r
279         for (i = 0;i < 100;i++)\r
280         {\r
281                 if (sbIn(sbDataAvail) & 0x80)           // If data is available...\r
282                 {\r
283                         if (sbIn(sbReadData) == 0xaa)   // If it matches correct value\r
284                                 return(true);\r
285                         else\r
286                         {\r
287                                 sbLocation = -1;                        // Otherwise not a SoundBlaster\r
288                                 return(false);\r
289                         }\r
290                 }\r
291         }\r
292         sbLocation = -1;                                                // Retry count exceeded - fail\r
293         return(false);\r
294 }\r
295 \r
296 ///////////////////////////////////////////////////////////////////////////\r
297 //\r
298 //      Checks to see if a SoundBlaster is in the system. If the port passed is\r
299 //              -1, then it scans through all possible I/O locations. If the port\r
300 //              passed is 0, then it uses the default (2). If the port is >0, then\r
301 //              it just passes it directly to SDL_CheckSB()\r
302 //\r
303 ///////////////////////////////////////////////////////////////////////////\r
304 static boolean\r
305 SDL_DetectSoundBlaster(int port)\r
306 {\r
307         int     i;\r
308 \r
309         if (port == 0)                                  // If user specifies default, use 2\r
310                 port = 2;\r
311         if (port == -1)\r
312         {\r
313                 if (SDL_CheckSB(2))                     // Check default before scanning\r
314                         return(true);\r
315 \r
316                 if (SDL_CheckSB(4))                     // Check other SB Pro location before scan\r
317                         return(true);\r
318 \r
319                 for (i = 1;i <= 6;i++)          // Scan through possible SB locations\r
320                 {\r
321                         if ((i == 2) || (i == 4))\r
322                                 continue;\r
323 \r
324                         if (SDL_CheckSB(i))             // If found at this address,\r
325                                 return(true);           //      return success\r
326                 }\r
327                 return(false);                          // All addresses failed, return failure\r
328         }\r
329         else\r
330                 return(SDL_CheckSB(port));      // User specified address or default\r
331 }\r
332 \r
333 ///////////////////////////////////////////////////////////////////////////\r
334 //\r
335 //      SDL_SBSetDMA() - Sets the DMA channel to be used by the SoundBlaster\r
336 //              code. Sets up sbDMA, and sbDMAa1-sbDMAa3 (used by SDL_SBPlaySeg()).\r
337 //\r
338 ///////////////////////////////////////////////////////////////////////////\r
339 void\r
340 SDL_SBSetDMA(byte channel, global_game_variables_t *gvar)\r
341 {\r
342         if (channel > 3)\r
343                 Quit(gvar, "SDL_SBSetDMA() - invalid SoundBlaster DMA channel");\r
344 \r
345         sbDMA = channel;\r
346         sbDMAa1 = sba1Vals[channel];\r
347         sbDMAa2 = sba2Vals[channel];\r
348         sbDMAa3 = sba3Vals[channel];\r
349 }\r
350 \r
351 ///////////////////////////////////////////////////////////////////////////\r
352 //\r
353 //      SDL_StartSB() - Turns on the SoundBlaster\r
354 //\r
355 ///////////////////////////////////////////////////////////////////////////\r
356 static void\r
357 SDL_StartSB(global_game_variables_t *gvar)\r
358 {\r
359         byte    timevalue,test;\r
360 \r
361         sbIntVec = sbIntVectors[sbInterrupt];\r
362         if (sbIntVec < 0)\r
363                 Quit(gvar, "SDL_StartSB: Illegal or unsupported interrupt number for SoundBlaster");\r
364 \r
365         sbOldIntHand = getvect(sbIntVec);       // Get old interrupt handler\r
366         setvect(sbIntVec,SDL_SBService);        // Set mine\r
367 \r
368         sbWriteDelay();\r
369         sbOut(sbWriteCmd,0xd1);                         // Turn on DSP speaker\r
370 \r
371         // Set the SoundBlaster DAC time constant for 7KHz\r
372         timevalue = 256 - (1000000 / 7000);\r
373         sbWriteDelay();\r
374         sbOut(sbWriteCmd,0x40);\r
375         sbWriteDelay();\r
376         sbOut(sbWriteData,timevalue);\r
377 \r
378         SBProPresent = false;\r
379         if (sbNoProCheck)\r
380                 return;\r
381 \r
382         // Check to see if this is a SB Pro\r
383         sbOut(sbpMixerAddr,sbpmFMVol);\r
384         sbpOldFMMix = sbIn(sbpMixerData);\r
385         sbOut(sbpMixerData,0xbb);\r
386         test = sbIn(sbpMixerData);\r
387         if (test == 0xbb)\r
388         {\r
389                 // Boost FM output levels to be equivilent with digitized output\r
390                 sbOut(sbpMixerData,0xff);\r
391                 test = sbIn(sbpMixerData);\r
392                 if (test == 0xff)\r
393                 {\r
394                         SBProPresent = true;\r
395 \r
396                         // Save old Voice output levels (SB Pro)\r
397                         sbOut(sbpMixerAddr,sbpmVoiceVol);\r
398                         sbpOldVOCMix = sbIn(sbpMixerData);\r
399 \r
400                         // Turn SB Pro stereo DAC off\r
401                         sbOut(sbpMixerAddr,sbpmControl);\r
402                         sbOut(sbpMixerData,0);                          // 0=off,2=on\r
403                 }\r
404         }\r
405 }\r
406 \r
407 ///////////////////////////////////////////////////////////////////////////\r
408 //\r
409 //      SDL_ShutSB() - Turns off the SoundBlaster\r
410 //\r
411 ///////////////////////////////////////////////////////////////////////////\r
412 static void\r
413 SDL_ShutSB(void)\r
414 {\r
415         SDL_SBStopSample();\r
416 \r
417         if (SBProPresent)\r
418         {\r
419                 // Restore FM output levels (SB Pro)\r
420                 sbOut(sbpMixerAddr,sbpmFMVol);\r
421                 sbOut(sbpMixerData,sbpOldFMMix);\r
422 \r
423                 // Restore Voice output levels (SB Pro)\r
424                 sbOut(sbpMixerAddr,sbpmVoiceVol);\r
425                 sbOut(sbpMixerData,sbpOldVOCMix);\r
426         }\r
427 \r
428         setvect(sbIntVec,sbOldIntHand);         // Set vector back\r
429 }\r
430 //++#endif\r
431 \r
432 \r
433 \r
434 \r
435 \r
436 //      Sound Source Code\r
437 \r
438 ///////////////////////////////////////////////////////////////////////////\r
439 //\r
440 //      SDL_SSStopSample() - Stops a sample playing on the Sound Source\r
441 //\r
442 ///////////////////////////////////////////////////////////////////////////\r
443 #ifdef  _MUSE_\r
444 void\r
445 #else\r
446 static void\r
447 #endif\r
448 SDL_SSStopSample(void)\r
449 {\r
450 asm     pushf\r
451 asm     cli\r
452 \r
453         /*(long)*/ssSample = 0;\r
454 \r
455 asm     popf\r
456 }\r
457 \r
458 ///////////////////////////////////////////////////////////////////////////\r
459 //\r
460 //      SDL_SSService() - Handles playing the next sample on the Sound Source\r
461 //\r
462 ///////////////////////////////////////////////////////////////////////////\r
463 static void\r
464 SDL_SSService(void)\r
465 {\r
466         //boolean       gotit;\r
467         boolean doneflag=false;\r
468         byte    v;\r
469 \r
470         while (ssSample)\r
471         {\r
472         __asm {\r
473                 mov             dx,[ssStatus]   // Check to see if FIFO is currently empty\r
474                 in              al,dx\r
475                 test    al,0x40\r
476                 jnz             done                    // Nope - don't push any more data out\r
477                 jmp end\r
478 #ifdef __BORLANDC__\r
479         }\r
480 #endif\r
481                 done:\r
482 #ifdef __BORLANDC__\r
483         __asm {\r
484 #endif\r
485                 mov     doneflag,1\r
486 #ifdef __BORLANDC__\r
487         }\r
488 #endif\r
489                 end:\r
490 #ifdef __WATCOMC__\r
491         }\r
492 #endif\r
493                 if(!doneflag)\r
494                 {\r
495                         v = *ssSample++;\r
496                         if (!(--ssLengthLeft))\r
497                         {\r
498                                 /*(long)*/ssSample = 0;\r
499                                 SDL_DigitizedDone();\r
500                         }\r
501 \r
502                         __asm {\r
503                                 mov             dx,[ssData]             // Pump the value out\r
504                                 mov             al,[v]\r
505                                 out             dx,al\r
506 \r
507                                 mov             dx,[ssControl]  // Pulse printer select\r
508                                 mov             al,[ssOff]\r
509                                 out             dx,al\r
510                                 push    ax\r
511                                 pop             ax\r
512                                 mov             al,[ssOn]\r
513                                 out             dx,al\r
514 \r
515                                 push    ax                              // Delay a short while\r
516                                 pop             ax\r
517                                 push    ax\r
518                                 pop             ax\r
519 done:;\r
520                         }\r
521                 }\r
522         }\r
523 }\r
524 \r
525 ///////////////////////////////////////////////////////////////////////////\r
526 //\r
527 //      SDL_SSPlaySample() - Plays the specified sample on the Sound Source\r
528 //\r
529 ///////////////////////////////////////////////////////////////////////////\r
530 #ifdef  _MUSE_\r
531 void\r
532 #else\r
533 static void\r
534 #endif\r
535 SDL_SSPlaySample(byte huge *data,dword len)\r
536 {\r
537 asm     pushf\r
538 asm     cli\r
539 \r
540         ssLengthLeft = len;\r
541         ssSample = (volatile byte far *)data;\r
542 \r
543 asm     popf\r
544 }\r
545 \r
546 ///////////////////////////////////////////////////////////////////////////\r
547 //\r
548 //      SDL_StartSS() - Sets up for and turns on the Sound Source\r
549 //\r
550 ///////////////////////////////////////////////////////////////////////////\r
551 static void\r
552 SDL_StartSS(void)\r
553 {\r
554         if (ssPort == 3)\r
555                 ssControl = 0x27a;      // If using LPT3\r
556         else if (ssPort == 2)\r
557                 ssControl = 0x37a;      // If using LPT2\r
558         else\r
559                 ssControl = 0x3be;      // If using LPT1\r
560         ssStatus = ssControl - 1;\r
561         ssData = ssStatus - 1;\r
562 \r
563         ssOn = 0x04;\r
564         if (ssIsTandy)\r
565                 ssOff = 0x0e;                           // Tandy wierdness\r
566         else\r
567                 ssOff = 0x0c;                           // For normal machines\r
568 \r
569         outportb(ssControl,ssOn);               // Enable SS\r
570 }\r
571 \r
572 ///////////////////////////////////////////////////////////////////////////\r
573 //\r
574 //      SDL_ShutSS() - Turns off the Sound Source\r
575 //\r
576 ///////////////////////////////////////////////////////////////////////////\r
577 static void\r
578 SDL_ShutSS(void)\r
579 {\r
580         outportb(ssControl,ssOff);\r
581 }\r
582 \r
583 ///////////////////////////////////////////////////////////////////////////\r
584 //\r
585 //      SDL_CheckSS() - Checks to see if a Sound Source is present at the\r
586 //              location specified by the sound source variables\r
587 //\r
588 ///////////////////////////////////////////////////////////////////////////\r
589 static boolean\r
590 SDL_CheckSS(void)\r
591 {\r
592         boolean         present = false, chkdone=0;\r
593         dword   lasttime;\r
594 \r
595         // Turn the Sound Source on and wait awhile (4 ticks)\r
596         SDL_StartSS();\r
597 \r
598         lasttime = TimeCount;\r
599         while (TimeCount < lasttime + 4)\r
600         {}\r
601 \r
602         __asm {\r
603                 mov             dx,[ssStatus]   // Check to see if FIFO is currently empty\r
604                 in              al,dx\r
605                 test    al,0x40\r
606                 jnz             checkdone               // Nope - Sound Source not here\r
607 \r
608                 mov             cx,32                   // Force FIFO overflow (FIFO is 16 bytes)\r
609 #ifdef __BORLANDC__\r
610         }\r
611 #endif\r
612 outloop:\r
613 #ifdef __BORLANDC__\r
614         __asm {\r
615 #endif\r
616                 mov             dx,[ssData]             // Pump a neutral value out\r
617                 mov             al,0x80\r
618                 out             dx,al\r
619 \r
620                 mov             dx,[ssControl]  // Pulse printer select\r
621                 mov             al,[ssOff]\r
622                 out             dx,al\r
623                 push    ax\r
624                 pop             ax\r
625                 mov             al,[ssOn]\r
626                 out             dx,al\r
627 \r
628                 push    ax                              // Delay a short while before we do this again\r
629                 pop             ax\r
630                 push    ax\r
631                 pop             ax\r
632 \r
633                 loop    outloop\r
634 \r
635                 mov             dx,[ssStatus]   // Is FIFO overflowed now?\r
636                 in              al,dx\r
637                 test    al,0x40\r
638                 jz              checkdone               // Nope, still not - Sound Source not here\r
639                 jmp end\r
640 #ifdef __BORLANDC__\r
641         }\r
642 #endif\r
643 checkdone:\r
644 #ifdef __BORLANDC__\r
645         __asm {\r
646 #endif\r
647                 mov     chkdone,1\r
648 #ifdef __BORLANDC__\r
649         }\r
650 #endif\r
651                 end:\r
652 #ifdef __WATCOMC__\r
653         }\r
654 #endif\r
655 \r
656         if(!chkdone) present = true;                    // Yes - it's here!\r
657 \r
658 //checkdone:\r
659         SDL_ShutSS();\r
660         return(present);\r
661 }\r
662 \r
663 static boolean\r
664 SDL_DetectSoundSource(void)\r
665 {\r
666         for (ssPort = 1;ssPort <= 3;ssPort++)\r
667                 if (SDL_CheckSS())\r
668                         return(true);\r
669         return(false);\r
670 }\r