You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
120 lines
4.2 KiB
JavaScript
120 lines
4.2 KiB
JavaScript
#!/usr/bin/env node
|
|
const path = require("path");
|
|
const fs = require("fs");
|
|
|
|
const config = {
|
|
"Dolphin": {
|
|
"BluetoothPassthrough": {
|
|
"Enabled": false
|
|
}
|
|
},
|
|
"WiimoteNew": {
|
|
"Wiimote1": {
|
|
"Device": "SDL/0/Steam Controller",
|
|
"Buttons/A": "`Button S`",
|
|
"Buttons/B": "`Trigger R` | `Button E`",
|
|
"Buttons/1": "`Button W`",
|
|
"Buttons/2": "`Button N`",
|
|
"Buttons/-": "Back",
|
|
"Buttons/+": "Start",
|
|
"Buttons/Home": "Return",
|
|
"D-Pad/Up": "`Pad N`",
|
|
"D-Pad/Down": "`Pad S`",
|
|
"D-Pad/Left": "`Pad W`",
|
|
"D-Pad/Right": "`Pad E`",
|
|
"IR/Up": "`XInput2/0/Virtual core pointer:Cursor Y-`",
|
|
"IR/Down": "`XInput2/0/Virtual core pointer:Cursor Y+`",
|
|
"IR/Left": "`XInput2/0/Virtual core pointer:Cursor X-`",
|
|
"IR/Right": "`XInput2/0/Virtual core pointer:Cursor X+`",
|
|
"Shake/X": "`Button W`",
|
|
"Shake/Y": "`Click 2`",
|
|
"Shake/Z": "`Click 2`",
|
|
"IRPassthrough/Object 1 X": "`IR Object 1 X`",
|
|
"IRPassthrough/Object 1 Y": "`IR Object 1 Y`",
|
|
"IRPassthrough/Object 1 Size": "`IR Object 1 Size`",
|
|
"IRPassthrough/Object 2 X": "`IR Object 2 X`",
|
|
"IRPassthrough/Object 2 Y": "`IR Object 2 Y`",
|
|
"IRPassthrough/Object 2 Size": "`IR Object 2 Size`",
|
|
"IRPassthrough/Object 3 X": "`IR Object 3 X`",
|
|
"IRPassthrough/Object 3 Y": "`IR Object 3 Y`",
|
|
"IRPassthrough/Object 3 Size": "`IR Object 3 Size`",
|
|
"IRPassthrough/Object 4 X": "`IR Object 4 X`",
|
|
"IRPassthrough/Object 4 Y": "`IR Object 4 Y`",
|
|
"IRPassthrough/Object 4 Size": "`IR Object 4 Size`",
|
|
"IMUAccelerometer/Up": "`Shoulder R`",
|
|
"IMUAccelerometer/Down": "`Accel Down`",
|
|
"IMUAccelerometer/Left": "`Accel Left`",
|
|
"IMUAccelerometer/Right": "`Accel Right`",
|
|
"IMUAccelerometer/Forward": "`Accel Forward`",
|
|
"IMUAccelerometer/Backward": "`Accel Backward`",
|
|
"IMUGyroscope/Pitch Up": "`Gyro Pitch Up`",
|
|
"IMUGyroscope/Pitch Down": "`Gyro Pitch Down`",
|
|
"IMUGyroscope/Roll Left": "`Gyro Roll Left`",
|
|
"IMUGyroscope/Roll Right": "`Gyro Roll Right`",
|
|
"IMUGyroscope/Yaw Left": "`Gyro Yaw Left`",
|
|
"IMUGyroscope/Yaw Right": "`Gyro Yaw Right`",
|
|
"Extension": "Nunchuk",
|
|
"Nunchuk/Buttons/C": "`Shoulder L`",
|
|
"Nunchuk/Buttons/Z": "`Trigger L`",
|
|
"Nunchuk/Stick/Up": "`Left Y+`",
|
|
"Nunchuk/Stick/Down": "`Left Y-`",
|
|
"Nunchuk/Stick/Left": "`Left X-`",
|
|
"Nunchuk/Stick/Right": "`Left X+`",
|
|
"Nunchuk/Stick/Calibration": "100.00 101.96 108.24 115.81 116.93 116.65 108.24 101.96 100.00 101.96 108.24 109.55 109.52 109.58 108.24 101.96 100.00 101.96 108.24 112.38 113.77 113.06 108.24 101.96 100.00 101.96 108.24 112.86 114.09 114.41 108.24 101.96",
|
|
"Nunchuk/Shake/X": "`Click 2`",
|
|
"Nunchuk/Shake/Y": "`Click 2`",
|
|
"Nunchuk/Shake/Z": "`Click 2`",
|
|
"Source": "1",
|
|
"IMUIR/Enabled": "False",
|
|
"IR/Auto-Hide": "True",
|
|
"Extension/Attach MotionPlus": "False"
|
|
},
|
|
"Wiimote2": {
|
|
"Device": "XInput2/0/Virtual core pointer",
|
|
"Source": "0"
|
|
},
|
|
"Wiimote3": {
|
|
"Device": "XInput2/0/Virtual core pointer",
|
|
"Source": "0"
|
|
},
|
|
"Wiimote4": {
|
|
"Device": "XInput2/0/Virtual core pointer",
|
|
"Source": "0"
|
|
},
|
|
"BalanceBoard": {
|
|
"Device": "XInput2/0/Virtual core pointer",
|
|
"Source": "0"
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function format_value(value){
|
|
if(typeof value== "boolean"){
|
|
return value? "True" : "False";
|
|
}else{return value}
|
|
}
|
|
|
|
for (const [system, sections] of Object.entries(config)) {
|
|
if(system =="WiimoteNew"){
|
|
let content = "";
|
|
for (const [section, keys] of Object.entries(sections)) {
|
|
content += `[${section}]\n`;
|
|
|
|
for (const [key, value] of Object.entries(keys)) {
|
|
content += `${key} = ${format_value(value)}\n`;
|
|
}
|
|
|
|
content += "\n";
|
|
}
|
|
fs.writeFileSync(path.resolve(process.env.DOLPHIN_CONFIG_DIR, "WiimoteNew.ini"), content);
|
|
continue;
|
|
}
|
|
for (const [section, keys] of Object.entries(sections)) {
|
|
for (const [key, value] of Object.entries(keys)) {
|
|
console.log(`--config=${system}.${section}.${key}=${format_value(value)}`);
|
|
}
|
|
}
|
|
}
|