From 7299895b4833521ebf80cc8812c734382e60225f Mon Sep 17 00:00:00 2001
From: bunnei <bunneidev@gmail.com>
Date: Mon, 29 Aug 2016 21:28:31 -0400
Subject: system: Add a function to see if the emulator is running.

---
 src/core/system.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'src/core/system.cpp')

diff --git a/src/core/system.cpp b/src/core/system.cpp
index 4a4757af38..4fc266cb09 100644
--- a/src/core/system.cpp
+++ b/src/core/system.cpp
@@ -17,6 +17,8 @@
 
 namespace System {
 
+static bool is_powered_on{ false };
+
 Result Init(EmuWindow* emu_window) {
     Core::Init();
     CoreTiming::Init();
@@ -30,9 +32,15 @@ Result Init(EmuWindow* emu_window) {
     AudioCore::Init();
     GDBStub::Init();
 
+    is_powered_on = true;
+
     return Result::Success;
 }
 
+bool IsPoweredOn() {
+    return is_powered_on;
+}
+
 void Shutdown() {
     GDBStub::Shutdown();
     AudioCore::Shutdown();
@@ -42,6 +50,8 @@ void Shutdown() {
     HW::Shutdown();
     CoreTiming::Shutdown();
     Core::Shutdown();
+
+    is_powered_on = false;
 }
 
 } // namespace
-- 
cgit v1.2.3-70-g09d2