This commit is contained in:
beerpsi 2023-12-26 12:36:44 +07:00
parent 4c06e76982
commit de021005fb

View File

@ -180,7 +180,7 @@ pub extern "C" fn chuni_io_jvs_read_coin_counter(total: *mut u16) {
let coin_pressed = (input[1] & 4) != 0;
if coin_pressed || unsafe { GetAsyncKeyState(CONFIGURATION.coin_key as c_int) } != 0 {
let coin_previously_pressed = COIN_PRESSED.fetch_or(true, Ordering::Relaxed);
let coin_previously_pressed = COIN_PRESSED.fetch_xor(true, Ordering::Relaxed);
if !coin_previously_pressed {
COIN_COUNT.fetch_add(1, Ordering::Relaxed);
}