Compare commits

..

5 Commits

Author SHA1 Message Date
coah
4e41a7ba9c fix controller manager readability 2026-09-28 23:23:30 +00:00
coah
d2d00f38ff split iplController into controller and manager units, decompile the asm 2026-09-28 23:23:30 +00:00
coah
33911687c7 decompile controller leaf destructors 2026-09-28 23:23:30 +00:00
coah
03bc324c97 model controller inheritance 2026-09-28 23:23:30 +00:00
coah
7e24906764 decompile controller asm bodies 2026-09-28 23:23:30 +00:00
5 changed files with 11 additions and 1924 deletions

View File

@@ -624,8 +624,8 @@ config.libs = [
Object(Matching, "system/rvl_dec.c"),
Object(Matching, "system/RIPL_BoardRecord.c"),
Object(Matching, "system/iplSystem.cpp"),
Object(Matching, "system/iplController.cpp"),
Object(Matching, "system/iplControllerManager.cpp"),
Object(NonMatching, "system/iplController.cpp"),
Object(NonMatching, "system/iplControllerManager.cpp"),
Object(Matching, "system/iplChannelManager.cpp"),
Object(Matching, "system/iplChannelScriptManager.cpp"),
Object(Matching, "system/iplNand.cpp"),

View File

@@ -63,14 +63,10 @@ namespace ipl {
// clang-format on
#ifdef IPL_CONTROLLER_NATIVE_HIERARCHY
#ifdef IPL_CONTROLLER_OUT_OF_LINE_INTERFACE
#define IPL_CONTROLLER_DEFAULT_VIRTUAL(signature, implementation) virtual signature;
#else
#ifdef IPL_CONTROLLER_INLINE_INTERFACE
#define IPL_CONTROLLER_DEFAULT_VIRTUAL(signature, implementation) virtual signature implementation
#else
#define IPL_CONTROLLER_DEFAULT_VIRTUAL(signature, implementation) virtual signature;
#endif
#endif
class Interface {
public:
@@ -83,7 +79,7 @@ namespace ipl {
IPL_CONTROLLER_DEFAULT_VIRTUAL(int pinch() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int pinchTrg() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(int pinchOffTrg() const, { return 0; })
virtual int decide() const = 0;
IPL_CONTROLLER_DEFAULT_VIRTUAL(int decide() const, { return 0; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(bool repeat(u32 button) const, { return false; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(BOOL rumble(int type = 0), { return FALSE; })
IPL_CONTROLLER_DEFAULT_VIRTUAL(void cancelRumbling(), { })

File diff suppressed because it is too large Load Diff

View File

@@ -18,9 +18,7 @@
#define IPL_CONTROLLER_NATIVE_HIERARCHY
#define IPL_CONTROLLER_INLINE_INTERFACE
#define IPL_CONTROLLER_OUT_OF_LINE_INTERFACE
#include "system/iplController.h"
#undef IPL_CONTROLLER_OUT_OF_LINE_INTERFACE
#undef IPL_CONTROLLER_INLINE_INTERFACE
#undef IPL_CONTROLLER_NATIVE_HIERARCHY
#include "system/iplSystem.h"
@@ -93,21 +91,6 @@ namespace ipl {
}
}
}
bool ipl::controller::Interface::isValidBtn() const {
return false;
}
bool ipl::controller::Interface::downTrg(u32 button) const {
return false;
}
int ipl::controller::Interface::pinch() const {
return 0;
}
bool ipl::controller::Interface::down(u32 button) const {
return false;
}
KPADStatus* ipl::controller::Interface::getKPADStatus() const {
return NULL;
}
int ipl::controller::Base::decide() const {
return unk_0x08 == 5;
}
@@ -342,15 +325,9 @@ namespace ipl {
bool ipl::controller::Master::upTrg(u32 button) const {
return call(button, kUpTrgMember);
}
bool ipl::controller::Interface::upTrg(u32 button) const {
return false;
}
bool ipl::controller::Master::repeat(u32 button) const {
return call(button, kRepeatMember);
}
bool ipl::controller::Interface::repeat(u32 button) const {
return false;
}
int ipl::controller::Master::decide() const {
bool current = false;
bool ret = false;
@@ -388,71 +365,6 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
}
return ret;
}
void ipl::controller::Interface::read() {}
int ipl::controller::Interface::getSubStickY() const {
return 0;
}
int ipl::controller::Interface::getSubStickX() const {
return 0;
}
int ipl::controller::Interface::getMainStickY() const {
return 0;
}
int ipl::controller::Interface::getMainStickX() const {
return 0;
}
bool ipl::controller::Interface::isValidDpd() const {
return false;
}
PADStatus* ipl::controller::Interface::getPADStatus() const {
return NULL;
}
f32 ipl::controller::Interface::getDpdDistance() const {
return 0.0f;
}
ipl::math::VEC2 ipl::controller::Interface::getHorizon() const {
return ipl::math::VEC2(0.0f, 0.0f);
}
ipl::math::VEC2 ipl::controller::Interface::getDpdProjectionPos() const {
return ipl::math::VEC2(0.0f, 0.0f);
}
ipl::math::VEC2 ipl::controller::Interface::getDpdPos() const {
return ipl::math::VEC2(0.0f, 0.0f);
}
int ipl::controller::Interface::getClassicReleaseFlag() const {
return 0;
}
int ipl::controller::Interface::getClassicTrigFlag() const {
return 0;
}
int ipl::controller::Interface::getClassicHoldFlag() const {
return 0;
}
int ipl::controller::Interface::getReleaseFlag() const {
return 0;
}
int ipl::controller::Interface::getTrigFlag() const {
return 0;
}
int ipl::controller::Interface::getHoldFlag() const {
return 0;
}
void ipl::controller::Interface::cancelRumbling() {}
BOOL ipl::controller::Interface::rumble(int type) {
return FALSE;
}
int ipl::controller::Interface::pinchOffTrg() const {
return 0;
}
int ipl::controller::Interface::pinchTrg() const {
return 0;
}
int ipl::controller::Interface::getChannel() const {
return -1;
}
int ipl::controller::Interface::getType() const {
return -1;
}
void ipl::controller::Base::setForceInvalid(bool flag) {
unk_0x1C = flag;
}

View File

@@ -98,7 +98,11 @@ namespace ipl {
probe_valid:
{
s32 read = KPADRead(chan, &mKPADStatus[chan], 1);
if (read > 0 && mKPADStatus[chan].wpad_err != -4 && deviceType != 0xfd) {
if (read > 0) {
if (mKPADStatus[chan].wpad_err == -4 || deviceType == 0xfd) {
goto store_null;
}
mInvalidCount[chan] = 0;
if (mKPADStatus[chan].wpad_err == -7 || deviceType == 0 || deviceType == 0xfb ||
deviceType == 0xfc || deviceType == 0xff) {
@@ -116,10 +120,7 @@ namespace ipl {
} else {
mControllers[chan] = NULL;
}
} else {
if (read != 0) {
goto store_null;
}
} else if (read == 0) {
mInvalidCount[chan]++;
if (mInvalidCount[chan] > 0x3c) {
mInvalidCount[chan] = 0x3c;
@@ -128,6 +129,8 @@ namespace ipl {
}
mControllers[chan] = NULL;
}
} else {
goto store_null;
}
}
goto channel_done;