use motion controls for move

This commit is contained in:
kalaposfos13 2026-03-14 14:23:39 +01:00
parent d229ab4d8b
commit 97e2367db4
2 changed files with 8 additions and 3 deletions

View File

@ -86,8 +86,12 @@ s32 PS4_SYSV_ABI sceMoveReadStateLatest(s32 handle, OrbisMoveData* data) {
m->ReadState(&s, &connected, &connected_count);
data->button_data.trigger_data = u16(s.axes[std::to_underlying(Input::Axis::TriggerRight)]);
data->button_data.button_data = std::to_underlying(PadToMoveOffset(s.buttonsState));
data->accelerometer[1] = m->accel_buf[1];
data->accelerometer[2] = m->accel_buf[2];
data->accelerometer[0] = s.acceleration.x;
data->accelerometer[1] = s.acceleration.y;
data->accelerometer[2] = s.acceleration.z;
data->gyro[0] = s.angularVelocity.x;
data->gyro[1] = s.angularVelocity.y;
data->gyro[2] = s.angularVelocity.z;
return ORBIS_OK;
}

View File

@ -75,7 +75,7 @@ static Uint32 SDLCALL PollController(void* userdata, SDL_TimerID timer_id, Uint3
controller->UpdateAxisSmoothing();
controller->Gyro(0);
controller->Acceleration(0);
return 4;
return interval;
}
WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameControllers* controllers_,
@ -285,6 +285,7 @@ void WindowSDL::WaitEvent() {
void WindowSDL::InitTimers() {
for (int i = 0; i < 4; ++i) {
SDL_AddTimer(4, &PollController, controllers[i]);
SDL_AddTimer(13, &PollController, controllers.moves(i));
}
SDL_AddTimer(33, Input::MousePolling, (void*)controllers[0]);
}