finalburnneo / FBNeo

FinalBurn Neo - We are Team FBNeo.
http://neo-source.com
Other
915 stars 360 forks source link

can it customize key mapping now? #1103

Closed creatxrgithub closed 2 years ago

creatxrgithub commented 2 years ago

i compiled for linux with "make sdl2"

e.g. it auto generated a config file: ~/.local/share/fbneo/config/sf2ceea.ini

i modified it. but it was recovered when game started.

i tried a same config by put cps.ini cps2.ini or sf2ceea.ni in config/presets/, it's still not work.

barbudreadmon commented 2 years ago

i modified it. but it was recovered when game started.

Looks like a bug that i fixed months ago, did you maybe download the latest official release (1.0.0.02) ? Official releases have the major issue of not including what was fixed/added/improved afterward. As said in the rules and recommendations, latest build is what you must use, and i believe it now supports customizing mapping through the gui.

creatxrgithub commented 2 years ago

thanks.

I am under Linux. I didn't find the setting gui.

Now, I downloaded by "git clone" and compiled with "make sdl2", then run it with command "./fbneo -menu -integerscale -fullscreen".

I want that: P1 up is "E", P1 down is "D", P1 left is "S", P1 right is "F", P1 weak punch is "I", P1 medium punch is "O", P1 strong is "P", P1 weak kick is "L", P1 medium kick is "K", P1 strong kick is "J".

So, I modified "config/sf2ceea.ini" with:

input "P1 Coin" switch 0x06 input "P1 Start" switch 0x02 input "P1 Up" switch 0x12 input "P1 Down" switch 0x20 input "P1 Left" switch 0x1F input "P1 Right" switch 0x21 input "P1 Weak Punch" switch 0x17 input "P1 Medium Punch" switch 0x18 input "P1 Strong Punch" switch 0x19 input "P1 Weak Kick" switch 0x26 input "P1 Medium Kick" switch 0x25 input "P1 Strong Kick" switch 0x24

Now, it wasn't recovered after run the game. but it cannot get to work.

I make files in "config/presets/cps.ini" and "config/presets/sf2ceea.ini" with the settings code above. It still cannot work. It use the default key mapping.

barbudreadmon commented 2 years ago

Afaik, you access settings by pressing tab.

creatxrgithub commented 2 years ago

it doesn't have the key mapping settings.

Screenshot_2022-07-09_11-00-35 Screenshot_2022-07-09_11-00-56

creatxrgithub commented 2 years ago

I got it.

It needs to change the "macro" not the "input".

So, use this to replace the settings:

macro "P1 Coin" switch 0x06 macro "P1 Start" switch 0x02 macro "P1 Up" switch 0x12 macro "P1 Down" switch 0x20 macro "P1 Left" switch 0x1F macro "P1 Right" switch 0x21 macro "P1 Weak Punch" switch 0x17 macro "P1 Medium Punch" switch 0x18 macro "P1 Strong Punch" switch 0x19 macro "P1 Weak Kick" switch 0x26 macro "P1 Medium Kick" switch 0x25 macro "P1 Strong Kick" switch 0x24

But it still has problems.

Even if I set the "P1 input"s to undefined or new key, the original key mapping is still working. e.g. It means that key "D" will has two functions at the same time "P1 Down" and "P1 Strong Punch". So, it cannot play with customized key mapping until now.

barbudreadmon commented 2 years ago

Well, i'm not that much knowledgeable about the sdl2 port, maybe @cjom can help as he is the author of the latest sdl2 fixes.

FWIW, a libretro port is also available if you are using linux.

barbudreadmon commented 2 years ago

It turns out sdl2 ingame mapping is only working with controllers right now

cjom commented 2 years ago

Does other default keys still work, too? Or is only D?

cjom commented 2 years ago

Ignore the previous post, I reproduced the issue. You should not be editing the MACRO fields, you're adding keys that should work as combos and not change default keys.

Looks like a bug that i fixed months ago

@barbudreadmon The issue now is not .ini being rewritten, the edited keys remain as we edit them, the issue now is them being completely ignored.

This is what I have in sf2ceea.ini:

input "P1 Coin" switch 0x06 input "P1 Start" switch 0x02 input "P1 Up" switch 0x12 input "P1 Down" switch 0x20 input "P1 Left" switch 0x1F input "P1 Right" switch 0x21 input "P1 Weak Punch" switch 0x17 input "P1 Medium Punch" switch 0x18 input "P1 Strong Punch" switch 0x19 input "P1 Weak Kick" switch 0x26 input "P1 Medium Kick" switch 0x25 input "P1 Strong Kick" switch 0x24

and when running the game fbneo still outputs default keys:

p1 coin 5 p1 start 1 p1 up ARROW UP p1 down ARROW DOWN p1 left ARROW LEFT p1 right ARROW RIGHT p1 fire 1 A p1 fire 2 S p1 fire 3 D p1 fire 4 Z p1 fire 5 X p1 fire 6 C

cjom commented 2 years ago

I think it's fixed in the pull request I just made... config/presets/cps.ini is also working too (they were not being loaded in SDL builds).

creatxrgithub commented 2 years ago

I think it's fixed in the pull request I just made... config/presets/cps.ini is also working too (they were not being loaded in SDL builds).

I've tried:

git pull and make sdl2

I've set "config/sf2ceea.ini" and "config/presets/cps.ini".

The problem wasn't resolved.

waiting......

barbudreadmon commented 2 years ago

The problem wasn't resolved.

https://github.com/finalburnneo/FBNeo/pull/1105 wasn't merged yet

cjom commented 2 years ago

The fix is now merged, and you can get an already compiled build from https://github.com/finalburnneo/FBNeo/releases/tag/latest

And to be clear, in my linux system, "config/sf2ceea.ini" is actually in "~/.local/share/fbneo/config/sf2ceea.ini", not in the folder where I run fbneo. (edit: ok, your initial post already mentioned the correct path.)

creatxrgithub commented 2 years ago

It works. Thanks.

but, "config/cps.ini" not works

cjom commented 2 years ago

but, "config/cps.ini" not works

Because it should be "config/presets/cps.ini"

edit: I'm working in having all support folders automatically created and fix hiscores and other path related issues...

creatxrgithub commented 2 years ago

config/presets/cps.ini

I put it here also. But when I loaded other games, it didn't work.

Maybe it didn't have general names for keys?

The keys' name must be "P1 Weak Punch", "P1 Fire", "P1 Bomb", "P1 Jump" etc.

I will try later.

cjom commented 2 years ago

Yes, names are important. I moved cf2ce.ini to cps.ini it worked. So the cps.ini should be a merge of multiple games genres.

creatxrgithub commented 2 years ago

Because it should be "config/presets/cps.ini"

I've tried again for confirm.

with "config/presets/cps.ini", key mapping doesn't work.

input "P1 Coin" switch 0x06 input "P1 Start" switch 0x02 input "P1 Up" switch 0x12 input "P1 Down" switch 0x20 input "P1 Left" switch 0x1F input "P1 Right" switch 0x21 input "P1 Weak Punch" switch 0x17 input "P1 Medium Punch" switch 0x18 input "P1 Strong Punch" switch 0x19 input "P1 Weak Kick" switch 0x26 input "P1 Medium Kick" switch 0x25 input "P1 Strong Kick" switch 0x24

for "sf2ceea".

It only works with "config/sf2ceea.ini".

cjom commented 2 years ago

I suspect you forgot to delete sf2ceea.ini when testing cps.ini. Here's an example cps.ini with inputs I collected from several games, that I tested with different games and worked:

FinalBurn Neo [DEBUG] - Hardware Default Preset

CPS-1/CPS-2/CPS-3 hardware

version 0x100003

// --- Inputs -----------------------------------------------------------------

input  "P1 Up"            switch 0xC8
input  "P1 Down"          switch 0xD0
input  "P1 Left"          switch 0xCB
input  "P1 Right"         switch 0xCD
input  "P1 Coin"          switch 0x06
input  "P1 Start"         switch 0x02
// vendetta
input  "P1 Button 1"      switch 0x24
input  "P1 Button 2"      switch 0x25
// gigawing
input  "P1 Shot"          switch 0x24
input  "P1 Bomb"          switch 0x25
// 1941
// input  "P1 Shot"          switch 0x24
input  "P1 Special"       switch 0x25
// ddsom
input  "P1 Attack"        switch 0x24
input  "P1 Jump"          switch 0x25
input  "P1 Select"        switch 0x16
input  "P1 Use"           switch 0x17
// sf2ce
input  "P1 Weak Punch"    switch 0x24
input  "P1 Medium Punch"  switch 0x25
input  "P1 Strong Punch"  switch 0x26
input  "P1 Weak Kick"     switch 0x16
input  "P1 Medium Kick"   switch 0x17
input  "P1 Strong Kick"   switch 0x18
// jojo
input  "P1 Weak Attack"   switch 0x24
input  "P1 Medium Attack" switch 0x25
input  "P1 Strong Attack" switch 0x26
input  "P1 Stand"         switch 0x16
input  "P1 All Attacks (Fake)" switch 0x17
input  "P1 Not in use 2"  switch 0x18

Keys are set to JKLUIO only for testing.

Edit again: just a note that SDL2 support paths are a mess and probably will be changed to the same structure used in windows... if that happens, .ini will have to go to "config/games/"

cjom commented 2 years ago

The only reason I can think for preset not working for you is if the cps.ini is windows style end-of-line (CR+LF) instead of being only LF...

Still, it's weird since you're in linux, I assume. Sorry for the trouble, but instead of deleting sf2ceea.ini could you move it to config/presets/cps.ini, edit cps.ini to your preferences (you can delete all macro stuff) and try one more time? Thanks.

cjom commented 2 years ago

Nah... I just tested putting cps.ini "windows style" and still worked ok... I don't have a clue why it is not working for you. :(

creatxrgithub commented 2 years ago

Nah... I just tested putting cps.ini "windows style" and still worked ok... I don't have a clue why it is not working for you. :(

I found the reason. this line is required:

version 0x100003

but it's better that it's not a requirement.

creatxrgithub commented 2 years ago

It only use the presets to init the key mapping once. If you want to update "cps.ini" in order to update for all the games, you must delete all the "*.ini" config files. It's the way to use presets.

cjom commented 2 years ago

I found the reason. this line is required:

version 0x100003

Great! Now the issue is finally closed :)

creatxrgithub commented 2 years ago

version 0x100003

but it's better that it's not a requirement.