finalburnneo / FBNeo

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

Custom mapping not possible #578

Closed kentosama closed 11 months ago

kentosama commented 3 years ago

Hello, I have compiled under ArchLinux the latest version available on the repository. I can't change the mapping in the configuration file for each game:



// --- Miscellaneous ----------------------------------------------------------

version 0x100001

analog  0x0100
cpu     0x0100

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

input  "P1 Coin"          switch 0x4086
input  "P1 Start"         switch 0x4087
input  "P1 Up"            switch 0x4002
input  "P1 Down"          switch 0x4003
input  "P1 Left"          switch 0x4000
input  "P1 Right"         switch 0x4001
input  "P1 Weak Punch"    switch 0x4082
input  "P1 Medium Punch"  switch 0x4083
input  "P1 Strong Punch"  switch 0x4084
input  "P1 Weak Kick"     switch 0x4080
input  "P1 Medium Kick"   switch 0x4081
input  "P1 Strong Kick"   switch 0x4085
input  "P2 Coin"          switch 0x07
input  "P2 Start"         switch 0x03
input  "P2 Up"            switch 0x4102
input  "P2 Down"          switch 0x4103
input  "P2 Left"          switch 0x4100
input  "P2 Right"         switch 0x4101
input  "P2 Weak Punch"    switch 0x4180
input  "P2 Medium Punch"  switch 0x4181
input  "P2 Strong Punch"  switch 0x4182
input  "P2 Weak Kick"     switch 0x4183
input  "P2 Medium Kick"   switch 0x4184
input  "P2 Strong Kick"   switch 0x4185
input  "Reset"            switch 0x3D
input  "Diagnostic"       switch 0x3C
input  "Service"          switch 0x0A
input  "Volume Up"        switch 0x4086
input  "Volume Down"      switch 0x4087

macro  "System Pause"     undefined
macro  "System FFWD"      undefined
macro  "System Load State" undefined
macro  "System Save State" undefined
macro  "System UNDO State" undefined
macro  "P1 Up"            undefined
macro  "P1 Down"          undefined
macro  "P1 Left"          undefined
macro  "P1 Right"         undefined
macro  "P1 šI"            undefined
macro  "P1 šJ"            undefined
macro  "P1 šL"            undefined
macro  "P1 šK"            undefined
macro  "P1 Weak Punch"    undefined
macro  "P1 Medium Punch"  undefined
macro  "P1 Strong Punch"  undefined
macro  "P1 Weak Kick"     undefined
macro  "P1 Medium Kick"   undefined
macro  "P1 Strong Kick"   undefined
macro  "P1 Buttons 3x Punch" undefined
macro  "P1 Buttons 3x Kick" undefined
macro  "P1 Buttons Weak PK" undefined
macro  "P1 Buttons Medium PK" undefined
macro  "P1 Buttons Strong PK" undefined
macro  "P1 Buttons SP + WK" undefined
macro  "P2 Up"            undefined
macro  "P2 Down"          undefined
macro  "P2 Left"          undefined
macro  "P2 Right"         undefined
macro  "P2 šI"            undefined
macro  "P2 šJ"            undefined
macro  "P2 šL"            undefined
macro  "P2 šK"            undefined
macro  "P2 Weak Punch"    undefined
macro  "P2 Medium Punch"  undefined
macro  "P2 Strong Punch"  undefined
macro  "P2 Weak Kick"     undefined
macro  "P2 Medium Kick"   undefined
macro  "P2 Strong Kick"   undefined
macro  "P2 Buttons 3x Punch" undefined
macro  "P2 Buttons 3x Kick" undefined
macro  "P2 Buttons Weak PK" undefined
macro  "P2 Buttons Medium PK" undefined
macro  "P2 Buttons Strong PK" undefined
macro  "P2 Buttons SP + WK" undefined```

If I change a value for the buttons, fbneo automatically generates the configuration on startup and overwrites the file on shutdown.

Same problem with SDL2 / SDL1.

How can I use this file and prevent fbneo from automatically generating the mapping?

Thanks.
UntrustedRoot commented 2 years ago

I also have this issue. I'm trying to map two fightsticks using hat inputs and every time I've launched a game the configuration is replaced with player one keyboard, player two analog (I really need it to be a hat input.)

I have tried the release tag and master branch, same results.

barbudreadmon commented 2 years ago

Remapping has yet to be implemented in the sdl/sdl2 ports. Contributors are welcome. I recommend using our libretro port on linux.

UntrustedRoot commented 2 years ago

I have an issue with libretro, trying to find a way to switch back to standalone emulation on Linux.

Also I was missing the -joy switch, so I was able to solve the 2-player fightstick issue, but the hat mapping is still bothering me. (I've noticed a slight input delay with the left stick analog vs dpad modes on both my 8bitdo and Madcats SFIV sticks. I do not know if this is the control board, driver/OS, or emulators fault. This issue exists for me on FBNeo on Windows and MAME on Windows and Fedora. I'm 90% sure this is my fault some how.)

C++ and I don't usually get along but I'm willing to put something together as a stopgap until someone with better skills can complete this. I've been studying the code to see if this is feasible or not.

To satisfy my needs, and to make this a cleaner contribution, would you be opposed to a extra command line switch that changes the default mapping of the left axis to the hat hits?

(I'm still studying the code and I'm not even at the point of pseudocode yet) On the command line it would look something like this: fbneo -fullscreen -joy -mapjoyhat sfiii3u

Internally I'll use the same check and storage for the command line switches and check if -mapjoyhat was set at input mapping time. A simple if statement around the part that sets the axis to set the hat/dpad instead should do the trick.

barbudreadmon commented 2 years ago

To satisfy my needs, and to make this a cleaner contribution, would you be opposed to a extra command line switch that changes the default mapping of the left axis to the hat hits?

Let's tag @tmaul about this since the current sdl/sdl2 port is mostly his work, but i believe any contribution is welcome as long as it improves the current implementation.

tmaul commented 2 years ago

That sounds good to me

UntrustedRoot commented 2 years ago

PR #919 addresses this. Simple fix :)

Kelvfimer commented 2 years ago

Hello

Does the PR working? For me at least is still overwritten the config file inputs, I used the latest commit. BTW I was surprised that dipswitches are not overwritten.

Kelvfimer commented 2 years ago

I made it working with custom mapping making the ini file inmutable with chattr +i . I'm using emuelec odroid n2+

I follow this steps for a xbox 360 pad with usb dongle

  1. Download FBNEO WIndows
  2. Download orunners rom.
  3. Load it and go to map input.
  4. Map the input of the joystick.
  5. If you want to add didswitches go to dipswitches section.
  6. Then on the config folder open orunners.ini with notepad or notepad++
  7. Copy the input section.
  8. open winscp and go to /storage/.local/share/fbneo/config/
  9. open orunners.ini
  10. overwritte from input section all the input configuration (if you have dipswitches do so too)
  11. save it
  12. Open putty terminal
  13. cd /storage/.local/share/fbneo/config
  14. Make orunners.ini inmutable using chattr +i orunners.ini
  15. go to the folder that holds fbneo and execute ./fbneo orunners -fullscreen

I hope this can help as a workaround.

Config file

// FinalBurn Neo v1.0.0.03 --- Config File for orunners (OutRunners (World))

// --- Miscellaneous ----------------------------------------------------------

version 0x100003

analog 0x0100 cpu 0x0100

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

input "P1 Coin" switch 0x4086 input "P1 Start" switch 0x4087 input "P1 Gear Up" switch 0x4085 input "P1 Gear Down" switch 0x4084 input "P1 Music" switch 0x4083 input "P1 Music -" switch 0x4005 input "P1 Music +" switch 0x4004 input "P1 Steering" joyaxis 0 0 input "P1 Accelerate" switch 0x4080 input "P1 Brake" switch 0x4081 input "P2 Coin" switch 0x07 input "P2 Start" switch 0x03 input "P2 Gear Up" switch 0x4080 input "P2 Gear Down" switch 0x4081 input "P2 Music" switch 0x4082 input "P2 Music -" switch 0x4083 input "P2 Music +" switch 0x4084 input "P2 Steering" joyaxis 0 0 input "P2 Accelerate" joyaxis 0 1 input "P2 Brake" joyaxis 0 2 input "Reset" switch 0x3D input "Service Mode" switch 0x3C input "Service 1" switch 0x0A input "Service 2" switch 0x0A input "Service 3" switch 0x0A input "Dip A" constant 0x0F input "Dip B" constant 0x01

macro "System Pause" undefined macro "System FFWD" undefined macro "System Frame" undefined macro "System Load State" undefined macro "System Save State" undefined macro "System UNDO State" undefined macro "P1 Gear Up" undefined macro "P1 Gear Down" undefined macro "P1 Music" undefined macro "P1 Music -" undefined macro "P1 Music +" undefined macro "P2 Gear Up" undefined macro "P2 Gear Down" undefined macro "P2 Music" undefined macro "P2 Music -" undefined macro "P2 Music +" undefined

UntrustedRoot commented 2 years ago

Hey Kelvfimer,

In my PR, the only time it will attempt to write the ini is if the ini doesn't exist, or if you specify the -joy switch. You shouldn't need to make the file immutable for this to work. (If this isn't the case, please let me know and I will fix it. I'd hate to have put in a bad PR on a great project.)

Your workflow is similar to mine, here's what I've been doing.

  1. Load FBNeo on my Windows PC
  2. Launch the game and configure my controls.
  3. Copy the ini to my Linux PC at ~/.local/share/fbneo/config/
  4. Launch FBNeo: fbneo -fullscreen sfiii3u

That's it! For CPS games I saved a single preset and copy it over before I launch the game. cp ~/.local/share/fbneo/config/{cps,sfiii3u}.ini && fbneo -fullscreen sfiii3u

barbudreadmon commented 11 months ago

IIRC it was implemented in the sdl port sometime last year, so i'll close.