Fix the input zone drawing in input settings #1888
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
gc stick input zone
this is the correct input zone assuming https://github.com/mirror/libogc/blob/master/libogc/pad.c /PAD_Clamp is correct. everything outside it is clamped down to the input zone
for the main stick __pad_clampstick remove 15 (dead zone) and clamp everything above 72, 40 (maximum, diagonal). these irregular dodecagon vertex coordinates (x, y) are therefore the minimum stick values (x, y) that still output the maximum clamped ones (in brackets). all higher values are clamped down to the values in the brackets
the input zone is therefore 72+15, 40+15
the c-stick clamp values are 59, 31 and the input zone is therefore 59+15, 31+15
this is tested in https://github.com/john-peterson/dolphin-test/blob/master/pad.cpp /test_area by writing all clamped stick coordinates (red), the clamped value (blue), and the maximum radius circle (green):
it's also tested in Source/TestSuite/PAD in https://github.com/mirror/dolphin-emu/pull/31/files
wii stick has no clamping
the nunchuk and classic controller stick input zone should be an octagon that fill the input square because it has no clamping beyond its octagonal shape that confine the stick
this is tested for the nunchuk stick (wd->exp.nunchuk.js.pos.x, wd->exp.nunchuk.js.pos.y) in Source/TestSuite/WPAD/source/dolphintest_wpad.cpp in https://github.com/mirror/dolphin-emu/pull/31/files that use https://github.com/mirror/libogc/blob/master/gc/wiiuse/wiiuse.h
optimal gc stick radius setting
the optimal gc stick radius (that fill the input zone) is therefore around
where 1.1 is a margin to ensure that all angles can reach the input zone edge