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

Fix the input zone drawing in input settings #1888

Merged
merged 1 commit into from Jan 19, 2015

Conversation

john-peterson
Copy link
Contributor

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

0, -15[ 0]   87[ 72]
1,  15[ 0]   87[ 72]
2,  55[ 40]  55[ 40]
3,  87[ 72]  15[  0]
4,  87[ 72] -15[  0]
5, -55[-40] -55[-40]

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):

screenshot 2015-01-18 21 27 32

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

  • main stick: (87 / 128) * 1.1 = 0.75
  • c-stick: (74 / 128) * 1.1 = 0.64

where 1.1 is a margin to ensure that all angles can reach the input zone edge

@skidau
Copy link
Contributor

skidau commented Jan 18, 2015

@dolphin-emu-bot rebuild

@JMC47
Copy link
Contributor

JMC47 commented Jan 18, 2015

This seems like it'll be really nice for helping people setup controllers to work best in games.

@skidau
Copy link
Contributor

skidau commented Jan 18, 2015

@dolphin-emu-bot rebuild

@@ -27,6 +27,64 @@
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "InputCommon/ControllerInterface/Device.h"

struct shape_position {

This comment was marked as off-topic.

@john-peterson
Copy link
Contributor Author

@lioncash done

@lioncash
Copy link
Member

Looks good, thanks.

@dolphin-emu-bot rebuild

@Sonicadvance1
Copy link
Contributor

@dolphin-emu-bot rebuild

skidau added a commit that referenced this pull request Jan 19, 2015
Fix the input zone drawing in input settings
@skidau skidau merged commit 6b0431e into dolphin-emu:master Jan 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants