SDL UI, fix for CD LED display
authorkub <derkub@gmail.com>
Tue, 23 Jun 2020 21:36:38 +0000 (23:36 +0200)
committerkub <derkub@gmail.com>
Tue, 23 Jun 2020 21:36:38 +0000 (23:36 +0200)
platform/common/plat_sdl.c
platform/linux/emu.c

index bce4b08..bb1ce61 100644 (file)
@@ -270,7 +270,7 @@ void plat_init(void)
        if (shadow_size < 320 * 480 * 2)
                shadow_size = 320 * 480 * 2;
 
-       shadow_fb = malloc(shadow_size);
+       shadow_fb = calloc(1, shadow_size);
        g_menubg_ptr = calloc(1, shadow_size);
        if (shadow_fb == NULL || g_menubg_ptr == NULL) {
                fprintf(stderr, "OOM\n");
index 005f82a..597c130 100644 (file)
@@ -39,10 +39,11 @@ static void draw_cd_leds(void)
        int led_reg, pitch, scr_offs, led_offs;\r
        led_reg = Pico_mcd->s68k_regs[0];\r
 \r
-       pitch = 320;\r
+       pitch = g_screen_ppitch;\r
        led_offs = 4;\r
        scr_offs = pitch * 2 + 4;\r
 \r
+#if 0\r
        if (currentConfig.renderer != RT_16BIT) {\r
        #define p(x) px[(x) >> 2]\r
                // 8-bit modes\r
@@ -52,7 +53,9 @@ static void draw_cd_leds(void)
                p(pitch*0) = p(pitch*1) = p(pitch*2) = col_g;\r
                p(pitch*0 + led_offs) = p(pitch*1 + led_offs) = p(pitch*2 + led_offs) = col_r;\r
        #undef p\r
-       } else {\r
+       } else\r
+#endif\r
+       {\r
        #define p(x) px[(x)*2 >> 2] = px[((x)*2 >> 2) + 1]\r
                // 16-bit modes\r
                unsigned int *px = (unsigned int *)((short *)g_screen_ptr + scr_offs);\r