-
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Configuration is provided with presets.json and config.json files, where first one is supplied with program and may be changed from one update to another, while config.json is edited by you and can stay the same until told otherwise.
Before starting first time you should copy config.template.json to config.json. Check out later one to set used profile, change calibration and create custom profiles.
Configuration is provided as a set of profiles, where one profile can inherit from one or few others. Below you can see profile basics, demonstrated on built-in profiles.
Also, there is a bunch of global values which aren't bound to any profiles and are purely specific to hardware setup. They are described in template configuration and aren't covered in this guide.
// Base constants which are required in every configuration
"baseBuiltin": {
"ACCEL_GRAV_WII": 103, // Gravitational acceleration (in raw data units)
"ACCEL_GRAV_REAL": 1, // Gravitational acceleration (in Gs)
"GYRO_MAX_WII": 335160, // Maximal rotation your MotionPlus can handle out (in raw data units)
"GYRO_MAX_REAL": 1860, // Maximal rotation your MotionPlus can handle out (deg/s)
},
"base": {
"basedOn": ["baseOverride", "baseBuiltin"]
},This profile provide constants that must exist in any profile you try to use. It also provides a very basic example of how inheritance work: profiles in basedOn are tried in their listed order, so if you will define profile baseOverride with, say, ACCEL_GRAV_WII defined, your value will override one from baseBuiltin.
"Vertical": {
"basedOn": "base",
"keys": {
"up": "up",
"right": "right",
"down": "down",
"left": "left",
"A": "A",
"B": "B",
"options": "home"
},
"accel": {
"x": ["x", 1],
"y": ["y", 1],
"z": ["z", -1]
},
"gyro": {
"p": ["z", 1],
"y": ["y", -1],
"r": ["x", 1]
}
},This is a simple example of how complete profile may look like. It maps D-Pad, A, B and Home directly and correspond to WiiMote held vertically, so it isn't too useful and serves more like an example.
"Pointed away": {
"basedOn": "Vertical",
"accel": {
"y": ["z", -1],
"z": ["y", 1]
},
"gyro": {
"y": ["x", 1],
"r": ["y", 1]
}
},Corresponds to WiiMote being held horizontally while being pointed away from you. This could be useful for a variety of games, e.g. Splatoon. Being derived from Vertical, button mappings stay the same, so you still will likely have to change them by deriving from this profile.
"Dolphin": {
"basedOn": "Pointed away",
"keys": {
"L1": "minus",
"R1": "plus",
"L2": "one",
"R2": "two"
}
},This one is specifically intended as plug-and-play profile for Dolphin emulator, matching its orientation and default button mapping. Please note that it isn't nearly the best way to connect wiimote to Dolphin, but still may be useful in some situations.
"Horizontal": {
"basedOn": "base",
"keys": {
"up": "right",
"right": "down",
"down": "left",
"left": "up",
"A": "one",
"B": "two",
"options": "home"
},
"accel": {
"x": ["y", -1],
"y": ["z", -1],
"z": ["x", -1]
},
"gyro": {
"p": ["y", -1],
"y": ["x", 1],
"r": ["z", 1]
}
},This profile is active by default because it is actually pretty useful: it corresponds to WiiMote held horizontally with D-Pad on the left, which is mapped the way it's oriented to you, while buttons A and B are mapped to One and Two accordingly.
It is a good base for custom profile.
"Disable D-Pad": {
"keys": {
"up": "",
"right": "",
"down": "",
"left": "",
}
},While this profile is useless by itself and doesn't inherit from base profile, it can be combined with other profiles to easily tweak them as you'll see below.
"Horizontal with left joystick": {
"basedOn": ["Disable D-Pad", "Horizontal"],
"keys": {
"leftjoy": {
"x": {
"minus": "up",
"plus": "down"
},
"y": {
"minus": "left",
"plus": "right"
}
}
}
}This profile demonstrate a lot of features.
First, we easily disable D-Pad by inheriting from profile Disable D-Pad with highest priority, overriding values that are defined in Horizontal.
Second, obviously, it demonstrates how to setup joysticks. In this case D-Pad (in horizontal orientation) is mapped to left joystick.
That's how a complete profile would look like:
"My complete profile": {
"basedOn": "base",
"keys": {
// D-Pad
"up": "",
"right": "",
"down": "",
"left": "",
// Buttons
"A": "",
"B": "",
"X": "",
"Y": "",
"L1": "",
"R1": "",
"L2": "",
"R2": "",
"L3": "",
"R3": "",
"options": "",
"share": "",
// Joysticks
"leftjoy": {
"x": {
"minus": "",
"plus": ""
},
"y": {
"minus": "",
"plus": ""
}
},
"rightjoy": {
"x": {
"minus": "",
"plus": ""
},
"y": {
"minus": "",
"plus": ""
}
}
},
// Accelerometer
"accel": {
"x": ["x", 0],
"y": ["x", 0],
"z": ["x", 0]
},
// Gyroscope (MotionPlus)
"gyro": {
"p": ["x", 0], // Pitch
"y": ["x", 0], // Yaw
"r": ["x", 0] // Roll
}
},It show all values which are extracted from profile, excluding ones stored in base. Apparently, all values here are also default ones 😉.
You should add profiles right after last comment in config.json.
Keys correspond to emulated buttons (and joysticks), values - to physical buttons. List of valid emulated buttons is in listing above and those physical buttons are supported:
- D-Pad
**
up**right**down**left ABplusminushomeonetwo
Keys correspond to emulated axis, while value is array of physical axis and multiplier. Most common multiplier values include:
-
1to pass result unchanged -
-1to invert result -
0to ignore result
Please note that gyroscope directions may vary from one WiiMote to another, and proper way to fix them is adjusting last three values in Calibration entry for your WiiMote and NOT via profiles.