Path: utzoo!attcan!uunet!lll-winken!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!caen!umich!yale!husc6!unix!mxmora From: mxmora@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Re: How can I move the cursor with THINKC?? Message-ID: <17590@unix.SRI.COM> Date: 25 Oct 90 16:10:55 GMT References: <55432.2723256d@pttrnl.nl> Reply-To: mxmora@unix.UUCP (Matt Mora) Organization: SRI International, Menlo Park, CA Lines: 55 In article <55432.2723256d@pttrnl.nl> nugteren@pttrnl.nl writes: >I am writing a trackball driver that would allow connection of an MSDOS Mouse >(actually optical trackball) to a Mac II. One of the problems I have to solve >is how to change to cursor position on the screen from a software level. >I have found the addresses in RAM that contain the current cursor position >(0x830). But now I would like to know which routine to call to refresh the >screen. Does anyone know where this ROM routine starts?? > > >I would appreciate any tips you might have!! > >Thanks in advance, > >Nils From UMPG page 10: This seems to come up every few months. I've posted bad Pascal code for this SetMouse routine in the past. Here's a Think C version: /* ------------------------- SetMouse ------------------------- */ /* some dangerous low-memory-global equates */ extern Point MTemp : 0x828; extern Point RawMouse : 0x82c; extern Point Mouse : 0x830; extern Byte MBState : 0x172; extern int CrsrNewCouple : 0x8ce; /* both New & Couple */ extern Byte CrsrNew : 0x8ce; extern Byte CrsrCouple : 0x8cf; #define Couple 0xff; /* value for CrsrCouple */ #define Uncouple 0x00; /* value for CrsrCouple */ void SetMouse(where) Point where; { long finalTicks; LocalToGlobal(&where); /* Get ready to store mouse position */ RawMouse = where; /* into RawMouse */ MTemp = where; /* and MTemp */ CrsrNewCouple = 0xffff; /* Hit CrsrNew & CrsrCouple */ Delay(5, &finalTicks); /* let the cursor catch up */ } /* SetMouse */ From: cbm@well.UUCP (Chris Muir) -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@sri.com SRI International | my unix mxmora@unix.sri.com ___________________________________________________________