Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wren TIC.btn fixes #1368

Merged
merged 2 commits into from
Mar 5, 2021
Merged

Wren TIC.btn fixes #1368

merged 2 commits into from
Mar 5, 2021

Conversation

txgruppi
Copy link
Contributor

@txgruppi txgruppi commented Mar 4, 2021

The fixes

Two fixes for the Wren's API

  1. TIC.btn() was not defined in Wren and had the wrong return value
  2. TIC.btn(_) was mixing controllers 1 & 3, 2 & 4

TIC.btn()

Fixed 2 problems:

  1. The handler wren_btn was checking for this call but it was not declared as part of the TIC class and it was not defined in foreignTicMethods
  2. The handler wren_btn was setting the return value to bool instead of double

TIC.btn(_)

The button index bitmask was 0xf instead of 0x1f, this made tat gamepad 3 returned value for gamepad 1 and gamepad 4 returned value for gamepad 2.

Updated bitmask from 0xf to 0x1f to support 3rd and 4th gamepads
@txgruppi txgruppi changed the title Wren tic btn fixes Wren TIC.btn fixes Mar 4, 2021
Copy link
Owner

@nesbox nesbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
Thank you.

@nesbox nesbox merged commit ddf3c07 into nesbox:master Mar 5, 2021
@txgruppi txgruppi deleted the wren-tic-btn-fixes branch March 5, 2021 14:23
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.

2 participants