diff options
author | Volker Ruppert <info@vruppert.de> | 2003-01-19 11:35:23 +0000 |
---|---|---|
committer | Volker Ruppert <info@vruppert.de> | 2003-01-19 11:35:23 +0000 |
commit | 9b27e43a2e4ec67f2517d0877658160a53cbd2b0 (patch) | |
tree | 1f129af6e8aca618480c3c119e595c65f5eada49 | |
parent | a46750352126ad4f130384d92c98a8c2863a8be1 (diff) | |
download | vgabios-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.c | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -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; |