[Tutorial] OpenBOR - the complete guide
-
@cyperghost said in [Tutorial] OpenBOR - the complete guide:
What's a youtuber?
A miserable little pile of video data. But enough talk… Have at you!
-
@cyperghost My YouTube is Denver Gamer brother
-
My computer died on me. Literally. Actually, our cat stepped on the power cord and unplugged it, causing a chain reaction burn out of the mobo and ram. I just now got everything up and running with a new system from scratch.
Anyway, I'm back at this and trying to make OpenBOR work with more games. The first thing I did was try to launch a game so I could re-familiarize myself with it. Wouldn't you know? It doesn't work! ARGH! Not sure where the problem is, but (for instance) Asterix crashes right after showing "Act 1-1". I only have 2 games installed, Asterix and Balance of Power. Balance of Power crashes right after selecting the player (as I indicated awhile ago on the compatibility spreadsheet).
The
/dev/shm
log wasn't very helpful. It just showed that the game had exited, even though I don't press anything. So I went back through and verified all my controller settings were right. Didn't fix it. I then tried just REINSTALLING it, by choosing toUpdate from Source
in the RetroPie-Setup. That didn't make any difference either. So then I thought maybe the whole thing got corrupted or something, and decided to just start all over again. I uninstalled it through RetroPie-Setup, then re-downloaded the "patch" to the install script (wget http://raw.githubusercontent.com/crcerror/RetroPie-OpenBOR-scripts/master/openbor.sh -O /home/pi/RetroPie-Setup/scriptmodules/ports/openbor.sh
). I then rebooted and started the install process again. It looked the same as before, with errors and what not. After it finished, I rebooted and tried to launch the program from thePorts
menu. It loads up just fine, and shows the 2 games on the list. After picking one though, it crashes back to the EmulationStation screen. I do get an error though:Parameters: Executing: pushd /opt/retropie/ports/openbor; /opt/retropie/ports/openbor/OpenBOR ""; popd /opt/retropie/ports/openbor ~ Warning: couldn't load OpenGL library (No dynamic GL support in video driver) ~
This isn't always the case though. Sometimes I can get it to load the game and can navigate the menus. However, once I get it going and it displays (in Asterix for example..) Act 1-1, I get a different error:
Posted at pastebin to reduce post size here:
https://pastebin.com/9ii6Kf4VThis is pretty crappy. It was all working fine before! What am I missing?
EDIT
I've partially figured it out. It looks like it's choking on the number of controller adapters I have connected to the system. When I disconnected everything except the keyboard, everything loads and plays (the actual game not just menus) fine. The same is true when I connect the Xbox dongle. When I connect JUST 1 more adapter, either the Raphnet NES or the Mayflash SEGA, it still works ok. But if I have BOTH of them connected, it crashes back to ES. I don't actually have controllers connected to those adapters, they're just adding ports. But the system configures itself as if they're already connected. It looks like OpenBOR is choking when I try to add a 4th device type.I should be able to get around all this with XBOXDRV. I just need to add some extra configurations to disable the other adapters. Fingers Crossed this is where my problem is. I'm too tired to mess with it tonight. I'll find out tomorrow night after work if I'm not too tired then too.
-
Calling @mediamogul !!!
APB on @mediamogul !!!I still can't get this to run with 3 input devices being detected. My thoughts were that if I use XBOXDRV to detach the kernel drivers (not not map them to anything) it should then work to hide them from OpenBOR from trying to map them. My theory so far has come up empty. Any idea why this doesn't work?
if [ "$1" = "openbor" ] then sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \ --evdev /dev/input/by-id/usb-©Microsoft_Xbox_360_Wireless_Receiver_for_Windows_E1594E70-event-joystick \ --detach-kernel-driver \ --silent \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --dpad-as-button \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_RX=x2,ABS_RY=y2,ABS_Z=lt,ABS_RZ=rt \ --evdev-keymap BTN_SOUTH=a,BTN_EAST=b,BTN_NORTH=x,BTN_WEST=y,BTN_TL=lb,BTN_TR=rb,BTN_THUMBL=tl,BTN_THUMBR=tr,BTN_MODE=guide,BTN_SELECT=back,BTN_START=start,BTN_TRIGGER_HAPPY3=du,BTN_TRIGGER_HAPPY4=dd,BTN_TRIGGER_HAPPY1=dl,BTN_TRIGGER_HAPPY2=dr \ --ui-buttonmap x=KEY_F,a=KEY_A,b=KEY_D,lb=KEY_Z,Y=KEY_S,rb=KEY_X \ --ui-buttonmap guide=KEY_F12,start=KEY_ENTER,back=KEY_ESC \ --ui-buttonmap du=KEY_UP,dd=KEY_DOWN,dl=KEY_LEFT,dr=KEY_RIGHT \ & sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \ --evdev /dev/input/event0 \ --detach-kernel-driver \ & sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \ --evdev /dev/input/event1 \ --detach-kernel-driver \ & sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \ --evdev /dev/input/by-id/usb-Mayflash_Ltd_Mayflash_MD_USB_Adapter-event-joystick \ --detach-kernel-driver \ & sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \ --evdev /dev/input/by-id/usb-Mayflash_Ltd_Mayflash_MD_USB_Adapter-if01-event-joystick \ --detach-kernel-driver \ & fi
Maybe I need to just go at this a different way. Back to my original plans of just disabling them completely during the run, then
runcommand-onend.sh
revert them back. Perhaps just a quick and dirtysudo mv /dev/input/blahblah /home/pi
. That should work right? Gets it out of the input folder and somewhere safe until I can return it? -
@hansolo77 said in [Tutorial] OpenBOR - the complete guide:
My thoughts were that if I use XBOXDRV to detach the kernel drivers (not not map them to anything) it should then work to hide them from OpenBOR from trying to map them.
It's a good notion, but unfortunately, I don't think this particular method will work to hide the controllers. In doing this, they're always still there and able to be fully discovered by any software. It's more like they remain in a sort of null state that won't interfere with outside mapping. I can't speak to the potential effectiveness of moving the events, but it's worth a shot.
-
Thanks. :) I was working up an edit to my last post when I saw you had replied. I couldn't make it work by moving out the events. I might have the scripting wrong.. It should be a simple thing, but when I was logged in through SSH I noticed the events all stayed when I launched the game. Int this particular script, does it matter if I'm using &'s after each line, or if I use the backslashes \ ? I thought in our previous thread you had said the backslashes were there to let the script know you're continuing the same command but rather than have it really long you can use that to shorten it onto multiple lines. So if my
mv
command will all fit on one line cleanly, I don't think I would need them. But the &'s have me wondering if I need one after eachmv
or if I can make it work with back to back lines. I guess it's something I'll have to figure out later. Got to get to bed. -
More trying to figure this out. Anybody come across this error? (it crashed ES to terminal)
emulationstation: /home/pi/RetroPie-Setup/tmp/build/emulationstation/es-core/src/InputManager.cpp:80: void InputManager::addJoystickByDeviceIndex(int): Assertion 'id >= 0 && id < SDL_NumJoysticks()' failed.
What I tried to do was use XBOXDRV and create an entry for each of my devices, but naming them all
--device-name "Keyboard (xboxdrv)"
. So I had 4 entries in my on-start script, each mapping to the same keys. My thinking was that if the--detach-kernel-driver
flag merely assigned the controls tonull
, then I should be able to just map them all to the same keys. Doesn't look like that worked though.I may have to come up with a hardware modification. Since I noticed it worked by having either the NES or the SEGA adapters unplugged, I'm going to have to create an inline switch that does the same thing. I don't want to have to keep opening up my case to get to the USB plug. I'll create some kind of pushbutton and mount it somewhere I can get to from the outside. Then just make sure I wire the switch up to the correct wires (data should be it correct?). Switch on, Raspberry Pi detects the adapter. Switch off, Raspberry Pi only sends power and ground. I have a few extra switches laying around. At least I can test it. Sucks I can't make a switch through software.
-
@hansolo77 all mv commands will fit in one line by using ;
Or by logical boolean true with && (be aware with this!)
Or stick to your if clause and writemv file1 location1
mv file2 location2Why do you use & - it just sends the processes to background and is not needed imho
-
@cyperghost said in [Tutorial] OpenBOR - the complete guide
Why do you use & - it just sends the processes to background and is not needed imho
I dunno. It's just the way it works. I built my system with the thought in mind to have ports externally available for original NES and SEGA/ATARI controllers. The only way I could make it work like that was by using XBOXDRV to map those controllers as keyboard keys. Otherwise the whole system screws up because of how it maps them automatically. Sometimes the NES controller would be player 1, while other times it was the SEGA controller. Since I only use those controllers sparingly, it was a huge headache getting it to always map my Xbox controller as my primary player 1. Using XBOXDRV solved all of that. The only problem is, those adapters are permanently connected to the Pi. So OpenBOR comes around, and it chokes trying to enumerate all the different devices. Seems like it can only work with a total of 4 (Keyboard, Xbox, 2 Sega OR Keyboard, Xbox, 2 NES). Makes sense, considering OpenBOR only has controller configs for up to 4 players. I still have the problem though, that it doesn't recognize the XBOX controller as player 1, so I have to use XBOXDRV to map it to a keyboard.
As for the quote and the use of
&
... the explanation in the RetroPie Docs does it that way, so I just followed along. -
WOOOO!!!! I figured out a working command to get the controls to not get enumerated during OpenBOR boot up! All I had to do was my original idea of moving the controller device out of
/dev/input
. I just didn't have the command right. Now I've spent some time testing the command in the terminal BEFORE trying to do it through the script, and then modified theruncommand-onstart.sh
script to make it run automatically.. and it does!if [ "$1" = "openbor" ] then sudo mv /dev/input/event0 ~/inputs/event0 && sudo mv /dev/input/event1 ~/inputs/event1 ## Commands to Launch XBOXDRV for Xbox Mapping go here ## & ## Commands to Launch XBOXDRIV for Sega Mapping go here ## & fi
This works every time. Now, in order to move the controls back, I had to add a segment to the
runcommand-onend.sh
file.sudo killall > /dev/null 2>&1 xboxdrv if [ "$1" = "openbor" ] then sudo mv ~/inputs/event0 /dev/input/event0 && sudo mv ~/inputs/event1 /dev/input/event1 fi
This is basically unloading the XBOXDRV driver. Then, if the system just exited was "OpenBOR", then it moves the devices back to their original locations. It works! I'm so happy I don't have to cut cables and solder a hard switch. :) Now to test things a few more times and make a backup before I screw something else up! :)
-
Glad to hear this worked out.
-
@hansolo77 glad you got it working. Are these the complete scripts? I think the method is solid ground for others.
And yes you are right for a device driver like xboxdrv the & is essential because it have to be active in background but for cp or mv command it is not needed.
The && method is useful
It is working like
mv devive1 to path
&& means true chain connectionSo if device 1 is not available it will stop moving the other devices that come next in the && chain. The code could be refined but the method you elaborated is really great. That's the hard work you did - the bit of scripting fingetricks is now easy to do.
-
@cyperghost said in [Tutorial] OpenBOR - the complete guide:
@hansolo77 glad you got it working. Are these the complete scripts? I think the method is solid ground for others.
Not entirely. In my particular set up, I'm using numerous entries in the
runcommand-onstart.sh
script. However, for the purpose of completeness, should somebody want to copy my working script, I can post it. The working bits of OpenBOR is all I'm including, along with the the additions of the SEGA mapping and the moving out of the NES controllers:/opt/retropie/configs/all/runcommand-onstart.sh
if [ "$1" = "openbor" ] then sudo mv /dev/input/event0 ~/inputs/event0 && sudo mv /dev/input/event1 ~/inputs/event1 sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \ --evdev /dev/input/by-id/usb-©Microsoft_Xbox_360_Wireless_Receiver_for_Windows_E1594E70-event-joystick \ --detach-kernel-driver \ --silent \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --dpad-as-button \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_RX=x2,ABS_RY=y2,ABS_Z=lt,ABS_RZ=rt \ --evdev-keymap BTN_SOUTH=a,BTN_EAST=b,BTN_NORTH=x,BTN_WEST=y,BTN_TL=lb,BTN_TR=rb,BTN_THUMBL=tl,BTN_THUMBR=tr,BTN_MODE=guide,BTN_SELECT=back,BTN_START=start,BTN_TRIGGER_HAPPY3=du,BTN_TRIGGER_HAPPY4=dd,BTN_TRIGGER_HAPPY1=dl,BTN_TRIGGER_HAPPY2=dr \ --ui-buttonmap x=KEY_F,a=KEY_A,b=KEY_D,lb=KEY_Z,Y=KEY_S,rb=KEY_X \ --ui-buttonmap guide=KEY_F12,start=KEY_ENTER,back=KEY_ESC \ --ui-buttonmap du=KEY_UP,dd=KEY_DOWN,dl=KEY_LEFT,dr=KEY_RIGHT \ & sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \ --evdev /dev/input/by-id/usb-Mayflash_Ltd_Mayflash_MD_USB_Adapter-event-joystick \ --detach-kernel-driver \ --mimic-xpad \ --evdev-absmap ABS_HAT0X=x1,ABS_HAT0Y=y1 \ --evdev-keymap BTN_TR=back,BTN_TR2=start \ --evdev-keymap BTN_SOUTH=x,BTN_EAST=a,BTN_C=b \ --evdev-keymap BTN_NORTH=lb,BTN_WEST=y,BTN_TL=rb \ --dpad-as-button \ --ui-axismap x1=KEY_LEFT:KEY_RIGHT,y1=KEY_DOWN:KEY_UP \ --ui-buttonmap y=KEY_S,b=KEY_D,a=KEY_A,lb=KEY_Z,x=KEY_F,rb=KEY_X,start=KEY_ENTER,back=KEY_ESC \ & sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \ --evdev /dev/input/by-id/usb-Mayflash_Ltd_Mayflash_MD_USB_Adapter-if01-event-joystick \ --detach-kernel-driver \ --mimic-xpad \ --evdev-absmap ABS_HAT0X=x1,ABS_HAT0Y=y1 \ --evdev-keymap BTN_TR=back,BTN_TR2=start \ --evdev-keymap BTN_SOUTH=x,BTN_EAST=a,BTN_C=b \ --evdev-keymap BTN_NORTH=lb,BTN_WEST=y,BTN_TL=rb \ --dpad-as-button \ --ui-axismap x1=KEY_G:KEY_H,y1=KEY_J:KEY_I \ --ui-buttonmap x=KEY_N,a=KEY_K,b=KEY_M,lb=KEY_P,y=KEY_O,rb=KEY_Q \ --ui-buttonmap start=KEY_KP9,back=KEY_KP0 \ & fi
Provided you have XBOXDRV installed, this will create a mapping of an Xbox 360 controller as well as a Mayflash Sega Genesis Adapter (2 Players / 6-button) to keyboard keys. These keys are the default keyboard mapping inside OpenBOR, so it removes the necessary requirements of create a "master" keymap, and the need to have one for new games. This script will also move out the NES Controllers (provided by the Raphnet NES adapter) to a temporary location so OpenBOR doesn't detect it and cause the game engine to crash.
/opt/retropie/configs/all/runcommand-onend.sh
sudo killall > /dev/null 2>&1 xboxdrv if [ "$1" = "openbor" ] then sudo mv ~/inputs/event0 /dev/input/event0 && sudo mv ~/inputs/event1 /dev/input/event1 fi
This script will unload the XBOXDRV driver, making your controllers work like regular controllers again without being mapped to keyboard keys. If the game system that was just running was OpenBOR, it also returns the Raphnet NES controller devices back to their original locations to be available to the system again.
EDIT Sorry, when I first ran through this, I had the script mapping the NES controllers, not the SEGA ones. So the script was not helpful. After switching it over to the SEGA ones, I discovered my maps were all wrong. Then the engine kept crashing. I fixed it all now. The current script works. If you don't have NES or SEGA controllers, you don't need to include those parts, and you don't need to include the added
if
segment to theruncommand-onend.sh
script either. Also, mappings for Player 2 don't exist for keyboard. So you have to map them in-game first. I have it mapped for the Sega Controllers right now, but just because I don't have a 2nd XBOX controller to test with. -
Thanks for the guide! I spent hours trying to figure this out on my own and was finally able to get things working after following this guide!
One question though, I have the ES background music script running and for some reason it doesn't turn off when I run OpenBOR games. I've opened up the script and looked in line 25 for the list of emulators that are supposed to pause the script and "openbor" is listed there. I started up a game, went into SSH, typed "top" and saw that the emulator name was "OpenBOR" and figured that maybe I needed to add in a variant of openbor with that casing but that didn't work either. Not really sure what else to try. Any ideas?
-
@AtTheArcade said in [Tutorial] OpenBOR - the complete guide:
Thanks for the guide! I spent hours trying to figure this out on my own and was finally able to get things working after following this guide!
One question though, I have the ES background music script running and for some reason it doesn't turn off when I run OpenBOR games. I've opened up the script and looked in line 25 for the list of emulators that are supposed to pause the script and "openbor" is listed there. I started up a game, went into SSH, typed "top" and saw that the emulator name was "OpenBOR" and figured that maybe I needed to add in a variant of openbor with that casing but that didn't work either. Not really sure what else to try. Any ideas?
Turns out I just needed to restart ES after I updated the script. It's always something simple with me...
-
@AtTheArcade Glad you got it sorted out using one of the most forgotten, yet one of the most successful troubleshooting steps! Enjoy!
-
I'm getting very confused, so what I do is on emulationstation I press F4 and then type this?
wget "http://raw.githubusercontent.com/crcerror/RetroPie-OpenBOR-scripts/master/OpenBOR - Beats of Rage Engine Selection.sh" -O "/home/pi/RetroPie/roms/ports/OpenBOR - Beats of Rage Engine Selection.sh"
I tried it, but nothing happens. What did I do wrong? is this the correct way, or the easiest best way to do it?
Sorry for the dumb question but I'm abit confused as to how to get this working.If someone out there could make a complete video tutorial step by step it would be so much easier, it really would...
Please can someone make a video how to set this up?As I think what is holding people back (like me who are not experts in using our pi's) from trying this emulator is the install method. how to get it installed.
-
Can anyone assist me. I'm trying to open a Double Dragon Revenge modded game that works on my pc, I'm having trouble on my RPi 3B+. I load OpenBor via experimental packages. I add the .pak to the operbor folder. i run the extract.sh command. Everything seems to go ok, but when the lauch window comes up with the game, i get a quick "Loading" then exits right to the "PORTS" RPi menu screen. No idea where i went wrong.
THanks for any help. -
@therexershow Please follow topic OpenBOR - OpenBeta
-
@cyperghost , your work is amazing! Thank you so much for that.
A strange issue always happening: every time I press "left stick" / "d-pad left" on a controller (tried using the Xbox wired controller and mk_arcade_joystic) when I am inside a game, the game quits suddenly (abnormal end) and trows me back to ES MENU. This happens anytime in the game (even when I'm trying to configure the controller).
So, I am unable to use or configure joysticks (unless I don't tap the left - what is very annoying).
Any clue of what is causing that issue ?
P.s: I'm using the latest version of RetroPie (4.6 buster image) installed on a 3b+.
Thanks in advance!
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.