aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hw/gpu.cpp
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2015-05-01 19:05:18 -0400
committerGravatar bunnei <bunneidev@gmail.com>2015-05-01 19:05:18 -0400
commit6a2d8c46f21e8813e0472dba28932ed461ce1a66 (patch)
treed7057cf9926c822c12cc7d82814a252db79ca600 /src/core/hw/gpu.cpp
parent4d30edc11effef4021a7bd7d5dfe1d92678708b9 (diff)
parent046dd6e3ef3f4b4da2dd2eef0bdfe0f6fb28b1d8 (diff)
Merge pull request #713 from bunnei/qt-emuthread-fixes
Fix emulation state resetting to support multiple emulation sessions
Diffstat (limited to 'src/core/hw/gpu.cpp')
-rw-r--r--src/core/hw/gpu.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index 308ea203..0ad7e296 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -29,8 +29,7 @@ namespace GPU {
Regs g_regs;
/// True if the current frame was skipped
-bool g_skip_frame = false;
-
+bool g_skip_frame;
/// 268MHz / gpu_refresh_rate frames per second
static u64 frame_ticks;
/// Event id for CoreTiming
@@ -38,7 +37,7 @@ static int vblank_event;
/// Total number of frames drawn
static u64 frame_count;
/// True if the last frame was skipped
-static bool last_skip_frame = false;
+static bool last_skip_frame;
template <typename T>
inline void Read(T &var, const u32 raw_addr) {
@@ -320,6 +319,8 @@ static void VBlankCallback(u64 userdata, int cycles_late) {
/// Initialize hardware
void Init() {
+ memset(&g_regs, 0, sizeof(g_regs));
+
auto& framebuffer_top = g_regs.framebuffer_config[0];
auto& framebuffer_sub = g_regs.framebuffer_config[1];
@@ -349,6 +350,7 @@ void Init() {
frame_ticks = 268123480 / Settings::values.gpu_refresh_rate;
last_skip_frame = false;
g_skip_frame = false;
+ frame_count = 0;
vblank_event = CoreTiming::RegisterEvent("GPU::VBlankCallback", VBlankCallback);
CoreTiming::ScheduleEvent(frame_ticks, vblank_event);