#ifndef CMDEMU_H_INCLUDED
#define CMDEMU_H_INCLUDED

// Generic named-boolean toggle, shared with c.cmdctrl (Joystick_Control):
// op: -1 = query only (no change), 0 = off, 1 = on. Setting a flag to the
// state it's already in is a harmless no-op, not an error - simpler for a
// caller (e.g. JoySetup's Save button) than having to check current state
// before deciding whether to call this at all.
_kernel_oserror *joy_flag_toggle(int *flag, int32_t op, const char *name);

// *USBJoystick_Emulate <SerialPort|Joy|ADC> [<on|off>] - mirrors
// Joystick_Emulate's R0 selector 1:1 (see h.joyswis for JOYSTICK_EMULATE_*);
// omitting on/off reports the current state, matching the SWI's own -1 =
// query convention.
_kernel_oserror *command_emulate(const char *args, int32_t argc);

// Single Joystick_Emulate SWI - see h.joyswis for the JOYSTICK_EMULATE_*
// selector values and the reasoning for why one shape regardless of R0 is a
// legitimate use of a reason code here. No Acorn selector and no
// *USBJoystick_EmulateAcorn command - Joystick_Read is always active, see
// h.joyswis. *USBJoystick_Emulate is a CLI convenience over this same SWI -
// that split is unrelated to this.
_kernel_oserror *swi_joystick_emulate(_kernel_swi_regs *r);

#endif
