aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Ruppert <info@vruppert.de>2003-01-19 11:35:23 +0000
committerVolker Ruppert <info@vruppert.de>2003-01-19 11:35:23 +0000
commit9b27e43a2e4ec67f2517d0877658160a53cbd2b0 (patch)
tree1f129af6e8aca618480c3c119e595c65f5eada49
parenta46750352126ad4f130384d92c98a8c2863a8be1 (diff)
downloadvgabios-9b27e43a2e4ec67f2517d0877658160a53cbd2b0.tar.gz
- function set_scan_lines() recalculates the number of rows and the page size
- new values for char height, text rows and page size are stored in the BIOS data segment - asm helper function idiv_u added
-rw-r--r--vgabios.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/vgabios.c b/vgabios.c
index 2cc4162..d6a2377 100644
--- a/vgabios.c
+++ b/vgabios.c
@@ -1653,9 +1653,17 @@ static void release_font_access()
outw( VGAREG_GRDC_ADDRESS, 0x0e06 );
}
+ASM_START
+idiv_u:
+ xor dx,dx
+ div bx
+ ret
+ASM_END
+
static void set_scan_lines(lines) Bit8u lines;
{
- Bit8u crtc9;
+ Bit16u cols,page,vde;
+ Bit8u crtc9,ovl,rows;
outb(read_word(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS), 0x09);
crtc9 = inb(read_word(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS)+1);
@@ -1669,6 +1677,16 @@ static void set_scan_lines(lines) Bit8u lines;
{
biosfn_set_cursor_shape(lines-4,lines-3);
}
+ write_word(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT, lines);
+ outb(read_word(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS), 0x12);
+ vde = inb(read_word(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS)+1);
+ outb(read_word(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS), 0x07);
+ ovl = inb(read_word(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS)+1);
+ vde += (((ovl & 0x02) << 7) + ((ovl & 0x40) << 3) + 1);
+ rows = vde / lines;
+ write_byte(BIOSMEM_SEG,BIOSMEM_NB_ROWS, rows-1);
+ cols = read_word(BIOSMEM_SEG,BIOSMEM_NB_COLS);
+ write_word(BIOSMEM_SEG,BIOSMEM_PAGE_SIZE, rows * cols * 2);
}
static void biosfn_load_text_user_pat (AL,ES,BP,CX,DX,BL,BH) Bit8u AL;Bit16u ES;Bit16u BP;Bit16u CX;Bit16u DX;Bit8u BL;Bit8u BH;