Skip to content

Commit

Permalink
Add support for basic scanlines without requiring double height/doubl…
Browse files Browse the repository at this point in the history
…e writes
  • Loading branch information
IanSB committed Jan 9, 2021
1 parent 7cdd628 commit cb16f97
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
13 changes: 12 additions & 1 deletion src/geometry.c
Expand Up @@ -429,6 +429,13 @@ void geometry_get_fb_params(capture_info_t *capinfo) {

if ((capinfo->detected_sync_type & SYNC_BIT_INTERLACED) && capinfo->video_type != VIDEO_PROGRESSIVE) {
capinfo->sizex2 |= 1;
} else {
if (get_scanlines() && !(menu_active() || osd_active())) {
if ((capinfo->sizex2 & 1) == 0) {
capinfo->sizex2 |= 4; //flag basic scanlines
}
capinfo->sizex2 |= 1; // force double height
}
}

int geometry_h_offset = geometry->h_offset;
Expand Down Expand Up @@ -537,7 +544,11 @@ void geometry_get_fb_params(capture_info_t *capinfo) {
if ((geometry_min_v_height << double_height) > v_size43) {
double_height = 0;
}
capinfo->sizex2 = double_height | (double_width << 1);
if (double_height && (capinfo->sizex2 & 4)) {
capinfo->sizex2 = double_height | (double_width << 1) | 4;
} else {
capinfo->sizex2 = double_height | (double_width << 1);
}

//log_info("unadjusted integer = %d, %d, %d, %d, %d, %d", geometry_h_offset, geometry_v_offset, geometry_min_h_width, geometry_min_v_height, geometry_max_h_width, geometry_max_v_height);

Expand Down
2 changes: 1 addition & 1 deletion src/osd.c
Expand Up @@ -4422,7 +4422,7 @@ int osd_key(int key) {

case A4_SCANLINES:
clear_menu_bits();
if ((capinfo->sizex2 & 1) & ( (capinfo->video_type == VIDEO_PROGRESSIVE) || (capinfo->video_type == !VIDEO_PROGRESSIVE && !(capinfo->detected_sync_type & SYNC_BIT_INTERLACED)) ) ) {
if ((capinfo->video_type == VIDEO_PROGRESSIVE) || (capinfo->video_type == !VIDEO_PROGRESSIVE && !(capinfo->detected_sync_type & SYNC_BIT_INTERLACED)) ) {
set_feature(F_SCANLINES, 1 - get_feature(F_SCANLINES));
if (get_feature(F_SCANLINES)) {
osd_set(0, ATTR_DOUBLE_SIZE, "Scanlines on");
Expand Down
10 changes: 7 additions & 3 deletions src/rgb_to_fb.S
Expand Up @@ -220,6 +220,9 @@ skip_swap:
tst r9, #1
bicne r3, r3, #BIT_NO_LINE_DOUBLE
orreq r3, r3, #BIT_NO_LINE_DOUBLE
tst r9, #4
orrne r3, r3, #BIT_NO_LINE_DOUBLE
bicne r9, #1

ldr r8, param_video_type
cmp r8, #1 //VIDEO_INTERLACED
Expand Down Expand Up @@ -258,7 +261,7 @@ skip_double_check:
add r7, r7, #28 // main index initially points to fast 4bpp or fast 8bpp (20-21)

cmp r8, #0 // palette control?
cmpeq r9, #0 // double size?
tsteq r9, #3 // double size?
tsteq r3, #BIT_OLD_FIRMWARE_SUPPORT // if version < 3 have to do the second PSYNC read
movne r7, r10 // if any are enabled make index point to non-fast versions

Expand Down Expand Up @@ -627,8 +630,9 @@ skip_fix_vsync_jitter:
addne r11, r11, r2
subeq r11, r11, r2
nointadj:

tst r3, #BIT_NO_LINE_DOUBLE
ldr r6, param_fb_sizex2
eor r6, r6, #1
tst r6, #1 //now 0 if double height
tsteq r3, #BIT_INTERLACED_VIDEO
addeq r11, r11, r2
tst r3, #BIT_ELK
Expand Down

0 comments on commit cb16f97

Please sign in to comment.