Update jbio for testmenu support and add jbio-p4io
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
#ifndef P4IO_CMD_H
|
||||
#define P4IO_CMD_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
enum p4ioemu_p4io_command {
|
||||
P4IO_CMD_INIT = 0x00,
|
||||
P4IO_CMD_GET_DEVICE_INFO = 0x01,
|
||||
P4IO_CMD_SET_PORTOUT = 0x12,
|
||||
P4IO_CMD_COINSTOCK = 0x18,
|
||||
P4IO_CMD_RESET_WTD = 0x1C,
|
||||
P4IO_CMD_SCI_MNG_OPEN = 0x20,
|
||||
P4IO_CMD_SCI_UPDATE = 0x21,
|
||||
/* SCI = serial communication interface */
|
||||
P4IO_CMD_SCI_MNG_BREAK = 0x24,
|
||||
/* Read round plug id over one-wire */
|
||||
P4IO_CMD_DALLAS_READ_ID = 0x40,
|
||||
/* Read round plug mem over one-wire */
|
||||
P4IO_CMD_DALLAS_READ_MEM = 0x41
|
||||
};
|
||||
|
||||
#define P4IO_CMD_HEADER_LEN 4
|
||||
#define P4IO_MAX_PAYLOAD 60
|
||||
|
||||
struct p4io_cmd_header {
|
||||
uint8_t AA;
|
||||
uint8_t cmd;
|
||||
uint8_t seq_num;
|
||||
uint8_t payload_len;
|
||||
};
|
||||
|
||||
struct p4io_cmd_package {
|
||||
struct p4io_cmd_header header;
|
||||
uint8_t payload[P4IO_MAX_PAYLOAD];
|
||||
};
|
||||
|
||||
struct p4io_req_read_roundplug {
|
||||
/* 0 = black, 1 = white */
|
||||
uint8_t type;
|
||||
};
|
||||
|
||||
struct p4io_req_panel_mode {
|
||||
uint16_t mode;
|
||||
uint8_t is_single;
|
||||
uint8_t padding[13];
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct p4io_resp_device_info {
|
||||
uint32_t type;
|
||||
uint8_t padding;
|
||||
uint8_t version_major;
|
||||
uint8_t version_minor;
|
||||
uint8_t version_revision;
|
||||
char product_code[4];
|
||||
char build_date[16];
|
||||
char build_time[16];
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef P4IO_GUID_H
|
||||
#define P4IO_GUID_H
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
static const GUID p4io_guid = {
|
||||
0x8B7250A5,
|
||||
0x4F61,
|
||||
0x46C9,
|
||||
{0x84, 0x3A, 0xE6, 0x68, 0x06, 0x47, 0x6A, 0x20}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef P4IO_IOCTL_H
|
||||
#define P4IO_IOCTL_H
|
||||
|
||||
/* can't seem to #include the requisite DDK headers from usermode code,
|
||||
so we have to redefine these macros here */
|
||||
|
||||
#ifndef CTL_CODE
|
||||
#define CTL_CODE(DeviceType, Function, Method, Access) \
|
||||
(((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
|
||||
#endif
|
||||
|
||||
#ifndef METHOD_BUFFERED
|
||||
#define METHOD_BUFFERED 0
|
||||
#endif
|
||||
|
||||
#ifndef FILE_ANY_ACCESS
|
||||
#define FILE_ANY_ACCESS 0x00
|
||||
#endif
|
||||
|
||||
#ifndef FILE_DEVICE_UNKNOWN
|
||||
#define FILE_DEVICE_UNKNOWN 0x22
|
||||
#endif
|
||||
|
||||
#define P4IO_FUNCTION_READ_JAMMA_2 0x801
|
||||
#define P4IO_FUNCTION_GET_DEVICE_NAME 0x803
|
||||
|
||||
// 0x22200Cu sent to bulk handle
|
||||
#define P4IO_IOCTL_GET_DEVICE_NAME \
|
||||
CTL_CODE( \
|
||||
FILE_DEVICE_UNKNOWN, \
|
||||
P4IO_FUNCTION_GET_DEVICE_NAME, \
|
||||
METHOD_BUFFERED, \
|
||||
FILE_ANY_ACCESS)
|
||||
// 0x222004 sent to int handle
|
||||
#define P4IO_IOCTL_READ_JAMMA_2 \
|
||||
CTL_CODE( \
|
||||
FILE_DEVICE_UNKNOWN, \
|
||||
P4IO_FUNCTION_READ_JAMMA_2, \
|
||||
METHOD_BUFFERED, \
|
||||
FILE_ANY_ACCESS)
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user