• Advertisement

Archived

This topic is now archived and is closed to further replies.

Pascal - 13h mode - mouse control

This topic is 5903 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Can anybody help me with mouse control ? I''m practicing the 13h mode ... and I want some mousing :D I don''t know a single bit about using the mouse, especially in this oldie graphics mode. Thanks a lot ! PS : I''m new here. Glad that I''ve found this board.

Share this post


Link to post
Share on other sites
Advertisement
I''d try to help you out a little:

I assume you''re running DOS or something or else these lil''
snippets below won''t work (I didn''t test it actually because I use NT and Linux but they definitely work under DOS clones).

1) this will reset the mouse driver

PROCEDURE m_reset; ASSEMBLER;
ASM
XOR ax, ax
INT 33h
END;

2) set the mouse movement area (ie. mma(0,0,330,200)

PROCEDURE mma(x1,y1,x2,y2: INTEGER); ASSEMBLER;{ mma: MouseMoveArea }
ASM
MOV AX, 0008h { ftn.# for "Set vertical Limits" }
MOV CX, y1
MOV DX, y2
INT 33h { call mouse driver }
MOV AX, 0007h { ftn.# for "Set horizontal Limits" }
MOV CX, x1
MOV DX, x2
INT 33h { call mouse driver }
END;

3) get mouse movement

PROCEDURE m_move(VAR deltax, deltay : INTEGER); ASSEMBLER;
ASM
MOV AX, 0Bh
INT 33h
LES DI, deltax
MOV ES : [DI], CX
LES DI, deltay
MOV ES : [DI], DX
END;

4) current mouse cursor position

FUNCTION m_x: WORD; ASSEMBLER;
ASM
MOV AX, 03h { GetmouseInfo }
INT 33h
MOV AX, CX
ADD AX, Cursor.hotx { taken from my mouse unit so best ignore it }
END;

FUNCTION m_y: WORD; ASSEMBLER;
ASM
MOV AX, 03h
INT 33h
MOV AX, DX
ADD AX, Cursor.hoty
END;

5) mouse button status

FUNCTION m_button : WORD; ASSEMBLER;
ASM
MOV AX, 03h
INT 33h
MOV AX, BX
END;

if you need some more specific functions and/or info - drop me a line via e-mail.


Share this post


Link to post
Share on other sites

  • Advertisement