Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!ll-xn!ames!amdahl!bnrmtv!perkins From: perkins@bnrmtv.UUCP (Henry Perkins) Newsgroups: comp.sys.ibm.pc Subject: Re: Graphics driver Message-ID: <2436@bnrmtv.UUCP> Date: Tue, 25-Aug-87 19:09:14 EDT Article-I.D.: bnrmtv.2436 Posted: Tue Aug 25 19:09:14 1987 Date-Received: Fri, 28-Aug-87 00:47:05 EDT References: <1096@ark.cs.vu.nl> Organization: BNR Inc., Mountain View, California Lines: 32 Summary: Direct writes to CGA memory are fastest In article <1096@ark.cs.vu.nl>, lesmem@cs.vu.nl (Marco Lesmeister) writes: > Could anyone tell me what the fastest way is to control the screen in, for > instance games and simulators? I want to move a C64-sprite like figure > as fast as possible across the screen in CGA-mode. If you want to modify a CGA screen, the fastest way to do it is with direct writes to CGA memory, located in B800:0000 to B800:1F40 (even scan lines) and B800:2000 to B800:2F40 (odd scan lines). A device driver would be s l o w . You're trying to do something that IBM really didn't provide for. There is no hardware support for sprites or anything resembling them; you'll have to save the original screen contents so you can restore things when the "sprite" moves, and you'll need to do your own collision calculations. You can't even do color table animation, because the color palettes are fixed with two non-intersecting sets of 3 colors each. Since each byte of memory represents 4 pixels, you'll need to OR and AND with pixel masks for horizontal movement. Vertical movement is harder, because you need to add or subtract your screen memory offset depending on whether you're in an even or odd row. Good luck; you'll need it, plus lots of patience. (I did the animation for Championship Golf, published by Activision's GameStar division.) -- {hplabs,amdahl,ames}!bnrmtv!perkins --Henry Perkins It is better never to have been born. But who among us has such luck? One in a million, perhaps.