Controller refuses to vibrate
Posted: May 1st, 2020, 7:32 am
Hey everyone
Yeees I have another question again and yeeeeeeees I have no idea why it is not behaving.
I have a DualShock controller being in the "digital mode" and I want to make actuators to well uhh vibrate? So I followed some example code I found in the PSYQ folders.
When starting my game I setup the controller something like that:
For every frame I will call PadGetState on Port 0 and process what I get. At boot up the controller is already connected so I directly land in "PadStateStable" at this point I have not called any thing else, so I will execute:
When PadSetActAlign returns 1 I will set a flag to not call this function again and I set vibrate[0] and [1] to 0xF0. From this point two things can happen:
1.) If I go directly into an endless loop, then the controller will vibrate happily.
2.) If I don't do that - then PadGetState will tell me for the next 3 frames "PadStateReqInfo" until it goes to "PadStateStable". However, it will not vibrate then!
I made sure that PadSetActAlign returns true... If I place my endless loop in "PadStateReqInfo" then it will also not vibrate. If I always call "PadSetActAlign" when being in the stable state, then it will fail, go back to the requeststate - and well it will loop.
This is so weird oO To me it sounds like I'm not allowed to get into the "PadStateReqInfo" state.
I hope anyone can help me with that, cause I believe I do the same like in the example... And I mean.... It does vibrate with the endless loop... But that would be a boring game xD
Yeees I have another question again and yeeeeeeees I have no idea why it is not behaving.
I have a DualShock controller being in the "digital mode" and I want to make actuators to well uhh vibrate? So I followed some example code I found in the PSYQ folders.
When starting my game I setup the controller something like that:
Code: Select all
u_char vibration[2] = {0};
void setup()
{
PadInitDirect(this->portData[toPortIDX(Direct::Port0)].rawData, this->portData[toPortIDX(Direct::Port1)].rawData);
PadSetAct((int)Direct::Port0, vibration, sizeof(vibration));
PadStartCom();
}
Code: Select all
u_char ActuatorAlign[6] = {0x0, 0x1, 0xFF, 0xFF, 0xFF, 0xFF};
PadSetActAlign((int)Direct::Port0, ActuatorAlign);
1.) If I go directly into an endless loop, then the controller will vibrate happily.
2.) If I don't do that - then PadGetState will tell me for the next 3 frames "PadStateReqInfo" until it goes to "PadStateStable". However, it will not vibrate then!
I made sure that PadSetActAlign returns true... If I place my endless loop in "PadStateReqInfo" then it will also not vibrate. If I always call "PadSetActAlign" when being in the stable state, then it will fail, go back to the requeststate - and well it will loop.
This is so weird oO To me it sounds like I'm not allowed to get into the "PadStateReqInfo" state.
I hope anyone can help me with that, cause I believe I do the same like in the example... And I mean.... It does vibrate with the endless loop... But that would be a boring game xD