Skip to content

Commit

Permalink
Update Arm conditional build options
Browse files Browse the repository at this point in the history
  • Loading branch information
IanSB committed Nov 24, 2021
1 parent abdcaeb commit 198c023
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 44 deletions.
4 changes: 2 additions & 2 deletions src/defs.h
Expand Up @@ -11,8 +11,8 @@
//do not leave USE_ARM_CAPTURE uncommented during a release build as all versions will be ARM
//#define USE_ARM_CAPTURE //uncomment to select ARM capture build

#define USE_ALT_M7DEINTERLACE_CODE // uses re-ordered code for mode7 deinterlace
#define USE_CACHED_SCREEN // caches the upper half of the screen area and uses it for mode7 deinterlace
//#define USE_ALT_M7DEINTERLACE_CODE // uses re-ordered code for mode7 deinterlace
//#define USE_CACHED_SCREEN // caches the upper half of the screen area and uses it for mode7 deinterlace
#define CACHED_SCREEN_OFFSET 0x00B00000 // offset to cached screen area
#define CACHED_SCREEN_SIZE 0x00100000 // size of cached screen area

Expand Down
51 changes: 34 additions & 17 deletions src/filesystem.c
Expand Up @@ -8,6 +8,7 @@
#include "rgb_to_fb.h"
#include "geometry.h"
#include "rgb_to_hdmi.h"
#include "startup.h"

#define USE_LODEPNG

Expand Down Expand Up @@ -585,33 +586,49 @@ 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 && (read_cpld_version() >> VERSION_DESIGN_BIT) != DESIGN_SIMPLE)
|| strcmp(fno.fname, "Amiga_2000") == 0
|| strcmp(fno.fname, "Amiga_Var-Scanlines") == 0
|| strcmp(fno.fname, "Amiga_Blk-Scanlines") == 0
|| strcmp(fno.fname, "Atari_ST") == 0
|| strcmp(fno.fname, "Atari_STE") == 0
|| strcmp(fno.fname, "Apple_IIGS") == 0))
#endif
{
#ifdef USE_ARM_CAPTURE
if (_get_hardware_id() == _RPI2 || _get_hardware_id() == _RPI3) {
if (!((strcmp(fno.fname, "Amiga") == 0 && (read_cpld_version() >> VERSION_DESIGN_BIT) != DESIGN_SIMPLE)
|| strcmp(fno.fname, "Amiga_2000") == 0
|| strcmp(fno.fname, "Amiga_Var-Scanlines") == 0
|| strcmp(fno.fname, "Amiga_Blk-Scanlines") == 0
|| strcmp(fno.fname, "Atari_ST") == 0
|| strcmp(fno.fname, "Atari_STE") == 0
|| strcmp(fno.fname, "Apple_IIGS") == 0)) {
strncpy(profile_names[*count], fno.fname, MAX_PROFILE_WIDTH);
(*count)++;
}
} else {
strncpy(profile_names[*count], fno.fname, MAX_PROFILE_WIDTH);
(*count)++;
}
}
#else
strncpy(profile_names[*count], fno.fname, MAX_PROFILE_WIDTH);
(*count)++;
#endif
} 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) {
#ifdef HIDE_12BIT_PROFILES
if (!(strcmp(fno.fname, "BBC_NuLA_3bpp_Mode7.txt") == 0
|| strcmp(fno.fname, "Sam_Coupe.txt") == 0
|| strcmp(fno.fname, "BBC_NuLA_12bpp_Mode7.txt") == 0))
#endif
{
#ifdef USE_ARM_CAPTURE
if (_get_hardware_id() == _RPI2 || _get_hardware_id() == _RPI3) {
if (!(strcmp(fno.fname, "BBC_NuLA_3bpp_Mode7.txt") == 0
|| strcmp(fno.fname, "Sam_Coupe.txt") == 0
|| strcmp(fno.fname, "BBC_NuLA_12bpp_Mode7.txt") == 0)) {
strncpy(profile_names[*count], fno.fname, MAX_PROFILE_WIDTH);
profile_names[*count][strlen(fno.fname) - 4] = 0;
(*count)++;
}
} else {
strncpy(profile_names[*count], fno.fname, MAX_PROFILE_WIDTH);
profile_names[*count][strlen(fno.fname) - 4] = 0;
(*count)++;
}
#else
strncpy(profile_names[*count], fno.fname, MAX_PROFILE_WIDTH);
profile_names[*count][strlen(fno.fname) - 4] = 0;
(*count)++;
#endif
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/geometry.c
Expand Up @@ -462,9 +462,11 @@ void geometry_get_fb_params(capture_info_t *capinfo) {
capinfo->bpp = 8; //force 8bpp in 1 & 3 bit modes as no capture loops for 1 or 3 bit capture into 16bpp buffer
}

#ifdef INHIBIT_DOUBLE_HEIGHT
if (capinfo->video_type == VIDEO_PROGRESSIVE) {
capinfo->sizex2 &= SIZEX2_DOUBLE_WIDTH;
#ifdef USE_ARM_CAPTURE
if (_get_hardware_id() == _RPI2 || _get_hardware_id() == _RPI3) { //in ARM build have to inhibit double height on Pi2 / Pi 3 /Zero 2 otherwise you get stalling
if (capinfo->video_type == VIDEO_PROGRESSIVE) {
capinfo->sizex2 &= SIZEX2_DOUBLE_WIDTH;
}
}
#endif

Expand Down
9 changes: 0 additions & 9 deletions src/rgb_to_fb.S
Expand Up @@ -756,15 +756,6 @@ skip_line_loop:
skip_line_loop_exit:

push {r1-r5, r11}
#ifdef USE_ARM_CAPTURE
push {r3}
orr r3, r3, #BIT_OSD
ldr r12, capture_address
sub r12, r12, #4
// Call preload capture line function (runs all paths of capture code to preload it into cache - OSD version)
blx r12
pop {r3}
#endif
ldr r12, capture_address
sub r12, r12, #4
// Call preload capture line function (runs all paths of capture code to preload it into cache)
Expand Down
16 changes: 3 additions & 13 deletions src/rgb_to_hdmi.c
Expand Up @@ -3354,9 +3354,9 @@ log_info("d = %08X, %08X", xdisplay_list[0], xdisplay_list[1]);
}
osd_set(1, 0, osdline);
} else {
#if defined(WARN_12BIT)
if (capinfo->sample_width >= SAMPLE_WIDTH_9LO) {
osd_set(1, 0, "9/12BPP UNSUPPORTED with ARM capture");
#ifdef USE_ARM_CAPTURE
if ((_get_hardware_id() == _RPI2 || _get_hardware_id() == _RPI3) && capinfo->sample_width >= SAMPLE_WIDTH_9LO) {
osd_set(1, 0, "Use GPU capture version for 9/12BPP");
} else {
osd_set(1, 0, "");
}
Expand Down Expand Up @@ -3402,11 +3402,7 @@ log_info("d = %08X, %08X", xdisplay_list[0], xdisplay_list[1]);
ncapture = osd_key(OSD_SW3);
}

#if defined(WARN_12BIT)
if (powerup || (capinfo->sample_width >= SAMPLE_WIDTH_9LO && capinfo->bpp >= 16 && !osd_active())) {
#else
if (powerup) {
#endif
powerup = 0;
if (resolution_status) {
int h_size = get_hdisplay() + config_overscan_left + config_overscan_right;
Expand All @@ -3422,12 +3418,6 @@ log_info("d = %08X, %08X", xdisplay_list[0], xdisplay_list[1]);
}
osd_set(0, ATTR_DOUBLE_SIZE, osdline);
osd_display_interface(2);
#if defined(WARN_12BIT)
if(capinfo->sample_width >= SAMPLE_WIDTH_9LO && capinfo->bpp >= 16) {
osd_set(2 + 4, 0, "9BPP & 12BPP NOT SUPPORTED on ARM capture");
osd_set(2 + 5, 0, "Please use the GPU capture build");
}
#endif
ncapture = 180;
} else {
ncapture = 1;
Expand Down

0 comments on commit 198c023

Please sign in to comment.