comparison render_sdl.c @ 2200:f11f4399d64b

Crop display in game gear mode
author Michael Pavone <pavone@retrodev.com>
date Mon, 22 Aug 2022 20:19:59 -0700
parents 46ee354f29bd
children b2f788f08a31
comparison
equal deleted inserted replaced
2199:6f66356af4e2 2200:f11f4399d64b
777 } 777 }
778 } 778 }
779 } 779 }
780 } 780 }
781 781
782 static uint32_t overscan_top[NUM_VID_STD] = {2, 21}; 782 static uint32_t overscan_top[NUM_VID_STD] = {2, 21, 51};
783 static uint32_t overscan_bot[NUM_VID_STD] = {1, 17}; 783 static uint32_t overscan_bot[NUM_VID_STD] = {1, 17, 48};
784 static uint32_t overscan_left[NUM_VID_STD] = {13, 13}; 784 static uint32_t overscan_left[NUM_VID_STD] = {13, 13, 61};
785 static uint32_t overscan_right[NUM_VID_STD] = {14, 14}; 785 static uint32_t overscan_right[NUM_VID_STD] = {14, 14, 62};
786 static vid_std video_standard = VID_NTSC; 786 static vid_std video_standard = VID_NTSC;
787 static uint8_t need_ui_fb_resize; 787 static uint8_t need_ui_fb_resize;
788 788
789 int lock_joystick_index(int joystick, int desired_index) 789 int lock_joystick_index(int joystick, int desired_index)
790 { 790 {
939 { 939 {
940 handle_event(&event); 940 handle_event(&event);
941 } 941 }
942 } 942 }
943 943
944 static char *vid_std_names[NUM_VID_STD] = {"ntsc", "pal"}; 944 static char *vid_std_names[NUM_VID_STD] = {"ntsc", "pal", "gamegear"};
945 static int display_hz; 945 static int display_hz;
946 static int source_hz; 946 static int source_hz;
947 static int source_frame; 947 static int source_frame;
948 static int source_frame_count; 948 static int source_frame_count;
949 static int frame_repeat[60]; 949 static int frame_repeat[60];
1502 return; 1502 return;
1503 } 1503 }
1504 1504
1505 last_width = width; 1505 last_width = width;
1506 uint32_t height = which <= FRAMEBUFFER_EVEN 1506 uint32_t height = which <= FRAMEBUFFER_EVEN
1507 ? (video_standard == VID_NTSC ? 243 : 294) - (overscan_top[video_standard] + overscan_bot[video_standard]) 1507 ? (video_standard == VID_PAL ? 294 : 243) - (overscan_top[video_standard] + overscan_bot[video_standard])
1508 : 240; 1508 : 240;
1509 FILE *screenshot_file = NULL; 1509 FILE *screenshot_file = NULL;
1510 uint32_t shot_height, shot_width; 1510 uint32_t shot_height, shot_width;
1511 char *ext; 1511 char *ext;
1512 if (screenshot_path && which == FRAMEBUFFER_ODD) { 1512 if (screenshot_path && which == FRAMEBUFFER_ODD) {
1519 } else { 1519 } else {
1520 warning("Failed to open screenshot file %s for writing\n", screenshot_path); 1520 warning("Failed to open screenshot file %s for writing\n", screenshot_path);
1521 } 1521 }
1522 free(screenshot_path); 1522 free(screenshot_path);
1523 screenshot_path = NULL; 1523 screenshot_path = NULL;
1524 shot_height = video_standard == VID_NTSC ? 243 : 294; 1524 shot_height = height;
1525 shot_width = width; 1525 shot_width = width;
1526 } 1526 }
1527 interlaced = last != which; 1527 interlaced = last != which;
1528 width -= overscan_left[video_standard] + overscan_right[video_standard]; 1528 width -= overscan_left[video_standard] + overscan_right[video_standard];
1529 #ifndef DISABLE_OPENGL 1529 #ifndef DISABLE_OPENGL
1833 return last_width - overscan_left[video_standard] - overscan_right[video_standard]; 1833 return last_width - overscan_left[video_standard] - overscan_right[video_standard];
1834 } 1834 }
1835 1835
1836 uint32_t render_emulated_height() 1836 uint32_t render_emulated_height()
1837 { 1837 {
1838 return (video_standard == VID_NTSC ? 243 : 294) - overscan_top[video_standard] - overscan_bot[video_standard]; 1838 return (video_standard == VID_PAL ? 294 : 243) - overscan_top[video_standard] - overscan_bot[video_standard];
1839 } 1839 }
1840 1840
1841 uint32_t render_overscan_left() 1841 uint32_t render_overscan_left()
1842 { 1842 {
1843 return overscan_left[video_standard]; 1843 return overscan_left[video_standard];