Browse Source

preparation for retrofw and legacy opendingux support

kub 3 years ago
parent
commit
b053cb2044

+ 1 - 0
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
 

+ 5 - 4
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"
     ;;

+ 7 - 7
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)

+ 4 - 0
platform/opendingux/data/PicoDrive.dge

@@ -0,0 +1,4 @@
+#! /bin/sh
+echo 0 > /proc/sys/kernel/printk
+./PicoDrive "$@"
+sync

+ 12 - 0
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