Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions loader/source/ppc/PADReadGC/source/PADReadGC.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ static u8 lastDanceMatPacket = 0x00;
#define DRC_SWAP (1<<16)

const s8 DEADZONE = 0x1A;
// This is the threshold for where an analog trigger is considered fully pressed.
const u8 ANALOG_LR_FULL_PRESS = 0xDF;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would it make sense to load this value as a configuration setting at runtime, rather than setting it at compile time for all controllers regardless of their type?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think that it makes a reasonable amount of sense to have this be a configuration file option, but I didn't want to touch the configuration file to avoid breaking anything. Plus, there needs to be a default threshold value anyways, for when there isn't an explicitly configured value.

Also, this only applies to controllers which are of the DigitalLR=2 type (described as being for when there are no digital triggers, and digital trigger value should be calculated from analog trigger position). An example of such a controller is a PS4/PS5 controller. Controllers of other DigitalLR types will continue to function the same.


#define HID_PAD_NONE 4
#define HID_PAD_NOT_SET 0xFF
Expand Down Expand Up @@ -596,9 +598,9 @@ u32 PADRead(u32 calledByGame)
}
else //standard no digital trigger button
{
if(HID_Packet[HID_CTRL->L.Offset] >= HID_CTRL->L.Mask)
if (HID_Packet[HID_CTRL->LAnalog] >= ANALOG_LR_FULL_PRESS)
button |= PAD_TRIGGER_L;
if(HID_Packet[HID_CTRL->R.Offset] >= HID_CTRL->R.Mask)
if (HID_Packet[HID_CTRL->RAnalog] >= ANALOG_LR_FULL_PRESS)
button |= PAD_TRIGGER_R;
}
}
Expand Down