+ case PSE_PAD_TYPE_MOUSE:
+ {
+ /* mouse x/y movement, range -128 to +127 */
+ float accum_x = 0, accum_y = 0;
+
+ float x = input_state_cb(i, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_X);
+ float y = input_state_cb(i, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_Y);
+
+ accum_x += x;
+ accum_y += y;
+
+ if (accum_x > 127)
+ accum_x = 127;
+ else if (accum_x < -128)
+ accum_x = -128;
+
+ if (accum_y > 127)
+ accum_y = 127;
+ else if (accum_y < -128)
+ accum_y = -128;
+
+ in_mouse[i][0] = (int)accum_x;
+ in_mouse[i][1] = (int)accum_y;
+
+ /* mouse button state */
+ if (input_state_cb(i, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_LEFT))
+ in_keystate[i] |= 1 << 11;
+
+ if (input_state_cb(i, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_RIGHT))
+ in_keystate[i] |= 1 << 10;
+
+ break;
+ }