|
KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Automatic input notification callbacks More...
Typedefs | |
| typedef void(* | mie_btn_callback_t) (uint32_t btns) |
| Mapped controller button callback type. | |
| typedef void(* | mie_jvs_callback_t) (mie_jvs_input_t input, uint32_t mask) |
| Native JVS input callback type. | |
Enumerations | |
| enum | mie_jvs_input_t { MIE_JVS_IN_SYSTEM , MIE_JVS_IN_P1 , MIE_JVS_IN_P2 , MIE_JVS_IN_PANEL_DIP , MIE_JVS_IN_PANEL_PSW , MIE_JVS_IN_COIN1 , MIE_JVS_IN_COIN2 } |
| Native JVS input source for mie_jvs_callback(). More... | |
Functions | |
| int | mie_btn_callback (uint32_t btns, mie_btn_callback_t cb) |
| Set an automatic mapped button press callback. | |
| int | mie_jvs_callback (mie_jvs_input_t input, uint32_t mask, mie_jvs_callback_t cb) |
| Set an automatic native JVS input callback. | |
Automatic input notification callbacks
Callbacks are invoked on a dedicated worker thread when the requested input transitions from released to pressed. Pass NULL as the callback pointer to uninstall a registration with the same key.
| typedef void(* mie_btn_callback_t) (uint32_t btns) |
Mapped controller button callback type.
Called when the mapped cont_state_t buttons matching the registered mask become pressed.
| btns | Current mapped button bitmask (Inputs). |
| typedef void(* mie_jvs_callback_t) (mie_jvs_input_t input, uint32_t mask) |
Native JVS input callback type.
| input | Input source that triggered the callback. |
| mask | Active bits from the matched mask. |
| enum mie_jvs_input_t |
Native JVS input source for mie_jvs_callback().
| int mie_btn_callback | ( | uint32_t | btns, |
| mie_btn_callback_t | cb ) |
Set an automatic mapped button press callback.
Registers a callback invoked when the mapped controller buttons in btns transition from not-all-pressed to all-pressed. The callback runs on a worker thread, not in the Maple IRQ context.
| btns | Button mask to match (Inputs). |
| cb | Callback to invoke, or NULL to uninstall callbacks registered for the same btns value. |
| 0 | On success. |
| -1 | On allocation or thread creation failure. |
| int mie_jvs_callback | ( | mie_jvs_input_t | input, |
| uint32_t | mask, | ||
| mie_jvs_callback_t | cb ) |
Set an automatic native JVS input callback.
Registers a callback invoked when the selected native input source has all bits in mask transition from not-all-active to all-active. The callback runs on a worker thread, not in the Maple IRQ context.
For MIE_JVS_IN_P1, MIE_JVS_IN_P2, MIE_JVS_IN_SYSTEM, MIE_JVS_IN_PANEL_DIP, and MIE_JVS_IN_PANEL_PSW, mask uses the matching Input Masks constants. For MIE_JVS_IN_COIN1 and MIE_JVS_IN_COIN2, use MIE_JVS_COIN_INSERT_BIT. These fire when the JVS COININP meter for that slot increases after a physical coin insert on COIN SW 1/2. The I/O board updates the meter automatically; do not call mie_coin_add() again for the same insert.
| input | Native JVS input source to watch. |
| mask | Bit mask within that source. |
| cb | Callback to invoke, or NULL to uninstall callbacks registered for the same input and mask pair. |
| 0 | On success. |
| -1 | On allocation or thread creation failure. |
Referenced by main().