Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!seismo!dimacs.rutgers.edu!rutgers!cbmvax!carolyn From: carolyn@cbmvax.commodore.com (Carolyn Scheppner - CATS) Newsgroups: comp.sys.amiga.programmer Subject: Re: GetMiscResource ? Message-ID: <22418@cbmvax.commodore.com> Date: 13 Jun 91 21:44:31 GMT References: <1949138e.ARN0d5b@trantor.informatik.uni-erlangen.de> Reply-To: carolyn@cbmvax.commodore.com (Carolyn Scheppner - CATS) Organization: Commodore, West Chester, PA Lines: 43 In article <1949138e.ARN0d5b@trantor.informatik.uni-erlangen.de> akk@trantor.informatik.uni-erlangen.de (Andy Klingler) writes: >How do I call GetMiscResource from Lattice/SAS C 5.05 ? > >I wanted to allocate the serialhardware to be able to play with the bits, >but there is no prototype for GetMiscResource in the includes and it even >does not appear in amiga.lib. >The only thing I could find was a > >#define MR_ALLOCMISCRESOURCE (LIB_BASE) See my example (rbfhandler I think) in the 1.3 Amiga RKM Libs and Devs. It's in the Exec Interrupts chapter. Since there were no stubs for Get/FreeMiscResource, I used #pragmas coded into the source. Here's a snippet including the pragmas. #ifdef LATTICE #include #include #include #include int CXBRK(void) { return(0); } /* Disable Lattice CTRL-C handling */ int chkabort(void) { return(0); } /* really */ extern struct Custom far custom; /* defined in amiga.lib */ UBYTE *GetMiscResource(long,UBYTE *); void FreeMiscResource(long); #pragma libcall MiscBase GetMiscResource 6 9002 #pragma libcall MiscBase FreeMiscResource c 001 #else extern struct Custom custom; /* Without pragmas, you must provide C bindings for misc.resource calls. * See the Resources chapter. */ #endif -- ========================================================================== Carolyn Scheppner -- Tech. Mgr. CATS - Commodore Amiga Technical Support PHONE 215-431-9180 {uunet,rutgers}!cbmvax!carolyn carolyn@commodore.com I am fully operational and all of my circuits are funcTiOnINg pperrf... ==========================================================================