diff --git a/src/emulator.c b/src/emulator.c index d586a93e..1229e735 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -107,19 +107,20 @@ static void *emu_video_thread(void *data) { /* make secondary context active for this thread */ r_make_current(emu->r2); - while (emu->running) { + while (1) { mutex_lock(emu->pending_mutex); /* wait for the next tile context provided by emu_start_render */ while (!emu->pending_ctx) { - /* check for shutdown */ - if (!emu->running) { - break; - } - cond_wait(emu->pending_cond, emu->pending_mutex); } + /* check for shutdown */ + if (!emu->running) { + mutex_unlock(emu->pending_mutex); + break; + } + /* parse the context, uploading its textures to the render backend */ tr_parse_context(emu->tr, emu->pending_ctx, &emu->video_ctx); emu->pending_ctx = NULL; @@ -325,6 +326,7 @@ static void emu_video_context_destroyed(void *userdata) { /* destroy the video thread */ if (emu->multi_threaded) { mutex_lock(emu->pending_mutex); + emu->pending_ctx = (struct tile_ctx *)0xdeadbeef; cond_signal(emu->pending_cond); mutex_unlock(emu->pending_mutex); diff --git a/src/hw/pvr/ta.c b/src/hw/pvr/ta.c index 5b006c32..8cf59c23 100644 --- a/src/hw/pvr/ta.c +++ b/src/hw/pvr/ta.c @@ -231,7 +231,7 @@ static void ta_soft_reset(struct ta *ta) { } static void ta_clear_textures(struct ta *ta) { - LOG_INFO("Texture cache cleared"); + LOG_INFO("ta_clear_textures"); struct rb_node *it = rb_first(&ta->live_entries); diff --git a/src/sdl_host.c b/src/sdl_host.c index 78ed7d81..21fddeda 100644 --- a/src/sdl_host.c +++ b/src/sdl_host.c @@ -547,7 +547,7 @@ static void input_handle_controller_removed(struct sdl_host *host, int port) { return; } - LOG_INFO("controller %s removed from port %d", SDL_GameControllerName(ctrl), + LOG_INFO("controller '%s' removed from port %d", SDL_GameControllerName(ctrl), port); SDL_GameControllerClose(ctrl); host->controllers[port] = NULL; @@ -563,14 +563,14 @@ static void input_handle_controller_added(struct sdl_host *host, } } if (port >= INPUT_MAX_CONTROLLERS) { - LOG_WARNING("No open ports to bind controller to"); + LOG_WARNING("no open ports to bind controller to"); return; } SDL_GameController *ctrl = SDL_GameControllerOpen(device_id); host->controllers[port] = ctrl; - LOG_INFO("controller %s added on port %d", SDL_GameControllerName(ctrl), + LOG_INFO("controller '%s' added on port %d", SDL_GameControllerName(ctrl), port); }