From: Gautier DOT DeMontmollin AT maths DOT unine DOT ch Newsgroups: comp.os.msdos.djgpp Subject: Re: Writing Drivers? Message-ID: <9DN3PsygTq+p@nedcu4> Date: 5 Oct 98 14:27:38 MET References: <907589267 DOT 988799 AT mars DOT cs DOT unp DOT ac DOT za> Organization: University of Neuchatel, Switzerland Lines: 29 NNTP-Posting-Host: nedcu4.unine.ch To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp jdominy AT saturn DOT cs DOT unp DOT ac DOT za (James Dominy) writes: > Right I've got two putpixel routines, one for VESA 1.2 banked mode, the > other for VESA 2.0 Linear Frame Buffer Mode. > > They are both implemented as macros now for speed purposes, although no > doubt inline would have much the same effect on performance. > > However, I do not want to continuously have if statements all over my code > checking which routine should be used. So, I set up an array as such > > void *putpixel[2](int x, int y, int c); > > and call putpixel[0](0,0,15) for example or use 1 instead of 0 for the > second routine. > > But can I inline them in any way? I realize that this would involve the > compiler knowing which routine would be used on each call, but I would know > that from after my mode setting routine! > > Any help appreciated! A good solution is in SVGA02.ZIP @ ftp://ftp.gwu.edu/pub/ada/ez2load/ Of course inling is trivial to program in Ada (pragma inline) and cross-package inlining is supported by GNAT compiler (@ same address) - no need of macro-assembler level tricks... Gautier