diff options
| author | 2015-05-01 19:05:18 -0400 | |
|---|---|---|
| committer | 2015-05-01 19:05:18 -0400 | |
| commit | 6a2d8c46f21e8813e0472dba28932ed461ce1a66 (patch) | |
| tree | d7057cf9926c822c12cc7d82814a252db79ca600 /src/core/hw/gpu.cpp | |
| parent | Merge pull request #717 from linkmauve/useless-auto (diff) | |
| parent | Qt: Shutdown game on emulator close event. (diff) | |
| download | yuzu-6a2d8c46f21e8813e0472dba28932ed461ce1a66.tar.gz yuzu-6a2d8c46f21e8813e0472dba28932ed461ce1a66.tar.xz yuzu-6a2d8c46f21e8813e0472dba28932ed461ce1a66.zip | |
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.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 308ea2035..0ad7e2963 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp | |||
| @@ -29,8 +29,7 @@ namespace GPU { | |||
| 29 | Regs g_regs; | 29 | Regs g_regs; |
| 30 | 30 | ||
| 31 | /// True if the current frame was skipped | 31 | /// True if the current frame was skipped |
| 32 | bool g_skip_frame = false; | 32 | bool g_skip_frame; |
| 33 | |||
| 34 | /// 268MHz / gpu_refresh_rate frames per second | 33 | /// 268MHz / gpu_refresh_rate frames per second |
| 35 | static u64 frame_ticks; | 34 | static u64 frame_ticks; |
| 36 | /// Event id for CoreTiming | 35 | /// Event id for CoreTiming |
| @@ -38,7 +37,7 @@ static int vblank_event; | |||
| 38 | /// Total number of frames drawn | 37 | /// Total number of frames drawn |
| 39 | static u64 frame_count; | 38 | static u64 frame_count; |
| 40 | /// True if the last frame was skipped | 39 | /// True if the last frame was skipped |
| 41 | static bool last_skip_frame = false; | 40 | static bool last_skip_frame; |
| 42 | 41 | ||
| 43 | template <typename T> | 42 | template <typename T> |
| 44 | inline void Read(T &var, const u32 raw_addr) { | 43 | inline void Read(T &var, const u32 raw_addr) { |
| @@ -320,6 +319,8 @@ static void VBlankCallback(u64 userdata, int cycles_late) { | |||
| 320 | 319 | ||
| 321 | /// Initialize hardware | 320 | /// Initialize hardware |
| 322 | void Init() { | 321 | void Init() { |
| 322 | memset(&g_regs, 0, sizeof(g_regs)); | ||
| 323 | |||
| 323 | auto& framebuffer_top = g_regs.framebuffer_config[0]; | 324 | auto& framebuffer_top = g_regs.framebuffer_config[0]; |
| 324 | auto& framebuffer_sub = g_regs.framebuffer_config[1]; | 325 | auto& framebuffer_sub = g_regs.framebuffer_config[1]; |
| 325 | 326 | ||
| @@ -349,6 +350,7 @@ void Init() { | |||
| 349 | frame_ticks = 268123480 / Settings::values.gpu_refresh_rate; | 350 | frame_ticks = 268123480 / Settings::values.gpu_refresh_rate; |
| 350 | last_skip_frame = false; | 351 | last_skip_frame = false; |
| 351 | g_skip_frame = false; | 352 | g_skip_frame = false; |
| 353 | frame_count = 0; | ||
| 352 | 354 | ||
| 353 | vblank_event = CoreTiming::RegisterEvent("GPU::VBlankCallback", VBlankCallback); | 355 | vblank_event = CoreTiming::RegisterEvent("GPU::VBlankCallback", VBlankCallback); |
| 354 | CoreTiming::ScheduleEvent(frame_ticks, vblank_event); | 356 | CoreTiming::ScheduleEvent(frame_ticks, vblank_event); |