return;
// Get the mode
- struct vgamode_s *vmode_g = vgahw_find_mode(GET_BDA(video_mode));
+ struct vgamode_s *vmode_g = get_current_mode();
if (!vmode_g)
return;
SET_IVT(0x43, GET_FARVAR(seg, info->font1));
}
+
+/****************************************************************
+ * Mode setting
+ ****************************************************************/
+
+struct vgamode_s *
+get_current_mode(void)
+{
+ return vgahw_find_mode(GET_BDA(video_mode));
+}
+
// Setup BDA after a mode switch.
void
modeswitch_set_bda(int mode, int flags, struct vgamode_s *vmode_g)
u8 x, y, page;
};
u16 calc_page_size(u8 memmodel, u16 width, u16 height);
+struct vgamode_s *get_current_mode(void);
void modeswitch_set_bda(int mode, int flags, struct vgamode_s *vmode_g);
// vgafb.c
#include "biosvar.h" // GET_BDA
#include "util.h" // memset_far
-#include "vgahw.h" // vgahw_find_mode
#include "stdvga.h" // stdvga_planar4_plane
vgafb_scroll(int nblines, int attr, struct cursorpos ul, struct cursorpos lr)
{
// Get the mode
- struct vgamode_s *vmode_g = vgahw_find_mode(GET_BDA(video_mode));
+ struct vgamode_s *vmode_g = get_current_mode();
if (!vmode_g)
return;
vgafb_write_char(struct cursorpos cp, struct carattr ca)
{
// Get the mode
- struct vgamode_s *vmode_g = vgahw_find_mode(GET_BDA(video_mode));
+ struct vgamode_s *vmode_g = get_current_mode();
if (!vmode_g)
return;
vgafb_read_char(struct cursorpos cp)
{
// Get the mode
- struct vgamode_s *vmode_g = vgahw_find_mode(GET_BDA(video_mode));
+ struct vgamode_s *vmode_g = get_current_mode();
if (!vmode_g)
goto fail;
vgafb_write_pixel(u8 color, u16 x, u16 y)
{
// Get the mode
- struct vgamode_s *vmode_g = vgahw_find_mode(GET_BDA(video_mode));
+ struct vgamode_s *vmode_g = get_current_mode();
if (!vmode_g)
return;
vgafb_read_pixel(u16 x, u16 y)
{
// Get the mode
- struct vgamode_s *vmode_g = vgahw_find_mode(GET_BDA(video_mode));
+ struct vgamode_s *vmode_g = get_current_mode();
if (!vmode_g)
return 0;