comparison src/audio/dart/SDL_dart.c @ 2735:204be4fc2726

Final merge of Google Summer of Code 2008 work... Port SDL 1.3 to the Nintendo DS by Darren Alton, mentored by Sam Lantinga
author Sam Lantinga <slouken@libsdl.org>
date Wed, 27 Aug 2008 15:10:03 +0000
parents 866052b01ee5
children 99210400e8b9
comparison
equal deleted inserted replaced
2734:dd25eabe441c 2735:204be4fc2726
60 SDL_AudioDevice *pSDLAudioDevice = pBufDesc->pSDLAudioDevice; 60 SDL_AudioDevice *pSDLAudioDevice = pBufDesc->pSDLAudioDevice;
61 // Set the buffer to be empty 61 // Set the buffer to be empty
62 pBufDesc->iBufferUsage = BUFFER_EMPTY; 62 pBufDesc->iBufferUsage = BUFFER_EMPTY;
63 // And notify DART feeder thread that it will have to work a bit. 63 // And notify DART feeder thread that it will have to work a bit.
64 if (pSDLAudioDevice) 64 if (pSDLAudioDevice)
65 DosPostEventSem(pSDLAudioDevice->hidden-> 65 DosPostEventSem(pSDLAudioDevice->
66 hevAudioBufferPlayed); 66 hidden->hevAudioBufferPlayed);
67 } 67 }
68 } 68 }
69 } 69 }
70 return TRUE; 70 return TRUE;
71 } 71 }
310 310
311 pBufDesc = 311 pBufDesc =
312 (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf].ulUserParm; 312 (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf].ulUserParm;
313 pBufDesc->iBufferUsage = BUFFER_USED; 313 pBufDesc->iBufferUsage = BUFFER_USED;
314 // Send it to DART to be queued 314 // Send it to DART to be queued
315 _this->hidden->MixSetupParms.pmixWrite(_this->hidden->MixSetupParms. 315 _this->hidden->MixSetupParms.pmixWrite(_this->hidden->
316 ulMixHandle, 316 MixSetupParms.ulMixHandle,
317 &(_this->hidden-> 317 &(_this->
318 pMixBuffers[iFreeBuf]), 1); 318 hidden->pMixBuffers[iFreeBuf]),
319 1);
319 320
320 _this->hidden->iLastPlayedBuf = iFreeBuf; 321 _this->hidden->iLastPlayedBuf = iFreeBuf;
321 iFreeBuf = (iFreeBuf + 1) % _this->hidden->iCurrNumBufs; 322 iFreeBuf = (iFreeBuf + 1) % _this->hidden->iCurrNumBufs;
322 _this->hidden->iNextFreeBuffer = iFreeBuf; 323 _this->hidden->iNextFreeBuffer = iFreeBuf;
323 } 324 }
331 332
332 if (_this) { 333 if (_this) {
333 if (_this->hidden) { 334 if (_this->hidden) {
334 iFreeBuf = _this->hidden->iNextFreeBuffer; 335 iFreeBuf = _this->hidden->iNextFreeBuffer;
335 pBufDesc = 336 pBufDesc =
336 (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf]. 337 (pMixBufferDesc) _this->hidden->
337 ulUserParm; 338 pMixBuffers[iFreeBuf].ulUserParm;
338 339
339 if (pBufDesc) { 340 if (pBufDesc) {
340 if (pBufDesc->iBufferUsage == BUFFER_EMPTY) { 341 if (pBufDesc->iBufferUsage == BUFFER_EMPTY) {
341 pResult = _this->hidden->pMixBuffers[iFreeBuf].pBuffer; 342 pResult = _this->hidden->pMixBuffers[iFreeBuf].pBuffer;
342 return pResult; 343 return pResult;