Skip to content

Created TOS-GRS Plugin#383

Open
concentrateddon wants to merge 1 commit intooomek:masterfrom
concentrateddon:master
Open

Created TOS-GRS Plugin#383
concentrateddon wants to merge 1 commit intooomek:masterfrom
concentrateddon:master

Conversation

@concentrateddon
Copy link
Copy Markdown

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.)

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.)
Comment on lines +45 to +46
if ( config["romlist_field"] == "Control" )
game_field=Info.Control;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines are redundant.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are, but it's a bit of a stub, if someone wanted to use a different field from the romlist.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, but I still don't understand the meaning of these lines.

{
case Transition.ToGame:
{
if ( fe.game_info( game_field) != "X" )
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary verbosity

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assumes Windows, hardcoded paths. AM+ is multiplatform so it would be nice if it worked on all platforms.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case you should make the path to the executable configurable and explicitly mention it's windows only plugin.

@oomek
Copy link
Copy Markdown
Owner

oomek commented Mar 11, 2026

Sorry I was commenting from my other account @attractmodeplus

@guilleshop
Copy link
Copy Markdown
Contributor

I have the TOSGRS and will be testing this.

Some input in case you think this is worth it:
Consider adding an option "Default_AM_State" or similar that will allow the user to specify what state (4 or 8) the TOS will be in when returning to the AM+ front end after exit from game. Options could be "4 way", "8 way", or "don't change" (for this last one, there would be no switching when exiting the game, and TOS stays in whatever state the game state had it switched to (4 or 8).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants