From 2cfa118f965376269f0173eeb3c7385f87ce0478 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 23 Jan 2012 01:30:24 +0200 Subject: [PATCH] Fix unattended dumping --- include/core/window.hpp | 2 ++ src/core/window.cpp | 4 +++- src/plat-dummy/graphics.cpp | 3 ++- src/util/lsnes-dumpavi.cpp | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/core/window.hpp b/include/core/window.hpp index 75189b9e..1212ca54 100644 --- a/include/core/window.hpp +++ b/include/core/window.hpp @@ -532,6 +532,8 @@ struct platform * Run all queues. */ static void run_queues() throw(); + + static bool pausing_allowed; }; class modal_pause_holder diff --git a/src/core/window.cpp b/src/core/window.cpp index e8e56352..7aea724d 100644 --- a/src/core/window.cpp +++ b/src/core/window.cpp @@ -420,6 +420,8 @@ void platform::flush_command_queue() throw() while(true) { mutex::holder h(*queue_lock); internal_run_queues(true); + if(!pausing_allowed) + return; uint64_t now = get_utime(); uint64_t waitleft = 0; waitleft = (now < continue_time) ? (continue_time - now) : 0; @@ -573,5 +575,5 @@ modal_pause_holder::~modal_pause_holder() platform::set_modal_pause(false); } - +bool platform::pausing_allowed = true; volatile bool queue_synchronous_fn_warning; diff --git a/src/plat-dummy/graphics.cpp b/src/plat-dummy/graphics.cpp index 0136eb28..95ececdc 100644 --- a/src/plat-dummy/graphics.cpp +++ b/src/plat-dummy/graphics.cpp @@ -10,6 +10,7 @@ namespace void graphics_plugin::init() throw() { + platform::pausing_allowed = false; } void graphics_plugin::quit() throw() @@ -29,7 +30,6 @@ void graphics_plugin::notify_message() throw() void graphics_plugin::notify_status() throw() { - std::cerr << "Exiting on fatal error." << std::endl; } void graphics_plugin::notify_screen() throw() @@ -44,6 +44,7 @@ bool graphics_plugin::modal_message(const std::string& text, bool confirm) throw void graphics_plugin::fatal_error() throw() { + std::cerr << "Exiting on fatal error." << std::endl; } const char* graphics_plugin::name = "Dummy graphics plugin"; diff --git a/src/util/lsnes-dumpavi.cpp b/src/util/lsnes-dumpavi.cpp index 5e8424f4..e44598c1 100644 --- a/src/util/lsnes-dumpavi.cpp +++ b/src/util/lsnes-dumpavi.cpp @@ -165,6 +165,7 @@ int main(int argc, char** argv) x << snes_library_id() << " (" << SNES::Info::Profile << " core)"; bsnes_core_version = x.str(); } + platform::init(); init_lua(); messages << "BSNES version: " << bsnes_core_version << std::endl;