Changeset 188 for sbliveos2/trunk/drv16
- Timestamp:
- Sep 9, 2001, 5:31:35 PM (24 years ago)
- Location:
- sbliveos2/trunk/drv16
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sbliveos2/trunk/drv16/init.cpp
r178 r188 65 65 #define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002UL 66 66 #endif 67 #define PCI_ID ((PCI_DEVICE_ID_CREATIVE_EMU10K1<<16UL)|PCI_VENDOR_ID_CREATIVE) 67 68 #ifndef PCI_DEVICE_ID_CREATIVE_EMU10K1_JOYSTICK 69 #define PCI_DEVICE_ID_CREATIVE_EMU10K1_JOYSTICK 0x7002 70 #endif 71 72 #define PCI_ID ((PCI_DEVICE_ID_CREATIVE_EMU10K1<<16UL)|PCI_VENDOR_ID_CREATIVE) 73 #define PCI_IDJOY ((PCI_DEVICE_ID_CREATIVE_EMU10K1_JOYSTICK<<16UL)|PCI_VENDOR_ID_CREATIVE) 68 74 69 75 // Default MIDI timer interval, milliseconds. … … 76 82 static char szSBLiveAllocResFailed1[] = "Another device driver was granted exclusive access to IRQ "; 77 83 static char szSBLiveAllocResFailed2[] = "Unable to allocate hardware resources! Aborting..."; 78 static char szSBLiveConfig1[] = "SB Live! configuration: IRQ ";79 static char szSBLiveConfig2[] = ", IO Port 0x";80 84 static char szSBLiveConfig1[] = "SB Live! configuration: IRQ "; 85 static char szSBLiveConfig2[] = ", IO Port 0x"; 86 static char szSBLiveConfigJoy[] = "SB Live! Joystick : IO Port 0x"; 81 87 82 88 // … … 183 189 HexWordToASCII(digit, pResources->uIOBase[0], 0); 184 190 DosWrite(1, (VOID FAR*)digit, strlen(digit), &result); 185 186 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);187 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result);188 191 } 189 192 delete pResources; 193 194 //Joystick detection 195 if(pRM->bIsDevDetected(PCI_IDJOY, SEARCH_ID_DEVICEID, TRUE)) 196 { 197 pResources = pRM->pGetDevResources(PCI_IDJOY, SEARCH_ID_DEVICEID, TRUE, TRUE); 198 if((pResources) && !pResources->isEmpty() && fVerbose) { 199 USHORT result; 200 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result); 201 DosWrite(1, (VOID FAR*)szSBLiveConfigJoy, sizeof(szSBLiveConfigJoy)-1, &result); 202 HexWordToASCII(digit, pResources->uIOBase[0], 0); 203 DosWrite(1, (VOID FAR*)digit, strlen(digit), &result); 204 } 205 delete pResources; 206 } 207 if (fVerbose) { 208 USHORT result; 209 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result); 210 DosWrite(1, (VOID FAR*)NEWLINE, sizeof(NEWLINE)-1, &result); 211 } 190 212 191 213 // Build the MPU401 object only if we got a good 2115 init. -
sbliveos2/trunk/drv16/ioctl.cpp
r186 r188 108 108 } 109 109 else { 110 delete pstream; 110 #if 1 111 // Rudi: Workaround for MMPM device sharing bug 112 if (pstream->ulStreamState & STREAM_STREAMING) { 113 CONTROL_PARM dummy; 114 pstream->PauseStream(&dummy); 115 pstream->ResumeStream(); 116 p->pvReserved = (VOID FAR *) (ULONG)prp->s.ioctl.usSysFileNum; 117 p->sReturnCode = 0; 118 return; 119 } 120 #endif 121 delete pstream; 111 122 } 112 123 } -
sbliveos2/trunk/drv16/wavestrm.cpp
r178 r188 165 165 //underrun: stop playback 166 166 dprintf(("underrun: stop playback")); 167 167 pahw->Stop(this); 168 168 fUnderrun = TRUE; 169 169 return; … … 171 171 space = OSS16_StreamGetSpace(this); 172 172 while(space) { 173 byteswritten = AddBuffer(space); 173 byteswritten = AddBuffer(space); 174 if(byteswritten == (ULONG)-1) break; 174 175 space -= byteswritten; 175 if(byteswritten == 0) break; 176 } 176 } 177 177 } 178 178 } … … 191 191 192 192 if(!pTemp || pTemp->ulBuffpos >= (pTemp->ulBuffsz & 0xFFFFFFFC)) { 193 193 pTemp = (PSTREAMBUFFER)qhInProcess.Head(); 194 194 } 195 195 if(!pTemp) { 196 196 dprintf4(("AddBuffer: pTemp == NULL")); 197 return 0;197 return (ULONG)-1; 198 198 } 199 199 … … 202 202 Buff_left = pTemp->ulBuffsz - pTemp->ulBuffpos; 203 203 204 // write the audio buffer 205 Buff_left = min(Buff_left, space); 206 byteswritten = OSS16_StreamAddBuffer(this, pdataBuf, Buff_left); 207 if(byteswritten == 0) { 208 return 0; //no more room 209 } 210 211 // update the buffer pos counter 212 pTemp->ulBuffpos += byteswritten; 213 214 if(pTemp != qhDone.Tail()) { 215 qhDone.PushOnTail(qhInProcess.PopHead()); 204 if(Buff_left) { 205 // write the audio buffer 206 Buff_left = min(Buff_left, space); 207 byteswritten = OSS16_StreamAddBuffer(this, pdataBuf, Buff_left); 208 if(byteswritten == 0) { 209 return (ULONG)-1; //no more room 210 } 211 212 // update the buffer pos counter 213 pTemp->ulBuffpos += byteswritten; 214 } 215 else byteswritten = 0; 216 217 if(pTemp == qhInProcess.Head()) { 218 qhDone.PushOnTail(qhInProcess.PopHead()); 216 219 } 217 220 dprintf4(("AddBuffer %lx size %d, bytes written %d", pdataBuf, (USHORT)Buff_left, (USHORT)byteswritten)); … … 299 302 else break; //shouldn't happen 300 303 } 301 302 //Get rid of empty buffers 303 ptemp = (PSTREAMBUFFER)qhInProcess.Head(); 304 if(ptemp && (ptemp->ulBuffsz == 0 || ptemp->pBuffptr == NULL)) { 305 dprintf(("Returning 0 size buffer immediately")); 306 ReturnBuffer(); 307 } 308 AddBuffers(FALSE); 309 break; 310 } 311 case STREAM_READ: 312 while(_vReadAudioBuf()); 313 break; 304 AddBuffers(FALSE); 305 break; 306 } 307 case STREAM_READ: 308 while(_vReadAudioBuf()); 309 break; 314 310 default: 315 311 break;
Note:
See TracChangeset
for help on using the changeset viewer.