preparation for retrofw and legacy opendingux support
authorkub <derkub@gmail.com>
Sun, 21 Feb 2021 19:36:42 +0000 (20:36 +0100)
committerkub <derkub@gmail.com>
Mon, 22 Feb 2021 21:27:41 +0000 (22:27 +0100)
Makefile
configure
platform/common/plat_sdl.c
platform/opendingux/data/PicoDrive.dge [new file with mode: 0644]
platform/opendingux/data/default.retrofw.desktop [new file with mode: 0644]

index febf440..7955305 100644 (file)
--- 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
 
index f7f9825..9afcca6 100755 (executable)
--- 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"
     ;;
index b91ab7a..01958dc 100644 (file)
@@ -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 (file)
index 0000000..22f3a7c
--- /dev/null
@@ -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 (file)
index 0000000..84a3589
--- /dev/null
@@ -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