Close

Web-Bluetooth (BLE) configuration interface

A project log for BlueRetro

Multiplayer Bluetooth controllers adapter for retro video game consoles

Jacques GagnonJacques Gagnon 06/30/2020 at 23:280 Comments

BlueRetro configuration is all done via Web Bluetooth pages which does not require anything to be installed. It can be used on desktop or mobile.

Currently two pages exist, the first being the advance configuration from which you can configure everything. The second allows loading the adapter with presets for various games. JavaScript is not my strong force so the pages are essentially a big hack of Google's Web Bluetooth sample page :) .

Simply press Connect on either page and select BlueRetro in the list. BlueRetro configuration will be only available if no controllers are connected. This maximize airtime for controllers for gameplay.

Advance config page

Global config

From this section you can configure global settings like forcing system type or using system detection (Auto) (Only auto right now). You can enable multitap emulation as well (TBD).

Output config

Here you can configure the wired output device type (gamepad, alternative gamepad (like 6 buttons),  keyboard or mouse) and if applicable accessories used with the controller (rumble pak, memory card).

Mapping config

Up to 255 mapping can be added. Simply click on +/- buttons to add or remove a mapping. The label used are as generic as possible but still describe the usual function well. I say usual because even if the name implies an axis direction or a button it might not be the case. For example, the N64 destination RX-Left is C-Left button.

For each mapping you can configure various options which might or not be used base on what the source and destination end up to be a button or an axis and vice versa.

Presets page

Presets are predefined button mapping for a specific game or game type. They are JSON files located on the server that the client list via GitHub API. A user could simply fork the page on GitHub and upload its own presets.

{
    "name":"N64 GoldenEye 007 / Perfect Dark 2.2 Single Player",
    "desc":"This mapping expect that the game is configured with 2.2 control style. Left stick move, right stick look.",
    "map":[
        ["PAD_LX_LEFT",  "PAD_LX_LEFT",  1, 100, 50, 135, 0, 0, 0],
        ["PAD_LX_RIGHT", "PAD_LX_RIGHT", 1, 100, 50, 135, 0, 0, 0],
        ["PAD_LY_DOWN",  "PAD_LY_DOWN",  1, 100, 50, 135, 0, 0, 0],
        ["PAD_LY_UP",    "PAD_LY_UP",    1, 100, 50, 135, 0, 0, 0],
        ["PAD_RX_LEFT",  "PAD_LX_LEFT",  0, 100, 50, 135, 0, 0, 0],
        ["PAD_RX_RIGHT", "PAD_LX_RIGHT", 0, 100, 50, 135, 0, 0, 0],
        ["PAD_RY_DOWN",  "PAD_LY_DOWN",  0, 100, 50, 135, 0, 0, 0],
        ["PAD_RY_UP",    "PAD_LY_UP",    0, 100, 50, 135, 0, 0, 0],
        ["PAD_LD_LEFT",  "PAD_LD_LEFT",  0, 100, 50, 135, 0, 0, 0],
        ["PAD_LD_RIGHT", "PAD_LD_RIGHT", 0, 100, 50, 135, 0, 0, 0],
        ["PAD_LD_DOWN",  "PAD_LD_DOWN",  0, 100, 50, 135, 0, 0, 0],
        ["PAD_LD_UP",    "PAD_LD_UP",    0, 100, 50, 135, 0, 0, 0],
        ["PAD_RB_LEFT",  "PAD_RB_LEFT",  0, 100, 50, 135, 0, 0, 0],
        ["PAD_RB_DOWN",  "PAD_RB_DOWN",  0, 100, 50, 135, 0, 0, 0],
        ["PAD_MM",       "PAD_MM",       0, 100, 50, 135, 0, 0, 0],
        ["PAD_LM",       "PAD_LM",       0, 100, 50, 135, 0, 0, 0],
        ["PAD_LS",       "PAD_LM",       1, 100, 50, 135, 0, 0, 0],
        ["PAD_RM",       "PAD_RM",       0, 100, 50, 135, 0, 0, 0],
        ["PAD_RS",       "PAD_RM",       1, 100, 50, 135, 0, 0, 0]
    ]
}

Future pages

I plan to add pages for OTA firmware update and for SD card file management. The advance config is very exhaustive but too complex. A simpler version could be made to cover the most common use only.

Discussions