menu: fix for option string overflow. Hide DIP from subpage finally.

This commit is contained in:
sorgelig
2021-04-19 14:51:05 +08:00
parent e4c6778413
commit b9e12cb67c

View File

@@ -1591,7 +1591,7 @@ void HandleUI(void)
else if (!strcmp(p, "DIP"))
{
h = page;
if (arcade_sw()->dip_num)
if (!h && arcade_sw()->dip_num)
{
dip_submenu = selentry;
MenuWrite(entry, " DIP Switches \x16", menusub == selentry, 0);
@@ -1775,7 +1775,11 @@ void HandleUI(void)
while ((end > s + 1) && (*end == ' ')) end--;
*(end + 1) = 0;
strcat(s, ":");
int len = strlen(s);
if (len+l > 27) len = 27-l;
s[len++] = ':';
s[len] = 0;
l = 28 - l - strlen(s);
while (l--) strcat(s, " ");
@@ -1934,7 +1938,6 @@ void HandleUI(void)
d = 0;
inpage = !page;
if (!strcmp(p, "DIP") && page) continue;
if (strcmp(p, "DIP") && strncmp(p, "DEFMRA,", 7))
{
//Hide or Disable flag