From b053cb2044ea0ded1b2f86385e73d3104bbcf213 Mon Sep 17 00:00:00 2001 From: kub Date: Sun, 21 Feb 2021 20:36:42 +0100 Subject: [PATCH] preparation for retrofw and legacy opendingux support --- Makefile | 1 + configure | 9 +++++---- platform/common/plat_sdl.c | 14 +++++++------- platform/opendingux/data/PicoDrive.dge | 4 ++++ platform/opendingux/data/default.retrofw.desktop | 12 ++++++++++++ 5 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 platform/opendingux/data/PicoDrive.dge create mode 100644 platform/opendingux/data/default.retrofw.desktop diff --git a/Makefile b/Makefile index febf4400..7955305d 100644 --- a/Makefile +++ b/Makefile @@ -90,6 +90,7 @@ $(TARGET).opk: $(TARGET) cp $< .opk_data/PicoDrive $(STRIP) .opk_data/PicoDrive mksquashfs .opk_data $@ -all-root -noappend -no-exports -no-xattrs + cd .opk_data && zip -9 -r $(TARGET).zip * all: opk diff --git a/configure b/configure index f7f98256..9afcca6d 100755 --- a/configure +++ b/configure @@ -38,7 +38,8 @@ check_define() # setting options to "yes" or "no" will make that choice default, # "" means "autodetect". -platform_list="generic pandora gp2x wiz caanoo opendingux gcw0 rg350 rpi1 rpi2 psp" +# TODO this is annoyingly messy. should have platform and device +platform_list="generic pandora gp2x wiz caanoo opendingux retrofw gcw0 rg350 rpi1 rpi2 psp" platform="generic" sound_driver_list="oss alsa sdl" sound_drivers="" @@ -91,9 +92,9 @@ set_platform() ;; generic) ;; - opendingux | gcw0 | rg350) + opendingux | retrofw | gcw0 | rg350) sound_drivers="sdl" - # both are really an opendingux + # all are more or less based on opendingux. save device type as C define. CFLAGS="$CFLAGS -D__`echo $platform | tr '[a-z]' '[A-Z]'`__" platform="opendingux" ;; @@ -110,7 +111,7 @@ set_platform() # always use static linking, since caanoo doesn't have OABI libs. Moreover, # dynamic linking slows Wiz 1-10%, and libm on F100 isn't compatible LDFLAGS="$LDFLAGS -static" - # unified binary for all of them + # unified binary for all of them. picodrive detects device type for itself. CFLAGS="$CFLAGS -D__GP2X__" platform="gp2x" ;; diff --git a/platform/common/plat_sdl.c b/platform/common/plat_sdl.c index b91ab7ab..01958dc7 100644 --- a/platform/common/plat_sdl.c +++ b/platform/common/plat_sdl.c @@ -164,7 +164,7 @@ void plat_video_menu_enter(int is_rom_loaded) { if (SDL_MUSTLOCK(plat_sdl_screen)) SDL_UnlockSurface(plat_sdl_screen); - plat_sdl_change_video_mode(g_menuscreen_w, g_menuscreen_h, 0); + plat_sdl_change_video_mode(g_menuscreen_w, g_menuscreen_h, 1); g_screen_ptr = shadow_fb; plat_video_set_buffer(g_screen_ptr); } @@ -212,22 +212,22 @@ void plat_video_menu_leave(void) void plat_video_loop_prepare(void) { if (plat_sdl_overlay != NULL || plat_sdl_gl_active) { - g_screen_ptr = shadow_fb; g_screen_width = 320; g_screen_height = 240; g_screen_ppitch = g_screen_width; + plat_sdl_change_video_mode(g_screen_width, g_screen_height, 0); + g_screen_ptr = shadow_fb; } else { - if (SDL_MUSTLOCK(plat_sdl_screen)) - SDL_LockSurface(plat_sdl_screen); - g_screen_ptr = plat_sdl_screen->pixels; g_screen_width = g_menuscreen_w; g_screen_height = g_menuscreen_h; g_screen_ppitch = g_menuscreen_pp; + plat_sdl_change_video_mode(g_screen_width, g_screen_height, 0); + if (SDL_MUSTLOCK(plat_sdl_screen)) + SDL_LockSurface(plat_sdl_screen); + g_screen_ptr = plat_sdl_screen->pixels; } plat_video_set_buffer(g_screen_ptr); - - plat_sdl_change_video_mode(g_screen_width, g_screen_height, 0); } void plat_early_init(void) diff --git a/platform/opendingux/data/PicoDrive.dge b/platform/opendingux/data/PicoDrive.dge new file mode 100644 index 00000000..22f3a7cd --- /dev/null +++ b/platform/opendingux/data/PicoDrive.dge @@ -0,0 +1,4 @@ +#! /bin/sh +echo 0 > /proc/sys/kernel/printk +./PicoDrive "$@" +sync diff --git a/platform/opendingux/data/default.retrofw.desktop b/platform/opendingux/data/default.retrofw.desktop new file mode 100644 index 00000000..84a35894 --- /dev/null +++ b/platform/opendingux/data/default.retrofw.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Name=Picodrive +Comment=A megadrive/genesis emulator +Exec=PicoDrive %f +Icon=megadrive +Categories=games; +X-OD-Manual= +X-OD-Selector= +X-OD-Filter=.md,.smd,.bin,.sms,.cue,.32x,.zip,.7z +Terminal=true +Type=Application +StartupNotify=true -- 2.39.5