summaryrefslogtreecommitdiff
path: root/src/00_Core/Player/TouchControl.cpp
diff options
context:
space:
mode:
authorAetias <aetias@outlook.com>2025-05-22 22:05:31 +0200
committerAetias <aetias@outlook.com>2025-05-22 22:05:31 +0200
commit0ae9b8c14902a59341ec84730d417eabe595f2de (patch)
tree03ce8d268435e7165017374eaee15fbc37b1ace6 /src/00_Core/Player/TouchControl.cpp
parent4a764f9d58cb16343c02afb3592aad7aabf66d6d (diff)
parent3f6a81d03dec2bd7c8394b508dbe4f017a5244b9 (diff)
Merge remote-tracking branch 'zeldaret/main' into decomp-PlayerControl
Diffstat (limited to 'src/00_Core/Player/TouchControl.cpp')
-rw-r--r--src/00_Core/Player/TouchControl.cpp34
1 files changed, 31 insertions, 3 deletions
diff --git a/src/00_Core/Player/TouchControl.cpp b/src/00_Core/Player/TouchControl.cpp
index 5cae75a5..9630de1a 100644
--- a/src/00_Core/Player/TouchControl.cpp
+++ b/src/00_Core/Player/TouchControl.cpp
@@ -1,11 +1,39 @@
#include "Player/TouchControl.hpp"
TouchControl::TouchControl() {}
-void TouchControl::IncreaseSpeed(s16 increase) {}
+
+void TouchControl::IncreaseSpeed(s16 increase) {
+ this->mFlags = 0;
+ this->mSpeed += increase;
+}
+
void TouchControl::UpdateFlags(u16 speed) {}
void TouchControl::UpdateWithStateFlags(TouchStateFlags *state, u16 speed) {}
void TouchControl::Update(TouchState *state, u16 speed) {}
-bool TouchControl::func_ov00_0207aeac() {}
+bool TouchControl::func_ov00_0207aeac() {
+ return ((*data_0207aecc & 0x8000) >> 15) == 1;
+}
void TouchControl::UpdateConditionally(TouchState *state, u16 speed) {}
-void TouchControl::func_ov00_0207af38(u16 speed, bool param2) {}
+
+void TouchControl::func_ov00_0207af38(u16 speedIncrease, bool shouldIncrease) {
+ TouchStateFlags touchState;
+
+ if (shouldIncrease) {
+ IncreaseSpeed(speedIncrease); /* TODO: IncreaseSpeed expects an s16 variable,
+ while speedIncrease is a u16. As a result, the function
+ performs a conversion that is not present in the binary. */
+ return;
+ }
+
+ u32 result = TouchControl::func_ov00_0207aeac();
+ if (result != 0) {
+ Fill16(0, &touchState.touchX, 8);
+ } else {
+
+ GetTouchStateFlags(&touchState);
+ }
+
+ UpdateWithStateFlags(&touchState, speedIncrease);
+}
+
TouchControl::~TouchControl() {}