[comp.sys.ibm.pc] Cursor question, Int 0x10 service 0x03

bamcpherson@trillium.waterloo.edu (Brent McPherson) (11/20/88)

Hi, 
	I calculate a half-height insert cursor from the information
	received through interrupt 0x10, service 0x03. 
	What I do is take the old cursors bottom scan line, divide this
	by two. This now becomes the new top scan line of the insert cursor.

	eg.

	regs.h.ah = 0x03;                /* read cursor position */
	intr( 0x10, &regs );             /* perform video interrupt */
	old_cursor = regs.x.cx;          /* save normal cursor */
	ins_cursor = (((old_cursor & 0xff) >> 1) << 8) + (old_cursor & 0xff);


	The cursor is set by using interrupt 0x10, service 0x01 and
	the cursor (old or ins) is stored into CX.

	There seems to a problem on certain machines. (the plain IBM PC
	with a monochrome monitor I think) Basically instead of getting a
	half-height insert cursor you get a cursor in the middle of the
	character. Also a mode change using "mode" seems to correct the 
	problem.

                normal       desired      actual
		cursor     ins cursor    ins cursor
		+----+       +----+       +----+
		|    |       |    |       |    |
		|    |       |####|       |####|
		|####|       |####|       |    |
		+----+       +----+       +----+

	I do not have access to a machine where the problem occurs and
	cannot investigate this problem. Does anyone know if
	this a known bug? Am I doing something wrong? Has anyone else
	had this problem? This code is called from within a TSR.

	Thanks in advance,
--
Brent

funkstr@ucscb.UCSC.EDU (-=/ Larry Hastings /=-) (11/20/88)

+-In article <9821@watdragon.waterloo.edu>, bamcpherson@trillium.waterloo.edu (Brent McPherson) wrote:-
+----------
|
| 
| Hi, 
| 	I calculate a half-height insert cursor from the information
| 	received through interrupt 0x10, service 0x03. 
| 	What I do is take the old cursors bottom scan line, divide this
| 	by two. This now becomes the new top scan line of the insert cursor.
| 
| 	eg.
| 	regs.h.ah = 0x03;                /* read cursor position */
| 	intr( 0x10, &regs );             /* perform video interrupt */
| 	old_cursor = regs.x.cx;          /* save normal cursor */
| 	ins_cursor = (((old_cursor & 0xff) >> 1) << 8) + (old_cursor & 0xff);
| 
| 	There seems to a problem on certain machines. (the plain IBM PC
| 	with a monochrome monitor I think) Basically instead of getting a
| 	half-height insert cursor you get a cursor in the middle of the
| 	character.
| Brent
|
+----------

  Aha!  This is because on MGA, the cursor is (if memory serves) 11 lines tall,
not 8.  It might be 13, but I think it's 11.  Anyways, you're setting the bottom
to be 8, and the bottom line is 11, so the cursor stops two-thirds of the way
from the bottom...  anyways, the fix is obvious; you just need to take in
account the taller cursor for MGA.


--
 /|\ /|\   .. .  .   .    .     .      .       .        .         .          . 
| |\| |\|  .. .  .   .    .     .      .       .        .         .          .
|/|\|/|\|/||   _  _ _   _ |_| _  _ |_ -__  _  _ARPA: funkstr@ucscb.ucsc.EDU
  | |/| |/|L_ (_\( ( (_/  | |(_\_) (_ || )(_)_)UUCP: *!ucbvax!ucscb!funkstr
   \|/ \|/ larry      /   hastings        _/   WORK: sun!acad!metaware!funkster
MetaWare Incorporated   Disclaimer: It was a bad day.
"If any of your OSF force are caught or killed, the Secretary will deny any
 knowlege of your activities."  --from the new Mission: Impractical

leonard@bucket.UUCP (Leonard Erickson) (11/28/88)

In article <9821@watdragon.waterloo.edu> bamcpherson@trillium.waterloo.edu (Brent McPherson) writes:
<	I calculate a half-height insert cursor from the information
<	received through interrupt 0x10, service 0x03. 
<	What I do is take the old cursors bottom scan line, divide this
<	by two. This now becomes the new top scan line of the insert cursor.
<
<	eg.
<
<	regs.h.ah = 0x03;                /* read cursor position */
<	intr( 0x10, &regs );             /* perform video interrupt */
<	old_cursor = regs.x.cx;          /* save normal cursor */
<	ins_cursor = (((old_cursor & 0xff) >> 1) << 8) + (old_cursor & 0xff);
<
<
<	The cursor is set by using interrupt 0x10, service 0x01 and
<	the cursor (old or ins) is stored into CX.
<
<	There seems to a problem on certain machines. (the plain IBM PC
<	with a monochrome monitor I think) Basically instead of getting a
<	half-height insert cursor you get a cursor in the middle of the
<	character. Also a mode change using "mode" seems to correct the 
<	problem.

The problem is that on IBM monochrome cards, Hercules cards or on clones of
either, the system 'sees' "monochrome". For god only knows what reason,
monochrome displays do not return the corect values from BIOS call. Sometimes
you will get the correct values, most of the time you won't. 

The only "solution" I know of is to test for monochrome, and then *assume*
the standard cursor.... then modiify/restore accordingly.      
-- 
Leonard Erickson		...!tektronix!reed!percival!bucket!leonard
CIS: [70465,203]
"I used to be a hacker. Now I'm a 'microcomputer specialist'.
You know... I'd rather be a hacker."