C-buttons on standard mapping (R2+face buttons) do not work

Open Beginner friendly
#855 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c
Domain
game-dev

Research direction

Start with the declarations and use of r_cbutton in libretro/libretro.c and mupen64plus-core/src/plugin/emulate_game_controller_via_libretro.c, then compare how Mupen64Plus initializes the corresponding values from core options in the linked libretro.c location. Check the standard mapping path and verify that all four C-button variables are initialized consistently; done when standard mapping no longer uses uninitialized values.

Written by the indexing model from the issue text.

Description

Root cause seems to be the respective variables in the code not being initialized.

This is only for standard mapping (i.e., does not seem to apply to independent C-buttons mapping). Taking the right C-button as an example:

parallel-n64$ git rev-parse @
e0ef5d673257e2e83bf9b7cffe62eda141af8493

parallel-n64$ git grep "r_cbutton"
libretro/libretro.c:int r_cbutton, l_cbutton, d_cbutton, u_cbutton;
mupen64plus-core/src/plugin/emulate_game_controller_via_libretro.c:extern int r_cbutton;
mupen64plus-core/src/plugin/emulate_game_controller_via_libretro.c:         Keys->R_CBUTTON = !!((ret & (1 << r_cbutton)));
tools/test_mouse_accum.c:int r_cbutton, l_cbutton, d_cbutton, u_cbutton;

Mupen64Plus initializes the same values from core options:

Core options definitions: https://github.com/libretro/mupen64plus-libretro-nx/blob/15bada85906593376e8fd697f1b0b3af3a20f512/libretro/libretro_core_options.h#L1586
Initialization in libretro.c: https://github.com/libretro/mupen64plus-libretro-nx/blob/15bada85906593376e8fd697f1b0b3af3a20f512/libretro/libretro.c#L850

Dominant language
C
Stars
414
Forks
155
Avg merge
1d 8h
Merged PRs (30d)
4

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libretro/parallel-n64

All issues in libretro/parallel-n64

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.