Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!lll-lcc!ames!ucbcad!ucbvax!decvax!tektronix!reed!omssw2!ogcvax!schaefer From: schaefer@ogcvax.UUCP Newsgroups: comp.sys.cbm Subject: Re: C-Power Message-ID: <1199@ogcvax.UUCP> Date: Thu, 12-Feb-87 16:38:53 EST Article-I.D.: ogcvax.1199 Posted: Thu Feb 12 16:38:53 1987 Date-Received: Sun, 15-Feb-87 05:24:13 EST Reply-To: schaefer@ogcvax.UUCP (Barton E. Schaefer) Organization: Oregon Graduate Center, Beaverton, OR Lines: 108 Summary: Need grafpak1.c Expires: References: Sender: Followup-To: Keywords: [ This is a partial reposting of an earlier article. I'm not sure the first one ever made it out of OGC. Apologies if you've seen this before. ] Does anyone out there have a COMPLETE source for grafpak1.c (originally posted some months ago)? If so, I would greatly appreciate it if you could mail me a copy. I have appended a context diff of the corrections I attempted, but they are wrong somewhere because gdriver locks up with a blank screen right after the textmode test. Actually, a summary of what else I need to fix would suffice. Thanks in advance .... *** grafpak1.c Tue Nov 11 13:17:10 1986 --- g1.c Tue Jan 27 10:19:16 1987 *************** *** 179,185 } /* Set graphics screen base address */ ! unsigned vb,bb; { register unsigned bank; --- 179,185 ----- } /* Set graphics screen base address */ ! setmap(vb,bb) unsigned vb,bb; { register unsigned bank; *************** *** 212,217 } /* Set Text Graphics mode */ setmap(0,1024); setscreen(0,1024); poke(VICCTL,peek(VICCTL) & 223); --- 212,219 ----- } /* Set Text Graphics mode */ + textmode() + { setmap(0,1024); setscreen(0,1024); poke(VICCTL,peek(VICCTL) & 223); *************** *** 239,244 poke(VICMC,peek(VICMC) & 239); /* disable multi-color mode */ poke(53281,pencolor[0]); /* background color reg */ aspect = 320.0 / 200.0; /* compute aspect ratio */ /* Convert pixel coordinate to byte offset. ** The BASIC formula from the PRG is: --- 241,247 ----- poke(VICMC,peek(VICMC) & 239); /* disable multi-color mode */ poke(53281,pencolor[0]); /* background color reg */ aspect = 320.0 / 200.0; /* compute aspect ratio */ + } /* Convert pixel coordinate to byte offset. ** The BASIC formula from the PRG is: *************** *** 263,269 loc = y_offset[y >> 3] + /* row offset */ (x & 0xfff8) + /* character offset */ ! return loc; } --- 266,272 ----- loc = y_offset[y >> 3] + /* row offset */ (x & 0xfff8) + /* character offset */ ! (y & 7); /* line offset */ return loc; } *************** *** 329,335 poke(loc,(pencolor[1]<<4) | pencolor[2]); } } ! } /* Bresenham's line drawing algorithm. ** Draw a line between two coordinate pairs. --- 332,338 ----- poke(loc,(pencolor[1]<<4) | pencolor[2]); } } ! /* something must be missing here */ } /* Bresenham's line drawing algorithm. ** Draw a line between two coordinate pairs. -- Bart Schaefer Dept. of CS&E CSNET: schaefer@Oregon-Grad Oregon Graduate Center UUCP: {ihnp4,seismo,sun}!verdix \ 19600 NW Von Neumann Dr {hplabs,ucbvax,decvax}!tektronix !ogcvax!schaefer Beaverton, OR 97006