Wii: Wiimote rumble
Jeffrey Pfau jeffrey@endrift.com
Sun, 23 Aug 2015 02:10:14 -0700
1 files changed,
10 insertions(+),
0 deletions(-)
jump to
M
src/platform/wii/main.c
→
src/platform/wii/main.c
@@ -27,6 +27,7 @@ static bool GBAWiiLoadGame(const char* path);
static void _postVideoFrame(struct GBAAVStream*, struct GBAVideoRenderer* renderer); static void _audioDMA(void); +static void _setRumble(struct GBARumble* rumble, int enable); static void _drawStart(void); static void _drawEnd(void);@@ -35,6 +36,7 @@
static struct GBAContext context; static struct GBAVideoSoftwareRenderer renderer; static struct GBAAVStream stream; +static struct GBARumble rumble; static FILE* logfile; static GXRModeObj* mode; static Mtx model, view, modelview;@@ -138,6 +140,8 @@ stream.postAudioFrame = 0;
stream.postAudioBuffer = 0; stream.postVideoFrame = _postVideoFrame; + rumble.setRumble = _setRumble; + GBAContextInit(&context, 0); struct GBAOptions opts = { .useBios = true,@@ -147,6 +151,7 @@ };
GBAConfigLoadDefaults(&context.config, &opts); context.gba->logHandler = GBAWiiLog; context.gba->stream = &stream; + context.gba->rumble = &rumble; GBAVideoSoftwareRendererCreate(&renderer); renderer.outputBuffer = memalign(32, 256 * 256 * BYTES_PER_PIXEL);@@ -400,3 +405,8 @@ keys |= 1 << GUI_INPUT_DOWN;
} return keys; } + +void _setRumble(struct GBARumble* rumble, int enable) { + UNUSED(rumble); + WPAD_Rumble(0, enable); +}