Bemanitools v5.26 release

This commit is contained in:
icex2
2019-09-27 22:36:50 +02:00
commit cbd7720349
718 changed files with 62731 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
#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
+84
View File
@@ -0,0 +1,84 @@
#ifndef BEMANITOOLS_DDRIO_H
#define BEMANITOOLS_DDRIO_H
#include <stdbool.h>
#include <stdint.h>
#include "bemanitools/glue.h"
enum ddr_pad_bit {
DDR_TEST = 0x04,
DDR_COIN = 0x05,
DDR_SERVICE = 0x06,
DDR_P2_START = 0x08,
DDR_P2_UP = 0x09,
DDR_P2_DOWN = 0x0A,
DDR_P2_LEFT = 0x0B,
DDR_P2_RIGHT = 0x0C,
DDR_P2_MENU_LEFT = 0x0E,
DDR_P2_MENU_RIGHT = 0x0F,
DDR_P2_MENU_UP = 0x02,
DDR_P2_MENU_DOWN = 0x03,
DDR_P1_START = 0x10,
DDR_P1_UP = 0x11,
DDR_P1_DOWN = 0x12,
DDR_P1_LEFT = 0x13,
DDR_P1_RIGHT = 0x14,
DDR_P1_MENU_LEFT = 0x16,
DDR_P1_MENU_RIGHT = 0x17,
DDR_P1_MENU_UP = 0x00,
DDR_P1_MENU_DOWN = 0x01,
};
/* p3io controls menu btn and marquee lights
extio controls neons and stage lights. */
enum p3io_light_bit {
LIGHT_P1_MENU = 0x00,
LIGHT_P2_MENU = 0x01,
LIGHT_P2_LOWER_LAMP = 0x04,
LIGHT_P2_UPPER_LAMP = 0x05,
LIGHT_P1_LOWER_LAMP = 0x06,
LIGHT_P1_UPPER_LAMP = 0x07
};
enum extio_light_bit {
LIGHT_NEONS = 0x0E,
LIGHT_P2_RIGHT = 0x13,
LIGHT_P2_LEFT = 0x14,
LIGHT_P2_DOWN = 0x15,
LIGHT_P2_UP = 0x16,
LIGHT_P1_RIGHT = 0x1B,
LIGHT_P1_LEFT = 0x1C,
LIGHT_P1_DOWN = 0x1D,
LIGHT_P1_UP = 0x1E
};
/* 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 ddr_io_set_loggers(log_formatter_t misc, log_formatter_t info,
log_formatter_t warning, log_formatter_t fatal);
/* Initialize your DDR 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 ddr_io_init(thread_create_t thread_create, thread_join_t thread_join,
thread_destroy_t thread_destroy);
uint32_t ddr_io_read_pad(void);
void ddr_io_set_lights_extio(uint32_t extio_lights);
void ddr_io_set_lights_p3io(uint32_t p3io_lights);
void ddr_io_fini(void);
#endif
+132
View File
@@ -0,0 +1,132 @@
#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
+47
View File
@@ -0,0 +1,47 @@
#ifndef BEMANITOOLS_GLUE_H
#define BEMANITOOLS_GLUE_H
/* Common definitions for integration bindings */
#include <stdint.h>
#ifdef __GNUC__
/* Bemanitools is compiled with GCC (MinGW, specifically) as of version 5 */
#define LOG_CHECK_FMT __attribute__(( format(printf, 2, 3) ))
#else
/* Compile it out for MSVC plebs */
#define LOG_CHECK_FMT
#endif
/* An AVS-style logger function. Comes in four flavors: misc, info, warning,
and fatal, with increasing severity. Fatal loggers do not return, they
abort the running process after writing their message to the log.
"module" is an arbitrary short string identifying the source of the log
message. The name of the calling DLL is a good default choice for this
string, although you might want to identify a module within your DLL here
instead.
"fmt" is a printf-style format string. Depending on the context in which
your DLL is running you might end up calling a logger function exported
from libavs, which has its own printf implementation (including a number of
proprietary extensions), so don't use any overly exotic formats. */
typedef void (*log_formatter_t)(const char *module, const char *fmt, ...)
LOG_CHECK_FMT;
/* An API for spawning threads. This API is defined by libavs, although
Bemanitools itself may supply compatible implementations of these functions
to your DLL, depending on the context in which it runs.
NOTE: You may only use the logging functions from a thread where Bemanitools
calls you, or a thread that you create using this API. Failure to observe
this restriction will cause the process to crash. This is a limitation of
libavs itself, not Bemanitools. */
typedef int (*thread_create_t)(int (*proc)(void *), void *ctx,
uint32_t stack_sz, unsigned int priority);
typedef void (*thread_join_t)(int thread_id, int *result);
typedef void (*thread_destroy_t)(int thread_id);
#endif
+155
View File
@@ -0,0 +1,155 @@
#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,
};
/* 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
+87
View File
@@ -0,0 +1,87 @@
#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
+83
View File
@@ -0,0 +1,83 @@
#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,
};
/* 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);
/* TODO doc */
bool jb_io_read_inputs(void);
bool jb_io_write_outputs(void);
uint8_t jb_io_get_sys_inputs(void);
uint16_t jb_io_get_panel_inputs(void);
void jb_io_set_rgb_led(enum jb_io_rgb_led unit, uint8_t r, uint8_t g, uint8_t b);
#endif
+95
View File
@@ -0,0 +1,95 @@
#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_TEST = 4,
SDVX_IO_IN_GPIO_SYS_SERVICE = 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_HEADPHONE = 4,
};
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);
#endif
+56
View File
@@ -0,0 +1,56 @@
#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