Page 2 of 2

Re: X and Y

Posted: Fri Jun 21, 2019 11:44 am
by XavSnap
Hi,
On the Zx81, you can't use the PRINT AT all over the screen.

Code: Select all

1 FOR A=0 TO 23
2 PRINT AT A,0;"X"
3 NEXT A
Will crash, or give an display error !

It's due to the command lines window (2 lines located in line 22 & 23), used for INPUT command !

We had to fill this zone with a PRINT AT 21,0; "xxxxxxxxxx...xxxxxxxxx" (1+2=3 lines of x continus chars!)
In this case, PRINT AT 22,x and PRINT AT 23,x give a Basic error.

To avoid this error, you had to set the INPUT zone, and set the Basic variable (DF-SZ) to 1 to allow the line 22 or to 0, to set the line#23 to a free use.

Code: Select all

0 POKE 16418,0
1 FOR A=0 TO 23
2 PRINT AT A,0;"X"
3 NEXT A
4 GOTO 4
In this case, the PRINT AT 23,x will work fine, but you had to set the "DF-SZ" to '1', if you had to get an INPUT command line.

'POKE 16418,0' is to set the full PRINT AT screen but, in case of INPUT command, the INPUT prompt won't be displayed !
:roll:

Otherwise, I still do not understand your questions …
Print AT 0 to 31 and PRINT AT 23,31...
[0-31] 32 characters. (columns)
[23-0] 24 characters. (lines)
In a normal stat, only 22 [Lines 0-21] are usable… without a DF-SZ set.
That's all.

Re: X and Y

Posted: Fri Jul 19, 2019 1:38 am
by 2late
Crayon21 wrote:
Fri Jun 21, 2019 12:16 am
what are all the numbers for? positions? kinda lost here
Yes, the numbers are positions.

Leaving alone the input lines, PRINT AT goes "the other way round" as PLOT in two ways.
  • PLOT has a mathematical system where the horizontal position is counted left to right and is the first argument of PLOT.
  • PRINT AT also counts left to right, but the horizontal position goes into the second argument
  • PLOT counts the vertical position bottom up and it is the second argument of PLOT.
  • PRINT AT however counts the lines top down, and the vertical position goes into the first argument
So to convert position from PLOT to PRINT you have to
  1. convert the horizontal i.e. x position by dividing it by 8 and take the INT of this
  2. convert the vertical i.e. y position by dividing it by 8 and take the INT of this and subtract the result from 21
The attached snapshot draws a line across the screen and then puts an S to the start and an E to the end by converting the coordinates and using PRINT AT.
CONVERT-PLOT-TO-PRINT-AT-COORDINATES.png

Re: X and Y

Posted: Fri Jul 19, 2019 1:42 am
by 2late
Crayon21 wrote:
Sat Jun 15, 2019 11:31 pm
BTW, how do i save drawings as Jpeg or other using Fuse?
I simply make a screen copy with https://www.gimp.org/

Re: X and Y

Posted: Fri Jul 19, 2019 2:10 am
by XavSnap
Thanks 2Late.
:ugeek: