ControllerRemap GUI

bob.records

New member
RL Member
I think with mess you can set per system and not game. Unless you tell it to open a specific ctrlr file. When you change buttons in mess\nes it has input "this machine" not a per game option and saved it in nes.cfg. But I'm not a mess user, that was from testing.
 

Knewlife

Member
RL Member
Hi guys, I have to make controller remap work in the current mame module because I'm updating my setup... so I was thinking in something like this file structure to load diffrent Controller Remap Configuration file for every game-system in MAME-MESS:

The base path to store the configurations can be anywhere, but I think that the ctrlr folder in mame in a good place to start:

HTML:
Example: ctrlr\[RL_SystemName]\[RomName]\_Default.cfg

ctrlr\
	Atari 2600\
		_Default\
			_Default.cfg  <-- Default Atari 2600 CtrlrRemap Config File
		Amidar (USA)\
			_Default.cfg  <-- Game Specific CtrlrRemap Config
	MAME\
		_Default\
			_Default.cfg   <-- Default MAME CtrlrRemap Config
		rally\
			_Default.cfg   <-- Game Specific CtrlrRemap Config

The right file is sent by CLI to controllerRemap.exe (you have to set that in the module options) and then it output a temporal file called for example: RocketLauncher.cfg in the mame\ctrlr folder. It contains you configuration with the Right ID for every controller.

After that we launch mame as usual but adding the "-ctrlr RocketLauncher" parameter.

Obviusly, to create the _Default.cfg files you have to understand how ControllerRemap.exe Works... or use this GUI app to create the (thats if this GUI allows you to save the Config files... im not tested it yet).



So what you think... this is the basic idea... it can be more complex... similar to how Xpadder profiles work... but I can start with this and see how it works.
 

brolly

Administrator
Developer
I have plans to integrate this into MAME's module, didn't do it yet because the lack of time and djvj going on a module refactoring spree. The final structure is still not defined, but should be something like:
.\%systemName%\%romName%\%romName%.cfg (Game Specific)
.\%systemName%\_Default.cfg (System Specific)
.\_Default.cfg (Global)
(Paths relative to a user configured folder in the module to store the cfg files)

Don't see the need for all those extra folders unless it makes sense to have multiple remap files for each system/game which is something I don't see any real use, besides that would bring other questions like how would RL know which one to select without any user interaction. So unless someone can come up with a good use case for such scenarios, the above structure would be just fine.
 

Knewlife

Member
RL Member
I have plans to integrate this into MAME's module, didn't do it yet because the lack of time and djvj going on a module refactoring spree. The final structure is still not defined, but should be something like:
.\%systemName%\%romName%\%romName%.cfg (Game Specific)
.\%systemName%\_Default.cfg (System Specific)
.\_Default.cfg (Global)
(Paths relative to a user configured folder in the module to store the cfg files)

Don't see the need for all those extra folders unless it makes sense to have multiple remap files for each system/game which is something I don't see any real use, besides that would bring other questions like how would RL know which one to select without any user interaction. So unless someone can come up with a good use case for such scenarios, the above structure would be just fine.
You do have a point, I have made it more complex because I needed to load certain configuration depending on the connected controllers, but now i'm thinking it will be too much complex.

Gonna try to make my setup work using your file structure and modifiying the module.

I need all gungames to use ppjoy 1 and 2 as player 1 and 2... thats because I use 2 Wiimotes for gun games. I think i can just make the configuration file for one game and batch copy it based on the gungames genre xml...
 

Knewlife

Member
RL Member
So... im advancing in this module modification.

I have MAME 174 working fine with the module and controller remap. Change the file structure to look like brolly's.
My old mame configurations works great. No Problem here.

In the MESS part of MAME (We all know both emulators have been convined into one) there is a problem with some wreid controls like the Atari 5200 Keypad.
AS much as i try to set the input configuration in my ctrlr files, it just ignore them and fallback to default keys in this case.

The good news is that analog controls and normal buttons (not keypads) seems to work just fine... so using xpadder i can map my controller buttons to keyboard... and just map that keys to the keypad buttons in the a5200.cfg file found in mame's cfg folder (do not cofuse with ctrlr files, cfg files are the mame general configuration files that you edit when selecting "Input (This Machine)" in mame UI).

PD: More info on ctrlr files :D http://wiki.arcadecontrols.com/wiki/Ctrlr_file
 

Knewlife

Member
RL Member
The module is working fine... I added the option of loading the parent profile if the the specific rom name is not found.
Doing that I found that in mame 174 the xml information file produced by mame use the tag <machine> instead of <game> so I change the RegEx in the funcion to ...

Code:
s)<(machine|game).*name=" . """" . rom . """" . ".*" . "cloneof=" . """" . "[^""""]*

To include both options.
 

brolly

Administrator
Developer
Nice, if you have it done then please share the updated module as it will only make our life easier when adding support for this to the official module. No need to be reinventing the wheel.
 

Knewlife

Member
RL Member
Nice, if you have it done then please share the updated module as it will only make our life easier when adding support for this to the official module. No need to be reinventing the wheel.

Here is the module, I try to use RL functions and Classes but you can make it better for sure. I can't use RL Run() function for some reason to run controllerremap.exe ... I have to use ahk native run command or else the cfg file is not processed for some reason.

https://www.dropbox.com/s/gymubrm83yjktbq/MAME.7z?dl=0
 

brolly

Administrator
Developer
Looks good thanks, but a couple of questions:

ControllerRemapConfigPath := moduleIni.Read( mameSystem . "|Settings", "ControllerRemapConfigPath", emuPath . "\ctrlr\","",1)
Is this right? I think it's pretty confusing to keep the config files inside MAME's ctrlr folder, these should be by default stored in a sub-folder inside controllerremap not MAME.

MAMECtrlrPath should be relative to MAME's folder imo not RocketLauncher.

I cleaned up the code a bit and changed a bunch of file operations to use classes instead since this is the new norm, I have no way to test it so please check it out and let me know if it's working:
http://pastebin.com/ZmiEkk1Z

Feel free to make any changes if needed to get it running, as I said I didn't test it.
 

Knewlife

Member
RL Member
Looks good thanks, but a couple of questions:

ControllerRemapConfigPath := moduleIni.Read( mameSystem . "|Settings", "ControllerRemapConfigPath", emuPath . "\ctrlr\","",1)
Is this right? I think it's pretty confusing to keep the config files inside MAME's ctrlr folder, these should be by default stored in a sub-folder inside controllerremap not MAME.

MAMECtrlrPath should be relative to MAME's folder imo not RocketLauncher.

Yes I should change that, I store the configurations inside mame/ctrlr before... now I store them inside rocketlauncher/profile/controllerremap ... but you are right the default path should be someting like ControllerRemapPath . "\Config"

And in the next topic, do you refer to this line?
MAMECtrlrPath := AbsoluteFromRelative("", MAMECtrlrPath)

I SHould change that to...
MAMECtrlrPath := AbsoluteFromRelative(EmuPath, MAMECtrlrPath)

I Need to change something in the ISD file to make the file browse relative to EmuPath?

I will test your modifications tomorrow and let you know how it goes.
 

brolly

Administrator
Developer
Yeah that's it exactly. You simply need to add the following to the KEY:
<PATHTYPE>Relative</PATHTYPE>
<BASEPATH>%EmulatorPath%</BASEPATH>
 

Knewlife

Member
RL Member
Ok I have tested the module with MAME system default config, MAME Game Specific (Mortal Kombat), and Atari 5200 system default config. After some changes in the module it is working fine.
I'm not in home right now, but will upload the module tonight.
 

Knewlife

Member
RL Member
Tested again to be sure, here is the module.
Hope someone else can test this besides me.

Really cool Classes you guys have added to Rocketlauncher, and also like the new userfunctions ;)

Great experience with RocketLauncher so far.
 

Attachments

  • MAME.zip
    25.9 KB · Views: 6

djvj

Administrator
Staff member
Developer
Brolly if this is good, please push it to git so it's not lost. I'll forget about it.

Glad you like em knewlife. They have been a lot of work over the past few months.
Sent from my SM-N910V using Tapatalk
 

brolly

Administrator
Developer
Finally got around to test this, looks good except for this part:
ControllerRemapPath := moduleIni.Read(mameSystem . "|Settings", "ControllerRemapPath", emuPath . "\ControllerRemap\ControllerRemap.exe","",1)
ControllerRemapConfigPath := moduleIni.Read( mameSystem . "|Settings", "ControllerRemapConfigPath", ControllerRemapPath . "\ctrlr\","",1)

This won't work as you are defaulting ControllerRemapConfigPath to emuPath . "\ControllerRemap\ControllerRemap.exe\ctrlr"!

Should be something like this instead:
ControllerRemapPath := moduleIni.Read(mameSystem . "|Settings", "ControllerRemapPath", emuPath . "\ControllerRemap\ControllerRemap.exe","",1)
CtrlRemapFile := new File(ControllerRemapPath)
ControllerRemapConfigPath := moduleIni.Read( mameSystem . "|Settings", "ControllerRemapConfigPath", CtrlRemapFile.FilePath . "\ctrlr\","",1)
 

Knewlife

Member
RL Member
Finally got around to test this, looks good except for this part:
ControllerRemapPath := moduleIni.Read(mameSystem . "|Settings", "ControllerRemapPath", emuPath . "\ControllerRemap\ControllerRemap.exe","",1)
ControllerRemapConfigPath := moduleIni.Read( mameSystem . "|Settings", "ControllerRemapConfigPath", ControllerRemapPath . "\ctrlr\","",1)

This won't work as you are defaulting ControllerRemapConfigPath to emuPath . "\ControllerRemap\ControllerRemap.exe\ctrlr"!

Should be something like this instead:
ControllerRemapPath := moduleIni.Read(mameSystem . "|Settings", "ControllerRemapPath", emuPath . "\ControllerRemap\ControllerRemap.exe","",1)
CtrlRemapFile := new File(ControllerRemapPath)
ControllerRemapConfigPath := moduleIni.Read( mameSystem . "|Settings", "ControllerRemapConfigPath", CtrlRemapFile.FilePath . "\ctrlr\","",1)





You are right... I change that at some point after setting my ini paths so I don't notice the error. Your solution is great because if you set controllerremap exe file the config path defaults to a ctrlr folder inside the controllerremap exe path.





The mamectrlr path is independent from those two. It actually depends on mame ini but different mame versions change te ini file they are using... Is a mess. So better set this manually...







It also will need to check if the files and folders exists... I don't do that before... But should be so dificult using file class.
 
Last edited:

Knewlife

Member
RL Member
Brolly i can fix the details you mentioned before in the mame module modification if you dont do it already. Just let me know.

Enviado desde mi 3SQ mediante Tapatalk
 
Top