#include "biosvar.h" // GET_BDA
#include "util.h" // memset_far
-#include "vgabios.h" // find_vga_entry
+#include "vgahw.h" // vgahw_find_mode
#include "stdvga.h" // stdvga_grdc_write
{
int cheight = 1;
int cwidth = 2;
- u16 nbrows = GET_BDA(video_rows) + 1;
- u16 nbcols = GET_BDA(video_cols);
- int stride = nbcols * cwidth;
- void *src_far, *dest_far = (void*)SCREEN_MEM_START(nbcols, nbrows, ul.page);
+ int stride = GET_BDA(video_cols) * cwidth;
+ void *src_far, *dest_far = (void*)(GET_BDA(video_pagesize) * ul.page);
if (nblines >= 0) {
dest_far += ul.y * cheight * stride + ul.x * cwidth;
src_far = dest_far + nblines * cheight * stride;
vgafb_scroll(int nblines, int attr, struct cursorpos ul, struct cursorpos lr)
{
// Get the mode
- struct vgamode_s *vmode_g = find_vga_entry(GET_BDA(video_mode));
+ struct vgamode_s *vmode_g = vgahw_find_mode(GET_BDA(video_mode));
if (!vmode_g)
return;
write_text_char(struct vgamode_s *vmode_g
, struct cursorpos cp, struct carattr ca)
{
- // Get the dimensions
- u16 nbrows = GET_BDA(video_rows) + 1;
- u16 nbcols = GET_BDA(video_cols);
-
// Compute the address
- void *address_far = (void*)(SCREEN_MEM_START(nbcols, nbrows, cp.page)
+ u16 nbcols = GET_BDA(video_cols);
+ void *address_far = (void*)(GET_BDA(video_pagesize) * cp.page
+ (cp.x + cp.y * nbcols) * 2);
if (ca.use_attr) {
vgafb_write_char(struct cursorpos cp, struct carattr ca)
{
// Get the mode
- struct vgamode_s *vmode_g = find_vga_entry(GET_BDA(video_mode));
+ struct vgamode_s *vmode_g = vgahw_find_mode(GET_BDA(video_mode));
if (!vmode_g)
return;
vgafb_read_char(struct cursorpos cp)
{
// Get the mode
- struct vgamode_s *vmode_g = find_vga_entry(GET_BDA(video_mode));
+ struct vgamode_s *vmode_g = vgahw_find_mode(GET_BDA(video_mode));
if (!vmode_g)
goto fail;
goto fail;
}
- // Get the dimensions
- u16 nbrows = GET_BDA(video_rows) + 1;
- u16 nbcols = GET_BDA(video_cols);
-
// Compute the address
- u16 *address_far = (void*)(SCREEN_MEM_START(nbcols, nbrows, cp.page)
+ u16 nbcols = GET_BDA(video_cols);
+ u16 *address_far = (void*)(GET_BDA(video_pagesize) * cp.page
+ (cp.x + cp.y * nbcols) * 2);
u16 v = GET_FARVAR(GET_GLOBAL(vmode_g->sstart), *address_far);
struct carattr ca = {v, v>>8, 0};
vgafb_write_pixel(u8 color, u16 x, u16 y)
{
// Get the mode
- struct vgamode_s *vmode_g = find_vga_entry(GET_BDA(video_mode));
+ struct vgamode_s *vmode_g = vgahw_find_mode(GET_BDA(video_mode));
if (!vmode_g)
return;
vgafb_read_pixel(u16 x, u16 y)
{
// Get the mode
- struct vgamode_s *vmode_g = find_vga_entry(GET_BDA(video_mode));
+ struct vgamode_s *vmode_g = vgahw_find_mode(GET_BDA(video_mode));
if (!vmode_g)
return 0;