platform.c
void SDLFillAudio(void* udata, u8* stream_u8, int len)
    {
    s16* stream = (s16*)(stream_u8);
    u32 i; u8 flag = 0;

    len = (len/2) - 1;

    for (i = 0; i < len;)
        {
        if (buffer_start != buffer_end)
            {
            stream[i++] = AUDIO_BUFFER_L[buffer_start];
            stream[i++] = AUDIO_BUFFER_R[buffer_start];
            buffer_start = (buffer_start + 1) % AUDIO_BUFFER_SIZE;
            }    
        else
            {
            flag = 1;
            stream[i++] = 0;
            stream[i++] = 0;
            }
        }
    if (flag && !step_debugger) 
        {
        printf("audio buffer underflow\n");
        }

#ifdef SAVE_AUDIO_DATA_SDL
    fwrite(stream, sizeof(stream[0]), len, raw);
#endif
    }
/*
    Provide sound to SDL audio.
*/
Provide sound to SDL audio.
Provide sound to SDL audio .
void SDLFillAudio(void* udata, u8* stream_u8, int len)
    {
    s16* stream = (s16*)(stream_u8);
    u32 i; u8 flag = 0;
    len = (len/2) - 1;
    for (i = 0; i < len;)
        {
        if (buffer_start != buffer_end)
            {
            stream[i++] = AUDIO_BUFFER_L[buffer_start];
            stream[i++] = AUDIO_BUFFER_R[buffer_start];
            buffer_start = (buffer_start + 1) % AUDIO_BUFFER_SIZE;
            }    
        else
            {
            flag = 1;
            stream[i++] = 0;
            stream[i++] = 0;
            }
        }
    if (flag && !step_debugger) 
        {
        printf("audio buffer underflow\n");
        }
#ifdef SAVE_AUDIO_DATA_SDL
    fwrite(stream, sizeof(stream[0]), len, raw);
#endif
    }
void SDLFillAudio ( void * udata , u8 * stream_u8 , int len ) { s16 * stream = ( s16 * ) ( stream_u8 ) ; u32 i ; u8 flag = 0 ; len = ( len / 2 ) - 1 ; for ( i = 0 ; i < len ; ) { if ( buffer_start != buffer_end ) { stream [ i ++ ] = AUDIO_BUFFER_L [ buffer_start ] ; stream [ i ++ ] = AUDIO_BUFFER_R [ buffer_start ] ; buffer_start = ( buffer_start + 1 ) % AUDIO_BUFFER_SIZE ; } else { flag = 1 ; stream [ i ++ ] = 0 ; stream [ i ++ ] = 0 ; } } if ( flag && ! step_debugger ) { printf ( " \n " ) ; } #ifdef SAVE_AUDIO_DATA_SDL fwrite ( stream , sizeof ( stream [ 0 ] ) , len , raw ) ; #endif }
Provide sound to SDL audio.
Provide sound to SDL audio .