From 9f8e8d024d457e20a0a63c2ef29d53065ccf53a2 Mon Sep 17 00:00:00 2001 From: Heath123 Date: Sun, 7 May 2023 12:54:53 +0100 Subject: [PATCH] Add missing file --- ion/src/simulator/prizm/power.cpp | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ion/src/simulator/prizm/power.cpp diff --git a/ion/src/simulator/prizm/power.cpp b/ion/src/simulator/prizm/power.cpp new file mode 100644 index 000000000..ff7d70e11 --- /dev/null +++ b/ion/src/simulator/prizm/power.cpp @@ -0,0 +1,39 @@ +#include +#include +#include + +#include "main.h" + +#include +#include + +void PowerOff(int displayLogo) { + __asm__ __volatile__ ( + "mov.l 2f, r2 \n\t" + "mov.l 1f, r0 \n\t" + "jmp @r2 \n\t" + "nop \n\t" + "1: \n\t" + ".long 0x1839 \n\t" + "2: \n\t" + ".long 0x80020070 \n\t" + ); +} + +void powerOff(void) { + PowerOff(1); +} + +namespace Ion { +namespace Power { + +void suspend(bool checkIfOnOffKeyReleased) { + Simulator::Main::runPowerOffSafe(powerOff, true); +} + +void standby() { + Simulator::Main::runPowerOffSafe(powerOff, true); +} + +} +}