mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-27 09:39:22 +00:00
Lift 255x255 erminal sie restriction to 65535x65535. Also change from
bitmasks to small structures of size chosen to fit in registers.
This commit is contained in:
1 parent
7abdac8e13
commit
e89c2d48a9
24 files changed
+266
-244
No files matched your search
@@ -101,13 +101,13 @@ grub_console_init_output (struct grub_term_output *term)
|
||||
struct winsize size;
|
||||
if (ioctl (STDOUT_FILENO, TIOCGWINSZ, &size) >= 0)
|
||||
{
|
||||
grub_console_terminfo_output.width = size.ws_col;
|
||||
grub_console_terminfo_output.height = size.ws_row;
|
||||
grub_console_terminfo_output.size.x = size.ws_col;
|
||||
grub_console_terminfo_output.size.y = size.ws_row;
|
||||
}
|
||||
else
|
||||
{
|
||||
grub_console_terminfo_output.width = 80;
|
||||
grub_console_terminfo_output.height = 24;
|
||||
grub_console_terminfo_output.size.x = 80;
|
||||
grub_console_terminfo_output.size.y = 24;
|
||||
}
|
||||
|
||||
grub_terminfo_output_init (term);
|
||||
@@ -125,8 +125,7 @@ struct grub_terminfo_input_state grub_console_terminfo_input =
|
||||
struct grub_terminfo_output_state grub_console_terminfo_output =
|
||||
{
|
||||
.put = put,
|
||||
.width = 80,
|
||||
.height = 24
|
||||
.size = { 80, 24 }
|
||||
};
|
||||
|
||||
static struct grub_term_input grub_console_term_input =
|
||||
|
||||
@@ -129,7 +129,7 @@ grub_console_getkey (struct grub_term_input *term __attribute__ ((unused)))
|
||||
}
|
||||
}
|
||||
|
||||
static grub_uint16_t
|
||||
static struct grub_term_coordinate
|
||||
grub_console_getwh (struct grub_term_output *term __attribute__ ((unused)))
|
||||
{
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
@@ -139,24 +139,24 @@ grub_console_getwh (struct grub_term_output *term __attribute__ ((unused)))
|
||||
|
||||
GetConsoleScreenBufferInfo (hStdout, &csbi);
|
||||
|
||||
return ((csbi.dwSize.X << 8) | csbi.dwSize.Y);
|
||||
return (struct grub_term_coordinate) { csbi.dwSize.X, csbi.dwSize.Y };
|
||||
}
|
||||
|
||||
static grub_uint16_t
|
||||
static struct grub_term_coordinate
|
||||
grub_console_getxy (struct grub_term_output *term __attribute__ ((unused)))
|
||||
{
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
|
||||
GetConsoleScreenBufferInfo (hStdout, &csbi);
|
||||
|
||||
return ((csbi.dwCursorPosition.X << 8) | csbi.dwCursorPosition.Y);
|
||||
return (struct grub_term_coordinate) { csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y };
|
||||
}
|
||||
|
||||
static void
|
||||
grub_console_gotoxy (struct grub_term_output *term __attribute__ ((unused)),
|
||||
grub_uint8_t x, grub_uint8_t y)
|
||||
struct grub_term_coordinate pos)
|
||||
{
|
||||
COORD coord = { x, y };
|
||||
COORD coord = { pos.x, pos.y };
|
||||
|
||||
SetConsoleCursorPosition (hStdout, coord);
|
||||
}
|
||||
@@ -179,13 +179,13 @@ grub_console_cls (struct grub_term_output *term)
|
||||
GetConsoleScreenBufferInfo (hStdout, &csbi);
|
||||
|
||||
SetConsoleTextAttribute (hStdout, 0);
|
||||
grub_console_gotoxy (term, 0, 0);
|
||||
grub_console_gotoxy (term, (struct grub_term_coordinate) { 0, 0 });
|
||||
tsz = csbi.dwSize.X * csbi.dwSize.Y;
|
||||
|
||||
while (tsz--)
|
||||
grub_console_putchar (term, &c);
|
||||
|
||||
grub_console_gotoxy (term, 0, 0);
|
||||
grub_console_gotoxy (term, (struct grub_term_coordinate) { 0, 0 });
|
||||
SetConsoleTextAttribute (hStdout, csbi.wAttributes);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user