stdvga_crtc_write(crtc_addr, 0x11, 0x00);
stdvga_crtc_write(crtc_addr, 0x01, width / 8 - 1);
stdvga_set_linelength(vmode_g, width);
- stdvga_crtc_write(crtc_addr, 0x12, height - 1);
- u8 v = 0;
- if ((height - 1) & 0x0100)
- v |= 0x02;
- if ((height - 1) & 0x0200)
- v |= 0x40;
- stdvga_crtc_mask(crtc_addr, 0x07, 0x42, v);
+ stdvga_set_vertical_size(height);
stdvga_crtc_write(crtc_addr, 0x09, 0x00);
stdvga_crtc_mask(crtc_addr, 0x17, 0x00, 0x03);
return vde + 1;
}
+// Set vertical screen size (number of horizontal lines in the display)
+void
+stdvga_set_vertical_size(int lines)
+{
+ u16 crtc_addr = stdvga_get_crtc();
+ u16 vde = lines - 1;
+ stdvga_crtc_write(crtc_addr, 0x12, vde);
+ u8 ovl = ((vde >> 7) & 0x02) + ((vde >> 3) & 0x40);
+ stdvga_crtc_mask(crtc_addr, 0x07, 0x42, ovl);
+}
+
// Get offset into framebuffer accessible from real-mode 64K segment
int
stdvga_get_window(struct vgamode_s *curmode_g, int window)
void stdvga_set_cursor_pos(int address);
void stdvga_set_character_height(u8 lines);
u16 stdvga_get_vertical_size(void);
+void stdvga_set_vertical_size(int lines);
int stdvga_get_window(struct vgamode_s *curmode_g, int window);
int stdvga_set_window(struct vgamode_s *curmode_g, int window, int val);
int stdvga_minimum_linelength(struct vgamode_s *vmode_g);