Conversation
This provides automated switching of the 4-way/8-way servo on the TOS GRS Restrictor Plate Switcher. Requires their command-line utility to be installed and obviously requires their controller board to be attached to USB. Assumes the "4" or "8" command is in the Control field of the romlist. ("X" is also an option and means "don't switch.)
| if ( config["romlist_field"] == "Control" ) | ||
| game_field=Info.Control; |
There was a problem hiding this comment.
They are, but it's a bit of a stub, if someone wanted to use a different field from the romlist.
There was a problem hiding this comment.
I'm sorry, but I still don't understand the meaning of these lines.
| { | ||
| case Transition.ToGame: | ||
| { | ||
| if ( fe.game_info( game_field) != "X" ) |
There was a problem hiding this comment.
I don't recall the Control field to contain 2, 4, 8 or X in any game so I'm not sure what are you trying to achieve here. Please analyse mame.txt
There was a problem hiding this comment.
I needed a field in the romlist to pull the data from, this seemed like a good one. That's why the code has an option (which would need to be coded) to use a different field.
There was a problem hiding this comment.
This field is populated by mame romlist generator and contains values like:
only_buttons
mahjong
joystick (4-way)
joystick (4-way),joystick (4-way)
joystick (8-way),joystick (8-way)
joystick (8-way),joystick (8-way),joystick (8-way),joystick (8-way)
and so on. You should process it accordingly.
There was a problem hiding this comment.
This is correct. The mame.txt file will have values like "dual joystick" for games like robotron. And I have found others that don't mention 4/8 way. So perhaps the code should have a "case" condition that translates each possible value to an 8 or 4 way toggle. Even then, something like "dual joystick" doesn't necessarily always translate to 8 way. So I'm not sure this is the right approach.
But yes this current plugin would work if you have a very well cleaned and maintained mame.txt but current romlist generators don't populate it ready for this application.
| return false; | ||
| } | ||
|
|
||
| print(" Getting COM port for joystick servo \n"); |
There was a problem hiding this comment.
Was for debugging, happy to remove it. I'm obviously not familiar with your coding style and preferences.
| class UserConfig </ help="Integration plug-in for use with the command line utility provided by ThunderStickStudios.com" /> { | ||
|
|
||
| </ label="Command", help="Path to the command line utility", order=1 /> | ||
| command="C:\\Program Files (x86)\\tos428cl\\tos428cl.exe"; |
There was a problem hiding this comment.
Assumes Windows, hardcoded paths. AM+ is multiplatform so it would be nice if it worked on all platforms.
There was a problem hiding this comment.
Yeah, but the executable isn't available for any other platform. It'd like how LEDBlinky doesn't work on Mac, but there's still a plugin for it. For that matter, your Ultimarc360 plugin doesn't work on anything but Windows either, because Ultimarc doesn't provide an exe for anything else.
There was a problem hiding this comment.
In that case you should make the path to the executable configurable and explicitly mention it's windows only plugin.
|
Sorry I was commenting from my other account @attractmodeplus |
|
I have the TOSGRS and will be testing this. Some input in case you think this is worth it: |
This provides automated switching of the 4-way/8-way servo on the TOS GRS Restrictor Plate Switcher. Requires their command-line utility to be installed and obviously requires their controller board to be attached to USB. Assumes the "4" or "8" command is in the Control field of the romlist. ("X" is also an option and means "don't switch.)