aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Ruppert <info@vruppert.de>2003-01-21 18:30:27 +0000
committerVolker Ruppert <info@vruppert.de>2003-01-21 18:30:27 +0000
commit7e2677e3729f3f1cb21daf3b1754abead0a5e6fd (patch)
treec874567efddc05aa5e257ebb58e4ccb5fa9baaf9
parentdafcafd548f382d71d51b9e375b8c36cc45baad2 (diff)
downloadvgabios-7e2677e3729f3f1cb21daf3b1754abead0a5e6fd.tar.gz
- remap the cursor size if the char height is > 8 and the new values are < 8
-rw-r--r--vgabios.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/vgabios.c b/vgabios.c
index d6a2377..1d77454 100644
--- a/vgabios.c
+++ b/vgabios.c
@@ -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);