static void mainmenu_draw(menu_t *menu) { modeset_draw(menu); /* draw the two video mode lines */ osd_gotoxy(menu->xpos + menu->xsize - 20, menu->ypos + menu->ysize - 3); osd_puts("Input : "); print_resolution(); osd_gotoxy(menu->xpos + menu->xsize - 20, menu->ypos + menu->ysize - 2); uint32_t outputlines = video_out_lines[current_videomode]; bool interlaced = false; if (current_videomode <= VIDMODE_576i && (video_settings[current_videomode] & VIDEOIF_SET_LD_ENABLE)) outputlines *= 2; if (outputlines & 1) { outputlines *= 2; interlaced = true; } printf("Output: 720x%3d%c%d", outputlines & ~3, interlaced ? 'i' : 'p', (current_videomode & 1) ? 50 : 60); }
static void print_value(menu_t *menu, unsigned int itemnum) { int value = menu->items[itemnum].value->get(); osd_gotoxy(menu->xpos + menu->xsize - 6, menu->ypos + menu->items[itemnum].line + 1); switch (menu->items[itemnum].value->type) { case VALTYPE_BOOL: if (value) osd_puts(" On"); else osd_puts(" Off"); break; case VALTYPE_EVENODD: if (value) osd_puts("Even"); else osd_puts(" Odd"); break; case VALTYPE_BYTE: case VALTYPE_SBYTE: printf("%4d", value); break; } }
void menu_draw(menu_t *menu) { const menuitem_t *items = menu->items; unsigned int i; /* draw the menu */ osd_fillbox(menu->xpos, menu->ypos, menu->xsize, menu->ysize, ' ' | ATTRIB_DIM_BG); osd_drawborder(menu->xpos, menu->ypos, menu->xsize, menu->ysize); /* run the callback, it might update the item flags */ if (menu->drawcallback) menu->drawcallback(menu); for (i = 0; i < menu->entries; i++) { if (items[i].flags & MENU_FLAG_DISABLED) osd_setattr(true, true); else osd_setattr(true, false); /* print item */ osd_gotoxy(menu->xpos + 2, menu->ypos + items[i].line + 1); osd_puts(items[i].text); if (items[i].value) { print_value(menu, i); } } }
void aboot_anim() { uint8_t i; for (i = 0; i < 3; i++) { osd_gotoxy(28, i+3); osd_puts(dude[waverseq[dude_seqno]*3+i]); } dude_seqno = (dude_seqno + 1) % 16; }
uint8_t menu_busy(uint8_t status) { char *text; switch (status) { case 0: text = state == STATE_ABOOT2 ? TXT_MENU_ABOOTHALP : TXT_MENU_HALP; break; case 1: text = TXT_MENU_BUSY; break; case 2: text = TXT_MENU_INSERT; menu_init(); break; } osd_gotoxy(0, 7); osd_puts(text); }
void draw_menu() { int m_y, m_x, item = 0; for (m_y = 0; m_y < 3; m_y++) { for (m_x = 0; m_x < 3; m_x++) { osd_inv((m_y == menu_y) && (m_x == menu_x)); draw_item(menu_item[item], 5 + m_x * 10, m_y+2, ALIGN_MIDDLE); item++; } } osd_inv(0); draw_item(ptrfile, 16, 6, ALIGN_MIDDLE); osd_inv(0); osd_gotoxy(0,7); osd_puts(TXT_MENU_HALP); }
void aboot_show() { osd_cls(1); osd_gotoxy(0,1); osd_puts(cnotice2); osd_gotoxy(0,2); osd_puts(aboot2); osd_gotoxy(0,3); osd_puts(aboot3); osd_gotoxy(0,4); osd_puts(aboot4); osd_gotoxy(0,5); osd_puts(aboot5); osd_gotoxy(0,6); osd_puts(aboot6); dude_seqno = 0; }
void draw_item(char *s, uint8_t x, uint8_t y, uint8_t align) { int len; len = strlen(s); switch (align) { case ALIGN_MIDDLE: x -= len/2; break; case ALIGN_LEFT: break; case ALIGN_RIGHT: x -= len; break; } osd_gotoxy(x, y); osd_puts(s); }
void screen_mainmenu(void) { int current_item = 0; while (1) { modeset_mode = current_videomode; /* (re)draw */ osd_clrscr(); menu_draw(&mainmenu); /* run */ current_item = menu_exec(&mainmenu, current_item); switch (current_item) { case MENU_ABORT: case MENUITEM_EXIT: return; case MENUITEM_OSDSET: screen_osdsettings(); break; case MENUITEM_OTHERSET: screen_othersettings(); break; case MENUITEM_VIEWALL: screen_allmodes(); break; case MENUITEM_ABOUT: screen_about(); break; case MENUITEM_STORE: osd_clrscr(); /* show "saving" message because page erase needs 1-3s */ osd_fillbox(13, 13, 18, 3, ' ' | ATTRIB_DIM_BG); osd_drawborder(13, 13, 18, 3); osd_gotoxy(15, 14); osd_puts("Saving..."); spiflash_write_settings(); osd_gotoxy(15, 14); osd_puts("Settings saved"); /* wait until all buttons are released */ while (pad_buttons & PAD_ALL) if (pad_buttons & PAD_VIDEOCHANGE) return; /* now wait for any button press */ pad_clear(PAD_ALL); while (!(pad_buttons & PAD_ALL)) if (pad_buttons & PAD_VIDEOCHANGE) return; pad_clear(PAD_ALL); break; default: break; } } }