2024-03-19 17:53:59 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "global.h"
|
2024-10-12 16:16:32 +02:00
|
|
|
#include "lib/touch.h"
|
2025-01-18 15:50:03 +01:00
|
|
|
#include "nds/math.h"
|
2024-10-12 16:16:32 +02:00
|
|
|
#include "types.h"
|
2024-03-19 17:53:59 +01:00
|
|
|
|
2025-02-24 20:22:07 +01:00
|
|
|
extern u16 *data_0207aecc;
|
|
|
|
|
|
2024-03-19 17:53:59 +01:00
|
|
|
typedef u16 TouchFlags;
|
|
|
|
|
enum TouchFlag_ {
|
2024-10-12 16:16:32 +02:00
|
|
|
TouchFlag_TouchedNow = 0x0001,
|
2024-03-19 17:53:59 +01:00
|
|
|
TouchFlag_UntouchedNow = 0x0002,
|
2024-10-12 16:16:32 +02:00
|
|
|
TouchFlag_Repeat = 0x0004,
|
2024-03-19 17:53:59 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class TouchControl {
|
|
|
|
|
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;
|
|
|
|
|
// 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;
|
|
|
|
|
/* 0c */ bool mTouch;
|
|
|
|
|
/* 10 */ s32 mTouchX;
|
|
|
|
|
/* 14 */ s32 mTouchY;
|
|
|
|
|
/* 18 */ bool mTouchPrev;
|
|
|
|
|
/* 1c */ s32 mTouchPrevX;
|
|
|
|
|
/* 20 */ s32 mTouchPrevY;
|
|
|
|
|
/* 24 */ s32 mTouchLastX;
|
|
|
|
|
/* 28 */ s32 mTouchLastY;
|
|
|
|
|
/* 2c */ s32 mTouchStartX;
|
|
|
|
|
/* 30 */ s32 mTouchStartY;
|
|
|
|
|
/* 34 */ TouchFlags mFlags;
|
|
|
|
|
/* 36 */
|
|
|
|
|
|
2025-07-13 15:11:50 +02:00
|
|
|
TouchControl();
|
|
|
|
|
TouchControl(unk32 param_1);
|
|
|
|
|
~TouchControl();
|
|
|
|
|
|
2025-07-06 14:47:44 +02:00
|
|
|
void Init();
|
2024-03-19 17:53:59 +01:00
|
|
|
void IncreaseSpeed(s16 increase);
|
|
|
|
|
void UpdateFlags(u16 speed);
|
|
|
|
|
void UpdateWithStateFlags(TouchStateFlags *state, u16 speed);
|
|
|
|
|
void Update(TouchState *state, u16 speed);
|
|
|
|
|
bool func_ov00_0207aeac();
|
|
|
|
|
void UpdateConditionally(TouchState *state, u16 speed);
|
2025-02-24 20:22:07 +01:00
|
|
|
void func_ov00_0207af38(u16 speedIncrease, bool shouldIncrease);
|
2024-05-25 11:16:50 +02:00
|
|
|
|
|
|
|
|
static bool func_0202b864(Vec3p *param1, s32 size, unk8 param3);
|
|
|
|
|
static bool func_0202b894(Vec3p *param1, s32 size, unk8 param3);
|
2024-03-19 17:53:59 +01:00
|
|
|
};
|
2025-02-24 20:22:07 +01:00
|
|
|
|
2025-07-13 15:11:50 +02:00
|
|
|
extern "C" void Fill16(int value, unsigned short *dst, int size); // TODO: Replace with header file
|