X and Y

A place to discuss the ZX80's and ZX81's younger brother - the Sinclair ZX Spectrum
Crayon21
Posts: 348
Joined: Sun Nov 04, 2018 2:33 am

X and Y

Post by Crayon21 »

When using the plot and draw commands, I get confused as to what X and Y symbolize as far as cardinal direction.
Is X up and Y left, is the second number a completely different direction? Is there some sort of guide i can use to map out the Plot and Draw commands. In short, do i need to know geometry to do simple commands? Clearly, Sinclair never thought that we'd need a map just to make a simple picture. I can understand Circle fine, but even making a simple face is frustrating. please help

BTW, how do i save drawings as Jpeg or other using Fuse?
In Heck, there are two options for perpetual torment:

Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
:twisted:
User avatar
1024MAK
Posts: 5103
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: X and Y

Post by 1024MAK »

In terms of graphics, imagine you are looking at a piece of graph paper (with a fine grid printed on it).

X is then the horizontal plane, with point zero on the bottom left, and as you move to the right, X increments upwards.

Y is the vertical plane. Point zero is still the bottom left. As you move up, Y increases.

This is a completely different system to the PRINT AT coordinate system.

See the manual for more details...

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
Crayon21
Posts: 348
Joined: Sun Nov 04, 2018 2:33 am

Re: X and Y

Post by Crayon21 »

and for PRINT AT?
In Heck, there are two options for perpetual torment:

Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
:twisted:
User avatar
1024MAK
Posts: 5103
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: X and Y

Post by 1024MAK »

PRINT AT line, column

E.g.
PRINT AT 11,15;”Hi”
will print Hi in the middle of the screen.

PRINT AT 0,0;
will set the current print position to the top left corner.

PRINT AT is shown in the manual here.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: X and Y

Post by XavSnap »

Hi,

I had to diet a Spectrum program, to add a display routine in it.
I had to delete all "PRINT AT" to retrieve memory rooms…

http://zx81.ordi5.free.fr/sacha/downloa ... _ATOME.zip

I just use the specials display characters:
Print AT 14,15 ( 1+7+1+7= 16 bytes) (+4 bytes if you had to cut a text line: ";AT 14,15;" )
\{22}\{14}\{15} (3 bytes)
Where \{22}=CHR$(22) \{14}=Y AND \{15}=X

SCpos$=CHR$(22) +CHR$(14)+ CHR$(15) >> Print AT 14,15;"HELLO WORLD" ==PRINT SCpos$;"HELLO WORLD"

But, you can't replace all AT functions in the main Basic Editor. You had to run my updated "ZmakeBas" release !
It able to add binaries in texts.

"ZmakeBas" and examples enclosed in the "Galagor" zipped file.
:ugeek:
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Crayon21
Posts: 348
Joined: Sun Nov 04, 2018 2:33 am

Re: X and Y

Post by Crayon21 »

Is there some sort of Graph Paper reference as far as direction.

10,10 is center and 0,0 is top left, what direction or placement are the others? :?:
In Heck, there are two options for perpetual torment:

Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
:twisted:
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: X and Y

Post by XavSnap »

1024MAK wrote: Sun Jun 16, 2019 12:22 pm PRINT AT is shown in the manual here.
??? Arrhg … the famous "Have a look to the fucking manual"...
what direction or placement are the others?
Elementary my dear Watson: all around the center !
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
1024MAK
Posts: 5103
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: X and Y

Post by 1024MAK »

Try...

Code: Select all

10 CLS
20 FOR C=0 TO 31 STEP 8
30 FOR L=0 TO 21
40 PRINT AT L,C;L;“ ”;C
50 NEXT L
60 NEXT C
70 PAUSE 4E4
[Works on both the ZX Spectrum and the ZX81, but the Zeddy takes a bit longer...]

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
1024MAK
Posts: 5103
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: X and Y

Post by 1024MAK »

Also try...
[ZX Spectrum version]

Code: Select all

10 FOR A=0 TO 1 STEP 0
20 CLS
30 INPUT “Line number? ”;L
40 INPUT “Column number? ”;C
50 PRINT AT L,C;”O”
60 PAUSE 4E4
70 NEXT A
[ZX81 version]

Code: Select all

10 FOR A=0 TO 1 STEP 0
20 CLS
30 PRINT AT 21,0;“LINE NUMBER”
40 INPUT L
50 PRINT AT 21,0;“COLUMN NUMBER”
60 INPUT C
70 CLS
80 PRINT AT L,C;”O”
90 PAUSE 4E4
100 NEXT A
With both, type the keyword STOP in the input line to stop.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
Crayon21
Posts: 348
Joined: Sun Nov 04, 2018 2:33 am

Re: X and Y

Post by Crayon21 »

what are all the numbers for? positions? kinda lost here
In Heck, there are two options for perpetual torment:

Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
:twisted:
Post Reply