diff options
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 | ||