Changeset 178 for sbliveos2/trunk/drv16/rm.cpp
- Timestamp:
- Apr 30, 2001, 11:08:00 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sbliveos2/trunk/drv16/rm.cpp
r157 r178 42 42 #include <dbgos2.h> 43 43 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 47 char DeviceName[64] = "Creative Labs SoundBlaster Live!"; 48 char DeviceNameJoy[64] = "Creative Labs SoundBlaster Live! Joystick"; 46 49 /**@external LDev_Resources::isEmpty 47 50 * Returns TRUE iff the LDev_Resources structure has no information. … … 141 144 ((pGIS->uchMajorVersion == 20) && (pGIS->uchMinorVersion > 30)) ); 142 145 } 143 144 if(getPCIConfiguration(pciId) == FALSE) {145 _state = rmDriverFailed;146 }147 148 146 } 149 147 … … 166 164 { 167 165 #if 1 166 if(getPCIConfiguration(DevID) == FALSE) { 167 return FALSE; 168 } 169 168 170 //Manual detection in ResourceManager class constructor; 169 171 return (_state == rmDriverCreated || _state == rmAdapterCreated); … … 203 205 */ 204 206 #pragma off (unreferenced) 205 LDev_Resources* ResourceManager::GetRMDetectedResources ( DEVID DevID , ULONG ulSearchFlags, bool fPciDevice )207 LDev_Resources* ResourceManager::GetRMDetectedResources ( DEVID DevID , ULONG ulSearchFlags, bool fPciDevice, bool fJoystick) 206 208 #pragma on (unreferenced) 207 209 { … … 215 217 216 218 //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 } 222 226 } 223 227 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; 225 232 226 233 return pResources; … … 345 352 */ 346 353 347 LDev_Resources* ResourceManager::pGetDevResources ( DEVID DevID , ULONG ulSearchFlags, bool fPciDevice )354 LDev_Resources* ResourceManager::pGetDevResources ( DEVID DevID , ULONG ulSearchFlags, bool fPciDevice, bool fJoystick) 348 355 { 349 356 APIRET rc; … … 362 369 // Initialize resource object. Use detected information if available, 363 370 // otherwise use hardcoded defaults. 364 pResources = GetRMDetectedResources( DevID, ulSearchFlags, fPciDevice 371 pResources = GetRMDetectedResources( DevID, ulSearchFlags, fPciDevice, fJoystick); 365 372 if (!pResources) goto exit; 366 373 … … 369 376 if (! pResourceList) goto exit; 370 377 pahResources = _pahRMAllocResources( pResourceList ); 371 if (! pahResources) goto exit; 378 if (! pahResources) { 379 _state = rmAllocFailed; 380 goto exit; 381 } 372 382 373 383 //--- Here, we got all the resources we wanted. Register adapter if not yet done. … … 375 385 if (_state != rmAdapterCreated) { 376 386 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 ); 381 394 382 395 exit:
Note:
See TracChangeset
for help on using the changeset viewer.