diff options
| author | Yanis <35189056+Yanis002@users.noreply.github.com> | 2026-01-30 18:36:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-30 18:36:20 +0100 |
| commit | 98cc0af690719f10bd7b67c1c11d207bfcdbbfe7 (patch) | |
| tree | 106937a3d0b6476d44872d8ccf2cfc6b0a6a03df /include | |
| parent | e5701a754e910812061cdd7aa2012feca050a6c4 (diff) | |
Started `TouchControl.cpp` (#111)
* start both `TouchControl.cpp`
* fix build issues
* complete touchcontrol
* remove useless comment
---------
Co-authored-by: Yanis002 <Yanis002@users.noreply.github.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/Player/TouchControl.hpp | 12 | ||||
| -rw-r--r-- | include/lib/touch.h | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/include/Player/TouchControl.hpp b/include/Player/TouchControl.hpp index ee63a3ee..efe18d97 100644 --- a/include/Player/TouchControl.hpp +++ b/include/Player/TouchControl.hpp @@ -9,6 +9,7 @@ extern u16 *data_0207aecc; typedef u16 TouchFlags; enum TouchFlag_ { + TouchFlag_None = 0x0000, TouchFlag_TouchedNow = 0x0001, TouchFlag_UntouchedNow = 0x0002, TouchFlag_Repeat = 0x0004, @@ -19,11 +20,11 @@ public: /* 00 */ u16 mSpeed; /* 02 */ u16 mTimeBetweenTouches; // gets set to mTimeSinceTouch when touching the screen /* 04 */ u16 mTimeSinceTouch; // increases by mSpeed every frame - /* 06 */ unk16 mRepeatStart; - /* 08 */ unk16 mRepeatLoop; + /* 06 */ u16 mRepeatStart; + /* 08 */ u16 mRepeatLoop; // mRepeatTimer starts at mRepeatStart, decreases by mSpeed while touching the screen. // if equal to 0, mRepeatTimer gets set to mRepeatLoop and the Repeat flag is set - /* 0a */ unk16 mRepeatTimer; + /* 0a */ u16 mRepeatTimer; /* 0c */ bool mTouch; /* 10 */ s32 mTouchX; /* 14 */ s32 mTouchY; @@ -34,7 +35,7 @@ public: /* 28 */ s32 mTouchLastY; /* 2c */ s32 mTouchStartX; /* 30 */ s32 mTouchStartY; - /* 34 */ TouchFlags mFlags; + /* 34 */ volatile TouchFlags mFlags; /* 36 */ TouchControl(); @@ -42,7 +43,7 @@ public: ~TouchControl(); void Init(); - void IncreaseSpeed(s16 increase); + void IncreaseSpeed(u16 increase); void UpdateFlags(u16 speed); void UpdateWithStateFlags(TouchStateFlags *state, u16 speed); void Update(TouchState *state, u16 speed); @@ -53,6 +54,7 @@ public: static bool func_0202b864(Vec3p *param1, s32 size, unk8 param3); static bool func_0202b894(Vec3p *param1, s32 size, unk8 param3); }; + extern TouchControl gTouchControl; extern "C" void Fill16(int value, unsigned short *dst, int size); // TODO: Replace with header file diff --git a/include/lib/touch.h b/include/lib/touch.h index 4bc0ed30..e5848f5f 100644 --- a/include/lib/touch.h +++ b/include/lib/touch.h @@ -16,5 +16,7 @@ struct TouchState { s32 touchY; }; +extern "C" { void WaitForTouchUpdate(u16 param1); bool GetTouchStateFlags(TouchStateFlags *pState); +} |
