From 348c285caacbb125184bd3a21562bdc4b11ad0b3 Mon Sep 17 00:00:00 2001 From: Mario Montminy Date: Sun, 19 Jul 2020 09:33:35 -0400 Subject: [PATCH 1/3] corrected clipping issue with battlezone, major havoc --- advance/osd/dvg.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/advance/osd/dvg.c b/advance/osd/dvg.c index d45cefb47..da84d55b3 100644 --- a/advance/osd/dvg.c +++ b/advance/osd/dvg.c @@ -769,6 +769,19 @@ int dvg_update(point *p, int num_points) y1 = p->arg2; transform_coords(&x0, &y0); transform_coords(&x1, &y1); + // Make sure the clip coordinates fall within the display coordinates. + if (x0 > DVG_RES_MAX) { + x0 = DVG_RES_MAX; + } + if (y0 > DVG_RES_MAX) { + y0 = DVG_RES_MAX; + } + if (x1 > DVG_RES_MAX) { + x1 = DVG_RES_MAX; + } + if (y1 > DVG_RES_MAX) { + y1 = DVG_RES_MAX; + } s_clipx_min = x0; s_clipy_min = y0; s_clipx_max = x1; From 5a856f706494991a9cf1b5d6815fd4617d2d383c Mon Sep 17 00:00:00 2001 From: Mario Montminy Date: Sun, 19 Jul 2020 16:52:52 -0400 Subject: [PATCH 2/3] Corrected clipping issue in major havoc --- advance/osd/dvg.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/advance/osd/dvg.c b/advance/osd/dvg.c index da84d55b3..f67beda40 100644 --- a/advance/osd/dvg.c +++ b/advance/osd/dvg.c @@ -117,6 +117,8 @@ static uint32_t s_in_vec_last_y; static vector_t *s_out_vec_list; static uint32_t s_out_vec_cnt; +static void transform_final(int *px, int *py); + // // Function to compute region code for a point(x, y) // @@ -465,6 +467,7 @@ static void cmd_add_point(int x, int y, int r, int g, int b) } } } + transform_final(&x, &y); cmd = (FLAG_XY << 29) | ((blank & 0x1) << 28) | ((x & 0x3fff) << 14) | (y & 0x3fff); if (s_cmd_offs <= (CMD_BUF_SIZE - 8)) { s_cmd_buf[s_cmd_offs++] = cmd >> 24; @@ -723,6 +726,18 @@ static void transform_final(int *px, int *py) if (s_flip_y) { y = DVG_RES_MAX - y; } + if (x < 0) { + x = 0; + } + else if (x > DVG_RES_MAX) { + x = DVG_RES_MAX; + } + if (y < 0) { + y = 0; + } + else if (y > DVG_RES_MAX) { + y = DVG_RES_MAX; + } *px = x; *py = y; } @@ -803,7 +818,6 @@ int dvg_update(point *p, int num_points) b = RGB_BLUE(col); } transform_coords(&x, &y); - transform_final(&x, &y); cmd_add_vec(x, y, r, g, b); } p++; From 1a2283a93dcda8c1c83ceb2865b7c94f88413962 Mon Sep 17 00:00:00 2001 From: Mario Montminy Date: Thu, 23 Jul 2020 09:45:31 -0400 Subject: [PATCH 3/3] Update glue.c No exit menu on quiet mode - Needed when you have a vector menu. --- advance/osd/glue.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/advance/osd/glue.c b/advance/osd/glue.c index 9954f814c..13f66712c 100644 --- a/advance/osd/glue.c +++ b/advance/osd/glue.c @@ -1002,7 +1002,7 @@ static struct glue_keyboard_name GLUE_KEYBOARD_STD[] = { KR2("period", "period", ".") KR2("slash", "slash", "/") KR2("colon", "colon", ":") - KR2("pound", "pound", "£") + KR2("pound", "pound", "£") KR2("doublequote", "doublequote", "\"") KR2("diesis", "diessi", "#") @@ -2595,6 +2595,12 @@ static int on_exit_menu(int selected) int sel; int total; + /* Quiet option - no dialog */ + if (options.skip_warnings) { + /* Return exit */ + return -5; + } + sel = selected; total = 0;