1#pragma once
2
3#include <math/seadVector.h>
4
5namespace sead {
6class ControllerBase;
7}
8
9namespace al {
10class IUseCamera;
11
12bool isPadTypeJoySingle(s32 port = -1);
13
14bool isPadTrigger(s32 port, s32 button);
15bool isPadTriggerA(s32 port = -1);
16bool isPadTriggerB(s32 port = -1);
17bool isPadTriggerX(s32 port = -1);
18bool isPadTriggerY(s32 port = -1);
19bool isPadTriggerZL(s32 port = -1);
20bool isPadTriggerZR(s32 port = -1);
21bool isPadTriggerL(s32 port = -1);
22bool isPadTriggerR(s32 port = -1);
23bool isPadTrigger1(s32 port = -1);
24bool isPadTrigger2(s32 port = -1);
25bool isPadTriggerUp(s32 port = -1);
26bool isPadTriggerDown(s32 port = -1);
27bool isPadTriggerLeft(s32 port = -1);
28bool isPadTriggerRight(s32 port = -1);
29bool isPadTriggerLeftUp(s32 port = -1);
30bool isPadTriggerLeftDown(s32 port = -1);
31bool isPadTriggerRightUp(s32 port = -1);
32bool isPadTriggerRightDown(s32 port = -1);
33bool isPadTriggerHome(s32 port = -1);
34bool isPadTriggerStart(s32 port = -1);
35bool isPadTriggerSelect(s32 port = -1);
36bool isPadTriggerPlus(s32 port = -1);
37bool isPadTriggerMinus(s32 port = -1);
38bool isPadTriggerTouch();
39bool isPadTriggerUpLeftStick(s32 port = -1);
40bool isPadTriggerDownLeftStick(s32 port = -1);
41bool isPadTriggerLeftLeftStick(s32 port = -1);
42bool isPadTriggerRightLeftStick(s32 port = -1);
43bool isPadTriggerUpRightStick(s32 port = -1);
44bool isPadTriggerDownRightStick(s32 port = -1);
45bool isPadTriggerLeftRightStick(s32 port = -1);
46bool isPadTriggerRightRightStick(s32 port = -1);
47bool isPadTriggerAnyABXY(s32 port = -1);
48bool isPadTriggerAny(s32 port = -1);
49bool isPadTriggerLeftStick(s32 port = -1);
50bool isPadTriggerRightStick(s32 port = -1);
51bool isPadTriggerPressLeftStick(s32 port = -1);
52bool isPadTriggerPressRightStick(s32 port = -1);
53bool isPadTriggerUiCursorUp(s32 port = -1); // TODO implement below
54bool isPadTriggerUiCursorDown(s32 port = -1);
55bool isPadTriggerUiCursorLeft(s32 port = -1);
56bool isPadTriggerUiCursorRight(s32 port = -1);
57
58bool isPadRepeatA(s32 port = -1);
59bool isPadRepeatB(s32 port = -1);
60bool isPadRepeatX(s32 port = -1);
61bool isPadRepeatY(s32 port = -1);
62bool isPadRepeatZL(s32 port = -1);
63bool isPadRepeatZR(s32 port = -1);
64bool isPadRepeatL(s32 port = -1);
65bool isPadRepeatR(s32 port = -1);
66bool isPadRepeat1(s32 port = -1);
67bool isPadRepeat2(s32 port = -1);
68bool isPadRepeatUp(s32 port = -1);
69bool isPadRepeatDown(s32 port = -1);
70bool isPadRepeatLeft(s32 port = -1);
71bool isPadRepeatRight(s32 port = -1);
72bool isPadRepeatHome(s32 port = -1);
73bool isPadRepeatStart(s32 port = -1);
74bool isPadRepeatSelect(s32 port = -1);
75bool isPadRepeatPlus(s32 port = -1);
76bool isPadRepeatMinus(s32 port = -1);
77bool isPadRepeatTouch();
78bool isPadRepeatUpLeftStick(s32 port = -1);
79bool isPadRepeatDownLeftStick(s32 port = -1);
80bool isPadRepeatLeftLeftStick(s32 port = -1);
81bool isPadRepeatRightLeftStick(s32 port = -1);
82bool isPadRepeatUpRightStick(s32 port = -1);
83bool isPadRepeatDownRightStick(s32 port = -1);
84bool isPadRepeatLeftRightStick(s32 port = -1);
85bool isPadRepeatRightRightStick(s32 port = -1);
86bool isPadRepeatUiCursorUp(s32 port = -1); // TODO implement below
87bool isPadRepeatUiCursorDown(s32 port = -1);
88bool isPadRepeatUiCursorLeft(s32 port = -1);
89bool isPadRepeatUiCursorRight(s32 port = -1);
90
91bool isPadHoldPressLeftStick(s32 port = -1);
92bool isPadHoldPressRightStick(s32 port = -1);
93bool isPadHold(s32, s32);
94bool isPadHoldA(s32 port = -1);
95bool isPadHoldB(s32 port = -1);
96bool isPadHoldX(s32 port = -1);
97bool isPadHoldY(s32 port = -1);
98bool isPadHoldZL(s32 port = -1);
99bool isPadHoldZR(s32 port = -1);
100bool isPadHoldL(s32 port = -1);
101bool isPadHoldR(s32 port = -1);
102bool isPadHold1(s32 port = -1);
103bool isPadHold2(s32 port = -1);
104bool isPadHoldUp(s32 port = -1);
105bool isPadHoldDown(s32 port = -1);
106bool isPadHoldLeft(s32 port = -1);
107bool isPadHoldRight(s32 port = -1);
108bool isPadHoldLeftUp(s32 port = -1);
109bool isPadHoldLeftDown(s32 port = -1);
110bool isPadHoldRightUp(s32 port = -1);
111bool isPadHoldRightDown(s32 port = -1);
112bool isPadHoldHome(s32 port = -1);
113bool isPadHoldStart(s32 port = -1);
114bool isPadHoldSelect(s32 port = -1);
115bool isPadHoldPlus(s32 port = -1);
116bool isPadHoldMinus(s32 port = -1);
117bool isPadHoldAny(s32 port = -1);
118bool isPadHoldAnyWithoutStick(s32 port = -1);
119bool isPadHoldTouch();
120bool isPadHoldUpLeftStick(s32 port = -1);
121bool isPadHoldDownLeftStick(s32 port = -1);
122bool isPadHoldLeftLeftStick(s32 port = -1);
123bool isPadHoldRightLeftStick(s32 port = -1);
124bool isPadHoldUpRightStick(s32 port = -1);
125bool isPadHoldDownRightStick(s32 port = -1);
126bool isPadHoldLeftRightStick(s32 port = -1);
127bool isPadHoldRightRightStick(s32 port = -1);
128bool isPadHoldLeftStick(s32 port = -1);
129bool isPadHoldRightStick(s32 port = -1);
130bool isPadHoldUiCursorUp(s32 port = -1);
131bool isPadHoldUiCursorDown(s32 port = -1);
132bool isPadHoldUiCursorLeft(s32 port = -1);
133bool isPadHoldUiCursorRight(s32 port = -1);
134
135bool isPadRelease(s32, s32);
136bool isPadReleaseA(s32 port = -1);
137bool isPadReleaseB(s32 port = -1);
138bool isPadReleaseX(s32 port = -1);
139bool isPadReleaseY(s32 port = -1);
140bool isPadReleaseZL(s32 port = -1);
141bool isPadReleaseZR(s32 port = -1);
142bool isPadReleaseL(s32 port = -1);
143bool isPadReleaseR(s32 port = -1);
144bool isPadRelease1(s32 port = -1);
145bool isPadRelease2(s32 port = -1);
146bool isPadReleaseUp(s32 port = -1);
147bool isPadReleaseDown(s32 port = -1);
148bool isPadReleaseLeft(s32 port = -1);
149bool isPadReleaseRight(s32 port = -1);
150bool isPadReleaseHome(s32 port = -1);
151bool isPadReleaseStart(s32 port = -1);
152bool isPadReleaseSelect(s32 port = -1);
153bool isPadReleasePlus(s32 port = -1);
154bool isPadReleaseMinus(s32 port = -1);
155bool isPadReleaseTouch();
156bool isPadReleaseUpLeftStick(s32 port = -1);
157bool isPadReleaseDownLeftStick(s32 port = -1);
158bool isPadReleaseLeftLeftStick(s32 port = -1);
159bool isPadReleaseRightLeftStick(s32 port = -1);
160bool isPadReleaseUpRightStick(s32 port = -1);
161bool isPadReleaseDownRightStick(s32 port = -1);
162bool isPadReleaseLeftRightStick(s32 port = -1);
163bool isPadReleaseRightRightStick(s32 port = -1);
164bool isPadReleaseUiCursorUp(s32 port = -1); // TODO implement below
165bool isPadReleaseUiCursorDown(s32 port = -1);
166bool isPadReleaseUiCursorLeft(s32 port = -1);
167bool isPadReleaseUiCursorRight(s32 port = -1);
168
169const sead::Vector2f& getLeftStick(s32 port = -1);
170const sead::Vector2f& getRightStick(s32 port = -1);
171
172void getPadCrossDir(sead::Vector2f*, s32);
173void getPadCrossDirSideways(sead::Vector2f*, s32);
174
175void calcTouchScreenPos(sead::Vector2f*);
176void calcTouchLayoutPos(sead::Vector2f*);
177
178bool isTouchPosInRect(const sead::Vector2f&, const sead::Vector2f&);
179bool isTouchPosInCircle(const sead::Vector2f&, f32);
180bool isTouchPosInCircleByWorldPos(const sead::Vector2f&, const IUseCamera*, f32, f32);
181bool isPadTouchRect(f32, f32, f32, f32);
182
183void setPadRepeat(s32, s32, s32, s32);
184
185s32 getPlayerControllerPort(s32 index);
186s32 getTouchPanelPort();
187s32 getMainControllerPort();
188s32 getMainJoyPadDoublePort();
189s32 getMainJoyPadSingleRightPort();
190s32 getMainJoyPadSingleLeftPort();
191
192bool isSameNpadId(u32, s32); // TODO implement
193
194} // namespace al
195