Update source to follow GCS more precisely.

This commit is contained in:
chaac 2005-08-16 18:34:17 +00:00
parent 6323696adf
commit 0bd41162dd
6 changed files with 72 additions and 36 deletions

View file

@ -1,3 +1,12 @@
2005-08-16 Vesa Jaaskelainen <chaac@nic.fi>
* commands/i386/pc/vbe_list_modes.c: Update source formatting to
follow GCS more precisely.
* commands/i386/pc/vbe_test.c: Likewise.
* include/grub/i386/pc/vbe.h: Likewise.
* term/i386/pc/vesafb.c: Likewise.
* video/i386/pc/vbe.c: Likewise.
2005-08-16 Vesa Jaaskelainen <chaac@nic.fi>
* DISTLIST: Added term/i386/pc/vesafb.c

View file

@ -29,8 +29,8 @@
static void *
real2pm(grub_vbe_farptr_t ptr)
{
return (void *)((((unsigned long)ptr & 0xFFFF0000) >> 12UL) +
((unsigned long)ptr & 0x0000FFFF));
return (void *)((((unsigned long)ptr & 0xFFFF0000) >> 12UL)
+ ((unsigned long)ptr & 0x0000FFFF));
}
static grub_err_t
@ -133,8 +133,12 @@ grub_cmd_vbe_list_modes(struct grub_arg_list *state __attribute__ ((unused)),
GRUB_MOD_INIT
{
(void)mod; /* To stop warning. */
grub_register_command ("vbe_list_modes", grub_cmd_vbe_list_modes, GRUB_COMMAND_FLAG_BOTH,
"vbe_list_modes", "List compatible VESA BIOS extension video modes.", 0);
grub_register_command ("vbe_list_modes",
grub_cmd_vbe_list_modes,
GRUB_COMMAND_FLAG_BOTH,
"vbe_list_modes",
"List compatible VESA BIOS extension video modes.",
0);
}
GRUB_MOD_FINI

View file

@ -30,8 +30,8 @@
static void *
real2pm(grub_vbe_farptr_t ptr)
{
return (void *)((((unsigned long)ptr & 0xFFFF0000) >> 12UL) +
((unsigned long)ptr & 0x0000FFFF));
return (void *)((((unsigned long)ptr & 0xFFFF0000) >> 12UL)
+ ((unsigned long)ptr & 0x0000FFFF));
}
static grub_err_t
@ -185,8 +185,12 @@ grub_cmd_vbe_test(struct grub_arg_list *state __attribute__ ((unused)),
GRUB_MOD_INIT
{
(void)mod; /* To stop warning. */
grub_register_command ("vbe_test", grub_cmd_vbe_test, GRUB_COMMAND_FLAG_BOTH,
"vbe_test", "Test VESA BIOS Extension 2.0+ support", 0);
grub_register_command ("vbe_test",
grub_cmd_vbe_test,
GRUB_COMMAND_FLAG_BOTH,
"vbe_test",
"Test VESA BIOS Extension 2.0+ support",
0);
}
GRUB_MOD_FINI

View file

@ -190,10 +190,18 @@ grub_vbe_status_t EXPORT_FUNC(grub_vbe_set_palette_data) (grub_uint32_t color_co
/* Prototypes for helper functions. */
grub_err_t grub_vbe_probe (struct grub_vbe_info_block *info_block);
grub_err_t grub_vbe_set_video_mode (grub_uint32_t mode, struct grub_vbe_mode_info_block *mode_info);
grub_err_t grub_vbe_set_video_mode (grub_uint32_t mode,
struct grub_vbe_mode_info_block *mode_info);
grub_err_t grub_vbe_get_video_mode (grub_uint32_t *mode);
grub_err_t grub_vbe_get_video_mode_info (grub_uint32_t mode, struct grub_vbe_mode_info_block *mode_info);
void grub_vbe_set_pixel_rgb (grub_uint32_t x, grub_uint32_t y, grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue);
void grub_vbe_set_pixel_index (grub_uint32_t x, grub_uint32_t y, grub_uint8_t color);
grub_err_t grub_vbe_get_video_mode_info (grub_uint32_t mode,
struct grub_vbe_mode_info_block *mode_info);
void grub_vbe_set_pixel_rgb (grub_uint32_t x,
grub_uint32_t y,
grub_uint8_t red,
grub_uint8_t green,
grub_uint8_t blue);
void grub_vbe_set_pixel_index (grub_uint32_t x,
grub_uint32_t y,
grub_uint8_t color);
#endif /* ! GRUB_VBE_MACHINE_HEADER */

View file

@ -136,9 +136,9 @@ grub_virtual_screen_setup (grub_uint32_t width,
/* Allocate memory for text buffer. */
virtual_screen.text_buffer =
(struct grub_colored_char *)grub_malloc (virtual_screen.columns *
virtual_screen.rows *
sizeof(struct grub_colored_char));
(struct grub_colored_char *)grub_malloc (virtual_screen.columns
* virtual_screen.rows
* sizeof(struct grub_colored_char));
if (virtual_screen.text_buffer == 0)
{
return GRUB_ERR_OUT_OF_MEMORY;
@ -320,9 +320,9 @@ write_char (void)
unsigned char bitmap[32];
unsigned width;
p = (virtual_screen.text_buffer +
virtual_screen.cursor_x +
(virtual_screen.cursor_y * virtual_screen.columns));
p = (virtual_screen.text_buffer
+ virtual_screen.cursor_x
+ (virtual_screen.cursor_y * virtual_screen.columns));
p -= p->index;
@ -356,8 +356,10 @@ write_char (void)
color = p->bg_color;
}
grub_vbe_set_pixel_index(i + (virtual_screen.cursor_x * virtual_screen.char_width),
y + (virtual_screen.cursor_y * virtual_screen.char_height),
grub_vbe_set_pixel_index(i + (virtual_screen.cursor_x
* virtual_screen.char_width),
y + (virtual_screen.cursor_y
* virtual_screen.char_height),
color);
}
}
@ -390,9 +392,9 @@ scroll_up (void)
/* Scroll text buffer with one line to up. */
grub_memmove (virtual_screen.text_buffer,
virtual_screen.text_buffer + virtual_screen.columns,
sizeof (struct grub_colored_char) *
virtual_screen.columns *
(virtual_screen.rows - 1));
sizeof (struct grub_colored_char)
* virtual_screen.columns
* (virtual_screen.rows - 1));
/* Clear last line in text buffer. */
for (i = virtual_screen.columns * (virtual_screen.rows - 1);
@ -408,14 +410,15 @@ scroll_up (void)
/* Scroll frambuffer with one line to up. */
grub_memmove (framebuffer,
framebuffer + bytes_per_scan_line * virtual_screen.char_height,
bytes_per_scan_line *
(mode_info.y_resolution - virtual_screen.char_height));
framebuffer
+ bytes_per_scan_line * virtual_screen.char_height,
bytes_per_scan_line
* (mode_info.y_resolution - virtual_screen.char_height));
/* Clear last line in framebuffer. */
grub_memset (framebuffer +
(bytes_per_scan_line *
(mode_info.y_resolution - virtual_screen.char_height)),
grub_memset (framebuffer
+ (bytes_per_scan_line
* (mode_info.y_resolution - virtual_screen.char_height)),
0,
bytes_per_scan_line * virtual_screen.char_height);
}

View file

@ -329,13 +329,17 @@ grub_vbe_set_pixel_rgb (grub_uint32_t x,
if (active_mode_info.bits_per_pixel == 32)
{
grub_uint32_t *ptr = (grub_uint32_t *)(framebuffer + y * bytes_per_scan_line + x * 4);
grub_uint32_t *ptr = (grub_uint32_t *)(framebuffer
+ y * bytes_per_scan_line
+ x * 4);
*ptr = value;
}
else if (active_mode_info.bits_per_pixel == 24)
{
grub_uint8_t *ptr = (grub_uint8_t *)(framebuffer + y * bytes_per_scan_line + x * 3);
grub_uint8_t *ptr = (grub_uint8_t *)(framebuffer
+ y * bytes_per_scan_line
+ x * 3);
grub_uint8_t *ptr2 = (grub_uint8_t *)&value;
ptr[0] = ptr2[0];
@ -345,7 +349,9 @@ grub_vbe_set_pixel_rgb (grub_uint32_t x,
else if ((active_mode_info.bits_per_pixel == 16) ||
(active_mode_info.bits_per_pixel == 15))
{
grub_uint16_t *ptr = (grub_uint16_t *)(framebuffer + y * bytes_per_scan_line + x * 2);
grub_uint16_t *ptr = (grub_uint16_t *)(framebuffer
+ y * bytes_per_scan_line
+ x * 2);
*ptr = (grub_uint16_t)(value & 0xFFFF);
}
@ -364,7 +370,9 @@ grub_vbe_set_pixel_index (grub_uint32_t x,
if (index_color_mode == 1)
{
grub_uint8_t *ptr = (grub_uint8_t *)(framebuffer + y * bytes_per_scan_line + x);
grub_uint8_t *ptr = (grub_uint8_t *)(framebuffer
+ y * bytes_per_scan_line
+ x);
*ptr = color;
}