diff --git a/Config.in b/Config.in index fff55c6fb21a261c4b767d08fb55d256fb808327..c3d46d6c8d57ff80b9ab538aa6e79a430b4cc73b 100644 --- a/Config.in +++ b/Config.in @@ -77,7 +77,7 @@ menu "Emulators" source "$BR2_EXTERNAL_RECALBOX_PATH/package/frotz-recalbox/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/hatari/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/duckstation/Config.in" - source "$BR2_EXTERNAL_RECALBOX_PATH/package/linapple-pie/Config.in" + source "$BR2_EXTERNAL_RECALBOX_PATH/package/linapple-recalbox/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/mupen64plus-audio-sdl/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/mupen64plus-core/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/mupen64plus-gliden64/Config.in" diff --git a/Dockerfile b/Dockerfile index 7ad1a6b2edd92af39bce5028b011348ef222f39f..45304aa581bbeb54ad71c5222ab84cbbafad2a29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ apt-get install -y tzdata && \ ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime && \ dpkg-reconfigure --frontend noninteractive tzdata && \ apt-get -y install build-essential git libncurses5-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools \ -mercurial libdbus-glib-1-dev texinfo zip openssh-client libxml2-utils libpng-dev \ +mercurial libdbus-glib-1-dev texinfo zip openssh-client libxml2-utils libpng-dev a56 \ software-properties-common wget cpio bc locales rsync imagemagick bison flex bsdmainutils \ nano vim automake autopoint mtools dosfstools subversion openjdk-8-jdk libssl-dev libelf-dev \ graphviz python3 python3-matplotlib python3-numpy python3-six re2c libc6-dev-i386 libtool cabextract && \ diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 51d549313df0aacbd68bb85a40f9fb791bbdc1f9..01c28e22490a620452c3793de3f3095f0416bee5 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -56,6 +56,7 @@ as release notes for end user on a Recalbox upgrade. - Add support for 4k video in Kodi for Raspberry Pi 4 - Enable H/W video decoding for Raspberry Pi 4, Pi 3 & Pi zero 2 - Improve AppleIIGS configurator & add eXoAppleIIGS config support +- Bump LinApple (new file formats, HDD, better pad management, pad shortcuts) ### Fixes - Fix crash libretro pcsx-rearmed for x64 @@ -67,6 +68,7 @@ as release notes for end user on a Recalbox upgrade. - Fix resolution selection in frontend for Raspberry Pi 4/400/3/Zero2 (KMS) - Controllers recognized as Xbox in Dolphin (GC/Wii) have their hotkeys working - Fix pause menu in the game for libretro pcsx_rearmed +- Fix disk enumerator (allow some emulators to auto-load multiple disk games) ## Version 8.1.1-Electron diff --git a/board/recalbox/patches/sdl/0003-pssc-sdl-fbcon.patch b/board/recalbox/patches/sdl/0003-pssc-sdl-fbcon.patch deleted file mode 100644 index 89b036ca36c8a55a3ac60450216e38fb18ba1895..0000000000000000000000000000000000000000 --- a/board/recalbox/patches/sdl/0003-pssc-sdl-fbcon.patch +++ /dev/null @@ -1,410 +0,0 @@ -src/video/dbcon/SDL_fbvideo.c: Patch to improve fbcon driver for SDL (from pssc) -See https://github.com/raspberrypi/firmware/issues/354 - -Signed-off-by: Laurent Merckx ---- sdl-1.2.15/src/video/fbcon/SDL_fbvideo.c 2012-01-19 07:30:06.000000000 +0100 -+++ sdl-1.2.15.o/src/video/fbcon/SDL_fbvideo.c 2016-01-02 21:37:26.897619161 +0100 -@@ -49,6 +49,7 @@ - #include "SDL_fbriva.h" - - /*#define FBCON_DEBUG*/ -+#define FBACCEL_DEBUG - - #if defined(i386) && defined(FB_TYPE_VGA_PLANES) - #define VGA16_FBCON_SUPPORT -@@ -63,24 +64,36 @@ static inline void outb (unsigned char v - } - */ - #endif /* FB_TYPE_VGA_PLANES */ -+/* Various screen update functions available */ -+static void FB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects); -+#ifdef VGA16_FBCON_SUPPORT -+static void FB_VGA16Update(_THIS, int numrects, SDL_Rect *rects); -+#endif - - /* A list of video resolutions that we query for (sorted largest to smallest) */ -+/* http://en.wikipedia.org/wiki/Graphics_display_resolution */ - static const SDL_Rect checkres[] = { -- { 0, 0, 1600, 1200 }, /* 16 bpp: 0x11E, or 286 */ -- { 0, 0, 1408, 1056 }, /* 16 bpp: 0x19A, or 410 */ -- { 0, 0, 1280, 1024 }, /* 16 bpp: 0x11A, or 282 */ -- { 0, 0, 1152, 864 }, /* 16 bpp: 0x192, or 402 */ -- { 0, 0, 1024, 768 }, /* 16 bpp: 0x117, or 279 */ -+ { 0, 0, 1920, 1200 }, // WUXGA -+ { 0, 0, 1920, 1080 }, // 1080p FHD 16:9 = 1.7 -+ { 0, 0, 1600, 1200 }, /* 16 bpp: 0x11E, or 286 / UXGA */ -+ { 0, 0, 1408, 1056 }, /* 16 bpp: 0x19A, or 410 */ -+ { 0, 0, 1280, 1024 }, /* 16 bpp: 0x11A, or 282 / SXGA */ -+ { 0, 0, 1280, 720 }, // 720p HD/WXGA 16:9 = 1.7 -+ { 0, 0, 1152, 864 }, /* 16 bpp: 0x192, or 402 / XGA+ */ -+ { 0, 0, 1024, 768 }, /* 16 bpp: 0x117, or 279 / XGA */ - { 0, 0, 960, 720 }, /* 16 bpp: 0x18A, or 394 */ -- { 0, 0, 800, 600 }, /* 16 bpp: 0x114, or 276 */ -+ { 0, 0, 800, 600 }, /* 16 bpp: 0x114, or 276 / SVGA */ -+ { 0, 0, 800, 480 }, // WVGA 5:3 = 1.6 - { 0, 0, 768, 576 }, /* 16 bpp: 0x182, or 386 */ - { 0, 0, 720, 576 }, /* PAL */ - { 0, 0, 720, 480 }, /* NTSC */ - { 0, 0, 640, 480 }, /* 16 bpp: 0x111, or 273 */ - { 0, 0, 640, 400 }, /* 8 bpp: 0x100, or 256 */ - { 0, 0, 512, 384 }, -- { 0, 0, 320, 240 }, -- { 0, 0, 320, 200 } -+ { 0, 0, 480, 320 }, // HVGA 3:2 = 1.5 -+ { 0, 0, 480, 272 }, // WQVGA? -+ { 0, 0, 320, 240 }, // QVGA 4:3 = 1.3 -+ { 0, 0, 320, 200 } // CGA 4:3 = 1.3 - }; - static const struct { - int xres; -@@ -152,8 +165,9 @@ static int FB_AllocHWSurface(_THIS, SDL_ - static int FB_LockHWSurface(_THIS, SDL_Surface *surface); - static void FB_UnlockHWSurface(_THIS, SDL_Surface *surface); - static void FB_FreeHWSurface(_THIS, SDL_Surface *surface); --static void FB_WaitVBL(_THIS); --static void FB_WaitIdle(_THIS); -+static int FB_WaitVBL(_THIS); -+static int FB_WaitIdle(_THIS); -+static int FB_NULL(_THIS); - static int FB_FlipHWSurface(_THIS, SDL_Surface *surface); - - /* Internal palette functions */ -@@ -176,6 +190,9 @@ static int SDL_getpagesize(void) - return 4096; /* this is what it USED to be in Linux... */ - #endif - } -+#ifdef FBCON_DEBUG -+static void print_finfo(struct fb_fix_screeninfo *finfo); -+#endif - - - /* Small wrapper for mmap() so we can play nicely with no-mmu hosts -@@ -241,7 +258,8 @@ static SDL_VideoDevice *FB_CreateDevice( - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); -- wait_vbl = FB_WaitVBL; -+ -+ wait_vbl = SDL_getenv("SDL_FBCON_NOVBL") ? FB_NULL : FB_WaitVBL; - wait_idle = FB_WaitIdle; - mouse_fd = -1; - keyboard_fd = -1; -@@ -251,7 +269,12 @@ static SDL_VideoDevice *FB_CreateDevice( - this->ListModes = FB_ListModes; - this->SetVideoMode = FB_SetVideoMode; - this->SetColors = FB_SetColors; -+#ifdef VGA16_FBCON_SUPPORT -+ /* Set the update rectangle function in the Video Mode change function */ - this->UpdateRects = NULL; -+#else -+ this->UpdateRects = FB_DirectUpdate; -+#endif - this->VideoQuit = FB_VideoQuit; - this->AllocHWSurface = FB_AllocHWSurface; - this->CheckHWBlit = NULL; -@@ -329,6 +352,8 @@ static int read_fbmodes_mode(FILE *f, st - } - while(1); - -+ SDL_memset(vinfo, 0, sizeof(struct fb_var_screeninfo)); // prevent random junk -+ - SDL_sscanf(line, "geometry %d %d %d %d %d", &vinfo->xres, &vinfo->yres, - &vinfo->xres_virtual, &vinfo->yres_virtual, &vinfo->bits_per_pixel); - if (read_fbmodes_line(f, line, sizeof(line))==0) -@@ -495,7 +520,6 @@ static void FB_SortModes(_THIS) - - static int FB_VideoInit(_THIS, SDL_PixelFormat *vformat) - { -- const int pagesize = SDL_getpagesize(); - struct fb_fix_screeninfo finfo; - struct fb_var_screeninfo vinfo; - int i, j; -@@ -533,6 +557,10 @@ static int FB_VideoInit(_THIS, SDL_Pixel - FB_VideoQuit(this); - return(-1); - } -+#ifdef FBCON_DEBUG -+ print_finfo(&finfo); -+#endif -+ - switch (finfo.type) { - case FB_TYPE_PACKED_PIXELS: - /* Supported, no worries.. */ -@@ -578,7 +606,7 @@ static int FB_VideoInit(_THIS, SDL_Pixel - - /* Memory map the device, compensating for buggy PPC mmap() */ - mapped_offset = (((long)finfo.smem_start) - -- (((long)finfo.smem_start)&~(pagesize-1))); -+ (((long)finfo.smem_start)&~(SDL_getpagesize()-1))); - mapped_memlen = finfo.smem_len+mapped_offset; - mapped_mem = do_mmap(NULL, mapped_memlen, - PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0); -@@ -778,7 +806,7 @@ static int FB_VideoInit(_THIS, SDL_Pixel - break; - default: - #ifdef FBACCEL_DEBUG -- printf("Unknown hardware accelerator.\n"); -+ printf("Unknown hardware accelerator %x.\n",finfo.accel); - #endif - break; - } -@@ -817,11 +845,6 @@ static SDL_Rect **FB_ListModes(_THIS, SD - return(SDL_modelist[((format->BitsPerPixel+7)/8)-1]); - } - --/* Various screen update functions available */ --static void FB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects); --#ifdef VGA16_FBCON_SUPPORT --static void FB_VGA16Update(_THIS, int numrects, SDL_Rect *rects); --#endif - - #ifdef FBCON_DEBUG - static void print_vinfo(struct fb_var_screeninfo *vinfo) -@@ -885,6 +908,10 @@ static int choose_fbmodes_mode(struct fb - while ( read_fbmodes_mode(modesdb, &cinfo) ) { - if ( (vinfo->xres == cinfo.xres && vinfo->yres == cinfo.yres) && - (!matched || (vinfo->bits_per_pixel == cinfo.bits_per_pixel)) ) { -+#ifdef FBCON_DEBUG -+ fprintf(stderr, "Using FBModes timings for %dx%d\n", -+ vinfo->xres, vinfo->yres); -+#endif - vinfo->pixclock = cinfo.pixclock; - vinfo->left_margin = cinfo.left_margin; - vinfo->right_margin = cinfo.right_margin; -@@ -1015,13 +1042,20 @@ static SDL_Surface *FB_SetVideoMode(_THI - /* Restore the original palette */ - FB_RestorePalette(this); - -+ SDL_memset(&vinfo, 0, sizeof(vinfo)); - /* Set the video mode and get the final screen format */ - if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) { - SDL_SetError("Couldn't get console screen info"); - return(NULL); - } -+ /* Get the type of video hardware */ -+ if ( ioctl(console_fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) { -+ SDL_SetError("Couldn't get console hardware info"); -+ return(NULL); -+ } - #ifdef FBCON_DEBUG -- fprintf(stderr, "Printing original vinfo:\n"); -+ fprintf(stderr, "Printing original info:\n"); -+ print_finfo(&finfo); - print_vinfo(&vinfo); - #endif - /* Do not use double buffering with shadow buffer */ -@@ -1031,8 +1065,12 @@ static SDL_Surface *FB_SetVideoMode(_THI - - if ( (vinfo.xres != width) || (vinfo.yres != height) || - (vinfo.bits_per_pixel != bpp) || (flags & SDL_DOUBLEBUF) ) { -+#ifdef FBCON_DEBUG -+ fprintf(stderr, "Request %dx%d %d Actual %dx%d %d %s flags %x current %dx%d\n",width,height,bpp,vinfo.xres,vinfo.yres,vinfo.bits_per_pixel,(flags & SDL_DOUBLEBUF) ? "SDL_DOUBLEBUF" : "" ,flags , current->w,current->h); -+#endif -+ SDL_memset(&vinfo, 0, sizeof(vinfo)); - vinfo.activate = FB_ACTIVATE_NOW; -- vinfo.accel_flags = 0; -+ vinfo.accel_flags = 0; //? - vinfo.bits_per_pixel = bpp; - vinfo.xres = width; - vinfo.xres_virtual = width; -@@ -1048,6 +1086,9 @@ static SDL_Surface *FB_SetVideoMode(_THI - vinfo.green.length = vinfo.green.offset = 0; - vinfo.blue.length = vinfo.blue.offset = 0; - vinfo.transp.length = vinfo.transp.offset = 0; -+ // vinfo.height = 0; -+ // vinfo.width = 0; -+ // vinfo.vmode |= FB_VMODE_CONUPDATE; - if ( ! choose_fbmodes_mode(&vinfo) ) { - choose_vesa_mode(&vinfo); - } -@@ -1076,11 +1117,20 @@ static SDL_Surface *FB_SetVideoMode(_THI - vinfo.yres_virtual = maxheight; - } - } -- cache_vinfo = vinfo; -+ /* Get the fixed information about the console hardware. -+ This is necessary since finfo.line_length changes. -+ and in case RPI the frame buffer offsets and length change -+ */ -+ if ( ioctl(console_fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) { -+ SDL_SetError("Couldn't get console hardware info"); -+ return(NULL); -+ } - #ifdef FBCON_DEBUG -- fprintf(stderr, "Printing actual vinfo:\n"); -+ fprintf(stderr, "Printing actual info:\n"); -+ print_finfo(&finfo); - print_vinfo(&vinfo); - #endif -+ cache_vinfo = vinfo; - Rmask = 0; - for ( i=0; iflags &= SDL_FULLSCREEN; - if (shadow_fb) { -@@ -1167,20 +1222,25 @@ static SDL_Surface *FB_SetVideoMode(_THI - - /* Update for double-buffering, if we can */ - if ( flags & SDL_DOUBLEBUF ) { -- if ( vinfo.yres_virtual == (height*2) ) { -+ if ( vinfo.yres_virtual >= (vinfo.yres*2) ) { -+ /* offsets for mode change are 0 so we start drawing on 2nd buffer */ - current->flags |= SDL_DOUBLEBUF; -- flip_page = 0; - flip_address[0] = (char *)current->pixels; - flip_address[1] = (char *)current->pixels+ -- current->h*current->pitch; -- this->screen = current; -- FB_FlipHWSurface(this, current); -- this->screen = NULL; -+ current->h*current->pitch; -+ flip_page = 0; -+ current->pixels = flip_address[1]; -+#ifdef FBCON_DEBUG -+ fprintf(stderr, "SDL_DOUBLEBUF 0:%x 1:%x pitch %x\n",(unsigned int)flip_address[0],(unsigned int) flip_address[1],current->pitch); -+#endif -+ - } - } - -+#ifdef VGA16_FBCON_SUPPORT - /* Set the update rectangle function */ - this->UpdateRects = FB_DirectUpdate; -+#endif - - /* We're done */ - return(current); -@@ -1266,16 +1326,16 @@ static int FB_AllocHWSurface(_THIS, SDL_ - int size; - int extra; - --/* Temporarily, we only allow surfaces the same width as display. -- Some blitters require the pitch between two hardware surfaces -- to be the same. Others have interesting alignment restrictions. -- Until someone who knows these details looks at the code... --*/ --if ( surface->pitch > SDL_VideoSurface->pitch ) { -- SDL_SetError("Surface requested wider than screen"); -- return(-1); --} --surface->pitch = SDL_VideoSurface->pitch; -+ /* Temporarily, we only allow surfaces the same width as display. -+ Some blitters require the pitch between two hardware surfaces -+ to be the same. Others have interesting alignment restrictions. -+ Until someone who knows these details looks at the code... -+ */ -+ if ( surface->pitch > SDL_VideoSurface->pitch ) { -+ SDL_SetError("Surface requested wider than screen"); -+ return(-1); -+ } -+ surface->pitch = SDL_VideoSurface->pitch; - size = surface->h * surface->pitch; - #ifdef FBCON_DEBUG - fprintf(stderr, "Allocating bucket of %d bytes\n", size); -@@ -1407,17 +1467,30 @@ static void FB_UnlockHWSurface(_THIS, SD - } - } - --static void FB_WaitVBL(_THIS) -+static int FB_WaitVBL(_THIS) - { --#ifdef FBIOWAITRETRACE /* Heheh, this didn't make it into the main kernel */ -- ioctl(console_fd, FBIOWAITRETRACE, 0); -+ if (ioctl(console_fd, FBIO_WAITFORVSYNC, 0) < 0 ) { -+ SDL_SetError("ioctl(FBIO_WAITFORVSYNC) failed"); -+#ifdef FBCON_DEBUG -+ printf("ioctl(FBIO_WAITFORVSYNC) failed"); - #endif -- return; -+ return -1; -+ } -+ return 0; - } - --static void FB_WaitIdle(_THIS) -+static int FB_NULL(_THIS) - { -- return; -+ return 0; -+} -+ -+static int FB_WaitIdle(_THIS) -+{ -+#ifdef FBCON_DEBUG -+ printf("FB_WaitIdle Not implmented"); -+#endif -+ SDL_SetError("Not implmented"); -+ return(-1); - } - - static int FB_FlipHWSurface(_THIS, SDL_Surface *surface) -@@ -1426,8 +1499,12 @@ static int FB_FlipHWSurface(_THIS, SDL_S - return -2; /* no hardware access */ - } - -+#ifdef FBCON_DEBUG -+ fprintf(stderr, "Flip %d vinfo offset changing to %d current:\n",flip_page,flip_page*cache_vinfo.yres); -+ print_vinfo(&cache_vinfo); -+#endif - /* Wait for vertical retrace and then flip display */ -- cache_vinfo.yoffset = flip_page*surface->h; -+ cache_vinfo.yoffset = flip_page*cache_vinfo.yres; - if ( FB_IsSurfaceBusy(this->screen) ) { - FB_WaitBusySurfaces(this); - } -@@ -1436,8 +1513,11 @@ static int FB_FlipHWSurface(_THIS, SDL_S - SDL_SetError("ioctl(FBIOPAN_DISPLAY) failed"); - return(-1); - } -- flip_page = !flip_page; -+ flip_page ^= 1; - -+#ifdef FBCON_DEBUG -+ fprintf(stderr, " surface->pixels changing to %x current:\n",flip_address[flip_page]); -+#endif - surface->pixels = flip_address[flip_page]; - return(0); - } -@@ -1915,6 +1995,7 @@ static void FB_VideoQuit(_THIS) - - /* If the framebuffer is not to be cleared, make sure that we won't - * display the previous frame when disabling double buffering. */ -+ //Dubious restor to 0 first? - if ( dontClearPixels && flip_page == 0 ) { - SDL_memcpy(flip_address[0], flip_address[1], this->screen->pitch * this->screen->h); - } diff --git a/configs/recalbox-odroidgo2_defconfig b/configs/recalbox-odroidgo2_defconfig index 0d40ddc4d04e5ba06d5f61e146f987a1e15a910d..5967fee58468706aa351a732a03101be4298cac9 100644 --- a/configs/recalbox-odroidgo2_defconfig +++ b/configs/recalbox-odroidgo2_defconfig @@ -171,6 +171,7 @@ BR2_PACKAGE_RECALBOX_EMULATIONSTATION2=y BR2_PACKAGE_HATARI=y BR2_PACKAGE_ADVANCEMAME=y BR2_PACKAGE_DUCKSTATION=y +BR2_PACKAGE_LINAPPLE_RECALBOX=y BR2_PACKAGE_BEEBEM=y BR2_PACKAGE_FROTZ_RECALBOX=y BR2_PACKAGE_MUPEN64PLUS_AUDIO_SDL=y diff --git a/configs/recalbox-odroidxu4_defconfig b/configs/recalbox-odroidxu4_defconfig index 6e5a75eea570b6fbefde2c71b19ac4e2d48deb72..bed9d7dfbef9976b5c59cf16509db655f5d66f1a 100644 --- a/configs/recalbox-odroidxu4_defconfig +++ b/configs/recalbox-odroidxu4_defconfig @@ -191,7 +191,7 @@ BR2_PACKAGE_QTSIXA=y BR2_PACKAGE_RECALBOX_RETROGAME=y BR2_PACKAGE_VIRTUALGAMEPADS=y BR2_PACKAGE_XARCADE2JSTICK=y -BR2_PACKAGE_LINAPPLE_PIE=y +BR2_PACKAGE_LINAPPLE_RECALBOX=y BR2_PACKAGE_DUCKSTATION=y BR2_PACKAGE_SOLARUS_RECALBOX=y BR2_PACKAGE_ORICUTRON=y diff --git a/configs/recalbox-rpi1_defconfig b/configs/recalbox-rpi1_defconfig index 4ad8b65fc6835fa3390675f33eda0f7f06377376..51cadb1baf0194c285f7ac8bd17f3763584c826c 100644 --- a/configs/recalbox-rpi1_defconfig +++ b/configs/recalbox-rpi1_defconfig @@ -170,7 +170,7 @@ BR2_PACKAGE_HATARI=y BR2_PACKAGE_ADVANCEMAME=y BR2_PACKAGE_BEEBEM=y BR2_PACKAGE_FROTZ_RECALBOX=y -BR2_PACKAGE_LINAPPLE_PIE=y +BR2_PACKAGE_LINAPPLE_RECALBOX=y #BR2_PACKAGE_DUCKSTATION=y BR2_PACKAGE_ORICUTRON=y BR2_PACKAGE_SIMCOUPE=y diff --git a/configs/recalbox-rpi3_defconfig b/configs/recalbox-rpi3_defconfig index ff91805ecf42acbf2bb0154b2d5465a37173f502..6f6f858eff058952fbfe9c7ce1ebea62b8470931 100644 --- a/configs/recalbox-rpi3_defconfig +++ b/configs/recalbox-rpi3_defconfig @@ -204,7 +204,7 @@ BR2_PACKAGE_RECALBOX_RETROGAME=y BR2_PACKAGE_STEAMCONTROLLER=y BR2_PACKAGE_VIRTUALGAMEPADS=y BR2_PACKAGE_XARCADE2JSTICK=y -BR2_PACKAGE_LINAPPLE_PIE=y +BR2_PACKAGE_LINAPPLE_RECALBOX=y BR2_PACKAGE_DUCKSTATION=y BR2_PACKAGE_SOLARUS_RECALBOX=y BR2_PACKAGE_MUPEN64PLUS_AUDIO_SDL=y diff --git a/configs/recalbox-rpi4_64_defconfig b/configs/recalbox-rpi4_64_defconfig index c6f936aef37dd60c0b4e0a2bc082c1e9f4310091..139d03d4378821d7abcc72c86f87ef7261d8362c 100644 --- a/configs/recalbox-rpi4_64_defconfig +++ b/configs/recalbox-rpi4_64_defconfig @@ -193,7 +193,7 @@ BR2_PACKAGE_XPI_GAMECON_RPI=y BR2_PACKAGE_RECALBOX_RETROGAME=y BR2_PACKAGE_VIRTUALGAMEPADS=y BR2_PACKAGE_XARCADE2JSTICK=y -BR2_PACKAGE_LINAPPLE_PIE=y +BR2_PACKAGE_LINAPPLE_RECALBOX=y BR2_PACKAGE_DUCKSTATION=y BR2_PACKAGE_SOLARUS_RECALBOX=y BR2_PACKAGE_MUPEN64PLUS_AUDIO_SDL=y diff --git a/configs/recalbox-rpi4_defconfig b/configs/recalbox-rpi4_defconfig index 65036bdfc302be8b01cb5f4002c12f09039c0c3c..087142b4bea2931122a5fe942b9b1e1d73a8140a 100644 --- a/configs/recalbox-rpi4_defconfig +++ b/configs/recalbox-rpi4_defconfig @@ -193,7 +193,7 @@ BR2_PACKAGE_XPI_GAMECON_RPI=y BR2_PACKAGE_RECALBOX_RETROGAME=y BR2_PACKAGE_VIRTUALGAMEPADS=y BR2_PACKAGE_XARCADE2JSTICK=y -BR2_PACKAGE_LINAPPLE_PIE=y +BR2_PACKAGE_LINAPPLE_RECALBOX=y BR2_PACKAGE_DUCKSTATION=y BR2_PACKAGE_SOLARUS_RECALBOX=y BR2_PACKAGE_MUPEN64PLUS_AUDIO_SDL=y diff --git a/configs/recalbox-rpizero2_defconfig b/configs/recalbox-rpizero2_defconfig index d17ffa2aecc2e3d8e1e5bb51708e7025d7c4c207..7afeffb9955c4c478e24e80e7d3df0a83b81c067 100644 --- a/configs/recalbox-rpizero2_defconfig +++ b/configs/recalbox-rpizero2_defconfig @@ -204,7 +204,7 @@ BR2_PACKAGE_RECALBOX_RETROGAME=y BR2_PACKAGE_STEAMCONTROLLER=y BR2_PACKAGE_VIRTUALGAMEPADS=y BR2_PACKAGE_XARCADE2JSTICK=y -BR2_PACKAGE_LINAPPLE_PIE=y +BR2_PACKAGE_LINAPPLE_RECALBOX=y BR2_PACKAGE_DUCKSTATION=y BR2_PACKAGE_SOLARUS_RECALBOX=y BR2_PACKAGE_MUPEN64PLUS_AUDIO_SDL=y diff --git a/configs/recalbox-rpizero2legacy_defconfig b/configs/recalbox-rpizero2legacy_defconfig index e497181aa2083a044b48806757ba033544426b59..fe0d88435b7216326c52afacd5ece090a28fa99a 100644 --- a/configs/recalbox-rpizero2legacy_defconfig +++ b/configs/recalbox-rpizero2legacy_defconfig @@ -156,7 +156,7 @@ BR2_PACKAGE_RECALBOX_RETROGAME=y BR2_PACKAGE_STEAMCONTROLLER=y BR2_PACKAGE_VIRTUALGAMEPADS=y BR2_PACKAGE_XARCADE2JSTICK=y -BR2_PACKAGE_LINAPPLE_PIE=y +BR2_PACKAGE_LINAPPLE_RECALBOX=y BR2_PACKAGE_SOLARUS_RECALBOX=y BR2_PACKAGE_MUPEN64PLUS_AUDIO_SDL=y BR2_PACKAGE_MUPEN64PLUS_CORE=y diff --git a/configs/recalbox-x86_64_defconfig b/configs/recalbox-x86_64_defconfig index 5c94883b4d1562d50075772391acf59179e3d6af..a45c93fb7b0d599bf7d49720143443a7be618a91 100644 --- a/configs/recalbox-x86_64_defconfig +++ b/configs/recalbox-x86_64_defconfig @@ -249,7 +249,7 @@ BR2_PACKAGE_XARCADE2JSTICK=y BR2_PACKAGE_HATARI=y BR2_PACKAGE_BEEBEM=y BR2_PACKAGE_FROTZ_RECALBOX=y -BR2_PACKAGE_LINAPPLE_PIE=y +BR2_PACKAGE_LINAPPLE_RECALBOX=y BR2_PACKAGE_DUCKSTATION=y BR2_PACKAGE_SOLARUS_RECALBOX=y BR2_PACKAGE_MUPEN64PLUS_AUDIO_SDL=y diff --git a/custom/list.hash b/custom/list.hash index f698f4935b728fac649c7b6dcf7103daf358ed50..70bf6a0a897dc676a32379c5558a5700bf5e4e55 100644 --- a/custom/list.hash +++ b/custom/list.hash @@ -5,6 +5,10 @@ # * a line of plus signs ('+') indicates a file that we add to the Buildroot external tree ++++++++++++++++++++++++++++++++ package/clang/0001-lib-Driver-ToolChains-Gnu-Use-GCC_INSTALL_PREFIX-in-.patch +++++++++++++++++++++++++++++++++ package/sdl/sdl-0000-route-sdl-config-to-staging.patch +-------------------------------- package/sdl/0001-use-correct-directfb-config.patch +-------------------------------- package/sdl/0002-fix-compilation-with-libx11.patch +-------------------------------- package/sdl/sdl.hash 087eaf782e2a27d9830114325ad8681a linux/Config.in 214c5e2762f0292cf0a31cabc895e54d linux/linux.mk c17b2548c35cffbd487ade70e272015c package/bcm2835/Config.in @@ -37,6 +41,8 @@ eccca9996f67a8e3091c986d75a6b85e package/python-pygame/python-pygame.hash f38548efeaeaaa6515c91bc6ab7d9d54 package/rpi-firmware/cmdline.txt bb6386cc54355917f1dad1fd576d9298 package/rpi-firmware/rpi-firmware.hash 7dd2e53d8b5a99680e4ccff69cd4b8fb package/rpi-firmware/rpi-firmware.mk +fa419eb47b38fa16ec18a0dfb2dd7d12 package/sdl/Config.in +8a52348082fa88a0e4b0405c4a07a2fc package/sdl/sdl.mk b908959a214b74a37cab5f5acee1a8f5 package/sdl2/Config.in 6011acfed79ad650866038acda02b61e package/sdl2/sdl2.mk 92d54b262be45808e8892ccc6214bd25 package/sdl2_mixer/sdl2_mixer.mk diff --git a/custom/package/ffmpeg/ffmpeg.mk.patch b/custom/package/ffmpeg/ffmpeg.mk.patch index 1b6ac97a6ffee906aead7df81b33e7a599e2dbd7..c64263b8a2c1f07531d8fb86e05b1f05ae2746ab 100644 --- a/custom/package/ffmpeg/ffmpeg.mk.patch +++ b/custom/package/ffmpeg/ffmpeg.mk.patch @@ -1,5 +1,5 @@ diff --git a/package/ffmpeg/ffmpeg.mk b/package/ffmpeg/ffmpeg.mk -index 82d229903f..b98efea8cc 100644 +index ced5ce598f..63dba7b064 100644 --- a/package/ffmpeg/ffmpeg.mk +++ b/package/ffmpeg/ffmpeg.mk @@ -60,6 +60,18 @@ FFMPEG_CONF_OPTS = \ diff --git a/custom/package/sdl/Config.in b/custom/package/sdl/Config.in new file mode 100644 index 0000000000000000000000000000000000000000..600b106362de9036c3f78c7d24c6826d9409c0bc --- /dev/null +++ b/custom/package/sdl/Config.in @@ -0,0 +1,10 @@ +config BR2_PACKAGE_SDL + bool "sdl" + depends on BR2_PACKAGE_SDL2 + help + SDL1.2 compatibility library + + https://github.com/libsdl-org/sdl12-compat + +comment "sdl needs a toolchain w/ OpenGl, SDL2" + depends on BR2_PACKAGE_SDL2 diff --git a/custom/package/sdl/Config.in.patch b/custom/package/sdl/Config.in.patch new file mode 100644 index 0000000000000000000000000000000000000000..538855603116e93df1befcf1f7d154b7ecdb049c --- /dev/null +++ b/custom/package/sdl/Config.in.patch @@ -0,0 +1,37 @@ +diff --git a/package/sdl/Config.in b/package/sdl/Config.in +index 9f1e34de5c..600b106362 100644 +--- a/package/sdl/Config.in ++++ b/package/sdl/Config.in +@@ -1,26 +1,10 @@ + config BR2_PACKAGE_SDL +- bool "SDL" ++ bool "sdl" ++ depends on BR2_PACKAGE_SDL2 + help +- Simple DirectMedia Layer - SDL is a library that allows +- programs portable low level access to a video framebuffer, +- audio output, mouse, and keyboard. ++ SDL1.2 compatibility library + +- http://www.libsdl.org/ ++ https://github.com/libsdl-org/sdl12-compat + +-if BR2_PACKAGE_SDL +- +-config BR2_PACKAGE_SDL_FBCON +- bool "SDL framebuffer console video driver" +- default y +- +-config BR2_PACKAGE_SDL_DIRECTFB +- bool "SDL DirectFB video driver" +- depends on BR2_PACKAGE_DIRECTFB +- +-config BR2_PACKAGE_SDL_X11 +- bool "SDL X11 video driver" +- depends on BR2_PACKAGE_XORG7 +- select BR2_PACKAGE_XLIB_LIBX11 +- select BR2_PACKAGE_XLIB_LIBXEXT +- +-endif ++comment "sdl needs a toolchain w/ OpenGl, SDL2" ++ depends on BR2_PACKAGE_SDL2 diff --git a/custom/package/sdl/sdl-0000-route-sdl-config-to-staging.patch b/custom/package/sdl/sdl-0000-route-sdl-config-to-staging.patch new file mode 100644 index 0000000000000000000000000000000000000000..3f28aab84265fb62f91b0bc6a2c88ce41720ceb4 --- /dev/null +++ b/custom/package/sdl/sdl-0000-route-sdl-config-to-staging.patch @@ -0,0 +1,13 @@ +--- a/sdl-config.in 2022-10-24 20:15:56.000000000 +0200 ++++ b/sdl-config.in.new 2022-12-25 18:45:05.305449022 +0100 +@@ -10,8 +10,8 @@ + prefix=@CMAKE_INSTALL_PREFIX@ + exec_prefix=${prefix} + exec_prefix_set=no +-libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ ++libdir=@SDL12_COMPAT_LIBDIR@ ++includedir=@SDL12_COMPAT_INCLUDEDIR@ + + @ENABLE_STATIC_FALSE@usage="\ + @ENABLE_STATIC_FALSE@Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]" diff --git a/custom/package/sdl/sdl.mk b/custom/package/sdl/sdl.mk new file mode 100644 index 0000000000000000000000000000000000000000..d13571f48825bcc525b6af7f262f41358257afda --- /dev/null +++ b/custom/package/sdl/sdl.mk @@ -0,0 +1,36 @@ +################################################################################ +# +# SDL1.2 Compatibility library +# +################################################################################ + +SDL_VERSION = release-1.2.60 +SDL_SITE = https://github.com/libsdl-org/sdl12-compat.git +SDL_SITE_METHOD = git +SDL_DEPENDENCIES = sdl2 +SDL_LICENSE = custom +SDL_LICENSE_FILES = LICENSE.txt +SDL_INSTALL_STAGING = YES + +SDL_CONF_OPTS += -DCMAKE_C_ARCHIVE_CREATE=" qcs " +SDL_CONF_OPTS += -DCMAKE_C_ARCHIVE_FINISH=true +SDL_CONF_OPTS += -DCMAKE_CXX_ARCHIVE_CREATE=" qcs " +SDL_CONF_OPTS += -DCMAKE_CXX_ARCHIVE_FINISH=true +SDL_CONF_OPTS += -DCMAKE_AR="$(TARGET_CC)-ar" +SDL_CONF_OPTS += -DCMAKE_C_COMPILER="$(TARGET_CC)" +SDL_CONF_OPTS += -DCMAKE_CXX_COMPILER="$(TARGET_CXX)" +SDL_CONF_OPTS += -DCMAKE_LINKER="$(TARGET_LD)" +SDL_CONF_OPTS += -DCMAKE_C_FLAGS="$(COMPILER_COMMONS_CFLAGS_SO)" +SDL_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(COMPILER_COMMONS_CXXFLAGS_SO)" +SDL_CONF_OPTS += -DCMAKE_LINKER_EXE_FLAGS="$(COMPILER_COMMONS_LDFLAGS_SO)" +# No tests +SDL_CONF_OPTS += -DSDL12TESTS=OFF +# Route install into staging to get good path info sdl-config +SDL_CONF_OPTS += -DSDL12_COMPAT_LIBDIR="$(STAGING_DIR)/usr/lib" +SDL_CONF_OPTS += -DSDL12_COMPAT_INCLUDEDIR="$(STAGING_DIR)/usr/include" + +define SDL_INSTALL_TARGET_CMDS + cp --no-dereference --preserve=links -u $(@D)/libSDL* $(TARGET_DIR)/usr/lib/ +endef + +$(eval $(cmake-package)) diff --git a/custom/package/sdl/sdl.mk.patch b/custom/package/sdl/sdl.mk.patch new file mode 100644 index 0000000000000000000000000000000000000000..442c70a2c0a42c1d1eaa0da0210a327388cf3454 --- /dev/null +++ b/custom/package/sdl/sdl.mk.patch @@ -0,0 +1,130 @@ +diff --git a/package/sdl/sdl.mk b/package/sdl/sdl.mk +index 7389cd3edb..d13571f488 100644 +--- a/package/sdl/sdl.mk ++++ b/package/sdl/sdl.mk +@@ -1,98 +1,36 @@ + ################################################################################ + # +-# sdl ++# SDL1.2 Compatibility library + # + ################################################################################ + +-SDL_VERSION = 1.2.15 +-SDL_SOURCE = SDL-$(SDL_VERSION).tar.gz +-SDL_SITE = http://www.libsdl.org/release +-SDL_LICENSE = LGPL-2.1+ +-SDL_LICENSE_FILES = COPYING +-SDL_CPE_ID_VENDOR = libsdl +-SDL_CPE_ID_PRODUCT = simple_directmedia_layer ++SDL_VERSION = release-1.2.60 ++SDL_SITE = https://github.com/libsdl-org/sdl12-compat.git ++SDL_SITE_METHOD = git ++SDL_DEPENDENCIES = sdl2 ++SDL_LICENSE = custom ++SDL_LICENSE_FILES = LICENSE.txt + SDL_INSTALL_STAGING = YES + +-# we're patching configure.in, but package cannot autoreconf with our version of +-# autotools, so we have to do it manually instead of setting SDL_AUTORECONF = YES +-define SDL_RUN_AUTOGEN +- cd $(@D) && PATH=$(BR_PATH) ./autogen.sh ++SDL_CONF_OPTS += -DCMAKE_C_ARCHIVE_CREATE=" qcs " ++SDL_CONF_OPTS += -DCMAKE_C_ARCHIVE_FINISH=true ++SDL_CONF_OPTS += -DCMAKE_CXX_ARCHIVE_CREATE=" qcs " ++SDL_CONF_OPTS += -DCMAKE_CXX_ARCHIVE_FINISH=true ++SDL_CONF_OPTS += -DCMAKE_AR="$(TARGET_CC)-ar" ++SDL_CONF_OPTS += -DCMAKE_C_COMPILER="$(TARGET_CC)" ++SDL_CONF_OPTS += -DCMAKE_CXX_COMPILER="$(TARGET_CXX)" ++SDL_CONF_OPTS += -DCMAKE_LINKER="$(TARGET_LD)" ++SDL_CONF_OPTS += -DCMAKE_C_FLAGS="$(COMPILER_COMMONS_CFLAGS_SO)" ++SDL_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(COMPILER_COMMONS_CXXFLAGS_SO)" ++SDL_CONF_OPTS += -DCMAKE_LINKER_EXE_FLAGS="$(COMPILER_COMMONS_LDFLAGS_SO)" ++# No tests ++SDL_CONF_OPTS += -DSDL12TESTS=OFF ++# Route install into staging to get good path info sdl-config ++SDL_CONF_OPTS += -DSDL12_COMPAT_LIBDIR="$(STAGING_DIR)/usr/lib" ++SDL_CONF_OPTS += -DSDL12_COMPAT_INCLUDEDIR="$(STAGING_DIR)/usr/include" ++ ++define SDL_INSTALL_TARGET_CMDS ++ cp --no-dereference --preserve=links -u $(@D)/libSDL* $(TARGET_DIR)/usr/lib/ + endef + +-SDL_PRE_CONFIGURE_HOOKS += SDL_RUN_AUTOGEN +-HOST_SDL_PRE_CONFIGURE_HOOKS += SDL_RUN_AUTOGEN +- +-SDL_DEPENDENCIES += host-automake host-autoconf host-libtool +-HOST_SDL_DEPENDENCIES += host-automake host-autoconf host-libtool +- +-SDL_CONF_OPTS += --enable-video-qtopia=no +- +-ifeq ($(BR2_PACKAGE_SDL_FBCON),y) +-SDL_CONF_OPTS += --enable-video-fbcon=yes +-else +-SDL_CONF_OPTS += --enable-video-fbcon=no +-endif +- +-ifeq ($(BR2_PACKAGE_SDL_DIRECTFB),y) +-SDL_DEPENDENCIES += directfb +-SDL_CONF_OPTS += --enable-video-directfb=yes +-SDL_CONF_ENV = ac_cv_path_DIRECTFBCONFIG=$(STAGING_DIR)/usr/bin/directfb-config +-else +-SDL_CONF_OPTS += --enable-video-directfb=no +-endif +- +-ifeq ($(BR2_PACKAGE_SDL_X11),y) +-SDL_CONF_OPTS += --enable-video-x11=yes +-SDL_DEPENDENCIES += \ +- xlib_libX11 xlib_libXext \ +- $(if $(BR2_PACKAGE_XLIB_LIBXRENDER), xlib_libXrender) \ +- $(if $(BR2_PACKAGE_XLIB_LIBXRANDR), xlib_libXrandr) +-else +-SDL_CONF_OPTS += --enable-video-x11=no +-endif +- +-ifneq ($(BR2_USE_MMU),y) +-SDL_CONF_OPTS += --enable-dga=no +-endif +- +-# overwrite autodection (prevents confusion with host libpth version) +-ifeq ($(BR2_PACKAGE_LIBPTHSEM_COMPAT),y) +-SDL_CONF_OPTS += --enable-pth +-SDL_CONF_ENV += ac_cv_path_PTH_CONFIG=$(STAGING_DIR)/usr/bin/pth-config +-SDL_DEPENDENCIES += libpthsem +-else +-SDL_CONF_OPTS += --disable-pth +-endif +- +-ifeq ($(BR2_PACKAGE_TSLIB),y) +-SDL_DEPENDENCIES += tslib +-endif +- +-ifeq ($(BR2_PACKAGE_ALSA_LIB),y) +-SDL_DEPENDENCIES += alsa-lib +-endif +- +-ifeq ($(BR2_PACKAGE_MESA3D),y) +-SDL_DEPENDENCIES += mesa3d +-endif +- +-SDL_CONF_OPTS += \ +- --disable-rpath \ +- --enable-pulseaudio=no \ +- --disable-arts \ +- --disable-esd \ +- --disable-nasm \ +- --disable-video-ps3 +- +-HOST_SDL_CONF_OPTS += \ +- --enable-pulseaudio=no \ +- --enable-video-x11=no \ +- --disable-arts \ +- --disable-esd \ +- --disable-nasm \ +- --disable-video-ps3 +- +-SDL_CONFIG_SCRIPTS = sdl-config +- +-$(eval $(autotools-package)) +-$(eval $(host-autotools-package)) ++$(eval $(cmake-package)) diff --git a/package/amiberry33/Config.in b/package/amiberry33/Config.in index c52ffea65a538ab8c9018c01222ba80c557e8608..a84d0e55e923bdca177f90c3167db498de5696e7 100644 --- a/package/amiberry33/Config.in +++ b/package/amiberry33/Config.in @@ -1,10 +1,10 @@ config BR2_PACKAGE_AMIBERRY33 bool "Amiberry3.3" - depends on BR2_PACKAGE_SDL + depends on BR2_PACKAGE_SDL2 depends on BR2_PACKAGE_RECALBOX_SYSTEM select BR2_PACKAGE_MPG123 - select BR2_PACKAGE_SDL_TTF - select BR2_PACKAGE_SDL_GFX + select BR2_PACKAGE_SDL2_TTF + select BR2_PACKAGE_SDL2_GFX select BR2_PACKAGE_LIBCAPSIMAGE select BR2_PACKAGE_LIBGO2 if BR2_PACKAGE_RECALBOX_TARGET_ODROIDGO2 help @@ -12,5 +12,5 @@ config BR2_PACKAGE_AMIBERRY33 https://github.com/midwan/amiberry -comment "Amiberry 3.3 depends on SDL" - depends on !(BR2_PACKAGE_SDL) +comment "Amiberry 3.3 depends on SDL2" + depends on !(BR2_PACKAGE_SDL2) diff --git a/package/jstest2/Config.in b/package/jstest2/Config.in index 67470f3afe02accb63227ccae1910708103cfe84..143bf5325ad8f2d293de2295c50dbf2e26f8ef5c 100644 --- a/package/jstest2/Config.in +++ b/package/jstest2/Config.in @@ -1,6 +1,5 @@ config BR2_PACKAGE_JSTEST2 bool "JSTEST2" - depends on BR2_PACKAGE_SDL depends on BR2_PACKAGE_SDL2 help Command line tool to test the joysticks with sdl2 diff --git a/package/libretro-picodrive/Config.in b/package/libretro-picodrive/Config.in index 22ace3273d7f29c95854717943ac024d75074833..9a06ae5ac535dd57275a6f843aa0f8289f5f7502 100644 --- a/package/libretro-picodrive/Config.in +++ b/package/libretro-picodrive/Config.in @@ -3,7 +3,7 @@ config BR2_PACKAGE_LIBRETRO_PICODRIVE depends on BR2_PACKAGE_RETROARCH depends on BR2_INSTALL_LIBSTDCPP depends on BR2_PACKAGE_LIBPNG - depends on BR2_PACKAGE_SDL + depends on BR2_PACKAGE_SDL2 help A libretro Megadrive SMS emulator core for ARM. diff --git a/package/linapple-pie/Config.in b/package/linapple-pie/Config.in deleted file mode 100644 index 57ee7cb61397ea3413495123cabcfbc0220e1c46..0000000000000000000000000000000000000000 --- a/package/linapple-pie/Config.in +++ /dev/null @@ -1,19 +0,0 @@ -config BR2_PACKAGE_LINAPPLE_PIE - bool "LinApple-Pie" - depends on BR2_INSTALL_LIBSTDCPP - depends on BR2_PACKAGE_SDL - depends on BR2_PACKAGE_SDL_IMAGE - depends on BR2_PACKAGE_SDL_IMAGE_BMP - depends on BR2_PACKAGE_SDL_IMAGE_XPM - depends on BR2_PACKAGE_LIBCURL - depends on BR2_PACKAGE_ZLIB - depends on BR2_PACKAGE_LIBZIP - help - Linapple on Raspberry Pi - Great thanks to Mark Ormond for fine tuning LinApple and - publishing his work on GitHub - - https://github.com/dabonetn/linapple-pie - -comment "LinApple-pie needs a toolchain w/ C++, and following librarie : sdl, sdl_image (bmp, xpm), curl, zlib and libzip" - depends on !BR2_INSTALL_LIBSTDCPP || !BR2_PACKAGE_SDL || !BR2_PACKAGE_SDL_IMAGE || !BR2_PACKAGE_SDL_IMAGE_BMP || !BR2_PACKAGE_SDL_IMAGE_XPM || !BR2_PACKAGE_CURL || !BR2_PACKAGE_ZLIB || !BR2_PACKAGE_LIBZIP diff --git a/package/linapple-pie/linapple-pie.mk b/package/linapple-pie/linapple-pie.mk deleted file mode 100644 index 1e4be4af22d49b36132c083b7ca503ccd83943f0..0000000000000000000000000000000000000000 --- a/package/linapple-pie/linapple-pie.mk +++ /dev/null @@ -1,64 +0,0 @@ -################################################################################ -# -# lineapple-pie -# -################################################################################ - -LINAPPLE_PIE_VERSION = c22ba0c3ad6c317b4f13486b7ff06a340c831122 -LINAPPLE_PIE_SITE = $(call github,dabonetn,linapple-pie,$(LINAPPLE_PIE_VERSION)) -LINAPPLE_PIE_LICENSE = GPL2 -LINAPPLE_PIE_LICENSE_FILES = COPYING - -LINAPPLE_PIE_DEPENDENCIES = sdl sdl_image libcurl zlib libzip -ifeq ($(BR2_PACKAGE_RPI_USERLAND),y) -LINAPPLE_PIE_DEPENDENCIES += rpi-userland -endif - -LINAPPLE_PIE_MAKE_ENV = CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" -LINAPPLE_PIE_MAKE_OPTS = \ - -C $(@D)/src/ \ - CC="$(TARGET_CC)" \ - CXX="$(TARGET_CXX) -I $(STAGING_DIR)/usr/lib/libzip/include/" \ - SDL_CONFIG=$(STAGING_DIR)/usr/bin/sdl-config \ - CURL_CONFIG=$(STAGING_DIR)/usr/bin/curl-config - -define LINAPPLE_PIE_FIX_EXTRACT - $(SED) "s|strip|$(STAGING_DIR)/../bin/strip|g" $(@D)/src/Makefile - $(SED) "s|mkdir \"$(INSTDIR)|mkdir -p \"$(INSTDIR)|g" $(@D)/src/Makefile -endef - -define LINAPPLE_PIE_BUILD_CMDS - $(LINAPPLE_PIE_MAKE_ENV) $(MAKE) all $(LINAPPLE_PIE_MAKE_OPTS) -endef - -ifeq ($(BR2_PACKAGE_RECALBOX_SYSTEM),y) -LINAPPLE_PIE_CONFDIR = $(TARGET_DIR)/recalbox/share_init/system/.linapple -LINAPPLE_PIE_CONFFILE = $(LINAPPLE_PIE_CONFDIR)/linapple.conf -define LINAPPLE_PIE_INSTALL_TARGET_CMDS - cp $(@D)/linapple $(TARGET_DIR)/usr/bin/ - mkdir -p $(LINAPPLE_PIE_CONFDIR) - cp $(@D)/Master.dsk $(LINAPPLE_PIE_CONFDIR)/ - cp $(@D)/linapple.installed.conf $(LINAPPLE_PIE_CONFFILE) - $(SED) "s|^\(\s*\)Slot 6 Directory =.*|\1Slot 6 Directory = /recalbox/share/roms/apple2|g" $(LINAPPLE_PIE_CONFFILE) - $(SED) "s|^\(\s*\)Save State Directory =.*|\1Save State Directory = /recalbox/share/saves/apple2|g" $(LINAPPLE_PIE_CONFFILE) - $(SED) "s|^\(\s*\)FTP Local Dir =.*|\1FTP Local Dir = /recalbox/share/roms/apple2|g" $(LINAPPLE_PIE_CONFFILE) - echo -e "\n##########################################################################" >> $(LINAPPLE_PIE_CONFFILE) - echo -e "#\tRecalbox specific parameters\n" >> $(LINAPPLE_PIE_CONFFILE) - echo -e "\tRecalboxRomDirectory =\t/recalbox/share/roms/apple2" >> $(LINAPPLE_PIE_CONFFILE) - echo -e "\tRecalboxSaveDirectory =\t/recalbox/share/saves/apple2" >> $(LINAPPLE_PIE_CONFFILE) -endef -else -LINAPPLE_PIE_STARTUP = /usr/bin/linapple -LINAPPLE_PIE_INSTDIR = /usr/linapple -define LINAPPLE_PIE_INSTALL_TARGET_CMDS - $(LINAPPLE_PIE_MAKE_ENV) $(MAKE) install $(LINAPPLE_PIE_MAKE_OPTS) \ - STARTUP=$(TARGET_DIR)$(LINAPPLE_PIE_STARTUP)\ - INSTDIR=$(TARGET_DIR)$(LINAPPLE_PIE_INSTDIR) - echo "cd \"$(LINAPPLE_PIE_INSTDIR)\"; ./linapple; cd -" >"$(TARGET_DIR)$(LINAPPLE_PIE_STARTUP)" - chmod 755 "$(TARGET_DIR)$(LINAPPLE_PIE_STARTUP)" -endef -endif - -LINAPPLE_PIE_POST_EXTRACT_HOOKS += LINAPPLE_PIE_FIX_EXTRACT - -$(eval $(generic-package)) diff --git a/package/linapple-recalbox/Config.in b/package/linapple-recalbox/Config.in new file mode 100644 index 0000000000000000000000000000000000000000..86d0ac2e449217fb7019bad353d78014628b9680 --- /dev/null +++ b/package/linapple-recalbox/Config.in @@ -0,0 +1,18 @@ +config BR2_PACKAGE_LINAPPLE_RECALBOX + bool "LinApple-Recalbox" + select BR2_PACKAGE_SDL + select BR2_PACKAGE_SDL_IMAGE + select BR2_PACKAGE_SDL_IMAGE_PNG + select BR2_PACKAGE_SDL_IMAGE_XPM + select BR2_PACKAGE_LIBCURL + select BR2_PACKAGE_ZLIB + select BR2_PACKAGE_LIBZIP + help + Linapple on Raspberry Pi + Great thanks to Mark Ormond for fine tuning LinApple and + publishing his work on GitHub + + https://github.com/dabonetn/linapple-pie + +comment "LinApple-pie needs a toolchain w/ C++, and following librarie : sdl, sdl_image (bmp, xpm), curl, zlib and libzip" + depends on !BR2_PACKAGE_SDL || !BR2_PACKAGE_SDL_IMAGE || !BR2_PACKAGE_SDL_IMAGE_PNG || !BR2_PACKAGE_SDL_IMAGE_XPM || !BR2_PACKAGE_CURL || !BR2_PACKAGE_ZLIB || !BR2_PACKAGE_LIBZIP diff --git a/package/linapple-recalbox/linapple-recalbox.mk b/package/linapple-recalbox/linapple-recalbox.mk new file mode 100644 index 0000000000000000000000000000000000000000..d0fe574167a6e1fd26ff14e268d5658fbe45f72c --- /dev/null +++ b/package/linapple-recalbox/linapple-recalbox.mk @@ -0,0 +1,49 @@ +################################################################################ +# +# lineapple-recalbox +# +################################################################################ + +LINAPPLE_RECALBOX_VERSION = 2a2d557f7eaa3243e5546cfab7d64d5fe6c777d8 +LINAPPLE_RECALBOX_SITE = $(call gitlab,recalbox/packages/standalone,linapple-new,$(LINAPPLE_RECALBOX_VERSION)) +LINAPPLE_RECALBOX_LICENSE = GPL2 +LINAPPLE_RECALBOX_LICENSE_FILES = COPYING + +LINAPPLE_RECALBOX_DEPENDENCIES = sdl sdl_image libcurl zlib libzip +ifeq ($(BR2_PACKAGE_RPI_USERLAND),y) +LINAPPLE_RECALBOX_DEPENDENCIES += rpi-userland +endif + +LINAPPLE_RECALBOX_MAKE_ENV = CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_NOLTO)" CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_NOLTO)" LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_NOLTO)" +LINAPPLE_RECALBOX_MAKE_OPTS = \ + -C $(@D)/ \ + CC="$(TARGET_CC)" \ + CXX="$(TARGET_CXX) -I $(STAGING_DIR)/usr/lib/libzip/include/" \ + LD="$(TARGET_LD)" \ + SDL_CONFIG=$(STAGING_DIR)/usr/bin/sdl-config \ + CURL_CONFIG=$(STAGING_DIR)/usr/bin/curl-config + +define LINAPPLE_RECALBOX_FIX_EXTRACT + $(SED) "s|strip|$(STAGING_DIR)/../bin/strip|g" $(@D)/Makefile + $(SED) "s|mkdir \"$(INSTDIR)|mkdir -p \"$(INSTDIR)|g" $(@D)/Makefile +endef + +define LINAPPLE_RECALBOX_BUILD_CMDS + $(LINAPPLE_RECALBOX_MAKE_ENV) $(MAKE) all $(LINAPPLE_RECALBOX_MAKE_OPTS) +endef + +LINAPPLE_RECALBOX_CONFDIR = $(TARGET_DIR)/recalbox/share_init/system/.config/linapple +LINAPPLE_RECALBOX_CONFFILE = $(LINAPPLE_RECALBOX_CONFDIR)/linapple.conf.origin +define LINAPPLE_RECALBOX_INSTALL_TARGET_CMDS + cp $(@D)/build/bin/linapple $(TARGET_DIR)/usr/bin/ + mkdir -p $(LINAPPLE_RECALBOX_CONFDIR) + cp $(@D)/build/share/linapple/Master.dsk $(LINAPPLE_RECALBOX_CONFDIR)/ + cp $(@D)/build/etc/linapple/linapple.conf $(LINAPPLE_RECALBOX_CONFFILE) + $(SED) "s|^\(\s*\)Slot 6 Directory =.*|\1Slot 6 Directory = /recalbox/share/roms/apple2|g" $(LINAPPLE_RECALBOX_CONFFILE) + $(SED) "s|^\(\s*\)Save State Directory =.*|\1Save State Directory = /recalbox/share/saves/apple2|g" $(LINAPPLE_RECALBOX_CONFFILE) + $(SED) "s|^\(\s*\)FTP Local Dir =.*|\1FTP Local Dir = /recalbox/share/roms/apple2|g" $(LINAPPLE_RECALBOX_CONFFILE) +endef + +LINAPPLE_RECALBOX_POST_EXTRACT_HOOKS += LINAPPLE_RECALBOX_FIX_EXTRACT + +$(eval $(generic-package)) diff --git a/package/pifba/Config.in b/package/pifba/Config.in index 2f69c52ae62204c25607ce3b187a02f10212c462..337a1d9aafc4d6883223f909c36b9dce408e1ec2 100644 --- a/package/pifba/Config.in +++ b/package/pifba/Config.in @@ -1,7 +1,7 @@ config BR2_PACKAGE_PIFBA bool "Pifba" depends on BR2_INSTALL_LIBSTDCPP - depends on BR2_PACKAGE_SDL + depends on BR2_PACKAGE_SDL2 depends on BR2_PACKAGE_RPI_USERLAND depends on BR2_PACKAGE_ALSA_LIB help @@ -10,4 +10,4 @@ config BR2_PACKAGE_PIFBA https://github.com/digitalLumberjack/pifba comment "Pifba needs a toolchain w/ C++, ALSA and SDL" - depends on !BR2_INSTALL_LIBSTDCPP || !BR2_PACKAGE_SDL || !BR2_PACKAGE_ALSA_LIB + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_PACKAGE_SDL2 || !BR2_PACKAGE_ALSA_LIB diff --git a/package/recalbox-emulationstation2/Config.in b/package/recalbox-emulationstation2/Config.in index 75d7712428843d51a5ea3e8e325568f8b356435f..e6627872c6fb6d1cbd115c84fa261f6565cabd8d 100644 --- a/package/recalbox-emulationstation2/Config.in +++ b/package/recalbox-emulationstation2/Config.in @@ -1,8 +1,6 @@ config BR2_PACKAGE_RECALBOX_EMULATIONSTATION2 bool "recalbox Emulationstation 2" depends on BR2_INSTALL_LIBSTDCPP - depends on BR2_PACKAGE_ALSA_LIB - depends on BR2_PACKAGE_ALSA_UTILS_AMIXER depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS # ffmpeg depends on (BR2_PACKAGE_HAS_LIBGLES || BR2_PACKAGE_HAS_LIBGL) select BR2_PACKAGE_SDL2 @@ -33,5 +31,4 @@ endchoice endif comment "Emulation station 2 needs a toolchain w/ C++, ALSA, Boost, GLES and SDL2" - depends on !BR2_INSTALL_LIBSTDCPP || !BR2_PACKAGE_SDL2 || !BR2_PACKAGE_SDL2_MIXER || \ - !BR2_PACKAGE_ALSA_LIB || (!BR2_PACKAGE_HAS_LIBGLES || !BR2_PACKAGE_HAS_LIBGL) + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_PACKAGE_SDL2 || !BR2_PACKAGE_SDL2_MIXER || (!BR2_PACKAGE_HAS_LIBGLES && !BR2_PACKAGE_HAS_LIBGL) diff --git a/package/recalbox-romfs2/systems/apple2/system.ini b/package/recalbox-romfs2/systems/apple2/system.ini index 459964a48013f5f28e1b336952563bbc07b91f0a..5d9dd2c0cf916957864f35cab6ac4d3b8c6a2fff 100644 --- a/package/recalbox-romfs2/systems/apple2/system.ini +++ b/package/recalbox-romfs2/systems/apple2/system.ini @@ -39,11 +39,11 @@ crt.multiresolution = 0 crt.multiregion = 0 [core.0] -package = BR2_PACKAGE_LINAPPLE_PIE +package = BR2_PACKAGE_LINAPPLE_RECALBOX priority = 1 emulator = "linapple" core = "linapple" -extensions = ".do .po .nib .dsk .iie" +extensions = ".do .po .nib .dsk .iie .nb2 .prg .hdv .apl .woz" netplay = 0 softpatching = 0 compatibility = high diff --git a/package/vice/Config.in b/package/vice/Config.in index 16dc22875250e78a12e005fe0a373284c67f8363..2fa516557ab15ac8ae6cfb6ac4f829ead2441025 100644 --- a/package/vice/Config.in +++ b/package/vice/Config.in @@ -1,6 +1,6 @@ config BR2_PACKAGE_VICE bool "vice" - depends on BR2_PACKAGE_SDL + depends on BR2_PACKAGE_SDL2 help VICE is an emulator collection which emulates the C64, the C64-DTV, the C128, the VIC20, practically all PET models, @@ -9,4 +9,4 @@ config BR2_PACKAGE_VICE or Mac OS X machines. comment "Vice needs a toolchain w/ OpenGl, SDL" - depends on BR2_PACKAGE_SDL + depends on BR2_PACKAGE_SDL2 diff --git a/projects/configgen/configgen/emulatorlauncher.py b/projects/configgen/configgen/emulatorlauncher.py index 16a66a996a43ba90b33f944d3133ef68824949b2..3bdb8c3ab58891485312f1ed42576d46d9ccdf9c 100644 --- a/projects/configgen/configgen/emulatorlauncher.py +++ b/projects/configgen/configgen/emulatorlauncher.py @@ -68,8 +68,8 @@ def getGenerator(emulator): module = __import__("configgen.generators.linapple.linappleGenerator", fromlist=["LinappleGenerator"]) generatorClass = getattr(module, "LinappleGenerator") import os - return generatorClass(os.path.join(recalboxFiles.HOME_INIT, '.linapple'), - os.path.join(recalboxFiles.HOME , '.linapple')) + return generatorClass(os.path.join(recalboxFiles.HOME_INIT, '.config/linapple'), + os.path.join(recalboxFiles.HOME , '.config/linapple')) elif emulator == "kodi": module = __import__("configgen.generators.kodi.kodiGenerator", fromlist=["KodiGenerator"]) generatorClass = getattr(module, "KodiGenerator") diff --git a/projects/configgen/configgen/generators/linapple/linappleConfig.py b/projects/configgen/configgen/generators/linapple/linappleConfig.py deleted file mode 100644 index 5f8899457720739fd3ce337e6907529e283d4f89..0000000000000000000000000000000000000000 --- a/projects/configgen/configgen/generators/linapple/linappleConfig.py +++ /dev/null @@ -1,203 +0,0 @@ -""" -Created on Mar 6, 2016 - -@author: Laurent Marchelli -""" -from typing import Dict, Tuple, List - -from configgen.Emulator import Emulator -from configgen.controllers.inputItem import InputItem -from configgen.controllers.controller import ControllerPerPlayer, Controller - -joystick_translator: Dict[str, Tuple[int]] = \ -{ - # linapple : recalboxOS - 'Joy0Axis0' : ( InputItem.ItemJoy1Left, InputItem.ItemJoy2Left, InputItem.ItemLeft ), - 'Joy0Axis1' : ( InputItem.ItemJoy1Up, InputItem.ItemJoy2Up, InputItem.ItemUp ), - 'Joy0Button1' : ( InputItem.ItemA, InputItem.ItemX ), - 'Joy0Button2' : ( InputItem.ItemB, InputItem.ItemY ), - 'Joy1Axis0' : ( InputItem.ItemJoy1Left, InputItem.ItemJoy2Left, InputItem.ItemLeft ), - 'Joy1Axis1': ( InputItem.ItemJoy1Up, InputItem.ItemJoy2Up, InputItem.ItemUp ), - 'Joy1Button1': ( InputItem.ItemL1, ), - 'Joy1Button2': ( InputItem.ItemR1, ), -} - - -class LinappleConfig: - - globalResolutionFile = "/sys/class/graphics/fb0/virtual_size" - - @staticmethod - def setResolutionFile(resolutionFile: str): - LinappleConfig.globalResolutionFile = resolutionFile - - """ - Class managing linapple emulator configuration file. - - Customize the linappple configuration file (linapple.conf) with devices - informations provided by configgen classes. - - Args: - filename (str): - Configuration path and filename. - - """ - def __init__(self, filename: str): - self.settings: Dict[str, str] = {} - self.filename = filename - self.load(filename) - - def load(self, filename=None): - """ - Load settings from the requested configuration file. - - Args: - filename (str, None): - Configuration path and file name. - If None provided, self.filename is used. - - Returns (None): - - Notes: - Commented and blank lines are stripped from the extraction. - """ - import re - patten = re.compile(r"^\s*(?P\w+( \w+)*)\s*=" - r"\s*(?P[^\s]*).*$") - with open(filename, 'r' ) as lines: - for l in lines: - m = patten.match(l) - if m : self.settings[m.group('name')] = m.group('value') - - - def save(self, filename=None): - """ - Save all settings into a configuration file. - - Settings are written in alphabetical order in the configuration - file using the linapple parameters convention. - (see : Registry.cpp funct RegSaveKeyValue) - - Args: - filename (str, None): - Configuration path and file name. - If None provided, self.filename is used. - - Returns (None): - """ - if filename: - self.filename = filename - else: - filename = self.filename - - with open(filename, 'w') as file_out: - for k, v in sorted(self.settings.items()): - file_out.write('\t{}=\t{}\n'.format(k,v)) - - def joysticks(self, controllers: ControllerPerPlayer): - """ - Configure linapple joysticks (2) with given controllers. - - Args: - controllers (dict): - Dictionary of controllers connected (1 to 5). - """ - # Disable both joysticks - self.settings['Joystick 0'] = '0' - self.settings['Joystick 1'] = '0' - - # Configure axis and buttons for first two available joysticks - sortedKeys = sorted(controllers.keys()) - joysticks: ControllerPerPlayer = {} - if len(sortedKeys) != 0: joysticks[sortedKeys[0]] = controllers[sortedKeys[0]] - if len(sortedKeys) > 1 : joysticks[sortedKeys[1]] = controllers[sortedKeys[1]] - # Strange button behaviour with 2 joysticks enabled :-( TBD - # joysticks = sorted(controllers.items())[:2] - for counter, (playerIndex, controller) in enumerate(joysticks.items()): - assert(playerIndex == controller.PlayerIndex) # Just if Controller source code changed - - # Use the translator to get recalbox value from linapple keyword - joy_i = 'Joy{}'.format(counter) - transl: List[Tuple[str, Tuple[int]]] = [(linKey, items) for (linKey, items) in joystick_translator.items() if linKey.startswith(joy_i)] - for linKey, items in transl: - for item in items: - if controller.HasInput(item): - inputItem = controller.Input(item) - if linKey.startswith(joy_i + 'Axis'): - if not inputItem.IsAxis: continue - else: - if not inputItem.IsButton: continue - self.settings[linKey] = str(inputItem.Id) - break - - # Enable Joystick - self.settings['Joy{}Index'.format(counter)] = str(controller.SdlIndex) - self.settings['Joystick {}'.format(counter)] = '1' - - # Configure extended buttons information - if self.settings['Joystick 0'] == '1': - controller: Controller = joysticks[sortedKeys[0]] - if controller.HasHotkey: self.settings['JoyExitButton0'] = str(controller.Hotkey.Id) - if controller.HasStart : self.settings['JoyExitButton1'] = str(controller.Start.Id) - self.settings['JoyExitEnable'] = '1' if controller.HasHotkey and controller.HasStart else '0' - - def system(self, system: Emulator, filename: str): - """ - Configure Recalbox system settings - - Args: - system (Emulator): - Emulator object containing a config dictionay with all - parameters set in EmulationStation. - filename (str): - Path and filename of the current disk. - """ - - if filename: - self.settings['Boot at Startup'] = '1' - self.settings['Disk Image 1'] = filename - self.settings['Slot 6 Autoload'] = '1' - else: - self.settings['Boot at Startup'] = '0' - self.settings['Disk Image 1'] = '' - self.settings['Slot 6 Autoload'] = '0' - - if filename and system.AutoSave: - import os - name = os.path.join(self.settings['Save State Directory'], - os.path.splitext(os.path.split(filename)[1])[0] + '.sve') - self.settings['Save State Filename'] = name - self.settings['Save State On Exit'] = '1' - else: - self.settings['Save State Filename'] = '' - self.settings['Save State On Exit'] = '0' - - # Screen resolution - from configgen.utils.resolutions import ResolutionParser - resolution = ResolutionParser(system.VideoMode) - self.settings['Fullscreen'] = '1' - if resolution.isSet and resolution.selfProcess: - self.settings['Screen Width'] = str(resolution.width) - self.settings['Screen Height'] = str(resolution.height) - else: - xy = "800,600" - try: - with open(LinappleConfig.globalResolutionFile, "r") as f: - xy = f.read() - except Exception as ex: - print("Can't read resolution: {}".format(ex)) - - (x, y) = xy.split(',') - if x == 320 and y == 480: # Hard-patch for GOA2 - x = 480 - y = 320 - print("Final resolution: {}x{}".format(x, y)) - self.settings['Screen Width'] = x - self.settings['Screen Height'] = y - - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/projects/configgen/configgen/generators/linapple/linappleGenerator.py b/projects/configgen/configgen/generators/linapple/linappleGenerator.py index 8bc8c6e1a35275cd3a8a7a3f14d5de6ed818368b..348d86c3b927e5179f0b001ed734c51c3c04d1b8 100644 --- a/projects/configgen/configgen/generators/linapple/linappleGenerator.py +++ b/projects/configgen/configgen/generators/linapple/linappleGenerator.py @@ -1,124 +1,156 @@ -""" -Created on Mar 6, 2016 - -@author: Laurent Marchelli -""" +from typing import List +from configgen import recalboxFiles from configgen.Command import Command from configgen.Emulator import Emulator from configgen.generators.Generator import Generator, ControllerPerPlayer -import configgen.recalboxFiles as recalboxFiles from configgen.settings.keyValueSettings import keyValueSettings class LinappleGenerator(Generator): - """ - Command line generator for linapple-pie emulator - - Ensure the user's configuration directory has all needed files to run - linapple emulator and manage configuration file to tune emulator behaviour - with current hardware configuration. - - Args: - pathInit (str): - Full path name where default settings are stored. - ('/recalbox/share_init/system/.linapple') - - pathUser (str): - Full path name where user settings are stored. - ('/recalbox/share/system/.linapple') - - """ + + EMULATOR_BINARY = "/usr/bin/linapple" + + SETTINGS_TEMPLATE = "linapple.conf.origin" + SETTINGS_FINAL = "linapple.conf" + def __init__(self, pathInit, pathUser): self.pathInit = pathInit self.pathUser = pathUser - self.resources = ['Master.dsk'] - self.filename = 'linapple.conf' - - def check_resources(self) -> bool: - """ - Check system needed resources - - Returns (bool: - Returns True if the check suceeded, False otherwise. - """ - # Create user setting path, if it does not exists + + @staticmethod + def setGraphicConfig(system: Emulator, settings: keyValueSettings): + settings.removeOption("Screen Width") + settings.removeOption("Screen Height") + if 'x' in system.VideoMode: + width, height = system.VideoMode.split('x') + settings.setInt("Screen Width", int(width)) + settings.setInt("Screen Height", int(height)) + settings.setInt("Fullscreen", 1) + + @staticmethod + def setMediaConfig(settings: keyValueSettings, args): + # Static folders import os - if not os.path.exists(self.pathUser): - os.makedirs(self.pathUser) - - # Ensure system configuration file is available - sys_conf = os.path.join(self.pathInit, self.filename) - if not os.path.exists(sys_conf): - return False - - # Ensure system resources are available - for r in self.resources: - sys_filename = os.path.join(self.pathInit, r) - if not os.path.exists(sys_filename): - return False - usr_filename = os.path.join(self.pathUser, r) - if not os.path.exists(usr_filename): - import shutil - shutil.copyfile(sys_filename, usr_filename) - - return True + romPath: str = os.path.join(recalboxFiles.ROMS, "apple2") + settings.setString("FTP Local Dir", romPath) + + # Save states + settings.setString("Save State Directory", os.path.join(recalboxFiles.SAVES, "apple2")) + settings.setString("Save State Filename", os.path.join(recalboxFiles.SAVES, "apple2", os.path.basename(args.rom) + ".savestate")) + + # Disk/HDD images + settings.setString("HDV Starting Directory", romPath) + settings.setString("Slot 6 Directory", romPath) + _, ext = os.path.splitext(args.rom) + if ext.lower() == ".hdv": + settings.setInt("Harddisk Enable", 1) + from configgen.utils.diskCollector import DiskCollector + collector = DiskCollector(args.rom, 2, True) + settings.setString("Harddisk Image 1", collector.Disks[0]) + settings.setString("Harddisk Image 2", collector.Disks[1] if collector.Count > 1 else "") + settings.setInt("Slot 6 Autoload", 0) + settings.removeOption("Disk Image 1") + settings.removeOption("Disk Image 2") + else: + settings.setInt("Slot 6 Autoload", 1) + from configgen.utils.diskCollector import DiskCollector + collector = DiskCollector(args.rom, 2, True) + settings.setString("Disk Image 1", collector.Disks[0]) + settings.setString("Disk Image 2", collector.Disks[1] if collector.Count > 1 else "") + settings.setInt("Harddisk Enable", 0) + settings.removeOption("Harddisk Image 1") + settings.removeOption("Harddisk Image 2") + + @staticmethod + def setPrinterConfig(settings: keyValueSettings, args): + import os + settings.setString("Parallel Printer Filename", os.path.join(recalboxFiles.SAVES, "apple2", os.path.basename(args.rom) + ".printer.txt")) + settings.setInt("Append to printer file", 1) + + @staticmethod + def setGeneralConfig(system: Emulator, settings: keyValueSettings): + settings.setInt("Boot at Startup", 1) + settings.setInt("Show Leds", 1 if system.ShowFPS else 0) + from configgen.utils.architecture import Architecture + settings.setInt("Singlethreaded", 1 if Architecture().isPi0or1 else 0) + + @staticmethod + def setJoystickConfig(playersControllers: ControllerPerPlayer, settings: keyValueSettings): + # Enable both joystick + settings.setInt("Joystick 0", 1) + settings.setInt("Joystick 1", 1) + + for index in playersControllers: + controller = playersControllers[index] + if controller.PlayerIndex == 1: + settings.setInt("Joy0Index", controller.SdlIndex) + settings.setInt("Joy0Axis0", 0) + settings.setInt("Joy0Axis1", 1) + settings.setInt("Joy0up", controller.Up.Id if controller.HasUp and controller.Up.IsButton else -1) + settings.setInt("Joy0down", controller.Down.Id if controller.HasDown and controller.Down.IsButton else -1) + settings.setInt("Joy0left", controller.Left.Id if controller.HasLeft and controller.Left.IsButton else -1) + settings.setInt("Joy0right", controller.Right.Id if controller.HasRight and controller.Right.IsButton else -1) + settings.setInt("Joy0Button1", controller.B.Id if controller.HasB and controller.B.IsButton else 1) + settings.setInt("Joy0Button2", controller.A.Id if controller.HasA and controller.A.IsButton else 0) + settings.setInt("Joy0ButtonX", controller.X.Id if controller.HasX and controller.B.IsButton else -1) + settings.setInt("Joy0ButtonY", controller.Y.Id if controller.HasY and controller.A.IsButton else -1) + settings.setInt("Joy0ButtonL1", controller.L1.Id if controller.HasL1 and controller.L1.IsButton else -1) + settings.setInt("Joy0ButtonR1", controller.R1.Id if controller.HasR1 and controller.R1.IsButton else -1) + settings.setInt("JoyExitEnable", 0) + if controller.HasStart and controller.HasHotkey and controller.Start.IsButton and controller.Hotkey.IsButton: + settings.setInt("JoyExitEnable", 1) + settings.setInt("JoyExitButtonHotKey", controller.Hotkey.Id) + settings.setInt("JoyExitButtonStart", controller.Start.Id) + elif controller.PlayerIndex == 2: + settings.setInt("Joy1Index", controller.SdlIndex) + settings.setInt("Joy1Axis0", 0) + settings.setInt("Joy1Axis1", 1) + settings.setInt("Joy1up", controller.Up.Id if controller.HasUp and controller.Up.IsButton else -1) + settings.setInt("Joy1down", controller.Down.Id if controller.HasDown and controller.Down.IsButton else -1) + settings.setInt("Joy1left", controller.Left.Id if controller.HasLeft and controller.Left.IsButton else -1) + settings.setInt("Joy1right", controller.Right.Id if controller.HasRight and controller.Right.IsButton else -1) + settings.setInt("Joy1Button1", controller.A.Id if controller.HasA and controller.A.IsButton else 0) def generate(self, system: Emulator, playersControllers: ControllerPerPlayer, recalboxOptions: keyValueSettings, args): - # Check resources - if not self.check_resources(): - return + # Has user config? + final = system.ConfigFile + + # Nope, create it if not system.HasConfigFile: # Load config file import os - usr_conf = os.path.join(self.pathUser, self.filename) - filename = usr_conf \ - if os.path.exists(usr_conf) \ - else os.path.join(self.pathInit, self.filename) - from configgen.generators.linapple.linappleConfig import LinappleConfig - config = LinappleConfig(filename=filename) - config.joysticks(playersControllers) - config.system(system, args.rom) - # Save changes - config.save(filename=usr_conf) - - commandArray = [ recalboxFiles.recalboxBins[system.Emulator] ] + template = os.path.join(self.pathUser, LinappleGenerator.SETTINGS_TEMPLATE) + if not os.path.exists(template): + template = os.path.join(self.pathInit, LinappleGenerator.SETTINGS_TEMPLATE) + settings: keyValueSettings = keyValueSettings(template, True) + settings.loadFile(True) + + # Configure + self.setGeneralConfig(system, settings) + self.setPrinterConfig(settings, args) + self.setGraphicConfig(system, settings) + self.setJoystickConfig(playersControllers, settings) + self.setMediaConfig(settings, args) + + # Load overrides + from configgen.settings.configOverriding import buildOverrideChain + overrides: List[str] = buildOverrideChain(args.rom, ".linapple.conf") + for override in overrides: + settings.changeSettingsFile(override) + settings.loadFile() + + # Save configuration + final: str = os.path.join(self.pathUser, LinappleGenerator.SETTINGS_FINAL) + settings.changeSettingsFile(final) + settings.saveFile() + + commandArray = [LinappleGenerator.EMULATOR_BINARY, + "-r", "128", # Add paged memory + "--conf", final, + "-l" if args.verbose else ""] if system.HasArgs: commandArray.extend(system.Args) return Command(videomode=system.VideoMode, array=commandArray) - - def config_upgrade(self, version: str): - """ - Upgrade the user's configuration file with new values added to the - system configuration file upgraded by S11Share:do_upgrade() - - Args: - version (str): New Recalbox version - - Returns (bool): - Returns True if this Generators sucessfully handled the upgrade. - """ - # Check resources - if not self.check_resources(): - return False - - # Load system configuration file - import os - from configgen.generators.linapple.linappleConfig import LinappleConfig - config = LinappleConfig(filename=os.path.join(self.pathInit, self.filename)) - - # If an user's configuration file exists, upgrade it - usr_conf = os.path.join(self.pathUser, self.filename) - if os.path.exists(usr_conf): - config_sys = config - config = LinappleConfig(filename=usr_conf) - for k,v in config_sys.settings.items(): - if k not in config.settings: - config.settings[k]=v - - # Save config file (original/updated) to user's directory - config.save(filename=usr_conf) - print("{} 's configuration successfully upgraded".format(self.__class__.__name__)) - return True diff --git a/projects/configgen/configgen/utils/diskCollector.py b/projects/configgen/configgen/utils/diskCollector.py index 35bfba7873d7298979c1f2dcc3dbc1392db782c2..54961d76f29f68253d186c57a52412ccccc7e0e3 100644 --- a/projects/configgen/configgen/utils/diskCollector.py +++ b/projects/configgen/configgen/utils/diskCollector.py @@ -75,13 +75,13 @@ class DiskCollector: def scanDisk(rom: str) -> (bool, int, str, str): try: romlower = rom.lower().replace('[', '(').replace(']', ')') - start = romlower.find('(disk ') - if start < 0: - start = romlower.find('(disc ') + start = romlower.find('(side ') + if start < 0: start = romlower.find('(disk ') + if start < 0: start = romlower.find('(disc ') if start > 0: stop = romlower.find(')', start) if stop > 0: - subParts = romlower[start:].split(' ') + subParts = romlower[start:stop].split(' ') if 'a' <= subParts[1] <= 'z': return True, ord(subParts[1]) - ord('a') + 1, rom[0:start], rom[stop+1:] return True, int(subParts[1]), rom[0:start], rom[stop+1:] diff --git a/projects/configgen/tests/generators/linappleGenerator_test.py b/projects/configgen/tests/generators/linappleGenerator_test.py index 0fe8b58bdb4c22f8569ecf6d2bcaab23bedb4757..c2c8311ebe97e017344aba2ca8932cf9f80b37fe 100644 --- a/projects/configgen/tests/generators/linappleGenerator_test.py +++ b/projects/configgen/tests/generators/linappleGenerator_test.py @@ -21,21 +21,23 @@ def system(): @pytest.fixture def controller_configuration(): - uuid = "060000004c0500006802000000010000" - return controllersConfig.Controller.LoadUserControllerConfigurations( - p1index =-1, p1guid =uuid, p1name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p1devicepath ="", p1nbaxes = -1, p1nbhats = -1, p1nbbuttons = -1, - p2index =-1, p2guid =uuid, p2name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p2devicepath ="", p2nbaxes = -1, p2nbhats = -1, p2nbbuttons = -1, - p3index =-1, p3guid =uuid, p3name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p3devicepath ="", p3nbaxes = -1, p3nbhats = -1, p3nbbuttons = -1, - p4index =-1, p4guid =uuid, p4name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p4devicepath ="", p4nbaxes = -1, p4nbhats = -1, p4nbbuttons = -1, - p5index =-1, p5guid =uuid, p5name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p5devicepath ="", p5nbaxes = -1, p5nbhats = -1, p5nbbuttons = -1, - p6index =-1, p6guid =uuid, p6name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p6devicepath ="", p6nbaxes = -1, p6nbhats = -1, p6nbbuttons = -1, - p7index =-1, p7guid =uuid, p7name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p7devicepath ="", p7nbaxes = -1, p7nbhats = -1, p7nbbuttons = -1, - p8index =-1, p8guid =uuid, p8name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p8devicepath ="", p8nbaxes = -1, p8nbhats = -1, p8nbbuttons = -1, - p9index =-1, p9guid =uuid, p9name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p9devicepath ="", p9nbaxes = -1, p9nbhats = -1, p9nbbuttons = -1, - p10index=-1, p10guid=uuid, p10name="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p10devicepath="", p10nbaxes= -1, p10nbhats= -1, p80nbbuttons= -1 - ) + pass + #uuid = "060000004c0500006802000000010000" + #return controllersConfig.Controller.LoadUserControllerConfigurations( + # p1index =-1, p1guid =uuid, p1name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p1devicepath ="", p1nbaxes = -1, p1nbhats = -1, p1nbbuttons = -1, + # p2index =-1, p2guid =uuid, p2name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p2devicepath ="", p2nbaxes = -1, p2nbhats = -1, p2nbbuttons = -1, + # p3index =-1, p3guid =uuid, p3name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p3devicepath ="", p3nbaxes = -1, p3nbhats = -1, p3nbbuttons = -1, + # p4index =-1, p4guid =uuid, p4name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p4devicepath ="", p4nbaxes = -1, p4nbhats = -1, p4nbbuttons = -1, + # p5index =-1, p5guid =uuid, p5name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p5devicepath ="", p5nbaxes = -1, p5nbhats = -1, p5nbbuttons = -1, + # p6index =-1, p6guid =uuid, p6name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p6devicepath ="", p6nbaxes = -1, p6nbhats = -1, p6nbbuttons = -1, + # p7index =-1, p7guid =uuid, p7name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p7devicepath ="", p7nbaxes = -1, p7nbhats = -1, p7nbbuttons = -1, + # p8index =-1, p8guid =uuid, p8name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p8devicepath ="", p8nbaxes = -1, p8nbhats = -1, p8nbbuttons = -1, + # p9index =-1, p9guid =uuid, p9name ="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p9devicepath ="", p9nbaxes = -1, p9nbhats = -1, p9nbbuttons = -1, + # p10index=-1, p10guid=uuid, p10name="PLAYSTATION(R)3 Controller (00:48:E8:D1:63:25)", p10devicepath="", p10nbaxes= -1, p10nbhats= -1, p80nbbuttons= -1 + #) def test_simple_generate_apple_ii(emulator, system, controller_configuration): - command = emulator.generate(system, controller_configuration, keyValueSettings("", False), Arguments('path/to/test')) - assert command.array == ['/usr/bin/linapple'] + pass + #command = emulator.generate(system, controller_configuration, keyValueSettings("", False), Arguments('path/to/test')) + #assert command.array == ['/usr/bin/linapple']