Article View: alt.msdos.programmer
Article #689Re: Mouse programming
From: Ian D. Gay
Date: Mon, 05 Oct 1992 16:50
Date: Mon, 05 Oct 1992 16:50
57 lines
2480 bytes
2480 bytes
gay@selkirk.sfu.ca (Ian D. Gay) writes:
>stuartw@ccu1.aukuni.ac.nz (Stuart Woolford) writes:
>> A friend of mine has a small problem with the useage of Msoft mouse drivers...
>>How do you write a routine in pascal ( or C...asm...etc ) which will be called
>>by the standard callback function of the driver ( when a button is pressed, etc
>>), and which can still address the programs global variables, the problem is
>>that, when the routine is called, DS points at the MOUSE DRIVERS data segment,
>>and I at least could not think of an easy way to address the programs global
>>data, which will NOT be at a fixed address :-(
>I have used the following as inline assembler with Turbo-C. It works.
>I couldn't think of a pure C way to do it.
> push ds
> mov ds seg DGROUP
sorry, not thinking, that should be
push ds
mov ax, seg DGROUP
mov ds,ax
since you cant load a constant to a segment register
> ......
> pop ds
>This works because T-C keeps its global variables in a group called
>DGROUP. Basically what you have to do is get ds loaded with a
>_constant_ of the correct value, since no registers have what you want
>when the call occurs. The above code generates such a constant (fixed
>up at link time, of course).
>>Also, he said that there is a problem with the mouse in all 256 color VGA modes
>>( under TP 6.0, using BGI's ), any comment ????
>Are BGI's supposed to support the mouse? The usoft mouse driver
>doesn't really support anything but the standard IBM video modes, i.e.
>only 320x200 (yecch!) if you want 256 colours. You can do it yourself,
>the hard way, by only using the lowest level mouse calls, and
>drawing/erasing the pointer yourself, as required.
>>any replies appreciated...
>>------------------------------------------------------------------------------
>>stuartw@ccu1.aukuni.ac.nz
>> >>>>In VI Where Available<<<<
>>------------------------------------------------------------------------------
Technical Details
Message-ID:
<gay.718303817@sfu.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!destroyer!cs.ubc.ca!newsserver.sfu.ca!sfu.ca!gayReferences:
<1992Oct5.000501.3735@ccu1.aukuni.ac.nz> <gay.718302243@sfu.ca>Show Full Headers
Complete Article Headers
Newsgroups: alt.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!cs.ubc.ca!newsserver.sfu.ca!sfu.ca!gay From: gay@selkirk.sfu.ca (Ian D. Gay) Subject: Re: Mouse programming Message-ID: <gay.718303817@sfu.ca> Keywords: Mouse Sender: news@sfu.ca Organization: Simon Fraser University, Burnaby, B.C., Canada References: <1992Oct5.000501.3735@ccu1.aukuni.ac.nz> <gay.718302243@sfu.ca> Date: Mon, 5 Oct 1992 16:50:17 GMT Lines: 57