Skip to content

Commit

Permalink
If VPAD Proc Mode use returned buffer count instead of bufferSize
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew1Hawes committed Aug 22, 2024
1 parent 7d1af34 commit 0eddf06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ DECL_FUNCTION(int32_t, VPADRead, VPADChan chan, VPADStatus *buffer, uint32_t buf

if (result > 0 && realError == VPAD_READ_SUCCESS) {
bool foundX = false;
uint32_t end = (VPADGetButtonProcMode(chan) == 1) ? bufferSize : 1;
uint32_t end = VPADGetButtonProcMode(chan) == 1 ? result : 1;
for (uint32_t i = 0; i < end; i++) {
if (buffer[i].hold & VPAD_BUTTON_X) {
foundX = true;
Expand Down

0 comments on commit 0eddf06

Please sign in to comment.