cosmetic fixes for pandora port
authornotaz <notasas@gmail.com>
Sat, 2 Dec 2023 21:52:55 +0000 (23:52 +0200)
committeririxxxx <31696370+irixxxx@users.noreply.github.com>
Sun, 3 Dec 2023 20:52:28 +0000 (21:52 +0100)
platform/pandora/menu.c
platform/pandora/plat.c

index 867b5c0..476af31 100644 (file)
@@ -24,11 +24,12 @@ static int menu_loop_cscaler(int id, int keys)
 
                inp = in_menu_wait(PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT
                                   |PBTN_R|PBTN_MOK|PBTN_MBACK, NULL, 40);
-               if (inp & PBTN_UP)    g_layer_cy--;
-               if (inp & PBTN_DOWN)  g_layer_cy++;
-               if (inp & PBTN_LEFT)  g_layer_cx--;
-               if (inp & PBTN_RIGHT) g_layer_cx++;
-               if (!(inp & PBTN_R)) {
+               if (inp & PBTN_R) {
+                       if (inp & PBTN_UP)    g_layer_cy--;
+                       if (inp & PBTN_DOWN)  g_layer_cy++;
+                       if (inp & PBTN_LEFT)  g_layer_cx--;
+                       if (inp & PBTN_RIGHT) g_layer_cx++;
+               } else {
                        if (inp & PBTN_UP)    g_layer_ch += 2;
                        if (inp & PBTN_DOWN)  g_layer_ch -= 2;
                        if (inp & PBTN_LEFT)  g_layer_cw += 2;
index 9b71d87..88a9652 100644 (file)
 \r
 static struct vout_fbdev *main_fb, *layer_fb;\r
 // g_layer_* - in use, g_layer_c* - configured custom\r
-int g_layer_cx, g_layer_cy, g_layer_cw, g_layer_ch;\r
+int g_layer_cx = 80, g_layer_cy, g_layer_cw = 640, g_layer_ch = 480;\r
 static int g_layer_x, g_layer_y;\r
 static int g_layer_w = 320, g_layer_h = 240;\r
-static int g_osd_fps_x, g_osd_y, doing_bg_frame;\r
+static int g_osd_start_x, g_osd_fps_x, g_osd_y, doing_bg_frame;\r
 \r
 static unsigned char __attribute__((aligned(4))) fb_copy[320 * 240 * 2];\r
 static void *temp_frame;\r
@@ -48,7 +48,6 @@ const char *renderer_names[] = { NULL };
 const char *renderer_names32x[] = { NULL };\r
 \r
 static const char * const pandora_gpio_keys[KEY_MAX + 1] = {\r
-       [0 ... KEY_MAX] = NULL,\r
        [KEY_UP]        = "Up",\r
        [KEY_LEFT]      = "Left",\r
        [KEY_RIGHT]     = "Right",\r
@@ -165,7 +164,7 @@ static void draw_cd_leds(void)
 void pemu_finalize_frame(const char *fps, const char *notice)\r
 {\r
        if (notice && notice[0])\r
-               emu_osd_text16(2, g_osd_y, notice);\r
+               emu_osd_text16(2 + g_osd_start_x, g_osd_y, notice);\r
        if (fps && fps[0] && (currentConfig.EmuOpt & EOPT_SHOW_FPS))\r
                emu_osd_text16(g_osd_fps_x, g_osd_y, fps);\r
        if ((PicoIn.AHW & PAHW_MCD) && (currentConfig.EmuOpt & EOPT_EN_CD_LEDS))\r
@@ -340,7 +339,7 @@ void emu_video_mode_change(int start_line, int line_count, int start_col, int co
 \r
        fb_w = col_count;\r
        fb_left = start_col;\r
-       fb_right = 320 - (fb_w+fb_left);;\r
+       fb_right = 320 - (fb_w + fb_left);\r
 \r
        switch (currentConfig.scaling) {\r
        case SCALE_1x1:\r
@@ -380,7 +379,8 @@ void emu_video_mode_change(int start_line, int line_count, int start_col, int co
                fb_h = line_count;\r
                break;\r
        }\r
-       g_osd_fps_x = col_count < 320 ? 232 : 264;\r
+       g_osd_start_x = start_col;\r
+       g_osd_fps_x = start_col + col_count - 5*8 - 2;\r
        g_osd_y = fb_top + fb_h - 8;\r
 \r
        pnd_setup_layer(1, g_layer_x, g_layer_y, g_layer_w, g_layer_h);\r
@@ -411,6 +411,7 @@ void pemu_loop_prep(void)
 \r
 void pemu_loop_end(void)\r
 {\r
+       memset(fb_copy, 0, sizeof(fb_copy));\r
        /* do one more frame for menu bg */\r
        pemu_forced_frame(0, 1);\r
 \r