Configuring Buddabing's LED Controller

The GameCab Deluxe LED controller requires a DLL to run. I provide this DLL, named buddaled.dll, in the binary distribution of BuddaMAME. To pass this information to BuddaMAME, you should specify the DLL name in the -lightdriver (or -ld) MAME option. This can safely be specified in the mame.ini file.

The mame.ini option to load the DLL is:
lightdriver buddaled

or:
ld buddaled

The buddaled.dll must either be in the same directory as the executable calling it or in a subdirectory named lights under the current directory.

If buddaled.dll is not in either of those two paths, a "error while parsing cmdline" error will be returned.

TODO: Make a more informative error message.

Keywords in buddaled.cfg

debug_max6956
Turn on debugging messages related to the MAX6956 chips. Use for troubleshooting only.

debug_2wire
Turn on debugging messages related to the 2-wire interface, which is the I2C interface between the parallel port and the MAX6956 chips.

delay_count
This variable controls the timing of the parallel port signals. If the board does not respond when playing animations, try changing this value.

PL1_START_LIGHT

PL2_START_LIGHT

PL3_START_LIGHT

PL4_START_LIGHT

Change the port mapping for the player start lights. Put these lines in the buddaled.cfg to enable player start button flashing. A numeric port number is expected after the keyword, separated by a space. Port numbers range from 1 to 40 on the first controller, 41 to 80 on the second, and so forth.

Note: Implementation of these start lights is a bit spotty.

enable_second_controller

enable_third_controller

enable_fourth_controller
Set this to 1 to enable writes to other LED controllers than the first. Default values for these options is zero. Unless you have more than one controller installed, I recommend that you leave these unset. The DLL will attempt to write the other controllers every frame if the options are set, resulting in possibly slower performance.

Each controller should have two jumpers on it indicated which controller it is. The two jumpers on each board must be set identically.

disable_controller_writes
Set this to 1 to disable all writes to the LED controller. Used for troubleshooting only. Default is zero.

DEFINE_CUSTOM_EVENT
Usage:
DEFINE_CUSTOM_EVENT event_name event_value event_action

This keyword defines a custom event.

The event name can be any string which does not contain any spaces. The event value must be numeric.

Possible values for event_action
PLAY_ONCE(animation_filename) Plays an animation file one time
PLAY_TWICE(animation_filename) Plays an animation file twice
PLAY_x_TIMES(animation_filename) Plays an animation file x number of times (x numeric)
PLAY_LOOP(animation_filename) Start playing an animation file and keep repeatedly playing it
STOP_PLAYING Stop playing whatever animation file is currently playing, if any

Event values tie into the Light Signal Engine. As an example, gl.tter has provided mrdo.dat, a file which contains memory watchpoints for the game Mr. Do!. This file defines three custom events.

One custom event named MRDO_BALLREADY. Event values of 0 and 1 are defined for this event.

Another custom event is named MRDO_DIAMOND. Event values of 0 and 1 are defined for this event as well.

The third custom event is named MRDO_BALL_ANIMATION. Event values of 0, 1, and 2 are defined for this event.

In this example, suppose you want to have light number 5 flash 3 times when the ball is exploding. In your buddaled.cfg, you would put the following line:
DEFINE_CUSTOM_EVENT MRDO_BALL_ANIMATION 1 PLAY_ONCE(explode.txt)

Explode.txt would have the following text in it:
repeat 3
{
( 100 5 + )
( 100 5 0 )
}

Alternatively, you could put the following in the buddaled.cfg:
DEFINE_CUSTOM_EVENT MRDO_BALL_ANIMATION 1 PLAY_3_TIMES(explode.txt)

In this variation, explode.txt would be:
( 100 5 + )
( 100 5 0 )

Troubleshooting

If the animations you wish to use are complex, it might be better to precompile them with animaker.exe, my animation compiler. That way there is no time spent by the DLL in the compiling process.

As of this writing, the software for the controller is still in a state of flux. Please make sure you have the latest version of BuddaMAME and the latest version of the buddaled.dll installed. Feel free to contact me for help with animations, getting your controller to display correctly, or help with other troubleshooting. My email address is:

buddabing AT houston DOT rr DOT com.