diff options
author | Volker Ruppert <info@vruppert.de> | 2003-01-21 18:30:27 +0000 |
---|---|---|
committer | Volker Ruppert <info@vruppert.de> | 2003-01-21 18:30:27 +0000 |
commit | 7e2677e3729f3f1cb21daf3b1754abead0a5e6fd (patch) | |
tree | c874567efddc05aa5e257ebb58e4ccb5fa9baaf9 | |
parent | dafcafd548f382d71d51b9e375b8c36cc45baad2 (diff) | |
download | vgabios-7e2677e3729f3f1cb21daf3b1754abead0a5e6fd.tar.gz |
- remap the cursor size if the char height is > 8 and the new values are < 8
-rw-r--r-- | vgabios.c | 26 |
1 files changed, 16 insertions, 10 deletions
@@ -938,14 +938,7 @@ static void biosfn_set_video_mode(mode) Bit8u mode; // Set cursor shape if(vga_modes[line].class==TEXT) { - if(cheight<14) - { - biosfn_set_cursor_shape(0x06,0x07); - } - else - { - biosfn_set_cursor_shape(0x0C,0x0D); - } + biosfn_set_cursor_shape(0x06,0x07); } // Set cursor pos for page 0..7 @@ -985,15 +978,28 @@ ASM_END // -------------------------------------------------------------------------------------------- static void biosfn_set_cursor_shape (CH,CL) Bit8u CH;Bit8u CL; -{Bit16u curs; +{Bit16u cheight,curs; CH&=0x3f; CL&=0x1f; - // FIXME should remap to vga settings in case of 14/16 lines curs=(CH<<8)+CL; write_word(BIOSMEM_SEG,BIOSMEM_CURSOR_TYPE,curs); + cheight = read_word(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT); + if((cheight>8) && (CL<8) && (CH<0x20)) + { + if(CL!=(CH+1)) + { + CH = ((CH+1) * cheight / 8) -1; + } + else + { + CH = ((CL+1) * cheight / 8) - 2; + } + CL = ((CL+1) * cheight / 8) - 1; + } + // CTRC regs 0x0a and 0x0b outb(read_word(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS),0x0a); outb(read_word(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS)+1,CH); |