[comp.os.msdos.programmer] My patches to CMOUSE.ARC

nbladt@aut.UUCP (Norbert Bladt) (10/17/90)

Hello,

I did promise to post my patches to the CMOUSE.ARC package which is
on SIMTEL20.

This is my first patch posting, so I apologize for anything I did wrong
with this posting. The patches are very small.
I used a diff on my system to create the diff output, but
I don't know whether this output can be used by the patch program.
Additionally, I changed something else in the original files. However,
this was just done to modify the "one tab is 4 spaces" look-and-feel
to my "one tab is 8 spaces" preferred look.
So, there were a lot of diff's which were done only for that reason and I
left them out of this posting.

First, a short reminder, what CMOUSE.ARC is and where to get it:

_______ extracted parts of a message on USENET (on c.b.i.p.d ?)

> CMOUSE.ARC - Mouse management for MSC 5.1/MASM 5.0 or later

> I have uploaded: [to SIMTEL20, Norbert Bladt]

> CMOUSE.ARC      Mouse management for MSC 5.1/MASM 5.0 or later

> The following is included in the archive:

> Archive:  CMOUSE.ARC
> Name          Length    Method     SF   Size now  Mod Date    Time     CRC
> ============  ========  ========  ====  ========  =========  ======== ========
> COMPACT.INC         17    -----     2         17  06 Mar 89  12:01:48 DE63
> ERROR.LST          450  Crunched   15        379  06 Mar 89  11:07:38 4A34
> FARCALL.INC         17    -----     2         17  08 Nov 88  13:26:36 B2FB
> HANDLER.ASM       1092  Crunched   30        754  16 Apr 89  17:31:44 DEE9
> HUGEDATA.INC        18    -----     2         18  08 Nov 88  13:26:38 AEA0
> LARGE.INC           15    -----     3         15  06 Mar 89  12:02:20 1D54
> MAKE.EXE         21505  Crunched   18      17495  26 Oct 87  12:43:14 8E45
> MAKEFILE          4572  Crunched   61       1743  06 Mar 89  12:12:40 E761
> MEDIUM.INC          16    -----     3         16  06 Mar 89  12:02:04 7A84
> MICE.ASM         21552  Squashed   72       5898  31 May 87  10:58:28 49ED
> MOUSE.C           4934  Crunched   49       2483  16 Apr 89  17:36:40 2161
> MOUSE.CMD           40    -----     1         40  06 Mar 89  12:13:26 ADB2
> MOUSE.H           2183  Crunched   41       1288  16 Apr 89  15:23:16 B505
> NEARCALL.INC        17    -----     2         17  08 Nov 88  13:26:50 72AA
> SMALDATA.INC        18    -----     2         18  08 Nov 88  13:26:54 6EF1
> SMALL.INC           15    -----     3         15  06 Mar 89  12:02:20 AF7D
> TEST1.C           2105  Crunched   42       1214  06 Mar 89  14:48:30 CE94
> TEST2.C           1766  Crunched   37       1097  28 Mar 89  06:30:00 F9EF
> ============     =====            ====     =====  =========  ======== ====
>  total    18     60332             45%     33048

> The source code is intended for MSC 5.1 and MASM 5.0 or later.

> I have included a PD Unix-like make, which is what my makefile is
> intended to be used with (MAKE.EXE). This make has been posted to
> the Usenet several times in the past, and will run recursively which
> allows automatic manufacturing of libraries for all memory models.

> The mouse routines are adapted from articles in 'The C Gazette' and
> several other publications, including PC Magazine and PC Tech Journal.

> The makefile will create a library file for each of the PC memory models.

> See test1.c and test2.c for examples of use.

I did use it with MS-C 5.0 (and MASM 5.1) and it works, too.

Hope that helps some of you,

Norbert Bladt.

____________ Patch for MOUSE.C -----------------------------------------
____________ comment: changed parameter 3 of "GraphicCursor"
____________          from "unsigned long (*mask)[]"
____________          to the reasonable (and working) "unsigned int *mask".
____________          changed register setting from "ds" to "es".
148,151c157,161
< void GraphicCursor(hot_x, hot_y, mask)	/* Define grahic cursor & hot spot */
< int hot_x, hot_y;			/* Coordinates of hot spot	   */
< unsigned int *mask;			/* Ptr to array of unsigned ints   */
< {					/* (double words)		   */
---
> void
> GraphicCursor(hot_x, hot_y, mask)	/* Define grahic cursor & hot spot */
> int hot_x, hot_y;							/* Coordinates of hot spot				*/
> unsigned long (*mask)[];				/* Ptr to array of unsigned longs	*/
> 	{											/* (double words)							*/
159,160c169
< /* 19-Jun-90: NB - Bugfix: changed "ds" to "es" */
< 	segregs.es = FP_SEG(mask);
---
> 	segregs.ds = FP_SEG(mask);

____________ Patch for MOUSE.H -----------------------------------------
____________ comment: just reflects the change in MOUSE.C
49c50
< extern void GraphicCursor(int hot_x, int hot_y, unsigned far *mask);
---
> extern void GraphicCursor(int hot_x, int hot_y, unsigned long **mask);
57a59
> 

____________ Patch for TEST1.C -----------------------------------------
____________ comment: just reflects the change in MOUSE.C
5c5
< static unsigned far masks[32] =			/* Graphics cursor masks */
---
> main()
7,18d6
< 	0xffff, 0xffff, 0xffff, 0xffff,		/* Screen mask */
< 	0xffff, 0xffff, 0xffff, 0xffff,
< 	0xffff, 0xffff, 0xffff, 0xffff,
< 	0xffff, 0xffff, 0xffff, 0xffff,
< 
< 	0x8000, 0xe000, 0xf800, 0xd800,		/* Cursor mask */
< 	0x0c00, 0x0600, 0x0300, 0x0000,
< 	0x0000, 0x0000, 0x0000, 0x0000,
< 	0x0000, 0x0000, 0x0000, 0x0000
< };
< 
< main() {
22,33c10,21
< 	static unsigned far masks[32] =		/* Graphics cursor masks */
< 	  {
< 	  0xffff, 0xffff, 0xffff, 0xffff,	/* Screen mask */
< 	  0xffff, 0xffff, 0xffff, 0xffff,
< 	  0xffff, 0xffff, 0xffff, 0xffff,
< 	  0xffff, 0xffff, 0xffff, 0xffff,
< 
< 	  0x8000, 0xe000, 0xf800, 0xd800,	/* Cursor mask */
< 	  0x0c00, 0x0600, 0x0300, 0x0000,
< 	  0x0000, 0x0000, 0x0000, 0x0000,
< 	  0x0000, 0x0000, 0x0000, 0x0000
< 	};
---
> 	static unsigned long masks[32] =			/* Graphics cursor masks */
> 		{
> 		0xffff, 0xffff, 0xffff, 0xffff,		/* Screen mask */
> 		0xffff, 0xffff, 0xffff, 0xffff,
> 		0xffff, 0xffff, 0xffff, 0xffff,
> 		0xffff, 0xffff, 0xffff, 0xffff,
> 
> 		0x8000, 0xe000, 0xf800, 0xd800,		/* Cursor mask */
> 		0x0c00, 0x0600, 0x0300, 0x0000,
> 		0x0000, 0x0000, 0x0000, 0x0000,
> 		0x0000, 0x0000, 0x0000, 0x0000
> 		};

____________ End of patches --- -----------------------------------------
-- 
Please use this path as return address. DON'T USE THE RETURN PATH IN THE HEADER
Norbert Bladt, Ascom Autelca AG, Worbstr. 201, CH-3073 Guemligen, Switzerland
Phone: +41 31 52 92 14
EMail: ..!uunet!mcsun!chx400!hslrswi!bladt