diff options
| author | 2014-04-18 17:52:49 -0400 | |
|---|---|---|
| committer | 2014-04-18 17:52:49 -0400 | |
| commit | 958bca606e80110e05d7c142dda3097fddc96503 (patch) | |
| tree | 576917751444b4dfdb476d040b4e075bde431b7b /src/core/hw/lcd.cpp | |
| parent | Init window size from VideoCore. Start changing the default window behavior... (diff) | |
| parent | renamed hw_lcd module to just lcd (diff) | |
| download | yuzu-958bca606e80110e05d7c142dda3097fddc96503.tar.gz yuzu-958bca606e80110e05d7c142dda3097fddc96503.tar.xz yuzu-958bca606e80110e05d7c142dda3097fddc96503.zip | |
Merge branch 'hle-interface'
Diffstat (limited to 'src/core/hw/lcd.cpp')
| -rw-r--r-- | src/core/hw/lcd.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/core/hw/lcd.cpp b/src/core/hw/lcd.cpp new file mode 100644 index 000000000..3013673f8 --- /dev/null +++ b/src/core/hw/lcd.cpp | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "common/common_types.h" | ||
| 6 | #include "common/log.h" | ||
| 7 | |||
| 8 | #include "core/core.h" | ||
| 9 | #include "core/hw/lcd.h" | ||
| 10 | |||
| 11 | #include "video_core/video_core.h" | ||
| 12 | |||
| 13 | namespace LCD { | ||
| 14 | |||
| 15 | static const u32 kFrameTicks = 268123480 / 60; ///< 268MHz / 60 frames per second | ||
| 16 | |||
| 17 | u64 g_last_ticks = 0; ///< Last CPU ticks | ||
| 18 | |||
| 19 | template <typename T> | ||
| 20 | inline void Read(T &var, const u32 addr) { | ||
| 21 | } | ||
| 22 | |||
| 23 | template <typename T> | ||
| 24 | inline void Write(u32 addr, const T data) { | ||
| 25 | } | ||
| 26 | |||
| 27 | /// Update hardware | ||
| 28 | void Update() { | ||
| 29 | u64 current_ticks = Core::g_app_core->GetTicks(); | ||
| 30 | |||
| 31 | if ((current_ticks - g_last_ticks) >= kFrameTicks) { | ||
| 32 | g_last_ticks = current_ticks; | ||
| 33 | VideoCore::g_renderer->SwapBuffers(); | ||
| 34 | } | ||
| 35 | } | ||
| 36 | |||
| 37 | /// Initialize hardware | ||
| 38 | void Init() { | ||
| 39 | g_last_ticks = Core::g_app_core->GetTicks(); | ||
| 40 | NOTICE_LOG(LCD, "initialized OK"); | ||
| 41 | } | ||
| 42 | |||
| 43 | /// Shutdown hardware | ||
| 44 | void Shutdown() { | ||
| 45 | NOTICE_LOG(LCD, "shutdown OK"); | ||
| 46 | } | ||
| 47 | |||
| 48 | } // namespace | ||