Skip to content

Fix Galaga fire edge detection and menu return#81

Open
sisraelson-home wants to merge 1 commit into
harbaum:mainfrom
sisraelson-home:fix/button-input
Open

Fix Galaga fire edge detection and menu return#81
sisraelson-home wants to merge 1 commit into
harbaum:mainfrom
sisraelson-home:fix/button-input

Conversation

@sisraelson-home

Copy link
Copy Markdown
Contributor

Galaga: the Namco 06xx 3-byte polling cycle read buttons and updated prev_mask on every byte, so fire/coin/start edges were frequently consumed on byte 0 (credit byte) before the byte that encodes them. Sample buttons once at namco_cnt==0 and latch the fire edge for the whole cycle so byte 1 always reports it reliably.

buttons_get: the BUTTON_EXTRA detection was wrapped in nested #ifndef/#ifdef BTN_COIN_PIN, making the inner branch dead code and leaving BUTTON_EXTRA unset whenever BTN_COIN_PIN was defined. Restored the intended behavior (coin pin when present, start pin otherwise) and raised the hold threshold to 3 seconds to avoid accidental resets.

Galaga: the Namco 06xx 3-byte polling cycle read buttons and updated
prev_mask on every byte, so fire/coin/start edges were frequently
consumed on byte 0 (credit byte) before the byte that encodes them.
Sample buttons once at namco_cnt==0 and latch the fire edge for the
whole cycle so byte 1 always reports it reliably.

buttons_get: the BUTTON_EXTRA detection was wrapped in nested
#ifndef/#ifdef BTN_COIN_PIN, making the inner branch dead code and
leaving BUTTON_EXTRA unset whenever BTN_COIN_PIN was defined. Restored
the intended behavior (coin pin when present, start pin otherwise) and
raised the hold threshold to 3 seconds to avoid accidental resets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant