[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Double lowres graphics?
Mike Pfaiffer (pfaiffer@mts.net) wrote:
: > To clear the entire double-lo-res screen and draw a white horizontal line
: > across the middle of it, then, you would need to do the following:
: >
: > ]PR#3
: > ]GR
: > ]POKE -16290,0: REM Annunciator 3
: > ]POKE -16299,0: REM Page 2
: > ]GR : REM Clear the other half of the page
: > ]COLOR=15 : REM Set color=White
: > ]HLIN 0,39 AT 24 : REM Draw line across even spaces
: > ]POKE -16300,0 :REM Select main memory
: > ]HLIN 0,39 AT 24 : REM Fill in the gaps
: >
: > I have just been informed that the system is about to go down, so I have
: > to run. I'll present the list of soft-switches next time I read this
: > newsgroup.
: It might be easier just to implement some routines in assembler. Just
: remember it maps to the same area with the AUX page as the even columns
: (0,2,4,etc.). The toughest thing to implement would be a line from one
: point to another (not HLIN or VLIN). To implement a line the formula y=
: mx + b should be useful.
Remember that while in hi-res you get the ever-so-useful HPLOT x1,y1 TO
x2,y2 syntax, that does not actually exist in lo-res. You get HLIN, VLIN,
PLOT, and SCRN to play with. With that in mind, you could...even in
Applesoft...write yourself a cool little subroutine to handle lo-res
plotting of any legal point on the screen, something like this:
60000 Q1=INT(X/2):P=(Q1=X/2):POKE -16300+P,0:PLOT Q1,Y:RETURN
...That way, if you specify any point (0-79),(0-47) in the variables X and
Y, that single line of code will figure out which page to use, what
horizontal position to use, and plot the location for you.
(EXPLANATION FOR THOSE NOT FAMILIAR WITH APPLESOFT--
(Note that if X is even, then X/2 = INT(X/2), therefore P=1 therefore
-16300+P=-16299, which is Page 2. If X is odd, then X/2 <> INT (X/2)
therefore P=0 therefore -16300+P=-16300 which is Page 1. Cool, huh?)
I'd have to think a bit about how to do it, since my math skills are
pretty shoddy, but you could write a routine to find all the dot
positions, then GOSUB 60000 (the routine above) to do the actual plotting.
Hmmm...
60001 XD = X2-X1 : YD = Y2-Y1 : YS = YD/XD : YY=Y1:FOR X = X1 TO X2:
Y=INT(YY) : GOSUB 60000 : YY=YY+YS : NEXT X : RETURN
I haven't completely thought it through, but I *think* that ought to work.
Give it X1,Y1 and X2,Y2 and it should be able to generate a line provided
that X1 < X2; if Y2 happens to be < Y1, then YS will be negative, so the
routine should still work. I think. 8-)
--Dave Althoff, ][.
--
/X\ _ _ _*** Closed for the season ***
/XXX\ /X\ /X\_ _ /X\__ _ _ _____
/XXXXX\ /XXX\ _/XXXX\_ /X\ /XXXXX\ /X\ /X\ /XXXXX
_/XXXXXXX\__/XXXXX\/XXXXXXXX\_/XXX\_/XXXXXXX\__/XXX\_/XXX\_/\_/XXXXXX