Tweak JVS coin count APIs

This makes things more consistent with the button/analog APIs.
This commit is contained in:
Tau
2019-08-03 17:41:39 -04:00
parent 40ba10e29a
commit 9ea6e09fdc
11 changed files with 53 additions and 25 deletions

View File

@ -47,8 +47,12 @@ void diva_io_jvs_poll(uint8_t *opbtn_out, uint8_t *gamebtn_out)
*gamebtn_out = gamebtn;
}
uint16_t diva_io_jvs_read_coin_counter(void)
void diva_io_jvs_read_coin_counter(uint16_t *out)
{
if (out == NULL) {
return;
}
if (GetAsyncKeyState('3')) {
if (!diva_io_coin) {
diva_io_coin = true;
@ -58,7 +62,7 @@ uint16_t diva_io_jvs_read_coin_counter(void)
diva_io_coin = false;
}
return diva_io_coins;
*out = diva_io_coins;
}
void diva_io_jvs_set_coin_blocker(bool open)

View File

@ -30,7 +30,7 @@ void diva_io_jvs_poll(uint8_t *opbtn, uint8_t *gamebtn);
for every coin detected by the coin acceptor mechanism. This count does not
need to persist beyond the lifetime of the process. */
uint16_t diva_io_jvs_read_coin_counter(void);
void diva_io_jvs_read_coin_counter(uint16_t *out);
/* Set the state of the coin blocker. Parameter is true if the blocker is
disengaged (i.e. coins can be inserted) and false if the blocker is engaged