Implemented set cursor shape functionality.

This commit is contained in:
Andreas Mohr 2002-07-01 18:13:52 +00:00 committed by Alexandre Julliard
parent e921e4664d
commit db31151b1e
4 changed files with 22 additions and 5 deletions

View file

@ -36,11 +36,10 @@ static void scroll_window(int direction, char lines, char row1,
#define SCROLL_UP 1
#define SCROLL_DOWN 2
/* FIXME: is row or column first? */
static void BIOS_GetCursorPos(BIOSDATA*data,unsigned page,unsigned*X,unsigned*Y)
{
*X = data->VideoCursorPos[page*2];
*Y = data->VideoCursorPos[page*2+1];
*X = data->VideoCursorPos[page*2]; /* column */
*Y = data->VideoCursorPos[page*2+1]; /* row */
}
static void BIOS_SetCursorPos(BIOSDATA*data,unsigned page,unsigned X,unsigned Y)
@ -365,7 +364,9 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context )
break;
case 0x01: /* SET CURSOR SHAPE */
FIXME("Set Cursor Shape - Not Supported\n");
TRACE("Set Cursor Shape start %d end %d options %d\n", CH_reg(context) & 0x1f, CL_reg(context) & 0x1f, CH_reg(context) & 0xe0);
data->VideoCursorType = CX_reg(context); /* direct copy */
VGA_SetCursorShape(CH_reg(context), CL_reg(context));
break;
case 0x02: /* SET CURSOR POSITION */

View file

@ -473,6 +473,21 @@ void VGA_GetAlphaMode(unsigned*Xres,unsigned*Yres)
if (Yres) *Yres=info.dwSize.Y;
}
void VGA_SetCursorShape(unsigned char start_options, unsigned char end)
{
CONSOLE_CURSOR_INFO cci;
/* standard cursor settings:
* 0x0607 == CGA, 0x0b0c == monochrome, 0x0d0e == EGA/VGA */
/* calculate percentage from bottom - assuming VGA (bottom 0x0e) */
cci.dwSize = ((end & 0x1f) - (start_options & 0x1f))/0x0e * 100;
if (!cci.dwSize) cci.dwSize++; /* NULL cursor would make SCCI() fail ! */
cci.bVisible = ((start_options & 0x60) != 0x20); /* invisible ? */
SetConsoleCursorInfo(VGA_AlphaConsole(),&cci);
}
void VGA_SetCursorPos(unsigned X,unsigned Y)
{
COORD pos;

View file

@ -40,6 +40,7 @@ void VGA_Unlock(void);
/* text mode */
int VGA_SetAlphaMode(unsigned Xres,unsigned Yres);
void VGA_GetAlphaMode(unsigned*Xres,unsigned*Yres);
void VGA_SetCursorShape(unsigned char start_options,unsigned char end);
void VGA_SetCursorPos(unsigned X,unsigned Y);
void VGA_GetCursorPos(unsigned*X,unsigned*Y);
void VGA_WriteChars(unsigned X,unsigned Y,unsigned ch,int attr,int count);

View file

@ -60,7 +60,7 @@ typedef struct
WORD VideoColumns; /* 4a: Number of columns */
WORD VideoPageSize; /* 4c: Video page size in bytes */
WORD VideoPageStartAddr; /* 4e: Video page start address */
BYTE VideoCursorPos[16]; /* 50: Cursor position for 8 pages */
BYTE VideoCursorPos[16]; /* 50: Cursor position for 8 pages, column/row order */
WORD VideoCursorType; /* 60: Video cursor type */
BYTE VideoCurPage; /* 62: Video current page */
WORD VideoCtrlAddr WINE_PACKED; /* 63: Video controller address */