bananatools/ferrumio/ferrumio.h
2023-01-02 23:39:03 -05:00

68 lines
1.9 KiB
C

#pragma once
#include <windows.h>
#include <stdint.h>
#include "ferrumio/config.h"
enum {
FERRUM_IO_OPBTN_TEST = 0x01,
FERRUM_IO_OPBTN_SERVICE = 0x02,
FERRUM_IO_OPBTN_UP = 0x04,
FERRUM_IO_OPBTN_DOWN = 0x08,
FERRUM_IO_OPBTN_ENTER = 0x10,
FERRUM_IO_OPBTN_COIN = 0x20,
};
// Chagned to match xinput masks for ease of use
enum {
FERRUM_IO_GAMEBTN_UP = 0x0001,
FERRUM_IO_GAMEBTN_DOWN = 0x0002,
FERRUM_IO_GAMEBTN_LEFT = 0x0004,
FERRUM_IO_GAMEBTN_RIGHT = 0x0008,
FERRUM_IO_GAMEBTN_START = 0x0010,
FERRUM_IO_GAMEBTN_TRIGGER_L = 0x0100,
FERRUM_IO_GAMEBTN_TRIGGER_R = 0x0200,
FERRUM_IO_GAMEBTN_A = 0x2000,
FERRUM_IO_GAMEBTN_B = 0x1000,
FERRUM_IO_GAMEBTN_X = 0x8000,
FERRUM_IO_GAMEBTN_Y = 0x4000,
};
/* Get the version of the Pokken IO API that this DLL supports. This
function should return a positive 16-bit integer, where the high byte is
the major version and the low byte is the minor version (as defined by the
Semantic Versioning standard).
The latest API version as of this writing is 0x0100. */
uint16_t ferrum_io_get_api_version(void);
/* Initialize the IO DLL. This is the second function that will be called on
your DLL, after ferrum_io_get_api_version.
All subsequent calls to this API may originate from arbitrary threads.
Minimum API version: 0x0100 */
HRESULT ferrum_io_jvs_init(void);
/* Initialize the IO DLL. This is the second function that will be called on
your DLL, after ferrum_io_get_api_version.
All subsequent calls to this API may originate from arbitrary threads.
Minimum API version: 0x0100 */
HRESULT ferrum_io_gamepad_init(void);
/* Send any queued outputs (of which there are currently none, though this may
change in subsequent API versions) and retrieve any new inputs.
Minimum API version: 0x0100 */
HRESULT ferrum_io_jvs_poll(uint8_t *opbtn);
HRESULT ferrum_io_gamepad_poll(uint16_t *gamebtn);
void ferrum_io_jvs_read_coin_counter(uint16_t *coins);