+ poff_w = poff_h = 0;
+ if (w > w_max) {
+ poff_w = w / 2 - w_max / 2;
+ w = w_max;
+ }
+ fb_offset_x = 0;
+ if (w < 320)
+ fb_offset_x = 320/2 - w / 2;
+ if (h > 240) {
+ poff_h = h / 2 - 240/2;
+ h = 240;
+ }
+ fb_offset_y = 240/2 - h / 2;
+
+ psx_offset_x = poff_w;
+ psx_offset_y = poff_h;
+ psx_width = w;
+ psx_height = h;
+ psx_bpp = bpp;
+
+ if (fb_offset_x || fb_offset_y) {
+ // not fullscreen, must clear borders
+ memset(g_menuscreen_ptr, 0, 320*240 * psx_bpp/8);
+ g_menuscreen_ptr = fb_flip();
+ memset(g_menuscreen_ptr, 0, 320*240 * psx_bpp/8);
+ }
+
+ pollux_changemode(bpp, 1);
+
+ return NULL;
+}
+
+static void *pl_vout_flip(void)
+{
+ return NULL;
+}
+
+static void save_multiple_regs(unsigned int *dest, int base, int count)
+{
+ const volatile unsigned int *regs = memregl + base / 4;
+ int i;
+
+ for (i = 0; i < count; i++)
+ dest[i] = regs[i];
+}
+
+static void restore_multiple_regs(int base, const unsigned int *src, int count)
+{
+ volatile unsigned int *regs = memregl + base / 4;
+ int i;
+
+ for (i = 0; i < count; i++)
+ regs[i] = src[i];