summaryrefslogtreecommitdiff
path: root/src/core/hw/hw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hw/hw.cpp')
-rw-r--r--src/core/hw/hw.cpp49
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
9namespace HW {
10
11template <typename T>
12inline void Read(T &var, const u32 addr) {
13 NOTICE_LOG(HW, "Hardware read from address %08X", addr);
14}
15
16template <typename T>
17inline 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
23template void Read<u64>(u64 &var, const u32 addr);
24template void Read<u32>(u32 &var, const u32 addr);
25template void Read<u16>(u16 &var, const u32 addr);
26template void Read<u8>(u8 &var, const u32 addr);
27
28template void Write<const u64>(u32 addr, const u64 data);
29template void Write<const u32>(u32 addr, const u32 data);
30template void Write<const u16>(u32 addr, const u16 data);
31template void Write<const u8>(u32 addr, const u8 data);
32
33/// Update hardware
34void Update() {
35 LCD::Update();
36}
37
38/// Initialize hardware
39void Init() {
40 LCD::Init();
41 NOTICE_LOG(HW, "Hardware initialized OK");
42}
43
44/// Shutdown hardware
45void Shutdown() {
46 NOTICE_LOG(HW, "Hardware shutdown OK");
47}
48
49} \ No newline at end of file