Removed unused files, maintainer suggestions.
This commit is contained in:
parent
ceb8a5e3a3
commit
441e9999c7
|
@ -1,54 +0,0 @@
|
|||
#ifndef BEMANITOOLS_SDVXIO_H
|
||||
#define BEMANITOOLS_SDVXIO_H
|
||||
|
||||
/* IO emulation provider for BeatStream */
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "bemanitools/glue.h"
|
||||
|
||||
enum bst_io_in_gpio_sys_bit {
|
||||
SDVX_IO_IN_GPIO_SYS_COIN = 2,
|
||||
SDVX_IO_IN_GPIO_SYS_TEST = 4,
|
||||
SDVX_IO_IN_GPIO_SYS_SERVICE = 5,
|
||||
};
|
||||
|
||||
/* The first function that will be called on your DLL. You will be supplied
|
||||
with four function pointers that may be used to log messages to the game's
|
||||
log file. See comments in glue.h for further information. */
|
||||
|
||||
void bst_io_set_loggers(
|
||||
log_formatter_t misc,
|
||||
log_formatter_t info,
|
||||
log_formatter_t warning,
|
||||
log_formatter_t fatal);
|
||||
|
||||
/* Initialize your BST IO emulation DLL. Thread management functions are
|
||||
provided to you; you must use these functions to create your own threads if
|
||||
you want to make use of the logging functions that are provided to
|
||||
eam_io_set_loggers(). You will also need to pass these thread management
|
||||
functions on to geninput if you intend to make use of that library.
|
||||
|
||||
See glue.h and geninput.h for further details. */
|
||||
|
||||
bool bst_io_init(
|
||||
thread_create_t thread_create,
|
||||
thread_join_t thread_join,
|
||||
thread_destroy_t thread_destroy);
|
||||
|
||||
/* Shut down your SDVX IO emulation DLL */
|
||||
|
||||
void bst_io_fini(void);
|
||||
|
||||
/* Read input state. Returns true if successful. */
|
||||
|
||||
bool bst_io_read_input(void);
|
||||
|
||||
/* Get state of coin, test, service inputs */
|
||||
|
||||
uint8_t bst_io_get_input(void);
|
||||
|
||||
// TODO: Lighting
|
||||
|
||||
#endif
|
|
@ -1,137 +0,0 @@
|
|||
#ifndef BEMANITOOLS_EAM_H
|
||||
#define BEMANITOOLS_EAM_H
|
||||
|
||||
/* Card reader emulator API. You may replace the stock EAMIO.DLL supplied by
|
||||
Bemanitools with your own custom implementation, which should implement the
|
||||
interface contract defined in this header file. */
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "bemanitools/glue.h"
|
||||
|
||||
/* Scan codes for the so-called "10 key" button panel on each card reader. Each
|
||||
scan code corresponds to a bit position within the 16-bit bitfield that you
|
||||
return from eam_io_get_keypad_state(). */
|
||||
|
||||
enum eam_io_keypad_scan_code {
|
||||
EAM_IO_KEYPAD_0 = 0,
|
||||
EAM_IO_KEYPAD_1 = 1,
|
||||
EAM_IO_KEYPAD_4 = 2,
|
||||
EAM_IO_KEYPAD_7 = 3,
|
||||
EAM_IO_KEYPAD_00 = 4,
|
||||
EAM_IO_KEYPAD_2 = 5,
|
||||
EAM_IO_KEYPAD_5 = 6,
|
||||
EAM_IO_KEYPAD_8 = 7,
|
||||
EAM_IO_KEYPAD_DECIMAL = 8,
|
||||
EAM_IO_KEYPAD_3 = 9,
|
||||
EAM_IO_KEYPAD_6 = 10,
|
||||
EAM_IO_KEYPAD_9 = 11,
|
||||
|
||||
EAM_IO_KEYPAD_COUNT = 12, /* Not an actual scan code */
|
||||
};
|
||||
|
||||
/* Emulating the sensors of a slotted card reader. The reader has one
|
||||
sensor at the front that detects if a card is getting inserted or
|
||||
if the card is not fully removed. When the back sensor is triggered
|
||||
the card is locked in the slot and its data is read. */
|
||||
|
||||
enum eam_io_sensor_state {
|
||||
EAM_IO_SENSOR_FRONT = 0,
|
||||
EAM_IO_SENSOR_BACK = 1,
|
||||
};
|
||||
|
||||
/* Different commands for the (slotted) reader. The game triggers one
|
||||
of these actions and the card slot as to execute it. When non-slotted
|
||||
readers are emulated, these states are not used/set. */
|
||||
|
||||
enum eam_io_card_slot_cmd {
|
||||
EAM_IO_CARD_SLOT_CMD_CLOSE = 0,
|
||||
EAM_IO_CARD_SLOT_CMD_OPEN = 1,
|
||||
EAM_IO_CARD_SLOT_CMD_EJECT = 2,
|
||||
EAM_IO_CARD_SLOT_CMD_READ = 3,
|
||||
};
|
||||
|
||||
/* Emulating of the card type for new readers. */
|
||||
|
||||
enum eam_io_read_card_result {
|
||||
EAM_IO_CARD_NONE = 0,
|
||||
EAM_IO_CARD_ISO15696 = 1,
|
||||
EAM_IO_CARD_FELICA = 2,
|
||||
};
|
||||
|
||||
/* A private function pointer table returned by the stock EAMIO.DLL
|
||||
implementation and consumed by config.exe. The contents of this table are
|
||||
undocumented and subject to change without notice. */
|
||||
|
||||
struct eam_io_config_api;
|
||||
|
||||
/* The first function that will be called on your DLL. You will be supplied
|
||||
with four function pointers that may be used to log messages to the game's
|
||||
log file. See comments in glue.h for further information. */
|
||||
|
||||
void eam_io_set_loggers(
|
||||
log_formatter_t misc,
|
||||
log_formatter_t info,
|
||||
log_formatter_t warning,
|
||||
log_formatter_t fatal);
|
||||
|
||||
/* Initialize your card reader emulation DLL. Thread management functions are
|
||||
provided to you; you must use these functions to create your own threads if
|
||||
you want to make use of the logging functions that are provided to
|
||||
eam_io_set_loggers(). You will also need to pass these thread management
|
||||
functions on to geninput if you intend to make use of that library.
|
||||
|
||||
See glue.h and geninput.h for further details. */
|
||||
|
||||
bool eam_io_init(
|
||||
thread_create_t thread_create,
|
||||
thread_join_t thread_join,
|
||||
thread_destroy_t thread_destroy);
|
||||
|
||||
/* Shut down your card reader emulation DLL. */
|
||||
|
||||
void eam_io_fini(void);
|
||||
|
||||
/* Return the state of the number pad on your reader. This function will be
|
||||
called frequently. See enum eam_io_keypad_scan_code above for the meaning of
|
||||
each bit within the return value.
|
||||
|
||||
This function will be called even if the running game does not actually have
|
||||
a number pad on the real cabinet (e.g. Jubeat).
|
||||
|
||||
unit_no is either 0 or 1. Games with only a single reader (jubeat, popn,
|
||||
drummania) will only use unit_no 0. */
|
||||
|
||||
uint16_t eam_io_get_keypad_state(uint8_t unit_no);
|
||||
|
||||
/* Indicate which sensors (front and back) are triggered for a slotted reader
|
||||
(refer to enum). To emulate non-slotted readers, just set both sensors
|
||||
to on to indicate the card is in range of the reader. This function
|
||||
will be called frequently. */
|
||||
|
||||
uint8_t eam_io_get_sensor_state(uint8_t unit_no);
|
||||
|
||||
/* Read a card ID. This function is only called when the return value of
|
||||
eam_io_get_sensor_state() changes from false to true, so you may take your
|
||||
time and perform file I/O etc, within reason. You must return exactly eight
|
||||
bytes into the buffer pointed to by card_id. */
|
||||
|
||||
uint8_t eam_io_read_card(uint8_t unit_no, uint8_t *card_id, uint8_t nbytes);
|
||||
|
||||
/* Send a command to the card slot. This is called by the game to execute
|
||||
certain actions on a slotted reader (refer to enum). When emulating
|
||||
wave pass readers, this is function is never called. */
|
||||
|
||||
bool eam_io_card_slot_cmd(uint8_t unit_no, uint8_t cmd);
|
||||
|
||||
/* This function is called frequently. Update your device and states in here */
|
||||
|
||||
bool eam_io_poll(uint8_t unit_no);
|
||||
|
||||
/* Return a pointer to an internal configuration API for use by config.exe.
|
||||
Custom implementations should return NULL. */
|
||||
|
||||
const struct eam_io_config_api *eam_io_get_config_api(void);
|
||||
|
||||
#endif
|
|
@ -1,173 +0,0 @@
|
|||
#ifndef BEMANITOOLS_IIDXIO_H
|
||||
#define BEMANITOOLS_IIDXIO_H
|
||||
|
||||
/* IO emulation provider for beatmania IIDX. */
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "bemanitools/glue.h"
|
||||
|
||||
/* Bit mapping for the "pad" word */
|
||||
|
||||
enum iidx_io_sys_bit {
|
||||
IIDX_IO_SYS_TEST = 0x00,
|
||||
IIDX_IO_SYS_SERVICE = 0x01,
|
||||
IIDX_IO_SYS_COIN = 0x02
|
||||
};
|
||||
|
||||
enum iidx_io_panel_bit {
|
||||
IIDX_IO_PANEL_P1_START = 0x00,
|
||||
IIDX_IO_PANEL_P2_START = 0x01,
|
||||
IIDX_IO_PANEL_VEFX = 0x02,
|
||||
IIDX_IO_PANEL_EFFECT = 0x03
|
||||
};
|
||||
|
||||
enum iidx_io_key_bit {
|
||||
IIDX_IO_KEY_P1_1 = 0x00,
|
||||
IIDX_IO_KEY_P1_2 = 0x01,
|
||||
IIDX_IO_KEY_P1_3 = 0x02,
|
||||
IIDX_IO_KEY_P1_4 = 0x03,
|
||||
IIDX_IO_KEY_P1_5 = 0x04,
|
||||
IIDX_IO_KEY_P1_6 = 0x05,
|
||||
IIDX_IO_KEY_P1_7 = 0x06,
|
||||
|
||||
IIDX_IO_KEY_P2_1 = 0x07,
|
||||
IIDX_IO_KEY_P2_2 = 0x08,
|
||||
IIDX_IO_KEY_P2_3 = 0x09,
|
||||
IIDX_IO_KEY_P2_4 = 0x0A,
|
||||
IIDX_IO_KEY_P2_5 = 0x0B,
|
||||
IIDX_IO_KEY_P2_6 = 0x0C,
|
||||
IIDX_IO_KEY_P2_7 = 0x0D
|
||||
};
|
||||
|
||||
/* Bit mapping for the P1 and P2 deck lights */
|
||||
|
||||
enum iidx_io_deck_light {
|
||||
IIDX_IO_DECK_LIGHT_P1_1 = 0,
|
||||
IIDX_IO_DECK_LIGHT_P1_2 = 1,
|
||||
IIDX_IO_DECK_LIGHT_P1_3 = 2,
|
||||
IIDX_IO_DECK_LIGHT_P1_4 = 3,
|
||||
IIDX_IO_DECK_LIGHT_P1_5 = 4,
|
||||
IIDX_IO_DECK_LIGHT_P1_6 = 5,
|
||||
IIDX_IO_DECK_LIGHT_P1_7 = 6,
|
||||
|
||||
IIDX_IO_DECK_LIGHT_P2_1 = 8,
|
||||
IIDX_IO_DECK_LIGHT_P2_2 = 9,
|
||||
IIDX_IO_DECK_LIGHT_P2_3 = 10,
|
||||
IIDX_IO_DECK_LIGHT_P2_4 = 11,
|
||||
IIDX_IO_DECK_LIGHT_P2_5 = 12,
|
||||
IIDX_IO_DECK_LIGHT_P2_6 = 13,
|
||||
IIDX_IO_DECK_LIGHT_P2_7 = 14,
|
||||
};
|
||||
|
||||
/* Bit mapping for the front panel lights */
|
||||
|
||||
enum iidx_io_panel_light {
|
||||
IIDX_IO_PANEL_LIGHT_P1_START = 0,
|
||||
IIDX_IO_PANEL_LIGHT_P2_START = 1,
|
||||
IIDX_IO_PANEL_LIGHT_VEFX = 2,
|
||||
IIDX_IO_PANEL_LIGHT_EFFECT = 3,
|
||||
};
|
||||
|
||||
/* Bit mapping for the top lamps from left to right when facing cabinet screen */
|
||||
|
||||
enum iidx_io_top_lamp {
|
||||
IIDX_IO_TOP_LAMP_LEFT_BLUE = 0,
|
||||
IIDX_IO_TOP_LAMP_LEFT_GREEN = 1,
|
||||
IIDX_IO_TOP_LAMP_LEFT_YELLOW = 2,
|
||||
IIDX_IO_TOP_LAMP_LEFT_RED = 3,
|
||||
IIDX_IO_TOP_LAMP_RIGHT_BLUE = 4,
|
||||
IIDX_IO_TOP_LAMP_RIGHT_GREEN = 5,
|
||||
IIDX_IO_TOP_LAMP_RIGHT_YELLOW = 6,
|
||||
IIDX_IO_TOP_LAMP_RIGHT_RED = 7,
|
||||
};
|
||||
|
||||
/* The first function that will be called on your DLL. You will be supplied
|
||||
with four function pointers that may be used to log messages to the game's
|
||||
log file. See comments in glue.h for further information. */
|
||||
|
||||
void iidx_io_set_loggers(
|
||||
log_formatter_t misc,
|
||||
log_formatter_t info,
|
||||
log_formatter_t warning,
|
||||
log_formatter_t fatal);
|
||||
|
||||
/* Initialize your IIDX IO emulation DLL. Thread management functions are
|
||||
provided to you; you must use these functions to create your own threads if
|
||||
you want to make use of the logging functions that are provided to
|
||||
eam_io_set_loggers(). You will also need to pass these thread management
|
||||
functions on to geninput if you intend to make use of that library.
|
||||
|
||||
See glue.h and geninput.h for further details. */
|
||||
|
||||
bool iidx_io_init(
|
||||
thread_create_t thread_create,
|
||||
thread_join_t thread_join,
|
||||
thread_destroy_t thread_destroy);
|
||||
|
||||
/* Shut down your IIDX IO emulation DLL */
|
||||
|
||||
void iidx_io_fini(void);
|
||||
|
||||
/* Set the deck lighting state. See enum iidx_io_deck_light above. */
|
||||
|
||||
void iidx_io_ep1_set_deck_lights(uint16_t deck_lights);
|
||||
|
||||
/* Set front panel lighting state. See enum iidx_io_panel_light above. */
|
||||
|
||||
void iidx_io_ep1_set_panel_lights(uint8_t panel_lights);
|
||||
|
||||
/* Set state of the eight halogens above the marquee. */
|
||||
|
||||
void iidx_io_ep1_set_top_lamps(uint8_t top_lamps);
|
||||
|
||||
/* Switch the top neons on or off. */
|
||||
|
||||
void iidx_io_ep1_set_top_neons(bool top_neons);
|
||||
|
||||
/* Transmit the lighting state to the lighting controller. This function is
|
||||
called immediately after all of the other iidx_io_ep1_set_*() functions.
|
||||
|
||||
Return false in the event of an IO error. This will lock the game into an
|
||||
IO error screen. */
|
||||
|
||||
bool iidx_io_ep1_send(void);
|
||||
|
||||
/* Read input state from the input controller. This function is called
|
||||
immediately before all of the iidx_io_ep2_get_*() functions.
|
||||
|
||||
Return false in the event of an IO error. This will lock the game into an
|
||||
IO error screen. */
|
||||
|
||||
bool iidx_io_ep2_recv(void);
|
||||
|
||||
/* Get absolute turntable position, expressed in 1/256ths of a rotation.
|
||||
player_no is either 0 or 1. */
|
||||
|
||||
uint8_t iidx_io_ep2_get_turntable(uint8_t player_no);
|
||||
|
||||
/* Get slider position, where 0 is the bottom position and 15 is the topmost
|
||||
position. slider_no is a number between 0 (leftmost) and 4 (rightmost). */
|
||||
|
||||
uint8_t iidx_io_ep2_get_slider(uint8_t slider_no);
|
||||
|
||||
/* Get the state of the system buttons. See enums above. */
|
||||
|
||||
uint8_t iidx_io_ep2_get_sys(void);
|
||||
|
||||
/* Get the state of the panel buttons. See enums above. */
|
||||
|
||||
uint8_t iidx_io_ep2_get_panel(void);
|
||||
|
||||
/* Get the state of the 14 key buttons. See enums above. */
|
||||
|
||||
uint16_t iidx_io_ep2_get_keys(void);
|
||||
|
||||
/* Write a nine-character string to the 16-segment display. This happens on a
|
||||
different schedule to all of the other IO operations, so you should initiate
|
||||
the communication as soon as this function is called */
|
||||
|
||||
bool iidx_io_ep3_write_16seg(const char *text);
|
||||
|
||||
#endif
|
|
@ -1,92 +0,0 @@
|
|||
#ifndef BEMANITOOLS_INPUT_H
|
||||
#define BEMANITOOLS_INPUT_H
|
||||
|
||||
/* Generic input API. This header file defines the public API for geninput.dll.
|
||||
|
||||
You may use geninput to supply generic input mapping services for controls
|
||||
that your custom IO DLLs do not natively provide. For instance, you might
|
||||
want to make a custom IIDXIO.DLL that interfaces with your own 16-segment
|
||||
LCD marquee device while still using the stock IIDXIO.DLL input and lighting
|
||||
code, which uses the generic services provided by geninput.dll.
|
||||
|
||||
All other exports from geninput.dll are undocumented and subject to change
|
||||
without notice. */
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "bemanitools/glue.h"
|
||||
|
||||
/* Supply logging functions to geninput. You should pass on the logging
|
||||
functions that are supplied to your own custom DLLs.
|
||||
|
||||
This is the only function that can safely be called before input_init(). */
|
||||
|
||||
void input_set_loggers(
|
||||
log_formatter_t misc,
|
||||
log_formatter_t info,
|
||||
log_formatter_t warning,
|
||||
log_formatter_t fatal);
|
||||
|
||||
/* Initialize the generic input subsystem. You must pass on the thread
|
||||
management functions that have been supplied to your DLL.
|
||||
|
||||
Calling any geninput functions other than input_set_loggers() before calling
|
||||
input_init() will probably crash the running process.
|
||||
|
||||
You will also need to call mapper_config_load() with the appropriate
|
||||
game_type parameter, otherwise you will not receive any input, and any
|
||||
attempts to set a light output level will have no effect. */
|
||||
|
||||
void input_init(
|
||||
thread_create_t thread_create,
|
||||
thread_join_t thread_join,
|
||||
thread_destroy_t thread_destroy);
|
||||
|
||||
/* Shut down the generic input subsystem. After calling this function, no
|
||||
geninput functions other than input_set_loggers() or input_init() may be
|
||||
called. */
|
||||
|
||||
void input_fini(void);
|
||||
|
||||
/* Load input mappings for a particular game, as configured from config.exe.
|
||||
|
||||
Currently recognized game types are:
|
||||
|
||||
ddr: Dance Dance Revolution
|
||||
dm: Drum Mania
|
||||
gf: Guitar Freaks
|
||||
iidx: beatmania IIDX
|
||||
pnm: pop'n music
|
||||
sdvx: Sound Voltex
|
||||
ju: jubeat
|
||||
|
||||
Returns true if a suitable config file was found and successfully loaded. */
|
||||
|
||||
bool mapper_config_load(const char *game_type);
|
||||
|
||||
/* Return the absolute position of an analog spinner, expressed in 1/256ths of
|
||||
a complete rotation. */
|
||||
|
||||
uint8_t mapper_read_analog(uint8_t analog);
|
||||
|
||||
/* Map the current state of all attached input devices to a 64-bit bit field.
|
||||
The exact layout of this bit field varies between game types, although we
|
||||
try to approximate the contents of each emulated IO PCB's own state packet
|
||||
as closely as is reasonably practical. */
|
||||
|
||||
uint64_t mapper_update(void);
|
||||
|
||||
/* Set the intensity of any light on a controller corresponding to a particular
|
||||
software-controlled light on an arcade cabinet, where 0 is off and 255 is
|
||||
full intensity. Consult the header files for the light identifiers used for
|
||||
each game type. The mappings between these light identifiers and the actual
|
||||
lights on the user's controller (if any) are configured by the user by means
|
||||
of the config.exe program.
|
||||
|
||||
Note that any calls to this function do not take effect until the next call
|
||||
to mapper_update(). */
|
||||
|
||||
void mapper_write_light(uint8_t light, uint8_t intensity);
|
||||
|
||||
#endif
|
|
@ -1,119 +0,0 @@
|
|||
#ifndef BEMANITOOLS_JBIO_H
|
||||
#define BEMANITOOLS_JBIO_H
|
||||
|
||||
/* IO emulation provider for jubeat. */
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "bemanitools/glue.h"
|
||||
|
||||
/* input bit mappings. Panels on the controller are
|
||||
panel 1 top left corner down to panel 16 bottom right corner */
|
||||
enum jb_io_panel_bit {
|
||||
JB_IO_PANEL_01 = 0x00,
|
||||
JB_IO_PANEL_02 = 0x01,
|
||||
JB_IO_PANEL_03 = 0x02,
|
||||
JB_IO_PANEL_04 = 0x03,
|
||||
JB_IO_PANEL_05 = 0x04,
|
||||
JB_IO_PANEL_06 = 0x05,
|
||||
JB_IO_PANEL_07 = 0x06,
|
||||
JB_IO_PANEL_08 = 0x07,
|
||||
JB_IO_PANEL_09 = 0x08,
|
||||
JB_IO_PANEL_10 = 0x09,
|
||||
JB_IO_PANEL_11 = 0x0A,
|
||||
JB_IO_PANEL_12 = 0x0B,
|
||||
JB_IO_PANEL_13 = 0x0C,
|
||||
JB_IO_PANEL_14 = 0x0D,
|
||||
JB_IO_PANEL_15 = 0x0E,
|
||||
JB_IO_PANEL_16 = 0x0F,
|
||||
};
|
||||
|
||||
/* input "single button mode" mappings. Allows you to check each corner of each
|
||||
button to determine any flaky inputs
|
||||
*/
|
||||
enum jb_io_panel_mode {
|
||||
JB_IO_PANEL_MODE_ALL = 0, // any of the four corners will trigger a panel
|
||||
JB_IO_PANEL_MODE_TOP_LEFT = 1,
|
||||
JB_IO_PANEL_MODE_TOP_RIGHT = 2,
|
||||
JB_IO_PANEL_MODE_BOTTOM_RIGHT = 3,
|
||||
JB_IO_PANEL_MODE_BOTTOM_LEFT = 4,
|
||||
};
|
||||
|
||||
/* Bit mappings for "system" inputs */
|
||||
enum jb_io_sys_bit {
|
||||
JB_IO_SYS_TEST = 0x00,
|
||||
JB_IO_SYS_SERVICE = 0x01,
|
||||
JB_IO_SYS_COIN = 0x02,
|
||||
};
|
||||
|
||||
/* RGB led units to address */
|
||||
enum jb_io_rgb_led {
|
||||
JB_IO_RGB_LED_FRONT = 0,
|
||||
JB_IO_RGB_LED_TOP = 1,
|
||||
JB_IO_RGB_LED_LEFT = 2,
|
||||
JB_IO_RGB_LED_RIGHT = 3,
|
||||
JB_IO_RGB_LED_TITLE = 4,
|
||||
JB_IO_RGB_LED_WOOFER = 5
|
||||
};
|
||||
|
||||
/* The first function that will be called on your DLL. You will be supplied
|
||||
with four function pointers that may be used to log messages to the game's
|
||||
log file. See comments in glue.h for further information. */
|
||||
|
||||
void jb_io_set_loggers(
|
||||
log_formatter_t misc,
|
||||
log_formatter_t info,
|
||||
log_formatter_t warning,
|
||||
log_formatter_t fatal);
|
||||
|
||||
/* Initialize your JB IO emulation DLL. Thread management functions are
|
||||
provided to you; you must use these functions to create your own threads if
|
||||
you want to make use of the logging functions that are provided to
|
||||
jb_io_set_loggers(). You will also need to pass these thread management
|
||||
functions on to geninput if you intend to make use of that library.
|
||||
|
||||
See glue.h and geninput.h for further details. */
|
||||
|
||||
bool jb_io_init(
|
||||
thread_create_t thread_create,
|
||||
thread_join_t thread_join,
|
||||
thread_destroy_t thread_destroy);
|
||||
|
||||
/* Shut down your JB IO emulation DLL */
|
||||
|
||||
void jb_io_fini(void);
|
||||
|
||||
/* Read input state */
|
||||
|
||||
bool jb_io_read_inputs(void);
|
||||
|
||||
/* Get state of coin, test, service inputs */
|
||||
|
||||
uint8_t jb_io_get_sys_inputs(void);
|
||||
|
||||
/* Get panel button state. Will return either any button being pressed, or a
|
||||
particular panel corner depending on previous call to jb_io_set_panel_mode */
|
||||
|
||||
uint16_t jb_io_get_panel_inputs(void);
|
||||
|
||||
/* Set state of a PWM (dimmable) light */
|
||||
|
||||
void jb_io_set_rgb_led(
|
||||
enum jb_io_rgb_led unit, uint8_t r, uint8_t g, uint8_t b);
|
||||
|
||||
/* Transmit the light state to the IOPCB */
|
||||
|
||||
bool jb_io_write_lights(void);
|
||||
|
||||
/* Select operating mode for the panel. Should be immediately sent to the IOPCB */
|
||||
|
||||
bool jb_io_set_panel_mode(enum jb_io_panel_mode mode);
|
||||
|
||||
/* Open or close the coin chute - true will redirect all coins to the return
|
||||
slot. Required for jb_io_set_panel_mode to operate correctly on p4io.
|
||||
Should be immediately sent to the IOPCB */
|
||||
|
||||
bool jb_io_set_coin_blocker(bool blocked);
|
||||
|
||||
#endif
|
|
@ -1,109 +0,0 @@
|
|||
#ifndef BEMANITOOLS_SDVXIO_H
|
||||
#define BEMANITOOLS_SDVXIO_H
|
||||
|
||||
/* IO emulation provider for SOUND VOLTEX */
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "bemanitools/glue.h"
|
||||
|
||||
enum sdvx_io_in_gpio_sys_bit {
|
||||
SDVX_IO_IN_GPIO_SYS_COIN = 2,
|
||||
SDVX_IO_IN_GPIO_SYS_SERVICE = 4,
|
||||
SDVX_IO_IN_GPIO_SYS_TEST = 5,
|
||||
};
|
||||
|
||||
enum sdvx_io_in_gpio_0_bit {
|
||||
SDVX_IO_IN_GPIO_0_C = 0,
|
||||
SDVX_IO_IN_GPIO_0_B = 1,
|
||||
SDVX_IO_IN_GPIO_0_A = 2,
|
||||
SDVX_IO_IN_GPIO_0_START = 3,
|
||||
SDVX_IO_IN_GPIO_0_RECORDER = 4,
|
||||
SDVX_IO_IN_GPIO_0_HEADPHONE = 5,
|
||||
};
|
||||
|
||||
enum sdvx_io_in_gpio_1_bit {
|
||||
SDVX_IO_IN_GPIO_1_FX_R = 3,
|
||||
SDVX_IO_IN_GPIO_1_FX_L = 4,
|
||||
SDVX_IO_IN_GPIO_1_D = 5,
|
||||
};
|
||||
|
||||
enum sdvx_io_out_gpio_bit {
|
||||
SDVX_IO_OUT_GPIO_D = 0,
|
||||
SDVX_IO_OUT_GPIO_FX_L = 1,
|
||||
SDVX_IO_OUT_GPIO_FX_R = 2,
|
||||
SDVX_IO_OUT_GPIO_START = 12,
|
||||
SDVX_IO_OUT_GPIO_A = 13,
|
||||
SDVX_IO_OUT_GPIO_B = 14,
|
||||
SDVX_IO_OUT_GPIO_C = 15,
|
||||
};
|
||||
|
||||
/* The first function that will be called on your DLL. You will be supplied
|
||||
with four function pointers that may be used to log messages to the game's
|
||||
log file. See comments in glue.h for further information. */
|
||||
|
||||
void sdvx_io_set_loggers(
|
||||
log_formatter_t misc,
|
||||
log_formatter_t info,
|
||||
log_formatter_t warning,
|
||||
log_formatter_t fatal);
|
||||
|
||||
/* Initialize your SDVX IO emulation DLL. Thread management functions are
|
||||
provided to you; you must use these functions to create your own threads if
|
||||
you want to make use of the logging functions that are provided to
|
||||
eam_io_set_loggers(). You will also need to pass these thread management
|
||||
functions on to geninput if you intend to make use of that library.
|
||||
|
||||
See glue.h and geninput.h for further details. */
|
||||
|
||||
bool sdvx_io_init(
|
||||
thread_create_t thread_create,
|
||||
thread_join_t thread_join,
|
||||
thread_destroy_t thread_destroy);
|
||||
|
||||
/* Shut down your SDVX IO emulation DLL */
|
||||
|
||||
void sdvx_io_fini(void);
|
||||
|
||||
/* Set state of the GPIO (on/off) lights (see bit definitions above) */
|
||||
|
||||
void sdvx_io_set_gpio_lights(uint32_t gpio_lights);
|
||||
|
||||
/* Set state of a PWM (dimmable) light channel. These come in groups of three
|
||||
(red, green, blue). There are a six group of three PWM channels, for a
|
||||
total of 18 channels (0 through 17). */
|
||||
|
||||
void sdvx_io_set_pwm_light(uint8_t light_no, uint8_t intensity);
|
||||
|
||||
/* Transmit the light state to the IOPCB */
|
||||
|
||||
bool sdvx_io_write_output(void);
|
||||
|
||||
/* Read input state */
|
||||
|
||||
bool sdvx_io_read_input(void);
|
||||
|
||||
/* Get state of coin, test, service inputs */
|
||||
|
||||
uint8_t sdvx_io_get_input_gpio_sys(void);
|
||||
|
||||
/* Get gameplay button state. Parameter selects GPIO bank 0 or 1. See bit
|
||||
definitions above for details. */
|
||||
|
||||
uint16_t sdvx_io_get_input_gpio(uint8_t gpio_bank);
|
||||
|
||||
/* Get a 10-bit (!) spinner position, where spinner_no is 0 or 1.
|
||||
High six bits are ignored. */
|
||||
|
||||
uint16_t sdvx_io_get_spinner_pos(uint8_t spinner_no);
|
||||
|
||||
/* Sets the volume of the digital amps if possible.
|
||||
Range is between 0-96, where 0 is MAX and 96 is LOW. */
|
||||
|
||||
bool sdvx_io_set_amp_volume(
|
||||
uint8_t primary,
|
||||
uint8_t headphone,
|
||||
uint8_t subwoofer);
|
||||
|
||||
#endif
|
|
@ -1,61 +0,0 @@
|
|||
#ifndef BEMANITOOLS_VEFXIO_H
|
||||
#define BEMANITOOLS_VEFXIO_H
|
||||
|
||||
/* IO emulation provider for beatmania IIDX Effector Panel. */
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "bemanitools/glue.h"
|
||||
|
||||
/* The first function that will be called on your DLL. You will be supplied
|
||||
with four function pointers that may be used to log messages to the game's
|
||||
log file. See comments in glue.h for further information. */
|
||||
|
||||
void vefx_io_set_loggers(
|
||||
log_formatter_t misc,
|
||||
log_formatter_t info,
|
||||
log_formatter_t warning,
|
||||
log_formatter_t fatal);
|
||||
|
||||
/* Initialize your IIDX IO emulation DLL. Thread management functions are
|
||||
provided to you; you must use these functions to create your own threads if
|
||||
you want to make use of the logging functions that are provided to
|
||||
eam_io_set_loggers(). You will also need to pass these thread management
|
||||
functions on to geninput if you intend to make use of that library.
|
||||
|
||||
See glue.h and geninput.h for further details. */
|
||||
|
||||
bool vefx_io_init(
|
||||
thread_create_t thread_create,
|
||||
thread_join_t thread_join,
|
||||
thread_destroy_t thread_destroy);
|
||||
|
||||
/* Shut down your IIDX IO emulation DLL */
|
||||
|
||||
void vefx_io_fini(void);
|
||||
|
||||
/* Read input state from the input controller. This function is called
|
||||
immediately before the vefx_io_get_slider() function.
|
||||
|
||||
Return false in the event of an IO error. This will lock the game into an
|
||||
IO error screen.
|
||||
|
||||
If making a custom driver, ppad can be used to update regular IO if needed
|
||||
|
||||
See iidxio.c for mappings. */
|
||||
|
||||
bool vefx_io_recv(uint64_t *ppad);
|
||||
|
||||
/* Get slider position, where 0 is the bottom position and 15 is the topmost
|
||||
position. slider_no is a number between 0 (leftmost) and 4 (rightmost). */
|
||||
|
||||
uint8_t vefx_io_get_slider(uint8_t slider_no);
|
||||
|
||||
/* Write a nine-character string to the 16-segment display. This happens on a
|
||||
different schedule to all of the other IO operations, so you should initiate
|
||||
the communication as soon as this function is called */
|
||||
|
||||
bool vefx_io_write_16seg(const char *text);
|
||||
|
||||
#endif
|
|
@ -1,68 +0,0 @@
|
|||
/* PCSX2 - PS2 Emulator for PCs
|
||||
* Copyright (C) 2002-2020 PCSX2 Dev Team
|
||||
*
|
||||
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU Lesser General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with PCSX2.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Used OBS as example
|
||||
|
||||
#include "PrecompiledHeader.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <vector>
|
||||
#include <ghc/filesystem.h>
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/collpane.h>
|
||||
#include <wx/filepicker.h>
|
||||
#include <wx/slider.h>
|
||||
#include <wx/spinctrl.h>
|
||||
#include <wx/gbsizer.h>
|
||||
|
||||
#include "gui/AppCoreThread.h"
|
||||
|
||||
#include "gui/AppConfig.h"
|
||||
|
||||
#include "usb-python2-passthrough.h"
|
||||
|
||||
namespace usb_python2
|
||||
{
|
||||
namespace btools
|
||||
{
|
||||
|
||||
void ConfigurePython2Passthrough(Python2DlgConfig &config)
|
||||
{
|
||||
ScopedCoreThreadPause paused_core;
|
||||
|
||||
TSTDSTRING selectedDevice;
|
||||
LoadSetting(Python2Device::TypeName(), config.port, "python2", N_DEVICE, selectedDevice);
|
||||
|
||||
Python2PassthroughConfigDialog dialog(config.devList);
|
||||
dialog.Load(config, selectedDevice);
|
||||
|
||||
if (dialog.ShowModal() == wxID_OK)
|
||||
{
|
||||
auto selectedIdx = dialog.GetSelectedGame();
|
||||
|
||||
#ifdef _WIN32
|
||||
TSTDSTRING selectedGameEntry = config.devListGroups[selectedIdx].ToStdWstring();
|
||||
#else
|
||||
TSTDSTRING selectedGameEntry = config.devListGroups[selectedIdx].ToStdString();
|
||||
#endif
|
||||
SaveSetting<TSTDSTRING>(Python2Device::TypeName(), config.port, "python2", N_DEVICE, selectedGameEntry);
|
||||
}
|
||||
|
||||
paused_core.AllowResume();
|
||||
}
|
||||
} // namespace passthrough
|
||||
} // namespace usb_python2
|
|
@ -75,15 +75,21 @@ namespace usb_python2
|
|||
BToolsInput* dev = static_cast<BToolsInput*>(ptr);
|
||||
dev->isInterruptReaderThreadRunning = true;
|
||||
|
||||
while (true)
|
||||
if (dev->m_ddr_io_read_pad)
|
||||
{
|
||||
//BTools API claims that this method will sleep/prevent banging.
|
||||
//so we can safely loop around it.
|
||||
if (dev->m_ddr_io_read_pad)
|
||||
Console.WriteLn("Btools polling thread start");
|
||||
|
||||
while (true)
|
||||
{
|
||||
//BTools API claims that this method will sleep/prevent banging.
|
||||
//so we can safely loop around it.
|
||||
dev->ddrioState = dev->m_ddr_io_read_pad();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Error("Btools Thread: Could not find m_ddr_io_read_pad");
|
||||
}
|
||||
|
||||
dev->isInterruptReaderThreadRunning = false;
|
||||
}
|
||||
|
@ -95,6 +101,15 @@ namespace usb_python2
|
|||
if (hDDRIO != nullptr)
|
||||
{
|
||||
m_ddr_io_read_pad = (ddr_io_read_pad_type*)GetProcAddress(hDDRIO, "ddr_io_read_pad");
|
||||
|
||||
if (!isInterruptReaderThreadRunning)
|
||||
{
|
||||
if (interruptThread.joinable())
|
||||
interruptThread.join();
|
||||
interruptThread = std::thread(BToolsInput::InterruptReaderThread, this);
|
||||
}
|
||||
|
||||
Console.WriteLn("BToolsInput start");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -103,15 +118,6 @@ namespace usb_python2
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (!isInterruptReaderThreadRunning)
|
||||
{
|
||||
if (interruptThread.joinable())
|
||||
interruptThread.join();
|
||||
interruptThread = std::thread(BToolsInput::InterruptReaderThread, this);
|
||||
}
|
||||
|
||||
Console.Error("BToolsInput start");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -164,11 +170,5 @@ namespace usb_python2
|
|||
return false;
|
||||
}
|
||||
|
||||
bool BToolsInput::set_p3io_lights(uint8_t stateFromGame)
|
||||
{
|
||||
Console.WriteLn("method! %d", stateFromGame);
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace passthrough
|
||||
} // namespace usb_python2
|
||||
|
|
|
@ -44,12 +44,13 @@ namespace usb_python2
|
|||
#ifdef INCLUDE_BTOOLS
|
||||
HINSTANCE hDDRIO = LoadLibraryA("ddrio.dll");
|
||||
m_ddr_io_set_lights_extio = (ddr_io_set_lights_extio_type*)GetProcAddress(hDDRIO, "ddr_io_set_lights_extio");
|
||||
|
||||
//try to the use function and turn the lights off.
|
||||
if (m_ddr_io_set_lights_extio)
|
||||
m_ddr_io_set_lights_extio(0);
|
||||
|
||||
//if the function was found with the library successfully loaded, begin to use it.
|
||||
isUsingBtoolLights = m_ddr_io_set_lights_extio;
|
||||
|
||||
//turn the lights off during boot.
|
||||
if (isUsingBtoolLights)
|
||||
m_ddr_io_set_lights_extio(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -139,7 +140,7 @@ namespace usb_python2
|
|||
|
||||
extioState |= (neonLights & EXTIO_LIGHT_NEON) ? (1 << LIGHT_NEONS) : 0;
|
||||
|
||||
if (extioState != oldExtioState && m_ddr_io_set_lights_extio)
|
||||
if (extioState != oldExtioState)
|
||||
{
|
||||
m_ddr_io_set_lights_extio(extioState);
|
||||
}
|
||||
|
|
|
@ -401,7 +401,7 @@ namespace usb_python2
|
|||
|
||||
m_ddr_io_fini = (ddr_io_fini_type*)GetProcAddress(hDDRIO, "ddr_io_fini");
|
||||
|
||||
s->isUsingBtoolLights = m_ddr_io_set_loggers && m_ddr_io_init && m_ddr_io_fini;
|
||||
s->isUsingBtoolLights = m_ddr_io_set_loggers && m_ddr_io_init && m_ddr_io_set_lights_p3io && m_ddr_io_fini;
|
||||
|
||||
if (s->isUsingBtoolLights)
|
||||
{
|
||||
|
@ -647,10 +647,8 @@ namespace usb_python2
|
|||
curLightCabinet |= (((s->buf[5] & 0xf3) | 0xf2) == 0xf2) ? 1 << LIGHT_P1_MENU : 0;
|
||||
curLightCabinet |= (((s->buf[5] & 0xf3) | 0xf1) == 0xf1) ? 1 << LIGHT_P2_MENU : 0;
|
||||
|
||||
if (curLightCabinet != s->f.oldLightCabinet && m_ddr_io_set_lights_p3io)
|
||||
if (curLightCabinet != s->f.oldLightCabinet)
|
||||
m_ddr_io_set_lights_p3io(curLightCabinet);
|
||||
|
||||
//((usb_python2::btools::BToolsInput*)(s->p2dev))->set_p3io_lights(curLightCabinet);
|
||||
}
|
||||
|
||||
s->f.oldLightCabinet = curLightCabinet;
|
||||
|
|
Loading…
Reference in New Issue