int SS_DetectSoundSource
   (
   void
   )

   {
   if ( USER_CheckParameter( SELECT_SOUNDSOURCE_PORT1 ) )
      {
      SS_Port = SS_Port1;
      return( TRUE );
      }

   if ( USER_CheckParameter( SELECT_SOUNDSOURCE_PORT2 ) )
      {
      SS_Port = SS_Port2;
      return( TRUE );
      }

   if ( USER_CheckParameter( SELECT_SOUNDSOURCE_PORT3 ) )
      {
      SS_Port = SS_Port3;
      return( TRUE );
      }

   if ( SS_TestSoundSource( SS_Port1 ) )
      {
      SS_Port = SS_Port1;
      return( TRUE );
      }

   if ( SS_TestSoundSource( SS_Port2 ) )
      {
      SS_Port = SS_Port2;
      return( TRUE );
      }

   if ( SS_TestSoundSource( SS_Port3 ) )
      {
      SS_Port = SS_Port3;
      return( TRUE );
      }

   return( FALSE );
   }
int SS_Init
   (
   int soundcard
   )

   {
   int status;

   if ( SS_Installed )
      {
      SS_Shutdown();
      }

   if ( ( soundcard == TandySoundSource ) ||
      ( USER_CheckParameter( SELECT_TANDY_SOUNDSOURCE ) ) )
      {
      // Tandy
      SS_OffCommand = 0x0e;
      }
   else
      {
      // Disney
      SS_OffCommand = 0x0c;
      }

   status = SS_DetectSoundSource();
   if ( !status )
      {
      SS_SetErrorCode( SS_NotFound );
      return( SS_Warning );
      }

   status = SS_LockMemory();
   if ( status != SS_Ok )
      {
      SS_UnlockMemory();
      return( status );
      }

   status = SS_Ok;

   outp( SS_Port + 2, 4 );

   SS_SoundPlaying = FALSE;

   SS_SetCallBack( NULL );

   SS_BufferStart = NULL;

   SS_Installed = TRUE;

   SS_SetErrorCode( status );
   return( status );
   }
Esempio n. 3
0
int FX_SetupCard
   (
   int SoundCard,
   fx_device *device
   )

   {
   int status;
   int DeviceStatus;

   if ( USER_CheckParameter( "ASSVER" ) )
      {
      FX_SetErrorCode( FX_ASSVersion );
      return( FX_Error );
      }

   FX_SoundDevice = SoundCard;

   status = FX_Ok;
   FX_SetErrorCode( FX_Ok );


      DeviceStatus = DSL_Init();
      if ( DeviceStatus != DSL_Ok )
         {
         FX_SetErrorCode( FX_SoundCardError );
         status = FX_Error;
         }
         else
         {
         device->MaxVoices     = 32;
         device->MaxSampleBits = 0;
         device->MaxChannels   = 0;
         }


   return( status );
   }
Esempio n. 4
0
int MUSIC_Init
   (
   int SoundCard,
   int Address
   )

   {
   int i;
   int status;

   if ( USER_CheckParameter( "ASSVER" ) )
      {
      MUSIC_SetErrorCode( MUSIC_ASSVersion );
      return( MUSIC_Error );
      }

   status = LL_LockMemory();
   if ( status != LL_Ok )
      {
      MUSIC_SetErrorCode( MUSIC_DPMI_Error );
      return( MUSIC_Error );
      }

   for( i = 0; i < 128; i++ )
      {
      MIDI_PatchMap[ i ] = i;
      }

   status = MUSIC_Ok;
   MUSIC_SoundDevice = SoundCard;

   switch( SoundCard )
      {
      case SoundBlaster :
      case Adlib :
      case ProAudioSpectrum :
      case SoundMan16 :
         status = MUSIC_InitFM( SoundCard, &MUSIC_MidiFunctions );
         break;

      case GenMidi :
      case SoundCanvas :
      case WaveBlaster :
      case SoundScape :
         status = MUSIC_InitMidi( SoundCard, &MUSIC_MidiFunctions, Address );
         break;

      case Awe32 :
         status = MUSIC_InitAWE32( &MUSIC_MidiFunctions );
         break;

      case UltraSound :
         status = MUSIC_InitGUS( &MUSIC_MidiFunctions );
         break;

      case SoundSource :
      case PC :
      default :
         MUSIC_SetErrorCode( MUSIC_InvalidCard );
         status = MUSIC_Error;
      }

   if ( status != MUSIC_Ok )
      {
      LL_UnlockMemory();
      }

   return( status );
   }
Esempio n. 5
0
int FX_Init
   (
   int SoundCard,
   int numvoices,
   int numchannels,
   int samplebits,
   unsigned mixrate
   )

   {
   int status;
   int devicestatus;

   if ( FX_Installed )
      {
      FX_Shutdown();
      }

   if ( USER_CheckParameter( "ASSVER" ) )
      {
      FX_SetErrorCode( FX_ASSVersion );
      return( FX_Error );
      }

   status = LL_LockMemory();
   if ( status != LL_Ok )
      {
      FX_SetErrorCode( FX_DPMI_Error );
      return( FX_Error );
      }

   FX_MixRate = mixrate;

   status = FX_Ok;
   FX_SoundDevice = SoundCard;
   switch( SoundCard )
      {
      case SoundBlaster :
      case Awe32 :
      case ProAudioSpectrum :
      case SoundMan16 :
      case SoundScape :
      case SoundSource :
      case TandySoundSource :
      case UltraSound :
         devicestatus = MV_Init( SoundCard, FX_MixRate, numvoices,
            numchannels, samplebits );
         if ( devicestatus != MV_Ok )
            {
            FX_SetErrorCode( FX_MultiVocError );
            status = FX_Error;
            }
         break;

      default :
         FX_SetErrorCode( FX_InvalidCard );
         status = FX_Error;
      }

   if ( status != FX_Ok )
      {
      LL_UnlockMemory();
      }
   else
      {
      FX_Installed = TRUE;
      }

   return( status );
   }
Esempio n. 6
0
int FX_SetupCard
   (
   int SoundCard,
   fx_device *device
   )

   {
   int status;
   int DeviceStatus;

   if ( USER_CheckParameter( "ASSVER" ) )
      {
      FX_SetErrorCode( FX_ASSVersion );
      return( FX_Error );
      }

   FX_SoundDevice = SoundCard;

   status = FX_Ok;
   FX_SetErrorCode( FX_Ok );

#ifdef PLAT_DOS
   switch( SoundCard )
      {
      case SoundBlaster :
      case Awe32 :
         DeviceStatus = BLASTER_Init();
         if ( DeviceStatus != BLASTER_Ok )
            {
            FX_SetErrorCode( FX_SoundCardError );
            status = FX_Error;
            break;
            }

         device->MaxVoices = 32;
         BLASTER_GetCardInfo( &device->MaxSampleBits, &device->MaxChannels );
         break;

      case ProAudioSpectrum :
      case SoundMan16 :
         DeviceStatus = PAS_Init();
         if ( DeviceStatus != PAS_Ok )
            {
            FX_SetErrorCode( FX_SoundCardError );
            status = FX_Error;
            break;
            }

         device->MaxVoices = 32;
         PAS_GetCardInfo( &device->MaxSampleBits, &device->MaxChannels );
         break;

      case GenMidi :
      case SoundCanvas :
      case WaveBlaster :
         device->MaxVoices     = 0;
         device->MaxSampleBits = 0;
         device->MaxChannels   = 0;
         break;

      case SoundScape :
         device->MaxVoices = 32;
         DeviceStatus = SOUNDSCAPE_GetCardInfo( &device->MaxSampleBits,
            &device->MaxChannels );
         if ( DeviceStatus != SOUNDSCAPE_Ok )
            {
            FX_SetErrorCode( FX_SoundCardError );
            status = FX_Error;
            }
         break;

      case UltraSound :
         if ( GUSWAVE_Init( 8 ) != GUSWAVE_Ok )
            {
            FX_SetErrorCode( FX_SoundCardError );
            status = FX_Error;
            break;
            }

         device->MaxVoices     = 8;
         device->MaxSampleBits = 0;
         device->MaxChannels   = 0;
         break;

      case SoundSource :
      case TandySoundSource :
         DeviceStatus = SS_Init( SoundCard );
         if ( DeviceStatus != SS_Ok )
            {
            FX_SetErrorCode( FX_SoundCardError );
            status = FX_Error;
            break;
            }
         SS_Shutdown();
         device->MaxVoices     = 32;
         device->MaxSampleBits = 8;
         device->MaxChannels   = 1;
         break;
      default :
         FX_SetErrorCode( FX_InvalidCard );
         status = FX_Error;
      }
#else
      DeviceStatus = DSL_Init();
      if ( DeviceStatus != DSL_Ok )
         {
         FX_SetErrorCode( FX_SoundCardError );
         status = FX_Error;
         }
         else
         {
         device->MaxVoices     = 32;
         device->MaxSampleBits = 0;
         device->MaxChannels   = 0;
         }
#endif

   return( status );
   }