Skip to content

Commit

Permalink
fix noanalog
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Oct 22, 2024
1 parent 7771787 commit 784a310
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions core/systemctrl/src/exitgame.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,15 @@ static void startExitThread(){
pspSdkSetK1(k1);
}

static void remove_analog_input(SceCtrlData *data)
static void remove_analog_input(SceCtrlData *data, int count)
{
if(data == NULL)
return;
data->Lx = 0xFF/2;
data->Ly = 0xFF/2;

for (int i=0; i<count; i++){
data[i].Lx = 0xFF/2;
data[i].Ly = 0xFF/2;
}
}

// Gamepad Hook #1
Expand All @@ -143,7 +146,7 @@ int peek_positive(SceCtrlData * pad_data, int count)
}

if (se_config.noanalog){
remove_analog_input(pad_data);
remove_analog_input(pad_data, count);
}

// Return Number of Input Frames
Expand All @@ -164,7 +167,7 @@ int peek_negative(SceCtrlData * pad_data, int count)
}

if (se_config.noanalog){
remove_analog_input(pad_data);
remove_analog_input(pad_data, count);
}

// Return Number of Input Frames
Expand All @@ -185,7 +188,7 @@ int read_positive(SceCtrlData * pad_data, int count)
}

if (se_config.noanalog){
remove_analog_input(pad_data);
remove_analog_input(pad_data, count);
}

// Return Number of Input Frames
Expand All @@ -206,7 +209,7 @@ int read_negative(SceCtrlData * pad_data, int count)
}

if (se_config.noanalog){
remove_analog_input(pad_data);
remove_analog_input(pad_data, count);
}

// Return Number of Input Frames
Expand Down

0 comments on commit 784a310

Please sign in to comment.