MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / PADControlMotor

Function PADControlMotor

src/dolphin/src/pad/Pad.c:514–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512#pragma pop
513
514void PADControlMotor(s32 chan, u32 command)
515{
516 BOOL enabled;
517 u32 chanBit;
518
519 enabled = OSDisableInterrupts();
520 chanBit = PAD_CHAN0_BIT >> chan;
521 if ((EnabledBits & chanBit) && !(SIGetType(chan) & SI_GC_NOMOTOR))
522 {
523 if (Spec < PAD_SPEC_2 && command == PAD_MOTOR_STOP_HARD)
524 {
525 command = PAD_MOTOR_STOP;
526 }
527
528 SISetCommand(chan, (0x40 << 16) | AnalogMode | (command & (0x00000001 | 0x00000002)));
529 SITransferCommands();
530 }
531 OSRestoreInterrupts(enabled);
532}
533
534void PADSetSpec(u32 spec)
535{

Callers 2

iPadStopRumbleFunction · 0.85
iPadStartRumbleFunction · 0.85

Calls 4

OSDisableInterruptsFunction · 0.85
SIGetTypeFunction · 0.85
SISetCommandFunction · 0.85
SITransferCommandsFunction · 0.85

Tested by

no test coverage detected