Skip to content

Commit

Permalink
. 修正增加变量menu_tab_ext引入的问题。
Browse files Browse the repository at this point in the history
.  修正font函数。
  • Loading branch information
yaya2007 committed Oct 14, 2023
1 parent 5b2435f commit eeb9ba9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
9 changes: 7 additions & 2 deletions ChangeLog_chenall.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
更新说明:
2023-10-14 (yaya)
修正增加变量menu_tab_ext引入的问题。
修正font函数。

2023-09-22 (yaya)
修正切换分辨率花屏问题。
修正grldr.mbr。 issues #427
增加变量menu_tab_ext,避免重入主菜单时重复加载背景图及字库。
例如:calc *0x8312&2 > nul || splashimage /boot/grub/lt.jpg
增加变量menu_tab_ext,避免重入主菜单时重复设置图形模式、加载背景图及字库。
例如:calc *0x8312&1 > nul || graphicsmode -1 800
calc *0x8312&2 > nul || splashimage /boot/grub/lt.jpg
calc *0x8312&4 > nul || font /boot/grub/unifont.hex.gz

2023-08-18 (yaya)
Expand Down
13 changes: 9 additions & 4 deletions stage2/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -6468,11 +6468,10 @@ font_func (char *arg, int flags)
i=0;
while ((len = grub_read((unsigned long long)(unsigned int)(char*)&buf, 1, 0xedde0d90)))
{
if (buf[0] == '#') //避免注释中含有'DotSize='字符串,清除已安装字库 2023-09-30
while (grub_read((unsigned long long)(unsigned int)(char*)&buf, 1, 0xedde0d90) && buf[0] != '\n'); //跳过注释
if (buf[0] == '\n' || buf[0] == '\r')
{
//printf ("goto valid_lines=%d, buf=%s\n", valid_lines, buf);
goto redo; /* try the new line */
}
if (buf[0] == '\0') /* NULL encountered ? */
break; /* yes, end */

Expand Down Expand Up @@ -15622,7 +15621,13 @@ graphicsmode_func (char *arg, int flags)
current_bytes_per_pixel = (z+7)/8;
if (IMAGE_BUFFER) //字库位置使用内存分配 2023-02-22
grub_free (IMAGE_BUFFER);
IMAGE_BUFFER = grub_zalloc (current_x_resolution * current_y_resolution * current_bytes_per_pixel);//应当在加载图像前设置 使用grub_malloc,切换分辨率可能花屏。2023-08-24
// IMAGE_BUFFER = grub_zalloc (current_x_resolution * current_y_resolution * current_bytes_per_pixel);//应当在加载图像前设置 使用grub_malloc,切换分辨率可能花屏。2023-08-24
IMAGE_BUFFER = grub_malloc (current_bytes_per_scanline * current_y_resolution); //如果设置了返回主菜单不重新加载背景图,背景图会被清除。2023-09-25
if (graphics_mode != (unsigned int)tmp_graphicsmode) //如果当前图形模式与设置的不同
{
menu_tab_ext &= 0xfd; //清除背景图已加载标记
grub_memset (IMAGE_BUFFER, 0, current_bytes_per_scanline * current_y_resolution); //清除背景图,避免切换分辨率可能花屏 2023-09-25
}
if (!JPG_FILE)
{
JPG_FILE = grub_zalloc (0x8000); //使用grub_malloc,切换分辨率可能花屏。2023-08-24
Expand Down
4 changes: 3 additions & 1 deletion stage2/stage2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2870,6 +2870,7 @@ extern int graphicsmode_func (char *, int);
menu = "(md)0x880+0x200";
if (font_func (menu, 0))
{
menu_tab_ext &= 0xfb; //清除字库已加载标记
/* font exists, automatically enter graphics mode. */
if (! graphicsmode_in_menu_init)
{
Expand Down Expand Up @@ -2897,7 +2898,8 @@ extern int graphicsmode_func (char *, int);
//font_func (NULL, 0); /* clear the font */
/* Clear the narrow_char_indicator for the NULL char only. */
// *(unsigned long *)UNIFONT_START = 0; // Enable next font command.
font_func (config_file, 0);
if (font_func (config_file, 0))
menu_tab_ext &= 0xfb; //清除字库已加载标记
//font_func (NULL, 0); /* clear the font */
/* Clear the narrow_char_indicator for the NULL char only. */
// *(unsigned long *)UNIFONT_START = 0; // Enable next font command.
Expand Down

0 comments on commit eeb9ba9

Please sign in to comment.