From 8f9942a225977e6cfa3216c1568dd3629d4d773e Mon Sep 17 00:00:00 2001 From: IanSB Date: Sat, 30 Oct 2021 14:42:32 +0100 Subject: [PATCH] Temporarily hide 9bpp & 12bpp profiles that don't work on Pi zero 2 --- src/defs.h | 1 + src/filesystem.c | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/defs.h b/src/defs.h index a8fea9fd..f26d4c8b 100644 --- a/src/defs.h +++ b/src/defs.h @@ -121,6 +121,7 @@ #if defined(RPI2) || defined(RPI3) // Pi4 may not need these #define USE_ALT_M7DEINTERLACE_CODE // uses re-ordered code for bob and simple motion deinterlace #define USE_CACHED_COMPARISON_BUFFER // uses cached memory for the comparison buffer with simple & advanced motion deinterlace +#define HIDE_12BIT_PROFILES #define INHIBIT_DOUBLE_HEIGHT // inhibit line doubling as it causes memory stalls with Pi2 & Pi3 #endif diff --git a/src/filesystem.c b/src/filesystem.c index 990d2c03..0a74dd76 100644 --- a/src/filesystem.c +++ b/src/filesystem.c @@ -585,15 +585,32 @@ void scan_profiles(char profile_names[MAX_PROFILES][MAX_PROFILE_WIDTH], int has_ res = f_readdir(&dir, &fno); if (res != FR_OK || fno.fname[0] == 0 || *count == MAX_PROFILES) break; if (fno.fattrib & AM_DIR) { +#ifdef HIDE_12BIT_PROFILES // temporarily hide 12 bit profiles on pi zero 2 + if (!(strcmp(fno.fname, "Amiga") == 0 + || strcmp(fno.fname, "Amiga_2000") == 0 + || strcmp(fno.fname, "Amiga_Var-Scanlines") == 0 + || strcmp(fno.fname, "Atari_ST") == 0 + || strcmp(fno.fname, "Atari_STE") == 0 + || strcmp(fno.fname, "Apple_IIGS") == 0)) +#endif + { strncpy(profile_names[*count], fno.fname, MAX_PROFILE_WIDTH); (*count)++; + } } else { if (fno.fname[0] != '.' && strlen(fno.fname) > 4 && strcmp(fno.fname, DEFAULTTXT_STRING) != 0) { char* filetype = fno.fname + strlen(fno.fname)-4; if (strcmp(filetype, ".txt") == 0) { - strncpy(profile_names[*count], fno.fname, MAX_PROFILE_WIDTH); - profile_names[*count][strlen(fno.fname) - 4] = 0; - (*count)++; +#ifdef HIDE_12BIT_PROFILES + if (!(strcmp(fno.fname, "Sam_Coupe.txt") == 0 + || strcmp(fno.fname, "BBC_NuLA_3bpp_Mode7.txt") == 0 + || strcmp(fno.fname, "BBC_NuLA_12bpp_Mode7.txt") == 0)) +#endif + { + strncpy(profile_names[*count], fno.fname, MAX_PROFILE_WIDTH); + profile_names[*count][strlen(fno.fname) - 4] = 0; + (*count)++; + } } } }