diff options
author | bunnei <bunneidev@gmail.com> | 2015-04-28 04:03:35 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-05-02 00:27:02 +0200 |
commit | 57aaaf92dbbdb4c1d43f6b564c7e8f83ab0811e7 (patch) | |
tree | 851fb394c4fe279ca90cae70112d33aa9c4e7d6b /src/core | |
parent | Services: Initialize all state variables at bootup. (diff) | |
download | yuzu-57aaaf92dbbdb4c1d43f6b564c7e8f83ab0811e7.tar yuzu-57aaaf92dbbdb4c1d43f6b564c7e8f83ab0811e7.tar.gz yuzu-57aaaf92dbbdb4c1d43f6b564c7e8f83ab0811e7.tar.bz2 yuzu-57aaaf92dbbdb4c1d43f6b564c7e8f83ab0811e7.tar.lz yuzu-57aaaf92dbbdb4c1d43f6b564c7e8f83ab0811e7.tar.xz yuzu-57aaaf92dbbdb4c1d43f6b564c7e8f83ab0811e7.tar.zst yuzu-57aaaf92dbbdb4c1d43f6b564c7e8f83ab0811e7.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hw/gpu.cpp | 8 | ||||
-rw-r--r-- | src/core/hw/hw.cpp | 2 | ||||
-rw-r--r-- | src/core/hw/lcd.cpp | 1 |
3 files changed, 8 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 { 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); diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp index bed50af50..236958139 100644 --- a/src/core/hw/hw.cpp +++ b/src/core/hw/hw.cpp @@ -63,6 +63,8 @@ void Init() { /// Shutdown hardware void Shutdown() { + GPU::Shutdown(); + LCD::Shutdown(); LOG_DEBUG(HW, "shutdown OK"); } diff --git a/src/core/hw/lcd.cpp b/src/core/hw/lcd.cpp index 7986f3ddb..8a09c3bc0 100644 --- a/src/core/hw/lcd.cpp +++ b/src/core/hw/lcd.cpp @@ -55,6 +55,7 @@ template void Write<u8>(u32 addr, const u8 data); /// Initialize hardware void Init() { + memset(&g_regs, 0, sizeof(g_regs)); LOG_DEBUG(HW_LCD, "initialized OK"); } |