some fixes and adjustments
[libpicofe.git] / common / menu.c
index bb59510..16d4342 100644 (file)
@@ -225,7 +225,6 @@ void menu_init(void)
                                int tmp = parse_hex_color(buff+16);\r
                                if (tmp >= 0) menu_sel_color = tmp;\r
                                else lprintf("skin.txt: parse error for selection_color\n");\r
-                               lprintf("sel color: %04x\n", menu_sel_color);\r
                        }\r
                        else\r
                                lprintf("skin.txt: parse error: %s\n", buff);\r
@@ -323,5 +322,25 @@ int me_process(menu_entry *entries, int count, menu_id id, int is_next)
        }\r
 }\r
 \r
-\r
+const char *me_region_name(unsigned int code, int auto_order)\r
+{\r
+       static const char *names[] = { "Auto", "      Japan NTSC", "      Japan PAL", "      USA", "      Europe" };\r
+       static const char *names_short[] = { "", " JP", " JP", " US", " EU" };\r
+       int u, i = 0;\r
+       if (code) {\r
+               code <<= 1;\r
+               while((code >>= 1)) i++;\r
+               if (i > 4) return "unknown";\r
+               return names[i];\r
+       } else {\r
+               static char name[24];\r
+               strcpy(name, "Auto:");\r
+               for (u = 0; u < 3; u++) {\r
+                       i = 0; code = ((auto_order >> u*4) & 0xf) << 1;\r
+                       while((code >>= 1)) i++;\r
+                       strcat(name, names_short[i]);\r
+               }\r
+               return name;\r
+       }\r
+}\r
 \r