Skip to content
Permalink
Browse files

. 修正动画在 checkkey 时不能播放的问题。(issues #208)

  • Loading branch information...
yaya
yaya committed Sep 9, 2019
1 parent 5616d7f commit 34ca1a9fd5a34423317dbdaf138e840c069b3327
Showing with 55 additions and 13 deletions.
  1. +5 −0 ChangeLog_chenall.txt
  2. +20 −1 stage2/asm.S
  3. +20 −5 stage2/builtins.c
  4. +2 −1 stage2/shared.h
  5. +8 −4 stage2/stage2.c
  6. +0 −2 stage2/term.h
@@ -1,4 +1,9 @@
更新说明:
2019-09-09(yaya)
1. setmenu 函数增加 --keyhelp-on* --keyhelp-off 参数。
2. 改进 setmenu --string 负数行设定,不随临时调整字体尺寸而变化。
3. 修正动画在 checkkey 时不能播放的问题。

2019-08-08(yaya)
菜单每秒动态更新日期时间。
1. 指定日期时间格式
@@ -15170,7 +15170,26 @@ ENTRY(console_checkkey)

9:
cmpl $0xFFFFFFFF, %edx
je 1f
jne 3f
pushl $1
call defer
popl %eax
cmpb $0, beep_enable
jz 2f
call beep_func
2:
cmpb $0, string_enable
je 2f
call string_refresh
2:
cmpl $0, graphics_inited
je 1f
cmpb $0, animated_enable
je 1f
call animated
movl $0xFFFFFFFF, %edx
jmp 1f
3:
call remap_ascii_char /* ESI changed */
1:
mov %edx, %eax
@@ -16541,7 +16541,7 @@ setmenu_func(char *arg, int flags)
if (y_count_bottom == 0)
strings[i].start_y = val; //y
else
strings[i].start_y = current_term->max_lines - val - 1;
strings[i].start_y = -(val + 1);
}
arg++;
if (safe_parse_maxint (&arg, &val))
@@ -16560,9 +16560,9 @@ setmenu_func(char *arg, int flags)
if (x_horiz_center)
{
if (string_enable && !*arg)
strings[i].start_x = ((current_term->chars_per_line - 20) >> 1) - 1; //x
strings[i].start_x = ((current_term->chars_per_line - 20) >> 1); //x
else
strings[i].start_x = ((current_term->chars_per_line - num_text_char(arg)) >> 1) - 1; //x
strings[i].start_x = ((current_term->chars_per_line - num_text_char(arg)) >> 1); //x
}
string_width = parse_string(arg);
string_total += string_width;
@@ -16708,6 +16708,16 @@ setmenu_func(char *arg, int flags)
menu_tab |= 0x10;
arg += 16;
}
else if (grub_memcmp (arg, "--keyhelp-on", 12) == 0)
{
menu_tab &= 0xfb;
arg += 12;
}
else if (grub_memcmp (arg, "--keyhelp-off", 13) == 0)
{
menu_tab |= 4;
arg += 13;
}
else if (grub_memcmp (arg, "--box", 5) == 0)
{
arg = skip_to (0, arg);
@@ -16853,7 +16863,7 @@ static struct builtin builtin_setmenu =
"--ver-on* --ver-off --lang=en* --lang=zh --u (clear all)\n"
"--left-align* --right-align --middle-align\n"
"--auto-num-off* --auto-num-all-on --auto-num-on --triangle-on* --triangle-off\n"
"--highlight-short* --highlight-full\n"
"--highlight-short* --highlight-full --keyhelp-on* --keyhelp-off\n"
"--font-spacing=FONT:LINE. default 0\n"
"--string=[X]=[-]Y=COLOR=\"STRING\" max 16 commands.\n"
" If no X, text in middle.\n"
@@ -16921,12 +16931,17 @@ void string_refresh(void)
if (!refresh)
{
unsigned long date, time;
char y;

refresh = 250;
get_datetime(&date, &time);
unsigned long long col = current_color_64bit;
current_term->setcolorstate (COLOR_STATE_NORMAL);
gotoxy (strings[i].start_x, strings[i].start_y);
if (strings[i].start_y < 0)
y = strings[i].start_y + current_term->max_lines;
else
y = strings[i].start_y;
gotoxy (strings[i].start_x, y);
if ((strings[i].color & 0xffffffff00000000) == 0)
current_color_64bit = strings[i].color | (current_color_64bit & 0xffffffff00000000);
else
@@ -499,7 +499,7 @@ struct string
{
unsigned char index;
unsigned char start_x;
unsigned char start_y;
char start_y;
unsigned long long color;
int addr;
} __attribute__ ((packed));
@@ -850,6 +850,7 @@ extern int use_config_file;
#define use_preset_menu *(unsigned long *)0x307FF8
/* print debug message on startup if the DEBUG_KEY is pressed. */
extern int debug_boot;
extern int console_checkkey (void);
extern int console_getkey (void);
extern int console_beep (void);
extern int beep_func(char *arg, int flags);
@@ -526,7 +526,7 @@ print_entry (int y, int highlight,int entryno, char *config_entries)
// else if (default_help_message_destoyed)
else
{
if(!(menu_border.menu_keyhelp_y_offset))
if(!(menu_border.menu_keyhelp_y_offset) && !(menu_tab & 4))
{
// if (current_term->setcolorstate)
// current_term->setcolorstate (COLOR_STATE_HELPTEXT);
@@ -909,6 +909,7 @@ run_menu (char *menu_entries, char *config_entries, /*int num_entries,*/ char *h
if (graphics_inited && graphics_mode > 0xff)/*vbe mode call rectangle_func*/
{
int i,j;
char y;
unsigned long long col = current_color_64bit;
for (i=0; i<16; i++)
{
@@ -920,15 +921,17 @@ run_menu (char *menu_entries, char *config_entries, /*int num_entries,*/ char *h

if (num_string)
{
int start_offcet = 0;
i = num_string;

for (j=0; j<i; j++)
{
if (strings[j].index == 0)
continue;
start_offcet = strings[j].start_x;
gotoxy (start_offcet, strings[j].start_y);
if (strings[j].start_y < 0)
y = strings[j].start_y + current_term->max_lines;
else
y = strings[j].start_y;
gotoxy (strings[j].start_x, y);
current_term->setcolorstate (COLOR_STATE_NORMAL);
if ((strings[j].color & 0xffffffff00000000) == 0)
current_color_64bit = strings[j].color | (current_color_64bit & 0xffffffff00000000);
@@ -1004,6 +1007,7 @@ run_menu (char *menu_entries, char *config_entries, /*int num_entries,*/ char *h
if (current_term->setcolorstate)
current_term->setcolorstate (COLOR_STATE_HELPTEXT);

if (!(menu_tab & 4))
print_default_help_message (config_entries);

if (current_term->flags & TERM_DUMB)
@@ -105,8 +105,6 @@ extern struct term_entry *current_term;
/* The console stuff. */
unsigned int console_putchar (unsigned int c, unsigned int max_width);

int console_checkkey (void);
int console_getkey (void);
int console_getxy (void);
void console_gotoxy (int x, int y);
void console_cls (void);

0 comments on commit 34ca1a9

Please sign in to comment.
You can’t perform that action at this time.