Rumble cvar and fixes (#184)

* Rumble indefinitely until turned off

* Add rumble cvar

* Register CVar

* Check if controller can rumble to insert rumble pak

* Reduce verbosity of checks

* Remove extraneous const_cast

* Once again remove extraneous const_cast

* Add per-controller settings

* Add nice spacing

* Only display controller entry if pad connected

* Const some stuff
This commit is contained in:
Sirius902 2022-04-26 16:50:24 -07:00 committed by GitHub
parent 486f673df5
commit eea5135d62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 274 additions and 150 deletions

View file

@ -269,7 +269,7 @@ void PadMgr_ProcessInputs(PadMgr* padMgr) {
input->press.stick_y += (s8)(input->cur.stick_y - input->prev.stick_y);
}
controllerCallback.rumble = padMgr->rumbleEnable[0] > 0 ? 1 : 0;
controllerCallback.rumble = CVar_GetS32("gRumbleEnabled", 0) && (padMgr->rumbleEnable[0] > 0);
if (HealthMeter_IsCritical()) {
controllerCallback.ledColor = 0;
@ -303,6 +303,11 @@ void PadMgr_HandleRetraceMsg(PadMgr* padMgr) {
}
osRecvMesg(queue, NULL, OS_MESG_BLOCK);
osContGetReadData(padMgr->pads);
for (i = 0; i < __osMaxControllers; i++) {
padMgr->padStatus[i].status = CVar_GetS32("gRumbleEnabled", 0) && Controller_ShouldRumble(i);
}
if (padMgr->preNMIShutdown) {
memset(padMgr->pads, 0, sizeof(padMgr->pads));
}