What's new

Wiimote Input Plugin for OoT (0.1)

jyc673

New member
Wiimote Input Plugin for OoT (Version 0.2, with Classic Controller support!)

Update 4-20-08: 0.2 released. It will use the Classic Controller, then default to Wiimote + Nunchuk. One bug fix (if you didn't get to connect the wii remote, you can restart the emulation without having Mupen64 crashing).

hi all, it's my first post here (you might have noticed on the left there). Anyway, I wanted to start a mini coding project that's fun, brush up my C (been programming in Java and Ruby recently, but gonna start programming with PAlib for my DS/R4), and teach me how to use wiiuse (an awesome API for wii remotes), so I made a crude plugin for you guys' awesome emulator. It's no Twilight Princess, but hey, it works!

Download Source (No Binaries):
0.2: http://www.mediafire.com/?ner9f0izea5

0.1: http://www.mediafire.com/?zjlnnbzl0mz

Obviously, you're gonna need a Wiimote + nunchuk (no wii required) and a Bluetooth dongle/adapter/whatever. Dependencies (Ubuntu apt-get them):

libbluetooth2-dev
libgtk2-dev (I think...it uses GTK)

Terminal: make && sudo make install

And then copy wii_oot_plugin.so to your plugins folder.

The first time you open a ROM when your emulator, the emulation screen will be black for ~5 seconds, and that's your cue to connect by pressing 1+2.

It should be easy to port to Windoze, no Linux-specific dependency (unless M$ decides to make Windoze not POSIX-compliant...This plugin uses a POSIX thread for polling, though it's kind of a crude hack).

I'll make it configurable sometime after I finish a Smash64 version...

Comments, suggestions, bug reports?
 
Last edited:
OP
J

jyc673

New member
controls

Oh, and I forgot to explain the control mapping:

Code:
[U]N64        |  Wii remote[/U]
A          | A
B          | B or Flick
C Buttons  | DPad
Joystick   | Nunchuk Joystick
Z Trigger  | Z (Nunchuk)
R Trigger  | C (Nunchuk)
L Trigger  | 1
Start      | Home

If you want to modify it, look in handle_event, near the end of main.c
 

lifning

New member
I've previously used cwiid before to simulate a joystick, which I then configured through blight's input plugin, to get a similar effect. However, this seems like a useful and more direct approach. I'm pretty sure I couldn't map "flick" with cwiid, after all. =) Can't wait to see more developments on this plugin! Will it support the "classic" controller?
 
OP
J

jyc673

New member
Yeah, for the general purpose input driver like cwiid/wminput and wiiuse/xwii, the focus has to be on the emulator window (so no IM-ing and MK64, and dreaming that it's actually MKWii and Nintendo did WiiFi the right way).

The flicking is done with checking the gforce, so each direction can represent a different action, like in Smash Brawl (if you don't have it or haven't tried the nunchuk config, flicking the wii remote would give you a smash attack in that direction).

It'd be very easy to implement the classic controller (in fact, if I cleaned up handle_event, you could probably programmed it...The "if" statements represent the button config, and I'll modularize the axis config), but I'm busy cleaning up my laptop. I might have it by tomorrow, but I don't have a classic controller to debug...but there shouldn't be a large problem porting. I'll put handle_event in another file with lotsa comments so everyone can config it the way they want while I learn gtk.
 
OP
J

jyc673

New member
0.2 released, with classic controller support.

Oh, and look in config.c if you want to configure the control scheme. It's not that hard...And recompile+copy+paste to use your new scheme

I'll look into gtk...sometime...
 

Top