Decompile padmgr.c (#1246)

* Decompile padmgr.c

* Format

* Enum names

* Update namefixer

* Suggested changes

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>

* Suggested changes, improve motor.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Further suggested changes

* Format

* Fix `controller.h` comment

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

---------

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
Tharo
2023-05-26 13:57:44 -04:00
committed by GitHub
co-authored by Anghelo Carvajal Derek Hensley engineer124
parent 22af2bb8fe
commit 6d20839ab0
24 changed files with 1103 additions and 236 deletions
+6 -6
View File
@@ -29,7 +29,7 @@ typedef struct {
/* 0x03 */ u8 flags3;
} RestrictionFlags;
Input sPostmanTimerInput[4];
Input sPostmanTimerInput[MAXCONTROLLERS];
#define RESTRICTIONS_TABLE_END 0xFF
@@ -887,10 +887,10 @@ void Interface_SetVertices(PlayState* play) {
s32 sPostmanTimerInputBtnAPressed = false;
void Interface_PostmanTimerCallback(s32 arg0) {
void Interface_PostmanTimerCallback(void* arg) {
s32 btnAPressed;
func_80175E68(&sPostmanTimerInput[0], 0);
PadMgr_GetInputNoLock(sPostmanTimerInput, false);
btnAPressed = CHECK_BTN_ALL(sPostmanTimerInput[0].cur.button, BTN_A);
if ((btnAPressed != sPostmanTimerInputBtnAPressed) && btnAPressed) {
gSaveContext.postmanTimerStopOsTime = osGetTime();
@@ -5654,7 +5654,7 @@ void Interface_DrawTimers(PlayState* play) {
}
gSaveContext.timerStates[TIMER_ID_POSTMAN] = TIMER_STATE_POSTMAN_COUNTING;
sPostmanTimerInputBtnAPressed = true;
func_80174F7C(Interface_PostmanTimerCallback, NULL);
PadMgr_SetInputRetraceCallback(Interface_PostmanTimerCallback, NULL);
break;
case TIMER_STATE_POSTMAN_STOP:
@@ -5663,7 +5663,7 @@ void Interface_DrawTimers(PlayState* play) {
postmanTimerStopOsTime - ((void)0, gSaveContext.timerStartOsTimes[TIMER_ID_POSTMAN]) -
((void)0, gSaveContext.timerPausedOsTimes[TIMER_ID_POSTMAN]));
gSaveContext.timerStates[TIMER_ID_POSTMAN] = TIMER_STATE_POSTMAN_END;
func_80174F9C(Interface_PostmanTimerCallback, NULL);
PadMgr_UnsetInputRetraceCallback(Interface_PostmanTimerCallback, NULL);
break;
case TIMER_STATE_POSTMAN_COUNTING:
@@ -7211,7 +7211,7 @@ void Interface_Update(PlayState* play) {
void Interface_Destroy(PlayState* play) {
Map_Destroy(play);
func_80174F9C(Interface_PostmanTimerCallback, NULL);
PadMgr_UnsetInputRetraceCallback(Interface_PostmanTimerCallback, NULL);
}
void Interface_Init(PlayState* play) {