Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
rumble.c
Go to the documentation of this file.
1#include "common.h"
2#include "nu/nusys.h"
3#include "rumble.h"
4
5// TODO: replace nustuff with defines
6
9
10void poll_rumble(void) {
11 nuContRmbCheck(0);
12 nuContRmbModeSet(0, 2);
13}
14
15void start_rumble(s32 freq, s32 nframes) {
17 if (rumbleMaxDuration != 0) {
18#if !VERSION_JP
19 s32 maxFrames = rumbleMaxDuration * 2;
20
21 if (nframes > maxFrames) {
22 nframes = maxFrames;
23 }
24#endif
25
26 if (nuContRmbCheck(0) == 0) {
27 nuContRmbModeSet(0, 2);
28 nuContRmbStart(0, freq, nframes);
29 }
30 }
31 }
32}
33
44
46#if VERSION_JP
48#else
50#endif
51}
@ DEMO_STATE_NONE
Definition enums.h:3535
s32 rumbleButtons
Definition rumble.c:8
u16 rumbleMaxDuration
Definition rumble.c:7
void update_max_rumble_duration(void)
Definition rumble.c:34
void start_rumble(s32 freq, s32 nframes)
Definition rumble.c:15
void reset_max_rumble_duration(void)
Definition rumble.c:45
void poll_rumble(void)
Definition rumble.c:10
GameStatus * gGameStatusPtr
Definition main_loop.c:32