Lines Matching refs:sdl
24 } sdl; variable
47 if (!sdl.inited) { in sandbox_sdl_ensure_init()
56 sdl.inited = true; in sandbox_sdl_ensure_init()
77 sdl.width = width; in sandbox_sdl_init_display()
78 sdl.height = height; in sandbox_sdl_init_display()
79 sdl.depth = 1 << log2_bpp; in sandbox_sdl_init_display()
80 sdl.pitch = sdl.width * sdl.depth / 8; in sandbox_sdl_init_display()
81 sdl.screen = SDL_SetVideoMode(width, height, 0, 0); in sandbox_sdl_init_display()
91 frame = SDL_CreateRGBSurfaceFrom(lcd_base, sdl.width, sdl.height, in sandbox_sdl_sync()
92 sdl.depth, sdl.pitch, in sandbox_sdl_sync()
94 SDL_BlitSurface(frame, NULL, sdl.screen, NULL); in sandbox_sdl_sync()
96 SDL_UpdateRect(sdl.screen, 0, 0, 0, 0); in sandbox_sdl_sync()
243 avail = sdl.audio_size - sdl.audio_pos; in sandbox_sdl_fill_audio()
247 SDL_MixAudio(stream, sdl.audio_data + sdl.audio_pos, len, in sandbox_sdl_fill_audio()
249 sdl.audio_pos += len; in sandbox_sdl_fill_audio()
252 if (sdl.audio_pos == sdl.audio_size) in sandbox_sdl_fill_audio()
253 sdl.audio_pos = 0; in sandbox_sdl_fill_audio()
263 if (sdl.audio_active) in sandbox_sdl_sound_init()
293 sdl.audio_size = sizeof(uint16_t) * wanted.freq; in sandbox_sdl_sound_init()
294 sdl.audio_data = malloc(sdl.audio_size); in sandbox_sdl_sound_init()
295 if (!sdl.audio_data) { in sandbox_sdl_sound_init()
299 sdl.audio_pos = 0; in sandbox_sdl_sound_init()
311 sdl.audio_active = true; in sandbox_sdl_sound_init()
316 free(sdl.audio_data); in sandbox_sdl_sound_init()
322 if (!sdl.audio_active) in sandbox_sdl_sound_start()
324 sdl.frequency = frequency; in sandbox_sdl_sound_start()
325 sound_create_square_wave((unsigned short *)sdl.audio_data, in sandbox_sdl_sound_start()
326 sdl.audio_size, frequency); in sandbox_sdl_sound_start()
327 sdl.audio_pos = 0; in sandbox_sdl_sound_start()
335 if (!sdl.audio_active) in sandbox_sdl_sound_stop()