Cursor
Re:Cursor
This [url=http://my.execpc.com/~geezer/osd/cons/index.htm] website says:
This should work...
HTH..
Code: Select all
Move hardware cursor by changing VGA registers; without using the BIOS:
#include <dos.h> /* outportb() */
unsigned short crtc_adr = 0x3D4; /* 0x3B4 for monochrome */
unsigned short offset;
unsigned short x = 20, y = 3;
offset = x + y * 80; /* 80 characters per line */
outportb(crtc_adr + 0, 14); /* MSB of offset to CRTC reg 14 */
outportb(crtc_adr + 1, offset >> 8);
outportb(crtc_adr + 0, 15); /* LSB of offset to CRTC reg 15 */
outportb(crtc_adr + 1, offset);
HTH..
Re:Cursor
Heres the code I use to turn the text cursor on and off its in asm,
but should be easy to convert to c if thats what you need, just use
ie. outportb(0x3d4,0x0a)
Hope this helps
pkd
;------------------------------------------
;Turn Cursor on
;------------------------------------------
mov dx,0x3d4
mov al,0x0a
out dx,al
mov dx,0x3d5
mov al,0x0f
out dx,al
mov dx,0x3d4
mov al,0x0b
out dx,al
mov dx,0x3d5
mov al,0x0f
out dx,al
;----------------------------------------
;Turn Cursor off
;----------------------------------------
mov dx,0x3d4
mov al,0x0a
out dx,al
mov dx,0x3d5
mov al,0x2f
out dx,al
mov dx,0x3d4
mov al,0x0b
out dx,al
mov dx,0x3d5
mov al,0x0f
out dx,al
but should be easy to convert to c if thats what you need, just use
ie. outportb(0x3d4,0x0a)
Hope this helps
pkd
;------------------------------------------
;Turn Cursor on
;------------------------------------------
mov dx,0x3d4
mov al,0x0a
out dx,al
mov dx,0x3d5
mov al,0x0f
out dx,al
mov dx,0x3d4
mov al,0x0b
out dx,al
mov dx,0x3d5
mov al,0x0f
out dx,al
;----------------------------------------
;Turn Cursor off
;----------------------------------------
mov dx,0x3d4
mov al,0x0a
out dx,al
mov dx,0x3d5
mov al,0x2f
out dx,al
mov dx,0x3d4
mov al,0x0b
out dx,al
mov dx,0x3d5
mov al,0x0f
out dx,al