Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: THINK C & 32-bit quickdraw (.c) Message-ID: <32505@ucbvax.BERKELEY.EDU> Date: 12 Nov 89 07:29:11 GMT References: <32503@ucbvax.BERKELEY.EDU> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 274 As my way of saying thank you, here are the interfaces for 32-bit Quickdraw for THINK C. You can save this, compile it, then get at all the 32-bit quickdraw traps from THINK C. You may want to save this file and upload it, since it contains tabs and fairly long lines.: > The mac is a detour in the inevitable march of mediocre computers. > drs@bnlux0.bnl.gov (David R. Stampf) --- David Phillip Oster -master of the ad hoc odd hack. Arpa: oster@dewey.soe.berkeley.edu Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu (cut here, call this QuickDraw32Bit.c). #include /* let's get a real juicy 32 bit discussion going based on this maybe !! by bhamlin@well.sf.ca.us (Brian M. Hamlin) from oster@well.sf.ca.us (David Phillip Oster) */ /* BitmapToRegion - */ pascal OSErr BitmapToRegion(region, bmap) RgnHandle region; BitMap *bmap;{ asm { SUBQ.L #2,SP MOVE.L region(A6),-(SP) MOVE.L bmap(A6),-(SP) DC.W 0xA8D7 MOVE.W (SP)+,D0 } } /* NewGWorld - */ pascal QDErr NewGWorld(offscreenGWorld, pixelDepth, boundsRect, cTable, aGDevice, flags) GWorldPtr *offscreenGWorld; short pixelDepth; Rect *boundsRect; CTabHandle cTable; GDHandle aGDevice; GWorldFlags flags;{ asm { SUBQ.L #2,SP MOVE.L offscreenGWorld(A6),-(SP) MOVE.W pixelDepth(A6),-(SP) MOVE.L boundsRect(A6),-(SP) MOVE.L cTable(A6),-(SP) MOVE.L aGDevice(A6),-(SP) MOVE.L flags(A6),-(SP) MOVEQ #0,D0 DC.W 0xAB1D MOVE.W (SP)+,D0 } } /* LockPixels - */ pascal Boolean LockPixels(pm)PixMapHandle pm;{ asm { SUBQ.L #2,SP MOVE.L pm(A6),-(SP) MOVEQ #1,D0 DC.W 0xAB1D MOVE.B (SP)+,D0 } } /* UnlockPixels - */ pascal void UnlockPixels(pm)PixMapHandle pm;{ asm { MOVE.L pm(A6),-(SP) MOVEQ #2,D0 DC.W 0xAB1D } } /* UpdateGWorld - */ pascal GWorldFlags UpdateGWorld(offscreenGWorld, pixelDepth, boundsRect, cTable, aGDevice, flags) GWorldPtr *offscreenGWorld; short pixelDepth; Rect *boundsRect; CTabHandle cTable; GDHandle aGDevice; GWorldFlags flags;{ asm { SUBQ.L #4,SP MOVE.L offscreenGWorld(A6),-(SP) MOVE.W pixelDepth(A6),-(SP) MOVE.L boundsRect(A6),-(SP) MOVE.L cTable(A6),-(SP) MOVE.L aGDevice(A6),-(SP) MOVE.L flags(A6),-(SP) MOVEQ #3,D0 DC.W 0xAB1D MOVE.L (SP)+,D0 } } /* DisposeGWorld - */ pascal void DisposeGWorld(offscreenGWorld)GWorldPtr offscreenGWorld;{ asm { MOVE.L offscreenGWorld(A6),-(SP) MOVEQ #4,D0 DC.W 0xAB1D } } /* GetGWorld - */ pascal void GetGWorld(port, gdh)CGrafPtr *port;GDHandle *gdh;{ asm { MOVE.L port(A6),-(SP) MOVE.L gdh(A6),-(SP) MOVEQ #5,D0 DC.W 0xAB1D } } /* SetGWorld - */ pascal void SetGWorld(port, gdh)CGrafPtr port;GDHandle gdh;{ asm { MOVE.L port(A6),-(SP) MOVE.L gdh(A6),-(SP) MOVEQ #6,D0 DC.W 0xAB1D } } /* CTabChanged - */ pascal void CTabChanged(ctab)CTabHandle ctab;{ asm { MOVE.L ctab(A6),-(SP) MOVEQ #7,D0 DC.W 0xAB1D } } /* PixPatChanged - */ pascal void PixPatChanged(ppat)PixPatHandle ppat;{ asm { MOVE.L ppat(A6),-(SP) MOVEQ #8,D0 DC.W 0xAB1D } } /* PortChanged - */ pascal void PortChanged(port)GrafPtr port;{ asm { MOVE.L port(A6),-(SP) MOVEQ #9,D0 DC.W 0xAB1D } } /* GDeviceChanged - */ pascal void GDeviceChanged(gdh)GDHandle gdh;{ asm { MOVE.L gdh(A6),-(SP) MOVEQ #0x0A,D0 DC.W 0xAB1D } } /* AllowPurgePixels - */ pascal void AllowPurgePixels(pm)PixMapHandle pm;{ asm { MOVE.L pm(A6),-(SP) MOVEQ #0x0B,D0 DC.W 0xAB1D } } /* NoPurgePixels - */ pascal void NoPurgePixels(pm)PixMapHandle pm;{ asm { MOVE.L pm(A6),-(SP) MOVEQ #0x0C,D0 DC.W 0xAB1D } } /* GetPixelsState - */ pascal GWorldFlags GetPixelsState(pm)PixMapHandle pm;{ asm { SUBQ.L #4,SP MOVE.L pm(A6),-(SP) MOVEQ #0x0D,D0 DC.W 0xAB1D MOVE.L (SP)+,D0 } } /* SetPixelsState - */ pascal void SetPixelsState(pm, state)PixMapHandle pm;GWorldFlags state;{ asm { MOVE.L pm(A6),-(SP) MOVE.L state(A6),-(SP) MOVEQ #0x0E,D0 DC.W 0xAB1D } } /* GetPixBaseAddr - */ pascal Ptr GetPixBaseAddr(pm)PixMapHandle pm;{ asm { SUBQ.L #4,SP MOVE.L pm(A6),-(SP) MOVEQ #0x0F,D0 DC.W 0xAB1D MOVE.L (SP)+,D0 } } /* NewScreenBuffer - */ pascal QDErr NewScreenBuffer(globalRect, purgeable, gdh, offscreenPixMap) Rect *globalRect; Boolean purgeable; GDHandle *gdh; PixMapHandle *offscreenPixMap;{ asm { SUBQ.L #2,SP MOVE.L globalRect(A6),-(SP) MOVE.B purgeable(A6),-(SP) MOVE.L gdh(A6),-(SP) MOVE.L offscreenPixMap(A6),-(SP) MOVEQ #0x10,D0 DC.W 0xAB1D MOVE.W (SP),D0 } } /* DisposeScreenBuffer - */ pascal void DisposeScreenBuffer(offscreenPixMap)PixMapHandle offscreenPixMap;{ asm { MOVE.L offscreenPixMap(A6),-(SP) MOVEQ #0x11,D0 DC.W 0xAB1D } } /* GetGWorldDevice - */ pascal GDHandle GetGWorldDevice(offscreenGWorld)GWorldPtr offscreenGWorld;{ asm { SUBQ.L #4,SP MOVE.L offscreenGWorld(A6),-(SP) MOVEQ #0x12,D0 DC.W 0xAB1D MOVE.L (SP)+,D0 } }