Esempio n. 1
0
int main ( int argc, char** argv )
{
    printf("Starting test ... \n");

    gamepad_buttons[0] = 0; // all up
    gamepad_buttons[1] = 0;
    
    game_init();

    printf("  Game init done. \n");

    // program main loop
    for (int i=0;i<EMU_FRAMES;i++) {
        handle_gamepad();

        // update game
        game_frame();

        // update time
        vga_frame++;

        // one sound buffer per frame 
        game_snd_buffer(audio,BITBOX_SNDBUF_LEN); 

        refresh_screen();
    } // end main loop

    // all is well ;)
    printf("  Test OK !\n");
    return 0;
}
Esempio n. 2
0
static void mixaudio(void * userdata, Uint8 * stream, int len)
// this callback is called each time we need to fill the buffer
{
    game_snd_buffer((uint16_t *)stream,len/2);
}