X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=common%2Fmenu.c;h=16d4342d4fc4a25b5d74bac064d96c4b0533ba62;hb=0ae25549b5066ea8b42216ec875f5c3c5d5bd8d6;hp=7fc7ba531cd70387b6dfe4ffa4e982fc743d3503;hpb=c09d5a010d3835ac1812da1aeb114c17705fbac1;p=libpicofe.git diff --git a/common/menu.c b/common/menu.c index 7fc7ba5..16d4342 100644 --- a/common/menu.c +++ b/common/menu.c @@ -322,5 +322,25 @@ int me_process(menu_entry *entries, int count, menu_id id, int is_next) } } - +const char *me_region_name(unsigned int code, int auto_order) +{ + static const char *names[] = { "Auto", " Japan NTSC", " Japan PAL", " USA", " Europe" }; + static const char *names_short[] = { "", " JP", " JP", " US", " EU" }; + int u, i = 0; + if (code) { + code <<= 1; + while((code >>= 1)) i++; + if (i > 4) return "unknown"; + return names[i]; + } else { + static char name[24]; + strcpy(name, "Auto:"); + for (u = 0; u < 3; u++) { + i = 0; code = ((auto_order >> u*4) & 0xf) << 1; + while((code >>= 1)) i++; + strcat(name, names_short[i]); + } + return name; + } +}