Article View: comp.os.msdos.programmer
Article #6357Re: Mouse Cursor Drawing .
From: Lee Hollingworth
Date: Wed, 18 Nov 1992 07:23
Date: Wed, 18 Nov 1992 07:23
106 lines
2542 bytes
2542 bytes
buxduac@dct.ac.uk writes:
>How does a mouse driver draw it cursor on the screen ? Does it use a
>nice safe DOS function or does it have to do the bit manipulation itself ?
> I know int 33H function 09 sets the cursor shape but the drawing I
>can not find !.
Int 33h 09h does indeed set the cursor shape and it uses ES:DX for pointer
to screen and cursor. (ES segment, DX offset).
You will need a function which defines segment:offset such as MSC && TC++
FP_OFF() and FP_SEG().
/***
* file: mouse.h
* purpose: mouse defines
***/
#ifndef MOUSE
#define LBUTTON 0
#define RBUTTON 1
#define SOFT_TEXT_CURSOR 0
#define HARD_TEXT_CURSOR 1
#define MOUSE_BUS 1
#define MOUSE_SERIAL 2
#define MOUSE_INPORT 3
#define MOUSE_PS2 4
#define MOUSE_MP 5
#define IRQ_PS2 0
struct graph_cur {
int screen_mask[16];
int cursor_mask[16];
int spotx;
int spoty;
};
/* graphics mode cursor, hour glass */
static struct graph_cur far gcursor_hour = {
/* screen mask */
0x0000,
0x0000,
0x0000,
0x8001,
0xC003,
0xE007,
0xF00F,
0xE007,
0xC003,
0x8001,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
/* cursor mask */
0x0000,
0x7FFE,
0x6006,
0x300C,
0x1818,
0x0C30,
0x0660,
0x03C0,
0x0660,
0x0C30,
0x1998,
0x33CC,
0x67E6,
0x7FFE,
0x0000,
0x0000,
/* hot spot x, y */
07, 07
};
#define MOUSE
#endif
void m_cursor(struct graph_cur far *cursor)
{
unsigned seg = FP_SEG(cursor);
unsigned off = FP_OFF(cursor);
int spotx = cursor->spotx;
int spoty = cursor->spoty;
_asm {
mov ax, 9
mov bx, spotx
mov cx, spoty
mov es, seg
mov dx, off
int 33h
}
}
Lee Hollingworth
s1110238@giaeb.cc.monash.edu.au
Technical Details
Message-ID:
<s1110238.722071396@giaeb>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!munnari.oz.au!titan!trlluna!bruce.cs.monash.edu.au!monu6!giaeb!s1110238References:
<1992Nov17.153941.1446@dct.ac.uk>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!munnari.oz.au!titan!trlluna!bruce.cs.monash.edu.au!monu6!giaeb!s1110238 From: s1110238@giaeb.cc.monash.edu.au (Lee Hollingworth) Subject: Re: Mouse Cursor Drawing . Message-ID: <s1110238.722071396@giaeb> Sender: news@monu6.cc.monash.edu.au (Usenet system) Organization: Monash University, Melb., Australia. References: <1992Nov17.153941.1446@dct.ac.uk> Date: Wed, 18 Nov 1992 07:23:16 GMT Lines: 106