Add bi2a-iidx support for aciotest
This commit is contained in:
@@ -11,5 +11,6 @@ src_aciotest := \
|
||||
kfca.c \
|
||||
panb.c \
|
||||
rvol.c \
|
||||
bi2a-iidx.c \
|
||||
bi2a-sdvx.c \
|
||||
main.c \
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
#include "aciotest/bi2a-iidx.h"
|
||||
|
||||
#include "acio/acio.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bio2drv/bi2a-iidx.h"
|
||||
|
||||
bool aciotest_bi2a_iidx_handler_init(
|
||||
struct aciodrv_device_ctx *device, uint8_t node_id, void **ctx)
|
||||
{
|
||||
*ctx = malloc(sizeof(uint32_t));
|
||||
*((uint32_t *) *ctx) = 0;
|
||||
|
||||
return bio2drv_bi2a_iidx_init(device, node_id);
|
||||
}
|
||||
|
||||
bool aciotest_bi2a_iidx_handler_update(
|
||||
struct aciodrv_device_ctx *device, uint8_t node_id, void *ctx)
|
||||
{
|
||||
struct bi2a_iidx_state_in pin;
|
||||
struct bi2a_iidx_state_out pout;
|
||||
|
||||
memset(&pout, 0, sizeof(pout));
|
||||
|
||||
if (!bio2drv_bi2a_iidx_poll(device, node_id, &pout, &pin)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
printf(
|
||||
"|---------------------------------------|\n"
|
||||
"| R Y G B Neons B G Y R |\n"
|
||||
"| %d %d %d %d %d %d %d %d %d |\n"
|
||||
"|---------------------------------------|\n"
|
||||
"| NOW PLAYING: %c%c%c%c%c%c%c%c%c |\n"
|
||||
"|---------------------------------------|\n"
|
||||
"| Effect %d S1 S2 S3 S4 S5 Test %d|\n"
|
||||
"|StartP1 %d %02d %02d %02d %02d %02d StartP2 %d|\n"
|
||||
"| VEFX %d Service %d|\n"
|
||||
"_________________________________________\n"
|
||||
"| __ __ |\n"
|
||||
"| / \\ _ / \\ |\n"
|
||||
"| | %03d| %d %d %d |%d| %d %d %d | %03d| |\n"
|
||||
"| \\___/ %d %d %d %d |_| %d %d %d %d \\___/ |\n"
|
||||
"| |\n"
|
||||
"|---------------------------------------|\n"
|
||||
"|---------------------------------------|\n",
|
||||
|
||||
pout.SPOTLIGHT2[0].l_state,
|
||||
pout.SPOTLIGHT2[1].l_state,
|
||||
pout.SPOTLIGHT2[2].l_state,
|
||||
pout.SPOTLIGHT2[3].l_state,
|
||||
pout.NEONLAMP.l_state,
|
||||
pout.SPOTLIGHT1[0].l_state,
|
||||
pout.SPOTLIGHT1[1].l_state,
|
||||
pout.SPOTLIGHT1[2].l_state,
|
||||
pout.SPOTLIGHT1[3].l_state,
|
||||
|
||||
pout.SEG16[0],
|
||||
pout.SEG16[1],
|
||||
pout.SEG16[2],
|
||||
pout.SEG16[3],
|
||||
pout.SEG16[4],
|
||||
pout.SEG16[5],
|
||||
pout.SEG16[6],
|
||||
pout.SEG16[7],
|
||||
pout.SEG16[8],
|
||||
|
||||
pin.PANEL.y_effect,
|
||||
pin.SYSTEM.v_test,
|
||||
|
||||
pin.PANEL.y_start1,
|
||||
pin.SLIDER1.s_val,
|
||||
pin.SLIDER2.s_val,
|
||||
pin.SLIDER3.s_val,
|
||||
pin.SLIDER4.s_val,
|
||||
pin.SLIDER5.s_val,
|
||||
pin.PANEL.y_start2,
|
||||
|
||||
pin.PANEL.y_vefx,
|
||||
pin.SYSTEM.v_service,
|
||||
|
||||
pin.TURNTABLE1,
|
||||
pin.P1SW2.b_val,
|
||||
pin.P1SW4.b_val,
|
||||
pin.P1SW6.b_val,
|
||||
pin.SYSTEM.v_coin,
|
||||
pin.P2SW2.b_val,
|
||||
pin.P2SW4.b_val,
|
||||
pin.P2SW6.b_val,
|
||||
pin.TURNTABLE2,
|
||||
|
||||
pin.P1SW1.b_val,
|
||||
pin.P1SW3.b_val,
|
||||
pin.P1SW5.b_val,
|
||||
pin.P1SW7.b_val,
|
||||
pin.P2SW1.b_val,
|
||||
pin.P2SW3.b_val,
|
||||
pin.P2SW5.b_val,
|
||||
pin.P2SW7.b_val
|
||||
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef ACIOTEST_BI2A_IIDX_H
|
||||
#define ACIOTEST_BI2A_IIDX_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "aciodrv/device.h"
|
||||
|
||||
bool aciotest_bi2a_iidx_handler_init(
|
||||
struct aciodrv_device_ctx *device, uint8_t node_id, void **ctx);
|
||||
bool aciotest_bi2a_iidx_handler_update(
|
||||
struct aciodrv_device_ctx *device, uint8_t node_id, void *ctx);
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <windows.h>
|
||||
@@ -7,6 +8,7 @@
|
||||
#include "aciodrv/device.h"
|
||||
|
||||
#include "aciotest/bi2a-sdvx.h"
|
||||
#include "aciotest/bi2a-iidx.h"
|
||||
#include "aciotest/handler.h"
|
||||
#include "aciotest/icca.h"
|
||||
#include "aciotest/kfca.h"
|
||||
@@ -16,7 +18,7 @@
|
||||
#include "util/log.h"
|
||||
|
||||
static uint8_t aciotest_cnt = 0;
|
||||
static uint8_t bi2a_mode = 0;
|
||||
static uint8_t bi2a_mode = -1;
|
||||
|
||||
/**
|
||||
* Enumerate supported ACIO nodes based on their product id.
|
||||
@@ -53,11 +55,15 @@ static bool aciotest_assign_handler(
|
||||
}
|
||||
|
||||
if (product_type == AC_IO_NODE_TYPE_BI2A) {
|
||||
printf("Please assign bi2a mode, 0 for SDVX and 1 for IIDX, then press ENTER:");
|
||||
scanf("%hhd",&bi2a_mode);
|
||||
if (bi2a_mode == 0) {
|
||||
handler->init = aciotest_bi2a_sdvx_handler_init;
|
||||
handler->update = aciotest_bi2a_sdvx_handler_update;
|
||||
|
||||
return true;
|
||||
} else if (bi2a_mode == 1) {
|
||||
handler->init = aciotest_bi2a_iidx_handler_init;
|
||||
handler->update = aciotest_bi2a_iidx_handler_update;
|
||||
} else {
|
||||
printf("Unknown BI2A device specified");
|
||||
}
|
||||
@@ -93,7 +99,8 @@ int main(int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Opening acio device successful\n");
|
||||
printf("Opening acio device successful, press ENTER to continue\n");
|
||||
getchar();
|
||||
|
||||
uint8_t node_count = aciodrv_device_get_node_count(device);
|
||||
printf("Enumerated %d nodes\n", node_count);
|
||||
|
||||
Reference in New Issue
Block a user