Recently, I've been testing Doom Legacy in my Raspberry Pi 2, a small single-board computer that has an ARM processor and runs Linux, with a distro called Retropie that can basically turn it into a gaming console, operating only through gamepads. Some guys on RetroPie forum were able to compile Doom Legacy in Raspberry Pi computers, thus being able to use it for playing Doom in split-screen with two controllers.
However, although DL runs fine in RPi, this sourceport isn't fully optimized for a console-like experience. Unlike all other frontends and emulators inside RetroPie whose menus and interfaces are fully navigable with USB controllers, Doom Legacy won't allow you to navigate through menus without a keyboard or a mouse.
I'm sending, as an attachment, a patch that implements a console-like experience in Doom Legacy, and aims to address those issues. The patch was created by a "svn diff" command, based in the commit 1453, the latest one from now.
Here's a description of the changes contained in the patch:
- Allow menu navigation with a gamepad: By using SDL_JOYHATMOTION event, now the D-Pad of the first controller works as arrow keys in menus, thus allowing player one to navigate in the menus with your gamepad;
- Translation of joystick hats to button mappings: By using SDL_JOYHATMOTION event, now it's possible to bind D-Pad directions to actions, just like moving or changing weapons / inventory;
- Translation of Xbox360 triggers to button mappings: By using SDL_JOYAXISMOTION event and a local routine that uses SDL_JoystickName function in order to try to detect Xbox360 controllers, now it's possible to bind those buttons to actions, such as RT to shoot, or LT to look up;
- Joystick axis deadzone support: Applies axes movements only if the values are between 4000 and 32768, or -4000 and -32768. This way, axes won't be super-sensitive to smallest movements ocurred when the analog sticks aren't fully centered, or somehow loosen. Useful to avoid a bug where players keep moving like crazy on controllers sometimes;
- Axes movements sensible to "Run" command: Doubles axes values when "Run" is pressed / activated. Works only when player is moving or strafing;
- Ability to read autoexec file in home folder: Useful for having "autoexec.cfg" in the same folder as "config.cfg";
- New automatic bindings for the first plugged controller:
- "Y" key to "Enter" Key / Button 1: To confirm the operation in confirmation popups, such as ending a game or exiting DL without a keyboard. The "Y" key still works;
- "N" key to "ESC" Key / Button 2: To cancel the operation in confirmation popups. The "N" key still works;
- "S" key to "Enter" Key / Button 1: In order to start a multiplayer game when "Wait players" is greater than 1 and other players haven't connected to you yet. The "S" key still works;
- New control bindings:
- Automap: To show the map from a controller button (ex: R1 or RB). TAB key still works;
- Main Menu: To open main menu from a controller button (ex: START). ESC key still works;
- Pause: To pause the game from a controller button (ex: SELECT or BACK). Pause key still works;
- New multiplayer / splitscreen game options:
- Bots: Allows you to add bots in a game, without having to recurr to "addbot" console command (already added in recent commits);
- Randomize Bots: If true, bots will be added with random names, colors and skins (if there's any). If false, bots will be added in the original sequence of names (Frag-God, Thresh, Reptile, etc), colors (green, indigo, brown, red, etc) and will always use the default "Marine" skin.
I tried creating this ticket in the "Patches" section, but it seems I have no permission to do that, so I'm posting it here. Sorry if it's in the wrong place, and sorry if some of my code changes aren't as good as it should, since I'm not as versed in C++ as I wanted to be. But at least for me, all those changes worked fine, both on my desktop with Ubuntu and my RPi2 with a Debian-based distro.
Doom Legacy is a great source port and I wanted to help its development somehow. I hope my contribution helps, and that you guys include them in DL in the future.
DoomLegacy 1.48 is having problems with the network code. It kicks players during testing, and it is not recovering as it should.
I am rewriting most of the network code to remove the fragile hacks and kluges.
I am introducing all the network fixes I can now, because to do so later would require another major release.