summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2021-06-24 23:50:52 -0700
committertheo3 <arisstephenson2@gmail.com>2021-06-25 20:29:11 -0700
commitd12508cfce49ca4bf620c688aea7f14f1e161ca7 (patch)
tree252ad40be49298c67c5c1e2ba970d3191a7a3e09
parent24cc84add75663b733efa704e3d20e3f31b462a0 (diff)
AutoDim decompiled
-rw-r--r--data/uking_functions.csv10
-rw-r--r--src/KingSystem/System/AutoDim.cpp22
-rw-r--r--src/KingSystem/System/AutoDim.h19
-rw-r--r--src/KingSystem/System/CMakeLists.txt2
4 files changed, 48 insertions, 5 deletions
diff --git a/data/uking_functions.csv b/data/uking_functions.csv
index 374ed3bc..8232917e 100644
--- a/data/uking_functions.csv
+++ b/data/uking_functions.csv
@@ -88649,11 +88649,11 @@
0x00000071010b6558,sub_71010B6558,24,
0x00000071010b6570,sub_71010B6570,200,
0x00000071010b6638,sub_71010B6638,376,
-0x00000071010b67b0,sub_71010B67B0,96,
-0x00000071010b6810,sub_71010B6810,104,
-0x00000071010b6878,AutoDim::createInstance,136,
-0x00000071010b6900,AutoDim::__auto1,84,
-0x00000071010b6954,AutoDim::__auto0,8,
+0x00000071010b67b0,sub_71010B67B0,96,_ZN4ksys7AutoDim18SingletonDisposer_D1Ev
+0x00000071010b6810,sub_71010B6810,104,_ZN4ksys7AutoDim18SingletonDisposer_D0Ev
+0x00000071010b6878,AutoDim::createInstance,136,_ZN4ksys7AutoDim14createInstanceEPN4sead4HeapE
+0x00000071010b6900,AutoDim::__auto1,84,_ZN4ksys7AutoDim10setEnabledEb
+0x00000071010b6954,AutoDim::__auto0,8,_ZNK4ksys7AutoDim9isEnabledEv
0x00000071010b695c,sub_71010B695C,384,
0x00000071010b6adc,sub_71010B6ADC,68,
0x00000071010b6b20,sub_71010B6B20,64,
diff --git a/src/KingSystem/System/AutoDim.cpp b/src/KingSystem/System/AutoDim.cpp
new file mode 100644
index 00000000..c222f790
--- /dev/null
+++ b/src/KingSystem/System/AutoDim.cpp
@@ -0,0 +1,22 @@
+#include "KingSystem/System/AutoDim.h"
+#include <nn/oe.h>
+#include <prim/seadScopedLock.h>
+
+namespace ksys {
+
+SEAD_SINGLETON_DISPOSER_IMPL(AutoDim)
+
+void AutoDim::setEnabled(bool enable) {
+ const auto lock = sead::makeScopedLock(mCS);
+ mEnabled = enable;
+ if (enable)
+ nn::oe::SetUserInactivityDetectionTimeExtended(false);
+ else
+ nn::oe::SetUserInactivityDetectionTimeExtended(true);
+}
+
+bool AutoDim::isEnabled() const {
+ return mEnabled;
+}
+
+} // namespace ksys
diff --git a/src/KingSystem/System/AutoDim.h b/src/KingSystem/System/AutoDim.h
new file mode 100644
index 00000000..b893da53
--- /dev/null
+++ b/src/KingSystem/System/AutoDim.h
@@ -0,0 +1,19 @@
+#include <heap/seadDisposer.h>
+#include <thread/seadCriticalSection.h>
+
+namespace ksys {
+
+class AutoDim {
+ SEAD_SINGLETON_DISPOSER(AutoDim)
+ AutoDim() = default;
+
+public:
+ void setEnabled(bool enable);
+ bool isEnabled() const;
+
+private:
+ bool mEnabled = true;
+ sead::CriticalSection mCS{};
+};
+
+} // namespace ksys
diff --git a/src/KingSystem/System/CMakeLists.txt b/src/KingSystem/System/CMakeLists.txt
index d59a029b..6bc04a57 100644
--- a/src/KingSystem/System/CMakeLists.txt
+++ b/src/KingSystem/System/CMakeLists.txt
@@ -1,6 +1,8 @@
target_sources(uking PRIVATE
Account.cpp
Account.h
+ AutoDim.cpp
+ AutoDim.h
BasicProfiler.cpp
BasicProfiler.h
CameraEditor.cpp