Ignore:
Timestamp:
Apr 30, 2001, 11:08:00 PM (24 years ago)
Author:
sandervl
Message:

DirectAudio interface updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sbliveos2/trunk/drv16/rm.cpp

    r157 r178  
    4242#include <dbgos2.h>
    4343
    44 char DeviceName[64] = "Creative Labs SoundBlaster Live";
    45 
     44#define EMU10K1_JOYSTICK_EXTENT 0x8     /* 8 byte I/O space */
     45#define EMU10K1_EXTENT  0x20    /* 32 byte I/O space */
     46
     47char DeviceName[64] = "Creative Labs SoundBlaster Live!";
     48char DeviceNameJoy[64] = "Creative Labs SoundBlaster Live! Joystick";
    4649/**@external LDev_Resources::isEmpty
    4750 *  Returns TRUE iff the LDev_Resources structure has no information.
     
    141144           ((pGIS->uchMajorVersion == 20) && (pGIS->uchMinorVersion > 30)) );
    142145   }
    143 
    144    if(getPCIConfiguration(pciId) == FALSE) {
    145       _state = rmDriverFailed;
    146    }
    147 
    148146}
    149147
     
    166164{
    167165#if 1
     166   if(getPCIConfiguration(DevID) == FALSE) {
     167      return FALSE;
     168   }
     169
    168170   //Manual detection in ResourceManager class constructor;
    169171   return (_state == rmDriverCreated || _state == rmAdapterCreated);
     
    203205 */
    204206#pragma off (unreferenced)
    205 LDev_Resources* ResourceManager::GetRMDetectedResources ( DEVID DevID , ULONG ulSearchFlags, bool fPciDevice)
     207LDev_Resources* ResourceManager::GetRMDetectedResources ( DEVID DevID , ULONG ulSearchFlags, bool fPciDevice, bool fJoystick)
    206208#pragma on (unreferenced)
    207209{
     
    215217
    216218   //Fill in resources read from PCI Configuration space
    217    pResources->uIRQLevel[0]  = pciConfigData->InterruptLine;
    218    if(pResources->uIRQLevel[0] == 0 || pResources->uIRQLevel[0] > 15)  {
    219         dprintf(("Invalid PCI irq %x", (int)pResources->uIRQLevel[0]));
    220         DebugInt3();
    221         return NULL;
     219   if(!fJoystick) {
     220        pResources->uIRQLevel[0]  = pciConfigData->InterruptLine;
     221        if(pResources->uIRQLevel[0] == 0 || pResources->uIRQLevel[0] > 15)  {
     222                dprintf(("Invalid PCI irq %x", (int)pResources->uIRQLevel[0]));
     223                DebugInt3();
     224                return NULL;
     225        }
    222226   }
    223227   pResources->uIOBase[0]   = (USHORT)(pciConfigData->Bar0 & 0xFFFFFFF0);
    224    pResources->uIOLength[0] = 0x20;
     228   if(fJoystick) {
     229        pResources->uIOLength[0] = EMU10K1_JOYSTICK_EXTENT;
     230   }
     231   else pResources->uIOLength[0] = EMU10K1_EXTENT;
    225232
    226233   return pResources;
     
    345352 */
    346353
    347 LDev_Resources* ResourceManager::pGetDevResources ( DEVID DevID , ULONG ulSearchFlags, bool fPciDevice)
     354LDev_Resources* ResourceManager::pGetDevResources ( DEVID DevID , ULONG ulSearchFlags, bool fPciDevice, bool fJoystick)
    348355{
    349356   APIRET rc;
     
    362369   // Initialize resource object.  Use detected information if available,
    363370   // otherwise use hardcoded defaults.
    364    pResources = GetRMDetectedResources( DevID, ulSearchFlags, fPciDevice );
     371   pResources = GetRMDetectedResources( DevID, ulSearchFlags, fPciDevice, fJoystick);
    365372   if (!pResources) goto exit;
    366373
     
    369376   if (! pResourceList) goto exit;
    370377   pahResources = _pahRMAllocResources( pResourceList );
    371    if (! pahResources) goto exit;
     378   if (! pahResources) {
     379       _state = rmAllocFailed;
     380       goto exit;
     381   }
    372382
    373383   //--- Here, we got all the resources we wanted.  Register adapter if not yet done.
     
    375385   if (_state != rmAdapterCreated) {
    376386      rc = _rmCreateAdapter();
    377 
    378       // Register the device with OS/2 RM.
    379       _rmCreateDevice((unsigned char __far *)DeviceName, pahResources );
    380    }
     387   }
     388
     389   // Register the device with OS/2 RM.
     390   if(fJoystick) {
     391        _rmCreateDevice((unsigned char __far *)DeviceNameJoy, pahResources );
     392   }
     393   else _rmCreateDevice((unsigned char __far *)DeviceName, pahResources );
    381394
    382395exit:
Note: See TracChangeset for help on using the changeset viewer.