Sync with trunk
This commit is contained in:
commit
e022a2d667
98 changed files with 3475 additions and 1020 deletions
|
@ -27,7 +27,7 @@
|
|||
#include <grub/bitmap.h>
|
||||
#include <grub/command.h>
|
||||
|
||||
#define DEFAULT_VIDEO_MODE "1024x768,800x600,640x480,0x0"
|
||||
#define DEFAULT_VIDEO_MODE "auto"
|
||||
#define DEFAULT_BORDER_WIDTH 10
|
||||
|
||||
#define DEFAULT_STANDARD_COLOR 0x07
|
||||
|
@ -247,12 +247,6 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y,
|
|||
return grub_errno;
|
||||
}
|
||||
|
||||
static int NESTED_FUNC_ATTR video_hook (grub_video_adapter_t p __attribute__ ((unused)),
|
||||
struct grub_video_mode_info *info)
|
||||
{
|
||||
return ! (info->mode_type & GRUB_VIDEO_MODE_TYPE_PURE_TEXT);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_gfxterm_init (void)
|
||||
{
|
||||
|
@ -272,13 +266,15 @@ grub_gfxterm_init (void)
|
|||
/* Parse gfxmode environment variable if set. */
|
||||
modevar = grub_env_get ("gfxmode");
|
||||
if (! modevar || *modevar == 0)
|
||||
err = grub_video_set_mode (DEFAULT_VIDEO_MODE, video_hook);
|
||||
err = grub_video_set_mode (DEFAULT_VIDEO_MODE,
|
||||
GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0);
|
||||
else
|
||||
{
|
||||
tmp = grub_malloc (grub_strlen (modevar)
|
||||
+ sizeof (DEFAULT_VIDEO_MODE) + 1);
|
||||
grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar);
|
||||
err = grub_video_set_mode (tmp, video_hook);
|
||||
err = grub_video_set_mode (tmp,
|
||||
GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0);
|
||||
grub_free (tmp);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ inc_y (void)
|
|||
static void
|
||||
inc_x (void)
|
||||
{
|
||||
if (grub_curr_x >= COLS - 2)
|
||||
if (grub_curr_x >= COLS - 1)
|
||||
inc_y ();
|
||||
else
|
||||
grub_curr_x++;
|
||||
|
|
|
@ -83,12 +83,17 @@ grub_ofconsole_putchar (grub_uint32_t c)
|
|||
grub_curr_y++;
|
||||
grub_curr_x = 0;
|
||||
}
|
||||
else if (c == '\r')
|
||||
{
|
||||
grub_curr_x = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
grub_curr_x++;
|
||||
if (grub_curr_x > grub_ofconsole_width)
|
||||
if (grub_curr_x >= grub_ofconsole_width)
|
||||
{
|
||||
grub_ofconsole_putchar ('\n');
|
||||
grub_ofconsole_putchar ('\r');
|
||||
grub_curr_x++;
|
||||
}
|
||||
}
|
||||
|
@ -234,16 +239,13 @@ grub_ofconsole_getxy (void)
|
|||
return ((grub_curr_x - 1) << 8) | grub_curr_y;
|
||||
}
|
||||
|
||||
static grub_uint16_t
|
||||
grub_ofconsole_getwh (void)
|
||||
static void
|
||||
grub_ofconsole_dimensions (void)
|
||||
{
|
||||
grub_ieee1275_ihandle_t options;
|
||||
char *val;
|
||||
grub_ssize_t lval;
|
||||
|
||||
if (grub_ofconsole_width && grub_ofconsole_height)
|
||||
return (grub_ofconsole_width << 8) | grub_ofconsole_height;
|
||||
|
||||
if (! grub_ieee1275_finddevice ("/options", &options)
|
||||
&& options != (grub_ieee1275_ihandle_t) -1)
|
||||
{
|
||||
|
@ -280,7 +282,11 @@ grub_ofconsole_getwh (void)
|
|||
grub_ofconsole_width = 80;
|
||||
if (! grub_ofconsole_height)
|
||||
grub_ofconsole_height = 24;
|
||||
}
|
||||
|
||||
static grub_uint16_t
|
||||
grub_ofconsole_getwh (void)
|
||||
{
|
||||
return (grub_ofconsole_width << 8) | grub_ofconsole_height;
|
||||
}
|
||||
|
||||
|
@ -379,6 +385,8 @@ grub_ofconsole_init_output (void)
|
|||
grub_ofconsole_setcolorstate (GRUB_TERM_COLOR_NORMAL);
|
||||
}
|
||||
|
||||
grub_ofconsole_dimensions ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue