Next: , Previous: Display Effects, Up: Effects


6.4 Lamp Effects

Lamp effects are defined in the [leffs] section of the machine configuration file. Each lamp effect defines a function that executes when the effect is running, plus it says which of the lamps, flashers, and G.I. strings it is able to modify. Attempts to modify unallocated objects have no effect.

The objects allocated to a lamp effect are guaranteed to be turned off when the function starts, and are restored to their previous states when the function ends.

A lamp effect can also be declared as shared. A shared leff can run in parallel with the current running leff, and with other shared leffs. Shared leffs have a lower priority than normal leffs; the effect can be masked. Also, shared leffs run to completion and are never preempted.

Shared leffs are usually for indicating low-priority game state that requires constant updating, and where it is not appropriate to use the default lamp state. Normal leffs are intended for light shows.

Lamp effects cannot be aborted by the flippers like display effects.

If a normal leff cannot be started, it is forgotten and never queued, like display effects can be.

leff_start
Starts a lamp effect.
leff_stop
Stops a lamp effect.
leff_restart
Stops and then starts a lamp effect again.
leff_on, leff_off, leff_toggle, leff_test
Called from within a lamp effect, sets/gets the state of a single lamp that has been allocated to it.
gi_leff_alloc, gi_leff_enable, gi_leff_disable, gi_leff_free
Called only from within lamps effects. These modify GI strings overriding their default settings.
leff_exit
Exits from the currently running lamp effect.