Skip to content

Commit

Permalink
Create KPadDirector slice and header
Browse files Browse the repository at this point in the history
  • Loading branch information
narahiero authored and em-eight committed Sep 1, 2023
1 parent 9231707 commit a7734cc
Show file tree
Hide file tree
Showing 11 changed files with 777 additions and 93 deletions.
3 changes: 2 additions & 1 deletion pack/rel_objects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ out/rel/data_808b2c84_808b2d38.o
out/GhostFile.o
out/rel/text_8051d4d4_8051e85c.o
out/KPadController.o
out/rel/text_805230e0_80525f88.o
out/KPadDirector.o
out/rel/text_80524ac4_80525f88.o
out/rel/rodata_8088fcd8_8088fd60.o
out/Mii.o
out/rel/text_80525ff4_8052a098.o
Expand Down
3 changes: 3 additions & 0 deletions pack/rel_slices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ source/game/system/KPadController.cpp:
text: [0x8051e85c, 0x805230e0]
rodata: [0x8088fcc0, 0x8088fcd8]

source/game/system/KPadDirector.cpp:
text: [0x805230e0, 0x80524ac4]

source/game/system/Mii.cpp:
text: [0x80525f88, 0x80525ff4]
rodata: [0x8088fd60, 0x8088fd64]
Expand Down
94 changes: 47 additions & 47 deletions pack/symbols.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15439,58 +15439,58 @@ global:
0x80522f40: 'readFrame__Q26System17KPadFaceButtonsStreamFv'
0x805230a8: 'getSequenceSize__Q26System17KPadFaceButtonsStreamFv'
0x805230b0: '__sinit__KPadController_cpp'
0x805230e0: 'unk_805230e0'
0x8052313c: 'KPadDirector_createInstance'
0x8052318c: 'InputMgr_destroyStaticInstance'
0x805231dc: 'InputMgr_destroy'
0x805232b0: 'unk_805232b0'
0x805232f0: 'KPadDirector_construct'
0x805234a0: 'AiKartInput_construct'
0x80523520: 'unk_80523520'
0x80523524: 'unk_80523524'
0x805235ac: 'unk_805235ac'
0x805235d4: 'unk_805235d4'
0x80523690: 'KPadDirector_reset'
0x80523724: 'unk_80523724'
0x805237ac: 'unk_805237ac'
0x805237e8: 'KPadDirector_calcPads'
0x805238f0: 'InputMgr_calc'
0x80523990: 'unk_80523990'
0x80523a58: 'unk_80523a58'
0x80523a80: 'unk_80523a80'
0x80523bc8: 'unk_80523bc8'
0x80523d10: 'unk_80523d10'
0x80523eac: 'unk_80523eac'
0x80523ebc: 'KPadDirector_tryRegister'
0x805240ec: 'unk_805240ec'
0x80524264: 'KPadDirector_resetPlayerController'
0x8052427c: 'unk_8052427c'
0x805242d8: 'InputMgr_initControllers'
0x80524438: 'unk_80524438'
0x80524500: 'unk_80524500'
0x8052453c: 'setGhostController__Q26System12KPadDirectorFUcPvb'
0x805230e0: 'syncDeviceCallback__Q26System12KPadDirectorFi'
0x8052313c: 'createInstance__Q26System12KPadDirectorFv'
0x8052318c: 'destroyInstance__Q26System12KPadDirectorFv'
0x805231dc: '__dt__Q26System12KPadDirectorFv'
0x805232b0: '__dt__Q26System19KPadDummyControllerFv'
0x805232f0: '__ct__Q26System12KPadDirectorFv'
0x805234a0: '__ct__Q26System6KPadAIFv'
0x80523520: 'initialize__Q26System12KPadDirectorFv'
0x80523524: 'reset2__Q26System12KPadDirectorFv'
0x805235ac: 'resetPlayersActivityStatus__Q26System12KPadDirectorFv'
0x805235d4: 'checkPlayerActivityStatus__Q26System12KPadDirectorFUcUsUs'
0x80523690: 'reset__Q26System12KPadDirectorFv'
0x80523724: 'stopAllMotors__Q26System12KPadDirectorFv'
0x805237ac: 'readPads__Q26System12KPadDirectorFv'
0x805237e8: 'calcControllers__Q26System12KPadDirectorFb'
0x805238f0: 'calc__Q26System12KPadDirectorFv'
0x80523990: 'setController__Q26System12KPadDirectorFPQ26System4KPadQ26System18eControllerTypeUcb'
0x80523a58: 'getControllerType__Q26System12KPadDirectorFQ26System14eControlSource'
0x80523a80: 'copyController__Q26System12KPadDirectorFPQ26System4KPadPQ26System4KPadb'
0x80523bc8: 'initMasterController__Q26System12KPadDirectorFv'
0x80523d10: 'setPlayerToMasterController__Q26System12KPadDirectorFUc'
0x80523eac: 'resetMasterController__Q26System12KPadDirectorFv'
0x80523ebc: 'initPlayerController__Q26System12KPadDirectorFUcb'
0x805240ec: 'setMasterToPlayerController__Q26System12KPadDirectorFUc'
0x80524264: 'resetPlayerController__Q26System12KPadDirectorFUc'
0x8052427c: 'resetPlayerControllers__Q26System12KPadDirectorFv'
0x805242d8: 'initPlayerControllers__Q26System12KPadDirectorFv'
0x80524438: 'setPlayerController__Q26System12KPadDirectorFUcQ26System14eControlSourceUc'
0x80524500: 'setGhostController__Q26System12KPadDirectorFUc'
0x8052453c: 'setGhostController__Q26System12KPadDirectorFUcPUsb'
0x80524558: 'unk_80524558'
0x80524568: 'KPadDirector_startRace'
0x80524580: 'KPadDirector_startGhostProxies'
0x805245cc: 'KPadDirector_endGhostProxy'
0x805245dc: 'unk_805245dc'
0x80524628: 'KPadDirector_getPadStatus'
0x805246c0: 'unk_805246c0'
0x80524718: 'unk_80524718'
0x80524734: 'unk_80524734'
0x80524788: 'unk_80524788'
0x805247e4: 'unk_805247e4'
0x80524840: 'unk_80524840'
0x805248d8: 'unk_805248d8'
0x80524568: 'lockGhostProxies__Q26System12KPadDirectorFv'
0x80524580: 'startGhostProxies__Q26System12KPadDirectorFv'
0x805245cc: 'endGhostProxy__Q26System12KPadDirectorFUc'
0x805245dc: 'endGhostProxies__Q26System12KPadDirectorFv'
0x80524628: 'getPadStatus__Q26System12KPadDirectorFUcP9PADStatus'
0x805246c0: 'loadRumbleSettings__Q26System12KPadDirectorFv'
0x80524718: 'unloadRumbleSettings__Q26System12KPadDirectorFv'
0x80524734: 'syncDeviceCallbackImpl__Q26System12KPadDirectorFi'
0x80524788: 'startSync__Q26System12KPadDirectorFv'
0x805247e4: 'stopSync__Q26System12KPadDirectorFv'
0x80524840: 'enableDpds__Q26System12KPadDirectorFPb'
0x805248d8: 'restoreDpds__Q26System12KPadDirectorFPb'
0x80524944: 'unk_80524944'
0x80524998: 'unk_80524998'
0x805249b0: 'unk_805249b0'
0x805249c8: 'unk_805249c8'
0x805249c8: 'stopAllMotors2__Q26System12KPadDirectorFv'
0x80524a50: 'unk_80524a50'
0x80524a58: 'unk_80524a58'
0x80524aa8: 'AiController_vf10'
0x80524ab0: 'unk_80524ab0'
0x80524ab4: 'unk_80524ab4'
0x80524a58: 'calcInner__Q26System16KPadAIControllerFPQ26System18KPadRaceInputStatePQ26System16KPadUIInputState'
0x80524aa8: 'getControlSource__Q26System16KPadAIControllerFv'
0x80524ab0: 'calcInner__Q26System19KPadDummyControllerFPQ26System18KPadRaceInputStatePQ26System16KPadUIInputState'
0x80524ab4: '__sinit__KPadDirector_cpp'
0x80524ac4: 'GhostWriter_construct'
0x80524c2c: 'GhostWriter_destroy'
0x80524ca8: 'GhostWriter_reset'
Expand Down
4 changes: 2 additions & 2 deletions source/game/system/KPadController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ extern UNKNOWN_FUNCTION(__nwa__FUl);
// PAL: 0x80229ee0
extern UNKNOWN_FUNCTION(__dla__FPv);
// PAL: 0x80523a58
extern UNKNOWN_FUNCTION(unk_80523a58);
extern UNKNOWN_FUNCTION(getControllerType__Q26System12KPadDirectorFQ26System14eControlSource);
// PAL: 0x80524628
extern UNKNOWN_FUNCTION(KPadDirector_getPadStatus);
extern UNKNOWN_FUNCTION(getPadStatus__Q26System12KPadDirectorFUcP9PADStatus);
// PAL: 0x80524ac4
extern UNKNOWN_FUNCTION(GhostWriter_construct);
// PAL: 0x80524ca8
Expand Down
16 changes: 8 additions & 8 deletions source/game/system/KPadController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ class KPadController {
virtual void setDriftIsAuto(bool isAuto); // [vt+0x38]
virtual void* vf_3c(); // [vt+0x3c]
virtual u32 getBatteryLevelAsync(); // [vt+0x40]
virtual void reset(bool isDriftAuto); // [vt+0x44]
virtual void reset(bool driftIsAuto); // [vt+0x44]

public:
KPadRaceInputState mRaceInputState; // [this+0x04]
Expand Down Expand Up @@ -410,7 +410,7 @@ class KPadWiiController : public KPadController {
bool isDpdEnabled() override; // [vt+0x2c]
int getChan() override; // [vt+0x34]
u32 getBatteryLevelAsync() override; // [vt+0x40]
void reset(bool isDriftAuto) override; // [vt+0x44]
void reset(bool driftIsAuto) override; // [vt+0x44]

private:

Expand Down Expand Up @@ -473,7 +473,7 @@ class KPadGCController : public KPadController {
void stopMotor() override; // [vt+0x1c]
void stopMotorHard() override; // [vt+0x20]
int getChan() override; // [vt+0x34]
void reset(bool isDriftAuto) override; // [vt+0x44]
void reset(bool driftIsAuto) override; // [vt+0x44]

public:
PADStatus mPadStatus; // [this+0x90]
Expand Down Expand Up @@ -501,7 +501,7 @@ class KPadGhostController : public KPadController {
eControlSource getControlSource() override; // [vt+0x10]
double getStreamSize() override; // [vt+0x24]
void setDriftIsAuto(bool isAuto) override; // [vt+0x38]
void reset(bool isDriftAuto) override; // [vt+0x44]
void reset(bool driftIsAuto) override; // [vt+0x44]

bool hasGhostBuffer() const;
void readGhostBuffer(u16* buttonsData, bool isAuto);
Expand Down Expand Up @@ -606,8 +606,8 @@ class KPad {
KPadUIInputState mUIInputState; // [this+0x58]
KPadUIInputState mPrevUIPInputState; // [this+0x8c]
s16 _c0; // Is drift auto (?)
u16 _c2; // Frames holding the same input
u16 _c4; // Frames controller has been disconnected
u16 mInactivityFrames; // [this+0xc2]
u16 mDisconnectedFrames; // [this+0xc4]
bool _c6; // Is paused (?)
u8 _c7;
KPadControllerInfo mControllerInfo; // [this+0xc8]
Expand All @@ -629,7 +629,7 @@ class KPadPlayer : public KPad {

void setGhostController(KPadController* controller,
KPadController* controller2,
bool isDriftAuto);
bool driftIsAuto);

public:
u16* mGhostBuffer; // [this+0xd8]
Expand All @@ -646,7 +646,7 @@ static_assert(sizeof(KPadPlayer) == 0xec);

class KPadAI : public KPad {
public:
virtual ~KPadAI() {}; // [vt+0x08]
virtual ~KPadAI() {}; // [vt+0x08]

// [vt+0x14]
void setInputState(KPadRaceInputState* raceInputState) override;
Expand Down
Loading

0 comments on commit a7734cc

Please sign in to comment.