micetools/src/micetools/dll/drivers/jvs.h

90 lines
2.6 KiB
C

#define JVS_MARK 0xd0
#define JVS_SYNC 0xe0
#define JVS_NODE_MASTER 0x00
#define JVS_NODE_BROADCAST 0xff
#define JVS_VERSION_CMD 0x13 // A real board reports 1.1, but we support 1.3
#define JVS_VERSION_JVS 0x30 // My board is 0x20, but SBWU needs 0x30
#define JVS_VERSION_COMM 0x10
typedef enum JVS_STATUS {
JVS_STATUS_OK = 0x01,
JVS_STATUS_UKCOM = 0x02,
JVS_STATUS_SUM = 0x03,
JVS_STATUS_OVERFLOW = 0x04,
JVS_STATUS_UNKNOWN = 0xfe, // Not a spec-compliant status, but there's none for this!
JVS_STATUS_SILENCE = 0xff, // Pseudo-status to indicate that the response is not to be sent
} JVS_STATUS;
typedef enum JVS_REPORT {
JVS_REPORT_OK = 0x01,
JVS_REPORT_PARAM_NODATA = 0x02,
JVS_REPORT_PARAM_INVALID = 0x03,
JVS_REPORT_BUSY = 0x04,
} JVS_REPORT;
typedef enum JVS_FEATURE {
JVS_FEATURE_PAD = 0x00,
JVS_FEATURE_EOF = 0x00,
JVS_FEATURE_PLAYERS = 0x01,
JVS_FEATURE_COINS = 0x02,
JVS_FEATURE_ANALOG = 0x03,
JVS_FEATURE_ROTARY = 0x04,
JVS_FEATURE_KEYCODE = 0x05,
JVS_FEATURE_SCREEN_POS = 0x06,
JVS_FEATURE_MISC_SWITCH = 0x07,
JVS_FEATURE_CARDS = 0x10,
JVS_FEATURE_MEDAL_HOPPER = 0x11,
JVS_FEATURE_GPIO = 0x12,
JVS_FEATURE_ANALOG_OUT = 0x13,
JVS_FEATURE_CHAR_OUT = 0x14,
JVS_FEATURE_BACKUP = 0x15,
} JVS_FEATURE;
#define JVS_CHARTYPE_UNKNOWN 0x00
#define JVS_CHARTYPE_NUMBER 0x01
#define JVS_CHARTYPE_ALNUM 0x02
#define JVS_CHARTYPE_ALNUM_KATAKANA 0x03
#define JVS_CHARTYPE_SHIFTJIS 0x04
#define JVS_COINSLOT_NORMAL 0x00
#define JVS_COINSLOT_JAM 0x01
#define JVS_COINSLOT_COUNTER_DISCON 0x02
#define JVS_COINSLOT_BUSY 0x03
// Mandatory JVS commands
#define JVS_CMD_RESET 0xf0
#define JVS_CMD_RESET_ASSERT 0xd9
#define JVS_CMD_ASSIGN_ADDR 0xf1
#define JVS_CMD_CHANGE_COMMS 0xf2
#define JVS_CMD_READ_ID 0x10
#define JVS_CMD_GET_CMD_VERSION 0x11
#define JVS_CMD_GET_JVS_VERSION 0x12
#define JVS_CMD_GET_COMM_VERSION 0x13
#define JVS_CMD_GET_FEATURES 0x14
#define JVS_CMD_REQUEST_RETRANSMIT 0x2f
// Optional JVS commands
#define JVS_CMD_RECEIVE_MAIN_ID 0x15
#define JVS_CMD_READ_SW 0x20
#define JVS_CMD_READ_COIN 0x21
#define JVS_CMD_READ_ANALOGS 0x22
#define JVS_CMD_READ_ROTARY 0x23
#define JVS_CMD_READ_KEYCODE 0x24
#define JVS_CMD_READ_SCREEN_POS 0x25
#define JVS_CMD_READ_MISC_SWITCH 0x26
#define JVS_CMD_REMAINING_PAYOUT 0x2e
#define JVS_CMD_COIN_DECREASE 0x30
#define JVS_CMD_PAYOUT_INCREASE 0x31
#define JVS_CMD_WRITE_GPIO1 0x32
#define JVS_CMD_WRITE_ANALOG 0x33
#define JVS_CMD_WRITE_CHARACTER 0x34
#define JVS_CMD_COIN_INCREASE 0x35
#define JVS_CMD_PAYOUT_DECREATE 0x36
#define JVS_CMD_WRITE_GPIO2 0x37
#define JVS_CMD_WRITE_GPIO3 0x38