# HG changeset patch # User Michael Pavone # Date 1661224799 25200 # Node ID f11f4399d64bb444a9f80ec9449dde79f565d1e6 # Parent 6f66356af4e2e4023ad736220b3ac2dd092a242c Crop display in game gear mode diff -r 6f66356af4e2 -r f11f4399d64b default.cfg --- a/default.cfg Mon Aug 22 20:05:36 2022 -0700 +++ b/default.cfg Mon Aug 22 20:19:59 2022 -0700 @@ -308,7 +308,7 @@ #comment out those two lines and uncomment these #top 11 #bottom 8 - + #these values will completely hide the horizontal border left 13 right 14 @@ -326,12 +326,21 @@ #coment out those two lines and uncomment these #top 30 #bottom 24 - + #these values will completely hide the horizontal border left 13 right 14 } } + gamegear { + overscan { + #generally shouldn't change these + top 51 + bot 48 + left 61 + right 62 + } + } } audio { diff -r 6f66356af4e2 -r f11f4399d64b render.h --- a/render.h Mon Aug 22 20:05:36 2022 -0700 +++ b/render.h Mon Aug 22 20:19:59 2022 -0700 @@ -83,6 +83,7 @@ typedef enum { VID_NTSC, VID_PAL, + VID_GAMEGEAR, NUM_VID_STD } vid_std; diff -r 6f66356af4e2 -r f11f4399d64b render_sdl.c --- a/render_sdl.c Mon Aug 22 20:05:36 2022 -0700 +++ b/render_sdl.c Mon Aug 22 20:19:59 2022 -0700 @@ -779,10 +779,10 @@ } } -static uint32_t overscan_top[NUM_VID_STD] = {2, 21}; -static uint32_t overscan_bot[NUM_VID_STD] = {1, 17}; -static uint32_t overscan_left[NUM_VID_STD] = {13, 13}; -static uint32_t overscan_right[NUM_VID_STD] = {14, 14}; +static uint32_t overscan_top[NUM_VID_STD] = {2, 21, 51}; +static uint32_t overscan_bot[NUM_VID_STD] = {1, 17, 48}; +static uint32_t overscan_left[NUM_VID_STD] = {13, 13, 61}; +static uint32_t overscan_right[NUM_VID_STD] = {14, 14, 62}; static vid_std video_standard = VID_NTSC; static uint8_t need_ui_fb_resize; @@ -941,7 +941,7 @@ } } -static char *vid_std_names[NUM_VID_STD] = {"ntsc", "pal"}; +static char *vid_std_names[NUM_VID_STD] = {"ntsc", "pal", "gamegear"}; static int display_hz; static int source_hz; static int source_frame; @@ -1504,7 +1504,7 @@ last_width = width; uint32_t height = which <= FRAMEBUFFER_EVEN - ? (video_standard == VID_NTSC ? 243 : 294) - (overscan_top[video_standard] + overscan_bot[video_standard]) + ? (video_standard == VID_PAL ? 294 : 243) - (overscan_top[video_standard] + overscan_bot[video_standard]) : 240; FILE *screenshot_file = NULL; uint32_t shot_height, shot_width; @@ -1521,7 +1521,7 @@ } free(screenshot_path); screenshot_path = NULL; - shot_height = video_standard == VID_NTSC ? 243 : 294; + shot_height = height; shot_width = width; } interlaced = last != which; @@ -1835,7 +1835,7 @@ uint32_t render_emulated_height() { - return (video_standard == VID_NTSC ? 243 : 294) - overscan_top[video_standard] - overscan_bot[video_standard]; + return (video_standard == VID_PAL ? 294 : 243) - overscan_top[video_standard] - overscan_bot[video_standard]; } uint32_t render_overscan_left() diff -r 6f66356af4e2 -r f11f4399d64b sms.c --- a/sms.c Mon Aug 22 20:05:36 2022 -0700 +++ b/sms.c Mon Aug 22 20:19:59 2022 -0700 @@ -412,7 +412,11 @@ sms_context *sms = (sms_context *)system; uint32_t target_cycle = sms->z80->Z80_CYCLE + 3420*16; //TODO: PAL support - render_set_video_standard(VID_NTSC); + if (sms->vdp->type == VDP_GAMEGEAR) { + render_set_video_standard(VID_GAMEGEAR); + } else { + render_set_video_standard(VID_NTSC); + } while (!sms->should_return) { if (system->delayed_load_slot) {