Android Gamepad Support

msmalik681

OpenBOR Developer
Staff member
bWWd, Viper Snake, Yotatouch, O Ilusionista and anyone else who has a android blutooth gamepad could you please test this private build and report back how your gamepads are working.  Please give as much details as possible so if some keys configure but others wont, if nothing works, if your getting random maps and the controller you are using.

Before testing please note this build does not have a fix for up and down so if you configure up and down on gamepad your will be stuck in the menu. So configure one hit ok then go back into the menu and configure the others. Remember to delete old save data folder.

Download: https://drive.google.com/open?id=1d0KLVoclZXVoW7bKmSQuqFFNRLHnfQQL
 
Tested on my phone as well.
The remap of the buttons seems okay, i don't have attacks, jumps, special, extra buttons etc issues.
And as you know, when it comes to Directionnal imputs, it's totally buggy.
I did several tests, and the last one was do not remap directionnals.

So i went ingame and tried to push on the attacks, jumps, special, extra buttons, it works well.
That's my report.
 
OpenBOR shows "P2 Unknown <key>" when trying to remap the analog sticks, dpad or L2/R2 triggers on a Moga Hero Power. These "P2" remaps do nothing at all no matter the input they are mapped too. All other buttons work (including the buttons where you push in the stick like a L3/R3) and show a keyboard key (a minor exception is the select button which oddly shows P1 Button 5, but it still works). I can awkwardly map directional inputs to the buttons that work to escape the configuration menu.
c7qorQi.png

"P2 Unknown 12" which is the ESC button according to the OpenBOR touch controls (no button on the controller actually maps to this), is also randomly spammed in a glitchy way when attempting to map the controller buttons.
 
Viper Snake said:
OpenBOR shows "P2 Unknown <key>" when trying to remap the analog sticks, dpad or L2/R2 triggers on a Moga Hero Power. These "P2" remaps do nothing at all no matter the input they are mapped too. All other buttons work (including the buttons where you push in the stick like a L3/R3) and show a keyboard key (a minor exception is the select button which oddly shows P1 Button 5, but it still works). I can awkwardly map directional inputs to the buttons that work to escape the configuration menu.
c7qorQi.png

"P2 Unknown 12" which is the ESC button according to the OpenBOR touch controls (no button on the controller actually maps to this), is also randomly spammed in a glitchy way when attempting to map the controller buttons.


mmm...
it's strange... in control.c in the line (555):
return JOY_GetKeyName(keycode);
the function use SDL_GetScancodeName() to get the name...
maybe not recognized and maybe a sdl bug?
 
msmalik see function PC_GetJoystickKeyName() maybe we need to change it for android.
please make some test..

in control.c try to comment lines:
Code:
		for(j=1; j<JOY_MAX_INPUTS+1; j++)
		{
			joysticks[i].KeyName[j] = PC_GetJoystickKeyName(i, j);
		}

and make some test in android...
many thanks!
 
@WD
I got a error when compiling but it did compile successfully.


Error:
Code:
jni/openbor/../../../sdl/control.c:270:9: error: unused variable 'j' [-Werror,-Wunused-variable]
        int i, j, k;
               ^
1 error generated.


Here is the next test apk please refer to first post on how to give feedback and test.


Download: https://drive.google.com/open?id=1d0KLVoclZXVoW7bKmSQuqFFNRLHnfQQL


control.c edit:
Code:
		//SDL_JoystickEventState(SDL_IGNORE); // disable joystick events
		/*for(j=1; j<JOY_MAX_INPUTS+1; j++)
		{
			joysticks[i].KeyName[j] = PC_GetJoystickKeyName(i, j);
		}*/
 
Hey guys its very close ! I can remap all buttons on gamepad and they are recognized, It works for buttons a/b/x/y l1/l2 etc but directional buttons are not working so if i press up/down or left/right then nothing happens, this is my log and my screenshot, i used version from first post.
Code:
Total Ram: 1930194944 Bytes
 Free Ram: 95342592 Bytes
 Used Ram: 119251456 Bytes

SDL video Renderer: opengles2 

1 joystick(s) found!
SDL video Renderer: opengles2 

1 joystick(s) found!
OpenBoR v3.0 Build , Compile Date: Apr 24 2018

Game Selected: /mnt/sdcard/OpenBOR/Paks/BEARS.PAK

FileCaching System Init......	Enabled
Initializing video............
Reading video settings from 'data/video.txt'.

Colordepth is depreciated. All modules are displayed with a 32bit color screen.


Using debug video mode: 640 x 360
Initialized video.............	640x360 (Mode: 255)

SDL video Renderer: opengles2 
Loading menu.txt.............	Done!
Loading fonts................	1 2 3 4 Done!
Timer init...................	Done!
Initialize Sound..............	
Loading sprites..............	Done!
Loading level order..........	Done!
Loading model constants......	Done!
Loading script settings......	Done!
Loading scripts..............	Done!
Loading models...............

Cacheing 'arti' from data/chars/arti/arti.txt
Cacheing 'artib' from data/chars/arti/artib.txt
Cacheing 'hubert' from data/chars/hub/hub.txt
Cacheing 'hubertb' from data/chars/hub/hubb.txt
Cacheing 'kriper' from data/chars/krip/krip.txt
Cacheing 'kriperb' from data/chars/krip/kripb.txt
Cacheing 'owel' from data/chars/owl/owl.txt
Cacheing 'owel__' from data/chars/owl/owl__.txt
Cacheing 'edi' from data/chars/tedi/tedi.txt
Cacheing 'edib' from data/chars/tedi/tedib.txt
Cacheing 'kit' from data/chars/kit/kit.txt
Cacheing 'kitb' from data/chars/kit/kitb.txt
Cacheing 'flash' from data/sprites/flash.txt
Cacheing 'dust' from data/sprites/dust.txt
Cacheing 'bam' from data/sprites/bam.txt
Cacheing 'blood' from data/sprites/blood.txt
Cacheing 'poo' from data/sprites/poo.txt
Cacheing 'step1' from data/chars/tedi/step1.txt
Cacheing 'step2' from data/chars/tedi/step2.txt
Cacheing 'pop' from data/sprites/pop.txt
Cacheing 'smoke' from data/sprites/smoke.txt
Cacheing 'gren' from data/sprites/gren.txt
Cacheing 'bazo' from data/sprites/bazo.txt
Cacheing 'ss3' from data/chars/ss3/ss3.txt
Cacheing 'ss1' from data/chars/ss1/ss1.txt
Cacheing 'fat' from data/chars/fat/fat.txt
Cacheing 'robit' from data/chars/robit/robit.txt
Cacheing 'robit' from data/chars/robit/laser.txt
Cacheing 'be' from data/sprites/be.txt
Cacheing 'trem' from data/chars/trem/trem.txt
Cacheing 'owl' from data/sprites/owl.txt
Cacheing 'blop' from data/sprites/blop.txt
Cacheing 'box' from data/sprites/box.txt
Cacheing 'ball' from data/sprites/ball.txt
Cacheing 'tre' from data/sprites/tre.txt
Cacheing 'bat' from data/sprites/bat.txt
Cacheing 'pla' from data/sprites/pla.txt
Cacheing 'pla2' from data/sprites/pla2.txt
Cacheing 'co' from data/sprites/co.txt
Cacheing 'coi' from data/sprites/coi.txt
Cacheing 'car' from data/sprites/car.txt
Cacheing 'carun' from data/sprites/carun.txt
Cacheing 'kid' from data/sprites/kid.txt
Cacheing 'kidf' from data/sprites/kidf.txt
Cacheing 'mine' from data/sprites/mine.txt
Cacheing 'torpe' from data/sprites/torpe.txt
Cacheing 'bug' from data/sprites/bug.txt

Loaded 'arti' from data/chars/arti/arti.txt 
Loaded 'artib' from data/chars/arti/artib.txt 
Loaded 'hubert' from data/chars/hub/hub.txt 
Loaded 'hubertb' from data/chars/hub/hubb.txt 
Loaded 'kriper' from data/chars/krip/krip.txt 
Loaded 'kriperb' from data/chars/krip/kripb.txt 
Loaded 'owel' from data/chars/owl/owl.txt 
Loaded 'owel__' from data/chars/owl/owl__.txt 
Loaded 'edi' from data/chars/tedi/tedi.txt 
Loaded 'edib' from data/chars/tedi/tedib.txt 
Loaded 'kit' from data/chars/kit/kit.txt 
Loaded 'kitb' from data/chars/kit/kitb.txt 
Loaded 'Flash' from data/sprites/flash.txt 
Loaded 'dust' from data/sprites/dust.txt 
Loaded 'bam' from data/sprites/bam.txt 
Loaded 'blood' from data/sprites/blood.txt 
Loaded 'poo' from data/sprites/poo.txt 
Loaded 'step1' from data/chars/tedi/step1.txt 
Loaded 'step2' from data/chars/tedi/step2.txt 
Loaded 'pop' from data/sprites/pop.txt 
Loaded 'smoke' from data/sprites/smoke.txt 
Loaded 'gren' from data/sprites/gren.txt 
Loaded 'bazo' from data/sprites/bazo.txt 

Loading models...............	Done!
Object engine init...........	Done!
Input init...................	
2 joystick(s) found!
1. Android Accelerometer - 3 axes, 0 buttons, 0 hat(s)
                                2. Microntek              USB Joystick           - 4 axes, 36 buttons, 1 hat(s)
Done!
Create blending tables.......	Done!
Save settings so far........	Done!


Video track: resolution=640*360, display resolution=640*360, 23.98 frames/second
Audio track: 48000.000000 Hz, 1 channels, 32 bits/sample
Warning: the audio frequency (48000 Hz) is suboptimal; resample to 44100 Hz for best quality
SDL video Renderer: opengles2 
Loading control settings.......	Done!
Level Loading:   'data/levels/wods.txt'
Total Ram: 1930194944 Bytes
 Free Ram: 120033280 Bytes
 Used Ram: 130184192 Bytes

Loaded 'bug' from data/sprites/bug.txt 
sound_load_sample can't load sample from file 'data/sounds/spawn.wav'!
Loaded 'mine' from data/sprites/mine.txt 
Loaded 'tre' from data/sprites/tre.txt 
Loaded 'ss1' from data/chars/ss1/ss1.txt 
Loaded 'box' from data/sprites/box.txt 
Loaded 'kidf' from data/sprites/kidf.txt 
Loaded 'robit' from data/chars/robit/robit.txt 
Loaded 'laser' from data/chars/robit/laser.txt 
sound_load_sample can't load sample from file 'data/chars/robit/fall.wav'!
Loaded 'fat' from data/chars/fat/fat.txt 
sound_load_sample can't load sample from file 'data/chars/fat/fall.wav'!
Loaded 'be' from data/sprites/be.txt 
sound_load_sample can't load sample from file 'data/sounds/spawn.wav'!
Loaded 'co' from data/sprites/co.txt 
Loaded 'ss3' from data/chars/ss3/ss3.txt 
Loaded 'trem' from data/chars/trem/trem.txt 
Loaded 'torpe' from data/sprites/torpe.txt 
Command 'delay7' not understood in file 'data/sprites/torpe.txt'!
Loaded 'ball' from data/sprites/ball.txt 

Level Loaded:    'data/levels/wods.txt'
Total Ram: 1930194944 Bytes
 Free Ram: 116703232 Bytes
 Used Ram: 130558976 Bytes
Total sprites mapped: 1128

Level Unloading: 'data/levels/wods.txt'
Total Ram: 1930194944 Bytes
 Free Ram: 114278400 Bytes
 Used Ram: 130558976 Bytes

RAM Status:
Total Ram: 1930194944 Bytes
 Free Ram: 115281920 Bytes
 Used Ram: 130496000 Bytes


Can't play music file 'data/music/gameover'
Loading control settings.......	Done!

************ Shutting Down ************

OpenBOR v3.0 Build , Compile Date: Apr 24 2018
Presented by the OpenBOR Team.
www.chronocrash.com
OpenBOR is the open source continuation of Beats of Rage by Senile Team.

Special thanks to SEGA and SNK.

Total Ram: 1930194944 Bytes
 Free Ram: 149237760 Bytes
 Used Ram: 130608128 Bytes

Release level data...........
Done!

Release graphics data........	Done!
Release game data............

Unload 'arti' ............Done.
Unload 'artib' ............Done.
Unload 'hubert' ............Done.
Unload 'hubertb' ............Done.
Unload 'kriper' ............Done.
Unload 'kriperb' ............Done.
Unload 'owel' ............Done.
Unload 'owel__' ............Done.
Unload 'edi' ............Done.
Unload 'edib' ............Done.
Unload 'kit' ............Done.
Unload 'kitb' ............Done.
Unload 'Flash' ............Done.
Unload 'dust' ............Done.
Unload 'bam' ............Done.
Unload 'blood' ............Done.
Unload 'poo' ............Done.
Unload 'step1' ............Done.
Unload 'step2' ............Done.
Unload 'pop' ............Done.
Unload 'smoke' ............Done.
Unload 'gren' ............Done.
Unload 'bazo' ............Done.
Unload 'bug' ............Done.
Unload 'mine' ............Done.
Unload 'tre' ............Done.
Unload 'ss1' ............Done.
Unload 'box' ............Done.
Unload 'kidf' ............Done.
Unload 'robit' ............Done.
Unload 'laser' ............Done.
Unload 'fat' ............Done.
Unload 'be' ............Done.
Unload 'co' ............Done.
Unload 'ss3' ............Done.
Unload 'trem' ............Done.
Unload 'torpe' ............Done.
Unload 'ball' ............Done.

Release game data............	Done!
Release timer................	Done!
Release input hardware.......	Done!
Release sound system.........	Done!
Release FileCaching System...	Done!

**************** Done *****************

OpenBOR v3.0 Build , Compile Date: Apr 24 2018
Presented by the OpenBOR Team.
www.chronocrash.com
OpenBOR is the open source continuation of Beats of Rage by Senile Team.

Special thanks to SEGA and SNK.
2FnJg.jpg

I will test second build posted above this post
--
Ok this is from second build posted here:
2FnJW.jpg

Directional DPAD is still not working/ analogs not working as well but still recognized , they just dont move through menus when pressed, also now  it says "unknown" etc, previous build recognized directional buttons better i guess?
Its chinese ps3 USB  knockoff  microntek gamepad with analogs, theres lots of rebranding of this model around.
 
Tested the new build and it still has all the same problems in my previous post except "P2 Unknown 12" is no longer being spammed in a glitchy way.
 
If i can find my otg cable i will  connect my xbox 360/ps4 gamepad then I can get down to some heavy debugging.
 
Its like in previous version, directional pad doesnt work after setup,  also in this new version i cant see the names of the  joystick input(the ones on right) so its just move up /move down etc without displaying which gamepad button is assigned to them.
 
Back
Top Bottom