Excellent doubleanti. He is right. For mouse cursors you should use your own graphics. The hardware cursor is fine for applications, but usually not for games or other types of programming.
There is not a function in the standard MS/Logitech mouse driver for changing the color of the mouse pointer. However, some drivers provide more (sometimes less) support for various functions. But the standard functions 00h through 09h do not handle mouse cursor color.
Just use sub-function 03h to retrieve the coords of the mouse and place your own graphic at those coords. If double-buffering just 'put' your mouse graphic in the buffer at those coords. This is done after all other operations (drawing, rendering, etc) are complete. When you copy the buffer to vidmem the mouse cursor will be on top of all of the graphics. If you are not double-buffering, use bit masks to define your mouse cursor.
I think the order of logical ops is:
- AND the mouse cursor mask with the screen image
- XOR the mouse cursor data with the screen image
Code:
union REGS regs;
regs.x.ax=0x03;
int86(0x33,regs,regs)
int mousex=regs.cx; //regs.cx>>1 for 320 width
int mousey=regs.dx;
//call your function to put the image at mousex,mousey
You must have ampersands before the regs in the call to int86().
For some reason, this board messes up the ampersands which prevents me from using them correctly.
If you want to change your hardware mouse cursor, use sub-function 09h and the appropriate bit masks. Logical operations are taken care of by the interrupt handler.