Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!newstop!sun!stpeter.Eng.Sun.COM!cmcmanis From: cmcmanis@stpeter.Eng.Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga Subject: Re: Difficulty in programming Message-ID: <136558@sun.Eng.Sun.COM> Date: 2 Jun 90 09:27:29 GMT References: <2487@zipeecs.umich.edu> <1990Jun2.063414.10292@agate.berkeley.edu> Sender: news@sun.Eng.Sun.COM Organization: Sun Microsystems, Mt. View, Ca. Lines: 40 In article <1990Jun2.063414.10292@agate.berkeley.edu> laba-1ei@e260-2f (Joseph Chung) writes: >Try this one on for size: > >In an IBM (no flames please!), if I want to put a character anywhere on the >screen, I just >1. load a segment register with the segment of the screen. >2. write the proper byte to the screen location (using a simple offset) (In >short, is a basic POKE command!) > >How would you accomplish this in an Amiga? Well, how about : win = fopen("CON:640/200/0/0","w+"); fprintf(fp,"\e[%d;%dH%s",y,x,"X"); Prints the character X at x, y. Of course in your rather rude IBM example you just bang on the hardware, the equivalently rude thing on the Amiga is : IntuitionBase = OpenLibrary("intuition.library",0L); GfxBase = OpenLibrary("graphics.library",0L); rp = &(IntuitionBase->FirstScreen->RastPort); Move(rp, x, y); Text(rp, "X", 1); Of course this screws up the display, just like the IBM example given does. The only difference between this and making it nice is getting your own rastport which means opening your own window which is really trivial in AmigaBASIC and in C it is also pretty trivial. My final comment on all this silliness is wait until you get a real job and someone asks you to put characters on an "X11" window. Hooboy, that may be too difficult for you. This is one of the reason why "years and years" of experience programming the IBM PC just doesn't cut it in my book. -- --Chuck McManis Sun Microsystems uucp: {anywhere}!sun!cmcmanis BIX: Internet: cmcmanis@Eng.Sun.COM These opinions are my own and no one elses, but you knew that didn't you. "I tell you this parrot is bleeding deceased!"