Compare commits
1 Commits
cleanup/wp
...
cleanup/co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b8d11475d |
@@ -185,8 +185,8 @@ namespace ipl {
|
||||
gui::PaneManager* mpGui; // 0x74
|
||||
|
||||
BOOL mbHovered[BTN_MAX]; // 0x78
|
||||
u32 mPendingSceneId;
|
||||
u32 mExitSeqStep;
|
||||
u32 unk_0x90;
|
||||
u32 unk_0x94;
|
||||
|
||||
static const char* smButtonName[BTN_MAX];
|
||||
};
|
||||
|
||||
@@ -125,9 +125,9 @@ namespace ipl {
|
||||
mType = 2;
|
||||
mbForceInvalid = 0;
|
||||
KPADEnableDPD(chan);
|
||||
mbPinching = 0;
|
||||
mbWasPinching = 0;
|
||||
mpKpadStatus = &status;
|
||||
mbPinch = 0;
|
||||
mbPrevPinch = 0;
|
||||
mpStatus = &status;
|
||||
}
|
||||
|
||||
Base(int chan, int type, KPADStatus& status) {
|
||||
@@ -158,9 +158,9 @@ namespace ipl {
|
||||
u32 mChan;
|
||||
u32 mType;
|
||||
u8 mbForceInvalid;
|
||||
u8 mbPinching;
|
||||
u8 mbWasPinching;
|
||||
KPADStatus* mpKpadStatus;
|
||||
u8 mbPinch;
|
||||
u8 mbPrevPinch;
|
||||
KPADStatus* mpStatus;
|
||||
};
|
||||
|
||||
class Revolution : public Base {
|
||||
@@ -206,7 +206,7 @@ namespace ipl {
|
||||
virtual BOOL isValidDpdClassic() const;
|
||||
|
||||
private:
|
||||
math::VEC2 mClassicCursorPos;
|
||||
math::VEC2 mClassicCursor;
|
||||
int mClassicCursorTimer;
|
||||
};
|
||||
|
||||
@@ -273,9 +273,9 @@ namespace ipl {
|
||||
|
||||
KPADEnableDPD(chan);
|
||||
|
||||
mbPinching = 0;
|
||||
mbWasPinching = 0;
|
||||
mpKpadStatus = &arg1;
|
||||
mbPinch = 0;
|
||||
mbPrevPinch = 0;
|
||||
mpStatus = &arg1;
|
||||
}
|
||||
|
||||
virtual ~Base(); // 0x08
|
||||
@@ -332,9 +332,9 @@ namespace ipl {
|
||||
u32 mChan; // 0x14
|
||||
u32 mType; // 0x18
|
||||
u8 mbForceInvalid;
|
||||
u8 mbPinching; // 0x1D
|
||||
u8 mbWasPinching; // 0x1E
|
||||
KPADStatus* mpKpadStatus; // 0x20
|
||||
u8 mbPinch; // 0x1D
|
||||
u8 mbPrevPinch; // 0x1E
|
||||
KPADStatus* mpStatus; // 0x20
|
||||
};
|
||||
|
||||
class Interface : public Base {
|
||||
@@ -446,7 +446,7 @@ namespace ipl {
|
||||
virtual BOOL isValidDpdClassic() const; // 0x8C
|
||||
|
||||
private:
|
||||
math::VEC2 mClassicCursorPos;
|
||||
math::VEC2 mClassicCursor;
|
||||
int mClassicCursorTimer;
|
||||
};
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ typedef struct WPADExtConfig {
|
||||
|
||||
typedef struct WPADCB {
|
||||
WPADGameInfo gameInfo; // 0x00
|
||||
s32 gameInfoStatus[2]; // 0x38
|
||||
s32 unk_0x38[2];
|
||||
u8 rxBufMain[RX_BUFFER_SIZE]; // 0x40
|
||||
u8 rxBufs[2][RX_BUFFER_SIZE]; // 0xA0
|
||||
WPADCommandQueue stdCmdQueue; // 0x160
|
||||
@@ -223,7 +223,7 @@ typedef struct WPADCB {
|
||||
u16 filterDiffExt; // 0x900
|
||||
u16 filterSameExt; // 0x902
|
||||
s64 lastReportSendTime; // 0x908
|
||||
u8 suppressDisconnect; // 0x910
|
||||
u8 unk_0x910;
|
||||
u8 calibrated; // 0x911
|
||||
u16 comboHeld; // 0x912
|
||||
u8 encryptionKey[16]; // 0x914
|
||||
|
||||
@@ -190,7 +190,7 @@ static s32 WPADiSendData(s32 chan, WPADCommand command) {
|
||||
|
||||
if (status == WPAD_ERR_COMMUNICATION_ERROR) {
|
||||
if ((s32)OSTicksToSeconds(__OSGetSystemTime() - p->lastReportSendTime) > 1 && _sleepTime != 0) {
|
||||
if (!p->suppressDisconnect) {
|
||||
if (!p->unk_0x910) {
|
||||
p->lastReportSendTime = __OSGetSystemTime();
|
||||
WPADiDisconnect(chan, FALSE);
|
||||
} else {
|
||||
@@ -1263,7 +1263,7 @@ static void __ClearControlBlock(s32 chan) {
|
||||
|
||||
p->lastControllerDataUpdate = __OSGetSystemTime();
|
||||
p->lastReportSendTime = __OSGetSystemTime();
|
||||
p->suppressDisconnect = 0;
|
||||
p->unk_0x910 = 0;
|
||||
p->unk_0x8C9 = 0;
|
||||
p->unk_0x8C4 = 0;
|
||||
p->wmReadDataPtr = NULL;
|
||||
@@ -1298,8 +1298,8 @@ static void __ClearControlBlock(s32 chan) {
|
||||
memset(&p->decryptXorTable, 0, sizeof(p->decryptXorTable));
|
||||
memset(&p->gameInfo, 0, sizeof(WPADGameInfo));
|
||||
|
||||
p->gameInfoStatus[0] = -1;
|
||||
p->gameInfoStatus[1] = -1;
|
||||
p->unk_0x38[0] = -1;
|
||||
p->unk_0x38[1] = -1;
|
||||
|
||||
p->stdCmdQueue.buffer = p->stdCmdQueueList;
|
||||
p->stdCmdQueue.capacity = ARRAY_LENGTH(p->stdCmdQueueList);
|
||||
@@ -2692,7 +2692,7 @@ static void __SendData(s32 chan, WPADCommand command) {
|
||||
u32 time;
|
||||
memcpy(&time, command.dataBuf, sizeof(u32));
|
||||
p->lastReportSendTime = __OSGetSystemTime() + time;
|
||||
p->suppressDisconnect = 1;
|
||||
p->unk_0x910 = 1;
|
||||
return;
|
||||
}
|
||||
default: {
|
||||
@@ -2704,7 +2704,7 @@ static void __SendData(s32 chan, WPADCommand command) {
|
||||
p->cmdBlkCB = command.cmdCB;
|
||||
p->lastReportID = reportID;
|
||||
p->lastReportSendTime = __OSGetSystemTime() + OSSecondsToTicks(2);
|
||||
p->suppressDisconnect = 0;
|
||||
p->unk_0x910 = 0;
|
||||
|
||||
OSRestoreInterrupts(enabled);
|
||||
}
|
||||
|
||||
@@ -547,9 +547,9 @@ static void getGameInfo(s32 chan, s32 result, u8 index) {
|
||||
|
||||
if (p_info->checksum == sum) {
|
||||
memcpy(&p_wpd->gameInfo, p_buf, sizeof(WPADMEMGameInfo));
|
||||
p_wpd->gameInfoStatus[index] = WPAD_ERR_NONE;
|
||||
p_wpd->unk_0x38[index] = WPAD_ERR_NONE;
|
||||
} else {
|
||||
p_wpd->gameInfoStatus[index] = WPAD_ERR_INVALID;
|
||||
p_wpd->unk_0x38[index] = WPAD_ERR_INVALID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace ipl {
|
||||
|
||||
SettingSelect::SettingSelect(EGG::Heap* heap, int arg)
|
||||
: Base(heap), ::gui::EventHandler(), mState(STATE_WAIT_BUTTON_FADE_IN), mPrevState(STATE_WAIT_BUTTON_FADE_IN), mSettingArg(arg),
|
||||
mpLayout(NULL), mpLayoutFile(NULL), mpGui(NULL), mPendingSceneId(0), mExitSeqStep(0) {
|
||||
mpLayout(NULL), mpLayoutFile(NULL), mpGui(NULL), unk_0x90(0), unk_0x94(0) {
|
||||
setSceneParentFlags(SCN_PARENTFLAG_CALC | SCN_PARENTFLAG_DRAW);
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace ipl {
|
||||
|
||||
void SettingSelect::stt_1st_fadeout() {
|
||||
if (is_stopped_all_anm()) {
|
||||
if (mPendingSceneId != 0) {
|
||||
if (unk_0x90 != 0) {
|
||||
System::getFader()->fadeOut();
|
||||
CHANGE_STATE(STATE_WAIT_BLACK_OUT);
|
||||
} else {
|
||||
@@ -247,7 +247,7 @@ namespace ipl {
|
||||
|
||||
void SettingSelect::stt_2nd_fadeout() {
|
||||
if (is_stopped_all_anm()) {
|
||||
if (mPendingSceneId != 0) {
|
||||
if (unk_0x90 != 0) {
|
||||
CHANGE_STATE(STATE_WAIT_CHILD);
|
||||
reset_gui();
|
||||
} else {
|
||||
@@ -309,7 +309,7 @@ namespace ipl {
|
||||
case STATE_1ST_NORMAL: {
|
||||
System::getChannelManager()->refreshAsync();
|
||||
System::getFader()->fadeOut();
|
||||
mPendingSceneId = SCENE_BOARD;
|
||||
unk_0x90 = 4;
|
||||
|
||||
reserveAllSceneDestruction(SCENE_BOARD, NULL);
|
||||
|
||||
@@ -369,8 +369,8 @@ namespace ipl {
|
||||
int backAnim = -1;
|
||||
int inAnim = -1;
|
||||
|
||||
switch (mPendingSceneId) {
|
||||
case SCENE_MEMORY: {
|
||||
switch (unk_0x90) {
|
||||
case 13: {
|
||||
#ifndef KOREAN_BUILD
|
||||
backAnim = ANIM_WII_SAVE_DATA_BACK;
|
||||
inAnim = ANIM_GC_SAVE_DATA_IN;
|
||||
@@ -380,12 +380,12 @@ namespace ipl {
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case SCENE_MEMORY_CARD: {
|
||||
case 14: {
|
||||
backAnim = ANIM_GC_SAVE_DATA_BACK;
|
||||
inAnim = ANIM_WII_SAVE_DATA_IN;
|
||||
break;
|
||||
}
|
||||
case SCENE_CHANNEL_EDIT: {
|
||||
case 12: {
|
||||
backAnim = ANIM_CHANNEL_BACK;
|
||||
inAnim = ANIM_SAVE_DATA_IN;
|
||||
if (mSettingArg == SettingSelectArg::ARG_START_SAVE_DATA) {
|
||||
@@ -404,14 +404,14 @@ namespace ipl {
|
||||
|
||||
void SettingSelect::stt_wait_child_anm() {
|
||||
if (is_stopped_all_anm()) {
|
||||
switch (mPendingSceneId) {
|
||||
case SCENE_CHANNEL_EDIT: {
|
||||
switch (unk_0x90) {
|
||||
case 12: {
|
||||
static_cast<SettingButton*>(System::getScene(SCENE_SETTING_BUTTON))->showWii();
|
||||
CHANGE_STATE(STATE_2ND_NORMAL);
|
||||
break;
|
||||
}
|
||||
case SCENE_MEMORY:
|
||||
case SCENE_MEMORY_CARD: {
|
||||
case 13:
|
||||
case 14: {
|
||||
static_cast<SettingButton*>(System::getScene(SCENE_SETTING_BUTTON))->showWii();
|
||||
#ifndef KOREAN_BUILD
|
||||
CHANGE_STATE(STATE_3RD_NORMAL);
|
||||
@@ -422,7 +422,7 @@ namespace ipl {
|
||||
}
|
||||
}
|
||||
|
||||
mPendingSceneId = 0;
|
||||
unk_0x90 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ namespace ipl {
|
||||
break;
|
||||
}
|
||||
case BTN_SETTING: {
|
||||
mPendingSceneId = SCENE_SETTING;
|
||||
unk_0x90 = 18;
|
||||
flashAnim = ANIM_SETTING_FLASH;
|
||||
outAnim = ANIM_DATA_MANAGE_OUT;
|
||||
reserveAllSceneDestruction(SCENE_SETTING, (void*)Setting::ARG_NORMAL_PAGE);
|
||||
@@ -596,7 +596,7 @@ namespace ipl {
|
||||
}
|
||||
case BTN_SAVEDATA: {
|
||||
#ifdef KOREAN_BUILD
|
||||
mPendingSceneId = SCENE_MEMORY;
|
||||
unk_0x90 = 13;
|
||||
#endif
|
||||
flashAnim = ANIM_SAVE_DATA_FLASH;
|
||||
outAnim = ANIM_CHANNEL_OUT;
|
||||
@@ -611,7 +611,7 @@ namespace ipl {
|
||||
break;
|
||||
}
|
||||
case BTN_CHANNEL: {
|
||||
mPendingSceneId = SCENE_CHANNEL_EDIT;
|
||||
unk_0x90 = 12;
|
||||
flashAnim = ANIM_CHANNEL_FLASH;
|
||||
outAnim = ANIM_SAVE_DATA_OUT;
|
||||
createChildScene(SCENE_CHANNEL_EDIT, this, NULL);
|
||||
@@ -623,7 +623,7 @@ namespace ipl {
|
||||
break;
|
||||
}
|
||||
case BTN_WII_SAVE: {
|
||||
mPendingSceneId = SCENE_MEMORY;
|
||||
unk_0x90 = 13;
|
||||
flashAnim = ANIM_WII_SAVE_DATA_FLASH;
|
||||
outAnim = ANIM_GC_SAVE_DATA_OUT;
|
||||
createChildScene(SCENE_MEMORY, this, NULL);
|
||||
@@ -632,7 +632,7 @@ namespace ipl {
|
||||
break;
|
||||
}
|
||||
case BTN_GC_SAVE: {
|
||||
mPendingSceneId = SCENE_MEMORY_CARD;
|
||||
unk_0x90 = 14;
|
||||
flashAnim = ANIM_GC_SAVE_DATA_FLASH;
|
||||
outAnim = ANIM_WII_SAVE_DATA_OUT;
|
||||
createChildScene(SCENE_MEMORY_CARD, this, NULL);
|
||||
@@ -689,7 +689,7 @@ namespace ipl {
|
||||
}
|
||||
|
||||
void SettingSelect::calc_exit_sequence() {
|
||||
switch (mExitSeqStep) {
|
||||
switch (unk_0x94) {
|
||||
case 0: {
|
||||
prepare_exit_abort();
|
||||
break;
|
||||
@@ -720,13 +720,13 @@ namespace ipl {
|
||||
|
||||
System::getBS2Manager()->abort();
|
||||
System::stopReceiveSchedule();
|
||||
mExitSeqStep = 1;
|
||||
unk_0x94 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void SettingSelect::wait_decide_se() {
|
||||
if (!snd::getSystem()->isSEActive("WIPL_SE_DECIDE")) {
|
||||
mExitSeqStep = 2;
|
||||
unk_0x94 = 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -734,7 +734,7 @@ namespace ipl {
|
||||
__WPADReconnect(TRUE);
|
||||
snd::getSystem()->stopAllSound(20);
|
||||
System::getFader()->fadeOut();
|
||||
mExitSeqStep = 3;
|
||||
unk_0x94 = 3;
|
||||
}
|
||||
|
||||
void SettingSelect::finish_exit_reboot() {
|
||||
|
||||
@@ -130,24 +130,24 @@ namespace ipl {
|
||||
}
|
||||
void ipl::controller::Revolution::read() {
|
||||
if (!isValidDpd()) {
|
||||
mpKpadStatus->pos.y = 1.0f / 0.0f;
|
||||
mpKpadStatus->pos.x = 1.0f / 0.0f;
|
||||
mpKpadStatus->speed = 0.0f;
|
||||
mpKpadStatus->vec.y = 0.0f;
|
||||
mpKpadStatus->vec.x = 0.0f;
|
||||
mpStatus->pos.y = 1.0f / 0.0f;
|
||||
mpStatus->pos.x = 1.0f / 0.0f;
|
||||
mpStatus->speed = 0.0f;
|
||||
mpStatus->vec.y = 0.0f;
|
||||
mpStatus->vec.x = 0.0f;
|
||||
}
|
||||
|
||||
mbWasPinching = mbPinching;
|
||||
mbPrevPinch = mbPinch;
|
||||
if (isValidBtn()) {
|
||||
if (mbWasPinching == 0) {
|
||||
if (mbPrevPinch == 0) {
|
||||
if (down(0x800) && down(0x400)) {
|
||||
mbPinching = 1;
|
||||
mbPinch = 1;
|
||||
}
|
||||
} else if (!down(0x800) || !down(0x400)) {
|
||||
mbPinching = 0;
|
||||
mbPinch = 0;
|
||||
}
|
||||
} else {
|
||||
mbPinching = 0;
|
||||
mbPinch = 0;
|
||||
}
|
||||
|
||||
Base::read();
|
||||
@@ -157,17 +157,17 @@ namespace ipl {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (mpKpadStatus->wpad_err == 0 || mpKpadStatus->wpad_err == -7) && mpKpadStatus->dpd_valid_fg != 0;
|
||||
return (mpStatus->wpad_err == 0 || mpStatus->wpad_err == -7) && mpStatus->dpd_valid_fg != 0;
|
||||
}
|
||||
bool ipl::controller::Revolution::isValidBtn() const {
|
||||
u8 val = mpKpadStatus->wpad_err;
|
||||
u8 val = mpStatus->wpad_err;
|
||||
|
||||
return (u8)(val + 7) <= 7 && ((1 << (val + 7)) & 0xA1) != 0;
|
||||
}
|
||||
bool ipl::controller::Revolution::down(u32 mButton) const {
|
||||
bool ret = false;
|
||||
if (isValidBtn()) {
|
||||
if (mpKpadStatus->hold & (mButton & 0xFFFF)) {
|
||||
if (mpStatus->hold & (mButton & 0xFFFF)) {
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
@@ -177,7 +177,7 @@ namespace ipl {
|
||||
ipl::math::VEC2 ipl::controller::Revolution::getDpdProjectionPos() const {
|
||||
math::VEC2 ret;
|
||||
Vec2 dest;
|
||||
Vec2 src = {mpKpadStatus->pos.x, mpKpadStatus->pos.y};
|
||||
Vec2 src = {mpStatus->pos.x, mpStatus->pos.y};
|
||||
nw4r::ut::Rect nw4r_rect; // constructor shouldn't be inlined
|
||||
Rect kpad_rect;
|
||||
|
||||
@@ -216,8 +216,8 @@ namespace ipl {
|
||||
y = fy;
|
||||
}
|
||||
ipl::controller::Classic::Classic(int arg0, KPADStatus& arg1) : Revolution(arg0, arg1) {
|
||||
mClassicCursorPos.x = 0.01f;
|
||||
mClassicCursorPos.y = 0.01f;
|
||||
mClassicCursor.x = 0.01f;
|
||||
mClassicCursor.y = 0.01f;
|
||||
mClassicCursorTimer = 0;
|
||||
}
|
||||
ipl::controller::Base::~Base() {
|
||||
@@ -230,14 +230,14 @@ namespace ipl {
|
||||
}
|
||||
void ipl::controller::Classic::read() {
|
||||
if (!Revolution::isValidDpd()) {
|
||||
math::VEC2 lstick(mpKpadStatus->ex_status.cl.lstick.x, mpKpadStatus->ex_status.cl.lstick.y);
|
||||
math::VEC2 lstick(mpStatus->ex_status.cl.lstick.x, mpStatus->ex_status.cl.lstick.y);
|
||||
|
||||
if (lstick.x * lstick.x + lstick.y * lstick.y > 0.0036f) {
|
||||
mClassicCursorPos.x = math::abs_clamp(mClassicCursorPos.x + mpKpadStatus->ex_status.cl.lstick.x * 0.05f, 1.8f);
|
||||
mClassicCursorPos.y = math::abs_clamp(mClassicCursorPos.y - mpKpadStatus->ex_status.cl.lstick.y * 0.05f, 1.2f);
|
||||
mClassicCursor.x = math::abs_clamp(mClassicCursor.x + mpStatus->ex_status.cl.lstick.x * 0.05f, 1.8f);
|
||||
mClassicCursor.y = math::abs_clamp(mClassicCursor.y - mpStatus->ex_status.cl.lstick.y * 0.05f, 1.2f);
|
||||
}
|
||||
|
||||
math::VEC2 rstick = math::VEC2(mpKpadStatus->ex_status.cl.rstick.x, mpKpadStatus->ex_status.cl.rstick.y);
|
||||
math::VEC2 rstick = math::VEC2(mpStatus->ex_status.cl.rstick.x, mpStatus->ex_status.cl.rstick.y);
|
||||
if (getClassicHoldFlag() != 0 || lstick.x * lstick.x + lstick.y * lstick.y > 0.0036f ||
|
||||
rstick.x * rstick.x + rstick.y * rstick.y > 0.0036f) {
|
||||
mClassicCursorTimer = 180;
|
||||
@@ -247,15 +247,15 @@ namespace ipl {
|
||||
mClassicCursorTimer = 0;
|
||||
}
|
||||
} else {
|
||||
mClassicCursorPos.y = 0.01f;
|
||||
mClassicCursorPos.x = 0.01f;
|
||||
mClassicCursor.y = 0.01f;
|
||||
mClassicCursor.x = 0.01f;
|
||||
mClassicCursorTimer = 0;
|
||||
}
|
||||
|
||||
Revolution::read();
|
||||
}
|
||||
int ipl::controller::Classic::getClassicHoldFlag() const {
|
||||
return mpKpadStatus->ex_status.cl.hold;
|
||||
return mpStatus->ex_status.cl.hold;
|
||||
}
|
||||
template <>
|
||||
f32 ipl::math::abs_clamp<f32>(const f32& x, const f32& y) {
|
||||
@@ -270,7 +270,7 @@ namespace ipl {
|
||||
ipl::math::VEC2 ipl::controller::Classic::getHorizon() const {
|
||||
math::VEC2 ret;
|
||||
if (Revolution::isValidDpd()) {
|
||||
ret.set(mpKpadStatus->horizon.x, mpKpadStatus->horizon.y);
|
||||
ret.set(mpStatus->horizon.x, mpStatus->horizon.y);
|
||||
} else {
|
||||
ret.x = 1.0f;
|
||||
ret.y = -0.2679492f;
|
||||
@@ -280,9 +280,9 @@ namespace ipl {
|
||||
ipl::math::VEC2 ipl::controller::Classic::getDpdPos() const {
|
||||
math::VEC2 ret;
|
||||
if (Revolution::isValidDpd()) {
|
||||
ret.set(mpKpadStatus->pos.x, mpKpadStatus->pos.y);
|
||||
ret.set(mpStatus->pos.x, mpStatus->pos.y);
|
||||
} else if (mClassicCursorTimer != 0) {
|
||||
ret = mClassicCursorPos;
|
||||
ret = mClassicCursor;
|
||||
} else {
|
||||
ret.x = (1.0f / 0.0f);
|
||||
ret.y = (1.0f / 0.0f);
|
||||
@@ -296,9 +296,9 @@ namespace ipl {
|
||||
ipl::math::VEC2 ipl::controller::Classic::getDpdProjectionPos() const {
|
||||
math::VEC2 ret;
|
||||
if (Revolution::isValidDpd()) {
|
||||
ret.set(mpKpadStatus->pos.x, mpKpadStatus->pos.y);
|
||||
ret.set(mpStatus->pos.x, mpStatus->pos.y);
|
||||
} else if (mClassicCursorTimer != 0) {
|
||||
ret = mClassicCursorPos;
|
||||
ret = mClassicCursor;
|
||||
} else {
|
||||
ret.set(1.0f / 0.0f, 1.0f / 0.0f);
|
||||
}
|
||||
@@ -463,43 +463,43 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
|
||||
return mChan;
|
||||
}
|
||||
KPADStatus* ipl::controller::Revolution::getKPADStatus() const {
|
||||
return mpKpadStatus;
|
||||
return mpStatus;
|
||||
}
|
||||
f32 ipl::controller::Revolution::getDpdDistance() const {
|
||||
return mpKpadStatus->dist;
|
||||
return mpStatus->dist;
|
||||
}
|
||||
int ipl::controller::Revolution::getReleaseFlag() const {
|
||||
return mpKpadStatus->release;
|
||||
return mpStatus->release;
|
||||
}
|
||||
int ipl::controller::Revolution::getTrigFlag() const {
|
||||
return mpKpadStatus->trig;
|
||||
return mpStatus->trig;
|
||||
}
|
||||
int ipl::controller::Revolution::getHoldFlag() const {
|
||||
return mpKpadStatus->hold;
|
||||
return mpStatus->hold;
|
||||
}
|
||||
int ipl::controller::Revolution::pinchOffTrg() const {
|
||||
int ret = 0;
|
||||
if (isValidBtn() && mbPinching == 0 && mbWasPinching != 0) {
|
||||
if (isValidBtn() && mbPinch == 0 && mbPrevPinch != 0) {
|
||||
ret = 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
int ipl::controller::Revolution::pinch() const {
|
||||
int ret = 0;
|
||||
if (isValidBtn() && mbPinching != 0) {
|
||||
if (isValidBtn() && mbPinch != 0) {
|
||||
ret = 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
int ipl::controller::Revolution::pinchTrg() const {
|
||||
int ret = 0;
|
||||
if (isValidBtn() && mbPinching != 0 && mbWasPinching == 0) {
|
||||
if (isValidBtn() && mbPinch != 0 && mbPrevPinch == 0) {
|
||||
ret = 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
bool ipl::controller::Revolution::repeat(u32 button) const {
|
||||
return down(button) && (mpKpadStatus->hold & 0x80000000) != 0;
|
||||
return down(button) && (mpStatus->hold & 0x80000000) != 0;
|
||||
}
|
||||
BOOL ipl::controller::Classic::isValidDpdClassic() const {
|
||||
return mClassicCursorTimer != 0;
|
||||
@@ -512,16 +512,16 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
|
||||
return (Revolution::isValidDpd() != 0) || (mClassicCursorTimer != 0);
|
||||
}
|
||||
int ipl::controller::Classic::getClassicReleaseFlag() const {
|
||||
return mpKpadStatus->ex_status.cl.release;
|
||||
return mpStatus->ex_status.cl.release;
|
||||
}
|
||||
int ipl::controller::Classic::getClassicTrigFlag() const {
|
||||
return mpKpadStatus->ex_status.cl.trig;
|
||||
return mpStatus->ex_status.cl.trig;
|
||||
}
|
||||
bool ipl::controller::Classic::upTrg(u32 button) const {
|
||||
bool ret = false;
|
||||
if (isValidBtn()) {
|
||||
bool pressed = true;
|
||||
KPADStatus* status = mpKpadStatus;
|
||||
KPADStatus* status = mpStatus;
|
||||
if ((status->release & (button & 0xFFFF)) == 0) {
|
||||
if ((status->ex_status.cl.release & (button >> 16)) == 0) {
|
||||
pressed = false;
|
||||
@@ -537,7 +537,7 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
|
||||
bool ret = false;
|
||||
if (isValidBtn()) {
|
||||
bool pressed = true;
|
||||
KPADStatus* status = mpKpadStatus;
|
||||
KPADStatus* status = mpStatus;
|
||||
if ((status->trig & (button & 0xFFFF)) == 0) {
|
||||
if ((status->ex_status.cl.trig & (button >> 16)) == 0) {
|
||||
pressed = false;
|
||||
@@ -553,8 +553,8 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
|
||||
bool ret = false;
|
||||
if (isValidBtn()) {
|
||||
bool pressed = true;
|
||||
if ((mpKpadStatus->hold & (button & 0xFFFF)) == 0) {
|
||||
if ((mpKpadStatus->ex_status.cl.hold & (button >> 16)) == 0) {
|
||||
if ((mpStatus->hold & (button & 0xFFFF)) == 0) {
|
||||
if ((mpStatus->ex_status.cl.hold & (button >> 16)) == 0) {
|
||||
pressed = false;
|
||||
}
|
||||
}
|
||||
@@ -565,15 +565,15 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
|
||||
return ret;
|
||||
}
|
||||
ipl::math::VEC2 ipl::controller::Revolution::getHorizon() const {
|
||||
return math::VEC2(mpKpadStatus->horizon.x, mpKpadStatus->horizon.y);
|
||||
return math::VEC2(mpStatus->horizon.x, mpStatus->horizon.y);
|
||||
}
|
||||
ipl::math::VEC2 ipl::controller::Revolution::getDpdPos() const {
|
||||
return math::VEC2(mpKpadStatus->pos.x, mpKpadStatus->pos.y);
|
||||
return math::VEC2(mpStatus->pos.x, mpStatus->pos.y);
|
||||
}
|
||||
bool ipl::controller::Revolution::upTrg(u32 button) const {
|
||||
bool ret = false;
|
||||
if (isValidBtn()) {
|
||||
if (mpKpadStatus->release & (button & 0xFFFF)) {
|
||||
if (mpStatus->release & (button & 0xFFFF)) {
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
@@ -582,7 +582,7 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
|
||||
bool ipl::controller::Revolution::downTrg(u32 button) const {
|
||||
bool ret = false;
|
||||
if (isValidBtn()) {
|
||||
if (mpKpadStatus->trig & (button & 0xFFFF)) {
|
||||
if (mpStatus->trig & (button & 0xFFFF)) {
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,9 +152,9 @@ namespace ipl {
|
||||
}
|
||||
|
||||
Revolution::Revolution(int chan, int type, KPADStatus& status) : Base(chan, type, status) {
|
||||
mbPinching = 0;
|
||||
mbWasPinching = 0;
|
||||
mpKpadStatus = &status;
|
||||
mbPinch = 0;
|
||||
mbPrevPinch = 0;
|
||||
mpStatus = &status;
|
||||
}
|
||||
|
||||
Interface* Manager::getMasterController() {
|
||||
|
||||
Reference in New Issue
Block a user