Difference between revisions of "Engine:FNA"
m (GetGUIDEXT Link) |
m (Linux info I wrote for other pages...) |
||
Line 41: | Line 41: | ||
FNA supports the DualShock 4 light bar. The [https://github.com/flibitijibibo/FNA/wiki/5:-FNA-Extensions#setlightbarext SetLightBarEXT] extension allows you to set the color of the light bar by way of adjusting the brightness of the RGB LEDs. | FNA supports the DualShock 4 light bar. The [https://github.com/flibitijibibo/FNA/wiki/5:-FNA-Extensions#setlightbarext SetLightBarEXT] extension allows you to set the color of the light bar by way of adjusting the brightness of the RGB LEDs. | ||
− | Currently | + | Currently this is only supported on Linux, with kernel 3.15 and higher or SteamOS version 137 and higher. |
If a game supports this extension, simply allow write permission to the brightness files for the red/blue/green LEDs via /sys/class/leds/. For example: | If a game supports this extension, simply allow write permission to the brightness files for the red/blue/green LEDs via /sys/class/leds/. For example: |
Revision as of 21:24, 21 June 2015
Developers | |
---|---|
Ethan Lee | |
Website | |
http://fna-xna.github.io/ |
Information
FNA is an open source reimplementation of the Microsoft XNA Framework, specifically the 4.0 Refresh revision. It started as a branch of MonoGame called "MonoGame-SDL2".
The goal of the project is to recreate a fast, portable, and accurate XNA4 runtime library that prevents the need for code/content changes on the part of the XNA game developer. The currently supported platforms include Windows, Mac OS X and GNU/Linux, with further platform support including those supported by SDL2.
Joysticks
About XNA Joystick Support
XNA, being a Microsoft technology, centered its controller input around the Xbox 360 Controller. Because of this, the XNA API is not cleanly compatible with custom controllers, including the Xbox 360 Controller when not being read by XInput. However, a config format was developed to allow binding of joystick input values to a virtual 360 controller, which then gets read by XNA games.
Automatic Configuration: SDL_GameController
Since FNA uses SDL2 as its base library, we also get the benefit of SDL_GameController, a new subsystem added by Alfred Reynolds at Valve. This takes configurations for known controllers and automatically configures them for the virtual 360 controller, so if your controller is recognized, manual configuration is not necessary. If you run an FNA title through Steam, your controller will automatically be configured using the Big Picture Mode configuration.
About GUIDs
In addition to expanded configuration support, FNA provides the GetGUIDEXT extension that allows XNA devs to pull in a trimmed/standardized GUID string to determine the controller hardware and react accordingly. TowerFall Ascension uses this for button icon support, for example.
Consider this GUID from the PlayStation 4 controller:
// These are the strings reported by SDL2's SDL_JoystickGetGUIDString: // https://wiki.libsdl.org/SDL_JoystickGetGUIDString 4c05c405000000000000504944564944 // Windows. Note characters 1-8. 4c05000000000000c405000000000000 // OSX. Note characters 1-4 and 17-20. 030000004c050000c405000011010000 // Linux. Note characters 9-12 and 17-20. 4c05c405 // This is the GUID string returned by FNA. Get it?
For XInput controllers on Windows, the GUID string is simply 'xinput'.
DualShock 4 Light Bar Support
FNA supports the DualShock 4 light bar. The SetLightBarEXT extension allows you to set the color of the light bar by way of adjusting the brightness of the RGB LEDs.
Currently this is only supported on Linux, with kernel 3.15 and higher or SteamOS version 137 and higher.
If a game supports this extension, simply allow write permission to the brightness files for the red/blue/green LEDs via /sys/class/leds/. For example:
cd /sys/class/leds/ chmod 777 0003:054C:05C4.0021:red/brightness chmod 777 0003:054C:05C4.0021:green/brightness chmod 777 0003:054C:05C4.0021:blue/brightness
Note that the folder noted above can change per instance, but the constant value is 054C:05C4, the hardware ID for the DualShock 4. Also note that you will need root access to run the chmod operations.