+ pl_rearmed_cbs.gpu_neon.enhancement_enable = 0;
+ soft_filter = SOFT_FILTER_NONE;
+ snprintf(hud_msg, sizeof(hud_msg), "default mode");
+ return 1;
+}
+
+int dispmode_doubleres(void)
+{
+ if (!(pl_rearmed_cbs.gpu_caps & GPU_CAP_SUPPORTS_2X)
+ || !resolution_ok(psx_w * 2, psx_h * 2) || psx_bpp != 16)
+ return 0;
+
+ dispmode_default();
+ pl_rearmed_cbs.gpu_neon.enhancement_enable = 1;
+ snprintf(hud_msg, sizeof(hud_msg), "double resolution");
+ return 1;
+}
+
+int dispmode_scale2x(void)
+{
+ if (psx_bpp != 16)
+ return 0;
+
+ dispmode_default();
+ soft_filter = SOFT_FILTER_SCALE2X;
+ snprintf(hud_msg, sizeof(hud_msg), "scale2x");
+ return 1;
+}
+
+int dispmode_eagle2x(void)
+{
+ if (psx_bpp != 16)
+ return 0;
+
+ dispmode_default();
+ soft_filter = SOFT_FILTER_EAGLE2X;
+ snprintf(hud_msg, sizeof(hud_msg), "eagle2x");
+ return 1;
+}
+
+static int (*dispmode_switchers[])(void) = {
+ dispmode_default,
+#ifdef __ARM_NEON__
+ dispmode_doubleres,
+ dispmode_scale2x,
+ dispmode_eagle2x,
+#endif
+};
+
+static int dispmode_current;
+
+void pl_switch_dispmode(void)
+{
+ if (pl_rearmed_cbs.gpu_caps & GPU_CAP_OWNS_DISPLAY)
+ return;
+
+ while (1) {
+ dispmode_current++;
+ if (dispmode_current >=
+ sizeof(dispmode_switchers) / sizeof(dispmode_switchers[0]))
+ dispmode_current = 0;
+ if (dispmode_switchers[dispmode_current]())
+ break;
+ }
+}
+
+#ifndef MAEMO
+static void update_analogs(void)
+{
+ int *nubp[2] = { in_a1, in_a2 };
+ int i, a, v, ret;
+
+ for (i = 0; i < 2; i++)
+ {
+ if (in_adev[i] < 0)
+ continue;
+
+ for (a = 0; a < 2; a++) {
+ nubp[i][a] = 127;
+
+ ret = in_update_analog(in_adev[i], in_adev_axis[i][a], &v);
+ if (ret == 0) {
+ v = v / (IN_ABS_RANGE / 128) + 127;
+ nubp[i][a] = v < 0 ? 0 : v;
+ }
+ }
+ }
+ //printf("%4d %4d %4d %4d\n", in_a1[0], in_a1[1], in_a2[0], in_a2[1]);