For the complete documentation index, see llms.txt. This page is also available as Markdown.

Combo reference

Combos are compiler-scheduled top-level blocks. They produce timed output without an inner delay loop in main. A combo keeps running across VM cycles until it finishes, is stopped, or is suspended.

Declaration

combo-declaration.gpc
combo TapSquare {
    set_val(PS5_SQUARE, 100);
    wait(80);
    set_val(PS5_SQUARE, 0);
    wait(80);
}

combo and fcombo use the same source structure. Combo names are resolved separately from variables, definitions, enum members, and const-data names. Keywords and built-in names remain reserved.


combo_run

Starts a combo only when it is not already running.

Syntax and returns

combo_run(combo_name);

Returns nothing.

Example

main {
    if(event_press(PS5_CROSS)) combo_run(TapSquare);
}

Repeated calls do not reset an active combo.


combo_running

Reports whether a combo is currently active.

Syntax and returns

Returns TRUE while the combo is running; otherwise FALSE.

Example


combo_stop

Stops one combo. It has no effect when that combo is not running.

Syntax and returns

Returns nothing.

Example


combo_restart

Starts a stopped combo or restarts an active combo from its first step.

Syntax and returns

Returns nothing.

Example

Use this only when every new trigger should deliberately reset the timing sequence.


combo_suspend

Pauses one running combo without discarding its position.

Syntax and returns

Returns nothing.

Example


combo_suspended

Reports whether a combo is paused.

Syntax and returns

Returns TRUE when suspended; otherwise FALSE.

Example


combo_current_step

Returns the index of the step currently being executed.

Syntax and returns

Returns the current combo step value.

Example

Use this for diagnostics and progress displays; do not build fragile behavior that depends on an undocumented compiler step layout.


combo_step_time_left

Returns the milliseconds remaining in the active combo step.

Syntax and returns

Returns remaining milliseconds.

Example


combo_stop_all

Stops every running combo.

Syntax and returns

Returns nothing.

Example

This is useful on an emergency cancel or exclusive menu transition. Document the ownership change because unrelated combos are also stopped.


combo_suspend_all

Pauses every active combo.

Syntax and returns

Returns nothing.

Example


combo_resume

Resumes one suspended combo.

Syntax and returns

Returns nothing.

Example


combo_resume_all

Resumes every suspended combo.

Syntax and returns

Returns nothing.

Example

Only use all-combo control when the state transition truly owns every scheduled behavior.


wait

Holds the output assignments from the current combo step for a duration. wait is valid only at the root level of a combo.

Syntax and returns

Parameter
Accepted value

milliseconds

1..2147483647.

Returns nothing. Use practical bounded values and verify compiled timing on the device.

The current 32-bit target accepts an integer duration; use practical bounded values and verify compiled timing. Returns nothing.

Example

Do not place wait inside if, while, or another nested block within the combo.


call

Runs another combo as a subroutine. The parent combo pauses until the called combo finishes, then resumes at its next step.

Syntax and returns

Returns nothing.

Example

call must be at the combo root. Avoid recursion and cycles such as A calling B while B calls A.

Complete control example

The combo output and main output share the final report. Device-test output ownership when both write the same identifier.

Last updated