diff --git a/menu.cpp b/menu.cpp index 1558c59..836395d 100644 --- a/menu.cpp +++ b/menu.cpp @@ -179,9 +179,7 @@ static uint32_t menu_timer = 0; extern const char *version; -const char *config_tos_mem[] = { "512 kB", "1 MB", "2 MB", "4 MB", "8 MB", "14 MB", "--", "--" }; const char *config_tos_wrprot[] = { "None", "A:", "B:", "A: and B:" }; -const char *config_tos_usb[] = { "none", "control", "debug", "serial", "parallel", "midi" }; const char *config_scanlines_msg[] = { "Off", "HQ2x", "CRT 25%" , "CRT 50%" , "CRT 75%" }; const char *config_ar_msg[] = { "4:3", "16:9" }; @@ -228,10 +226,6 @@ static const char *info_bottom = "\x85\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x static const char* HELPTEXT_SPACER = " "; static char helptext_custom[1024]; -const char* scanlines[] = { "Off","25%","50%","75%" }; -const char* stereo[] = { "Mono","Stereo" }; -const char* atari_chipset[] = { "ST","STE","MegaSTE","STEroids" }; - // file selection menu variables static char fs_pFileExt[13] = "xxx"; static uint32_t fs_ExtLen = 0; @@ -2906,7 +2900,7 @@ void HandleUI(void) OsdWrite(m++); strcpy(s, " Memory: "); - strcat(s, config_tos_mem[(tos_system_ctrl() >> 1) & 7]); + strcat(s, tos_mem[(tos_system_ctrl() >> 1) & 7]); OsdWrite(m++, s, menusub == 3); snprintf(s, 29, " TOS: %s", tos_get_image_name()); @@ -2914,7 +2908,7 @@ void HandleUI(void) strcpy(s, " Chipset: "); // extract TOS_CONTROL_STE and TOS_CONTROL_MSTE bits - strcat(s, atari_chipset[(tos_system_ctrl() >> 23) & 3]); + strcat(s, tos_chipset[(tos_system_ctrl() >> 23) & 3]); OsdWrite(m++, s, menusub == 5); // Blitter is always present in >= STE @@ -2944,11 +2938,11 @@ void HandleUI(void) OsdWrite(m++, s, menusub == 10); strcpy(s, " Scanlines: "); - strcat(s, scanlines[(tos_system_ctrl() >> 20) & 3]); + strcat(s, tos_scanlines[(tos_system_ctrl() >> 20) & 3]); OsdWrite(m++, s, menusub == 11); strcpy(s, " YM-Audio: "); - strcat(s, stereo[(tos_system_ctrl() & TOS_CONTROL_STEREO) ? 1 : 0]); + strcat(s, tos_stereo[(tos_system_ctrl() & TOS_CONTROL_STEREO) ? 1 : 0]); OsdWrite(m++, s, menusub == 12); for (; m < OsdGetSize() - 1; m++) OsdWrite(m); @@ -2962,7 +2956,7 @@ void HandleUI(void) if (menu) { menustate = MENU_ST_MAIN1; - menusub = 3; + menusub = 4; if(need_reset) tos_reset(1); } else if (select) @@ -3058,7 +3052,7 @@ void HandleUI(void) case 13: menustate = MENU_ST_MAIN1; - menusub = 3; + menusub = 4; if (need_reset) tos_reset(1); break; } @@ -3087,32 +3081,28 @@ void HandleUI(void) case MENU_ST_LOAD_CONFIG1: helptext = helptexts[HELPTEXT_NONE]; - m = 0; - if (parentstate != menustate) // First run? - { - menumask = 0x21; - if (tos_config_exists(1)) menumask |= 0x02; - if (tos_config_exists(2)) menumask |= 0x04; - if (tos_config_exists(3)) menumask |= 0x08; - if (tos_config_exists(4)) menumask |= 0x10; - } - parentstate = menustate; - parentstate = menustate; OsdSetTitle("Load Config", 0); + if (parentstate != menustate) // First run? + { + parentstate = menustate; + menumask = 0x201; + for (uint32_t i = 1; i < 9; i++) if (tos_config_exists(i)) menumask |= 1<> 1) & 7]); + strcat(str, " "); + if (tmp.acsi_img[0][0]) strcat(str, "H0 "); + if (tmp.acsi_img[1][0]) strcat(str, "H1 "); + if (tmp.cart_img[0]) strcat(str, "CR "); + strcat(str, tos_chipset_short[(tmp.system_ctrl >> 23) & 3]); + strcat(str, " "); + if (!((tmp.system_ctrl >> 23) & 3) && (tmp.system_ctrl & TOS_CONTROL_BLITTER)) strcat(str, "B "); + if (tmp.system_ctrl & TOS_CONTROL_VIKING) strcat(str, "V "); + if (tmp.system_ctrl & TOS_CONTROL_VIDEO_AR) strcat(str, "W "); + strcat(str, (tmp.system_ctrl & TOS_CONTROL_VIDEO_COLOR) ? "C " : "M "); + if (!(tmp.system_ctrl & TOS_CONTROL_BORDER)) strcat(str, "F "); + int sl = (tmp.system_ctrl >> 20) & 3; + if (sl) sprintf(str + strlen(str), "S%d ", sl); + strcat(str, (tmp.system_ctrl & TOS_CONTROL_STEREO) ? "AS " : "AM "); + + if (tmp.tos_img[0]) + { + char *p = strrchr(tmp.tos_img, '/'); + if (!p) p = tmp.tos_img; else p++; + int len = strlen(p); + if (len >= 4) len -= 4; + memcpy(str + strlen(str), p, len); + } + return str; + } + + return "< empty slot >"; +} diff --git a/support/st/st_tos.h b/support/st/st_tos.h index 652fe33..5d4da4e 100644 --- a/support/st/st_tos.h +++ b/support/st/st_tos.h @@ -67,8 +67,14 @@ #define TOS_CONTROL_BORDER 0x20000000 -unsigned long tos_system_ctrl(void); +extern const char* tos_mem[]; +extern const char* tos_scanlines[]; +extern const char* tos_stereo[]; +extern const char* tos_chipset[]; +const char* tos_get_cfg_string(int num); + +unsigned long tos_system_ctrl(); void tos_upload(const char *); void tos_poll(); void tos_update_sysctrl(uint32_t ctrl);