From 74bd70403b7da8c35edf70113f3de06bcb38d72c Mon Sep 17 00:00:00 2001 From: kub Date: Tue, 22 Feb 2022 20:40:34 +0000 Subject: [PATCH] platform sdl, add config file option for fullscreen --- platform/common/main.c | 4 ++-- platform/common/menu_pico.c | 1 + platform/common/menu_pico.h | 1 + platform/common/plat_sdl.c | 5 ++--- platform/gp2x/plat.c | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/platform/common/main.c b/platform/common/main.c index 3c1998cd..571b8884 100644 --- a/platform/common/main.c +++ b/platform/common/main.c @@ -84,12 +84,12 @@ int main(int argc, char *argv[]) //in_probe(); plat_target_init(); - plat_init(); - menu_init(); emu_prep_defconfig(); // depends on input emu_read_config(NULL, 0); + plat_init(); + menu_init(); emu_init(); engineState = PGS_Menu; diff --git a/platform/common/menu_pico.c b/platform/common/menu_pico.c index 812ea842..8ea84328 100644 --- a/platform/common/menu_pico.c +++ b/platform/common/menu_pico.c @@ -1316,6 +1316,7 @@ static menu_entry e_menu_hidden[] = { mee_onoff("Accurate sprites", MA_OPT_ACC_SPRITES, PicoIn.opt, POPT_ACC_SPRITES), mee_onoff("autoload savestates", MA_OPT_AUTOLOAD_SAVE, g_autostateld_opt, 1), + mee_onoff("SDL fullscreen mode", MA_OPT_VOUT_FULL, plat_target.vout_fullscreen, 1), mee_end, }; diff --git a/platform/common/menu_pico.h b/platform/common/menu_pico.h index fb1c67d9..dc9d6e99 100644 --- a/platform/common/menu_pico.h +++ b/platform/common/menu_pico.h @@ -40,6 +40,7 @@ typedef enum MA_OPT_INTERLACED, /* giz */ MA_OPT_TEARING_FIX, /* wiz */ MA_OPT_VOUT_MODE, + MA_OPT_VOUT_FULL, MA_OPT_AUTOLOAD_SAVE, MA_OPT_SOUND_FILTER, MA_OPT_SOUND_ALPHA, diff --git a/platform/common/plat_sdl.c b/platform/common/plat_sdl.c index 7198136c..d66a2ace 100644 --- a/platform/common/plat_sdl.c +++ b/platform/common/plat_sdl.c @@ -128,8 +128,6 @@ static int clear_buf_cnt, clear_stat_cnt; void plat_video_set_size(int w, int h) { if (area.w != w || area.h != h) { - area = (struct area) { w, h }; - if (plat_sdl_change_video_mode(w, h, 0) < 0) { // failed, revert to original resolution plat_sdl_change_video_mode(g_screen_width, g_screen_height, 0); @@ -141,6 +139,7 @@ void plat_video_set_size(int w, int h) g_screen_ppitch = w; g_screen_ptr = plat_sdl_screen->pixels; } + area = (struct area) { w, h }; } } @@ -193,7 +192,7 @@ void plat_video_clear_status(void) void plat_video_clear_buffers(void) { if (plat_sdl_overlay != NULL || plat_sdl_gl_active) - memset(shadow_fb, 0, plat_sdl_screen->w*plat_sdl_screen->h * 2); + memset(shadow_fb, 0, g_menuscreen_w * g_menuscreen_h * 2); else { memset(g_screen_ptr, 0, plat_sdl_screen->w*plat_sdl_screen->h * 2); clear_buf_cnt = 3; // do it thrice in case of triple buffering diff --git a/platform/gp2x/plat.c b/platform/gp2x/plat.c index 4fcf76f4..b25ce850 100644 --- a/platform/gp2x/plat.c +++ b/platform/gp2x/plat.c @@ -16,7 +16,7 @@ #include "warm.h" #include "plat.h" -#include +#include /* GP2X local */ int gp2x_current_bpp; -- 2.39.5