What exactly do Plot and Unplot do?

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Freya
Posts: 16
Joined: Tue Feb 14, 2023 7:45 pm

What exactly do Plot and Unplot do?

Post by Freya »

I'm familiar with sinclair basic on the zx spectrum but wondered about the zx81 plot/unplot commands.
They don't appear to work at the pixel level so I'm wondering how they are different to Print At with the semigraphics/Block Graphics?
There isn't even a draw command on the zx81 so what is it all about and why would you need it or want to use it?

Freya
dr beep
Posts: 2077
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: What exactly do Plot and Unplot do?

Post by dr beep »

A character can also be 4 pixels. a bit like character 129 to 143 on the ZX Spectrum.

PLOT will set the large pixels in a character on the screen.
Since the screen is character based you can't plot a pixel at the position of a character unless the character is the graphical character 0 to 7 or 128 to 135.

UNPLOT will erase the plotted pixel.
dr beep
Posts: 2077
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: What exactly do Plot and Unplot do?

Post by dr beep »

Freya wrote: Sun Feb 19, 2023 7:26 pm There isn't even a draw command on the zx81 so what is it all about and why would you need it or want to use it?
I am not coding in BASIC, but in machinecode I am using my own PLOT function when I need pixels on the screen.
Also my own DRAW or vectormovement of a ball like in BREAKOUT.

See my 10= game or DIGgIT for pixel examples.the
10= the ball
DIGgIT boulders are PLOTTED.
User avatar
GCHarder
Posts: 428
Joined: Sat Dec 14, 2013 7:46 pm

Re: What exactly do Plot and Unplot do?

Post by GCHarder »

PLOT and UNPLOT work as expected except the plot coordinates are 64x48 instead of 256x192.

Regards;

Greg

PS actually the PLOT coords are 64x44 but can be increased to 48 easily with MC.
Freya
Posts: 16
Joined: Tue Feb 14, 2023 7:45 pm

Re: What exactly do Plot and Unplot do?

Post by Freya »

dr beep wrote: Sun Feb 19, 2023 7:44 pm A character can also be 4 pixels. a bit like character 129 to 143 on the ZX Spectrum.

PLOT will set the large pixels in a character on the screen.
Since the screen is character based you can't plot a pixel at the position of a character unless the character is the graphical character 0 to 7 or 128 to 135.

UNPLOT will erase the plotted pixel.
But how is this different to using Print AT when you have a char based display file?
I'm wondering what was the point of the plot keyword at all on the zx81.
Couldn't you do exactly the same thing with Print AT?

Freya
Freya
Posts: 16
Joined: Tue Feb 14, 2023 7:45 pm

Re: What exactly do Plot and Unplot do?

Post by Freya »

GCHarder wrote: Sun Feb 19, 2023 11:31 pm PLOT and UNPLOT work as expected except the plot coordinates are 64x48 instead of 256x192.

Regards;

Greg

PS actually the PLOT coords are 64x44 but can be increased to 48 easily with MC.
Thanks Greg,
So basically it's just printing block graphics with a different coordinate system than Print AT?
Kind of a shame they didn't implement DRAW or CIRCLE as then it would all seem to make a lot more sense.
User avatar
1024MAK
Posts: 5118
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: What exactly do Plot and Unplot do?

Post by 1024MAK »

Freya wrote: Mon Feb 20, 2023 12:42 am Kind of a shame they didn't implement DRAW or CIRCLE as then it would all seem to make a lot more sense.
No room left in ROM. As it is, some commands and functions were dropped.

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.
Whitey
Posts: 22
Joined: Sat Jan 21, 2023 10:28 pm

Re: What exactly do Plot and Unplot do?

Post by Whitey »

So caveated by the fact I'm only a couple of weeks back into the zx81 so I may be well off, my thought was if you're purely talking about making a picture there is probably little difference however if you're showing the outcome of mathematical calculations like a circle or a graph you have 4 possible plot locations for each print at coordinate. To cover this there are 14 seperate graphical characters required via print at to cover each possible permutation of those 4 plot positions
You'd also need some logic applied to determine which graphical character is required to cover the permutation your calculated result requires.
By the time you've programmed how to work out which graphic character you need to print and where its far easier and quicker to use plot /unplot.

Hope that makes sense.....and is correct!
dr beep
Posts: 2077
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: What exactly do Plot and Unplot do?

Post by dr beep »

Whitey wrote: Mon Feb 20, 2023 9:18 am By the time you've programmed how to work out which graphic character you need to print and where its far easier and quicker to use plot /unplot.

Hope that makes sense.....and is correct!
So true, especially when you PLOT or UNPLOT position 4
12
34
User avatar
XavSnap
Posts: 1941
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: What exactly do Plot and Unplot do?

Post by XavSnap »

functions were dropped.
I read somewhere, Sinclair planned to add a DATA/READ ASM routine in the first ROM project.
But, this routine was replaced by the LPRINT routine to drive the ZxPrinter...
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Post Reply