KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
Coin Control

JVS coin slot meter access and commands More...

Functions

uint16_t mie_get_coin_meter (uint8_t slot)
 Read cached coin slot meter.
 
bool mie_read_coin_input (mie_jvs_coin_slot_t *out, int max_slots)
 Copy cached coin slot state from the last poll.
 
bool mie_coin_decrease (uint8_t slot, uint16_t amount, bool block)
 Send JVS COINDEC (0x30) for a coin slot.
 
bool mie_coin_add (uint8_t slot, uint16_t amount, bool block)
 Send JVS COINADD (0x35) for a coin slot.
 

Detailed Description

JVS coin slot meter access and commands

Function Documentation

◆ mie_coin_add()

bool mie_coin_add ( uint8_t slot,
uint16_t amount,
bool block )

Send JVS COINADD (0x35) for a coin slot.

Adds credits to the specified coin slot meter on the JVS board.

Parameters
slotCoin slot index (0 = first slot).
amountCredits to add.
blocktrue to wait for completion; false to queue only.
Return values
trueCommand completed or queued successfully.
falseInvalid arguments, JVS not initialized, busy, or I/O failed.

Referenced by mie_service_cb().

◆ mie_coin_decrease()

bool mie_coin_decrease ( uint8_t slot,
uint16_t amount,
bool block )

Send JVS COINDEC (0x30) for a coin slot.

Subtracts credits from the specified coin slot meter on the JVS board.

Parameters
slotCoin slot index (0 = first slot).
amountCredits to subtract.
blocktrue to wait for completion; false to queue only.
Return values
trueCommand completed or queued successfully.
falseInvalid arguments, JVS not initialized, busy, or I/O failed.

◆ mie_get_coin_meter()

uint16_t mie_get_coin_meter ( uint8_t slot)

Read cached coin slot meter.

Returns the parsed cumulative count for the given coin slot from the latest driver poll. Does not perform a synchronous bus transaction.

Parameters
slotCoin slot index (0 = first slot).
Returns
Coin meter count, or 0 for an invalid slot.
See also
mie_read_coin_input, mie_jvs_coin_slot_t

Referenced by ui_build().

◆ mie_read_coin_input()

bool mie_read_coin_input ( mie_jvs_coin_slot_t * out,
int max_slots )

Copy cached coin slot state from the last poll.

Copies the parsed per-slot data already obtained by the periodic input poll. Does not send a standalone JVS COININP (0x21) command.

Parameters
outPer-slot parsed data (up to MIE_JVS_COIN_SLOTS).
max_slotsNumber of coin slots to copy (1 or 2).
Return values
trueArguments valid and JVS initialized.
falseInvalid arguments or JVS not initialized.
See also
mie_get_coin_meter, mie_jvs_coin_slot_t, mie_jvs_inputs_t::coin_fault