diff options
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp new file mode 100644 index 000000000..540b20f27 --- /dev/null +++ b/src/core/core.cpp | |||
| @@ -0,0 +1,58 @@ | |||
| 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 "mem_map.h" | ||
| 8 | #include "hw/hw.h" | ||
| 9 | #include "arm/disassembler/arm_disasm.h" | ||
| 10 | #include "arm/interpreter/arm_interpreter.h" | ||
| 11 | |||
| 12 | namespace Core { | ||
| 13 | |||
| 14 | ARM_Disasm* g_disasm = NULL; ///< ARM disassembler | ||
| 15 | ARM_Interface* g_app_core = NULL; ///< ARM11 application core | ||
| 16 | ARM_Interface* g_sys_core = NULL; ///< ARM11 system (OS) core | ||
| 17 | |||
| 18 | /// Run the core CPU loop | ||
| 19 | void RunLoop() { | ||
| 20 | // TODO(ShizZy): ImplementMe | ||
| 21 | } | ||
| 22 | |||
| 23 | /// Step the CPU one instruction | ||
| 24 | void SingleStep() { | ||
| 25 | g_app_core->Step(); | ||
| 26 | HW::Update(); | ||
| 27 | } | ||
| 28 | |||
| 29 | /// Halt the core | ||
| 30 | void Halt(const char *msg) { | ||
| 31 | // TODO(ShizZy): ImplementMe | ||
| 32 | } | ||
| 33 | |||
| 34 | /// Kill the core | ||
| 35 | void Stop() { | ||
| 36 | // TODO(ShizZy): ImplementMe | ||
| 37 | } | ||
| 38 | |||
| 39 | /// Initialize the core | ||
| 40 | int Init() { | ||
| 41 | NOTICE_LOG(MASTER_LOG, "Core initialized OK"); | ||
| 42 | |||
| 43 | g_disasm = new ARM_Disasm(); | ||
| 44 | g_app_core = new ARM_Interpreter(); | ||
| 45 | g_sys_core = new ARM_Interpreter(); | ||
| 46 | |||
| 47 | return 0; | ||
| 48 | } | ||
| 49 | |||
| 50 | void Shutdown() { | ||
| 51 | delete g_disasm; | ||
| 52 | delete g_app_core; | ||
| 53 | delete g_sys_core; | ||
| 54 | |||
| 55 | NOTICE_LOG(MASTER_LOG, "Core shutdown OK"); | ||
| 56 | } | ||
| 57 | |||
| 58 | } // namespace | ||