Files
pumpitupdev_pumptools/src/main/hook/patch/piubtn.h
T
icex2 24d5cfc647 patch/piuio/piubtn: Add option to delay polling on ctrl msgs
The PRO games do not have proper CPU load limiting on their
IO threads which results in very high CPU load when using
the emulation subsystem.
2021-04-12 22:03:24 +02:00

37 lines
1013 B
C

/**
* Patch libusb-0.1 calls to intercept with piubtn (pump pro buttons)
* communication and hook our API with emulation code
*/
#ifndef PATCH_PIUBTN_H
#define PATCH_PIUBTN_H
#include "ptapi/io/x11-input-hook.h"
#include "util/options.h"
/**
* Initialize the patch module
*
* @param piubtn_lib_path Path to a library implementing the piubtn API
* @param poll_delay_ms If the polling thread relies on the hardware
* load for timing, CPU load increases massively if the caller is not taking
* care of sleeping properly. Injects an artificial delay to emulate that and
* control the CPU load.
*/
void patch_piubtn_init(const char *piubtn_lib_path, uint32_t poll_delay_ms);
/**
* Get the input hook handler provided by the piubtn library.
*
* @return Input hook handler for main-loop patch module or NULL if none is
* used.
*/
const struct pumptools_input_hook_handler *
patch_piubtn_get_input_hook_handler(void);
/**
* Shut down the patch module
*/
void patch_piubtn_shutdown(void);
#endif