diff options
| author | 2014-04-08 19:25:03 -0400 | |
|---|---|---|
| committer | 2014-04-08 19:25:03 -0400 | |
| commit | 63e46abdb8764bc97e91bae862c8d461e61b1965 (patch) | |
| tree | e73f4aa25d7b4015a265e7bbfb6004dab7561027 /src/core/hw/hw_lcd.cpp | |
| parent | fixed some license headers that I missed (diff) | |
| download | yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar.gz yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar.xz yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.zip | |
got rid of 'src' folders in each sub-project
Diffstat (limited to 'src/core/hw/hw_lcd.cpp')
| -rw-r--r-- | src/core/hw/hw_lcd.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/core/hw/hw_lcd.cpp b/src/core/hw/hw_lcd.cpp new file mode 100644 index 000000000..ad346c794 --- /dev/null +++ b/src/core/hw/hw_lcd.cpp | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "log.h" | ||
| 6 | #include "core.h" | ||
| 7 | #include "hw_lcd.h" | ||
| 8 | #include "video_core.h" | ||
| 9 | |||
| 10 | namespace LCD { | ||
| 11 | |||
| 12 | static const u32 kFrameTicks = 268123480 / 60; ///< 268MHz / 60 frames per second | ||
| 13 | |||
| 14 | u64 g_last_ticks = 0; ///< Last CPU ticks | ||
| 15 | |||
| 16 | template <typename T> | ||
| 17 | inline void Read(T &var, const u32 addr) { | ||
| 18 | } | ||
| 19 | |||
| 20 | template <typename T> | ||
| 21 | inline void Write(u32 addr, const T data) { | ||
| 22 | } | ||
| 23 | |||
| 24 | /// Update hardware | ||
| 25 | void Update() { | ||
| 26 | u64 current_ticks = Core::g_app_core->GetTicks(); | ||
| 27 | |||
| 28 | if ((current_ticks - g_last_ticks) >= kFrameTicks) { | ||
| 29 | g_last_ticks = current_ticks; | ||
| 30 | VideoCore::g_renderer->SwapBuffers(); | ||
| 31 | } | ||
| 32 | } | ||
| 33 | |||
| 34 | /// Initialize hardware | ||
| 35 | void Init() { | ||
| 36 | g_last_ticks = Core::g_app_core->GetTicks(); | ||
| 37 | NOTICE_LOG(LCD, "LCD initialized OK"); | ||
| 38 | } | ||
| 39 | |||
| 40 | /// Shutdown hardware | ||
| 41 | void Shutdown() { | ||
| 42 | NOTICE_LOG(LCD, "LCD shutdown OK"); | ||
| 43 | } | ||
| 44 | |||
| 45 | } // namespace | ||