diff options
Diffstat (limited to 'src/core/hw/hw.cpp')
| -rw-r--r-- | src/core/hw/hw.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp new file mode 100644 index 000000000..57be4d6a8 --- /dev/null +++ b/src/core/hw/hw.cpp | |||
| @@ -0,0 +1,49 @@ | |||
| 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 "hw/hw.h" | ||
| 7 | #include "hw/hw_lcd.h" | ||
| 8 | |||
| 9 | namespace HW { | ||
| 10 | |||
| 11 | template <typename T> | ||
| 12 | inline void Read(T &var, const u32 addr) { | ||
| 13 | NOTICE_LOG(HW, "Hardware read from address %08X", addr); | ||
| 14 | } | ||
| 15 | |||
| 16 | template <typename T> | ||
| 17 | inline void Write(u32 addr, const T data) { | ||
| 18 | NOTICE_LOG(HW, "Hardware write to address %08X", addr); | ||
| 19 | } | ||
| 20 | |||
| 21 | // Explicitly instantiate template functions because we aren't defining this in the header: | ||
| 22 | |||
| 23 | template void Read<u64>(u64 &var, const u32 addr); | ||
| 24 | template void Read<u32>(u32 &var, const u32 addr); | ||
| 25 | template void Read<u16>(u16 &var, const u32 addr); | ||
| 26 | template void Read<u8>(u8 &var, const u32 addr); | ||
| 27 | |||
| 28 | template void Write<const u64>(u32 addr, const u64 data); | ||
| 29 | template void Write<const u32>(u32 addr, const u32 data); | ||
| 30 | template void Write<const u16>(u32 addr, const u16 data); | ||
| 31 | template void Write<const u8>(u32 addr, const u8 data); | ||
| 32 | |||
| 33 | /// Update hardware | ||
| 34 | void Update() { | ||
| 35 | LCD::Update(); | ||
| 36 | } | ||
| 37 | |||
| 38 | /// Initialize hardware | ||
| 39 | void Init() { | ||
| 40 | LCD::Init(); | ||
| 41 | NOTICE_LOG(HW, "Hardware initialized OK"); | ||
| 42 | } | ||
| 43 | |||
| 44 | /// Shutdown hardware | ||
| 45 | void Shutdown() { | ||
| 46 | NOTICE_LOG(HW, "Hardware shutdown OK"); | ||
| 47 | } | ||
| 48 | |||
| 49 | } \ No newline at end of file | ||